@mt-gloss/ui 0.1.105 → 0.1.107

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.
@@ -1,18 +1,27 @@
1
- import { u as $, f as q, S as se, a as oe, g as E, c as A } from "./COMMITS-kaUvc5jL.js";
2
- import { C as Xe, b as Je, P as Ze, e as et, i as tt, r as nt, d as st } from "./COMMITS-kaUvc5jL.js";
3
- import { jsx as s, jsxs as p, Fragment as ae } from "react/jsx-runtime";
4
- import z, { useState as b, useRef as U, createContext as Y, useContext as K, useEffect as V, useLayoutEffect as re, useCallback as W } from "react";
5
- function le({ children: e }) {
1
+ import { u as k, f as Q, S as he, a as fe, g as A, c as T } from "./COMMITS-DG0Q_9DU.js";
2
+ import { C as Et, b as xt, P as At, e as Tt, i as Lt, r as Ot, d as kt } from "./COMMITS-DG0Q_9DU.js";
3
+ import { jsx as s, jsxs as h, Fragment as X } from "react/jsx-runtime";
4
+ import K, { useState as _, useRef as I, createContext as J, useContext as Z, useMemo as W, useEffect as x, useCallback as E, useLayoutEffect as ge } from "react";
5
+ import { useSensors as be, useSensor as q, PointerSensor as ve, KeyboardSensor as ye, DndContext as Se, closestCenter as _e } from "@dnd-kit/core";
6
+ import { sortableKeyboardCoordinates as Ne, SortableContext as Ce, horizontalListSortingStrategy as we, arrayMove as Pe, useSortable as Ee } from "@dnd-kit/sortable";
7
+ import { CSS as xe } from "@dnd-kit/utilities";
8
+ function ft() {
9
+ const e = k();
10
+ if (e?.state.activePanelId !== "settings") return null;
11
+ const t = e.state.activeTrigger;
12
+ return t?.kind === "card-overflow" ? t.cardId : null;
13
+ }
14
+ function Ae({ children: e }) {
6
15
  return /* @__PURE__ */ s("div", { className: "clone-stage", children: e });
7
16
  }
8
- function ie({ span: e, rotating: t = !0, children: o }) {
17
+ function Te({ span: e, rotating: t = !0, children: r }) {
9
18
  const n = ["clone-card", `span-${e}`, t ? "rotating" : ""].filter(Boolean).join(" ");
10
- return /* @__PURE__ */ s("div", { className: n, children: o });
19
+ return /* @__PURE__ */ s("div", { className: n, children: r });
11
20
  }
12
- function ce({ value: e, onChange: t }) {
13
- return /* @__PURE__ */ p("div", { className: "settings-shell__field settings-shell__field--threshold", children: [
21
+ function Le({ value: e, onChange: t }) {
22
+ return /* @__PURE__ */ h("div", { className: "settings-shell__field settings-shell__field--threshold", children: [
14
23
  /* @__PURE__ */ s("span", { className: "settings-shell__label", "aria-hidden": "true", children: "Alert level (%)" }),
15
- /* @__PURE__ */ p("div", { className: "settings-shell__slider-row", children: [
24
+ /* @__PURE__ */ h("div", { className: "settings-shell__slider-row", children: [
16
25
  /* @__PURE__ */ s(
17
26
  "input",
18
27
  {
@@ -29,17 +38,17 @@ function ce({ value: e, onChange: t }) {
29
38
  className: "settings-shell__slider"
30
39
  }
31
40
  ),
32
- /* @__PURE__ */ p("span", { className: "settings-shell__slider-value", "aria-live": "polite", children: [
41
+ /* @__PURE__ */ h("span", { className: "settings-shell__slider-value", "aria-live": "polite", children: [
33
42
  e,
34
43
  "%"
35
44
  ] })
36
45
  ] })
37
46
  ] });
38
47
  }
39
- function de({ value: e, onChange: t }) {
40
- return /* @__PURE__ */ p("div", { className: "settings-shell__field settings-shell__field--timeframe", children: [
48
+ function Oe({ value: e, onChange: t }) {
49
+ return /* @__PURE__ */ h("div", { className: "settings-shell__field settings-shell__field--timeframe", children: [
41
50
  /* @__PURE__ */ s("span", { className: "settings-shell__label", "aria-hidden": "true", children: "Rolling period (days)" }),
42
- /* @__PURE__ */ p("div", { className: "settings-shell__slider-row", children: [
51
+ /* @__PURE__ */ h("div", { className: "settings-shell__slider-row", children: [
43
52
  /* @__PURE__ */ s(
44
53
  "input",
45
54
  {
@@ -56,100 +65,423 @@ function de({ value: e, onChange: t }) {
56
65
  className: "settings-shell__slider"
57
66
  }
58
67
  ),
59
- /* @__PURE__ */ p("span", { className: "settings-shell__slider-value", "aria-live": "polite", children: [
68
+ /* @__PURE__ */ h("span", { className: "settings-shell__slider-value", "aria-live": "polite", children: [
60
69
  e,
61
70
  " days"
62
71
  ] })
63
72
  ] })
64
73
  ] });
65
74
  }
66
- const ue = ["Orders", "Quota", "Unassigned"];
67
- function pe() {
68
- return /* @__PURE__ */ p("div", { className: "settings-shell__field settings-shell__field--slots", "aria-label": "Stack slots (display only)", children: [
69
- /* @__PURE__ */ s("p", { className: "settings-shell__help", children: "Slots are currently fixed. Drag-to-reorder is coming in a later phase." }),
70
- /* @__PURE__ */ s("ul", { className: "settings-shell__slots-list", children: ue.map((e) => /* @__PURE__ */ s("li", { className: "settings-shell__slot-pill", children: e }, e)) })
75
+ function ke({ id: e, onRemove: t }) {
76
+ const { attributes: r, listeners: n, setNodeRef: c, transform: i, transition: d, isDragging: l } = Ee({ id: e }), a = {
77
+ transform: xe.Transform.toString(i),
78
+ transition: d,
79
+ opacity: l ? 0.6 : 1
80
+ };
81
+ return /* @__PURE__ */ h(
82
+ "li",
83
+ {
84
+ ref: c,
85
+ style: a,
86
+ className: `settings-shell__slot-pill${l ? " settings-shell__slot-pill--dragging" : ""}`,
87
+ children: [
88
+ /* @__PURE__ */ s(
89
+ "button",
90
+ {
91
+ type: "button",
92
+ className: "settings-shell__slot-pill__handle",
93
+ "aria-label": `Reorder ${e}`,
94
+ ...r,
95
+ ...n,
96
+ children: /* @__PURE__ */ s("span", { "aria-hidden": "true", className: "settings-shell__slot-pill__grip", children: "⋮⋮" })
97
+ }
98
+ ),
99
+ /* @__PURE__ */ s("span", { className: "settings-shell__slot-pill__label", children: e }),
100
+ /* @__PURE__ */ s(
101
+ "button",
102
+ {
103
+ type: "button",
104
+ className: "settings-shell__slot-pill__remove",
105
+ "aria-label": `Remove ${e}`,
106
+ onClick: t,
107
+ children: "×"
108
+ }
109
+ )
110
+ ]
111
+ }
112
+ );
113
+ }
114
+ function Ie({ value: e, onChange: t }) {
115
+ const r = be(
116
+ q(ve, { activationConstraint: { distance: 4 } }),
117
+ q(ye, { coordinateGetter: Ne })
118
+ ), n = (i) => {
119
+ const { active: d, over: l } = i;
120
+ if (!l || d.id === l.id) return;
121
+ const a = e.findIndex((u) => u === d.id), o = e.findIndex((u) => u === l.id);
122
+ a === -1 || o === -1 || t(Pe([...e], a, o));
123
+ }, c = (i) => {
124
+ t(e.filter((d) => d !== i));
125
+ };
126
+ return /* @__PURE__ */ h("div", { className: "settings-shell__field settings-shell__field--slots", "aria-label": "Stack slots", children: [
127
+ /* @__PURE__ */ s("span", { className: "settings-shell__label", children: "Stack slots" }),
128
+ /* @__PURE__ */ s(Se, { sensors: r, collisionDetection: _e, onDragEnd: n, children: /* @__PURE__ */ s(Ce, { items: [...e], strategy: we, children: /* @__PURE__ */ s("ul", { className: "settings-shell__slots-list", role: "list", children: e.map((i) => /* @__PURE__ */ s(ke, { id: i, onRemove: () => c(i) }, i)) }) }) }),
129
+ e.length === 0 && /* @__PURE__ */ s("p", { className: "settings-shell__help", children: "All slots removed. Apply to commit, or Reset to restore." }),
130
+ /* @__PURE__ */ s("p", { className: "settings-shell__help settings-shell__help--small", children: "Drag to reorder · click × to remove" })
71
131
  ] });
72
132
  }
73
- const me = ["#1d6fd8", "#10b981", "#f59e0b", "#ef4444", "#8b5cf6"];
74
- function he({ value: e, onSelect: t }) {
75
- return /* @__PURE__ */ p("div", { className: "settings-shell__field settings-shell__field--color", role: "group", "aria-label": "Accent color", children: [
133
+ const De = ["#1d6fd8", "#10b981", "#f59e0b", "#ef4444", "#8b5cf6"];
134
+ function Me({ value: e, onSelect: t }) {
135
+ return /* @__PURE__ */ h("div", { className: "settings-shell__field settings-shell__field--color", role: "group", "aria-label": "Accent color", children: [
76
136
  /* @__PURE__ */ s("span", { className: "settings-shell__label", children: "Accent color" }),
77
- /* @__PURE__ */ s("div", { className: "settings-shell__swatch-row", children: me.map((o) => {
78
- const n = e === o;
137
+ /* @__PURE__ */ s("div", { className: "settings-shell__swatch-row", children: De.map((r) => {
138
+ const n = e === r;
79
139
  return /* @__PURE__ */ s(
80
140
  "button",
81
141
  {
82
142
  type: "button",
83
143
  "aria-pressed": n,
84
- "aria-label": `Accent ${o}`,
144
+ "aria-label": `Accent ${r}`,
85
145
  className: `settings-shell__swatch${n ? " settings-shell__swatch--active" : ""}`,
86
- style: { backgroundColor: o },
87
- onClick: () => t(o)
146
+ style: { backgroundColor: r },
147
+ onClick: () => t(r)
88
148
  },
89
- o
149
+ r
90
150
  );
91
151
  }) })
92
152
  ] });
93
153
  }
94
- const fe = ["threshold", "timeframe", "color"];
95
- function Be({
154
+ const Re = ["Orders", "Quota", "Unassigned"], $e = ["threshold", "timeframe", "color"];
155
+ function gt({
96
156
  isOpen: e,
97
157
  cardSpan: t,
98
- cardLabel: o = "Metric",
158
+ cardLabel: r = "Metric",
99
159
  cardValue: n = "—",
100
- dimensions: r = fe,
101
- initialTab: l
160
+ previewSlot: c,
161
+ dimensions: i = $e,
162
+ initialTab: d,
163
+ initialValues: l
102
164
  }) {
103
- const d = $(), i = d?.state.activeTrigger, a = i?.kind === "card-overflow" ? i.cardId : null, c = q(), u = i?.span, h = t ?? u ?? 1, g = r[0] ?? "threshold", [f, y] = z.useState(l ?? g);
104
- z.useEffect(() => {
105
- r.includes(f) || y(g);
106
- }, [r, f, g]);
107
- const v = a != null ? d?.state?.bufferByCard?.[a]?.changes ?? {} : {}, N = typeof v.threshold == "number" ? v.threshold : 80, S = typeof v.timeframe == "number" ? v.timeframe : 30, w = typeof v.accent == "string" ? v.accent : null, C = (_) => {
108
- a == null || d == null || d.dispatch({ type: "SET_BUFFER_VALUE", cardId: a, key: "threshold", value: Number(_.target.value) });
109
- }, te = (_) => {
110
- a == null || d == null || d.dispatch({ type: "SET_BUFFER_VALUE", cardId: a, key: "timeframe", value: Number(_.target.value) });
111
- }, ne = (_) => {
112
- a == null || d == null || d.dispatch({ type: "SET_BUFFER_VALUE", cardId: a, key: "accent", value: _ });
165
+ const a = k(), o = a?.state.activeTrigger, u = o?.kind === "card-overflow" ? o.cardId : null, p = Q(), m = o?.span, b = t ?? m ?? 1, y = i[0] ?? "threshold", [v, N] = K.useState(d ?? y);
166
+ K.useEffect(() => {
167
+ i.includes(v) || N(y);
168
+ }, [i, v, y]);
169
+ const g = u != null ? a?.state?.bufferByCard?.[u]?.changes ?? {} : {}, S = typeof g.threshold == "number" ? g.threshold : typeof l?.threshold == "number" ? l.threshold : 80, oe = typeof g.timeframe == "number" ? g.timeframe : typeof l?.timeframe == "number" ? l.timeframe : 30, ie = typeof g.accent == "string" ? g.accent : typeof l?.accent == "string" ? l.accent : null, ce = Array.isArray(g.slots) ? g.slots : Array.isArray(l?.slots) ? l.slots : Re, de = (w) => {
170
+ u == null || a == null || a.dispatch({ type: "SET_BUFFER_VALUE", cardId: u, key: "threshold", value: Number(w.target.value) });
171
+ }, ue = (w) => {
172
+ u == null || a == null || a.dispatch({ type: "SET_BUFFER_VALUE", cardId: u, key: "timeframe", value: Number(w.target.value) });
173
+ }, pe = (w) => {
174
+ u == null || a == null || a.dispatch({ type: "SET_BUFFER_VALUE", cardId: u, key: "accent", value: w });
175
+ }, me = (w) => {
176
+ u == null || a == null || a.dispatch({ type: "SET_BUFFER_VALUE", cardId: u, key: "slots", value: w });
113
177
  };
114
- return /* @__PURE__ */ p("div", { className: "settings-shell", "data-shell": "settings", "aria-hidden": !e, children: [
115
- /* @__PURE__ */ s("div", { "aria-hidden": "true", children: /* @__PURE__ */ s(le, { children: /* @__PURE__ */ p(ie, { span: h, rotating: !c, children: [
116
- /* @__PURE__ */ s("div", { style: { fontSize: 9, textTransform: "uppercase", letterSpacing: "0.06em", color: "#9ca3af", marginBottom: 6 }, children: o }),
178
+ return /* @__PURE__ */ h("div", { className: "settings-shell", "data-shell": "settings", "aria-hidden": !e, children: [
179
+ /* @__PURE__ */ s("div", { "aria-hidden": "true", children: /* @__PURE__ */ s(Ae, { children: /* @__PURE__ */ s(Te, { span: b, rotating: !p, children: c ?? /* @__PURE__ */ h(X, { children: [
180
+ /* @__PURE__ */ s("div", { style: { fontSize: 9, textTransform: "uppercase", letterSpacing: "0.06em", color: "#9ca3af", marginBottom: 6 }, children: r }),
117
181
  /* @__PURE__ */ s("div", { style: { fontSize: 22, fontWeight: 700, color: "#111827", lineHeight: 1 }, children: n })
118
- ] }) }) }),
182
+ ] }) }) }) }),
119
183
  /* @__PURE__ */ s(
120
- se,
184
+ he,
121
185
  {
122
- dimensions: r,
123
- activeTab: f,
124
- onSelect: y,
125
- reduced: c
186
+ dimensions: i,
187
+ activeTab: v,
188
+ onSelect: N,
189
+ reduced: p
126
190
  }
127
191
  ),
128
- /* @__PURE__ */ p(
192
+ /* @__PURE__ */ h(
129
193
  "div",
130
194
  {
131
195
  role: "tabpanel",
132
- id: `settings-tabpanel-${f}`,
196
+ id: `settings-tabpanel-${v}`,
133
197
  "aria-label": "Settings dimension controls",
134
198
  tabIndex: 0,
135
199
  className: "settings-shell__tabpanel",
136
200
  children: [
137
- f === "threshold" && /* @__PURE__ */ s(ce, { value: N, onChange: C }),
138
- f === "timeframe" && /* @__PURE__ */ s(de, { value: S, onChange: te }),
139
- f === "slots" && /* @__PURE__ */ s(pe, {}),
140
- f === "color" && /* @__PURE__ */ s(he, { value: w, onSelect: ne })
201
+ v === "threshold" && /* @__PURE__ */ s(Le, { value: S, onChange: de }),
202
+ v === "timeframe" && /* @__PURE__ */ s(Oe, { value: oe, onChange: ue }),
203
+ v === "slots" && /* @__PURE__ */ s(Ie, { value: ce, onChange: me }),
204
+ v === "color" && /* @__PURE__ */ s(Me, { value: ie, onSelect: pe })
141
205
  ]
142
206
  }
143
207
  )
144
208
  ] });
145
209
  }
146
- function j({ lenses: e, activeLens: t, onLensChange: o }) {
147
- const [n, r] = b(!1), l = U(null), d = () => {
148
- l.current != null && (window.clearTimeout(l.current), l.current = null);
149
- }, i = () => {
150
- d(), l.current = window.setTimeout(() => r(!1), 100);
151
- }, a = e.filter((c) => c !== t);
152
- return /* @__PURE__ */ s("div", { className: "cat-segmented-wrap", children: /* @__PURE__ */ p("div", { className: "cat-segmented", children: [
210
+ const ee = [
211
+ "Overbought",
212
+ "What's selling",
213
+ "On track vs plan",
214
+ "Orders on time",
215
+ "Vendor performance",
216
+ "Assortment mix",
217
+ "Customer retention"
218
+ ], te = "Overbought", U = {
219
+ Overbought: {
220
+ headline: "Am I overbought?",
221
+ helper: "Find slow-moving inventory before discount cycles eat margin."
222
+ },
223
+ "What's selling": {
224
+ headline: "What's selling right now?",
225
+ helper: "Velocity leaders and sleepers across your assortment."
226
+ },
227
+ "On track vs plan": {
228
+ headline: "Am I on track vs plan?",
229
+ helper: "Pace-to-plan signals across revenue, units, and margin."
230
+ },
231
+ "Orders on time": {
232
+ headline: "Are orders going out on time?",
233
+ helper: "Fulfillment SLA performance and at-risk shipments."
234
+ },
235
+ "Vendor performance": {
236
+ headline: "Who are my best and worst vendors?",
237
+ helper: "Sell-through, lead time, and fill-rate across the vendor mix."
238
+ },
239
+ "Assortment mix": {
240
+ headline: "Is my assortment balanced?",
241
+ helper: "Brand and category mix concentration vs target ranges."
242
+ },
243
+ "Customer retention": {
244
+ headline: "Are my best customers coming back?",
245
+ helper: "Repeat-rate and lapsed-account signals from the buyer file."
246
+ }
247
+ };
248
+ U["Customer retention"].beta = !0;
249
+ const ne = {
250
+ Overbought: {
251
+ primary: [
252
+ {
253
+ id: "ob-units-at-risk",
254
+ label: "Units at risk",
255
+ value: "12,840",
256
+ desc: "Inventory units flagged as overbought relative to forward demand.",
257
+ variants: ["1×1"],
258
+ startHere: !0,
259
+ isNew: !0
260
+ },
261
+ {
262
+ id: "ob-weeks-of-supply",
263
+ label: "Weeks of supply",
264
+ value: "18.4",
265
+ desc: "Weighted average weeks of forward cover across the assortment.",
266
+ variants: ["1×1"]
267
+ },
268
+ {
269
+ id: "ob-discount-exposure",
270
+ label: "Discount exposure",
271
+ value: "$184K",
272
+ desc: "Estimated markdown dollars to clear excess at current sell-through.",
273
+ variants: ["1×3"],
274
+ subStats: [
275
+ { label: "MTD", value: "$48K" },
276
+ { label: "QTD", value: "$112K" },
277
+ { label: "YTD", value: "$184K" }
278
+ ]
279
+ }
280
+ ],
281
+ secondary: [
282
+ {
283
+ id: "ob-sku-coverage",
284
+ label: "SKUs over plan",
285
+ value: "342",
286
+ desc: "SKUs exceeding planned forward cover."
287
+ },
288
+ {
289
+ id: "ob-vendor-share",
290
+ label: "Top vendor share",
291
+ value: "38%",
292
+ desc: "Share of overbought inventory concentrated in the top vendor.",
293
+ donut: !0,
294
+ accent: "#7c3aed"
295
+ }
296
+ ]
297
+ },
298
+ "What's selling": {
299
+ primary: [
300
+ {
301
+ id: "ws-top-sku",
302
+ label: "Top SKU",
303
+ value: "SKU-9241",
304
+ desc: "Highest-velocity SKU over the trailing 7 days.",
305
+ startHere: !0
306
+ },
307
+ {
308
+ id: "ws-velocity",
309
+ label: "Velocity Δ",
310
+ value: "+12.4%",
311
+ desc: "Rolling 7-day velocity change versus the prior comparable period.",
312
+ variants: ["1×1"]
313
+ },
314
+ {
315
+ id: "ws-sellthrough",
316
+ label: "Sell-through",
317
+ value: "see breakdown",
318
+ variants: ["1×5"],
319
+ subStats: [
320
+ { label: "MTD", value: "64%" },
321
+ { label: "QTD", value: "71%" },
322
+ { label: "YTD", value: "68%" },
323
+ { label: "LYTD", value: "62%" },
324
+ { label: "7D", value: "74%" }
325
+ ],
326
+ desc: "Sell-through across multiple windows."
327
+ }
328
+ ],
329
+ secondary: [
330
+ {
331
+ id: "ws-new-arrivals",
332
+ label: "New arrival lift",
333
+ value: "+8.1%",
334
+ desc: "Velocity boost from new-arrival SKUs versus the assortment mean.",
335
+ isNew: !0
336
+ }
337
+ ]
338
+ },
339
+ "On track vs plan": {
340
+ primary: [
341
+ {
342
+ id: "pl-revenue-pace",
343
+ label: "Revenue pace",
344
+ value: "102%",
345
+ desc: "Revenue pace versus plan, period-to-date.",
346
+ donut: !0,
347
+ accent: "#16a34a",
348
+ startHere: !0
349
+ },
350
+ {
351
+ id: "pl-units-pace",
352
+ label: "Units pace",
353
+ value: "94%",
354
+ desc: "Units pace versus plan, period-to-date.",
355
+ donut: !0,
356
+ accent: "#f59e0b"
357
+ },
358
+ {
359
+ id: "pl-margin-pace",
360
+ label: "Margin pace",
361
+ value: "see breakdown",
362
+ variants: ["1×3"],
363
+ subStats: [
364
+ { label: "MTD", value: "38.4%" },
365
+ { label: "QTD", value: "37.9%" },
366
+ { label: "YTD", value: "38.1%" }
367
+ ],
368
+ desc: "Gross margin pace across multiple windows."
369
+ }
370
+ ]
371
+ },
372
+ "Orders on time": {
373
+ primary: [
374
+ {
375
+ id: "ot-on-time-rate",
376
+ label: "On-time rate",
377
+ value: "94.2%",
378
+ desc: "Share of orders shipped within SLA.",
379
+ startHere: !0
380
+ },
381
+ {
382
+ id: "ot-at-risk",
383
+ label: "At-risk shipments",
384
+ value: "18",
385
+ desc: "Open shipments projected to miss SLA.",
386
+ isNew: !0
387
+ }
388
+ ]
389
+ },
390
+ "Vendor performance": {
391
+ primary: [
392
+ {
393
+ id: "vp-top-vendor",
394
+ label: "Top vendor",
395
+ value: "Acme Co.",
396
+ desc: "Highest sell-through vendor over the trailing 30 days.",
397
+ startHere: !0
398
+ },
399
+ {
400
+ id: "vp-fill-rate",
401
+ label: "Fill rate",
402
+ value: "97.1%",
403
+ desc: "Vendor fill rate against placed orders.",
404
+ donut: !0,
405
+ accent: "#2563eb"
406
+ }
407
+ ]
408
+ },
409
+ "Assortment mix": {
410
+ primary: [
411
+ {
412
+ id: "am-brand-mix",
413
+ label: "Brand mix",
414
+ value: "see breakdown",
415
+ variants: ["1×3"],
416
+ subStats: [
417
+ { label: "Core", value: "58%" },
418
+ { label: "Growth", value: "27%" },
419
+ { label: "Test", value: "15%" }
420
+ ],
421
+ desc: "Assortment mix across brand tiers.",
422
+ startHere: !0
423
+ }
424
+ ]
425
+ },
426
+ "Customer retention": {
427
+ primary: [
428
+ {
429
+ id: "cr-repeat-rate",
430
+ label: "Repeat rate",
431
+ value: "62.4%",
432
+ desc: "Share of buyers placing two or more orders in the period.",
433
+ startHere: !0,
434
+ isNew: !0
435
+ },
436
+ {
437
+ id: "cr-lapsed",
438
+ label: "Lapsed accounts",
439
+ value: "47",
440
+ desc: "Accounts with zero orders in the last 90 days."
441
+ }
442
+ ]
443
+ }
444
+ };
445
+ function se({
446
+ lenses: e,
447
+ activeLens: t,
448
+ onLensChange: r,
449
+ variant: n = "pills",
450
+ lensMeta: c = U
451
+ }) {
452
+ return n === "pills" ? /* @__PURE__ */ s("div", { className: "cat-pills-wrap", children: /* @__PURE__ */ s("div", { className: "cat-pills", role: "tablist", "aria-label": "Metric lenses", children: e.map((i) => {
453
+ const d = i === t, l = c[i], a = ["cat-pill"];
454
+ return d && a.push("active"), /* @__PURE__ */ h(
455
+ "button",
456
+ {
457
+ type: "button",
458
+ role: "tab",
459
+ "aria-selected": d,
460
+ className: a.join(" "),
461
+ "data-lens": i,
462
+ onClick: () => {
463
+ d || r(i);
464
+ },
465
+ children: [
466
+ i,
467
+ l?.beta && /* @__PURE__ */ s("span", { className: "cat-pill-beta", "aria-label": "Beta", children: "BETA" })
468
+ ]
469
+ },
470
+ i
471
+ );
472
+ }) }) }) : /* @__PURE__ */ s(Fe, { lenses: e, activeLens: t, onLensChange: r });
473
+ }
474
+ function Fe({
475
+ lenses: e,
476
+ activeLens: t,
477
+ onLensChange: r
478
+ }) {
479
+ const [n, c] = _(!1), i = I(null), d = () => {
480
+ i.current != null && (window.clearTimeout(i.current), i.current = null);
481
+ }, l = () => {
482
+ d(), i.current = window.setTimeout(() => c(!1), 100);
483
+ }, a = e.filter((o) => o !== t);
484
+ return /* @__PURE__ */ s("div", { className: "cat-segmented-wrap", children: /* @__PURE__ */ h("div", { className: "cat-segmented", children: [
153
485
  /* @__PURE__ */ s(
154
486
  "button",
155
487
  {
@@ -160,14 +492,14 @@ function j({ lenses: e, activeLens: t, onLensChange: o }) {
160
492
  children: t
161
493
  }
162
494
  ),
163
- /* @__PURE__ */ p(
495
+ /* @__PURE__ */ h(
164
496
  "div",
165
497
  {
166
498
  className: "cat-seg-more",
167
499
  onMouseEnter: () => {
168
- d(), r(!0);
500
+ d(), c(!0);
169
501
  },
170
- onMouseLeave: i,
502
+ onMouseLeave: l,
171
503
  children: [
172
504
  /* @__PURE__ */ s("button", { type: "button", className: "cat-seg cat-seg-more-btn", "aria-haspopup": "menu", "aria-expanded": n, children: "More ▾" }),
173
505
  n && /* @__PURE__ */ s(
@@ -176,19 +508,19 @@ function j({ lenses: e, activeLens: t, onLensChange: o }) {
176
508
  className: "cat-seg-overflow",
177
509
  role: "menu",
178
510
  onMouseEnter: d,
179
- onMouseLeave: i,
180
- children: a.map((c) => /* @__PURE__ */ s(
511
+ onMouseLeave: l,
512
+ children: a.map((o) => /* @__PURE__ */ s(
181
513
  "button",
182
514
  {
183
515
  type: "button",
184
- "data-lens": c,
516
+ "data-lens": o,
185
517
  role: "menuitem",
186
518
  onClick: () => {
187
- o(c), r(!1);
519
+ r(o), c(!1);
188
520
  },
189
- children: c
521
+ children: o
190
522
  },
191
- c
523
+ o
192
524
  ))
193
525
  }
194
526
  )
@@ -197,48 +529,63 @@ function j({ lenses: e, activeLens: t, onLensChange: o }) {
197
529
  )
198
530
  ] }) });
199
531
  }
200
- function ge(e) {
201
- return e.split("·").map((t, o) => {
202
- const n = t.trim(), r = n.match(/^([$+\-]?[\d,]+(?:\.\d+)?[%+]?)\s*(.*)$/), l = r ? r[1] : "", d = r ? r[2] : n;
203
- return /* @__PURE__ */ p("span", { children: [
204
- /* @__PURE__ */ s("strong", { children: l }),
532
+ function He(e) {
533
+ return e.split("·").map((t, r) => {
534
+ const n = t.trim(), c = n.match(/^([$+\-]?[\d,]+(?:\.\d+)?[%+]?)\s*(.*)$/), i = c ? c[1] : "", d = c ? c[2] : n;
535
+ return /* @__PURE__ */ h("span", { children: [
536
+ /* @__PURE__ */ s("strong", { children: i }),
205
537
  /* @__PURE__ */ s("small", { children: d })
206
- ] }, o);
538
+ ] }, r);
207
539
  });
208
540
  }
209
- function G({ tiles: e, selectedTileId: t, onSelectTile: o }) {
541
+ function ze(e) {
542
+ return e.map((t, r) => /* @__PURE__ */ h("span", { children: [
543
+ /* @__PURE__ */ s("strong", { children: t.value }),
544
+ /* @__PURE__ */ s("small", { children: t.label })
545
+ ] }, r));
546
+ }
547
+ function H({ tiles: e, selectedTileId: t, onSelectTile: r }) {
210
548
  return /* @__PURE__ */ s("div", { className: "cat-tiles", children: e.map((n) => {
211
- const r = n.id === t, l = n.stack === !0, d = ["cat-tile"];
212
- return l && d.push("span-2"), r && d.push("selected"), /* @__PURE__ */ p(
549
+ const c = n.id === t, i = n.subStats != null && n.subStats.length > 0;
550
+ let d = null;
551
+ i ? n.subStats.length === 5 ? d = "span-5" : n.subStats.length === 3 ? d = "span-3" : d = "span-2" : n.stack === !0 && (d = "span-2");
552
+ const l = ["cat-tile"];
553
+ return d && l.push(d), c && l.push("selected"), n.isNew && l.push("is-new"), n.startHere && l.push("start-here"), n.donut && l.push("has-donut"), /* @__PURE__ */ h(
213
554
  "button",
214
555
  {
215
556
  type: "button",
216
- className: d.join(" "),
557
+ className: l.join(" "),
217
558
  "data-metric": n.id,
218
559
  "data-desc": n.desc,
219
- "aria-pressed": r,
220
- onClick: () => o(n.id, n.desc),
560
+ "data-donut": n.donut ? "true" : void 0,
561
+ "data-accent": n.accent,
562
+ "aria-pressed": c,
563
+ onClick: () => r(n.id, n.desc),
564
+ style: n.accent ? { "--cat-tile-accent": n.accent } : void 0,
221
565
  children: [
566
+ n.startHere && /* @__PURE__ */ s("span", { className: "cat-tile-start-here", "aria-hidden": "true", children: "START HERE" }),
222
567
  /* @__PURE__ */ s("span", { className: "cat-tile-label", children: n.label }),
223
- /* @__PURE__ */ s("span", { className: "cat-tile-value", children: l ? ge(n.value) : n.value }),
224
- n.variants && n.variants.length > 0 && /* @__PURE__ */ s("span", { className: "cat-tile-variants", "aria-hidden": "true", children: n.variants.map((i) => /* @__PURE__ */ s("span", { children: i }, i)) })
568
+ /* @__PURE__ */ s("span", { className: "cat-tile-value", children: i ? ze(n.subStats) : n.stack === !0 ? He(n.value) : n.value }),
569
+ n.variants && n.variants.length > 0 && /* @__PURE__ */ s("span", { className: "cat-tile-variants", "aria-hidden": "true", children: n.variants.map((a) => /* @__PURE__ */ s("span", { children: a }, a)) }),
570
+ n.isNew && /* @__PURE__ */ s("span", { className: "cat-tile-new-dot", "aria-hidden": "true" }),
571
+ n.donut && /* @__PURE__ */ s("span", { className: "cat-tile-donut", "aria-hidden": "true" })
225
572
  ]
226
573
  },
227
574
  n.id
228
575
  );
229
576
  }) });
230
577
  }
231
- const R = Y(null);
232
- function ve() {
233
- return K(R);
578
+ const V = J(null);
579
+ function Ue() {
580
+ return Z(V);
234
581
  }
235
- function be({ mode: e, dispatch: t }) {
236
- const o = ve();
237
- if (o == null && e == null) return null;
238
- const n = o?.mode ?? e ?? "add", r = o?.selectedTileId ?? null, l = o?.description ?? null, d = r == null;
239
- return /* @__PURE__ */ p("div", { className: "panel-footer catalog", children: [
240
- /* @__PURE__ */ s("div", { className: "cat-description", id: "cat-desc", children: l ?? /* @__PURE__ */ s("em", { children: "Tap a metric to see its description" }) }),
241
- /* @__PURE__ */ p("div", { style: { display: "flex", padding: "10px 14px", gap: 8 }, children: [
582
+ function Ve({ mode: e, dispatch: t }) {
583
+ const r = Ue();
584
+ if (r == null && e == null) return null;
585
+ const n = r?.mode ?? e ?? "add", c = r?.selectedTileId ?? null, i = r?.description ?? null, d = c == null;
586
+ return /* @__PURE__ */ h("div", { className: "panel-footer catalog", children: [
587
+ /* @__PURE__ */ s("div", { className: "cat-description", id: "cat-desc", children: i ?? /* @__PURE__ */ s("em", { children: "Tap a metric to see its description" }) }),
588
+ /* @__PURE__ */ h("div", { style: { display: "flex", padding: "10px 14px", gap: 8 }, children: [
242
589
  /* @__PURE__ */ s("div", { className: "spacer", style: { flex: 1 } }),
243
590
  /* @__PURE__ */ s(
244
591
  "button",
@@ -275,178 +622,150 @@ function be({ mode: e, dispatch: t }) {
275
622
  ] })
276
623
  ] });
277
624
  }
278
- const Q = [
279
- "Revenue",
280
- "Order flow",
281
- "Rep performance",
282
- "Brand portfolio",
283
- "Account coverage",
284
- "Commission"
285
- ], X = "Order flow", J = {
286
- Revenue: [
287
- { id: "rev-mtd", label: "Revenue MTD", value: "$184K", desc: "Month-to-date revenue across all manufacturers and territories." },
288
- { id: "rev-ytd", label: "Revenue YTD", value: "$2.1M", desc: "Year-to-date revenue including pending and posted orders.", variants: ["1×1", "1×3"] },
289
- { id: "rev-yoy", label: "YoY Δ", value: "+12.4%", desc: "Revenue growth versus the prior comparable period." },
290
- { id: "rev-avg", label: "Avg order", value: "$1,820", desc: "Average order value over the last 30 days." }
291
- ],
292
- "Order flow": [
293
- {
294
- id: "of-funnel",
295
- label: "Order funnel",
296
- value: "New 42 · Incomplete 18 · Transmitted 91",
297
- stack: !0,
298
- desc: "Funnel snapshot — new orders, incomplete (awaiting attention), and transmitted to manufacturer.",
299
- variants: ["1×3"]
300
- },
301
- { id: "of-incomplete", label: "Incomplete", value: "18", desc: "Orders started but not yet transmitted." },
302
- { id: "of-transmitted", label: "Transmitted", value: "91", desc: "Orders successfully sent to manufacturer." },
303
- { id: "of-today", label: "New today", value: "7", desc: "Orders created in the current calendar day." },
304
- { id: "of-velocity", label: "Order velocity", value: "+3.1/d", desc: "Rolling 7-day order-creation rate change." }
305
- ],
306
- "Rep performance": [
307
- { id: "rp-leader", label: "#1 Rep", value: "A. Chen", desc: "Top revenue performer in the current period." },
308
- { id: "rp-quota", label: "Below quota", value: "4 reps", desc: "Reps currently tracking below pace-to-quota." },
309
- { id: "rp-commission", label: "Commission pace", value: "$48K", desc: "Projected commission pool at current burn rate." },
310
- { id: "rp-active", label: "Active reps", value: "14", desc: "Reps with at least one order this period." }
311
- ],
312
- "Brand portfolio": [
313
- { id: "bp-top", label: "Top brand", value: "Acme Co.", desc: "Highest-revenue manufacturer this period." },
314
- { id: "bp-mix", label: "Mix Δ", value: "+2pp", desc: "Portfolio mix shift versus the prior period." },
315
- { id: "bp-coverage", label: "Brand coverage", value: "73%", desc: "Percent of accounts with at least one active brand." },
316
- { id: "bp-new", label: "New brand adds", value: "3", desc: "Brands with first-order activity this period." }
317
- ],
318
- "Account coverage": [
319
- { id: "ac-active", label: "Active accounts", value: "128", desc: "Accounts with at least one order in the period." },
320
- { id: "ac-untouched", label: "Untouched", value: "34", desc: "Accounts with zero activity in the period." },
321
- { id: "ac-concentration", label: "Concentration", value: "38% top-5", desc: "Revenue concentration in top-5 accounts." },
322
- { id: "ac-new", label: "New accounts", value: "6", desc: "Accounts with first-ever order this period." }
323
- ],
324
- Commission: [
325
- { id: "cm-projected", label: "Projected", value: "$48K", desc: "Forecast commission at current pace." },
326
- { id: "cm-paid", label: "Paid", value: "$31K", desc: "Commission posted to ledger this period." },
327
- { id: "cm-pending", label: "Pending", value: "$17K", desc: "Commission earned but not yet posted." },
328
- { id: "cm-rate", label: "Effective rate", value: "6.8%", desc: "Realized commission rate across all orders." }
329
- ]
330
- };
331
- function He({
625
+ function G(e, t) {
626
+ if (t.length === 0) return !0;
627
+ const r = t.toLowerCase();
628
+ if (e.label.toLowerCase().includes(r) || e.value.toLowerCase().includes(r)) return !0;
629
+ if (e.subStats) {
630
+ for (const n of e.subStats)
631
+ if (n.label.toLowerCase().includes(r) || n.value.toLowerCase().includes(r)) return !0;
632
+ }
633
+ return !1;
634
+ }
635
+ function bt({
332
636
  isOpen: e,
333
- lenses: t = Q,
334
- defaultLens: o = X,
335
- tilesByLens: n = J,
336
- footerSlot: r
637
+ lenses: t = ee,
638
+ defaultLens: r = te,
639
+ tilesByLens: n = ne,
640
+ lensMeta: c = U,
641
+ footerSlot: i
337
642
  }) {
338
- const [l, d] = b(o), [i, a] = b(null), [c, u] = b(null), h = n[l] ?? [];
339
- return /* @__PURE__ */ p(
340
- R.Provider,
643
+ const [d, l] = _(r), [a, o] = _(null), [u, p] = _(null), [m, b] = _(""), y = n[d] ?? { primary: [] }, v = c[d], N = W(
644
+ () => y.primary.filter((g) => G(g, m)),
645
+ [y.primary, m]
646
+ ), C = W(
647
+ () => (y.secondary ?? []).filter((g) => G(g, m)),
648
+ [y.secondary, m]
649
+ );
650
+ return /* @__PURE__ */ h(
651
+ V.Provider,
341
652
  {
342
- value: { mode: "add", selectedTileId: i, description: c },
653
+ value: { mode: "add", selectedTileId: a, description: u },
343
654
  children: [
344
- /* @__PURE__ */ p("div", { "data-shell": "catalog-add", "aria-hidden": !e, children: [
345
- /* @__PURE__ */ s("h3", { children: "Add a metric" }),
655
+ /* @__PURE__ */ h("div", { "data-shell": "catalog-add", "aria-hidden": !e, children: [
656
+ /* @__PURE__ */ s("div", { className: "cat-search", children: /* @__PURE__ */ s(
657
+ "input",
658
+ {
659
+ type: "search",
660
+ className: "cat-search-input",
661
+ placeholder: "Search metrics",
662
+ "aria-label": "Search metrics",
663
+ value: m,
664
+ onChange: (g) => b(g.target.value)
665
+ }
666
+ ) }),
346
667
  /* @__PURE__ */ s(
347
- j,
668
+ se,
348
669
  {
349
670
  lenses: t,
350
- activeLens: l,
671
+ activeLens: d,
672
+ lensMeta: c,
673
+ variant: "pills",
351
674
  onLensChange: (g) => {
352
- d(g), a(null), u(null);
675
+ l(g), o(null), p(null), b("");
353
676
  }
354
677
  }
355
678
  ),
679
+ v && /* @__PURE__ */ h("div", { className: "cat-lens-meta", children: [
680
+ /* @__PURE__ */ s("h3", { className: "cat-lens-headline", children: v.headline }),
681
+ /* @__PURE__ */ s("p", { className: "cat-lens-helper", children: v.helper })
682
+ ] }),
356
683
  /* @__PURE__ */ s(
357
- G,
684
+ H,
358
685
  {
359
- tiles: h,
360
- selectedTileId: i,
361
- onSelectTile: (g, f) => {
362
- a(g), u(f);
686
+ tiles: N,
687
+ selectedTileId: a,
688
+ onSelectTile: (g, S) => {
689
+ o(g), p(S);
363
690
  }
364
691
  }
365
- )
692
+ ),
693
+ C.length > 0 && /* @__PURE__ */ h("div", { className: "cat-more-in-lens", children: [
694
+ /* @__PURE__ */ s("div", { className: "cat-more-in-lens__heading", children: "MORE IN THIS LENS" }),
695
+ /* @__PURE__ */ s(
696
+ H,
697
+ {
698
+ tiles: C,
699
+ selectedTileId: a,
700
+ onSelectTile: (g, S) => {
701
+ o(g), p(S);
702
+ }
703
+ }
704
+ )
705
+ ] }),
706
+ N.length === 0 && C.length === 0 && m.length > 0 && /* @__PURE__ */ h("div", { className: "cat-empty", children: [
707
+ 'No metrics match "',
708
+ m,
709
+ '".'
710
+ ] })
366
711
  ] }),
367
- r
712
+ i
368
713
  ]
369
714
  }
370
715
  );
371
716
  }
372
- function qe({
717
+ function vt({
373
718
  isOpen: e,
374
719
  replacingLabel: t,
375
- lenses: o = Q,
376
- defaultLens: n = X,
377
- tilesByLens: r = J,
378
- footerSlot: l
720
+ lenses: r = ee,
721
+ defaultLens: n = te,
722
+ tilesByLens: c = ne,
723
+ footerSlot: i
379
724
  }) {
380
- const [d, i] = b(n), [a, c] = b(null), [u, h] = b(null), g = r[d] ?? [];
381
- return /* @__PURE__ */ p(
382
- R.Provider,
725
+ const [d, l] = _(n), [a, o] = _(null), [u, p] = _(null), m = c[d] ?? { primary: [] }, b = [...m.primary, ...m.secondary ?? []];
726
+ return /* @__PURE__ */ h(
727
+ V.Provider,
383
728
  {
384
729
  value: { mode: "replace", selectedTileId: a, description: u },
385
730
  children: [
386
- /* @__PURE__ */ p("div", { "data-shell": "catalog-replace", "aria-hidden": !e, children: [
387
- /* @__PURE__ */ s("h3", { children: "Replace metric" }),
388
- t && /* @__PURE__ */ p("p", { className: "cat-subtitle", children: [
731
+ /* @__PURE__ */ h("div", { "data-shell": "catalog-replace", "aria-hidden": !e, children: [
732
+ t && /* @__PURE__ */ h("p", { className: "cat-subtitle", children: [
389
733
  "replacing ",
390
734
  t
391
735
  ] }),
392
736
  /* @__PURE__ */ s(
393
- j,
737
+ se,
394
738
  {
395
- lenses: o,
739
+ lenses: r,
396
740
  activeLens: d,
397
- onLensChange: (f) => {
398
- i(f), c(null), h(null);
741
+ onLensChange: (y) => {
742
+ l(y), o(null), p(null);
399
743
  }
400
744
  }
401
745
  ),
402
746
  /* @__PURE__ */ s(
403
- G,
747
+ H,
404
748
  {
405
- tiles: g,
749
+ tiles: b,
406
750
  selectedTileId: a,
407
- onSelectTile: (f, y) => {
408
- c(f), h(y);
751
+ onSelectTile: (y, v) => {
752
+ o(y), p(v);
409
753
  }
410
754
  }
411
755
  )
412
756
  ] }),
413
- l
757
+ i
414
758
  ]
415
759
  }
416
760
  );
417
761
  }
418
- function ye({ page: e, onRename: t, onKebab: o, onDragStart: n }) {
419
- const r = ["pm-row"];
420
- return e.active && r.push("active"), /* @__PURE__ */ p("div", { className: r.join(" "), "data-page-id": e.id, role: "listitem", children: [
421
- /* @__PURE__ */ s(
422
- "div",
423
- {
424
- className: "pm-handle",
425
- "aria-hidden": "true",
426
- onMouseDown: () => n?.(e.id),
427
- children: "⋮⋮"
428
- }
429
- ),
430
- /* @__PURE__ */ s("div", { className: "pm-name", onClick: () => t?.(e.id), children: e.name }),
431
- /* @__PURE__ */ s(
432
- "button",
433
- {
434
- type: "button",
435
- className: "pm-kebab",
436
- "aria-label": "Page options",
437
- onClick: () => o?.(e.id),
438
- children: "⋯"
439
- }
440
- )
441
- ] });
762
+ const ae = J(null);
763
+ function re() {
764
+ return Z(ae);
442
765
  }
443
- const Z = Y(null);
444
- function Ce() {
445
- return K(Z);
446
- }
447
- function Pe(e = {}) {
448
- const o = Ce()?.setPages;
449
- return /* @__PURE__ */ p(
766
+ function Be(e = {}) {
767
+ const r = re()?.setPages;
768
+ return /* @__PURE__ */ h(
450
769
  "div",
451
770
  {
452
771
  className: "panel-footer pm",
@@ -460,7 +779,7 @@ function Pe(e = {}) {
460
779
  type: "button",
461
780
  className: "btn btn-primary",
462
781
  onClick: () => {
463
- o && o((n) => [
782
+ r && r((n) => [
464
783
  ...n,
465
784
  { id: `new-${Date.now()}`, name: "Untitled", active: !1 }
466
785
  ]);
@@ -472,38 +791,112 @@ function Pe(e = {}) {
472
791
  }
473
792
  );
474
793
  }
475
- const _e = [
794
+ function Ke({ page: e, onRename: t, onKebab: r, onDragStart: n }) {
795
+ const c = re(), [i, d] = _(!1), l = I(null);
796
+ x(() => {
797
+ if (!i) return;
798
+ const m = (b) => {
799
+ l.current && (l.current.contains(b.target) || d(!1));
800
+ };
801
+ return document.addEventListener("mousedown", m, !0), () => document.removeEventListener("mousedown", m, !0);
802
+ }, [i]);
803
+ const a = () => {
804
+ if (d(!1), t) return t(e.id);
805
+ if (!c?.renamePage) return;
806
+ const m = window.prompt("Rename page", e.name);
807
+ m != null && m.trim().length > 0 && c.renamePage(e.id, m.trim());
808
+ }, o = () => {
809
+ d(!1), c?.duplicatePage?.(e.id);
810
+ }, u = () => {
811
+ d(!1), !e.active && c?.deletePage?.(e.id);
812
+ }, p = ["pm-row"];
813
+ return e.active && p.push("active"), /* @__PURE__ */ h("div", { ref: l, className: p.join(" "), "data-page-id": e.id, role: "listitem", children: [
814
+ /* @__PURE__ */ s(
815
+ "div",
816
+ {
817
+ className: "pm-handle",
818
+ "aria-hidden": "true",
819
+ onMouseDown: () => n?.(e.id),
820
+ children: "⋮⋮"
821
+ }
822
+ ),
823
+ /* @__PURE__ */ s("div", { className: "pm-name", children: e.name }),
824
+ /* @__PURE__ */ s(
825
+ "button",
826
+ {
827
+ type: "button",
828
+ className: "pm-kebab",
829
+ "aria-label": "Page options",
830
+ "aria-haspopup": "menu",
831
+ "aria-expanded": i,
832
+ onClick: (m) => {
833
+ if (m.stopPropagation(), r) return r(e.id);
834
+ d((b) => !b);
835
+ },
836
+ children: "⋯"
837
+ }
838
+ ),
839
+ i && /* @__PURE__ */ h("div", { className: "pm-kebab-menu", role: "menu", "data-page-id": e.id, children: [
840
+ /* @__PURE__ */ s("button", { type: "button", role: "menuitem", className: "pm-kebab-menu__item", onClick: a, children: "Rename" }),
841
+ /* @__PURE__ */ s("button", { type: "button", role: "menuitem", className: "pm-kebab-menu__item", onClick: o, children: "Duplicate" }),
842
+ /* @__PURE__ */ s(
843
+ "button",
844
+ {
845
+ type: "button",
846
+ role: "menuitem",
847
+ className: "pm-kebab-menu__item pm-kebab-menu__item--danger",
848
+ onClick: u,
849
+ "aria-disabled": e.active,
850
+ children: "Delete"
851
+ }
852
+ )
853
+ ] })
854
+ ] });
855
+ }
856
+ const We = [
476
857
  { id: "p-pipeline", name: "My Pipeline", active: !0 },
477
858
  { id: "p-numbers", name: "My Numbers", active: !1 },
478
859
  { id: "p-morning", name: "My Morning", active: !1 },
479
860
  { id: "p-accounts", name: "My Accounts", active: !1 }
480
861
  ];
481
- function Ue({
862
+ function yt({
482
863
  isOpen: e,
483
- pages: t = _e,
484
- footerSlot: o
864
+ pages: t = We,
865
+ footerSlot: r
485
866
  }) {
486
- const [n, r] = b(() => [...t]);
487
- return /* @__PURE__ */ p(Z.Provider, { value: { pages: n, setPages: r }, children: [
488
- /* @__PURE__ */ p("div", { "data-shell": "page-management", "aria-hidden": !e, children: [
489
- /* @__PURE__ */ s("h3", { children: "Manage pages" }),
490
- /* @__PURE__ */ s("div", { className: "pm-list", role: "list", children: n.map((l) => /* @__PURE__ */ s(ye, { page: l }, l.id)) })
491
- ] }),
492
- o
493
- ] });
867
+ const [n, c] = _(() => [...t]), i = E((a, o) => {
868
+ c((u) => u.map((p) => p.id === a ? { ...p, name: o } : p));
869
+ }, []), d = E((a) => {
870
+ c((o) => {
871
+ const u = o.find((b) => b.id === a);
872
+ if (!u) return o;
873
+ const p = {
874
+ id: `${u.id}-copy-${Date.now()}`,
875
+ name: `${u.name} copy`,
876
+ active: !1
877
+ }, m = o.findIndex((b) => b.id === a);
878
+ return [...o.slice(0, m + 1), p, ...o.slice(m + 1)];
879
+ });
880
+ }, []), l = E((a) => {
881
+ c((o) => o.filter((u) => u.id !== a));
882
+ }, []);
883
+ return /* @__PURE__ */ s(ae.Provider, { value: { pages: n, setPages: c, renamePage: i, duplicatePage: d, deletePage: l }, children: /* @__PURE__ */ h("div", { "data-shell": "page-management", "aria-hidden": !e, children: [
884
+ /* @__PURE__ */ s("div", { className: "pm-list", role: "list", children: n.map((a) => /* @__PURE__ */ s(Ke, { page: a }, a.id)) }),
885
+ r != null && /* @__PURE__ */ s("div", { className: "pm-footer-pin", children: r })
886
+ ] }) });
494
887
  }
495
- const Ye = {
888
+ const St = {
496
889
  SETTINGS: "settings",
497
890
  CATALOG_ADD: "catalog-add",
498
891
  CATALOG_REPLACE: "catalog-replace",
499
892
  PAGE_MGMT: "page-management",
500
893
  NOTIFICATION_CENTER: "notification-center"
501
- }, Ne = {
894
+ }, qe = {
502
895
  position: "fixed",
503
896
  inset: 0,
504
897
  pointerEvents: "none",
505
898
  zIndex: 55
506
- }, Se = {
899
+ }, Ge = {
507
900
  position: "absolute",
508
901
  inset: 0,
509
902
  zIndex: 1,
@@ -512,69 +905,88 @@ const Ye = {
512
905
  pointerEvents: "none",
513
906
  background: "rgba(0, 0, 0, 0.04)"
514
907
  };
515
- function Ke() {
516
- const { state: e, dispatch: t, getCloseLog: o } = oe();
517
- V(() => {
908
+ function _t() {
909
+ const { state: e, dispatch: t, getCloseLog: r } = fe();
910
+ x(() => {
518
911
  if (e.activePanelId == null) return;
519
- function l(d) {
912
+ function i(d) {
520
913
  d.key === "Escape" && t({ type: "CLOSE_PANEL", reason: "escape-key" });
521
914
  }
522
- return document.addEventListener("keydown", l), () => document.removeEventListener("keydown", l);
915
+ return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
523
916
  }, [e.activePanelId, t]);
524
- const n = U(e);
525
- re(() => {
917
+ const n = I(e);
918
+ ge(() => {
526
919
  n.current = e;
527
- }), V(() => {
920
+ }), x(() => {
528
921
  if (process.env.NODE_ENV === "production") return;
529
- const l = window;
530
- return l.__panelsHostHandle && console.warn("[panels] multiple PanelHost/PanelHostShell instances mounted; dev handle is unreliable"), l.__panelsHostHandle = {
922
+ const i = window;
923
+ return i.__panelsHostHandle && console.warn("[panels] multiple PanelHost/PanelHostShell instances mounted; dev handle is unreliable"), i.__panelsHostHandle = {
531
924
  dispatch: t,
532
925
  getState: () => n.current,
533
- getCloseLog: o
926
+ getCloseLog: r
534
927
  }, () => {
535
- l.__panelsHostHandle?.dispatch === t && delete window.__panelsHostHandle;
928
+ i.__panelsHostHandle?.dispatch === t && delete window.__panelsHostHandle;
536
929
  };
537
- }, [t, o]);
538
- const r = W(() => {
930
+ }, [t, r]);
931
+ const c = E(() => {
539
932
  t({ type: "CLOSE_PANEL", reason: "nav-escape-hatch" });
540
933
  }, [t]);
541
- return /* @__PURE__ */ s("div", { "data-panel-host": "true", style: Ne, children: e.activePanelId != null && /* @__PURE__ */ s(
934
+ return /* @__PURE__ */ s("div", { "data-panel-host": "true", style: qe, children: e.activePanelId != null && /* @__PURE__ */ s(
542
935
  "div",
543
936
  {
544
937
  "data-panel-scrim": "true",
545
- style: Se,
546
- onClick: r
938
+ style: Ge,
939
+ onClick: c
547
940
  }
548
941
  ) });
549
942
  }
550
- function We({ panelComponents: e, children: t }) {
551
- const o = $();
552
- if (o == null) return null;
553
- const { state: n, dispatch: r } = o;
554
- if (n.activePanelId == null) return null;
555
- const l = e?.[n.activePanelId];
556
- if (l == null && t == null)
943
+ const Ye = 700;
944
+ function je(e) {
945
+ const [t, r] = _(null), n = I(null);
946
+ return x(() => {
947
+ if (e != null) {
948
+ n.current != null && (clearTimeout(n.current), n.current = null), r(null);
949
+ return;
950
+ }
951
+ return r((c) => c), n.current = setTimeout(() => {
952
+ r(null), n.current = null;
953
+ }, Ye), () => {
954
+ n.current != null && (clearTimeout(n.current), n.current = null);
955
+ };
956
+ }, [e]), x(() => {
957
+ e != null && r(e);
958
+ }, [e]), e != null ? { panelId: e, isOpen: !0 } : t != null ? { panelId: t, isOpen: !1 } : { panelId: null, isOpen: !1 };
959
+ }
960
+ function Nt({ panelComponents: e, children: t }) {
961
+ const r = k();
962
+ if (r == null) return null;
963
+ const { state: n, dispatch: c } = r, i = je(n.activePanelId);
964
+ if (i.panelId == null) return null;
965
+ const d = i.panelId, l = i.isOpen, a = e?.[d];
966
+ if (a == null && t == null)
557
967
  return process.env.NODE_ENV !== "production" && console.error(
558
968
  "[panels] No panel component registered for activePanelId:",
559
- n.activePanelId
969
+ d
560
970
  ), null;
561
- if (n.activePanelId === "settings") {
562
- const d = n.isDirty, i = n.activeTrigger, a = i?.kind === "card-overflow" ? i.cardId : null;
563
- return /* @__PURE__ */ s(E, { isOpen: !0, children: /* @__PURE__ */ s(
564
- A,
971
+ if (d === "settings") {
972
+ const o = n.isDirty, u = n.activeTrigger, p = u?.kind === "card-overflow" ? u.cardId : null;
973
+ return /* @__PURE__ */ s(A, { isOpen: l, children: /* @__PURE__ */ s(
974
+ T,
565
975
  {
566
- isOpen: !0,
567
- onClose: () => r({ type: "CLOSE_PANEL", reason: "header-x" }),
568
- footer: /* @__PURE__ */ p(ae, { children: [
976
+ isOpen: l,
977
+ title: "Configure metric",
978
+ variant: "merged-stage",
979
+ onClose: () => c({ type: "CLOSE_PANEL", reason: "header-x" }),
980
+ footer: /* @__PURE__ */ h(X, { children: [
569
981
  /* @__PURE__ */ s(
570
982
  "button",
571
983
  {
572
984
  id: "btn-reset",
573
985
  type: "button",
574
986
  className: "gloss-panel-chrome__footer-btn",
575
- disabled: !d,
987
+ disabled: !o,
576
988
  onClick: () => {
577
- a != null && r({ type: "CLEAR_BUFFER", cardId: a });
989
+ p != null && c({ type: "CLEAR_BUFFER", cardId: p });
578
990
  },
579
991
  children: "Reset"
580
992
  }
@@ -586,7 +998,7 @@ function We({ panelComponents: e, children: t }) {
586
998
  id: "settings-cancel",
587
999
  type: "button",
588
1000
  className: "gloss-panel-chrome__footer-btn",
589
- onClick: () => r({ type: "CLOSE_PANEL", reason: "cancel-button" }),
1001
+ onClick: () => c({ type: "CLOSE_PANEL", reason: "cancel-button" }),
590
1002
  children: "Cancel"
591
1003
  }
592
1004
  ),
@@ -596,271 +1008,273 @@ function We({ panelComponents: e, children: t }) {
596
1008
  id: "settings-apply",
597
1009
  type: "button",
598
1010
  className: "gloss-panel-chrome__footer-btn gloss-panel-chrome__footer-btn--primary",
599
- disabled: !d,
600
- onClick: () => r({ type: "CLOSE_PANEL", reason: "apply-button" }),
1011
+ disabled: !o,
1012
+ onClick: () => c({ type: "CLOSE_PANEL", reason: "apply-button" }),
601
1013
  children: "Apply"
602
1014
  }
603
1015
  )
604
1016
  ] }),
605
- children: l != null ? /* @__PURE__ */ s(l, { isOpen: !0 }) : t
1017
+ children: a != null ? /* @__PURE__ */ s(a, { isOpen: l }) : t
606
1018
  }
607
1019
  ) });
608
1020
  }
609
- if (n.activePanelId === "catalog-add" || n.activePanelId === "catalog-replace") {
610
- if (l == null) return null;
611
- const d = n.activePanelId === "catalog-replace" ? "replace" : "add";
612
- return /* @__PURE__ */ s(E, { isOpen: !0, children: /* @__PURE__ */ s(
613
- A,
1021
+ if (d === "catalog-add" || d === "catalog-replace") {
1022
+ if (a == null) return null;
1023
+ const o = d === "catalog-replace" ? "replace" : "add";
1024
+ return /* @__PURE__ */ s(A, { isOpen: l, children: /* @__PURE__ */ s(
1025
+ T,
614
1026
  {
615
- isOpen: !0,
616
- onClose: () => r({ type: "CLOSE_PANEL", reason: "header-x" }),
1027
+ isOpen: l,
1028
+ onClose: () => c({ type: "CLOSE_PANEL", reason: "header-x" }),
617
1029
  footer: null,
1030
+ title: o === "replace" ? "Replace metric" : "Add a metric",
618
1031
  children: /* @__PURE__ */ s(
619
- l,
1032
+ a,
620
1033
  {
621
- isOpen: !0,
622
- footerSlot: /* @__PURE__ */ s(be, { mode: d, dispatch: r })
1034
+ isOpen: l,
1035
+ footerSlot: /* @__PURE__ */ s(Ve, { mode: o, dispatch: c })
623
1036
  }
624
1037
  )
625
1038
  }
626
1039
  ) });
627
1040
  }
628
- return n.activePanelId === "page-management" ? l == null ? null : /* @__PURE__ */ s(E, { isOpen: !0, children: /* @__PURE__ */ s(
629
- A,
1041
+ return d === "page-management" ? a == null ? null : /* @__PURE__ */ s(A, { isOpen: l, children: /* @__PURE__ */ s(
1042
+ T,
630
1043
  {
631
- isOpen: !0,
632
- onClose: () => r({ type: "CLOSE_PANEL", reason: "header-x" }),
1044
+ isOpen: l,
1045
+ onClose: () => c({ type: "CLOSE_PANEL", reason: "header-x" }),
633
1046
  footer: null,
634
- children: /* @__PURE__ */ s(l, { isOpen: !0, footerSlot: /* @__PURE__ */ s(Pe, {}) })
1047
+ title: "Manage pages",
1048
+ children: /* @__PURE__ */ s(a, { isOpen: l, footerSlot: /* @__PURE__ */ s(Be, {}) })
635
1049
  }
636
- ) }) : /* @__PURE__ */ s(E, { isOpen: !0, children: /* @__PURE__ */ s(
637
- A,
1050
+ ) }) : /* @__PURE__ */ s(A, { isOpen: l, children: /* @__PURE__ */ s(
1051
+ T,
638
1052
  {
639
1053
  isOpen: !0,
640
- onClose: () => r({ type: "CLOSE_PANEL", reason: "header-x" }),
1054
+ onClose: () => c({ type: "CLOSE_PANEL", reason: "header-x" }),
641
1055
  footer: null,
642
- children: l != null ? /* @__PURE__ */ s(l, { isOpen: !0 }) : t
1056
+ children: a != null ? /* @__PURE__ */ s(a, { isOpen: l }) : t
643
1057
  }
644
1058
  ) });
645
1059
  }
646
- function B(e) {
1060
+ function Y(e) {
647
1061
  return e === null ? null : e.kind === "manage-pages-action" ? `global-${e.align ?? "left"}` : e.kind === "card-overflow" || e.kind === "empty-cell" ? `section-${e.sectionIndex}` : null;
648
1062
  }
649
- const we = 685, H = 627, Ee = "cubic-bezier(0.22, 1, 0.36, 1)", Ae = 200;
650
- function ee(e, t) {
1063
+ const Qe = 685, j = 627, Xe = "cubic-bezier(0.22, 1, 0.36, 1)", Je = 200;
1064
+ function le(e, t) {
651
1065
  if (typeof window > "u") return t;
652
- const o = window.getComputedStyle(document.documentElement).getPropertyValue(e).trim();
653
- if (!o) return t;
654
- const n = parseFloat(o);
655
- return Number.isNaN(n) ? t : o.endsWith("s") && !o.endsWith("ms") ? n * 1e3 : n;
1066
+ const r = window.getComputedStyle(document.documentElement).getPropertyValue(e).trim();
1067
+ if (!r) return t;
1068
+ const n = parseFloat(r);
1069
+ return Number.isNaN(n) ? t : r.endsWith("s") && !r.endsWith("ms") ? n * 1e3 : n;
656
1070
  }
657
- function xe(e, t) {
1071
+ function Ze(e, t) {
658
1072
  return typeof window > "u" ? t : window.getComputedStyle(document.documentElement).getPropertyValue(e).trim() || t;
659
1073
  }
660
- function x(e) {
1074
+ function L(e) {
661
1075
  e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger });
662
1076
  }
663
- function Te(e) {
664
- const { mountEl: t, chromeEl: o, reducedMotion: n, onAssert: r } = e;
665
- if (t == null || o == null) {
666
- x(e), r?.({ branch: "slide-fallback-no-dom", timestamp: Date.now() });
1077
+ function et(e) {
1078
+ const { mountEl: t, chromeEl: r, reducedMotion: n, onAssert: c } = e;
1079
+ if (t == null || r == null) {
1080
+ L(e), c?.({ branch: "slide-fallback-no-dom", timestamp: Date.now() });
667
1081
  return;
668
1082
  }
669
1083
  if (n) {
670
- e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), r?.({ branch: "slide-reduced-motion", timestamp: Date.now() });
1084
+ e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), c?.({ branch: "slide-reduced-motion", timestamp: Date.now() });
671
1085
  return;
672
1086
  }
673
- if (typeof o.animate != "function") {
674
- x(e), r?.({ branch: "slide-no-waapi", timestamp: Date.now() });
1087
+ if (typeof r.animate != "function") {
1088
+ L(e), c?.({ branch: "slide-no-waapi", timestamp: Date.now() });
675
1089
  return;
676
1090
  }
677
- const l = o.cloneNode(!0);
678
- l.id = "panel-chrome-frozen", l.style.cssText = "position:absolute;left:8px;right:8px;top:8px;z-index:1;pointer-events:none;", t.appendChild(l), o.style.zIndex = "2", e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger });
679
- const d = ee("--panel-open-dur", we), i = xe("--panel-easing", Ee), a = o.animate(
1091
+ const i = r.cloneNode(!0);
1092
+ i.id = "panel-chrome-frozen", i.style.cssText = "position:absolute;left:8px;right:8px;top:8px;z-index:1;pointer-events:none;", t.appendChild(i), r.style.zIndex = "2", e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger });
1093
+ const d = le("--panel-open-dur", Qe), l = Ze("--panel-easing", Xe), a = r.animate(
680
1094
  [{ transform: "translateY(100%)" }, { transform: "translateY(0)" }],
681
- { duration: d, easing: i, fill: "forwards" }
1095
+ { duration: d, easing: l, fill: "forwards" }
682
1096
  );
683
1097
  a.addEventListener(
684
1098
  "finish",
685
1099
  () => {
686
- l.remove(), o.style.zIndex = "", a.cancel(), r?.({ branch: "slide-complete", frozen: "cleaned", timestamp: Date.now() });
1100
+ i.remove(), r.style.zIndex = "", a.cancel(), c?.({ branch: "slide-complete", frozen: "cleaned", timestamp: Date.now() });
687
1101
  },
688
1102
  { once: !0 }
689
1103
  );
690
1104
  }
691
- function Le(e) {
692
- const { mountEl: t, onAssert: o } = e;
1105
+ function tt(e) {
1106
+ const { mountEl: t, onAssert: r } = e;
693
1107
  if (t == null) {
694
- e.dispatch({ type: "CLOSE_PANEL", reason: "mutex-handoff" }), setTimeout(() => x(e), H), o?.({ branch: "handoff-fallback-no-mount", timestamp: Date.now() });
1108
+ e.dispatch({ type: "CLOSE_PANEL", reason: "mutex-handoff" }), setTimeout(() => L(e), j), r?.({ branch: "handoff-fallback-no-mount", timestamp: Date.now() });
695
1109
  return;
696
1110
  }
697
- const n = ee("--panel-close-dur", H);
698
- let r = !1, l = null;
1111
+ const n = le("--panel-close-dur", j);
1112
+ let c = !1, i = null;
699
1113
  const d = (a) => {
700
- a.target !== t || a.propertyName !== "max-height" || r || (r = !0, l != null && clearTimeout(l), t.removeEventListener("transitionend", d), e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), o?.({ branch: "handoff-complete", timestamp: Date.now() }));
701
- }, i = () => {
702
- r || (r = !0, t.removeEventListener("transitionend", d), e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), o?.({ branch: "handoff-forced", timestamp: Date.now() }));
1114
+ a.target !== t || a.propertyName !== "max-height" || c || (c = !0, i != null && clearTimeout(i), t.removeEventListener("transitionend", d), e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), r?.({ branch: "handoff-complete", timestamp: Date.now() }));
1115
+ }, l = () => {
1116
+ c || (c = !0, t.removeEventListener("transitionend", d), e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), r?.({ branch: "handoff-forced", timestamp: Date.now() }));
703
1117
  };
704
- t.addEventListener("transitionend", d), e.dispatch({ type: "CLOSE_PANEL", reason: "mutex-handoff" }), l = setTimeout(i, n + Ae);
1118
+ t.addEventListener("transitionend", d), e.dispatch({ type: "CLOSE_PANEL", reason: "mutex-handoff" }), i = setTimeout(l, n + Je);
705
1119
  }
706
- function Oe(e) {
707
- const { state: t, onAssert: o } = e;
1120
+ function nt(e) {
1121
+ const { state: t, onAssert: r } = e;
708
1122
  if (t.activePanelId && t.isDirty) {
709
- e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), o?.({ branch: "blocked-dirty", timestamp: Date.now() });
1123
+ e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), r?.({ branch: "blocked-dirty", timestamp: Date.now() });
710
1124
  return;
711
1125
  }
712
- const n = B(t.activeTrigger), r = B(e.trigger);
713
- if (!!t.activePanelId && n != null && n === r) {
714
- Te(e);
1126
+ const n = Y(t.activeTrigger), c = Y(e.trigger);
1127
+ if (!!t.activePanelId && n != null && n === c) {
1128
+ et(e);
715
1129
  return;
716
1130
  }
717
1131
  if (t.activePanelId) {
718
- Le(e);
1132
+ tt(e);
719
1133
  return;
720
1134
  }
721
- x(e), o?.({ branch: "fresh-open", timestamp: Date.now() });
1135
+ L(e), r?.({ branch: "fresh-open", timestamp: Date.now() });
722
1136
  }
723
- function Ie() {
1137
+ function st() {
724
1138
  if (!(typeof window > "u"))
725
1139
  return window.__panelsAsserter;
726
1140
  }
727
- function je() {
728
- const e = $(), t = q();
729
- return W(
730
- (o, n) => {
1141
+ function Ct() {
1142
+ const e = k(), t = Q();
1143
+ return E(
1144
+ (r, n) => {
731
1145
  if (!e)
732
1146
  return;
733
- const r = typeof document < "u" ? document.querySelector('[data-mount="panel"]') : null, l = typeof document < "u" ? document.querySelector('[data-chrome="panel"]') : null, d = {
734
- panelId: o,
1147
+ const c = typeof document < "u" ? document.querySelector('[data-mount="panel"]') : null, i = typeof document < "u" ? document.querySelector('[data-chrome="panel"]') : null, d = {
1148
+ panelId: r,
735
1149
  trigger: n,
736
1150
  state: e.state,
737
1151
  dispatch: e.dispatch,
738
- mountEl: r,
739
- chromeEl: l,
1152
+ mountEl: c,
1153
+ chromeEl: i,
740
1154
  reducedMotion: t,
741
- onAssert: (i) => {
742
- Ie()?.recordTransition?.(i);
1155
+ onAssert: (l) => {
1156
+ st()?.recordTransition?.(l);
743
1157
  }
744
1158
  };
745
- Oe(d);
1159
+ nt(d);
746
1160
  },
747
1161
  [e, t]
748
1162
  );
749
1163
  }
750
- let T = !1, L = null;
751
- function D() {
1164
+ let O = !1, D = null;
1165
+ function z() {
752
1166
  const e = [];
753
1167
  let t = "cleaned";
754
1168
  document.querySelectorAll("#panel-chrome-frozen").length > 0 && (e.push("#panel-chrome-frozen"), t = "lingering");
755
1169
  const n = document.querySelectorAll(".gloss-panel-mount");
756
1170
  n.length > 1 && e.push(`mount-count=${n.length}`);
757
- const r = n[0] ?? null, l = r ? r.querySelectorAll(".gloss-panel-chrome") : [];
758
- l.length > 1 && e.push(`chrome-count=${l.length}`);
759
- const d = l[0] ?? null;
1171
+ const c = n[0] ?? null, i = c ? c.querySelectorAll(".gloss-panel-chrome") : [];
1172
+ i.length > 1 && e.push(`chrome-count=${i.length}`);
1173
+ const d = i[0] ?? null;
760
1174
  if (d) {
761
1175
  const u = d.style.zIndex;
762
1176
  u !== "" && u !== "2" && e.push(`chrome-zindex=${u}`);
763
1177
  }
764
- const i = r ? "present" : "absent", a = d ? "present" : "absent";
1178
+ const l = c ? "present" : "absent", a = d ? "present" : "absent";
765
1179
  return {
766
1180
  valid: e.length === 0,
767
- mount: i,
1181
+ mount: l,
768
1182
  chrome: a,
769
1183
  frozen: t,
770
1184
  orphans: e,
771
1185
  timestamp: Date.now()
772
1186
  };
773
1187
  }
774
- const O = "8px 8px 0px", I = "64px", k = "inset(0px 0px 60px 0px)", M = "inset(0px -40px -40px -40px)";
775
- function m(e, t, o, n, r) {
776
- return { id: e, constraint: t, expected: o, actual: n, pass: r };
1188
+ const M = "8px 8px 0px", R = "64px", $ = "inset(0px 0px 60px 0px)", F = "inset(0px -40px -40px -40px)";
1189
+ function f(e, t, r, n, c) {
1190
+ return { id: e, constraint: t, expected: r, actual: n, pass: c };
777
1191
  }
778
1192
  function P(e) {
779
1193
  const t = parseInt(e, 10);
780
1194
  return Number.isFinite(t) ? t : NaN;
781
1195
  }
782
- function F() {
783
- const e = [], t = document.querySelector(".gloss-panel-mount"), o = t?.querySelector(".gloss-panel-chrome") ?? null, n = document.querySelector(".gloss-panel-coordinator") ?? document.querySelector("[data-panel-coordinator]"), r = document.querySelector(".bell-cutout"), l = document.querySelector(".bell-popover"), d = document.querySelector(".gloss-bottom-toolbar");
1196
+ function B() {
1197
+ const e = [], t = document.querySelector(".gloss-panel-mount"), r = t?.querySelector(".gloss-panel-chrome") ?? null, n = document.querySelector(".gloss-panel-coordinator") ?? document.querySelector("[data-panel-coordinator]"), c = document.querySelector(".bell-cutout"), i = document.querySelector(".bell-popover"), d = document.querySelector(".gloss-bottom-toolbar");
784
1198
  if (!t)
785
- e.push(m("C1", "mount --reveal-y matches clip-path inset-bottom Npx", "mount present", "absent", !1));
1199
+ e.push(f("C1", "mount --reveal-y matches clip-path inset-bottom Npx", "mount present", "absent", !1));
786
1200
  else {
787
- const i = getComputedStyle(t), a = i.getPropertyValue("--reveal-y").trim() || t.style.getPropertyValue("--reveal-y").trim(), c = i.clipPath || t.style.clipPath || "", u = c.match(/inset\(\s*0(?:px)?\s+0(?:px)?\s+(\d+)px\s+0(?:px)?\s*\)/), h = u ? parseInt(u[1], 10) : NaN, g = P(a), f = Number.isFinite(h) && Number.isFinite(g) && h === g;
1201
+ const l = getComputedStyle(t), a = l.getPropertyValue("--reveal-y").trim() || t.style.getPropertyValue("--reveal-y").trim(), o = l.clipPath || t.style.clipPath || "", u = o.match(/inset\(\s*0(?:px)?\s+0(?:px)?\s+(\d+)px\s+0(?:px)?\s*\)/), p = u ? parseInt(u[1], 10) : NaN, m = P(a), b = Number.isFinite(p) && Number.isFinite(m) && p === m;
788
1202
  e.push(
789
- m(
1203
+ f(
790
1204
  "C1",
791
1205
  "mount --reveal-y matches clip-path inset-bottom Npx",
792
- `inset(0 0 ${g}px 0) === --reveal-y(${g}px)`,
793
- `--reveal-y=${a || "n/a"} clip-path=${c || "n/a"}`,
794
- f
1206
+ `inset(0 0 ${m}px 0) === --reveal-y(${m}px)`,
1207
+ `--reveal-y=${a || "n/a"} clip-path=${o || "n/a"}`,
1208
+ b
795
1209
  )
796
1210
  );
797
1211
  }
798
1212
  if (!t)
799
- e.push(m("C2", "mount padding constant", O, "absent", !1));
1213
+ e.push(f("C2", "mount padding constant", M, "absent", !1));
800
1214
  else {
801
- const i = t.style.padding, a = getComputedStyle(t), c = i || a.padding || "", u = c === O || c === "8px 8px 0px 8px";
802
- e.push(m("C2", "mount padding constant", O, c || "n/a", u));
1215
+ const l = t.style.padding, a = getComputedStyle(t), o = l || a.padding || "", u = o === M || o === "8px 8px 0px 8px";
1216
+ e.push(f("C2", "mount padding constant", M, o || "n/a", u));
803
1217
  }
804
1218
  if (!t)
805
- e.push(m("C3", "mount.bottom resolves to var(--tb-h)=64px", I, "absent", !1));
1219
+ e.push(f("C3", "mount.bottom resolves to var(--tb-h)=64px", R, "absent", !1));
806
1220
  else {
807
- const a = getComputedStyle(t).bottom || t.style.bottom || "", c = a === I;
808
- e.push(m("C3", "mount.bottom resolves to var(--tb-h)=64px", I, a || "n/a", c));
1221
+ const a = getComputedStyle(t).bottom || t.style.bottom || "", o = a === R;
1222
+ e.push(f("C3", "mount.bottom resolves to var(--tb-h)=64px", R, a || "n/a", o));
809
1223
  }
810
- if (!o)
811
- e.push(m("C4", "panel-chrome height formula = (row-h*3)+(row-gap*3)-8px", "formula match", "absent", !1));
1224
+ if (!r)
1225
+ e.push(f("C4", "panel-chrome height formula = (row-h*3)+(row-gap*3)-8px", "formula match", "absent", !1));
812
1226
  else {
813
- const i = getComputedStyle(o), a = P(
814
- i.getPropertyValue("--row-h").trim() || o.style.getPropertyValue("--row-h").trim() || "0"
815
- ), c = P(
816
- i.getPropertyValue("--row-gap").trim() || o.style.getPropertyValue("--row-gap").trim() || "0"
817
- ), u = a * 3 + c * 3 - 8, h = P(i.height || o.style.height || ""), g = Number.isFinite(a) && Number.isFinite(c) && Number.isFinite(h) && Number.isFinite(u) && h === u;
1227
+ const l = getComputedStyle(r), a = P(
1228
+ l.getPropertyValue("--row-h").trim() || r.style.getPropertyValue("--row-h").trim() || "0"
1229
+ ), o = P(
1230
+ l.getPropertyValue("--row-gap").trim() || r.style.getPropertyValue("--row-gap").trim() || "0"
1231
+ ), u = a * 3 + o * 3 - 8, p = P(l.height || r.style.height || ""), m = Number.isFinite(a) && Number.isFinite(o) && Number.isFinite(p) && Number.isFinite(u) && p === u;
818
1232
  e.push(
819
- m(
1233
+ f(
820
1234
  "C4",
821
1235
  "panel-chrome height formula = (row-h*3)+(row-gap*3)-8px",
822
- `${u}px (rh=${a} rg=${c})`,
823
- `${h}px`,
824
- g
1236
+ `${u}px (rh=${a} rg=${o})`,
1237
+ `${p}px`,
1238
+ m
825
1239
  )
826
1240
  );
827
1241
  }
828
- if (!n || !o)
1242
+ if (!n || !r)
829
1243
  e.push(
830
- m(
1244
+ f(
831
1245
  "C5",
832
1246
  'coordinator perspective + origin "center bottom"; chrome perspective-style flat',
833
1247
  "present",
834
- `coordinator=${n ? "present" : "absent"} chrome=${o ? "present" : "absent"}`,
1248
+ `coordinator=${n ? "present" : "absent"} chrome=${r ? "present" : "absent"}`,
835
1249
  !1
836
1250
  )
837
1251
  );
838
1252
  else {
839
- const i = getComputedStyle(n), a = getComputedStyle(o), c = i.perspective || n.style.perspective || "", u = (i.perspectiveOrigin || n.style.perspectiveOrigin || "").trim(), h = a.perspectiveStyle || o.style.perspectiveStyle || "", v = c !== "" && c !== "none" && (u === "center bottom" || u === "50% 100%") && h === "flat";
1253
+ const l = getComputedStyle(n), a = getComputedStyle(r), o = l.perspective || n.style.perspective || "", u = (l.perspectiveOrigin || n.style.perspectiveOrigin || "").trim(), p = a.perspectiveStyle || r.style.perspectiveStyle || "", v = o !== "" && o !== "none" && (u === "center bottom" || u === "50% 100%") && p === "flat";
840
1254
  e.push(
841
- m(
1255
+ f(
842
1256
  "C5",
843
1257
  'coordinator perspective + origin "center bottom"; chrome perspective-style flat',
844
1258
  "perspective:not-none, origin:center bottom, chrome-style:flat",
845
- `perspective=${c} origin=${u} chrome-style=${h}`,
1259
+ `perspective=${o} origin=${u} chrome-style=${p}`,
846
1260
  v
847
1261
  )
848
1262
  );
849
1263
  }
850
1264
  {
851
- let i = !1, a = "absent";
1265
+ let l = !1, a = "absent";
852
1266
  try {
853
- for (const c of Array.from(document.styleSheets)) {
1267
+ for (const o of Array.from(document.styleSheets)) {
854
1268
  let u = [];
855
1269
  try {
856
- u = Array.from(c.cssRules ?? []);
1270
+ u = Array.from(o.cssRules ?? []);
857
1271
  } catch {
858
1272
  continue;
859
1273
  }
860
- for (const h of u)
861
- if (h.name === "stage-spin") {
862
- const f = Array.from(h.cssRules), y = f.find((C) => C.keyText === "0%" || C.keyText === "from"), v = f.find((C) => C.keyText === "100%" || C.keyText === "to"), N = y?.style.transform ?? "", S = v?.style.transform ?? "", w = /rotateY\(\s*0(?:deg)?\s*\)/;
863
- i = w.test(N) && w.test(S), a = `0%=${N || "n/a"} 100%=${S || "n/a"}`;
1274
+ for (const p of u)
1275
+ if (p.name === "stage-spin") {
1276
+ const b = Array.from(p.cssRules), y = b.find((S) => S.keyText === "0%" || S.keyText === "from"), v = b.find((S) => S.keyText === "100%" || S.keyText === "to"), N = y?.style.transform ?? "", C = v?.style.transform ?? "", g = /rotateY\(\s*0(?:deg)?\s*\)/;
1277
+ l = g.test(N) && g.test(C), a = `0%=${N || "n/a"} 100%=${C || "n/a"}`;
864
1278
  break;
865
1279
  }
866
1280
  if (a !== "absent") break;
@@ -869,69 +1283,69 @@ function F() {
869
1283
  a = "inspection-error";
870
1284
  }
871
1285
  e.push(
872
- m(
1286
+ f(
873
1287
  "C6",
874
1288
  "@keyframes stage-spin 0% AND 100% anchor at rotateY(0)",
875
1289
  "both frames rotateY(0)",
876
1290
  a,
877
- i
1291
+ l
878
1292
  )
879
1293
  );
880
1294
  }
881
1295
  {
882
- const i = document.documentElement, a = getComputedStyle(i), c = a.getPropertyValue("--panel-open-dur").trim() || i.style.getPropertyValue("--panel-open-dur").trim(), u = a.getPropertyValue("--panel-close-dur").trim() || i.style.getPropertyValue("--panel-close-dur").trim(), h = P(c) || parseFloat(c) * (c.endsWith("s") && !c.endsWith("ms") ? 1e3 : 1), g = P(u) || parseFloat(u) * (u.endsWith("s") && !u.endsWith("ms") ? 1e3 : 1), f = Number.isFinite(h) && Number.isFinite(g) && h > g;
1296
+ const l = document.documentElement, a = getComputedStyle(l), o = a.getPropertyValue("--panel-open-dur").trim() || l.style.getPropertyValue("--panel-open-dur").trim(), u = a.getPropertyValue("--panel-close-dur").trim() || l.style.getPropertyValue("--panel-close-dur").trim(), p = P(o) || parseFloat(o) * (o.endsWith("s") && !o.endsWith("ms") ? 1e3 : 1), m = P(u) || parseFloat(u) * (u.endsWith("s") && !u.endsWith("ms") ? 1e3 : 1), b = Number.isFinite(p) && Number.isFinite(m) && p > m;
883
1297
  e.push(
884
- m("C7", "--panel-open-dur > --panel-close-dur", "open > close", `open=${c || "n/a"} close=${u || "n/a"}`, f)
1298
+ f("C7", "--panel-open-dur > --panel-close-dur", "open > close", `open=${o || "n/a"} close=${u || "n/a"}`, b)
885
1299
  );
886
1300
  }
887
- if (!r)
888
- e.push(m("C8", "BellCutout zero computed animation/transition", "no inline timing", "absent", !1));
1301
+ if (!c)
1302
+ e.push(f("C8", "BellCutout zero computed animation/transition", "no inline timing", "absent", !1));
889
1303
  else {
890
- const i = getComputedStyle(r), a = i.animationName || "", c = i.transitionProperty || "", u = (a === "" || a === "none") && (c === "" || c === "none" || c === "all");
1304
+ const l = getComputedStyle(c), a = l.animationName || "", o = l.transitionProperty || "", u = (a === "" || a === "none") && (o === "" || o === "none" || o === "all");
891
1305
  e.push(
892
- m(
1306
+ f(
893
1307
  "C8",
894
1308
  "BellCutout zero computed animation/transition",
895
1309
  "animation:none AND transition:none",
896
- `animation=${a || "n/a"} transition=${c || "n/a"}`,
1310
+ `animation=${a || "n/a"} transition=${o || "n/a"}`,
897
1311
  u
898
1312
  )
899
1313
  );
900
1314
  }
901
1315
  if (!t)
902
- e.push(m("C9", "mount closed-state clipPath", k, "absent", !1));
1316
+ e.push(f("C9", "mount closed-state clipPath", $, "absent", !1));
903
1317
  else {
904
- const i = t.style.clipPath, a = getComputedStyle(t), c = i || a.clipPath || "", u = c === k;
905
- e.push(m("C9", "mount closed-state clipPath", k, c || "n/a", u));
1318
+ const l = t.style.clipPath, a = getComputedStyle(t), o = l || a.clipPath || "", u = o === $;
1319
+ e.push(f("C9", "mount closed-state clipPath", $, o || "n/a", u));
906
1320
  }
907
- if (!l)
908
- e.push(m("C10", "bell-popover parentElement === document.body (open)", "body", "absent", !1));
1321
+ if (!i)
1322
+ e.push(f("C10", "bell-popover parentElement === document.body (open)", "body", "absent", !1));
909
1323
  else {
910
- const i = l.parentElement, a = i === document.body;
1324
+ const l = i.parentElement, a = l === document.body;
911
1325
  e.push(
912
- m(
1326
+ f(
913
1327
  "C10",
914
1328
  "bell-popover parentElement === document.body (open)",
915
1329
  "body",
916
- i === document.body ? "body" : i?.tagName ?? "n/a",
1330
+ l === document.body ? "body" : l?.tagName ?? "n/a",
917
1331
  a
918
1332
  )
919
1333
  );
920
1334
  }
921
1335
  if (!n)
922
- e.push(m("C11", "coordinator overflow === visible", "visible", "absent", !1));
1336
+ e.push(f("C11", "coordinator overflow === visible", "visible", "absent", !1));
923
1337
  else {
924
- const a = getComputedStyle(n).overflow || n.style.overflow || "", c = a === "visible";
925
- e.push(m("C11", "coordinator overflow === visible", "visible", a || "n/a", c));
1338
+ const a = getComputedStyle(n).overflow || n.style.overflow || "", o = a === "visible";
1339
+ e.push(f("C11", "coordinator overflow === visible", "visible", a || "n/a", o));
926
1340
  }
927
1341
  if (!d)
928
- e.push(m("C12", "toolbar clipPath = inset(0 -40 -40 -40)", M, "absent", !1));
1342
+ e.push(f("C12", "toolbar clipPath = inset(0 -40 -40 -40)", F, "absent", !1));
929
1343
  else {
930
- const i = d.style.clipPath, a = getComputedStyle(d), c = i || a.clipPath || "", u = c === M;
931
- e.push(m("C12", "toolbar clipPath = inset(0 -40 -40 -40)", M, c || "n/a", u));
1344
+ const l = d.style.clipPath, a = getComputedStyle(d), o = l || a.clipPath || "", u = o === F;
1345
+ e.push(f("C12", "toolbar clipPath = inset(0 -40 -40 -40)", F, o || "n/a", u));
932
1346
  }
933
1347
  return e.push(
934
- m(
1348
+ f(
935
1349
  "C13",
936
1350
  "same-position slide via WAAPI (mid-transition getAnimations().length > 0)",
937
1351
  "WAAPI driver wired in orchestrator (source-proof)",
@@ -939,7 +1353,7 @@ function F() {
939
1353
  "wiring_only"
940
1354
  )
941
1355
  ), e.push(
942
- m(
1356
+ f(
943
1357
  "C14",
944
1358
  'cross-position handoff transitionend filtered by propertyName="max-height"',
945
1359
  "transitionend filter wired in orchestrator (source-proof)",
@@ -948,11 +1362,11 @@ function F() {
948
1362
  )
949
1363
  ), e;
950
1364
  }
951
- function ke(e) {
952
- return F().find((t) => t.id === e);
1365
+ function at(e) {
1366
+ return B().find((t) => t.id === e);
953
1367
  }
954
- function Me() {
955
- const e = D();
1368
+ function rt() {
1369
+ const e = z();
956
1370
  return { q12: [
957
1371
  {
958
1372
  id: "Q12-12",
@@ -961,74 +1375,76 @@ function Me() {
961
1375
  actual: `valid=${e.valid} mount=${e.mount} chrome=${e.chrome} frozen=${e.frozen} orphans=[${e.orphans.join(",")}]`,
962
1376
  pass: e.valid
963
1377
  }
964
- ], cc: F() };
1378
+ ], cc: B() };
965
1379
  }
966
- function De() {
1380
+ function lt() {
967
1381
  return {
968
- enable: $e,
969
- disable: Re,
970
- isEnabled: () => T,
971
- getLastReport: () => L,
1382
+ enable: ot,
1383
+ disable: it,
1384
+ isEnabled: () => O,
1385
+ getLastReport: () => D,
972
1386
  recordTransition: (e) => {
973
- T && (L = { ...e, ...D() });
1387
+ O && (D = { ...e, ...z() });
974
1388
  },
975
1389
  assertOnce: () => {
976
- const e = D();
977
- return L = e, e;
1390
+ const e = z();
1391
+ return D = e, e;
978
1392
  },
979
- assertCcOnly: F,
980
- getCcRowById: ke,
981
- assertPanelTruths: Me
1393
+ assertCcOnly: B,
1394
+ getCcRowById: at,
1395
+ assertPanelTruths: rt
982
1396
  };
983
1397
  }
984
- function $e() {
985
- if (T = !0, typeof window > "u") return;
986
- window.__panelsAsserter || (window.__panelsAsserter = De(), console.info(
1398
+ function ot() {
1399
+ if (O = !0, typeof window > "u") return;
1400
+ window.__panelsAsserter || (window.__panelsAsserter = lt(), console.info(
987
1401
  "[panels] asserter enabled (P3b Q12-12 + P6 W5 cc:C1..C14). Inspect via window.__panelsAsserter."
988
1402
  ));
989
1403
  }
990
- function Re() {
991
- T = !1;
1404
+ function it() {
1405
+ O = !1;
992
1406
  }
993
1407
  export {
994
- Xe as COMMITS,
995
- He as CatalogAddShell,
996
- be as CatalogFooter,
997
- qe as CatalogReplaceShell,
998
- R as CatalogStateContext,
999
- ie as CloneCard,
1000
- le as CloneStage,
1001
- X as MOCK_DEFAULT_LENS,
1002
- Q as MOCK_LENSES,
1003
- _e as MOCK_PAGES,
1004
- J as MOCK_TILES_BY_LENS,
1005
- Ye as PANEL_IDS,
1006
- Pe as PageMgmtFooter,
1007
- Ue as PageMgmtShell,
1008
- Z as PageMgmtStateContext,
1009
- A as PanelChrome,
1010
- Je as PanelHost,
1011
- Ke as PanelHostShell,
1012
- E as PanelMount,
1013
- Ze as PanelProvider,
1014
- We as PanelSlot,
1015
- Be as SettingsShell,
1016
- F as assertCcOnly,
1017
- D as assertPanelDomShape,
1018
- Me as assertPanelTruths,
1019
- et as deriveSurfaceState,
1020
- Re as disablePanelAsserter,
1021
- $e as enablePanelAsserter,
1022
- ke as getCcRowById,
1023
- tt as initialState,
1024
- B as positionKey,
1025
- nt as reducer,
1026
- Oe as transitionToPanel,
1027
- ve as useCatalogState,
1028
- Ce as usePageMgmtState,
1029
- oe as usePanelContext,
1030
- $ as usePanelContextOptional,
1031
- st as usePanelCoordinator,
1032
- q as useReducedMotionPanel,
1033
- je as useTransitionToPanel
1408
+ Et as COMMITS,
1409
+ bt as CatalogAddShell,
1410
+ Ve as CatalogFooter,
1411
+ vt as CatalogReplaceShell,
1412
+ V as CatalogStateContext,
1413
+ Te as CloneCard,
1414
+ Ae as CloneStage,
1415
+ te as MOCK_DEFAULT_LENS,
1416
+ ee as MOCK_LENSES,
1417
+ U as MOCK_LENS_META,
1418
+ We as MOCK_PAGES,
1419
+ ne as MOCK_TILES_BY_LENS,
1420
+ St as PANEL_IDS,
1421
+ Be as PageMgmtFooter,
1422
+ yt as PageMgmtShell,
1423
+ ae as PageMgmtStateContext,
1424
+ T as PanelChrome,
1425
+ xt as PanelHost,
1426
+ _t as PanelHostShell,
1427
+ A as PanelMount,
1428
+ At as PanelProvider,
1429
+ Nt as PanelSlot,
1430
+ gt as SettingsShell,
1431
+ B as assertCcOnly,
1432
+ z as assertPanelDomShape,
1433
+ rt as assertPanelTruths,
1434
+ Tt as deriveSurfaceState,
1435
+ it as disablePanelAsserter,
1436
+ ot as enablePanelAsserter,
1437
+ at as getCcRowById,
1438
+ Lt as initialState,
1439
+ Y as positionKey,
1440
+ Ot as reducer,
1441
+ nt as transitionToPanel,
1442
+ Ue as useCatalogState,
1443
+ ft as useEditingCardId,
1444
+ re as usePageMgmtState,
1445
+ fe as usePanelContext,
1446
+ k as usePanelContextOptional,
1447
+ kt as usePanelCoordinator,
1448
+ Q as useReducedMotionPanel,
1449
+ Ct as useTransitionToPanel
1034
1450
  };