@alfadocs/ui-kit-debug 1.106.0 → 1.108.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{map-view-V7etHnyF.js → map-view-Dn7aXZJw.js} +187 -182
- package/dist/_chunks/map-view-Dn7aXZJw.js.map +1 -0
- package/dist/_chunks/{practice-results-BXz01sti.js → practice-results-BOpaPaav.js} +2 -2
- package/dist/_chunks/{practice-results-BXz01sti.js.map → practice-results-BOpaPaav.js.map} +1 -1
- package/dist/_chunks/stat-group-CC4-O-Fj.js +97 -0
- package/dist/_chunks/stat-group-CC4-O-Fj.js.map +1 -0
- package/dist/agent-catalog.json +1 -1
- package/dist/components/map-view/index.js +1 -1
- package/dist/components/map-view/map-view.d.ts +8 -0
- package/dist/components/map-view/map-view.d.ts.map +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/stat-group/index.js +1 -1
- package/dist/components/stat-group/stat-group.d.ts.map +1 -1
- package/dist/core.css +1 -1
- package/dist/index.js +3 -3
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/map-view-V7etHnyF.js.map +0 -1
- package/dist/_chunks/stat-group-DSNnzkbW.js +0 -107
- package/dist/_chunks/stat-group-DSNnzkbW.js.map +0 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as l, jsxs as S } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
2
|
+
import { forwardRef as ge, useMemo as E, useRef as k, useId as fe, useState as Y, useEffect as C, useCallback as T, useImperativeHandle as be } from "react";
|
|
3
3
|
import { c as x } from "./index-D2ZczOXr.js";
|
|
4
4
|
import { useTranslation as A } from "react-i18next";
|
|
5
|
-
import { M as
|
|
6
|
-
import { B as
|
|
7
|
-
import { S as
|
|
8
|
-
import { V as
|
|
9
|
-
import { E as
|
|
10
|
-
import { u as
|
|
11
|
-
import { l as
|
|
12
|
-
import { M as
|
|
13
|
-
import { E as
|
|
14
|
-
const
|
|
5
|
+
import { M as ye, A as we, a as ve, b as ke, P as Me, c as ze, u as Ve, d as ne, e as K } from "./maps-core-gate-DkNqGkm3.js";
|
|
6
|
+
import { B as Ce } from "./button-DohK_Ak_.js";
|
|
7
|
+
import { S as Ie } from "./skeleton-tTWJpvAq.js";
|
|
8
|
+
import { V as Le } from "./visually-hidden-BHxEUGyT.js";
|
|
9
|
+
import { E as Ee } from "./error-boundary-tAn_GuCu.js";
|
|
10
|
+
import { u as Te } from "./registry-DvAUVLHh.js";
|
|
11
|
+
import { l as Se } from "./length-token-DwMnGEYT.js";
|
|
12
|
+
import { M as xe } from "./map-pin-BaY37-Km.js";
|
|
13
|
+
import { E as Pe } from "./external-link-CY6zAXXU.js";
|
|
14
|
+
const Ge = {
|
|
15
15
|
id: "map-view",
|
|
16
16
|
// pan → scroll (viewport move); set_zoom → set_value; select_marker → pick
|
|
17
17
|
// (NON-persisting marker focus, no value state slot).
|
|
@@ -153,7 +153,7 @@ const Pe = {
|
|
|
153
153
|
description: "Sourced from the id prop."
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
|
-
},
|
|
156
|
+
}, Ne = x(
|
|
157
157
|
["ds:relative ds:overflow-hidden ds:block", "ds:bg-[var(--muted)]"].join(" "),
|
|
158
158
|
{
|
|
159
159
|
variants: {
|
|
@@ -177,7 +177,7 @@ const Pe = {
|
|
|
177
177
|
},
|
|
178
178
|
defaultVariants: { size: "md", surface: "bordered" }
|
|
179
179
|
}
|
|
180
|
-
),
|
|
180
|
+
), Re = x("ds:block ds:w-full", {
|
|
181
181
|
variants: {
|
|
182
182
|
size: {
|
|
183
183
|
sm: "ds:[block-size:var(--map-block-size)]",
|
|
@@ -187,7 +187,7 @@ const Pe = {
|
|
|
187
187
|
}
|
|
188
188
|
},
|
|
189
189
|
defaultVariants: { size: "md" }
|
|
190
|
-
}),
|
|
190
|
+
}), Ze = x(
|
|
191
191
|
[
|
|
192
192
|
"ds:absolute ds:inset-0",
|
|
193
193
|
"ds:flex ds:flex-col ds:items-center ds:justify-center",
|
|
@@ -196,16 +196,16 @@ const Pe = {
|
|
|
196
196
|
"ds:bg-[var(--muted)] ds:text-[var(--foreground)]",
|
|
197
197
|
"ds:text-center"
|
|
198
198
|
].join(" ")
|
|
199
|
-
),
|
|
199
|
+
), _e = x("type-heading-3 ds:m-0"), Q = x(
|
|
200
200
|
"type-body-sm ds:text-[var(--muted-foreground)] ds:[max-inline-size:28rem] ds:m-0"
|
|
201
201
|
);
|
|
202
|
-
function
|
|
202
|
+
function je({
|
|
203
203
|
onHandleReady: e,
|
|
204
204
|
onMarkerSelect: n,
|
|
205
205
|
onCameraMove: o
|
|
206
206
|
}) {
|
|
207
207
|
const i = K();
|
|
208
|
-
return
|
|
208
|
+
return C(() => {
|
|
209
209
|
if (i)
|
|
210
210
|
return e({
|
|
211
211
|
panTo: (r) => {
|
|
@@ -229,27 +229,27 @@ function _e({
|
|
|
229
229
|
}), () => e(null);
|
|
230
230
|
}, [i, e, n, o]), null;
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function Oe({
|
|
233
233
|
onBoundsChange: e,
|
|
234
234
|
userInteraction: n
|
|
235
235
|
}) {
|
|
236
236
|
const o = K(), i = k(e);
|
|
237
|
-
return i.current = e,
|
|
237
|
+
return i.current = e, C(() => {
|
|
238
238
|
if (!o) return;
|
|
239
239
|
const r = o.getDiv();
|
|
240
240
|
let a = null;
|
|
241
|
-
const
|
|
241
|
+
const c = () => {
|
|
242
242
|
n.current = {
|
|
243
243
|
pendingInput: !1,
|
|
244
244
|
moved: !1,
|
|
245
245
|
programmatic: !1
|
|
246
246
|
};
|
|
247
247
|
};
|
|
248
|
-
|
|
248
|
+
c();
|
|
249
249
|
let b;
|
|
250
|
-
const
|
|
251
|
-
if (t instanceof PointerEvent && t.pointerType === "touch" && (t.type === "pointerdown" &&
|
|
252
|
-
|
|
250
|
+
const u = /* @__PURE__ */ new Set(), f = (t) => {
|
|
251
|
+
if (t instanceof PointerEvent && t.pointerType === "touch" && (t.type === "pointerdown" && u.add(t.pointerId), t.type === "pointerup" || t.type === "pointercancel")) {
|
|
252
|
+
u.delete(t.pointerId);
|
|
253
253
|
return;
|
|
254
254
|
}
|
|
255
255
|
if (t instanceof PointerEvent && t.type === "pointermove" && t.buttons === 0 && t.pointerType !== "touch" || t instanceof KeyboardEvent && ![
|
|
@@ -267,22 +267,22 @@ function je({
|
|
|
267
267
|
"PageDown"
|
|
268
268
|
].includes(t.key))
|
|
269
269
|
return;
|
|
270
|
-
const
|
|
271
|
-
let
|
|
272
|
-
t instanceof PointerEvent && t.type === "pointermove" && (
|
|
270
|
+
const m = document.fullscreenElement, w = !!(m && (m.contains(r) || r.contains(m)));
|
|
271
|
+
let h = t.type === "dblclick";
|
|
272
|
+
t instanceof PointerEvent && t.type === "pointermove" && (h = t.pointerType !== "touch" || u.size >= 2 || w), t.type === "touchmove" && (h = t.touches.length >= 2 || w), t instanceof KeyboardEvent && (h = t.key !== "Enter" && t.key !== " "), t instanceof WheelEvent && (h = t.ctrlKey || t.metaKey || w), t.type === "click" && (h = t.target instanceof Element && t.target.closest('button, [role="button"]') != null), h && (n.current.programmatic = !1), n.current.pendingInput = !0, clearTimeout(b), b = setTimeout(() => {
|
|
273
273
|
n.current.pendingInput = !1;
|
|
274
274
|
}, 250);
|
|
275
|
-
},
|
|
275
|
+
}, d = () => {
|
|
276
276
|
n.current.pendingInput && !n.current.programmatic && (n.current.moved = !0);
|
|
277
277
|
}, y = () => {
|
|
278
278
|
var P, G;
|
|
279
|
-
const t = (P = o.getBounds()) == null ? void 0 : P.toJSON(),
|
|
280
|
-
if (
|
|
281
|
-
const
|
|
279
|
+
const t = (P = o.getBounds()) == null ? void 0 : P.toJSON(), m = (G = o.getCenter()) == null ? void 0 : G.toJSON(), w = o.getZoom(), h = n.current.moved;
|
|
280
|
+
if (c(), clearTimeout(b), !t || !m || w == null) return;
|
|
281
|
+
const v = !a || Object.keys(t).some(
|
|
282
282
|
(N) => t[N] !== a.bounds[N]
|
|
283
|
-
), I = a != null && (w !== a.zoom ||
|
|
284
|
-
a = { bounds: t, center:
|
|
285
|
-
},
|
|
283
|
+
), I = a != null && (w !== a.zoom || m.lat !== a.center.lat || m.lng !== a.center.lng);
|
|
284
|
+
a = { bounds: t, center: m, zoom: w }, v && i.current(t, { userInteraction: h && I });
|
|
285
|
+
}, p = [
|
|
286
286
|
"pointerdown",
|
|
287
287
|
"pointermove",
|
|
288
288
|
"pointerup",
|
|
@@ -294,113 +294,113 @@ function je({
|
|
|
294
294
|
"wheel",
|
|
295
295
|
"keydown"
|
|
296
296
|
];
|
|
297
|
-
|
|
297
|
+
p.forEach(
|
|
298
298
|
(t) => r.addEventListener(t, f, { capture: !0, passive: !0 })
|
|
299
299
|
);
|
|
300
|
-
const
|
|
300
|
+
const M = [
|
|
301
301
|
o.addListener("dragstart", () => {
|
|
302
302
|
n.current.programmatic = !1, n.current.moved = !0;
|
|
303
303
|
}),
|
|
304
|
-
o.addListener("center_changed",
|
|
305
|
-
o.addListener("zoom_changed",
|
|
304
|
+
o.addListener("center_changed", d),
|
|
305
|
+
o.addListener("zoom_changed", d),
|
|
306
306
|
o.addListener("idle", y)
|
|
307
307
|
];
|
|
308
308
|
return y(), () => {
|
|
309
|
-
|
|
309
|
+
M.forEach((t) => t.remove()), p.forEach(
|
|
310
310
|
(t) => r.removeEventListener(t, f, !0)
|
|
311
|
-
), clearTimeout(b),
|
|
311
|
+
), clearTimeout(b), c();
|
|
312
312
|
};
|
|
313
313
|
}, [o, n]), null;
|
|
314
314
|
}
|
|
315
|
-
const
|
|
315
|
+
const Ae = 256, Ke = (e) => e * Math.PI / 180;
|
|
316
316
|
function ee(e) {
|
|
317
|
-
const n = Math.min(Math.max(Math.sin(
|
|
317
|
+
const n = Math.min(Math.max(Math.sin(Ke(e)), -0.9999), 0.9999);
|
|
318
318
|
return Math.log((1 + n) / (1 - n)) / 2;
|
|
319
319
|
}
|
|
320
|
-
const
|
|
321
|
-
function
|
|
320
|
+
const $e = (e) => Math.atan(Math.sinh(e)) * 180 / Math.PI;
|
|
321
|
+
function qe(e) {
|
|
322
322
|
let n = -90, o = 90, i = -180, r = 180;
|
|
323
|
-
for (const { lat: a, lng:
|
|
324
|
-
n = Math.max(n, a), o = Math.min(o, a), i = Math.max(i,
|
|
323
|
+
for (const { lat: a, lng: c } of e)
|
|
324
|
+
n = Math.max(n, a), o = Math.min(o, a), i = Math.max(i, c), r = Math.min(r, c);
|
|
325
325
|
return { north: n, south: o, east: i, west: r };
|
|
326
326
|
}
|
|
327
|
-
function
|
|
328
|
-
const { north: a, south:
|
|
329
|
-
if (a ===
|
|
327
|
+
function De(e, n, o, i, r) {
|
|
328
|
+
const { north: a, south: c, east: b, west: u } = qe(e);
|
|
329
|
+
if (a === c && b === u)
|
|
330
330
|
return { center: { lat: a, lng: b }, zoom: r };
|
|
331
|
-
const f = ee(a),
|
|
332
|
-
lat:
|
|
333
|
-
lng: (b +
|
|
334
|
-
},
|
|
335
|
-
|
|
336
|
-
|
|
331
|
+
const f = ee(a), d = ee(c), y = {
|
|
332
|
+
lat: $e((f + d) / 2),
|
|
333
|
+
lng: (b + u) / 2
|
|
334
|
+
}, p = (t, m) => m > 0 ? Math.log2(Math.max(t, 1) / Ae / m) : r, M = Math.min(
|
|
335
|
+
p(n - 2 * i, (b - u) / 360),
|
|
336
|
+
p(o - 2 * i, (f - d) / (2 * Math.PI)),
|
|
337
337
|
r
|
|
338
338
|
);
|
|
339
|
-
return { center: y, zoom: Math.max(0, Math.floor(
|
|
339
|
+
return { center: y, zoom: Math.max(0, Math.floor(M)) };
|
|
340
340
|
}
|
|
341
341
|
const re = ({ id: e, lat: n, lng: o }) => e != null ? `id:${e}` : `at:${n},${o}`;
|
|
342
|
-
function
|
|
342
|
+
function He({
|
|
343
343
|
points: e,
|
|
344
344
|
fitKey: n,
|
|
345
345
|
maxZoom: o,
|
|
346
346
|
onCameraMove: i
|
|
347
347
|
}) {
|
|
348
|
-
const r = K(), a = k(null),
|
|
349
|
-
return
|
|
348
|
+
const r = K(), a = k(null), c = k(!1), b = k(null);
|
|
349
|
+
return C(() => {
|
|
350
350
|
if (!r) return;
|
|
351
|
-
const
|
|
351
|
+
const u = () => {
|
|
352
352
|
var t;
|
|
353
|
-
const
|
|
354
|
-
|
|
353
|
+
const d = b.current, y = (t = r.getCenter()) == null ? void 0 : t.toJSON(), p = r.getZoom();
|
|
354
|
+
d != null && p === d.zoom && y != null && Math.abs(y.lat - d.center.lat) < 1e-6 && Math.abs(y.lng - d.center.lng) < 1e-6 || (c.current = !0);
|
|
355
355
|
}, f = [
|
|
356
356
|
r.addListener("dragstart", () => {
|
|
357
|
-
|
|
357
|
+
c.current = !0;
|
|
358
358
|
}),
|
|
359
|
-
r.addListener("center_changed",
|
|
360
|
-
r.addListener("zoom_changed",
|
|
359
|
+
r.addListener("center_changed", u),
|
|
360
|
+
r.addListener("zoom_changed", u)
|
|
361
361
|
];
|
|
362
|
-
return () => f.forEach((
|
|
363
|
-
}, [r]),
|
|
362
|
+
return () => f.forEach((d) => d.remove());
|
|
363
|
+
}, [r]), C(() => {
|
|
364
364
|
var w;
|
|
365
365
|
if (!r) return;
|
|
366
|
-
const
|
|
367
|
-
if ((
|
|
368
|
-
const f = new Set(e.map(re)),
|
|
369
|
-
b.current = { center:
|
|
366
|
+
const u = ((w = a.current) == null ? void 0 : w.map) === r ? a.current : null;
|
|
367
|
+
if ((u == null ? void 0 : u.key) === n) return;
|
|
368
|
+
const f = new Set(e.map(re)), d = (h, v) => {
|
|
369
|
+
b.current = { center: h, zoom: v }, i(), r.moveCamera({ center: h, zoom: v }), c.current = !1;
|
|
370
370
|
};
|
|
371
371
|
if (e.length === 0) {
|
|
372
372
|
a.current = { map: r, key: n, points: f };
|
|
373
373
|
return;
|
|
374
374
|
}
|
|
375
|
-
if (
|
|
375
|
+
if (u != null && u.points.size > 0 && [...u.points].every((h) => f.has(h)) && c.current) {
|
|
376
376
|
a.current = { map: r, key: n, points: f };
|
|
377
377
|
return;
|
|
378
378
|
}
|
|
379
|
-
const
|
|
380
|
-
if (!(
|
|
381
|
-
const
|
|
379
|
+
const p = r.getDiv();
|
|
380
|
+
if (!(p instanceof Element)) return;
|
|
381
|
+
const M = () => {
|
|
382
382
|
a.current = { map: r, key: n, points: f };
|
|
383
|
-
const
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
), { center:
|
|
383
|
+
const h = Math.min(
|
|
384
|
+
Se("--spacing-2xl", p, 48),
|
|
385
|
+
p.clientWidth / 4,
|
|
386
|
+
p.clientHeight / 4
|
|
387
|
+
), { center: v, zoom: I } = De(
|
|
388
388
|
e,
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
389
|
+
p.clientWidth,
|
|
390
|
+
p.clientHeight,
|
|
391
|
+
h,
|
|
392
392
|
o
|
|
393
393
|
);
|
|
394
|
-
|
|
395
|
-
}, t = () =>
|
|
394
|
+
d(v, I);
|
|
395
|
+
}, t = () => p.clientWidth > 0 && p.clientHeight > 0;
|
|
396
396
|
if (t() || typeof ResizeObserver > "u") {
|
|
397
|
-
|
|
397
|
+
M();
|
|
398
398
|
return;
|
|
399
399
|
}
|
|
400
|
-
const
|
|
401
|
-
t() && (
|
|
400
|
+
const m = new ResizeObserver(() => {
|
|
401
|
+
t() && (m.disconnect(), M());
|
|
402
402
|
});
|
|
403
|
-
return
|
|
403
|
+
return m.observe(p), () => m.disconnect();
|
|
404
404
|
}, [r, n, e, o, i]), null;
|
|
405
405
|
}
|
|
406
406
|
const oe = (e) => {
|
|
@@ -416,74 +416,76 @@ function se() {
|
|
|
416
416
|
"data-testid": "map-view-loading",
|
|
417
417
|
className: "ds:[inline-size:100%] ds:[block-size:100%]",
|
|
418
418
|
children: [
|
|
419
|
-
/* @__PURE__ */ l(
|
|
420
|
-
/* @__PURE__ */ l(
|
|
419
|
+
/* @__PURE__ */ l(Ie, { variant: "rectangular", width: "100%", height: "100%" }),
|
|
420
|
+
/* @__PURE__ */ l(Le, { children: e("common.loading") })
|
|
421
421
|
]
|
|
422
422
|
}
|
|
423
423
|
);
|
|
424
424
|
}
|
|
425
|
-
function
|
|
426
|
-
const n =
|
|
425
|
+
function Be({ children: e }) {
|
|
426
|
+
const n = Ve();
|
|
427
427
|
return ne("maps") || !n || oe("Map") ? e : /* @__PURE__ */ l(se, {});
|
|
428
428
|
}
|
|
429
|
-
function
|
|
429
|
+
function Fe({ children: e }) {
|
|
430
430
|
return ne("marker") || oe("Marker") ? e : null;
|
|
431
431
|
}
|
|
432
432
|
function te({
|
|
433
433
|
address: e,
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
434
|
+
contentLang: n,
|
|
435
|
+
description: o,
|
|
436
|
+
onLoadMap: i,
|
|
437
|
+
openInGoogleMapsHref: r,
|
|
438
|
+
consentCta: a
|
|
438
439
|
}) {
|
|
439
|
-
const { t:
|
|
440
|
-
return /* @__PURE__ */ S("div", { className:
|
|
440
|
+
const { t: c } = A("ui");
|
|
441
|
+
return /* @__PURE__ */ S("div", { className: Ze(), "data-testid": "map-view-consent", children: [
|
|
441
442
|
/* @__PURE__ */ l(
|
|
442
|
-
|
|
443
|
+
xe,
|
|
443
444
|
{
|
|
444
445
|
"aria-hidden": "true",
|
|
445
446
|
className: "ds:size-6 ds:text-[var(--muted-foreground)]"
|
|
446
447
|
}
|
|
447
448
|
),
|
|
448
|
-
/* @__PURE__ */ l("p", { className:
|
|
449
|
+
/* @__PURE__ */ l("p", { className: _e(), children: c("mapView.consentTitle") }),
|
|
449
450
|
e ? /* @__PURE__ */ l(
|
|
450
451
|
"p",
|
|
451
452
|
{
|
|
452
453
|
className: Q(),
|
|
453
454
|
"data-testid": "map-view-address",
|
|
455
|
+
lang: n,
|
|
454
456
|
children: e
|
|
455
457
|
}
|
|
456
458
|
) : null,
|
|
457
|
-
/* @__PURE__ */ l("p", { className: Q(), children:
|
|
459
|
+
/* @__PURE__ */ l("p", { className: Q(), children: o }),
|
|
458
460
|
/* @__PURE__ */ S("div", { className: "ds:flex ds:gap-[var(--spacing-sm)] ds:flex-wrap ds:items-center ds:justify-center", children: [
|
|
459
|
-
|
|
460
|
-
|
|
461
|
+
a ?? /* @__PURE__ */ l(
|
|
462
|
+
Ce,
|
|
461
463
|
{
|
|
462
464
|
type: "button",
|
|
463
465
|
intent: "primary",
|
|
464
466
|
size: "sm",
|
|
465
|
-
onClick:
|
|
467
|
+
onClick: i,
|
|
466
468
|
"data-testid": "map-view-load-cta",
|
|
467
|
-
children:
|
|
469
|
+
children: c("mapView.consentCta")
|
|
468
470
|
}
|
|
469
471
|
),
|
|
470
472
|
/* @__PURE__ */ S(
|
|
471
473
|
"a",
|
|
472
474
|
{
|
|
473
|
-
href:
|
|
475
|
+
href: r,
|
|
474
476
|
target: "_blank",
|
|
475
477
|
rel: "noopener noreferrer",
|
|
476
478
|
className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-2xs)] ds:text-[var(--primary-readable)] ds:underline ds:underline-offset-2",
|
|
477
479
|
children: [
|
|
478
|
-
|
|
479
|
-
/* @__PURE__ */ l(
|
|
480
|
+
c("mapView.openInGoogleMaps"),
|
|
481
|
+
/* @__PURE__ */ l(Pe, { "aria-hidden": "true", className: "ds:size-3" })
|
|
480
482
|
]
|
|
481
483
|
}
|
|
482
484
|
)
|
|
483
485
|
] })
|
|
484
486
|
] });
|
|
485
487
|
}
|
|
486
|
-
const
|
|
488
|
+
const We = ge(
|
|
487
489
|
({
|
|
488
490
|
id: e,
|
|
489
491
|
apiKey: n,
|
|
@@ -491,36 +493,37 @@ const Fe = he(
|
|
|
491
493
|
zoom: i = 15,
|
|
492
494
|
markers: r,
|
|
493
495
|
selectedMarkerId: a,
|
|
494
|
-
onMarkerClick:
|
|
496
|
+
onMarkerClick: c,
|
|
495
497
|
onBoundsChange: b,
|
|
496
|
-
consentGranted:
|
|
498
|
+
consentGranted: u = !1,
|
|
497
499
|
onConsentRequest: f,
|
|
498
|
-
address:
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
500
|
+
address: d,
|
|
501
|
+
contentLang: y,
|
|
502
|
+
consentDescription: p,
|
|
503
|
+
consentCta: M,
|
|
504
|
+
mapId: t,
|
|
505
|
+
size: m,
|
|
506
|
+
surface: w,
|
|
507
|
+
ariaLabel: h,
|
|
508
|
+
fitToPoints: v,
|
|
509
|
+
fitKey: I,
|
|
510
|
+
fitMaxZoom: P = 15,
|
|
511
|
+
className: G,
|
|
512
|
+
...N
|
|
513
|
+
}, ae) => {
|
|
514
|
+
const { t: R, i18n: ie } = A("ui"), Z = E(() => v ?? [], [v]), le = E(
|
|
515
|
+
() => I ?? Z.map((s) => `${re(s)}@${s.lat},${s.lng}`).sort().join("|"),
|
|
516
|
+
[I, Z]
|
|
517
|
+
), V = Z.length > 0, $ = k(V), q = fe(), ce = E(
|
|
515
518
|
() => `map-${q.replace(/[^a-zA-Z0-9-_]/g, "")}`,
|
|
516
519
|
[q]
|
|
517
|
-
), [D,
|
|
518
|
-
|
|
520
|
+
), [D, de] = Y(!1);
|
|
521
|
+
C(() => {
|
|
519
522
|
if (typeof window > "u") return;
|
|
520
|
-
const s = window.matchMedia("(prefers-reduced-motion: reduce)"), g = () =>
|
|
523
|
+
const s = window.matchMedia("(prefers-reduced-motion: reduce)"), g = () => de(s.matches);
|
|
521
524
|
return g(), s.addEventListener("change", g), () => s.removeEventListener("change", g);
|
|
522
525
|
}, []);
|
|
523
|
-
const H = E(() => `https://www.google.com/maps/search/?api=1&query=${
|
|
526
|
+
const H = E(() => `https://www.google.com/maps/search/?api=1&query=${d ? encodeURIComponent(d) : `${o.lat},${o.lng}`}`, [d, o.lat, o.lng]), z = k(null), B = k({
|
|
524
527
|
pendingInput: !1,
|
|
525
528
|
moved: !1,
|
|
526
529
|
programmatic: !1
|
|
@@ -532,10 +535,10 @@ const Fe = he(
|
|
|
532
535
|
};
|
|
533
536
|
}, []), j = T(
|
|
534
537
|
(s) => {
|
|
535
|
-
_(),
|
|
538
|
+
_(), c == null || c(s);
|
|
536
539
|
},
|
|
537
|
-
[_,
|
|
538
|
-
),
|
|
540
|
+
[_, c]
|
|
541
|
+
), pe = T((s) => {
|
|
539
542
|
z.current = s;
|
|
540
543
|
}, []), F = k(!1), W = k(null), J = k(0), O = T(
|
|
541
544
|
() => ({
|
|
@@ -570,28 +573,28 @@ const Fe = he(
|
|
|
570
573
|
}),
|
|
571
574
|
[]
|
|
572
575
|
);
|
|
573
|
-
|
|
574
|
-
const
|
|
576
|
+
be(ae, O, [O]);
|
|
577
|
+
const ue = E(
|
|
575
578
|
() => O(),
|
|
576
579
|
[O]
|
|
577
580
|
);
|
|
578
|
-
|
|
579
|
-
var g,
|
|
581
|
+
Te(Ge, ue, e), C(() => {
|
|
582
|
+
var g, L;
|
|
580
583
|
const s = $.current && !V;
|
|
581
584
|
if ($.current = V, !V) {
|
|
582
585
|
if (s) {
|
|
583
586
|
(g = z.current) == null || g.jumpTo(o, i);
|
|
584
587
|
return;
|
|
585
588
|
}
|
|
586
|
-
D || (
|
|
589
|
+
D || (L = z.current) == null || L.panTo(o);
|
|
587
590
|
}
|
|
588
|
-
}, [o.lat, o.lng, D, V]),
|
|
591
|
+
}, [o.lat, o.lng, D, V]), C(() => {
|
|
589
592
|
var s;
|
|
590
593
|
V || (s = z.current) == null || s.setZoom(i);
|
|
591
594
|
}, [i, V]);
|
|
592
|
-
const [
|
|
595
|
+
const [me, U] = Y(!1), X = u || me;
|
|
593
596
|
F.current = X, W.current = a ?? null, J.current = (r ?? []).length;
|
|
594
|
-
const
|
|
597
|
+
const he = T(() => {
|
|
595
598
|
if (f) {
|
|
596
599
|
f(), U(!0);
|
|
597
600
|
return;
|
|
@@ -601,85 +604,86 @@ const Fe = he(
|
|
|
601
604
|
return /* @__PURE__ */ l(
|
|
602
605
|
"div",
|
|
603
606
|
{
|
|
604
|
-
className:
|
|
607
|
+
className: Ne({ size: m, surface: w, className: G }),
|
|
605
608
|
"data-component": "map-view",
|
|
606
|
-
"data-component-id": e ??
|
|
609
|
+
"data-component-id": e ?? ce,
|
|
607
610
|
role: "region",
|
|
608
|
-
"aria-label":
|
|
609
|
-
...
|
|
610
|
-
children: /* @__PURE__ */ l("div", { className:
|
|
611
|
+
"aria-label": h ?? R("mapView.label"),
|
|
612
|
+
...N,
|
|
613
|
+
children: /* @__PURE__ */ l("div", { className: Re({ size: m }), children: X ? (
|
|
611
614
|
// A provider failure shows the consent placeholder (its "Open in
|
|
612
615
|
// Google Maps" link needs no script) with "Load map" as the
|
|
613
616
|
// retry, instead of unmounting the host's React tree. The gate
|
|
614
617
|
// starts the provider only once Google's `core` and `maps`
|
|
615
618
|
// libraries have arrived.
|
|
616
619
|
/* @__PURE__ */ l(
|
|
617
|
-
|
|
620
|
+
Ee,
|
|
618
621
|
{
|
|
619
622
|
fallback: ({ reset: s }) => /* @__PURE__ */ l(
|
|
620
623
|
te,
|
|
621
624
|
{
|
|
622
|
-
address:
|
|
623
|
-
|
|
625
|
+
address: d,
|
|
626
|
+
contentLang: y,
|
|
627
|
+
description: p ?? R("mapView.consentDescription"),
|
|
624
628
|
onLoadMap: s,
|
|
625
629
|
consentCta: void 0,
|
|
626
630
|
openInGoogleMapsHref: H
|
|
627
631
|
}
|
|
628
632
|
),
|
|
629
|
-
children: /* @__PURE__ */ l(
|
|
630
|
-
|
|
633
|
+
children: /* @__PURE__ */ l(ye, { libraries: ["maps"], pending: /* @__PURE__ */ l(se, {}), children: /* @__PURE__ */ l(
|
|
634
|
+
we,
|
|
631
635
|
{
|
|
632
636
|
apiKey: n,
|
|
633
|
-
language:
|
|
634
|
-
children: /* @__PURE__ */ l(
|
|
635
|
-
|
|
637
|
+
language: ie.language,
|
|
638
|
+
children: /* @__PURE__ */ l(Be, { children: /* @__PURE__ */ S(
|
|
639
|
+
ve,
|
|
636
640
|
{
|
|
637
641
|
defaultCenter: o,
|
|
638
642
|
defaultZoom: i,
|
|
639
|
-
mapId:
|
|
643
|
+
mapId: t,
|
|
640
644
|
gestureHandling: "cooperative",
|
|
641
645
|
disableDefaultUI: !1,
|
|
642
646
|
onClick: () => j(null),
|
|
643
647
|
className: "ds:[inline-size:100%] ds:[block-size:100%]",
|
|
644
648
|
children: [
|
|
645
649
|
/* @__PURE__ */ l(
|
|
646
|
-
|
|
650
|
+
je,
|
|
647
651
|
{
|
|
648
|
-
onHandleReady:
|
|
652
|
+
onHandleReady: pe,
|
|
649
653
|
onMarkerSelect: j,
|
|
650
654
|
onCameraMove: _
|
|
651
655
|
}
|
|
652
656
|
),
|
|
653
657
|
b ? /* @__PURE__ */ l(
|
|
654
|
-
|
|
658
|
+
Oe,
|
|
655
659
|
{
|
|
656
660
|
onBoundsChange: b,
|
|
657
661
|
userInteraction: B
|
|
658
662
|
}
|
|
659
663
|
) : null,
|
|
660
|
-
|
|
661
|
-
|
|
664
|
+
v ? /* @__PURE__ */ l(
|
|
665
|
+
He,
|
|
662
666
|
{
|
|
663
667
|
points: Z,
|
|
664
|
-
fitKey:
|
|
665
|
-
maxZoom:
|
|
668
|
+
fitKey: le,
|
|
669
|
+
maxZoom: P,
|
|
666
670
|
onCameraMove: _
|
|
667
671
|
}
|
|
668
672
|
) : null,
|
|
669
|
-
/* @__PURE__ */ l(
|
|
670
|
-
const g = a != null && a === s.id,
|
|
673
|
+
/* @__PURE__ */ l(Fe, { children: (r ?? []).map((s) => {
|
|
674
|
+
const g = a != null && a === s.id, L = R("mapView.markerLabel", {
|
|
671
675
|
label: s.label ?? s.id
|
|
672
676
|
});
|
|
673
|
-
return
|
|
674
|
-
|
|
677
|
+
return t ? /* @__PURE__ */ l(
|
|
678
|
+
ke,
|
|
675
679
|
{
|
|
676
680
|
position: s.position,
|
|
677
|
-
title:
|
|
678
|
-
"aria-label":
|
|
681
|
+
title: L,
|
|
682
|
+
"aria-label": L,
|
|
679
683
|
"data-selected": g ? "true" : "false",
|
|
680
684
|
onClick: () => j(s.id),
|
|
681
685
|
children: /* @__PURE__ */ l(
|
|
682
|
-
|
|
686
|
+
Me,
|
|
683
687
|
{
|
|
684
688
|
background: "var(--primary)",
|
|
685
689
|
borderColor: "var(--primary)",
|
|
@@ -689,10 +693,10 @@ const Fe = he(
|
|
|
689
693
|
},
|
|
690
694
|
s.id
|
|
691
695
|
) : /* @__PURE__ */ l(
|
|
692
|
-
|
|
696
|
+
ze,
|
|
693
697
|
{
|
|
694
698
|
position: s.position,
|
|
695
|
-
title:
|
|
699
|
+
title: L,
|
|
696
700
|
onClick: () => j(s.id)
|
|
697
701
|
},
|
|
698
702
|
s.id
|
|
@@ -708,10 +712,11 @@ const Fe = he(
|
|
|
708
712
|
) : /* @__PURE__ */ l(
|
|
709
713
|
te,
|
|
710
714
|
{
|
|
711
|
-
address:
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
+
address: d,
|
|
716
|
+
contentLang: y,
|
|
717
|
+
description: p ?? R("mapView.consentDescription"),
|
|
718
|
+
onLoadMap: he,
|
|
719
|
+
consentCta: M,
|
|
715
720
|
openInGoogleMapsHref: H
|
|
716
721
|
}
|
|
717
722
|
) })
|
|
@@ -719,8 +724,8 @@ const Fe = he(
|
|
|
719
724
|
);
|
|
720
725
|
}
|
|
721
726
|
);
|
|
722
|
-
|
|
727
|
+
We.displayName = "MapView";
|
|
723
728
|
export {
|
|
724
|
-
|
|
729
|
+
We as M
|
|
725
730
|
};
|
|
726
|
-
//# sourceMappingURL=map-view-
|
|
731
|
+
//# sourceMappingURL=map-view-Dn7aXZJw.js.map
|