@nivaro/react 0.3.44 → 0.3.46

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 (51) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +75 -7
  4. package/dist/shared/components/BaseMap.js +149 -103
  5. package/dist/shared/components/CollectionBrowserView.js +1390 -1358
  6. package/dist/shared/components/DataTable.js +356 -334
  7. package/dist/shared/components/ProfileView.js +16 -21
  8. package/dist/shared/components/command-center/CommandCenterView.js +331 -352
  9. package/dist/shared/components/command-center/Customize.js +353 -0
  10. package/dist/shared/components/command-center/Header.js +296 -0
  11. package/dist/shared/components/command-center/KioskLinks.js +198 -0
  12. package/dist/shared/components/command-center/PeekPanel.js +146 -0
  13. package/dist/shared/components/command-center/announce.js +13 -0
  14. package/dist/shared/components/command-center/api.js +26 -0
  15. package/dist/shared/components/command-center/board-prefs.js +99 -0
  16. package/dist/shared/components/command-center/freshness.js +29 -0
  17. package/dist/shared/components/command-center/layout.js +56 -0
  18. package/dist/shared/components/command-center/panels/AttentionPanel.js +135 -0
  19. package/dist/shared/components/command-center/panels/Banner.js +75 -0
  20. package/dist/shared/components/command-center/panels/BoardSettings.js +223 -0
  21. package/dist/shared/components/command-center/panels/FeedPanel.js +149 -0
  22. package/dist/shared/components/command-center/panels/FlowPanel.js +159 -0
  23. package/dist/shared/components/command-center/panels/ForecastPanel.js +247 -0
  24. package/dist/shared/components/command-center/panels/MapLegend.js +266 -0
  25. package/dist/shared/components/command-center/panels/MapPanel.js +224 -0
  26. package/dist/shared/components/command-center/panels/PartnersPanel.js +52 -0
  27. package/dist/shared/components/command-center/panels/PeoplePanel.js +264 -0
  28. package/dist/shared/components/command-center/panels/RegionPicker.js +91 -0
  29. package/dist/shared/components/command-center/panels/SystemPanel.js +173 -0
  30. package/dist/shared/components/command-center/panels/ThroughputPanel.js +310 -0
  31. package/dist/shared/components/command-center/panels/TimeBar.js +231 -0
  32. package/dist/shared/components/command-center/panels/TrafficPanel.js +15 -0
  33. package/dist/shared/components/command-center/panels/WorkloadPanel.js +85 -0
  34. package/dist/shared/components/command-center/panels/attention-actions.js +267 -0
  35. package/dist/shared/components/command-center/panels/map-shared.js +95 -0
  36. package/dist/shared/components/command-center/panels/registry.js +96 -0
  37. package/dist/shared/components/command-center/shell-hooks.js +118 -0
  38. package/dist/shared/components/command-center/shortcuts.js +37 -0
  39. package/dist/shared/components/command-center/state.js +12 -0
  40. package/dist/shared/components/command-center/theme.js +84 -0
  41. package/dist/shared/components/command-center/time.js +52 -0
  42. package/dist/shared/components/command-center/url-state.js +54 -0
  43. package/dist/shared/components/command-center/work-links.js +32 -0
  44. package/dist/shared/components/imports/ImportConsole.js +48 -47
  45. package/dist/shared/components/monitoring/TrafficMiniMap.js +111 -70
  46. package/dist/shared/components/notifications/TestMyRules.js +39 -38
  47. package/dist/shared/components/profile/TeamsConnect.js +2 -2
  48. package/dist/shared/components/queue/QueueQuickFilters.js +81 -63
  49. package/dist/shared/components/queue/QueueWorklist.js +598 -586
  50. package/dist/shared/lib/quick-filter-cascade.js +29 -0
  51. package/package.json +1 -1
@@ -9,7 +9,7 @@ import { noteReplayEvent as _e, createReplayCheckoutState as De } from "../share
9
9
  import { emitReplayTap as Te, setReplayRecorderMode as N, registerReplayCapture as qe, clipEndOffset as Le, withClipKind as Pe } from "../shared/lib/replay-capture.js";
10
10
  import { instrumentConsole as Ne, instrumentRequests as Fe, redactSecrets as Me } from "../shared/lib/replay-context.js";
11
11
  import { instrumentSocket as Oe } from "../shared/lib/replay-socket.js";
12
- const Ue = "nivaro-react@0.3.44", j = 1e4, We = 150, He = 3e3, Ke = 600, $e = (n) => `nvr_replay_resume${n ? `:${n}` : ""}`, G = () => typeof navigator > "u" || navigator.onLine !== !1;
12
+ const Ue = "nivaro-react@0.3.46", j = 1e4, We = 150, He = 3e3, Ke = 600, $e = (n) => `nvr_replay_resume${n ? `:${n}` : ""}`, G = () => typeof navigator > "u" || navigator.onLine !== !1;
13
13
  function Be(n) {
14
14
  return typeof n.url != "string" || typeof fetch != "function" ? null : (f, a) => {
15
15
  const u = typeof n.getToken == "function" ? n.getToken() : void 0, d = { "Content-Type": "application/json" };
package/dist/index.d.ts CHANGED
@@ -1002,7 +1002,7 @@ export declare interface BannerLine {
1002
1002
  * banner AND anywhere else that ends up wanting the same sentence. */
1003
1003
  export declare function bannerLines(rows: Row[], now?: Date): BannerLine[];
1004
1004
 
1005
- export declare function BaseMap({ pins, bubbles, statusLine, onPinClick, onBubbleClick, minHeight, focus }: {
1005
+ export declare function BaseMap({ pins, bubbles, statusLine, onPinClick, onBubbleClick, minHeight, focus, clusterColor, dots, onDotClick }: {
1006
1006
  pins: BaseMapPin[];
1007
1007
  bubbles?: BaseMapBubble[];
1008
1008
  /** Bottom-left caption ("214 pinned · © OpenStreetMap"). */
@@ -1018,6 +1018,12 @@ export declare function BaseMap({ pins, bubbles, statusLine, onPinClick, onBubbl
1018
1018
  zoom?: number;
1019
1019
  nonce: number;
1020
1020
  } | null;
1021
+ /** Colour of a cluster disc from its pins (e.g. the worst child's); default: red when any
1022
+ * pin pulses, else the first pin's colour. */
1023
+ clusterColor?: (pins: BaseMapPin[]) => string;
1024
+ /** Extra point layer (see BaseMapDot). */
1025
+ dots?: BaseMapDot[];
1026
+ onDotClick?: (id: string) => void;
1021
1027
  }): JSX.Element;
1022
1028
 
1023
1029
  export declare interface BaseMapBubble {
@@ -1029,6 +1035,17 @@ export declare interface BaseMapBubble {
1029
1035
  color?: string;
1030
1036
  }
1031
1037
 
1038
+ /** A light point layer (heat / activity / people out) — never clustered, drawn under pins. */
1039
+ declare interface BaseMapDot {
1040
+ id: string;
1041
+ lat: number;
1042
+ lng: number;
1043
+ label: string;
1044
+ color: string;
1045
+ /** 0..1 — size and opacity. */
1046
+ weight?: number;
1047
+ }
1048
+
1032
1049
  export declare interface BaseMapPin {
1033
1050
  id: string;
1034
1051
  lat: number;
@@ -1065,6 +1082,12 @@ declare interface Blur {
1065
1082
  strength: number;
1066
1083
  }
1067
1084
 
1085
+ /** How the board reads and replaces the URL's query string. */
1086
+ declare interface BoardUrlAdapter {
1087
+ read: () => string;
1088
+ replace: (search: string) => void;
1089
+ }
1090
+
1068
1091
  export declare function BooleanField({ field, value, onChange, error, disabled, readOnly, inputId, errorId }: FieldComponentProps): JSX.Element;
1069
1092
 
1070
1093
  export declare function BroadcastView({ className }: {
@@ -1278,6 +1301,14 @@ declare type CascadeRule_2 = {
1278
1301
  on_unavailable?: CascadeSwapConfig;
1279
1302
  };
1280
1303
 
1304
+ /** Another filter's picks: rows of `collection` whose `field` is one of `values`. */
1305
+ declare interface CascadeSelection {
1306
+ collection: string;
1307
+ /** 'id' when the picks are row ids; otherwise the column the picks are values of (a display field). */
1308
+ field: string;
1309
+ values: Array<string | number>;
1310
+ }
1311
+
1281
1312
  /** A parent→child picker cascade. `on_unavailable` opts a rule into the
1282
1313
  * swap: when the USER changes the parent this session and a row's current
1283
1314
  * value is no longer offered under the new parent, the row is re-pointed to
@@ -2159,12 +2190,36 @@ declare interface ColumnPreset {
2159
2190
  columns: string[];
2160
2191
  }
2161
2192
 
2193
+ /**
2194
+ * Command Center — one live board answering "what is happening in the business right now":
2195
+ * where the work physically is (map), what's moving (flow, throughput, feed), what needs
2196
+ * someone (attention), who's on (people) and a one-line system status that hands off to the
2197
+ * Traffic Map (the machine's own board). Every number clicks through to its real surface.
2198
+ *
2199
+ * Structure: this shell owns the board state (state.tsx), the lenses in the URL (url-state.ts),
2200
+ * the person's prefs (board-prefs.ts), keyboard shortcuts, TV / full screen and the layout
2201
+ * (layout.ts arrangeBoard places the panel registry for the screen size); each panel is its own
2202
+ * module reading useCc() + useCcQuery(). The contract with the API is types.ts.
2203
+ *
2204
+ * Layout — "what needs someone right now" leads at every size:
2205
+ * ≥1800px three columns: Needs attention + Workload | map (+ live feed under it) | rail
2206
+ * ≥1280px map (+ feed) | rail opening with Needs attention, beside the map's top edge
2207
+ * <1280px one column: attention first, then the map (on a phone behind "Show map"), the rest
2208
+ *
2209
+ * Hosts: NivaroProvider + NavigationContext required. A wallboard link (`kiosk`) shows the
2210
+ * board read-only, always dark and in TV mode, with no prefs, no URL writes and no navigation.
2211
+ */
2162
2212
  export declare function CommandCenterView({
2163
- /** Geo collections offered in the map layer picker; first is the default. */
2164
- geoCollections, recordUrl }: {
2213
+ /** Fallback map collections when the instance has no Command Center config yet. */
2214
+ geoCollections, recordUrl, isAdmin, kiosk, urlAdapter }: {
2165
2215
  geoCollections?: string[];
2166
- /** Host route for a clicked pin's record — defaults to the admin shape. */
2216
+ /** Host route for a record — defaults to the admin shape. */
2167
2217
  recordUrl?: (collection: string, id: string) => string;
2218
+ isAdmin?: boolean;
2219
+ /** Wallboard link token (read-only board). */
2220
+ kiosk?: string | null;
2221
+ /** How the board reads/replaces the query string; default history.replaceState. */
2222
+ urlAdapter?: BoardUrlAdapter;
2168
2223
  }): JSX.Element;
2169
2224
 
2170
2225
  export declare function CommentPanel({ collection, item, title, defaultExpanded, queuedComments, onQueueComment }: {
@@ -2390,7 +2445,7 @@ export declare function dashboardPretendDownOptions(widgets: Array<{
2390
2445
  field?: string | null;
2391
2446
  }>, labels?: Record<string, string | null | undefined>): PretendDownOption[];
2392
2447
 
2393
- export declare function DataTable<T = Record<string, unknown>>({ columns, rows, rowKey, total, page, limit, isLoading, isError, errorMessage, sort, onSortChange, onPageChange, onRowClick, onRowContextMenu, searchValue, onSearchChange, searchPlaceholder, filterDefs, filterValues, onFilterChange, toolbarRight, emptyMessage, minBodyHeight, fillHeight, footer, hideFilterRow, nowrapCells, density, pinFirstColumn, columnPins, onColumnPinChange, columnFilterRow, hScrollProxy, selectedIds, onSelectionChange, rowClassName, rowDragProps, rowTitle, enterKey, rowGroups, collapsedGroups, onToggleGroup }: DataTableProps<T>): React_2.JSX.Element;
2448
+ export declare function DataTable<T = Record<string, unknown>>({ columns, rows, rowKey, total, page, limit, isLoading, isError, errorMessage, onRetry, sort, onSortChange, onPageChange, onRowClick, onRowContextMenu, searchValue, onSearchChange, searchPlaceholder, filterDefs, filterValues, onFilterChange, toolbarRight, emptyMessage, minBodyHeight, fillHeight, footer, hideFilterRow, nowrapCells, density, pinFirstColumn, columnPins, onColumnPinChange, columnFilterRow, hScrollProxy, selectedIds, onSelectionChange, rowClassName, rowDragProps, rowTitle, enterKey, rowGroups, collapsedGroups, onToggleGroup }: DataTableProps<T>): React_2.JSX.Element;
2394
2449
 
2395
2450
  export declare interface DataTableProps<T = Record<string, unknown>> {
2396
2451
  columns: Column<T>[];
@@ -2402,6 +2457,8 @@ export declare interface DataTableProps<T = Record<string, unknown>> {
2402
2457
  isLoading?: boolean;
2403
2458
  isError?: boolean;
2404
2459
  errorMessage?: string;
2460
+ /** Shown as "Try again" on the error banner. */
2461
+ onRetry?: () => void;
2405
2462
  sort?: string;
2406
2463
  onSortChange?: (sort: string) => void;
2407
2464
  onPageChange: (page: number) => void;
@@ -3377,10 +3434,18 @@ export declare interface FilterDef {
3377
3434
  }[];
3378
3435
  /** 'combobox' only: server-backed autocomplete. Called (debounced) with the search
3379
3436
  * text; overrides `options` when provided. */
3380
- loadOptions?: (search: string) => Promise<{
3437
+ loadOptions?: (search: string, context?: {
3438
+ narrowBy: CascadeSelection[];
3439
+ }) => Promise<{
3381
3440
  label: string;
3382
3441
  value: string;
3383
3442
  }[]>;
3443
+ /** What this facet's values are (rows of `collection` by `field`): other facets' options
3444
+ * cascade from its picks (Zone → its Regions). */
3445
+ cascade?: {
3446
+ collection: string;
3447
+ field: string;
3448
+ };
3384
3449
  /** 'combobox' only: allow selecting multiple values (filter matches ANY of them). */
3385
3450
  multi?: boolean;
3386
3451
  /** Options are narrowed to the viewer's restricted scope — renders an amber badge. */
@@ -10728,7 +10793,7 @@ declare interface TopicPresence {
10728
10793
  /** Install the listeners. Safe to call more than once. */
10729
10794
  export declare function trackActivity(): void;
10730
10795
 
10731
- export declare function TrafficMiniMap({ window: win, tone, href, refreshMs, className }: {
10796
+ export declare function TrafficMiniMap({ window: win, tone, href, refreshMs, className, onPickTime }: {
10732
10797
  window?: 60 | 300 | 900;
10733
10798
  tone?: 'auto' | 'dark';
10734
10799
  /** Where "Open" goes. An absolute URL (another app's admin) opens in a new tab; default
@@ -10736,6 +10801,9 @@ export declare function TrafficMiniMap({ window: win, tone, href, refreshMs, cla
10736
10801
  href?: string;
10737
10802
  refreshMs?: number;
10738
10803
  className?: string;
10804
+ /** When set, each lane's sparkline is a button: clicking a point (or Enter = the lane's
10805
+ * spike) hands back that minute — the Command Center rewinds to it. */
10806
+ onPickTime?: (ms: number) => void;
10739
10807
  }): JSX.Element | null;
10740
10808
 
10741
10809
  /**
@@ -1,168 +1,185 @@
1
- import { jsxs as w, jsx as h } from "react/jsx-runtime";
2
- import { useRef as j, useState as Y, useEffect as D, useMemo as _ } from "react";
3
- import { Plus as A, Minus as F } from "lucide-react";
4
- const l = 256, G = (i, c, p) => `https://tile.openstreetmap.org/${i}/${c}/${p}.png`;
5
- function y(i, c) {
6
- return (i + 180) / 360 * 2 ** c;
1
+ import { jsxs as b, jsx as h } from "react/jsx-runtime";
2
+ import { Plus as G, Minus as J } from "lucide-react";
3
+ import { useRef as E, useState as C, useEffect as R, useMemo as K } from "react";
4
+ const s = 256, Q = (c, d, p) => `https://tile.openstreetmap.org/${c}/${d}/${p}.png`;
5
+ function w(c, d) {
6
+ return (c + 180) / 360 * 2 ** d;
7
7
  }
8
- function b(i, c) {
9
- const p = i * Math.PI / 180;
10
- return (1 - Math.log(Math.tan(p) + 1 / Math.cos(p)) / Math.PI) / 2 * 2 ** c;
8
+ function y(c, d) {
9
+ const p = c * Math.PI / 180;
10
+ return (1 - Math.log(Math.tan(p) + 1 / Math.cos(p)) / Math.PI) / 2 * 2 ** d;
11
11
  }
12
- function S(i, c) {
13
- return i / 2 ** c * 360 - 180;
12
+ function T(c, d) {
13
+ return c / 2 ** d * 360 - 180;
14
14
  }
15
- function C(i, c) {
16
- const p = Math.PI - 2 * Math.PI * i / 2 ** c;
15
+ function D(c, d) {
16
+ const p = Math.PI - 2 * Math.PI * c / 2 ** d;
17
17
  return 180 / Math.PI * Math.atan(0.5 * (Math.exp(p) - Math.exp(-p)));
18
18
  }
19
- function tt({
20
- pins: i,
21
- bubbles: c = [],
19
+ function nt({
20
+ pins: c,
21
+ bubbles: d = [],
22
22
  statusLine: p,
23
- onPinClick: k,
24
- onBubbleClick: $,
25
- minHeight: W = 420,
26
- focus: u = null
23
+ onPinClick: P,
24
+ onBubbleClick: N,
25
+ minHeight: U = 420,
26
+ focus: m = null,
27
+ clusterColor: Y,
28
+ dots: Z = [],
29
+ onDotClick: k
27
30
  }) {
28
- const N = j(null), [a, X] = Y({ w: 800, h: 520 }), [U, z] = Y(null), L = j(null);
29
- D(() => {
30
- const t = N.current;
31
+ const L = E(null), [a, q] = C({ w: 800, h: 520 }), [B, z] = C(null), S = E(null);
32
+ R(() => {
33
+ const t = L.current;
31
34
  if (!t) return;
32
- const e = new ResizeObserver(() => X({ w: t.clientWidth, h: t.clientHeight }));
35
+ const e = new ResizeObserver(() => q({ w: t.clientWidth, h: t.clientHeight }));
33
36
  return e.observe(t), () => e.disconnect();
34
37
  }, []);
35
- const E = j(!1);
36
- D(() => {
37
- const t = [...i, ...c];
38
- if (E.current || t.length === 0) return;
39
- E.current = !0;
40
- const e = t.map((M) => M.lat), o = t.map((M) => M.lng), n = Math.min(...e), s = Math.max(...e), d = Math.min(...o), m = Math.max(...o), P = { lat: (n + s) / 2, lng: (d + m) / 2 };
38
+ const W = E(!1);
39
+ R(() => {
40
+ const t = [...c, ...d];
41
+ if (W.current || t.length === 0) return;
42
+ W.current = !0;
43
+ const e = t.map((M) => M.lat), o = t.map((M) => M.lng), n = Math.min(...e), r = Math.max(...e), i = Math.min(...o), u = Math.max(...o), $ = { lat: (n + r) / 2, lng: (i + u) / 2 };
41
44
  let x = 15;
42
45
  for (; x > 3; ) {
43
- const M = Math.abs(y(m, x) - y(d, x)) * l, V = Math.abs(b(n, x) - b(s, x)) * l;
44
- if (M < a.w * 0.85 && V < a.h * 0.85) break;
46
+ const M = Math.abs(w(u, x) - w(i, x)) * s, F = Math.abs(y(n, x) - y(r, x)) * s;
47
+ if (M < a.w * 0.85 && F < a.h * 0.85) break;
45
48
  x--;
46
49
  }
47
- z({ ...P, zoom: x });
48
- }, [i, c, a]), D(() => {
49
- u && z({ lat: u.lat, lng: u.lng, zoom: u.zoom ?? 8 });
50
- }, [u == null ? void 0 : u.nonce]);
51
- const r = U ?? { lat: 39.5, lng: -98.35, zoom: 4 }, f = y(r.lng, r.zoom), g = b(r.lat, r.zoom), R = [], v = 2 ** r.zoom, Z = Math.floor(f - a.w / 2 / l), q = Math.ceil(f + a.w / 2 / l), B = Math.max(0, Math.floor(g - a.h / 2 / l)), H = Math.min(v - 1, Math.ceil(g + a.h / 2 / l));
52
- for (let t = Z; t <= q; t++)
53
- for (let e = B; e <= H; e++) {
50
+ z({ ...$, zoom: x });
51
+ }, [c, d, a]), R(() => {
52
+ m && z({ lat: m.lat, lng: m.lng, zoom: m.zoom ?? 8 });
53
+ }, [m == null ? void 0 : m.nonce]);
54
+ const l = B ?? { lat: 39.5, lng: -98.35, zoom: 4 }, g = w(l.lng, l.zoom), f = y(l.lat, l.zoom), X = [], v = 2 ** l.zoom, H = Math.floor(g - a.w / 2 / s), O = Math.ceil(g + a.w / 2 / s), V = Math.max(0, Math.floor(f - a.h / 2 / s)), _ = Math.min(v - 1, Math.ceil(f + a.h / 2 / s));
55
+ for (let t = H; t <= O; t++)
56
+ for (let e = V; e <= _; e++) {
54
57
  const o = (t % v + v) % v;
55
- R.push({
56
- z: r.zoom,
58
+ X.push({
59
+ z: l.zoom,
57
60
  x: o,
58
61
  y: e,
59
- left: a.w / 2 + (t - f) * l,
60
- top: a.h / 2 + (e - g) * l
62
+ left: a.w / 2 + (t - g) * s,
63
+ top: a.h / 2 + (e - f) * s
61
64
  });
62
65
  }
63
- const T = (t, e) => ({
64
- x: a.w / 2 + (y(e, r.zoom) - f) * l,
65
- y: a.h / 2 + (b(t, r.zoom) - g) * l
66
- }), O = _(() => {
66
+ const I = (t, e) => ({
67
+ x: a.w / 2 + (w(e, l.zoom) - g) * s,
68
+ y: a.h / 2 + (y(t, l.zoom) - f) * s
69
+ }), A = K(() => {
67
70
  const e = /* @__PURE__ */ new Map();
68
- for (const o of i) {
69
- const { x: n, y: s } = T(o.lat, o.lng);
70
- if (n < -60 || n > a.w + 60 || s < -60 || s > a.h + 60) continue;
71
- const d = `${Math.round(n / 44)}:${Math.round(s / 44)}`, m = e.get(d) ?? { pins: [], sx: 0, sy: 0 };
72
- m.pins.push(o), m.sx += n, m.sy += s, e.set(d, m);
71
+ for (const o of c) {
72
+ const { x: n, y: r } = I(o.lat, o.lng);
73
+ if (n < -60 || n > a.w + 60 || r < -60 || r > a.h + 60) continue;
74
+ const i = `${Math.round(n / 44)}:${Math.round(r / 44)}`, u = e.get(i) ?? { pins: [], sx: 0, sy: 0 };
75
+ u.pins.push(o), u.sx += n, u.sy += r, e.set(i, u);
73
76
  }
74
77
  return [...e.values()].map((o) => ({
75
78
  pins: o.pins,
76
79
  x: o.sx / o.pins.length,
77
80
  y: o.sy / o.pins.length
78
81
  }));
79
- }, [i, r, f, g, a]), I = (t, e) => {
82
+ }, [c, l, g, f, a]), j = (t, e) => {
80
83
  z((o) => {
81
- const n = o ?? r, s = Math.max(2, Math.min(18, n.zoom + t));
82
- if (s === n.zoom) return n;
84
+ const n = o ?? l, r = Math.max(2, Math.min(18, n.zoom + t));
85
+ if (r === n.zoom) return n;
83
86
  if (e) {
84
- const d = y(n.lng, n.zoom) + (e.x - a.w / 2) / l, m = b(n.lat, n.zoom) + (e.y - a.h / 2) / l, P = 2 ** (s - n.zoom);
87
+ const i = w(n.lng, n.zoom) + (e.x - a.w / 2) / s, u = y(n.lat, n.zoom) + (e.y - a.h / 2) / s, $ = 2 ** (r - n.zoom);
85
88
  return {
86
- lng: S(d * P - (e.x - a.w / 2) / l, s),
87
- lat: C(m * P - (e.y - a.h / 2) / l, s),
88
- zoom: s
89
+ lng: T(i * $ - (e.x - a.w / 2) / s, r),
90
+ lat: D(u * $ - (e.y - a.h / 2) / s, r),
91
+ zoom: r
89
92
  };
90
93
  }
91
- return { ...n, zoom: s };
94
+ return { ...n, zoom: r };
92
95
  });
93
96
  };
94
- return /* @__PURE__ */ w(
97
+ return /* @__PURE__ */ b(
95
98
  "div",
96
99
  {
97
- ref: N,
100
+ ref: L,
98
101
  className: "relative h-full w-full cursor-grab overflow-hidden rounded-lg border border-slate-200 bg-slate-100 active:cursor-grabbing dark:border-border dark:bg-muted",
99
- style: { minHeight: W },
102
+ style: { minHeight: U },
100
103
  "data-base-map": !0,
101
104
  onPointerDown: (t) => {
102
- L.current = { x: t.clientX, y: t.clientY, lat: r.lat, lng: r.lng }, t.currentTarget.setPointerCapture(t.pointerId);
105
+ S.current = { x: t.clientX, y: t.clientY, lat: l.lat, lng: l.lng }, t.currentTarget.setPointerCapture(t.pointerId);
103
106
  },
104
107
  onPointerMove: (t) => {
105
- const e = L.current;
108
+ const e = S.current;
106
109
  if (!e) return;
107
- const o = (t.clientX - e.x) / l, n = (t.clientY - e.y) / l;
110
+ const o = (t.clientX - e.x) / s, n = (t.clientY - e.y) / s;
108
111
  z({
109
- zoom: r.zoom,
110
- lng: S(y(e.lng, r.zoom) - o, r.zoom),
111
- lat: C(b(e.lat, r.zoom) - n, r.zoom)
112
+ zoom: l.zoom,
113
+ lng: T(w(e.lng, l.zoom) - o, l.zoom),
114
+ lat: D(y(e.lat, l.zoom) - n, l.zoom)
112
115
  });
113
116
  },
114
117
  onPointerUp: () => {
115
- L.current = null;
118
+ S.current = null;
116
119
  },
117
120
  onWheel: (t) => {
118
121
  var o;
119
122
  t.preventDefault();
120
- const e = (o = N.current) == null ? void 0 : o.getBoundingClientRect();
121
- I(t.deltaY < 0 ? 1 : -1, e ? { x: t.clientX - e.left, y: t.clientY - e.top } : void 0);
123
+ const e = (o = L.current) == null ? void 0 : o.getBoundingClientRect();
124
+ j(
125
+ t.deltaY < 0 ? 1 : -1,
126
+ e ? { x: t.clientX - e.left, y: t.clientY - e.top } : void 0
127
+ );
122
128
  },
123
129
  children: [
124
- R.map((t) => /* @__PURE__ */ h(
130
+ X.map((t) => /* @__PURE__ */ h(
125
131
  "img",
126
132
  {
127
- src: G(t.z, t.x, t.y),
133
+ src: Q(t.z, t.x, t.y),
128
134
  alt: "",
129
135
  draggable: !1,
130
136
  className: "pointer-events-none absolute select-none",
131
- style: { left: t.left, top: t.top, width: l, height: l }
137
+ style: { left: t.left, top: t.top, width: s, height: s }
132
138
  },
133
139
  `${t.z}/${t.x}/${t.y}`
134
140
  )),
135
- c.map((t) => {
136
- const { x: e, y: o } = T(t.lat, t.lng);
141
+ d.map((t) => {
142
+ const { x: e, y: o } = I(t.lat, t.lng);
137
143
  if (e < -120 || e > a.w + 120 || o < -120 || o > a.h + 120) return null;
138
- const n = Math.min(56, 18 + Math.sqrt(t.count) * 7), s = t.color ?? "#00a5cc";
139
- return /* @__PURE__ */ w(
144
+ const n = Math.min(56, 18 + Math.sqrt(t.count) * 7), r = t.color ?? "#00a5cc";
145
+ return /* @__PURE__ */ b(
140
146
  "button",
141
147
  {
142
148
  type: "button",
143
- onClick: (d) => {
144
- d.stopPropagation(), $ == null || $(t.id);
149
+ onClick: (i) => {
150
+ i.stopPropagation(), N == null || N(t.id);
145
151
  },
146
- onPointerDown: (d) => d.stopPropagation(),
152
+ onPointerDown: (i) => i.stopPropagation(),
147
153
  className: "absolute z-[1] -translate-x-1/2 -translate-y-1/2",
148
154
  style: { left: e, top: o },
149
155
  "data-tip": `${t.label} — ${t.count} online`,
156
+ "aria-label": `${t.label}: ${t.count} online`,
150
157
  children: [
151
- /* @__PURE__ */ w(
158
+ /* @__PURE__ */ b(
152
159
  "span",
153
160
  {
154
161
  className: "flex items-center justify-center gap-0.5 rounded-full font-bold text-white",
155
162
  style: {
156
163
  width: n * 2,
157
164
  height: n * 2,
158
- background: `${s}45`,
159
- border: `2.5px dashed ${s}`,
160
- boxShadow: `0 0 0 3px ${s}22`,
165
+ background: `${r}45`,
166
+ border: `2.5px dashed ${r}`,
167
+ boxShadow: `0 0 0 3px ${r}22`,
161
168
  fontSize: Math.max(12, Math.min(18, n / 2)),
162
169
  textShadow: "0 1px 2px rgba(0,0,0,0.55)"
163
170
  },
164
171
  children: [
165
- /* @__PURE__ */ h("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ h("path", { d: "M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z" }) }),
172
+ /* @__PURE__ */ h(
173
+ "svg",
174
+ {
175
+ width: "12",
176
+ height: "12",
177
+ viewBox: "0 0 24 24",
178
+ fill: "currentColor",
179
+ "aria-hidden": "true",
180
+ children: /* @__PURE__ */ h("path", { d: "M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z" })
181
+ }
182
+ ),
166
183
  t.count
167
184
  ]
168
185
  }
@@ -171,7 +188,7 @@ function tt({
171
188
  "span",
172
189
  {
173
190
  className: "mt-0.5 block whitespace-nowrap text-center text-[10.5px] font-semibold",
174
- style: { color: s, textShadow: "0 0 3px #fff, 0 0 3px #fff" },
191
+ style: { color: r, textShadow: "0 0 3px #fff, 0 0 3px #fff" },
175
192
  children: t.label
176
193
  }
177
194
  )
@@ -180,27 +197,55 @@ function tt({
180
197
  `bubble-${t.id}`
181
198
  );
182
199
  }),
183
- O.map(
184
- (t) => t.pins.length === 1 ? /* @__PURE__ */ w(
200
+ Z.map((t) => {
201
+ const { x: e, y: o } = I(t.lat, t.lng);
202
+ if (e < -40 || e > a.w + 40 || o < -40 || o > a.h + 40) return null;
203
+ const n = Math.max(0.15, Math.min(1, t.weight ?? 0.6)), r = 6 + n * 10;
204
+ return /* @__PURE__ */ h(
205
+ "button",
206
+ {
207
+ type: "button",
208
+ onClick: (i) => {
209
+ i.stopPropagation(), k == null || k(t.id);
210
+ },
211
+ onPointerDown: (i) => i.stopPropagation(),
212
+ className: "absolute z-[1] -translate-x-1/2 -translate-y-1/2 rounded-full",
213
+ style: {
214
+ left: e,
215
+ top: o,
216
+ width: r * 2,
217
+ height: r * 2,
218
+ background: `${t.color}${Math.round(40 + n * 100).toString(16).padStart(2, "0")}`,
219
+ border: `1.5px solid ${t.color}`
220
+ },
221
+ "data-tip": t.label,
222
+ "aria-label": t.label
223
+ },
224
+ `dot-${t.id}`
225
+ );
226
+ }),
227
+ A.map(
228
+ (t) => t.pins.length === 1 ? /* @__PURE__ */ b(
185
229
  "button",
186
230
  {
187
231
  type: "button",
188
232
  onClick: (e) => {
189
- e.stopPropagation(), k == null || k(t.pins[0].id);
233
+ e.stopPropagation(), P == null || P(t.pins[0].id);
190
234
  },
191
235
  onPointerDown: (e) => e.stopPropagation(),
192
236
  className: "group absolute z-[2] -translate-x-1/2 -translate-y-full",
193
237
  style: { left: t.x, top: t.y },
194
238
  "data-tip": t.pins[0].label,
239
+ "aria-label": t.pins[0].label,
195
240
  children: [
196
241
  t.pins[0].pulse && /* @__PURE__ */ h(
197
242
  "span",
198
243
  {
199
- className: "absolute left-1/2 top-[10px] h-6 w-6 -translate-x-1/2 -translate-y-1/2 animate-ping rounded-full",
244
+ className: "absolute left-1/2 top-[10px] h-6 w-6 -translate-x-1/2 -translate-y-1/2 motion-safe:animate-ping rounded-full",
200
245
  style: { background: `${t.pins[0].color ?? "#ef4444"}66` }
201
246
  }
202
247
  ),
203
- /* @__PURE__ */ w("svg", { width: "24", height: "30", viewBox: "0 0 24 30", "aria-hidden": "true", className: "relative", children: [
248
+ /* @__PURE__ */ b("svg", { width: "24", height: "30", viewBox: "0 0 24 30", "aria-hidden": "true", className: "relative", children: [
204
249
  /* @__PURE__ */ h(
205
250
  "path",
206
251
  {
@@ -221,9 +266,9 @@ function tt({
221
266
  type: "button",
222
267
  onClick: (e) => {
223
268
  e.stopPropagation(), z({
224
- lat: C(g + (t.y - a.h / 2) / l, r.zoom),
225
- lng: S(f + (t.x - a.w / 2) / l, r.zoom),
226
- zoom: Math.min(18, r.zoom + 2)
269
+ lat: D(f + (t.y - a.h / 2) / s, l.zoom),
270
+ lng: T(g + (t.x - a.w / 2) / s, l.zoom),
271
+ zoom: Math.min(18, l.zoom + 2)
227
272
  });
228
273
  },
229
274
  onPointerDown: (e) => e.stopPropagation(),
@@ -231,35 +276,36 @@ function tt({
231
276
  style: {
232
277
  left: t.x,
233
278
  top: t.y,
234
- background: t.pins.some((e) => e.pulse) ? "#ef4444" : t.pins[0].color ?? "#00a5cc"
279
+ background: Y ? Y(t.pins) : t.pins.some((e) => e.pulse) ? "#ef4444" : t.pins[0].color ?? "#00a5cc"
235
280
  },
236
281
  "data-tip": `${t.pins.length} records — click to zoom`,
282
+ "aria-label": `${t.pins.length} records here — zoom in`,
237
283
  children: t.pins.length
238
284
  },
239
285
  `c-${t.pins[0].id}`
240
286
  )
241
287
  ),
242
- /* @__PURE__ */ w("div", { className: "absolute right-3 top-3 z-[3] flex flex-col overflow-hidden rounded-md border border-slate-200 bg-white shadow dark:border-border dark:bg-card", children: [
288
+ /* @__PURE__ */ b("div", { className: "absolute right-3 top-3 z-[3] flex flex-col overflow-hidden rounded-md border border-slate-200 bg-white shadow dark:border-border dark:bg-card", children: [
243
289
  /* @__PURE__ */ h(
244
290
  "button",
245
291
  {
246
292
  type: "button",
247
- onClick: () => I(1),
293
+ onClick: () => j(1),
248
294
  onPointerDown: (t) => t.stopPropagation(),
249
295
  className: "flex h-8 w-8 items-center justify-center text-slate-600 hover:bg-slate-50 dark:text-slate-300 dark:hover:bg-muted",
250
296
  "aria-label": "Zoom in",
251
- children: /* @__PURE__ */ h(A, { className: "h-4 w-4" })
297
+ children: /* @__PURE__ */ h(G, { className: "h-4 w-4" })
252
298
  }
253
299
  ),
254
300
  /* @__PURE__ */ h(
255
301
  "button",
256
302
  {
257
303
  type: "button",
258
- onClick: () => I(-1),
304
+ onClick: () => j(-1),
259
305
  onPointerDown: (t) => t.stopPropagation(),
260
306
  className: "flex h-8 w-8 items-center justify-center border-t border-slate-100 text-slate-600 hover:bg-slate-50 dark:border-border dark:text-slate-300 dark:hover:bg-muted",
261
307
  "aria-label": "Zoom out",
262
- children: /* @__PURE__ */ h(F, { className: "h-4 w-4" })
308
+ children: /* @__PURE__ */ h(J, { className: "h-4 w-4" })
263
309
  }
264
310
  )
265
311
  ] }),
@@ -269,5 +315,5 @@ function tt({
269
315
  );
270
316
  }
271
317
  export {
272
- tt as BaseMap
318
+ nt as BaseMap
273
319
  };