@mt-gloss/ui 0.1.138 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/{BaseAsyncButton-CJlY7Uik.js → BaseAsyncButton-Cq_l7clO.js} +29 -30
  2. package/COMMITS-Dm8qIHaq.js +444 -0
  3. package/Expandable-BcmIxWR8.js +13807 -0
  4. package/UIContext-DP6JGCto.js +1731 -0
  5. package/catalog.js +120 -122
  6. package/composites-panels.js +578 -1442
  7. package/index.d.ts +4 -2
  8. package/index.js +2368 -2029
  9. package/internals.js +80 -81
  10. package/lib/base/BaseAccordion/BaseAccordion.d.ts +4 -24
  11. package/lib/base/BaseCard/BaseCard.d.ts +8 -48
  12. package/lib/base/BaseCheckbox/BaseCheckbox.d.ts +1 -6
  13. package/lib/base/BaseInput/BaseInput.d.ts +1 -6
  14. package/lib/base/BaseMaskedInput/BaseMaskedInput.d.ts +1 -6
  15. package/lib/base/BaseMenu/BaseMenu.d.ts +2 -12
  16. package/lib/base/BaseRadio/BaseRadio.d.ts +1 -6
  17. package/lib/base/BaseRating/BaseRating.d.ts +1 -6
  18. package/lib/base/BaseSegmentedControl/BaseSegmentedControl.d.ts +1 -6
  19. package/lib/base/BaseSelect/BaseSelect.d.ts +2 -12
  20. package/lib/base/BaseTextarea/BaseTextarea.d.ts +1 -6
  21. package/lib/base/BaseToggle/BaseToggle.d.ts +1 -6
  22. package/lib/base/BaseTooltip/BaseTooltip.d.ts +1 -6
  23. package/lib/composites/dashboard/BellPopover/BellPopover.d.ts +0 -12
  24. package/lib/composites/forms/PasswordInput.d.ts +1 -6
  25. package/lib/composites/forms/PhoneInput.d.ts +1 -6
  26. package/lib/composites/forms/SearchInput.d.ts +1 -6
  27. package/lib/composites/forms/TagInput.d.ts +1 -6
  28. package/lib/composites/inputs/FilterChip.d.ts +1 -6
  29. package/lib/composites/overlay/SplitButton/SplitButton.d.ts +1 -6
  30. package/lib/composites/panels/PanelChrome.d.ts +1 -23
  31. package/lib/composites/panels/PanelSlot.d.ts +3 -14
  32. package/lib/composites/panels/coordinator/types.d.ts +1 -12
  33. package/lib/composites/panels/index.d.ts +4 -5
  34. package/lib/composites/panels/shells/CatalogAddShell.d.ts +8 -21
  35. package/lib/composites/panels/shells/CatalogReplaceShell.d.ts +4 -9
  36. package/lib/composites/panels/shells/PageMgmtShell.d.ts +3 -28
  37. package/lib/composites/panels/shells/SettingsShell.d.ts +3 -55
  38. package/lib/composites/panels/shells/index.d.ts +2 -2
  39. package/lib/composites/panels/shells/internals/CatalogLensPicker.d.ts +1 -14
  40. package/lib/composites/panels/shells/internals/CatalogTileGrid.d.ts +1 -18
  41. package/lib/composites/panels/shells/internals/PageMgmtFooter.d.ts +0 -11
  42. package/lib/composites/panels/shells/internals/PageMgmtRow.d.ts +1 -6
  43. package/lib/composites/panels/shells/internals/catalog-mocks.d.ts +8 -145
  44. package/lib/composites/panels/stage3d/CloneStage.d.ts +1 -11
  45. package/lib/containers/ContainerDialog/ContainerDialog.d.ts +3 -18
  46. package/lib/containers/ContainerFormSection/ContainerFormSection.d.ts +1 -6
  47. package/lib/containers/ContainerPanel/ContainerPanel.d.ts +1 -6
  48. package/lib/containers/ContainerTable/ContainerTable.d.ts +1 -6
  49. package/lib/containers/ContainerToolbar/ContainerToolbar.d.ts +1 -6
  50. package/lib/facade/index.d.ts +2 -0
  51. package/lib/presets/PresetAccordion/PresetAccordion.d.ts +4 -24
  52. package/lib/presets/PresetBadge/PresetBadge.d.ts +1 -6
  53. package/lib/presets/PresetCard/PresetCard.d.ts +8 -48
  54. package/lib/presets/PresetCheckbox/PresetCheckbox.d.ts +1 -6
  55. package/lib/presets/PresetChip/PresetChip.d.ts +1 -6
  56. package/lib/presets/PresetColorPicker/PresetColorPicker.d.ts +1 -6
  57. package/lib/presets/PresetDatePicker/PresetDatePicker.d.ts +1 -6
  58. package/lib/presets/PresetDateRangePicker/PresetDateRangePicker.d.ts +1 -6
  59. package/lib/presets/PresetFileUpload/PresetFileUpload.d.ts +1 -6
  60. package/lib/presets/PresetInput/PresetInput.d.ts +1 -6
  61. package/lib/presets/PresetLink/PresetLink.d.ts +1 -6
  62. package/lib/presets/PresetMaskedInput/PresetMaskedInput.d.ts +1 -6
  63. package/lib/presets/PresetMenu/PresetMenu.d.ts +2 -13
  64. package/lib/presets/PresetNumberInput/PresetNumberInput.d.ts +1 -6
  65. package/lib/presets/PresetRadio/PresetRadio.d.ts +1 -6
  66. package/lib/presets/PresetRangeSlider/PresetRangeSlider.d.ts +1 -6
  67. package/lib/presets/PresetRating/PresetRating.d.ts +1 -6
  68. package/lib/presets/PresetTextarea/PresetTextarea.d.ts +1 -6
  69. package/lib/presets/PresetTimePicker/PresetTimePicker.d.ts +1 -6
  70. package/lib/presets/PresetToggle/PresetToggle.d.ts +1 -6
  71. package/lib/primitives/dashboard/ResizePill/ResizePill.d.ts +1 -7
  72. package/lib/primitives/dashboard/index.d.ts +0 -1
  73. package/lib/wrappers/Actionable/Actionable.d.ts +1 -6
  74. package/lib/wrappers/AsyncLoader/AsyncLoader.d.ts +1 -6
  75. package/lib/wrappers/ButtonGroup/ButtonGroup.d.ts +1 -6
  76. package/lib/wrappers/CheckboxGroup/CheckboxGroup.d.ts +1 -6
  77. package/lib/wrappers/Dismissible/Dismissible.d.ts +1 -6
  78. package/lib/wrappers/Expandable/Expandable.d.ts +1 -6
  79. package/lib/wrappers/InputGroup/InputGroup.d.ts +2 -12
  80. package/lib/wrappers/RadioGroup/RadioGroup.d.ts +1 -6
  81. package/lib/wrappers/Selectable/Selectable.d.ts +1 -6
  82. package/lib/wrappers/Sortable/Sortable.d.ts +1 -6
  83. package/package.json +1 -1
  84. package/ui.css +1 -1
  85. package/BaseText-Dxbk1JJa.js +0 -66
  86. package/COMMITS-aGwevMtR.js +0 -975
  87. package/Expandable-G7SCUlMb.js +0 -13245
  88. package/MetricCard-DOPtBpek.js +0 -698
  89. package/UIContext-CGQI_KJk.js +0 -1808
  90. package/lib/composites/panels/chrome-v2/PanelBody.d.ts +0 -5
  91. package/lib/composites/panels/chrome-v2/PanelChromeV2.d.ts +0 -18
  92. package/lib/composites/panels/chrome-v2/PanelFooter.d.ts +0 -6
  93. package/lib/composites/panels/chrome-v2/PanelFooterMessage.d.ts +0 -6
  94. package/lib/composites/panels/chrome-v2/PanelHeader.d.ts +0 -10
  95. package/lib/composites/panels/chrome-v2/PanelNavigation.d.ts +0 -5
  96. package/lib/composites/panels/chrome-v2/PanelStage.d.ts +0 -5
  97. package/lib/composites/panels/chrome-v2/index.d.ts +0 -23
  98. package/lib/composites/panels/coordinator/settingsBufferSchemas.d.ts +0 -18
  99. package/lib/composites/panels/hooks/useEditingCardId.d.ts +0 -16
  100. package/lib/composites/panels/shells/NotificationCenterShell.d.ts +0 -2
  101. package/lib/composites/panels/shells/settings/ColorControls.d.ts +0 -13
  102. package/lib/composites/panels/shells/settings/SlotsControls.d.ts +0 -6
  103. package/lib/composites/panels/shells/settings/ThresholdControls.d.ts +0 -10
  104. package/lib/composites/panels/shells/settings/TimeframeControls.d.ts +0 -6
  105. package/lib/composites/panels/shells/settings/index.d.ts +0 -12
  106. package/lib/primitives/dashboard/SettingsTabStrip/SettingsTabStrip.d.ts +0 -17
  107. package/lib/primitives/dashboard/SettingsTabStrip/index.d.ts +0 -6
  108. package/lib/primitives/dashboard/SettingsTabStrip/types.d.ts +0 -12
@@ -1,752 +1,80 @@
1
- import { u as O, g as ke, m as be, n as K, l as De, S as Le, e as Me, o as Oe } from "./COMMITS-aGwevMtR.js";
2
- import { C as en, N as tn, w as nn, x as an, q as sn, f as rn, v as on, P as ln, t as cn, k as dn, j as un, i as pn, h as mn } from "./COMMITS-aGwevMtR.js";
3
- import { jsx as a, jsxs as f, Fragment as q } from "react/jsx-runtime";
4
- import * as H from "react";
5
- import R, { useState as A, useRef as Q, createContext as ye, useContext as ve, useMemo as ce, useEffect as z, useCallback as M, useLayoutEffect as Ie } from "react";
6
- import { SPIN_COMMIT_REDUCED as Re, SPIN_COMMIT_FULL as $e } from "@mt-gloss/motion";
7
- import { useMotionValue as de, animate as B, motion as Fe } from "framer-motion";
8
- import { useSensors as Ue, useSensor as ue, PointerSensor as ze, KeyboardSensor as He, DndContext as Be, closestCenter as Ye } from "@dnd-kit/core";
9
- import { sortableKeyboardCoordinates as Ve, SortableContext as Ke, horizontalListSortingStrategy as qe, arrayMove as Qe, useSortable as We } from "@dnd-kit/sortable";
10
- import { CSS as Ge } from "@dnd-kit/utilities";
11
- import { M as pe } from "./MetricCard-DOPtBpek.js";
12
- function Ht() {
13
- const e = O();
14
- if (e?.state.activePanelId !== "settings") return null;
15
- const t = e.state.activeTrigger;
16
- return t?.kind === "card-overflow" ? t.cardId : null;
17
- }
18
- function je({ span: e, rotating: t = !0, children: r }) {
19
- const l = ["clone-card", `span-${e}`, t ? "rotating" : ""].filter(Boolean).join(" "), n = r != null ? "full" : "fallback";
20
- return /* @__PURE__ */ a("div", { className: l, "data-clone-fidelity": n, children: r });
21
- }
22
- const Ze = 500, Xe = 1, Je = "var(--gloss-color-primary, #6366f1)";
23
- function et({
24
- children: e,
25
- spinTrigger: t,
26
- onSpinComplete: r,
27
- spinDuration: l,
28
- spinRotations: n,
29
- accentColor: i
30
- }) {
31
- const u = de(0), o = de(1), s = H.useRef(null), c = H.useMemo(() => ke() === "reduced", []), d = H.useRef(t);
32
- return H.useEffect(() => {
33
- if (t === void 0 || t === d.current) return;
34
- d.current = t;
35
- const h = (l ?? Ze) / 1e3, y = n ?? Xe, p = s.current;
36
- if (c) {
37
- const _ = [];
38
- if (p) {
39
- const x = B(
40
- p,
41
- { opacity: [0, 0.4, 0] },
42
- Re
43
- );
44
- _.push(x), x.then(() => {
45
- r?.();
46
- });
47
- } else
48
- Promise.resolve().then(() => {
49
- r?.();
50
- });
51
- return () => {
52
- _.forEach((x) => x.stop());
53
- };
54
- }
55
- const v = { ...$e, duration: h }, T = B(u, [0, 360 * y], v), S = B(o, [1, 1.03, 1], v), b = [T, S];
56
- if (p) {
57
- const _ = B(
58
- p,
59
- { opacity: [0, 0.6, 0, 0] },
60
- { ...v, times: [0, 0.3, 0.8, 1] }
61
- );
62
- b.push(_);
63
- }
64
- return T.then(() => {
65
- r?.();
66
- }), () => {
67
- b.forEach((_) => _.stop());
68
- };
69
- }, [t, l, n, c, r, u, o]), /* @__PURE__ */ f(
70
- Fe.div,
71
- {
72
- className: "clone-stage",
73
- style: { rotateY: u, scale: o },
74
- children: [
75
- e,
76
- /* @__PURE__ */ a(
77
- "div",
78
- {
79
- ref: s,
80
- className: "clone-stage__accent",
81
- style: {
82
- "--spin-accent-color": i ?? Je
83
- }
84
- }
85
- )
86
- ]
87
- }
88
- );
89
- }
90
- function Bt({ primary: e, secondary: t }) {
91
- return /* @__PURE__ */ f("div", { className: "gloss-panel-chrome-v2__footer-msg", children: [
92
- /* @__PURE__ */ a("span", { className: "gloss-panel-chrome-v2__footer-msg-primary", children: e }),
93
- t != null && /* @__PURE__ */ a("span", { className: "gloss-panel-chrome-v2__footer-msg-secondary", children: t })
94
- ] });
95
- }
96
- function tt({
97
- value: e,
98
- onChange: t,
99
- enabled: r = !1,
100
- onToggleEnabled: l
1
+ import { u as I, f as q, a as Z, g as N, c as w } from "./COMMITS-Dm8qIHaq.js";
2
+ import { C as Ve, b as qe, P as Be, e as He, i as Ue, r as Ye, d as Ke } from "./COMMITS-Dm8qIHaq.js";
3
+ import { jsx as s, jsxs as h, Fragment as ee } from "react/jsx-runtime";
4
+ import { useState as y, useRef as B, createContext as H, useContext as U, useEffect as F, useLayoutEffect as te, useCallback as Y } from "react";
5
+ function ne({ children: e }) {
6
+ return /* @__PURE__ */ s("div", { className: "clone-stage", children: e });
7
+ }
8
+ function oe({ span: e, rotating: t = !0, children: o }) {
9
+ const n = ["clone-card", `span-${e}`, t ? "rotating" : ""].filter(Boolean).join(" ");
10
+ return /* @__PURE__ */ s("div", { className: n, children: o });
11
+ }
12
+ const se = ["#1d6fd8", "#10b981", "#f59e0b", "#ef4444", "#8b5cf6"];
13
+ function Le({
14
+ isOpen: e,
15
+ cardSpan: t,
16
+ cardLabel: o = "Metric",
17
+ cardValue: n = "—"
101
18
  }) {
102
- const n = "settings-threshold-enabled";
103
- return /* @__PURE__ */ f("div", { className: "settings-shell__field settings-shell__field--threshold", children: [
104
- /* @__PURE__ */ f("div", { className: "settings-shell__toggle-row", children: [
105
- /* @__PURE__ */ a("label", { htmlFor: n, className: "settings-shell__toggle-label", children: "Show threshold indicator" }),
106
- /* @__PURE__ */ a(
107
- "input",
108
- {
109
- id: n,
110
- type: "checkbox",
111
- role: "switch",
112
- "aria-label": "Enable threshold indicator",
113
- "aria-checked": r,
114
- checked: r,
115
- onChange: (i) => l?.(i.target.checked),
116
- className: "settings-shell__toggle"
117
- }
118
- )
119
- ] }),
120
- r ? /* @__PURE__ */ f(q, { children: [
121
- /* @__PURE__ */ a("span", { className: "settings-shell__label", "aria-hidden": "true", children: "Alert level (%)" }),
122
- /* @__PURE__ */ f("div", { className: "settings-shell__slider-row", children: [
123
- /* @__PURE__ */ a(
19
+ const a = I(), r = a?.state.activeTrigger, d = r?.kind === "card-overflow" ? r.cardId : null, l = q(), i = r?.span, c = t ?? i ?? 1, u = d != null ? a?.state?.bufferByCard?.[d]?.changes ?? {} : {}, m = typeof u.threshold == "number" ? u.threshold : 50, f = typeof u.accent == "string" ? u.accent : null, v = (g) => {
20
+ d == null || a == null || a.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "threshold", value: Number(g.target.value) });
21
+ }, b = (g) => {
22
+ d == null || a == null || a.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "accent", value: g });
23
+ };
24
+ return /* @__PURE__ */ h("div", { "data-shell": "settings", "aria-hidden": !e, children: [
25
+ /* @__PURE__ */ s(ne, { children: /* @__PURE__ */ h(oe, { span: c, rotating: !l, children: [
26
+ /* @__PURE__ */ s("div", { style: { fontSize: 9, textTransform: "uppercase", letterSpacing: "0.06em", color: "#9ca3af", marginBottom: 6 }, children: o }),
27
+ /* @__PURE__ */ s("div", { style: { fontSize: 22, fontWeight: 700, color: "#111827", lineHeight: 1 }, children: n })
28
+ ] }) }),
29
+ /* @__PURE__ */ h("div", { className: "settings-shell__controls", children: [
30
+ /* @__PURE__ */ s("h3", { className: "settings-shell__heading", children: "Settings" }),
31
+ /* @__PURE__ */ h("label", { className: "settings-shell__field", children: [
32
+ /* @__PURE__ */ s("span", { className: "settings-shell__label", children: "Threshold" }),
33
+ /* @__PURE__ */ s(
124
34
  "input",
125
35
  {
126
- id: "settings-threshold-input",
127
36
  type: "range",
128
37
  min: 0,
129
38
  max: 100,
130
- value: e,
131
- onChange: t,
39
+ step: 1,
40
+ value: m,
41
+ onChange: v,
42
+ className: "settings-shell__slider",
132
43
  "aria-label": "Threshold",
133
- "aria-valuenow": e,
134
- "aria-valuemin": 0,
135
- "aria-valuemax": 100,
136
- className: "settings-shell__slider"
137
- }
138
- ),
139
- /* @__PURE__ */ f("span", { className: "settings-shell__slider-value", "aria-live": "polite", children: [
140
- e,
141
- "%"
142
- ] })
143
- ] })
144
- ] }) : /* @__PURE__ */ a("p", { className: "settings-shell__help", "aria-live": "polite", children: "Off — the card uses its default styling. Turn on to tint values below the threshold." })
145
- ] });
146
- }
147
- function nt({ value: e, onChange: t }) {
148
- return /* @__PURE__ */ f("div", { className: "settings-shell__field settings-shell__field--timeframe", children: [
149
- /* @__PURE__ */ a("span", { className: "settings-shell__label", "aria-hidden": "true", children: "Rolling period (days)" }),
150
- /* @__PURE__ */ f("div", { className: "settings-shell__slider-row", children: [
151
- /* @__PURE__ */ a(
152
- "input",
153
- {
154
- id: "settings-timeframe-input",
155
- type: "range",
156
- min: 7,
157
- max: 90,
158
- value: e,
159
- onChange: t,
160
- "aria-label": "Timeframe",
161
- "aria-valuenow": e,
162
- "aria-valuemin": 7,
163
- "aria-valuemax": 90,
164
- className: "settings-shell__slider"
165
- }
166
- ),
167
- /* @__PURE__ */ f("span", { className: "settings-shell__slider-value", "aria-live": "polite", children: [
168
- e,
169
- " days"
170
- ] })
171
- ] })
172
- ] });
173
- }
174
- function at({ id: e, onRemove: t }) {
175
- const { attributes: r, listeners: l, setNodeRef: n, transform: i, transition: u, isDragging: o } = We({ id: e }), s = {
176
- transform: Ge.Transform.toString(i),
177
- transition: u,
178
- opacity: o ? 0.6 : 1
179
- };
180
- return /* @__PURE__ */ f(
181
- "li",
182
- {
183
- ref: n,
184
- style: s,
185
- className: `settings-shell__slot-pill${o ? " settings-shell__slot-pill--dragging" : ""}`,
186
- children: [
187
- /* @__PURE__ */ a(
188
- "button",
189
- {
190
- type: "button",
191
- className: "settings-shell__slot-pill__handle",
192
- "aria-label": `Reorder ${e}`,
193
- ...r,
194
- ...l,
195
- children: /* @__PURE__ */ a("span", { "aria-hidden": "true", className: "settings-shell__slot-pill__grip", children: "⋮⋮" })
44
+ "data-testid": "settings-threshold-slider"
196
45
  }
197
46
  ),
198
- /* @__PURE__ */ a("span", { className: "settings-shell__slot-pill__label", children: e }),
199
- /* @__PURE__ */ a(
200
- "button",
201
- {
202
- type: "button",
203
- className: "settings-shell__slot-pill__remove",
204
- "aria-label": `Remove ${e}`,
205
- onClick: t,
206
- children: "×"
207
- }
208
- )
209
- ]
210
- }
211
- );
212
- }
213
- function st({ value: e, onChange: t }) {
214
- const r = Ue(
215
- ue(ze, { activationConstraint: { distance: 4 } }),
216
- ue(He, { coordinateGetter: Ve })
217
- ), l = R.useRef(!1), [n, i] = R.useState(!1), u = (s) => {
218
- const { active: c, over: d } = s;
219
- if (!d || c.id === d.id) return;
220
- const m = e.findIndex((y) => y === c.id), h = e.findIndex((y) => y === d.id);
221
- m === -1 || h === -1 || t(Qe([...e], m, h));
222
- }, o = (s) => {
223
- l.current || (l.current = !0, i(!0)), t(e.filter((c) => c !== s));
224
- };
225
- return /* @__PURE__ */ f("div", { className: "settings-shell__field settings-shell__field--slots", "aria-label": "Stack slots", children: [
226
- /* @__PURE__ */ a(Be, { sensors: r, collisionDetection: Ye, onDragEnd: u, children: /* @__PURE__ */ a(Ke, { items: [...e], strategy: qe, children: /* @__PURE__ */ a("ul", { className: "settings-shell__slots-list", role: "list", children: e.map((s) => /* @__PURE__ */ a(at, { id: s, onRemove: () => o(s) }, s)) }) }) }),
227
- e.length === 0 && n && /* @__PURE__ */ a("p", { className: "settings-shell__help", children: "All slots removed. Apply to commit, or Reset to restore." }),
228
- /* @__PURE__ */ a("p", { className: "settings-shell__help settings-shell__help--small", children: "Drag to reorder · click × to remove" })
229
- ] });
230
- }
231
- const rt = ["#1d6fd8", "#10b981", "#f59e0b", "#ef4444", "#8b5cf6"];
232
- function ot({
233
- value: e,
234
- onSelect: t,
235
- enabled: r = !1,
236
- onToggleEnabled: l
237
- }) {
238
- const n = "settings-accent-enabled";
239
- return /* @__PURE__ */ f("div", { className: "settings-shell__field settings-shell__field--color", role: "group", "aria-label": "Accent color", children: [
240
- /* @__PURE__ */ f("div", { className: "settings-shell__toggle-row", children: [
241
- /* @__PURE__ */ a("label", { htmlFor: n, className: "settings-shell__toggle-label", children: "Override default accent" }),
242
- /* @__PURE__ */ a(
243
- "input",
244
- {
245
- id: n,
246
- type: "checkbox",
247
- role: "switch",
248
- "aria-label": "Enable accent override",
249
- "aria-checked": r,
250
- checked: r,
251
- onChange: (i) => l?.(i.target.checked),
252
- className: "settings-shell__toggle"
253
- }
254
- )
255
- ] }),
256
- r ? /* @__PURE__ */ f(q, { children: [
257
- /* @__PURE__ */ a("span", { className: "settings-shell__label", children: "Accent color" }),
258
- /* @__PURE__ */ a("div", { className: "settings-shell__swatch-row", children: rt.map((i) => {
259
- const u = e === i;
260
- return /* @__PURE__ */ a(
47
+ /* @__PURE__ */ s("span", { className: "settings-shell__value", "aria-live": "polite", children: m })
48
+ ] }),
49
+ /* @__PURE__ */ h("div", { className: "settings-shell__field", children: [
50
+ /* @__PURE__ */ s("span", { className: "settings-shell__label", children: "Accent" }),
51
+ /* @__PURE__ */ s("div", { className: "settings-shell__swatches", role: "radiogroup", "aria-label": "Accent color", children: se.map((g) => /* @__PURE__ */ s(
261
52
  "button",
262
53
  {
263
54
  type: "button",
264
- "aria-pressed": u,
265
- "aria-label": `Accent ${i}`,
266
- className: `settings-shell__swatch${u ? " settings-shell__swatch--active" : ""}`,
267
- style: { backgroundColor: i },
268
- onClick: () => t(i)
55
+ role: "radio",
56
+ "aria-pressed": f === g,
57
+ "aria-checked": f === g,
58
+ "aria-label": `Accent ${g}`,
59
+ className: "settings-shell__swatch",
60
+ style: { backgroundColor: g },
61
+ onClick: () => b(g),
62
+ "data-testid": `settings-swatch-${g}`
269
63
  },
270
- i
271
- );
272
- }) })
273
- ] }) : /* @__PURE__ */ a("p", { className: "settings-shell__help", "aria-live": "polite", children: "Off — the card uses its default accent. Turn on to override." })
64
+ g
65
+ )) })
66
+ ] })
67
+ ] })
274
68
  ] });
275
69
  }
276
- const lt = ["Orders", "Quota", "Unassigned"], it = ["threshold", "timeframe", "color"];
277
- function Yt({
278
- isOpen: e,
279
- cardSpan: t,
280
- cardLabel: r = "Metric",
281
- cardValue: l = "—",
282
- previewSlot: n,
283
- dimensions: i = it,
284
- initialTab: u,
285
- initialValues: o
286
- }) {
287
- const s = O(), c = s?.state.activeTrigger, d = c?.kind === "card-overflow" ? c.cardId : null, m = be(), h = c?.span, y = t ?? h ?? 1, p = i[0] ?? "threshold", [v, T] = R.useState(u ?? p);
288
- R.useEffect(() => {
289
- i.includes(v) || T(p);
290
- }, [i, v, p]);
291
- const b = d != null ? s?.state?.bufferByCard?.[d]?.changes ?? {} : {}, _ = typeof b.threshold == "number" ? b.threshold : typeof o?.threshold == "number" ? o.threshold : 80, x = typeof b.timeframe == "number" ? b.timeframe : typeof o?.timeframe == "number" ? o.timeframe : 30, $ = typeof b.accent == "string" ? b.accent : typeof o?.accent == "string" ? o.accent : null, F = Array.isArray(b.slots) ? b.slots : Array.isArray(o?.slots) ? o.slots : lt, E = typeof b.thresholdEnabled == "boolean" ? b.thresholdEnabled : typeof o?.thresholdEnabled == "boolean" ? o.thresholdEnabled : !1, L = typeof b.accentEnabled == "boolean" ? b.accentEnabled : typeof o?.accentEnabled == "boolean" ? o.accentEnabled : !1, W = (w) => {
292
- d == null || s == null || s.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "threshold", value: Number(w.target.value) });
293
- }, G = (w) => {
294
- d == null || s == null || s.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "timeframe", value: Number(w.target.value) });
295
- }, ie = (w) => {
296
- d == null || s == null || s.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "accent", value: w });
297
- }, j = (w) => {
298
- d == null || s == null || s.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "slots", value: w });
299
- }, Z = (w) => {
300
- d == null || s == null || s.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "thresholdEnabled", value: w });
301
- }, g = (w) => {
302
- d == null || s == null || s.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "accentEnabled", value: w });
303
- }, N = s?.state.isDirty ?? !1, P = d, k = () => {
304
- P != null && s?.dispatch({ type: "CLEAR_BUFFER", cardId: P });
305
- }, [D, U] = R.useState(0), Ae = () => {
306
- U((w) => w + 1), s?.dispatch({ type: "CLOSE_PANEL", reason: "apply-button" });
307
- }, xe = R.useCallback(() => {
308
- }, []);
309
- return /* @__PURE__ */ a(
310
- K,
311
- {
312
- variant: "with-stage",
313
- onClose: () => s?.dispatch({ type: "CLOSE_PANEL", reason: "header-x" }),
314
- stage: (
315
- // M003-S004-MOT-02 — CloneStage wraps CloneCard so the spin-commit
316
- // gesture has a transform host that does NOT disturb the inner
317
- // CloneCard's existing sway / span-N geometry. Counter is owned here
318
- // (Option 3); reptime sees no spinTrigger plumbing.
319
- /* @__PURE__ */ a(et, { spinTrigger: D, onSpinComplete: xe, children: /* @__PURE__ */ a(je, { span: y, rotating: !m, children: n ?? /* @__PURE__ */ f(q, { children: [
320
- /* @__PURE__ */ a("div", { style: { fontSize: 9, textTransform: "uppercase", letterSpacing: "0.06em", color: "#9ca3af", marginBottom: 6 }, children: r }),
321
- /* @__PURE__ */ a("div", { style: { fontSize: 22, fontWeight: 700, color: "#111827", lineHeight: 1 }, children: l })
322
- ] }) }) })
323
- ),
324
- navigation: /* @__PURE__ */ a(
325
- De,
326
- {
327
- dimensions: i,
328
- activeTab: v,
329
- onSelect: T,
330
- reduced: m
331
- }
332
- ),
333
- footer: {
334
- left: /* @__PURE__ */ a(
335
- "button",
336
- {
337
- id: "btn-reset",
338
- type: "button",
339
- className: "gloss-panel-chrome-v2__footer-btn",
340
- disabled: !N,
341
- onClick: k,
342
- children: "Reset"
343
- }
344
- ),
345
- right: /* @__PURE__ */ a(
346
- "button",
347
- {
348
- id: "settings-apply",
349
- type: "button",
350
- className: "gloss-panel-chrome-v2__footer-btn gloss-panel-chrome-v2__footer-btn--primary",
351
- disabled: !N,
352
- onClick: Ae,
353
- children: "Apply"
354
- }
355
- )
356
- },
357
- children: /* @__PURE__ */ a("div", { className: "settings-shell", "data-shell": "settings", "aria-hidden": !e, children: /* @__PURE__ */ f(
358
- "div",
359
- {
360
- role: "tabpanel",
361
- id: `settings-tabpanel-${v}`,
362
- "aria-label": "Settings dimension controls",
363
- tabIndex: 0,
364
- className: "settings-shell__tabpanel",
365
- children: [
366
- v === "threshold" && /* @__PURE__ */ a(
367
- tt,
368
- {
369
- value: _,
370
- onChange: W,
371
- enabled: E,
372
- onToggleEnabled: Z
373
- }
374
- ),
375
- v === "timeframe" && /* @__PURE__ */ a(nt, { value: x, onChange: G }),
376
- v === "slots" && /* @__PURE__ */ a(st, { value: F, onChange: j }),
377
- v === "color" && /* @__PURE__ */ a(
378
- ot,
379
- {
380
- value: $,
381
- onSelect: ie,
382
- enabled: L,
383
- onToggleEnabled: g
384
- }
385
- )
386
- ]
387
- }
388
- ) })
389
- }
390
- );
391
- }
392
- const _e = [
393
- "Revenue",
394
- "Order flow",
395
- "Rep performance",
396
- "Brand portfolio",
397
- "Account coverage",
398
- "Commission"
399
- ], Ce = "Revenue", Ne = {
400
- Revenue: {
401
- headline: "Are we hitting our number?",
402
- helper: "Top-line sales, growth, average order value, and pace-to-plan signals."
403
- },
404
- "Order flow": {
405
- headline: "Are orders flowing through?",
406
- helper: "Daily activity, pipeline, unassigned work, and cancel-rate health."
407
- },
408
- "Rep performance": {
409
- headline: "How are my reps performing?",
410
- helper: "Quota attainment, leaderboards, and activity flags across the rep team."
411
- },
412
- "Brand portfolio": {
413
- headline: "Which brands matter?",
414
- helper: "Manufacturer mix, top performers, and emerging line health."
415
- },
416
- "Account coverage": {
417
- headline: "Where are the gaps?",
418
- helper: "New, active, inactive, and at-risk customer accounts."
419
- },
420
- Commission: {
421
- headline: "What's our commission rate?",
422
- helper: "Outstanding balances, aging buckets, and effective commission yield."
423
- }
424
- }, Se = {
425
- Revenue: {
426
- primary: [
427
- {
428
- id: "agency-sales",
429
- label: "Sales",
430
- value: "$892,450",
431
- desc: "Agency total sales with trend sparkline",
432
- cardType: "sparkline",
433
- sparklineData: [620, 640, 680, 700, 740, 760, 790, 820, 850, 892],
434
- prefix: "$",
435
- startHere: !0
436
- },
437
- {
438
- id: "agency-sales-stacked",
439
- label: "Sales",
440
- value: "$892,450",
441
- desc: "Agency sales across three timeframes at a glance (MTD shown)",
442
- variants: ["1×3"],
443
- subStats: [
444
- { label: "MTD", value: "$892K" },
445
- { label: "QTD", value: "$2.4M" },
446
- { label: "YTD", value: "$8.6M" }
447
- ],
448
- cardType: "stacked-group",
449
- stackedTimeframes: ["MTD", "QTD", "YTD"]
450
- },
451
- {
452
- id: "agency-growth",
453
- label: "Sales Growth",
454
- value: "+18%",
455
- desc: "Year-over-year agency sales growth rate",
456
- cardType: "standard",
457
- suffix: "%",
458
- trend: { value: 18, direction: "up" }
459
- },
460
- {
461
- id: "agency-aov",
462
- label: "Avg Order",
463
- value: "$2,340",
464
- desc: "Average order value with trend sparkline",
465
- cardType: "sparkline",
466
- sparklineData: [2100, 2150, 2200, 2180, 2250, 2280, 2300, 2320, 2335, 2340],
467
- prefix: "$"
468
- },
469
- {
470
- id: "agency-aov-stacked",
471
- label: "Avg Order",
472
- value: "$2,340",
473
- desc: "Average order value across three timeframes",
474
- variants: ["1×3"],
475
- subStats: [
476
- { label: "MTD", value: "$2,340" },
477
- { label: "QTD", value: "$2,280" },
478
- { label: "YTD", value: "$2,210" }
479
- ],
480
- cardType: "stacked-group",
481
- stackedTimeframes: ["MTD", "QTD", "YTD"]
482
- },
483
- {
484
- id: "agency-conversion",
485
- label: "Conversion",
486
- value: "68%",
487
- desc: "Order completion rate vs cancellations",
488
- cardType: "donut",
489
- donutValue: 0.68,
490
- accentColor: "#10b981",
491
- suffix: "%"
492
- }
493
- ],
494
- secondary: [
495
- {
496
- id: "agency-revenue-compact",
497
- label: "Total Revenue",
498
- value: "$892,450",
499
- desc: "Agency revenue with sparkline trend",
500
- cardType: "sparkline",
501
- sparklineData: [620, 660, 700, 740, 780, 820, 860, 892],
502
- prefix: "$"
503
- },
504
- {
505
- id: "agency-yoy-versus",
506
- label: "YoY Comparison",
507
- value: "$892K",
508
- desc: "TY vs LY sales side-by-side",
509
- cardType: "versus",
510
- comparison: {
511
- current: { value: "$892K", label: "This year" },
512
- prior: { value: "$724K", label: "Last year" }
513
- }
514
- },
515
- {
516
- id: "agency-revenue-by-mfr",
517
- label: "Mfr Revenue",
518
- value: "$892K",
519
- desc: "Revenue mix across top manufacturers",
520
- cardType: "segmented",
521
- segments: [
522
- { label: "A", value: 35, color: "#7c3aed" },
523
- { label: "B", value: 28, color: "#1d6fd8" },
524
- { label: "C", value: 22, color: "#10b981" },
525
- { label: "D", value: 15, color: "#f59e0b" }
526
- ]
527
- }
528
- ]
529
- },
530
- "Order flow": {
531
- primary: [
532
- {
533
- id: "agency-activity",
534
- label: "Orders",
535
- value: "47 Orders",
536
- desc: "Daily team order count with bar chart",
537
- cardType: "bars",
538
- barData: [12, 18, 15, 22, 19, 25, 28],
539
- startHere: !0
540
- },
541
- {
542
- id: "agency-orders-compact",
543
- label: "Order Count",
544
- value: "156",
545
- desc: "Total order count with bar chart trend",
546
- cardType: "bars",
547
- barData: [18, 22, 19, 24, 26, 23, 28]
548
- },
549
- {
550
- id: "agency-orders-stacked",
551
- label: "Orders",
552
- value: "156",
553
- desc: "Order count across three timeframes",
554
- variants: ["1×3"],
555
- subStats: [
556
- { label: "MTD", value: "156" },
557
- { label: "QTD", value: "482" },
558
- { label: "YTD", value: "1,847" }
559
- ],
560
- cardType: "stacked-group",
561
- stackedTimeframes: ["MTD", "QTD", "YTD"]
562
- },
563
- {
564
- id: "agency-order-pipeline-value",
565
- label: "Pipeline Value",
566
- value: "$284,500",
567
- desc: "Open + transmitted order $ pipeline",
568
- cardType: "standard",
569
- prefix: "$"
570
- },
571
- {
572
- id: "agency-unassigned-orders",
573
- label: "Unassigned",
574
- value: "0",
575
- desc: "Orders awaiting salesperson assignment",
576
- cardType: "standard"
577
- },
578
- {
579
- id: "agency-cancel-rate",
580
- label: "Cancel Rate",
581
- value: "4.2%",
582
- desc: "Order cancel-rate percentage (warn-tinted highlight)",
583
- cardType: "highlight",
584
- highlightColor: "#f59e0b",
585
- suffix: "%"
586
- }
587
- ]
588
- },
589
- "Rep performance": {
590
- primary: [
591
- {
592
- id: "agency-top-rep",
593
- label: "#1 Rep",
594
- value: "Sarah Mitchell",
595
- desc: "Top-performing rep on the team this period",
596
- cardType: "name",
597
- startHere: !0
598
- },
599
- {
600
- id: "agency-quota",
601
- label: "Below Quota",
602
- value: "3 of 12",
603
- desc: "Reps currently tracking under their quota",
604
- cardType: "ratio",
605
- numerator: 3,
606
- denominator: 12
607
- },
608
- {
609
- id: "agency-rep-leaderboard-sales",
610
- label: "Rep Sales",
611
- value: "Top 5",
612
- desc: "Sales leaderboard across the rep team",
613
- cardType: "leaderboard",
614
- catalogValue: "Top 5"
615
- }
616
- ]
617
- },
618
- "Brand portfolio": {
619
- primary: [
620
- {
621
- id: "agency-mfr-mix",
622
- label: "Mfr Mix",
623
- value: "$892K",
624
- desc: "Revenue mix by manufacturer (segmented bar)",
625
- cardType: "segmented",
626
- segments: [
627
- { label: "A", value: 35, color: "#7c3aed" },
628
- { label: "B", value: 28, color: "#1d6fd8" },
629
- { label: "C", value: 22, color: "#10b981" },
630
- { label: "D", value: 15, color: "#f59e0b" }
631
- ],
632
- startHere: !0
633
- },
634
- {
635
- id: "agency-mfr-new-line",
636
- label: "New Mfrs",
637
- value: "3",
638
- desc: "New manufacturer count for the period",
639
- cardType: "standard"
640
- }
641
- ]
642
- },
643
- "Account coverage": {
644
- primary: [
645
- {
646
- id: "agency-new-accounts",
647
- label: "New Accounts",
648
- value: "12",
649
- desc: "New customer accounts opened this period",
650
- cardType: "standard",
651
- startHere: !0
652
- },
653
- {
654
- id: "agency-customers-compact",
655
- label: "Customers",
656
- value: "287",
657
- desc: "Active customer count with bar chart trend",
658
- cardType: "bars",
659
- barData: [240, 250, 260, 270, 275, 280, 287]
660
- },
661
- {
662
- id: "agency-inactive-accounts",
663
- label: "Inactive Act",
664
- value: "5",
665
- desc: "Inactive customer-account count (warn-tinted)",
666
- cardType: "highlight",
667
- highlightColor: "#f59e0b"
668
- },
669
- {
670
- id: "agency-account-churn",
671
- label: "Account Churn",
672
- value: "8%",
673
- desc: "Customer churn rate (LY-active not TY-active)",
674
- cardType: "standard",
675
- suffix: "%"
676
- }
677
- ]
678
- },
679
- Commission: {
680
- primary: [
681
- {
682
- id: "agency-outstanding",
683
- label: "Outstanding",
684
- value: "$24,500",
685
- desc: "Unpaid order balance across all accounts",
686
- cardType: "standard",
687
- prefix: "$",
688
- startHere: !0
689
- },
690
- {
691
- id: "agency-commission-rate",
692
- label: "Commission",
693
- value: "8.4%",
694
- desc: "Effective commission rate %",
695
- cardType: "standard",
696
- suffix: "%"
697
- },
698
- {
699
- id: "agency-commission-aging",
700
- label: "Commission Aging",
701
- value: "$24K",
702
- desc: "Unpaid commission aging by buckets",
703
- cardType: "bars",
704
- barData: [4, 8, 7, 5]
705
- }
706
- ]
707
- }
708
- };
709
- function Ee({
710
- lenses: e,
711
- activeLens: t,
712
- onLensChange: r,
713
- variant: l = "pills",
714
- lensMeta: n = Ne
715
- }) {
716
- return l === "pills" ? /* @__PURE__ */ a("div", { className: "cat-pills-wrap", children: /* @__PURE__ */ a("div", { className: "cat-pills", role: "tablist", "aria-label": "Metric lenses", children: e.map((i) => {
717
- const u = i === t, o = n[i], s = ["cat-pill"];
718
- return u && s.push("active"), /* @__PURE__ */ f(
719
- "button",
720
- {
721
- type: "button",
722
- role: "tab",
723
- "aria-selected": u,
724
- className: s.join(" "),
725
- "data-lens": i,
726
- onClick: () => {
727
- u || r(i);
728
- },
729
- children: [
730
- i,
731
- o?.beta && /* @__PURE__ */ a("span", { className: "cat-pill-beta", "aria-label": "Beta", children: "BETA" })
732
- ]
733
- },
734
- i
735
- );
736
- }) }) }) : /* @__PURE__ */ a(ct, { lenses: e, activeLens: t, onLensChange: r });
737
- }
738
- function ct({
739
- lenses: e,
740
- activeLens: t,
741
- onLensChange: r
742
- }) {
743
- const [l, n] = A(!1), i = Q(null), u = () => {
744
- i.current != null && (window.clearTimeout(i.current), i.current = null);
745
- }, o = () => {
746
- u(), i.current = window.setTimeout(() => n(!1), 100);
747
- }, s = e.filter((c) => c !== t);
748
- return /* @__PURE__ */ a("div", { className: "cat-segmented-wrap", children: /* @__PURE__ */ f("div", { className: "cat-segmented", children: [
749
- /* @__PURE__ */ a(
70
+ function K({ lenses: e, activeLens: t, onLensChange: o }) {
71
+ const [n, a] = y(!1), r = B(null), d = () => {
72
+ r.current != null && (window.clearTimeout(r.current), r.current = null);
73
+ }, l = () => {
74
+ d(), r.current = window.setTimeout(() => a(!1), 100);
75
+ }, i = e.filter((c) => c !== t);
76
+ return /* @__PURE__ */ s("div", { className: "cat-segmented-wrap", children: /* @__PURE__ */ h("div", { className: "cat-segmented", children: [
77
+ /* @__PURE__ */ s(
750
78
  "button",
751
79
  {
752
80
  type: "button",
@@ -756,31 +84,31 @@ function ct({
756
84
  children: t
757
85
  }
758
86
  ),
759
- /* @__PURE__ */ f(
87
+ /* @__PURE__ */ h(
760
88
  "div",
761
89
  {
762
90
  className: "cat-seg-more",
763
91
  onMouseEnter: () => {
764
- u(), n(!0);
92
+ d(), a(!0);
765
93
  },
766
- onMouseLeave: o,
94
+ onMouseLeave: l,
767
95
  children: [
768
- /* @__PURE__ */ a("button", { type: "button", className: "cat-seg cat-seg-more-btn", "aria-haspopup": "menu", "aria-expanded": l, children: "More ▾" }),
769
- l && /* @__PURE__ */ a(
96
+ /* @__PURE__ */ s("button", { type: "button", className: "cat-seg cat-seg-more-btn", "aria-haspopup": "menu", "aria-expanded": n, children: "More ▾" }),
97
+ n && /* @__PURE__ */ s(
770
98
  "div",
771
99
  {
772
100
  className: "cat-seg-overflow",
773
101
  role: "menu",
774
- onMouseEnter: u,
775
- onMouseLeave: o,
776
- children: s.map((c) => /* @__PURE__ */ a(
102
+ onMouseEnter: d,
103
+ onMouseLeave: l,
104
+ children: i.map((c) => /* @__PURE__ */ s(
777
105
  "button",
778
106
  {
779
107
  type: "button",
780
108
  "data-lens": c,
781
109
  role: "menuitem",
782
110
  onClick: () => {
783
- r(c), n(!1);
111
+ o(c), a(!1);
784
112
  },
785
113
  children: c
786
114
  },
@@ -793,87 +121,50 @@ function ct({
793
121
  )
794
122
  ] }) });
795
123
  }
796
- function ae({ tiles: e, selectedTileId: t, onSelectTile: r, renderTile: l }) {
797
- return /* @__PURE__ */ a("div", { className: "cat-tiles", children: e.map((n) => {
798
- const i = n.id === t, u = n.subStats != null && n.subStats.length > 0;
799
- let o = null;
800
- u ? n.subStats.length === 5 ? o = "span-5" : n.subStats.length === 3 ? o = "span-3" : o = "span-2" : n.stack === !0 && (o = "span-2");
801
- const s = ["cat-tile"];
802
- o && s.push(o), i && s.push("selected"), n.isNew && s.push("is-new"), n.startHere && s.push("start-here"), n.donut && s.push("has-donut");
803
- const c = 1;
804
- let d = 0.7;
805
- if (n.donut) {
806
- const m = /([\d.]+)\s*%/.exec(n.value);
807
- if (m) {
808
- const h = parseFloat(m[1]);
809
- Number.isFinite(h) && (d = Math.max(0, Math.min(1, h / 100)));
810
- }
811
- }
812
- return /* @__PURE__ */ f(
124
+ function ae(e) {
125
+ return e.split("·").map((t, o) => {
126
+ const n = t.trim(), a = n.match(/^([$+\-]?[\d,]+(?:\.\d+)?[%+]?)\s*(.*)$/), r = a ? a[1] : "", d = a ? a[2] : n;
127
+ return /* @__PURE__ */ h("span", { children: [
128
+ /* @__PURE__ */ s("strong", { children: r }),
129
+ /* @__PURE__ */ s("small", { children: d })
130
+ ] }, o);
131
+ });
132
+ }
133
+ function j({ tiles: e, selectedTileId: t, onSelectTile: o }) {
134
+ return /* @__PURE__ */ s("div", { className: "cat-tiles", children: e.map((n) => {
135
+ const a = n.id === t, r = n.stack === !0, d = ["cat-tile"];
136
+ return r && d.push("span-2"), a && d.push("selected"), /* @__PURE__ */ h(
813
137
  "button",
814
138
  {
815
139
  type: "button",
816
- className: s.join(" "),
140
+ className: d.join(" "),
817
141
  "data-metric": n.id,
818
142
  "data-desc": n.desc,
819
- "data-col-span": String(c),
820
- "data-donut": n.donut ? "true" : void 0,
821
- "data-accent": n.accent,
822
- "aria-pressed": i,
823
- onClick: () => r(n.id, n.desc),
824
- style: n.accent ? { "--cat-tile-accent": n.accent } : void 0,
143
+ "aria-pressed": a,
144
+ onClick: () => o(n.id, n.desc),
825
145
  children: [
826
- n.startHere && /* @__PURE__ */ a("span", { className: "cat-tile-start-here", "aria-hidden": "true", children: "START HERE" }),
827
- l ? l(n) : /* @__PURE__ */ a(
828
- "div",
829
- {
830
- className: "cat-tile-primitive-wrapper gloss-metric-card",
831
- "data-col-span": "1",
832
- style: { pointerEvents: "none", width: "100%", height: "100%" },
833
- "aria-hidden": "true",
834
- children: n.donut ? /* @__PURE__ */ a(
835
- pe,
836
- {
837
- variant: "donut",
838
- label: n.label,
839
- value: n.value,
840
- donutValue: d,
841
- donutMax: 1,
842
- accentColor: n.accent,
843
- colSpan: c
844
- }
845
- ) : /* @__PURE__ */ a(
846
- pe,
847
- {
848
- variant: "standard",
849
- label: n.label,
850
- value: n.value,
851
- colSpan: c
852
- }
853
- )
854
- }
855
- ),
856
- n.variants && n.variants.length > 0 && /* @__PURE__ */ a("span", { className: "cat-tile-variants", "aria-hidden": "true", children: n.variants.map((m) => /* @__PURE__ */ a("span", { children: m }, m)) }),
857
- n.isNew && /* @__PURE__ */ a("span", { className: "cat-tile-new-dot", "aria-hidden": "true" })
146
+ /* @__PURE__ */ s("span", { className: "cat-tile-label", children: n.label }),
147
+ /* @__PURE__ */ s("span", { className: "cat-tile-value", children: r ? ae(n.value) : n.value }),
148
+ n.variants && n.variants.length > 0 && /* @__PURE__ */ s("span", { className: "cat-tile-variants", "aria-hidden": "true", children: n.variants.map((l) => /* @__PURE__ */ s("span", { children: l }, l)) })
858
149
  ]
859
150
  },
860
151
  n.id
861
152
  );
862
153
  }) });
863
154
  }
864
- const re = ye(null);
865
- function oe() {
866
- return ve(re);
867
- }
868
- function Vt({ mode: e, dispatch: t }) {
869
- const r = oe();
870
- if (r == null && e == null) return null;
871
- const l = r?.mode ?? e ?? "add", n = r?.selectedTileId ?? null, i = r?.description ?? null, u = n == null;
872
- return /* @__PURE__ */ f("div", { className: "panel-footer catalog", children: [
873
- /* @__PURE__ */ a("div", { className: "cat-description", id: "cat-desc", children: i ?? /* @__PURE__ */ a("em", { children: "Tap a metric to see its description" }) }),
874
- /* @__PURE__ */ f("div", { style: { display: "flex", padding: "10px 14px", gap: 8 }, children: [
875
- /* @__PURE__ */ a("div", { className: "spacer", style: { flex: 1 } }),
876
- /* @__PURE__ */ a(
155
+ const k = H(null);
156
+ function re() {
157
+ return U(k);
158
+ }
159
+ function le({ mode: e, dispatch: t }) {
160
+ const o = re();
161
+ if (o == null && e == null) return null;
162
+ const n = o?.mode ?? e ?? "add", a = o?.selectedTileId ?? null, r = o?.description ?? null, d = a == null;
163
+ return /* @__PURE__ */ h("div", { className: "panel-footer catalog", children: [
164
+ /* @__PURE__ */ s("div", { className: "cat-description", id: "cat-desc", children: r ?? /* @__PURE__ */ s("em", { children: "Tap a metric to see its description" }) }),
165
+ /* @__PURE__ */ h("div", { style: { display: "flex", padding: "10px 14px", gap: 8 }, children: [
166
+ /* @__PURE__ */ s("div", { className: "spacer", style: { flex: 1 } }),
167
+ /* @__PURE__ */ s(
877
168
  "button",
878
169
  {
879
170
  id: "btn-cat-cancel",
@@ -883,24 +174,24 @@ function Vt({ mode: e, dispatch: t }) {
883
174
  children: "Cancel"
884
175
  }
885
176
  ),
886
- l === "add" && /* @__PURE__ */ a(
177
+ n === "add" && /* @__PURE__ */ s(
887
178
  "button",
888
179
  {
889
180
  id: "btn-cat-add",
890
181
  type: "button",
891
182
  className: "btn btn-primary",
892
- disabled: u,
183
+ disabled: d,
893
184
  onClick: () => t({ type: "CLOSE_PANEL", reason: "apply-button" }),
894
185
  children: "Add metric"
895
186
  }
896
187
  ),
897
- l === "replace" && /* @__PURE__ */ a(
188
+ n === "replace" && /* @__PURE__ */ s(
898
189
  "button",
899
190
  {
900
191
  id: "btn-cat-replace",
901
192
  type: "button",
902
193
  className: "btn btn-primary",
903
- disabled: u,
194
+ disabled: d,
904
195
  onClick: () => t({ type: "CLOSE_PANEL", reason: "apply-button" }),
905
196
  children: "Replace metric"
906
197
  }
@@ -908,220 +199,192 @@ function Vt({ mode: e, dispatch: t }) {
908
199
  ] })
909
200
  ] });
910
201
  }
911
- function me(e, t) {
912
- if (t.length === 0) return !0;
913
- const r = t.toLowerCase();
914
- if (e.label.toLowerCase().includes(r) || e.value.toLowerCase().includes(r)) return !0;
915
- if (e.subStats) {
916
- for (const l of e.subStats)
917
- if (l.label.toLowerCase().includes(r) || l.value.toLowerCase().includes(r)) return !0;
918
- }
919
- return !1;
920
- }
921
- function dt() {
922
- const t = oe()?.description ?? null;
923
- return t == null ? /* @__PURE__ */ a("span", { style: { fontStyle: "italic" }, children: "Tap a metric to see its description" }) : /* @__PURE__ */ a("span", { children: t });
924
- }
925
- function Kt({
202
+ const W = [
203
+ "Revenue",
204
+ "Order flow",
205
+ "Rep performance",
206
+ "Brand portfolio",
207
+ "Account coverage",
208
+ "Commission"
209
+ ], G = "Order flow", Q = {
210
+ Revenue: [
211
+ { id: "rev-mtd", label: "Revenue MTD", value: "$184K", desc: "Month-to-date revenue across all manufacturers and territories." },
212
+ { id: "rev-ytd", label: "Revenue YTD", value: "$2.1M", desc: "Year-to-date revenue including pending and posted orders.", variants: ["1×1", "1×3"] },
213
+ { id: "rev-yoy", label: "YoY Δ", value: "+12.4%", desc: "Revenue growth versus the prior comparable period." },
214
+ { id: "rev-avg", label: "Avg order", value: "$1,820", desc: "Average order value over the last 30 days." }
215
+ ],
216
+ "Order flow": [
217
+ {
218
+ id: "of-funnel",
219
+ label: "Order funnel",
220
+ value: "New 42 · Incomplete 18 · Transmitted 91",
221
+ stack: !0,
222
+ desc: "Funnel snapshot — new orders, incomplete (awaiting attention), and transmitted to manufacturer.",
223
+ variants: ["1×3"]
224
+ },
225
+ { id: "of-incomplete", label: "Incomplete", value: "18", desc: "Orders started but not yet transmitted." },
226
+ { id: "of-transmitted", label: "Transmitted", value: "91", desc: "Orders successfully sent to manufacturer." },
227
+ { id: "of-today", label: "New today", value: "7", desc: "Orders created in the current calendar day." },
228
+ { id: "of-velocity", label: "Order velocity", value: "+3.1/d", desc: "Rolling 7-day order-creation rate change." }
229
+ ],
230
+ "Rep performance": [
231
+ { id: "rp-leader", label: "#1 Rep", value: "A. Chen", desc: "Top revenue performer in the current period." },
232
+ { id: "rp-quota", label: "Below quota", value: "4 reps", desc: "Reps currently tracking below pace-to-quota." },
233
+ { id: "rp-commission", label: "Commission pace", value: "$48K", desc: "Projected commission pool at current burn rate." },
234
+ { id: "rp-active", label: "Active reps", value: "14", desc: "Reps with at least one order this period." }
235
+ ],
236
+ "Brand portfolio": [
237
+ { id: "bp-top", label: "Top brand", value: "Acme Co.", desc: "Highest-revenue manufacturer this period." },
238
+ { id: "bp-mix", label: "Mix Δ", value: "+2pp", desc: "Portfolio mix shift versus the prior period." },
239
+ { id: "bp-coverage", label: "Brand coverage", value: "73%", desc: "Percent of accounts with at least one active brand." },
240
+ { id: "bp-new", label: "New brand adds", value: "3", desc: "Brands with first-order activity this period." }
241
+ ],
242
+ "Account coverage": [
243
+ { id: "ac-active", label: "Active accounts", value: "128", desc: "Accounts with at least one order in the period." },
244
+ { id: "ac-untouched", label: "Untouched", value: "34", desc: "Accounts with zero activity in the period." },
245
+ { id: "ac-concentration", label: "Concentration", value: "38% top-5", desc: "Revenue concentration in top-5 accounts." },
246
+ { id: "ac-new", label: "New accounts", value: "6", desc: "Accounts with first-ever order this period." }
247
+ ],
248
+ Commission: [
249
+ { id: "cm-projected", label: "Projected", value: "$48K", desc: "Forecast commission at current pace." },
250
+ { id: "cm-paid", label: "Paid", value: "$31K", desc: "Commission posted to ledger this period." },
251
+ { id: "cm-pending", label: "Pending", value: "$17K", desc: "Commission earned but not yet posted." },
252
+ { id: "cm-rate", label: "Effective rate", value: "6.8%", desc: "Realized commission rate across all orders." }
253
+ ]
254
+ };
255
+ function Te({
926
256
  isOpen: e,
927
- lenses: t = _e,
928
- defaultLens: r = Ce,
929
- tilesByLens: l = Se,
930
- lensMeta: n = Ne,
931
- renderTile: i,
932
- onAdd: u
257
+ lenses: t = W,
258
+ defaultLens: o = G,
259
+ tilesByLens: n = Q,
260
+ footerSlot: a
933
261
  }) {
934
- const o = O(), [s, c] = A(r), [d, m] = A(null), [h, y] = A(null), [p, v] = A(""), T = l[s] ?? { primary: [] }, S = n[s], b = ce(
935
- () => T.primary.filter((E) => me(E, p)),
936
- [T.primary, p]
937
- ), _ = ce(
938
- () => (T.secondary ?? []).filter((E) => me(E, p)),
939
- [T.secondary, p]
940
- ), x = () => {
941
- d != null && u?.(d), o?.dispatch({ type: "CLOSE_PANEL", reason: "apply-button" });
942
- }, $ = () => o?.dispatch({ type: "CLOSE_PANEL", reason: "header-x" }), F = d == null;
943
- return /* @__PURE__ */ a(
944
- re.Provider,
262
+ const [r, d] = y(o), [l, i] = y(null), [c, u] = y(null), m = n[r] ?? [];
263
+ return /* @__PURE__ */ h(
264
+ k.Provider,
945
265
  {
946
- value: { mode: "add", selectedTileId: d, description: h },
947
- children: /* @__PURE__ */ a(
948
- K,
949
- {
950
- variant: "no-stage",
951
- title: "Add a metric",
952
- onClose: $,
953
- footer: {
954
- left: /* @__PURE__ */ a(dt, {}),
955
- right: /* @__PURE__ */ a(
956
- "button",
957
- {
958
- id: "btn-cat-add",
959
- type: "button",
960
- className: "gloss-panel-chrome-v2__footer-btn gloss-panel-chrome-v2__footer-btn--primary",
961
- disabled: F,
962
- onClick: x,
963
- children: "Add metric"
964
- }
965
- )
966
- },
967
- children: /* @__PURE__ */ f("div", { "data-shell": "catalog-add", "aria-hidden": !e, children: [
968
- /* @__PURE__ */ a("div", { className: "cat-search", children: /* @__PURE__ */ a(
969
- "input",
970
- {
971
- type: "search",
972
- className: "cat-search-input",
973
- placeholder: "Search metrics",
974
- "aria-label": "Search metrics",
975
- value: p,
976
- onChange: (E) => v(E.target.value)
977
- }
978
- ) }),
979
- /* @__PURE__ */ a(
980
- Ee,
981
- {
982
- lenses: t,
983
- activeLens: s,
984
- lensMeta: n,
985
- variant: "pills",
986
- onLensChange: (E) => {
987
- c(E), m(null), y(null), v("");
988
- }
266
+ value: { mode: "add", selectedTileId: l, description: c },
267
+ children: [
268
+ /* @__PURE__ */ h("div", { "data-shell": "catalog-add", "aria-hidden": !e, children: [
269
+ /* @__PURE__ */ s("h3", { children: "Add a metric" }),
270
+ /* @__PURE__ */ s(
271
+ K,
272
+ {
273
+ lenses: t,
274
+ activeLens: r,
275
+ onLensChange: (f) => {
276
+ d(f), i(null), u(null);
989
277
  }
990
- ),
991
- S && /* @__PURE__ */ f("div", { className: "cat-lens-meta", children: [
992
- /* @__PURE__ */ a("h3", { className: "cat-lens-headline", children: S.headline }),
993
- /* @__PURE__ */ a("p", { className: "cat-lens-helper", children: S.helper })
994
- ] }),
995
- /* @__PURE__ */ a(
996
- ae,
997
- {
998
- tiles: b,
999
- selectedTileId: d,
1000
- onSelectTile: (E, L) => {
1001
- m(E), y(L);
1002
- },
1003
- renderTile: i
278
+ }
279
+ ),
280
+ /* @__PURE__ */ s(
281
+ j,
282
+ {
283
+ tiles: m,
284
+ selectedTileId: l,
285
+ onSelectTile: (f, v) => {
286
+ i(f), u(v);
1004
287
  }
1005
- ),
1006
- _.length > 0 && /* @__PURE__ */ f("div", { className: "cat-more-in-lens", children: [
1007
- /* @__PURE__ */ a("div", { className: "cat-more-in-lens__heading", children: "MORE IN THIS LENS" }),
1008
- /* @__PURE__ */ a(
1009
- ae,
1010
- {
1011
- tiles: _,
1012
- selectedTileId: d,
1013
- onSelectTile: (E, L) => {
1014
- m(E), y(L);
1015
- },
1016
- renderTile: i
1017
- }
1018
- )
1019
- ] }),
1020
- b.length === 0 && _.length === 0 && p.length > 0 && /* @__PURE__ */ f("div", { className: "cat-empty", children: [
1021
- 'No metrics match "',
1022
- p,
1023
- '".'
1024
- ] })
1025
- ] })
1026
- }
1027
- )
288
+ }
289
+ )
290
+ ] }),
291
+ a
292
+ ]
1028
293
  }
1029
294
  );
1030
295
  }
1031
- function ut() {
1032
- const t = oe()?.description ?? null;
1033
- return t == null ? /* @__PURE__ */ a("em", { children: "Tap a metric to see its description" }) : /* @__PURE__ */ a(q, { children: t });
1034
- }
1035
- function qt({
296
+ function Ie({
1036
297
  isOpen: e,
1037
298
  replacingLabel: t,
1038
- lenses: r = _e,
1039
- defaultLens: l = Ce,
1040
- tilesByLens: n = Se,
1041
- renderTile: i
299
+ lenses: o = W,
300
+ defaultLens: n = G,
301
+ tilesByLens: a = Q,
302
+ footerSlot: r
1042
303
  }) {
1043
- const u = O(), [o, s] = A(l), [c, d] = A(null), [m, h] = A(null), y = n[o] ?? { primary: [] }, p = [...y.primary, ...y.secondary ?? []], v = () => u?.dispatch({ type: "CLOSE_PANEL", reason: "apply-button" }), T = () => u?.dispatch({ type: "CLOSE_PANEL", reason: "header-x" }), S = c == null;
1044
- return /* @__PURE__ */ a(
1045
- re.Provider,
304
+ const [d, l] = y(n), [i, c] = y(null), [u, m] = y(null), f = a[d] ?? [];
305
+ return /* @__PURE__ */ h(
306
+ k.Provider,
1046
307
  {
1047
- value: { mode: "replace", selectedTileId: c, description: m },
1048
- children: /* @__PURE__ */ a(
1049
- K,
1050
- {
1051
- variant: "no-stage",
1052
- title: "Replace metric",
1053
- onClose: T,
1054
- footer: {
1055
- left: /* @__PURE__ */ a(ut, {}),
1056
- right: /* @__PURE__ */ a(
1057
- "button",
1058
- {
1059
- id: "btn-cat-replace",
1060
- type: "button",
1061
- className: "gloss-panel-chrome-v2__footer-btn gloss-panel-chrome-v2__footer-btn--primary",
1062
- disabled: S,
1063
- onClick: v,
1064
- children: "Replace metric"
1065
- }
1066
- )
1067
- },
1068
- children: /* @__PURE__ */ f("div", { "data-shell": "catalog-replace", "aria-hidden": !e, children: [
1069
- t && /* @__PURE__ */ f("p", { className: "cat-subtitle", children: [
1070
- "replacing ",
1071
- t
1072
- ] }),
1073
- /* @__PURE__ */ a(
1074
- Ee,
1075
- {
1076
- lenses: r,
1077
- activeLens: o,
1078
- onLensChange: (b) => {
1079
- s(b), d(null), h(null);
1080
- }
308
+ value: { mode: "replace", selectedTileId: i, description: u },
309
+ children: [
310
+ /* @__PURE__ */ h("div", { "data-shell": "catalog-replace", "aria-hidden": !e, children: [
311
+ /* @__PURE__ */ s("h3", { children: "Replace metric" }),
312
+ t && /* @__PURE__ */ h("p", { className: "cat-subtitle", children: [
313
+ "replacing ",
314
+ t
315
+ ] }),
316
+ /* @__PURE__ */ s(
317
+ K,
318
+ {
319
+ lenses: o,
320
+ activeLens: d,
321
+ onLensChange: (v) => {
322
+ l(v), c(null), m(null);
1081
323
  }
1082
- ),
1083
- /* @__PURE__ */ a(
1084
- ae,
1085
- {
1086
- tiles: p,
1087
- selectedTileId: c,
1088
- onSelectTile: (b, _) => {
1089
- d(b), h(_);
1090
- },
1091
- renderTile: i
324
+ }
325
+ ),
326
+ /* @__PURE__ */ s(
327
+ j,
328
+ {
329
+ tiles: f,
330
+ selectedTileId: i,
331
+ onSelectTile: (v, b) => {
332
+ c(v), m(b);
1092
333
  }
1093
- )
1094
- ] })
1095
- }
1096
- )
334
+ }
335
+ )
336
+ ] }),
337
+ r
338
+ ]
1097
339
  }
1098
340
  );
1099
341
  }
1100
- const Te = ye(null);
1101
- function Pe() {
1102
- return ve(Te);
342
+ function ie({ page: e, onRename: t, onKebab: o, onDragStart: n }) {
343
+ const a = ["pm-row"];
344
+ return e.active && a.push("active"), /* @__PURE__ */ h("div", { className: a.join(" "), "data-page-id": e.id, role: "listitem", children: [
345
+ /* @__PURE__ */ s(
346
+ "div",
347
+ {
348
+ className: "pm-handle",
349
+ "aria-hidden": "true",
350
+ onMouseDown: () => n?.(e.id),
351
+ children: "⋮⋮"
352
+ }
353
+ ),
354
+ /* @__PURE__ */ s("div", { className: "pm-name", onClick: () => t?.(e.id), children: e.name }),
355
+ /* @__PURE__ */ s(
356
+ "button",
357
+ {
358
+ type: "button",
359
+ className: "pm-kebab",
360
+ "aria-label": "Page options",
361
+ onClick: () => o?.(e.id),
362
+ children: "⋯"
363
+ }
364
+ )
365
+ ] });
366
+ }
367
+ const X = H(null);
368
+ function ce() {
369
+ return U(X);
1103
370
  }
1104
- function pt(e = {}) {
1105
- const t = Pe(), r = t?.createPage, l = t?.setPages;
1106
- return /* @__PURE__ */ f(
371
+ function de(e = {}) {
372
+ const o = ce()?.setPages;
373
+ return /* @__PURE__ */ h(
1107
374
  "div",
1108
375
  {
1109
376
  className: "panel-footer pm",
1110
377
  style: { display: "flex", justifyContent: "flex-end", padding: "10px 14px" },
1111
378
  children: [
1112
- /* @__PURE__ */ a("div", { className: "spacer", style: { flex: 1 } }),
1113
- /* @__PURE__ */ a(
379
+ /* @__PURE__ */ s("div", { className: "spacer", style: { flex: 1 } }),
380
+ /* @__PURE__ */ s(
1114
381
  "button",
1115
382
  {
1116
383
  id: "btn-new-page",
1117
384
  type: "button",
1118
385
  className: "btn btn-primary",
1119
386
  onClick: () => {
1120
- if (r) {
1121
- r();
1122
- return;
1123
- }
1124
- l && l((n) => [
387
+ o && o((n) => [
1125
388
  ...n,
1126
389
  { id: `new-${Date.now()}`, name: "Untitled", active: !1 }
1127
390
  ]);
@@ -1133,566 +396,448 @@ function pt(e = {}) {
1133
396
  }
1134
397
  );
1135
398
  }
1136
- function he({ page: e, onRename: t, onKebab: r, onDragStart: l, onSwitchPage: n }) {
1137
- const i = Pe(), [u, o] = A(!1), s = Q(null);
1138
- z(() => {
1139
- if (!u) return;
1140
- const p = (v) => {
1141
- s.current && (s.current.contains(v.target) || o(!1));
1142
- };
1143
- return document.addEventListener("mousedown", p, !0), () => document.removeEventListener("mousedown", p, !0);
1144
- }, [u]);
1145
- const c = () => {
1146
- if (o(!1), t) return t(e.id);
1147
- if (!i?.renamePage) return;
1148
- const p = window.prompt("Rename page", e.name);
1149
- p != null && p.trim().length > 0 && i.renamePage(e.id, p.trim());
1150
- }, d = () => {
1151
- o(!1), i?.duplicatePage?.(e.id);
1152
- }, m = () => {
1153
- o(!1), i?.deletePage?.(e.id);
1154
- }, h = (p) => {
1155
- p.stopPropagation(), n && !e.active && n(e.id);
1156
- }, y = ["pm-row"];
1157
- return e.active && y.push("active"), /* @__PURE__ */ f("div", { ref: s, className: y.join(" "), "data-page-id": e.id, role: "listitem", children: [
1158
- /* @__PURE__ */ a(
1159
- "div",
1160
- {
1161
- className: "pm-handle",
1162
- "aria-hidden": "true",
1163
- onMouseDown: () => l?.(e.id),
1164
- children: "⋮⋮"
1165
- }
1166
- ),
1167
- /* @__PURE__ */ a(
1168
- "div",
1169
- {
1170
- className: "pm-name",
1171
- role: n && !e.active ? "button" : void 0,
1172
- tabIndex: n && !e.active ? 0 : void 0,
1173
- onClick: n ? h : void 0,
1174
- onKeyDown: (p) => {
1175
- !n || e.active || (p.key === "Enter" || p.key === " ") && (p.preventDefault(), p.stopPropagation(), n(e.id));
1176
- },
1177
- "aria-label": n && !e.active ? `Switch to ${e.name}` : void 0,
1178
- children: e.name
1179
- }
1180
- ),
1181
- /* @__PURE__ */ a(
1182
- "button",
1183
- {
1184
- type: "button",
1185
- className: "pm-kebab",
1186
- "aria-label": "Page options",
1187
- "aria-haspopup": "menu",
1188
- "aria-expanded": u,
1189
- onPointerDown: (p) => p.stopPropagation(),
1190
- onMouseDown: (p) => p.stopPropagation(),
1191
- onClick: (p) => {
1192
- if (p.stopPropagation(), r) return r(e.id);
1193
- o((v) => !v);
1194
- },
1195
- children: "⋯"
1196
- }
1197
- ),
1198
- u && /* @__PURE__ */ f(
1199
- "div",
1200
- {
1201
- className: "pm-kebab-menu",
1202
- role: "menu",
1203
- "data-page-id": e.id,
1204
- onPointerDown: (p) => p.stopPropagation(),
1205
- onMouseDown: (p) => p.stopPropagation(),
1206
- children: [
1207
- /* @__PURE__ */ a("button", { type: "button", role: "menuitem", className: "pm-kebab-menu__item", onClick: c, children: "Rename" }),
1208
- /* @__PURE__ */ a("button", { type: "button", role: "menuitem", className: "pm-kebab-menu__item", onClick: d, children: "Duplicate" }),
1209
- /* @__PURE__ */ a(
1210
- "button",
1211
- {
1212
- type: "button",
1213
- role: "menuitem",
1214
- className: "pm-kebab-menu__item pm-kebab-menu__item--danger",
1215
- onClick: m,
1216
- children: "Delete"
1217
- }
1218
- )
1219
- ]
1220
- }
1221
- )
1222
- ] });
1223
- }
1224
- const mt = [
399
+ const ue = [
1225
400
  { id: "p-pipeline", name: "My Pipeline", active: !0 },
1226
401
  { id: "p-numbers", name: "My Numbers", active: !1 },
1227
402
  { id: "p-morning", name: "My Morning", active: !1 },
1228
403
  { id: "p-accounts", name: "My Accounts", active: !1 }
1229
404
  ];
1230
- function Qt({
405
+ function ke({
1231
406
  isOpen: e,
1232
- pages: t = mt,
1233
- externalPages: r,
1234
- activePageId: l,
1235
- onRename: n,
1236
- onDuplicate: i,
1237
- onDelete: u,
1238
- onReorder: o,
1239
- onCreatePage: s,
1240
- onSwitchPage: c
407
+ pages: t = ue,
408
+ footerSlot: o
1241
409
  }) {
1242
- const d = O(), [m, h] = A(() => [...t]), y = M((g, N) => {
1243
- h((P) => P.map((k) => k.id === g ? { ...k, name: N } : k));
1244
- }, []), p = M((g) => {
1245
- h((N) => {
1246
- const P = N.find((U) => U.id === g);
1247
- if (!P) return N;
1248
- const k = {
1249
- id: `${P.id}-copy-${Date.now()}`,
1250
- name: `${P.name} copy`,
1251
- active: !1
1252
- }, D = N.findIndex((U) => U.id === g);
1253
- return [...N.slice(0, D + 1), k, ...N.slice(D + 1)];
1254
- });
1255
- }, []), v = M((g) => {
1256
- h((N) => N.filter((P) => P.id !== g));
1257
- }, []), T = M((g) => {
1258
- h((N) => {
1259
- const P = new Map(N.map((D) => [D.id, D])), k = g.map((D) => P.get(D)).filter(Boolean);
1260
- return k.length === N.length ? k : N;
1261
- });
1262
- }, []), S = r != null, b = S ? r : m, _ = l != null ? b.map((g) => ({ ...g, active: g.id === l })) : [...b], x = n ?? (S ? void 0 : y), $ = i ?? (S ? void 0 : p), F = u ?? (S ? void 0 : v), E = o ?? (S ? void 0 : T), L = M(
1263
- (g) => {
1264
- S || h(g);
1265
- },
1266
- [S]
1267
- ), W = M(
1268
- (g) => {
1269
- const N = g[0]?.items.map((P) => P.id) ?? [];
1270
- N.length > 0 && E && E(N);
1271
- },
1272
- [E]
1273
- ), G = _.map((g) => `${g.id}:${g.name}`).join("|"), j = E != null && _.length > 1 ? /* @__PURE__ */ a(
1274
- Le,
1275
- {
1276
- zones: [
1277
- {
1278
- zoneKey: "pm-pages",
1279
- items: _.map((g) => ({ ...g, id: g.id }))
1280
- }
1281
- ],
1282
- onZoneChange: W,
1283
- renderZone: (g, N, P) => /* @__PURE__ */ a("div", { className: "pm-list", role: "list", children: P }),
1284
- renderItem: (g) => /* @__PURE__ */ a(
1285
- he,
1286
- {
1287
- page: g,
1288
- onSwitchPage: c
1289
- },
1290
- g.id
1291
- )
1292
- },
1293
- G
1294
- ) : /* @__PURE__ */ a("div", { className: "pm-list", role: "list", children: _.map((g) => /* @__PURE__ */ a(
1295
- he,
1296
- {
1297
- page: g,
1298
- onSwitchPage: c
1299
- },
1300
- g.id
1301
- )) }), Z = () => d?.dispatch({ type: "CLOSE_PANEL", reason: "header-x" });
1302
- return /* @__PURE__ */ a(
1303
- Te.Provider,
1304
- {
1305
- value: {
1306
- pages: _,
1307
- setPages: L,
1308
- renamePage: x,
1309
- duplicatePage: $,
1310
- deletePage: F,
1311
- // Sprint 2026-05-20 — propagate live create binding for footer.
1312
- createPage: s
1313
- },
1314
- children: /* @__PURE__ */ a(
1315
- K,
1316
- {
1317
- variant: "no-stage",
1318
- title: "Manage pages",
1319
- onClose: Z,
1320
- footer: { right: /* @__PURE__ */ a(pt, {}) },
1321
- children: /* @__PURE__ */ a("div", { "data-shell": "page-management", "aria-hidden": !e, children: j })
1322
- }
1323
- )
1324
- }
1325
- );
410
+ const [n, a] = y(() => [...t]);
411
+ return /* @__PURE__ */ h(X.Provider, { value: { pages: n, setPages: a }, children: [
412
+ /* @__PURE__ */ h("div", { "data-shell": "page-management", "aria-hidden": !e, children: [
413
+ /* @__PURE__ */ s("h3", { children: "Manage pages" }),
414
+ /* @__PURE__ */ s("div", { className: "pm-list", role: "list", children: n.map((r) => /* @__PURE__ */ s(ie, { page: r }, r.id)) })
415
+ ] }),
416
+ o
417
+ ] });
1326
418
  }
1327
- const Wt = {
419
+ const Me = {
1328
420
  SETTINGS: "settings",
1329
421
  CATALOG_ADD: "catalog-add",
1330
422
  CATALOG_REPLACE: "catalog-replace",
1331
423
  PAGE_MGMT: "page-management",
1332
424
  NOTIFICATION_CENTER: "notification-center"
1333
- }, ht = {
425
+ }, pe = {
1334
426
  position: "fixed",
1335
427
  inset: 0,
1336
428
  pointerEvents: "none",
1337
429
  zIndex: 55
1338
- }, ft = {
430
+ }, me = {
1339
431
  position: "absolute",
1340
432
  inset: 0,
1341
433
  zIndex: 1,
1342
434
  // CR-03 fix: pass-through tint — scrim is visual-only and must not intercept
1343
- // grid card clicks. Dismiss is ESC-only (see PanelHost.tsx CR-03 comment).
435
+ // grid card clicks. See PanelHost.tsx CR-03 comment for full rationale.
1344
436
  pointerEvents: "none",
1345
437
  background: "rgba(0, 0, 0, 0.04)"
1346
438
  };
1347
- function Gt() {
1348
- const { state: e, dispatch: t, getCloseLog: r } = Me();
1349
- z(() => {
439
+ function $e() {
440
+ const { state: e, dispatch: t, getCloseLog: o } = Z();
441
+ F(() => {
1350
442
  if (e.activePanelId == null) return;
1351
- function n(i) {
1352
- i.key === "Escape" && t({ type: "CLOSE_PANEL", reason: "escape-key" });
443
+ function r(d) {
444
+ d.key === "Escape" && t({ type: "CLOSE_PANEL", reason: "escape-key" });
1353
445
  }
1354
- return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
446
+ return document.addEventListener("keydown", r), () => document.removeEventListener("keydown", r);
1355
447
  }, [e.activePanelId, t]);
1356
- const l = Q(e);
1357
- return Ie(() => {
1358
- l.current = e;
1359
- }), z(() => {
448
+ const n = B(e);
449
+ te(() => {
450
+ n.current = e;
451
+ }), F(() => {
1360
452
  if (process.env.NODE_ENV === "production") return;
1361
- const n = window;
1362
- return n.__panelsHostHandle && console.warn("[panels] multiple PanelHost/PanelHostShell instances mounted; dev handle is unreliable"), n.__panelsHostHandle = {
453
+ const r = window;
454
+ return r.__panelsHostHandle && console.warn("[panels] multiple PanelHost/PanelHostShell instances mounted; dev handle is unreliable"), r.__panelsHostHandle = {
1363
455
  dispatch: t,
1364
- getState: () => l.current,
1365
- getCloseLog: r
456
+ getState: () => n.current,
457
+ getCloseLog: o
1366
458
  }, () => {
1367
- n.__panelsHostHandle?.dispatch === t && delete window.__panelsHostHandle;
459
+ r.__panelsHostHandle?.dispatch === t && delete window.__panelsHostHandle;
1368
460
  };
1369
- }, [t, r]), /* @__PURE__ */ a("div", { "data-panel-host": "true", style: ht, children: e.activePanelId != null && /* @__PURE__ */ a(
461
+ }, [t, o]);
462
+ const a = Y(() => {
463
+ t({ type: "CLOSE_PANEL", reason: "nav-escape-hatch" });
464
+ }, [t]);
465
+ return /* @__PURE__ */ s("div", { "data-panel-host": "true", style: pe, children: e.activePanelId != null && /* @__PURE__ */ s(
1370
466
  "div",
1371
467
  {
1372
468
  "data-panel-scrim": "true",
1373
- style: ft
469
+ style: me,
470
+ onClick: a
1374
471
  }
1375
472
  ) });
1376
473
  }
1377
- const gt = 700;
1378
- function bt(e, t) {
1379
- const [r, l] = A(null), n = Q(null);
1380
- return z(() => {
1381
- if (e != null) {
1382
- n.current != null && (clearTimeout(n.current), n.current = null), l(null);
1383
- return;
474
+ function De({ panelComponents: e }) {
475
+ const t = I();
476
+ if (t == null) return null;
477
+ const { state: o, dispatch: n } = t;
478
+ if (o.activePanelId == null) return null;
479
+ const a = e[o.activePanelId];
480
+ if (a == null)
481
+ return process.env.NODE_ENV !== "production" && console.error(
482
+ "[panels] No panel component registered for activePanelId:",
483
+ o.activePanelId
484
+ ), null;
485
+ if (o.activePanelId === "settings")
486
+ return /* @__PURE__ */ s(N, { isOpen: !0, children: /* @__PURE__ */ s(
487
+ w,
488
+ {
489
+ isOpen: !0,
490
+ onClose: () => n({ type: "CLOSE_PANEL", reason: "header-x" }),
491
+ footer: /* @__PURE__ */ h(ee, { children: [
492
+ /* @__PURE__ */ s(
493
+ "button",
494
+ {
495
+ id: "settings-cancel",
496
+ type: "button",
497
+ className: "gloss-panel-chrome__footer-btn",
498
+ onClick: () => n({ type: "CLOSE_PANEL", reason: "cancel-button" }),
499
+ children: "Cancel"
500
+ }
501
+ ),
502
+ /* @__PURE__ */ s(
503
+ "button",
504
+ {
505
+ id: "settings-apply",
506
+ type: "button",
507
+ className: "gloss-panel-chrome__footer-btn gloss-panel-chrome__footer-btn--primary",
508
+ onClick: () => n({ type: "CLOSE_PANEL", reason: "apply-button" }),
509
+ children: "Apply"
510
+ }
511
+ )
512
+ ] }),
513
+ children: /* @__PURE__ */ s(a, { isOpen: !0 })
514
+ }
515
+ ) });
516
+ if (o.activePanelId === "catalog-add" || o.activePanelId === "catalog-replace") {
517
+ const r = o.activePanelId === "catalog-replace" ? "replace" : "add";
518
+ return /* @__PURE__ */ s(N, { isOpen: !0, children: /* @__PURE__ */ s(
519
+ w,
520
+ {
521
+ isOpen: !0,
522
+ onClose: () => n({ type: "CLOSE_PANEL", reason: "header-x" }),
523
+ footer: null,
524
+ children: /* @__PURE__ */ s(
525
+ a,
526
+ {
527
+ isOpen: !0,
528
+ footerSlot: /* @__PURE__ */ s(le, { mode: r, dispatch: n })
529
+ }
530
+ )
531
+ }
532
+ ) });
533
+ }
534
+ return o.activePanelId === "page-management" ? /* @__PURE__ */ s(N, { isOpen: !0, children: /* @__PURE__ */ s(
535
+ w,
536
+ {
537
+ isOpen: !0,
538
+ onClose: () => n({ type: "CLOSE_PANEL", reason: "header-x" }),
539
+ footer: null,
540
+ children: /* @__PURE__ */ s(a, { isOpen: !0, footerSlot: /* @__PURE__ */ s(de, {}) })
1384
541
  }
1385
- if (t) {
1386
- n.current != null && (clearTimeout(n.current), n.current = null), l(null);
1387
- return;
542
+ ) }) : /* @__PURE__ */ s(N, { isOpen: !0, children: /* @__PURE__ */ s(
543
+ w,
544
+ {
545
+ isOpen: !0,
546
+ onClose: () => n({ type: "CLOSE_PANEL", reason: "header-x" }),
547
+ footer: null,
548
+ children: /* @__PURE__ */ s(a, { isOpen: !0 })
1388
549
  }
1389
- return n.current = setTimeout(() => {
1390
- l(null), n.current = null;
1391
- }, gt), () => {
1392
- n.current != null && (clearTimeout(n.current), n.current = null);
1393
- };
1394
- }, [e, t]), z(() => {
1395
- e != null && l(e);
1396
- }, [e]), e != null ? { panelId: e, isOpen: !0 } : r != null ? { panelId: r, isOpen: !1 } : { panelId: null, isOpen: !1 };
1397
- }
1398
- function jt({ panelComponents: e, children: t }) {
1399
- const r = O(), l = r?.state.lastClose?.reason === "section-hidden", n = bt(r?.state.activePanelId ?? null, l);
1400
- if (r == null || n.panelId == null) return null;
1401
- const i = n.panelId, u = n.isOpen, o = e?.[i];
1402
- return o == null && t == null ? (process.env.NODE_ENV !== "production" && console.error(
1403
- "[panels] No panel component registered for activePanelId:",
1404
- i
1405
- ), null) : /* @__PURE__ */ a(Oe, { isOpen: u, children: o != null ? /* @__PURE__ */ a(o, { isOpen: u }) : t });
550
+ ) });
1406
551
  }
1407
- function fe(e) {
552
+ function z(e) {
1408
553
  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;
1409
554
  }
1410
- const yt = 685, ge = 627, vt = "cubic-bezier(0.22, 1, 0.36, 1)", _t = 200;
1411
- function we(e, t) {
555
+ const he = 685, V = 627, fe = "cubic-bezier(0.22, 1, 0.36, 1)", ve = 200;
556
+ function J(e, t) {
1412
557
  if (typeof window > "u") return t;
1413
- const r = window.getComputedStyle(document.documentElement).getPropertyValue(e).trim();
1414
- if (!r) return t;
1415
- const l = parseFloat(r);
1416
- return Number.isNaN(l) ? t : r.endsWith("s") && !r.endsWith("ms") ? l * 1e3 : l;
558
+ const o = window.getComputedStyle(document.documentElement).getPropertyValue(e).trim();
559
+ if (!o) return t;
560
+ const n = parseFloat(o);
561
+ return Number.isNaN(n) ? t : o.endsWith("s") && !o.endsWith("ms") ? n * 1e3 : n;
1417
562
  }
1418
- function Ct(e, t) {
563
+ function ge(e, t) {
1419
564
  return typeof window > "u" ? t : window.getComputedStyle(document.documentElement).getPropertyValue(e).trim() || t;
1420
565
  }
1421
- function Y(e) {
566
+ function S(e) {
1422
567
  e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger });
1423
568
  }
1424
- function Nt(e) {
1425
- const { mountEl: t, chromeEl: r, reducedMotion: l, onAssert: n } = e;
1426
- if (t == null || r == null) {
1427
- Y(e), n?.({ branch: "slide-fallback-no-dom", timestamp: Date.now() });
569
+ function ye(e) {
570
+ const { mountEl: t, chromeEl: o, reducedMotion: n, onAssert: a } = e;
571
+ if (t == null || o == null) {
572
+ S(e), a?.({ branch: "slide-fallback-no-dom", timestamp: Date.now() });
1428
573
  return;
1429
574
  }
1430
- if (l) {
1431
- e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), n?.({ branch: "slide-reduced-motion", timestamp: Date.now() });
575
+ if (n) {
576
+ e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), a?.({ branch: "slide-reduced-motion", timestamp: Date.now() });
1432
577
  return;
1433
578
  }
1434
- if (typeof r.animate != "function") {
1435
- Y(e), n?.({ branch: "slide-no-waapi", timestamp: Date.now() });
579
+ if (typeof o.animate != "function") {
580
+ S(e), a?.({ branch: "slide-no-waapi", timestamp: Date.now() });
1436
581
  return;
1437
582
  }
1438
- const i = r.cloneNode(!0);
1439
- 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 });
1440
- const u = we("--panel-open-dur", yt), o = Ct("--panel-easing", vt), s = r.animate(
583
+ const r = o.cloneNode(!0);
584
+ r.id = "panel-chrome-frozen", r.style.cssText = "position:absolute;left:8px;right:8px;top:8px;z-index:1;pointer-events:none;", t.appendChild(r), o.style.zIndex = "2", e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger });
585
+ const d = J("--panel-open-dur", he), l = ge("--panel-easing", fe), i = o.animate(
1441
586
  [{ transform: "translateY(100%)" }, { transform: "translateY(0)" }],
1442
- { duration: u, easing: o, fill: "forwards" }
587
+ { duration: d, easing: l, fill: "forwards" }
1443
588
  );
1444
- s.addEventListener(
589
+ i.addEventListener(
1445
590
  "finish",
1446
591
  () => {
1447
- i.remove(), r.style.zIndex = "", s.cancel(), n?.({ branch: "slide-complete", frozen: "cleaned", timestamp: Date.now() });
592
+ r.remove(), o.style.zIndex = "", i.cancel(), a?.({ branch: "slide-complete", frozen: "cleaned", timestamp: Date.now() });
1448
593
  },
1449
594
  { once: !0 }
1450
595
  );
1451
596
  }
1452
- function St(e) {
1453
- const { mountEl: t, onAssert: r } = e;
597
+ function be(e) {
598
+ const { mountEl: t, onAssert: o } = e;
1454
599
  if (t == null) {
1455
- e.dispatch({ type: "CLOSE_PANEL", reason: "mutex-handoff" }), setTimeout(() => Y(e), ge), r?.({ branch: "handoff-fallback-no-mount", timestamp: Date.now() });
600
+ e.dispatch({ type: "CLOSE_PANEL", reason: "mutex-handoff" }), setTimeout(() => S(e), V), o?.({ branch: "handoff-fallback-no-mount", timestamp: Date.now() });
1456
601
  return;
1457
602
  }
1458
- const l = we("--panel-close-dur", ge);
1459
- let n = !1, i = null;
1460
- const u = (s) => {
1461
- s.target !== t || s.propertyName !== "max-height" || n || (n = !0, i != null && clearTimeout(i), t.removeEventListener("transitionend", u), e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), r?.({ branch: "handoff-complete", timestamp: Date.now() }));
1462
- }, o = () => {
1463
- n || (n = !0, t.removeEventListener("transitionend", u), e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), r?.({ branch: "handoff-forced", timestamp: Date.now() }));
603
+ const n = J("--panel-close-dur", V);
604
+ let a = !1, r = null;
605
+ const d = (i) => {
606
+ i.target !== t || i.propertyName !== "max-height" || a || (a = !0, r != null && clearTimeout(r), t.removeEventListener("transitionend", d), e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), o?.({ branch: "handoff-complete", timestamp: Date.now() }));
607
+ }, l = () => {
608
+ a || (a = !0, t.removeEventListener("transitionend", d), e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), o?.({ branch: "handoff-forced", timestamp: Date.now() }));
1464
609
  };
1465
- t.addEventListener("transitionend", u), e.dispatch({ type: "CLOSE_PANEL", reason: "mutex-handoff" }), i = setTimeout(o, l + _t);
610
+ t.addEventListener("transitionend", d), e.dispatch({ type: "CLOSE_PANEL", reason: "mutex-handoff" }), r = setTimeout(l, n + ve);
1466
611
  }
1467
- function Et(e) {
1468
- const { state: t, onAssert: r } = e;
612
+ function Pe(e) {
613
+ const { state: t, onAssert: o } = e;
1469
614
  if (t.activePanelId && t.isDirty) {
1470
- e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), r?.({ branch: "blocked-dirty", timestamp: Date.now() });
615
+ e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), o?.({ branch: "blocked-dirty", timestamp: Date.now() });
1471
616
  return;
1472
617
  }
1473
- const l = fe(t.activeTrigger), n = fe(e.trigger);
1474
- if (!!t.activePanelId && l != null && l === n) {
1475
- Nt(e);
618
+ const n = z(t.activeTrigger), a = z(e.trigger);
619
+ if (!!t.activePanelId && n != null && n === a) {
620
+ ye(e);
1476
621
  return;
1477
622
  }
1478
623
  if (t.activePanelId) {
1479
- St(e);
624
+ be(e);
1480
625
  return;
1481
626
  }
1482
- Y(e), r?.({ branch: "fresh-open", timestamp: Date.now() });
627
+ S(e), o?.({ branch: "fresh-open", timestamp: Date.now() });
1483
628
  }
1484
- function Tt() {
629
+ function Ce() {
1485
630
  if (!(typeof window > "u"))
1486
631
  return window.__panelsAsserter;
1487
632
  }
1488
- function Zt() {
1489
- const e = O(), t = be();
1490
- return M(
1491
- (r, l) => {
633
+ function Re() {
634
+ const e = I(), t = q();
635
+ return Y(
636
+ (o, n) => {
1492
637
  if (!e)
1493
638
  return;
1494
- const n = typeof document < "u" ? document.querySelector('[data-mount="panel"]') : null, i = typeof document < "u" ? document.querySelector('[data-chrome="panel"]') : null, u = {
1495
- panelId: r,
1496
- trigger: l,
639
+ const a = typeof document < "u" ? document.querySelector('[data-mount="panel"]') : null, r = typeof document < "u" ? document.querySelector('[data-chrome="panel"]') : null, d = {
640
+ panelId: o,
641
+ trigger: n,
1497
642
  state: e.state,
1498
643
  dispatch: e.dispatch,
1499
- mountEl: n,
1500
- chromeEl: i,
644
+ mountEl: a,
645
+ chromeEl: r,
1501
646
  reducedMotion: t,
1502
- onAssert: (o) => {
1503
- Tt()?.recordTransition?.(o);
647
+ onAssert: (l) => {
648
+ Ce()?.recordTransition?.(l);
1504
649
  }
1505
650
  };
1506
- Et(u);
651
+ Pe(d);
1507
652
  },
1508
653
  [e, t]
1509
654
  );
1510
655
  }
1511
- let V = !1, X = null;
1512
- function se() {
656
+ let E = !1, _ = null;
657
+ function T() {
1513
658
  const e = [];
1514
659
  let t = "cleaned";
1515
660
  document.querySelectorAll("#panel-chrome-frozen").length > 0 && (e.push("#panel-chrome-frozen"), t = "lingering");
1516
- const l = document.querySelectorAll(".gloss-panel-mount");
1517
- l.length > 1 && e.push(`mount-count=${l.length}`);
1518
- const n = l[0] ?? null, i = n ? n.querySelectorAll(".gloss-panel-chrome") : [];
1519
- i.length > 1 && e.push(`chrome-count=${i.length}`);
1520
- const u = i[0] ?? null;
1521
- if (u) {
1522
- const d = u.style.zIndex;
1523
- d !== "" && d !== "2" && e.push(`chrome-zindex=${d}`);
661
+ const n = document.querySelectorAll(".gloss-panel-mount");
662
+ n.length > 1 && e.push(`mount-count=${n.length}`);
663
+ const a = n[0] ?? null, r = a ? a.querySelectorAll(".gloss-panel-chrome") : [];
664
+ r.length > 1 && e.push(`chrome-count=${r.length}`);
665
+ const d = r[0] ?? null;
666
+ if (d) {
667
+ const u = d.style.zIndex;
668
+ u !== "" && u !== "2" && e.push(`chrome-zindex=${u}`);
1524
669
  }
1525
- const o = n ? "present" : "absent", s = u ? "present" : "absent";
670
+ const l = a ? "present" : "absent", i = d ? "present" : "absent";
1526
671
  return {
1527
672
  valid: e.length === 0,
1528
- mount: o,
1529
- chrome: s,
673
+ mount: l,
674
+ chrome: i,
1530
675
  frozen: t,
1531
676
  orphans: e,
1532
677
  timestamp: Date.now()
1533
678
  };
1534
679
  }
1535
- const J = "8px 8px 0px", ee = "64px", te = "inset(0px 0px 60px 0px)", ne = "inset(0px -40px -40px -40px)";
1536
- function C(e, t, r, l, n) {
1537
- return { id: e, constraint: t, expected: r, actual: l, pass: n };
680
+ const A = "8px 8px 0px", x = "64px", O = "inset(0px 0px 60px 0px)", L = "inset(0px -40px -40px -40px)";
681
+ function p(e, t, o, n, a) {
682
+ return { id: e, constraint: t, expected: o, actual: n, pass: a };
1538
683
  }
1539
- function I(e) {
684
+ function P(e) {
1540
685
  const t = parseInt(e, 10);
1541
686
  return Number.isFinite(t) ? t : NaN;
1542
687
  }
1543
- function le() {
1544
- const e = [], t = document.querySelector(".gloss-panel-mount"), r = t?.querySelector(".gloss-panel-chrome") ?? null, l = document.querySelector(".gloss-panel-coordinator") ?? document.querySelector("[data-panel-coordinator]"), n = document.querySelector(".bell-cutout"), i = document.querySelector(".bell-popover"), u = document.querySelector(".gloss-bottom-toolbar");
688
+ function M() {
689
+ 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]"), a = document.querySelector(".bell-cutout"), r = document.querySelector(".bell-popover"), d = document.querySelector(".gloss-bottom-toolbar");
1545
690
  if (!t)
1546
- e.push(C("C1", "mount --reveal-y matches clip-path inset-bottom Npx", "mount present", "absent", !1));
691
+ e.push(p("C1", "mount --reveal-y matches clip-path inset-bottom Npx", "mount present", "absent", !1));
1547
692
  else {
1548
- const o = getComputedStyle(t), s = o.getPropertyValue("--reveal-y").trim() || t.style.getPropertyValue("--reveal-y").trim(), c = o.clipPath || t.style.clipPath || "", d = c.match(/inset\(\s*0(?:px)?\s+0(?:px)?\s+(\d+)px\s+0(?:px)?\s*\)/), m = d ? parseInt(d[1], 10) : NaN, h = I(s), y = Number.isFinite(m) && Number.isFinite(h) && m === h;
693
+ const l = getComputedStyle(t), i = l.getPropertyValue("--reveal-y").trim() || t.style.getPropertyValue("--reveal-y").trim(), c = l.clipPath || t.style.clipPath || "", u = c.match(/inset\(\s*0(?:px)?\s+0(?:px)?\s+(\d+)px\s+0(?:px)?\s*\)/), m = u ? parseInt(u[1], 10) : NaN, f = P(i), v = Number.isFinite(m) && Number.isFinite(f) && m === f;
1549
694
  e.push(
1550
- C(
695
+ p(
1551
696
  "C1",
1552
697
  "mount --reveal-y matches clip-path inset-bottom Npx",
1553
- `inset(0 0 ${h}px 0) === --reveal-y(${h}px)`,
1554
- `--reveal-y=${s || "n/a"} clip-path=${c || "n/a"}`,
1555
- y
698
+ `inset(0 0 ${f}px 0) === --reveal-y(${f}px)`,
699
+ `--reveal-y=${i || "n/a"} clip-path=${c || "n/a"}`,
700
+ v
1556
701
  )
1557
702
  );
1558
703
  }
1559
704
  if (!t)
1560
- e.push(C("C2", "mount padding constant", J, "absent", !1));
705
+ e.push(p("C2", "mount padding constant", A, "absent", !1));
1561
706
  else {
1562
- const o = t.style.padding, s = getComputedStyle(t), c = o || s.padding || "", d = c === J || c === "8px 8px 0px 8px";
1563
- e.push(C("C2", "mount padding constant", J, c || "n/a", d));
707
+ const l = t.style.padding, i = getComputedStyle(t), c = l || i.padding || "", u = c === A || c === "8px 8px 0px 8px";
708
+ e.push(p("C2", "mount padding constant", A, c || "n/a", u));
1564
709
  }
1565
710
  if (!t)
1566
- e.push(C("C3", "mount.bottom resolves to var(--tb-h)=64px", ee, "absent", !1));
711
+ e.push(p("C3", "mount.bottom resolves to var(--tb-h)=64px", x, "absent", !1));
1567
712
  else {
1568
- const s = getComputedStyle(t).bottom || t.style.bottom || "", c = s === ee;
1569
- e.push(C("C3", "mount.bottom resolves to var(--tb-h)=64px", ee, s || "n/a", c));
713
+ const i = getComputedStyle(t).bottom || t.style.bottom || "", c = i === x;
714
+ e.push(p("C3", "mount.bottom resolves to var(--tb-h)=64px", x, i || "n/a", c));
1570
715
  }
1571
- if (!r)
1572
- e.push(C("C4", "panel-chrome height formula = (row-h*3)+(row-gap*3)-8px", "formula match", "absent", !1));
716
+ if (!o)
717
+ e.push(p("C4", "panel-chrome height formula = (row-h*3)+(row-gap*3)-8px", "formula match", "absent", !1));
1573
718
  else {
1574
- const o = getComputedStyle(r), s = I(
1575
- o.getPropertyValue("--row-h").trim() || r.style.getPropertyValue("--row-h").trim() || "0"
1576
- ), c = I(
1577
- o.getPropertyValue("--row-gap").trim() || r.style.getPropertyValue("--row-gap").trim() || "0"
1578
- ), d = s * 3 + c * 3 - 8, m = I(o.height || r.style.height || ""), h = Number.isFinite(s) && Number.isFinite(c) && Number.isFinite(m) && Number.isFinite(d) && m === d;
719
+ const l = getComputedStyle(o), i = P(
720
+ l.getPropertyValue("--row-h").trim() || o.style.getPropertyValue("--row-h").trim() || "0"
721
+ ), c = P(
722
+ l.getPropertyValue("--row-gap").trim() || o.style.getPropertyValue("--row-gap").trim() || "0"
723
+ ), u = i * 3 + c * 3 - 8, m = P(l.height || o.style.height || ""), f = Number.isFinite(i) && Number.isFinite(c) && Number.isFinite(m) && Number.isFinite(u) && m === u;
1579
724
  e.push(
1580
- C(
725
+ p(
1581
726
  "C4",
1582
727
  "panel-chrome height formula = (row-h*3)+(row-gap*3)-8px",
1583
- `${d}px (rh=${s} rg=${c})`,
728
+ `${u}px (rh=${i} rg=${c})`,
1584
729
  `${m}px`,
1585
- h
730
+ f
1586
731
  )
1587
732
  );
1588
733
  }
1589
- if (!l || !r)
734
+ if (!n || !o)
1590
735
  e.push(
1591
- C(
736
+ p(
1592
737
  "C5",
1593
738
  'coordinator perspective + origin "center bottom"; chrome perspective-style flat',
1594
739
  "present",
1595
- `coordinator=${l ? "present" : "absent"} chrome=${r ? "present" : "absent"}`,
740
+ `coordinator=${n ? "present" : "absent"} chrome=${o ? "present" : "absent"}`,
1596
741
  !1
1597
742
  )
1598
743
  );
1599
744
  else {
1600
- const o = getComputedStyle(l), s = getComputedStyle(r), c = o.perspective || l.style.perspective || "", d = (o.perspectiveOrigin || l.style.perspectiveOrigin || "").trim(), m = s.perspectiveStyle || r.style.perspectiveStyle || "", v = c !== "" && c !== "none" && (d === "center bottom" || d === "50% 100%") && m === "flat";
745
+ const l = getComputedStyle(n), i = getComputedStyle(o), c = l.perspective || n.style.perspective || "", u = (l.perspectiveOrigin || n.style.perspectiveOrigin || "").trim(), m = i.perspectiveStyle || o.style.perspectiveStyle || "", g = c !== "" && c !== "none" && (u === "center bottom" || u === "50% 100%") && m === "flat";
1601
746
  e.push(
1602
- C(
747
+ p(
1603
748
  "C5",
1604
749
  'coordinator perspective + origin "center bottom"; chrome perspective-style flat',
1605
750
  "perspective:not-none, origin:center bottom, chrome-style:flat",
1606
- `perspective=${c} origin=${d} chrome-style=${m}`,
1607
- v
751
+ `perspective=${c} origin=${u} chrome-style=${m}`,
752
+ g
1608
753
  )
1609
754
  );
1610
755
  }
1611
756
  {
1612
- let o = !1, s = "absent";
757
+ let l = !1, i = "absent";
1613
758
  try {
1614
759
  for (const c of Array.from(document.styleSheets)) {
1615
- let d = [];
760
+ let u = [];
1616
761
  try {
1617
- d = Array.from(c.cssRules ?? []);
762
+ u = Array.from(c.cssRules ?? []);
1618
763
  } catch {
1619
764
  continue;
1620
765
  }
1621
- for (const m of d)
766
+ for (const m of u)
1622
767
  if (m.name === "stage-spin") {
1623
- const y = Array.from(m.cssRules), p = y.find((_) => _.keyText === "0%" || _.keyText === "from"), v = y.find((_) => _.keyText === "100%" || _.keyText === "to"), T = p?.style.transform ?? "", S = v?.style.transform ?? "", b = /rotateY\(\s*0(?:deg)?\s*\)/;
1624
- o = b.test(T) && b.test(S), s = `0%=${T || "n/a"} 100%=${S || "n/a"}`;
768
+ const v = Array.from(m.cssRules), b = v.find((C) => C.keyText === "0%" || C.keyText === "from"), g = v.find((C) => C.keyText === "100%" || C.keyText === "to"), $ = b?.style.transform ?? "", D = g?.style.transform ?? "", R = /rotateY\(\s*0(?:deg)?\s*\)/;
769
+ l = R.test($) && R.test(D), i = `0%=${$ || "n/a"} 100%=${D || "n/a"}`;
1625
770
  break;
1626
771
  }
1627
- if (s !== "absent") break;
772
+ if (i !== "absent") break;
1628
773
  }
1629
774
  } catch {
1630
- s = "inspection-error";
775
+ i = "inspection-error";
1631
776
  }
1632
777
  e.push(
1633
- C(
778
+ p(
1634
779
  "C6",
1635
780
  "@keyframes stage-spin 0% AND 100% anchor at rotateY(0)",
1636
781
  "both frames rotateY(0)",
1637
- s,
1638
- o
782
+ i,
783
+ l
1639
784
  )
1640
785
  );
1641
786
  }
1642
787
  {
1643
- const o = document.documentElement, s = getComputedStyle(o), c = s.getPropertyValue("--panel-open-dur").trim() || o.style.getPropertyValue("--panel-open-dur").trim(), d = s.getPropertyValue("--panel-close-dur").trim() || o.style.getPropertyValue("--panel-close-dur").trim(), m = I(c) || parseFloat(c) * (c.endsWith("s") && !c.endsWith("ms") ? 1e3 : 1), h = I(d) || parseFloat(d) * (d.endsWith("s") && !d.endsWith("ms") ? 1e3 : 1), y = Number.isFinite(m) && Number.isFinite(h) && m > h;
788
+ const l = document.documentElement, i = getComputedStyle(l), c = i.getPropertyValue("--panel-open-dur").trim() || l.style.getPropertyValue("--panel-open-dur").trim(), u = i.getPropertyValue("--panel-close-dur").trim() || l.style.getPropertyValue("--panel-close-dur").trim(), m = P(c) || parseFloat(c) * (c.endsWith("s") && !c.endsWith("ms") ? 1e3 : 1), f = P(u) || parseFloat(u) * (u.endsWith("s") && !u.endsWith("ms") ? 1e3 : 1), v = Number.isFinite(m) && Number.isFinite(f) && m > f;
1644
789
  e.push(
1645
- C("C7", "--panel-open-dur > --panel-close-dur", "open > close", `open=${c || "n/a"} close=${d || "n/a"}`, y)
790
+ p("C7", "--panel-open-dur > --panel-close-dur", "open > close", `open=${c || "n/a"} close=${u || "n/a"}`, v)
1646
791
  );
1647
792
  }
1648
- if (!n)
1649
- e.push(C("C8", "BellCutout zero computed animation/transition", "no inline timing", "absent", !1));
793
+ if (!a)
794
+ e.push(p("C8", "BellCutout zero computed animation/transition", "no inline timing", "absent", !1));
1650
795
  else {
1651
- const o = getComputedStyle(n), s = o.animationName || "", c = o.transitionProperty || "", d = (s === "" || s === "none") && (c === "" || c === "none" || c === "all");
796
+ const l = getComputedStyle(a), i = l.animationName || "", c = l.transitionProperty || "", u = (i === "" || i === "none") && (c === "" || c === "none" || c === "all");
1652
797
  e.push(
1653
- C(
798
+ p(
1654
799
  "C8",
1655
800
  "BellCutout zero computed animation/transition",
1656
801
  "animation:none AND transition:none",
1657
- `animation=${s || "n/a"} transition=${c || "n/a"}`,
1658
- d
802
+ `animation=${i || "n/a"} transition=${c || "n/a"}`,
803
+ u
1659
804
  )
1660
805
  );
1661
806
  }
1662
807
  if (!t)
1663
- e.push(C("C9", "mount closed-state clipPath", te, "absent", !1));
808
+ e.push(p("C9", "mount closed-state clipPath", O, "absent", !1));
1664
809
  else {
1665
- const o = t.style.clipPath, s = getComputedStyle(t), c = o || s.clipPath || "", d = c === te;
1666
- e.push(C("C9", "mount closed-state clipPath", te, c || "n/a", d));
810
+ const l = t.style.clipPath, i = getComputedStyle(t), c = l || i.clipPath || "", u = c === O;
811
+ e.push(p("C9", "mount closed-state clipPath", O, c || "n/a", u));
1667
812
  }
1668
- if (!i)
1669
- e.push(C("C10", "bell-popover parentElement === document.body (open)", "body", "absent", !1));
813
+ if (!r)
814
+ e.push(p("C10", "bell-popover parentElement === document.body (open)", "body", "absent", !1));
1670
815
  else {
1671
- const o = i.parentElement, s = o === document.body;
816
+ const l = r.parentElement, i = l === document.body;
1672
817
  e.push(
1673
- C(
818
+ p(
1674
819
  "C10",
1675
820
  "bell-popover parentElement === document.body (open)",
1676
821
  "body",
1677
- o === document.body ? "body" : o?.tagName ?? "n/a",
1678
- s
822
+ l === document.body ? "body" : l?.tagName ?? "n/a",
823
+ i
1679
824
  )
1680
825
  );
1681
826
  }
1682
- if (!l)
1683
- e.push(C("C11", "coordinator overflow === visible", "visible", "absent", !1));
827
+ if (!n)
828
+ e.push(p("C11", "coordinator overflow === visible", "visible", "absent", !1));
1684
829
  else {
1685
- const s = getComputedStyle(l).overflow || l.style.overflow || "", c = s === "visible";
1686
- e.push(C("C11", "coordinator overflow === visible", "visible", s || "n/a", c));
830
+ const i = getComputedStyle(n).overflow || n.style.overflow || "", c = i === "visible";
831
+ e.push(p("C11", "coordinator overflow === visible", "visible", i || "n/a", c));
1687
832
  }
1688
- if (!u)
1689
- e.push(C("C12", "toolbar clipPath = inset(0 -40 -40 -40)", ne, "absent", !1));
833
+ if (!d)
834
+ e.push(p("C12", "toolbar clipPath = inset(0 -40 -40 -40)", L, "absent", !1));
1690
835
  else {
1691
- const o = u.style.clipPath, s = getComputedStyle(u), c = o || s.clipPath || "", d = c === ne;
1692
- e.push(C("C12", "toolbar clipPath = inset(0 -40 -40 -40)", ne, c || "n/a", d));
836
+ const l = d.style.clipPath, i = getComputedStyle(d), c = l || i.clipPath || "", u = c === L;
837
+ e.push(p("C12", "toolbar clipPath = inset(0 -40 -40 -40)", L, c || "n/a", u));
1693
838
  }
1694
839
  return e.push(
1695
- C(
840
+ p(
1696
841
  "C13",
1697
842
  "same-position slide via WAAPI (mid-transition getAnimations().length > 0)",
1698
843
  "WAAPI driver wired in orchestrator (source-proof)",
@@ -1700,7 +845,7 @@ function le() {
1700
845
  "wiring_only"
1701
846
  )
1702
847
  ), e.push(
1703
- C(
848
+ p(
1704
849
  "C14",
1705
850
  'cross-position handoff transitionend filtered by propertyName="max-height"',
1706
851
  "transitionend filter wired in orchestrator (source-proof)",
@@ -1709,11 +854,11 @@ function le() {
1709
854
  )
1710
855
  ), e;
1711
856
  }
1712
- function Pt(e) {
1713
- return le().find((t) => t.id === e);
857
+ function Ne(e) {
858
+ return M().find((t) => t.id === e);
1714
859
  }
1715
- function wt() {
1716
- const e = se();
860
+ function we() {
861
+ const e = T();
1717
862
  return { q12: [
1718
863
  {
1719
864
  id: "Q12-12",
@@ -1722,83 +867,74 @@ function wt() {
1722
867
  actual: `valid=${e.valid} mount=${e.mount} chrome=${e.chrome} frozen=${e.frozen} orphans=[${e.orphans.join(",")}]`,
1723
868
  pass: e.valid
1724
869
  }
1725
- ], cc: le() };
870
+ ], cc: M() };
1726
871
  }
1727
- function At() {
872
+ function Se() {
1728
873
  return {
1729
- enable: xt,
1730
- disable: kt,
1731
- isEnabled: () => V,
1732
- getLastReport: () => X,
874
+ enable: Ee,
875
+ disable: _e,
876
+ isEnabled: () => E,
877
+ getLastReport: () => _,
1733
878
  recordTransition: (e) => {
1734
- V && (X = { ...e, ...se() });
879
+ E && (_ = { ...e, ...T() });
1735
880
  },
1736
881
  assertOnce: () => {
1737
- const e = se();
1738
- return X = e, e;
882
+ const e = T();
883
+ return _ = e, e;
1739
884
  },
1740
- assertCcOnly: le,
1741
- getCcRowById: Pt,
1742
- assertPanelTruths: wt
885
+ assertCcOnly: M,
886
+ getCcRowById: Ne,
887
+ assertPanelTruths: we
1743
888
  };
1744
889
  }
1745
- function xt() {
1746
- if (V = !0, typeof window > "u") return;
1747
- window.__panelsAsserter || (window.__panelsAsserter = At(), console.info(
890
+ function Ee() {
891
+ if (E = !0, typeof window > "u") return;
892
+ window.__panelsAsserter || (window.__panelsAsserter = Se(), console.info(
1748
893
  "[panels] asserter enabled (P3b Q12-12 + P6 W5 cc:C1..C14). Inspect via window.__panelsAsserter."
1749
894
  ));
1750
895
  }
1751
- function kt() {
1752
- V = !1;
896
+ function _e() {
897
+ E = !1;
1753
898
  }
1754
899
  export {
1755
- en as COMMITS,
1756
- Kt as CatalogAddShell,
1757
- Vt as CatalogFooter,
1758
- qt as CatalogReplaceShell,
1759
- re as CatalogStateContext,
1760
- je as CloneCard,
1761
- et as CloneStage,
1762
- Ce as MOCK_DEFAULT_LENS,
1763
- _e as MOCK_LENSES,
1764
- Ne as MOCK_LENS_META,
1765
- mt as MOCK_PAGES,
1766
- Se as MOCK_TILES_BY_LENS,
1767
- tn as NotificationCenterShell,
1768
- Wt as PANEL_IDS,
1769
- pt as PageMgmtFooter,
1770
- Qt as PageMgmtShell,
1771
- Te as PageMgmtStateContext,
1772
- nn as PanelBody,
1773
- K as PanelChromeV2,
1774
- an as PanelFooter,
1775
- Bt as PanelFooterMessage,
1776
- sn as PanelHeader,
1777
- rn as PanelHost,
1778
- Gt as PanelHostShell,
1779
- Oe as PanelMount,
1780
- on as PanelNavigation,
1781
- ln as PanelProvider,
1782
- jt as PanelSlot,
1783
- cn as PanelStage,
1784
- Yt as SettingsShell,
1785
- le as assertCcOnly,
1786
- se as assertPanelDomShape,
1787
- wt as assertPanelTruths,
1788
- dn as deriveSurfaceState,
1789
- kt as disablePanelAsserter,
1790
- xt as enablePanelAsserter,
1791
- Pt as getCcRowById,
1792
- un as initialState,
1793
- fe as positionKey,
1794
- pn as reducer,
1795
- Et as transitionToPanel,
1796
- oe as useCatalogState,
1797
- Ht as useEditingCardId,
1798
- Pe as usePageMgmtState,
1799
- Me as usePanelContext,
1800
- O as usePanelContextOptional,
1801
- mn as usePanelCoordinator,
1802
- be as useReducedMotionPanel,
1803
- Zt as useTransitionToPanel
900
+ Ve as COMMITS,
901
+ Te as CatalogAddShell,
902
+ le as CatalogFooter,
903
+ Ie as CatalogReplaceShell,
904
+ k as CatalogStateContext,
905
+ oe as CloneCard,
906
+ ne as CloneStage,
907
+ G as MOCK_DEFAULT_LENS,
908
+ W as MOCK_LENSES,
909
+ ue as MOCK_PAGES,
910
+ Q as MOCK_TILES_BY_LENS,
911
+ Me as PANEL_IDS,
912
+ de as PageMgmtFooter,
913
+ ke as PageMgmtShell,
914
+ X as PageMgmtStateContext,
915
+ w as PanelChrome,
916
+ qe as PanelHost,
917
+ $e as PanelHostShell,
918
+ N as PanelMount,
919
+ Be as PanelProvider,
920
+ De as PanelSlot,
921
+ Le as SettingsShell,
922
+ M as assertCcOnly,
923
+ T as assertPanelDomShape,
924
+ we as assertPanelTruths,
925
+ He as deriveSurfaceState,
926
+ _e as disablePanelAsserter,
927
+ Ee as enablePanelAsserter,
928
+ Ne as getCcRowById,
929
+ Ue as initialState,
930
+ z as positionKey,
931
+ Ye as reducer,
932
+ Pe as transitionToPanel,
933
+ re as useCatalogState,
934
+ ce as usePageMgmtState,
935
+ Z as usePanelContext,
936
+ I as usePanelContextOptional,
937
+ Ke as usePanelCoordinator,
938
+ q as useReducedMotionPanel,
939
+ Re as useTransitionToPanel
1804
940
  };