@m3ui-vue/m3ui-vue 1.0.3 → 1.1.1

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.
Files changed (101) hide show
  1. package/dist/API.md +75 -11
  2. package/dist/MMenuItem-BOkcVtEe.js +809 -0
  3. package/dist/MMenuItem-BOkcVtEe.js.map +1 -0
  4. package/dist/{MSlider-CdNIH7jc.js → MSlider-BXsBv0ox.js} +208 -182
  5. package/dist/MSlider-BXsBv0ox.js.map +1 -0
  6. package/dist/{MTextField-B4X92vH_.js → MTextField-rML9jnXs.js} +2 -2
  7. package/dist/{MTextField-B4X92vH_.js.map → MTextField-rML9jnXs.js.map} +1 -1
  8. package/dist/api.json +1 -1
  9. package/dist/code-editor.js +1 -1
  10. package/dist/components/MBottomSheet.vue.d.ts +20 -1
  11. package/dist/components/MDialog.vue.d.ts +17 -8
  12. package/dist/components/MDragDropList.vue.d.ts +1 -1
  13. package/dist/components/MMap.vue.d.ts +4 -4
  14. package/dist/components/MMapControl.vue.d.ts +20 -3
  15. package/dist/components/MMapMarker.vue.d.ts +5 -2
  16. package/dist/components/MMapPopup.vue.d.ts +5 -3
  17. package/dist/components/MMenuItem.vue.d.ts +2 -2
  18. package/dist/components/MSeekBar.vue.d.ts +122 -0
  19. package/dist/components/MSplitButton.vue.d.ts +2 -2
  20. package/dist/components/_MMapAttribution.vue.d.ts +7 -0
  21. package/dist/composables/_mapPin.d.ts +5 -0
  22. package/dist/composables/_popupPosition.d.ts +12 -0
  23. package/dist/composables/_useCalendarMonth.d.ts +24 -0
  24. package/dist/composables/_useEscapeStack.d.ts +3 -0
  25. package/dist/composables/_useScrollLock.d.ts +8 -0
  26. package/dist/composables/_useSheetMotion.d.ts +16 -1
  27. package/dist/composables/useLocale.d.ts +8 -0
  28. package/dist/index.d.ts +2 -0
  29. package/dist/locales/index.js +56 -0
  30. package/dist/locales/index.js.map +1 -1
  31. package/dist/m3ui-vue.css +1 -1
  32. package/dist/m3ui.js +5276 -4718
  33. package/dist/m3ui.js.map +1 -1
  34. package/dist/map.js +777 -641
  35. package/dist/map.js.map +1 -1
  36. package/dist/rich-text-editor.js +8 -8
  37. package/dist/styles.css +1 -1
  38. package/dist/{useLocale-b5-hzsL3.js → useLocale-CqQrhWFl.js} +9 -1
  39. package/dist/useLocale-CqQrhWFl.js.map +1 -0
  40. package/package.json +1 -1
  41. package/src/__tests__/MDialog.test.ts +30 -0
  42. package/src/__tests__/MMap.test.ts +132 -2
  43. package/src/__tests__/MSeekBar.test.ts +170 -0
  44. package/src/__tests__/MShape.test.ts +20 -0
  45. package/src/__tests__/MTooltip.test.ts +110 -0
  46. package/src/__tests__/_fakeMaplibre.ts +3 -0
  47. package/src/__tests__/calendarMonth.test.ts +59 -0
  48. package/src/__tests__/pickerModals.test.ts +128 -0
  49. package/src/__tests__/popupPosition.test.ts +224 -0
  50. package/src/__tests__/scrollLock.test.ts +110 -0
  51. package/src/__tests__/sheets.test.ts +158 -0
  52. package/src/components/MAutocomplete.vue +2 -4
  53. package/src/components/MBottomSheet.vue +211 -13
  54. package/src/components/MCommandPalette.vue +4 -6
  55. package/src/components/MContextMenu.vue +19 -5
  56. package/src/components/MDatePicker.vue +29 -70
  57. package/src/components/MDatePickerModal.vue +116 -172
  58. package/src/components/MDateRangePicker.vue +29 -51
  59. package/src/components/MDateRangePickerModal.vue +84 -162
  60. package/src/components/MDialog.vue +87 -63
  61. package/src/components/MLightbox.vue +6 -3
  62. package/src/components/MMap.vue +74 -28
  63. package/src/components/MMapControl.vue +121 -7
  64. package/src/components/MMapIdentify.vue +2 -1
  65. package/src/components/MMapMarker.vue +14 -7
  66. package/src/components/MMapPopup.vue +8 -4
  67. package/src/components/MMenu.vue +31 -12
  68. package/src/components/MMenuItem.vue +21 -4
  69. package/src/components/MMultiAutocomplete.vue +2 -4
  70. package/src/components/MMultiSelect.vue +2 -4
  71. package/src/components/MNavigationDrawer.vue +2 -8
  72. package/src/components/MNavigationRail.vue +2 -3
  73. package/src/components/MSearchBar.vue +2 -5
  74. package/src/components/MSeekBar.vue +593 -0
  75. package/src/components/MSelect.vue +2 -8
  76. package/src/components/MShape.vue +22 -8
  77. package/src/components/MSplitButton.vue +23 -7
  78. package/src/components/MSpotlightSearch.vue +4 -6
  79. package/src/components/MTimePicker.vue +23 -6
  80. package/src/components/MTimePickerModal.vue +213 -226
  81. package/src/components/MTooltip.vue +99 -3
  82. package/src/components/_MMapAttribution.vue +81 -0
  83. package/src/composables/_mapPin.ts +25 -0
  84. package/src/composables/_popupPosition.ts +39 -0
  85. package/src/composables/_useCalendarMonth.ts +74 -0
  86. package/src/composables/_useEscapeStack.ts +33 -0
  87. package/src/composables/_useScrollLock.ts +41 -0
  88. package/src/composables/_useSheetMotion.ts +82 -20
  89. package/src/composables/useLocale.ts +16 -0
  90. package/src/index.ts +2 -0
  91. package/src/locales/de.ts +8 -0
  92. package/src/locales/es.ts +8 -0
  93. package/src/locales/fr.ts +8 -0
  94. package/src/locales/ja.ts +8 -0
  95. package/src/locales/ko.ts +8 -0
  96. package/src/locales/pt.ts +8 -0
  97. package/src/locales/zh.ts +8 -0
  98. package/dist/MMenuItem-DFyXflk9.js +0 -707
  99. package/dist/MMenuItem-DFyXflk9.js.map +0 -1
  100. package/dist/MSlider-CdNIH7jc.js.map +0 -1
  101. package/dist/useLocale-b5-hzsL3.js.map +0 -1
package/dist/map.js CHANGED
@@ -1,24 +1,24 @@
1
- import { a as e, i as t, l as n, n as r, s as i, t as a } from "./MSlider-CdNIH7jc.js";
2
- import { i as o } from "./useLocale-b5-hzsL3.js";
3
- import { h as s, n as c, t as l } from "./MTextField-B4X92vH_.js";
4
- import { t as u } from "./MIcon-DLOkQduI.js";
5
- import { Fragment as d, Transition as f, computed as p, createBlock as m, createCommentVNode as h, createElementBlock as g, createElementVNode as _, createSlots as v, createTextVNode as y, createVNode as b, defineComponent as x, getCurrentInstance as S, inject as C, markRaw as w, mergeProps as T, normalizeClass as E, normalizeStyle as D, onBeforeUnmount as O, onMounted as k, onUnmounted as A, openBlock as j, provide as M, reactive as N, ref as P, renderList as F, renderSlot as I, shallowRef as L, toDisplayString as R, unref as z, useId as B, useSlots as V, watch as H, withCtx as U, withModifiers as W } from "vue";
1
+ import { a as e, c as t, d as n, i as r, l as i, n as a, p as o, s, t as c, u as l } from "./MSlider-BXsBv0ox.js";
2
+ import { i as u } from "./useLocale-CqQrhWFl.js";
3
+ import { f as d, h as f, n as p, t as m } from "./MTextField-rML9jnXs.js";
4
+ import { t as h } from "./MIcon-DLOkQduI.js";
5
+ import { Fragment as g, Transition as _, computed as v, createBlock as y, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createSlots as C, createTextVNode as w, createVNode as T, defineComponent as E, getCurrentInstance as D, inject as O, markRaw as k, mergeProps as A, normalizeClass as j, normalizeStyle as M, onBeforeUnmount as N, onMounted as P, onUnmounted as ee, openBlock as F, provide as I, reactive as L, ref as R, renderList as z, renderSlot as B, shallowRef as V, toDisplayString as H, unref as U, useId as te, useSlots as ne, watch as W, withCtx as G, withModifiers as K } from "vue";
6
6
  //#region src/composables/useMap.ts
7
- var ee = Symbol("m3-map");
8
- function G() {
9
- let e = C(ee, null);
7
+ var q = Symbol("m3-map");
8
+ function J() {
9
+ let e = O(q, null);
10
10
  if (!e) throw Error("useMap() must be called in a component inside <MMap>");
11
11
  let t = [];
12
- S() && O(() => t.splice(0).forEach((e) => e()));
12
+ D() && N(() => t.splice(0).forEach((e) => e()));
13
13
  function n(n) {
14
14
  let r = () => {
15
15
  if (e.map.value && e.maplibre.value) return n(e.map.value, e.maplibre.value);
16
- let r = H(e.map, (t) => {
16
+ let r = W(e.map, (t) => {
17
17
  t && e.maplibre.value && (r(), n(t, e.maplibre.value));
18
18
  });
19
19
  t.push(r);
20
- }, i = S();
21
- i && !i.isMounted ? k(r) : r();
20
+ }, i = D();
21
+ i && !i.isMounted ? P(r) : r();
22
22
  }
23
23
  function r(e, r) {
24
24
  n((n) => {
@@ -31,9 +31,9 @@ function G() {
31
31
  });
32
32
  }
33
33
  return {
34
- map: p(() => e.map.value),
35
- maplibre: p(() => e.maplibre.value),
36
- styleVersion: p(() => e.styleVersion.value),
34
+ map: v(() => e.map.value),
35
+ maplibre: v(() => e.maplibre.value),
36
+ styleVersion: v(() => e.styleVersion.value),
37
37
  activeTool: e.activeTool,
38
38
  onReady: n,
39
39
  on: r,
@@ -41,8 +41,162 @@ function G() {
41
41
  };
42
42
  }
43
43
  //#endregion
44
- //#region src/composables/useMapLayers.ts
45
- var te = {
44
+ //#region src/components/MMapControl.vue?vue&type=script&setup=true&lang.ts
45
+ var re = { class: "hidden" }, ie = {
46
+ key: 0,
47
+ class: "m3-map-control-panel-in"
48
+ }, ae = /* @__PURE__ */ E({
49
+ inheritAttrs: !1,
50
+ __name: "MMapControl",
51
+ props: {
52
+ position: { default: "top-right" },
53
+ group: {
54
+ type: Boolean,
55
+ default: !0
56
+ },
57
+ expanded: {
58
+ type: Boolean,
59
+ default: !1
60
+ },
61
+ animate: {
62
+ type: Boolean,
63
+ default: !0
64
+ }
65
+ },
66
+ emits: ["update:expanded"],
67
+ setup(e, { emit: r }) {
68
+ let a = e, o = r, s = ne(), c = R(), { onReady: u } = J(), f = R(a.expanded);
69
+ W(() => a.expanded, (e) => {
70
+ f.value = e;
71
+ });
72
+ let p = v(() => f.value && !!s.panel);
73
+ function m(e) {
74
+ e !== f.value && (f.value = e, o("update:expanded", e));
75
+ }
76
+ let h = () => m(!f.value), g = () => m(!1);
77
+ function _(e) {
78
+ p.value && !c.value?.contains(e.target) && g();
79
+ }
80
+ function y(e) {
81
+ e.key === "Escape" && p.value && (g(), e.stopPropagation());
82
+ }
83
+ let b = null, C = null, w = [], T = {
84
+ w: 0,
85
+ h: 0
86
+ }, E = {
87
+ w: 0,
88
+ h: 0
89
+ }, D = null;
90
+ function O() {
91
+ return {
92
+ w: c.value.offsetWidth,
93
+ h: c.value.offsetHeight
94
+ };
95
+ }
96
+ function k() {
97
+ let e = c.value;
98
+ if (!e || C) return;
99
+ let t = O();
100
+ b && (t.w !== b.w || t.h !== b.h) && a.animate && !i() && j(e, b, t), b = t;
101
+ }
102
+ function j(e, r, i) {
103
+ if (T = r, E = i, w = n(0, 1, 0, d.standard.defaultSpatial, .002), e.style.overflow = "hidden", C = t(e, w, (e) => ({
104
+ width: `${r.w + (i.w - r.w) * e}px`,
105
+ height: `${r.h + (i.h - r.h) * e}px`
106
+ })), !C) return M(e);
107
+ C.onfinish = () => M(e);
108
+ }
109
+ function M(e) {
110
+ C?.cancel(), C = null, e.style.overflow = "";
111
+ let t = O();
112
+ t.w !== E.w || t.h !== E.h ? (b = E, k()) : b = t;
113
+ }
114
+ function ee() {
115
+ if (!c.value || !C) return;
116
+ let e = l(w, C.currentTime), t = {
117
+ w: T.w + (E.w - T.w) * e,
118
+ h: T.h + (E.h - T.h) * e
119
+ };
120
+ C.onfinish = null, C.cancel(), C = null, b = t, k();
121
+ }
122
+ W(p, ee, { flush: "post" });
123
+ let I, L = {
124
+ onAdd: () => c.value,
125
+ onRemove: () => c.value?.remove()
126
+ };
127
+ return u((e) => {
128
+ I = e, c.value && e.addControl(L, a.position);
129
+ }), W(() => a.position, (e) => {
130
+ I && c.value && (I.removeControl(L), I.addControl(L, e));
131
+ }), P(() => {
132
+ document.addEventListener("pointerdown", _, !0), !(typeof ResizeObserver > "u" || !c.value) && (D = new ResizeObserver(k), D.observe(c.value));
133
+ }), N(() => {
134
+ document.removeEventListener("pointerdown", _, !0), D?.disconnect(), C?.cancel(), I?.hasControl(L) && I.removeControl(L);
135
+ }), (t, n) => (F(), x("div", re, [S("div", A({
136
+ ref_key: "el",
137
+ ref: c,
138
+ class: ["maplibregl-ctrl m3-map-control", p.value ? "m3-map-control-panel" : e.group ? "maplibregl-ctrl-group" : ""]
139
+ }, t.$attrs, { onKeydown: y }), [p.value ? (F(), x("div", ie, [B(t.$slots, "panel", { close: g })])) : B(t.$slots, "default", {
140
+ expanded: f.value,
141
+ toggle: h
142
+ }, void 0, void 0, 1)], 16)]));
143
+ }
144
+ }), Y = [
145
+ "title",
146
+ "aria-label",
147
+ "aria-expanded"
148
+ ], X = ["innerHTML"], oe = /* @__PURE__ */ E({
149
+ __name: "_MMapAttribution",
150
+ props: { position: {} },
151
+ setup(e) {
152
+ let t = e, n = u(), { on: r, onReady: i } = J(), a = R([]), o = R(!0), s = R(0), c;
153
+ function l() {
154
+ if (!c) return;
155
+ let e = c.getStyle?.();
156
+ if (!e?.sources) return;
157
+ let t = new Set(e.layers?.map((e) => e.source).filter(Boolean)), n = [];
158
+ for (let [r, i] of Object.entries(e.sources)) {
159
+ if (t.size && !t.has(r)) continue;
160
+ let e = c.getSource(r)?.attribution ?? i.attribution;
161
+ e && !n.includes(e) && n.push(e);
162
+ }
163
+ let r = n.filter((e) => !n.some((t) => t !== e && t.includes(e)));
164
+ r.join("\n") !== a.value.join("\n") && (a.value = r), s.value = Math.max(0, c.getContainer().clientWidth - 20);
165
+ }
166
+ i((e) => {
167
+ c = e, l();
168
+ }), r("styledata", l), r("sourcedata", l), r("resize", l), r("dragstart", () => {
169
+ o.value = !1;
170
+ });
171
+ let d = v(() => a.value.join(" ")), f = v(() => t.position.endsWith("right"));
172
+ return (t, r) => d.value ? (F(), y(ae, {
173
+ key: 0,
174
+ position: e.position,
175
+ group: !1,
176
+ class: j(["m3-map-attrib", o.value ? "m3-map-attrib-open" : ""])
177
+ }, {
178
+ default: G(() => [S("div", {
179
+ class: j(["m3-map-attrib-row", f.value ? "flex-row-reverse" : ""]),
180
+ style: M(s.value ? { maxWidth: `${s.value}px` } : void 0)
181
+ }, [S("button", {
182
+ type: "button",
183
+ class: "m3-map-attrib-button",
184
+ title: U(n).mapToggleAttribution,
185
+ "aria-label": U(n).mapToggleAttribution,
186
+ "aria-expanded": o.value,
187
+ onClick: r[0] ||= (e) => o.value = !o.value
188
+ }, [T(h, {
189
+ name: "info",
190
+ size: 20
191
+ })], 8, Y), o.value ? (F(), x("div", {
192
+ key: 0,
193
+ class: j(["m3-map-attrib-text", f.value ? "pl-3.5" : "pr-3.5"]),
194
+ innerHTML: d.value
195
+ }, null, 10, X)) : b("", !0)], 6)]),
196
+ _: 1
197
+ }, 8, ["position", "class"])) : b("", !0);
198
+ }
199
+ }), se = {
46
200
  fill: ["fill-opacity"],
47
201
  line: ["line-opacity"],
48
202
  circle: ["circle-opacity", "circle-stroke-opacity"],
@@ -51,27 +205,27 @@ var te = {
51
205
  heatmap: ["heatmap-opacity"],
52
206
  "fill-extrusion": ["fill-extrusion-opacity"]
53
207
  };
54
- function K() {
55
- return N({
208
+ function ce() {
209
+ return L({
56
210
  visible: {},
57
211
  opacity: {}
58
212
  });
59
213
  }
60
- function ne(e, t, n) {
214
+ function le(e, t, n) {
61
215
  let r = {}, i = {};
62
216
  for (let e of n?.layers ?? []) {
63
217
  let n = t.getLayer(e.id);
64
218
  if (!n) continue;
65
219
  r[e.id] = t.getLayoutProperty(e.id, "visibility") !== "none";
66
- let a = te[n.type]?.[0], o = a ? t.getPaintProperty(e.id, a) : void 0;
220
+ let a = se[n.type]?.[0], o = a ? t.getPaintProperty(e.id, a) : void 0;
67
221
  i[e.id] = typeof o == "number" ? o : 1;
68
222
  }
69
223
  e.visible = r, e.opacity = i;
70
224
  }
71
- function q() {
72
- let e = C(ee, null);
225
+ function Z() {
226
+ let e = O(q, null);
73
227
  if (!e) throw Error("useMapLayers() must be called in a component inside <MMap>");
74
- let { map: t, model: n, layerState: r } = e, i = p(() => n.value?.layers ?? []), a = p(() => new Map(i.value.map((e) => [e.id, e])));
228
+ let { map: t, model: n, layerState: r } = e, i = v(() => n.value?.layers ?? []), a = v(() => new Map(i.value.map((e) => [e.id, e])));
75
229
  function o(e) {
76
230
  return r.visible[e] ?? !0;
77
231
  }
@@ -88,7 +242,7 @@ function q() {
88
242
  }
89
243
  function u(e, n) {
90
244
  let i = t.value, o = i?.getLayer(e);
91
- if (o) for (let t of te[o.type] ?? []) i.setPaintProperty(e, t, n);
245
+ if (o) for (let t of se[o.type] ?? []) i.setPaintProperty(e, t, n);
92
246
  r.opacity[e] = n;
93
247
  for (let t of a.value.get(e)?.children ?? []) u(t, n);
94
248
  }
@@ -99,15 +253,15 @@ function q() {
99
253
  let t = d(e).map((e) => o(e.id));
100
254
  return t.length && t.every(Boolean) ? "visible" : t.some(Boolean) ? "partial" : "hidden";
101
255
  }
102
- function m(e, t) {
256
+ function p(e, t) {
103
257
  for (let n of d(e)) s(n.id, t);
104
258
  }
105
- let h = p(() => i.value.filter((e) => e.base)), g = p(() => h.value.find((e) => o(e.id))?.id ?? null);
106
- function _(e) {
107
- for (let t of h.value) s(t.id, t.id === e);
259
+ let m = v(() => i.value.filter((e) => e.base)), h = v(() => m.value.find((e) => o(e.id))?.id ?? null);
260
+ function g(e) {
261
+ for (let t of m.value) s(t.id, t.id === e);
108
262
  }
109
263
  return {
110
- model: p(() => n.value),
264
+ model: v(() => n.value),
111
265
  layers: i,
112
266
  isVisible: o,
113
267
  setVisible: s,
@@ -116,15 +270,15 @@ function q() {
116
270
  setOpacity: u,
117
271
  layersOf: d,
118
272
  groupState: f,
119
- setGroupVisible: m,
120
- baseLayers: h,
121
- baseLayer: g,
122
- setBaseLayer: _
273
+ setGroupVisible: p,
274
+ baseLayers: m,
275
+ baseLayer: h,
276
+ setBaseLayer: g
123
277
  };
124
278
  }
125
279
  //#endregion
126
280
  //#region src/components/MMap.vue?vue&type=script&setup=true&lang.ts
127
- var re = 600, J = /* @__PURE__ */ x({
281
+ var ue = 600, de = /* @__PURE__ */ E({
128
282
  __name: "MMap",
129
283
  props: {
130
284
  mapStyle: {},
@@ -168,21 +322,21 @@ var re = 600, J = /* @__PURE__ */ x({
168
322
  "update:pitch"
169
323
  ],
170
324
  setup(e, { expose: t, emit: n }) {
171
- let r = e, i = n, a = P(), s = P(), c = L(), l = L(), u = P(0), d = L(), p = K(), m = P(null);
172
- M(ee, {
173
- map: c,
174
- maplibre: l,
175
- styleVersion: u,
325
+ let r = e, i = n, a = R(), o = R(), s = V(), c = V(), l = R(0), d = V(), f = ce(), p = R(null);
326
+ I(q, {
327
+ map: s,
328
+ maplibre: c,
329
+ styleVersion: l,
176
330
  model: d,
177
- layerState: p,
178
- activeTool: m
331
+ layerState: f,
332
+ activeTool: p
179
333
  });
180
- function v(e) {
181
- d.value = r.adapter ? r.adapter(e.getStyle(), { styleUrl: typeof r.mapStyle == "string" ? r.mapStyle : void 0 }) : void 0, ne(p, e, d.value);
334
+ function m(e) {
335
+ d.value = r.adapter ? r.adapter(e.getStyle(), { styleUrl: typeof r.mapStyle == "string" ? r.mapStyle : void 0 }) : void 0, le(f, e, d.value);
182
336
  }
183
- let y = o(), x = () => typeof r.persist == "string" ? r.persist : r.persist ? "m3-map-view" : null;
184
- function S() {
185
- let e = x();
337
+ let h = u(), g = () => typeof r.persist == "string" ? r.persist : r.persist ? "m3-map-view" : null;
338
+ function v() {
339
+ let e = g();
186
340
  if (!e) return {};
187
341
  try {
188
342
  let t = JSON.parse(localStorage.getItem(e) ?? "null");
@@ -200,7 +354,7 @@ var re = 600, J = /* @__PURE__ */ x({
200
354
  pitch: e.getPitch()
201
355
  };
202
356
  }
203
- let T = {
357
+ let w = {
204
358
  navigation: {
205
359
  corner: "top-right",
206
360
  create: (e) => new e.NavigationControl()
@@ -222,44 +376,40 @@ var re = 600, J = /* @__PURE__ */ x({
222
376
  maxWidth: 100,
223
377
  unit: "metric"
224
378
  })
225
- },
226
- attribution: {
227
- corner: "bottom-right",
228
- create: (e) => new e.AttributionControl({ compact: !0 })
229
379
  }
230
- }, N = /* @__PURE__ */ new Map();
231
- function F(e) {
232
- let t = c.value, n = l.value;
380
+ }, E = /* @__PURE__ */ new Map();
381
+ function D(e) {
382
+ let t = s.value, n = c.value;
233
383
  if (!t || !n) return;
234
- let i = N.get(e);
235
- i && (t.removeControl(i), N.delete(e));
384
+ let i = E.get(e);
385
+ i && (t.removeControl(i), E.delete(e));
236
386
  let a = r[e];
237
387
  if (!a) return;
238
- let o = T[e].create(n);
239
- t.addControl(o, a === !0 ? T[e].corner : a), N.set(e, o);
388
+ let o = w[e].create(n);
389
+ t.addControl(o, a === !0 ? w[e].corner : a), E.set(e, o);
240
390
  }
241
- for (let e of Object.keys(T)) H(() => r[e], () => F(e));
242
- function z() {
391
+ for (let e of Object.keys(w)) W(() => r[e], () => D(e));
392
+ function O() {
243
393
  return {
244
- "AttributionControl.ToggleAttribution": y.mapToggleAttribution,
245
- "AttributionControl.MapFeedback": y.mapFeedback,
246
- "FullscreenControl.Enter": y.mapEnterFullscreen,
247
- "FullscreenControl.Exit": y.mapExitFullscreen,
248
- "GeolocateControl.FindMyLocation": y.mapFindMyLocation,
249
- "GeolocateControl.LocationNotAvailable": y.mapLocationNotAvailable,
250
- "Map.Title": y.mapTitle,
251
- "Marker.Title": y.mapMarker,
252
- "NavigationControl.ResetBearing": y.mapResetBearing,
253
- "NavigationControl.ZoomIn": y.mapZoomIn,
254
- "NavigationControl.ZoomOut": y.mapZoomOut,
255
- "Popup.Close": y.close,
256
- "CooperativeGesturesHandler.WindowsHelpText": y.mapCtrlScroll,
257
- "CooperativeGesturesHandler.MacHelpText": y.mapCmdScroll,
258
- "CooperativeGesturesHandler.MobileHelpText": y.mapTwoFingers
394
+ "AttributionControl.ToggleAttribution": h.mapToggleAttribution,
395
+ "AttributionControl.MapFeedback": h.mapFeedback,
396
+ "FullscreenControl.Enter": h.mapEnterFullscreen,
397
+ "FullscreenControl.Exit": h.mapExitFullscreen,
398
+ "GeolocateControl.FindMyLocation": h.mapFindMyLocation,
399
+ "GeolocateControl.LocationNotAvailable": h.mapLocationNotAvailable,
400
+ "Map.Title": h.mapTitle,
401
+ "Marker.Title": h.mapMarker,
402
+ "NavigationControl.ResetBearing": h.mapResetBearing,
403
+ "NavigationControl.ZoomIn": h.mapZoomIn,
404
+ "NavigationControl.ZoomOut": h.mapZoomOut,
405
+ "Popup.Close": h.close,
406
+ "CooperativeGesturesHandler.WindowsHelpText": h.mapCtrlScroll,
407
+ "CooperativeGesturesHandler.MacHelpText": h.mapCmdScroll,
408
+ "CooperativeGesturesHandler.MobileHelpText": h.mapTwoFingers
259
409
  };
260
410
  }
261
- let B = P(null), V, W;
262
- function G(e) {
411
+ let A = R(null), L, z;
412
+ function U(e) {
263
413
  let t = e.getAttribute("title");
264
414
  t && e.closest(".maplibregl-ctrl") && (e.setAttribute("data-m3-tip", t), e.hasAttribute("aria-label") || e.setAttribute("aria-label", t), e.removeAttribute("title"));
265
415
  }
@@ -267,128 +417,142 @@ var re = 600, J = /* @__PURE__ */ x({
267
417
  let t = e.getAttribute("data-m3-tip"), n = a.value?.getBoundingClientRect();
268
418
  if (!t || !n) return;
269
419
  let r = e.getBoundingClientRect(), i = r.left + r.width / 2 > n.left + n.width / 2;
270
- B.value = {
420
+ A.value = {
271
421
  text: t,
272
422
  left: i,
273
423
  x: (i ? r.left - 8 : r.right + 8) - n.left,
274
424
  y: r.top + r.height / 2 - n.top
275
425
  };
276
426
  }
277
- function q() {
278
- clearTimeout(V), B.value = null;
427
+ function ne() {
428
+ clearTimeout(L), A.value = null;
279
429
  }
280
- let J = (e) => e.target?.closest?.(".maplibregl-ctrl [data-m3-tip]") ?? null;
281
- function ie(e) {
282
- let t = J(e);
283
- t && e.pointerType !== "touch" && (clearTimeout(V), V = setTimeout(() => te(t), re));
430
+ let K = (e) => e.target?.closest?.(".maplibregl-ctrl [data-m3-tip]") ?? null;
431
+ function J(e) {
432
+ let t = K(e);
433
+ t && e.pointerType !== "touch" && (clearTimeout(L), L = setTimeout(() => te(t), ue));
284
434
  }
285
- function ae(e) {
286
- let t = J(e);
287
- t && !t.contains(e.relatedTarget) && q();
435
+ function re(e) {
436
+ let t = K(e);
437
+ t && !t.contains(e.relatedTarget) && ne();
288
438
  }
289
- function oe(e) {
290
- let t = J(e);
439
+ function ie(e) {
440
+ let t = K(e);
291
441
  t?.matches(":focus-visible") && te(t);
292
442
  }
293
- k(() => {
443
+ P(() => {
294
444
  let e = a.value;
295
- e && (e.querySelectorAll("[title]").forEach(G), W = new MutationObserver((e) => {
296
- for (let t of e) t.type === "attributes" ? G(t.target) : t.addedNodes.forEach((e) => {
297
- e instanceof Element && (G(e), e.querySelectorAll("[title]").forEach(G));
445
+ e && (e.querySelectorAll("[title]").forEach(U), z = new MutationObserver((e) => {
446
+ for (let t of e) t.type === "attributes" ? U(t.target) : t.addedNodes.forEach((e) => {
447
+ e instanceof Element && (U(e), e.querySelectorAll("[title]").forEach(U));
298
448
  });
299
- }), W.observe(e, {
449
+ }), z.observe(e, {
300
450
  subtree: !0,
301
451
  childList: !0,
302
452
  attributes: !0,
303
453
  attributeFilter: ["title"]
304
454
  }));
305
- }), O(() => {
306
- W?.disconnect(), clearTimeout(V);
455
+ }), N(() => {
456
+ z?.disconnect(), clearTimeout(L);
307
457
  });
308
- let Y = !1;
309
- k(async () => {
458
+ let ae = !1;
459
+ P(async () => {
310
460
  let e = await import("maplibre-gl"), t = "Map" in e ? e : e.default;
311
- if (Y || !s.value) return;
312
- let n = S(), a = {
461
+ if (ae || !o.value) return;
462
+ let n = v(), a = {
313
463
  center: n.center ?? r.center,
314
464
  zoom: n.zoom ?? r.zoom,
315
465
  bearing: n.bearing ?? r.bearing,
316
466
  pitch: n.pitch ?? r.pitch
317
- }, o = w(new t.Map({
318
- container: s.value,
467
+ }, u = k(new t.Map({
468
+ container: o.value,
319
469
  style: r.mapStyle,
320
470
  attributionControl: !1,
321
- locale: z(),
471
+ locale: O(),
322
472
  ...Object.fromEntries(Object.entries(a).filter(([, e]) => e !== void 0)),
323
473
  ...r.options
324
474
  }));
325
- l.value = t, o.on("style.load", () => {
326
- v(o), u.value++;
327
- }), o.on("click", (e) => i("click", e)), o.on("moveend", () => {
328
- let e = C(o);
475
+ c.value = t, u.on("style.load", () => {
476
+ m(u), l.value++;
477
+ }), u.on("click", (e) => i("click", e)), u.on("moveend", () => {
478
+ let e = C(u);
329
479
  i("update:center", e.center), i("update:zoom", e.zoom), i("update:bearing", e.bearing), i("update:pitch", e.pitch);
330
- let t = x();
480
+ let t = g();
331
481
  if (t) try {
332
482
  localStorage.setItem(t, JSON.stringify(e));
333
483
  } catch {}
334
- }), o.once("load", () => {
335
- c.value = o;
336
- for (let e of Object.keys(T)) F(e);
337
- i("ready", o);
484
+ }), u.once("load", () => {
485
+ s.value = u;
486
+ for (let e of Object.keys(w)) D(e);
487
+ i("ready", u);
338
488
  });
339
- }), A(() => {
340
- Y = !0, c.value?.remove(), c.value = void 0;
489
+ }), ee(() => {
490
+ ae = !0, s.value?.remove(), s.value = void 0;
341
491
  });
342
- let X = (e, t) => Math.abs(e - t) < 1e-9;
343
- return H(() => r.center?.join(","), () => {
344
- let e = c.value;
492
+ let Y = (e, t) => Math.abs(e - t) < 1e-9;
493
+ return W(() => r.center?.join(","), () => {
494
+ let e = s.value;
345
495
  if (!e || !r.center) return;
346
496
  let t = e.getCenter();
347
- (!X(t.lng, r.center[0]) || !X(t.lat, r.center[1])) && e.jumpTo({ center: r.center });
348
- }), H(() => r.zoom, (e) => {
349
- c.value && e !== void 0 && !X(c.value.getZoom(), e) && c.value.jumpTo({ zoom: e });
350
- }), H(() => r.bearing, (e) => {
351
- c.value && e !== void 0 && !X(c.value.getBearing(), e) && c.value.jumpTo({ bearing: e });
352
- }), H(() => r.pitch, (e) => {
353
- c.value && e !== void 0 && !X(c.value.getPitch(), e) && c.value.jumpTo({ pitch: e });
354
- }), H(() => r.adapter, () => {
355
- c.value && v(c.value);
356
- }), H(() => r.mapStyle, (e) => c.value?.setStyle(e, { diff: !1 })), t({ map: c }), (e, t) => (j(), g("div", {
497
+ (!Y(t.lng, r.center[0]) || !Y(t.lat, r.center[1])) && e.jumpTo({ center: r.center });
498
+ }), W(() => r.zoom, (e) => {
499
+ s.value && e !== void 0 && !Y(s.value.getZoom(), e) && s.value.jumpTo({ zoom: e });
500
+ }), W(() => r.bearing, (e) => {
501
+ s.value && e !== void 0 && !Y(s.value.getBearing(), e) && s.value.jumpTo({ bearing: e });
502
+ }), W(() => r.pitch, (e) => {
503
+ s.value && e !== void 0 && !Y(s.value.getPitch(), e) && s.value.jumpTo({ pitch: e });
504
+ }), W(() => r.adapter, () => {
505
+ s.value && m(s.value);
506
+ }), W(() => r.mapStyle, (e) => s.value?.setStyle(e, { diff: !1 })), t({ map: s }), (t, n) => (F(), x("div", {
357
507
  ref_key: "root",
358
508
  ref: a,
359
509
  class: "m3-map relative overflow-hidden",
360
- onPointerover: ie,
361
- onPointerout: ae,
362
- onPointerdown: q,
363
- onFocusin: oe,
364
- onFocusout: q
510
+ onPointerover: J,
511
+ onPointerout: re,
512
+ onPointerdown: ne,
513
+ onFocusin: ie,
514
+ onFocusout: ne
365
515
  }, [
366
- _("div", {
516
+ S("div", {
367
517
  ref_key: "container",
368
- ref: s,
518
+ ref: o,
369
519
  class: "h-full w-full"
370
520
  }, null, 512),
371
- c.value ? I(e.$slots, "default", {}, void 0, void 0, 0) : h("", !0),
372
- b(f, {
521
+ s.value && e.attribution ? (F(), y(oe, {
522
+ key: 0,
523
+ position: e.attribution === !0 ? "bottom-right" : e.attribution
524
+ }, null, 8, ["position"])) : b("", !0),
525
+ s.value ? B(t.$slots, "default", {}, void 0, void 0, 1) : b("", !0),
526
+ T(_, {
373
527
  "enter-active-class": "transition-opacity duration-150",
374
528
  "enter-from-class": "opacity-0",
375
529
  "leave-active-class": "transition-opacity duration-100",
376
530
  "leave-to-class": "opacity-0"
377
531
  }, {
378
- default: U(() => [B.value ? (j(), g("div", {
532
+ default: G(() => [A.value ? (F(), x("div", {
379
533
  key: 0,
380
534
  role: "tooltip",
381
- class: E(["pointer-events-none absolute z-10 min-h-6 max-w-[200px] -translate-y-1/2 rounded bg-inverse-surface px-2 py-1 text-body-small whitespace-nowrap text-inverse-on-surface", B.value.left ? "-translate-x-full" : ""]),
382
- style: D({
383
- left: `${B.value.x}px`,
384
- top: `${B.value.y}px`
535
+ class: j(["pointer-events-none absolute z-10 min-h-6 max-w-[200px] -translate-y-1/2 rounded bg-inverse-surface px-2 py-1 text-body-small whitespace-nowrap text-inverse-on-surface", A.value.left ? "-translate-x-full" : ""]),
536
+ style: M({
537
+ left: `${A.value.x}px`,
538
+ top: `${A.value.y}px`
385
539
  })
386
- }, R(B.value.text), 7)) : h("", !0)]),
540
+ }, H(A.value.text), 7)) : b("", !0)]),
387
541
  _: 1
388
542
  })
389
543
  ], 544));
390
544
  }
391
- }), ie = { class: "hidden" }, ae = /* @__PURE__ */ x({
545
+ }), fe = 13.5, pe = fe / Math.SQRT2, me = [0, -14], he = {
546
+ center: [0, 0],
547
+ top: [0, 0],
548
+ "top-left": [0, 0],
549
+ "top-right": [0, 0],
550
+ bottom: [0, -38.1],
551
+ "bottom-left": [pe, (24.6 + pe) * -1],
552
+ "bottom-right": [-pe, (24.6 + pe) * -1],
553
+ left: [fe, -24.6],
554
+ right: [-13.5, -24.6]
555
+ }, ge = { class: "hidden" }, _e = /* @__PURE__ */ E({
392
556
  inheritAttrs: !1,
393
557
  __name: "MMapMarker",
394
558
  props: {
@@ -404,40 +568,39 @@ var re = 600, J = /* @__PURE__ */ x({
404
568
  },
405
569
  emits: ["update:lngLat", "click"],
406
570
  setup(e, { expose: t, emit: n }) {
407
- let r = e, i = n, a = V(), o = P(), s = P(), { onReady: c } = G(), l;
571
+ let r = e, i = n, a = ne(), o = R(), s = R(), { onReady: c } = J(), l, u = !1;
408
572
  c((e, t) => {
409
- let n = !!a.default && o.value;
410
- l = new t.Marker({
411
- ...n ? { element: o.value } : { color: r.color ?? "currentColor" },
573
+ u = !!a.default && !!o.value, l = new t.Marker({
574
+ ...u ? { element: o.value } : { color: r.color ?? "currentColor" },
412
575
  draggable: r.draggable,
413
- anchor: r.anchor ?? (n ? "center" : "bottom"),
414
- offset: r.offset,
576
+ ...r.anchor ? { anchor: r.anchor } : u ? { anchor: "center" } : {},
577
+ ...r.offset ? { offset: r.offset } : {},
415
578
  rotation: r.rotation
416
- }), !n && !r.color && l.getElement().classList.add("m3-map-marker--default"), l.setLngLat(r.lngLat).addTo(e), l.getElement().addEventListener("click", u), l.on("dragend", () => {
579
+ }), !u && !r.color && l.getElement().classList.add("m3-map-marker--default"), l.setLngLat(r.lngLat).addTo(e), l.getElement().addEventListener("click", d), l.on("dragend", () => {
417
580
  let { lng: e, lat: t } = l.getLngLat();
418
581
  i("update:lngLat", [e, t]);
419
582
  }), a.popup && s.value && l.setPopup(new t.Popup({
420
- offset: n ? 16 : 32,
583
+ ...u ? { offset: 16 } : {},
421
584
  maxWidth: "320px"
422
585
  }).setDOMContent(s.value));
423
586
  });
424
- function u(e) {
587
+ function d(e) {
425
588
  i("click", e);
426
589
  }
427
- return H(() => r.lngLat.join(","), () => l?.setLngLat(r.lngLat)), H(() => r.draggable, (e) => l?.setDraggable(e)), H(() => r.rotation, (e) => l?.setRotation(e)), H(() => r.offset?.join(","), () => l?.setOffset(r.offset ?? [0, 0])), O(() => {
428
- l?.getElement().removeEventListener("click", u), l?.getPopup()?.remove(), l?.remove();
429
- }), t({ marker: () => l }), (e, t) => (j(), g("div", ie, [e.$slots.default ? (j(), g("div", T({
590
+ return W(() => r.lngLat.join(","), () => l?.setLngLat(r.lngLat)), W(() => r.draggable, (e) => l?.setDraggable(e)), W(() => r.rotation, (e) => l?.setRotation(e)), W(() => r.offset?.join(","), () => l?.setOffset(r.offset ?? (u ? [0, 0] : me))), N(() => {
591
+ l?.getElement().removeEventListener("click", d), l?.getPopup()?.remove(), l?.remove();
592
+ }), t({ marker: () => l }), (e, t) => (F(), x("div", ge, [e.$slots.default ? (F(), x("div", A({
430
593
  key: 0,
431
594
  ref_key: "content",
432
595
  ref: o,
433
596
  class: "m3-map-marker"
434
- }, e.$attrs), [I(e.$slots, "default")], 16)) : h("", !0), e.$slots.popup ? (j(), g("div", {
597
+ }, e.$attrs), [B(e.$slots, "default")], 16)) : b("", !0), e.$slots.popup ? (F(), x("div", {
435
598
  key: 1,
436
599
  ref_key: "popupContent",
437
600
  ref: s
438
- }, [I(e.$slots, "popup")], 512)) : h("", !0)]));
601
+ }, [B(e.$slots, "popup")], 512)) : b("", !0)]));
439
602
  }
440
- }), oe = { class: "hidden" }, Y = /* @__PURE__ */ x({
603
+ }), ve = { class: "hidden" }, ye = /* @__PURE__ */ E({
441
604
  inheritAttrs: !1,
442
605
  __name: "MMapPopup",
443
606
  props: {
@@ -455,12 +618,12 @@ var re = 600, J = /* @__PURE__ */ x({
455
618
  default: !0
456
619
  },
457
620
  anchor: {},
458
- offset: { default: 8 },
621
+ offset: {},
459
622
  maxWidth: { default: "320px" }
460
623
  },
461
624
  emits: ["update:open"],
462
625
  setup(e, { expose: t, emit: n }) {
463
- let r = e, i = n, a = P(), { onReady: o } = G(), s, c, l = !1;
626
+ let r = e, i = n, a = R(), { onReady: o } = J(), s, c, l = !1;
464
627
  function u() {
465
628
  s && c && !s.isOpen() && s.setLngLat(r.lngLat).addTo(c);
466
629
  }
@@ -470,37 +633,37 @@ var re = 600, J = /* @__PURE__ */ x({
470
633
  closeOnClick: r.closeOnClick,
471
634
  closeOnMove: !1,
472
635
  anchor: r.anchor,
473
- offset: r.offset,
636
+ ...r.offset === void 0 ? {} : { offset: r.offset },
474
637
  maxWidth: r.maxWidth,
475
638
  focusAfterOpen: !1
476
639
  }), a.value && s.setDOMContent(a.value), s.on("close", () => {
477
640
  l || i("update:open", !1);
478
641
  }), r.open && u();
479
- }), H(() => r.open, (e) => {
642
+ }), W(() => r.open, (e) => {
480
643
  e ? u() : s?.isOpen() && (l = !0, s.remove(), l = !1);
481
- }), H(() => r.lngLat.join(","), () => s?.setLngLat(r.lngLat)), H(() => r.maxWidth, (e) => s?.setMaxWidth(e)), O(() => {
644
+ }), W(() => r.lngLat.join(","), () => s?.setLngLat(r.lngLat)), W(() => r.maxWidth, (e) => s?.setMaxWidth(e)), W(() => r.offset, (e) => s?.setOffset(e ?? 0)), N(() => {
482
645
  l = !0, s?.remove();
483
- }), t({ popup: () => s }), (e, t) => (j(), g("div", oe, [_("div", T({
646
+ }), t({ popup: () => s }), (e, t) => (F(), x("div", ve, [S("div", A({
484
647
  ref_key: "content",
485
648
  ref: a
486
- }, e.$attrs), [I(e.$slots, "default")], 16)]));
649
+ }, e.$attrs), [B(e.$slots, "default")], 16)]));
487
650
  }
488
651
  });
489
652
  //#endregion
490
653
  //#region src/composables/_useThemeTokens.ts
491
- function X(e) {
654
+ function be(e) {
492
655
  let t = () => {
493
656
  let t = getComputedStyle(document.documentElement);
494
657
  return Object.fromEntries(e.map((e) => [e, t.getPropertyValue(`--color-${e}`).trim()]));
495
- }, r = P(typeof document > "u" ? Object.fromEntries(e.map((e) => [e, ""])) : t()), i, a;
496
- return k(() => {
497
- let o = () => {
498
- let n = t();
499
- e.some((e) => n[e] !== r.value[e]) && (r.value = n);
500
- }, s = (e) => (e instanceof Element ? e : e?.parentElement)?.id === n;
501
- i = new MutationObserver((e) => {
502
- e.some((e) => e.target === document.documentElement || s(e.target) || Array.from(e.addedNodes).some(s)) && (o(), clearTimeout(a), a = setTimeout(o, 300));
503
- }), i.observe(document.documentElement, {
658
+ }, n = R(typeof document > "u" ? Object.fromEntries(e.map((e) => [e, ""])) : t()), r, i;
659
+ return P(() => {
660
+ let a = () => {
661
+ let r = t();
662
+ e.some((e) => r[e] !== n.value[e]) && (n.value = r);
663
+ }, s = (e) => (e instanceof Element ? e : e?.parentElement)?.id === o;
664
+ r = new MutationObserver((e) => {
665
+ e.some((e) => e.target === document.documentElement || s(e.target) || Array.from(e.addedNodes).some(s)) && (a(), clearTimeout(i), i = setTimeout(a, 300));
666
+ }), r.observe(document.documentElement, {
504
667
  attributes: !0,
505
668
  attributeFilter: [
506
669
  "class",
@@ -508,18 +671,18 @@ function X(e) {
508
671
  "data-palette",
509
672
  "data-contrast"
510
673
  ]
511
- }), i.observe(document.head, {
674
+ }), r.observe(document.head, {
512
675
  childList: !0,
513
676
  characterData: !0,
514
677
  subtree: !0
515
678
  });
516
- }), O(() => {
517
- i?.disconnect(), clearTimeout(a);
518
- }), r;
679
+ }), N(() => {
680
+ r?.disconnect(), clearTimeout(i);
681
+ }), n;
519
682
  }
520
683
  //#endregion
521
684
  //#region src/components/MMapGeoJson.vue
522
- var se = /* @__PURE__ */ x({
685
+ var xe = /* @__PURE__ */ E({
523
686
  inheritAttrs: !1,
524
687
  __name: "MMapGeoJson",
525
688
  props: {
@@ -535,13 +698,13 @@ var se = /* @__PURE__ */ x({
535
698
  },
536
699
  emits: ["click"],
537
700
  setup(e, { expose: t, emit: n }) {
538
- let r = e, i = n, a = r.id ?? `m3-geojson-${B()}`, { onReady: o, styleVersion: s } = G(), c = X(["primary", "surface"]), l = (...e) => [
701
+ let r = e, i = n, a = r.id ?? `m3-geojson-${te()}`, { onReady: o, styleVersion: s } = J(), c = be(["primary", "surface"]), l = (...e) => [
539
702
  "match",
540
703
  ["geometry-type"],
541
704
  e,
542
705
  !0,
543
706
  !1
544
- ], u = p(() => {
707
+ ], u = v(() => {
545
708
  let { primary: e, surface: t } = c.value;
546
709
  return [
547
710
  {
@@ -574,25 +737,25 @@ var se = /* @__PURE__ */ x({
574
737
  }
575
738
  }
576
739
  ];
577
- }), d = p(() => (r.layers ?? u.value).map((e, t) => ({
740
+ }), d = v(() => (r.layers ?? u.value).map((e, t) => ({
578
741
  ...e,
579
742
  id: e.id ?? `${a}-${t}`,
580
743
  source: a
581
- }))), f, m = [], h = (e) => i("click", e), g = () => {
744
+ }))), f, p = [], m = (e) => i("click", e), h = () => {
582
745
  r.interactive && f && (f.getCanvas().style.cursor = "pointer");
583
- }, _ = () => {
746
+ }, g = () => {
584
747
  r.interactive && f && (f.getCanvas().style.cursor = "");
585
748
  };
586
- function v() {
749
+ function _() {
587
750
  if (f) {
588
- for (let e of m) f.off("click", e, h), f.off("mouseenter", e, g), f.off("mouseleave", e, _), f.getLayer(e) && f.removeLayer(e);
589
- m = [];
751
+ for (let e of p) f.off("click", e, m), f.off("mouseenter", e, h), f.off("mouseleave", e, g), f.getLayer(e) && f.removeLayer(e);
752
+ p = [];
590
753
  }
591
754
  }
592
755
  function y() {
593
756
  if (f) {
594
- v();
595
- for (let e of d.value) f.addLayer(e, r.before && f.getLayer(r.before) ? r.before : void 0), f.on("click", e.id, h), f.on("mouseenter", e.id, g), f.on("mouseleave", e.id, _), m.push(e.id);
757
+ _();
758
+ for (let e of d.value) f.addLayer(e, r.before && f.getLayer(r.before) ? r.before : void 0), f.on("click", e.id, m), f.on("mouseenter", e.id, h), f.on("mouseleave", e.id, g), p.push(e.id);
596
759
  }
597
760
  }
598
761
  function b() {
@@ -600,57 +763,30 @@ var se = /* @__PURE__ */ x({
600
763
  type: "geojson",
601
764
  data: r.data,
602
765
  ...r.sourceOptions
603
- }), m = []), (!m.length || !f.getLayer(m[0])) && y());
766
+ }), p = []), (!p.length || !f.getLayer(p[0])) && y());
604
767
  }
605
768
  return o((e) => {
606
769
  f = e, b();
607
- }), H(s, () => b()), H(() => r.data, (e) => (f?.getSource(a))?.setData(e)), H(() => JSON.stringify(d.value), () => y()), H(() => r.before, () => y()), O(() => {
608
- f &&= (v(), f.getSource(a) && f.removeSource(a), void 0);
770
+ }), W(s, () => b()), W(() => r.data, (e) => (f?.getSource(a))?.setData(e)), W(() => JSON.stringify(d.value), () => y()), W(() => r.before, () => y()), N(() => {
771
+ f &&= (_(), f.getSource(a) && f.removeSource(a), void 0);
609
772
  }), t({
610
773
  sourceId: a,
611
- layerIds: () => [...m]
774
+ layerIds: () => [...p]
612
775
  }), (e, t) => null;
613
776
  }
614
- }), ce = { class: "hidden" }, le = /* @__PURE__ */ x({
615
- inheritAttrs: !1,
616
- __name: "MMapControl",
617
- props: {
618
- position: { default: "top-right" },
619
- group: {
620
- type: Boolean,
621
- default: !0
622
- }
623
- },
624
- setup(e) {
625
- let t = e, n = P(), { onReady: r } = G(), i, a = {
626
- onAdd: () => n.value,
627
- onRemove: () => n.value?.remove()
628
- };
629
- return r((e) => {
630
- i = e, n.value && e.addControl(a, t.position);
631
- }), H(() => t.position, (e) => {
632
- i && n.value && (i.removeControl(a), i.addControl(a, e));
633
- }), O(() => {
634
- i?.hasControl(a) && i.removeControl(a);
635
- }), (t, r) => (j(), g("div", ce, [_("div", T({
636
- ref_key: "el",
637
- ref: n,
638
- class: ["maplibregl-ctrl", e.group ? "maplibregl-ctrl-group" : ""]
639
- }, t.$attrs), [I(t.$slots, "default")], 16)]));
640
- }
641
- }), ue = { class: "flex min-w-0 flex-1 flex-col" }, de = ["aria-label", "aria-pressed"], fe = { class: "flex min-w-0 flex-1 flex-col" }, pe = {
777
+ }), Q = { class: "flex min-w-0 flex-1 flex-col" }, Se = ["aria-label", "aria-pressed"], Ce = { class: "flex min-w-0 flex-1 flex-col" }, we = {
642
778
  key: 0,
643
779
  class: "truncate text-label-small text-on-surface-variant"
644
- }, me = {
780
+ }, Te = {
645
781
  key: 0,
646
782
  class: "rounded-full bg-primary/8 px-2 py-0.5 text-label-small tabular-nums text-primary"
647
- }, he = { class: "min-h-0 overflow-hidden" }, ge = { class: "flex flex-col gap-3 px-3 pb-3" }, _e = {
783
+ }, Ee = { class: "min-h-0 overflow-hidden" }, De = { class: "flex flex-col gap-3 px-3 pb-3" }, Oe = {
648
784
  key: 0,
649
785
  class: "text-body-small text-on-surface-variant"
650
- }, ve = { class: "flex items-center gap-2 rounded-2xl bg-surface-container-highest/60 px-3 py-1" }, ye = ["src"], be = {
786
+ }, ke = { class: "flex items-center gap-2 rounded-2xl bg-surface-container-highest/60 px-3 py-1" }, Ae = ["src"], je = {
651
787
  key: 2,
652
788
  class: "flex flex-wrap items-center gap-2"
653
- }, xe = ["href"], Z = /* @__PURE__ */ x({
789
+ }, Me = ["href"], Ne = /* @__PURE__ */ E({
654
790
  __name: "_MMapLayerItem",
655
791
  props: {
656
792
  layer: {},
@@ -658,80 +794,80 @@ var se = /* @__PURE__ */ x({
658
794
  },
659
795
  emits: ["toggle-expanded"],
660
796
  setup(e, { emit: t }) {
661
- let n = t, r = o(), { isVisible: i, toggle: s, opacityOf: c, setOpacity: l } = q();
662
- return (t, o) => (j(), g("div", { class: E(["flex overflow-hidden rounded-2xl bg-surface-container", z(i)(e.layer.id) ? "" : "opacity-75"]) }, [_("div", { class: E(["w-1 shrink-0 transition-colors duration-200", z(i)(e.layer.id) ? "bg-primary" : "bg-outline-variant"]) }, null, 2), _("div", ue, [_("div", {
797
+ let n = t, r = u(), { isVisible: i, toggle: a, opacityOf: o, setOpacity: s } = Z();
798
+ return (t, l) => (F(), x("div", { class: j(["flex overflow-hidden rounded-2xl bg-surface-container", U(i)(e.layer.id) ? "" : "opacity-75"]) }, [S("div", { class: j(["w-1 shrink-0 transition-colors duration-200", U(i)(e.layer.id) ? "bg-primary" : "bg-outline-variant"]) }, null, 2), S("div", Q, [S("div", {
663
799
  class: "flex cursor-pointer items-center gap-2 px-3 py-2",
664
- onClick: o[1] ||= (e) => n("toggle-expanded")
800
+ onClick: l[1] ||= (e) => n("toggle-expanded")
665
801
  }, [
666
- _("button", {
802
+ S("button", {
667
803
  type: "button",
668
- class: E(["grid size-8 shrink-0 cursor-pointer place-items-center rounded-full transition-colors duration-200", z(i)(e.layer.id) ? "bg-primary/12 text-primary" : "bg-on-surface/5 text-on-surface-variant"]),
669
- "aria-label": z(i)(e.layer.id) ? z(r).mapHideLayer : z(r).mapShowLayer,
670
- "aria-pressed": z(i)(e.layer.id),
671
- onClick: o[0] ||= W((t) => z(s)(e.layer.id), ["stop"])
672
- }, [b(u, {
673
- name: z(i)(e.layer.id) ? "visibility" : "visibility_off",
804
+ class: j(["grid size-8 shrink-0 cursor-pointer place-items-center rounded-full transition-colors duration-200", U(i)(e.layer.id) ? "bg-primary/12 text-primary" : "bg-on-surface/5 text-on-surface-variant"]),
805
+ "aria-label": U(i)(e.layer.id) ? U(r).mapHideLayer : U(r).mapShowLayer,
806
+ "aria-pressed": U(i)(e.layer.id),
807
+ onClick: l[0] ||= K((t) => U(a)(e.layer.id), ["stop"])
808
+ }, [T(h, {
809
+ name: U(i)(e.layer.id) ? "visibility" : "visibility_off",
674
810
  size: 18
675
- }, null, 8, ["name"])], 10, de),
676
- _("div", fe, [_("span", { class: E(["truncate text-body-medium", z(i)(e.layer.id) ? "text-on-surface" : "text-on-surface-variant"]) }, R(e.layer.title), 3), e.layer.description && !e.expanded ? (j(), g("span", pe, R(e.layer.description), 1)) : h("", !0)]),
677
- z(i)(e.layer.id) && z(c)(e.layer.id) < 1 ? (j(), g("span", me, R(Math.round(z(c)(e.layer.id) * 100)) + "% ", 1)) : h("", !0),
678
- b(u, {
811
+ }, null, 8, ["name"])], 10, Se),
812
+ S("div", Ce, [S("span", { class: j(["truncate text-body-medium", U(i)(e.layer.id) ? "text-on-surface" : "text-on-surface-variant"]) }, H(e.layer.title), 3), e.layer.description && !e.expanded ? (F(), x("span", we, H(e.layer.description), 1)) : b("", !0)]),
813
+ U(i)(e.layer.id) && U(o)(e.layer.id) < 1 ? (F(), x("span", Te, H(Math.round(U(o)(e.layer.id) * 100)) + "% ", 1)) : b("", !0),
814
+ T(h, {
679
815
  name: "expand_more",
680
816
  size: 18,
681
- class: E(["shrink-0 text-on-surface-variant transition-transform duration-300", e.expanded ? "rotate-180" : ""])
817
+ class: j(["shrink-0 text-on-surface-variant transition-transform duration-300", e.expanded ? "rotate-180" : ""])
682
818
  }, null, 8, ["class"])
683
- ]), _("div", {
819
+ ]), S("div", {
684
820
  class: "grid transition-[grid-template-rows] duration-300 ease-[cubic-bezier(0.2,0,0,1)]",
685
- style: D({ gridTemplateRows: e.expanded ? "1fr" : "0fr" })
686
- }, [_("div", he, [_("div", ge, [
687
- e.layer.description ? (j(), g("p", _e, R(e.layer.description), 1)) : h("", !0),
688
- _("div", ve, [b(u, {
821
+ style: M({ gridTemplateRows: e.expanded ? "1fr" : "0fr" })
822
+ }, [S("div", Ee, [S("div", De, [
823
+ e.layer.description ? (F(), x("p", Oe, H(e.layer.description), 1)) : b("", !0),
824
+ S("div", ke, [T(h, {
689
825
  name: "opacity",
690
826
  size: 16,
691
827
  class: "shrink-0 text-on-surface-variant"
692
- }), b(a, {
693
- "model-value": z(c)(e.layer.id),
828
+ }), T(c, {
829
+ "model-value": U(o)(e.layer.id),
694
830
  min: 0,
695
831
  max: 1,
696
832
  step: .01,
697
- label: z(r).mapOpacity,
833
+ label: U(r).mapOpacity,
698
834
  class: "flex-1",
699
- "onUpdate:modelValue": o[2] ||= (t) => z(l)(e.layer.id, Number(t))
835
+ "onUpdate:modelValue": l[2] ||= (t) => U(s)(e.layer.id, Number(t))
700
836
  }, null, 8, ["model-value", "label"])]),
701
- e.layer.legend ? (j(), g("img", {
837
+ e.layer.legend ? (F(), x("img", {
702
838
  key: 1,
703
839
  src: e.layer.legend,
704
840
  alt: "",
705
841
  class: "max-w-full self-start",
706
842
  loading: "lazy"
707
- }, null, 8, ye)) : h("", !0),
708
- e.layer.download || t.$slots.actions ? (j(), g("div", be, [e.layer.download ? (j(), g("a", {
843
+ }, null, 8, Ae)) : b("", !0),
844
+ e.layer.download || t.$slots.actions ? (F(), x("div", je, [e.layer.download ? (F(), x("a", {
709
845
  key: 0,
710
846
  href: e.layer.download,
711
847
  target: "_blank",
712
848
  rel: "noopener",
713
849
  download: "",
714
850
  class: "inline-flex items-center gap-1 rounded-full px-3 py-1.5 text-label-large text-primary hover:bg-primary/8"
715
- }, [b(u, {
851
+ }, [T(h, {
716
852
  name: "download",
717
853
  size: 18
718
- }), y(" " + R(z(r).mapDownload), 1)], 8, xe)) : h("", !0), I(t.$slots, "actions", {
854
+ }), w(" " + H(U(r).mapDownload), 1)], 8, Me)) : b("", !0), B(t.$slots, "actions", {
719
855
  layer: e.layer,
720
- visible: z(i)(e.layer.id)
721
- })])) : h("", !0)
856
+ visible: U(i)(e.layer.id)
857
+ })])) : b("", !0)
722
858
  ])])], 4)])], 2));
723
859
  }
724
- }), Q = { class: "flex flex-col gap-3" }, Se = ["onClick"], Ce = [
860
+ }), Pe = { class: "flex flex-col gap-3" }, Fe = ["onClick"], Ie = [
725
861
  "aria-label",
726
862
  "aria-pressed",
727
863
  "onClick"
728
- ], we = { class: "flex-1 select-none truncate text-label-large text-on-surface" }, Te = { class: "rounded-full bg-surface-container-highest px-2 py-0.5 text-label-small tabular-nums text-on-surface-variant" }, Ee = {
864
+ ], Le = { class: "flex-1 select-none truncate text-label-large text-on-surface" }, Re = { class: "rounded-full bg-surface-container-highest px-2 py-0.5 text-label-small tabular-nums text-on-surface-variant" }, ze = {
729
865
  key: 1,
730
866
  class: "flex flex-col gap-1.5"
731
- }, De = {
867
+ }, Be = {
732
868
  key: 2,
733
869
  class: "flex flex-col items-center gap-3 py-8"
734
- }, Oe = { class: "grid size-14 place-items-center rounded-full bg-surface-container-highest" }, ke = { class: "text-body-medium text-on-surface-variant" }, Ae = /* @__PURE__ */ x({
870
+ }, Ve = { class: "grid size-14 place-items-center rounded-full bg-surface-container-highest" }, He = { class: "text-body-medium text-on-surface-variant" }, Ue = /* @__PURE__ */ E({
735
871
  __name: "MMapLayers",
736
872
  props: {
737
873
  search: {
@@ -744,103 +880,103 @@ var se = /* @__PURE__ */ x({
744
880
  }
745
881
  },
746
882
  setup(e) {
747
- let t = e, n = o(), { model: r, layersOf: i, isVisible: a, groupState: s, setGroupVisible: c } = q(), f = P(""), y = (e) => !f.value || e.title.toLowerCase().includes(f.value.toLowerCase()), x = p(() => (r.value?.groups ?? []).map((e) => ({
883
+ let t = e, n = u(), { model: r, layersOf: i, isVisible: a, groupState: o, setGroupVisible: s } = Z(), c = R(""), l = (e) => !c.value || e.title.toLowerCase().includes(c.value.toLowerCase()), d = v(() => (r.value?.groups ?? []).map((e) => ({
748
884
  ...e,
749
885
  all: i(e.name),
750
- layers: i(e.name).filter(y)
751
- })).filter((e) => e.layers.length)), S = p(() => i(null).filter(y)), C = P(/* @__PURE__ */ new Set()), w = (e) => C.value.has(e) === t.collapsed;
752
- function O(e) {
753
- let t = new Set(C.value);
754
- t.delete(e) || t.add(e), C.value = t;
886
+ layers: i(e.name).filter(l)
887
+ })).filter((e) => e.layers.length)), f = v(() => i(null).filter(l)), p = R(/* @__PURE__ */ new Set()), _ = (e) => p.value.has(e) === t.collapsed;
888
+ function w(e) {
889
+ let t = new Set(p.value);
890
+ t.delete(e) || t.add(e), p.value = t;
755
891
  }
756
- let k = P(/* @__PURE__ */ new Set());
757
- function A(e) {
758
- let t = new Set(k.value);
759
- t.delete(e) || t.add(e), k.value = t;
892
+ let E = R(/* @__PURE__ */ new Set());
893
+ function D(e) {
894
+ let t = new Set(E.value);
895
+ t.delete(e) || t.add(e), E.value = t;
760
896
  }
761
- let M = (e) => e.filter((e) => a(e.id)).length;
762
- return (t, r) => (j(), g("div", Q, [
763
- e.search ? (j(), m(l, {
897
+ let O = (e) => e.filter((e) => a(e.id)).length;
898
+ return (t, r) => (F(), x("div", Pe, [
899
+ e.search ? (F(), y(m, {
764
900
  key: 0,
765
- modelValue: f.value,
766
- "onUpdate:modelValue": r[0] ||= (e) => f.value = e,
767
- label: z(n).mapSearchLayers,
901
+ modelValue: c.value,
902
+ "onUpdate:modelValue": r[0] ||= (e) => c.value = e,
903
+ label: U(n).mapSearchLayers,
768
904
  "leading-icon": "search",
769
905
  variant: "outlined",
770
906
  clearable: ""
771
- }, null, 8, ["modelValue", "label"])) : h("", !0),
772
- (j(!0), g(d, null, F(x.value, (e) => (j(), g("section", {
907
+ }, null, 8, ["modelValue", "label"])) : b("", !0),
908
+ (F(!0), x(g, null, z(d.value, (e) => (F(), x("section", {
773
909
  key: e.name,
774
910
  class: "flex flex-col"
775
- }, [_("div", {
911
+ }, [S("div", {
776
912
  class: "m3-map-layers-row flex cursor-pointer items-center gap-2 rounded-xl px-2 py-1.5",
777
- onClick: (t) => O(e.name)
913
+ onClick: (t) => w(e.name)
778
914
  }, [
779
- _("button", {
915
+ S("button", {
780
916
  type: "button",
781
- class: E(["grid size-8 shrink-0 cursor-pointer place-items-center rounded-full transition-colors duration-200", z(s)(e.name) === "visible" ? "bg-primary-container text-on-primary-container" : z(s)(e.name) === "partial" ? "bg-secondary-container text-on-secondary-container" : "bg-on-surface/8 text-on-surface-variant"]),
782
- "aria-label": z(s)(e.name) === "hidden" ? z(n).mapShowLayer : z(n).mapHideLayer,
783
- "aria-pressed": z(s)(e.name) !== "hidden",
784
- onClick: W((t) => z(c)(e.name, z(s)(e.name) !== "visible"), ["stop"])
785
- }, [b(u, {
786
- name: z(s)(e.name) === "hidden" ? "visibility_off" : "visibility",
917
+ class: j(["grid size-8 shrink-0 cursor-pointer place-items-center rounded-full transition-colors duration-200", U(o)(e.name) === "visible" ? "bg-primary-container text-on-primary-container" : U(o)(e.name) === "partial" ? "bg-secondary-container text-on-secondary-container" : "bg-on-surface/8 text-on-surface-variant"]),
918
+ "aria-label": U(o)(e.name) === "hidden" ? U(n).mapShowLayer : U(n).mapHideLayer,
919
+ "aria-pressed": U(o)(e.name) !== "hidden",
920
+ onClick: K((t) => U(s)(e.name, U(o)(e.name) !== "visible"), ["stop"])
921
+ }, [T(h, {
922
+ name: U(o)(e.name) === "hidden" ? "visibility_off" : "visibility",
787
923
  size: 18
788
- }, null, 8, ["name"])], 10, Ce),
789
- _("span", we, R(e.title), 1),
790
- _("span", Te, R(M(e.all)) + "/" + R(e.all.length), 1),
791
- b(u, {
924
+ }, null, 8, ["name"])], 10, Ie),
925
+ S("span", Le, H(e.title), 1),
926
+ S("span", Re, H(O(e.all)) + "/" + H(e.all.length), 1),
927
+ T(h, {
792
928
  name: "expand_more",
793
929
  size: 18,
794
- class: E(["text-on-surface-variant transition-transform duration-300", w(e.name) ? "rotate-180" : ""])
930
+ class: j(["text-on-surface-variant transition-transform duration-300", _(e.name) ? "rotate-180" : ""])
795
931
  }, null, 8, ["class"])
796
- ], 8, Se), _("div", {
932
+ ], 8, Fe), S("div", {
797
933
  class: "grid transition-[grid-template-rows] duration-300 ease-[cubic-bezier(0.2,0,0,1)]",
798
- style: D({ gridTemplateRows: w(e.name) ? "1fr" : "0fr" })
799
- }, [_("div", { class: E(["flex min-h-0 flex-col gap-1.5 overflow-hidden", w(e.name) ? "pt-1.5" : ""]) }, [(j(!0), g(d, null, F(e.layers, (e) => (j(), m(Z, {
934
+ style: M({ gridTemplateRows: _(e.name) ? "1fr" : "0fr" })
935
+ }, [S("div", { class: j(["flex min-h-0 flex-col gap-1.5 overflow-hidden", _(e.name) ? "pt-1.5" : ""]) }, [(F(!0), x(g, null, z(e.layers, (e) => (F(), y(Ne, {
800
936
  key: e.id,
801
937
  layer: e,
802
- expanded: k.value.has(e.id),
803
- onToggleExpanded: (t) => A(e.id)
804
- }, v({ _: 2 }, [t.$slots.actions ? {
938
+ expanded: E.value.has(e.id),
939
+ onToggleExpanded: (t) => D(e.id)
940
+ }, C({ _: 2 }, [t.$slots.actions ? {
805
941
  name: "actions",
806
- fn: U((e) => [I(t.$slots, "actions", T({ ref_for: !0 }, e))]),
942
+ fn: G((e) => [B(t.$slots, "actions", A({ ref_for: !0 }, e))]),
807
943
  key: "0"
808
944
  } : void 0]), 1032, [
809
945
  "layer",
810
946
  "expanded",
811
947
  "onToggleExpanded"
812
948
  ]))), 128))], 2)], 4)]))), 128)),
813
- S.value.length ? (j(), g("div", Ee, [(j(!0), g(d, null, F(S.value, (e) => (j(), m(Z, {
949
+ f.value.length ? (F(), x("div", ze, [(F(!0), x(g, null, z(f.value, (e) => (F(), y(Ne, {
814
950
  key: e.id,
815
951
  layer: e,
816
- expanded: k.value.has(e.id),
817
- onToggleExpanded: (t) => A(e.id)
818
- }, v({ _: 2 }, [t.$slots.actions ? {
952
+ expanded: E.value.has(e.id),
953
+ onToggleExpanded: (t) => D(e.id)
954
+ }, C({ _: 2 }, [t.$slots.actions ? {
819
955
  name: "actions",
820
- fn: U((e) => [I(t.$slots, "actions", T({ ref_for: !0 }, e))]),
956
+ fn: G((e) => [B(t.$slots, "actions", A({ ref_for: !0 }, e))]),
821
957
  key: "0"
822
958
  } : void 0]), 1032, [
823
959
  "layer",
824
960
  "expanded",
825
961
  "onToggleExpanded"
826
- ]))), 128))])) : h("", !0),
827
- !x.value.length && !S.value.length ? (j(), g("div", De, [_("div", Oe, [b(u, {
962
+ ]))), 128))])) : b("", !0),
963
+ !d.value.length && !f.value.length ? (F(), x("div", Be, [S("div", Ve, [T(h, {
828
964
  name: "layers_clear",
829
965
  size: 28,
830
966
  class: "text-on-surface-variant"
831
- })]), _("p", ke, R(z(n).mapNoLayers), 1)])) : h("", !0)
967
+ })]), S("p", He, H(U(n).mapNoLayers), 1)])) : b("", !0)
832
968
  ]));
833
969
  }
834
- }), je = [
970
+ }), We = [
835
971
  "title",
836
972
  "aria-label",
837
973
  "aria-checked",
838
974
  "onClick"
839
- ], Me = ["src"], Ne = [
975
+ ], Ge = ["src"], Ke = [
840
976
  "title",
841
977
  "aria-label",
842
978
  "aria-checked"
843
- ], Pe = /* @__PURE__ */ x({
979
+ ], qe = /* @__PURE__ */ E({
844
980
  __name: "MMapBaseLayers",
845
981
  props: {
846
982
  imageBase: { default: "" },
@@ -854,95 +990,95 @@ var se = /* @__PURE__ */ x({
854
990
  }
855
991
  },
856
992
  setup(e) {
857
- let t = o(), { baseLayers: n, baseLayer: r, setBaseLayer: i } = q(), a = (e, t) => /^(https?:|data:|\/\/)/.test(e) ? e : `${t}${e}`;
858
- return (o, s) => (j(), g("div", {
859
- class: E(["flex gap-2", e.vertical ? "flex-col" : "flex-row flex-wrap"]),
993
+ let t = u(), { baseLayers: n, baseLayer: r, setBaseLayer: i } = Z(), a = (e, t) => /^(https?:|data:|\/\/)/.test(e) ? e : `${t}${e}`;
994
+ return (o, s) => (F(), x("div", {
995
+ class: j(["flex gap-2", e.vertical ? "flex-col" : "flex-row flex-wrap"]),
860
996
  role: "radiogroup"
861
- }, [(j(!0), g(d, null, F(z(n), (t) => (j(), g("button", {
997
+ }, [(F(!0), x(g, null, z(U(n), (t) => (F(), x("button", {
862
998
  key: t.id,
863
999
  type: "button",
864
1000
  role: "radio",
865
- class: E(["m3-map-base grid size-12 shrink-0 cursor-pointer place-items-center overflow-hidden rounded-full border-2 bg-surface-variant transition-[border-color,transform] duration-150 hover:scale-110", z(r) === t.id ? "m3-map-base--active border-primary" : "border-transparent"]),
1001
+ class: j(["m3-map-base grid size-12 shrink-0 cursor-pointer place-items-center overflow-hidden rounded-full border-2 bg-surface-variant transition-[border-color,transform] duration-150 hover:scale-110", U(r) === t.id ? "m3-map-base--active border-primary" : "border-transparent"]),
866
1002
  title: t.title,
867
1003
  "aria-label": t.title,
868
- "aria-checked": z(r) === t.id,
869
- onClick: (e) => z(i)(t.id)
870
- }, [t.base?.image ? (j(), g("img", {
1004
+ "aria-checked": U(r) === t.id,
1005
+ onClick: (e) => U(i)(t.id)
1006
+ }, [t.base?.image ? (F(), x("img", {
871
1007
  key: 0,
872
1008
  src: a(t.base.image, e.imageBase),
873
1009
  alt: "",
874
1010
  class: "size-full object-cover"
875
- }, null, 8, Me)) : (j(), m(u, {
1011
+ }, null, 8, Ge)) : (F(), y(h, {
876
1012
  key: 1,
877
1013
  name: "map",
878
1014
  size: 22,
879
1015
  class: "text-on-surface-variant"
880
- }))], 10, je))), 128)), e.none ? (j(), g("button", {
1016
+ }))], 10, We))), 128)), e.none ? (F(), x("button", {
881
1017
  key: 0,
882
1018
  type: "button",
883
1019
  role: "radio",
884
- class: E(["m3-map-base grid size-12 shrink-0 cursor-pointer place-items-center rounded-full border-2 bg-surface-variant transition-[border-color,transform] duration-150 hover:scale-110", z(r) === null ? "m3-map-base--active border-primary" : "border-transparent"]),
885
- title: z(t).mapNoBaseLayer,
886
- "aria-label": z(t).mapNoBaseLayer,
887
- "aria-checked": z(r) === null,
888
- onClick: s[0] ||= (e) => z(i)(null)
889
- }, [b(u, {
1020
+ class: j(["m3-map-base grid size-12 shrink-0 cursor-pointer place-items-center rounded-full border-2 bg-surface-variant transition-[border-color,transform] duration-150 hover:scale-110", U(r) === null ? "m3-map-base--active border-primary" : "border-transparent"]),
1021
+ title: U(t).mapNoBaseLayer,
1022
+ "aria-label": U(t).mapNoBaseLayer,
1023
+ "aria-checked": U(r) === null,
1024
+ onClick: s[0] ||= (e) => U(i)(null)
1025
+ }, [T(h, {
890
1026
  name: "layers_clear",
891
1027
  size: 22,
892
1028
  class: "text-on-surface-variant"
893
- })], 10, Ne)) : h("", !0)], 2));
1029
+ })], 10, Ke)) : b("", !0)], 2));
894
1030
  }
895
- }), Fe = { class: "flex flex-col gap-2" }, Ie = { class: "flex items-center gap-2 bg-primary-container/40 px-4 py-2" }, Le = { class: "text-label-large text-on-primary-container" }, Re = { class: "flex flex-col px-4 py-1" }, ze = { class: "text-label-small text-on-surface-variant" }, Be = { class: "text-body-medium text-on-surface" }, Ve = {
1031
+ }), Je = { class: "flex flex-col gap-2" }, Ye = { class: "flex items-center gap-2 bg-primary-container/40 px-4 py-2" }, Xe = { class: "text-label-large text-on-primary-container" }, Ze = { class: "flex flex-col px-4 py-1" }, Qe = { class: "text-label-small text-on-surface-variant" }, $e = { class: "text-body-medium text-on-surface" }, et = {
896
1032
  key: 0,
897
1033
  class: "break-words"
898
- }, He = {
1034
+ }, tt = {
899
1035
  key: 1,
900
1036
  class: "text-body-small italic text-on-surface-variant"
901
- }, Ue = /* @__PURE__ */ x({
1037
+ }, nt = /* @__PURE__ */ E({
902
1038
  __name: "MMapFeatureInfo",
903
1039
  props: { results: {} },
904
1040
  setup(e) {
905
- let t = o();
906
- return (n, r) => (j(), g("div", Fe, [(j(!0), g(d, null, F(e.results, (e, r) => (j(), g("div", {
1041
+ let t = u();
1042
+ return (n, r) => (F(), x("div", Je, [(F(!0), x(g, null, z(e.results, (e, r) => (F(), x("div", {
907
1043
  key: r,
908
1044
  class: "overflow-hidden rounded-2xl bg-surface-container"
909
- }, [_("div", Ie, [b(u, {
1045
+ }, [S("div", Ye, [T(h, {
910
1046
  name: "layers",
911
1047
  size: 16,
912
1048
  class: "text-on-primary-container"
913
- }), _("span", Le, R(e.layer.title), 1)]), _("dl", Re, [(j(!0), g(d, null, F(e.fields, (r) => (j(), g("div", {
1049
+ }), S("span", Xe, H(e.layer.title), 1)]), S("dl", Ze, [(F(!0), x(g, null, z(e.fields, (r) => (F(), x("div", {
914
1050
  key: r.key,
915
1051
  class: "flex flex-col gap-0.5 border-b border-outline-variant py-1.5 last:border-b-0"
916
- }, [_("dt", ze, R(r.label), 1), _("dd", Be, [I(n.$slots, "value", {
1052
+ }, [S("dt", Qe, H(r.label), 1), S("dd", $e, [B(n.$slots, "value", {
917
1053
  field: r,
918
1054
  result: e
919
- }, () => [r.value ? (j(), g("span", Ve, R(r.value), 1)) : (j(), g("span", He, R(z(t).mapNoValue), 1))])])]))), 128))])]))), 128))]));
1055
+ }, () => [r.value ? (F(), x("span", et, H(r.value), 1)) : (F(), x("span", tt, H(U(t).mapNoValue), 1))])])]))), 128))])]))), 128))]));
920
1056
  }
921
- }), We = (e) => e.metadata, Ge = /* @__PURE__ */ new Set([
1057
+ }), rt = (e) => e.metadata, it = /* @__PURE__ */ new Set([
922
1058
  "fill",
923
1059
  "line",
924
1060
  "circle",
925
1061
  "symbol",
926
1062
  "fill-extrusion",
927
1063
  "heatmap"
928
- ]), Ke = (e) => ({
1064
+ ]), at = (e) => ({
929
1065
  title: e.name,
930
1066
  groups: [],
931
1067
  layers: e.layers.filter((e) => e.type !== "background").map((e) => ({
932
1068
  id: e.id,
933
- title: We(e)?.title ?? e.id,
1069
+ title: rt(e)?.title ?? e.id,
934
1070
  listed: !0,
935
1071
  children: [],
936
- identify: Ge.has(e.type) ? {
1072
+ identify: it.has(e.type) ? {
937
1073
  format: {},
938
1074
  exclude: []
939
1075
  } : !1,
940
1076
  hover: !1
941
1077
  }))
942
1078
  });
943
- function qe(e = {}) {
1079
+ function ot(e = {}) {
944
1080
  let t = e.legend ?? ((e, t) => {
945
- let n = We(e)?.legend;
1081
+ let n = rt(e)?.legend;
946
1082
  if (n?.show === !1) return;
947
1083
  if (n?.wmslegend) return n.wmslegend;
948
1084
  if (!t?.includes("/services/styles/")) return;
@@ -958,7 +1094,7 @@ function qe(e = {}) {
958
1094
  title: e.alias ?? e.name
959
1095
  })),
960
1096
  layers: e.layers.filter((e) => e.type !== "background").map((e) => {
961
- let r = We(e) ?? {}, i = { ...r.fields }, a = i.exclude ?? [];
1097
+ let r = rt(e) ?? {}, i = { ...r.fields }, a = i.exclude ?? [];
962
1098
  delete i.exclude;
963
1099
  let o = {};
964
1100
  for (let [e, t] of Object.entries(i)) o[e] = {
@@ -995,10 +1131,10 @@ function qe(e = {}) {
995
1131
  };
996
1132
  };
997
1133
  }
998
- function Je(e, t) {
1134
+ function st(e, t) {
999
1135
  return t?.label ?? e.charAt(0).toUpperCase() + e.slice(1);
1000
1136
  }
1001
- function Ye(e, t) {
1137
+ function ct(e, t) {
1002
1138
  if (e == null || String(e).trim() === "") return "";
1003
1139
  let n = String(e), r = typeof e == "number" ? e : Number(e);
1004
1140
  if (t?.mask && !Number.isNaN(r)) {
@@ -1011,23 +1147,23 @@ function Ye(e, t) {
1011
1147
  }
1012
1148
  return t?.prefix && (n = `${t.prefix} ${n}`), t?.suffix && (n = `${n} ${t.suffix}`), n;
1013
1149
  }
1014
- var Xe = /* @__PURE__ */ new Set([
1150
+ var lt = /* @__PURE__ */ new Set([
1015
1151
  "coordinates",
1016
1152
  "mapCoordinates",
1017
1153
  "layerId",
1018
1154
  "__layerMetadata"
1019
1155
  ]);
1020
- function Ze(e, t, n) {
1156
+ function ut(e, t, n) {
1021
1157
  let r = new Map((n?.layers ?? []).filter((t) => t.identify && e.getLayer(t.id)).map((e) => [e.id, e]));
1022
1158
  if (!r.size) return [];
1023
1159
  let i = [];
1024
1160
  for (let n of e.queryRenderedFeatures(t, { layers: [...r.keys()] })) {
1025
1161
  let e = r.get(n.layer.id);
1026
1162
  if (!e || !e.identify) continue;
1027
- let { format: t, exclude: a } = e.identify, o = Object.entries(n.properties ?? {}).filter(([e]) => !Xe.has(e) && !a.includes(e) && !t[e]?.hidden).map(([e, n]) => ({
1163
+ let { format: t, exclude: a } = e.identify, o = Object.entries(n.properties ?? {}).filter(([e]) => !lt.has(e) && !a.includes(e) && !t[e]?.hidden).map(([e, n]) => ({
1028
1164
  key: e,
1029
- label: Je(e, t[e]),
1030
- value: Ye(n, t[e])
1165
+ label: st(e, t[e]),
1166
+ value: ct(n, t[e])
1031
1167
  }));
1032
1168
  o.length && i.push({
1033
1169
  layer: e,
@@ -1039,7 +1175,7 @@ function Ze(e, t, n) {
1039
1175
  }
1040
1176
  //#endregion
1041
1177
  //#region src/components/MMapIdentify.vue?vue&type=script&setup=true&lang.ts
1042
- var Qe = { class: "hidden" }, $e = /* @__PURE__ */ x({
1178
+ var dt = { class: "hidden" }, ft = /* @__PURE__ */ E({
1043
1179
  inheritAttrs: !1,
1044
1180
  __name: "MMapIdentify",
1045
1181
  props: {
@@ -1058,64 +1194,64 @@ var Qe = { class: "hidden" }, $e = /* @__PURE__ */ x({
1058
1194
  },
1059
1195
  emits: ["identify"],
1060
1196
  setup(e, { expose: t, emit: n }) {
1061
- let r = e, i = n, { on: a, onReady: o, activeTool: s } = G(), { model: c } = q(), l = L([]), u = P([0, 0]), d = P(!1);
1197
+ let r = e, i = n, { on: a, onReady: o, activeTool: s } = J(), { model: c } = Z(), l = V([]), u = R([0, 0]), d = R(!1);
1062
1198
  a("click", (e) => {
1063
1199
  if (!r.enabled || s.value) return;
1064
1200
  let t = e.target;
1065
- l.value = Ze(t, e.point, c.value), u.value = [e.lngLat.lng, e.lngLat.lat], d.value = l.value.length > 0, i("identify", l.value, u.value);
1201
+ l.value = ut(t, e.point, c.value), u.value = [e.lngLat.lng, e.lngLat.lat], d.value = l.value.length > 0, i("identify", l.value, u.value);
1066
1202
  });
1067
1203
  function f() {
1068
1204
  d.value = !1;
1069
1205
  }
1070
- H(() => r.enabled, (e) => {
1206
+ W(() => r.enabled, (e) => {
1071
1207
  e || f();
1072
1208
  });
1073
- let p, v = [], y = () => {
1209
+ let p, m = [], h = () => {
1074
1210
  r.enabled && !s.value && p && (p.getCanvas().style.cursor = "pointer");
1075
- }, x = () => {
1211
+ }, g = () => {
1076
1212
  p && (p.getCanvas().style.cursor = "");
1077
1213
  };
1078
- function S() {
1214
+ function _() {
1079
1215
  if (p) {
1080
- for (let e of v) p.off("mouseenter", e, y), p.off("mouseleave", e, x);
1081
- v = (c.value?.layers ?? []).filter((e) => e.identify).map((e) => e.id);
1082
- for (let e of v) p.on("mouseenter", e, y), p.on("mouseleave", e, x);
1216
+ for (let e of m) p.off("mouseenter", e, h), p.off("mouseleave", e, g);
1217
+ m = (c.value?.layers ?? []).filter((e) => e.identify).map((e) => e.id);
1218
+ for (let e of m) p.on("mouseenter", e, h), p.on("mouseleave", e, g);
1083
1219
  }
1084
1220
  }
1085
1221
  return o((e) => {
1086
- p = e, S();
1087
- }), H(c, S), O(() => {
1088
- v.forEach((e) => {
1089
- p?.off("mouseenter", e, y), p?.off("mouseleave", e, x);
1222
+ p = e, _();
1223
+ }), W(c, _), N(() => {
1224
+ m.forEach((e) => {
1225
+ p?.off("mouseenter", e, h), p?.off("mouseleave", e, g);
1090
1226
  });
1091
- }), t({ close: f }), (t, n) => (j(), g("div", Qe, [e.marker && d.value ? (j(), m(ae, {
1227
+ }), t({ close: f }), (t, n) => (F(), x("div", dt, [e.marker && d.value ? (F(), y(_e, {
1092
1228
  key: 0,
1093
1229
  "lng-lat": u.value
1094
- }, null, 8, ["lng-lat"])) : h("", !0), e.popup && l.value.length ? (j(), m(Y, {
1230
+ }, null, 8, ["lng-lat"])) : b("", !0), e.popup && l.value.length ? (F(), y(ye, {
1095
1231
  key: 1,
1096
1232
  open: d.value,
1097
1233
  "onUpdate:open": n[0] ||= (e) => d.value = e,
1098
1234
  "lng-lat": u.value,
1099
1235
  "max-width": "360px",
1100
- offset: e.marker ? 40 : 8
1236
+ offset: e.marker ? U(he) : void 0
1101
1237
  }, {
1102
- default: U(() => [_("div", T({ class: "max-h-80 overflow-y-auto" }, t.$attrs), [I(t.$slots, "default", {
1238
+ default: G(() => [S("div", A({ class: "max-h-80 overflow-y-auto" }, t.$attrs), [B(t.$slots, "default", {
1103
1239
  results: l.value,
1104
1240
  lngLat: u.value,
1105
1241
  close: f
1106
- }, () => [b(Ue, { results: l.value }, null, 8, ["results"])])], 16)]),
1242
+ }, () => [T(nt, { results: l.value }, null, 8, ["results"])])], 16)]),
1107
1243
  _: 3
1108
1244
  }, 8, [
1109
1245
  "open",
1110
1246
  "lng-lat",
1111
1247
  "offset"
1112
- ])) : h("", !0)]));
1248
+ ])) : b("", !0)]));
1113
1249
  }
1114
- }), et = { class: "hidden" }, tt = [
1250
+ }), pt = { class: "hidden" }, mt = [
1115
1251
  "title",
1116
1252
  "aria-label",
1117
1253
  "aria-pressed"
1118
- ], nt = { class: "-mx-4 -mt-3 mb-1 bg-primary-container px-3 py-1.5 text-label-medium text-on-primary-container" }, rt = { class: "flex flex-col" }, it = { class: "text-label-small text-on-surface-variant" }, at = { class: "text-body-small text-on-surface" }, ot = /* @__PURE__ */ x({
1254
+ ], ht = { class: "-mx-4 -mt-3 mb-1 bg-primary-container px-3 py-1.5 text-label-medium text-on-primary-container" }, gt = { class: "flex flex-col" }, _t = { class: "text-label-small text-on-surface-variant" }, vt = { class: "text-body-small text-on-surface" }, yt = /* @__PURE__ */ E({
1119
1255
  __name: "MMapHover",
1120
1256
  props: {
1121
1257
  modelValue: {
@@ -1129,82 +1265,82 @@ var Qe = { class: "hidden" }, $e = /* @__PURE__ */ x({
1129
1265
  },
1130
1266
  emits: ["update:modelValue"],
1131
1267
  setup(e, { emit: t }) {
1132
- let n = e, r = t, i = o(), { onReady: a } = G(), { model: s } = q(), c = p(() => (s.value?.layers ?? []).filter((e) => e.hover && e.hover.fields.length)), l = L(null), f = P([0, 0]), v = P(!1), y, x = [];
1133
- function S(e) {
1134
- let t = e.features?.[0], n = c.value.find((e) => e.id === t?.layer.id);
1268
+ let n = e, r = t, i = u(), { onReady: a } = J(), { model: o } = Z(), s = v(() => (o.value?.layers ?? []).filter((e) => e.hover && e.hover.fields.length)), c = V(null), l = R([0, 0]), d = R(!1), f, p = [];
1269
+ function m(e) {
1270
+ let t = e.features?.[0], n = s.value.find((e) => e.id === t?.layer.id);
1135
1271
  if (!t || !n || !n.hover) return;
1136
1272
  let r = t.properties ?? {};
1137
- l.value = {
1273
+ c.value = {
1138
1274
  layer: n,
1139
1275
  fields: n.hover.fields.map((e) => ({
1140
1276
  key: e.key,
1141
- label: Je(e.key, e),
1142
- value: Ye(r[e.key], e)
1277
+ label: st(e.key, e),
1278
+ value: ct(r[e.key], e)
1143
1279
  })).filter((e) => e.value)
1144
- }, f.value = [e.lngLat.lng, e.lngLat.lat], v.value = !0;
1280
+ }, l.value = [e.lngLat.lng, e.lngLat.lat], d.value = !0;
1281
+ }
1282
+ function _() {
1283
+ d.value = !1;
1145
1284
  }
1146
1285
  function C() {
1147
- v.value = !1;
1148
- }
1149
- function w() {
1150
- if (y) {
1151
- for (let e of x) y.off("mousemove", e, S), y.off("mouseleave", e, C);
1152
- x = n.modelValue ? c.value.map((e) => e.id) : [];
1153
- for (let e of x) y.on("mousemove", e, S), y.on("mouseleave", e, C);
1154
- n.modelValue || (v.value = !1);
1286
+ if (f) {
1287
+ for (let e of p) f.off("mousemove", e, m), f.off("mouseleave", e, _);
1288
+ p = n.modelValue ? s.value.map((e) => e.id) : [];
1289
+ for (let e of p) f.on("mousemove", e, m), f.on("mouseleave", e, _);
1290
+ n.modelValue || (d.value = !1);
1155
1291
  }
1156
1292
  }
1157
1293
  a((e) => {
1158
- y = e, w();
1159
- }), H([() => n.modelValue, c], w), O(() => {
1160
- for (let e of x) y?.off("mousemove", e, S), y?.off("mouseleave", e, C);
1294
+ f = e, C();
1295
+ }), W([() => n.modelValue, s], C), N(() => {
1296
+ for (let e of p) f?.off("mousemove", e, m), f?.off("mouseleave", e, _);
1161
1297
  });
1162
- let T = p(() => n.control === !0 ? "top-right" : n.control || "top-right");
1163
- return (t, n) => (j(), g("div", et, [e.control && c.value.length ? (j(), m(le, {
1298
+ let w = v(() => n.control === !0 ? "top-right" : n.control || "top-right");
1299
+ return (t, n) => (F(), x("div", pt, [e.control && s.value.length ? (F(), y(ae, {
1164
1300
  key: 0,
1165
- position: T.value
1301
+ position: w.value
1166
1302
  }, {
1167
- default: U(() => [_("button", {
1303
+ default: G(() => [S("button", {
1168
1304
  type: "button",
1169
1305
  class: "grid place-items-center",
1170
- title: z(i).mapHoverInfo,
1171
- "aria-label": z(i).mapHoverInfo,
1306
+ title: U(i).mapHoverInfo,
1307
+ "aria-label": U(i).mapHoverInfo,
1172
1308
  "aria-pressed": e.modelValue,
1173
1309
  onClick: n[0] ||= (t) => r("update:modelValue", !e.modelValue)
1174
- }, [b(u, {
1310
+ }, [T(h, {
1175
1311
  name: "ads_click",
1176
1312
  size: 20
1177
- })], 8, tt)]),
1313
+ })], 8, mt)]),
1178
1314
  _: 1
1179
- }, 8, ["position"])) : h("", !0), l.value ? (j(), m(Y, {
1315
+ }, 8, ["position"])) : b("", !0), c.value ? (F(), y(ye, {
1180
1316
  key: 1,
1181
- open: v.value,
1182
- "onUpdate:open": n[1] ||= (e) => v.value = e,
1183
- "lng-lat": f.value,
1317
+ open: d.value,
1318
+ "onUpdate:open": n[1] ||= (e) => d.value = e,
1319
+ "lng-lat": l.value,
1184
1320
  "close-button": !1,
1185
1321
  "close-on-click": !1,
1186
1322
  offset: 12,
1187
1323
  "max-width": "280px",
1188
1324
  class: "m3-map-hover"
1189
1325
  }, {
1190
- default: U(() => [_("p", nt, R(l.value.layer.title), 1), _("dl", rt, [(j(!0), g(d, null, F(l.value.fields, (e) => (j(), g("div", {
1326
+ default: G(() => [S("p", ht, H(c.value.layer.title), 1), S("dl", gt, [(F(!0), x(g, null, z(c.value.fields, (e) => (F(), x("div", {
1191
1327
  key: e.key,
1192
1328
  class: "border-b border-outline-variant py-1 last:border-b-0"
1193
- }, [_("dt", it, R(e.label), 1), _("dd", at, R(e.value), 1)]))), 128))])]),
1329
+ }, [S("dt", _t, H(e.label), 1), S("dd", vt, H(e.value), 1)]))), 128))])]),
1194
1330
  _: 1
1195
- }, 8, ["open", "lng-lat"])) : h("", !0)]));
1331
+ }, 8, ["open", "lng-lat"])) : b("", !0)]));
1196
1332
  }
1197
- }), st = 6371008.8, $ = Math.PI / 180;
1198
- function ct(e, t) {
1333
+ }), bt = 6371008.8, $ = Math.PI / 180;
1334
+ function xt(e, t) {
1199
1335
  let n = (t[1] - e[1]) * $, r = (t[0] - e[0]) * $, i = Math.sin(n / 2) ** 2 + Math.cos(e[1] * $) * Math.cos(t[1] * $) * Math.sin(r / 2) ** 2;
1200
- return 2 * st * Math.asin(Math.min(1, Math.sqrt(i)));
1336
+ return 2 * bt * Math.asin(Math.min(1, Math.sqrt(i)));
1201
1337
  }
1202
- function lt(e) {
1338
+ function St(e) {
1203
1339
  let t = 0;
1204
- for (let n = 1; n < e.length; n++) t += ct(e[n - 1], e[n]);
1340
+ for (let n = 1; n < e.length; n++) t += xt(e[n - 1], e[n]);
1205
1341
  return t;
1206
1342
  }
1207
- function ut(e, t) {
1343
+ function Ct(e, t) {
1208
1344
  let [n, r, i, a] = [
1209
1345
  e[0] * $,
1210
1346
  e[1] * $,
@@ -1213,22 +1349,22 @@ function ut(e, t) {
1213
1349
  ], o = Math.cos(a) * Math.cos(i - n), s = Math.cos(a) * Math.sin(i - n), c = Math.atan2(Math.sin(r) + Math.sin(a), Math.sqrt((Math.cos(r) + o) ** 2 + s ** 2));
1214
1350
  return [(n + Math.atan2(s, Math.cos(r) + o)) / $, c / $];
1215
1351
  }
1216
- function dt(e) {
1217
- let t = ft(e), n = t.length - 1;
1352
+ function wt(e) {
1353
+ let t = Tt(e), n = t.length - 1;
1218
1354
  if (n <= 2) return 0;
1219
1355
  let r = 0;
1220
1356
  for (let e = 0; e < n; e++) {
1221
1357
  let i = t[e], a = t[e + 1 === n ? 0 : e + 1], o = t[e + 2 >= n ? (e + 2) % n : e + 2];
1222
1358
  r += (o[0] - i[0]) * $ * Math.sin(a[1] * $);
1223
1359
  }
1224
- return Math.abs(r * st * st / 2);
1360
+ return Math.abs(r * bt * bt / 2);
1225
1361
  }
1226
- function ft(e) {
1362
+ function Tt(e) {
1227
1363
  let t = e[0], n = e[e.length - 1];
1228
1364
  return t && n && (t[0] !== n[0] || t[1] !== n[1]) ? [...e, t] : e;
1229
1365
  }
1230
- function pt(e) {
1231
- let t = ft(e), n = 0, r = 0, i = 0;
1366
+ function Et(e) {
1367
+ let t = Tt(e), n = 0, r = 0, i = 0;
1232
1368
  for (let e = 0; e < t.length - 1; e++) {
1233
1369
  let [a, o] = t[e], [s, c] = t[e + 1], l = a * c - s * o;
1234
1370
  n += l, r += (a + s) * l, i += (o + c) * l;
@@ -1241,11 +1377,11 @@ function pt(e) {
1241
1377
  }
1242
1378
  //#endregion
1243
1379
  //#region src/components/MMapMeasure.vue?vue&type=script&setup=true&lang.ts
1244
- var mt = { class: "hidden" }, ht = ["title", "aria-pressed"], gt = ["title", "aria-pressed"], _t = ["title", "disabled"], vt = [
1380
+ var Dt = { class: "hidden" }, Ot = ["title", "aria-pressed"], kt = ["title", "aria-pressed"], At = ["title", "disabled"], jt = [
1245
1381
  "aria-label",
1246
1382
  "title",
1247
1383
  "onClick"
1248
- ], yt = /* @__PURE__ */ x({
1384
+ ], Mt = /* @__PURE__ */ E({
1249
1385
  __name: "MMapMeasure",
1250
1386
  props: {
1251
1387
  modelValue: { default: null },
@@ -1256,14 +1392,14 @@ var mt = { class: "hidden" }, ht = ["title", "aria-pressed"], gt = ["title", "ar
1256
1392
  },
1257
1393
  emits: ["update:modelValue", "change"],
1258
1394
  setup(e, { expose: t, emit: n }) {
1259
- let r = e, i = n, a = o(), { onReady: s, styleVersion: c, activeTool: l } = G(), f = X(["primary", "surface"]), v = `m3-measure-${B()}`, x = {
1260
- done: `${v}-done`,
1261
- draft: `${v}-draft`,
1262
- handles: `${v}-handles`
1263
- }, S = `${x.handles}-vertex`, C = `${x.handles}-midpoint`, w = [], T = [], D = null, k = !1, A = null, M = 0, N, I = P(null), V = P(0), ee = L([]), te = () => typeof document < "u" && document.documentElement.lang || void 0, K = (e, t) => new Intl.NumberFormat(te(), {
1395
+ let r = e, i = n, a = u(), { onReady: o, styleVersion: s, activeTool: c } = J(), l = be(["primary", "surface"]), d = `m3-measure-${te()}`, f = {
1396
+ done: `${d}-done`,
1397
+ draft: `${d}-draft`,
1398
+ handles: `${d}-handles`
1399
+ }, p = `${f.handles}-vertex`, m = `${f.handles}-midpoint`, _ = [], C = [], E = null, D = !1, O = null, k = 0, A, M = R(null), P = R(0), ee = V([]), I = () => typeof document < "u" && document.documentElement.lang || void 0, L = (e, t) => new Intl.NumberFormat(I(), {
1264
1400
  minimumFractionDigits: t,
1265
1401
  maximumFractionDigits: t
1266
- }).format(e), ne = (e) => e === 0 ? "" : e < 1e3 ? `${K(Math.round(e), 0)} m` : `${K(e / 1e3, 2)} km`, q = (e) => e >= 1e6 ? `${K(e / 1e6, 2)} km²` : e >= 1e4 ? `${K(e / 1e4, 2)} ha` : `${K(Math.round(e), 0)} m²`, re = (e, t = {}) => ({
1402
+ }).format(e), B = (e) => e === 0 ? "" : e < 1e3 ? `${L(Math.round(e), 0)} m` : `${L(e / 1e3, 2)} km`, ne = (e) => e >= 1e6 ? `${L(e / 1e6, 2)} km²` : e >= 1e4 ? `${L(e / 1e4, 2)} ha` : `${L(Math.round(e), 0)} m²`, q = (e, t = {}) => ({
1267
1403
  type: "Feature",
1268
1404
  geometry: {
1269
1405
  type: "Point",
@@ -1271,8 +1407,8 @@ var mt = { class: "hidden" }, ht = ["title", "aria-pressed"], gt = ["title", "ar
1271
1407
  },
1272
1408
  properties: t
1273
1409
  });
1274
- function J(e, t, n, r) {
1275
- let i = e.map((e) => re(e)), o = [];
1410
+ function re(e, t, n, r) {
1411
+ let i = e.map((e) => q(e)), o = [];
1276
1412
  if (e.length < 2) return {
1277
1413
  features: i,
1278
1414
  labels: o
@@ -1287,10 +1423,10 @@ var mt = { class: "hidden" }, ht = ["title", "aria-pressed"], gt = ["title", "ar
1287
1423
  });
1288
1424
  let s = (e) => {
1289
1425
  for (let t = 0; t < e.length - 1; t++) {
1290
- let r = ne(ct(e[t], e[t + 1]));
1426
+ let r = B(xt(e[t], e[t + 1]));
1291
1427
  r && o.push({
1292
1428
  key: `${n}-s${t}`,
1293
- at: ut(e[t], e[t + 1]),
1429
+ at: Ct(e[t], e[t + 1]),
1294
1430
  text: r,
1295
1431
  kind: "segment"
1296
1432
  });
@@ -1299,12 +1435,12 @@ var mt = { class: "hidden" }, ht = ["title", "aria-pressed"], gt = ["title", "ar
1299
1435
  if (t === "distance") s(e), o.push({
1300
1436
  key: `${n}-t`,
1301
1437
  at: e[e.length - 1],
1302
- text: `${a.mapTotal}: ${ne(lt(e))}`,
1438
+ text: `${a.mapTotal}: ${B(St(e))}`,
1303
1439
  kind: "total",
1304
1440
  m: r
1305
1441
  });
1306
1442
  else if (e.length >= 3) {
1307
- let t = ft(e);
1443
+ let t = Tt(e);
1308
1444
  i.push({
1309
1445
  type: "Feature",
1310
1446
  geometry: {
@@ -1314,15 +1450,15 @@ var mt = { class: "hidden" }, ht = ["title", "aria-pressed"], gt = ["title", "ar
1314
1450
  properties: {}
1315
1451
  }), s(t), o.push({
1316
1452
  key: `${n}-a`,
1317
- at: pt(t),
1318
- text: q(dt(t)),
1453
+ at: Et(t),
1454
+ text: ne(wt(t)),
1319
1455
  kind: "area",
1320
1456
  m: r
1321
1457
  });
1322
1458
  } else o.push({
1323
1459
  key: `${n}-t`,
1324
1460
  at: e[e.length - 1],
1325
- text: ne(lt(e)),
1461
+ text: B(St(e)),
1326
1462
  kind: "total",
1327
1463
  m: r
1328
1464
  });
@@ -1334,44 +1470,44 @@ var mt = { class: "hidden" }, ht = ["title", "aria-pressed"], gt = ["title", "ar
1334
1470
  let ie = (e) => ({
1335
1471
  type: "FeatureCollection",
1336
1472
  features: e
1337
- }), oe = (e, t) => (N?.getSource(e))?.setData(ie(t));
1338
- function Y() {
1339
- if (!N) return;
1340
- let e = w.map((e, t) => J(e.points, e.mode, `m${t}`, t)), t = I.value && T.length ? J(D ? [...T, D] : T, I.value, "draft") : {
1473
+ }), Y = (e, t) => (A?.getSource(e))?.setData(ie(t));
1474
+ function X() {
1475
+ if (!A) return;
1476
+ let e = _.map((e, t) => re(e.points, e.mode, `m${t}`, t)), t = M.value && C.length ? re(E ? [...C, E] : C, M.value, "draft") : {
1341
1477
  features: [],
1342
1478
  labels: []
1343
1479
  };
1344
- oe(x.done, e.flatMap((e) => e.features)), oe(x.draft, t.features);
1480
+ Y(f.done, e.flatMap((e) => e.features)), Y(f.draft, t.features);
1345
1481
  let n = [];
1346
- I.value || w.forEach((e, t) => {
1347
- (e.closed ? e.points.slice(0, -1) : e.points).forEach((e, r) => n.push(re(e, {
1482
+ M.value || _.forEach((e, t) => {
1483
+ (e.closed ? e.points.slice(0, -1) : e.points).forEach((e, r) => n.push(q(e, {
1348
1484
  handle: "vertex",
1349
1485
  m: t,
1350
1486
  v: r
1351
1487
  })));
1352
- for (let r = 0; r < e.points.length - 1; r++) n.push(re(ut(e.points[r], e.points[r + 1]), {
1488
+ for (let r = 0; r < e.points.length - 1; r++) n.push(q(Ct(e.points[r], e.points[r + 1]), {
1353
1489
  handle: "midpoint",
1354
1490
  m: t,
1355
1491
  after: r
1356
1492
  }));
1357
- }), oe(x.handles, n), ee.value = [...e.flatMap((e) => e.labels), ...t.labels];
1493
+ }), Y(f.handles, n), ee.value = [...e.flatMap((e) => e.labels), ...t.labels];
1358
1494
  }
1359
- function se() {
1360
- V.value = w.length, i("change", w.map((e) => ({
1495
+ function oe() {
1496
+ P.value = _.length, i("change", _.map((e) => ({
1361
1497
  mode: e.mode,
1362
1498
  points: e.points.map((e) => [...e]),
1363
1499
  closed: e.closed,
1364
- length: lt(e.points),
1365
- ...e.mode === "area" || e.closed ? { area: dt(e.points) } : {}
1500
+ length: St(e.points),
1501
+ ...e.mode === "area" || e.closed ? { area: wt(e.points) } : {}
1366
1502
  })));
1367
1503
  }
1368
- let ce = (e) => [
1504
+ let se = (e) => [
1369
1505
  "==",
1370
1506
  ["geometry-type"],
1371
1507
  e
1372
1508
  ];
1373
- function ue() {
1374
- let { primary: e, surface: t } = f.value;
1509
+ function ce() {
1510
+ let { primary: e, surface: t } = l.value;
1375
1511
  return {
1376
1512
  fill: { "fill-color": e },
1377
1513
  line: { "line-color": e },
@@ -1381,20 +1517,20 @@ var mt = { class: "hidden" }, ht = ["title", "aria-pressed"], gt = ["title", "ar
1381
1517
  }
1382
1518
  };
1383
1519
  }
1384
- function de() {
1385
- if (!N) return;
1386
- for (let e of Object.values(x)) N.getSource(e) || N.addSource(e, {
1520
+ function le() {
1521
+ if (!A) return;
1522
+ for (let e of Object.values(f)) A.getSource(e) || A.addSource(e, {
1387
1523
  type: "geojson",
1388
1524
  data: ie([])
1389
1525
  });
1390
- let e = ue(), t = (e) => {
1391
- N.getLayer(e.id) || N.addLayer(e);
1526
+ let e = ce(), t = (e) => {
1527
+ A.getLayer(e.id) || A.addLayer(e);
1392
1528
  };
1393
- for (let [n, r] of [[x.done, !1], [x.draft, !0]]) t({
1529
+ for (let [n, r] of [[f.done, !1], [f.draft, !0]]) t({
1394
1530
  id: `${n}-fill`,
1395
1531
  type: "fill",
1396
1532
  source: n,
1397
- filter: ce("Polygon"),
1533
+ filter: se("Polygon"),
1398
1534
  paint: {
1399
1535
  ...e.fill,
1400
1536
  "fill-opacity": r ? .15 : .2
@@ -1417,7 +1553,7 @@ var mt = { class: "hidden" }, ht = ["title", "aria-pressed"], gt = ["title", "ar
1417
1553
  id: `${n}-points`,
1418
1554
  type: "circle",
1419
1555
  source: n,
1420
- filter: ce("Point"),
1556
+ filter: se("Point"),
1421
1557
  paint: {
1422
1558
  ...e.vertices,
1423
1559
  "circle-radius": 5,
@@ -1425,9 +1561,9 @@ var mt = { class: "hidden" }, ht = ["title", "aria-pressed"], gt = ["title", "ar
1425
1561
  }
1426
1562
  });
1427
1563
  t({
1428
- id: C,
1564
+ id: m,
1429
1565
  type: "circle",
1430
- source: x.handles,
1566
+ source: f.handles,
1431
1567
  filter: [
1432
1568
  "==",
1433
1569
  ["get", "handle"],
@@ -1440,9 +1576,9 @@ var mt = { class: "hidden" }, ht = ["title", "aria-pressed"], gt = ["title", "ar
1440
1576
  "circle-opacity": .7
1441
1577
  }
1442
1578
  }), t({
1443
- id: S,
1579
+ id: p,
1444
1580
  type: "circle",
1445
- source: x.handles,
1581
+ source: f.handles,
1446
1582
  filter: [
1447
1583
  "==",
1448
1584
  ["get", "handle"],
@@ -1455,197 +1591,197 @@ var mt = { class: "hidden" }, ht = ["title", "aria-pressed"], gt = ["title", "ar
1455
1591
  }
1456
1592
  });
1457
1593
  }
1458
- H(f, () => {
1459
- if (!N) return;
1460
- let e = ue(), t = (e, t) => {
1461
- if (N.getLayer(e)) for (let [n, r] of Object.entries(t)) N.setPaintProperty(e, n, r);
1594
+ W(l, () => {
1595
+ if (!A) return;
1596
+ let e = ce(), t = (e, t) => {
1597
+ if (A.getLayer(e)) for (let [n, r] of Object.entries(t)) A.setPaintProperty(e, n, r);
1462
1598
  };
1463
- for (let n of [x.done, x.draft]) t(`${n}-fill`, e.fill), t(`${n}-line`, e.line), t(`${n}-points`, e.vertices);
1464
- t(C, e.vertices), t(S, e.vertices);
1599
+ for (let n of [f.done, f.draft]) t(`${n}-fill`, e.fill), t(`${n}-line`, e.line), t(`${n}-points`, e.vertices);
1600
+ t(m, e.vertices), t(p, e.vertices);
1465
1601
  });
1466
- let fe = (e) => [e.lngLat.lng, e.lngLat.lat];
1467
- function pe(e) {
1468
- if (T.length >= 2) {
1469
- let t = N.project(T[0]);
1602
+ let Z = (e) => [e.lngLat.lng, e.lngLat.lat];
1603
+ function ue(e) {
1604
+ if (C.length >= 2) {
1605
+ let t = A.project(C[0]);
1470
1606
  if (Math.hypot(t.x - e.point.x, t.y - e.point.y) < 20) {
1471
- k = !0, Q();
1607
+ D = !0, Q();
1472
1608
  return;
1473
1609
  }
1474
1610
  }
1475
- T.push(fe(e)), Y();
1611
+ C.push(Z(e)), X();
1476
1612
  }
1477
- function me(e) {
1478
- D = fe(e), !M && (M = requestAnimationFrame(() => {
1479
- M = 0, Y();
1613
+ function de(e) {
1614
+ E = Z(e), !k && (k = requestAnimationFrame(() => {
1615
+ k = 0, X();
1480
1616
  }));
1481
1617
  }
1482
- function he(e) {
1483
- if (e.preventDefault(), T.length < 2) return;
1484
- let t = N.project(T[T.length - 1]), n = N.project(T[T.length - 2]);
1485
- Math.hypot(t.x - n.x, t.y - n.y) < 10 && T.pop(), Q();
1618
+ function fe(e) {
1619
+ if (e.preventDefault(), C.length < 2) return;
1620
+ let t = A.project(C[C.length - 1]), n = A.project(C[C.length - 2]);
1621
+ Math.hypot(t.x - n.x, t.y - n.y) < 10 && C.pop(), Q();
1486
1622
  }
1487
- function ge(e) {
1623
+ function pe(e) {
1488
1624
  (e.key === "Escape" || e.key === "Enter") && Q(e.key === "Escape");
1489
1625
  }
1490
- let _e = () => typeof navigator < "u" ? navigator.keyboard : void 0, ve = !1;
1491
- function ye() {
1492
- I.value && document.fullscreenElement && _e()?.lock && _e().lock(["Escape"]).then(() => {
1493
- ve = !0;
1626
+ let me = () => typeof navigator < "u" ? navigator.keyboard : void 0, he = !1;
1627
+ function ge() {
1628
+ M.value && document.fullscreenElement && me()?.lock && me().lock(["Escape"]).then(() => {
1629
+ he = !0;
1494
1630
  }, () => {});
1495
1631
  }
1496
- function be() {
1497
- I.value || (ve && _e()?.unlock?.(), ve = !1);
1632
+ function ve() {
1633
+ M.value || (he && me()?.unlock?.(), he = !1);
1498
1634
  }
1499
- function xe() {
1635
+ function ye() {
1500
1636
  let e, t = () => {
1501
- document.removeEventListener("keyup", n, !0), clearTimeout(e), setTimeout(be);
1637
+ document.removeEventListener("keyup", n, !0), clearTimeout(e), setTimeout(ve);
1502
1638
  }, n = (e) => {
1503
1639
  e.key === "Escape" && t();
1504
1640
  };
1505
1641
  document.addEventListener("keyup", n, !0), e = setTimeout(t, 1500);
1506
1642
  }
1507
- function Z(e) {
1508
- if (N) {
1509
- if (I.value === e) return Q();
1510
- I.value && Q(), I.value = e, l.value = "measure", T = [], D = null, N.getCanvas().style.cursor = "crosshair", N.doubleClickZoom.disable(), N.on("click", pe), N.on("mousemove", me), N.on("dblclick", he), document.addEventListener("keydown", ge), document.addEventListener("fullscreenchange", ye), ye(), Y(), r.modelValue !== e && i("update:modelValue", e);
1643
+ function xe(e) {
1644
+ if (A) {
1645
+ if (M.value === e) return Q();
1646
+ M.value && Q(), M.value = e, c.value = "measure", C = [], E = null, A.getCanvas().style.cursor = "crosshair", A.doubleClickZoom.disable(), A.on("click", ue), A.on("mousemove", de), A.on("dblclick", fe), document.addEventListener("keydown", pe), document.addEventListener("fullscreenchange", ge), ge(), X(), r.modelValue !== e && i("update:modelValue", e);
1511
1647
  }
1512
1648
  }
1513
1649
  function Q(e = !1) {
1514
- if (!N || !I.value) return;
1515
- cancelAnimationFrame(M), M = 0;
1516
- let t = T.length >= 3 && (k || I.value === "area");
1517
- T.length >= 2 && w.push({
1518
- mode: I.value,
1519
- points: t ? [...T, [...T[0]]] : T,
1650
+ if (!A || !M.value) return;
1651
+ cancelAnimationFrame(k), k = 0;
1652
+ let t = C.length >= 3 && (D || M.value === "area");
1653
+ C.length >= 2 && _.push({
1654
+ mode: M.value,
1655
+ points: t ? [...C, [...C[0]]] : C,
1520
1656
  closed: t
1521
- }), T = [], D = null, k = !1, I.value = null, l.value === "measure" && (l.value = null), N.getCanvas().style.cursor = "", N.doubleClickZoom.enable(), N.off("click", pe), N.off("mousemove", me), N.off("dblclick", he), document.removeEventListener("keydown", ge), document.removeEventListener("fullscreenchange", ye), e && ve ? xe() : be(), Y(), se(), r.modelValue !== null && i("update:modelValue", null);
1657
+ }), C = [], E = null, D = !1, M.value = null, c.value === "measure" && (c.value = null), A.getCanvas().style.cursor = "", A.doubleClickZoom.enable(), A.off("click", ue), A.off("mousemove", de), A.off("dblclick", fe), document.removeEventListener("keydown", pe), document.removeEventListener("fullscreenchange", ge), e && he ? ye() : ve(), X(), oe(), r.modelValue !== null && i("update:modelValue", null);
1522
1658
  }
1523
1659
  function Se(e) {
1524
- w[e] && (w.splice(e, 1), Y(), se());
1660
+ _[e] && (_.splice(e, 1), X(), oe());
1525
1661
  }
1526
1662
  function Ce() {
1527
- I.value && Q(), w.length = 0, Y(), se();
1663
+ M.value && Q(), _.length = 0, X(), oe();
1528
1664
  }
1529
1665
  function we(e) {
1530
1666
  let t = e.features?.[0];
1531
- if (!t || I.value || !N) return;
1667
+ if (!t || M.value || !A) return;
1532
1668
  e.preventDefault();
1533
- let n = t.properties.m, r = w[n];
1669
+ let n = t.properties.m, r = _[n];
1534
1670
  if (!r) return;
1535
1671
  let i = t.properties.v;
1536
- t.properties.handle === "midpoint" && (i = t.properties.after + 1, r.points.splice(i, 0, fe(e))), A = {
1672
+ t.properties.handle === "midpoint" && (i = t.properties.after + 1, r.points.splice(i, 0, Z(e))), O = {
1537
1673
  m: n,
1538
1674
  v: i
1539
- }, l.value = "measure", N.getCanvas().style.cursor = "grabbing";
1675
+ }, c.value = "measure", A.getCanvas().style.cursor = "grabbing";
1540
1676
  let a = e.type === "touchstart";
1541
- a && N.dragPan.disable(), N.on(a ? "touchmove" : "mousemove", Te), N.once(a ? "touchend" : "mouseup", Ee), Y();
1677
+ a && A.dragPan.disable(), A.on(a ? "touchmove" : "mousemove", Te), A.once(a ? "touchend" : "mouseup", Ee), X();
1542
1678
  }
1543
1679
  function Te(e) {
1544
- if (!A) return;
1545
- let t = w[A.m];
1680
+ if (!O) return;
1681
+ let t = _[O.m];
1546
1682
  if (!t) return;
1547
- let n = fe(e);
1548
- t.points[A.v] = n, t.closed && A.v === 0 && (t.points[t.points.length - 1] = n), Y();
1683
+ let n = Z(e);
1684
+ t.points[O.v] = n, t.closed && O.v === 0 && (t.points[t.points.length - 1] = n), X();
1549
1685
  }
1550
1686
  function Ee() {
1551
- N && (A = null, N.off("mousemove", Te), N.off("touchmove", Te), N.dragPan.enable(), N.getCanvas().style.cursor = "", se(), setTimeout(() => {
1552
- l.value === "measure" && !I.value && (l.value = null);
1687
+ A && (O = null, A.off("mousemove", Te), A.off("touchmove", Te), A.dragPan.enable(), A.getCanvas().style.cursor = "", oe(), setTimeout(() => {
1688
+ c.value === "measure" && !M.value && (c.value = null);
1553
1689
  }));
1554
1690
  }
1555
1691
  let De = () => {
1556
- N && !A && !I.value && (N.getCanvas().style.cursor = "grab");
1692
+ A && !O && !M.value && (A.getCanvas().style.cursor = "grab");
1557
1693
  }, Oe = () => {
1558
- N && !A && !I.value && (N.getCanvas().style.cursor = "");
1694
+ A && !O && !M.value && (A.getCanvas().style.cursor = "");
1559
1695
  };
1560
- s((e) => {
1561
- N = e, de();
1562
- for (let t of [S, C]) e.on("mousedown", t, we), e.on("touchstart", t, we), e.on("mouseenter", t, De), e.on("mouseleave", t, Oe);
1563
- r.modelValue && Z(r.modelValue);
1564
- }), H(c, () => {
1565
- de(), Y();
1566
- }), H(() => r.modelValue, (e) => {
1567
- e && e !== I.value ? Z(e) : !e && I.value && Q();
1568
- }), O(() => {
1569
- if (!N) return;
1570
- I.value && Q();
1571
- for (let e of [S, C]) N.off("mousedown", e, we), N.off("touchstart", e, we), N.off("mouseenter", e, De), N.off("mouseleave", e, Oe);
1696
+ o((e) => {
1697
+ A = e, le();
1698
+ for (let t of [p, m]) e.on("mousedown", t, we), e.on("touchstart", t, we), e.on("mouseenter", t, De), e.on("mouseleave", t, Oe);
1699
+ r.modelValue && xe(r.modelValue);
1700
+ }), W(s, () => {
1701
+ le(), X();
1702
+ }), W(() => r.modelValue, (e) => {
1703
+ e && e !== M.value ? xe(e) : !e && M.value && Q();
1704
+ }), N(() => {
1705
+ if (!A) return;
1706
+ M.value && Q();
1707
+ for (let e of [p, m]) A.off("mousedown", e, we), A.off("touchstart", e, we), A.off("mouseenter", e, De), A.off("mouseleave", e, Oe);
1572
1708
  let e = [
1573
- S,
1574
- C,
1575
- ...[x.done, x.draft].flatMap((e) => [
1709
+ p,
1710
+ m,
1711
+ ...[f.done, f.draft].flatMap((e) => [
1576
1712
  `${e}-points`,
1577
1713
  `${e}-line`,
1578
1714
  `${e}-fill`
1579
1715
  ])
1580
1716
  ];
1581
- for (let t of e) N.getLayer(t) && N.removeLayer(t);
1582
- for (let e of Object.values(x)) N.getSource(e) && N.removeSource(e);
1717
+ for (let t of e) A.getLayer(t) && A.removeLayer(t);
1718
+ for (let e of Object.values(f)) A.getSource(e) && A.removeSource(e);
1583
1719
  });
1584
- let ke = p(() => r.control === !0 ? "top-right" : r.control || "top-right");
1720
+ let ke = v(() => r.control === !0 ? "top-right" : r.control || "top-right");
1585
1721
  return t({
1586
- start: Z,
1722
+ start: xe,
1587
1723
  finish: Q,
1588
1724
  clear: Ce,
1589
1725
  remove: Se
1590
- }), (t, n) => (j(), g("div", mt, [e.control ? (j(), m(le, {
1726
+ }), (t, n) => (F(), x("div", Dt, [e.control ? (F(), y(ae, {
1591
1727
  key: 0,
1592
1728
  position: ke.value
1593
1729
  }, {
1594
- default: U(() => [
1595
- _("button", {
1730
+ default: G(() => [
1731
+ S("button", {
1596
1732
  type: "button",
1597
1733
  class: "grid place-items-center",
1598
- title: z(a).mapMeasureDistance,
1599
- "aria-pressed": I.value === "distance",
1600
- onClick: n[0] ||= (e) => Z("distance")
1601
- }, [b(u, {
1734
+ title: U(a).mapMeasureDistance,
1735
+ "aria-pressed": M.value === "distance",
1736
+ onClick: n[0] ||= (e) => xe("distance")
1737
+ }, [T(h, {
1602
1738
  name: "straighten",
1603
1739
  size: 20
1604
- })], 8, ht),
1605
- _("button", {
1740
+ })], 8, Ot),
1741
+ S("button", {
1606
1742
  type: "button",
1607
1743
  class: "grid place-items-center",
1608
- title: z(a).mapMeasureArea,
1609
- "aria-pressed": I.value === "area",
1610
- onClick: n[1] ||= (e) => Z("area")
1611
- }, [b(u, {
1744
+ title: U(a).mapMeasureArea,
1745
+ "aria-pressed": M.value === "area",
1746
+ onClick: n[1] ||= (e) => xe("area")
1747
+ }, [T(h, {
1612
1748
  name: "pentagon",
1613
1749
  size: 20
1614
- })], 8, gt),
1615
- _("button", {
1750
+ })], 8, kt),
1751
+ S("button", {
1616
1752
  type: "button",
1617
1753
  class: "grid place-items-center",
1618
- title: z(a).mapClearMeasurements,
1619
- disabled: !V.value && !I.value,
1754
+ title: U(a).mapClearMeasurements,
1755
+ disabled: !P.value && !M.value,
1620
1756
  onClick: Ce
1621
- }, [b(u, {
1757
+ }, [T(h, {
1622
1758
  name: "delete",
1623
1759
  size: 20
1624
- })], 8, _t)
1760
+ })], 8, At)
1625
1761
  ]),
1626
1762
  _: 1
1627
- }, 8, ["position"])) : h("", !0), (j(!0), g(d, null, F(ee.value, (e) => (j(), m(ae, {
1763
+ }, 8, ["position"])) : b("", !0), (F(!0), x(g, null, z(ee.value, (e) => (F(), y(_e, {
1628
1764
  key: e.key,
1629
1765
  "lng-lat": e.at,
1630
1766
  anchor: e.kind === "area" ? "center" : "top",
1631
1767
  offset: e.kind === "area" ? [0, 0] : [0, 8],
1632
1768
  class: "pointer-events-none"
1633
1769
  }, {
1634
- default: U(() => [_("span", { class: E(["flex items-center gap-1 whitespace-nowrap rounded-full py-0.5 shadow-elevation-1", [e.kind === "segment" ? "bg-surface-container-highest text-label-small text-on-surface" : "bg-primary text-label-medium text-on-primary", e.m === void 0 ? "px-2" : "pr-0.5 pl-2"]]) }, [y(R(e.text) + " ", 1), e.m === void 0 ? h("", !0) : (j(), g("button", {
1770
+ default: G(() => [S("span", { class: j(["flex items-center gap-1 whitespace-nowrap rounded-full py-0.5 shadow-elevation-1", [e.kind === "segment" ? "bg-surface-container-highest text-label-small text-on-surface" : "bg-primary text-label-medium text-on-primary", e.m === void 0 ? "px-2" : "pr-0.5 pl-2"]]) }, [w(H(e.text) + " ", 1), e.m === void 0 ? b("", !0) : (F(), x("button", {
1635
1771
  key: 0,
1636
1772
  type: "button",
1637
1773
  class: "pointer-events-auto grid size-5 cursor-pointer place-items-center rounded-full hover:bg-on-primary/12 focus-visible:outline-2 focus-visible:outline-on-primary",
1638
- "aria-label": z(a).mapDeleteMeasurement,
1639
- title: z(a).mapDeleteMeasurement,
1640
- onClick: W((t) => Se(e.m), ["stop"]),
1641
- onPointerdown: n[2] ||= W(() => {}, ["stop"]),
1642
- onMousedown: n[3] ||= W(() => {}, ["stop"]),
1643
- onTouchstart: n[4] ||= W(() => {}, ["stop"]),
1644
- onDblclick: n[5] ||= W(() => {}, ["stop"])
1645
- }, [b(u, {
1774
+ "aria-label": U(a).mapDeleteMeasurement,
1775
+ title: U(a).mapDeleteMeasurement,
1776
+ onClick: K((t) => Se(e.m), ["stop"]),
1777
+ onPointerdown: n[2] ||= K(() => {}, ["stop"]),
1778
+ onMousedown: n[3] ||= K(() => {}, ["stop"]),
1779
+ onTouchstart: n[4] ||= K(() => {}, ["stop"]),
1780
+ onDblclick: n[5] ||= K(() => {}, ["stop"])
1781
+ }, [T(h, {
1646
1782
  name: "close",
1647
1783
  size: 14
1648
- })], 40, vt))], 2)]),
1784
+ })], 40, jt))], 2)]),
1649
1785
  _: 2
1650
1786
  }, 1032, [
1651
1787
  "lng-lat",
@@ -1653,15 +1789,15 @@ var mt = { class: "hidden" }, ht = ["title", "aria-pressed"], gt = ["title", "ar
1653
1789
  "offset"
1654
1790
  ]))), 128))]));
1655
1791
  }
1656
- }), bt = /* @__PURE__ */ new WeakMap();
1657
- function xt() {
1658
- let e = C(ee, null);
1792
+ }), Nt = /* @__PURE__ */ new WeakMap();
1793
+ function Pt() {
1794
+ let e = O(q, null);
1659
1795
  if (!e) throw Error("useMapFilter() must be called in a component inside <MMap>");
1660
1796
  function t(t, n) {
1661
1797
  let r = e.map.value;
1662
1798
  if (!r?.getLayer(t)) return;
1663
- let i = bt.get(r);
1664
- i || bt.set(r, i = /* @__PURE__ */ new Map()), i.has(t) || i.set(t, r.getFilter(t) ?? void 0);
1799
+ let i = Nt.get(r);
1800
+ i || Nt.set(r, i = /* @__PURE__ */ new Map()), i.has(t) || i.set(t, r.getFilter(t) ?? void 0);
1665
1801
  let a = i.get(t);
1666
1802
  r.setFilter(t, n ? a ? [
1667
1803
  "all",
@@ -1686,7 +1822,7 @@ function xt() {
1686
1822
  }
1687
1823
  //#endregion
1688
1824
  //#region src/components/MMapFilter.vue?vue&type=script&setup=true&lang.ts
1689
- var St = { class: "flex flex-wrap gap-2" }, Ct = /* @__PURE__ */ x({
1825
+ var Ft = { class: "flex flex-wrap gap-2" }, It = /* @__PURE__ */ E({
1690
1826
  __name: "MMapFilter",
1691
1827
  props: {
1692
1828
  layer: {},
@@ -1697,44 +1833,44 @@ var St = { class: "flex flex-wrap gap-2" }, Ct = /* @__PURE__ */ x({
1697
1833
  },
1698
1834
  emits: ["update:modelValue"],
1699
1835
  setup(t, { emit: n }) {
1700
- let r = t, i = n, { onReady: a, styleVersion: o } = G(), { setFilter: s, valuesOf: c } = xt(), l = P([]), u = p(() => r.values ?? l.value), f = P([]), h = p(() => r.modelValue ?? f.value);
1701
- function _() {
1702
- let e = h.value;
1836
+ let r = t, i = n, { onReady: a, styleVersion: o } = J(), { setFilter: s, valuesOf: c } = Pt(), l = R([]), u = v(() => r.values ?? l.value), d = R([]), f = v(() => r.modelValue ?? d.value);
1837
+ function p() {
1838
+ let e = f.value;
1703
1839
  s(r.layer, e.length ? [
1704
1840
  "in",
1705
1841
  ["get", r.property],
1706
1842
  ["literal", e]
1707
1843
  ] : null);
1708
1844
  }
1709
- function v(e) {
1710
- let t = h.value.includes(e) ? h.value.filter((t) => t !== e) : [...h.value, e];
1711
- f.value = t, i("update:modelValue", t);
1845
+ function m(e) {
1846
+ let t = f.value.includes(e) ? f.value.filter((t) => t !== e) : [...f.value, e];
1847
+ d.value = t, i("update:modelValue", t);
1712
1848
  }
1713
- function b(e) {
1849
+ function h(e) {
1714
1850
  let t = () => {
1715
1851
  r.values || (l.value = c(r.layer, r.property));
1716
1852
  };
1717
1853
  t(), e.once("idle", t);
1718
1854
  }
1719
1855
  return a((e) => {
1720
- b(e), _();
1721
- }), H(h, _, { deep: !0 }), H(o, () => _()), H(() => [r.layer, r.property], ([e], [t]) => {
1722
- e !== t && s(t, null), _();
1723
- }), O(() => s(r.layer, null)), (n, r) => (j(), g("div", St, [(j(!0), g(d, null, F(u.value, (n) => (j(), m(e, {
1856
+ h(e), p();
1857
+ }), W(f, p, { deep: !0 }), W(o, () => p()), W(() => [r.layer, r.property], ([e], [t]) => {
1858
+ e !== t && s(t, null), p();
1859
+ }), N(() => s(r.layer, null)), (n, r) => (F(), x("div", Ft, [(F(!0), x(g, null, z(u.value, (n) => (F(), y(e, {
1724
1860
  key: n,
1725
1861
  type: "filter",
1726
1862
  clickable: "",
1727
- selected: h.value.includes(n),
1728
- onClick: (e) => v(n)
1863
+ selected: f.value.includes(n),
1864
+ onClick: (e) => m(n)
1729
1865
  }, {
1730
- default: U(() => [y(R(t.labels?.[String(n)] ?? n), 1)]),
1866
+ default: G(() => [w(H(t.labels?.[String(n)] ?? n), 1)]),
1731
1867
  _: 2
1732
1868
  }, 1032, ["selected", "onClick"]))), 128))]));
1733
1869
  }
1734
1870
  });
1735
1871
  //#endregion
1736
1872
  //#region src/composables/mapSearch.ts
1737
- function wt(e = {}) {
1873
+ function Lt(e = {}) {
1738
1874
  return async (t, n) => {
1739
1875
  let r = new URLSearchParams({
1740
1876
  format: "jsonv2",
@@ -1762,17 +1898,17 @@ function wt(e = {}) {
1762
1898
  }
1763
1899
  //#endregion
1764
1900
  //#region src/components/MMapSearch.vue?vue&type=script&setup=true&lang.ts
1765
- var Tt = { class: "hidden" }, Et = [
1901
+ var Rt = { class: "hidden" }, zt = [
1766
1902
  "value",
1767
1903
  "placeholder",
1768
1904
  "aria-label"
1769
- ], Dt = {
1905
+ ], Bt = {
1770
1906
  key: 0,
1771
1907
  class: "border-t border-outline-variant"
1772
- }, Ot = {
1908
+ }, Vt = {
1773
1909
  key: 1,
1774
1910
  class: "flex flex-col items-center gap-2 py-6"
1775
- }, kt = { class: "text-body-small text-on-surface-variant" }, At = /* @__PURE__ */ x({
1911
+ }, Ht = { class: "text-body-small text-on-surface-variant" }, Ut = /* @__PURE__ */ E({
1776
1912
  __name: "MMapSearch",
1777
1913
  props: {
1778
1914
  provider: {},
@@ -1789,45 +1925,45 @@ var Tt = { class: "hidden" }, Et = [
1789
1925
  }
1790
1926
  },
1791
1927
  emits: ["select"],
1792
- setup(e, { emit: n }) {
1793
- let a = e, l = n, f = o(), { map: v } = G(), y = p(() => a.provider ?? wt()), x = P(""), S = L([]), C = P(!1), w = P(!1), T = P(!1), E = L(null), D, k;
1794
- async function A() {
1795
- let e = x.value.trim();
1928
+ setup(e, { emit: t }) {
1929
+ let n = e, i = t, o = u(), { map: c } = J(), l = v(() => n.provider ?? Lt()), d = R(""), m = V([]), _ = R(!1), C = R(!1), w = R(!1), E = V(null), D, O;
1930
+ async function k() {
1931
+ let e = d.value.trim();
1796
1932
  if (!e) return;
1797
1933
  D?.abort(), D = new AbortController();
1798
1934
  let t = D;
1799
- C.value = !0, T.value = !0;
1935
+ _.value = !0, w.value = !0;
1800
1936
  try {
1801
- S.value = await y.value(e, t.signal);
1937
+ m.value = await l.value(e, t.signal);
1802
1938
  } catch {
1803
1939
  if (t.signal.aborted) return;
1804
- S.value = [];
1940
+ m.value = [];
1805
1941
  } finally {
1806
- D === t && (C.value = !1, w.value = !0);
1942
+ D === t && (_.value = !1, C.value = !0);
1807
1943
  }
1808
1944
  }
1809
- function M(e) {
1810
- if (x.value = e, !e) return I();
1811
- a.instant && (clearTimeout(k), k = setTimeout(A, 350));
1945
+ function A(e) {
1946
+ if (d.value = e, !e) return M();
1947
+ n.instant && (clearTimeout(O), O = setTimeout(k, 350));
1812
1948
  }
1813
- function N(e) {
1814
- E.value = e, T.value = !1;
1815
- let t = v.value;
1949
+ function j(e) {
1950
+ E.value = e, w.value = !1;
1951
+ let t = c.value;
1816
1952
  e.bbox && e.bbox[0] !== e.bbox[2] ? t?.fitBounds([[e.bbox[0], e.bbox[1]], [e.bbox[2], e.bbox[3]]], {
1817
1953
  padding: 48,
1818
- maxZoom: a.zoom
1954
+ maxZoom: n.zoom
1819
1955
  }) : t?.flyTo({
1820
1956
  center: e.lngLat,
1821
- zoom: a.zoom
1822
- }), l("select", e);
1957
+ zoom: n.zoom
1958
+ }), i("select", e);
1823
1959
  }
1824
- function I() {
1825
- D?.abort(), clearTimeout(k), x.value = "", S.value = [], w.value = !1, C.value = !1, T.value = !1, E.value = null;
1960
+ function M() {
1961
+ D?.abort(), clearTimeout(O), d.value = "", m.value = [], C.value = !1, _.value = !1, w.value = !1, E.value = null;
1826
1962
  }
1827
- O(() => {
1828
- D?.abort(), clearTimeout(k);
1963
+ N(() => {
1964
+ D?.abort(), clearTimeout(O);
1829
1965
  });
1830
- let B = {
1966
+ let P = {
1831
1967
  city: "location_city",
1832
1968
  town: "location_city",
1833
1969
  village: "holiday_village",
@@ -1854,78 +1990,78 @@ var Tt = { class: "hidden" }, Et = [
1854
1990
  administrative: "map",
1855
1991
  country: "public",
1856
1992
  state: "map"
1857
- }, V = (e) => e && B[e] || "location_on";
1858
- return (n, a) => (j(), g("div", Tt, [b(le, {
1993
+ }, ee = (e) => e && P[e] || "location_on";
1994
+ return (t, n) => (F(), x("div", Rt, [T(ae, {
1859
1995
  position: e.position,
1860
1996
  group: !1
1861
1997
  }, {
1862
- default: U(() => [b(i, {
1998
+ default: G(() => [T(s, {
1863
1999
  variant: "elevated",
1864
2000
  class: "w-80 max-w-[calc(100vw-5rem)] overflow-hidden"
1865
2001
  }, {
1866
- default: U(() => [_("form", {
2002
+ default: G(() => [S("form", {
1867
2003
  class: "flex items-center gap-2 py-1 pr-1 pl-3",
1868
2004
  role: "search",
1869
- onSubmit: W(A, ["prevent"])
2005
+ onSubmit: K(k, ["prevent"])
1870
2006
  }, [
1871
- b(u, {
2007
+ T(h, {
1872
2008
  name: "search",
1873
2009
  size: 20,
1874
2010
  class: "shrink-0 text-on-surface-variant"
1875
2011
  }),
1876
- _("input", {
1877
- value: x.value,
2012
+ S("input", {
2013
+ value: d.value,
1878
2014
  type: "search",
1879
2015
  enterkeyhint: "search",
1880
- placeholder: e.placeholder ?? z(f).mapSearchPlaces,
1881
- "aria-label": e.placeholder ?? z(f).mapSearchPlaces,
2016
+ placeholder: e.placeholder ?? U(o).mapSearchPlaces,
2017
+ "aria-label": e.placeholder ?? U(o).mapSearchPlaces,
1882
2018
  class: "min-w-0 flex-1 bg-transparent py-2 text-body-medium text-on-surface outline-none placeholder:text-on-surface-variant [&::-webkit-search-cancel-button]:hidden",
1883
- onInput: a[0] ||= (e) => M(e.target.value),
1884
- onFocus: a[1] ||= (e) => T.value = w.value && !E.value
1885
- }, null, 40, Et),
1886
- C.value ? (j(), m(s, {
2019
+ onInput: n[0] ||= (e) => A(e.target.value),
2020
+ onFocus: n[1] ||= (e) => w.value = C.value && !E.value
2021
+ }, null, 40, zt),
2022
+ _.value ? (F(), y(f, {
1887
2023
  key: 0,
1888
2024
  size: 20,
1889
2025
  class: "mr-2 shrink-0"
1890
- })) : x.value ? (j(), m(c, {
2026
+ })) : d.value ? (F(), y(p, {
1891
2027
  key: 1,
1892
2028
  icon: "close",
1893
- label: z(f).clearSearch,
2029
+ label: U(o).clearSearch,
1894
2030
  size: "sm",
1895
- onClick: I
1896
- }, null, 8, ["label"])) : h("", !0)
1897
- ], 32), T.value && w.value && !C.value ? (j(), g("div", Dt, [S.value.length ? (j(), m(t, {
2031
+ onClick: M
2032
+ }, null, 8, ["label"])) : b("", !0)
2033
+ ], 32), w.value && C.value && !_.value ? (F(), x("div", Bt, [m.value.length ? (F(), y(r, {
1898
2034
  key: 0,
1899
2035
  class: "max-h-72 overflow-y-auto"
1900
2036
  }, {
1901
- default: U(() => [(j(!0), g(d, null, F(S.value, (e, t) => (j(), m(r, {
2037
+ default: G(() => [(F(!0), x(g, null, z(m.value, (e, t) => (F(), y(a, {
1902
2038
  key: t,
1903
2039
  title: e.label,
1904
- icon: V(e.type),
2040
+ icon: ee(e.type),
1905
2041
  leading: "icon",
1906
2042
  clickable: "",
1907
- onClick: (t) => N(e)
2043
+ onClick: (t) => j(e)
1908
2044
  }, null, 8, [
1909
2045
  "title",
1910
2046
  "icon",
1911
2047
  "onClick"
1912
2048
  ]))), 128))]),
1913
2049
  _: 1
1914
- })) : (j(), g("div", Ot, [b(u, {
2050
+ })) : (F(), x("div", Vt, [T(h, {
1915
2051
  name: "search_off",
1916
2052
  size: 28,
1917
2053
  class: "text-on-surface-variant"
1918
- }), _("span", kt, R(z(f).noResults), 1)]))])) : h("", !0)]),
2054
+ }), S("span", Ht, H(U(o).noResults), 1)]))])) : b("", !0)]),
1919
2055
  _: 1
1920
2056
  })]),
1921
2057
  _: 1
1922
- }, 8, ["position"]), e.marker && E.value ? (j(), m(ae, {
2058
+ }, 8, ["position"]), e.marker && E.value ? (F(), y(_e, {
1923
2059
  key: 0,
1924
2060
  "lng-lat": E.value.lngLat
1925
- }, null, 8, ["lng-lat"])) : h("", !0)]));
2061
+ }, null, 8, ["lng-lat"])) : b("", !0)]));
1926
2062
  }
1927
2063
  });
1928
2064
  //#endregion
1929
- export { J as MMap, Pe as MMapBaseLayers, le as MMapControl, Ue as MMapFeatureInfo, Ct as MMapFilter, se as MMapGeoJson, ot as MMapHover, $e as MMapIdentify, Ae as MMapLayers, ae as MMapMarker, yt as MMapMeasure, Y as MMapPopup, At as MMapSearch, Je as fieldLabel, Ye as formatFieldValue, Ke as genericAdapter, Ze as identifyFeatures, wt as nominatimProvider, qe as orvianAdapter, G as useMap, xt as useMapFilter, q as useMapLayers };
2065
+ export { de as MMap, qe as MMapBaseLayers, ae as MMapControl, nt as MMapFeatureInfo, It as MMapFilter, xe as MMapGeoJson, yt as MMapHover, ft as MMapIdentify, Ue as MMapLayers, _e as MMapMarker, Mt as MMapMeasure, ye as MMapPopup, Ut as MMapSearch, st as fieldLabel, ct as formatFieldValue, at as genericAdapter, ut as identifyFeatures, Lt as nominatimProvider, ot as orvianAdapter, J as useMap, Pt as useMapFilter, Z as useMapLayers };
1930
2066
 
1931
2067
  //# sourceMappingURL=map.js.map