@mt-gloss/ui 0.0.18 → 0.0.19

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/index.js CHANGED
@@ -1,15 +1,15 @@
1
- import { N as Xt, T as Jt, O as ea, Q as ta, b2 as aa, av as ra, ad as na, Z as oa, aj as sa, K as ia, a4 as la, bl as da, P as ca, B as ua, a as ma, y as ga, H as pa, be as ba, F as ha, J as fa, A as va, z as Ca, bd as ya, E as Da, D as wa, bt as Na, b as Sa, C as Ta, L as xa, o as ka, a9 as Ia, aJ as _a, y as Pa, H as Ma, F as Ra, J as Fa, A as Oa, z as Aa, E as Ea, D as La, aX as Ba, a_ as Ga, aZ as $a, aY as Ha, a$ as za, ay as Ka, am as Wa, k as Za, m as Ya, aB as qa, a7 as Va, b4 as Ua, a5 as ja, bm as Qa, Y as Xa, bD as Ja, bC as er, bE as tr, al as ar, aM as rr, b6 as nr, bI as or, n as sr, ai as ir, bx as lr, bp as dr, a0 as cr, an as ur, a2 as mr, bw as gr, G as pr, d as br, bg as hr, a6 as fr, bF as vr, aP as Cr, r as yr, v as Dr, I as wr, g as Nr, as as Sr, bJ as Tr, M as xr, w as kr, U as Ir, X as _r, V as Pr, W as Mr, ao as Rr, bc as Fr, bL as Or, bH as Ar, ak as Er, t as Lr, bn as Br, aO as Gr, af as $r, aG as Hr, ac as zr, ah as Kr, aq as Wr, aN as Zr, a8 as Yr, ap as qr, c as Vr, R as Ur, j as jr, p as Qr, aD as Xr, bu as Jr, bv as en, ae as tn, aa as an, h as rn, x as nn, b3 as on, ab as sn, bK as ln, b8 as dn, bb as cn, b9 as un, ba as mn, i as gn, b5 as pn, bk as bn, S as hn, bh as fn, bi as vn, ar as Cn, b7 as yn, bM as Dn, ag as wn, s as Nn, bG as Sn, l as Tn, f as xn, q as kn, _ as In, $ as _n, a3 as Pn, bf as Mn, bs as Rn, bz as Fn, aw as On, ax as An, aK as En, aL as Ln, az as Bn, aA as Gn, aC as $n, aR as Hn, aS as zn, bB as Kn, bA as Wn, aU as Zn, aV as Yn, at as qn, au as Vn, b1 as Un, b0 as jn, aW as Qn, aH as Xn, aI as Jn, aT as eo, aE as to, aF as ao, u as ro, by as no, bo as oo, bq as so, br as io, aQ as lo, a1 as co, e as uo, bj as mo } from "./Expandable-B7Umnd4T.js";
2
- import { jsxs as R, jsx as c } from "react/jsx-runtime";
3
- import _, { useRef as O, useEffect as E, useState as M, useCallback as C, forwardRef as ge, useMemo as pe, createContext as be, useContext as he } from "react";
1
+ import { N as Xt, T as Jt, O as ea, Q as ta, b2 as aa, av as ra, ad as na, Z as oa, aj as sa, K as ia, a4 as la, bl as da, P as ca, B as ua, a as ma, y as ga, H as pa, be as ba, F as ha, J as fa, A as va, z as Ca, bd as ya, E as Da, D as wa, bt as Na, b as Sa, C as Ta, L as xa, o as ka, a9 as Ia, aJ as Pa, y as _a, H as Ma, F as Ra, J as Fa, A as Oa, z as Aa, E as Ea, D as La, aX as Ba, a_ as Ga, aZ as $a, aY as Ha, a$ as za, ay as Ka, am as Wa, k as Za, m as Ya, aB as qa, a7 as Va, b4 as Ua, a5 as ja, bm as Qa, Y as Xa, bD as Ja, bC as er, bE as tr, al as ar, aM as rr, b6 as nr, bI as or, n as sr, ai as ir, bx as lr, bp as dr, a0 as cr, an as ur, a2 as mr, bw as gr, G as pr, d as br, bg as hr, a6 as fr, bF as vr, aP as Cr, r as yr, v as Dr, I as wr, g as Nr, as as Sr, bJ as Tr, M as xr, w as kr, U as Ir, X as Pr, V as _r, W as Mr, ao as Rr, bc as Fr, bL as Or, bH as Ar, ak as Er, t as Lr, bn as Br, aO as Gr, af as $r, aG as Hr, ac as zr, ah as Kr, aq as Wr, aN as Zr, a8 as Yr, ap as qr, c as Vr, R as Ur, j as jr, p as Qr, aD as Xr, bu as Jr, bv as en, ae as tn, aa as an, h as rn, x as nn, b3 as on, ab as sn, bK as ln, b8 as dn, bb as cn, b9 as un, ba as mn, i as gn, b5 as pn, bk as bn, S as hn, bh as fn, bi as vn, ar as Cn, b7 as yn, bM as Dn, ag as wn, s as Nn, bG as Sn, l as Tn, f as xn, q as kn, _ as In, $ as Pn, a3 as _n, bf as Mn, bs as Rn, bz as Fn, aw as On, ax as An, aK as En, aL as Ln, az as Bn, aA as Gn, aC as $n, aR as Hn, aS as zn, bB as Kn, bA as Wn, aU as Zn, aV as Yn, at as qn, au as Vn, b1 as Un, b0 as jn, aW as Qn, aH as Xn, aI as Jn, aT as eo, aE as to, aF as ao, u as ro, by as no, bo as oo, bq as so, br as io, aQ as lo, a1 as co, e as uo, bj as mo } from "./Expandable-B7Umnd4T.js";
2
+ import { jsxs as R, jsx as u } from "react/jsx-runtime";
3
+ import P, { useRef as F, useEffect as A, useState as M, useCallback as v, forwardRef as ge, useMemo as pe, createContext as be, useContext as he } from "react";
4
4
  import { B as fe, U as j } from "./UIContext-C3E-k7HI.js";
5
5
  import { a as po, u as bo } from "./UIContext-C3E-k7HI.js";
6
6
  import { createPortal as ve } from "react-dom";
7
- import { DEFAULT_MARKET_PRESETS as fo, DEFAULT_PINNED as vo, PERIOD_OPTIONS as Co, ROLLING_OPTIONS as yo, TODAY_PRESET as Do, findPreset as wo, formatDateRange as No, formatMarketDates as So, formatTrend as To, formatValue as xo, generateMarketId as ko, getAllPresets as Io, getDateRangeForPreset as _o, getPresetLabel as Po, isInRange as Mo, isMarketActive as Ro, isSameDay as Fo, normalizePresetId as Oo, toUppercasePresetId as Ao } from "@mt-gloss/utils";
7
+ import { DEFAULT_MARKET_PRESETS as fo, DEFAULT_PINNED as vo, PERIOD_OPTIONS as Co, ROLLING_OPTIONS as yo, TODAY_PRESET as Do, findPreset as wo, formatDateRange as No, formatMarketDates as So, formatTrend as To, formatValue as xo, generateMarketId as ko, getAllPresets as Io, getDateRangeForPreset as Po, getPresetLabel as _o, isInRange as Mo, isMarketActive as Ro, isSameDay as Fo, normalizePresetId as Oo, toUppercasePresetId as Ao } from "@mt-gloss/utils";
8
8
  function st(e = {}) {
9
- const { enabled: t = !0, returnTo: r } = e, a = O(null);
10
- return E(() => {
9
+ const { enabled: t = !0, returnTo: r } = e, a = F(null);
10
+ return A(() => {
11
11
  t && (a.current = r || document.activeElement);
12
- }, [t, r]), E(() => () => {
12
+ }, [t, r]), A(() => () => {
13
13
  t && a.current && setTimeout(() => {
14
14
  a.current?.focus?.();
15
15
  }, 0);
@@ -24,62 +24,62 @@ function it(e) {
24
24
  orientation: o = "vertical",
25
25
  enabled: s = !0,
26
26
  isItemDisabled: d,
27
- onSelect: u,
27
+ onSelect: m,
28
28
  onEscape: g
29
- } = e, [b, S] = M(-1), p = r !== void 0 ? r : b, i = C(
30
- (m) => {
31
- r === void 0 && S(m), a?.(m);
29
+ } = e, [y, w] = M(-1), l = r !== void 0 ? r : y, i = v(
30
+ (c) => {
31
+ r === void 0 && w(c), a?.(c);
32
32
  },
33
33
  [r, a]
34
- ), h = C(() => t.map((m, D) => ({ item: m, index: D })).filter(({ item: m, index: D }) => !d?.(m, D)).map(({ index: m }) => m), [t, d]), T = C(
35
- (m, D) => {
36
- const v = h();
37
- if (v.length === 0) return -1;
38
- const I = v.indexOf(m);
34
+ ), f = v(() => t.map((c, D) => ({ item: c, index: D })).filter(({ item: c, index: D }) => !d?.(c, D)).map(({ index: c }) => c), [t, d]), N = v(
35
+ (c, D) => {
36
+ const h = f();
37
+ if (h.length === 0) return -1;
38
+ const I = h.indexOf(c);
39
39
  if (I === -1)
40
- return D === 1 ? v.find((L) => L > m) ?? (n ? v[0] : -1) : [...v].reverse().find((G) => G < m) ?? (n ? v[v.length - 1] : -1);
41
- let k = I + D;
42
- return n ? k = (k + v.length) % v.length : k = Math.max(0, Math.min(v.length - 1, k)), v[k];
40
+ return D === 1 ? h.find((E) => E > c) ?? (n ? h[0] : -1) : [...h].reverse().find((G) => G < c) ?? (n ? h[h.length - 1] : -1);
41
+ let x = I + D;
42
+ return n ? x = (x + h.length) % h.length : x = Math.max(0, Math.min(h.length - 1, x)), h[x];
43
43
  },
44
- [h, n]
45
- ), x = C(() => {
46
- const m = h();
47
- m.length > 0 && i(m[0]);
48
- }, [h, i]), f = C(() => {
49
- const m = h();
50
- m.length > 0 && i(m[m.length - 1]);
51
- }, [h, i]), w = C(() => {
52
- const m = T(p, 1);
53
- m !== -1 && i(m);
54
- }, [p, T, i]), N = C(() => {
55
- const m = T(p, -1);
56
- m !== -1 && i(m);
57
- }, [p, T, i]), l = C(() => {
44
+ [f, n]
45
+ ), k = v(() => {
46
+ const c = f();
47
+ c.length > 0 && i(c[0]);
48
+ }, [f, i]), b = v(() => {
49
+ const c = f();
50
+ c.length > 0 && i(c[c.length - 1]);
51
+ }, [f, i]), S = v(() => {
52
+ const c = N(l, 1);
53
+ c !== -1 && i(c);
54
+ }, [l, N, i]), T = v(() => {
55
+ const c = N(l, -1);
56
+ c !== -1 && i(c);
57
+ }, [l, N, i]), C = v(() => {
58
58
  i(-1);
59
- }, [i]), y = C(
60
- (m) => {
59
+ }, [i]), p = v(
60
+ (c) => {
61
61
  if (!s) return;
62
- const { key: D } = m, v = D === "ArrowUp" && (o === "vertical" || o === "both"), I = D === "ArrowDown" && (o === "vertical" || o === "both"), k = D === "ArrowLeft" && (o === "horizontal" || o === "both"), L = D === "ArrowRight" && (o === "horizontal" || o === "both");
63
- if (v || k) {
64
- m.preventDefault(), p === -1 ? f() : N();
62
+ const { key: D } = c, h = D === "ArrowUp" && (o === "vertical" || o === "both"), I = D === "ArrowDown" && (o === "vertical" || o === "both"), x = D === "ArrowLeft" && (o === "horizontal" || o === "both"), E = D === "ArrowRight" && (o === "horizontal" || o === "both");
63
+ if (h || x) {
64
+ c.preventDefault(), l === -1 ? b() : T();
65
65
  return;
66
66
  }
67
- if (I || L) {
68
- m.preventDefault(), p === -1 ? x() : w();
67
+ if (I || E) {
68
+ c.preventDefault(), l === -1 ? k() : S();
69
69
  return;
70
70
  }
71
71
  if (D === "Home") {
72
- m.preventDefault(), x();
72
+ c.preventDefault(), k();
73
73
  return;
74
74
  }
75
75
  if (D === "End") {
76
- m.preventDefault(), f();
76
+ c.preventDefault(), b();
77
77
  return;
78
78
  }
79
- if ((D === "Enter" || D === " ") && p >= 0 && p < t.length) {
80
- m.preventDefault();
81
- const G = t[p];
82
- d?.(G, p) || u?.(G, p);
79
+ if ((D === "Enter" || D === " ") && l >= 0 && l < t.length) {
80
+ c.preventDefault();
81
+ const G = t[l];
82
+ d?.(G, l) || m?.(G, l);
83
83
  return;
84
84
  }
85
85
  if (D === "Escape") {
@@ -90,26 +90,26 @@ function it(e) {
90
90
  [
91
91
  s,
92
92
  o,
93
- p,
93
+ l,
94
94
  t,
95
- x,
96
- f,
97
- w,
98
- N,
95
+ k,
96
+ b,
97
+ S,
98
+ T,
99
99
  d,
100
- u,
100
+ m,
101
101
  g
102
102
  ]
103
103
  );
104
104
  return {
105
- focusedIndex: p,
105
+ focusedIndex: l,
106
106
  setFocusedIndex: i,
107
- handleKeyDown: y,
108
- focusFirst: x,
109
- focusLast: f,
110
- focusNext: w,
111
- focusPrevious: N,
112
- resetFocus: l
107
+ handleKeyDown: p,
108
+ focusFirst: k,
109
+ focusLast: b,
110
+ focusNext: S,
111
+ focusPrevious: T,
112
+ resetFocus: C
113
113
  };
114
114
  }
115
115
  const K = (e) => {
@@ -231,7 +231,7 @@ function Te({
231
231
  overflowActions: o,
232
232
  onClose: s
233
233
  }) {
234
- const [d, u] = M(null), g = O(null), b = C(() => {
234
+ const [d, m] = M(null), g = F(null), y = v(() => {
235
235
  if (!t) return { ...J, top: 0, left: 0 };
236
236
  const i = t.getBoundingClientRect();
237
237
  return {
@@ -240,62 +240,62 @@ function Te({
240
240
  left: i.left
241
241
  };
242
242
  }, [t]);
243
- if (E(() => {
243
+ if (A(() => {
244
244
  if (!e) return;
245
- const i = (h) => {
246
- h.key === "Escape" && s();
245
+ const i = (f) => {
246
+ f.key === "Escape" && s();
247
247
  };
248
248
  return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
249
- }, [e, s]), E(() => {
249
+ }, [e, s]), A(() => {
250
250
  if (!e) return;
251
- const i = (h) => {
252
- g.current && !g.current.contains(h.target) && s();
251
+ const i = (f) => {
252
+ g.current && !g.current.contains(f.target) && s();
253
253
  };
254
254
  return document.addEventListener("pointerdown", i, !0), () => document.removeEventListener("pointerdown", i, !0);
255
255
  }, [e, s]), !e) return null;
256
- const S = o && o.length > 0, p = /* @__PURE__ */ R(
256
+ const w = o && o.length > 0, l = /* @__PURE__ */ R(
257
257
  "div",
258
258
  {
259
259
  ref: g,
260
260
  "data-status-chip-menu": r,
261
261
  role: "menu",
262
262
  "aria-label": "Status actions",
263
- style: b(),
263
+ style: y(),
264
264
  children: [
265
- /* @__PURE__ */ c(
265
+ /* @__PURE__ */ u(
266
266
  "button",
267
267
  {
268
268
  role: "menuitem",
269
269
  style: Ne(d === "__primary"),
270
- onMouseEnter: () => u("__primary"),
271
- onMouseLeave: () => u(null),
270
+ onMouseEnter: () => m("__primary"),
271
+ onMouseLeave: () => m(null),
272
272
  onClick: () => {
273
273
  a(r), s();
274
274
  },
275
275
  children: "Open in table"
276
276
  }
277
277
  ),
278
- /* @__PURE__ */ c(
278
+ /* @__PURE__ */ u(
279
279
  "button",
280
280
  {
281
281
  role: "menuitem",
282
282
  style: Y(d === "__graph"),
283
- onMouseEnter: () => u("__graph"),
284
- onMouseLeave: () => u(null),
283
+ onMouseEnter: () => m("__graph"),
284
+ onMouseLeave: () => m(null),
285
285
  onClick: () => {
286
286
  n(r), s();
287
287
  },
288
288
  children: "Show on graph"
289
289
  }
290
290
  ),
291
- S && /* @__PURE__ */ c("div", { style: Se }),
292
- S && o?.map((i) => /* @__PURE__ */ c(
291
+ w && /* @__PURE__ */ u("div", { style: Se }),
292
+ w && o?.map((i) => /* @__PURE__ */ u(
293
293
  "button",
294
294
  {
295
295
  role: "menuitem",
296
296
  style: Y(d === i.id),
297
- onMouseEnter: () => u(i.id),
298
- onMouseLeave: () => u(null),
297
+ onMouseEnter: () => m(i.id),
298
+ onMouseLeave: () => m(null),
299
299
  onClick: () => {
300
300
  i.onSelect(r), s();
301
301
  },
@@ -306,40 +306,42 @@ function Te({
306
306
  ]
307
307
  }
308
308
  );
309
- return ve(p, document.body);
309
+ return ve(l, document.body);
310
310
  }
311
311
  Te.displayName = "StatusSlotChipMenu";
312
312
  const xe = ge(
313
- function({ state: t, onPointerDown: r, onPointerUp: a, edge: n = "right", ariaLabel: o = "Resize card" }, s) {
314
- const d = t === "handle-visible" || t === "dragging", u = (b) => {
313
+ function({ state: t, onPointerDown: r, onPointerUp: a, onPointerEnter: n, onPointerLeave: o, edge: s = "right", ariaLabel: d = "Resize card" }, m) {
314
+ const g = t === "handle-visible" || t === "dragging", y = (l) => {
315
315
  try {
316
- b.currentTarget.setPointerCapture(b.pointerId);
316
+ l.currentTarget.setPointerCapture(l.pointerId);
317
317
  } catch {
318
318
  }
319
- r(b);
320
- }, g = (b) => {
319
+ r(l);
320
+ }, w = (l) => {
321
321
  try {
322
- b.currentTarget.hasPointerCapture?.(b.pointerId) && b.currentTarget.releasePointerCapture(b.pointerId);
322
+ l.currentTarget.hasPointerCapture?.(l.pointerId) && l.currentTarget.releasePointerCapture(l.pointerId);
323
323
  } catch {
324
324
  }
325
- a(b);
325
+ a(l);
326
326
  };
327
- return /* @__PURE__ */ c(
327
+ return /* @__PURE__ */ u(
328
328
  "button",
329
329
  {
330
- ref: s,
330
+ ref: m,
331
331
  type: "button",
332
- "aria-label": o,
333
- "data-edge": n,
332
+ "aria-label": d,
333
+ "data-edge": s,
334
334
  "data-resize-state": t,
335
335
  className: [
336
336
  "gloss-edge-handle",
337
- `gloss-edge-handle--${n}`,
338
- d ? "gloss-edge-handle--visible" : ""
337
+ `gloss-edge-handle--${s}`,
338
+ g ? "gloss-edge-handle--visible" : ""
339
339
  ].filter(Boolean).join(" "),
340
- onPointerDown: u,
341
- onPointerUp: g,
342
- tabIndex: d ? 0 : -1
340
+ onPointerDown: y,
341
+ onPointerUp: w,
342
+ onPointerEnter: n,
343
+ onPointerLeave: o,
344
+ tabIndex: g ? 0 : -1
343
345
  }
344
346
  );
345
347
  }
@@ -351,7 +353,7 @@ function ke({
351
353
  enterMs: r = 180,
352
354
  exitMs: a = 120
353
355
  }) {
354
- return /* @__PURE__ */ c(
356
+ return /* @__PURE__ */ u(
355
357
  "div",
356
358
  {
357
359
  "aria-hidden": "true",
@@ -375,57 +377,67 @@ function vt({
375
377
  enterMs: o = 180,
376
378
  exitMs: s = 120
377
379
  }) {
378
- const [d, u] = M("idle"), [g, b] = M(e), S = O(null), p = O(null), i = 180, h = C(() => {
379
- S.current && (clearTimeout(S.current), S.current = null);
380
- }, []), T = C(() => {
381
- u((l) => l !== "idle" ? l : (S.current = setTimeout(() => u("handle-visible"), n), "dwelling"));
382
- }, [n]), x = C(() => {
383
- h(), u((l) => l === "dwelling" || l === "handle-visible" ? "idle" : l);
384
- }, [h]), f = C(
385
- (l) => {
386
- u((y) => y !== "handle-visible" ? y : (p.current = l.clientX, "dragging"));
380
+ const [d, m] = M("idle"), [g, y] = M(e), w = F(null), l = F(null), i = F("idle");
381
+ A(() => {
382
+ i.current = d;
383
+ }, [d]);
384
+ const f = 180, N = v(() => {
385
+ w.current && (clearTimeout(w.current), w.current = null);
386
+ }, []), k = v(() => {
387
+ m((p) => p !== "idle" ? p : (w.current = setTimeout(() => m("handle-visible"), n), "dwelling"));
388
+ }, [n]), b = v(() => {
389
+ N(), m((p) => p === "dwelling" || p === "handle-visible" ? "idle" : p);
390
+ }, [N]), S = v(
391
+ (p) => {
392
+ i.current === "handle-visible" && (l.current = p.clientX, i.current = "dragging", m("dragging"));
387
393
  },
388
394
  []
389
- ), w = C(
390
- (l) => {
391
- u((y) => {
392
- if (y !== "dragging") return y;
393
- const m = l.clientX - (p.current ?? l.clientX), D = Math.round(m / i), v = Math.min(3, Math.max(1, e + D));
394
- if (v === e)
395
- return a?.(), "cancelled";
396
- const I = v > e ? "grow" : "shrink";
397
- return r({ direction: I, targetColSpan: v, mode: t ? "slot-fill" : "sparkline-fidelity" }), "committed";
398
- });
395
+ ), T = v(
396
+ (p) => {
397
+ if (i.current !== "dragging") return;
398
+ const c = p.clientX - (l.current ?? p.clientX), D = Math.round(c / f), h = Math.min(3, Math.max(1, e + D)), I = h !== e;
399
+ if (m(I ? "committed" : "cancelled"), I) {
400
+ const x = h > e ? "grow" : "shrink";
401
+ r({ direction: x, targetColSpan: h, mode: t ? "slot-fill" : "sparkline-fidelity" });
402
+ } else
403
+ a?.();
399
404
  },
400
405
  [e, t, r, a]
401
- ), N = C(() => {
402
- h(), u((l) => l === "dragging" || l === "handle-visible" ? (a?.(), "cancelled") : l);
403
- }, [h, a]);
404
- return E(() => {
406
+ ), C = v(() => {
407
+ N(), m((p) => p === "dragging" || p === "handle-visible" ? (a?.(), "cancelled") : p);
408
+ }, [N, a]);
409
+ return A(() => {
405
410
  if (d !== "dragging" && d !== "handle-visible") return;
406
- const l = (y) => {
407
- y.key === "Escape" && N();
411
+ const p = (c) => {
412
+ c.key === "Escape" && C();
408
413
  };
409
- return window.addEventListener("keydown", l), () => window.removeEventListener("keydown", l);
410
- }, [d, N]), E(() => {
414
+ return window.addEventListener("keydown", p), () => window.removeEventListener("keydown", p);
415
+ }, [d, C]), A(() => {
411
416
  if (d !== "dragging") {
412
- b(e);
417
+ y(e);
413
418
  return;
414
419
  }
415
- const l = (y) => {
416
- const m = y.clientX - (p.current ?? y.clientX), D = Math.round(m / i), v = Math.min(3, Math.max(1, e + D));
417
- b((I) => I === v ? I : v);
420
+ const p = (c) => {
421
+ const D = c.clientX - (l.current ?? c.clientX), h = Math.round(D / f), I = Math.min(3, Math.max(1, e + h));
422
+ y((x) => x === I ? x : I);
418
423
  };
419
- return window.addEventListener("pointermove", l), () => window.removeEventListener("pointermove", l);
420
- }, [d, e]), E(() => () => h(), [h]), E(() => {
424
+ return window.addEventListener("pointermove", p), () => window.removeEventListener("pointermove", p);
425
+ }, [d, e]), A(() => () => N(), [N]), A(() => {
421
426
  if (d !== "committed" && d !== "cancelled") return;
422
- const l = setTimeout(() => u("idle"), s);
423
- return () => clearTimeout(l);
427
+ const p = setTimeout(() => m("idle"), s);
428
+ return () => clearTimeout(p);
424
429
  }, [d, s]), {
425
430
  state: d,
426
- enterEdgeZone: T,
427
- leaveEdgeZone: x,
428
- handleProps: { onPointerDown: f, onPointerUp: w },
431
+ enterEdgeZone: k,
432
+ leaveEdgeZone: b,
433
+ handleProps: {
434
+ onPointerDown: S,
435
+ onPointerUp: T,
436
+ // Bug E: handle continues zone presence so pointer crossing sentinel→handle
437
+ // doesn't collapse state. handle's pointerenter = stay in zone.
438
+ onPointerEnter: k,
439
+ onPointerLeave: b
440
+ },
429
441
  previewColSpan: g,
430
442
  ghostProps: {
431
443
  visible: d === "dragging",
@@ -552,13 +564,13 @@ const Ct = {
552
564
  variant: "standard",
553
565
  label: "Total Revenue",
554
566
  isLoading: !0
555
- }, _e = {
567
+ }, Pe = {
556
568
  variant: "standard",
557
569
  label: "Total Revenue",
558
570
  value: 125430,
559
571
  valueFormat: { prefix: "$", abbreviated: !0 },
560
572
  isError: !0
561
- }, Pe = {
573
+ }, _e = {
562
574
  variant: "standard",
563
575
  label: "Total Revenue",
564
576
  value: null,
@@ -595,8 +607,8 @@ const Ct = {
595
607
  isStale: !0
596
608
  }, Dt = [
597
609
  Ie,
598
- _e,
599
610
  Pe,
611
+ _e,
600
612
  Me,
601
613
  Re,
602
614
  Fe
@@ -694,19 +706,19 @@ function ne({
694
706
  onCreatePage: s,
695
707
  onManagePages: d
696
708
  }) {
697
- const u = C(
698
- (p) => {
699
- o(p), t();
709
+ const m = v(
710
+ (l) => {
711
+ o(l), t();
700
712
  },
701
713
  [o, t]
702
- ), g = C(
703
- (p, i) => {
704
- (i.key === "Enter" || i.key === " ") && (i.preventDefault(), u(p));
714
+ ), g = v(
715
+ (l, i) => {
716
+ (i.key === "Enter" || i.key === " ") && (i.preventDefault(), m(l));
705
717
  },
706
- [u]
707
- ), b = C(() => {
718
+ [m]
719
+ ), y = v(() => {
708
720
  s(), t();
709
- }, [s, t]), S = C(() => {
721
+ }, [s, t]), w = v(() => {
710
722
  d(), t();
711
723
  }, [d, t]);
712
724
  return /* @__PURE__ */ R(
@@ -723,8 +735,8 @@ function ne({
723
735
  anchorRef: r,
724
736
  className: "gloss-page-dropdown",
725
737
  children: [
726
- /* @__PURE__ */ c("ul", { role: "menu", className: "gloss-page-dropdown__list", children: a.map((p) => {
727
- const i = p.id === n;
738
+ /* @__PURE__ */ u("ul", { role: "menu", className: "gloss-page-dropdown__list", children: a.map((l) => {
739
+ const i = l.id === n;
728
740
  return /* @__PURE__ */ R(
729
741
  "li",
730
742
  {
@@ -733,45 +745,45 @@ function ne({
733
745
  "aria-current": i ? "page" : void 0,
734
746
  tabIndex: 0,
735
747
  className: `gloss-page-dropdown__item${i ? " gloss-page-dropdown__item--active" : ""}`,
736
- onClick: () => u(p.id),
737
- onKeyDown: (h) => g(p.id, h),
748
+ onClick: () => m(l.id),
749
+ onKeyDown: (f) => g(l.id, f),
738
750
  children: [
739
- /* @__PURE__ */ c(
751
+ /* @__PURE__ */ u(
740
752
  "span",
741
753
  {
742
754
  className: `gloss-page-dropdown__dot${i ? " gloss-page-dropdown__dot--active" : ""}`
743
755
  }
744
756
  ),
745
- /* @__PURE__ */ c(
757
+ /* @__PURE__ */ u(
746
758
  "span",
747
759
  {
748
- className: `gloss-page-dropdown__name${p.named ? "" : " gloss-page-dropdown__name--unnamed"}`,
749
- children: p.name
760
+ className: `gloss-page-dropdown__name${l.named ? "" : " gloss-page-dropdown__name--unnamed"}`,
761
+ children: l.name
750
762
  }
751
763
  ),
752
- /* @__PURE__ */ c("span", { className: "gloss-page-dropdown__count", children: p.cardCount })
764
+ /* @__PURE__ */ u("span", { className: "gloss-page-dropdown__count", children: l.cardCount })
753
765
  ]
754
766
  },
755
- p.id
767
+ l.id
756
768
  );
757
769
  }) }),
758
- /* @__PURE__ */ c("hr", { className: "gloss-page-dropdown__separator" }),
759
- /* @__PURE__ */ c(
770
+ /* @__PURE__ */ u("hr", { className: "gloss-page-dropdown__separator" }),
771
+ /* @__PURE__ */ u(
760
772
  "button",
761
773
  {
762
774
  role: "menuitem",
763
775
  className: "gloss-page-dropdown__action",
764
- onClick: b,
776
+ onClick: y,
765
777
  children: "+ New page"
766
778
  }
767
779
  ),
768
- /* @__PURE__ */ c("hr", { className: "gloss-page-dropdown__separator" }),
769
- /* @__PURE__ */ c(
780
+ /* @__PURE__ */ u("hr", { className: "gloss-page-dropdown__separator" }),
781
+ /* @__PURE__ */ u(
770
782
  "button",
771
783
  {
772
784
  role: "menuitem",
773
785
  className: "gloss-page-dropdown__action gloss-page-dropdown__action--muted",
774
- onClick: S,
786
+ onClick: w,
775
787
  children: "Manage pages"
776
788
  }
777
789
  )
@@ -789,20 +801,20 @@ const Oe = function({
789
801
  onManagePages: s,
790
802
  maskRadius: d = "var(--gloss-radius-md)"
791
803
  }) {
792
- const u = O(null), [g, b] = M(!1), S = C(() => {
793
- b((h) => !h);
794
- }, []), p = C(() => {
795
- b(!1);
804
+ const m = F(null), [g, y] = M(!1), w = v(() => {
805
+ y((f) => !f);
806
+ }, []), l = v(() => {
807
+ y(!1);
796
808
  }, []), i = a[t]?.id ?? "";
797
809
  return /* @__PURE__ */ R(
798
810
  "div",
799
811
  {
800
812
  className: "gloss-page-chip",
801
- ref: u,
813
+ ref: m,
802
814
  style: { position: "absolute", top: 0, right: 0 },
803
815
  "data-page-chip": !0,
804
816
  children: [
805
- /* @__PURE__ */ c(
817
+ /* @__PURE__ */ u(
806
818
  "div",
807
819
  {
808
820
  className: "gloss-page-chip__nuzzle",
@@ -816,7 +828,7 @@ const Oe = function({
816
828
  "aria-haspopup": "menu",
817
829
  "aria-expanded": g,
818
830
  "aria-label": `Page ${t + 1} of ${r}. Click to switch pages.`,
819
- onClick: S,
831
+ onClick: w,
820
832
  children: [
821
833
  t + 1,
822
834
  " / ",
@@ -824,12 +836,12 @@ const Oe = function({
824
836
  ]
825
837
  }
826
838
  ),
827
- /* @__PURE__ */ c(
839
+ /* @__PURE__ */ u(
828
840
  ne,
829
841
  {
830
842
  open: g,
831
- onDismiss: p,
832
- anchorRef: u,
843
+ onDismiss: l,
844
+ anchorRef: m,
833
845
  pages: a,
834
846
  activePageId: i,
835
847
  onPageChange: n,
@@ -1118,7 +1130,7 @@ function oe(e) {
1118
1130
  function se(e) {
1119
1131
  return new Date(e).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
1120
1132
  }
1121
- const H = _.createElement("span", { style: { color: "var(--color-text-muted)" } }, "—"), _t = [
1133
+ const H = P.createElement("span", { style: { color: "var(--color-text-muted)" } }, "—"), Pt = [
1122
1134
  {
1123
1135
  field: "id",
1124
1136
  headerName: "Order",
@@ -1170,7 +1182,7 @@ const H = _.createElement("span", { style: { color: "var(--color-text-muted)" }
1170
1182
  cellClassName: "gloss-tabular-nums",
1171
1183
  renderCell: ({ row: e }) => e.date ? se(e.date) : ""
1172
1184
  }
1173
- ], Pt = [
1185
+ ], _t = [
1174
1186
  {
1175
1187
  field: "sku",
1176
1188
  headerName: "Item ID",
@@ -1486,11 +1498,11 @@ const H = _.createElement("span", { style: { color: "var(--color-text-muted)" }
1486
1498
  { id: "ytd", label: "YTD" },
1487
1499
  { id: "lytd", label: "LYTD" }
1488
1500
  ];
1489
- function F(e, t) {
1501
+ function O(e, t) {
1490
1502
  return {
1491
1503
  id: e,
1492
1504
  colSpan: 1,
1493
- content: _.createElement("div", {
1505
+ content: P.createElement("div", {
1494
1506
  style: {
1495
1507
  width: "100%",
1496
1508
  height: "100%",
@@ -1508,21 +1520,21 @@ function F(e, t) {
1508
1520
  }
1509
1521
  function te(e, t) {
1510
1522
  return {
1511
- ...F(e, t),
1523
+ ...O(e, t),
1512
1524
  colSpan: 2
1513
1525
  };
1514
1526
  }
1515
1527
  const zt = [
1516
- F("total-revenue", "Total Revenue"),
1517
- F("total-orders", "Total Orders"),
1528
+ O("total-revenue", "Total Revenue"),
1529
+ O("total-orders", "Total Orders"),
1518
1530
  te("revenue-trend", "Revenue Trend (2x)"),
1519
- F("avg-order", "Avg Order Value"),
1520
- F("new-customers", "New Customers"),
1521
- F("top-salesperson", "Top Salesperson"),
1531
+ O("avg-order", "Avg Order Value"),
1532
+ O("new-customers", "New Customers"),
1533
+ O("top-salesperson", "Top Salesperson"),
1522
1534
  te("order-trend", "Order Trend (2x)"),
1523
- F("repeat-rate", "Repeat Rate"),
1524
- F("open-orders", "Open Orders"),
1525
- F("shipped-orders", "Shipped Orders")
1535
+ O("repeat-rate", "Repeat Rate"),
1536
+ O("open-orders", "Open Orders"),
1537
+ O("shipped-orders", "Shipped Orders")
1526
1538
  ], Kt = {
1527
1539
  columns: 6,
1528
1540
  rowHeight: 120,
@@ -1546,7 +1558,7 @@ const zt = [
1546
1558
  totalPages: 3
1547
1559
  };
1548
1560
  function Z(e) {
1549
- return _.createElement("span", { style: { fontSize: 14 } }, e);
1561
+ return P.createElement("span", { style: { fontSize: 14 } }, e);
1550
1562
  }
1551
1563
  const Yt = [
1552
1564
  {
@@ -1638,14 +1650,14 @@ function He(e) {
1638
1650
  }
1639
1651
  const ze = function(t) {
1640
1652
  if (t.renderMode === "discrete")
1641
- return /* @__PURE__ */ c(
1653
+ return /* @__PURE__ */ u(
1642
1654
  "div",
1643
1655
  {
1644
1656
  className: "gloss-metric-group gloss-metric-group--discrete",
1645
1657
  style: { display: "contents" },
1646
1658
  children: t.cards.map((n) => {
1647
1659
  const o = V(n.size);
1648
- return /* @__PURE__ */ c(
1660
+ return /* @__PURE__ */ u(
1649
1661
  "div",
1650
1662
  {
1651
1663
  className: "gloss-metric-group__slot",
@@ -1680,7 +1692,7 @@ const ze = function(t) {
1680
1692
  "aria-label": a?.label,
1681
1693
  tabIndex: void 0,
1682
1694
  children: [
1683
- a?.accentColor && /* @__PURE__ */ c(
1695
+ a?.accentColor && /* @__PURE__ */ u(
1684
1696
  "div",
1685
1697
  {
1686
1698
  className: "gloss-metric-group__accent",
@@ -1688,8 +1700,8 @@ const ze = function(t) {
1688
1700
  }
1689
1701
  ),
1690
1702
  a?.label && /* @__PURE__ */ R("div", { className: "gloss-metric-group__label", children: [
1691
- /* @__PURE__ */ c("span", { children: a.label }),
1692
- a?.trend && /* @__PURE__ */ c(
1703
+ /* @__PURE__ */ u("span", { children: a.label }),
1704
+ a?.trend && /* @__PURE__ */ u(
1693
1705
  "span",
1694
1706
  {
1695
1707
  className: "gloss-metric-group__trend",
@@ -1698,7 +1710,7 @@ const ze = function(t) {
1698
1710
  }
1699
1711
  )
1700
1712
  ] }),
1701
- /* @__PURE__ */ c(
1713
+ /* @__PURE__ */ u(
1702
1714
  "div",
1703
1715
  {
1704
1716
  className: "gloss-metric-group__slots",
@@ -1709,7 +1721,7 @@ const ze = function(t) {
1709
1721
  },
1710
1722
  children: r.map((n) => {
1711
1723
  const o = V(n.size);
1712
- return /* @__PURE__ */ c(
1724
+ return /* @__PURE__ */ u(
1713
1725
  "div",
1714
1726
  {
1715
1727
  className: "gloss-metric-group__slot--composite",
@@ -1744,37 +1756,37 @@ function Ke({
1744
1756
  anchorEl: a,
1745
1757
  anchorSelector: n
1746
1758
  }) {
1747
- const [o, s] = _.useState(null), d = _.useMemo(
1759
+ const [o, s] = P.useState(null), d = P.useMemo(
1748
1760
  () => typeof window < "u" && window.matchMedia ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : !1,
1749
1761
  []
1750
1762
  );
1751
- _.useEffect(() => {
1763
+ P.useEffect(() => {
1752
1764
  !a && !n && (typeof process > "u" || process.env.NODE_ENV !== "production") && console.error(
1753
1765
  "[InlineNudge] requires anchorEl or anchorSelector. AP-07: Do not mount InlineNudge in Layout/** or _app.tsx."
1754
1766
  );
1755
- }, [a, n]), _.useLayoutEffect(() => {
1767
+ }, [a, n]), P.useLayoutEffect(() => {
1756
1768
  let g = null;
1757
1769
  if (a ? g = a : n && (g = document.querySelector(n)), g) {
1758
- const b = g.getBoundingClientRect();
1770
+ const y = g.getBoundingClientRect();
1759
1771
  s({
1760
- top: b.bottom + window.scrollY + 6,
1761
- left: b.left + window.scrollX
1772
+ top: y.bottom + window.scrollY + 6,
1773
+ left: y.left + window.scrollX
1762
1774
  });
1763
1775
  }
1764
1776
  }, [a, n]);
1765
- const u = o ? { top: o.top, left: o.left } : {};
1777
+ const m = o ? { top: o.top, left: o.left } : {};
1766
1778
  return /* @__PURE__ */ R(
1767
1779
  "div",
1768
1780
  {
1769
1781
  className: B["gloss-inline-nudge"],
1770
- style: u,
1782
+ style: m,
1771
1783
  role: "status",
1772
1784
  "aria-live": "polite",
1773
1785
  "data-reduced-motion": d ? "true" : void 0,
1774
1786
  children: [
1775
- /* @__PURE__ */ c("span", { className: B["gloss-inline-nudge__message"], children: e }),
1787
+ /* @__PURE__ */ u("span", { className: B["gloss-inline-nudge__message"], children: e }),
1776
1788
  /* @__PURE__ */ R("div", { className: B["gloss-inline-nudge__actions"], children: [
1777
- /* @__PURE__ */ c(
1789
+ /* @__PURE__ */ u(
1778
1790
  "button",
1779
1791
  {
1780
1792
  type: "button",
@@ -1783,7 +1795,7 @@ function Ke({
1783
1795
  children: t.label
1784
1796
  }
1785
1797
  ),
1786
- /* @__PURE__ */ c(
1798
+ /* @__PURE__ */ u(
1787
1799
  "button",
1788
1800
  {
1789
1801
  type: "button",
@@ -1816,70 +1828,70 @@ function Ze({
1816
1828
  max: a = 100,
1817
1829
  disabled: n = !1
1818
1830
  }) {
1819
- const o = O(null), [s, d] = M(null), [u, g] = M(e), b = O(e);
1820
- b.current !== e && (b.current = e, g(e));
1821
- const S = pe(() => We(u, r, a), [u, r, a]), p = C(
1822
- (f) => {
1831
+ const o = F(null), [s, d] = M(null), [m, g] = M(e), y = F(e);
1832
+ y.current !== e && (y.current = e, g(e));
1833
+ const w = pe(() => We(m, r, a), [m, r, a]), l = v(
1834
+ (b) => {
1823
1835
  if (!o.current) return r;
1824
- const w = o.current.getBoundingClientRect(), N = Math.max(0, Math.min(1, (f - w.left) / w.width)), l = r + N * (a - r);
1825
- return Math.round(l * 100) / 100;
1836
+ const S = o.current.getBoundingClientRect(), T = Math.max(0, Math.min(1, (b - S.left) / S.width)), C = r + T * (a - r);
1837
+ return Math.round(C * 100) / 100;
1826
1838
  },
1827
1839
  [r, a]
1828
- ), i = C(
1829
- (f, w) => {
1830
- const N = u.find((l) => l.id === w);
1831
- n || N?.disabled || (typeof f.currentTarget.setPointerCapture == "function" && f.currentTarget.setPointerCapture(f.pointerId), d(w));
1840
+ ), i = v(
1841
+ (b, S) => {
1842
+ const T = m.find((C) => C.id === S);
1843
+ n || T?.disabled || (typeof b.currentTarget.setPointerCapture == "function" && b.currentTarget.setPointerCapture(b.pointerId), d(S));
1832
1844
  },
1833
- [n, u]
1834
- ), h = C(
1835
- (f) => {
1845
+ [n, m]
1846
+ ), f = v(
1847
+ (b) => {
1836
1848
  if (!s) return;
1837
- const w = p(f.clientX);
1849
+ const S = l(b.clientX);
1838
1850
  g(
1839
- (N) => N.map((l) => l.id === s ? { ...l, value: w } : l)
1851
+ (T) => T.map((C) => C.id === s ? { ...C, value: S } : C)
1840
1852
  );
1841
1853
  },
1842
- [s, p]
1843
- ), T = C(
1844
- (f) => {
1854
+ [s, l]
1855
+ ), N = v(
1856
+ (b) => {
1845
1857
  if (!s) return;
1846
- const w = p(f.clientX), N = u.map(
1847
- (l) => l.id === s ? { ...l, value: w } : l
1858
+ const S = l(b.clientX), T = m.map(
1859
+ (C) => C.id === s ? { ...C, value: S } : C
1848
1860
  );
1849
- g(N), d(null), t(N);
1861
+ g(T), d(null), t(T);
1850
1862
  },
1851
- [s, p, u, t]
1852
- ), x = a - r || 1;
1853
- return /* @__PURE__ */ c("div", { className: "gloss-threshold-ramp", "data-disabled": n || void 0, children: /* @__PURE__ */ c(
1863
+ [s, l, m, t]
1864
+ ), k = a - r || 1;
1865
+ return /* @__PURE__ */ u("div", { className: "gloss-threshold-ramp", "data-disabled": n || void 0, children: /* @__PURE__ */ u(
1854
1866
  "div",
1855
1867
  {
1856
1868
  ref: o,
1857
1869
  className: "gloss-threshold-ramp__track",
1858
- style: { background: S },
1859
- onPointerMove: h,
1860
- onPointerUp: T,
1861
- onPointerLeave: T,
1862
- children: u.map((f) => {
1863
- const w = (f.value - r) / x * 100;
1864
- return /* @__PURE__ */ c(
1870
+ style: { background: w },
1871
+ onPointerMove: f,
1872
+ onPointerUp: N,
1873
+ onPointerLeave: N,
1874
+ children: m.map((b) => {
1875
+ const S = (b.value - r) / k * 100;
1876
+ return /* @__PURE__ */ u(
1865
1877
  "span",
1866
1878
  {
1867
1879
  className: "gloss-threshold-ramp__stop",
1868
1880
  style: {
1869
- left: `${w}%`,
1870
- color: le(f)
1881
+ left: `${S}%`,
1882
+ color: le(b)
1871
1883
  },
1872
- "data-disabled": f.disabled || void 0,
1873
- "data-dragging": s === f.id || void 0,
1874
- onPointerDown: (N) => i(N, f.id),
1875
- "aria-label": f.label ?? `Stop at ${f.value}`,
1884
+ "data-disabled": b.disabled || void 0,
1885
+ "data-dragging": s === b.id || void 0,
1886
+ onPointerDown: (T) => i(T, b.id),
1887
+ "aria-label": b.label ?? `Stop at ${b.value}`,
1876
1888
  role: "slider",
1877
- "aria-valuenow": f.value,
1889
+ "aria-valuenow": b.value,
1878
1890
  "aria-valuemin": r,
1879
1891
  "aria-valuemax": a,
1880
- tabIndex: f.disabled ? -1 : 0
1892
+ tabIndex: b.disabled ? -1 : 0
1881
1893
  },
1882
- f.id
1894
+ b.id
1883
1895
  );
1884
1896
  })
1885
1897
  }
@@ -1891,10 +1903,10 @@ function Ye() {
1891
1903
  return he(de);
1892
1904
  }
1893
1905
  function qe({ option: e }) {
1894
- const t = Ye(), r = t?.isSelected(e.value) ?? !1, a = e.disabled || t?.groupDisabled, n = C(() => {
1906
+ const t = Ye(), r = t?.isSelected(e.value) ?? !1, a = e.disabled || t?.groupDisabled, n = v(() => {
1895
1907
  a || t?.select(e.value);
1896
1908
  }, [a, t, e.value]), o = e.colorToken ? `var(--gloss-color-${e.colorToken}, ${e.color ?? "#888"})` : e.color ?? "#888";
1897
- return /* @__PURE__ */ c(
1909
+ return /* @__PURE__ */ u(
1898
1910
  "button",
1899
1911
  {
1900
1912
  type: "button",
@@ -1919,22 +1931,22 @@ function Ve({
1919
1931
  disabled: n = !1,
1920
1932
  name: o
1921
1933
  }) {
1922
- const s = t !== void 0, [d, u] = M(r), g = s ? t : d, b = C(
1934
+ const s = t !== void 0, [d, m] = M(r), g = s ? t : d, y = v(
1923
1935
  (i) => {
1924
- s || u(i), a?.(i);
1936
+ s || m(i), a?.(i);
1925
1937
  },
1926
1938
  [s, a]
1927
- ), S = C(
1939
+ ), w = v(
1928
1940
  (i) => g === i,
1929
1941
  [g]
1930
- ), p = {
1942
+ ), l = {
1931
1943
  selectedValue: g,
1932
- select: b,
1933
- isSelected: S,
1944
+ select: y,
1945
+ isSelected: w,
1934
1946
  groupDisabled: n,
1935
1947
  name: o
1936
1948
  };
1937
- return /* @__PURE__ */ c(de.Provider, { value: p, children: /* @__PURE__ */ c(
1949
+ return /* @__PURE__ */ u(de.Provider, { value: l, children: /* @__PURE__ */ u(
1938
1950
  "div",
1939
1951
  {
1940
1952
  className: "gloss-preset-swatch-row",
@@ -1942,7 +1954,7 @@ function Ve({
1942
1954
  "aria-label": o,
1943
1955
  "aria-disabled": n,
1944
1956
  "data-disabled": n || void 0,
1945
- children: e.map((i) => /* @__PURE__ */ c(qe, { option: i }, i.value))
1957
+ children: e.map((i) => /* @__PURE__ */ u(qe, { option: i }, i.value))
1946
1958
  }
1947
1959
  ) });
1948
1960
  }
@@ -1962,83 +1974,83 @@ function Ue(e, t, r) {
1962
1974
  return a.splice(r, 0, n), a;
1963
1975
  }
1964
1976
  function je(e) {
1965
- const [t, r] = M(() => e.zones), [a, n] = M(null), [o, s] = M(null), d = O(null), u = O(e.onZoneChange);
1966
- u.current = e.onZoneChange;
1967
- const g = C(
1968
- (h) => {
1969
- const T = h.active.id;
1970
- let x = null, f = null;
1971
- for (const w of t) {
1972
- const N = w.items.find((l) => l.id === T);
1973
- if (N) {
1974
- x = N, f = w.zoneKey;
1977
+ const [t, r] = M(() => e.zones), [a, n] = M(null), [o, s] = M(null), d = F(null), m = F(e.onZoneChange);
1978
+ m.current = e.onZoneChange;
1979
+ const g = v(
1980
+ (f) => {
1981
+ const N = f.active.id;
1982
+ let k = null, b = null;
1983
+ for (const S of t) {
1984
+ const T = S.items.find((C) => C.id === N);
1985
+ if (T) {
1986
+ k = T, b = S.zoneKey;
1975
1987
  break;
1976
1988
  }
1977
1989
  }
1978
- d.current = f, n(x), s(f);
1990
+ d.current = b, n(k), s(b);
1979
1991
  },
1980
1992
  [t]
1981
- ), b = C(
1982
- (h) => {
1983
- if (!h.over) {
1993
+ ), y = v(
1994
+ (f) => {
1995
+ if (!f.over) {
1984
1996
  s(d.current);
1985
1997
  return;
1986
1998
  }
1987
- const T = ae(t, h.over.id);
1988
- s(T);
1999
+ const N = ae(t, f.over.id);
2000
+ s(N);
1989
2001
  },
1990
2002
  [t]
1991
- ), S = C(
1992
- (h) => {
1993
- const { active: T, over: x } = h, f = () => {
2003
+ ), w = v(
2004
+ (f) => {
2005
+ const { active: N, over: k } = f, b = () => {
1994
2006
  d.current = null, n(null), s(null);
1995
2007
  };
1996
- if (!x) {
1997
- f();
2008
+ if (!k) {
2009
+ b();
1998
2010
  return;
1999
2011
  }
2000
- const w = U(t, T.id), N = ae(t, x.id);
2001
- if (!w || !N) {
2002
- f();
2012
+ const S = U(t, N.id), T = ae(t, k.id);
2013
+ if (!S || !T) {
2014
+ b();
2003
2015
  return;
2004
2016
  }
2005
- let l = t.map((y) => ({ ...y, items: [...y.items] }));
2006
- if (w === N) {
2007
- const y = l.findIndex((k) => k.zoneKey === w), m = l[y], D = m.items.findIndex((k) => k.id === T.id), v = m.items.findIndex((k) => k.id === x.id), I = v >= 0 ? v : m.items.length - 1;
2008
- l[y] = {
2009
- ...m,
2010
- items: Ue(m.items, D, I)
2017
+ let C = t.map((p) => ({ ...p, items: [...p.items] }));
2018
+ if (S === T) {
2019
+ const p = C.findIndex((x) => x.zoneKey === S), c = C[p], D = c.items.findIndex((x) => x.id === N.id), h = c.items.findIndex((x) => x.id === k.id), I = h >= 0 ? h : c.items.length - 1;
2020
+ C[p] = {
2021
+ ...c,
2022
+ items: Ue(c.items, D, I)
2011
2023
  };
2012
2024
  } else {
2013
- const y = l.findIndex((P) => P.zoneKey === w), m = l.findIndex((P) => P.zoneKey === N), D = l[y], v = l[m], I = D.items.find((P) => P.id === T.id), k = D.items.filter((P) => P.id !== T.id), L = v.items.findIndex((P) => P.id === x.id), G = L >= 0 ? L : v.items.length;
2014
- let Q = k, A = [...v.items];
2015
- if (v.maxItems !== void 0 && A.length >= v.maxItems) {
2016
- const P = A[A.length - 1];
2017
- A = A.slice(0, v.maxItems - 1), Q = [...k, P];
2025
+ const p = C.findIndex((_) => _.zoneKey === S), c = C.findIndex((_) => _.zoneKey === T), D = C[p], h = C[c], I = D.items.find((_) => _.id === N.id), x = D.items.filter((_) => _.id !== N.id), E = h.items.findIndex((_) => _.id === k.id), G = E >= 0 ? E : h.items.length;
2026
+ let Q = x, L = [...h.items];
2027
+ if (h.maxItems !== void 0 && L.length >= h.maxItems) {
2028
+ const _ = L[L.length - 1];
2029
+ L = L.slice(0, h.maxItems - 1), Q = [...x, _];
2018
2030
  }
2019
- const X = Math.min(G, A.length), me = [
2020
- ...A.slice(0, X),
2031
+ const X = Math.min(G, L.length), me = [
2032
+ ...L.slice(0, X),
2021
2033
  I,
2022
- ...A.slice(X)
2034
+ ...L.slice(X)
2023
2035
  ];
2024
- l[y] = { ...D, items: Q }, l[m] = { ...v, items: me };
2036
+ C[p] = { ...D, items: Q }, C[c] = { ...h, items: me };
2025
2037
  }
2026
- r(l), u.current?.(l), f();
2038
+ r(C), m.current?.(C), b();
2027
2039
  },
2028
2040
  [t]
2029
- ), p = C(
2030
- (h) => ({
2031
- id: h,
2032
- "data-zone-key": h
2041
+ ), l = v(
2042
+ (f) => ({
2043
+ id: f,
2044
+ "data-zone-key": f
2033
2045
  }),
2034
2046
  []
2035
- ), i = C(
2036
- (h) => {
2037
- const T = U(t, h.id) ?? "";
2047
+ ), i = v(
2048
+ (f) => {
2049
+ const N = U(t, f.id) ?? "";
2038
2050
  return {
2039
- id: h.id,
2040
- "data-item-id": h.id,
2041
- "data-zone-key": T
2051
+ id: f.id,
2052
+ "data-item-id": f.id,
2053
+ "data-zone-key": N
2042
2054
  };
2043
2055
  },
2044
2056
  [t]
@@ -2047,11 +2059,11 @@ function je(e) {
2047
2059
  zones: t,
2048
2060
  activeZone: o,
2049
2061
  activeItem: a,
2050
- getZoneProps: p,
2062
+ getZoneProps: l,
2051
2063
  getItemProps: i,
2052
2064
  handleDragStart: g,
2053
- handleDragOver: b,
2054
- handleDragEnd: S
2065
+ handleDragOver: y,
2066
+ handleDragEnd: w
2055
2067
  };
2056
2068
  }
2057
2069
  let $ = null, z = null, re = !1;
@@ -2074,16 +2086,16 @@ function Qe() {
2074
2086
  })(), z);
2075
2087
  }
2076
2088
  function Xe(e) {
2077
- const { zones: t, onZoneChange: r, renderZone: a, renderItem: n, renderDragOverlay: o } = e, s = je({ zones: t, onZoneChange: r }), [d, u] = _.useState($);
2078
- return _.useEffect(() => {
2089
+ const { zones: t, onZoneChange: r, renderZone: a, renderItem: n, renderDragOverlay: o } = e, s = je({ zones: t, onZoneChange: r }), [d, m] = P.useState($);
2090
+ return P.useEffect(() => {
2079
2091
  if (d) return;
2080
2092
  let g = !0;
2081
- return Qe().then((b) => {
2082
- g && u(b);
2093
+ return Qe().then((y) => {
2094
+ g && m(y);
2083
2095
  }), () => {
2084
2096
  g = !1;
2085
2097
  };
2086
- }, [d]), d ? /* @__PURE__ */ c(
2098
+ }, [d]), d ? /* @__PURE__ */ u(
2087
2099
  ce,
2088
2100
  {
2089
2101
  state: s,
@@ -2092,9 +2104,9 @@ function Xe(e) {
2092
2104
  renderItem: n,
2093
2105
  renderDragOverlay: o
2094
2106
  }
2095
- ) : /* @__PURE__ */ c("div", { "data-sortable-zones-passive": "true", children: s.zones.map((g) => {
2096
- const b = g.items.map((S) => /* @__PURE__ */ c(_.Fragment, { children: n(S) }, S.id));
2097
- return /* @__PURE__ */ c("div", { ...s.getZoneProps(g.zoneKey), children: a(g.zoneKey, g.items, b) }, g.zoneKey);
2107
+ ) : /* @__PURE__ */ u("div", { "data-sortable-zones-passive": "true", children: s.zones.map((g) => {
2108
+ const y = g.items.map((w) => /* @__PURE__ */ u(P.Fragment, { children: n(w) }, w.id));
2109
+ return /* @__PURE__ */ u("div", { ...s.getZoneProps(g.zoneKey), children: a(g.zoneKey, g.items, y) }, g.zoneKey);
2098
2110
  }) });
2099
2111
  }
2100
2112
  Xe.displayName = "SortableZones";
@@ -2105,64 +2117,64 @@ function ce({
2105
2117
  renderItem: a,
2106
2118
  renderDragOverlay: n
2107
2119
  }) {
2108
- const { core: o, sortable: s, utilities: d } = t, { DndContext: u, DragOverlay: g, useSensors: b, useSensor: S, PointerSensor: p, KeyboardSensor: i, closestCenter: h } = o, { SortableContext: T, verticalListSortingStrategy: x } = s, f = b(
2109
- S(p, { activationConstraint: { distance: 5 } }),
2110
- S(i)
2111
- ), w = u, N = g, l = T;
2120
+ const { core: o, sortable: s, utilities: d } = t, { DndContext: m, DragOverlay: g, useSensors: y, useSensor: w, PointerSensor: l, KeyboardSensor: i, closestCenter: f } = o, { SortableContext: N, verticalListSortingStrategy: k } = s, b = y(
2121
+ w(l, { activationConstraint: { distance: 5 } }),
2122
+ w(i)
2123
+ ), S = m, T = g, C = N;
2112
2124
  return /* @__PURE__ */ R(
2113
- w,
2125
+ S,
2114
2126
  {
2115
- sensors: f,
2116
- collisionDetection: h,
2127
+ sensors: b,
2128
+ collisionDetection: f,
2117
2129
  onDragStart: e.handleDragStart,
2118
2130
  onDragOver: e.handleDragOver,
2119
2131
  onDragEnd: e.handleDragEnd,
2120
2132
  children: [
2121
- e.zones.map((y) => {
2122
- const m = y.items.map((v) => v.id), D = y.items.map((v) => /* @__PURE__ */ c(
2133
+ e.zones.map((p) => {
2134
+ const c = p.items.map((h) => h.id), D = p.items.map((h) => /* @__PURE__ */ u(
2123
2135
  ue,
2124
2136
  {
2125
- id: v.id,
2137
+ id: h.id,
2126
2138
  useSortable: s.useSortable,
2127
2139
  cssHelper: d.CSS,
2128
- children: a(v)
2140
+ children: a(h)
2129
2141
  },
2130
- v.id
2142
+ h.id
2131
2143
  ));
2132
- return /* @__PURE__ */ c("div", { ...e.getZoneProps(y.zoneKey), children: /* @__PURE__ */ c(l, { items: m, strategy: x, children: r(y.zoneKey, y.items, D) }) }, y.zoneKey);
2144
+ return /* @__PURE__ */ u("div", { ...e.getZoneProps(p.zoneKey), children: /* @__PURE__ */ u(C, { items: c, strategy: k, children: r(p.zoneKey, p.items, D) }) }, p.zoneKey);
2133
2145
  }),
2134
- /* @__PURE__ */ c(N, { children: e.activeItem ? n?.(e.activeItem) ?? a(e.activeItem) : null })
2146
+ /* @__PURE__ */ u(T, { children: e.activeItem ? n?.(e.activeItem) ?? a(e.activeItem) : null })
2135
2147
  ]
2136
2148
  }
2137
2149
  );
2138
2150
  }
2139
2151
  ce.displayName = "SortableZonesInner";
2140
2152
  function ue({ id: e, useSortable: t, cssHelper: r, children: a }) {
2141
- const { attributes: n, listeners: o, setNodeRef: s, transform: d, transition: u, isDragging: g } = t({ id: e }), b = {
2153
+ const { attributes: n, listeners: o, setNodeRef: s, transform: d, transition: m, isDragging: g } = t({ id: e }), y = {
2142
2154
  transform: r?.Transform?.toString(d) ?? void 0,
2143
- transition: u,
2155
+ transition: m,
2144
2156
  opacity: g ? 0.5 : 1
2145
2157
  };
2146
- return /* @__PURE__ */ c("div", { ref: s, style: b, "data-sortable-item-id": e, ...n, ...o, children: a });
2158
+ return /* @__PURE__ */ u("div", { ref: s, style: y, "data-sortable-item-id": e, ...n, ...o, children: a });
2147
2159
  }
2148
2160
  ue.displayName = "SortableItem";
2149
- const Je = _.forwardRef(({ density: e = "compact", children: t, ...r }, a) => {
2161
+ const Je = P.forwardRef(({ density: e = "compact", children: t, ...r }, a) => {
2150
2162
  const n = { ...r };
2151
- return delete n.className, delete n.style, /* @__PURE__ */ c("div", { ref: a, className: "gloss-container-toolbar", role: "toolbar", ...n, children: /* @__PURE__ */ c(j, { region: "toolbar", density: e, children: t }) });
2163
+ return delete n.className, delete n.style, /* @__PURE__ */ u("div", { ref: a, className: "gloss-container-toolbar", role: "toolbar", ...n, children: /* @__PURE__ */ u(j, { region: "toolbar", density: e, children: t }) });
2152
2164
  });
2153
2165
  Je.displayName = "ContainerToolbar";
2154
- const et = _.forwardRef(({ legend: e, description: t, density: r = "default", children: a, ...n }, o) => {
2166
+ const et = P.forwardRef(({ legend: e, description: t, density: r = "default", children: a, ...n }, o) => {
2155
2167
  const s = { ...n };
2156
2168
  return delete s.className, delete s.style, /* @__PURE__ */ R("fieldset", { ref: o, className: "gloss-container-form-section", ...s, children: [
2157
- e && /* @__PURE__ */ c("legend", { className: "gloss-container-form-section__legend", children: e }),
2158
- t && /* @__PURE__ */ c("p", { className: "gloss-container-form-section__description", children: t }),
2159
- /* @__PURE__ */ c(j, { region: "form-section", density: r, children: a })
2169
+ e && /* @__PURE__ */ u("legend", { className: "gloss-container-form-section__legend", children: e }),
2170
+ t && /* @__PURE__ */ u("p", { className: "gloss-container-form-section__description", children: t }),
2171
+ /* @__PURE__ */ u(j, { region: "form-section", density: r, children: a })
2160
2172
  ] });
2161
2173
  });
2162
2174
  et.displayName = "ContainerFormSection";
2163
- const tt = _.forwardRef(({ density: e = "compact", children: t, ...r }, a) => {
2175
+ const tt = P.forwardRef(({ density: e = "compact", children: t, ...r }, a) => {
2164
2176
  const n = { ...r };
2165
- return delete n.className, delete n.style, /* @__PURE__ */ c("div", { ref: a, className: "gloss-container-table", ...n, children: /* @__PURE__ */ c(j, { region: "table", density: e, children: t }) });
2177
+ return delete n.className, delete n.style, /* @__PURE__ */ u("div", { ref: a, className: "gloss-container-table", ...n, children: /* @__PURE__ */ u(j, { region: "table", density: e, children: t }) });
2166
2178
  });
2167
2179
  tt.displayName = "ContainerTable";
2168
2180
  export {
@@ -2197,8 +2209,8 @@ export {
2197
2209
  xa as Chip,
2198
2210
  ka as ColorPicker,
2199
2211
  Ia as ComparisonCard,
2200
- _a as ContactForm,
2201
- Pa as ContainerCard,
2212
+ Pa as ContactForm,
2213
+ _a as ContainerCard,
2202
2214
  Ma as ContainerCardActions,
2203
2215
  Ra as ContainerCardBody,
2204
2216
  Fa as ContainerCardFooter,
@@ -2260,8 +2272,8 @@ export {
2260
2272
  xr as MaskPresets,
2261
2273
  kr as MaskedInput,
2262
2274
  Ir as Menu,
2263
- _r as MenuDivider,
2264
- Pr as MenuGroup,
2275
+ Pr as MenuDivider,
2276
+ _r as MenuGroup,
2265
2277
  Mr as MenuItem,
2266
2278
  Rr as MergePrompt,
2267
2279
  Fr as MetricCard,
@@ -2323,8 +2335,8 @@ export {
2323
2335
  xn as Toggle,
2324
2336
  kn as Tooltip,
2325
2337
  In as Transition,
2326
- _n as TransitionGroup,
2327
- Pn as TrendCard,
2338
+ Pn as TransitionGroup,
2339
+ _n as TrendCard,
2328
2340
  Mn as TrendIndicator,
2329
2341
  po as UIContext,
2330
2342
  j as UIContextProvider,
@@ -2351,11 +2363,11 @@ export {
2351
2363
  $n as destructiveModalMetadata,
2352
2364
  Hn as durations,
2353
2365
  zn as easings,
2354
- Pe as emptyFixture,
2366
+ _e as emptyFixture,
2355
2367
  Ce as entityChip,
2356
2368
  Be as entityNameActions,
2357
2369
  ct as entityTabGroup,
2358
- _e as errorFixture,
2370
+ Pe as errorFixture,
2359
2371
  Mt as filteredState,
2360
2372
  wo as findPreset,
2361
2373
  No as formatDateRange,
@@ -2366,16 +2378,16 @@ export {
2366
2378
  ko as generateMarketId,
2367
2379
  Kn as generateTabId,
2368
2380
  Io as getAllPresets,
2369
- _o as getDateRangeForPreset,
2381
+ Po as getDateRangeForPreset,
2370
2382
  Wn as getMenuActions,
2371
- Po as getPresetLabel,
2383
+ _o as getPresetLabel,
2372
2384
  Zn as getTransitionStyle,
2373
2385
  zt as gridCards,
2374
2386
  Yn as interpolate,
2375
2387
  Mo as isInRange,
2376
2388
  Ro as isMarketActive,
2377
2389
  Fo as isSameDay,
2378
- Pt as itemColumns,
2390
+ _t as itemColumns,
2379
2391
  It as itemRows,
2380
2392
  Ie as loadingFixture,
2381
2393
  qn as loginFormMetadata,
@@ -2388,7 +2400,7 @@ export {
2388
2400
  qt as mixedTabs,
2389
2401
  Oo as normalizePresetId,
2390
2402
  $e as numericActions,
2391
- _t as orderColumns,
2403
+ Pt as orderColumns,
2392
2404
  Ge as orderIdActions,
2393
2405
  kt as orderRows,
2394
2406
  Yt as ordersTabs,