@phila/layerboard 3.0.1-beta.1 → 3.1.0
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.js +2 -2
- package/dist/index.mjs +990 -986
- package/dist/layerboard.css +1 -1
- package/package.json +5 -4
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as be, ref as E, watch as le, computed as $, nextTick as et, onMounted as ut, onUnmounted as Zt, createElementBlock as L, openBlock as
|
|
1
|
+
import { defineComponent as be, ref as E, watch as le, computed as $, nextTick as et, onMounted as ut, onUnmounted as Zt, createElementBlock as L, openBlock as _, createVNode as ee, unref as y, withCtx as rt, createBlock as K, createCommentVNode as Z, Fragment as ke, renderList as Ae, toRef as ot, h as Li, useAttrs as Ai, normalizeClass as me, createElementVNode as D, toDisplayString as Q, withModifiers as hi, renderSlot as Se, withDirectives as pi, mergeProps as _t, vModelDynamic as Ii, createTextVNode as Ve, isRef as Mi, readonly as W, normalizeProps as Jt, guardReactiveProps as Qt, normalizeStyle as we, provide as H, onBeforeUnmount as Di, useId as ei, resolveComponent as Ti, vShow as Bi } from "vue";
|
|
2
2
|
import { Map as Vi, DrawTool as Pi, RasterLayer as ti, CircleLayer as ii, FillLayer as si, LineLayer as Rt, MapMarker as Oi, MapPopup as Ri } from "@phila/phila-ui-map-core";
|
|
3
3
|
import { cn as Nt, Icon as Te, BaseLink as $i, ActionContent as ai } from "@phila/phila-ui-core";
|
|
4
4
|
const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
@@ -23,22 +23,22 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
23
23
|
initialCenter: { default: void 0 }
|
|
24
24
|
},
|
|
25
25
|
emits: ["zoom", "layerLoading", "layerError"],
|
|
26
|
-
setup(
|
|
27
|
-
const t =
|
|
26
|
+
setup(a, { emit: e }) {
|
|
27
|
+
const t = a, i = e, s = E(null), n = E(null), o = E(0);
|
|
28
28
|
function u(l) {
|
|
29
29
|
i("zoom", l), n.value && (o.value = c(n.value));
|
|
30
30
|
}
|
|
31
31
|
function c(l) {
|
|
32
|
-
const
|
|
33
|
-
return S * Math.cos(B) / Math.pow(2,
|
|
32
|
+
const g = l.getZoom(), C = l.getCenter().lat, S = 559082264028e-3, B = C * Math.PI / 180;
|
|
33
|
+
return S * Math.cos(B) / Math.pow(2, g);
|
|
34
34
|
}
|
|
35
|
-
const h = E({}), d = E(null),
|
|
36
|
-
async function r(l,
|
|
35
|
+
const h = E({}), d = E(null), m = E(/* @__PURE__ */ new Set());
|
|
36
|
+
async function r(l, g, p, C, S) {
|
|
37
37
|
const B = encodeURIComponent(C || "1=1"), j = JSON.stringify({
|
|
38
|
-
xmin:
|
|
39
|
-
ymin:
|
|
40
|
-
xmax:
|
|
41
|
-
ymax:
|
|
38
|
+
xmin: g.west,
|
|
39
|
+
ymin: g.south,
|
|
40
|
+
xmax: g.east,
|
|
41
|
+
ymax: g.north,
|
|
42
42
|
spatialReference: { wkid: 4326 }
|
|
43
43
|
}), ae = S !== void 0 && S < 14 ? `&maxAllowableOffset=${360 / (Math.pow(2, S) * 512)}` : "", ie = 2e3;
|
|
44
44
|
let Ce = 0, Le = [], ve = !0;
|
|
@@ -62,8 +62,8 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
62
62
|
features: Le
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
-
async function
|
|
66
|
-
const C =
|
|
65
|
+
async function f(l, g, p) {
|
|
66
|
+
const C = g.map(async (S) => {
|
|
67
67
|
const B = t.layerList.find((j) => j.config.id === S)?.config;
|
|
68
68
|
if (B) {
|
|
69
69
|
i("layerLoading", S, !0);
|
|
@@ -80,27 +80,27 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
80
80
|
});
|
|
81
81
|
await Promise.all(C);
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
const
|
|
83
|
+
function v(l) {
|
|
84
|
+
const g = new Set(l);
|
|
85
85
|
for (const p of t.layerList)
|
|
86
|
-
p.config.parentId &&
|
|
87
|
-
return [...
|
|
86
|
+
p.config.parentId && g.has(p.config.parentId) && g.add(p.config.id);
|
|
87
|
+
return [...g];
|
|
88
88
|
}
|
|
89
|
-
async function k(l,
|
|
90
|
-
const p =
|
|
91
|
-
await
|
|
89
|
+
async function k(l, g) {
|
|
90
|
+
const p = v([...t.visibleLayers]);
|
|
91
|
+
await f(l, p, g);
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function b(l) {
|
|
94
94
|
d.value = l.bounds, k(l.bounds, l.zoom);
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function A(l) {
|
|
97
97
|
n.value = l;
|
|
98
|
-
const
|
|
98
|
+
const g = l.getBounds();
|
|
99
99
|
d.value = {
|
|
100
|
-
west:
|
|
101
|
-
south:
|
|
102
|
-
east:
|
|
103
|
-
north:
|
|
100
|
+
west: g.getWest(),
|
|
101
|
+
south: g.getSouth(),
|
|
102
|
+
east: g.getEast(),
|
|
103
|
+
north: g.getNorth()
|
|
104
104
|
};
|
|
105
105
|
const p = l.getZoom();
|
|
106
106
|
i("zoom", p), o.value = c(l), k(d.value, p);
|
|
@@ -109,45 +109,45 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
109
109
|
() => t.visibleLayers,
|
|
110
110
|
async () => {
|
|
111
111
|
if (ge.value.length > 0 && Ze(), d.value) {
|
|
112
|
-
const l = new Set(t.visibleLayers),
|
|
113
|
-
|
|
114
|
-
const p =
|
|
112
|
+
const l = new Set(t.visibleLayers), g = [...l].filter((C) => !m.value.has(C));
|
|
113
|
+
m.value = new Set(l);
|
|
114
|
+
const p = v(g);
|
|
115
115
|
if (p.length > 0) {
|
|
116
116
|
const C = n.value?.getZoom();
|
|
117
|
-
await
|
|
117
|
+
await f(d.value, p, C);
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
);
|
|
122
|
-
function
|
|
122
|
+
function I(l) {
|
|
123
123
|
if (t.visibleLayers.has(l)) return !0;
|
|
124
|
-
const
|
|
125
|
-
return !!
|
|
124
|
+
const g = t.layerList.find((p) => p.config.id === l)?.config;
|
|
125
|
+
return !!g?.parentId && t.visibleLayers.has(g.parentId);
|
|
126
126
|
}
|
|
127
127
|
function z(l) {
|
|
128
128
|
return !!h.value[l.id];
|
|
129
129
|
}
|
|
130
|
-
const
|
|
131
|
-
() => t.layerList.filter((l) => l.config.type === "circle" &&
|
|
130
|
+
const M = $(
|
|
131
|
+
() => t.layerList.filter((l) => l.config.type === "circle" && I(l.config.id) && z(l.config)).map((l) => l.config)
|
|
132
132
|
), T = $(
|
|
133
|
-
() => t.layerList.filter((l) => l.config.type === "fill" &&
|
|
133
|
+
() => t.layerList.filter((l) => l.config.type === "fill" && I(l.config.id) && z(l.config)).map((l) => l.config)
|
|
134
134
|
), R = $(
|
|
135
135
|
() => t.layerList.filter(
|
|
136
|
-
(l) => l.config.type === "fill" && l.config.outlinePaint &&
|
|
136
|
+
(l) => l.config.type === "fill" && l.config.outlinePaint && I(l.config.id) && z(l.config)
|
|
137
137
|
).map((l) => l.config)
|
|
138
138
|
), se = $(
|
|
139
|
-
() => t.layerList.filter((l) => l.config.type === "line" &&
|
|
139
|
+
() => t.layerList.filter((l) => l.config.type === "line" && I(l.config.id) && z(l.config)).map((l) => l.config)
|
|
140
140
|
);
|
|
141
141
|
le(se, async (l) => {
|
|
142
142
|
if (l.length < 2) return;
|
|
143
143
|
await et();
|
|
144
|
-
const
|
|
145
|
-
if (!
|
|
144
|
+
const g = n.value;
|
|
145
|
+
if (!g) return;
|
|
146
146
|
const p = [...l].sort((C, S) => (C.zOrder ?? 0) - (S.zOrder ?? 0));
|
|
147
147
|
for (let C = p.length - 1; C >= 0; C--) {
|
|
148
148
|
const S = C < p.length - 1 ? p[C + 1].id : "highlight-lines";
|
|
149
149
|
try {
|
|
150
|
-
|
|
150
|
+
g.getLayer(p[C].id) && g.moveLayer(p[C].id, S);
|
|
151
151
|
} catch {
|
|
152
152
|
}
|
|
153
153
|
}
|
|
@@ -174,7 +174,7 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
174
174
|
if (!ht.value.has(l.id)) {
|
|
175
175
|
ht.value.add(l.id);
|
|
176
176
|
try {
|
|
177
|
-
const
|
|
177
|
+
const g = l.url.replace(/\/$/, ""), p = await fetch(`${g}?f=json`);
|
|
178
178
|
if (!p.ok)
|
|
179
179
|
return;
|
|
180
180
|
const C = await p.json(), S = C.minScale || 0;
|
|
@@ -198,13 +198,13 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
198
198
|
function pt(l) {
|
|
199
199
|
if (!l.scaleBasedRendering)
|
|
200
200
|
return "tiled";
|
|
201
|
-
const
|
|
202
|
-
if (!
|
|
201
|
+
const g = tt.value[l.id];
|
|
202
|
+
if (!g)
|
|
203
203
|
return "tiled";
|
|
204
204
|
const p = o.value;
|
|
205
|
-
return p === 0 || p >
|
|
205
|
+
return p === 0 || p > g.maxScale ? "tiled" : "dynamic";
|
|
206
206
|
}
|
|
207
|
-
const Mt = $(() => t.tiledLayers ? t.tiledLayers.filter((l) => q(l.id) ? l.scaleBasedRendering ? pt(l) === "tiled" : !0 : !1) : []),
|
|
207
|
+
const Mt = $(() => t.tiledLayers ? t.tiledLayers.filter((l) => q(l.id) ? l.scaleBasedRendering ? pt(l) === "tiled" : !0 : !1) : []), He = $(() => t.tiledLayers ? t.tiledLayers.filter((l) => q(l.id) && l.scaleBasedRendering ? pt(l) === "dynamic" : !1) : []);
|
|
208
208
|
function st(l) {
|
|
209
209
|
return {
|
|
210
210
|
type: "raster",
|
|
@@ -220,17 +220,17 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
220
220
|
return t.layerOpacities[l] ?? 1;
|
|
221
221
|
}
|
|
222
222
|
function at(l) {
|
|
223
|
-
const
|
|
223
|
+
const g = ze(l.id), p = l.type === "circle" ? "circle-opacity" : l.type === "fill" ? "fill-opacity" : "line-opacity";
|
|
224
224
|
if (l.type === "fill" && l.paint["fill-opacity"] === 0)
|
|
225
225
|
return { ...l.paint, "fill-opacity": 0 };
|
|
226
226
|
const C = l.type === "circle" ? "circle-color" : l.type === "fill" ? "fill-color" : "line-color", S = { ...l.paint }, B = S[C], j = S[p] === 1, ae = typeof B == "string" && B.startsWith("rgba(");
|
|
227
227
|
if (j && ae) {
|
|
228
|
-
if (
|
|
228
|
+
if (g === 1)
|
|
229
229
|
return S;
|
|
230
230
|
{
|
|
231
231
|
const ie = B.match(/rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)/);
|
|
232
232
|
if (ie && ie[4]) {
|
|
233
|
-
const [, Ce, Le, ve, re] = ie, U = parseFloat(re) *
|
|
233
|
+
const [, Ce, Le, ve, re] = ie, U = parseFloat(re) * g;
|
|
234
234
|
S[C] = `rgba(${Ce}, ${Le}, ${ve}, ${U})`, S[p] = 1;
|
|
235
235
|
}
|
|
236
236
|
return S;
|
|
@@ -243,33 +243,33 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
243
243
|
S[C] = `rgb(${Ce}, ${Le}, ${ve})`;
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
|
-
return S[p] =
|
|
246
|
+
return S[p] = g, S;
|
|
247
247
|
}
|
|
248
248
|
function Dt(l) {
|
|
249
|
-
const
|
|
250
|
-
return { ...l.outlinePaint, "line-opacity":
|
|
249
|
+
const g = ze(l.id);
|
|
250
|
+
return { ...l.outlinePaint, "line-opacity": g };
|
|
251
251
|
}
|
|
252
252
|
const ge = E([]), Ue = E(null), ce = E(0);
|
|
253
253
|
function We(l) {
|
|
254
|
-
const
|
|
255
|
-
return t.layerList.find((C) => C.config.id ===
|
|
254
|
+
const g = l.replace(/-outline$/, "");
|
|
255
|
+
return t.layerList.find((C) => C.config.id === g)?.config;
|
|
256
256
|
}
|
|
257
|
-
function ft(l,
|
|
257
|
+
function ft(l, g) {
|
|
258
258
|
return l.replace(/\{([^}]+)\}/g, (p, C) => {
|
|
259
|
-
const S =
|
|
259
|
+
const S = g[C];
|
|
260
260
|
return S == null ? "" : String(S);
|
|
261
261
|
});
|
|
262
262
|
}
|
|
263
263
|
function Fe(l) {
|
|
264
264
|
return l.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
265
265
|
}
|
|
266
|
-
function nt(l,
|
|
266
|
+
function nt(l, g, p) {
|
|
267
267
|
if (l == null) return "-";
|
|
268
|
-
if (
|
|
268
|
+
if (g?.dateFormat && typeof l == "number") {
|
|
269
269
|
const C = new Date(l);
|
|
270
|
-
if (p &&
|
|
270
|
+
if (p && g.dateFormat === "shortDateShortTime")
|
|
271
271
|
return C.toLocaleString(void 0, { dateStyle: "short", timeStyle: "short" });
|
|
272
|
-
switch (
|
|
272
|
+
switch (g.dateFormat) {
|
|
273
273
|
case "shortDateShortTime":
|
|
274
274
|
return C.toLocaleDateString();
|
|
275
275
|
case "longMonthDayYear":
|
|
@@ -283,9 +283,9 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
if (typeof l == "number") {
|
|
286
|
-
if (l > 1e12 && !
|
|
286
|
+
if (l > 1e12 && !g)
|
|
287
287
|
return new Date(l).toLocaleDateString();
|
|
288
|
-
const C =
|
|
288
|
+
const C = g?.places, S = g?.digitSeparator ?? !0;
|
|
289
289
|
if (C !== void 0) {
|
|
290
290
|
if (Number.isInteger(l) && C >= 0)
|
|
291
291
|
return String(l);
|
|
@@ -301,16 +301,16 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
301
301
|
return String(l);
|
|
302
302
|
}
|
|
303
303
|
function mt(l) {
|
|
304
|
-
const
|
|
304
|
+
const g = /* @__PURE__ */ new Set();
|
|
305
305
|
return l.filter((p) => {
|
|
306
306
|
const S = `${p.layer.id.replace(/-outline$/, "")}:${JSON.stringify(p.properties)}`;
|
|
307
|
-
return
|
|
307
|
+
return g.has(S) ? !1 : (g.add(S), !0);
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
|
-
function Me(l,
|
|
310
|
+
function Me(l, g) {
|
|
311
311
|
const p = h.value[l];
|
|
312
312
|
if (!p?.features) return null;
|
|
313
|
-
const C =
|
|
313
|
+
const C = g.objectid ?? g.OBJECTID ?? g.FID;
|
|
314
314
|
if (C != null) {
|
|
315
315
|
const S = p.features.find(
|
|
316
316
|
(B) => (B.properties?.objectid ?? B.properties?.OBJECTID ?? B.properties?.FID) === C
|
|
@@ -319,9 +319,9 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
319
319
|
}
|
|
320
320
|
return null;
|
|
321
321
|
}
|
|
322
|
-
function Tt(l,
|
|
322
|
+
function Tt(l, g) {
|
|
323
323
|
const p = /* @__PURE__ */ new Map();
|
|
324
|
-
return
|
|
324
|
+
return g.forEach((C, S) => {
|
|
325
325
|
p.set(C.id, S);
|
|
326
326
|
}), l.sort((C, S) => {
|
|
327
327
|
const B = C.layer.id.replace(/-outline$/, ""), j = S.layer.id.replace(/-outline$/, ""), ae = p.get(B) ?? -1;
|
|
@@ -329,19 +329,19 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
329
329
|
});
|
|
330
330
|
}
|
|
331
331
|
function de(l) {
|
|
332
|
-
const
|
|
333
|
-
if (!
|
|
332
|
+
const g = n.value;
|
|
333
|
+
if (!g) return;
|
|
334
334
|
const p = [];
|
|
335
335
|
t.layerList.forEach((U) => {
|
|
336
336
|
const J = U.config;
|
|
337
|
-
|
|
337
|
+
I(J.id) && (p.push(J.id), J.outlinePaint && p.push(`${J.id}-outline`));
|
|
338
338
|
});
|
|
339
|
-
const C = p.filter((U) =>
|
|
339
|
+
const C = p.filter((U) => g.getLayer(U));
|
|
340
340
|
if (C.length === 0) return;
|
|
341
|
-
const S =
|
|
341
|
+
const S = g.project([l.lngLat.lng, l.lngLat.lat]), B = 10, j = [
|
|
342
342
|
[S.x - B, S.y - B],
|
|
343
343
|
[S.x + B, S.y + B]
|
|
344
|
-
], ae =
|
|
344
|
+
], ae = g.queryRenderedFeatures(j, {
|
|
345
345
|
layers: C
|
|
346
346
|
});
|
|
347
347
|
if (ae.length === 0) return;
|
|
@@ -370,7 +370,7 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
370
370
|
if (re) {
|
|
371
371
|
const U = We(re.layerId);
|
|
372
372
|
if (U) {
|
|
373
|
-
const J = te(re.geometry), ye =
|
|
373
|
+
const J = te(re.geometry), ye = G(U.id, U.type);
|
|
374
374
|
F.value = {
|
|
375
375
|
geometry: re.geometry,
|
|
376
376
|
geometryType: J,
|
|
@@ -386,8 +386,8 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
386
386
|
}
|
|
387
387
|
function je(l) {
|
|
388
388
|
if (ge.value.length === 0) return;
|
|
389
|
-
const
|
|
390
|
-
if (!(
|
|
389
|
+
const g = l.target;
|
|
390
|
+
if (!(g.tagName === "INPUT" || g.tagName === "TEXTAREA" || g.isContentEditable))
|
|
391
391
|
switch (l.key) {
|
|
392
392
|
case "ArrowLeft":
|
|
393
393
|
case "ArrowUp":
|
|
@@ -420,16 +420,16 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
420
420
|
}), Ye = $(() => {
|
|
421
421
|
const l = he.value;
|
|
422
422
|
if (!l) return "";
|
|
423
|
-
let
|
|
424
|
-
if (
|
|
425
|
-
|
|
423
|
+
let g = '<div class="popup-content">';
|
|
424
|
+
if (g += `<h3 class="popup-title">${Fe(Ke.value)}</h3>`, l.popupConfig?.fields?.length) {
|
|
425
|
+
g += `<table class="popup-table" aria-label="${Fe(Ke.value)}">`;
|
|
426
426
|
for (const p of l.popupConfig.fields) {
|
|
427
427
|
const C = nt(l.properties[p.field], p.format, l.popupConfig.showTime), S = p.label.toLowerCase(), B = S.includes("url") || S.includes("website"), j = C.startsWith("http://") || C.startsWith("https://") || C.startsWith("www.") || B && C.includes("."), ae = C.startsWith("http://") || C.startsWith("https://") ? C : `https://${C}`, ie = j ? `<a href="${Fe(ae)}" target="_blank" rel="noopener noreferrer">${Fe(C)}</a>` : Fe(C);
|
|
428
|
-
|
|
428
|
+
g += `<tr><th scope="row">${Fe(p.label)}</th><td>${ie}</td></tr>`;
|
|
429
429
|
}
|
|
430
|
-
|
|
430
|
+
g += "</table>";
|
|
431
431
|
}
|
|
432
|
-
return
|
|
432
|
+
return g += "</div>", g;
|
|
433
433
|
}), pe = E({
|
|
434
434
|
type: "FeatureCollection",
|
|
435
435
|
features: []
|
|
@@ -456,15 +456,15 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
456
456
|
function te(l) {
|
|
457
457
|
return l.type;
|
|
458
458
|
}
|
|
459
|
-
function
|
|
459
|
+
function G(l, g) {
|
|
460
460
|
const p = We(l);
|
|
461
461
|
if (!p) return { radius: 5, width: 2 };
|
|
462
462
|
const C = p.paint || {};
|
|
463
|
-
if (
|
|
463
|
+
if (g === "circle") {
|
|
464
464
|
const S = C["circle-radius"];
|
|
465
465
|
return typeof S == "number" ? { radius: S } : { radius: 5 };
|
|
466
466
|
}
|
|
467
|
-
if (
|
|
467
|
+
if (g === "line" || g === "fill") {
|
|
468
468
|
const S = C["line-width"];
|
|
469
469
|
if (typeof S == "number")
|
|
470
470
|
return { width: S };
|
|
@@ -481,7 +481,7 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
481
481
|
return !l || l.length === 0 ? [] : l[0] ?? [];
|
|
482
482
|
}
|
|
483
483
|
function xe(l) {
|
|
484
|
-
const { geometry:
|
|
484
|
+
const { geometry: g, geometryType: p, originalStyle: C } = l;
|
|
485
485
|
if (p === "Point" || p === "MultiPoint") {
|
|
486
486
|
const B = (C.radius || 5) + 3;
|
|
487
487
|
return {
|
|
@@ -489,7 +489,7 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
489
489
|
features: [
|
|
490
490
|
{
|
|
491
491
|
type: "Feature",
|
|
492
|
-
geometry:
|
|
492
|
+
geometry: g,
|
|
493
493
|
properties: {
|
|
494
494
|
highlightRadius: B
|
|
495
495
|
}
|
|
@@ -504,7 +504,7 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
504
504
|
features: [
|
|
505
505
|
{
|
|
506
506
|
type: "Feature",
|
|
507
|
-
geometry:
|
|
507
|
+
geometry: g,
|
|
508
508
|
properties: {
|
|
509
509
|
highlightWidth: B
|
|
510
510
|
}
|
|
@@ -513,7 +513,7 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
513
513
|
};
|
|
514
514
|
}
|
|
515
515
|
if (p === "Polygon") {
|
|
516
|
-
const S =
|
|
516
|
+
const S = g.coordinates, B = X(S), ae = (C.width || 2) + 3;
|
|
517
517
|
return {
|
|
518
518
|
type: "FeatureCollection",
|
|
519
519
|
features: [
|
|
@@ -531,7 +531,7 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
531
531
|
};
|
|
532
532
|
}
|
|
533
533
|
if (p === "MultiPolygon") {
|
|
534
|
-
const S =
|
|
534
|
+
const S = g.coordinates, j = (C.width || 2) + 3;
|
|
535
535
|
return {
|
|
536
536
|
type: "FeatureCollection",
|
|
537
537
|
features: S.map((ie) => ({
|
|
@@ -552,10 +552,10 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
552
552
|
};
|
|
553
553
|
}
|
|
554
554
|
function Qe(l) {
|
|
555
|
-
const { geometry:
|
|
555
|
+
const { geometry: g, geometryType: p } = l;
|
|
556
556
|
return p === "Polygon" || p === "MultiPolygon" ? {
|
|
557
557
|
type: "FeatureCollection",
|
|
558
|
-
features: [{ type: "Feature", geometry:
|
|
558
|
+
features: [{ type: "Feature", geometry: g, properties: {} }]
|
|
559
559
|
} : { type: "FeatureCollection", features: [] };
|
|
560
560
|
}
|
|
561
561
|
function Ei(l) {
|
|
@@ -563,8 +563,8 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
563
563
|
Fi();
|
|
564
564
|
return;
|
|
565
565
|
}
|
|
566
|
-
const
|
|
567
|
-
l.geometryType === "Point" || l.geometryType === "MultiPoint" ? (pe.value =
|
|
566
|
+
const g = xe(l);
|
|
567
|
+
l.geometryType === "Point" || l.geometryType === "MultiPoint" ? (pe.value = g, Xe.value = { type: "FeatureCollection", features: [] }, Je.value = { type: "FeatureCollection", features: [] }) : (Xe.value = g, pe.value = { type: "FeatureCollection", features: [] }, Je.value = Qe(l));
|
|
568
568
|
}
|
|
569
569
|
function Fi() {
|
|
570
570
|
pe.value = { type: "FeatureCollection", features: [] }, Xe.value = { type: "FeatureCollection", features: [] }, Je.value = { type: "FeatureCollection", features: [] };
|
|
@@ -583,13 +583,13 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
583
583
|
F.value = null;
|
|
584
584
|
return;
|
|
585
585
|
}
|
|
586
|
-
const
|
|
587
|
-
if (
|
|
588
|
-
const p = te(l.geometry), C =
|
|
586
|
+
const g = We(l.layerId);
|
|
587
|
+
if (g) {
|
|
588
|
+
const p = te(l.geometry), C = G(g.id, g.type);
|
|
589
589
|
F.value = {
|
|
590
590
|
geometry: l.geometry,
|
|
591
591
|
geometryType: p,
|
|
592
|
-
layerId:
|
|
592
|
+
layerId: g.id,
|
|
593
593
|
properties: l.properties,
|
|
594
594
|
originalStyle: C
|
|
595
595
|
};
|
|
@@ -597,19 +597,19 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
597
597
|
});
|
|
598
598
|
const Yt = E(null);
|
|
599
599
|
function xi(l) {
|
|
600
|
-
const [
|
|
601
|
-
Yt.value = [
|
|
600
|
+
const [g, p] = l.geometry.coordinates;
|
|
601
|
+
Yt.value = [g, p];
|
|
602
602
|
}
|
|
603
|
-
return (l,
|
|
603
|
+
return (l, g) => (_(), L("div", Ni, [
|
|
604
604
|
ee(y(Vi), {
|
|
605
605
|
ref_key: "mapRef",
|
|
606
|
-
ref:
|
|
606
|
+
ref: s,
|
|
607
607
|
zoom: t.initialZoom,
|
|
608
608
|
center: t.initialCenter,
|
|
609
609
|
"navigation-controls": { position: t.navigationControlPosition },
|
|
610
610
|
"geolocation-control": { position: t.geolocationControlPosition },
|
|
611
611
|
"basemap-change-controls": { toggle: !0, dropdown: !0, position: t.basemapControlPosition },
|
|
612
|
-
"map-search-control": { position: t.searchControlPosition },
|
|
612
|
+
"map-search-control": { position: t.searchControlPosition, autocomplete: !0 },
|
|
613
613
|
"enable-cyclomedia": !0,
|
|
614
614
|
"cyclomedia-config": t.cyclomediaConfig,
|
|
615
615
|
"cyclomedia-button-position": t.cyclomediaButtonPosition,
|
|
@@ -620,16 +620,16 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
620
620
|
"tool-panel-split-ratio": 50,
|
|
621
621
|
onZoom: u,
|
|
622
622
|
onClick: Ze,
|
|
623
|
-
onMoveend:
|
|
624
|
-
onLoad:
|
|
623
|
+
onMoveend: b,
|
|
624
|
+
onLoad: A,
|
|
625
625
|
onSearchResult: xi
|
|
626
626
|
}, {
|
|
627
627
|
default: rt(() => [
|
|
628
|
-
t.drawControlPosition !== null ? (
|
|
628
|
+
t.drawControlPosition !== null ? (_(), K(y(Pi), {
|
|
629
629
|
key: 0,
|
|
630
630
|
position: t.drawControlPosition
|
|
631
631
|
}, null, 8, ["position"])) : Z("", !0),
|
|
632
|
-
(
|
|
632
|
+
(_(!0), L(ke, null, Ae(Mt.value, (p) => (_(), K(y(ti), {
|
|
633
633
|
id: "tiled-" + p.id,
|
|
634
634
|
key: "tiled-" + p.id,
|
|
635
635
|
source: Ne(p),
|
|
@@ -638,7 +638,7 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
638
638
|
maxzoom: p.maxZoom,
|
|
639
639
|
"before-id": "highlight-circles"
|
|
640
640
|
}, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
|
|
641
|
-
(
|
|
641
|
+
(_(!0), L(ke, null, Ae(He.value, (p) => (_(), K(y(ti), {
|
|
642
642
|
id: "dynamic-" + p.id,
|
|
643
643
|
key: "dynamic-" + p.id,
|
|
644
644
|
source: st(p),
|
|
@@ -647,7 +647,7 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
647
647
|
maxzoom: p.maxZoom,
|
|
648
648
|
"before-id": "highlight-circles"
|
|
649
649
|
}, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
|
|
650
|
-
(
|
|
650
|
+
(_(!0), L(ke, null, Ae(M.value, (p) => (_(), K(y(ii), {
|
|
651
651
|
id: p.id,
|
|
652
652
|
key: p.id,
|
|
653
653
|
source: Re(p),
|
|
@@ -657,7 +657,7 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
657
657
|
"before-id": "highlight-circles",
|
|
658
658
|
onClick: de
|
|
659
659
|
}, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
|
|
660
|
-
(
|
|
660
|
+
(_(!0), L(ke, null, Ae(T.value, (p) => (_(), K(y(si), {
|
|
661
661
|
id: p.id,
|
|
662
662
|
key: p.id,
|
|
663
663
|
source: Re(p),
|
|
@@ -667,7 +667,7 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
667
667
|
"before-id": "highlight-circles",
|
|
668
668
|
onClick: de
|
|
669
669
|
}, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
|
|
670
|
-
(
|
|
670
|
+
(_(!0), L(ke, null, Ae(R.value, (p) => (_(), K(y(Rt), {
|
|
671
671
|
id: p.id + "-outline",
|
|
672
672
|
key: p.id + "-outline",
|
|
673
673
|
source: Re(p),
|
|
@@ -677,7 +677,7 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
677
677
|
"before-id": "highlight-lines",
|
|
678
678
|
onClick: de
|
|
679
679
|
}, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
|
|
680
|
-
(
|
|
680
|
+
(_(!0), L(ke, null, Ae(se.value, (p) => (_(), K(y(Rt), {
|
|
681
681
|
id: p.id,
|
|
682
682
|
key: p.id,
|
|
683
683
|
source: Re(p),
|
|
@@ -709,7 +709,7 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
709
709
|
"lng-lat": Yt.value,
|
|
710
710
|
color: "#2176d2"
|
|
711
711
|
}, null, 8, ["lng-lat"]),
|
|
712
|
-
he.value && Ue.value ? (
|
|
712
|
+
he.value && Ue.value ? (_(), K(y(Ri), {
|
|
713
713
|
key: 1,
|
|
714
714
|
"lng-lat": Ue.value,
|
|
715
715
|
html: Ye.value,
|
|
@@ -728,14 +728,14 @@ const Ni = { class: "map-panel" }, zi = /* @__PURE__ */ be({
|
|
|
728
728
|
}, 8, ["zoom", "center", "navigation-controls", "geolocation-control", "basemap-change-controls", "map-search-control", "cyclomedia-config", "cyclomedia-button-position", "pictometry-credentials", "pictometry-button-position"])
|
|
729
729
|
]));
|
|
730
730
|
}
|
|
731
|
-
}), Oe = (
|
|
732
|
-
const t =
|
|
733
|
-
for (const [i,
|
|
734
|
-
t[i] =
|
|
731
|
+
}), Oe = (a, e) => {
|
|
732
|
+
const t = a.__vccOpts || a;
|
|
733
|
+
for (const [i, s] of e)
|
|
734
|
+
t[i] = s;
|
|
735
735
|
return t;
|
|
736
|
-
}, Ui = /* @__PURE__ */ Oe(zi, [["__scopeId", "data-v-
|
|
737
|
-
function fi(
|
|
738
|
-
let e =
|
|
736
|
+
}, Ui = /* @__PURE__ */ Oe(zi, [["__scopeId", "data-v-d42acf96"]]);
|
|
737
|
+
function fi(a) {
|
|
738
|
+
let e = a.split("?")[0] || a;
|
|
739
739
|
return e = e.replace(/\/query$/, ""), e = e.replace(/\/$/, ""), e = e.replace(/^https?:\/\//, ""), e.toLowerCase();
|
|
740
740
|
}
|
|
741
741
|
const Zi = ["disabled"], ji = /* @__PURE__ */ be({
|
|
@@ -759,15 +759,15 @@ const Zi = ["disabled"], ji = /* @__PURE__ */ be({
|
|
|
759
759
|
src: {},
|
|
760
760
|
svgRaw: {}
|
|
761
761
|
},
|
|
762
|
-
setup(
|
|
763
|
-
const e =
|
|
762
|
+
setup(a) {
|
|
763
|
+
const e = a, t = (o) => "href" in o && o.href !== void 0 || "to" in o && o.to !== void 0, i = $(() => Nt(
|
|
764
764
|
"phila-button",
|
|
765
765
|
`phila-button--${e.variant}`,
|
|
766
766
|
e.size && `is-${e.size}`,
|
|
767
767
|
e.iconOnly && "icon-button",
|
|
768
768
|
e.iconOnly && e.variant === "standard" && "icon-button--standard",
|
|
769
769
|
e.className
|
|
770
|
-
)),
|
|
770
|
+
)), s = $(() => t(e) ? "to" in e && e.to !== void 0 ? {
|
|
771
771
|
to: e.to,
|
|
772
772
|
disabled: e.disabled,
|
|
773
773
|
className: i.value
|
|
@@ -788,7 +788,7 @@ const Zi = ["disabled"], ji = /* @__PURE__ */ be({
|
|
|
788
788
|
size: e.size
|
|
789
789
|
})
|
|
790
790
|
);
|
|
791
|
-
return (o, u) => t(e) ? (
|
|
791
|
+
return (o, u) => t(e) ? (_(), K(y($i), _t({ key: 0 }, { ...s.value, ...o.$attrs }, { role: "button" }), {
|
|
792
792
|
default: rt(() => [
|
|
793
793
|
ee(y(ai), Jt(Qt(n.value)), {
|
|
794
794
|
default: rt(() => [
|
|
@@ -800,7 +800,7 @@ const Zi = ["disabled"], ji = /* @__PURE__ */ be({
|
|
|
800
800
|
}, 16)
|
|
801
801
|
]),
|
|
802
802
|
_: 3
|
|
803
|
-
}, 16)) : (
|
|
803
|
+
}, 16)) : (_(), L("button", _t({
|
|
804
804
|
key: 1,
|
|
805
805
|
type: "button",
|
|
806
806
|
disabled: e.disabled,
|
|
@@ -821,22 +821,22 @@ var qi = {
|
|
|
821
821
|
prefix: "fas",
|
|
822
822
|
iconName: "circle-exclamation",
|
|
823
823
|
icon: [512, 512, ["exclamation-circle"], "f06a", "M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zm0-192a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm0-192c-18.2 0-32.7 15.5-31.4 33.7l7.4 104c.9 12.6 11.4 22.3 23.9 22.3 12.6 0 23-9.7 23.9-22.3l7.4-104c1.3-18.2-13.1-33.7-31.4-33.7z"]
|
|
824
|
-
},
|
|
824
|
+
}, Gi = qi, Hi = {
|
|
825
825
|
prefix: "fas",
|
|
826
826
|
iconName: "xmark",
|
|
827
827
|
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"]
|
|
828
|
-
}, Wi =
|
|
829
|
-
function $e(
|
|
830
|
-
return typeof
|
|
828
|
+
}, Wi = Hi;
|
|
829
|
+
function $e(a) {
|
|
830
|
+
return typeof a == "string" || a instanceof String;
|
|
831
831
|
}
|
|
832
|
-
function ni(
|
|
832
|
+
function ni(a) {
|
|
833
833
|
var e;
|
|
834
|
-
return typeof
|
|
834
|
+
return typeof a == "object" && a != null && (a == null || (e = a.constructor) == null ? void 0 : e.name) === "Object";
|
|
835
835
|
}
|
|
836
|
-
function mi(
|
|
837
|
-
return Array.isArray(e) ? mi(
|
|
838
|
-
let [
|
|
839
|
-
return e(n,
|
|
836
|
+
function mi(a, e) {
|
|
837
|
+
return Array.isArray(e) ? mi(a, (t, i) => e.includes(i)) : Object.entries(a).reduce((t, i) => {
|
|
838
|
+
let [s, n] = i;
|
|
839
|
+
return e(n, s) && (t[s] = n), t;
|
|
840
840
|
}, {});
|
|
841
841
|
}
|
|
842
842
|
const x = {
|
|
@@ -846,42 +846,42 @@ const x = {
|
|
|
846
846
|
RIGHT: "RIGHT",
|
|
847
847
|
FORCE_RIGHT: "FORCE_RIGHT"
|
|
848
848
|
};
|
|
849
|
-
function Ki(
|
|
850
|
-
switch (
|
|
849
|
+
function Ki(a) {
|
|
850
|
+
switch (a) {
|
|
851
851
|
case x.LEFT:
|
|
852
852
|
return x.FORCE_LEFT;
|
|
853
853
|
case x.RIGHT:
|
|
854
854
|
return x.FORCE_RIGHT;
|
|
855
855
|
default:
|
|
856
|
-
return
|
|
856
|
+
return a;
|
|
857
857
|
}
|
|
858
858
|
}
|
|
859
|
-
function $t(
|
|
860
|
-
return
|
|
859
|
+
function $t(a) {
|
|
860
|
+
return a.replace(/([.*+?^=!:${}()|[\]/\\])/g, "\\$1");
|
|
861
861
|
}
|
|
862
|
-
function Ct(
|
|
863
|
-
if (e ===
|
|
864
|
-
const t = Array.isArray(e), i = Array.isArray(
|
|
865
|
-
let
|
|
862
|
+
function Ct(a, e) {
|
|
863
|
+
if (e === a) return !0;
|
|
864
|
+
const t = Array.isArray(e), i = Array.isArray(a);
|
|
865
|
+
let s;
|
|
866
866
|
if (t && i) {
|
|
867
|
-
if (e.length !=
|
|
868
|
-
for (
|
|
867
|
+
if (e.length != a.length) return !1;
|
|
868
|
+
for (s = 0; s < e.length; s++) if (!Ct(e[s], a[s])) return !1;
|
|
869
869
|
return !0;
|
|
870
870
|
}
|
|
871
871
|
if (t != i) return !1;
|
|
872
|
-
if (e &&
|
|
873
|
-
const n = e instanceof Date, o =
|
|
874
|
-
if (n && o) return e.getTime() ==
|
|
872
|
+
if (e && a && typeof e == "object" && typeof a == "object") {
|
|
873
|
+
const n = e instanceof Date, o = a instanceof Date;
|
|
874
|
+
if (n && o) return e.getTime() == a.getTime();
|
|
875
875
|
if (n != o) return !1;
|
|
876
|
-
const u = e instanceof RegExp, c =
|
|
877
|
-
if (u && c) return e.toString() ==
|
|
876
|
+
const u = e instanceof RegExp, c = a instanceof RegExp;
|
|
877
|
+
if (u && c) return e.toString() == a.toString();
|
|
878
878
|
if (u != c) return !1;
|
|
879
879
|
const h = Object.keys(e);
|
|
880
|
-
for (
|
|
881
|
-
for (
|
|
880
|
+
for (s = 0; s < h.length; s++) if (!Object.prototype.hasOwnProperty.call(a, h[s])) return !1;
|
|
881
|
+
for (s = 0; s < h.length; s++) if (!Ct(a[h[s]], e[h[s]])) return !1;
|
|
882
882
|
return !0;
|
|
883
|
-
} else if (e &&
|
|
884
|
-
return e.toString() ===
|
|
883
|
+
} else if (e && a && typeof e == "function" && typeof a == "function")
|
|
884
|
+
return e.toString() === a.toString();
|
|
885
885
|
return !1;
|
|
886
886
|
}
|
|
887
887
|
class Yi {
|
|
@@ -931,44 +931,44 @@ class Yi {
|
|
|
931
931
|
this.oldSelection.end === this.oldSelection.start ? x.RIGHT : x.LEFT;
|
|
932
932
|
}
|
|
933
933
|
}
|
|
934
|
-
function V(
|
|
935
|
-
return new V.InputMask(
|
|
934
|
+
function V(a, e) {
|
|
935
|
+
return new V.InputMask(a, e);
|
|
936
936
|
}
|
|
937
|
-
function gi(
|
|
938
|
-
if (
|
|
939
|
-
return
|
|
937
|
+
function gi(a) {
|
|
938
|
+
if (a == null) throw new Error("mask property should be defined");
|
|
939
|
+
return a instanceof RegExp ? V.MaskedRegExp : $e(a) ? V.MaskedPattern : a === Date ? V.MaskedDate : a === Number ? V.MaskedNumber : Array.isArray(a) || a === Array ? V.MaskedDynamic : V.Masked && a.prototype instanceof V.Masked ? a : V.Masked && a instanceof V.Masked ? a.constructor : a instanceof Function ? V.MaskedFunction : V.Masked;
|
|
940
940
|
}
|
|
941
|
-
function ct(
|
|
942
|
-
if (!
|
|
941
|
+
function ct(a) {
|
|
942
|
+
if (!a) throw new Error("Options in not defined");
|
|
943
943
|
if (V.Masked) {
|
|
944
|
-
if (
|
|
945
|
-
mask:
|
|
944
|
+
if (a.prototype instanceof V.Masked) return {
|
|
945
|
+
mask: a
|
|
946
946
|
};
|
|
947
947
|
const {
|
|
948
948
|
mask: e = void 0,
|
|
949
949
|
...t
|
|
950
|
-
} =
|
|
951
|
-
mask:
|
|
952
|
-
} : ni(
|
|
950
|
+
} = a instanceof V.Masked ? {
|
|
951
|
+
mask: a
|
|
952
|
+
} : ni(a) && a.mask instanceof V.Masked ? a : {};
|
|
953
953
|
if (e) {
|
|
954
954
|
const i = e.mask;
|
|
955
955
|
return {
|
|
956
|
-
...mi(e, (
|
|
956
|
+
...mi(e, (s, n) => !n.startsWith("_")),
|
|
957
957
|
mask: e.constructor,
|
|
958
958
|
_mask: i,
|
|
959
959
|
...t
|
|
960
960
|
};
|
|
961
961
|
}
|
|
962
962
|
}
|
|
963
|
-
return ni(
|
|
964
|
-
...
|
|
963
|
+
return ni(a) ? {
|
|
964
|
+
...a
|
|
965
965
|
} : {
|
|
966
|
-
mask:
|
|
966
|
+
mask: a
|
|
967
967
|
};
|
|
968
968
|
}
|
|
969
|
-
function Pe(
|
|
970
|
-
if (V.Masked &&
|
|
971
|
-
const e = ct(
|
|
969
|
+
function Pe(a) {
|
|
970
|
+
if (V.Masked && a instanceof V.Masked) return a;
|
|
971
|
+
const e = ct(a), t = gi(e.mask);
|
|
972
972
|
if (!t) throw new Error("Masked class is not found for provided mask " + e.mask + ", appropriate module needs to be imported manually before creating mask.");
|
|
973
973
|
return e.mask === t && delete e.mask, e._mask && (e.mask = e._mask, delete e._mask), new t(e);
|
|
974
974
|
}
|
|
@@ -1083,20 +1083,20 @@ V.HTMLMaskElement = Ft;
|
|
|
1083
1083
|
class vi extends Ft {
|
|
1084
1084
|
/** Returns HTMLElement selection start */
|
|
1085
1085
|
get _unsafeSelectionStart() {
|
|
1086
|
-
const e = this.rootElement, t = e.getSelection && e.getSelection(), i = t && t.anchorOffset,
|
|
1087
|
-
return
|
|
1086
|
+
const e = this.rootElement, t = e.getSelection && e.getSelection(), i = t && t.anchorOffset, s = t && t.focusOffset;
|
|
1087
|
+
return s == null || i == null || i < s ? i : s;
|
|
1088
1088
|
}
|
|
1089
1089
|
/** Returns HTMLElement selection end */
|
|
1090
1090
|
get _unsafeSelectionEnd() {
|
|
1091
|
-
const e = this.rootElement, t = e.getSelection && e.getSelection(), i = t && t.anchorOffset,
|
|
1092
|
-
return
|
|
1091
|
+
const e = this.rootElement, t = e.getSelection && e.getSelection(), i = t && t.anchorOffset, s = t && t.focusOffset;
|
|
1092
|
+
return s == null || i == null || i > s ? i : s;
|
|
1093
1093
|
}
|
|
1094
1094
|
/** Sets HTMLElement selection */
|
|
1095
1095
|
_unsafeSelect(e, t) {
|
|
1096
1096
|
if (!this.rootElement.createRange) return;
|
|
1097
1097
|
const i = this.rootElement.createRange();
|
|
1098
1098
|
i.setStart(this.input.firstChild || this.input, e), i.setEnd(this.input.lastChild || this.input, t);
|
|
1099
|
-
const
|
|
1099
|
+
const s = this.rootElement, n = s.getSelection && s.getSelection();
|
|
1100
1100
|
n && (n.removeAllRanges(), n.addRange(i));
|
|
1101
1101
|
}
|
|
1102
1102
|
/** HTMLElement value */
|
|
@@ -1216,7 +1216,7 @@ class Qi {
|
|
|
1216
1216
|
/** Fires custom event */
|
|
1217
1217
|
_fireEvent(e, t) {
|
|
1218
1218
|
const i = this._listeners[e];
|
|
1219
|
-
i && i.forEach((
|
|
1219
|
+
i && i.forEach((s) => s(t));
|
|
1220
1220
|
}
|
|
1221
1221
|
/** Current selection start */
|
|
1222
1222
|
get selectionStart() {
|
|
@@ -1242,8 +1242,8 @@ class Qi {
|
|
|
1242
1242
|
}
|
|
1243
1243
|
/** Syncronizes view from model value, fires change events */
|
|
1244
1244
|
updateControl(e) {
|
|
1245
|
-
const t = this.masked.unmaskedValue, i = this.masked.value,
|
|
1246
|
-
this._unmaskedValue = t, this._value = i, this._rawInputValue =
|
|
1245
|
+
const t = this.masked.unmaskedValue, i = this.masked.value, s = this.masked.rawInputValue, n = this.displayValue, o = this.unmaskedValue !== t || this.value !== i || this._rawInputValue !== s;
|
|
1246
|
+
this._unmaskedValue = t, this._value = i, this._rawInputValue = s, this.el.value !== n && (this.el.value = n), e === "auto" ? this.alignCursor() : e != null && (this.cursorPos = e), o && this._fireChangeEvents(), !this._historyChanging && (o || this.history.isEmpty) && this.history.push({
|
|
1247
1247
|
unmaskedValue: t,
|
|
1248
1248
|
selection: {
|
|
1249
1249
|
start: this.selectionStart,
|
|
@@ -1256,8 +1256,8 @@ class Qi {
|
|
|
1256
1256
|
const {
|
|
1257
1257
|
mask: t,
|
|
1258
1258
|
...i
|
|
1259
|
-
} = e,
|
|
1260
|
-
|
|
1259
|
+
} = e, s = !this.maskEquals(t), n = this.masked.optionsIsChanged(i);
|
|
1260
|
+
s && (this.mask = t), n && this.masked.updateOptions(i), (s || n) && this.updateControl();
|
|
1261
1261
|
}
|
|
1262
1262
|
/** Updates cursor */
|
|
1263
1263
|
updateCursor(e) {
|
|
@@ -1307,11 +1307,11 @@ class Qi {
|
|
|
1307
1307
|
// old state
|
|
1308
1308
|
oldValue: this.displayValue,
|
|
1309
1309
|
oldSelection: this._selection
|
|
1310
|
-
}), i = this.masked.rawInputValue,
|
|
1310
|
+
}), i = this.masked.rawInputValue, s = this.masked.splice(t.startChangePos, t.removed.length, t.inserted, t.removeDirection, {
|
|
1311
1311
|
input: !0,
|
|
1312
1312
|
raw: !0
|
|
1313
1313
|
}).offset, n = i === this.masked.rawInputValue ? t.removeDirection : x.NONE;
|
|
1314
|
-
let o = this.masked.nearestInputPos(t.startChangePos +
|
|
1314
|
+
let o = this.masked.nearestInputPos(t.startChangePos + s, n);
|
|
1315
1315
|
n !== x.NONE && (o = this.masked.nearestInputPos(o, x.NONE)), this.updateControl(o), delete this._inputEvent;
|
|
1316
1316
|
}
|
|
1317
1317
|
/** Handles view change event and commits model value */
|
|
@@ -1533,11 +1533,11 @@ class ne {
|
|
|
1533
1533
|
/** Appends char */
|
|
1534
1534
|
_appendChar(e, t, i) {
|
|
1535
1535
|
t === void 0 && (t = {});
|
|
1536
|
-
const
|
|
1536
|
+
const s = this.state;
|
|
1537
1537
|
let n;
|
|
1538
1538
|
if ([e, n] = this.doPrepareChar(e, t), e && (n = n.aggregate(this._appendCharRaw(e, t)), !n.rawInserted && this.autofix === "pad")) {
|
|
1539
1539
|
const o = this.state;
|
|
1540
|
-
this.state =
|
|
1540
|
+
this.state = s;
|
|
1541
1541
|
let u = this.pad(t);
|
|
1542
1542
|
const c = this._appendCharRaw(e, t);
|
|
1543
1543
|
u = u.aggregate(c), c.rawInserted || u.equals(n) ? n = u : this.state = o;
|
|
@@ -1560,7 +1560,7 @@ class ne {
|
|
|
1560
1560
|
}
|
|
1561
1561
|
u && h.inserted && (this.state = c);
|
|
1562
1562
|
}
|
|
1563
|
-
u || (n = new O(), this.state =
|
|
1563
|
+
u || (n = new O(), this.state = s, i && o && (i.state = o));
|
|
1564
1564
|
}
|
|
1565
1565
|
return n;
|
|
1566
1566
|
}
|
|
@@ -1575,16 +1575,16 @@ class ne {
|
|
|
1575
1575
|
/** Appends symbols considering flags */
|
|
1576
1576
|
append(e, t, i) {
|
|
1577
1577
|
if (!$e(e)) throw new Error("value should be string");
|
|
1578
|
-
const
|
|
1578
|
+
const s = $e(i) ? new Ie(String(i)) : i;
|
|
1579
1579
|
t != null && t.tail && (t._beforeTailState = this.state);
|
|
1580
1580
|
let n;
|
|
1581
1581
|
[e, n] = this.doPrepare(e, t);
|
|
1582
1582
|
for (let o = 0; o < e.length; ++o) {
|
|
1583
|
-
const u = this._appendChar(e[o], t,
|
|
1584
|
-
if (!u.rawInserted && !this.doSkipInvalid(e[o], t,
|
|
1583
|
+
const u = this._appendChar(e[o], t, s);
|
|
1584
|
+
if (!u.rawInserted && !this.doSkipInvalid(e[o], t, s)) break;
|
|
1585
1585
|
n.aggregate(u);
|
|
1586
1586
|
}
|
|
1587
|
-
return (this.eager === !0 || this.eager === "append") && t != null && t.input && e && n.aggregate(this._appendEager()),
|
|
1587
|
+
return (this.eager === !0 || this.eager === "append") && t != null && t.input && e && n.aggregate(this._appendEager()), s != null && (n.tailShift += this.appendTail(s).tailShift), n;
|
|
1588
1588
|
}
|
|
1589
1589
|
remove(e, t) {
|
|
1590
1590
|
return e === void 0 && (e = 0), t === void 0 && (t = this.displayValue.length), this._value = this.displayValue.slice(0, e) + this.displayValue.slice(t), new O();
|
|
@@ -1593,8 +1593,8 @@ class ne {
|
|
|
1593
1593
|
withValueRefresh(e) {
|
|
1594
1594
|
if (this._refreshing || !this._initialized) return e();
|
|
1595
1595
|
this._refreshing = !0;
|
|
1596
|
-
const t = this.rawInputValue, i = this.value,
|
|
1597
|
-
return this.rawInputValue = t, this.value && this.value !== i && i.indexOf(this.value) === 0 && (this.append(i.slice(this.displayValue.length), {}, ""), this.doCommit()), delete this._refreshing,
|
|
1596
|
+
const t = this.rawInputValue, i = this.value, s = e();
|
|
1597
|
+
return this.rawInputValue = t, this.value && this.value !== i && i.indexOf(this.value) === 0 && (this.append(i.slice(this.displayValue.length), {}, ""), this.doCommit()), delete this._refreshing, s;
|
|
1598
1598
|
}
|
|
1599
1599
|
runIsolated(e) {
|
|
1600
1600
|
if (this._isolated || !this._initialized) return e(this);
|
|
@@ -1621,26 +1621,26 @@ class ne {
|
|
|
1621
1621
|
doCommit() {
|
|
1622
1622
|
this.commit && this.commit(this.value, this);
|
|
1623
1623
|
}
|
|
1624
|
-
splice(e, t, i,
|
|
1625
|
-
i === void 0 && (i = ""),
|
|
1624
|
+
splice(e, t, i, s, n) {
|
|
1625
|
+
i === void 0 && (i = ""), s === void 0 && (s = x.NONE), n === void 0 && (n = {
|
|
1626
1626
|
input: !0
|
|
1627
1627
|
});
|
|
1628
1628
|
const o = e + t, u = this.extractTail(o), c = this.eager === !0 || this.eager === "remove";
|
|
1629
1629
|
let h;
|
|
1630
|
-
c && (
|
|
1630
|
+
c && (s = Ki(s), h = this.extractInput(0, o, {
|
|
1631
1631
|
raw: !0
|
|
1632
1632
|
}));
|
|
1633
1633
|
let d = e;
|
|
1634
|
-
const
|
|
1635
|
-
if (
|
|
1636
|
-
if (
|
|
1634
|
+
const m = new O();
|
|
1635
|
+
if (s !== x.NONE && (d = this.nearestInputPos(e, t > 1 && e !== 0 && !c ? x.NONE : s), m.tailShift = d - e), m.aggregate(this.remove(d)), c && s !== x.NONE && h === this.rawInputValue)
|
|
1636
|
+
if (s === x.FORCE_LEFT) {
|
|
1637
1637
|
let r;
|
|
1638
1638
|
for (; h === this.rawInputValue && (r = this.displayValue.length); )
|
|
1639
|
-
|
|
1639
|
+
m.aggregate(new O({
|
|
1640
1640
|
tailShift: -1
|
|
1641
1641
|
})).aggregate(this.remove(r - 1));
|
|
1642
|
-
} else
|
|
1643
|
-
return
|
|
1642
|
+
} else s === x.FORCE_RIGHT && u.unshift();
|
|
1643
|
+
return m.aggregate(this.append(i, n, u));
|
|
1644
1644
|
}
|
|
1645
1645
|
maskEquals(e) {
|
|
1646
1646
|
return this.mask === e;
|
|
@@ -1679,9 +1679,9 @@ class qe {
|
|
|
1679
1679
|
i ? t.extend(e.toString()) : this.chunks.push(e);
|
|
1680
1680
|
else if (e instanceof qe) {
|
|
1681
1681
|
if (e.stop == null) {
|
|
1682
|
-
let
|
|
1682
|
+
let s;
|
|
1683
1683
|
for (; e.chunks.length && e.chunks[0].stop == null; )
|
|
1684
|
-
|
|
1684
|
+
s = e.chunks.shift(), s.from += e.from, this.extend(s);
|
|
1685
1685
|
}
|
|
1686
1686
|
e.toString() && (e.stop = e.blockIndex, this.chunks.push(e));
|
|
1687
1687
|
}
|
|
@@ -1691,19 +1691,19 @@ class qe {
|
|
|
1691
1691
|
return new Ie(this.toString()).appendTo(e);
|
|
1692
1692
|
const t = new O();
|
|
1693
1693
|
for (let i = 0; i < this.chunks.length; ++i) {
|
|
1694
|
-
const
|
|
1694
|
+
const s = this.chunks[i], n = e._mapPosToBlock(e.displayValue.length), o = s.stop;
|
|
1695
1695
|
let u;
|
|
1696
1696
|
if (o != null && // if block not found or stop is behind lastBlock
|
|
1697
|
-
(!n || n.index <= o) && ((
|
|
1698
|
-
e._stops.indexOf(o) >= 0) && t.aggregate(e._appendPlaceholder(o)), u =
|
|
1699
|
-
const c = u.appendTail(
|
|
1697
|
+
(!n || n.index <= o) && ((s instanceof qe || // for continuous block also check if stop is exist
|
|
1698
|
+
e._stops.indexOf(o) >= 0) && t.aggregate(e._appendPlaceholder(o)), u = s instanceof qe && e._blocks[o]), u) {
|
|
1699
|
+
const c = u.appendTail(s);
|
|
1700
1700
|
t.aggregate(c);
|
|
1701
|
-
const h =
|
|
1701
|
+
const h = s.toString().slice(c.rawInserted.length);
|
|
1702
1702
|
h && t.aggregate(e.append(h, {
|
|
1703
1703
|
tail: !0
|
|
1704
1704
|
}));
|
|
1705
1705
|
} else
|
|
1706
|
-
t.aggregate(e.append(
|
|
1706
|
+
t.aggregate(e.append(s.toString(), {
|
|
1707
1707
|
tail: !0
|
|
1708
1708
|
}));
|
|
1709
1709
|
}
|
|
@@ -1722,9 +1722,9 @@ class qe {
|
|
|
1722
1722
|
chunks: t,
|
|
1723
1723
|
...i
|
|
1724
1724
|
} = e;
|
|
1725
|
-
Object.assign(this, i), this.chunks = t.map((
|
|
1726
|
-
const n = "chunks" in
|
|
1727
|
-
return n.state =
|
|
1725
|
+
Object.assign(this, i), this.chunks = t.map((s) => {
|
|
1726
|
+
const n = "chunks" in s ? new qe() : new Ie();
|
|
1727
|
+
return n.state = s, n;
|
|
1728
1728
|
});
|
|
1729
1729
|
}
|
|
1730
1730
|
unshift(e) {
|
|
@@ -1732,8 +1732,8 @@ class qe {
|
|
|
1732
1732
|
const t = e != null ? e - this.from : e;
|
|
1733
1733
|
let i = 0;
|
|
1734
1734
|
for (; i < this.chunks.length; ) {
|
|
1735
|
-
const
|
|
1736
|
-
if (
|
|
1735
|
+
const s = this.chunks[i], n = s.unshift(t);
|
|
1736
|
+
if (s.toString()) {
|
|
1737
1737
|
if (!n) break;
|
|
1738
1738
|
++i;
|
|
1739
1739
|
} else
|
|
@@ -1762,7 +1762,7 @@ class es {
|
|
|
1762
1762
|
this.masked = e, this._log = [];
|
|
1763
1763
|
const {
|
|
1764
1764
|
offset: i,
|
|
1765
|
-
index:
|
|
1765
|
+
index: s
|
|
1766
1766
|
} = e._mapPosToBlock(t) || (t < 0 ? (
|
|
1767
1767
|
// first
|
|
1768
1768
|
{
|
|
@@ -1776,7 +1776,7 @@ class es {
|
|
|
1776
1776
|
offset: 0
|
|
1777
1777
|
}
|
|
1778
1778
|
));
|
|
1779
|
-
this.offset = i, this.index =
|
|
1779
|
+
this.offset = i, this.index = s, this.ok = !1;
|
|
1780
1780
|
}
|
|
1781
1781
|
get block() {
|
|
1782
1782
|
return this.masked._blocks[this.index];
|
|
@@ -1883,7 +1883,7 @@ class yi {
|
|
|
1883
1883
|
}
|
|
1884
1884
|
nearestInputPos(e, t) {
|
|
1885
1885
|
t === void 0 && (t = x.NONE);
|
|
1886
|
-
const i = 0,
|
|
1886
|
+
const i = 0, s = this._value.length;
|
|
1887
1887
|
switch (t) {
|
|
1888
1888
|
case x.LEFT:
|
|
1889
1889
|
case x.FORCE_LEFT:
|
|
@@ -1892,7 +1892,7 @@ class yi {
|
|
|
1892
1892
|
case x.RIGHT:
|
|
1893
1893
|
case x.FORCE_RIGHT:
|
|
1894
1894
|
default:
|
|
1895
|
-
return
|
|
1895
|
+
return s;
|
|
1896
1896
|
}
|
|
1897
1897
|
}
|
|
1898
1898
|
totalInputPositions(e, t) {
|
|
@@ -1909,11 +1909,11 @@ class yi {
|
|
|
1909
1909
|
}
|
|
1910
1910
|
_appendChar(e, t) {
|
|
1911
1911
|
if (t === void 0 && (t = {}), this.isFilled) return new O();
|
|
1912
|
-
const i = this.eager === !0 || this.eager === "append",
|
|
1912
|
+
const i = this.eager === !0 || this.eager === "append", s = this.char === e && (this.isUnmasking || t.input || t.raw) && (!t.raw || !i) && !t.tail, n = new O({
|
|
1913
1913
|
inserted: this.char,
|
|
1914
|
-
rawInserted:
|
|
1914
|
+
rawInserted: s ? this.char : ""
|
|
1915
1915
|
});
|
|
1916
|
-
return this._value = this.char, this._isRawInput =
|
|
1916
|
+
return this._value = this.char, this._isRawInput = s && (t.raw || t.input), n;
|
|
1917
1917
|
}
|
|
1918
1918
|
_appendEager() {
|
|
1919
1919
|
return this._appendChar(this.char, {
|
|
@@ -1931,8 +1931,8 @@ class yi {
|
|
|
1931
1931
|
return $e(e) && (e = new Ie(String(e))), e.appendTo(this);
|
|
1932
1932
|
}
|
|
1933
1933
|
append(e, t, i) {
|
|
1934
|
-
const
|
|
1935
|
-
return i != null && (
|
|
1934
|
+
const s = this._appendChar(e[0], t);
|
|
1935
|
+
return i != null && (s.tailShift += this.appendTail(i).tailShift), s;
|
|
1936
1936
|
}
|
|
1937
1937
|
doCommit() {
|
|
1938
1938
|
}
|
|
@@ -1962,7 +1962,7 @@ class wt {
|
|
|
1962
1962
|
const {
|
|
1963
1963
|
parent: t,
|
|
1964
1964
|
isOptional: i,
|
|
1965
|
-
placeholderChar:
|
|
1965
|
+
placeholderChar: s,
|
|
1966
1966
|
displayChar: n,
|
|
1967
1967
|
lazy: o,
|
|
1968
1968
|
eager: u,
|
|
@@ -1971,7 +1971,7 @@ class wt {
|
|
|
1971
1971
|
this.masked = Pe(c), Object.assign(this, {
|
|
1972
1972
|
parent: t,
|
|
1973
1973
|
isOptional: i,
|
|
1974
|
-
placeholderChar:
|
|
1974
|
+
placeholderChar: s,
|
|
1975
1975
|
displayChar: n,
|
|
1976
1976
|
lazy: o,
|
|
1977
1977
|
eager: u
|
|
@@ -2001,8 +2001,8 @@ class wt {
|
|
|
2001
2001
|
_appendChar(e, t) {
|
|
2002
2002
|
if (t === void 0 && (t = {}), this.isFilled) return new O();
|
|
2003
2003
|
const i = this.masked.state;
|
|
2004
|
-
let
|
|
2005
|
-
return
|
|
2004
|
+
let s = this.masked._appendChar(e, this.currentMaskFlags(t));
|
|
2005
|
+
return s.inserted && this.doValidate(t) === !1 && (s = new O(), this.masked.state = i), !s.inserted && !this.isOptional && !this.lazy && !t.input && (s.inserted = this.placeholderChar), s.skip = !s.inserted && !this.isOptional, this.isFilled = !!s.inserted, s;
|
|
2006
2006
|
}
|
|
2007
2007
|
append(e, t, i) {
|
|
2008
2008
|
return this.masked.append(e, this.currentMaskFlags(t), i);
|
|
@@ -2026,14 +2026,14 @@ class wt {
|
|
|
2026
2026
|
}
|
|
2027
2027
|
nearestInputPos(e, t) {
|
|
2028
2028
|
t === void 0 && (t = x.NONE);
|
|
2029
|
-
const i = 0,
|
|
2029
|
+
const i = 0, s = this.value.length, n = Math.min(Math.max(e, i), s);
|
|
2030
2030
|
switch (t) {
|
|
2031
2031
|
case x.LEFT:
|
|
2032
2032
|
case x.FORCE_LEFT:
|
|
2033
2033
|
return this.isComplete ? n : i;
|
|
2034
2034
|
case x.RIGHT:
|
|
2035
2035
|
case x.FORCE_RIGHT:
|
|
2036
|
-
return this.isComplete ? n :
|
|
2036
|
+
return this.isComplete ? n : s;
|
|
2037
2037
|
case x.NONE:
|
|
2038
2038
|
default:
|
|
2039
2039
|
return n;
|
|
@@ -2119,32 +2119,32 @@ class oe extends ne {
|
|
|
2119
2119
|
this._blocks = [], this.exposeBlock = void 0, this._stops = [], this._maskedBlocks = {};
|
|
2120
2120
|
const t = this.mask;
|
|
2121
2121
|
if (!t || !e) return;
|
|
2122
|
-
let i = !1,
|
|
2122
|
+
let i = !1, s = !1;
|
|
2123
2123
|
for (let n = 0; n < t.length; ++n) {
|
|
2124
2124
|
if (this.blocks) {
|
|
2125
2125
|
const h = t.slice(n), d = Object.keys(this.blocks).filter((r) => h.indexOf(r) === 0);
|
|
2126
|
-
d.sort((r,
|
|
2127
|
-
const
|
|
2128
|
-
if (
|
|
2126
|
+
d.sort((r, f) => f.length - r.length);
|
|
2127
|
+
const m = d[0];
|
|
2128
|
+
if (m) {
|
|
2129
2129
|
const {
|
|
2130
2130
|
expose: r,
|
|
2131
|
-
repeat:
|
|
2132
|
-
...
|
|
2133
|
-
} = ct(this.blocks[
|
|
2131
|
+
repeat: f,
|
|
2132
|
+
...v
|
|
2133
|
+
} = ct(this.blocks[m]), k = {
|
|
2134
2134
|
lazy: this.lazy,
|
|
2135
2135
|
eager: this.eager,
|
|
2136
2136
|
placeholderChar: this.placeholderChar,
|
|
2137
2137
|
displayChar: this.displayChar,
|
|
2138
2138
|
overwrite: this.overwrite,
|
|
2139
2139
|
autofix: this.autofix,
|
|
2140
|
-
...
|
|
2141
|
-
repeat:
|
|
2140
|
+
...v,
|
|
2141
|
+
repeat: f,
|
|
2142
2142
|
parent: this
|
|
2143
|
-
},
|
|
2143
|
+
}, b = f != null ? new V.RepeatBlock(
|
|
2144
2144
|
k
|
|
2145
2145
|
/* TODO */
|
|
2146
2146
|
) : Pe(k);
|
|
2147
|
-
|
|
2147
|
+
b && (this._blocks.push(b), r && (this.exposeBlock = b), this._maskedBlocks[m] || (this._maskedBlocks[m] = []), this._maskedBlocks[m].push(this._blocks.length - 1)), n += m.length - 1;
|
|
2148
2148
|
continue;
|
|
2149
2149
|
}
|
|
2150
2150
|
}
|
|
@@ -2158,7 +2158,7 @@ class oe extends ne {
|
|
|
2158
2158
|
continue;
|
|
2159
2159
|
}
|
|
2160
2160
|
if (o === "[" || o === "]") {
|
|
2161
|
-
|
|
2161
|
+
s = !s;
|
|
2162
2162
|
continue;
|
|
2163
2163
|
}
|
|
2164
2164
|
if (o === oe.ESCAPE_CHAR) {
|
|
@@ -2166,7 +2166,7 @@ class oe extends ne {
|
|
|
2166
2166
|
u = !1;
|
|
2167
2167
|
}
|
|
2168
2168
|
const c = u ? new wt({
|
|
2169
|
-
isOptional:
|
|
2169
|
+
isOptional: s,
|
|
2170
2170
|
lazy: this.lazy,
|
|
2171
2171
|
eager: this.eager,
|
|
2172
2172
|
placeholderChar: this.placeholderChar,
|
|
@@ -2196,7 +2196,7 @@ class oe extends ne {
|
|
|
2196
2196
|
_blocks: t,
|
|
2197
2197
|
...i
|
|
2198
2198
|
} = e;
|
|
2199
|
-
this._blocks.forEach((
|
|
2199
|
+
this._blocks.forEach((s, n) => s.state = t[n]), super.state = i;
|
|
2200
2200
|
}
|
|
2201
2201
|
reset() {
|
|
2202
2202
|
super.reset(), this._blocks.forEach((e) => e.reset());
|
|
@@ -2258,8 +2258,8 @@ class oe extends ne {
|
|
|
2258
2258
|
let i = (e = this._mapPosToBlock(this.displayValue.length)) == null ? void 0 : e.index;
|
|
2259
2259
|
if (i == null) return t;
|
|
2260
2260
|
this._blocks[i].isFilled && ++i;
|
|
2261
|
-
for (let
|
|
2262
|
-
const n = this._blocks[
|
|
2261
|
+
for (let s = i; s < this._blocks.length; ++s) {
|
|
2262
|
+
const n = this._blocks[s]._appendEager();
|
|
2263
2263
|
if (!n.inserted) break;
|
|
2264
2264
|
t.aggregate(n);
|
|
2265
2265
|
}
|
|
@@ -2267,38 +2267,38 @@ class oe extends ne {
|
|
|
2267
2267
|
}
|
|
2268
2268
|
_appendCharRaw(e, t) {
|
|
2269
2269
|
t === void 0 && (t = {});
|
|
2270
|
-
const i = this._mapPosToBlock(this.displayValue.length),
|
|
2271
|
-
if (!i) return
|
|
2270
|
+
const i = this._mapPosToBlock(this.displayValue.length), s = new O();
|
|
2271
|
+
if (!i) return s;
|
|
2272
2272
|
for (let o = i.index, u; u = this._blocks[o]; ++o) {
|
|
2273
2273
|
var n;
|
|
2274
2274
|
const c = u._appendChar(e, {
|
|
2275
2275
|
...t,
|
|
2276
2276
|
_beforeTailState: (n = t._beforeTailState) == null || (n = n._blocks) == null ? void 0 : n[o]
|
|
2277
2277
|
});
|
|
2278
|
-
if (
|
|
2278
|
+
if (s.aggregate(c), c.consumed) break;
|
|
2279
2279
|
}
|
|
2280
|
-
return
|
|
2280
|
+
return s;
|
|
2281
2281
|
}
|
|
2282
2282
|
extractTail(e, t) {
|
|
2283
2283
|
e === void 0 && (e = 0), t === void 0 && (t = this.displayValue.length);
|
|
2284
2284
|
const i = new qe();
|
|
2285
|
-
return e === t || this._forEachBlocksInRange(e, t, (
|
|
2286
|
-
const c =
|
|
2285
|
+
return e === t || this._forEachBlocksInRange(e, t, (s, n, o, u) => {
|
|
2286
|
+
const c = s.extractTail(o, u);
|
|
2287
2287
|
c.stop = this._findStopBefore(n), c.from = this._blockStartPos(n), c instanceof qe && (c.blockIndex = n), i.extend(c);
|
|
2288
2288
|
}), i;
|
|
2289
2289
|
}
|
|
2290
2290
|
extractInput(e, t, i) {
|
|
2291
2291
|
if (e === void 0 && (e = 0), t === void 0 && (t = this.displayValue.length), i === void 0 && (i = {}), e === t) return "";
|
|
2292
|
-
let
|
|
2292
|
+
let s = "";
|
|
2293
2293
|
return this._forEachBlocksInRange(e, t, (n, o, u, c) => {
|
|
2294
|
-
|
|
2295
|
-
}),
|
|
2294
|
+
s += n.extractInput(u, c, i);
|
|
2295
|
+
}), s;
|
|
2296
2296
|
}
|
|
2297
2297
|
_findStopBefore(e) {
|
|
2298
2298
|
let t;
|
|
2299
2299
|
for (let i = 0; i < this._stops.length; ++i) {
|
|
2300
|
-
const
|
|
2301
|
-
if (
|
|
2300
|
+
const s = this._stops[i];
|
|
2301
|
+
if (s <= e) t = s;
|
|
2302
2302
|
else break;
|
|
2303
2303
|
}
|
|
2304
2304
|
return t;
|
|
@@ -2309,8 +2309,8 @@ class oe extends ne {
|
|
|
2309
2309
|
if (this.lazy && e == null) return t;
|
|
2310
2310
|
const i = this._mapPosToBlock(this.displayValue.length);
|
|
2311
2311
|
if (!i) return t;
|
|
2312
|
-
const
|
|
2313
|
-
return this._blocks.slice(
|
|
2312
|
+
const s = i.index, n = e ?? this._blocks.length;
|
|
2313
|
+
return this._blocks.slice(s, n).forEach((o) => {
|
|
2314
2314
|
if (!o.lazy || e != null) {
|
|
2315
2315
|
var u;
|
|
2316
2316
|
t.aggregate(o._appendPlaceholder((u = o._blocks) == null ? void 0 : u.length));
|
|
@@ -2321,8 +2321,8 @@ class oe extends ne {
|
|
|
2321
2321
|
_mapPosToBlock(e) {
|
|
2322
2322
|
let t = "";
|
|
2323
2323
|
for (let i = 0; i < this._blocks.length; ++i) {
|
|
2324
|
-
const
|
|
2325
|
-
if (t +=
|
|
2324
|
+
const s = this._blocks[i], n = t.length;
|
|
2325
|
+
if (t += s.displayValue, e <= t.length)
|
|
2326
2326
|
return {
|
|
2327
2327
|
index: i,
|
|
2328
2328
|
offset: e - n
|
|
@@ -2334,11 +2334,11 @@ class oe extends ne {
|
|
|
2334
2334
|
}
|
|
2335
2335
|
_forEachBlocksInRange(e, t, i) {
|
|
2336
2336
|
t === void 0 && (t = this.displayValue.length);
|
|
2337
|
-
const
|
|
2338
|
-
if (
|
|
2339
|
-
const n = this._mapPosToBlock(t), o = n &&
|
|
2340
|
-
if (i(this._blocks[
|
|
2341
|
-
for (let h =
|
|
2337
|
+
const s = this._mapPosToBlock(e);
|
|
2338
|
+
if (s) {
|
|
2339
|
+
const n = this._mapPosToBlock(t), o = n && s.index === n.index, u = s.offset, c = n && o ? n.offset : this._blocks[s.index].displayValue.length;
|
|
2340
|
+
if (i(this._blocks[s.index], s.index, u, c), n && !o) {
|
|
2341
|
+
for (let h = s.index + 1; h < n.index; ++h)
|
|
2342
2342
|
i(this._blocks[h], h, 0, this._blocks[h].displayValue.length);
|
|
2343
2343
|
i(this._blocks[n.index], n.index, 0, n.offset);
|
|
2344
2344
|
}
|
|
@@ -2347,8 +2347,8 @@ class oe extends ne {
|
|
|
2347
2347
|
remove(e, t) {
|
|
2348
2348
|
e === void 0 && (e = 0), t === void 0 && (t = this.displayValue.length);
|
|
2349
2349
|
const i = super.remove(e, t);
|
|
2350
|
-
return this._forEachBlocksInRange(e, t, (
|
|
2351
|
-
i.aggregate(
|
|
2350
|
+
return this._forEachBlocksInRange(e, t, (s, n, o, u) => {
|
|
2351
|
+
i.aggregate(s.remove(o, u));
|
|
2352
2352
|
}), i;
|
|
2353
2353
|
}
|
|
2354
2354
|
nearestInputPos(e, t) {
|
|
@@ -2372,8 +2372,8 @@ class oe extends ne {
|
|
|
2372
2372
|
totalInputPositions(e, t) {
|
|
2373
2373
|
e === void 0 && (e = 0), t === void 0 && (t = this.displayValue.length);
|
|
2374
2374
|
let i = 0;
|
|
2375
|
-
return this._forEachBlocksInRange(e, t, (
|
|
2376
|
-
i +=
|
|
2375
|
+
return this._forEachBlocksInRange(e, t, (s, n, o, u) => {
|
|
2376
|
+
i += s.totalInputPositions(o, u);
|
|
2377
2377
|
}), i;
|
|
2378
2378
|
}
|
|
2379
2379
|
/** Get block by name */
|
|
@@ -2420,11 +2420,11 @@ class kt extends oe {
|
|
|
2420
2420
|
const {
|
|
2421
2421
|
to: t = this.to || 0,
|
|
2422
2422
|
from: i = this.from || 0,
|
|
2423
|
-
maxLength:
|
|
2423
|
+
maxLength: s = this.maxLength || 0,
|
|
2424
2424
|
autofix: n = this.autofix,
|
|
2425
2425
|
...o
|
|
2426
2426
|
} = e;
|
|
2427
|
-
this.to = t, this.from = i, this.maxLength = Math.max(String(t).length,
|
|
2427
|
+
this.to = t, this.from = i, this.maxLength = Math.max(String(t).length, s), this.autofix = n;
|
|
2428
2428
|
const u = String(this.from).padStart(this.maxLength, "0"), c = String(this.to).padStart(this.maxLength, "0");
|
|
2429
2429
|
let h = 0;
|
|
2430
2430
|
for (; h < c.length && c[h] === u[h]; ) ++h;
|
|
@@ -2435,8 +2435,8 @@ class kt extends oe {
|
|
|
2435
2435
|
}
|
|
2436
2436
|
boundaries(e) {
|
|
2437
2437
|
let t = "", i = "";
|
|
2438
|
-
const [,
|
|
2439
|
-
return n && (t = "0".repeat(
|
|
2438
|
+
const [, s, n] = e.match(/^(\D*)(\d*)(\D*)/) || [];
|
|
2439
|
+
return n && (t = "0".repeat(s.length) + n, i = "9".repeat(s.length) + n), t = t.padEnd(this.maxLength, "0"), i = i.padEnd(this.maxLength, "9"), [t, i];
|
|
2440
2440
|
}
|
|
2441
2441
|
doPrepareChar(e, t) {
|
|
2442
2442
|
t === void 0 && (t = {});
|
|
@@ -2445,22 +2445,22 @@ class kt extends oe {
|
|
|
2445
2445
|
}
|
|
2446
2446
|
_appendCharRaw(e, t) {
|
|
2447
2447
|
if (t === void 0 && (t = {}), !this.autofix || this.value.length + 1 > this.maxLength) return super._appendCharRaw(e, t);
|
|
2448
|
-
const i = String(this.from).padStart(this.maxLength, "0"),
|
|
2449
|
-
return Number(o) < this.from ? super._appendCharRaw(i[this.value.length], t) : Number(n) > this.to ? !t.tail && this.autofix === "pad" && this.value.length + 1 < this.maxLength ? super._appendCharRaw(i[this.value.length], t).aggregate(this._appendCharRaw(e, t)) : super._appendCharRaw(
|
|
2448
|
+
const i = String(this.from).padStart(this.maxLength, "0"), s = String(this.to).padStart(this.maxLength, "0"), [n, o] = this.boundaries(this.value + e);
|
|
2449
|
+
return Number(o) < this.from ? super._appendCharRaw(i[this.value.length], t) : Number(n) > this.to ? !t.tail && this.autofix === "pad" && this.value.length + 1 < this.maxLength ? super._appendCharRaw(i[this.value.length], t).aggregate(this._appendCharRaw(e, t)) : super._appendCharRaw(s[this.value.length], t) : super._appendCharRaw(e, t);
|
|
2450
2450
|
}
|
|
2451
2451
|
doValidate(e) {
|
|
2452
2452
|
const t = this.value;
|
|
2453
2453
|
if (t.search(/[^0]/) === -1 && t.length <= this._matchFrom) return !0;
|
|
2454
|
-
const [i,
|
|
2455
|
-
return this.from <= Number(
|
|
2454
|
+
const [i, s] = this.boundaries(t);
|
|
2455
|
+
return this.from <= Number(s) && Number(i) <= this.to && super.doValidate(e);
|
|
2456
2456
|
}
|
|
2457
2457
|
pad(e) {
|
|
2458
2458
|
const t = new O();
|
|
2459
2459
|
if (this.value.length === this.maxLength) return t;
|
|
2460
|
-
const i = this.value,
|
|
2461
|
-
if (
|
|
2460
|
+
const i = this.value, s = this.maxLength - this.value.length;
|
|
2461
|
+
if (s) {
|
|
2462
2462
|
this.reset();
|
|
2463
|
-
for (let n = 0; n <
|
|
2463
|
+
for (let n = 0; n < s; ++n)
|
|
2464
2464
|
t.aggregate(super._appendCharRaw("0", e));
|
|
2465
2465
|
i.split("").forEach((n) => this._appendCharRaw(n));
|
|
2466
2466
|
}
|
|
@@ -2474,10 +2474,10 @@ class De extends oe {
|
|
|
2474
2474
|
const {
|
|
2475
2475
|
mask: t,
|
|
2476
2476
|
pattern: i,
|
|
2477
|
-
...
|
|
2477
|
+
...s
|
|
2478
2478
|
} = e;
|
|
2479
2479
|
return {
|
|
2480
|
-
...
|
|
2480
|
+
...s,
|
|
2481
2481
|
mask: $e(t) ? t : i
|
|
2482
2482
|
};
|
|
2483
2483
|
}
|
|
@@ -2499,13 +2499,13 @@ class De extends oe {
|
|
|
2499
2499
|
const {
|
|
2500
2500
|
mask: t,
|
|
2501
2501
|
pattern: i,
|
|
2502
|
-
blocks:
|
|
2502
|
+
blocks: s,
|
|
2503
2503
|
...n
|
|
2504
2504
|
} = {
|
|
2505
2505
|
...De.DEFAULTS,
|
|
2506
2506
|
...e
|
|
2507
2507
|
}, o = Object.assign({}, De.GET_DEFAULT_BLOCKS());
|
|
2508
|
-
e.min && (o.Y.from = e.min.getFullYear()), e.max && (o.Y.to = e.max.getFullYear()), e.min && e.max && o.Y.from === o.Y.to && (o.m.from = e.min.getMonth() + 1, o.m.to = e.max.getMonth() + 1, o.m.from === o.m.to && (o.d.from = e.min.getDate(), o.d.to = e.max.getDate())), Object.assign(o, this.blocks,
|
|
2508
|
+
e.min && (o.Y.from = e.min.getFullYear()), e.max && (o.Y.to = e.max.getFullYear()), e.min && e.max && o.Y.from === o.Y.to && (o.m.from = e.min.getMonth() + 1, o.m.to = e.max.getMonth() + 1, o.m.from === o.m.to && (o.d.from = e.min.getDate(), o.d.to = e.max.getDate())), Object.assign(o, this.blocks, s), super._update({
|
|
2509
2509
|
...n,
|
|
2510
2510
|
mask: $e(t) ? t : i,
|
|
2511
2511
|
blocks: o
|
|
@@ -2562,14 +2562,14 @@ De.DEFAULTS = {
|
|
|
2562
2562
|
...oe.DEFAULTS,
|
|
2563
2563
|
mask: Date,
|
|
2564
2564
|
pattern: is,
|
|
2565
|
-
format: (
|
|
2566
|
-
if (!
|
|
2567
|
-
const t = String(
|
|
2568
|
-
return [t, i,
|
|
2565
|
+
format: (a, e) => {
|
|
2566
|
+
if (!a) return "";
|
|
2567
|
+
const t = String(a.getDate()).padStart(2, "0"), i = String(a.getMonth() + 1).padStart(2, "0"), s = a.getFullYear();
|
|
2568
|
+
return [t, i, s].join(".");
|
|
2569
2569
|
},
|
|
2570
|
-
parse: (
|
|
2571
|
-
const [t, i,
|
|
2572
|
-
return new Date(
|
|
2570
|
+
parse: (a, e) => {
|
|
2571
|
+
const [t, i, s] = a.split(".").map(Number);
|
|
2572
|
+
return new Date(s, i - 1, t);
|
|
2573
2573
|
}
|
|
2574
2574
|
};
|
|
2575
2575
|
V.MaskedDate = De;
|
|
@@ -2587,12 +2587,12 @@ class Lt extends ne {
|
|
|
2587
2587
|
super._update(e), "mask" in e && (this.exposeMask = void 0, this.compiledMasks = Array.isArray(e.mask) ? e.mask.map((t) => {
|
|
2588
2588
|
const {
|
|
2589
2589
|
expose: i,
|
|
2590
|
-
...
|
|
2590
|
+
...s
|
|
2591
2591
|
} = ct(t), n = Pe({
|
|
2592
2592
|
overwrite: this._overwrite,
|
|
2593
2593
|
eager: this._eager,
|
|
2594
2594
|
skipInvalid: this._skipInvalid,
|
|
2595
|
-
...
|
|
2595
|
+
...s
|
|
2596
2596
|
});
|
|
2597
2597
|
return i && (this.exposeMask = n), n;
|
|
2598
2598
|
}) : []);
|
|
@@ -2604,12 +2604,12 @@ class Lt extends ne {
|
|
|
2604
2604
|
}
|
|
2605
2605
|
_applyDispatch(e, t, i) {
|
|
2606
2606
|
e === void 0 && (e = ""), t === void 0 && (t = {}), i === void 0 && (i = "");
|
|
2607
|
-
const
|
|
2607
|
+
const s = t.tail && t._beforeTailState != null ? t._beforeTailState._value : this.value, n = this.rawInputValue, o = t.tail && t._beforeTailState != null ? t._beforeTailState._rawInputValue : n, u = n.slice(o.length), c = this.currentMask, h = new O(), d = c?.state;
|
|
2608
2608
|
return this.currentMask = this.doDispatch(e, {
|
|
2609
2609
|
...t
|
|
2610
2610
|
}, i), this.currentMask && (this.currentMask !== c ? (this.currentMask.reset(), o && (this.currentMask.append(o, {
|
|
2611
2611
|
raw: !0
|
|
2612
|
-
}), h.tailShift = this.currentMask.value.length -
|
|
2612
|
+
}), h.tailShift = this.currentMask.value.length - s.length), u && (h.tailShift += this.currentMask.append(u, {
|
|
2613
2613
|
raw: !0,
|
|
2614
2614
|
tail: !0
|
|
2615
2615
|
}).tailShift)) : d && (this.currentMask.state = d)), h;
|
|
@@ -2641,21 +2641,21 @@ class Lt extends ne {
|
|
|
2641
2641
|
}
|
|
2642
2642
|
doPrepare(e, t) {
|
|
2643
2643
|
t === void 0 && (t = {});
|
|
2644
|
-
let [i,
|
|
2644
|
+
let [i, s] = super.doPrepare(e, t);
|
|
2645
2645
|
if (this.currentMask) {
|
|
2646
2646
|
let n;
|
|
2647
|
-
[i, n] = super.doPrepare(i, this.currentMaskFlags(t)),
|
|
2647
|
+
[i, n] = super.doPrepare(i, this.currentMaskFlags(t)), s = s.aggregate(n);
|
|
2648
2648
|
}
|
|
2649
|
-
return [i,
|
|
2649
|
+
return [i, s];
|
|
2650
2650
|
}
|
|
2651
2651
|
doPrepareChar(e, t) {
|
|
2652
2652
|
t === void 0 && (t = {});
|
|
2653
|
-
let [i,
|
|
2653
|
+
let [i, s] = super.doPrepareChar(e, t);
|
|
2654
2654
|
if (this.currentMask) {
|
|
2655
2655
|
let n;
|
|
2656
|
-
[i, n] = super.doPrepareChar(i, this.currentMaskFlags(t)),
|
|
2656
|
+
[i, n] = super.doPrepareChar(i, this.currentMaskFlags(t)), s = s.aggregate(n);
|
|
2657
2657
|
}
|
|
2658
|
-
return [i,
|
|
2658
|
+
return [i, s];
|
|
2659
2659
|
}
|
|
2660
2660
|
reset() {
|
|
2661
2661
|
var e;
|
|
@@ -2713,10 +2713,10 @@ class Lt extends ne {
|
|
|
2713
2713
|
const {
|
|
2714
2714
|
compiledMasks: t,
|
|
2715
2715
|
currentMaskRef: i,
|
|
2716
|
-
currentMask:
|
|
2716
|
+
currentMask: s,
|
|
2717
2717
|
...n
|
|
2718
2718
|
} = e;
|
|
2719
|
-
t && this.compiledMasks.forEach((o, u) => o.state = t[u]), i != null && (this.currentMask = i, this.currentMask.state =
|
|
2719
|
+
t && this.compiledMasks.forEach((o, u) => o.state = t[u]), i != null && (this.currentMask = i, this.currentMask.state = s), super.state = n;
|
|
2720
2720
|
}
|
|
2721
2721
|
extractInput(e, t, i) {
|
|
2722
2722
|
return this.currentMask ? this.currentMask.extractInput(e, t, i) : "";
|
|
@@ -2758,10 +2758,10 @@ class Lt extends ne {
|
|
|
2758
2758
|
return Array.isArray(e) ? this.compiledMasks.every((t, i) => {
|
|
2759
2759
|
if (!e[i]) return;
|
|
2760
2760
|
const {
|
|
2761
|
-
mask:
|
|
2761
|
+
mask: s,
|
|
2762
2762
|
...n
|
|
2763
2763
|
} = e[i];
|
|
2764
|
-
return Ct(t, n) && t.maskEquals(
|
|
2764
|
+
return Ct(t, n) && t.maskEquals(s);
|
|
2765
2765
|
}) : super.maskEquals(e);
|
|
2766
2766
|
}
|
|
2767
2767
|
typedValueEquals(e) {
|
|
@@ -2771,13 +2771,13 @@ class Lt extends ne {
|
|
|
2771
2771
|
}
|
|
2772
2772
|
Lt.DEFAULTS = {
|
|
2773
2773
|
...ne.DEFAULTS,
|
|
2774
|
-
dispatch: (
|
|
2774
|
+
dispatch: (a, e, t, i) => {
|
|
2775
2775
|
if (!e.compiledMasks.length) return;
|
|
2776
|
-
const
|
|
2776
|
+
const s = e.rawInputValue, n = e.compiledMasks.map((o, u) => {
|
|
2777
2777
|
const c = e.currentMask === o, h = c ? o.displayValue.length : o.nearestInputPos(o.displayValue.length, x.FORCE_LEFT);
|
|
2778
|
-
return o.rawInputValue !==
|
|
2778
|
+
return o.rawInputValue !== s ? (o.reset(), o.append(s, {
|
|
2779
2779
|
raw: !0
|
|
2780
|
-
})) : c || o.remove(h), o.append(
|
|
2780
|
+
})) : c || o.remove(h), o.append(a, e.currentMaskFlags(t)), o.appendTail(i), {
|
|
2781
2781
|
index: u,
|
|
2782
2782
|
weight: o.rawInputValue.length,
|
|
2783
2783
|
totalInputPositions: o.totalInputPositions(0, Math.max(h, o.nearestInputPos(o.displayValue.length, x.FORCE_LEFT)))
|
|
@@ -2803,21 +2803,21 @@ class At extends oe {
|
|
|
2803
2803
|
...i
|
|
2804
2804
|
} = e;
|
|
2805
2805
|
if (t) {
|
|
2806
|
-
const
|
|
2806
|
+
const s = t.map((u) => u.length), n = Math.min(...s), o = Math.max(...s) - n;
|
|
2807
2807
|
i.mask = "*".repeat(n), o && (i.mask += "[" + "*".repeat(o) + "]"), this.enum = t;
|
|
2808
2808
|
}
|
|
2809
2809
|
super._update(i);
|
|
2810
2810
|
}
|
|
2811
2811
|
_appendCharRaw(e, t) {
|
|
2812
2812
|
t === void 0 && (t = {});
|
|
2813
|
-
const i = Math.min(this.nearestInputPos(0, x.FORCE_RIGHT), this.value.length),
|
|
2814
|
-
if (
|
|
2815
|
-
|
|
2816
|
-
const c =
|
|
2813
|
+
const i = Math.min(this.nearestInputPos(0, x.FORCE_RIGHT), this.value.length), s = this.enum.filter((n) => this.matchValue(n, this.unmaskedValue + e, i));
|
|
2814
|
+
if (s.length) {
|
|
2815
|
+
s.length === 1 && this._forEachBlocksInRange(0, this.value.length, (o, u) => {
|
|
2816
|
+
const c = s[0][u];
|
|
2817
2817
|
u >= this.value.length || c === o.value || (o.reset(), o._appendChar(c, t));
|
|
2818
2818
|
});
|
|
2819
|
-
const n = super._appendCharRaw(
|
|
2820
|
-
return
|
|
2819
|
+
const n = super._appendCharRaw(s[0][this.value.length], t);
|
|
2820
|
+
return s.length === 1 && s[0].slice(this.unmaskedValue.length).split("").forEach((o) => n.aggregate(super._appendCharRaw(o))), n;
|
|
2821
2821
|
}
|
|
2822
2822
|
return new O({
|
|
2823
2823
|
skip: !this.isComplete
|
|
@@ -2829,11 +2829,11 @@ class At extends oe {
|
|
|
2829
2829
|
remove(e, t) {
|
|
2830
2830
|
if (e === void 0 && (e = 0), t === void 0 && (t = this.displayValue.length), e === t) return new O();
|
|
2831
2831
|
const i = Math.min(super.nearestInputPos(0, x.FORCE_RIGHT), this.value.length);
|
|
2832
|
-
let
|
|
2833
|
-
for (
|
|
2832
|
+
let s;
|
|
2833
|
+
for (s = e; s >= 0 && !(this.enum.filter((o) => this.matchValue(o, this.value.slice(i, s), i)).length > 1); --s)
|
|
2834
2834
|
;
|
|
2835
|
-
const n = super.remove(
|
|
2836
|
-
return n.tailShift +=
|
|
2835
|
+
const n = super.remove(s, t);
|
|
2836
|
+
return n.tailShift += s - e, n;
|
|
2837
2837
|
}
|
|
2838
2838
|
get isComplete() {
|
|
2839
2839
|
return this.enum.indexOf(this.value) >= 0;
|
|
@@ -2841,7 +2841,7 @@ class At extends oe {
|
|
|
2841
2841
|
}
|
|
2842
2842
|
At.DEFAULTS = {
|
|
2843
2843
|
...oe.DEFAULTS,
|
|
2844
|
-
matchValue: (
|
|
2844
|
+
matchValue: (a, e, t) => a.indexOf(e, t) === t
|
|
2845
2845
|
};
|
|
2846
2846
|
V.MaskedEnum = At;
|
|
2847
2847
|
class ss extends ne {
|
|
@@ -2902,7 +2902,7 @@ class fe extends ne {
|
|
|
2902
2902
|
}
|
|
2903
2903
|
doPrepareChar(e, t) {
|
|
2904
2904
|
t === void 0 && (t = {});
|
|
2905
|
-
const [i,
|
|
2905
|
+
const [i, s] = super.doPrepareChar(this._removeThousandsSeparators(this.scale && this.mapToRadix.length && /*
|
|
2906
2906
|
radix should be mapped when
|
|
2907
2907
|
1) input is done from keyboard = flags.input && flags.raw
|
|
2908
2908
|
2) unmasked value is set = !flags.input && !flags.raw
|
|
@@ -2911,13 +2911,13 @@ class fe extends ne {
|
|
|
2911
2911
|
2) raw value is set = !flags.input && flags.raw
|
|
2912
2912
|
*/
|
|
2913
2913
|
(t.input && t.raw || !t.input && !t.raw) ? e.replace(this._mapToRadixRegExp, this.radix) : e), t);
|
|
2914
|
-
return e && !i && (
|
|
2914
|
+
return e && !i && (s.skip = !0), i && !this.allowPositive && !this.value && i !== "-" && s.aggregate(this._appendChar("-")), [i, s];
|
|
2915
2915
|
}
|
|
2916
2916
|
_separatorsCount(e, t) {
|
|
2917
2917
|
t === void 0 && (t = !1);
|
|
2918
2918
|
let i = 0;
|
|
2919
|
-
for (let
|
|
2920
|
-
this._value.indexOf(this.thousandsSeparator,
|
|
2919
|
+
for (let s = 0; s < e; ++s)
|
|
2920
|
+
this._value.indexOf(this.thousandsSeparator, s) === s && (++i, t && (e += this.thousandsSeparator.length));
|
|
2921
2921
|
return i;
|
|
2922
2922
|
}
|
|
2923
2923
|
_separatorsCountFromSlice(e) {
|
|
@@ -2928,7 +2928,7 @@ class fe extends ne {
|
|
|
2928
2928
|
}
|
|
2929
2929
|
_appendCharRaw(e, t) {
|
|
2930
2930
|
t === void 0 && (t = {});
|
|
2931
|
-
const i = t.tail && t._beforeTailState ? t._beforeTailState._value : this._value,
|
|
2931
|
+
const i = t.tail && t._beforeTailState ? t._beforeTailState._value : this._value, s = this._separatorsCountFromSlice(i);
|
|
2932
2932
|
this._value = this._removeThousandsSeparators(this.value);
|
|
2933
2933
|
const n = this._value;
|
|
2934
2934
|
this._value += e;
|
|
@@ -2944,8 +2944,8 @@ class fe extends ne {
|
|
|
2944
2944
|
rawInserted: c ? "" : e,
|
|
2945
2945
|
skip: c
|
|
2946
2946
|
}) : (this._value = n, h = new O()), this._value = this._insertThousandsSeparators(this._value);
|
|
2947
|
-
const d = t.tail && t._beforeTailState ? t._beforeTailState._value : this._value,
|
|
2948
|
-
return h.tailShift += (
|
|
2947
|
+
const d = t.tail && t._beforeTailState ? t._beforeTailState._value : this._value, m = this._separatorsCountFromSlice(d);
|
|
2948
|
+
return h.tailShift += (m - s) * this.thousandsSeparator.length, h;
|
|
2949
2949
|
}
|
|
2950
2950
|
_findSeparatorAround(e) {
|
|
2951
2951
|
if (this.thousandsSeparator) {
|
|
@@ -2957,13 +2957,13 @@ class fe extends ne {
|
|
|
2957
2957
|
_adjustRangeWithSeparators(e, t) {
|
|
2958
2958
|
const i = this._findSeparatorAround(e);
|
|
2959
2959
|
i >= 0 && (e = i);
|
|
2960
|
-
const
|
|
2961
|
-
return
|
|
2960
|
+
const s = this._findSeparatorAround(t);
|
|
2961
|
+
return s >= 0 && (t = s + this.thousandsSeparator.length), [e, t];
|
|
2962
2962
|
}
|
|
2963
2963
|
remove(e, t) {
|
|
2964
2964
|
e === void 0 && (e = 0), t === void 0 && (t = this.displayValue.length), [e, t] = this._adjustRangeWithSeparators(e, t);
|
|
2965
|
-
const i = this.value.slice(0, e),
|
|
2966
|
-
this._value = this._insertThousandsSeparators(this._removeThousandsSeparators(i +
|
|
2965
|
+
const i = this.value.slice(0, e), s = this.value.slice(t), n = this._separatorsCount(i.length);
|
|
2966
|
+
this._value = this._insertThousandsSeparators(this._removeThousandsSeparators(i + s));
|
|
2967
2967
|
const o = this._separatorsCountFromSlice(i);
|
|
2968
2968
|
return new O({
|
|
2969
2969
|
tailShift: (o - n) * this.thousandsSeparator.length
|
|
@@ -2977,8 +2977,8 @@ class fe extends ne {
|
|
|
2977
2977
|
case x.FORCE_LEFT: {
|
|
2978
2978
|
const i = this._findSeparatorAround(e - 1);
|
|
2979
2979
|
if (i >= 0) {
|
|
2980
|
-
const
|
|
2981
|
-
if (e <
|
|
2980
|
+
const s = i + this.thousandsSeparator.length;
|
|
2981
|
+
if (e < s || this.value.length <= s || t === x.FORCE_LEFT)
|
|
2982
2982
|
return i;
|
|
2983
2983
|
}
|
|
2984
2984
|
break;
|
|
@@ -3004,7 +3004,7 @@ class fe extends ne {
|
|
|
3004
3004
|
}
|
|
3005
3005
|
_normalizeZeros(e) {
|
|
3006
3006
|
const t = this._removeThousandsSeparators(e).split(this.radix);
|
|
3007
|
-
return t[0] = t[0].replace(/^(\D*)(0*)(\d*)/, (i,
|
|
3007
|
+
return t[0] = t[0].replace(/^(\D*)(0*)(\d*)/, (i, s, n, o) => s + o), e.length && !/\d$/.test(t[0]) && (t[0] = t[0] + "0"), t.length > 1 && (t[1] = t[1].replace(/0*$/, ""), t[1].length || (t.length = 1)), this._insertThousandsSeparators(t.join(this.radix));
|
|
3008
3008
|
}
|
|
3009
3009
|
_padFractionalZeros(e) {
|
|
3010
3010
|
if (!e) return e;
|
|
@@ -3013,8 +3013,8 @@ class fe extends ne {
|
|
|
3013
3013
|
}
|
|
3014
3014
|
doSkipInvalid(e, t, i) {
|
|
3015
3015
|
t === void 0 && (t = {});
|
|
3016
|
-
const
|
|
3017
|
-
return super.doSkipInvalid(e, t, i) && !
|
|
3016
|
+
const s = this.scale === 0 && e !== this.thousandsSeparator && (e === this.radix || e === fe.UNMASKED_RADIX || this.mapToRadix.includes(e));
|
|
3017
|
+
return super.doSkipInvalid(e, t, i) && !s;
|
|
3018
3018
|
}
|
|
3019
3019
|
get unmaskedValue() {
|
|
3020
3020
|
return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix, fe.UNMASKED_RADIX);
|
|
@@ -3060,7 +3060,7 @@ fe.DEFAULTS = {
|
|
|
3060
3060
|
normalizeZeros: !0,
|
|
3061
3061
|
padFractionalZeros: !1,
|
|
3062
3062
|
parse: Number,
|
|
3063
|
-
format: (
|
|
3063
|
+
format: (a) => a.toLocaleString("en-US", {
|
|
3064
3064
|
useGrouping: !1,
|
|
3065
3065
|
maximumFractionDigits: 20
|
|
3066
3066
|
})
|
|
@@ -3071,13 +3071,13 @@ const zt = {
|
|
|
3071
3071
|
UNMASKED: "unmaskedValue",
|
|
3072
3072
|
TYPED: "typedValue"
|
|
3073
3073
|
};
|
|
3074
|
-
function bi(
|
|
3074
|
+
function bi(a, e, t) {
|
|
3075
3075
|
e === void 0 && (e = zt.MASKED), t === void 0 && (t = zt.MASKED);
|
|
3076
|
-
const i = Pe(
|
|
3077
|
-
return (
|
|
3076
|
+
const i = Pe(a);
|
|
3077
|
+
return (s) => i.runIsolated((n) => (n[e] = s, n[t]));
|
|
3078
3078
|
}
|
|
3079
|
-
function as(
|
|
3080
|
-
return bi(e, t, i)(
|
|
3079
|
+
function as(a, e, t, i) {
|
|
3080
|
+
return bi(e, t, i)(a);
|
|
3081
3081
|
}
|
|
3082
3082
|
V.PIPE_TYPE = zt;
|
|
3083
3083
|
V.createPipe = bi;
|
|
@@ -3098,7 +3098,7 @@ class ns extends oe {
|
|
|
3098
3098
|
super.updateOptions(e);
|
|
3099
3099
|
}
|
|
3100
3100
|
_update(e) {
|
|
3101
|
-
var t, i,
|
|
3101
|
+
var t, i, s;
|
|
3102
3102
|
const {
|
|
3103
3103
|
repeat: n,
|
|
3104
3104
|
...o
|
|
@@ -3106,7 +3106,7 @@ class ns extends oe {
|
|
|
3106
3106
|
this._blockOpts = Object.assign({}, this._blockOpts, o);
|
|
3107
3107
|
const u = Pe(this._blockOpts);
|
|
3108
3108
|
this.repeat = (t = (i = n ?? u.repeat) != null ? i : this.repeat) != null ? t : 1 / 0, super._update({
|
|
3109
|
-
mask: "m".repeat(Math.max(this.repeatTo === 1 / 0 && ((
|
|
3109
|
+
mask: "m".repeat(Math.max(this.repeatTo === 1 / 0 && ((s = this._blocks) == null ? void 0 : s.length) || 0, this.repeatFrom)),
|
|
3110
3110
|
blocks: {
|
|
3111
3111
|
m: u
|
|
3112
3112
|
},
|
|
@@ -3127,31 +3127,31 @@ class ns extends oe {
|
|
|
3127
3127
|
t === void 0 && (t = {});
|
|
3128
3128
|
const i = new O();
|
|
3129
3129
|
for (
|
|
3130
|
-
let c = (
|
|
3130
|
+
let c = (s = (n = this._mapPosToBlock(this.displayValue.length)) == null ? void 0 : n.index) != null ? s : Math.max(this._blocks.length - 1, 0), h, d;
|
|
3131
3131
|
// try to get a block or
|
|
3132
3132
|
// try to allocate a new block if not allocated already
|
|
3133
3133
|
h = (o = this._blocks[c]) != null ? o : d = !d && this._allocateBlock(c);
|
|
3134
3134
|
++c
|
|
3135
3135
|
) {
|
|
3136
|
-
var
|
|
3137
|
-
const
|
|
3136
|
+
var s, n, o, u;
|
|
3137
|
+
const m = h._appendChar(e, {
|
|
3138
3138
|
...t,
|
|
3139
3139
|
_beforeTailState: (u = t._beforeTailState) == null || (u = u._blocks) == null ? void 0 : u[c]
|
|
3140
3140
|
});
|
|
3141
|
-
if (
|
|
3141
|
+
if (m.skip && d) {
|
|
3142
3142
|
this._blocks.pop(), this.mask = this.mask.slice(1);
|
|
3143
3143
|
break;
|
|
3144
3144
|
}
|
|
3145
|
-
if (i.aggregate(
|
|
3145
|
+
if (i.aggregate(m), m.consumed) break;
|
|
3146
3146
|
}
|
|
3147
3147
|
return i;
|
|
3148
3148
|
}
|
|
3149
3149
|
_trimEmptyTail(e, t) {
|
|
3150
|
-
var i,
|
|
3150
|
+
var i, s;
|
|
3151
3151
|
e === void 0 && (e = 0);
|
|
3152
3152
|
const n = Math.max(((i = this._mapPosToBlock(e)) == null ? void 0 : i.index) || 0, this.repeatFrom, 0);
|
|
3153
3153
|
let o;
|
|
3154
|
-
t != null && (o = (
|
|
3154
|
+
t != null && (o = (s = this._mapPosToBlock(t)) == null ? void 0 : s.index), o == null && (o = this._blocks.length - 1);
|
|
3155
3155
|
let u = 0;
|
|
3156
3156
|
for (let c = o; n <= c && !this._blocks[c].unmaskedValue; --c, ++u)
|
|
3157
3157
|
;
|
|
@@ -3195,7 +3195,7 @@ var os = {
|
|
|
3195
3195
|
eager: {
|
|
3196
3196
|
required: !1,
|
|
3197
3197
|
default: void 0,
|
|
3198
|
-
validator: (
|
|
3198
|
+
validator: (a) => ["append", "remove"].includes(a) || typeof a == "boolean"
|
|
3199
3199
|
},
|
|
3200
3200
|
skipInvalid: {
|
|
3201
3201
|
type: Boolean,
|
|
@@ -3225,7 +3225,7 @@ var os = {
|
|
|
3225
3225
|
autofix: {
|
|
3226
3226
|
required: !1,
|
|
3227
3227
|
default: void 0,
|
|
3228
|
-
validator: (
|
|
3228
|
+
validator: (a) => a === "pad" || typeof a == "boolean"
|
|
3229
3229
|
},
|
|
3230
3230
|
// number
|
|
3231
3231
|
radix: String,
|
|
@@ -3247,42 +3247,42 @@ var os = {
|
|
|
3247
3247
|
// dynamic
|
|
3248
3248
|
dispatch: Function
|
|
3249
3249
|
};
|
|
3250
|
-
function rs(
|
|
3250
|
+
function rs(a, e) {
|
|
3251
3251
|
let {
|
|
3252
3252
|
emit: t,
|
|
3253
3253
|
onAccept: i,
|
|
3254
|
-
onComplete:
|
|
3254
|
+
onComplete: s,
|
|
3255
3255
|
defaultValue: n,
|
|
3256
3256
|
defaultUnmaskedValue: o,
|
|
3257
3257
|
defaultTypedValue: u
|
|
3258
3258
|
} = e === void 0 ? {} : e;
|
|
3259
|
-
const c = Mi(
|
|
3260
|
-
let
|
|
3261
|
-
function
|
|
3262
|
-
|
|
3259
|
+
const c = Mi(a) ? a : E(a), h = E(), d = E(), m = E(""), r = E(""), f = E();
|
|
3260
|
+
let v, k = m.value, b = r.value, A = f.value;
|
|
3261
|
+
function I() {
|
|
3262
|
+
A = f.value = d.value.typedValue, b = r.value = d.value.unmaskedValue, k = m.value = d.value.value;
|
|
3263
3263
|
}
|
|
3264
3264
|
function z(N) {
|
|
3265
|
-
|
|
3265
|
+
I(), t && (t("accept", m.value, N), t("accept:masked", m.value, N), t("accept:typed", f.value, N), t("accept:unmasked", r.value, N)), i?.(N);
|
|
3266
3266
|
}
|
|
3267
|
-
function
|
|
3268
|
-
t && (t("complete", d.value.value, N), t("complete:masked", d.value.value, N), t("complete:typed", d.value.typedValue, N), t("complete:unmasked", d.value.unmaskedValue, N)),
|
|
3267
|
+
function M(N) {
|
|
3268
|
+
t && (t("complete", d.value.value, N), t("complete:masked", d.value.value, N), t("complete:typed", d.value.typedValue, N), t("complete:unmasked", d.value.unmaskedValue, N)), s?.(N);
|
|
3269
3269
|
}
|
|
3270
3270
|
const T = () => {
|
|
3271
|
-
!d.value || r.value === void 0 || (
|
|
3271
|
+
!d.value || r.value === void 0 || (b !== r.value && (d.value.unmaskedValue = r.value, d.value.unmaskedValue !== r.value && z()), b = void 0);
|
|
3272
3272
|
};
|
|
3273
3273
|
le(r, T);
|
|
3274
3274
|
const R = () => {
|
|
3275
|
-
!d.value ||
|
|
3275
|
+
!d.value || m.value === void 0 || (k !== m.value && (d.value.value = m.value, d.value.value !== m.value && z()), k = void 0);
|
|
3276
3276
|
};
|
|
3277
|
-
le(
|
|
3277
|
+
le(m, R);
|
|
3278
3278
|
const se = () => {
|
|
3279
|
-
!d.value ||
|
|
3279
|
+
!d.value || f.value === void 0 || (A !== f.value && (d.value.typedValue = f.value, d.value.masked.typedValueEquals(f.value) || z()), A = void 0);
|
|
3280
3280
|
};
|
|
3281
|
-
le(
|
|
3281
|
+
le(f, se);
|
|
3282
3282
|
function q() {
|
|
3283
|
-
|
|
3283
|
+
v = h.value;
|
|
3284
3284
|
const N = c.value;
|
|
3285
|
-
!
|
|
3285
|
+
!v || !(N != null && N.mask) || (d.value = V(v, N), n !== void 0 && (m.value = n), o !== void 0 && (r.value = o), u !== void 0 && (f.value = u), T(), R(), se(), I(), d.value.on("accept", z).on("complete", M));
|
|
3286
3286
|
}
|
|
3287
3287
|
function ue() {
|
|
3288
3288
|
var N;
|
|
@@ -3290,21 +3290,21 @@ function rs(s, e) {
|
|
|
3290
3290
|
}
|
|
3291
3291
|
return ut(q), Zt(ue), le([h, c], () => {
|
|
3292
3292
|
const N = h.value, Ne = c.value;
|
|
3293
|
-
(!(Ne != null && Ne.mask) || N !==
|
|
3293
|
+
(!(Ne != null && Ne.mask) || N !== v) && ue(), N && (d.value ? d.value.updateOptions(Ne) : q());
|
|
3294
3294
|
}), {
|
|
3295
3295
|
el: h,
|
|
3296
3296
|
mask: W(d),
|
|
3297
|
-
masked:
|
|
3297
|
+
masked: m,
|
|
3298
3298
|
unmasked: r,
|
|
3299
|
-
typed:
|
|
3299
|
+
typed: f
|
|
3300
3300
|
};
|
|
3301
3301
|
}
|
|
3302
|
-
function ls(
|
|
3303
|
-
return
|
|
3304
|
-
...
|
|
3305
|
-
}, Object.keys(
|
|
3306
|
-
(
|
|
3307
|
-
}),
|
|
3302
|
+
function ls(a, e) {
|
|
3303
|
+
return a = {
|
|
3304
|
+
...a
|
|
3305
|
+
}, Object.keys(a).forEach((t) => {
|
|
3306
|
+
(a[t] === void 0 || e.includes(t)) && delete a[t];
|
|
3307
|
+
}), a;
|
|
3308
3308
|
}
|
|
3309
3309
|
const us = ["typed", "unmasked", "value", "modelValue"];
|
|
3310
3310
|
var cs = be({
|
|
@@ -3321,36 +3321,36 @@ var cs = be({
|
|
|
3321
3321
|
...os
|
|
3322
3322
|
},
|
|
3323
3323
|
emits: ["update:modelValue", "update:masked", "update:value", "update:unmasked", "update:typed", "accept", "accept:value", "accept:masked", "accept:unmasked", "accept:typed", "complete", "complete:value", "complete:masked", "complete:unmasked", "complete:typed"],
|
|
3324
|
-
setup(
|
|
3324
|
+
setup(a, e) {
|
|
3325
3325
|
let {
|
|
3326
3326
|
attrs: t,
|
|
3327
3327
|
emit: i
|
|
3328
3328
|
} = e;
|
|
3329
3329
|
const {
|
|
3330
|
-
el:
|
|
3330
|
+
el: s,
|
|
3331
3331
|
mask: n,
|
|
3332
3332
|
masked: o,
|
|
3333
3333
|
unmasked: u,
|
|
3334
3334
|
typed: c
|
|
3335
|
-
} = rs(ls(
|
|
3335
|
+
} = rs(ls(a, us), {
|
|
3336
3336
|
emit: i,
|
|
3337
|
-
onAccept: (
|
|
3338
|
-
const
|
|
3339
|
-
i("accept:value",
|
|
3337
|
+
onAccept: (f) => {
|
|
3338
|
+
const v = o.value;
|
|
3339
|
+
i("accept:value", v, f), i("update:value", v, f), i("update:masked", v, f), i("update:modelValue", v, f), i("update:unmasked", u.value, f), i("update:typed", c.value, f);
|
|
3340
3340
|
},
|
|
3341
|
-
onComplete: (
|
|
3342
|
-
i("complete:value", o.value,
|
|
3341
|
+
onComplete: (f) => {
|
|
3342
|
+
i("complete:value", o.value, f);
|
|
3343
3343
|
}
|
|
3344
|
-
}), h = ot(
|
|
3345
|
-
return o.value = d.value || h.value || "", u.value =
|
|
3346
|
-
const
|
|
3344
|
+
}), h = ot(a, "value"), d = ot(a, "modelValue"), m = ot(a, "unmasked"), r = ot(a, "typed");
|
|
3345
|
+
return o.value = d.value || h.value || "", u.value = m.value || "", c.value = r.value, le(h, (f) => o.value = f), le(d, (f) => o.value = f), le(m, (f) => u.value = f), le(r, (f) => c.value = f), () => {
|
|
3346
|
+
const f = {
|
|
3347
3347
|
...t,
|
|
3348
|
-
value:
|
|
3349
|
-
ref:
|
|
3348
|
+
value: a.value != null ? a.value : a.modelValue != null ? a.modelValue : n.value ? n.value.displayValue : "",
|
|
3349
|
+
ref: s
|
|
3350
3350
|
};
|
|
3351
|
-
return
|
|
3352
|
-
i("update:modelValue",
|
|
3353
|
-
}), Li("input",
|
|
3351
|
+
return a.mask || (f.onInput = (v) => {
|
|
3352
|
+
i("update:modelValue", v.target.value), i("update:value", v.target.value);
|
|
3353
|
+
}), Li("input", f);
|
|
3354
3354
|
};
|
|
3355
3355
|
}
|
|
3356
3356
|
}), ds = cs;
|
|
@@ -3378,90 +3378,94 @@ const hs = ["for"], ps = { class: "state-layer" }, fs = { class: "content" }, ms
|
|
|
3378
3378
|
} }
|
|
3379
3379
|
},
|
|
3380
3380
|
emits: ["update:modelValue", "complete"],
|
|
3381
|
-
setup(
|
|
3382
|
-
const
|
|
3383
|
-
get: () =>
|
|
3384
|
-
set: (
|
|
3385
|
-
|
|
3381
|
+
setup(a, { expose: e, emit: t }) {
|
|
3382
|
+
const i = Ai(), s = a, n = $(() => typeof s.error == "string" ? s.error : s.error[0]), o = ot(s, "id"), u = t, c = E(""), h = $({
|
|
3383
|
+
get: () => s.modelValue !== void 0 ? s.modelValue : c.value,
|
|
3384
|
+
set: (k) => {
|
|
3385
|
+
u("update:modelValue", k), c.value = k;
|
|
3386
3386
|
}
|
|
3387
|
-
}), h = $(() => {
|
|
3388
|
-
const f = ["default-class"];
|
|
3389
|
-
return t.disabled != null && f.push("phila-input--disabled"), a.value && f.push("phila-input--error"), t.required != null && f.push("phila-input--required"), Nt(...f);
|
|
3390
3387
|
}), d = $(() => {
|
|
3391
|
-
const
|
|
3392
|
-
return
|
|
3393
|
-
}),
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
}), r =
|
|
3397
|
-
|
|
3388
|
+
const k = ["default-class"];
|
|
3389
|
+
return i.disabled != null && k.push("phila-input--disabled"), n.value && k.push("phila-input--error"), i.required != null && k.push("phila-input--required"), Nt(...k);
|
|
3390
|
+
}), m = $(() => {
|
|
3391
|
+
const k = [];
|
|
3392
|
+
return h.value !== "" && k.push("phila-text-field--filled"), s.className && k.push(s.className), Nt(...k);
|
|
3393
|
+
}), r = $(() => {
|
|
3394
|
+
if (!(s.label || i["aria-label"]))
|
|
3395
|
+
return s.placeholder || void 0;
|
|
3396
|
+
}), f = E(null), v = (k) => {
|
|
3397
|
+
k.target.closest("button") || f.value?.focus();
|
|
3398
3398
|
};
|
|
3399
|
-
return (f, k) => (
|
|
3400
|
-
class: me(["phila-input",
|
|
3399
|
+
return e({ inputRef: f }), (k, b) => (_(), L("div", {
|
|
3400
|
+
class: me(["phila-input", d.value])
|
|
3401
3401
|
}, [
|
|
3402
|
-
|
|
3402
|
+
s.label ? (_(), L("label", {
|
|
3403
3403
|
key: 0,
|
|
3404
|
-
for:
|
|
3404
|
+
for: o.value,
|
|
3405
3405
|
class: "has-text-label-small phila-label"
|
|
3406
|
-
}, Q(
|
|
3406
|
+
}, Q(s.label), 9, hs)) : Z("", !0),
|
|
3407
3407
|
D("div", {
|
|
3408
|
-
class: me(["phila-text-field",
|
|
3409
|
-
onClick: hi(
|
|
3408
|
+
class: me(["phila-text-field", m.value]),
|
|
3409
|
+
onClick: hi(v, ["prevent"])
|
|
3410
3410
|
}, [
|
|
3411
3411
|
D("div", ps, [
|
|
3412
|
-
|
|
3412
|
+
s.leadingIcon ? (_(), K(y(Te), {
|
|
3413
3413
|
key: 0,
|
|
3414
|
-
"icon-class":
|
|
3414
|
+
"icon-class": s.leadingIcon,
|
|
3415
3415
|
inline: "",
|
|
3416
3416
|
decorative: ""
|
|
3417
3417
|
}, null, 8, ["icon-class"])) : Z("", !0),
|
|
3418
3418
|
D("div", fs, [
|
|
3419
3419
|
D("div", ms, [
|
|
3420
|
-
|
|
3421
|
-
id:
|
|
3422
|
-
modelValue:
|
|
3423
|
-
"onUpdate:modelValue":
|
|
3420
|
+
s.imaskProps?.mask ? (_(), K(y(ds), _t({ key: 0 }, { ...y(i), ...s.imaskProps }, {
|
|
3421
|
+
id: o.value,
|
|
3422
|
+
modelValue: h.value,
|
|
3423
|
+
"onUpdate:modelValue": b[0] || (b[0] = (A) => h.value = A),
|
|
3424
3424
|
class: "phila-text-field-input has-text-body-default",
|
|
3425
|
-
placeholder:
|
|
3426
|
-
onComplete:
|
|
3427
|
-
}), null, 16, ["id", "modelValue", "placeholder"])) : pi((
|
|
3428
|
-
|
|
3429
|
-
|
|
3425
|
+
placeholder: s.placeholder,
|
|
3426
|
+
onComplete: b[1] || (b[1] = () => u("complete", c.value))
|
|
3427
|
+
}), null, 16, ["id", "modelValue", "placeholder"])) : pi((_(), L("input", _t({
|
|
3428
|
+
key: 1,
|
|
3429
|
+
id: o.value,
|
|
3430
|
+
ref_key: "inputRef",
|
|
3431
|
+
ref: f
|
|
3432
|
+
}, y(i), {
|
|
3433
|
+
"onUpdate:modelValue": b[2] || (b[2] = (A) => h.value = A),
|
|
3430
3434
|
class: "phila-text-field-input has-text-body-default",
|
|
3431
|
-
placeholder:
|
|
3432
|
-
"aria-label":
|
|
3435
|
+
placeholder: s.placeholder,
|
|
3436
|
+
"aria-label": r.value
|
|
3433
3437
|
}), null, 16, gs)), [
|
|
3434
|
-
[Ii,
|
|
3438
|
+
[Ii, h.value]
|
|
3435
3439
|
])
|
|
3436
3440
|
])
|
|
3437
3441
|
]),
|
|
3438
|
-
|
|
3442
|
+
h.value != "" ? (_(), K(y(ji), {
|
|
3439
3443
|
key: 1,
|
|
3440
3444
|
variant: "standard",
|
|
3441
3445
|
size: "small",
|
|
3442
3446
|
"icon-only": "",
|
|
3443
3447
|
"icon-definition": y(Wi),
|
|
3444
|
-
onClick:
|
|
3448
|
+
onClick: b[3] || (b[3] = (A) => h.value = "")
|
|
3445
3449
|
}, null, 8, ["icon-definition"])) : Z("", !0),
|
|
3446
|
-
|
|
3450
|
+
s.trailingIcon ? (_(), K(y(Te), {
|
|
3447
3451
|
key: 2,
|
|
3448
3452
|
size: "small",
|
|
3449
|
-
"icon-class":
|
|
3453
|
+
"icon-class": s.trailingIcon,
|
|
3450
3454
|
inline: "",
|
|
3451
3455
|
decorative: ""
|
|
3452
3456
|
}, null, 8, ["icon-class"])) : Z("", !0),
|
|
3453
|
-
Se(
|
|
3457
|
+
Se(k.$slots, "trailing-action")
|
|
3454
3458
|
])
|
|
3455
3459
|
], 2),
|
|
3456
|
-
|
|
3457
|
-
|
|
3460
|
+
s.supportingText ? (_(), L("div", vs, Q(s.supportingText), 1)) : Z("", !0),
|
|
3461
|
+
n.value ? (_(), L("div", ys, [
|
|
3458
3462
|
ee(y(Te), {
|
|
3459
|
-
"icon-definition": y(
|
|
3463
|
+
"icon-definition": y(Gi),
|
|
3460
3464
|
size: "small",
|
|
3461
3465
|
inline: "",
|
|
3462
3466
|
decorative: ""
|
|
3463
3467
|
}, null, 8, ["icon-definition"]),
|
|
3464
|
-
Ve(" " + Q(
|
|
3468
|
+
Ve(" " + Q(n.value), 1)
|
|
3465
3469
|
])) : Z("", !0)
|
|
3466
3470
|
], 2));
|
|
3467
3471
|
}
|
|
@@ -3505,16 +3509,16 @@ const Es = {
|
|
|
3505
3509
|
error: {},
|
|
3506
3510
|
unavailable: { type: Boolean }
|
|
3507
3511
|
},
|
|
3508
|
-
setup(
|
|
3509
|
-
return (e, t) => (
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
+
setup(a) {
|
|
3513
|
+
return (e, t) => (_(), L(ke, null, [
|
|
3514
|
+
a.loading && !a.unavailable ? (_(), L("span", Es, " Loading... ")) : Z("", !0),
|
|
3515
|
+
a.error ? (_(), L("span", {
|
|
3512
3516
|
key: 1,
|
|
3513
3517
|
class: "error-indicator",
|
|
3514
|
-
"aria-label":
|
|
3518
|
+
"aria-label": a.error,
|
|
3515
3519
|
role: "status"
|
|
3516
3520
|
}, " Error ", 8, Fs)) : Z("", !0),
|
|
3517
|
-
|
|
3521
|
+
a.unavailable ? (_(), L("span", xs, " (zoom in) ")) : Z("", !0)
|
|
3518
3522
|
], 64));
|
|
3519
3523
|
}
|
|
3520
3524
|
}), St = /* @__PURE__ */ Oe(Ls, [["__scopeId", "data-v-19b1b402"]]), As = { class: "opacity-control" }, Is = ["for"], Ms = ["id", "value", "aria-label"], Ds = /* @__PURE__ */ be({
|
|
@@ -3525,25 +3529,25 @@ const Es = {
|
|
|
3525
3529
|
opacity: {}
|
|
3526
3530
|
},
|
|
3527
3531
|
emits: ["update:opacity"],
|
|
3528
|
-
setup(
|
|
3532
|
+
setup(a, { emit: e }) {
|
|
3529
3533
|
const t = e;
|
|
3530
|
-
function i(
|
|
3531
|
-
const n =
|
|
3534
|
+
function i(s) {
|
|
3535
|
+
const n = s.target;
|
|
3532
3536
|
t("update:opacity", parseFloat(n.value));
|
|
3533
3537
|
}
|
|
3534
|
-
return (
|
|
3538
|
+
return (s, n) => (_(), L("div", As, [
|
|
3535
3539
|
D("label", {
|
|
3536
3540
|
class: "opacity-label",
|
|
3537
|
-
for: "opacity-" +
|
|
3538
|
-
}, " Opacity: " + Q(Math.round(
|
|
3541
|
+
for: "opacity-" + a.layerId
|
|
3542
|
+
}, " Opacity: " + Q(Math.round(a.opacity * 100)) + "% ", 9, Is),
|
|
3539
3543
|
D("input", {
|
|
3540
|
-
id: "opacity-" +
|
|
3544
|
+
id: "opacity-" + a.layerId,
|
|
3541
3545
|
type: "range",
|
|
3542
3546
|
min: "0",
|
|
3543
3547
|
max: "1",
|
|
3544
3548
|
step: "0.05",
|
|
3545
|
-
value:
|
|
3546
|
-
"aria-label": "Opacity for " +
|
|
3549
|
+
value: a.opacity,
|
|
3550
|
+
"aria-label": "Opacity for " + a.layerName,
|
|
3547
3551
|
class: "opacity-slider",
|
|
3548
3552
|
onInput: i
|
|
3549
3553
|
}, null, 40, Ms)
|
|
@@ -3558,21 +3562,21 @@ const Es = {
|
|
|
3558
3562
|
items: {},
|
|
3559
3563
|
label: {}
|
|
3560
3564
|
},
|
|
3561
|
-
setup(
|
|
3562
|
-
return (e, t) => (
|
|
3565
|
+
setup(a) {
|
|
3566
|
+
return (e, t) => (_(), L("ul", {
|
|
3563
3567
|
class: "layer-legend",
|
|
3564
|
-
"aria-label":
|
|
3568
|
+
"aria-label": a.label
|
|
3565
3569
|
}, [
|
|
3566
|
-
(
|
|
3567
|
-
key:
|
|
3570
|
+
(_(!0), L(ke, null, Ae(a.items, (i, s) => (_(), L("li", {
|
|
3571
|
+
key: s,
|
|
3568
3572
|
class: "legend-item"
|
|
3569
3573
|
}, [
|
|
3570
|
-
i.type === "circle" ? (
|
|
3574
|
+
i.type === "circle" ? (_(), L("span", {
|
|
3571
3575
|
key: 0,
|
|
3572
3576
|
class: "legend-symbol legend-circle",
|
|
3573
3577
|
style: we({ backgroundColor: i.color }),
|
|
3574
3578
|
"aria-hidden": "true"
|
|
3575
|
-
}, null, 4)) : i.type === "line" ? (
|
|
3579
|
+
}, null, 4)) : i.type === "line" ? (_(), L("span", {
|
|
3576
3580
|
key: 1,
|
|
3577
3581
|
class: "legend-symbol legend-line",
|
|
3578
3582
|
style: we({
|
|
@@ -3580,7 +3584,7 @@ const Es = {
|
|
|
3580
3584
|
height: `${i.width || 2}px`
|
|
3581
3585
|
}),
|
|
3582
3586
|
"aria-hidden": "true"
|
|
3583
|
-
}, null, 4)) : i.type === "fill" ? (
|
|
3587
|
+
}, null, 4)) : i.type === "fill" ? (_(), L("span", {
|
|
3584
3588
|
key: 2,
|
|
3585
3589
|
class: "legend-symbol legend-fill",
|
|
3586
3590
|
style: we({
|
|
@@ -3590,29 +3594,29 @@ const Es = {
|
|
|
3590
3594
|
}),
|
|
3591
3595
|
"aria-hidden": "true"
|
|
3592
3596
|
}, null, 4)) : Z("", !0),
|
|
3593
|
-
|
|
3597
|
+
a.items.length > 1 ? (_(), L("span", Bs, Q(i.label), 1)) : Z("", !0)
|
|
3594
3598
|
]))), 128))
|
|
3595
3599
|
], 8, Ts));
|
|
3596
3600
|
}
|
|
3597
|
-
}),
|
|
3598
|
-
function
|
|
3601
|
+
}), Gt = /* @__PURE__ */ Oe(Vs, [["__scopeId", "data-v-3a9206ab"]]);
|
|
3602
|
+
function Ht(a) {
|
|
3599
3603
|
function e(o) {
|
|
3600
|
-
return
|
|
3604
|
+
return a().visibleLayerIds.has(o);
|
|
3601
3605
|
}
|
|
3602
3606
|
function t(o) {
|
|
3603
|
-
return
|
|
3607
|
+
return a().layerOpacities[o] ?? 1;
|
|
3604
3608
|
}
|
|
3605
3609
|
function i(o) {
|
|
3606
|
-
return
|
|
3610
|
+
return a().loadingLayerIds.has(o);
|
|
3607
3611
|
}
|
|
3608
|
-
function
|
|
3609
|
-
return
|
|
3612
|
+
function s(o) {
|
|
3613
|
+
return a().layerErrors[o] || null;
|
|
3610
3614
|
}
|
|
3611
3615
|
function n(o) {
|
|
3612
|
-
const u =
|
|
3616
|
+
const u = a().currentZoom, c = o.minZoom, h = o.maxZoom;
|
|
3613
3617
|
return !(c !== void 0 && u < c || h !== void 0 && u > h);
|
|
3614
3618
|
}
|
|
3615
|
-
return { isVisible: e, getLayerOpacity: t, isLayerLoading: i, getLayerError:
|
|
3619
|
+
return { isVisible: e, getLayerOpacity: t, isLayerLoading: i, getLayerError: s, isLayerAvailableAtZoom: n };
|
|
3616
3620
|
}
|
|
3617
3621
|
const Ps = { class: "layer-panel" }, Os = {
|
|
3618
3622
|
key: 0,
|
|
@@ -3644,18 +3648,18 @@ const Ps = { class: "layer-panel" }, Os = {
|
|
|
3644
3648
|
searchPlaceholder: { default: "Filter layers..." }
|
|
3645
3649
|
},
|
|
3646
3650
|
emits: ["toggleLayer", "setOpacity", "updateSearch"],
|
|
3647
|
-
setup(
|
|
3648
|
-
const t =
|
|
3651
|
+
setup(a, { emit: e }) {
|
|
3652
|
+
const t = a, i = e, s = $(() => {
|
|
3649
3653
|
if (!t.searchQuery.trim())
|
|
3650
3654
|
return t.layerList;
|
|
3651
|
-
const
|
|
3652
|
-
return t.layerList.filter((k) => k.config.title.toLowerCase().includes(
|
|
3655
|
+
const v = t.searchQuery.toLowerCase();
|
|
3656
|
+
return t.layerList.filter((k) => k.config.title.toLowerCase().includes(v));
|
|
3653
3657
|
});
|
|
3654
|
-
function n(
|
|
3655
|
-
const k = fi(
|
|
3658
|
+
function n(v) {
|
|
3659
|
+
const k = fi(v);
|
|
3656
3660
|
return t.layerMetadata[k] || null;
|
|
3657
3661
|
}
|
|
3658
|
-
const o = $(() => t.layerList.some((
|
|
3662
|
+
const o = $(() => t.layerList.some((v) => n(v.config.url))), { isVisible: u, getLayerOpacity: c, isLayerLoading: h, getLayerError: d, isLayerAvailableAtZoom: m } = Ht(() => ({
|
|
3659
3663
|
visibleLayerIds: t.visibleLayers,
|
|
3660
3664
|
layerOpacities: t.layerOpacities,
|
|
3661
3665
|
loadingLayerIds: t.loadingLayers,
|
|
@@ -3663,17 +3667,17 @@ const Ps = { class: "layer-panel" }, Os = {
|
|
|
3663
3667
|
currentZoom: t.currentZoom
|
|
3664
3668
|
})), r = $({
|
|
3665
3669
|
get: () => t.searchQuery,
|
|
3666
|
-
set: (
|
|
3670
|
+
set: (v) => i("updateSearch", v)
|
|
3667
3671
|
});
|
|
3668
|
-
function
|
|
3669
|
-
i("toggleLayer",
|
|
3672
|
+
function f(v) {
|
|
3673
|
+
i("toggleLayer", v);
|
|
3670
3674
|
}
|
|
3671
|
-
return (
|
|
3672
|
-
|
|
3675
|
+
return (v, k) => (_(), L("div", Ps, [
|
|
3676
|
+
a.showSearch ? (_(), L("div", Os, [
|
|
3673
3677
|
ee(y(ks), {
|
|
3674
3678
|
modelValue: r.value,
|
|
3675
|
-
"onUpdate:modelValue": k[0] || (k[0] = (
|
|
3676
|
-
placeholder:
|
|
3679
|
+
"onUpdate:modelValue": k[0] || (k[0] = (b) => r.value = b),
|
|
3680
|
+
placeholder: a.searchPlaceholder,
|
|
3677
3681
|
"class-name": "layer-search-field"
|
|
3678
3682
|
}, {
|
|
3679
3683
|
"trailing-action": rt(() => [
|
|
@@ -3687,26 +3691,26 @@ const Ps = { class: "layer-panel" }, Os = {
|
|
|
3687
3691
|
_: 1
|
|
3688
3692
|
}, 8, ["modelValue", "placeholder"])
|
|
3689
3693
|
])) : Z("", !0),
|
|
3690
|
-
|
|
3691
|
-
Se(
|
|
3694
|
+
a.mode === "topics" ? (_(), L("div", Rs, [
|
|
3695
|
+
Se(v.$slots, "topics", {}, () => [
|
|
3692
3696
|
k[2] || (k[2] = D("div", { class: "no-topics" }, ' No topic components provided. Use the "topics" slot to add TopicAccordion components. ', -1))
|
|
3693
3697
|
], !0)
|
|
3694
|
-
])) : (
|
|
3698
|
+
])) : (_(), L("div", {
|
|
3695
3699
|
key: 2,
|
|
3696
3700
|
class: me(["layer-list", { "has-metadata": o.value }])
|
|
3697
3701
|
}, [
|
|
3698
|
-
(
|
|
3699
|
-
key:
|
|
3702
|
+
(_(!0), L(ke, null, Ae(s.value, (b) => (_(), L("div", {
|
|
3703
|
+
key: b.config.id,
|
|
3700
3704
|
class: "layer-item"
|
|
3701
3705
|
}, [
|
|
3702
3706
|
D("div", $s, [
|
|
3703
|
-
n(
|
|
3707
|
+
n(b.config.url) ? (_(), L("a", {
|
|
3704
3708
|
key: 0,
|
|
3705
|
-
href: n(
|
|
3709
|
+
href: n(b.config.url) || "",
|
|
3706
3710
|
target: "_blank",
|
|
3707
3711
|
rel: "noopener noreferrer",
|
|
3708
3712
|
class: "metadata-link",
|
|
3709
|
-
"aria-label": "View metadata for " +
|
|
3713
|
+
"aria-label": "View metadata for " + b.config.title,
|
|
3710
3714
|
onClick: k[1] || (k[1] = hi(() => {
|
|
3711
3715
|
}, ["stop"]))
|
|
3712
3716
|
}, [
|
|
@@ -3716,47 +3720,47 @@ const Ps = { class: "layer-panel" }, Os = {
|
|
|
3716
3720
|
inline: "",
|
|
3717
3721
|
decorative: ""
|
|
3718
3722
|
}, null, 8, ["icon-definition"])
|
|
3719
|
-
], 8, Ns)) : o.value ? (
|
|
3723
|
+
], 8, Ns)) : o.value ? (_(), L("span", zs)) : Z("", !0),
|
|
3720
3724
|
D("label", {
|
|
3721
3725
|
class: me(["layer-checkbox", {
|
|
3722
|
-
"layer-unavailable": !y(
|
|
3723
|
-
"layer-error": y(d)(
|
|
3726
|
+
"layer-unavailable": !y(m)(b.config),
|
|
3727
|
+
"layer-error": y(d)(b.config.id)
|
|
3724
3728
|
}])
|
|
3725
3729
|
}, [
|
|
3726
3730
|
D("input", {
|
|
3727
3731
|
type: "checkbox",
|
|
3728
|
-
checked: y(u)(
|
|
3729
|
-
disabled: !y(
|
|
3730
|
-
onChange: (
|
|
3732
|
+
checked: y(u)(b.config.id),
|
|
3733
|
+
disabled: !y(m)(b.config),
|
|
3734
|
+
onChange: (A) => f(b.config.id)
|
|
3731
3735
|
}, null, 40, Us),
|
|
3732
3736
|
D("span", Zs, [
|
|
3733
|
-
Ve(Q(
|
|
3737
|
+
Ve(Q(b.config.title) + " ", 1),
|
|
3734
3738
|
ee(St, {
|
|
3735
|
-
loading: y(h)(
|
|
3736
|
-
error: y(d)(
|
|
3737
|
-
unavailable: !y(
|
|
3739
|
+
loading: y(h)(b.config.id),
|
|
3740
|
+
error: y(d)(b.config.id),
|
|
3741
|
+
unavailable: !y(m)(b.config)
|
|
3738
3742
|
}, null, 8, ["loading", "error", "unavailable"])
|
|
3739
3743
|
])
|
|
3740
3744
|
], 2)
|
|
3741
3745
|
]),
|
|
3742
|
-
|
|
3746
|
+
a.showOpacity && y(u)(b.config.id) && y(m)(b.config) ? (_(), K(qt, {
|
|
3743
3747
|
key: 0,
|
|
3744
|
-
"layer-id":
|
|
3745
|
-
"layer-name":
|
|
3746
|
-
opacity: y(c)(
|
|
3747
|
-
"onUpdate:opacity": (
|
|
3748
|
+
"layer-id": b.config.id,
|
|
3749
|
+
"layer-name": b.config.title,
|
|
3750
|
+
opacity: y(c)(b.config.id),
|
|
3751
|
+
"onUpdate:opacity": (A) => i("setOpacity", b.config.id, A)
|
|
3748
3752
|
}, null, 8, ["layer-id", "layer-name", "opacity", "onUpdate:opacity"])) : Z("", !0),
|
|
3749
|
-
|
|
3753
|
+
a.showLegend && y(u)(b.config.id) && y(m)(b.config) && b.config.legend?.length ? (_(), K(Gt, {
|
|
3750
3754
|
key: 1,
|
|
3751
|
-
items:
|
|
3752
|
-
label: "Legend for " +
|
|
3755
|
+
items: b.config.legend,
|
|
3756
|
+
label: "Legend for " + b.config.title
|
|
3753
3757
|
}, null, 8, ["items", "label"])) : Z("", !0)
|
|
3754
3758
|
]))), 128)),
|
|
3755
|
-
|
|
3759
|
+
s.value.length === 0 ? (_(), L("div", js, 'No layers match "' + Q(a.searchQuery) + '"', 1)) : Z("", !0)
|
|
3756
3760
|
], 2))
|
|
3757
3761
|
]));
|
|
3758
3762
|
}
|
|
3759
|
-
}),
|
|
3763
|
+
}), Gs = /* @__PURE__ */ Oe(qs, [["__scopeId", "data-v-e48bb978"]]), Hs = {
|
|
3760
3764
|
esriSLSSolid: null,
|
|
3761
3765
|
esriSLSDash: [6, 1.5],
|
|
3762
3766
|
esriSLSDot: [1, 1.5],
|
|
@@ -3764,104 +3768,104 @@ const Ps = { class: "layer-panel" }, Os = {
|
|
|
3764
3768
|
esriSLSDashDotDot: [6, 1.5, 1, 1.5, 1, 1.5],
|
|
3765
3769
|
esriSLSNull: null
|
|
3766
3770
|
};
|
|
3767
|
-
function dt(
|
|
3768
|
-
if (
|
|
3769
|
-
return
|
|
3771
|
+
function dt(a) {
|
|
3772
|
+
if (a)
|
|
3773
|
+
return Hs[a] ?? void 0;
|
|
3770
3774
|
}
|
|
3771
|
-
function Ws(
|
|
3775
|
+
function Ws(a, e, t, i, s) {
|
|
3772
3776
|
const n = [];
|
|
3773
|
-
let o = e[0], u = [
|
|
3774
|
-
for (let r = 1; r <
|
|
3775
|
-
e[r] === o ? u.push(
|
|
3777
|
+
let o = e[0], u = [a[0]], c = 0;
|
|
3778
|
+
for (let r = 1; r < a.length; r++)
|
|
3779
|
+
e[r] === o ? u.push(a[r]) : (n.push({ style: o, breaks: u, startIndex: c }), o = e[r], u = [a[r]], c = r);
|
|
3776
3780
|
n.push({ style: o, breaks: u, startIndex: c });
|
|
3777
3781
|
const h = [], d = /* @__PURE__ */ new Set();
|
|
3778
|
-
let
|
|
3782
|
+
let m = i.minValue ?? 0;
|
|
3779
3783
|
for (let r = 0; r < n.length; r++) {
|
|
3780
|
-
const
|
|
3781
|
-
let
|
|
3784
|
+
const f = n[r], v = f.breaks, k = dt(f.style), b = r === 0 ? null : n[r - 1].breaks[n[r - 1].breaks.length - 1].classMaxValue, A = v[v.length - 1].classMaxValue;
|
|
3785
|
+
let I;
|
|
3782
3786
|
const z = !!i.defaultSymbol;
|
|
3783
|
-
|
|
3784
|
-
const
|
|
3785
|
-
"line-opacity": Ee(
|
|
3787
|
+
b === null ? I = `${!z && i.minValue != null ? `${t} >= ${i.minValue} AND ` : ""}${t} <= ${A}` : r === n.length - 1 && z ? I = `${t} > ${b}` : I = `${t} > ${b} AND ${t} <= ${A}`;
|
|
3788
|
+
const M = {
|
|
3789
|
+
"line-opacity": Ee(s)
|
|
3786
3790
|
};
|
|
3787
|
-
if (k && (
|
|
3788
|
-
|
|
3791
|
+
if (k && (M["line-dasharray"] = k), v.length === 1)
|
|
3792
|
+
M["line-color"] = P(v[0].symbol?.color), M["line-width"] = Y(v[0].symbol?.width || 2);
|
|
3789
3793
|
else {
|
|
3790
3794
|
const q = ["step", ["get", t]], ue = ["step", ["get", t]];
|
|
3791
|
-
q.push(P(
|
|
3792
|
-
for (let N = 1; N <
|
|
3793
|
-
q.push(
|
|
3794
|
-
|
|
3795
|
+
q.push(P(v[0].symbol?.color)), ue.push(Y(v[0].symbol?.width || 2));
|
|
3796
|
+
for (let N = 1; N < v.length; N++)
|
|
3797
|
+
q.push(v[N - 1].classMaxValue), q.push(P(v[N].symbol?.color)), ue.push(v[N - 1].classMaxValue), ue.push(Y(v[N].symbol?.width || 2));
|
|
3798
|
+
M["line-color"] = q, M["line-width"] = ue;
|
|
3795
3799
|
}
|
|
3796
3800
|
const T = [];
|
|
3797
|
-
for (const q of
|
|
3801
|
+
for (const q of v)
|
|
3798
3802
|
T.push({
|
|
3799
3803
|
type: "line",
|
|
3800
3804
|
color: P(q.symbol?.color),
|
|
3801
3805
|
width: Y(q.symbol?.width || 2),
|
|
3802
|
-
label: q.label || `${
|
|
3803
|
-
}),
|
|
3804
|
-
const R =
|
|
3806
|
+
label: q.label || `${m} - ${q.classMaxValue}`
|
|
3807
|
+
}), m = q.classMaxValue + 1;
|
|
3808
|
+
const R = f.style.replace("esriSLS", "").toLowerCase();
|
|
3805
3809
|
let se;
|
|
3806
|
-
r === 0 ? se = "" : d.has(R) ? se = `-${R}-${r}` : se = `-${R}`, d.add(R), h.push({ suffix: se, where:
|
|
3810
|
+
r === 0 ? se = "" : d.has(R) ? se = `-${R}-${r}` : se = `-${R}`, d.add(R), h.push({ suffix: se, where: I, paint: M, legend: T });
|
|
3807
3811
|
}
|
|
3808
3812
|
return h;
|
|
3809
3813
|
}
|
|
3810
|
-
function Ks(
|
|
3814
|
+
function Ks(a, e, t, i, s) {
|
|
3811
3815
|
const n = /* @__PURE__ */ new Map();
|
|
3812
|
-
for (const h of
|
|
3816
|
+
for (const h of a) {
|
|
3813
3817
|
const d = h.symbol?.style || "esriSLSSolid";
|
|
3814
3818
|
n.has(d) || n.set(d, []), n.get(d).push(h);
|
|
3815
3819
|
}
|
|
3816
3820
|
const o = [], u = /* @__PURE__ */ new Set();
|
|
3817
3821
|
let c = !0;
|
|
3818
3822
|
for (const [h, d] of n) {
|
|
3819
|
-
const
|
|
3823
|
+
const m = dt(h), f = d.map((I) => `${e} = '${String(I.value).replace(/'/g, "''")}'`).join(" OR "), v = {
|
|
3820
3824
|
"line-opacity": Ee(i)
|
|
3821
3825
|
};
|
|
3822
|
-
if (
|
|
3823
|
-
|
|
3826
|
+
if (m && (v["line-dasharray"] = m), d.length === 1)
|
|
3827
|
+
v["line-color"] = P(d[0].symbol?.color), v["line-width"] = Y(d[0].symbol?.width || 2);
|
|
3824
3828
|
else {
|
|
3825
|
-
const
|
|
3829
|
+
const I = ["match", ["to-string", ["get", e]]];
|
|
3826
3830
|
for (const z of d)
|
|
3827
|
-
|
|
3828
|
-
|
|
3831
|
+
I.push(bt(z.value)), I.push(P(z.symbol?.color));
|
|
3832
|
+
I.push(t ? P(t.color) : "rgba(0, 0, 0, 0)"), v["line-color"] = I, v["line-width"] = Y(d[0].symbol?.width || 2);
|
|
3829
3833
|
}
|
|
3830
3834
|
const k = [];
|
|
3831
|
-
for (const
|
|
3832
|
-
const z = String(
|
|
3835
|
+
for (const I of d) {
|
|
3836
|
+
const z = String(I.value), T = s?.get(z) || I.label || z;
|
|
3833
3837
|
k.push({
|
|
3834
3838
|
type: "line",
|
|
3835
|
-
color: P(
|
|
3836
|
-
width: Y(
|
|
3839
|
+
color: P(I.symbol?.color),
|
|
3840
|
+
width: Y(I.symbol?.width || 1),
|
|
3837
3841
|
label: T
|
|
3838
3842
|
});
|
|
3839
3843
|
}
|
|
3840
|
-
const
|
|
3841
|
-
let
|
|
3842
|
-
c ?
|
|
3844
|
+
const b = h.replace("esriSLS", "").toLowerCase();
|
|
3845
|
+
let A;
|
|
3846
|
+
c ? A = "" : u.has(b) ? A = `-${b}-${o.length}` : A = `-${b}`, u.add(b), c = !1, o.push({ suffix: A, where: f, paint: v, legend: k });
|
|
3843
3847
|
}
|
|
3844
3848
|
return o;
|
|
3845
3849
|
}
|
|
3846
|
-
function P(
|
|
3847
|
-
if (!
|
|
3848
|
-
const e =
|
|
3850
|
+
function P(a) {
|
|
3851
|
+
if (!a || !Array.isArray(a) || a.length < 3) return "#888888";
|
|
3852
|
+
const e = a[0], t = a[1], i = a[2], n = (a[3] ?? 255) / 255;
|
|
3849
3853
|
return n === 1 ? `#${e.toString(16).padStart(2, "0")}${t.toString(16).padStart(2, "0")}${i.toString(16).padStart(2, "0")}` : `rgba(${e}, ${t}, ${i}, ${n.toFixed(2)})`;
|
|
3850
3854
|
}
|
|
3851
|
-
function Ee(
|
|
3852
|
-
return
|
|
3855
|
+
function Ee(a) {
|
|
3856
|
+
return a !== void 0 ? a : 1;
|
|
3853
3857
|
}
|
|
3854
|
-
function Y(
|
|
3855
|
-
return Math.round(
|
|
3858
|
+
function Y(a) {
|
|
3859
|
+
return Math.round(a * (96 / 72) * 10) / 10;
|
|
3856
3860
|
}
|
|
3857
3861
|
const Ys = 559082264;
|
|
3858
|
-
function li(
|
|
3859
|
-
return !
|
|
3862
|
+
function li(a) {
|
|
3863
|
+
return !a || a <= 0 ? null : Math.round(Math.log2(Ys / a) * 100) / 100;
|
|
3860
3864
|
}
|
|
3861
|
-
function Xs(
|
|
3865
|
+
function Xs(a, e) {
|
|
3862
3866
|
const t = {};
|
|
3863
|
-
if (
|
|
3864
|
-
const i = li(
|
|
3867
|
+
if (a && a > 0) {
|
|
3868
|
+
const i = li(a);
|
|
3865
3869
|
i !== null && (t.minZoom = i);
|
|
3866
3870
|
}
|
|
3867
3871
|
if (e && e > 0) {
|
|
@@ -3870,9 +3874,9 @@ function Xs(s, e) {
|
|
|
3870
3874
|
}
|
|
3871
3875
|
return t;
|
|
3872
3876
|
}
|
|
3873
|
-
function It(
|
|
3874
|
-
if (!
|
|
3875
|
-
switch (
|
|
3877
|
+
function It(a) {
|
|
3878
|
+
if (!a) return "fill";
|
|
3879
|
+
switch (a.type) {
|
|
3876
3880
|
case "esriSFS":
|
|
3877
3881
|
return "fill";
|
|
3878
3882
|
case "esriSLS":
|
|
@@ -3887,25 +3891,25 @@ function It(s) {
|
|
|
3887
3891
|
return "fill";
|
|
3888
3892
|
}
|
|
3889
3893
|
}
|
|
3890
|
-
function Be(
|
|
3891
|
-
return !(!
|
|
3894
|
+
function Be(a) {
|
|
3895
|
+
return !(!a || a.style === "esriSLSNull" || a.color === null || a.width === 0 || a.color && a.color[3] === 0);
|
|
3892
3896
|
}
|
|
3893
|
-
function bt(
|
|
3894
|
-
return String(
|
|
3897
|
+
function bt(a) {
|
|
3898
|
+
return String(a);
|
|
3895
3899
|
}
|
|
3896
|
-
function _i(
|
|
3897
|
-
const i =
|
|
3900
|
+
function _i(a, e, t) {
|
|
3901
|
+
const i = a.symbol, s = It(i);
|
|
3898
3902
|
let n = {}, o = [], u = null;
|
|
3899
|
-
if (
|
|
3903
|
+
if (s === "fill" && i) {
|
|
3900
3904
|
const c = i.color === null ? 0 : i.color?.[3] ?? 255, h = c === 0 ? "rgba(0, 0, 0, 0)" : P(i.color), d = c === 0 ? 0 : c < 255 ? 1 : Ee(e);
|
|
3901
3905
|
if (n = {
|
|
3902
3906
|
"fill-color": h,
|
|
3903
3907
|
"fill-opacity": d
|
|
3904
3908
|
}, Be(i.outline)) {
|
|
3905
|
-
const
|
|
3909
|
+
const m = Y(i.outline.width || 1);
|
|
3906
3910
|
u = {
|
|
3907
3911
|
"line-color": P(i.outline.color),
|
|
3908
|
-
"line-width":
|
|
3912
|
+
"line-width": m
|
|
3909
3913
|
};
|
|
3910
3914
|
}
|
|
3911
3915
|
c === 0 && Be(i.outline) ? o = [
|
|
@@ -3914,16 +3918,16 @@ function _i(s, e, t) {
|
|
|
3914
3918
|
color: "transparent",
|
|
3915
3919
|
outlineColor: P(i.outline.color),
|
|
3916
3920
|
outlineWidth: Y(i.outline.width || 1),
|
|
3917
|
-
label:
|
|
3921
|
+
label: a.label || "Feature"
|
|
3918
3922
|
}
|
|
3919
3923
|
] : o = [
|
|
3920
3924
|
{
|
|
3921
3925
|
type: "fill",
|
|
3922
3926
|
color: P(i.color),
|
|
3923
|
-
label:
|
|
3927
|
+
label: a.label || "Feature"
|
|
3924
3928
|
}
|
|
3925
3929
|
];
|
|
3926
|
-
} else if (
|
|
3930
|
+
} else if (s === "line" && i) {
|
|
3927
3931
|
n = {
|
|
3928
3932
|
"line-color": P(i.color),
|
|
3929
3933
|
"line-width": Y(i.width || 1),
|
|
@@ -3935,10 +3939,10 @@ function _i(s, e, t) {
|
|
|
3935
3939
|
type: "line",
|
|
3936
3940
|
color: P(i.color),
|
|
3937
3941
|
width: Y(i.width || 1),
|
|
3938
|
-
label:
|
|
3942
|
+
label: a.label || "Feature"
|
|
3939
3943
|
}
|
|
3940
3944
|
];
|
|
3941
|
-
} else if (
|
|
3945
|
+
} else if (s === "circle" && i) {
|
|
3942
3946
|
const c = Math.round((i.size || 6) * 0.71 * 100) / 100;
|
|
3943
3947
|
n = {
|
|
3944
3948
|
"circle-color": P(i.color),
|
|
@@ -3948,37 +3952,37 @@ function _i(s, e, t) {
|
|
|
3948
3952
|
{
|
|
3949
3953
|
type: "circle",
|
|
3950
3954
|
color: P(i.color),
|
|
3951
|
-
label:
|
|
3955
|
+
label: a.label || "Feature"
|
|
3952
3956
|
}
|
|
3953
3957
|
];
|
|
3954
3958
|
}
|
|
3955
|
-
return { paint: n, legend: o, geomType:
|
|
3959
|
+
return { paint: n, legend: o, geomType: s, outlinePaint: u };
|
|
3956
3960
|
}
|
|
3957
|
-
function Js(
|
|
3958
|
-
const i =
|
|
3959
|
-
if (
|
|
3960
|
-
return _i({ ...
|
|
3961
|
-
const o =
|
|
3961
|
+
function Js(a, e, t) {
|
|
3962
|
+
const i = a.field1.toLowerCase(), s = a.uniqueValueInfos || [], n = a.defaultSymbol;
|
|
3963
|
+
if (s.length === 0)
|
|
3964
|
+
return _i({ ...a, symbol: n }, e);
|
|
3965
|
+
const o = s[0]?.symbol || n, u = It(o);
|
|
3962
3966
|
let c = {};
|
|
3963
3967
|
const h = [];
|
|
3964
3968
|
let d = null;
|
|
3965
3969
|
if (u === "fill") {
|
|
3966
|
-
const
|
|
3967
|
-
for (const r of
|
|
3968
|
-
|
|
3969
|
-
const
|
|
3970
|
+
const m = ["match", ["to-string", ["get", i]]];
|
|
3971
|
+
for (const r of s) {
|
|
3972
|
+
m.push(bt(r.value)), m.push(P(r.symbol?.color));
|
|
3973
|
+
const f = String(r.value), k = t?.get(f) || r.label || f;
|
|
3970
3974
|
h.push({
|
|
3971
3975
|
type: "fill",
|
|
3972
3976
|
color: P(r.symbol?.color),
|
|
3973
3977
|
label: k
|
|
3974
3978
|
});
|
|
3975
3979
|
}
|
|
3976
|
-
if (
|
|
3980
|
+
if (m.push(n ? P(n.color) : "rgba(0, 0, 0, 0)"), n && h.push({
|
|
3977
3981
|
type: "fill",
|
|
3978
3982
|
color: P(n.color),
|
|
3979
|
-
label:
|
|
3983
|
+
label: a.defaultLabel || "Other"
|
|
3980
3984
|
}), c = {
|
|
3981
|
-
"fill-color":
|
|
3985
|
+
"fill-color": m,
|
|
3982
3986
|
"fill-opacity": Ee(e)
|
|
3983
3987
|
}, Be(o?.outline)) {
|
|
3984
3988
|
const r = Y(Math.max(o.outline.width || 1, 1));
|
|
@@ -3988,65 +3992,65 @@ function Js(s, e, t) {
|
|
|
3988
3992
|
};
|
|
3989
3993
|
}
|
|
3990
3994
|
} else if (u === "line") {
|
|
3991
|
-
const
|
|
3992
|
-
for (const
|
|
3993
|
-
|
|
3994
|
-
const k = String(
|
|
3995
|
+
const m = ["match", ["to-string", ["get", i]]];
|
|
3996
|
+
for (const v of s) {
|
|
3997
|
+
m.push(bt(v.value)), m.push(P(v.symbol?.color));
|
|
3998
|
+
const k = String(v.value), A = t?.get(k) || v.label || k;
|
|
3995
3999
|
h.push({
|
|
3996
4000
|
type: "line",
|
|
3997
|
-
color: P(
|
|
3998
|
-
width: Y(
|
|
3999
|
-
label:
|
|
4001
|
+
color: P(v.symbol?.color),
|
|
4002
|
+
width: Y(v.symbol?.width || 1),
|
|
4003
|
+
label: A
|
|
4000
4004
|
});
|
|
4001
4005
|
}
|
|
4002
|
-
|
|
4006
|
+
m.push(n ? P(n.color) : "rgba(0, 0, 0, 0)"), n && h.push({
|
|
4003
4007
|
type: "line",
|
|
4004
4008
|
color: P(n.color),
|
|
4005
4009
|
width: Y(n.width || 1),
|
|
4006
|
-
label:
|
|
4010
|
+
label: a.defaultLabel || "Other"
|
|
4007
4011
|
}), c = {
|
|
4008
|
-
"line-color":
|
|
4012
|
+
"line-color": m,
|
|
4009
4013
|
"line-width": Y(o?.width || 2),
|
|
4010
4014
|
"line-opacity": Ee(e)
|
|
4011
4015
|
};
|
|
4012
|
-
const r =
|
|
4013
|
-
if (
|
|
4014
|
-
const
|
|
4015
|
-
return { paint: {}, legend: [], geomType: u, outlinePaint: d, splitLayers:
|
|
4016
|
+
const r = s.map((v) => v.symbol?.style || "esriSLSSolid"), f = [...new Set(r)];
|
|
4017
|
+
if (f.length > 1) {
|
|
4018
|
+
const v = Ks(s, i, n, e, t);
|
|
4019
|
+
return { paint: {}, legend: [], geomType: u, outlinePaint: d, splitLayers: v };
|
|
4016
4020
|
}
|
|
4017
|
-
if (
|
|
4018
|
-
const
|
|
4019
|
-
|
|
4021
|
+
if (f.length === 1) {
|
|
4022
|
+
const v = dt(f[0]);
|
|
4023
|
+
v && (c["line-dasharray"] = v);
|
|
4020
4024
|
}
|
|
4021
4025
|
} else if (u === "circle") {
|
|
4022
|
-
const
|
|
4023
|
-
for (const
|
|
4024
|
-
|
|
4025
|
-
const
|
|
4026
|
+
const m = ["match", ["to-string", ["get", i]]];
|
|
4027
|
+
for (const f of s) {
|
|
4028
|
+
m.push(bt(f.value)), m.push(P(f.symbol?.color));
|
|
4029
|
+
const v = String(f.value), b = t?.get(v) || f.label || v;
|
|
4026
4030
|
h.push({
|
|
4027
4031
|
type: "circle",
|
|
4028
|
-
color: P(
|
|
4029
|
-
label:
|
|
4032
|
+
color: P(f.symbol?.color),
|
|
4033
|
+
label: b
|
|
4030
4034
|
});
|
|
4031
4035
|
}
|
|
4032
|
-
|
|
4036
|
+
m.push(n ? P(n.color) : "rgba(0, 0, 0, 0)"), n && h.push({
|
|
4033
4037
|
type: "circle",
|
|
4034
4038
|
color: P(n.color),
|
|
4035
|
-
label:
|
|
4039
|
+
label: a.defaultLabel || "Other"
|
|
4036
4040
|
});
|
|
4037
4041
|
const r = Math.round((o?.size || 6) * 0.71 * 100) / 100;
|
|
4038
4042
|
c = {
|
|
4039
|
-
"circle-color":
|
|
4043
|
+
"circle-color": m,
|
|
4040
4044
|
"circle-radius": r,
|
|
4041
4045
|
"circle-opacity": Ee(e)
|
|
4042
4046
|
}, Be(o?.outline) && (c["circle-stroke-color"] = P(o.outline.color), c["circle-stroke-width"] = Y(o.outline.width || 1));
|
|
4043
4047
|
}
|
|
4044
4048
|
return { paint: c, legend: h, geomType: u, outlinePaint: d };
|
|
4045
4049
|
}
|
|
4046
|
-
function Qs(
|
|
4047
|
-
const t =
|
|
4048
|
-
if (
|
|
4049
|
-
return ea(
|
|
4050
|
+
function Qs(a, e) {
|
|
4051
|
+
const t = a.field.toLowerCase(), i = a.classBreakInfos || [], s = a.visualVariables?.find((d) => d.type === "colorInfo");
|
|
4052
|
+
if (s?.stops && s.stops.length > 0)
|
|
4053
|
+
return ea(s, t, a, e);
|
|
4050
4054
|
if (i.length === 0)
|
|
4051
4055
|
return { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
|
|
4052
4056
|
const n = i[0]?.symbol, o = It(n);
|
|
@@ -4056,9 +4060,9 @@ function Qs(s, e) {
|
|
|
4056
4060
|
if (o === "fill") {
|
|
4057
4061
|
const d = ["step", ["get", t]];
|
|
4058
4062
|
d.push(P(i[0]?.symbol?.color));
|
|
4059
|
-
for (let
|
|
4060
|
-
const r = i[
|
|
4061
|
-
|
|
4063
|
+
for (let m = 0; m < i.length; m++) {
|
|
4064
|
+
const r = i[m];
|
|
4065
|
+
m > 0 && (d.push(i[m - 1].classMaxValue), d.push(P(r.symbol?.color))), c.push({
|
|
4062
4066
|
type: "fill",
|
|
4063
4067
|
color: P(r.symbol?.color),
|
|
4064
4068
|
label: r.label || `${r.classMaxValue}`
|
|
@@ -4068,44 +4072,44 @@ function Qs(s, e) {
|
|
|
4068
4072
|
"fill-color": d,
|
|
4069
4073
|
"fill-opacity": Ee(e)
|
|
4070
4074
|
}, Be(n?.outline)) {
|
|
4071
|
-
const
|
|
4075
|
+
const m = Y(n.outline.width || 1);
|
|
4072
4076
|
h = {
|
|
4073
4077
|
"line-color": P(n.outline.color),
|
|
4074
|
-
"line-width":
|
|
4078
|
+
"line-width": m
|
|
4075
4079
|
};
|
|
4076
4080
|
}
|
|
4077
4081
|
} else if (o === "line") {
|
|
4078
|
-
const d = i.map((
|
|
4079
|
-
if (
|
|
4080
|
-
const
|
|
4081
|
-
return { paint: {}, legend: [], geomType: o, outlinePaint: h, splitLayers:
|
|
4082
|
-
}
|
|
4083
|
-
const
|
|
4084
|
-
|
|
4085
|
-
let
|
|
4086
|
-
for (let
|
|
4087
|
-
const
|
|
4088
|
-
|
|
4082
|
+
const d = i.map((A) => A.symbol?.style || "esriSLSSolid"), m = [...new Set(d)];
|
|
4083
|
+
if (m.length > 1) {
|
|
4084
|
+
const A = Ws(i, d, t, a, e);
|
|
4085
|
+
return { paint: {}, legend: [], geomType: o, outlinePaint: h, splitLayers: A };
|
|
4086
|
+
}
|
|
4087
|
+
const f = ["step", ["get", t]];
|
|
4088
|
+
f.push(P(i[0]?.symbol?.color));
|
|
4089
|
+
let v = a.minValue ?? 0;
|
|
4090
|
+
for (let A = 0; A < i.length; A++) {
|
|
4091
|
+
const I = i[A];
|
|
4092
|
+
A > 0 && (f.push(i[A - 1].classMaxValue), f.push(P(I.symbol?.color))), c.push({
|
|
4089
4093
|
type: "line",
|
|
4090
|
-
color: P(
|
|
4091
|
-
width: Y(
|
|
4092
|
-
label:
|
|
4093
|
-
}),
|
|
4094
|
+
color: P(I.symbol?.color),
|
|
4095
|
+
width: Y(I.symbol?.width || n?.width || 2),
|
|
4096
|
+
label: I.label || `${v} - ${I.classMaxValue}`
|
|
4097
|
+
}), v = I.classMaxValue + 1;
|
|
4094
4098
|
}
|
|
4095
4099
|
const k = Y(n?.width || 2);
|
|
4096
4100
|
u = {
|
|
4097
|
-
"line-color":
|
|
4101
|
+
"line-color": f,
|
|
4098
4102
|
"line-width": k,
|
|
4099
4103
|
"line-opacity": Ee(e)
|
|
4100
4104
|
};
|
|
4101
|
-
const
|
|
4102
|
-
|
|
4105
|
+
const b = dt(m[0]);
|
|
4106
|
+
b && (u["line-dasharray"] = b);
|
|
4103
4107
|
}
|
|
4104
4108
|
return { paint: u, legend: c, geomType: o, outlinePaint: h };
|
|
4105
4109
|
}
|
|
4106
|
-
function ea(
|
|
4107
|
-
const
|
|
4108
|
-
if (
|
|
4110
|
+
function ea(a, e, t, i) {
|
|
4111
|
+
const s = a.stops || [];
|
|
4112
|
+
if (s.length === 0)
|
|
4109
4113
|
return { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
|
|
4110
4114
|
const n = t.classBreakInfos?.[0]?.symbol || t.defaultSymbol, o = It(n);
|
|
4111
4115
|
let u = {};
|
|
@@ -4113,7 +4117,7 @@ function ea(s, e, t, i) {
|
|
|
4113
4117
|
let h = null;
|
|
4114
4118
|
if (o === "fill") {
|
|
4115
4119
|
const d = ["interpolate", ["linear"], ["get", e]];
|
|
4116
|
-
for (const r of
|
|
4120
|
+
for (const r of s)
|
|
4117
4121
|
d.push(r.value), d.push(P(r.color)), c.push({
|
|
4118
4122
|
type: "fill",
|
|
4119
4123
|
color: P(r.color),
|
|
@@ -4139,52 +4143,52 @@ function ea(s, e, t, i) {
|
|
|
4139
4143
|
}
|
|
4140
4144
|
return { paint: u, legend: c, geomType: o, outlinePaint: h };
|
|
4141
4145
|
}
|
|
4142
|
-
function ta(
|
|
4143
|
-
if (!
|
|
4146
|
+
function ta(a, e, t, i) {
|
|
4147
|
+
if (!a?.renderer)
|
|
4144
4148
|
return { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
|
|
4145
|
-
const
|
|
4146
|
-
switch (
|
|
4149
|
+
const s = a.renderer;
|
|
4150
|
+
switch (s.type) {
|
|
4147
4151
|
case "simple":
|
|
4148
|
-
return _i(
|
|
4152
|
+
return _i(s, e);
|
|
4149
4153
|
case "uniqueValue":
|
|
4150
|
-
return Js(
|
|
4154
|
+
return Js(s, e, t);
|
|
4151
4155
|
case "classBreaks":
|
|
4152
|
-
return Qs(
|
|
4156
|
+
return Qs(s, e);
|
|
4153
4157
|
default:
|
|
4154
4158
|
return { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
|
|
4155
4159
|
}
|
|
4156
4160
|
}
|
|
4157
|
-
function ia(
|
|
4158
|
-
if (!
|
|
4159
|
-
const e = (
|
|
4161
|
+
function ia(a) {
|
|
4162
|
+
if (!a) return null;
|
|
4163
|
+
const e = (a.title || "").replace(/\{([^}]+)\}/g, (n, o) => `{${o.toLowerCase()}}`), i = (a.fieldInfos || []).filter((n) => n.visible === !0).map((n) => {
|
|
4160
4164
|
const o = {
|
|
4161
4165
|
field: n.fieldName.toLowerCase(),
|
|
4162
4166
|
label: n.label || n.fieldName
|
|
4163
4167
|
};
|
|
4164
4168
|
return n.format && (o.format = {}, n.format.dateFormat && (o.format.dateFormat = n.format.dateFormat), n.format.digitSeparator !== void 0 && (o.format.digitSeparator = n.format.digitSeparator), n.format.places !== void 0 && (o.format.places = n.format.places), Object.keys(o.format).length === 0 && delete o.format), o;
|
|
4165
|
-
}),
|
|
4169
|
+
}), s = {
|
|
4166
4170
|
title: e,
|
|
4167
4171
|
fields: i
|
|
4168
4172
|
};
|
|
4169
|
-
return
|
|
4173
|
+
return a.showTime && (s.showTime = !0), s;
|
|
4170
4174
|
}
|
|
4171
|
-
function sa(
|
|
4172
|
-
return
|
|
4175
|
+
function sa(a) {
|
|
4176
|
+
return a?.definitionExpression;
|
|
4173
4177
|
}
|
|
4174
|
-
function aa(
|
|
4175
|
-
return (
|
|
4178
|
+
function aa(a) {
|
|
4179
|
+
return (a.includes("_") ? a.split("_").slice(1).join(" ") : a).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
4176
4180
|
}
|
|
4177
|
-
function na(
|
|
4178
|
-
return
|
|
4181
|
+
function na(a) {
|
|
4182
|
+
return a.includes("_") ? a.split("_").slice(1).join(" ") : a;
|
|
4179
4183
|
}
|
|
4180
|
-
function oa(
|
|
4184
|
+
function oa(a) {
|
|
4181
4185
|
const e = /* @__PURE__ */ new Map();
|
|
4182
|
-
if (!
|
|
4186
|
+
if (!a)
|
|
4183
4187
|
return e;
|
|
4184
|
-
const t =
|
|
4188
|
+
const t = a.split(`
|
|
4185
4189
|
`), i = /^(\d{1,3})\s+(.+)$/;
|
|
4186
|
-
for (const
|
|
4187
|
-
const n =
|
|
4190
|
+
for (const s of t) {
|
|
4191
|
+
const n = s.trim().match(i);
|
|
4188
4192
|
if (n) {
|
|
4189
4193
|
const [, o, u] = n;
|
|
4190
4194
|
o && u && e.set(o, u.trim());
|
|
@@ -4192,9 +4196,9 @@ function oa(s) {
|
|
|
4192
4196
|
}
|
|
4193
4197
|
return e;
|
|
4194
4198
|
}
|
|
4195
|
-
async function ra(
|
|
4199
|
+
async function ra(a) {
|
|
4196
4200
|
try {
|
|
4197
|
-
const e = await fetch(`${
|
|
4201
|
+
const e = await fetch(`${a}?f=json`);
|
|
4198
4202
|
if (!e.ok)
|
|
4199
4203
|
return null;
|
|
4200
4204
|
const t = await e.json();
|
|
@@ -4206,28 +4210,28 @@ async function ra(s) {
|
|
|
4206
4210
|
return null;
|
|
4207
4211
|
}
|
|
4208
4212
|
}
|
|
4209
|
-
function ui(
|
|
4213
|
+
function ui(a) {
|
|
4210
4214
|
const e = {
|
|
4211
|
-
id:
|
|
4212
|
-
title:
|
|
4213
|
-
type:
|
|
4214
|
-
url:
|
|
4215
|
-
opacity:
|
|
4216
|
-
paint:
|
|
4217
|
-
legend:
|
|
4218
|
-
popup:
|
|
4215
|
+
id: a.id,
|
|
4216
|
+
title: a.title,
|
|
4217
|
+
type: a.type,
|
|
4218
|
+
url: a.url,
|
|
4219
|
+
opacity: a.opacity,
|
|
4220
|
+
paint: a.paint,
|
|
4221
|
+
legend: a.legend,
|
|
4222
|
+
popup: a.popup
|
|
4219
4223
|
};
|
|
4220
|
-
return
|
|
4224
|
+
return a.where && (e.where = a.where), a.minZoom !== void 0 && (e.minZoom = a.minZoom), a.maxZoom !== void 0 && (e.maxZoom = a.maxZoom), a.outlinePaint && (e.outlinePaint = a.outlinePaint), a.parentId && (e.parentId = a.parentId), e;
|
|
4221
4225
|
}
|
|
4222
|
-
async function Ci(
|
|
4223
|
-
const e =
|
|
4224
|
-
for (const
|
|
4225
|
-
if (
|
|
4226
|
+
async function Ci(a) {
|
|
4227
|
+
const e = a.operationalLayers || [], t = [], i = ["Zoning and Planning_Land Use"];
|
|
4228
|
+
for (const s of e)
|
|
4229
|
+
if (s.url && !s.title?.toLowerCase().includes("(under construction)") && !(s.url && /\/MapServer(\/\d+)?$/i.test(s.url)))
|
|
4226
4230
|
try {
|
|
4227
|
-
let n =
|
|
4228
|
-
const u = !n || !n.renderer, c = i.includes(
|
|
4229
|
-
if ((u || c) &&
|
|
4230
|
-
const T = await ra(
|
|
4231
|
+
let n = s.layerDefinition?.drawingInfo, o;
|
|
4232
|
+
const u = !n || !n.renderer, c = i.includes(s.title), h = n?.renderer?.uniqueValueInfos?.[0]?.symbol?.outline || n?.renderer?.defaultSymbol?.outline;
|
|
4233
|
+
if ((u || c) && s.url) {
|
|
4234
|
+
const T = await ra(s.url);
|
|
4231
4235
|
if (T) {
|
|
4232
4236
|
if (n = T.drawingInfo, h && Be(h) && n?.renderer) {
|
|
4233
4237
|
const R = n.renderer, se = R.uniqueValueInfos?.[0]?.symbol?.outline || R.defaultSymbol?.outline;
|
|
@@ -4240,65 +4244,65 @@ async function Ci(s) {
|
|
|
4240
4244
|
T.description && (o = oa(T.description), o.size > 0);
|
|
4241
4245
|
}
|
|
4242
4246
|
}
|
|
4243
|
-
const { paint: d, legend:
|
|
4247
|
+
const { paint: d, legend: m, geomType: r, outlinePaint: f, splitLayers: v } = ta(
|
|
4244
4248
|
n,
|
|
4245
|
-
|
|
4249
|
+
s.opacity,
|
|
4246
4250
|
o,
|
|
4247
|
-
|
|
4248
|
-
), k = ia(
|
|
4249
|
-
if (
|
|
4250
|
-
for (const T of
|
|
4251
|
-
const R = `${
|
|
4251
|
+
s.title
|
|
4252
|
+
), k = ia(s.popupInfo), b = sa(s.layerDefinition), A = Xs(s.layerDefinition?.minScale, s.layerDefinition?.maxScale), I = aa(s.title), z = na(s.title), M = s.opacity ?? 1;
|
|
4253
|
+
if (v && v.length > 0)
|
|
4254
|
+
for (const T of v) {
|
|
4255
|
+
const R = `${I}${T.suffix}`;
|
|
4252
4256
|
t.push(ui({
|
|
4253
4257
|
id: R,
|
|
4254
4258
|
title: z,
|
|
4255
4259
|
type: r,
|
|
4256
|
-
url:
|
|
4257
|
-
opacity:
|
|
4260
|
+
url: s.url,
|
|
4261
|
+
opacity: M,
|
|
4258
4262
|
paint: T.paint,
|
|
4259
4263
|
legend: T.legend,
|
|
4260
4264
|
popup: k,
|
|
4261
|
-
where:
|
|
4262
|
-
minZoom:
|
|
4263
|
-
maxZoom:
|
|
4264
|
-
parentId: T.suffix ?
|
|
4265
|
+
where: b ? `(${b}) AND (${T.where})` : T.where,
|
|
4266
|
+
minZoom: A.minZoom,
|
|
4267
|
+
maxZoom: A.maxZoom,
|
|
4268
|
+
parentId: T.suffix ? I : void 0
|
|
4265
4269
|
}));
|
|
4266
4270
|
}
|
|
4267
4271
|
else
|
|
4268
4272
|
t.push(ui({
|
|
4269
|
-
id:
|
|
4273
|
+
id: I,
|
|
4270
4274
|
title: z,
|
|
4271
4275
|
type: r,
|
|
4272
|
-
url:
|
|
4273
|
-
opacity:
|
|
4276
|
+
url: s.url,
|
|
4277
|
+
opacity: M,
|
|
4274
4278
|
paint: d,
|
|
4275
|
-
legend:
|
|
4279
|
+
legend: m,
|
|
4276
4280
|
popup: k,
|
|
4277
|
-
where:
|
|
4278
|
-
minZoom:
|
|
4279
|
-
maxZoom:
|
|
4280
|
-
outlinePaint:
|
|
4281
|
+
where: b,
|
|
4282
|
+
minZoom: A.minZoom,
|
|
4283
|
+
maxZoom: A.maxZoom,
|
|
4284
|
+
outlinePaint: f
|
|
4281
4285
|
}));
|
|
4282
4286
|
} catch {
|
|
4283
4287
|
}
|
|
4284
|
-
return t.sort((
|
|
4288
|
+
return t.sort((s, n) => s.title.localeCompare(n.title)), t;
|
|
4285
4289
|
}
|
|
4286
4290
|
const ci = {}, Wt = "376af635c84643cd816a8c5d017a53aa", qa = Wt;
|
|
4287
|
-
function Kt(
|
|
4288
|
-
let t = `https://www.arcgis.com/sharing/rest/content/items/${
|
|
4291
|
+
function Kt(a, e) {
|
|
4292
|
+
let t = `https://www.arcgis.com/sharing/rest/content/items/${a}/data?f=json`;
|
|
4289
4293
|
return e && (t += `&token=${e}`), t;
|
|
4290
4294
|
}
|
|
4291
|
-
function
|
|
4295
|
+
function Ga() {
|
|
4292
4296
|
return Kt(Wt);
|
|
4293
4297
|
}
|
|
4294
4298
|
const Et = /* @__PURE__ */ new Map(), lt = /* @__PURE__ */ new Map();
|
|
4295
|
-
function la(
|
|
4296
|
-
|
|
4299
|
+
function la(a) {
|
|
4300
|
+
a ? (Et.delete(a), lt.delete(a)) : (Et.clear(), lt.clear());
|
|
4297
4301
|
}
|
|
4298
4302
|
let yt, di = 0;
|
|
4299
4303
|
async function ua() {
|
|
4300
|
-
const
|
|
4301
|
-
if (!(!
|
|
4304
|
+
const a = typeof import.meta < "u" && ci?.VITE_AGO_USERNAME, e = typeof import.meta < "u" && ci?.VITE_AGO_PASSWORD;
|
|
4305
|
+
if (!(!a || !e)) {
|
|
4302
4306
|
if (yt && Date.now() < di - 3e5)
|
|
4303
4307
|
return yt;
|
|
4304
4308
|
try {
|
|
@@ -4309,7 +4313,7 @@ async function ua() {
|
|
|
4309
4313
|
},
|
|
4310
4314
|
body: new URLSearchParams({
|
|
4311
4315
|
f: "json",
|
|
4312
|
-
username:
|
|
4316
|
+
username: a,
|
|
4313
4317
|
password: e,
|
|
4314
4318
|
referer: window.location.origin || "https://localhost",
|
|
4315
4319
|
expiration: "120"
|
|
@@ -4322,18 +4326,18 @@ async function ua() {
|
|
|
4322
4326
|
}
|
|
4323
4327
|
}
|
|
4324
4328
|
}
|
|
4325
|
-
async function ca(
|
|
4326
|
-
const t = Kt(
|
|
4329
|
+
async function ca(a, e) {
|
|
4330
|
+
const t = Kt(a, e), i = await fetch(t, { cache: "no-store" });
|
|
4327
4331
|
if (!i.ok)
|
|
4328
4332
|
throw new Error(`Failed to fetch WebMap: ${i.status} ${i.statusText}`);
|
|
4329
|
-
const
|
|
4330
|
-
if (
|
|
4331
|
-
throw new Error(`ArcGIS error: ${
|
|
4332
|
-
return
|
|
4333
|
+
const s = await i.json();
|
|
4334
|
+
if (s.error)
|
|
4335
|
+
throw new Error(`ArcGIS error: ${s.error.message || s.error.code || "Unknown error"}`);
|
|
4336
|
+
return s;
|
|
4333
4337
|
}
|
|
4334
|
-
async function da(
|
|
4338
|
+
async function da(a) {
|
|
4335
4339
|
try {
|
|
4336
|
-
const e = await ua(), t = await ca(
|
|
4340
|
+
const e = await ua(), t = await ca(a, e);
|
|
4337
4341
|
return await Ci(t);
|
|
4338
4342
|
} catch (e) {
|
|
4339
4343
|
throw new Error(
|
|
@@ -4341,26 +4345,26 @@ async function da(s) {
|
|
|
4341
4345
|
);
|
|
4342
4346
|
}
|
|
4343
4347
|
}
|
|
4344
|
-
async function Ut(
|
|
4345
|
-
const e = Et.get(
|
|
4348
|
+
async function Ut(a = Wt) {
|
|
4349
|
+
const e = Et.get(a);
|
|
4346
4350
|
if (e)
|
|
4347
4351
|
return e;
|
|
4348
|
-
const t = lt.get(
|
|
4352
|
+
const t = lt.get(a);
|
|
4349
4353
|
if (t)
|
|
4350
4354
|
return t;
|
|
4351
4355
|
const i = (async () => {
|
|
4352
4356
|
try {
|
|
4353
|
-
const
|
|
4354
|
-
return Et.set(
|
|
4357
|
+
const s = await da(a);
|
|
4358
|
+
return Et.set(a, s), s;
|
|
4355
4359
|
} finally {
|
|
4356
|
-
lt.delete(
|
|
4360
|
+
lt.delete(a);
|
|
4357
4361
|
}
|
|
4358
4362
|
})();
|
|
4359
|
-
return lt.set(
|
|
4363
|
+
return lt.set(a, i), i;
|
|
4360
4364
|
}
|
|
4361
|
-
function ha(
|
|
4365
|
+
function ha(a) {
|
|
4362
4366
|
const e = E({}), t = /* @__PURE__ */ new Map();
|
|
4363
|
-
for (const r of
|
|
4367
|
+
for (const r of a)
|
|
4364
4368
|
e.value[r.id] = {
|
|
4365
4369
|
data: null,
|
|
4366
4370
|
loading: !1,
|
|
@@ -4368,18 +4372,18 @@ function ha(s) {
|
|
|
4368
4372
|
lastFetched: null
|
|
4369
4373
|
};
|
|
4370
4374
|
async function i(r) {
|
|
4371
|
-
const
|
|
4375
|
+
const f = r.id;
|
|
4372
4376
|
e.value = {
|
|
4373
4377
|
...e.value,
|
|
4374
|
-
[
|
|
4375
|
-
data: e.value[
|
|
4376
|
-
lastFetched: e.value[
|
|
4378
|
+
[f]: {
|
|
4379
|
+
data: e.value[f]?.data ?? null,
|
|
4380
|
+
lastFetched: e.value[f]?.lastFetched ?? null,
|
|
4377
4381
|
loading: !0,
|
|
4378
4382
|
error: null
|
|
4379
4383
|
}
|
|
4380
4384
|
};
|
|
4381
4385
|
try {
|
|
4382
|
-
let
|
|
4386
|
+
let v;
|
|
4383
4387
|
if (r.type === "http-get") {
|
|
4384
4388
|
const k = await fetch(r.url, {
|
|
4385
4389
|
method: "GET",
|
|
@@ -4387,7 +4391,7 @@ function ha(s) {
|
|
|
4387
4391
|
});
|
|
4388
4392
|
if (!k.ok)
|
|
4389
4393
|
throw new Error(`HTTP ${k.status}: ${k.statusText}`);
|
|
4390
|
-
|
|
4394
|
+
v = await k.json();
|
|
4391
4395
|
} else if (r.type === "http-post") {
|
|
4392
4396
|
const k = await fetch(r.url, {
|
|
4393
4397
|
method: "POST",
|
|
@@ -4395,42 +4399,42 @@ function ha(s) {
|
|
|
4395
4399
|
});
|
|
4396
4400
|
if (!k.ok)
|
|
4397
4401
|
throw new Error(`HTTP ${k.status}: ${k.statusText}`);
|
|
4398
|
-
|
|
4402
|
+
v = await k.json();
|
|
4399
4403
|
} else if (r.type === "esri") {
|
|
4400
|
-
const
|
|
4401
|
-
if (!
|
|
4402
|
-
throw new Error(`HTTP ${
|
|
4403
|
-
|
|
4404
|
+
const b = `${r.url.replace(/\/$/, "")}/query?where=1%3D1&outFields=*&returnGeometry=false&f=json`, A = await fetch(b, r.options);
|
|
4405
|
+
if (!A.ok)
|
|
4406
|
+
throw new Error(`HTTP ${A.status}: ${A.statusText}`);
|
|
4407
|
+
v = (await A.json()).features?.map((z) => z.attributes) || [];
|
|
4404
4408
|
} else
|
|
4405
4409
|
throw new Error(`Unknown data source type: ${r.type}`);
|
|
4406
|
-
r.transform && (
|
|
4410
|
+
r.transform && (v = r.transform(v)), e.value = {
|
|
4407
4411
|
...e.value,
|
|
4408
|
-
[
|
|
4409
|
-
data:
|
|
4412
|
+
[f]: {
|
|
4413
|
+
data: v,
|
|
4410
4414
|
loading: !1,
|
|
4411
4415
|
error: null,
|
|
4412
4416
|
lastFetched: Date.now()
|
|
4413
4417
|
}
|
|
4414
4418
|
};
|
|
4415
|
-
} catch (
|
|
4416
|
-
const k =
|
|
4419
|
+
} catch (v) {
|
|
4420
|
+
const k = v instanceof Error ? v.message : "Unknown error";
|
|
4417
4421
|
e.value = {
|
|
4418
4422
|
...e.value,
|
|
4419
|
-
[
|
|
4420
|
-
data: e.value[
|
|
4421
|
-
lastFetched: e.value[
|
|
4423
|
+
[f]: {
|
|
4424
|
+
data: e.value[f]?.data ?? null,
|
|
4425
|
+
lastFetched: e.value[f]?.lastFetched ?? null,
|
|
4422
4426
|
loading: !1,
|
|
4423
4427
|
error: k
|
|
4424
4428
|
}
|
|
4425
4429
|
};
|
|
4426
4430
|
}
|
|
4427
4431
|
}
|
|
4428
|
-
async function
|
|
4429
|
-
await Promise.all(
|
|
4432
|
+
async function s() {
|
|
4433
|
+
await Promise.all(a.map((r) => i(r)));
|
|
4430
4434
|
}
|
|
4431
4435
|
async function n(r) {
|
|
4432
|
-
const
|
|
4433
|
-
|
|
4436
|
+
const f = a.find((v) => v.id === r);
|
|
4437
|
+
f && await i(f);
|
|
4434
4438
|
}
|
|
4435
4439
|
function o(r) {
|
|
4436
4440
|
return e.value[r]?.data ?? null;
|
|
@@ -4443,30 +4447,30 @@ function ha(s) {
|
|
|
4443
4447
|
return e.value[r]?.error ?? null;
|
|
4444
4448
|
}
|
|
4445
4449
|
function d() {
|
|
4446
|
-
for (const r of
|
|
4450
|
+
for (const r of a)
|
|
4447
4451
|
if (r.pollInterval && r.pollInterval > 0) {
|
|
4448
|
-
const
|
|
4452
|
+
const f = window.setInterval(() => {
|
|
4449
4453
|
i(r);
|
|
4450
4454
|
}, r.pollInterval);
|
|
4451
|
-
t.set(r.id,
|
|
4455
|
+
t.set(r.id, f);
|
|
4452
4456
|
}
|
|
4453
4457
|
}
|
|
4454
|
-
function
|
|
4458
|
+
function m() {
|
|
4455
4459
|
for (const [, r] of t)
|
|
4456
4460
|
window.clearInterval(r);
|
|
4457
4461
|
t.clear();
|
|
4458
4462
|
}
|
|
4459
4463
|
return ut(() => {
|
|
4460
|
-
|
|
4464
|
+
s(), d();
|
|
4461
4465
|
}), Zt(() => {
|
|
4462
|
-
|
|
4466
|
+
m();
|
|
4463
4467
|
}), {
|
|
4464
4468
|
/** Reactive state for all data sources */
|
|
4465
4469
|
state: W(e),
|
|
4466
4470
|
/** Whether any data source is currently loading */
|
|
4467
4471
|
isLoading: u,
|
|
4468
4472
|
/** Fetch all data sources */
|
|
4469
|
-
fetchAll:
|
|
4473
|
+
fetchAll: s,
|
|
4470
4474
|
/** Refetch a specific data source by id */
|
|
4471
4475
|
refetch: n,
|
|
4472
4476
|
/** Get data for a specific source */
|
|
@@ -4476,7 +4480,7 @@ function ha(s) {
|
|
|
4476
4480
|
/** Get error for a specific source */
|
|
4477
4481
|
getError: h,
|
|
4478
4482
|
/** Stop all polling (useful for cleanup) */
|
|
4479
|
-
stopPolling:
|
|
4483
|
+
stopPolling: m
|
|
4480
4484
|
};
|
|
4481
4485
|
}
|
|
4482
4486
|
const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
@@ -4523,22 +4527,22 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4523
4527
|
initialCenter: { default: void 0 }
|
|
4524
4528
|
},
|
|
4525
4529
|
emits: ["configs-loaded", "load-error", "zoom"],
|
|
4526
|
-
setup(
|
|
4527
|
-
const i =
|
|
4528
|
-
function
|
|
4530
|
+
setup(a, { expose: e, emit: t }) {
|
|
4531
|
+
const i = a, s = t, n = E([]), o = E(!0), u = E(null), c = E(12), h = E(""), d = E(/* @__PURE__ */ new Set()), m = E({}), r = E(/* @__PURE__ */ new Set()), f = E({}), v = E({}), k = E(/* @__PURE__ */ new Set()), b = E({});
|
|
4532
|
+
function A() {
|
|
4529
4533
|
const w = {};
|
|
4530
4534
|
for (const F of i.tiledLayers)
|
|
4531
4535
|
w[F.id] = F.opacity ?? 1;
|
|
4532
|
-
|
|
4536
|
+
b.value = w;
|
|
4533
4537
|
}
|
|
4534
|
-
function
|
|
4538
|
+
function I(w) {
|
|
4535
4539
|
k.value.has(w) ? k.value.delete(w) : k.value.add(w), k.value = new Set(k.value);
|
|
4536
4540
|
}
|
|
4537
4541
|
function z(w, F) {
|
|
4538
4542
|
F ? k.value.add(w) : k.value.delete(w), k.value = new Set(k.value);
|
|
4539
4543
|
}
|
|
4540
|
-
function
|
|
4541
|
-
|
|
4544
|
+
function M(w, F) {
|
|
4545
|
+
b.value = { ...b.value, [w]: F };
|
|
4542
4546
|
}
|
|
4543
4547
|
const T = i.dataSources.length > 0 ? ha(i.dataSources) : null, R = $(() => T?.state.value ?? {}), se = $(() => T?.isLoading.value ?? !1);
|
|
4544
4548
|
function q(w) {
|
|
@@ -4547,7 +4551,7 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4547
4551
|
function ue(w) {
|
|
4548
4552
|
return T?.refetch(w) ?? Promise.resolve();
|
|
4549
4553
|
}
|
|
4550
|
-
|
|
4554
|
+
H("layerboard-layers", W(n)), H("layerboard-visible", d), H("layerboard-opacities", m), H("layerboard-loading", W(r)), H("layerboard-errors", W(f)), H("layerboard-zoom", W(c)), H("layerboard-toggle-layer", He), H("layerboard-set-layer-visible", st), H("layerboard-set-layers-visible", Re), H("layerboard-set-opacity", ze), H("layerboard-tiled-layers", W($(() => i.tiledLayers))), H("layerboard-visible-tiled", k), H("layerboard-tiled-opacities", b), H("layerboard-toggle-tiled", I), H("layerboard-set-tiled-opacity", M), H("layerboard-set-tiled-visible", z), H("layerboard-data-sources-state", R), H("layerboard-data-sources-loading", se), H("layerboard-get-data-source", q), H("layerboard-refetch-data-source", ue);
|
|
4551
4555
|
const N = $(() => ({
|
|
4552
4556
|
backgroundColor: i.themeColor
|
|
4553
4557
|
})), Ne = $(() => ({
|
|
@@ -4560,9 +4564,9 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4560
4564
|
async function it() {
|
|
4561
4565
|
try {
|
|
4562
4566
|
o.value = !0, u.value = null;
|
|
4563
|
-
const F = (await Ut(i.webMapId)).map((
|
|
4564
|
-
let X =
|
|
4565
|
-
const xe = i.layerStyleOverrides[
|
|
4567
|
+
const F = (await Ut(i.webMapId)).map((G) => {
|
|
4568
|
+
let X = G;
|
|
4569
|
+
const xe = i.layerStyleOverrides[G.id];
|
|
4566
4570
|
xe && (X = {
|
|
4567
4571
|
...X,
|
|
4568
4572
|
paint: xe.paint ?? X.paint,
|
|
@@ -4571,23 +4575,23 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4571
4575
|
type: xe.type ?? X.type,
|
|
4572
4576
|
zOrder: xe.zOrder ?? X.zOrder
|
|
4573
4577
|
});
|
|
4574
|
-
const Qe = i.popupOverrides[
|
|
4578
|
+
const Qe = i.popupOverrides[G.id] || (G.parentId ? i.popupOverrides[G.parentId] : void 0);
|
|
4575
4579
|
return Qe && X.popup && (X = {
|
|
4576
4580
|
...X,
|
|
4577
4581
|
popup: { ...X.popup, ...Qe }
|
|
4578
4582
|
}), X;
|
|
4579
4583
|
});
|
|
4580
|
-
n.value = F.map((
|
|
4581
|
-
config:
|
|
4582
|
-
component:
|
|
4584
|
+
n.value = F.map((G) => ({
|
|
4585
|
+
config: G,
|
|
4586
|
+
component: G.type
|
|
4583
4587
|
}));
|
|
4584
4588
|
const te = {};
|
|
4585
|
-
F.forEach((
|
|
4586
|
-
te[
|
|
4587
|
-
}),
|
|
4589
|
+
F.forEach((G) => {
|
|
4590
|
+
te[G.id] = G.opacity ?? 1;
|
|
4591
|
+
}), m.value = te, s("configs-loaded", F);
|
|
4588
4592
|
} catch (w) {
|
|
4589
4593
|
const F = w instanceof Error ? w.message : "Failed to load layer configurations";
|
|
4590
|
-
u.value = F,
|
|
4594
|
+
u.value = F, s("load-error", F);
|
|
4591
4595
|
} finally {
|
|
4592
4596
|
o.value = !1;
|
|
4593
4597
|
}
|
|
@@ -4599,20 +4603,20 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4599
4603
|
"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"
|
|
4600
4604
|
), F = await fetch(w);
|
|
4601
4605
|
if (!F.ok) return;
|
|
4602
|
-
const te = await F.json(),
|
|
4606
|
+
const te = await F.json(), G = {};
|
|
4603
4607
|
for (const X of te.rows || [])
|
|
4604
4608
|
if (X.url_text && X.representation) {
|
|
4605
4609
|
const xe = fi(X.url_text), Qe = `https://metadata.phila.gov/#home/representationdetails/${X.representation}/`;
|
|
4606
|
-
|
|
4610
|
+
G[xe] = Qe;
|
|
4607
4611
|
}
|
|
4608
|
-
|
|
4612
|
+
v.value = G;
|
|
4609
4613
|
} catch {
|
|
4610
4614
|
}
|
|
4611
4615
|
}
|
|
4612
4616
|
function Mt(w) {
|
|
4613
|
-
c.value = w,
|
|
4617
|
+
c.value = w, s("zoom", w);
|
|
4614
4618
|
}
|
|
4615
|
-
function
|
|
4619
|
+
function He(w) {
|
|
4616
4620
|
d.value.has(w) ? d.value.delete(w) : d.value.add(w), d.value = new Set(d.value);
|
|
4617
4621
|
}
|
|
4618
4622
|
function st(w, F) {
|
|
@@ -4624,17 +4628,17 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4624
4628
|
d.value = new Set(d.value);
|
|
4625
4629
|
}
|
|
4626
4630
|
function ze(w, F) {
|
|
4627
|
-
|
|
4631
|
+
m.value = { ...m.value, [w]: F };
|
|
4628
4632
|
}
|
|
4629
4633
|
function at(w, F) {
|
|
4630
4634
|
F ? r.value.add(w) : r.value.delete(w), r.value = new Set(r.value);
|
|
4631
4635
|
}
|
|
4632
4636
|
function Dt(w, F) {
|
|
4633
4637
|
if (F)
|
|
4634
|
-
|
|
4638
|
+
f.value = { ...f.value, [w]: F };
|
|
4635
4639
|
else {
|
|
4636
|
-
const te = { ...
|
|
4637
|
-
delete te[w],
|
|
4640
|
+
const te = { ...f.value };
|
|
4641
|
+
delete te[w], f.value = te;
|
|
4638
4642
|
}
|
|
4639
4643
|
}
|
|
4640
4644
|
function ge(w) {
|
|
@@ -4687,8 +4691,8 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4687
4691
|
)
|
|
4688
4692
|
);
|
|
4689
4693
|
if (F.length === 0) return;
|
|
4690
|
-
const te = F[0],
|
|
4691
|
-
w.shiftKey ? document.activeElement === te && (w.preventDefault(),
|
|
4694
|
+
const te = F[0], G = F[F.length - 1];
|
|
4695
|
+
w.shiftKey ? document.activeElement === te && (w.preventDefault(), G.focus()) : document.activeElement === G && (w.preventDefault(), te.focus());
|
|
4692
4696
|
}
|
|
4693
4697
|
}
|
|
4694
4698
|
function Bt(w) {
|
|
@@ -4703,25 +4707,25 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4703
4707
|
)
|
|
4704
4708
|
);
|
|
4705
4709
|
if (F.length === 0) return;
|
|
4706
|
-
const te = F[0],
|
|
4707
|
-
w.shiftKey ? document.activeElement === te && (w.preventDefault(),
|
|
4710
|
+
const te = F[0], G = F[F.length - 1];
|
|
4711
|
+
w.shiftKey ? document.activeElement === te && (w.preventDefault(), G.focus()) : document.activeElement === G && (w.preventDefault(), te.focus());
|
|
4708
4712
|
}
|
|
4709
4713
|
}
|
|
4710
|
-
|
|
4714
|
+
H("layerboard-open-modal", Ye), H("layerboard-close-modal", pe), H("layerboard-is-modal-open", W(he)), e({
|
|
4711
4715
|
/** Layer configurations */
|
|
4712
4716
|
layerList: n,
|
|
4713
4717
|
/** Set of visible layer IDs */
|
|
4714
4718
|
visibleLayers: d,
|
|
4715
4719
|
/** Layer opacity values */
|
|
4716
|
-
layerOpacities:
|
|
4720
|
+
layerOpacities: m,
|
|
4717
4721
|
/** Set of currently loading layer IDs */
|
|
4718
4722
|
loadingLayers: r,
|
|
4719
4723
|
/** Map of layer errors by ID */
|
|
4720
|
-
layerErrors:
|
|
4724
|
+
layerErrors: f,
|
|
4721
4725
|
/** Current map zoom level */
|
|
4722
4726
|
currentZoom: c,
|
|
4723
4727
|
/** Toggle a layer's visibility */
|
|
4724
|
-
toggleLayer:
|
|
4728
|
+
toggleLayer: He,
|
|
4725
4729
|
/** Set a layer's visibility explicitly */
|
|
4726
4730
|
setLayerVisible: st,
|
|
4727
4731
|
/** Set multiple layers' visibility at once */
|
|
@@ -4736,13 +4740,13 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4736
4740
|
/** Set of visible tiled layer IDs */
|
|
4737
4741
|
visibleTiledLayers: k,
|
|
4738
4742
|
/** Tiled layer opacity values */
|
|
4739
|
-
tiledLayerOpacities:
|
|
4743
|
+
tiledLayerOpacities: b,
|
|
4740
4744
|
/** Toggle a tiled layer's visibility */
|
|
4741
|
-
toggleTiledLayer:
|
|
4745
|
+
toggleTiledLayer: I,
|
|
4742
4746
|
/** Set a tiled layer's visibility explicitly */
|
|
4743
4747
|
setTiledLayerVisible: z,
|
|
4744
4748
|
/** Set a tiled layer's opacity */
|
|
4745
|
-
setTiledLayerOpacity:
|
|
4749
|
+
setTiledLayerOpacity: M,
|
|
4746
4750
|
// Data source APIs
|
|
4747
4751
|
/** State of all data sources */
|
|
4748
4752
|
dataSourcesState: R,
|
|
@@ -4764,10 +4768,10 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4764
4768
|
w.key === "Escape" && de.value && je();
|
|
4765
4769
|
}
|
|
4766
4770
|
return ut(() => {
|
|
4767
|
-
it(), pt(),
|
|
4771
|
+
it(), pt(), A(), document.addEventListener("keydown", vt);
|
|
4768
4772
|
}), Di(() => {
|
|
4769
4773
|
document.removeEventListener("keydown", vt);
|
|
4770
|
-
}), (w, F) => (
|
|
4774
|
+
}), (w, F) => (_(), L("div", pa, [
|
|
4771
4775
|
F[5] || (F[5] = D("a", {
|
|
4772
4776
|
href: "#main-content",
|
|
4773
4777
|
class: "skip-to-main-content-link"
|
|
@@ -4805,10 +4809,10 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4805
4809
|
}, null, 8, ["icon-definition"])
|
|
4806
4810
|
], 8, fa),
|
|
4807
4811
|
Se(w.$slots, "header", {}, () => [
|
|
4808
|
-
D("h1", null, Q(
|
|
4809
|
-
|
|
4812
|
+
D("h1", null, Q(a.title), 1),
|
|
4813
|
+
a.subtitle ? (_(), L("span", ma, Q(a.subtitle), 1)) : Z("", !0)
|
|
4810
4814
|
], !0),
|
|
4811
|
-
de.value ? (
|
|
4815
|
+
de.value ? (_(), L("div", {
|
|
4812
4816
|
key: 0,
|
|
4813
4817
|
ref_key: "mobileMenuRef",
|
|
4814
4818
|
ref: Fe,
|
|
@@ -4816,7 +4820,7 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4816
4820
|
role: "dialog",
|
|
4817
4821
|
"aria-modal": "true",
|
|
4818
4822
|
"aria-label": "Site menu",
|
|
4819
|
-
style: we({ backgroundColor:
|
|
4823
|
+
style: we({ backgroundColor: a.themeColor }),
|
|
4820
4824
|
onKeydown: Je
|
|
4821
4825
|
}, [
|
|
4822
4826
|
D("div", ga, [
|
|
@@ -4842,28 +4846,28 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4842
4846
|
}, null, 8, ["icon-definition"])
|
|
4843
4847
|
], 512)
|
|
4844
4848
|
], 36)) : Z("", !0),
|
|
4845
|
-
de.value ? (
|
|
4849
|
+
de.value ? (_(), L("div", {
|
|
4846
4850
|
key: 1,
|
|
4847
4851
|
class: "layerboard-mobile-menu-backdrop",
|
|
4848
4852
|
onClick: je
|
|
4849
4853
|
})) : Z("", !0)
|
|
4850
4854
|
], 4),
|
|
4851
4855
|
D("div", va, [
|
|
4852
|
-
o.value ? (
|
|
4856
|
+
o.value ? (_(), L("div", ya, [
|
|
4853
4857
|
D("div", {
|
|
4854
4858
|
class: "layerboard-spinner",
|
|
4855
|
-
style: we({ borderTopColor:
|
|
4859
|
+
style: we({ borderTopColor: a.themeColor })
|
|
4856
4860
|
}, null, 4),
|
|
4857
|
-
D("p", null, "Loading " + Q(
|
|
4858
|
-
])) : u.value ? (
|
|
4861
|
+
D("p", null, "Loading " + Q(a.title) + "...", 1)
|
|
4862
|
+
])) : u.value ? (_(), L("div", ka, [
|
|
4859
4863
|
F[3] || (F[3] = D("h2", null, "Error Loading Layers", -1)),
|
|
4860
4864
|
D("p", null, Q(u.value), 1),
|
|
4861
4865
|
D("button", {
|
|
4862
4866
|
class: "layerboard-retry-button",
|
|
4863
|
-
style: we({ backgroundColor:
|
|
4867
|
+
style: we({ backgroundColor: a.themeColor }),
|
|
4864
4868
|
onClick: it
|
|
4865
4869
|
}, " Retry ", 4)
|
|
4866
|
-
])) : (
|
|
4870
|
+
])) : (_(), L(ke, { key: 2 }, [
|
|
4867
4871
|
D("aside", {
|
|
4868
4872
|
id: "main-content",
|
|
4869
4873
|
ref_key: "sidebarRef",
|
|
@@ -4876,36 +4880,36 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4876
4880
|
Se(w.$slots, "sidebar", {
|
|
4877
4881
|
layers: n.value,
|
|
4878
4882
|
visibleLayers: d.value,
|
|
4879
|
-
layerOpacities:
|
|
4883
|
+
layerOpacities: m.value,
|
|
4880
4884
|
loadingLayers: r.value,
|
|
4881
|
-
layerErrors:
|
|
4885
|
+
layerErrors: f.value,
|
|
4882
4886
|
currentZoom: c.value,
|
|
4883
|
-
toggleLayer:
|
|
4887
|
+
toggleLayer: He,
|
|
4884
4888
|
setLayerVisible: st,
|
|
4885
4889
|
setLayersVisible: Re,
|
|
4886
4890
|
setOpacity: ze,
|
|
4887
|
-
tiledLayers:
|
|
4891
|
+
tiledLayers: a.tiledLayers,
|
|
4888
4892
|
visibleTiledLayers: k.value,
|
|
4889
|
-
tiledLayerOpacities:
|
|
4890
|
-
toggleTiledLayer:
|
|
4893
|
+
tiledLayerOpacities: b.value,
|
|
4894
|
+
toggleTiledLayer: I,
|
|
4891
4895
|
setTiledLayerVisible: z,
|
|
4892
|
-
setTiledLayerOpacity:
|
|
4896
|
+
setTiledLayerOpacity: M,
|
|
4893
4897
|
dataSourcesState: R.value,
|
|
4894
4898
|
dataSourcesLoading: se.value,
|
|
4895
4899
|
getDataSource: q,
|
|
4896
4900
|
refetchDataSource: ue
|
|
4897
4901
|
}, () => [
|
|
4898
|
-
|
|
4902
|
+
a.showDefaultSidebar ? (_(), K(Gs, {
|
|
4899
4903
|
key: 0,
|
|
4900
4904
|
"layer-list": n.value,
|
|
4901
4905
|
"visible-layers": d.value,
|
|
4902
|
-
"layer-opacities":
|
|
4906
|
+
"layer-opacities": m.value,
|
|
4903
4907
|
"loading-layers": r.value,
|
|
4904
|
-
"layer-errors":
|
|
4908
|
+
"layer-errors": f.value,
|
|
4905
4909
|
"current-zoom": c.value,
|
|
4906
4910
|
"search-query": h.value,
|
|
4907
|
-
"layer-metadata":
|
|
4908
|
-
onToggleLayer:
|
|
4911
|
+
"layer-metadata": v.value,
|
|
4912
|
+
onToggleLayer: He,
|
|
4909
4913
|
onSetOpacity: ze,
|
|
4910
4914
|
onUpdateSearch: ge
|
|
4911
4915
|
}, null, 8, ["layer-list", "visible-layers", "layer-opacities", "loading-layers", "layer-errors", "current-zoom", "search-query", "layer-metadata"])) : Z("", !0)
|
|
@@ -4918,22 +4922,22 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4918
4922
|
}, [
|
|
4919
4923
|
ee(Ui, {
|
|
4920
4924
|
"visible-layers": d.value,
|
|
4921
|
-
"layer-opacities":
|
|
4925
|
+
"layer-opacities": m.value,
|
|
4922
4926
|
"layer-list": n.value,
|
|
4923
|
-
"tiled-layers":
|
|
4927
|
+
"tiled-layers": a.tiledLayers,
|
|
4924
4928
|
"visible-tiled-layers": k.value,
|
|
4925
|
-
"tiled-layer-opacities":
|
|
4926
|
-
"cyclomedia-config":
|
|
4927
|
-
"pictometry-credentials":
|
|
4928
|
-
"basemap-control-position":
|
|
4929
|
-
"navigation-control-position":
|
|
4930
|
-
"geolocation-control-position":
|
|
4931
|
-
"search-control-position":
|
|
4932
|
-
"draw-control-position":
|
|
4933
|
-
"cyclomedia-button-position":
|
|
4934
|
-
"pictometry-button-position":
|
|
4935
|
-
"initial-zoom":
|
|
4936
|
-
"initial-center":
|
|
4929
|
+
"tiled-layer-opacities": b.value,
|
|
4930
|
+
"cyclomedia-config": a.cyclomediaConfig,
|
|
4931
|
+
"pictometry-credentials": a.pictometryCredentials,
|
|
4932
|
+
"basemap-control-position": a.basemapControlPosition,
|
|
4933
|
+
"navigation-control-position": a.navigationControlPosition,
|
|
4934
|
+
"geolocation-control-position": a.geolocationControlPosition,
|
|
4935
|
+
"search-control-position": a.searchControlPosition,
|
|
4936
|
+
"draw-control-position": a.drawControlPosition,
|
|
4937
|
+
"cyclomedia-button-position": a.cyclomediaButtonPosition,
|
|
4938
|
+
"pictometry-button-position": a.pictometryButtonPosition,
|
|
4939
|
+
"initial-zoom": a.initialZoom,
|
|
4940
|
+
"initial-center": a.initialCenter,
|
|
4937
4941
|
onZoom: Mt,
|
|
4938
4942
|
onLayerLoading: at,
|
|
4939
4943
|
onLayerError: Dt
|
|
@@ -4961,7 +4965,7 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4961
4965
|
style: we(tt.value),
|
|
4962
4966
|
onClick: Tt
|
|
4963
4967
|
}, [
|
|
4964
|
-
Me.value === "map" ? (
|
|
4968
|
+
Me.value === "map" ? (_(), L("span", _a, Q(a.sidebarLabel), 1)) : (_(), L("span", Ca, Q(a.mapLabel), 1))
|
|
4965
4969
|
], 4),
|
|
4966
4970
|
D("footer", {
|
|
4967
4971
|
class: "layerboard-footer",
|
|
@@ -4975,7 +4979,7 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
4975
4979
|
F[4] || (F[4] = Ve(" City of Philadelphia ", -1))
|
|
4976
4980
|
], !0)
|
|
4977
4981
|
], 4),
|
|
4978
|
-
he.value ? (
|
|
4982
|
+
he.value ? (_(), L("div", {
|
|
4979
4983
|
key: 0,
|
|
4980
4984
|
class: "layerboard-modal-backdrop",
|
|
4981
4985
|
onClick: Xe,
|
|
@@ -5008,7 +5012,7 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
5008
5012
|
D("span", wa, Q(Me.value === "sidebar" ? "Showing layers panel" : "Showing map"), 1)
|
|
5009
5013
|
]));
|
|
5010
5014
|
}
|
|
5011
|
-
}),
|
|
5015
|
+
}), Ha = /* @__PURE__ */ Oe(Sa, [["__scopeId", "data-v-3a0fb2f3"]]), Ea = ["aria-expanded"], Fa = {
|
|
5012
5016
|
key: 0,
|
|
5013
5017
|
class: "topic-icon"
|
|
5014
5018
|
}, xa = { class: "topic-title" }, La = /* @__PURE__ */ be({
|
|
@@ -5021,42 +5025,42 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
5021
5025
|
headerClass: { default: void 0 }
|
|
5022
5026
|
},
|
|
5023
5027
|
emits: ["toggle", "layerChange"],
|
|
5024
|
-
setup(
|
|
5025
|
-
const t =
|
|
5028
|
+
setup(a, { emit: e }) {
|
|
5029
|
+
const t = a, i = e, s = E(t.expanded), n = `topic-panel-${ei()}`, o = `topic-header-${ei()}`;
|
|
5026
5030
|
le(
|
|
5027
5031
|
() => t.expanded,
|
|
5028
5032
|
(c) => {
|
|
5029
|
-
|
|
5033
|
+
s.value = c;
|
|
5030
5034
|
}
|
|
5031
5035
|
);
|
|
5032
5036
|
function u() {
|
|
5033
|
-
|
|
5037
|
+
s.value = !s.value, i("toggle", s.value);
|
|
5034
5038
|
}
|
|
5035
5039
|
return (c, h) => {
|
|
5036
5040
|
const d = Ti("font-awesome-icon");
|
|
5037
|
-
return
|
|
5038
|
-
class: me(["topic-accordion", { "is-expanded":
|
|
5041
|
+
return _(), L("div", {
|
|
5042
|
+
class: me(["topic-accordion", { "is-expanded": s.value }])
|
|
5039
5043
|
}, [
|
|
5040
5044
|
D("button", {
|
|
5041
5045
|
id: o,
|
|
5042
|
-
class: me(["topic-header",
|
|
5046
|
+
class: me(["topic-header", a.headerClass]),
|
|
5043
5047
|
type: "button",
|
|
5044
|
-
"aria-expanded":
|
|
5048
|
+
"aria-expanded": s.value,
|
|
5045
5049
|
"aria-controls": n,
|
|
5046
5050
|
onClick: u
|
|
5047
5051
|
}, [
|
|
5048
|
-
|
|
5052
|
+
a.icon || c.$slots.icon ? (_(), L("span", Fa, [
|
|
5049
5053
|
Se(c.$slots, "icon", {}, () => [
|
|
5050
|
-
|
|
5054
|
+
a.icon ? (_(), K(d, {
|
|
5051
5055
|
key: 0,
|
|
5052
|
-
icon: ["fas",
|
|
5056
|
+
icon: ["fas", a.icon],
|
|
5053
5057
|
"aria-hidden": "true"
|
|
5054
5058
|
}, null, 8, ["icon"])) : Z("", !0)
|
|
5055
5059
|
], !0)
|
|
5056
5060
|
])) : Z("", !0),
|
|
5057
|
-
D("span", xa, Q(
|
|
5061
|
+
D("span", xa, Q(a.title), 1),
|
|
5058
5062
|
D("span", {
|
|
5059
|
-
class: me(["topic-chevron", { "is-rotated":
|
|
5063
|
+
class: me(["topic-chevron", { "is-rotated": s.value }])
|
|
5060
5064
|
}, [...h[0] || (h[0] = [
|
|
5061
5065
|
D("svg", {
|
|
5062
5066
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5084,23 +5088,23 @@ const pa = { class: "layerboard-layout" }, fa = ["aria-expanded"], ma = {
|
|
|
5084
5088
|
h[1] || (h[1] = D("p", { class: "topic-empty" }, "No content provided for this topic.", -1))
|
|
5085
5089
|
], !0)
|
|
5086
5090
|
], 512), [
|
|
5087
|
-
[Bi,
|
|
5091
|
+
[Bi, s.value]
|
|
5088
5092
|
])
|
|
5089
5093
|
], 2);
|
|
5090
5094
|
};
|
|
5091
5095
|
}
|
|
5092
5096
|
}), Wa = /* @__PURE__ */ Oe(La, [["__scopeId", "data-v-a2023afa"]]);
|
|
5093
|
-
function Aa(
|
|
5094
|
-
return
|
|
5097
|
+
function Aa(a) {
|
|
5098
|
+
return a.displayOptions?.shouldShowCheckbox !== !1;
|
|
5095
5099
|
}
|
|
5096
|
-
function wi(
|
|
5097
|
-
return e ?
|
|
5100
|
+
function wi(a, e) {
|
|
5101
|
+
return e ? a.displayOptions?.shouldShowSlider !== !1 : !1;
|
|
5098
5102
|
}
|
|
5099
|
-
function Si(
|
|
5100
|
-
return e ?
|
|
5103
|
+
function Si(a, e) {
|
|
5104
|
+
return e ? a.displayOptions?.shouldShowLegendBox !== !1 : !1;
|
|
5101
5105
|
}
|
|
5102
|
-
function
|
|
5103
|
-
return
|
|
5106
|
+
function Ge(a) {
|
|
5107
|
+
return a.displayOptions?.layerNameChange || a.title;
|
|
5104
5108
|
}
|
|
5105
5109
|
const Ia = ["aria-label"], Ma = ["checked", "disabled", "onChange"], Da = { class: "layer-title" }, Ta = { class: "layer-title" }, Ba = {
|
|
5106
5110
|
key: 0,
|
|
@@ -5119,23 +5123,23 @@ const Ia = ["aria-label"], Ma = ["checked", "disabled", "onChange"], Da = { clas
|
|
|
5119
5123
|
groupLabel: { default: void 0 }
|
|
5120
5124
|
},
|
|
5121
5125
|
emits: ["toggleLayer", "setOpacity"],
|
|
5122
|
-
setup(
|
|
5123
|
-
const t =
|
|
5126
|
+
setup(a, { emit: e }) {
|
|
5127
|
+
const t = a, i = e, { isVisible: s, getLayerOpacity: n, isLayerLoading: o, getLayerError: u, isLayerAvailableAtZoom: c } = Ht(
|
|
5124
5128
|
() => t
|
|
5125
5129
|
);
|
|
5126
5130
|
function h(d) {
|
|
5127
5131
|
i("toggleLayer", d);
|
|
5128
5132
|
}
|
|
5129
|
-
return (d,
|
|
5133
|
+
return (d, m) => (_(), L("fieldset", {
|
|
5130
5134
|
class: "layer-checkbox-set",
|
|
5131
5135
|
role: "group",
|
|
5132
|
-
"aria-label":
|
|
5136
|
+
"aria-label": a.groupLabel
|
|
5133
5137
|
}, [
|
|
5134
|
-
(
|
|
5138
|
+
(_(!0), L(ke, null, Ae(a.layers, (r) => (_(), L("div", {
|
|
5135
5139
|
key: r.id,
|
|
5136
5140
|
class: "layer-item"
|
|
5137
5141
|
}, [
|
|
5138
|
-
y(Aa)(r) ? (
|
|
5142
|
+
y(Aa)(r) ? (_(), L("label", {
|
|
5139
5143
|
key: 0,
|
|
5140
5144
|
class: me(["layer-checkbox", {
|
|
5141
5145
|
"layer-unavailable": !y(c)(r),
|
|
@@ -5144,19 +5148,19 @@ const Ia = ["aria-label"], Ma = ["checked", "disabled", "onChange"], Da = { clas
|
|
|
5144
5148
|
}, [
|
|
5145
5149
|
D("input", {
|
|
5146
5150
|
type: "checkbox",
|
|
5147
|
-
checked: y(
|
|
5151
|
+
checked: y(s)(r.id),
|
|
5148
5152
|
disabled: !y(c)(r),
|
|
5149
|
-
onChange: (
|
|
5153
|
+
onChange: (f) => h(r.id)
|
|
5150
5154
|
}, null, 40, Ma),
|
|
5151
5155
|
D("span", Da, [
|
|
5152
|
-
Ve(Q(y(
|
|
5156
|
+
Ve(Q(y(Ge)(r)) + " ", 1),
|
|
5153
5157
|
ee(St, {
|
|
5154
5158
|
loading: y(o)(r.id),
|
|
5155
5159
|
error: y(u)(r.id),
|
|
5156
5160
|
unavailable: !y(c)(r)
|
|
5157
5161
|
}, null, 8, ["loading", "error", "unavailable"])
|
|
5158
5162
|
])
|
|
5159
|
-
], 2)) : (
|
|
5163
|
+
], 2)) : (_(), L("div", {
|
|
5160
5164
|
key: 1,
|
|
5161
5165
|
class: me(["layer-label-only", {
|
|
5162
5166
|
"layer-unavailable": !y(c)(r),
|
|
@@ -5164,7 +5168,7 @@ const Ia = ["aria-label"], Ma = ["checked", "disabled", "onChange"], Da = { clas
|
|
|
5164
5168
|
}])
|
|
5165
5169
|
}, [
|
|
5166
5170
|
D("span", Ta, [
|
|
5167
|
-
Ve(Q(y(
|
|
5171
|
+
Ve(Q(y(Ge)(r)) + " ", 1),
|
|
5168
5172
|
ee(St, {
|
|
5169
5173
|
loading: y(o)(r.id),
|
|
5170
5174
|
error: y(u)(r.id),
|
|
@@ -5172,20 +5176,20 @@ const Ia = ["aria-label"], Ma = ["checked", "disabled", "onChange"], Da = { clas
|
|
|
5172
5176
|
}, null, 8, ["loading", "error", "unavailable"])
|
|
5173
5177
|
])
|
|
5174
5178
|
], 2)),
|
|
5175
|
-
y(wi)(r,
|
|
5179
|
+
y(wi)(r, a.showOpacity) && y(s)(r.id) && y(c)(r) ? (_(), K(qt, {
|
|
5176
5180
|
key: 2,
|
|
5177
5181
|
"layer-id": r.id,
|
|
5178
|
-
"layer-name": y(
|
|
5182
|
+
"layer-name": y(Ge)(r),
|
|
5179
5183
|
opacity: y(n)(r.id),
|
|
5180
|
-
"onUpdate:opacity": (
|
|
5184
|
+
"onUpdate:opacity": (f) => i("setOpacity", r.id, f)
|
|
5181
5185
|
}, null, 8, ["layer-id", "layer-name", "opacity", "onUpdate:opacity"])) : Z("", !0),
|
|
5182
|
-
y(Si)(r,
|
|
5186
|
+
y(Si)(r, a.showLegend) && y(s)(r.id) && y(c)(r) && r.legend?.length ? (_(), K(Gt, {
|
|
5183
5187
|
key: 3,
|
|
5184
5188
|
items: r.legend,
|
|
5185
|
-
label: "Legend for " + y(
|
|
5189
|
+
label: "Legend for " + y(Ge)(r)
|
|
5186
5190
|
}, null, 8, ["items", "label"])) : Z("", !0)
|
|
5187
5191
|
]))), 128)),
|
|
5188
|
-
|
|
5192
|
+
a.layers.length === 0 ? (_(), L("div", Ba, "No layers available")) : Z("", !0)
|
|
5189
5193
|
], 8, Ia));
|
|
5190
5194
|
}
|
|
5191
5195
|
}), Ka = /* @__PURE__ */ Oe(Va, [["__scopeId", "data-v-bfcd7855"]]), Pa = ["aria-label"], Oa = ["name", "checked", "disabled", "onChange"], Ra = { class: "layer-title" }, $a = {
|
|
@@ -5206,20 +5210,20 @@ const Ia = ["aria-label"], Ma = ["checked", "disabled", "onChange"], Da = { clas
|
|
|
5206
5210
|
groupLabel: { default: void 0 }
|
|
5207
5211
|
},
|
|
5208
5212
|
emits: ["selectLayer", "setOpacity"],
|
|
5209
|
-
setup(
|
|
5210
|
-
const t =
|
|
5213
|
+
setup(a, { emit: e }) {
|
|
5214
|
+
const t = a, i = e, { isVisible: s, getLayerOpacity: n, isLayerLoading: o, getLayerError: u, isLayerAvailableAtZoom: c } = Ht(
|
|
5211
5215
|
() => t
|
|
5212
5216
|
);
|
|
5213
5217
|
function h(d) {
|
|
5214
|
-
const
|
|
5215
|
-
i("selectLayer", d,
|
|
5218
|
+
const m = t.layers.filter((r) => t.visibleLayerIds.has(r.id) && r.id !== d).map((r) => r.id);
|
|
5219
|
+
i("selectLayer", d, m);
|
|
5216
5220
|
}
|
|
5217
|
-
return (d,
|
|
5221
|
+
return (d, m) => (_(), L("div", {
|
|
5218
5222
|
class: "layer-radio-set",
|
|
5219
5223
|
role: "radiogroup",
|
|
5220
|
-
"aria-label":
|
|
5224
|
+
"aria-label": a.groupLabel
|
|
5221
5225
|
}, [
|
|
5222
|
-
(
|
|
5226
|
+
(_(!0), L(ke, null, Ae(a.layers, (r) => (_(), L("div", {
|
|
5223
5227
|
key: r.id,
|
|
5224
5228
|
class: "layer-item"
|
|
5225
5229
|
}, [
|
|
@@ -5231,13 +5235,13 @@ const Ia = ["aria-label"], Ma = ["checked", "disabled", "onChange"], Da = { clas
|
|
|
5231
5235
|
}, [
|
|
5232
5236
|
D("input", {
|
|
5233
5237
|
type: "radio",
|
|
5234
|
-
name:
|
|
5235
|
-
checked: y(
|
|
5238
|
+
name: a.groupName,
|
|
5239
|
+
checked: y(s)(r.id),
|
|
5236
5240
|
disabled: !y(c)(r),
|
|
5237
|
-
onChange: (
|
|
5241
|
+
onChange: (f) => h(r.id)
|
|
5238
5242
|
}, null, 40, Oa),
|
|
5239
5243
|
D("span", Ra, [
|
|
5240
|
-
Ve(Q(y(
|
|
5244
|
+
Ve(Q(y(Ge)(r)) + " ", 1),
|
|
5241
5245
|
ee(St, {
|
|
5242
5246
|
loading: y(o)(r.id),
|
|
5243
5247
|
error: y(u)(r.id),
|
|
@@ -5245,92 +5249,92 @@ const Ia = ["aria-label"], Ma = ["checked", "disabled", "onChange"], Da = { clas
|
|
|
5245
5249
|
}, null, 8, ["loading", "error", "unavailable"])
|
|
5246
5250
|
])
|
|
5247
5251
|
], 2),
|
|
5248
|
-
y(wi)(r,
|
|
5252
|
+
y(wi)(r, a.showOpacity) && y(s)(r.id) && y(c)(r) ? (_(), K(qt, {
|
|
5249
5253
|
key: 0,
|
|
5250
5254
|
"layer-id": r.id,
|
|
5251
|
-
"layer-name": y(
|
|
5255
|
+
"layer-name": y(Ge)(r),
|
|
5252
5256
|
opacity: y(n)(r.id),
|
|
5253
|
-
"onUpdate:opacity": (
|
|
5257
|
+
"onUpdate:opacity": (f) => i("setOpacity", r.id, f)
|
|
5254
5258
|
}, null, 8, ["layer-id", "layer-name", "opacity", "onUpdate:opacity"])) : Z("", !0),
|
|
5255
|
-
y(Si)(r,
|
|
5259
|
+
y(Si)(r, a.showLegend) && y(s)(r.id) && y(c)(r) && r.legend?.length ? (_(), K(Gt, {
|
|
5256
5260
|
key: 1,
|
|
5257
5261
|
items: r.legend,
|
|
5258
|
-
label: "Legend for " + y(
|
|
5262
|
+
label: "Legend for " + y(Ge)(r)
|
|
5259
5263
|
}, null, 8, ["items", "label"])) : Z("", !0)
|
|
5260
5264
|
]))), 128)),
|
|
5261
|
-
|
|
5265
|
+
a.layers.length === 0 ? (_(), L("div", $a, "No layers available")) : Z("", !0)
|
|
5262
5266
|
], 8, Pa));
|
|
5263
5267
|
}
|
|
5264
5268
|
}), Ya = /* @__PURE__ */ Oe(Na, [["__scopeId", "data-v-c368d815"]]);
|
|
5265
|
-
function Xa(
|
|
5266
|
-
const e = E([]), t = E(/* @__PURE__ */ new Set()), i = E({}),
|
|
5269
|
+
function Xa(a) {
|
|
5270
|
+
const e = E([]), t = E(/* @__PURE__ */ new Set()), i = E({}), s = E(/* @__PURE__ */ new Set()), n = E({}), o = E(""), u = E(!1), c = E(!1), h = E(null), d = $(() => {
|
|
5267
5271
|
if (!o.value.trim())
|
|
5268
5272
|
return e.value;
|
|
5269
|
-
const
|
|
5270
|
-
return e.value.filter((T) => T.title.toLowerCase().includes(
|
|
5271
|
-
}),
|
|
5272
|
-
config:
|
|
5273
|
-
component:
|
|
5273
|
+
const M = o.value.toLowerCase();
|
|
5274
|
+
return e.value.filter((T) => T.title.toLowerCase().includes(M));
|
|
5275
|
+
}), m = $(() => e.value.map((M) => ({
|
|
5276
|
+
config: M,
|
|
5277
|
+
component: M.type
|
|
5274
5278
|
// "circle", "fill", or "line"
|
|
5275
5279
|
})));
|
|
5276
5280
|
async function r() {
|
|
5277
5281
|
if (!c.value) {
|
|
5278
5282
|
u.value = !0, h.value = null;
|
|
5279
5283
|
try {
|
|
5280
|
-
let
|
|
5281
|
-
|
|
5284
|
+
let M;
|
|
5285
|
+
a.mode === "dynamic" || !a.mode ? a.webMapId ? M = await f(a.webMapId) : M = await Ut() : M = await Ut(), e.value = M;
|
|
5282
5286
|
const T = {};
|
|
5283
|
-
|
|
5287
|
+
M.forEach((R) => {
|
|
5284
5288
|
T[R.id] = R.opacity ?? 1;
|
|
5285
5289
|
}), i.value = T, c.value = !0;
|
|
5286
|
-
} catch (
|
|
5287
|
-
h.value =
|
|
5290
|
+
} catch (M) {
|
|
5291
|
+
h.value = M instanceof Error ? M : new Error("Failed to initialize layerboard");
|
|
5288
5292
|
} finally {
|
|
5289
5293
|
u.value = !1;
|
|
5290
5294
|
}
|
|
5291
5295
|
}
|
|
5292
5296
|
}
|
|
5293
|
-
async function
|
|
5294
|
-
const T = Kt(
|
|
5297
|
+
async function f(M) {
|
|
5298
|
+
const T = Kt(M), R = await fetch(T, { cache: "no-store" });
|
|
5295
5299
|
if (!R.ok)
|
|
5296
5300
|
throw new Error(`Failed to fetch WebMap: ${R.status} ${R.statusText}`);
|
|
5297
5301
|
const se = await R.json();
|
|
5298
5302
|
return Ci(se);
|
|
5299
5303
|
}
|
|
5300
|
-
function
|
|
5304
|
+
function v(M) {
|
|
5301
5305
|
const T = new Set(t.value);
|
|
5302
|
-
T.has(
|
|
5306
|
+
T.has(M) ? T.delete(M) : T.add(M), t.value = T;
|
|
5303
5307
|
}
|
|
5304
|
-
function k(
|
|
5308
|
+
function k(M, T) {
|
|
5305
5309
|
i.value = {
|
|
5306
5310
|
...i.value,
|
|
5307
|
-
[
|
|
5311
|
+
[M]: Math.max(0, Math.min(1, T))
|
|
5308
5312
|
};
|
|
5309
5313
|
}
|
|
5310
|
-
function
|
|
5311
|
-
o.value =
|
|
5314
|
+
function b(M) {
|
|
5315
|
+
o.value = M;
|
|
5312
5316
|
}
|
|
5313
|
-
function M
|
|
5314
|
-
const R = new Set(
|
|
5315
|
-
T ? R.add(
|
|
5317
|
+
function A(M, T) {
|
|
5318
|
+
const R = new Set(s.value);
|
|
5319
|
+
T ? R.add(M) : R.delete(M), s.value = R;
|
|
5316
5320
|
}
|
|
5317
|
-
function
|
|
5321
|
+
function I(M, T) {
|
|
5318
5322
|
if (T)
|
|
5319
|
-
n.value = { ...n.value, [
|
|
5323
|
+
n.value = { ...n.value, [M]: T };
|
|
5320
5324
|
else {
|
|
5321
5325
|
const R = { ...n.value };
|
|
5322
|
-
delete R[
|
|
5326
|
+
delete R[M], n.value = R;
|
|
5323
5327
|
}
|
|
5324
5328
|
}
|
|
5325
5329
|
function z() {
|
|
5326
|
-
e.value = [], t.value = /* @__PURE__ */ new Set(), i.value = {},
|
|
5330
|
+
e.value = [], t.value = /* @__PURE__ */ new Set(), i.value = {}, s.value = /* @__PURE__ */ new Set(), n.value = {}, o.value = "", u.value = !1, c.value = !1, h.value = null;
|
|
5327
5331
|
}
|
|
5328
5332
|
return {
|
|
5329
5333
|
// State (readonly)
|
|
5330
5334
|
layerConfigs: W(e),
|
|
5331
5335
|
visibleLayers: W(t),
|
|
5332
5336
|
layerOpacities: W(i),
|
|
5333
|
-
loadingLayers: W(
|
|
5337
|
+
loadingLayers: W(s),
|
|
5334
5338
|
layerErrors: W(n),
|
|
5335
5339
|
searchQuery: W(o),
|
|
5336
5340
|
isLoading: W(u),
|
|
@@ -5338,45 +5342,45 @@ function Xa(s) {
|
|
|
5338
5342
|
error: W(h),
|
|
5339
5343
|
// Computed
|
|
5340
5344
|
filteredLayerConfigs: d,
|
|
5341
|
-
layerList:
|
|
5345
|
+
layerList: m,
|
|
5342
5346
|
// Config
|
|
5343
|
-
config:
|
|
5347
|
+
config: a,
|
|
5344
5348
|
// Methods
|
|
5345
5349
|
initialize: r,
|
|
5346
|
-
toggleLayer:
|
|
5350
|
+
toggleLayer: v,
|
|
5347
5351
|
setLayerOpacity: k,
|
|
5348
|
-
filterLayers:
|
|
5349
|
-
setLayerLoading:
|
|
5350
|
-
setLayerError:
|
|
5352
|
+
filterLayers: b,
|
|
5353
|
+
setLayerLoading: A,
|
|
5354
|
+
setLayerError: I,
|
|
5351
5355
|
reset: z
|
|
5352
5356
|
};
|
|
5353
5357
|
}
|
|
5354
5358
|
function Ja() {
|
|
5355
|
-
const
|
|
5359
|
+
const a = E([]), e = E(/* @__PURE__ */ new Set()), t = E(/* @__PURE__ */ new Set());
|
|
5356
5360
|
function i(n) {
|
|
5357
5361
|
e.value.has(n) ? e.value.delete(n) : e.value.add(n);
|
|
5358
5362
|
}
|
|
5359
|
-
function
|
|
5360
|
-
|
|
5363
|
+
function s(n) {
|
|
5364
|
+
a.value = n;
|
|
5361
5365
|
}
|
|
5362
5366
|
return {
|
|
5363
|
-
layers: $(() =>
|
|
5367
|
+
layers: $(() => a.value),
|
|
5364
5368
|
visibleLayerIds: $(() => e.value),
|
|
5365
5369
|
loadingLayerIds: $(() => t.value),
|
|
5366
5370
|
toggleLayer: i,
|
|
5367
|
-
setLayers:
|
|
5371
|
+
setLayers: s
|
|
5368
5372
|
};
|
|
5369
5373
|
}
|
|
5370
|
-
function za(
|
|
5371
|
-
const e = E(null), t = E(!1), i = E(null),
|
|
5374
|
+
function za(a) {
|
|
5375
|
+
const e = E(null), t = E(!1), i = E(null), s = E(0);
|
|
5372
5376
|
async function n(c = {}) {
|
|
5373
5377
|
t.value = !0, i.value = null;
|
|
5374
|
-
const h =
|
|
5375
|
-
let d = 0,
|
|
5378
|
+
const h = a.pageSize || 2e3;
|
|
5379
|
+
let d = 0, m = [], r = !0;
|
|
5376
5380
|
try {
|
|
5377
5381
|
for (; r; ) {
|
|
5378
|
-
const
|
|
5379
|
-
let
|
|
5382
|
+
const v = a.url.replace(/\/$/, ""), k = encodeURIComponent(c.where || a.where || "1=1");
|
|
5383
|
+
let b = `${v}/query?where=${k}&outFields=*&returnGeometry=true&resultRecordCount=${h}&resultOffset=${d}&f=geojson`;
|
|
5380
5384
|
if (c.bounds) {
|
|
5381
5385
|
const z = JSON.stringify({
|
|
5382
5386
|
xmin: c.bounds.west,
|
|
@@ -5385,28 +5389,28 @@ function za(s) {
|
|
|
5385
5389
|
ymax: c.bounds.north,
|
|
5386
5390
|
spatialReference: { wkid: 4326 }
|
|
5387
5391
|
});
|
|
5388
|
-
|
|
5392
|
+
b += `&geometry=${encodeURIComponent(z)}&geometryType=esriGeometryEnvelope&spatialRel=esriSpatialRelIntersects`;
|
|
5389
5393
|
}
|
|
5390
|
-
const
|
|
5391
|
-
if (!
|
|
5392
|
-
throw new Error(`HTTP ${
|
|
5393
|
-
const
|
|
5394
|
-
|
|
5394
|
+
const A = await fetch(b);
|
|
5395
|
+
if (!A.ok)
|
|
5396
|
+
throw new Error(`HTTP ${A.status}: ${A.statusText}`);
|
|
5397
|
+
const I = await A.json();
|
|
5398
|
+
I.features && I.features.length > 0 ? (m = m.concat(I.features), d += I.features.length, r = I.features.length === h) : r = !1;
|
|
5395
5399
|
}
|
|
5396
|
-
const
|
|
5400
|
+
const f = {
|
|
5397
5401
|
type: "FeatureCollection",
|
|
5398
|
-
features:
|
|
5402
|
+
features: m
|
|
5399
5403
|
};
|
|
5400
|
-
return e.value =
|
|
5401
|
-
} catch (
|
|
5402
|
-
const
|
|
5403
|
-
throw i.value =
|
|
5404
|
+
return e.value = f, s.value = m.length, f;
|
|
5405
|
+
} catch (f) {
|
|
5406
|
+
const v = f instanceof Error ? f : new Error("Failed to fetch features");
|
|
5407
|
+
throw i.value = v, v;
|
|
5404
5408
|
} finally {
|
|
5405
5409
|
t.value = !1;
|
|
5406
5410
|
}
|
|
5407
5411
|
}
|
|
5408
5412
|
function o() {
|
|
5409
|
-
e.value = null,
|
|
5413
|
+
e.value = null, s.value = 0, i.value = null;
|
|
5410
5414
|
}
|
|
5411
5415
|
async function u(c = {}) {
|
|
5412
5416
|
return n(c);
|
|
@@ -5416,22 +5420,22 @@ function za(s) {
|
|
|
5416
5420
|
data: W(e),
|
|
5417
5421
|
isLoading: W(t),
|
|
5418
5422
|
error: W(i),
|
|
5419
|
-
totalFeatures: W(
|
|
5423
|
+
totalFeatures: W(s),
|
|
5420
5424
|
// Config
|
|
5421
|
-
config:
|
|
5425
|
+
config: a,
|
|
5422
5426
|
// Methods
|
|
5423
5427
|
fetch: n,
|
|
5424
5428
|
refetch: u,
|
|
5425
5429
|
clear: o
|
|
5426
5430
|
};
|
|
5427
5431
|
}
|
|
5428
|
-
function Qa(
|
|
5429
|
-
const i = za(
|
|
5432
|
+
function Qa(a, e, t) {
|
|
5433
|
+
const i = za(a);
|
|
5430
5434
|
return le(
|
|
5431
5435
|
e,
|
|
5432
|
-
async (
|
|
5433
|
-
if (
|
|
5434
|
-
const n = t(
|
|
5436
|
+
async (s) => {
|
|
5437
|
+
if (s) {
|
|
5438
|
+
const n = t(s);
|
|
5435
5439
|
await i.fetch(n);
|
|
5436
5440
|
}
|
|
5437
5441
|
},
|
|
@@ -5440,17 +5444,17 @@ function Qa(s, e, t) {
|
|
|
5440
5444
|
}
|
|
5441
5445
|
export {
|
|
5442
5446
|
Ka as LayerCheckboxSet,
|
|
5443
|
-
|
|
5447
|
+
Gs as LayerPanel,
|
|
5444
5448
|
Ya as LayerRadioButtonSet,
|
|
5445
|
-
|
|
5449
|
+
Ha as Layerboard,
|
|
5446
5450
|
Ui as MapPanel,
|
|
5447
5451
|
Wa as TopicAccordion,
|
|
5448
5452
|
qa as WEBMAP_ID,
|
|
5449
5453
|
Kt as buildWebMapUrl,
|
|
5450
5454
|
la as clearCache,
|
|
5451
5455
|
Ut as getLayerConfigs,
|
|
5452
|
-
|
|
5453
|
-
|
|
5456
|
+
Ge as getLayerDisplayName,
|
|
5457
|
+
Ga as getWebMapUrl,
|
|
5454
5458
|
fi as normalizeUrl,
|
|
5455
5459
|
Aa as shouldShowCheckbox,
|
|
5456
5460
|
Si as shouldShowLegendBox,
|