@mt-gloss/ui 0.1.106 → 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,24 +1,27 @@
1
- import { u as I, f as q, S as se, a as oe, g as E, c as A } from "./COMMITS-kaUvc5jL.js";
2
- import { C as Je, b as Ze, P as et, e as tt, i as nt, r as st, d as ot } 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 Be() {
6
- const e = I();
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();
7
10
  if (e?.state.activePanelId !== "settings") return null;
8
11
  const t = e.state.activeTrigger;
9
12
  return t?.kind === "card-overflow" ? t.cardId : null;
10
13
  }
11
- function le({ children: e }) {
14
+ function Ae({ children: e }) {
12
15
  return /* @__PURE__ */ s("div", { className: "clone-stage", children: e });
13
16
  }
14
- function ie({ span: e, rotating: t = !0, children: o }) {
17
+ function Te({ span: e, rotating: t = !0, children: r }) {
15
18
  const n = ["clone-card", `span-${e}`, t ? "rotating" : ""].filter(Boolean).join(" ");
16
- return /* @__PURE__ */ s("div", { className: n, children: o });
19
+ return /* @__PURE__ */ s("div", { className: n, children: r });
17
20
  }
18
- function ce({ value: e, onChange: t }) {
19
- 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: [
20
23
  /* @__PURE__ */ s("span", { className: "settings-shell__label", "aria-hidden": "true", children: "Alert level (%)" }),
21
- /* @__PURE__ */ p("div", { className: "settings-shell__slider-row", children: [
24
+ /* @__PURE__ */ h("div", { className: "settings-shell__slider-row", children: [
22
25
  /* @__PURE__ */ s(
23
26
  "input",
24
27
  {
@@ -35,17 +38,17 @@ function ce({ value: e, onChange: t }) {
35
38
  className: "settings-shell__slider"
36
39
  }
37
40
  ),
38
- /* @__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: [
39
42
  e,
40
43
  "%"
41
44
  ] })
42
45
  ] })
43
46
  ] });
44
47
  }
45
- function de({ value: e, onChange: t }) {
46
- 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: [
47
50
  /* @__PURE__ */ s("span", { className: "settings-shell__label", "aria-hidden": "true", children: "Rolling period (days)" }),
48
- /* @__PURE__ */ p("div", { className: "settings-shell__slider-row", children: [
51
+ /* @__PURE__ */ h("div", { className: "settings-shell__slider-row", children: [
49
52
  /* @__PURE__ */ s(
50
53
  "input",
51
54
  {
@@ -62,100 +65,423 @@ function de({ value: e, onChange: t }) {
62
65
  className: "settings-shell__slider"
63
66
  }
64
67
  ),
65
- /* @__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: [
66
69
  e,
67
70
  " days"
68
71
  ] })
69
72
  ] })
70
73
  ] });
71
74
  }
72
- const ue = ["Orders", "Quota", "Unassigned"];
73
- function pe() {
74
- return /* @__PURE__ */ p("div", { className: "settings-shell__field settings-shell__field--slots", "aria-label": "Stack slots (display only)", children: [
75
- /* @__PURE__ */ s("p", { className: "settings-shell__help", children: "Slots are currently fixed. Drag-to-reorder is coming in a later phase." }),
76
- /* @__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" })
77
131
  ] });
78
132
  }
79
- const me = ["#1d6fd8", "#10b981", "#f59e0b", "#ef4444", "#8b5cf6"];
80
- function he({ value: e, onSelect: t }) {
81
- 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: [
82
136
  /* @__PURE__ */ s("span", { className: "settings-shell__label", children: "Accent color" }),
83
- /* @__PURE__ */ s("div", { className: "settings-shell__swatch-row", children: me.map((o) => {
84
- const n = e === o;
137
+ /* @__PURE__ */ s("div", { className: "settings-shell__swatch-row", children: De.map((r) => {
138
+ const n = e === r;
85
139
  return /* @__PURE__ */ s(
86
140
  "button",
87
141
  {
88
142
  type: "button",
89
143
  "aria-pressed": n,
90
- "aria-label": `Accent ${o}`,
144
+ "aria-label": `Accent ${r}`,
91
145
  className: `settings-shell__swatch${n ? " settings-shell__swatch--active" : ""}`,
92
- style: { backgroundColor: o },
93
- onClick: () => t(o)
146
+ style: { backgroundColor: r },
147
+ onClick: () => t(r)
94
148
  },
95
- o
149
+ r
96
150
  );
97
151
  }) })
98
152
  ] });
99
153
  }
100
- const fe = ["threshold", "timeframe", "color"];
101
- function He({
154
+ const Re = ["Orders", "Quota", "Unassigned"], $e = ["threshold", "timeframe", "color"];
155
+ function gt({
102
156
  isOpen: e,
103
157
  cardSpan: t,
104
- cardLabel: o = "Metric",
158
+ cardLabel: r = "Metric",
105
159
  cardValue: n = "—",
106
- dimensions: r = fe,
107
- initialTab: l
160
+ previewSlot: c,
161
+ dimensions: i = $e,
162
+ initialTab: d,
163
+ initialValues: l
108
164
  }) {
109
- const d = I(), 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);
110
- z.useEffect(() => {
111
- r.includes(f) || y(g);
112
- }, [r, f, g]);
113
- 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 = (_) => {
114
- a == null || d == null || d.dispatch({ type: "SET_BUFFER_VALUE", cardId: a, key: "threshold", value: Number(_.target.value) });
115
- }, te = (_) => {
116
- a == null || d == null || d.dispatch({ type: "SET_BUFFER_VALUE", cardId: a, key: "timeframe", value: Number(_.target.value) });
117
- }, ne = (_) => {
118
- 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 });
119
177
  };
120
- return /* @__PURE__ */ p("div", { className: "settings-shell", "data-shell": "settings", "aria-hidden": !e, children: [
121
- /* @__PURE__ */ s("div", { "aria-hidden": "true", children: /* @__PURE__ */ s(le, { children: /* @__PURE__ */ p(ie, { span: h, rotating: !c, children: [
122
- /* @__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 }),
123
181
  /* @__PURE__ */ s("div", { style: { fontSize: 22, fontWeight: 700, color: "#111827", lineHeight: 1 }, children: n })
124
- ] }) }) }),
182
+ ] }) }) }) }),
125
183
  /* @__PURE__ */ s(
126
- se,
184
+ he,
127
185
  {
128
- dimensions: r,
129
- activeTab: f,
130
- onSelect: y,
131
- reduced: c
186
+ dimensions: i,
187
+ activeTab: v,
188
+ onSelect: N,
189
+ reduced: p
132
190
  }
133
191
  ),
134
- /* @__PURE__ */ p(
192
+ /* @__PURE__ */ h(
135
193
  "div",
136
194
  {
137
195
  role: "tabpanel",
138
- id: `settings-tabpanel-${f}`,
196
+ id: `settings-tabpanel-${v}`,
139
197
  "aria-label": "Settings dimension controls",
140
198
  tabIndex: 0,
141
199
  className: "settings-shell__tabpanel",
142
200
  children: [
143
- f === "threshold" && /* @__PURE__ */ s(ce, { value: N, onChange: C }),
144
- f === "timeframe" && /* @__PURE__ */ s(de, { value: S, onChange: te }),
145
- f === "slots" && /* @__PURE__ */ s(pe, {}),
146
- 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 })
147
205
  ]
148
206
  }
149
207
  )
150
208
  ] });
151
209
  }
152
- function j({ lenses: e, activeLens: t, onLensChange: o }) {
153
- const [n, r] = b(!1), l = U(null), d = () => {
154
- l.current != null && (window.clearTimeout(l.current), l.current = null);
155
- }, i = () => {
156
- d(), l.current = window.setTimeout(() => r(!1), 100);
157
- }, a = e.filter((c) => c !== t);
158
- 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: [
159
485
  /* @__PURE__ */ s(
160
486
  "button",
161
487
  {
@@ -166,14 +492,14 @@ function j({ lenses: e, activeLens: t, onLensChange: o }) {
166
492
  children: t
167
493
  }
168
494
  ),
169
- /* @__PURE__ */ p(
495
+ /* @__PURE__ */ h(
170
496
  "div",
171
497
  {
172
498
  className: "cat-seg-more",
173
499
  onMouseEnter: () => {
174
- d(), r(!0);
500
+ d(), c(!0);
175
501
  },
176
- onMouseLeave: i,
502
+ onMouseLeave: l,
177
503
  children: [
178
504
  /* @__PURE__ */ s("button", { type: "button", className: "cat-seg cat-seg-more-btn", "aria-haspopup": "menu", "aria-expanded": n, children: "More ▾" }),
179
505
  n && /* @__PURE__ */ s(
@@ -182,19 +508,19 @@ function j({ lenses: e, activeLens: t, onLensChange: o }) {
182
508
  className: "cat-seg-overflow",
183
509
  role: "menu",
184
510
  onMouseEnter: d,
185
- onMouseLeave: i,
186
- children: a.map((c) => /* @__PURE__ */ s(
511
+ onMouseLeave: l,
512
+ children: a.map((o) => /* @__PURE__ */ s(
187
513
  "button",
188
514
  {
189
515
  type: "button",
190
- "data-lens": c,
516
+ "data-lens": o,
191
517
  role: "menuitem",
192
518
  onClick: () => {
193
- o(c), r(!1);
519
+ r(o), c(!1);
194
520
  },
195
- children: c
521
+ children: o
196
522
  },
197
- c
523
+ o
198
524
  ))
199
525
  }
200
526
  )
@@ -203,48 +529,63 @@ function j({ lenses: e, activeLens: t, onLensChange: o }) {
203
529
  )
204
530
  ] }) });
205
531
  }
206
- function ge(e) {
207
- return e.split("·").map((t, o) => {
208
- const n = t.trim(), r = n.match(/^([$+\-]?[\d,]+(?:\.\d+)?[%+]?)\s*(.*)$/), l = r ? r[1] : "", d = r ? r[2] : n;
209
- return /* @__PURE__ */ p("span", { children: [
210
- /* @__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 }),
211
537
  /* @__PURE__ */ s("small", { children: d })
212
- ] }, o);
538
+ ] }, r);
213
539
  });
214
540
  }
215
- 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 }) {
216
548
  return /* @__PURE__ */ s("div", { className: "cat-tiles", children: e.map((n) => {
217
- const r = n.id === t, l = n.stack === !0, d = ["cat-tile"];
218
- 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(
219
554
  "button",
220
555
  {
221
556
  type: "button",
222
- className: d.join(" "),
557
+ className: l.join(" "),
223
558
  "data-metric": n.id,
224
559
  "data-desc": n.desc,
225
- "aria-pressed": r,
226
- 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,
227
565
  children: [
566
+ n.startHere && /* @__PURE__ */ s("span", { className: "cat-tile-start-here", "aria-hidden": "true", children: "START HERE" }),
228
567
  /* @__PURE__ */ s("span", { className: "cat-tile-label", children: n.label }),
229
- /* @__PURE__ */ s("span", { className: "cat-tile-value", children: l ? ge(n.value) : n.value }),
230
- 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" })
231
572
  ]
232
573
  },
233
574
  n.id
234
575
  );
235
576
  }) });
236
577
  }
237
- const R = Y(null);
238
- function ve() {
239
- return K(R);
578
+ const V = J(null);
579
+ function Ue() {
580
+ return Z(V);
240
581
  }
241
- function be({ mode: e, dispatch: t }) {
242
- const o = ve();
243
- if (o == null && e == null) return null;
244
- const n = o?.mode ?? e ?? "add", r = o?.selectedTileId ?? null, l = o?.description ?? null, d = r == null;
245
- return /* @__PURE__ */ p("div", { className: "panel-footer catalog", children: [
246
- /* @__PURE__ */ s("div", { className: "cat-description", id: "cat-desc", children: l ?? /* @__PURE__ */ s("em", { children: "Tap a metric to see its description" }) }),
247
- /* @__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: [
248
589
  /* @__PURE__ */ s("div", { className: "spacer", style: { flex: 1 } }),
249
590
  /* @__PURE__ */ s(
250
591
  "button",
@@ -281,178 +622,150 @@ function be({ mode: e, dispatch: t }) {
281
622
  ] })
282
623
  ] });
283
624
  }
284
- const Q = [
285
- "Revenue",
286
- "Order flow",
287
- "Rep performance",
288
- "Brand portfolio",
289
- "Account coverage",
290
- "Commission"
291
- ], X = "Order flow", J = {
292
- Revenue: [
293
- { id: "rev-mtd", label: "Revenue MTD", value: "$184K", desc: "Month-to-date revenue across all manufacturers and territories." },
294
- { id: "rev-ytd", label: "Revenue YTD", value: "$2.1M", desc: "Year-to-date revenue including pending and posted orders.", variants: ["1×1", "1×3"] },
295
- { id: "rev-yoy", label: "YoY Δ", value: "+12.4%", desc: "Revenue growth versus the prior comparable period." },
296
- { id: "rev-avg", label: "Avg order", value: "$1,820", desc: "Average order value over the last 30 days." }
297
- ],
298
- "Order flow": [
299
- {
300
- id: "of-funnel",
301
- label: "Order funnel",
302
- value: "New 42 · Incomplete 18 · Transmitted 91",
303
- stack: !0,
304
- desc: "Funnel snapshot — new orders, incomplete (awaiting attention), and transmitted to manufacturer.",
305
- variants: ["1×3"]
306
- },
307
- { id: "of-incomplete", label: "Incomplete", value: "18", desc: "Orders started but not yet transmitted." },
308
- { id: "of-transmitted", label: "Transmitted", value: "91", desc: "Orders successfully sent to manufacturer." },
309
- { id: "of-today", label: "New today", value: "7", desc: "Orders created in the current calendar day." },
310
- { id: "of-velocity", label: "Order velocity", value: "+3.1/d", desc: "Rolling 7-day order-creation rate change." }
311
- ],
312
- "Rep performance": [
313
- { id: "rp-leader", label: "#1 Rep", value: "A. Chen", desc: "Top revenue performer in the current period." },
314
- { id: "rp-quota", label: "Below quota", value: "4 reps", desc: "Reps currently tracking below pace-to-quota." },
315
- { id: "rp-commission", label: "Commission pace", value: "$48K", desc: "Projected commission pool at current burn rate." },
316
- { id: "rp-active", label: "Active reps", value: "14", desc: "Reps with at least one order this period." }
317
- ],
318
- "Brand portfolio": [
319
- { id: "bp-top", label: "Top brand", value: "Acme Co.", desc: "Highest-revenue manufacturer this period." },
320
- { id: "bp-mix", label: "Mix Δ", value: "+2pp", desc: "Portfolio mix shift versus the prior period." },
321
- { id: "bp-coverage", label: "Brand coverage", value: "73%", desc: "Percent of accounts with at least one active brand." },
322
- { id: "bp-new", label: "New brand adds", value: "3", desc: "Brands with first-order activity this period." }
323
- ],
324
- "Account coverage": [
325
- { id: "ac-active", label: "Active accounts", value: "128", desc: "Accounts with at least one order in the period." },
326
- { id: "ac-untouched", label: "Untouched", value: "34", desc: "Accounts with zero activity in the period." },
327
- { id: "ac-concentration", label: "Concentration", value: "38% top-5", desc: "Revenue concentration in top-5 accounts." },
328
- { id: "ac-new", label: "New accounts", value: "6", desc: "Accounts with first-ever order this period." }
329
- ],
330
- Commission: [
331
- { id: "cm-projected", label: "Projected", value: "$48K", desc: "Forecast commission at current pace." },
332
- { id: "cm-paid", label: "Paid", value: "$31K", desc: "Commission posted to ledger this period." },
333
- { id: "cm-pending", label: "Pending", value: "$17K", desc: "Commission earned but not yet posted." },
334
- { id: "cm-rate", label: "Effective rate", value: "6.8%", desc: "Realized commission rate across all orders." }
335
- ]
336
- };
337
- function qe({
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({
338
636
  isOpen: e,
339
- lenses: t = Q,
340
- defaultLens: o = X,
341
- tilesByLens: n = J,
342
- footerSlot: r
637
+ lenses: t = ee,
638
+ defaultLens: r = te,
639
+ tilesByLens: n = ne,
640
+ lensMeta: c = U,
641
+ footerSlot: i
343
642
  }) {
344
- const [l, d] = b(o), [i, a] = b(null), [c, u] = b(null), h = n[l] ?? [];
345
- return /* @__PURE__ */ p(
346
- 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,
347
652
  {
348
- value: { mode: "add", selectedTileId: i, description: c },
653
+ value: { mode: "add", selectedTileId: a, description: u },
349
654
  children: [
350
- /* @__PURE__ */ p("div", { "data-shell": "catalog-add", "aria-hidden": !e, children: [
351
- /* @__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
+ ) }),
352
667
  /* @__PURE__ */ s(
353
- j,
668
+ se,
354
669
  {
355
670
  lenses: t,
356
- activeLens: l,
671
+ activeLens: d,
672
+ lensMeta: c,
673
+ variant: "pills",
357
674
  onLensChange: (g) => {
358
- d(g), a(null), u(null);
675
+ l(g), o(null), p(null), b("");
359
676
  }
360
677
  }
361
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
+ ] }),
362
683
  /* @__PURE__ */ s(
363
- G,
684
+ H,
364
685
  {
365
- tiles: h,
366
- selectedTileId: i,
367
- onSelectTile: (g, f) => {
368
- a(g), u(f);
686
+ tiles: N,
687
+ selectedTileId: a,
688
+ onSelectTile: (g, S) => {
689
+ o(g), p(S);
369
690
  }
370
691
  }
371
- )
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
+ ] })
372
711
  ] }),
373
- r
712
+ i
374
713
  ]
375
714
  }
376
715
  );
377
716
  }
378
- function Ue({
717
+ function vt({
379
718
  isOpen: e,
380
719
  replacingLabel: t,
381
- lenses: o = Q,
382
- defaultLens: n = X,
383
- tilesByLens: r = J,
384
- footerSlot: l
720
+ lenses: r = ee,
721
+ defaultLens: n = te,
722
+ tilesByLens: c = ne,
723
+ footerSlot: i
385
724
  }) {
386
- const [d, i] = b(n), [a, c] = b(null), [u, h] = b(null), g = r[d] ?? [];
387
- return /* @__PURE__ */ p(
388
- 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,
389
728
  {
390
729
  value: { mode: "replace", selectedTileId: a, description: u },
391
730
  children: [
392
- /* @__PURE__ */ p("div", { "data-shell": "catalog-replace", "aria-hidden": !e, children: [
393
- /* @__PURE__ */ s("h3", { children: "Replace metric" }),
394
- 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: [
395
733
  "replacing ",
396
734
  t
397
735
  ] }),
398
736
  /* @__PURE__ */ s(
399
- j,
737
+ se,
400
738
  {
401
- lenses: o,
739
+ lenses: r,
402
740
  activeLens: d,
403
- onLensChange: (f) => {
404
- i(f), c(null), h(null);
741
+ onLensChange: (y) => {
742
+ l(y), o(null), p(null);
405
743
  }
406
744
  }
407
745
  ),
408
746
  /* @__PURE__ */ s(
409
- G,
747
+ H,
410
748
  {
411
- tiles: g,
749
+ tiles: b,
412
750
  selectedTileId: a,
413
- onSelectTile: (f, y) => {
414
- c(f), h(y);
751
+ onSelectTile: (y, v) => {
752
+ o(y), p(v);
415
753
  }
416
754
  }
417
755
  )
418
756
  ] }),
419
- l
757
+ i
420
758
  ]
421
759
  }
422
760
  );
423
761
  }
424
- function ye({ page: e, onRename: t, onKebab: o, onDragStart: n }) {
425
- const r = ["pm-row"];
426
- return e.active && r.push("active"), /* @__PURE__ */ p("div", { className: r.join(" "), "data-page-id": e.id, role: "listitem", children: [
427
- /* @__PURE__ */ s(
428
- "div",
429
- {
430
- className: "pm-handle",
431
- "aria-hidden": "true",
432
- onMouseDown: () => n?.(e.id),
433
- children: "⋮⋮"
434
- }
435
- ),
436
- /* @__PURE__ */ s("div", { className: "pm-name", onClick: () => t?.(e.id), children: e.name }),
437
- /* @__PURE__ */ s(
438
- "button",
439
- {
440
- type: "button",
441
- className: "pm-kebab",
442
- "aria-label": "Page options",
443
- onClick: () => o?.(e.id),
444
- children: "⋯"
445
- }
446
- )
447
- ] });
448
- }
449
- const Z = Y(null);
450
- function Ce() {
451
- return K(Z);
762
+ const ae = J(null);
763
+ function re() {
764
+ return Z(ae);
452
765
  }
453
- function Pe(e = {}) {
454
- const o = Ce()?.setPages;
455
- return /* @__PURE__ */ p(
766
+ function Be(e = {}) {
767
+ const r = re()?.setPages;
768
+ return /* @__PURE__ */ h(
456
769
  "div",
457
770
  {
458
771
  className: "panel-footer pm",
@@ -466,7 +779,7 @@ function Pe(e = {}) {
466
779
  type: "button",
467
780
  className: "btn btn-primary",
468
781
  onClick: () => {
469
- o && o((n) => [
782
+ r && r((n) => [
470
783
  ...n,
471
784
  { id: `new-${Date.now()}`, name: "Untitled", active: !1 }
472
785
  ]);
@@ -478,38 +791,112 @@ function Pe(e = {}) {
478
791
  }
479
792
  );
480
793
  }
481
- 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 = [
482
857
  { id: "p-pipeline", name: "My Pipeline", active: !0 },
483
858
  { id: "p-numbers", name: "My Numbers", active: !1 },
484
859
  { id: "p-morning", name: "My Morning", active: !1 },
485
860
  { id: "p-accounts", name: "My Accounts", active: !1 }
486
861
  ];
487
- function Ye({
862
+ function yt({
488
863
  isOpen: e,
489
- pages: t = _e,
490
- footerSlot: o
864
+ pages: t = We,
865
+ footerSlot: r
491
866
  }) {
492
- const [n, r] = b(() => [...t]);
493
- return /* @__PURE__ */ p(Z.Provider, { value: { pages: n, setPages: r }, children: [
494
- /* @__PURE__ */ p("div", { "data-shell": "page-management", "aria-hidden": !e, children: [
495
- /* @__PURE__ */ s("h3", { children: "Manage pages" }),
496
- /* @__PURE__ */ s("div", { className: "pm-list", role: "list", children: n.map((l) => /* @__PURE__ */ s(ye, { page: l }, l.id)) })
497
- ] }),
498
- o
499
- ] });
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
+ ] }) });
500
887
  }
501
- const Ke = {
888
+ const St = {
502
889
  SETTINGS: "settings",
503
890
  CATALOG_ADD: "catalog-add",
504
891
  CATALOG_REPLACE: "catalog-replace",
505
892
  PAGE_MGMT: "page-management",
506
893
  NOTIFICATION_CENTER: "notification-center"
507
- }, Ne = {
894
+ }, qe = {
508
895
  position: "fixed",
509
896
  inset: 0,
510
897
  pointerEvents: "none",
511
898
  zIndex: 55
512
- }, Se = {
899
+ }, Ge = {
513
900
  position: "absolute",
514
901
  inset: 0,
515
902
  zIndex: 1,
@@ -518,69 +905,88 @@ const Ke = {
518
905
  pointerEvents: "none",
519
906
  background: "rgba(0, 0, 0, 0.04)"
520
907
  };
521
- function We() {
522
- const { state: e, dispatch: t, getCloseLog: o } = oe();
523
- V(() => {
908
+ function _t() {
909
+ const { state: e, dispatch: t, getCloseLog: r } = fe();
910
+ x(() => {
524
911
  if (e.activePanelId == null) return;
525
- function l(d) {
912
+ function i(d) {
526
913
  d.key === "Escape" && t({ type: "CLOSE_PANEL", reason: "escape-key" });
527
914
  }
528
- return document.addEventListener("keydown", l), () => document.removeEventListener("keydown", l);
915
+ return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
529
916
  }, [e.activePanelId, t]);
530
- const n = U(e);
531
- re(() => {
917
+ const n = I(e);
918
+ ge(() => {
532
919
  n.current = e;
533
- }), V(() => {
920
+ }), x(() => {
534
921
  if (process.env.NODE_ENV === "production") return;
535
- const l = window;
536
- 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 = {
537
924
  dispatch: t,
538
925
  getState: () => n.current,
539
- getCloseLog: o
926
+ getCloseLog: r
540
927
  }, () => {
541
- l.__panelsHostHandle?.dispatch === t && delete window.__panelsHostHandle;
928
+ i.__panelsHostHandle?.dispatch === t && delete window.__panelsHostHandle;
542
929
  };
543
- }, [t, o]);
544
- const r = W(() => {
930
+ }, [t, r]);
931
+ const c = E(() => {
545
932
  t({ type: "CLOSE_PANEL", reason: "nav-escape-hatch" });
546
933
  }, [t]);
547
- 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(
548
935
  "div",
549
936
  {
550
937
  "data-panel-scrim": "true",
551
- style: Se,
552
- onClick: r
938
+ style: Ge,
939
+ onClick: c
553
940
  }
554
941
  ) });
555
942
  }
556
- function je({ panelComponents: e, children: t }) {
557
- const o = I();
558
- if (o == null) return null;
559
- const { state: n, dispatch: r } = o;
560
- if (n.activePanelId == null) return null;
561
- const l = e?.[n.activePanelId];
562
- 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)
563
967
  return process.env.NODE_ENV !== "production" && console.error(
564
968
  "[panels] No panel component registered for activePanelId:",
565
- n.activePanelId
969
+ d
566
970
  ), null;
567
- if (n.activePanelId === "settings") {
568
- const d = n.isDirty, i = n.activeTrigger, a = i?.kind === "card-overflow" ? i.cardId : null;
569
- return /* @__PURE__ */ s(E, { isOpen: !0, children: /* @__PURE__ */ s(
570
- 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,
571
975
  {
572
- isOpen: !0,
573
- onClose: () => r({ type: "CLOSE_PANEL", reason: "header-x" }),
574
- 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: [
575
981
  /* @__PURE__ */ s(
576
982
  "button",
577
983
  {
578
984
  id: "btn-reset",
579
985
  type: "button",
580
986
  className: "gloss-panel-chrome__footer-btn",
581
- disabled: !d,
987
+ disabled: !o,
582
988
  onClick: () => {
583
- a != null && r({ type: "CLEAR_BUFFER", cardId: a });
989
+ p != null && c({ type: "CLEAR_BUFFER", cardId: p });
584
990
  },
585
991
  children: "Reset"
586
992
  }
@@ -592,7 +998,7 @@ function je({ panelComponents: e, children: t }) {
592
998
  id: "settings-cancel",
593
999
  type: "button",
594
1000
  className: "gloss-panel-chrome__footer-btn",
595
- onClick: () => r({ type: "CLOSE_PANEL", reason: "cancel-button" }),
1001
+ onClick: () => c({ type: "CLOSE_PANEL", reason: "cancel-button" }),
596
1002
  children: "Cancel"
597
1003
  }
598
1004
  ),
@@ -602,271 +1008,273 @@ function je({ panelComponents: e, children: t }) {
602
1008
  id: "settings-apply",
603
1009
  type: "button",
604
1010
  className: "gloss-panel-chrome__footer-btn gloss-panel-chrome__footer-btn--primary",
605
- disabled: !d,
606
- onClick: () => r({ type: "CLOSE_PANEL", reason: "apply-button" }),
1011
+ disabled: !o,
1012
+ onClick: () => c({ type: "CLOSE_PANEL", reason: "apply-button" }),
607
1013
  children: "Apply"
608
1014
  }
609
1015
  )
610
1016
  ] }),
611
- children: l != null ? /* @__PURE__ */ s(l, { isOpen: !0 }) : t
1017
+ children: a != null ? /* @__PURE__ */ s(a, { isOpen: l }) : t
612
1018
  }
613
1019
  ) });
614
1020
  }
615
- if (n.activePanelId === "catalog-add" || n.activePanelId === "catalog-replace") {
616
- if (l == null) return null;
617
- const d = n.activePanelId === "catalog-replace" ? "replace" : "add";
618
- return /* @__PURE__ */ s(E, { isOpen: !0, children: /* @__PURE__ */ s(
619
- 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,
620
1026
  {
621
- isOpen: !0,
622
- onClose: () => r({ type: "CLOSE_PANEL", reason: "header-x" }),
1027
+ isOpen: l,
1028
+ onClose: () => c({ type: "CLOSE_PANEL", reason: "header-x" }),
623
1029
  footer: null,
1030
+ title: o === "replace" ? "Replace metric" : "Add a metric",
624
1031
  children: /* @__PURE__ */ s(
625
- l,
1032
+ a,
626
1033
  {
627
- isOpen: !0,
628
- footerSlot: /* @__PURE__ */ s(be, { mode: d, dispatch: r })
1034
+ isOpen: l,
1035
+ footerSlot: /* @__PURE__ */ s(Ve, { mode: o, dispatch: c })
629
1036
  }
630
1037
  )
631
1038
  }
632
1039
  ) });
633
1040
  }
634
- return n.activePanelId === "page-management" ? l == null ? null : /* @__PURE__ */ s(E, { isOpen: !0, children: /* @__PURE__ */ s(
635
- A,
1041
+ return d === "page-management" ? a == null ? null : /* @__PURE__ */ s(A, { isOpen: l, children: /* @__PURE__ */ s(
1042
+ T,
636
1043
  {
637
- isOpen: !0,
638
- onClose: () => r({ type: "CLOSE_PANEL", reason: "header-x" }),
1044
+ isOpen: l,
1045
+ onClose: () => c({ type: "CLOSE_PANEL", reason: "header-x" }),
639
1046
  footer: null,
640
- 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, {}) })
641
1049
  }
642
- ) }) : /* @__PURE__ */ s(E, { isOpen: !0, children: /* @__PURE__ */ s(
643
- A,
1050
+ ) }) : /* @__PURE__ */ s(A, { isOpen: l, children: /* @__PURE__ */ s(
1051
+ T,
644
1052
  {
645
1053
  isOpen: !0,
646
- onClose: () => r({ type: "CLOSE_PANEL", reason: "header-x" }),
1054
+ onClose: () => c({ type: "CLOSE_PANEL", reason: "header-x" }),
647
1055
  footer: null,
648
- children: l != null ? /* @__PURE__ */ s(l, { isOpen: !0 }) : t
1056
+ children: a != null ? /* @__PURE__ */ s(a, { isOpen: l }) : t
649
1057
  }
650
1058
  ) });
651
1059
  }
652
- function B(e) {
1060
+ function Y(e) {
653
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;
654
1062
  }
655
- const we = 685, H = 627, Ee = "cubic-bezier(0.22, 1, 0.36, 1)", Ae = 200;
656
- 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) {
657
1065
  if (typeof window > "u") return t;
658
- const o = window.getComputedStyle(document.documentElement).getPropertyValue(e).trim();
659
- if (!o) return t;
660
- const n = parseFloat(o);
661
- 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;
662
1070
  }
663
- function xe(e, t) {
1071
+ function Ze(e, t) {
664
1072
  return typeof window > "u" ? t : window.getComputedStyle(document.documentElement).getPropertyValue(e).trim() || t;
665
1073
  }
666
- function x(e) {
1074
+ function L(e) {
667
1075
  e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger });
668
1076
  }
669
- function Te(e) {
670
- const { mountEl: t, chromeEl: o, reducedMotion: n, onAssert: r } = e;
671
- if (t == null || o == null) {
672
- 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() });
673
1081
  return;
674
1082
  }
675
1083
  if (n) {
676
- 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() });
677
1085
  return;
678
1086
  }
679
- if (typeof o.animate != "function") {
680
- 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() });
681
1089
  return;
682
1090
  }
683
- const l = o.cloneNode(!0);
684
- 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 });
685
- 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(
686
1094
  [{ transform: "translateY(100%)" }, { transform: "translateY(0)" }],
687
- { duration: d, easing: i, fill: "forwards" }
1095
+ { duration: d, easing: l, fill: "forwards" }
688
1096
  );
689
1097
  a.addEventListener(
690
1098
  "finish",
691
1099
  () => {
692
- 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() });
693
1101
  },
694
1102
  { once: !0 }
695
1103
  );
696
1104
  }
697
- function Ie(e) {
698
- const { mountEl: t, onAssert: o } = e;
1105
+ function tt(e) {
1106
+ const { mountEl: t, onAssert: r } = e;
699
1107
  if (t == null) {
700
- 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() });
701
1109
  return;
702
1110
  }
703
- const n = ee("--panel-close-dur", H);
704
- let r = !1, l = null;
1111
+ const n = le("--panel-close-dur", j);
1112
+ let c = !1, i = null;
705
1113
  const d = (a) => {
706
- 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() }));
707
- }, i = () => {
708
- 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() }));
709
1117
  };
710
- 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);
711
1119
  }
712
- function Le(e) {
713
- const { state: t, onAssert: o } = e;
1120
+ function nt(e) {
1121
+ const { state: t, onAssert: r } = e;
714
1122
  if (t.activePanelId && t.isDirty) {
715
- 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() });
716
1124
  return;
717
1125
  }
718
- const n = B(t.activeTrigger), r = B(e.trigger);
719
- if (!!t.activePanelId && n != null && n === r) {
720
- Te(e);
1126
+ const n = Y(t.activeTrigger), c = Y(e.trigger);
1127
+ if (!!t.activePanelId && n != null && n === c) {
1128
+ et(e);
721
1129
  return;
722
1130
  }
723
1131
  if (t.activePanelId) {
724
- Ie(e);
1132
+ tt(e);
725
1133
  return;
726
1134
  }
727
- x(e), o?.({ branch: "fresh-open", timestamp: Date.now() });
1135
+ L(e), r?.({ branch: "fresh-open", timestamp: Date.now() });
728
1136
  }
729
- function Oe() {
1137
+ function st() {
730
1138
  if (!(typeof window > "u"))
731
1139
  return window.__panelsAsserter;
732
1140
  }
733
- function Ge() {
734
- const e = I(), t = q();
735
- return W(
736
- (o, n) => {
1141
+ function Ct() {
1142
+ const e = k(), t = Q();
1143
+ return E(
1144
+ (r, n) => {
737
1145
  if (!e)
738
1146
  return;
739
- const r = typeof document < "u" ? document.querySelector('[data-mount="panel"]') : null, l = typeof document < "u" ? document.querySelector('[data-chrome="panel"]') : null, d = {
740
- 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,
741
1149
  trigger: n,
742
1150
  state: e.state,
743
1151
  dispatch: e.dispatch,
744
- mountEl: r,
745
- chromeEl: l,
1152
+ mountEl: c,
1153
+ chromeEl: i,
746
1154
  reducedMotion: t,
747
- onAssert: (i) => {
748
- Oe()?.recordTransition?.(i);
1155
+ onAssert: (l) => {
1156
+ st()?.recordTransition?.(l);
749
1157
  }
750
1158
  };
751
- Le(d);
1159
+ nt(d);
752
1160
  },
753
1161
  [e, t]
754
1162
  );
755
1163
  }
756
- let T = !1, L = null;
757
- function $() {
1164
+ let O = !1, D = null;
1165
+ function z() {
758
1166
  const e = [];
759
1167
  let t = "cleaned";
760
1168
  document.querySelectorAll("#panel-chrome-frozen").length > 0 && (e.push("#panel-chrome-frozen"), t = "lingering");
761
1169
  const n = document.querySelectorAll(".gloss-panel-mount");
762
1170
  n.length > 1 && e.push(`mount-count=${n.length}`);
763
- const r = n[0] ?? null, l = r ? r.querySelectorAll(".gloss-panel-chrome") : [];
764
- l.length > 1 && e.push(`chrome-count=${l.length}`);
765
- 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;
766
1174
  if (d) {
767
1175
  const u = d.style.zIndex;
768
1176
  u !== "" && u !== "2" && e.push(`chrome-zindex=${u}`);
769
1177
  }
770
- const i = r ? "present" : "absent", a = d ? "present" : "absent";
1178
+ const l = c ? "present" : "absent", a = d ? "present" : "absent";
771
1179
  return {
772
1180
  valid: e.length === 0,
773
- mount: i,
1181
+ mount: l,
774
1182
  chrome: a,
775
1183
  frozen: t,
776
1184
  orphans: e,
777
1185
  timestamp: Date.now()
778
1186
  };
779
1187
  }
780
- const O = "8px 8px 0px", k = "64px", M = "inset(0px 0px 60px 0px)", D = "inset(0px -40px -40px -40px)";
781
- function m(e, t, o, n, r) {
782
- 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 };
783
1191
  }
784
1192
  function P(e) {
785
1193
  const t = parseInt(e, 10);
786
1194
  return Number.isFinite(t) ? t : NaN;
787
1195
  }
788
- function F() {
789
- 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");
790
1198
  if (!t)
791
- 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));
792
1200
  else {
793
- 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;
794
1202
  e.push(
795
- m(
1203
+ f(
796
1204
  "C1",
797
1205
  "mount --reveal-y matches clip-path inset-bottom Npx",
798
- `inset(0 0 ${g}px 0) === --reveal-y(${g}px)`,
799
- `--reveal-y=${a || "n/a"} clip-path=${c || "n/a"}`,
800
- 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
801
1209
  )
802
1210
  );
803
1211
  }
804
1212
  if (!t)
805
- e.push(m("C2", "mount padding constant", O, "absent", !1));
1213
+ e.push(f("C2", "mount padding constant", M, "absent", !1));
806
1214
  else {
807
- const i = t.style.padding, a = getComputedStyle(t), c = i || a.padding || "", u = c === O || c === "8px 8px 0px 8px";
808
- 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));
809
1217
  }
810
1218
  if (!t)
811
- e.push(m("C3", "mount.bottom resolves to var(--tb-h)=64px", k, "absent", !1));
1219
+ e.push(f("C3", "mount.bottom resolves to var(--tb-h)=64px", R, "absent", !1));
812
1220
  else {
813
- const a = getComputedStyle(t).bottom || t.style.bottom || "", c = a === k;
814
- e.push(m("C3", "mount.bottom resolves to var(--tb-h)=64px", k, 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));
815
1223
  }
816
- if (!o)
817
- 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));
818
1226
  else {
819
- const i = getComputedStyle(o), a = P(
820
- i.getPropertyValue("--row-h").trim() || o.style.getPropertyValue("--row-h").trim() || "0"
821
- ), c = P(
822
- i.getPropertyValue("--row-gap").trim() || o.style.getPropertyValue("--row-gap").trim() || "0"
823
- ), 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;
824
1232
  e.push(
825
- m(
1233
+ f(
826
1234
  "C4",
827
1235
  "panel-chrome height formula = (row-h*3)+(row-gap*3)-8px",
828
- `${u}px (rh=${a} rg=${c})`,
829
- `${h}px`,
830
- g
1236
+ `${u}px (rh=${a} rg=${o})`,
1237
+ `${p}px`,
1238
+ m
831
1239
  )
832
1240
  );
833
1241
  }
834
- if (!n || !o)
1242
+ if (!n || !r)
835
1243
  e.push(
836
- m(
1244
+ f(
837
1245
  "C5",
838
1246
  'coordinator perspective + origin "center bottom"; chrome perspective-style flat',
839
1247
  "present",
840
- `coordinator=${n ? "present" : "absent"} chrome=${o ? "present" : "absent"}`,
1248
+ `coordinator=${n ? "present" : "absent"} chrome=${r ? "present" : "absent"}`,
841
1249
  !1
842
1250
  )
843
1251
  );
844
1252
  else {
845
- 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";
846
1254
  e.push(
847
- m(
1255
+ f(
848
1256
  "C5",
849
1257
  'coordinator perspective + origin "center bottom"; chrome perspective-style flat',
850
1258
  "perspective:not-none, origin:center bottom, chrome-style:flat",
851
- `perspective=${c} origin=${u} chrome-style=${h}`,
1259
+ `perspective=${o} origin=${u} chrome-style=${p}`,
852
1260
  v
853
1261
  )
854
1262
  );
855
1263
  }
856
1264
  {
857
- let i = !1, a = "absent";
1265
+ let l = !1, a = "absent";
858
1266
  try {
859
- for (const c of Array.from(document.styleSheets)) {
1267
+ for (const o of Array.from(document.styleSheets)) {
860
1268
  let u = [];
861
1269
  try {
862
- u = Array.from(c.cssRules ?? []);
1270
+ u = Array.from(o.cssRules ?? []);
863
1271
  } catch {
864
1272
  continue;
865
1273
  }
866
- for (const h of u)
867
- if (h.name === "stage-spin") {
868
- 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*\)/;
869
- 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"}`;
870
1278
  break;
871
1279
  }
872
1280
  if (a !== "absent") break;
@@ -875,69 +1283,69 @@ function F() {
875
1283
  a = "inspection-error";
876
1284
  }
877
1285
  e.push(
878
- m(
1286
+ f(
879
1287
  "C6",
880
1288
  "@keyframes stage-spin 0% AND 100% anchor at rotateY(0)",
881
1289
  "both frames rotateY(0)",
882
1290
  a,
883
- i
1291
+ l
884
1292
  )
885
1293
  );
886
1294
  }
887
1295
  {
888
- 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;
889
1297
  e.push(
890
- 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)
891
1299
  );
892
1300
  }
893
- if (!r)
894
- 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));
895
1303
  else {
896
- 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");
897
1305
  e.push(
898
- m(
1306
+ f(
899
1307
  "C8",
900
1308
  "BellCutout zero computed animation/transition",
901
1309
  "animation:none AND transition:none",
902
- `animation=${a || "n/a"} transition=${c || "n/a"}`,
1310
+ `animation=${a || "n/a"} transition=${o || "n/a"}`,
903
1311
  u
904
1312
  )
905
1313
  );
906
1314
  }
907
1315
  if (!t)
908
- e.push(m("C9", "mount closed-state clipPath", M, "absent", !1));
1316
+ e.push(f("C9", "mount closed-state clipPath", $, "absent", !1));
909
1317
  else {
910
- const i = t.style.clipPath, a = getComputedStyle(t), c = i || a.clipPath || "", u = c === M;
911
- e.push(m("C9", "mount closed-state clipPath", M, 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));
912
1320
  }
913
- if (!l)
914
- 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));
915
1323
  else {
916
- const i = l.parentElement, a = i === document.body;
1324
+ const l = i.parentElement, a = l === document.body;
917
1325
  e.push(
918
- m(
1326
+ f(
919
1327
  "C10",
920
1328
  "bell-popover parentElement === document.body (open)",
921
1329
  "body",
922
- i === document.body ? "body" : i?.tagName ?? "n/a",
1330
+ l === document.body ? "body" : l?.tagName ?? "n/a",
923
1331
  a
924
1332
  )
925
1333
  );
926
1334
  }
927
1335
  if (!n)
928
- e.push(m("C11", "coordinator overflow === visible", "visible", "absent", !1));
1336
+ e.push(f("C11", "coordinator overflow === visible", "visible", "absent", !1));
929
1337
  else {
930
- const a = getComputedStyle(n).overflow || n.style.overflow || "", c = a === "visible";
931
- 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));
932
1340
  }
933
1341
  if (!d)
934
- e.push(m("C12", "toolbar clipPath = inset(0 -40 -40 -40)", D, "absent", !1));
1342
+ e.push(f("C12", "toolbar clipPath = inset(0 -40 -40 -40)", F, "absent", !1));
935
1343
  else {
936
- const i = d.style.clipPath, a = getComputedStyle(d), c = i || a.clipPath || "", u = c === D;
937
- e.push(m("C12", "toolbar clipPath = inset(0 -40 -40 -40)", D, 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));
938
1346
  }
939
1347
  return e.push(
940
- m(
1348
+ f(
941
1349
  "C13",
942
1350
  "same-position slide via WAAPI (mid-transition getAnimations().length > 0)",
943
1351
  "WAAPI driver wired in orchestrator (source-proof)",
@@ -945,7 +1353,7 @@ function F() {
945
1353
  "wiring_only"
946
1354
  )
947
1355
  ), e.push(
948
- m(
1356
+ f(
949
1357
  "C14",
950
1358
  'cross-position handoff transitionend filtered by propertyName="max-height"',
951
1359
  "transitionend filter wired in orchestrator (source-proof)",
@@ -954,11 +1362,11 @@ function F() {
954
1362
  )
955
1363
  ), e;
956
1364
  }
957
- function ke(e) {
958
- return F().find((t) => t.id === e);
1365
+ function at(e) {
1366
+ return B().find((t) => t.id === e);
959
1367
  }
960
- function Me() {
961
- const e = $();
1368
+ function rt() {
1369
+ const e = z();
962
1370
  return { q12: [
963
1371
  {
964
1372
  id: "Q12-12",
@@ -967,75 +1375,76 @@ function Me() {
967
1375
  actual: `valid=${e.valid} mount=${e.mount} chrome=${e.chrome} frozen=${e.frozen} orphans=[${e.orphans.join(",")}]`,
968
1376
  pass: e.valid
969
1377
  }
970
- ], cc: F() };
1378
+ ], cc: B() };
971
1379
  }
972
- function De() {
1380
+ function lt() {
973
1381
  return {
974
- enable: $e,
975
- disable: Re,
976
- isEnabled: () => T,
977
- getLastReport: () => L,
1382
+ enable: ot,
1383
+ disable: it,
1384
+ isEnabled: () => O,
1385
+ getLastReport: () => D,
978
1386
  recordTransition: (e) => {
979
- T && (L = { ...e, ...$() });
1387
+ O && (D = { ...e, ...z() });
980
1388
  },
981
1389
  assertOnce: () => {
982
- const e = $();
983
- return L = e, e;
1390
+ const e = z();
1391
+ return D = e, e;
984
1392
  },
985
- assertCcOnly: F,
986
- getCcRowById: ke,
987
- assertPanelTruths: Me
1393
+ assertCcOnly: B,
1394
+ getCcRowById: at,
1395
+ assertPanelTruths: rt
988
1396
  };
989
1397
  }
990
- function $e() {
991
- if (T = !0, typeof window > "u") return;
992
- 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(
993
1401
  "[panels] asserter enabled (P3b Q12-12 + P6 W5 cc:C1..C14). Inspect via window.__panelsAsserter."
994
1402
  ));
995
1403
  }
996
- function Re() {
997
- T = !1;
1404
+ function it() {
1405
+ O = !1;
998
1406
  }
999
1407
  export {
1000
- Je as COMMITS,
1001
- qe as CatalogAddShell,
1002
- be as CatalogFooter,
1003
- Ue as CatalogReplaceShell,
1004
- R as CatalogStateContext,
1005
- ie as CloneCard,
1006
- le as CloneStage,
1007
- X as MOCK_DEFAULT_LENS,
1008
- Q as MOCK_LENSES,
1009
- _e as MOCK_PAGES,
1010
- J as MOCK_TILES_BY_LENS,
1011
- Ke as PANEL_IDS,
1012
- Pe as PageMgmtFooter,
1013
- Ye as PageMgmtShell,
1014
- Z as PageMgmtStateContext,
1015
- A as PanelChrome,
1016
- Ze as PanelHost,
1017
- We as PanelHostShell,
1018
- E as PanelMount,
1019
- et as PanelProvider,
1020
- je as PanelSlot,
1021
- He as SettingsShell,
1022
- F as assertCcOnly,
1023
- $ as assertPanelDomShape,
1024
- Me as assertPanelTruths,
1025
- tt as deriveSurfaceState,
1026
- Re as disablePanelAsserter,
1027
- $e as enablePanelAsserter,
1028
- ke as getCcRowById,
1029
- nt as initialState,
1030
- B as positionKey,
1031
- st as reducer,
1032
- Le as transitionToPanel,
1033
- ve as useCatalogState,
1034
- Be as useEditingCardId,
1035
- Ce as usePageMgmtState,
1036
- oe as usePanelContext,
1037
- I as usePanelContextOptional,
1038
- ot as usePanelCoordinator,
1039
- q as useReducedMotionPanel,
1040
- Ge 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
1041
1450
  };