@mediaradar/design-components 0.26.1 → 0.32.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.
package/dist/index.cjs CHANGED
@@ -32,6 +32,7 @@ __export(index_exports, {
32
32
  CheckBox: () => CheckBox,
33
33
  CheckBoxBox: () => CheckBoxBox,
34
34
  ChipContent: () => ChipContent,
35
+ CopyButton: () => CopyButton,
35
36
  DEFAULT_SEARCH_MATCH: () => DEFAULT_SEARCH_MATCH,
36
37
  DataScopeFilter: () => DataScopeFilter,
37
38
  DataTable: () => DataTable,
@@ -43,7 +44,9 @@ __export(index_exports, {
43
44
  FilterDropdownFooter: () => FilterDropdownFooter,
44
45
  Freshness: () => Freshness,
45
46
  InfoTip: () => InfoTip,
47
+ InlineMessage: () => InlineMessage,
46
48
  LineChartPlaceholder: () => LineChartPlaceholder,
49
+ MediaLabel: () => MediaLabel,
47
50
  Modal: () => Modal,
48
51
  MultiSelectFilter: () => MultiSelectFilter,
49
52
  NO_RESULTS_BODY: () => NO_RESULTS_BODY,
@@ -66,12 +69,14 @@ __export(index_exports, {
66
69
  SelectionPicker: () => SelectionPicker,
67
70
  SortButton: () => SortButton,
68
71
  StackedColumnPlaceholder: () => StackedColumnPlaceholder,
72
+ SuggestionChip: () => SuggestionChip,
69
73
  TablePagination: () => TablePagination,
70
74
  Tabs: () => Tabs,
71
75
  Tag: () => Tag,
72
76
  TextField: () => TextField,
73
77
  Toast: () => Toast,
74
78
  Toggle: () => Toggle,
79
+ ToggleChip: () => ToggleChip,
75
80
  Tooltip: () => Tooltip,
76
81
  WorkspaceAvatar: () => WorkspaceAvatar,
77
82
  WorkspaceSelectedCard: () => WorkspaceSelectedCard,
@@ -195,8 +200,46 @@ function AdvertiserSearchPrompt({ label = "an advertiser name" }) {
195
200
  ] });
196
201
  }
197
202
 
198
- // src/AdvertiserQuickFilter.tsx
203
+ // src/cn.ts
204
+ var import_clsx = require("clsx");
205
+ var import_tailwind_merge = require("tailwind-merge");
206
+ var twMerge = (0, import_tailwind_merge.extendTailwindMerge)({
207
+ extend: {
208
+ classGroups: {
209
+ "font-size": [{ text: define_FONT_SIZE_KEYS_default }]
210
+ }
211
+ }
212
+ });
213
+ function cn(...inputs) {
214
+ return twMerge((0, import_clsx.clsx)(inputs));
215
+ }
216
+
217
+ // src/ChipTrigger.tsx
199
218
  var import_jsx_runtime3 = require("react/jsx-runtime");
219
+ function chipTriggerClass(_variant = "box") {
220
+ return cn(
221
+ "flex h-11 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus"
222
+ // One stroke for every trigger: a `box` chip on the lighter default
223
+ // border sat beside SelectFilter's darker one in the same row and read as
224
+ // a different kind of control. The variant no longer changes anything.
225
+ );
226
+ }
227
+ function ChipContent({ caption, value, icon }) {
228
+ const stack = /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
229
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-control-caption uppercase tracking-wide text-text-tertiary", children: caption }),
230
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: value })
231
+ ] });
232
+ if (icon) {
233
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "flex items-center gap-2", children: [
234
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "shrink-0 text-text-tertiary", children: icon }),
235
+ stack
236
+ ] });
237
+ }
238
+ return stack;
239
+ }
240
+
241
+ // src/AdvertiserQuickFilter.tsx
242
+ var import_jsx_runtime4 = require("react/jsx-runtime");
200
243
  function cx(...parts) {
201
244
  return parts.filter(Boolean).join(" ");
202
245
  }
@@ -280,8 +323,8 @@ function AdvertiserQuickFilter({
280
323
  const shown = open && !showFooter ? draft : selected;
281
324
  const counted = parked.length ? shown.filter((id) => !parked.includes(id)) : shown;
282
325
  const value = counted.length === 0 ? "All" : counted.length === 1 ? options.find((o) => o.id === counted[0])?.label ?? "1 selected" : `${counted.length} selected`;
283
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "relative", ref, children: [
284
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
326
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "relative", ref, children: [
327
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
285
328
  "button",
286
329
  {
287
330
  type: "button",
@@ -289,14 +332,10 @@ function AdvertiserQuickFilter({
289
332
  onClick: () => open ? close() : openTray(),
290
333
  "aria-haspopup": "dialog",
291
334
  "aria-expanded": open,
292
- className: "flex h-11 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
335
+ className: chipTriggerClass(),
293
336
  children: [
294
- icon && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "shrink-0 text-text-tertiary", children: icon }),
295
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
296
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-control-caption uppercase tracking-wide text-text-tertiary", children: caption }),
297
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: value })
298
- ] }),
299
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
337
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ChipContent, { caption, value, icon }),
338
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
300
339
  import_lucide_react3.ChevronDown,
301
340
  {
302
341
  size: 14,
@@ -307,7 +346,7 @@ function AdvertiserQuickFilter({
307
346
  ]
308
347
  }
309
348
  ),
310
- open && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
349
+ open && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
311
350
  "div",
312
351
  {
313
352
  className: cx(
@@ -318,9 +357,9 @@ function AdvertiserQuickFilter({
318
357
  "aria-label": caption,
319
358
  "data-testid": testIdPrefix && `${testIdPrefix}-popover`,
320
359
  children: [
321
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex h-8 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus", children: [
322
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react3.Search, { size: 14, className: "shrink-0 text-text-secondary", "aria-hidden": "true" }),
323
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
360
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex h-8 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus", children: [
361
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react3.Search, { size: 14, className: "shrink-0 text-text-secondary", "aria-hidden": "true" }),
362
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
324
363
  "input",
325
364
  {
326
365
  ref: inputRef,
@@ -334,20 +373,20 @@ function AdvertiserQuickFilter({
334
373
  className: "h-full min-w-0 flex-1 bg-transparent text-[13px] outline-hidden placeholder:text-text-tertiary"
335
374
  }
336
375
  ),
337
- q && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
376
+ q && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
338
377
  "button",
339
378
  {
340
379
  type: "button",
341
380
  onClick: clearSearch,
342
381
  "aria-label": "Clear search",
343
382
  className: "shrink-0 text-text-tertiary transition-colors hover:text-text-primary",
344
- children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react3.X, { size: 13 })
383
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react3.X, { size: 13 })
345
384
  }
346
385
  )
347
386
  ] }) }),
348
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "max-h-[300px] overflow-y-auto p-1", children: [
349
- selectedOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "mb-1 border-b border-border-default pb-1", children: [
350
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
387
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "max-h-[300px] overflow-y-auto p-1", children: [
388
+ selectedOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "mb-1 border-b border-border-default pb-1", children: [
389
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
351
390
  "button",
352
391
  {
353
392
  type: "button",
@@ -356,7 +395,7 @@ function AdvertiserQuickFilter({
356
395
  "aria-expanded": selectedOpen,
357
396
  className: "flex w-full items-center gap-1.5 rounded-control px-2 py-1 text-left text-[11px] font-semibold uppercase tracking-wide text-text-tertiary transition-colors hover:text-text-primary",
358
397
  children: [
359
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
398
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
360
399
  import_lucide_react3.ChevronDown,
361
400
  {
362
401
  size: 13,
@@ -370,7 +409,7 @@ function AdvertiserQuickFilter({
370
409
  ]
371
410
  }
372
411
  ),
373
- selectedOpen && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "flex flex-col gap-0.5", children: selectedOptions.map((o) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
412
+ selectedOpen && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex flex-col gap-0.5", children: selectedOptions.map((o) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
374
413
  OptionRow,
375
414
  {
376
415
  label: o.label,
@@ -381,15 +420,15 @@ function AdvertiserQuickFilter({
381
420
  o.id
382
421
  )) })
383
422
  ] }),
384
- !ql ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(AdvertiserSearchPrompt, { label: promptLabel }) : results.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex flex-col items-center gap-1.5 px-4 py-8 text-center", children: [
385
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { className: "text-[13px] font-medium text-text-primary", children: [
423
+ !ql ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(AdvertiserSearchPrompt, { label: promptLabel }) : results.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex flex-col items-center gap-1.5 px-4 py-8 text-center", children: [
424
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { className: "text-[13px] font-medium text-text-primary", children: [
386
425
  "No results found for \u201C",
387
426
  q.trim(),
388
427
  "\u201D"
389
428
  ] }),
390
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-[12px] leading-snug text-text-tertiary", children: noResultsHint })
391
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
392
- results.length > SELECT_ALL_THRESHOLD && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
429
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "text-[12px] leading-snug text-text-tertiary", children: noResultsHint })
430
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
431
+ results.length > SELECT_ALL_THRESHOLD && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
393
432
  "button",
394
433
  {
395
434
  type: "button",
@@ -397,12 +436,12 @@ function AdvertiserQuickFilter({
397
436
  onClick: toggleAllVisible,
398
437
  className: "flex w-full items-center gap-2 rounded-control px-2 py-1.5 text-left text-[12px] font-semibold text-text-link transition-colors hover:bg-subtle",
399
438
  children: [
400
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react3.ListChecks, { size: 14, "aria-hidden": "true" }),
439
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react3.ListChecks, { size: 14, "aria-hidden": "true" }),
401
440
  allVisibleSelected ? `Deselect ${results.length} visible` : `Select all ${results.length} visible`
402
441
  ]
403
442
  }
404
443
  ),
405
- results.map((o) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
444
+ results.map((o) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
406
445
  OptionRow,
407
446
  {
408
447
  label: o.label,
@@ -414,8 +453,8 @@ function AdvertiserQuickFilter({
414
453
  ))
415
454
  ] })
416
455
  ] }),
417
- showFooter ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-center justify-between border-t border-border-default px-3 py-2.5", children: [
418
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
456
+ showFooter ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center justify-between border-t border-border-default px-3 py-2.5", children: [
457
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
419
458
  "button",
420
459
  {
421
460
  type: "button",
@@ -426,7 +465,7 @@ function AdvertiserQuickFilter({
426
465
  children: "Clear all"
427
466
  }
428
467
  ),
429
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
468
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
430
469
  "button",
431
470
  {
432
471
  type: "button",
@@ -436,12 +475,12 @@ function AdvertiserQuickFilter({
436
475
  children: "Apply"
437
476
  }
438
477
  )
439
- ] }) : draft.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-center justify-between border-t border-border-default p-2", children: [
440
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "text-[11px] text-text-tertiary", children: [
478
+ ] }) : draft.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center justify-between border-t border-border-default p-2", children: [
479
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "text-[11px] text-text-tertiary", children: [
441
480
  draft.length,
442
481
  " selected"
443
482
  ] }),
444
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
483
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
445
484
  "button",
446
485
  {
447
486
  type: "button",
@@ -462,13 +501,13 @@ function OptionRow({
462
501
  onToggle,
463
502
  testId
464
503
  }) {
465
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
504
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
466
505
  "div",
467
506
  {
468
507
  onClick: onToggle,
469
508
  className: "flex cursor-pointer items-center gap-2.5 rounded-control px-2 py-2 transition-colors hover:bg-subtle",
470
509
  children: [
471
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
510
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
472
511
  "button",
473
512
  {
474
513
  type: "button",
@@ -485,31 +524,17 @@ function OptionRow({
485
524
  "focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
486
525
  checked ? "border-transparent bg-brand-primaryAction text-brand-onprimary" : "border-border-interactive bg-surface hover:border-brand-primaryAction"
487
526
  ),
488
- children: checked && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react3.Check, { size: 13, strokeWidth: 3 })
527
+ children: checked && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react3.Check, { size: 13, strokeWidth: 3 })
489
528
  }
490
529
  ),
491
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "flex-1 text-[14px] text-text-primary", children: label })
530
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "flex-1 text-[14px] text-text-primary", children: label })
492
531
  ]
493
532
  }
494
533
  );
495
534
  }
496
535
 
497
- // src/cn.ts
498
- var import_clsx = require("clsx");
499
- var import_tailwind_merge = require("tailwind-merge");
500
- var twMerge = (0, import_tailwind_merge.extendTailwindMerge)({
501
- extend: {
502
- classGroups: {
503
- "font-size": [{ text: define_FONT_SIZE_KEYS_default }]
504
- }
505
- }
506
- });
507
- function cn(...inputs) {
508
- return twMerge((0, import_clsx.clsx)(inputs));
509
- }
510
-
511
536
  // src/Badge.tsx
512
- var import_jsx_runtime4 = require("react/jsx-runtime");
537
+ var import_jsx_runtime5 = require("react/jsx-runtime");
513
538
  var TONE = {
514
539
  neutral: "bg-subtle text-text-secondary",
515
540
  brand: "bg-brand-primarySoft text-brand-primaryAction",
@@ -560,25 +585,30 @@ var KIND = {
560
585
  count: "h-[18px] min-w-[18px] justify-center px-1.5 tabular-nums",
561
586
  // The only kind that shouts. Caps need the letterspacing -- caps set tight
562
587
  // are harder to read than the sentence case they replaced.
563
- eyebrow: "px-2.5 py-1 uppercase tracking-wider"
588
+ eyebrow: "px-2.5 py-1 uppercase tracking-wider",
589
+ // What a thing IS (a topic, a category) rather than a signal about it.
590
+ // Always the same quiet grey whatever `tone` says: colour here would read
591
+ // as meaning, and a category has none. This is the old Tag.
592
+ category: "px-2 py-1"
564
593
  };
594
+ var CATEGORY = "bg-subtle font-medium text-text-tertiary";
565
595
  function Badge({ tone = "neutral", kind = "label", dot = false, children, className }) {
566
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
596
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
567
597
  "span",
568
598
  {
569
- style: TONE_STYLE[tone],
599
+ style: kind === "category" ? void 0 : TONE_STYLE[tone],
570
600
  className: cn(
571
601
  // `inline-flex` + `gap` so a leading icon sits on the text baseline
572
602
  // without every caller re-inventing the spacing. `shrink-0` because a
573
603
  // badge is almost always beside flexible text that would otherwise
574
604
  // squash it. `whitespace-nowrap` because a wrapped badge is a bug.
575
- "inline-flex shrink-0 items-center gap-1 whitespace-nowrap rounded-full text-micro font-semibold leading-none",
576
- TONE[tone],
605
+ "inline-flex shrink-0 items-center gap-1 whitespace-nowrap rounded-full text-micro leading-none",
606
+ kind === "category" ? CATEGORY : cn("font-semibold", TONE[tone]),
577
607
  KIND[kind],
578
608
  className
579
609
  ),
580
610
  children: [
581
- dot && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { "aria-hidden": "true", className: "size-1.5 shrink-0 rounded-full bg-current" }),
611
+ dot && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "aria-hidden": "true", className: "size-1.5 shrink-0 rounded-full bg-current" }),
582
612
  children
583
613
  ]
584
614
  }
@@ -587,10 +617,10 @@ function Badge({ tone = "neutral", kind = "label", dot = false, children, classN
587
617
 
588
618
  // src/Delta.tsx
589
619
  var import_lucide_react4 = require("lucide-react");
590
- var import_jsx_runtime5 = require("react/jsx-runtime");
620
+ var import_jsx_runtime6 = require("react/jsx-runtime");
591
621
  function Delta({ value, suffix = "%", arrow = false, period, className }) {
592
622
  const up = value >= 0;
593
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
623
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
594
624
  "span",
595
625
  {
596
626
  className: cn(
@@ -599,11 +629,11 @@ function Delta({ value, suffix = "%", arrow = false, period, className }) {
599
629
  className
600
630
  ),
601
631
  children: [
602
- arrow && (up ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react4.ArrowUpRight, { size: 13, "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react4.ArrowDownRight, { size: 13, "aria-hidden": "true" })),
632
+ arrow && (up ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.ArrowUpRight, { size: 13, "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.ArrowDownRight, { size: 13, "aria-hidden": "true" })),
603
633
  up ? "+" : "\u2212",
604
634
  Math.abs(value).toFixed(1),
605
635
  suffix,
606
- period && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "ml-0.5", children: period })
636
+ period && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "ml-0.5", children: period })
607
637
  ]
608
638
  }
609
639
  );
@@ -611,7 +641,7 @@ function Delta({ value, suffix = "%", arrow = false, period, className }) {
611
641
 
612
642
  // src/CheckBox.tsx
613
643
  var import_lucide_react5 = require("lucide-react");
614
- var import_jsx_runtime6 = require("react/jsx-runtime");
644
+ var import_jsx_runtime7 = require("react/jsx-runtime");
615
645
  function boxClass(on, disabled) {
616
646
  return cn(
617
647
  "flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-[5px] border transition-colors",
@@ -620,8 +650,8 @@ function boxClass(on, disabled) {
620
650
  );
621
651
  }
622
652
  function Glyph({ checked, indeterminate }) {
623
- if (indeterminate) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Minus, { size: 13, strokeWidth: 3 });
624
- return checked ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Check, { size: 13, strokeWidth: 3 }) : null;
653
+ if (indeterminate) return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Minus, { size: 13, strokeWidth: 3 });
654
+ return checked ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Check, { size: 13, strokeWidth: 3 }) : null;
625
655
  }
626
656
  function CheckBox({
627
657
  checked,
@@ -635,7 +665,7 @@ function CheckBox({
635
665
  className
636
666
  }) {
637
667
  const on = checked || !!indeterminate;
638
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
668
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
639
669
  "button",
640
670
  {
641
671
  type: "button",
@@ -659,18 +689,18 @@ function CheckBox({
659
689
  disabled && "hover:border-border-interactive",
660
690
  className
661
691
  ),
662
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Glyph, { checked, indeterminate })
692
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Glyph, { checked, indeterminate })
663
693
  }
664
694
  );
665
695
  }
666
696
  function CheckBoxBox({ checked, indeterminate, disabled, className }) {
667
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { "aria-hidden": "true", className: cn(boxClass(checked || !!indeterminate, disabled), className), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Glyph, { checked, indeterminate }) });
697
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { "aria-hidden": "true", className: cn(boxClass(checked || !!indeterminate, disabled), className), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Glyph, { checked, indeterminate }) });
668
698
  }
669
699
 
670
700
  // src/DateRangeFilter.tsx
671
701
  var import_react3 = require("react");
672
702
  var import_lucide_react6 = require("lucide-react");
673
- var import_jsx_runtime7 = require("react/jsx-runtime");
703
+ var import_jsx_runtime8 = require("react/jsx-runtime");
674
704
  var DEFAULT_SHORTCUTS = [
675
705
  "Year to date",
676
706
  "Rolling 3 months",
@@ -719,6 +749,9 @@ var addDays = (d, n) => {
719
749
  };
720
750
  var addMonths = (d, n) => new Date(d.getFullYear(), d.getMonth() + n, 1);
721
751
  var sameDay = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
752
+ var firstOfMonth = (d) => new Date(d.getFullYear(), d.getMonth(), 1);
753
+ var lastOfMonth = (d) => new Date(d.getFullYear(), d.getMonth() + 1, 0);
754
+ var fmtMonth = (d) => `${MONTHS[d.getMonth()].slice(0, 3)} ${d.getFullYear()}`;
722
755
  var fmt = (d) => `${MONTHS[d.getMonth()].slice(0, 3)} ${d.getDate()}, ${d.getFullYear()}`;
723
756
  var fmtFull = (d) => `${MONTHS[d.getMonth()]} ${d.getDate()}, ${d.getFullYear()}`;
724
757
  var fullRangeLabel = (s, e) => `${fmtFull(s)} - ${fmtFull(e)}`;
@@ -799,14 +832,17 @@ function DateRangeFilter({
799
832
  shortDates = false,
800
833
  icon,
801
834
  presetSet = "default",
802
- testIdPrefix
835
+ testIdPrefix,
836
+ granularity = "day"
803
837
  }) {
838
+ const monthly = granularity === "month";
839
+ const snap = (s, e) => monthly ? [firstOfMonth(s), lastOfMonth(e)] : [s, e];
804
840
  const controlled = controlledValue !== void 0 && controlledRange !== void 0;
805
841
  const SHORTCUTS = presetSet === "creativeIntel" ? CREATIVE_INTEL_SHORTCUTS : DEFAULT_SHORTCUTS;
806
842
  const today = (0, import_react3.useMemo)(() => /* @__PURE__ */ new Date(), []);
807
843
  const initShortcut = matchShortcut(SHORTCUTS, controlled ? controlledValue : defaultValue);
808
- const initRange = controlled ? controlledRange : presetRange(initShortcut === "Custom" ? "Rolling 12 months" : initShortcut, today);
809
- const dateLine = (s, e) => shortDates ? `${fmt(s)} \u2013 ${fmt(e)}` : fullRangeLabel(s, e);
844
+ const initRange = controlled ? controlledRange : snap(...presetRange(initShortcut === "Custom" ? "Rolling 12 months" : initShortcut, today));
845
+ const dateLine = (s, e) => monthly ? `${fmtMonth(s)} \u2013 ${fmtMonth(e)}` : shortDates ? `${fmt(s)} \u2013 ${fmt(e)}` : fullRangeLabel(s, e);
810
846
  const [open, setOpen] = (0, import_react3.useState)(false);
811
847
  const [uncontrolledValue, setUncontrolledValue] = (0, import_react3.useState)(
812
848
  showDates ? presetLabel(initShortcut) : defaultValue || "Last 7 days"
@@ -849,25 +885,27 @@ function DateRangeFilter({
849
885
  if (key === "Custom") return;
850
886
  const r = presetRange(key, today);
851
887
  if (r) {
852
- setStart(r[0]);
853
- setEnd(r[1]);
854
- setLeftMonth(new Date(r[0].getFullYear(), r[0].getMonth(), 1));
888
+ const [s, e] = snap(r[0], r[1]);
889
+ setStart(s);
890
+ setEnd(e);
891
+ setLeftMonth(new Date(s.getFullYear(), s.getMonth(), 1));
855
892
  }
856
893
  };
857
894
  const pickDay = (d) => {
858
895
  setShortcut("Custom");
859
896
  if (!start || start && end) {
860
- setStart(d);
897
+ setStart(monthly ? firstOfMonth(d) : d);
861
898
  setEnd(null);
862
899
  } else if (d < start) {
863
- setEnd(start);
864
- setStart(d);
865
- } else setEnd(d);
900
+ const [s, e] = snap(d, start);
901
+ setStart(s);
902
+ setEnd(e);
903
+ } else setEnd(monthly ? lastOfMonth(d) : d);
866
904
  };
867
905
  const apply = () => {
868
- const s = start || initRange[0];
869
- const e = end || s;
870
- const v = showDates ? presetLabel(shortcut) : shortcut === "Custom" ? `${fmt(s)} \u2014 ${fmt(e)}` : shortcut;
906
+ const [s, e] = snap(start || initRange[0], end || start || initRange[0]);
907
+ const custom = monthly ? `${fmtMonth(s)} \u2014 ${fmtMonth(e)}` : `${fmt(s)} \u2014 ${fmt(e)}`;
908
+ const v = showDates ? presetLabel(shortcut) : shortcut === "Custom" ? custom : shortcut;
871
909
  if (!controlled) {
872
910
  committed.current = { shortcut, start: s, end: e };
873
911
  setUncontrolledValue(v);
@@ -884,26 +922,26 @@ function DateRangeFilter({
884
922
  setFlipBelow(ref.current.getBoundingClientRect().top < popRef.current.offsetHeight + 16);
885
923
  }, [open, placement]);
886
924
  const above = placement === "above" && !flipBelow;
887
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "relative", ref, children: [
888
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
925
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "relative", ref, children: [
926
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
889
927
  "button",
890
928
  {
891
929
  type: "button",
892
930
  "data-testid": testIdPrefix && `${testIdPrefix}-trigger`,
893
931
  onClick: () => setOpen((v) => !v),
894
932
  "aria-expanded": open,
895
- className: "flex h-11 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
933
+ className: chipTriggerClass(),
896
934
  children: [
897
- icon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "shrink-0 text-text-tertiary", children: icon }),
898
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
899
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: showDates ? "text-[11px] text-text-tertiary" : "text-control-caption uppercase tracking-wide text-text-tertiary", children: showDates ? displayDatesLine : caption }),
900
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: displayValue })
935
+ icon && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "shrink-0 text-text-tertiary", children: icon }),
936
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
937
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: showDates ? "text-[11px] text-text-tertiary" : "text-control-caption uppercase tracking-wide text-text-tertiary", children: showDates ? displayDatesLine : caption }),
938
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: displayValue })
901
939
  ] }),
902
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react6.ChevronDown, { size: 14, "aria-hidden": "true", className: `shrink-0 text-text-secondary transition-transform ${open ? "rotate-180" : ""}` })
940
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.ChevronDown, { size: 14, "aria-hidden": "true", className: `shrink-0 text-text-secondary transition-transform ${open ? "rotate-180" : ""}` })
903
941
  ]
904
942
  }
905
943
  ),
906
- open && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
944
+ open && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
907
945
  "div",
908
946
  {
909
947
  "data-testid": testIdPrefix && `${testIdPrefix}-popover`,
@@ -912,7 +950,7 @@ function DateRangeFilter({
912
950
  role: "dialog",
913
951
  "aria-label": "Select date range",
914
952
  children: [
915
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex w-44 shrink-0 flex-col gap-0.5 border-r border-border-default p-2", children: SHORTCUTS.map((s) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
953
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex w-44 shrink-0 flex-col gap-0.5 border-r border-border-default p-2", children: SHORTCUTS.map((s) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
916
954
  "button",
917
955
  {
918
956
  type: "button",
@@ -923,28 +961,28 @@ function DateRangeFilter({
923
961
  },
924
962
  s
925
963
  )) }),
926
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex flex-col p-4", children: [
927
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-end gap-3", children: [
928
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Field, { label: "Start date", value: start ? fmt(start) : "\u2014" }),
929
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "pb-2.5 text-text-tertiary", children: "\u2014" }),
930
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Field, { label: "End date", value: end ? fmt(end) : start ? fmt(start) : "\u2014" })
964
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col p-4", children: [
965
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex items-end gap-3", children: [
966
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Field, { label: "Start date", value: start ? fmt(start) : "\u2014" }),
967
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "pb-2.5 text-text-tertiary", children: "\u2014" }),
968
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Field, { label: "End date", value: end ? fmt(end) : start ? fmt(start) : "\u2014" })
931
969
  ] }),
932
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "my-4 border-t border-border-default" }),
933
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex gap-8", children: [0, 1].map((offset) => {
970
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "my-4 border-t border-border-default" }),
971
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex gap-8", children: [0, 1].map((offset) => {
934
972
  const m = addMonths(leftMonth, offset);
935
973
  const grid = monthGrid(m.getFullYear(), m.getMonth());
936
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w-[252px]", children: [
937
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "mb-2 flex items-center justify-between", children: [
938
- offset === 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(NavBtn, { onClick: () => setLeftMonth(addMonths(leftMonth, -1)), "aria-label": "Previous month", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react6.ChevronLeft, { size: 16 }) }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "h-7 w-7" }),
939
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "text-[15px] font-semibold text-text-primary", children: [
974
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w-[252px]", children: [
975
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "mb-2 flex items-center justify-between", children: [
976
+ offset === 0 ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(NavBtn, { onClick: () => setLeftMonth(addMonths(leftMonth, -1)), "aria-label": "Previous month", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.ChevronLeft, { size: 16 }) }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "h-7 w-7" }),
977
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "text-[15px] font-semibold text-text-primary", children: [
940
978
  MONTHS[m.getMonth()],
941
979
  " ",
942
980
  m.getFullYear()
943
981
  ] }),
944
- offset === 1 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(NavBtn, { onClick: () => setLeftMonth(addMonths(leftMonth, 1)), "aria-label": "Next month", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react6.ChevronRight, { size: 16 }) }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "h-7 w-7" })
982
+ offset === 1 ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(NavBtn, { onClick: () => setLeftMonth(addMonths(leftMonth, 1)), "aria-label": "Next month", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.ChevronRight, { size: 16 }) }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "h-7 w-7" })
945
983
  ] }),
946
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "grid grid-cols-7", children: [
947
- WEEKDAYS.map((w) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex h-8 items-center justify-center text-[12px] font-semibold text-text-secondary", children: w }, w)),
984
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "grid grid-cols-7", children: [
985
+ WEEKDAYS.map((w) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex h-8 items-center justify-center text-[12px] font-semibold text-text-secondary", children: w }, w)),
948
986
  grid.map((d, i) => {
949
987
  const inMonth = d.getMonth() === m.getMonth();
950
988
  const hasRange = !!(start && end);
@@ -959,9 +997,9 @@ function DateRangeFilter({
959
997
  else if (end && isEnd) band = "left-0 right-1/2";
960
998
  else band = "left-0 right-0";
961
999
  }
962
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", onClick: () => pickDay(d), className: "relative flex h-9 items-center justify-center", children: [
963
- band && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: `absolute inset-y-[3px] bg-ai-tint ${band}`, "aria-hidden": "true" }),
964
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1000
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", onClick: () => pickDay(d), className: "relative flex h-9 items-center justify-center", children: [
1001
+ band && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: `absolute inset-y-[3px] bg-ai-tint ${band}`, "aria-hidden": "true" }),
1002
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
965
1003
  "span",
966
1004
  {
967
1005
  className: `relative z-10 flex h-8 w-8 items-center justify-center rounded-full text-[13px] tabular-nums ${endpoint ? "bg-brand-primaryAction font-semibold text-brand-onprimary" : inMonth ? "text-text-primary hover:bg-subtle" : "text-text-tertiary"}`,
@@ -973,9 +1011,10 @@ function DateRangeFilter({
973
1011
  ] })
974
1012
  ] }, offset);
975
1013
  }) }),
976
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "mt-4 flex justify-end gap-2", children: [
977
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "data-testid": testIdPrefix && `${testIdPrefix}-cancel`, onClick: () => setOpen(false), className: "rounded-control border border-border-default bg-surface px-5 py-2 text-[13px] font-semibold text-text-primary transition-colors hover:bg-subtle", children: "Cancel" }),
978
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "data-testid": testIdPrefix && `${testIdPrefix}-apply`, onClick: apply, className: "rounded-control bg-brand-primaryAction px-5 py-2 text-[13px] font-semibold text-brand-onprimary transition-[filter] hover:brightness-110", children: "Apply" })
1014
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "mt-4 flex items-center justify-end gap-2", children: [
1015
+ monthly && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "mr-auto text-xs text-text-tertiary", children: "Data is monthly, so ranges cover whole months." }),
1016
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "data-testid": testIdPrefix && `${testIdPrefix}-cancel`, onClick: () => setOpen(false), className: "rounded-control border border-border-default bg-surface px-5 py-2 text-[13px] font-semibold text-text-primary transition-colors hover:bg-subtle", children: "Cancel" }),
1017
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "data-testid": testIdPrefix && `${testIdPrefix}-apply`, onClick: apply, className: "rounded-control bg-brand-primaryAction px-5 py-2 text-[13px] font-semibold text-brand-onprimary transition-[filter] hover:brightness-110", children: "Apply" })
979
1018
  ] })
980
1019
  ] })
981
1020
  ]
@@ -984,19 +1023,19 @@ function DateRangeFilter({
984
1023
  ] });
985
1024
  }
986
1025
  function Field({ label, value }) {
987
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
988
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-[12px] font-medium text-text-secondary", children: label }),
989
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex h-10 min-w-[140px] items-center rounded-control border border-border-strong bg-input px-3 text-[14px] font-medium text-text-primary", children: value })
1026
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
1027
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-[12px] font-medium text-text-secondary", children: label }),
1028
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex h-10 min-w-[140px] items-center rounded-control border border-border-strong bg-input px-3 text-[14px] font-medium text-text-primary", children: value })
990
1029
  ] });
991
1030
  }
992
1031
  function NavBtn({ children, onClick, ...rest }) {
993
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", onClick, className: "flex h-7 w-7 items-center justify-center rounded-full text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary", ...rest, children });
1032
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", onClick, className: "flex h-7 w-7 items-center justify-center rounded-full text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary", ...rest, children });
994
1033
  }
995
1034
 
996
1035
  // src/SearchBar.tsx
997
1036
  var import_react4 = require("react");
998
1037
  var import_lucide_react7 = require("lucide-react");
999
- var import_jsx_runtime8 = require("react/jsx-runtime");
1038
+ var import_jsx_runtime9 = require("react/jsx-runtime");
1000
1039
  var HEIGHT = { sm: "h-8", md: "h-10", lg: "h-11" };
1001
1040
  var DEFAULT_SEARCH_MATCH = { mode: "anyWord", wordJoin: "Or" };
1002
1041
  var MODE_LABEL = {
@@ -1036,7 +1075,7 @@ function SearchBar({
1036
1075
  };
1037
1076
  }, [open]);
1038
1077
  const showMatch = variant === "filterable" && matchValue;
1039
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1078
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1040
1079
  "div",
1041
1080
  {
1042
1081
  className: cx2(
@@ -1045,9 +1084,9 @@ function SearchBar({
1045
1084
  className
1046
1085
  ),
1047
1086
  children: [
1048
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: "flex min-w-0 flex-1 items-center gap-2 px-2.5", children: [
1049
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react7.Search, { size: 15, "aria-hidden": "true", className: "shrink-0 text-text-tertiary" }),
1050
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1087
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("label", { className: "flex min-w-0 flex-1 items-center gap-2 px-2.5", children: [
1088
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react7.Search, { size: 15, "aria-hidden": "true", className: "shrink-0 text-text-tertiary" }),
1089
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1051
1090
  "input",
1052
1091
  {
1053
1092
  ref: input,
@@ -1061,7 +1100,7 @@ function SearchBar({
1061
1100
  }
1062
1101
  )
1063
1102
  ] }),
1064
- value && onChange && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1103
+ value && onChange && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1065
1104
  "button",
1066
1105
  {
1067
1106
  type: "button",
@@ -1072,7 +1111,7 @@ function SearchBar({
1072
1111
  "aria-label": "Clear search",
1073
1112
  "data-testid": testIdPrefix && `${testIdPrefix}-clear`,
1074
1113
  className: "mr-1.5 flex size-6 shrink-0 items-center justify-center self-center rounded-control text-text-tertiary hover:bg-subtle hover:text-text-primary focus-visible:outline-2 focus-visible:outline-border-focus",
1075
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react7.X, { size: 14, "aria-hidden": "true" })
1114
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react7.X, { size: 14, "aria-hidden": "true" })
1076
1115
  }
1077
1116
  ),
1078
1117
  showMatch && // border-border-default, not the bare `border-border` both source
@@ -1086,8 +1125,8 @@ function SearchBar({
1086
1125
  // token package (insights-studio-prototype's own src/index.css;
1087
1126
  // mr-clientapps' own tailwind.config.ts `colors.border.DEFAULT`) --
1088
1127
  // an alias this shared component can't rely on existing.
1089
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "relative shrink-0 border-l border-border-default", ref, children: [
1090
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1128
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative shrink-0 border-l border-border-default", ref, children: [
1129
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1091
1130
  "button",
1092
1131
  {
1093
1132
  type: "button",
@@ -1098,7 +1137,7 @@ function SearchBar({
1098
1137
  className: "flex h-full items-center gap-1 px-2.5 text-[13px] font-medium text-text-primary transition-colors hover:bg-subtle",
1099
1138
  children: [
1100
1139
  matchValue.mode === "anyWord" ? `${MODE_LABEL.anyWord} (${matchValue.wordJoin})` : MODE_LABEL[matchValue.mode],
1101
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1140
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1102
1141
  import_lucide_react7.ChevronDown,
1103
1142
  {
1104
1143
  size: 14,
@@ -1109,25 +1148,25 @@ function SearchBar({
1109
1148
  ]
1110
1149
  }
1111
1150
  ),
1112
- open && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1151
+ open && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1113
1152
  "div",
1114
1153
  {
1115
1154
  role: "dialog",
1116
1155
  "aria-label": "Search match type",
1117
1156
  "data-testid": testIdPrefix && `${testIdPrefix}-mode-popover`,
1118
1157
  className: "absolute right-0 top-[calc(100%+8px)] z-50 w-[400px] rounded-card border border-border-default bg-surface p-3 shadow-overlay",
1119
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { role: "radiogroup", "aria-label": "Search match type", className: "flex flex-col", children: [
1120
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1158
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { role: "radiogroup", "aria-label": "Search match type", className: "flex flex-col", children: [
1159
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1121
1160
  ModeRow,
1122
1161
  {
1123
1162
  title: "Any Word Text Search",
1124
1163
  selected: matchValue.mode === "anyWord",
1125
1164
  onSelect: () => onMatchChange?.({ mode: "anyWord", wordJoin: matchValue.wordJoin }),
1126
1165
  testId: testIdPrefix && `${testIdPrefix}-mode-anyWord`,
1127
- description: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: "Find creatives that contain your keyword(s) using an \u201COr\u201D (match any) or \u201CAnd\u201D (match all) conditional in any order." }),
1166
+ description: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children: "Find creatives that contain your keyword(s) using an \u201COr\u201D (match any) or \u201CAnd\u201D (match all) conditional in any order." }),
1128
1167
  infoText: "The Or/And choice applies only when Any Word is the active search mode.",
1129
- extra: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "flex items-center gap-3", children: [
1130
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1168
+ extra: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "flex items-center gap-3", children: [
1169
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1131
1170
  RadioOption,
1132
1171
  {
1133
1172
  label: "Or",
@@ -1136,7 +1175,7 @@ function SearchBar({
1136
1175
  testId: testIdPrefix && `${testIdPrefix}-word-join-or`
1137
1176
  }
1138
1177
  ),
1139
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1178
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1140
1179
  RadioOption,
1141
1180
  {
1142
1181
  label: "And",
@@ -1148,8 +1187,8 @@ function SearchBar({
1148
1187
  ] })
1149
1188
  }
1150
1189
  ),
1151
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Divider, {}),
1152
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1190
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Divider, {}),
1191
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1153
1192
  ModeRow,
1154
1193
  {
1155
1194
  title: "Exact Match Text Search",
@@ -1160,8 +1199,8 @@ function SearchBar({
1160
1199
  infoText: "Keywords are matched as a single contiguous phrase, in the order you typed them."
1161
1200
  }
1162
1201
  ),
1163
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Divider, {}),
1164
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1202
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Divider, {}),
1203
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1165
1204
  ModeRow,
1166
1205
  {
1167
1206
  title: "Contextual Search",
@@ -1173,8 +1212,8 @@ function SearchBar({
1173
1212
  infoText: "Uses semantic matching, so results can include related terms even when the exact keyword isn't present."
1174
1213
  }
1175
1214
  ),
1176
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Divider, {}),
1177
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1215
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Divider, {}),
1216
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1178
1217
  ModeRow,
1179
1218
  {
1180
1219
  title: "Ad Code Search",
@@ -1194,7 +1233,7 @@ function SearchBar({
1194
1233
  );
1195
1234
  }
1196
1235
  function Divider() {
1197
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "my-2.5 border-t border-border-default", "aria-hidden": "true" });
1236
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "my-2.5 border-t border-border-default", "aria-hidden": "true" });
1198
1237
  }
1199
1238
  function ModeRow({
1200
1239
  title,
@@ -1206,7 +1245,7 @@ function ModeRow({
1206
1245
  onSelect,
1207
1246
  testId
1208
1247
  }) {
1209
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1248
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1210
1249
  "div",
1211
1250
  {
1212
1251
  role: "radio",
@@ -1222,18 +1261,18 @@ function ModeRow({
1222
1261
  },
1223
1262
  className: "flex cursor-pointer flex-col items-stretch gap-1 rounded-control p-1.5 text-left transition-colors hover:bg-subtle focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
1224
1263
  children: [
1225
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
1226
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-wrap items-center gap-3", children: [
1227
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "flex items-center gap-1", children: [
1228
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-[14px] font-semibold text-text-primary", children: title }),
1229
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(RowInfoTip, { text: infoText })
1264
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
1265
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-wrap items-center gap-3", children: [
1266
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "flex items-center gap-1", children: [
1267
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-[14px] font-semibold text-text-primary", children: title }),
1268
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(RowInfoTip, { text: infoText })
1230
1269
  ] }),
1231
- badge && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "rounded-full bg-subtle px-2 py-0.5 text-badge font-semibold uppercase tracking-wide text-text-secondary", children: badge }),
1270
+ badge && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "rounded-full bg-subtle px-2 py-0.5 text-badge font-semibold uppercase tracking-wide text-text-secondary", children: badge }),
1232
1271
  extra
1233
1272
  ] }),
1234
- selected && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react7.Check, { size: 16, strokeWidth: 2.5, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" })
1273
+ selected && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react7.Check, { size: 16, strokeWidth: 2.5, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" })
1235
1274
  ] }),
1236
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "block text-[12.5px] leading-snug text-text-secondary", children: description })
1275
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "block text-[12.5px] leading-snug text-text-secondary", children: description })
1237
1276
  ]
1238
1277
  }
1239
1278
  );
@@ -1244,7 +1283,7 @@ function RadioOption({
1244
1283
  onSelect,
1245
1284
  testId
1246
1285
  }) {
1247
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1286
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1248
1287
  "button",
1249
1288
  {
1250
1289
  type: "button",
@@ -1257,14 +1296,14 @@ function RadioOption({
1257
1296
  "aria-checked": checked,
1258
1297
  className: "flex items-center gap-1.5 text-[13px] font-medium text-text-primary",
1259
1298
  children: [
1260
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1299
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1261
1300
  "span",
1262
1301
  {
1263
1302
  className: cx2(
1264
1303
  "flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors",
1265
1304
  checked ? "border-brand-primaryAction" : "border-border-interactive"
1266
1305
  ),
1267
- children: checked && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "h-2 w-2 rounded-full bg-brand-primaryAction" })
1306
+ children: checked && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "h-2 w-2 rounded-full bg-brand-primaryAction" })
1268
1307
  }
1269
1308
  ),
1270
1309
  label
@@ -1284,8 +1323,8 @@ function RowInfoTip({ text }) {
1284
1323
  window.addEventListener("mousedown", onDown);
1285
1324
  return () => window.removeEventListener("mousedown", onDown);
1286
1325
  }, [open]);
1287
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "relative inline-flex shrink-0 items-center", ref, children: [
1288
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1326
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "relative inline-flex shrink-0 items-center", ref, children: [
1327
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1289
1328
  "button",
1290
1329
  {
1291
1330
  type: "button",
@@ -1297,10 +1336,10 @@ function RowInfoTip({ text }) {
1297
1336
  "aria-expanded": open,
1298
1337
  "aria-describedby": id,
1299
1338
  className: "inline-flex text-text-tertiary transition-colors hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
1300
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react7.AlertCircle, { size: 13, "aria-hidden": "true" })
1339
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react7.AlertCircle, { size: 13, "aria-hidden": "true" })
1301
1340
  }
1302
1341
  ),
1303
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1342
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1304
1343
  "span",
1305
1344
  {
1306
1345
  id,
@@ -1315,7 +1354,7 @@ function RowInfoTip({ text }) {
1315
1354
  // src/SectionRail.tsx
1316
1355
  var import_react5 = require("react");
1317
1356
  var import_lucide_react8 = require("lucide-react");
1318
- var import_jsx_runtime9 = require("react/jsx-runtime");
1357
+ var import_jsx_runtime10 = require("react/jsx-runtime");
1319
1358
  function SectionRail({
1320
1359
  title,
1321
1360
  titleSerif,
@@ -1328,20 +1367,20 @@ function SectionRail({
1328
1367
  const scroll = (direction) => {
1329
1368
  scrollRef.current?.scrollBy({ left: direction * 320, behavior: "smooth" });
1330
1369
  };
1331
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("section", { className: "flex flex-col gap-4", children: [
1332
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("header", { className: "flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between", children: [
1333
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
1334
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1370
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "flex flex-col gap-4", children: [
1371
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { className: "flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between", children: [
1372
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
1373
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1335
1374
  "h2",
1336
1375
  {
1337
1376
  className: titleSerif ? "font-serif text-2xl font-normal tracking-tight text-text-primary sm:text-[28px]" : "text-xl font-medium tracking-tight text-text-primary sm:text-2xl",
1338
1377
  children: title
1339
1378
  }
1340
1379
  ),
1341
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "mt-1 text-sm text-text-secondary", children: subtitle })
1380
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "mt-1 text-sm text-text-secondary", children: subtitle })
1342
1381
  ] }),
1343
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-2", children: [
1344
- viewAllLabel && viewAllHref && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1382
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2", children: [
1383
+ viewAllLabel && viewAllHref && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1345
1384
  "a",
1346
1385
  {
1347
1386
  href: viewAllHref,
@@ -1352,29 +1391,29 @@ function SectionRail({
1352
1391
  ]
1353
1392
  }
1354
1393
  ),
1355
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1394
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1356
1395
  "button",
1357
1396
  {
1358
1397
  type: "button",
1359
1398
  onClick: () => scroll(-1),
1360
1399
  "aria-label": "Previous",
1361
1400
  className: "hidden h-10 w-10 items-center justify-center rounded-control border border-border-default text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary sm:flex lg:hidden",
1362
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react8.ChevronLeft, { size: 16 })
1401
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react8.ChevronLeft, { size: 16 })
1363
1402
  }
1364
1403
  ),
1365
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1404
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1366
1405
  "button",
1367
1406
  {
1368
1407
  type: "button",
1369
1408
  onClick: () => scroll(1),
1370
1409
  "aria-label": "Next",
1371
1410
  className: "hidden h-10 w-10 items-center justify-center rounded-control border border-border-default text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary sm:flex lg:hidden",
1372
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react8.ChevronRight, { size: 16 })
1411
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react8.ChevronRight, { size: 16 })
1373
1412
  }
1374
1413
  )
1375
1414
  ] })
1376
1415
  ] }),
1377
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1416
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1378
1417
  "div",
1379
1418
  {
1380
1419
  ref: scrollRef,
@@ -1388,7 +1427,7 @@ function SectionRail({
1388
1427
  // src/DataScopeFilter.tsx
1389
1428
  var import_react6 = require("react");
1390
1429
  var import_lucide_react9 = require("lucide-react");
1391
- var import_jsx_runtime10 = require("react/jsx-runtime");
1430
+ var import_jsx_runtime11 = require("react/jsx-runtime");
1392
1431
  var FINAL_ONLY_TEXT = "Trims time periods to data that has finalized across the selected media formats. Some formats (e.g. Network TV and Cinema) finalize later, so the most recent periods may still change. Turn on for stable, report-ready numbers.";
1393
1432
  function cx3(...classes) {
1394
1433
  return classes.filter(Boolean).join(" ");
@@ -1414,21 +1453,17 @@ function DataScopeFilter({ value, onChange, align = "right" }) {
1414
1453
  onChange(v);
1415
1454
  setOpen(false);
1416
1455
  };
1417
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "relative", ref, children: [
1418
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1456
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "relative", ref, children: [
1457
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1419
1458
  "button",
1420
1459
  {
1421
1460
  type: "button",
1422
1461
  onClick: () => setOpen((o) => !o),
1423
1462
  "aria-expanded": open,
1424
- "aria-haspopup": "listbox",
1425
- className: "flex h-11 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
1463
+ className: chipTriggerClass(),
1426
1464
  children: [
1427
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
1428
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-control-caption uppercase tracking-wide text-text-tertiary", children: "Data" }),
1429
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: display })
1430
- ] }),
1431
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1465
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ChipContent, { caption: "Data", value: display }),
1466
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1432
1467
  import_lucide_react9.ChevronDown,
1433
1468
  {
1434
1469
  size: 14,
@@ -1439,18 +1474,18 @@ function DataScopeFilter({ value, onChange, align = "right" }) {
1439
1474
  ]
1440
1475
  }
1441
1476
  ),
1442
- open && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1477
+ open && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1443
1478
  "div",
1444
1479
  {
1445
- role: "listbox",
1480
+ role: "group",
1446
1481
  "aria-label": "Data",
1447
1482
  className: cx3(
1448
1483
  "absolute top-[calc(100%+8px)] z-30 min-w-[220px] overflow-hidden rounded-card border border-border-default bg-surface p-1 shadow-overlay",
1449
1484
  align === "right" ? "right-0" : "left-0"
1450
1485
  ),
1451
1486
  children: [
1452
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Option, { label: "All", selected: !value, onClick: () => choose(false) }),
1453
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Option, { label: "Final only", selected: value, onClick: () => choose(true), hint: FINAL_ONLY_TEXT })
1487
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Option, { label: "All", selected: !value, onClick: () => choose(false) }),
1488
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Option, { label: "Final only", selected: value, onClick: () => choose(true), hint: FINAL_ONLY_TEXT })
1454
1489
  ]
1455
1490
  }
1456
1491
  )
@@ -1462,12 +1497,11 @@ function Option({
1462
1497
  onClick,
1463
1498
  hint
1464
1499
  }) {
1465
- const option = /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1500
+ const option = /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1466
1501
  "button",
1467
1502
  {
1468
1503
  type: "button",
1469
- role: "option",
1470
- "aria-selected": selected,
1504
+ "aria-pressed": selected,
1471
1505
  onClick,
1472
1506
  className: cx3(
1473
1507
  "flex items-center gap-2 rounded-control px-2.5 py-2 text-left text-[13px] transition-colors hover:bg-subtle",
@@ -1475,15 +1509,15 @@ function Option({
1475
1509
  selected ? "font-semibold text-text-primary" : "text-text-secondary"
1476
1510
  ),
1477
1511
  children: [
1478
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react9.Check, { size: 14, "aria-hidden": "true", className: cx3("shrink-0 text-brand-primaryAction", !selected && "invisible") }),
1512
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react9.Check, { size: 14, "aria-hidden": "true", className: cx3("shrink-0 text-brand-primaryAction", !selected && "invisible") }),
1479
1513
  label
1480
1514
  ]
1481
1515
  }
1482
1516
  );
1483
1517
  if (!hint) return option;
1484
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center pr-2.5", children: [
1518
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center gap-2 pr-2.5", children: [
1485
1519
  option,
1486
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(InfoTip, { text: hint, trigger: "hover", label: `About ${label}` })
1520
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(InfoTip, { text: hint, trigger: "hover", label: `About ${label}` })
1487
1521
  ] });
1488
1522
  }
1489
1523
 
@@ -1491,13 +1525,46 @@ function Option({
1491
1525
  var import_react7 = require("react");
1492
1526
  var import_react_dom2 = require("react-dom");
1493
1527
  var import_lucide_react10 = require("lucide-react");
1494
- var import_jsx_runtime11 = require("react/jsx-runtime");
1528
+
1529
+ // src/MenuStatus.tsx
1530
+ var import_jsx_runtime12 = require("react/jsx-runtime");
1531
+ var ROW_WIDTHS = ["w-3/4", "w-1/2", "w-4/5", "w-3/5"];
1532
+ function MenuLoading() {
1533
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { role: "status", "aria-label": "Loading options", className: "p-1", children: ROW_WIDTHS.map((w) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex h-9 items-center px-2", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: `inline-block h-3 ${w} animate-pulse rounded-full bg-subtle`, "aria-hidden": "true" }) }, w)) });
1534
+ }
1535
+ function MenuError({ onRetry }) {
1536
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { role: "alert", className: "px-3 py-5 text-center text-dense text-text-secondary", children: [
1537
+ "Couldn't load options.",
1538
+ onRetry && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1539
+ "button",
1540
+ {
1541
+ type: "button",
1542
+ onClick: onRetry,
1543
+ className: "mt-1.5 block w-full font-medium text-text-link hover:underline focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
1544
+ children: "Try again"
1545
+ }
1546
+ )
1547
+ ] });
1548
+ }
1549
+
1550
+ // src/SelectFilter.tsx
1551
+ var import_jsx_runtime13 = require("react/jsx-runtime");
1495
1552
  function cx4(...classes) {
1496
1553
  return classes.filter(Boolean).join(" ");
1497
1554
  }
1498
1555
  function slug3(value) {
1499
1556
  return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
1500
1557
  }
1558
+ function OptionIcon({ children }) {
1559
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1560
+ "span",
1561
+ {
1562
+ "aria-hidden": "true",
1563
+ className: "flex h-3 w-4 shrink-0 items-center justify-center overflow-hidden text-text-secondary *:max-h-full *:max-w-full",
1564
+ children
1565
+ }
1566
+ );
1567
+ }
1501
1568
  function SelectFilter({
1502
1569
  caption,
1503
1570
  value,
@@ -1506,8 +1573,15 @@ function SelectFilter({
1506
1573
  align = "left",
1507
1574
  fullWidth = false,
1508
1575
  className,
1509
- testIdPrefix
1576
+ testIdPrefix,
1577
+ loading = false,
1578
+ error = false,
1579
+ onRetry,
1580
+ size = "md",
1581
+ disabled = false,
1582
+ renderIcon
1510
1583
  }) {
1584
+ const sm = size === "sm";
1511
1585
  const [open, setOpen] = (0, import_react7.useState)(false);
1512
1586
  const [pos, setPos] = (0, import_react7.useState)(null);
1513
1587
  const ref = (0, import_react7.useRef)(null);
@@ -1516,8 +1590,10 @@ function SelectFilter({
1516
1590
  const reposition = (0, import_react7.useCallback)(() => {
1517
1591
  if (!ref.current) return;
1518
1592
  const r = ref.current.getBoundingClientRect();
1519
- setPos({ top: r.bottom + 8, left: align === "right" ? r.right - r.width : r.left, width: r.width });
1520
- }, [align]);
1593
+ const h = Math.min(options.length * 36 + 8, 288);
1594
+ const above = r.bottom + 8 + h > window.innerHeight && r.top - 8 - h > 0;
1595
+ setPos({ top: above ? r.top - 8 - h : r.bottom + 8, left: align === "right" ? r.right - r.width : r.left, width: r.width });
1596
+ }, [align, options.length]);
1521
1597
  (0, import_react7.useLayoutEffect)(() => {
1522
1598
  if (!open) return;
1523
1599
  reposition();
@@ -1541,8 +1617,12 @@ function SelectFilter({
1541
1617
  window.removeEventListener("scroll", reposition, true);
1542
1618
  };
1543
1619
  }, [open, close, reposition]);
1544
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: cx4("relative", fullWidth && "w-full"), ref, children: [
1545
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1620
+ const triggerValue = renderIcon ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "flex items-center gap-1.5", children: [
1621
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(OptionIcon, { children: renderIcon(value) }),
1622
+ value
1623
+ ] }) : value;
1624
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: cx4("relative", fullWidth && "w-full"), ref, children: [
1625
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1546
1626
  "button",
1547
1627
  {
1548
1628
  type: "button",
@@ -1550,17 +1630,17 @@ function SelectFilter({
1550
1630
  onClick: () => setOpen((o) => !o),
1551
1631
  "aria-expanded": open,
1552
1632
  "aria-haspopup": "listbox",
1633
+ "aria-label": sm ? caption : void 0,
1634
+ disabled,
1553
1635
  className: cx4(
1554
- "flex h-11 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
1636
+ sm ? "flex h-8 items-center gap-1.5 rounded-control border border-border-strong bg-input pl-2.5 pr-2 text-dense font-medium text-text-primary transition-colors hover:bg-subtle focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus" : chipTriggerClass(),
1637
+ "disabled:pointer-events-none disabled:opacity-40",
1555
1638
  fullWidth && "w-full justify-between",
1556
1639
  className
1557
1640
  ),
1558
1641
  children: [
1559
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
1560
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "text-control-caption uppercase tracking-wide text-text-tertiary", children: caption }),
1561
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: value })
1562
- ] }),
1563
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1642
+ sm ? triggerValue : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ChipContent, { caption, value: triggerValue }),
1643
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1564
1644
  import_lucide_react10.ChevronDown,
1565
1645
  {
1566
1646
  size: 14,
@@ -1572,7 +1652,7 @@ function SelectFilter({
1572
1652
  }
1573
1653
  ),
1574
1654
  open && pos && (0, import_react_dom2.createPortal)(
1575
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1655
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1576
1656
  "div",
1577
1657
  {
1578
1658
  ref: popoverRef,
@@ -1580,13 +1660,13 @@ function SelectFilter({
1580
1660
  style: { position: "fixed", top: pos.top, left: pos.left, width: fullWidth ? pos.width : void 0 },
1581
1661
  className: cx4(
1582
1662
  "z-[65] flex flex-col overflow-hidden rounded-card border border-border-default bg-surface shadow-overlay",
1583
- !fullWidth && "w-56"
1663
+ !fullWidth && (sm ? "w-28" : "w-56")
1584
1664
  ),
1585
- role: "listbox",
1665
+ role: loading || error ? "group" : "listbox",
1586
1666
  "aria-label": caption,
1587
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "max-h-[280px] overflow-y-auto p-1", children: options.map((o) => {
1667
+ children: loading ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(MenuLoading, {}) : error ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(MenuError, { onRetry }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "max-h-[280px] overflow-y-auto p-1", children: options.map((o) => {
1588
1668
  const selected = o === value;
1589
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1669
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1590
1670
  "button",
1591
1671
  {
1592
1672
  type: "button",
@@ -1599,8 +1679,9 @@ function SelectFilter({
1599
1679
  },
1600
1680
  className: "flex w-full items-center gap-2.5 rounded-control px-2 py-2 text-left transition-colors hover:bg-subtle",
1601
1681
  children: [
1602
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center text-brand-primaryAction", children: selected && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react10.Check, { size: 15, strokeWidth: 3 }) }),
1603
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1682
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center text-brand-primaryAction", children: selected && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.Check, { size: 15, strokeWidth: 3 }) }),
1683
+ renderIcon && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(OptionIcon, { children: renderIcon(o) }),
1684
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1604
1685
  "span",
1605
1686
  {
1606
1687
  className: cx4("flex-1 text-[14px]", selected ? "font-semibold text-text-primary" : "text-text-primary"),
@@ -1621,9 +1702,9 @@ function SelectFilter({
1621
1702
 
1622
1703
  // src/Card.tsx
1623
1704
  var import_react8 = require("react");
1624
- var import_jsx_runtime12 = require("react/jsx-runtime");
1705
+ var import_jsx_runtime14 = require("react/jsx-runtime");
1625
1706
  var Card = (0, import_react8.forwardRef)(function Card2({ staticCard, title, titleAs: TitleTag = "h3", subtitle, action, className, children, ...rest }, ref) {
1626
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1707
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1627
1708
  "article",
1628
1709
  {
1629
1710
  ref,
@@ -1634,15 +1715,15 @@ var Card = (0, import_react8.forwardRef)(function Card2({ staticCard, title, tit
1634
1715
  className
1635
1716
  ].filter(Boolean).join(" "),
1636
1717
  ...rest,
1637
- children: title ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-1 flex-col p-card-padding", children: [
1638
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-start justify-between gap-2", children: [
1639
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
1640
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TitleTag, { className: "text-style-card-title", children: title }),
1641
- subtitle && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-0.5 text-xs leading-snug text-text-tertiary", children: subtitle })
1718
+ children: title ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-1 flex-col p-card-padding", children: [
1719
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-start justify-between gap-2", children: [
1720
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
1721
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TitleTag, { className: "text-style-card-title", children: title }),
1722
+ subtitle && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "mt-0.5 text-xs leading-snug text-text-tertiary", children: subtitle })
1642
1723
  ] }),
1643
- action && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "shrink-0 text-text-tertiary", children: action })
1724
+ action && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "shrink-0 text-text-tertiary", children: action })
1644
1725
  ] }),
1645
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "mt-4 flex flex-1 flex-col", children })
1726
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "mt-4 flex flex-1 flex-col", children })
1646
1727
  ] }) : children
1647
1728
  }
1648
1729
  );
@@ -1650,7 +1731,7 @@ var Card = (0, import_react8.forwardRef)(function Card2({ staticCard, title, tit
1650
1731
 
1651
1732
  // src/NoResultsEmptyState.tsx
1652
1733
  var import_lucide_react11 = require("lucide-react");
1653
- var import_jsx_runtime13 = require("react/jsx-runtime");
1734
+ var import_jsx_runtime15 = require("react/jsx-runtime");
1654
1735
  var NO_RESULTS_TITLE = "No results match your filters";
1655
1736
  var NO_RESULTS_BODY = "Your filters may be too narrow, conflict with each other, or have no activity in this period.";
1656
1737
  function noResultsBody(workspaceName) {
@@ -1672,12 +1753,12 @@ function NoResultsEmptyState({
1672
1753
  const showClear = hasFilters !== false && Boolean(onClearFilters);
1673
1754
  const showEdit = Boolean(onEditFilters);
1674
1755
  const hasActions = showClear || showEdit || Boolean(actions && actions.length > 0);
1675
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col items-center justify-center gap-3 text-center", "data-testid": testIdPrefix, children: [
1676
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "flex h-11 w-11 items-center justify-center rounded-full bg-subtle text-text-tertiary", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react11.FilterX, { size: 20, "aria-hidden": "true" }) }),
1677
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h2", { className: "text-base font-semibold text-text-primary", children: title }),
1678
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "max-w-[420px] text-[13px] leading-relaxed text-text-secondary", children: bodyText }),
1679
- hasActions && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "mt-1 flex flex-col items-center gap-3", children: [
1680
- showClear && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1756
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-col items-center justify-center gap-3 text-center", "data-testid": testIdPrefix, children: [
1757
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "flex h-11 w-11 items-center justify-center rounded-full bg-subtle text-text-tertiary", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react11.FilterX, { size: 20, "aria-hidden": "true" }) }),
1758
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h2", { className: "text-base font-semibold text-text-primary", children: title }),
1759
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "max-w-[420px] text-[13px] leading-relaxed text-text-secondary", children: bodyText }),
1760
+ hasActions && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "mt-1 flex flex-col items-center gap-3", children: [
1761
+ showClear && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1681
1762
  "button",
1682
1763
  {
1683
1764
  type: "button",
@@ -1687,7 +1768,7 @@ function NoResultsEmptyState({
1687
1768
  children: "Clear all filters"
1688
1769
  }
1689
1770
  ),
1690
- showEdit && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1771
+ showEdit && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1691
1772
  "button",
1692
1773
  {
1693
1774
  type: "button",
@@ -1697,7 +1778,7 @@ function NoResultsEmptyState({
1697
1778
  children: "Edit filters"
1698
1779
  }
1699
1780
  ),
1700
- actions?.map((action, i) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1781
+ actions?.map((action, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1701
1782
  "button",
1702
1783
  {
1703
1784
  type: "button",
@@ -1714,12 +1795,12 @@ function NoResultsEmptyState({
1714
1795
  // src/WorkspaceSelectedCard.tsx
1715
1796
  var import_react9 = require("react");
1716
1797
  var import_lucide_react12 = require("lucide-react");
1717
- var import_jsx_runtime14 = require("react/jsx-runtime");
1798
+ var import_jsx_runtime16 = require("react/jsx-runtime");
1718
1799
  function cx5(...parts) {
1719
1800
  return parts.filter(Boolean).join(" ");
1720
1801
  }
1721
1802
  function WorkspaceSelectedCard({ groups, testIdPrefix }) {
1722
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("aside", { className: "sticky top-4 flex min-w-0 flex-col gap-4 self-start rounded-card border border-border-default bg-surface px-5 pb-5 pt-4 shadow-raised sm:px-6 sm:pb-6", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex flex-col divide-y divide-border-default", children: groups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SummaryGroupItem, { group: g, testIdPrefix }, g.id)) }) });
1803
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("aside", { className: "sticky top-4 flex min-w-0 flex-col gap-4 self-start rounded-card border border-border-default bg-surface px-5 pb-5 pt-4 shadow-raised sm:px-6 sm:pb-6", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex flex-col divide-y divide-border-default", children: groups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SummaryGroupItem, { group: g, testIdPrefix }, g.id)) }) });
1723
1804
  }
1724
1805
  function SummaryGroupItem({
1725
1806
  group,
@@ -1736,8 +1817,8 @@ function SummaryGroupItem({
1736
1817
  else if (expandCount === 0) setOpen(false);
1737
1818
  wasEmpty.current = expandCount === 0;
1738
1819
  }, [expandCount]);
1739
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: nested ? "" : "py-3 first:pt-0 last:pb-0", children: [
1740
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1820
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: nested ? "" : "py-3 first:pt-0 last:pb-0", children: [
1821
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
1741
1822
  "button",
1742
1823
  {
1743
1824
  type: "button",
@@ -1746,7 +1827,7 @@ function SummaryGroupItem({
1746
1827
  "data-testid": testIdPrefix && `${testIdPrefix}-group-${group.id}`,
1747
1828
  className: "flex w-full min-w-0 items-center gap-2 text-left",
1748
1829
  children: [
1749
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1830
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1750
1831
  import_lucide_react12.ChevronDown,
1751
1832
  {
1752
1833
  size: 14,
@@ -1754,37 +1835,37 @@ function SummaryGroupItem({
1754
1835
  className: cx5("shrink-0 text-text-secondary transition-transform", !open && "-rotate-90")
1755
1836
  }
1756
1837
  ),
1757
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: cx5("truncate font-semibold text-text-primary", nested ? "text-[12px]" : "text-[13px]"), children: group.label }),
1758
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "shrink-0 rounded-full bg-subtle px-1.5 py-0.5 text-[11px] font-semibold text-text-secondary", children: ownCount })
1838
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: cx5("truncate font-semibold text-text-primary", nested ? "text-[12px]" : "text-[13px]"), children: group.label }),
1839
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "shrink-0 rounded-full bg-subtle px-1.5 py-0.5 text-[11px] font-semibold text-text-secondary", children: ownCount })
1759
1840
  ]
1760
1841
  }
1761
1842
  ),
1762
- open && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "pt-2.5", children: ownCount === 0 && subCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-[12px] text-text-secondary", children: "Nothing selected." }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-col gap-2.5", children: [
1763
- ownCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
1764
- group.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1843
+ open && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "pt-2.5", children: ownCount === 0 && subCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-[12px] text-text-secondary", children: "Nothing selected." }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex flex-col gap-2.5", children: [
1844
+ ownCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
1845
+ group.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
1765
1846
  "div",
1766
1847
  {
1767
1848
  className: "flex items-center justify-between gap-2 rounded-control border border-border-default bg-canvas px-2 py-1",
1768
1849
  children: [
1769
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "min-w-0 flex-1", children: [
1770
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "block truncate text-[12px] text-text-primary", children: item.name }),
1771
- item.meta && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "block truncate text-[11px] text-text-secondary", children: item.meta })
1850
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "min-w-0 flex-1", children: [
1851
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "block truncate text-[12px] text-text-primary", children: item.name }),
1852
+ item.meta && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "block truncate text-[11px] text-text-secondary", children: item.meta })
1772
1853
  ] }),
1773
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1854
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1774
1855
  "button",
1775
1856
  {
1776
1857
  type: "button",
1777
1858
  "aria-label": `Remove ${item.name}`,
1778
1859
  onClick: () => group.onRemove(item.id),
1779
1860
  className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-control text-text-secondary hover:bg-subtle hover:text-text-danger",
1780
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react12.X, { size: 12, "aria-hidden": "true" })
1861
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react12.X, { size: 12, "aria-hidden": "true" })
1781
1862
  }
1782
1863
  )
1783
1864
  ]
1784
1865
  },
1785
1866
  item.id
1786
1867
  )),
1787
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1868
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1788
1869
  "button",
1789
1870
  {
1790
1871
  type: "button",
@@ -1795,13 +1876,13 @@ function SummaryGroupItem({
1795
1876
  }
1796
1877
  )
1797
1878
  ] }),
1798
- group.subGroups?.map((sg) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SummaryGroupItem, { group: sg, nested: true, testIdPrefix }, sg.id))
1879
+ group.subGroups?.map((sg) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SummaryGroupItem, { group: sg, nested: true, testIdPrefix }, sg.id))
1799
1880
  ] }) })
1800
1881
  ] });
1801
1882
  }
1802
1883
 
1803
1884
  // src/chart-placeholder-shared.tsx
1804
- var import_jsx_runtime15 = require("react/jsx-runtime");
1885
+ var import_jsx_runtime17 = require("react/jsx-runtime");
1805
1886
  var GRID_ROWS = [0, 25, 50, 75, 100];
1806
1887
  var Y_TICK_WIDTHS = [26, 30, 30, 26, 20];
1807
1888
  var Y_AXIS_W = 48;
@@ -1813,9 +1894,9 @@ function AxisFrame({
1813
1894
  children
1814
1895
  }) {
1815
1896
  const gutter = xTicks > 0 ? X_AXIS_H : 0;
1816
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "w-full", style: { height }, role: "presentation", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "relative h-full w-full", children: [
1817
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "absolute inset-y-0 right-0", style: { left: Y_AXIS_W, bottom: gutter }, children: [
1818
- GRID_ROWS.map((pct) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1897
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w-full", style: { height }, role: "presentation", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "relative h-full w-full", children: [
1898
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "absolute inset-y-0 right-0", style: { left: Y_AXIS_W, bottom: gutter }, children: [
1899
+ GRID_ROWS.map((pct) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1819
1900
  "div",
1820
1901
  {
1821
1902
  className: "absolute inset-x-0 border-t border-dashed",
@@ -1823,9 +1904,9 @@ function AxisFrame({
1823
1904
  },
1824
1905
  pct
1825
1906
  )),
1826
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "absolute inset-0", children })
1907
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "absolute inset-0", children })
1827
1908
  ] }),
1828
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "absolute left-0 top-0", style: { width: Y_AXIS_W, bottom: gutter }, children: GRID_ROWS.map((pct, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1909
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "absolute left-0 top-0", style: { width: Y_AXIS_W, bottom: gutter }, children: GRID_ROWS.map((pct, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1829
1910
  "div",
1830
1911
  {
1831
1912
  className: "absolute right-2 h-2 -translate-y-1/2 rounded-xs bg-subtle",
@@ -1833,27 +1914,27 @@ function AxisFrame({
1833
1914
  },
1834
1915
  pct
1835
1916
  )) }),
1836
- xTicks > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1917
+ xTicks > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1837
1918
  "div",
1838
1919
  {
1839
1920
  className: "absolute bottom-0 right-0 flex items-center",
1840
1921
  style: { left: Y_AXIS_W, height: X_AXIS_H },
1841
- children: Array.from({ length: xTicks }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex flex-1 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "h-2 w-full max-w-[26px] rounded-xs bg-subtle" }) }, i))
1922
+ children: Array.from({ length: xTicks }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex flex-1 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "h-2 w-full max-w-[26px] rounded-xs bg-subtle" }) }, i))
1842
1923
  }
1843
1924
  )
1844
1925
  ] }) });
1845
1926
  }
1846
1927
  function BlankLegend({ rows, reverse = false }) {
1847
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1928
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1848
1929
  "ul",
1849
1930
  {
1850
1931
  className: `flex flex-1 justify-center gap-1.5 ${reverse ? "flex-col-reverse" : "flex-col"}`,
1851
1932
  role: "presentation",
1852
1933
  "aria-hidden": "true",
1853
- children: Array.from({ length: rows }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("li", { className: "flex items-center justify-between gap-2", children: [
1854
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "flex items-center gap-1.5", children: [
1855
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "h-2.5 w-2.5 rounded-xs bg-subtle" }),
1856
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1934
+ children: Array.from({ length: rows }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("li", { className: "flex items-center justify-between gap-2", children: [
1935
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "flex items-center gap-1.5", children: [
1936
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "h-2.5 w-2.5 rounded-xs bg-subtle" }),
1937
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1857
1938
  "span",
1858
1939
  {
1859
1940
  className: "h-2 rounded-xs bg-subtle",
@@ -1861,21 +1942,21 @@ function BlankLegend({ rows, reverse = false }) {
1861
1942
  }
1862
1943
  )
1863
1944
  ] }),
1864
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "h-2 w-6 rounded-xs bg-subtle" })
1945
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "h-2 w-6 rounded-xs bg-subtle" })
1865
1946
  ] }, i))
1866
1947
  }
1867
1948
  );
1868
1949
  }
1869
1950
 
1870
1951
  // src/BarChartPlaceholder.tsx
1871
- var import_jsx_runtime16 = require("react/jsx-runtime");
1952
+ var import_jsx_runtime18 = require("react/jsx-runtime");
1872
1953
  var BAR_PROFILE = [92, 86, 76, 65, 57, 40, 30, 24, 18, 13];
1873
1954
  function BarChartPlaceholder({ height = 220 }) {
1874
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AxisFrame, { height, xTicks: BAR_PROFILE.length, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex h-full w-full items-end gap-2", children: BAR_PROFILE.map((pct, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex-1 rounded-t-[3px] bg-subtle", style: { height: `${pct}%` } }, i)) }) });
1955
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AxisFrame, { height, xTicks: BAR_PROFILE.length, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex h-full w-full items-end gap-2", children: BAR_PROFILE.map((pct, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex-1 rounded-t-[3px] bg-subtle", style: { height: `${pct}%` } }, i)) }) });
1875
1956
  }
1876
1957
 
1877
1958
  // src/LineChartPlaceholder.tsx
1878
- var import_jsx_runtime17 = require("react/jsx-runtime");
1959
+ var import_jsx_runtime19 = require("react/jsx-runtime");
1879
1960
  var LINE_SERIES = [
1880
1961
  [58, 52, 55, 41, 45, 33, 36, 25, 28, 17],
1881
1962
  [74, 71, 66, 68, 59, 61, 54, 56, 48, 45],
@@ -1885,9 +1966,9 @@ var LINE_SERIES = [
1885
1966
  var LINE_FORECAST_FROM = 7;
1886
1967
  function LineChartPlaceholder({ height = 280 }) {
1887
1968
  const toPath = (pts, from, to) => pts.slice(from, to).map((y, i) => `${(i + from) / (pts.length - 1) * 100},${y}`).join(" ");
1888
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(AxisFrame, { height, xTicks: LINE_SERIES[0].length, children: [
1889
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("svg", { viewBox: "0 0 100 100", preserveAspectRatio: "none", className: "absolute inset-0 h-full w-full", children: LINE_SERIES.map((pts, s) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("g", { children: [
1890
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1969
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(AxisFrame, { height, xTicks: LINE_SERIES[0].length, children: [
1970
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("svg", { viewBox: "0 0 100 100", preserveAspectRatio: "none", className: "absolute inset-0 h-full w-full", children: LINE_SERIES.map((pts, s) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("g", { children: [
1971
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1891
1972
  "polyline",
1892
1973
  {
1893
1974
  points: toPath(pts, 0, LINE_FORECAST_FROM + 1),
@@ -1899,7 +1980,7 @@ function LineChartPlaceholder({ height = 280 }) {
1899
1980
  strokeLinejoin: "round"
1900
1981
  }
1901
1982
  ),
1902
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1983
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1903
1984
  "polyline",
1904
1985
  {
1905
1986
  points: toPath(pts, LINE_FORECAST_FROM, pts.length),
@@ -1914,7 +1995,7 @@ function LineChartPlaceholder({ height = 280 }) {
1914
1995
  )
1915
1996
  ] }, s)) }),
1916
1997
  LINE_SERIES.map(
1917
- (pts, s) => pts.map((y, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1998
+ (pts, s) => pts.map((y, i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1918
1999
  "div",
1919
2000
  {
1920
2001
  className: "absolute h-1.5 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full",
@@ -1931,16 +2012,16 @@ function LineChartPlaceholder({ height = 280 }) {
1931
2012
  }
1932
2013
 
1933
2014
  // src/PieChartPlaceholder.tsx
1934
- var import_jsx_runtime18 = require("react/jsx-runtime");
2015
+ var import_jsx_runtime20 = require("react/jsx-runtime");
1935
2016
  var PIE_SEAMS = [0, 115, 180, 230, 262, 288, 310, 332];
1936
2017
  function PieChartPlaceholder({ height = 220, legendRows = 8 }) {
1937
2018
  const r = 45;
1938
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex w-full items-center gap-3", style: { height }, role: "presentation", "aria-hidden": "true", children: [
1939
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex h-full items-center justify-center", style: { width: "60%" }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("svg", { viewBox: "0 0 100 100", className: "h-full", style: { aspectRatio: "1 / 1" }, children: [
1940
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("circle", { cx: "50", cy: "50", r, fill: "var(--mr-color-subtle)" }),
2019
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex w-full items-center gap-3", style: { height }, role: "presentation", "aria-hidden": "true", children: [
2020
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex h-full items-center justify-center", style: { width: "60%" }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("svg", { viewBox: "0 0 100 100", className: "h-full", style: { aspectRatio: "1 / 1" }, children: [
2021
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("circle", { cx: "50", cy: "50", r, fill: "var(--mr-color-subtle)" }),
1941
2022
  PIE_SEAMS.map((deg) => {
1942
2023
  const rad = (deg - 90) * Math.PI / 180;
1943
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2024
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1944
2025
  "line",
1945
2026
  {
1946
2027
  x1: "50",
@@ -1954,12 +2035,12 @@ function PieChartPlaceholder({ height = 220, legendRows = 8 }) {
1954
2035
  );
1955
2036
  })
1956
2037
  ] }) }),
1957
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(BlankLegend, { rows: legendRows })
2038
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(BlankLegend, { rows: legendRows })
1958
2039
  ] });
1959
2040
  }
1960
2041
 
1961
2042
  // src/StackedColumnPlaceholder.tsx
1962
- var import_jsx_runtime19 = require("react/jsx-runtime");
2043
+ var import_jsx_runtime21 = require("react/jsx-runtime");
1963
2044
  var COLUMN_WEIGHTS = [20, 30, 15, 35, 24, 12, 28, 18];
1964
2045
  function columnBands(count) {
1965
2046
  const weights = Array.from({ length: count }, (_, i) => COLUMN_WEIGHTS[i % COLUMN_WEIGHTS.length]);
@@ -1972,7 +2053,7 @@ function StackedColumnPlaceholder({
1972
2053
  legendRows = 4,
1973
2054
  axis = false
1974
2055
  }) {
1975
- const column = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex h-full flex-col overflow-hidden rounded-control bg-subtle", style: { width }, children: columnBands(legendRows).map((pct, i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2056
+ const column = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex h-full flex-col overflow-hidden rounded-control bg-subtle", style: { width }, children: columnBands(legendRows).map((pct, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1976
2057
  "div",
1977
2058
  {
1978
2059
  style: {
@@ -1984,16 +2065,16 @@ function StackedColumnPlaceholder({
1984
2065
  },
1985
2066
  i
1986
2067
  )) });
1987
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex w-full gap-4", style: { height }, role: "presentation", "aria-hidden": "true", children: [
1988
- axis ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { style: { width: "55%" }, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AxisFrame, { height, xTicks: 0, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex h-full items-stretch justify-center", children: column }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex items-stretch py-1", children: column }),
1989
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(BlankLegend, { rows: legendRows, reverse: !axis })
2068
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex w-full gap-4", style: { height }, role: "presentation", "aria-hidden": "true", children: [
2069
+ axis ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { style: { width: "55%" }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(AxisFrame, { height, xTicks: 0, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex h-full items-stretch justify-center", children: column }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex items-stretch py-1", children: column }),
2070
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(BlankLegend, { rows: legendRows, reverse: !axis })
1990
2071
  ] });
1991
2072
  }
1992
2073
 
1993
2074
  // src/Tooltip.tsx
1994
2075
  var import_react10 = require("react");
1995
2076
  var import_react_dom3 = require("react-dom");
1996
- var import_jsx_runtime20 = require("react/jsx-runtime");
2077
+ var import_jsx_runtime22 = require("react/jsx-runtime");
1997
2078
  function cx6(...parts) {
1998
2079
  return parts.filter(Boolean).join(" ");
1999
2080
  }
@@ -2182,7 +2263,7 @@ function Tooltip({
2182
2263
  }
2183
2264
  }
2184
2265
  const floating = anchor != null && typeof document !== "undefined" ? (0, import_react_dom3.createPortal)(
2185
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2266
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2186
2267
  "span",
2187
2268
  {
2188
2269
  ref: boxRef,
@@ -2213,7 +2294,7 @@ function Tooltip({
2213
2294
  document.body
2214
2295
  ) : null;
2215
2296
  if (anchorRef) return floating;
2216
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2297
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
2217
2298
  "span",
2218
2299
  {
2219
2300
  ref,
@@ -2234,26 +2315,26 @@ function Tooltip({
2234
2315
  }
2235
2316
 
2236
2317
  // src/AdvertiserNoResults.tsx
2237
- var import_jsx_runtime21 = require("react/jsx-runtime");
2318
+ var import_jsx_runtime23 = require("react/jsx-runtime");
2238
2319
  function AdvertiserNoResults({
2239
2320
  query,
2240
2321
  hint = "Try checking your spelling or searching for a broader brand name."
2241
2322
  }) {
2242
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex flex-col items-center gap-1.5 px-4 py-8 text-center", children: [
2243
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("p", { className: "text-[13px] font-medium text-text-primary", children: [
2323
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex flex-col items-center gap-1.5 px-4 py-8 text-center", children: [
2324
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("p", { className: "text-[13px] font-medium text-text-primary", children: [
2244
2325
  "No results found for \u201C",
2245
2326
  query,
2246
2327
  "\u201D"
2247
2328
  ] }),
2248
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-[12px] leading-snug text-text-tertiary", children: hint })
2329
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-[12px] leading-snug text-text-tertiary", children: hint })
2249
2330
  ] });
2250
2331
  }
2251
2332
 
2252
2333
  // src/SelectAllVisible.tsx
2253
2334
  var import_lucide_react13 = require("lucide-react");
2254
- var import_jsx_runtime22 = require("react/jsx-runtime");
2335
+ var import_jsx_runtime24 = require("react/jsx-runtime");
2255
2336
  function SelectAllVisible({ count, allSelected, onToggle, testIdPrefix }) {
2256
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
2337
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2257
2338
  "button",
2258
2339
  {
2259
2340
  type: "button",
@@ -2261,7 +2342,7 @@ function SelectAllVisible({ count, allSelected, onToggle, testIdPrefix }) {
2261
2342
  onClick: onToggle,
2262
2343
  className: "flex w-full items-center gap-2 rounded-control px-2 py-1.5 text-left text-[12px] font-semibold text-text-link transition-colors hover:bg-subtle",
2263
2344
  children: [
2264
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react13.ListChecks, { size: 14, "aria-hidden": "true" }),
2345
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react13.ListChecks, { size: 14, "aria-hidden": "true" }),
2265
2346
  allSelected ? `Deselect ${count} visible` : `Select all ${count} visible`
2266
2347
  ]
2267
2348
  }
@@ -2270,14 +2351,14 @@ function SelectAllVisible({ count, allSelected, onToggle, testIdPrefix }) {
2270
2351
 
2271
2352
  // src/SelectedSection.tsx
2272
2353
  var import_lucide_react14 = require("lucide-react");
2273
- var import_jsx_runtime23 = require("react/jsx-runtime");
2354
+ var import_jsx_runtime25 = require("react/jsx-runtime");
2274
2355
  function cx7(...parts) {
2275
2356
  return parts.filter(Boolean).join(" ");
2276
2357
  }
2277
2358
  function SelectedSection({ count, open, onToggle, children, testIdPrefix }) {
2278
2359
  if (count === 0) return null;
2279
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex flex-col", children: [
2280
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
2360
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex flex-col", children: [
2361
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
2281
2362
  "button",
2282
2363
  {
2283
2364
  type: "button",
@@ -2286,14 +2367,14 @@ function SelectedSection({ count, open, onToggle, children, testIdPrefix }) {
2286
2367
  "aria-expanded": open,
2287
2368
  className: "flex w-full items-center gap-1.5 rounded-control px-2 py-1 text-left text-[11px] font-semibold uppercase tracking-wide text-text-tertiary transition-colors hover:text-text-primary",
2288
2369
  children: [
2289
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react14.ChevronDown, { size: 13, "aria-hidden": "true", className: cx7("transition-transform", !open && "-rotate-90") }),
2370
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react14.ChevronDown, { size: 13, "aria-hidden": "true", className: cx7("transition-transform", !open && "-rotate-90") }),
2290
2371
  "Selected (",
2291
2372
  count,
2292
2373
  ")"
2293
2374
  ]
2294
2375
  }
2295
2376
  ),
2296
- open && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex flex-col gap-0.5", children })
2377
+ open && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex flex-col gap-0.5", children })
2297
2378
  ] });
2298
2379
  }
2299
2380
 
@@ -2301,7 +2382,7 @@ function SelectedSection({ count, open, onToggle, children, testIdPrefix }) {
2301
2382
  var import_react11 = require("react");
2302
2383
  var import_react_dom4 = require("react-dom");
2303
2384
  var import_lucide_react15 = require("lucide-react");
2304
- var import_jsx_runtime24 = require("react/jsx-runtime");
2385
+ var import_jsx_runtime26 = require("react/jsx-runtime");
2305
2386
  function cx8(...parts) {
2306
2387
  return parts.filter(Boolean).join(" ");
2307
2388
  }
@@ -2396,17 +2477,17 @@ function SelectionPicker({
2396
2477
  }
2397
2478
  };
2398
2479
  const rowGridCols = showInfoColumn ? "grid-cols-[36px_1fr_44px]" : "grid-cols-[36px_1fr]";
2399
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-4", children: [
2400
- helper && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
2401
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-[13px] text-text-secondary", children: helper }),
2402
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("hr", { className: "-mx-5 -mt-2 border-border-default sm:-mx-6" })
2480
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col gap-4", children: [
2481
+ helper && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
2482
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-[13px] text-text-secondary", children: helper }),
2483
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("hr", { className: "-mx-5 -mt-2 border-border-default sm:-mx-6" })
2403
2484
  ] }),
2404
- hasAccountLists && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "inline-flex gap-0.5 self-start rounded-control border border-border-default bg-canvas p-0.5", children: [
2485
+ hasAccountLists && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "inline-flex gap-0.5 self-start rounded-control border border-border-default bg-canvas p-0.5", children: [
2405
2486
  { id: "search", label: "Search", icon: import_lucide_react15.Search },
2406
2487
  { id: "lists", label: "Account lists", icon: import_lucide_react15.List }
2407
2488
  ].map((t) => {
2408
2489
  const on = source === t.id;
2409
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2490
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2410
2491
  "button",
2411
2492
  {
2412
2493
  type: "button",
@@ -2417,18 +2498,18 @@ function SelectionPicker({
2417
2498
  on ? "bg-surface text-text-primary shadow-raised" : "text-text-secondary hover:text-text-primary"
2418
2499
  ),
2419
2500
  children: [
2420
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(t.icon, { size: 14, "aria-hidden": "true" }),
2501
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(t.icon, { size: 14, "aria-hidden": "true" }),
2421
2502
  t.label
2422
2503
  ]
2423
2504
  },
2424
2505
  t.id
2425
2506
  );
2426
2507
  }) }),
2427
- source === "search" && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex min-w-0 flex-col gap-3", children: [
2428
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
2429
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex h-8 min-w-[200px] flex-1 items-center gap-2 rounded-control border border-border-strong bg-input px-3 focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus", children: [
2430
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.Search, { size: 15, className: "text-text-secondary", "aria-hidden": "true" }),
2431
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2508
+ source === "search" && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex min-w-0 flex-col gap-3", children: [
2509
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
2510
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex h-8 min-w-[200px] flex-1 items-center gap-2 rounded-control border border-border-strong bg-input px-3 focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus", children: [
2511
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Search, { size: 15, className: "text-text-secondary", "aria-hidden": "true" }),
2512
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2432
2513
  "input",
2433
2514
  {
2434
2515
  value: query,
@@ -2444,7 +2525,7 @@ function SelectionPicker({
2444
2525
  }
2445
2526
  )
2446
2527
  ] }),
2447
- filters.map((f) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2528
+ filters.map((f) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2448
2529
  FilterDropdown,
2449
2530
  {
2450
2531
  filter: f,
@@ -2456,14 +2537,14 @@ function SelectionPicker({
2456
2537
  )),
2457
2538
  toolbarExtra
2458
2539
  ] }),
2459
- !hasSearched ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col items-center gap-3 rounded-card border border-dashed border-border-default py-10 text-center", children: [
2460
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.Search, { size: 20, className: "text-text-tertiary", "aria-hidden": "true" }) }),
2461
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-1", children: [
2462
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-[14px] font-semibold text-text-primary", children: "Search to get started" }),
2463
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-[13px] text-text-tertiary", children: "Use the search or filters above to find and add options." })
2540
+ !hasSearched ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col items-center gap-3 rounded-card border border-dashed border-border-default py-10 text-center", children: [
2541
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Search, { size: 20, className: "text-text-tertiary", "aria-hidden": "true" }) }),
2542
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col gap-1", children: [
2543
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-[14px] font-semibold text-text-primary", children: "Search to get started" }),
2544
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-[13px] text-text-tertiary", children: "Use the search or filters above to find and add options." })
2464
2545
  ] })
2465
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "overflow-hidden rounded-control border border-border-default", children: [
2466
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2546
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "overflow-hidden rounded-control border border-border-default", children: [
2547
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2467
2548
  "div",
2468
2549
  {
2469
2550
  className: cx8(
@@ -2471,7 +2552,7 @@ function SelectionPicker({
2471
2552
  rowGridCols
2472
2553
  ),
2473
2554
  children: [
2474
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2555
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2475
2556
  CheckBox,
2476
2557
  {
2477
2558
  checked: allSelected,
@@ -2482,18 +2563,18 @@ function SelectionPicker({
2482
2563
  testId: testIdPrefix && `${testIdPrefix}-select-all`
2483
2564
  }
2484
2565
  ),
2485
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cx8("grid gap-2", gridForColumns(columns)), children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: c.className, children: c.header }, c.key)) }),
2486
- showInfoColumn && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "text-right", children: "Info" })
2566
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: cx8("grid gap-2", gridForColumns(columns)), children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: c.className, children: c.header }, c.key)) }),
2567
+ showInfoColumn && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "text-right", children: "Info" })
2487
2568
  ]
2488
2569
  }
2489
2570
  ),
2490
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "max-h-[360px] overflow-y-auto", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex items-center justify-center py-6", role: "status", "aria-label": "Loading", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.Loader2, { size: 18, className: "animate-spin text-text-tertiary", "aria-hidden": "true" }) }) : error ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "px-3 py-8 text-center text-[13px] text-text-tertiary", children: errorMessage }) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "px-3 py-8 text-center text-[13px] text-text-tertiary", children: "No matches. Try a different search or filter." }) : rows.map((row) => {
2571
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "max-h-[360px] overflow-y-auto", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex items-center justify-center py-6", role: "status", "aria-label": "Loading", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Loader2, { size: 18, className: "animate-spin text-text-tertiary", "aria-hidden": "true" }) }) : error ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "px-3 py-8 text-center text-[13px] text-text-tertiary", children: errorMessage }) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "px-3 py-8 text-center text-[13px] text-text-tertiary", children: "No matches. Try a different search or filter." }) : rows.map((row) => {
2491
2572
  const isSel = selectedIds.has(row.id);
2492
2573
  const isLocked = lockedIds?.has(row.id) ?? false;
2493
2574
  const kids = getChildren?.(row);
2494
2575
  const isOpen = expanded.has(row.id);
2495
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "border-t border-border-default/60 first:border-t-0", children: [
2496
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2576
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "border-t border-border-default/60 first:border-t-0", children: [
2577
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2497
2578
  "div",
2498
2579
  {
2499
2580
  onClick: isLocked ? void 0 : () => toggleRow(row),
@@ -2506,7 +2587,7 @@ function SelectionPicker({
2506
2587
  !isLocked && isSel && "opacity-70"
2507
2588
  ),
2508
2589
  children: [
2509
- isLocked ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2590
+ isLocked ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2510
2591
  CheckBox,
2511
2592
  {
2512
2593
  checked: isSel,
@@ -2515,8 +2596,8 @@ function SelectionPicker({
2515
2596
  testId: testIdPrefix && `${testIdPrefix}-row-${slug4(row.id)}`
2516
2597
  }
2517
2598
  ),
2518
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cx8("grid gap-2 text-[13px] text-text-primary", gridForColumns(columns)), children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: cx8("truncate", c.className), children: c.render(row) }, c.key)) }),
2519
- showInfoColumn && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex items-center justify-end", children: kids && kids.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2599
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: cx8("grid gap-2 text-[13px] text-text-primary", gridForColumns(columns)), children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: cx8("truncate", c.className), children: c.render(row) }, c.key)) }),
2600
+ showInfoColumn && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex items-center justify-end", children: kids && kids.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2520
2601
  "button",
2521
2602
  {
2522
2603
  type: "button",
@@ -2530,28 +2611,28 @@ function SelectionPicker({
2530
2611
  });
2531
2612
  },
2532
2613
  className: "flex h-7 w-7 items-center justify-center rounded-control text-text-secondary hover:bg-canvas hover:text-text-primary",
2533
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.ChevronRight, { size: 15, className: cx8("transition-transform", isOpen && "rotate-90") })
2614
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.ChevronRight, { size: 15, className: cx8("transition-transform", isOpen && "rotate-90") })
2534
2615
  }
2535
- ) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2616
+ ) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2536
2617
  "span",
2537
2618
  {
2538
2619
  className: "flex h-7 w-7 items-center justify-center text-text-tertiary",
2539
2620
  title: "No additional details",
2540
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.Info, { size: 14 })
2621
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Info, { size: 14 })
2541
2622
  }
2542
2623
  ) })
2543
2624
  ]
2544
2625
  }
2545
2626
  ),
2546
- isOpen && kids && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "bg-canvas/60 pb-1.5 pl-10 pr-3", children: kids.map((kid) => {
2627
+ isOpen && kids && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "bg-canvas/60 pb-1.5 pl-10 pr-3", children: kids.map((kid) => {
2547
2628
  const kidSel = selectedIds.has(kid.id);
2548
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2629
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2549
2630
  "div",
2550
2631
  {
2551
2632
  className: "flex items-center justify-between gap-2 border-t border-border-default/40 py-2 first:border-t-0",
2552
2633
  children: [
2553
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "truncate text-[13px] text-text-secondary", children: kid.name }),
2554
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2634
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "truncate text-[13px] text-text-secondary", children: kid.name }),
2635
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2555
2636
  "button",
2556
2637
  {
2557
2638
  type: "button",
@@ -2562,7 +2643,7 @@ function SelectionPicker({
2562
2643
  kidSel ? "text-text-tertiary" : "text-text-link hover:bg-subtle"
2563
2644
  ),
2564
2645
  children: [
2565
- kidSel ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.Check, { size: 13 }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.Plus, { size: 13 }),
2646
+ kidSel ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Check, { size: 13 }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Plus, { size: 13 }),
2566
2647
  kidSel ? "Added" : "Add"
2567
2648
  ]
2568
2649
  }
@@ -2574,7 +2655,7 @@ function SelectionPicker({
2574
2655
  }) })
2575
2656
  ] }, row.id);
2576
2657
  }) }),
2577
- !loading && !error && hasMore && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2658
+ !loading && !error && hasMore && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2578
2659
  "button",
2579
2660
  {
2580
2661
  type: "button",
@@ -2583,19 +2664,19 @@ function SelectionPicker({
2583
2664
  "data-testid": testIdPrefix && `${testIdPrefix}-load-more`,
2584
2665
  className: "flex w-full items-center justify-center gap-2 border-t border-border-default px-2 py-1.5 text-[13px] text-brand-primaryAction transition-colors hover:bg-subtle disabled:opacity-50",
2585
2666
  children: [
2586
- loadingMore ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.Loader2, { size: 13, className: "animate-spin", "aria-hidden": "true" }) : null,
2667
+ loadingMore ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Loader2, { size: 13, className: "animate-spin", "aria-hidden": "true" }) : null,
2587
2668
  loadingMore ? "Loading\u2026" : "Load more"
2588
2669
  ]
2589
2670
  }
2590
2671
  )
2591
2672
  ] })
2592
2673
  ] }),
2593
- source === "lists" && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex min-w-0 flex-col gap-3", children: [
2594
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-[13px] text-text-secondary", children: "Select an account list to add all of its accounts at once. Your workspace stays in sync as the list is updated." }),
2595
- accountLists && accountLists.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
2596
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ScrollFade, { className: "flex max-h-[396px] flex-col gap-2 overflow-y-auto pr-0.5", children: accountLists.map((list) => {
2674
+ source === "lists" && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex min-w-0 flex-col gap-3", children: [
2675
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-[13px] text-text-secondary", children: "Select an account list to add all of its accounts at once. Your workspace stays in sync as the list is updated." }),
2676
+ accountLists && accountLists.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
2677
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ScrollFade, { className: "flex max-h-[396px] flex-col gap-2 overflow-y-auto pr-0.5", children: accountLists.map((list) => {
2597
2678
  const on = (selectedListIds ?? []).includes(list.id);
2598
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2679
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2599
2680
  "button",
2600
2681
  {
2601
2682
  type: "button",
@@ -2607,19 +2688,19 @@ function SelectionPicker({
2607
2688
  on ? "border-brand-primaryAction bg-brand-primarySoft" : "border-border-default bg-surface hover:bg-subtle"
2608
2689
  ),
2609
2690
  children: [
2610
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2691
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2611
2692
  "span",
2612
2693
  {
2613
2694
  className: cx8(
2614
2695
  "flex h-5 w-5 shrink-0 items-center justify-center rounded-full",
2615
2696
  on ? "text-brand-primaryAction" : "text-text-secondary"
2616
2697
  ),
2617
- children: on ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.Check, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.Plus, { size: 16 })
2698
+ children: on ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Check, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Plus, { size: 16 })
2618
2699
  }
2619
2700
  ),
2620
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "min-w-0 flex-1", children: [
2621
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "flex min-w-0 items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "truncate text-[14px] font-medium text-text-primary", children: list.name }) }),
2622
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "block truncate text-[12px] text-text-secondary", children: [
2701
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: "min-w-0 flex-1", children: [
2702
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "flex min-w-0 items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "truncate text-[14px] font-medium text-text-primary", children: list.name }) }),
2703
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: "block truncate text-[12px] text-text-secondary", children: [
2623
2704
  list.count,
2624
2705
  " accounts \xB7 ",
2625
2706
  list.entityTypes.join(", "),
@@ -2627,13 +2708,13 @@ function SelectionPicker({
2627
2708
  formatListDate(list.updatedAt)
2628
2709
  ] })
2629
2710
  ] }),
2630
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: cx8("shrink-0 text-[12px] font-medium", on ? "text-brand-primaryAction" : "text-text-secondary"), children: on ? "Added" : "Add" })
2711
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: cx8("shrink-0 text-[12px] font-medium", on ? "text-brand-primaryAction" : "text-text-secondary"), children: on ? "Added" : "Add" })
2631
2712
  ]
2632
2713
  },
2633
2714
  list.id
2634
2715
  );
2635
2716
  }) }),
2636
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2717
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2637
2718
  "p",
2638
2719
  {
2639
2720
  className: "border-t border-border-default pt-2 text-right text-[12px] font-medium text-text-tertiary",
@@ -2645,11 +2726,11 @@ function SelectionPicker({
2645
2726
  ]
2646
2727
  }
2647
2728
  )
2648
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col items-center gap-3 rounded-card border border-dashed border-border-default py-10 text-center", children: [
2649
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.List, { size: 20, className: "text-text-tertiary", "aria-hidden": "true" }) }),
2650
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-1", children: [
2651
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-[14px] font-semibold text-text-primary", children: "No account lists yet" }),
2652
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-[13px] text-text-tertiary", children: "Account lists set up for you will appear here." })
2729
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col items-center gap-3 rounded-card border border-dashed border-border-default py-10 text-center", children: [
2730
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.List, { size: 20, className: "text-text-tertiary", "aria-hidden": "true" }) }),
2731
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col gap-1", children: [
2732
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-[14px] font-semibold text-text-primary", children: "No account lists yet" }),
2733
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-[13px] text-text-tertiary", children: "Account lists set up for you will appear here." })
2653
2734
  ] })
2654
2735
  ] })
2655
2736
  ] })
@@ -2681,7 +2762,7 @@ function ScrollFade({ className, children }) {
2681
2762
  [sync]
2682
2763
  );
2683
2764
  const mask = edges.top || edges.bottom ? `linear-gradient(to bottom, transparent 0, #000 ${edges.top ? EDGE_FADE : 0}px, #000 calc(100% - ${edges.bottom ? EDGE_FADE : 0}px), transparent 100%)` : void 0;
2684
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { ref: attach, onScroll: sync, className, style: { maskImage: mask, WebkitMaskImage: mask }, children });
2765
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { ref: attach, onScroll: sync, className, style: { maskImage: mask, WebkitMaskImage: mask }, children });
2685
2766
  }
2686
2767
  function formatListDate(iso) {
2687
2768
  try {
@@ -2731,8 +2812,8 @@ function FilterDropdown({
2731
2812
  const count = active.size;
2732
2813
  const label = count === 0 ? filter.label : count === 1 ? [...active][0] : "Multiple";
2733
2814
  const filterSlug = slug4(filter.label);
2734
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "relative", children: [
2735
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2815
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "relative", children: [
2816
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2736
2817
  "button",
2737
2818
  {
2738
2819
  ref: btnRef,
@@ -2743,12 +2824,12 @@ function FilterDropdown({
2743
2824
  className: "inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-control border border-border-strong bg-input px-3 text-[13px] font-medium text-text-secondary transition-colors hover:bg-subtle",
2744
2825
  children: [
2745
2826
  label,
2746
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.ChevronDown, { size: 13, "aria-hidden": "true", className: cx8("transition-transform", open && "rotate-180") })
2827
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.ChevronDown, { size: 13, "aria-hidden": "true", className: cx8("transition-transform", open && "rotate-180") })
2747
2828
  ]
2748
2829
  }
2749
2830
  ),
2750
2831
  open && pos && (0, import_react_dom4.createPortal)(
2751
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2832
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2752
2833
  "div",
2753
2834
  {
2754
2835
  ref: menuRef,
@@ -2757,9 +2838,9 @@ function FilterDropdown({
2757
2838
  style: { top: pos.top, left: pos.left },
2758
2839
  className: "fixed z-[80] min-w-[220px] rounded-card border border-border-default bg-surface p-2 shadow-overlay",
2759
2840
  children: [
2760
- searchable && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "mb-1.5 flex h-8 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5", children: [
2761
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.Search, { size: 14, className: "shrink-0 text-text-secondary", "aria-hidden": "true" }),
2762
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2841
+ searchable && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "mb-1.5 flex h-8 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5", children: [
2842
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react15.Search, { size: 14, className: "shrink-0 text-text-secondary", "aria-hidden": "true" }),
2843
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2763
2844
  "input",
2764
2845
  {
2765
2846
  autoFocus: true,
@@ -2770,14 +2851,14 @@ function FilterDropdown({
2770
2851
  }
2771
2852
  )
2772
2853
  ] }),
2773
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cx8("flex flex-col gap-0.5", searchable && "max-h-[240px] overflow-y-auto"), children: shownOptions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "px-2 py-3 text-center text-[12px] text-text-secondary", children: "No matches." }) : shownOptions.map((opt) => {
2854
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: cx8("flex flex-col gap-0.5", searchable && "max-h-[240px] overflow-y-auto"), children: shownOptions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "px-2 py-3 text-center text-[12px] text-text-secondary", children: "No matches." }) : shownOptions.map((opt) => {
2774
2855
  const on = active.has(opt);
2775
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2856
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2776
2857
  "label",
2777
2858
  {
2778
2859
  className: "flex cursor-pointer items-center gap-2 rounded-control px-2 py-1.5 text-[13px] text-text-primary hover:bg-subtle",
2779
2860
  children: [
2780
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2861
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2781
2862
  CheckBox,
2782
2863
  {
2783
2864
  checked: on,
@@ -2808,7 +2889,7 @@ function gridForColumns(columns) {
2808
2889
 
2809
2890
  // src/PublisherBreakdownList.tsx
2810
2891
  var import_react12 = require("react");
2811
- var import_jsx_runtime25 = require("react/jsx-runtime");
2892
+ var import_jsx_runtime27 = require("react/jsx-runtime");
2812
2893
  function cx9(...parts) {
2813
2894
  return parts.filter(Boolean).join(" ");
2814
2895
  }
@@ -2823,7 +2904,7 @@ function initials(name) {
2823
2904
  return name.replace(/[^a-zA-Z0-9]/g, "").slice(0, 2).toUpperCase();
2824
2905
  }
2825
2906
  function Monogram({ name, size = 28 }) {
2826
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2907
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2827
2908
  "span",
2828
2909
  {
2829
2910
  "aria-hidden": "true",
@@ -2834,12 +2915,12 @@ function Monogram({ name, size = 28 }) {
2834
2915
  );
2835
2916
  }
2836
2917
  function BreakdownTag({ children }) {
2837
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "inline-flex items-center whitespace-nowrap rounded-full bg-subtle px-2 py-0.5 text-[11px] font-medium text-text-secondary", children });
2918
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "inline-flex items-center whitespace-nowrap rounded-full bg-subtle px-2 py-0.5 text-[11px] font-medium text-text-secondary", children });
2838
2919
  }
2839
2920
  function DelayedTip({ label, children }) {
2840
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "group/dt relative inline-flex", tabIndex: 0, "aria-label": label, children: [
2921
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "group/dt relative inline-flex", tabIndex: 0, "aria-label": label, children: [
2841
2922
  children,
2842
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2923
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2843
2924
  "span",
2844
2925
  {
2845
2926
  role: "tooltip",
@@ -2853,22 +2934,22 @@ var COL_CURRENT = 76;
2853
2934
  var COL_PREVIOUS = 76;
2854
2935
  var COL_YOY = 44;
2855
2936
  function MetricListHeader({ className }) {
2856
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: cx9("flex items-baseline gap-2 pb-2", className), children: [
2857
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "flex-1" }),
2858
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
2859
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-right text-[11px] font-medium text-text-tertiary", style: { width: COL_CURRENT }, children: "Current" }),
2860
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DelayedTip, { label: "Spend during the same time period one year ago.", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-right text-[11px] font-medium text-text-tertiary", style: { width: COL_PREVIOUS }, children: "Previous" }) }),
2861
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DelayedTip, { label: "Percent change from this time period vs. the same time one year ago.", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-right text-[11px] font-medium text-text-tertiary", style: { width: COL_YOY }, children: "YoY" }) })
2937
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: cx9("flex items-baseline gap-2 pb-2", className), children: [
2938
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "flex-1" }),
2939
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
2940
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-right text-[11px] font-medium text-text-tertiary", style: { width: COL_CURRENT }, children: "Current" }),
2941
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(DelayedTip, { label: "Spend during the same time period one year ago.", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-right text-[11px] font-medium text-text-tertiary", style: { width: COL_PREVIOUS }, children: "Previous" }) }),
2942
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(DelayedTip, { label: "Percent change from this time period vs. the same time one year ago.", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-right text-[11px] font-medium text-text-tertiary", style: { width: COL_YOY }, children: "YoY" }) })
2862
2943
  ] })
2863
2944
  ] });
2864
2945
  }
2865
2946
  function MetricCells({ spendN, yoy }) {
2866
2947
  const prior = priorYearAmt(spendN, yoy);
2867
2948
  const up = yoy !== "NEW" && yoy >= 0;
2868
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
2869
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-right text-[12px] font-bold tabular-nums text-text-primary", style: { width: COL_CURRENT }, children: fmtM(spendN) }),
2870
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-right text-[12px] font-normal tabular-nums text-text-primary", style: { width: COL_PREVIOUS }, children: prior ?? "\u2014" }),
2871
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "flex justify-end", style: { width: COL_YOY }, children: yoy === "NEW" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "rounded-full bg-status-warning/15 px-1.5 text-badge font-semibold text-text-warning", children: "NEW" }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: cx9("text-right text-[12px] font-semibold tabular-nums", up ? "text-text-success" : "text-text-danger"), children: [
2949
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
2950
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-right text-[12px] font-bold tabular-nums text-text-primary", style: { width: COL_CURRENT }, children: fmtM(spendN) }),
2951
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-right text-[12px] font-normal tabular-nums text-text-primary", style: { width: COL_PREVIOUS }, children: prior ?? "\u2014" }),
2952
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "flex justify-end", style: { width: COL_YOY }, children: yoy === "NEW" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "rounded-full bg-status-warning/15 px-1.5 text-badge font-semibold text-text-warning", children: "NEW" }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: cx9("text-right text-[12px] font-semibold tabular-nums", up ? "text-text-success" : "text-text-danger"), children: [
2872
2953
  up ? "+" : "\u2212",
2873
2954
  Math.abs(yoy),
2874
2955
  "%"
@@ -2879,35 +2960,35 @@ function PublisherBreakdownList({ rows, defaultVisibleCount = 10, padded = true,
2879
2960
  const [showAll, setShowAll] = (0, import_react12.useState)(false);
2880
2961
  const visible = showAll ? rows : rows.slice(0, defaultVisibleCount);
2881
2962
  const rowPad = padded ? "px-5" : "";
2882
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex flex-col", children: [
2883
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex flex-col", children: [
2884
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MetricListHeader, { className: rowPad }),
2885
- visible.map((p) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: cx9("flex items-center justify-between gap-3 border-t border-border-default/60 py-2.5 first:border-t-0", rowPad), children: [
2886
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex min-w-0 items-center gap-2.5", children: [
2887
- renderLogo ? renderLogo(p) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Monogram, { name: p.brand, size: 28 }),
2888
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "min-w-0", children: [
2889
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5", children: [
2890
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-[14px] font-semibold text-text-primary", children: p.brand }),
2891
- p.tags.map((t) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(BreakdownTag, { children: t }, t))
2963
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col", children: [
2964
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col", children: [
2965
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(MetricListHeader, { className: rowPad }),
2966
+ visible.map((p) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: cx9("flex items-center justify-between gap-3 border-t border-border-default/60 py-2.5 first:border-t-0", rowPad), children: [
2967
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex min-w-0 items-center gap-2.5", children: [
2968
+ renderLogo ? renderLogo(p) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Monogram, { name: p.brand, size: 28 }),
2969
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "min-w-0", children: [
2970
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5", children: [
2971
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-[14px] font-semibold text-text-primary", children: p.brand }),
2972
+ p.tags.map((t) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(BreakdownTag, { children: t }, t))
2892
2973
  ] }),
2893
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "truncate text-[11.5px] text-text-tertiary", children: p.owner })
2974
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "truncate text-[11.5px] text-text-tertiary", children: p.owner })
2894
2975
  ] })
2895
2976
  ] }),
2896
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MetricCells, { spendN: p.spendN, yoy: p.yoy })
2977
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(MetricCells, { spendN: p.spendN, yoy: p.yoy })
2897
2978
  ] }, p.brand))
2898
2979
  ] }),
2899
- rows.length > defaultVisibleCount && (viewAllHref ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: cx9("border-t border-border-default py-3", rowPad), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("a", { href: viewAllHref, className: "text-[12px] font-semibold text-text-link hover:underline", children: "See all publishers" }) }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: cx9("flex items-center gap-2 border-t border-border-default py-3 text-[12px] text-text-tertiary", rowPad), children: [
2900
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { children: [
2980
+ rows.length > defaultVisibleCount && (viewAllHref ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: cx9("border-t border-border-default py-3", rowPad), children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("a", { href: viewAllHref, className: "text-[12px] font-semibold text-text-link hover:underline", children: "See all publishers" }) }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: cx9("flex items-center gap-2 border-t border-border-default py-3 text-[12px] text-text-tertiary", rowPad), children: [
2981
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { children: [
2901
2982
  "Showing ",
2902
2983
  visible.length,
2903
2984
  " of ",
2904
2985
  rows.length
2905
2986
  ] }),
2906
- !showAll ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("button", { type: "button", onClick: () => setShowAll(true), className: "font-semibold text-text-link hover:underline", children: [
2987
+ !showAll ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("button", { type: "button", onClick: () => setShowAll(true), className: "font-semibold text-text-link hover:underline", children: [
2907
2988
  "See all (",
2908
2989
  rows.length - defaultVisibleCount,
2909
2990
  " more)"
2910
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("button", { type: "button", onClick: () => setShowAll(false), className: "font-semibold text-text-link hover:underline", children: "Show less" })
2991
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("button", { type: "button", onClick: () => setShowAll(false), className: "font-semibold text-text-link hover:underline", children: "Show less" })
2911
2992
  ] }))
2912
2993
  ] });
2913
2994
  }
@@ -2917,7 +2998,7 @@ var import_react13 = require("react");
2917
2998
  var import_react_slot = require("@radix-ui/react-slot");
2918
2999
  var import_class_variance_authority = require("class-variance-authority");
2919
3000
  var import_lucide_react16 = require("lucide-react");
2920
- var import_jsx_runtime26 = require("react/jsx-runtime");
3001
+ var import_jsx_runtime28 = require("react/jsx-runtime");
2921
3002
  var buttonVariants = (0, import_class_variance_authority.cva)(
2922
3003
  "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-control transition-all duration-(--mr-motion-duration-interactive) ease-interactive disabled:pointer-events-none disabled:opacity-40 focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
2923
3004
  {
@@ -2987,10 +3068,10 @@ var Button = (0, import_react13.forwardRef)(
2987
3068
  ...props
2988
3069
  };
2989
3070
  if (asChild) {
2990
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_slot.Slot, { ref, ...shared, children });
3071
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_slot.Slot, { ref, ...shared, children });
2991
3072
  }
2992
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("button", { ref, ...shared, children: [
2993
- loading && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react16.Loader2, { className: "size-4 shrink-0 animate-spin", "aria-hidden": "true" }),
3073
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("button", { ref, ...shared, children: [
3074
+ loading && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react16.Loader2, { className: "size-4 shrink-0 animate-spin", "aria-hidden": "true" }),
2994
3075
  children
2995
3076
  ] });
2996
3077
  }
@@ -2998,14 +3079,14 @@ var Button = (0, import_react13.forwardRef)(
2998
3079
  Button.displayName = "Button";
2999
3080
 
3000
3081
  // src/FilterDropdownFooter.tsx
3001
- var import_jsx_runtime27 = require("react/jsx-runtime");
3082
+ var import_jsx_runtime29 = require("react/jsx-runtime");
3002
3083
  function FilterDropdownFooter({
3003
3084
  onClear,
3004
3085
  onApply,
3005
3086
  clearLabel = "Clear all",
3006
3087
  applyLabel = "Apply"
3007
3088
  }) {
3008
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
3089
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
3009
3090
  "div",
3010
3091
  {
3011
3092
  className: cn(
@@ -3013,8 +3094,8 @@ function FilterDropdownFooter({
3013
3094
  onClear ? "justify-between" : "justify-end"
3014
3095
  ),
3015
3096
  children: [
3016
- onClear && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { type: "button", variant: "ghost", size: "sm", onClick: onClear, children: clearLabel }),
3017
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { type: "button", variant: "primary", size: "sm", onClick: onApply, children: applyLabel })
3097
+ onClear && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Button, { type: "button", variant: "ghost", size: "sm", onClick: onClear, children: clearLabel }),
3098
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Button, { type: "button", variant: "primary", size: "sm", onClick: onApply, children: applyLabel })
3018
3099
  ]
3019
3100
  }
3020
3101
  );
@@ -3023,7 +3104,7 @@ function FilterDropdownFooter({
3023
3104
  // src/NameListModal.tsx
3024
3105
  var import_react14 = require("react");
3025
3106
  var import_react_dom5 = require("react-dom");
3026
- var import_jsx_runtime28 = require("react/jsx-runtime");
3107
+ var import_jsx_runtime30 = require("react/jsx-runtime");
3027
3108
  function NameListModal({
3028
3109
  title,
3029
3110
  initialName,
@@ -3075,12 +3156,12 @@ function NameListModal({
3075
3156
  // bg-scrim, not a literal: design-tokens gained a scrim token in 2.5.0.
3076
3157
  // No in-data-[theme=dark] override needed any more -- the token redefines
3077
3158
  // itself under that attribute in dark.css, so one class covers both themes.
3078
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3159
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3079
3160
  "div",
3080
3161
  {
3081
3162
  className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim px-4",
3082
3163
  onMouseDown: (e) => e.target === e.currentTarget && onCancel(),
3083
- children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
3164
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
3084
3165
  "div",
3085
3166
  {
3086
3167
  ref: dialogRef,
@@ -3090,10 +3171,10 @@ function NameListModal({
3090
3171
  onKeyDown: trapTab,
3091
3172
  className: "w-full max-w-110 rounded-card border border-border-default bg-surface p-5 shadow-overlay",
3092
3173
  children: [
3093
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("h2", { id: titleId, className: "text-[16px] font-semibold text-text-primary", children: title }),
3094
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "mt-4 flex flex-col gap-1.5", children: [
3095
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("label", { htmlFor: fieldId, className: "text-[12px] font-medium text-text-secondary", children: fieldLabel }),
3096
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3174
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h2", { id: titleId, className: "text-[16px] font-semibold text-text-primary", children: title }),
3175
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "mt-4 flex flex-col gap-1.5", children: [
3176
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("label", { htmlFor: fieldId, className: "text-[12px] font-medium text-text-secondary", children: fieldLabel }),
3177
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3097
3178
  "input",
3098
3179
  {
3099
3180
  id: fieldId,
@@ -3105,13 +3186,13 @@ function NameListModal({
3105
3186
  }
3106
3187
  )
3107
3188
  ] }),
3108
- options && options.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "mt-4 flex flex-col gap-2.5", children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("label", { className: "flex cursor-pointer items-center gap-2.5 text-[13px] text-text-primary", children: [
3109
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CheckBox, { checked: !!checked[o.key], onChange: () => toggle(o.key), ariaLabel: o.label }),
3189
+ options && options.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "mt-4 flex flex-col gap-2.5", children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "flex cursor-pointer items-center gap-2.5 text-[13px] text-text-primary", children: [
3190
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CheckBox, { checked: !!checked[o.key], onChange: () => toggle(o.key), ariaLabel: o.label }),
3110
3191
  o.label
3111
3192
  ] }, o.key)) }),
3112
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "mt-5 flex items-center justify-end gap-2", children: [
3113
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button, { variant: "secondary", onClick: onCancel, children: "Cancel" }),
3114
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button, { disabled: !name.trim(), onClick: () => onSubmit(name.trim(), checked), children: submitLabel })
3193
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "mt-5 flex items-center justify-end gap-2", children: [
3194
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Button, { variant: "secondary", onClick: onCancel, children: "Cancel" }),
3195
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Button, { disabled: !name.trim(), onClick: () => onSubmit(name.trim(), checked), children: submitLabel })
3115
3196
  ] })
3116
3197
  ]
3117
3198
  }
@@ -3122,37 +3203,13 @@ function NameListModal({
3122
3203
  );
3123
3204
  }
3124
3205
 
3125
- // src/ChipTrigger.tsx
3126
- var import_jsx_runtime29 = require("react/jsx-runtime");
3127
- function chipTriggerClass(_variant = "box") {
3128
- return cn(
3129
- "flex h-11 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus"
3130
- // One stroke for every trigger: a `box` chip on the lighter default
3131
- // border sat beside SelectFilter's darker one in the same row and read as
3132
- // a different kind of control. The variant no longer changes anything.
3133
- );
3134
- }
3135
- function ChipContent({ caption, value, icon }) {
3136
- const stack = /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
3137
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-control-caption uppercase tracking-wide text-text-tertiary", children: caption }),
3138
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: value })
3139
- ] });
3140
- if (icon) {
3141
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "flex items-center gap-2", children: [
3142
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "shrink-0 text-text-tertiary", children: icon }),
3143
- stack
3144
- ] });
3145
- }
3146
- return stack;
3147
- }
3148
-
3149
3206
  // src/FilterChipBar.tsx
3150
3207
  var import_lucide_react17 = require("lucide-react");
3151
- var import_jsx_runtime30 = require("react/jsx-runtime");
3208
+ var import_jsx_runtime31 = require("react/jsx-runtime");
3152
3209
  function FilterChipBar({ chips, onRemove, onClearAll, parkedKeys }) {
3153
3210
  if (chips.length === 0) return null;
3154
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5 border-t border-border-default pt-2.5", children: [
3155
- chips.map((c) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3211
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5 border-t border-border-default pt-2.5", children: [
3212
+ chips.map((c) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3156
3213
  Chip,
3157
3214
  {
3158
3215
  label: c.label,
@@ -3162,7 +3219,7 @@ function FilterChipBar({ chips, onRemove, onClearAll, parkedKeys }) {
3162
3219
  },
3163
3220
  c.key
3164
3221
  )),
3165
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", onClick: onClearAll, className: "ml-1 text-[12px] font-medium text-text-link hover:underline", children: "Clear all" })
3222
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", onClick: onClearAll, className: "ml-1 text-[12px] font-medium text-text-link hover:underline", children: "Clear all" })
3166
3223
  ] });
3167
3224
  }
3168
3225
  function Chip({
@@ -3171,8 +3228,8 @@ function Chip({
3171
3228
  parked,
3172
3229
  onRemove
3173
3230
  }) {
3174
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { className: "group relative inline-flex", children: [
3175
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
3231
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: "group relative inline-flex", children: [
3232
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3176
3233
  "span",
3177
3234
  {
3178
3235
  className: cn(
@@ -3184,22 +3241,22 @@ function Chip({
3184
3241
  ) : "bg-subtle text-text-secondary ring-transparent group-hover:bg-border-default group-hover:text-text-primary group-hover:ring-border-interactive"
3185
3242
  ),
3186
3243
  children: [
3187
- parked && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react17.CircleSlash, { size: 11, "aria-hidden": "true", className: "shrink-0 text-text-tertiary" }),
3244
+ parked && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react17.CircleSlash, { size: 11, "aria-hidden": "true", className: "shrink-0 text-text-tertiary" }),
3188
3245
  label,
3189
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3246
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3190
3247
  "button",
3191
3248
  {
3192
3249
  type: "button",
3193
3250
  onClick: onRemove,
3194
3251
  "aria-label": `Remove ${groupLabel}: ${label}`,
3195
3252
  className: "text-text-tertiary transition-colors hover:text-text-primary",
3196
- children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react17.X, { size: 12 })
3253
+ children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react17.X, { size: 12 })
3197
3254
  }
3198
3255
  )
3199
3256
  ]
3200
3257
  }
3201
3258
  ),
3202
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3259
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3203
3260
  "span",
3204
3261
  {
3205
3262
  role: "tooltip",
@@ -3212,7 +3269,7 @@ function Chip({
3212
3269
 
3213
3270
  // src/SortButton.tsx
3214
3271
  var import_lucide_react18 = require("lucide-react");
3215
- var import_jsx_runtime31 = require("react/jsx-runtime");
3272
+ var import_jsx_runtime32 = require("react/jsx-runtime");
3216
3273
  var ALIGN = {
3217
3274
  left: "justify-start text-left",
3218
3275
  center: "justify-center text-center",
@@ -3228,9 +3285,9 @@ function SortButton({
3228
3285
  align = "left",
3229
3286
  testIdPrefix
3230
3287
  }) {
3231
- if (!sortable) return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: cn("inline-flex", ALIGN[align]), children: label });
3288
+ if (!sortable) return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: cn("inline-flex", ALIGN[align]), children: label });
3232
3289
  const active = !disabled && sort.key === sortKey;
3233
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3290
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
3234
3291
  "button",
3235
3292
  {
3236
3293
  type: "button",
@@ -3259,7 +3316,7 @@ function SortButton({
3259
3316
  ),
3260
3317
  children: [
3261
3318
  label,
3262
- !disabled && (active ? sort.dir === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react18.ArrowUp, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react18.ArrowDown, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3319
+ !disabled && (active ? sort.dir === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react18.ArrowUp, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react18.ArrowDown, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3263
3320
  import_lucide_react18.ArrowUpDown,
3264
3321
  {
3265
3322
  size: 12,
@@ -3288,7 +3345,7 @@ function ariaSortFor(sort, key) {
3288
3345
 
3289
3346
  // src/Pager.tsx
3290
3347
  var import_lucide_react19 = require("lucide-react");
3291
- var import_jsx_runtime32 = require("react/jsx-runtime");
3348
+ var import_jsx_runtime33 = require("react/jsx-runtime");
3292
3349
  function pageWindow(current, total) {
3293
3350
  if (total <= 7) return Array.from({ length: total }, (_, i) => i + 1);
3294
3351
  const keep = /* @__PURE__ */ new Set([1, total, current, current - 1, current + 1]);
@@ -3304,8 +3361,8 @@ function pageWindow(current, total) {
3304
3361
  }
3305
3362
  function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination" }) {
3306
3363
  const btn = "flex h-8 min-w-8 items-center justify-center rounded-control px-2 text-[13px] transition-colors disabled:pointer-events-none disabled:opacity-30";
3307
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("nav", { "aria-label": label, className: "flex items-center gap-1", children: [
3308
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3364
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("nav", { "aria-label": label, className: "flex items-center gap-1", children: [
3365
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3309
3366
  "button",
3310
3367
  {
3311
3368
  type: "button",
@@ -3313,11 +3370,11 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
3313
3370
  disabled: disabled || page === 1,
3314
3371
  "aria-label": "Previous page",
3315
3372
  className: cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary"),
3316
- children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react19.ChevronLeft, { size: 16 })
3373
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react19.ChevronLeft, { size: 16 })
3317
3374
  }
3318
3375
  ),
3319
3376
  pageWindow(page, totalPages).map(
3320
- (p) => typeof p === "string" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "px-1 text-[13px] text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3377
+ (p) => typeof p === "string" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "px-1 text-[13px] text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3321
3378
  "button",
3322
3379
  {
3323
3380
  type: "button",
@@ -3326,14 +3383,14 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
3326
3383
  "aria-current": p === page ? "page" : void 0,
3327
3384
  className: cn(
3328
3385
  btn,
3329
- p === page ? "bg-brand-primaryAction font-semibold text-brand-onprimary" : "text-text-secondary hover:bg-subtle hover:text-text-primary"
3386
+ p === page ? "bg-subtle font-semibold text-text-primary" : "text-text-secondary hover:bg-subtle hover:text-text-primary"
3330
3387
  ),
3331
3388
  children: p.toLocaleString()
3332
3389
  },
3333
3390
  p
3334
3391
  )
3335
3392
  ),
3336
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3393
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3337
3394
  "button",
3338
3395
  {
3339
3396
  type: "button",
@@ -3341,14 +3398,14 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
3341
3398
  disabled: disabled || page === totalPages,
3342
3399
  "aria-label": "Next page",
3343
3400
  className: cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary"),
3344
- children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react19.ChevronRight, { size: 16 })
3401
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react19.ChevronRight, { size: 16 })
3345
3402
  }
3346
3403
  )
3347
3404
  ] });
3348
3405
  }
3349
3406
 
3350
3407
  // src/WorkspaceAvatar.tsx
3351
- var import_jsx_runtime33 = require("react/jsx-runtime");
3408
+ var import_jsx_runtime34 = require("react/jsx-runtime");
3352
3409
  function workspaceInitials(name) {
3353
3410
  const words = name.trim().split(/\s+/).filter(Boolean);
3354
3411
  if (words.length === 0) return "\xB7";
@@ -3366,7 +3423,7 @@ var SIZES = {
3366
3423
  lg: "h-11 w-11 text-panel-title"
3367
3424
  };
3368
3425
  function WorkspaceAvatar({ name, size = "md" }) {
3369
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3426
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3370
3427
  "span",
3371
3428
  {
3372
3429
  "aria-hidden": "true",
@@ -3383,11 +3440,11 @@ function WorkspaceAvatar({ name, size = "md" }) {
3383
3440
  var import_react15 = require("react");
3384
3441
  var import_react_dom6 = require("react-dom");
3385
3442
  var import_lucide_react20 = require("lucide-react");
3386
- var import_jsx_runtime34 = require("react/jsx-runtime");
3443
+ var import_jsx_runtime35 = require("react/jsx-runtime");
3387
3444
  var ICON = {
3388
3445
  neutral: null,
3389
- success: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react20.Check, { size: 15, className: "shrink-0", "aria-hidden": "true" }),
3390
- warning: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react20.AlertTriangle, { size: 15, className: "shrink-0", "aria-hidden": "true" })
3446
+ success: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react20.Check, { size: 15, className: "shrink-0", "aria-hidden": "true" }),
3447
+ warning: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react20.AlertTriangle, { size: 15, className: "shrink-0", "aria-hidden": "true" })
3391
3448
  };
3392
3449
  function Toast({ message, action, onClose, tone = "neutral", duration, className }) {
3393
3450
  const ms = duration ?? (action ? 1e4 : 5e3);
@@ -3403,7 +3460,7 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
3403
3460
  return () => window.clearTimeout(t);
3404
3461
  }, [message, ms, paused]);
3405
3462
  return (0, import_react_dom6.createPortal)(
3406
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
3463
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
3407
3464
  "div",
3408
3465
  {
3409
3466
  role: "status",
@@ -3420,7 +3477,7 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
3420
3477
  children: [
3421
3478
  ICON[tone] && // The inverse pair, not text-success / text-warning: those are tuned
3422
3479
  // for the page, and on the toast's flipped surface amber drops to 2:1.
3423
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3480
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3424
3481
  "span",
3425
3482
  {
3426
3483
  className: cn(
@@ -3430,8 +3487,8 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
3430
3487
  children: ICON[tone]
3431
3488
  }
3432
3489
  ),
3433
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "min-w-0", children: message }),
3434
- action && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3490
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "min-w-0", children: message }),
3491
+ action && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3435
3492
  "button",
3436
3493
  {
3437
3494
  type: "button",
@@ -3453,29 +3510,14 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
3453
3510
  }
3454
3511
 
3455
3512
  // src/Tag.tsx
3456
- var import_jsx_runtime35 = require("react/jsx-runtime");
3513
+ var import_jsx_runtime36 = require("react/jsx-runtime");
3457
3514
  function Tag({ children, className }) {
3458
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3459
- "span",
3460
- {
3461
- className: cn(
3462
- // text-micro and tertiary ink. The component used to sit at 11px in
3463
- // secondary -- a step darker than the ten hand-rolled copies the audit
3464
- // found, which had independently drifted to tertiary. Ten people
3465
- // reaching for "quieter" is worth more than the component's original
3466
- // guess: a tag names what a row IS, which is background to the row
3467
- // itself rather than part of it.
3468
- "inline-flex items-center whitespace-nowrap rounded-full bg-subtle px-2 py-0.5 text-micro font-medium text-text-tertiary",
3469
- className
3470
- ),
3471
- children
3472
- }
3473
- );
3515
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Badge, { kind: "category", className, children });
3474
3516
  }
3475
3517
 
3476
3518
  // src/TablePagination.tsx
3477
3519
  var import_lucide_react21 = require("lucide-react");
3478
- var import_jsx_runtime36 = require("react/jsx-runtime");
3520
+ var import_jsx_runtime37 = require("react/jsx-runtime");
3479
3521
  function TablePagination({
3480
3522
  page,
3481
3523
  perPage,
@@ -3495,7 +3537,7 @@ function TablePagination({
3495
3537
  const btn = "flex h-8 min-w-8 items-center justify-center rounded-control px-2 text-[13px] transition-colors";
3496
3538
  const off = "disabled:pointer-events-none disabled:opacity-30";
3497
3539
  const stepBtn = cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary", off);
3498
- const range = /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "text-[13px] text-text-tertiary tabular-nums", children: [
3540
+ const range = /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "text-[13px] text-text-tertiary tabular-nums", children: [
3499
3541
  rangeStart.toLocaleString(),
3500
3542
  " \u2013 ",
3501
3543
  rangeEnd.toLocaleString(),
@@ -3504,37 +3546,30 @@ function TablePagination({
3504
3546
  " ",
3505
3547
  itemLabel
3506
3548
  ] });
3507
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: cn("flex flex-wrap items-center justify-between gap-x-4 gap-y-2", className), "data-testid": testIdPrefix, children: [
3508
- onPerPageChange ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("label", { className: "flex items-center gap-2 text-[13px] text-text-secondary", children: [
3509
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "relative", children: [
3510
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3511
- "select",
3512
- {
3513
- value: perPage,
3514
- onChange: (e) => onPerPageChange(Number(e.target.value)),
3515
- disabled,
3516
- "aria-label": "Items per page",
3517
- "data-testid": testIdPrefix && `${testIdPrefix}-per-page`,
3518
- className: cn(
3519
- "appearance-none rounded-control border border-border-strong bg-input py-1 pl-2.5 pr-7 text-[13px] font-medium text-text-primary focus:outline focus:outline-2 focus:outline-border-focus",
3520
- off
3521
- ),
3522
- children: perPageOptions.map((n) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("option", { value: n, children: n }, n))
3523
- }
3524
- ),
3525
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3526
- import_lucide_react21.ChevronDown,
3527
- {
3528
- size: 13,
3529
- "aria-hidden": "true",
3530
- className: "pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-text-secondary"
3531
- }
3532
- )
3533
- ] }),
3534
- "items per page"
3535
- ] }) : range,
3536
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("nav", { className: "flex items-center gap-1", "aria-label": "Pagination", children: [
3537
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3549
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: cn("flex flex-wrap items-center justify-between gap-x-4 gap-y-2", className), "data-testid": testIdPrefix, children: [
3550
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
3551
+ "div",
3552
+ {
3553
+ className: cn("flex items-center gap-2 text-[13px] text-text-secondary", !onPerPageChange && "invisible"),
3554
+ children: [
3555
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3556
+ SelectFilter,
3557
+ {
3558
+ size: "sm",
3559
+ caption: "Items per page",
3560
+ value: String(perPage),
3561
+ options: perPageOptions.map(String),
3562
+ onChange: (v) => onPerPageChange?.(Number(v)),
3563
+ disabled,
3564
+ testIdPrefix: testIdPrefix && `${testIdPrefix}-per-page`
3565
+ }
3566
+ ),
3567
+ "items per page"
3568
+ ]
3569
+ }
3570
+ ),
3571
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("nav", { className: "flex items-center gap-1", "aria-label": "Pagination", children: [
3572
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3538
3573
  "button",
3539
3574
  {
3540
3575
  type: "button",
@@ -3543,10 +3578,10 @@ function TablePagination({
3543
3578
  "aria-label": "First page",
3544
3579
  "data-testid": testIdPrefix && `${testIdPrefix}-first`,
3545
3580
  className: stepBtn,
3546
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react21.ChevronFirst, { size: 16, "aria-hidden": "true" })
3581
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react21.ChevronFirst, { size: 16, "aria-hidden": "true" })
3547
3582
  }
3548
3583
  ),
3549
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3584
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3550
3585
  "button",
3551
3586
  {
3552
3587
  type: "button",
@@ -3555,11 +3590,11 @@ function TablePagination({
3555
3590
  "aria-label": "Previous page",
3556
3591
  "data-testid": testIdPrefix && `${testIdPrefix}-prev`,
3557
3592
  className: stepBtn,
3558
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react21.ChevronLeft, { size: 16, "aria-hidden": "true" })
3593
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react21.ChevronLeft, { size: 16, "aria-hidden": "true" })
3559
3594
  }
3560
3595
  ),
3561
3596
  pageWindow(current, totalPages).map(
3562
- (p) => typeof p === "string" ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "px-1 text-[13px] text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3597
+ (p) => typeof p === "string" ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "px-1 text-[13px] text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3563
3598
  "button",
3564
3599
  {
3565
3600
  type: "button",
@@ -3570,14 +3605,14 @@ function TablePagination({
3570
3605
  className: cn(
3571
3606
  btn,
3572
3607
  off,
3573
- p === current ? "bg-brand-primaryAction font-semibold text-brand-onprimary" : "text-text-secondary hover:bg-subtle hover:text-text-primary"
3608
+ p === current ? "bg-subtle font-semibold text-text-primary" : "text-text-secondary hover:bg-subtle hover:text-text-primary"
3574
3609
  ),
3575
3610
  children: p.toLocaleString()
3576
3611
  },
3577
3612
  p
3578
3613
  )
3579
3614
  ),
3580
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3615
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3581
3616
  "button",
3582
3617
  {
3583
3618
  type: "button",
@@ -3586,10 +3621,10 @@ function TablePagination({
3586
3621
  "aria-label": "Next page",
3587
3622
  "data-testid": testIdPrefix && `${testIdPrefix}-next`,
3588
3623
  className: stepBtn,
3589
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react21.ChevronRight, { size: 16, "aria-hidden": "true" })
3624
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react21.ChevronRight, { size: 16, "aria-hidden": "true" })
3590
3625
  }
3591
3626
  ),
3592
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3627
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3593
3628
  "button",
3594
3629
  {
3595
3630
  type: "button",
@@ -3598,18 +3633,18 @@ function TablePagination({
3598
3633
  "aria-label": "Last page",
3599
3634
  "data-testid": testIdPrefix && `${testIdPrefix}-last`,
3600
3635
  className: stepBtn,
3601
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react21.ChevronLast, { size: 16, "aria-hidden": "true" })
3636
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react21.ChevronLast, { size: 16, "aria-hidden": "true" })
3602
3637
  }
3603
3638
  )
3604
3639
  ] }),
3605
- onPerPageChange && range
3640
+ range
3606
3641
  ] });
3607
3642
  }
3608
3643
 
3609
3644
  // src/DateRangePicker.tsx
3610
3645
  var import_react16 = require("react");
3611
3646
  var import_lucide_react22 = require("lucide-react");
3612
- var import_jsx_runtime37 = require("react/jsx-runtime");
3647
+ var import_jsx_runtime38 = require("react/jsx-runtime");
3613
3648
  var MONTH_ABBR = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
3614
3649
  var QUARTER_ABBR = ["Q1", "Q2", "Q3", "Q4"];
3615
3650
  var PRESETS = ["Rolling 3 months", "Rolling 6 months", "Rolling 12 months"];
@@ -3645,7 +3680,7 @@ function spanLabel(label, today) {
3645
3680
  return `${fmtDate(s)} \u2013 ${fmtDate(e)}`;
3646
3681
  }
3647
3682
  function MiniSelect({ value, onChange, options }) {
3648
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3683
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3649
3684
  "select",
3650
3685
  {
3651
3686
  value: String(value),
@@ -3654,7 +3689,7 @@ function MiniSelect({ value, onChange, options }) {
3654
3689
  if (opt) onChange(opt.value);
3655
3690
  },
3656
3691
  className: "rounded-control border border-border-strong bg-input px-1.5 py-1 text-[12px] text-text-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
3657
- children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("option", { value: String(o.value), children: o.label }, String(o.value)))
3692
+ children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("option", { value: String(o.value), children: o.label }, String(o.value)))
3658
3693
  }
3659
3694
  );
3660
3695
  }
@@ -3715,8 +3750,8 @@ function DateRangePicker({
3715
3750
  if (showFooter) setDraft(label);
3716
3751
  else commit(label);
3717
3752
  };
3718
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "relative", ref, children: [
3719
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
3753
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "relative", ref, children: [
3754
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
3720
3755
  "button",
3721
3756
  {
3722
3757
  type: "button",
@@ -3725,16 +3760,16 @@ function DateRangePicker({
3725
3760
  "aria-haspopup": "listbox",
3726
3761
  className: chipTriggerClass(),
3727
3762
  children: [
3728
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
3729
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "text-control-caption text-text-tertiary", children: spanLabel(value, end) }),
3730
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: value })
3763
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
3764
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "text-control-caption text-text-tertiary", children: spanLabel(value, end) }),
3765
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: value })
3731
3766
  ] }),
3732
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react22.ChevronDown, { size: 14, "aria-hidden": "true", className: cn("shrink-0 text-text-secondary transition-transform", open && "rotate-180") })
3767
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react22.ChevronDown, { size: 14, "aria-hidden": "true", className: cn("shrink-0 text-text-secondary transition-transform", open && "rotate-180") })
3733
3768
  ]
3734
3769
  }
3735
3770
  ),
3736
- open && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: cn("absolute top-[calc(100%+8px)] z-30 w-[280px] overflow-hidden rounded-card border border-border-default bg-surface py-1 shadow-overlay", align === "right" ? "right-0" : "left-0"), children: [
3737
- presets.map((p) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3771
+ open && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: cn("absolute top-[calc(100%+8px)] z-30 w-[280px] overflow-hidden rounded-card border border-border-default bg-surface py-1 shadow-overlay", align === "right" ? "right-0" : "left-0"), children: [
3772
+ presets.map((p) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3738
3773
  "button",
3739
3774
  {
3740
3775
  type: "button",
@@ -3744,26 +3779,26 @@ function DateRangePicker({
3744
3779
  },
3745
3780
  p
3746
3781
  )),
3747
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "mt-1 border-t border-border-default px-3 pb-2 pt-2", children: [
3748
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "text-[13px] font-semibold text-text-primary", children: "Custom range" }),
3749
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "mt-2 flex flex-col gap-2", children: [
3750
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("label", { className: "flex items-center justify-between gap-2 text-[12px] text-text-secondary", children: [
3782
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "mt-1 border-t border-border-default px-3 pb-2 pt-2", children: [
3783
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "text-[13px] font-semibold text-text-primary", children: "Custom range" }),
3784
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "mt-2 flex flex-col gap-2", children: [
3785
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("label", { className: "flex items-center justify-between gap-2 text-[12px] text-text-secondary", children: [
3751
3786
  "From",
3752
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "flex gap-1", children: [
3753
- granularity === "month" && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MiniSelect, { value: fromMo, onChange: setFromMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
3754
- granularity === "quarter" && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MiniSelect, { value: fromQ, onChange: setFromQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
3755
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MiniSelect, { value: fromYr, onChange: setFromYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
3787
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "flex gap-1", children: [
3788
+ granularity === "month" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MiniSelect, { value: fromMo, onChange: setFromMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
3789
+ granularity === "quarter" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MiniSelect, { value: fromQ, onChange: setFromQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
3790
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MiniSelect, { value: fromYr, onChange: setFromYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
3756
3791
  ] })
3757
3792
  ] }),
3758
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("label", { className: "flex items-center justify-between gap-2 text-[12px] text-text-secondary", children: [
3793
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("label", { className: "flex items-center justify-between gap-2 text-[12px] text-text-secondary", children: [
3759
3794
  "To",
3760
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "flex gap-1", children: [
3761
- granularity === "month" && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MiniSelect, { value: toMo, onChange: setToMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
3762
- granularity === "quarter" && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MiniSelect, { value: toQ, onChange: setToQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
3763
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MiniSelect, { value: toYr, onChange: setToYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
3795
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "flex gap-1", children: [
3796
+ granularity === "month" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MiniSelect, { value: toMo, onChange: setToMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
3797
+ granularity === "quarter" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MiniSelect, { value: toQ, onChange: setToQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
3798
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MiniSelect, { value: toYr, onChange: setToYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
3764
3799
  ] })
3765
3800
  ] }),
3766
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3801
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3767
3802
  "button",
3768
3803
  {
3769
3804
  type: "button",
@@ -3775,7 +3810,7 @@ function DateRangePicker({
3775
3810
  )
3776
3811
  ] })
3777
3812
  ] }),
3778
- showFooter && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(FilterDropdownFooter, { onApply: () => commit(draft) })
3813
+ showFooter && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FilterDropdownFooter, { onApply: () => commit(draft) })
3779
3814
  ] })
3780
3815
  ] });
3781
3816
  }
@@ -3783,7 +3818,7 @@ function DateRangePicker({
3783
3818
  // src/MultiSelectFilter.tsx
3784
3819
  var import_react17 = require("react");
3785
3820
  var import_lucide_react23 = require("lucide-react");
3786
- var import_jsx_runtime38 = require("react/jsx-runtime");
3821
+ var import_jsx_runtime39 = require("react/jsx-runtime");
3787
3822
  function MultiSelectFilter({
3788
3823
  caption,
3789
3824
  options = [],
@@ -3803,7 +3838,10 @@ function MultiSelectFilter({
3803
3838
  clearValue = [],
3804
3839
  menuWidthClass = "w-60",
3805
3840
  plainParent = false,
3806
- fullWidth = false
3841
+ fullWidth = false,
3842
+ loading = false,
3843
+ error = false,
3844
+ onRetry
3807
3845
  }) {
3808
3846
  const groupLeaves = (g) => g.children.length ? g.children : [{ id: g.id, label: g.label }];
3809
3847
  const leafOptions = groups ? groups.flatMap(groupLeaves) : options;
@@ -3874,8 +3912,8 @@ function MultiSelectFilter({
3874
3912
  const kids = live.filter((c) => c.label.toLowerCase().includes(ql));
3875
3913
  return kids.length ? { ...g, children: kids } : null;
3876
3914
  }).filter((g) => g !== null) : [];
3877
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: cn("relative", fullWidth && "w-full"), ref, children: [
3878
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
3915
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: cn("relative", fullWidth && "w-full"), ref, children: [
3916
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
3879
3917
  "button",
3880
3918
  {
3881
3919
  type: "button",
@@ -3883,8 +3921,8 @@ function MultiSelectFilter({
3883
3921
  "aria-expanded": open,
3884
3922
  className: cn(chipTriggerClass(variant), fullWidth && "w-full justify-between"),
3885
3923
  children: [
3886
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ChipContent, { caption, value, icon }),
3887
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3924
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ChipContent, { caption, value, icon }),
3925
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
3888
3926
  import_lucide_react23.ChevronDown,
3889
3927
  {
3890
3928
  size: 14,
@@ -3895,7 +3933,7 @@ function MultiSelectFilter({
3895
3933
  ]
3896
3934
  }
3897
3935
  ),
3898
- open && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
3936
+ open && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
3899
3937
  "div",
3900
3938
  {
3901
3939
  className: cn(
@@ -3905,10 +3943,10 @@ function MultiSelectFilter({
3905
3943
  ),
3906
3944
  role: "dialog",
3907
3945
  "aria-label": caption,
3908
- children: [
3909
- searchable && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex h-8 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus", children: [
3910
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react23.Search, { size: 14, className: "text-text-secondary", "aria-hidden": "true" }),
3911
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3946
+ children: loading ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MenuLoading, {}) : error ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MenuError, { onRetry }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
3947
+ searchable && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex h-8 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus", children: [
3948
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react23.Search, { size: 14, className: "text-text-secondary", "aria-hidden": "true" }),
3949
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
3912
3950
  "input",
3913
3951
  {
3914
3952
  type: "text",
@@ -3918,37 +3956,37 @@ function MultiSelectFilter({
3918
3956
  className: "h-full flex-1 bg-transparent text-[13px] outline-hidden placeholder:text-text-tertiary"
3919
3957
  }
3920
3958
  ),
3921
- q && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { type: "button", onClick: () => setQ(""), "aria-label": "Clear search", className: "text-text-tertiary hover:text-text-primary", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react23.X, { size: 13 }) })
3959
+ q && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("button", { type: "button", onClick: () => setQ(""), "aria-label": "Clear search", className: "text-text-tertiary hover:text-text-primary", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react23.X, { size: 13 }) })
3922
3960
  ] }) }),
3923
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "max-h-[280px] overflow-y-auto p-1", children: [
3961
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "max-h-[280px] overflow-y-auto p-1", children: [
3924
3962
  groups ? visibleGroups.map((g) => {
3925
3963
  const state = groupState(g);
3926
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { children: [
3927
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
3964
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { children: [
3965
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
3928
3966
  "button",
3929
3967
  {
3930
3968
  type: "button",
3931
3969
  onClick: () => toggleGroup(g),
3932
3970
  className: "flex w-full items-center gap-2.5 rounded-control px-2 py-2 text-left transition-colors hover:bg-subtle",
3933
3971
  children: [
3934
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TriCheck, { state }),
3935
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: cn("flex-1 text-[14px] text-text-primary", !plainParent && "font-semibold"), children: g.label }),
3936
- counts && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(OptionCount, { n: countFor(g.id) })
3972
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TriCheck, { state }),
3973
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: cn("flex-1 text-[14px] text-text-primary", !plainParent && "font-semibold"), children: g.label }),
3974
+ counts && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(OptionCount, { n: countFor(g.id) })
3937
3975
  ]
3938
3976
  }
3939
3977
  ),
3940
3978
  g.children.map((c) => {
3941
3979
  const checked = draft.includes(c.id);
3942
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
3980
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
3943
3981
  "button",
3944
3982
  {
3945
3983
  type: "button",
3946
3984
  onClick: () => toggle(c.id),
3947
3985
  className: "flex w-full items-center gap-2.5 rounded-control py-2 pl-9 pr-2 text-left transition-colors hover:bg-subtle",
3948
3986
  children: [
3949
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TriCheck, { state: checked ? "all" : "none" }),
3950
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "flex-1 text-[14px] text-text-primary", children: c.label }),
3951
- counts && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(OptionCount, { n: countFor(c.id) })
3987
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TriCheck, { state: checked ? "all" : "none" }),
3988
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "flex-1 text-[14px] text-text-primary", children: c.label }),
3989
+ counts && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(OptionCount, { n: countFor(c.id) })
3952
3990
  ]
3953
3991
  },
3954
3992
  c.id
@@ -3957,33 +3995,33 @@ function MultiSelectFilter({
3957
3995
  ] }, g.id);
3958
3996
  }) : items.map((o) => {
3959
3997
  const checked = draft.includes(o.id);
3960
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
3998
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
3961
3999
  "button",
3962
4000
  {
3963
4001
  type: "button",
3964
4002
  onClick: () => toggle(o.id),
3965
4003
  className: "flex w-full items-center gap-2.5 rounded-control px-2 py-2 text-left transition-colors hover:bg-subtle",
3966
4004
  children: [
3967
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
4005
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
3968
4006
  "span",
3969
4007
  {
3970
4008
  className: cn(
3971
4009
  "flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-[5px] border transition-colors",
3972
4010
  checked ? "border-transparent bg-brand-primaryAction text-brand-onprimary" : "border-border-interactive bg-input"
3973
4011
  ),
3974
- children: checked && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react23.Check, { size: 13, strokeWidth: 3 })
4012
+ children: checked && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react23.Check, { size: 13, strokeWidth: 3 })
3975
4013
  }
3976
4014
  ),
3977
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "flex-1 text-[14px] text-text-primary", children: o.label }),
3978
- counts && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(OptionCount, { n: countFor(o.id) })
4015
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "flex-1 text-[14px] text-text-primary", children: o.label }),
4016
+ counts && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(OptionCount, { n: countFor(o.id) })
3979
4017
  ]
3980
4018
  },
3981
4019
  o.id
3982
4020
  );
3983
4021
  }),
3984
- (groups && !visibleGroups.length || !groups && !items.length) && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "py-6 text-center text-[13px] text-text-tertiary", children: "No matches." })
4022
+ (groups && !visibleGroups.length || !groups && !items.length) && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "py-6 text-center text-[13px] text-text-tertiary", children: "No matches." })
3985
4023
  ] }),
3986
- showFooter ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FilterDropdownFooter, { onClear: () => setDraft(clearValue), onApply: apply }) : min === 0 && draft.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "border-t border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
4024
+ showFooter ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(FilterDropdownFooter, { onClear: () => setDraft(clearValue), onApply: apply }) : min === 0 && draft.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "border-t border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
3987
4025
  "button",
3988
4026
  {
3989
4027
  type: "button",
@@ -3995,14 +4033,14 @@ function MultiSelectFilter({
3995
4033
  ]
3996
4034
  }
3997
4035
  ) })
3998
- ]
4036
+ ] })
3999
4037
  }
4000
4038
  )
4001
4039
  ] });
4002
4040
  }
4003
4041
  function TriCheck({ state }) {
4004
4042
  const filled = state !== "none";
4005
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
4043
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
4006
4044
  "span",
4007
4045
  {
4008
4046
  className: cn(
@@ -4010,14 +4048,14 @@ function TriCheck({ state }) {
4010
4048
  filled ? "border-transparent bg-brand-primaryAction text-brand-onprimary" : "border-border-interactive bg-input"
4011
4049
  ),
4012
4050
  children: [
4013
- state === "all" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react23.Check, { size: 13, strokeWidth: 3 }),
4014
- state === "some" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react23.Minus, { size: 13, strokeWidth: 3 })
4051
+ state === "all" && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react23.Check, { size: 13, strokeWidth: 3 }),
4052
+ state === "some" && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react23.Minus, { size: 13, strokeWidth: 3 })
4015
4053
  ]
4016
4054
  }
4017
4055
  );
4018
4056
  }
4019
4057
  function OptionCount({ n }) {
4020
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "shrink-0 text-[12px] tabular-nums text-text-tertiary", children: [
4058
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { className: "shrink-0 text-[12px] tabular-nums text-text-tertiary", children: [
4021
4059
  "(",
4022
4060
  n.toLocaleString(),
4023
4061
  ")"
@@ -4025,7 +4063,7 @@ function OptionCount({ n }) {
4025
4063
  }
4026
4064
 
4027
4065
  // src/Toggle.tsx
4028
- var import_jsx_runtime39 = require("react/jsx-runtime");
4066
+ var import_jsx_runtime40 = require("react/jsx-runtime");
4029
4067
  var SIZES2 = {
4030
4068
  sm: { track: "h-5 w-9", knob: "h-4 w-4", on: "translate-x-[18px]" },
4031
4069
  md: { track: "h-6 w-11", knob: "h-5 w-5", on: "translate-x-[22px]" }
@@ -4033,7 +4071,7 @@ var SIZES2 = {
4033
4071
  var OFF_TRACK = "color-mix(in srgb, var(--mr-color-border-interactive) 70%, var(--mr-color-text-secondary))";
4034
4072
  function Toggle({ checked, onChange, label, size = "md", disabled, className, testIdPrefix }) {
4035
4073
  const s = SIZES2[size];
4036
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4074
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4037
4075
  "button",
4038
4076
  {
4039
4077
  type: "button",
@@ -4051,7 +4089,7 @@ function Toggle({ checked, onChange, label, size = "md", disabled, className, te
4051
4089
  disabled && "cursor-not-allowed opacity-50",
4052
4090
  className
4053
4091
  ),
4054
- children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4092
+ children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4055
4093
  "span",
4056
4094
  {
4057
4095
  className: cn(
@@ -4068,20 +4106,20 @@ function Toggle({ checked, onChange, label, size = "md", disabled, className, te
4068
4106
  // src/AISpark.tsx
4069
4107
  var import_react18 = require("react");
4070
4108
  var import_lucide_react24 = require("lucide-react");
4071
- var import_jsx_runtime40 = require("react/jsx-runtime");
4109
+ var import_jsx_runtime41 = require("react/jsx-runtime");
4072
4110
  function AISpark({ size = 16, className }) {
4073
4111
  const id = (0, import_react18.useId)();
4074
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
4075
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("svg", { width: "0", height: "0", "aria-hidden": "true", style: { position: "absolute" }, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("linearGradient", { id, x1: "0", y1: "0", x2: "1", y2: "1", children: [
4076
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("stop", { offset: "0%", stopColor: "var(--mr-color-brand-primary)" }),
4077
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("stop", { offset: "100%", className: "[stop-color:#9474ff] in-data-[theme=dark]:[stop-color:#a488ff]" })
4112
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
4113
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("svg", { width: "0", height: "0", "aria-hidden": "true", style: { position: "absolute" }, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("linearGradient", { id, x1: "0", y1: "0", x2: "1", y2: "1", children: [
4114
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("stop", { offset: "0%", stopColor: "var(--mr-color-brand-primary)" }),
4115
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("stop", { offset: "100%", className: "[stop-color:#9474ff] in-data-[theme=dark]:[stop-color:#a488ff]" })
4078
4116
  ] }) }) }),
4079
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react24.Sparkles, { size, stroke: `url(#${id})`, className, "aria-hidden": "true" })
4117
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react24.Sparkles, { size, stroke: `url(#${id})`, className, "aria-hidden": "true" })
4080
4118
  ] });
4081
4119
  }
4082
4120
 
4083
4121
  // src/Freshness.tsx
4084
- var import_jsx_runtime41 = require("react/jsx-runtime");
4122
+ var import_jsx_runtime42 = require("react/jsx-runtime");
4085
4123
  var dotColor = {
4086
4124
  fresh: "bg-status-success",
4087
4125
  recent: "bg-status-warning",
@@ -4093,7 +4131,7 @@ var srLabel = {
4093
4131
  stale: "Older than a day"
4094
4132
  };
4095
4133
  function Freshness({ level }) {
4096
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
4134
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
4097
4135
  "span",
4098
4136
  {
4099
4137
  className: cn("inline-block h-1.5 w-1.5 shrink-0 rounded-full", dotColor[level]),
@@ -4104,39 +4142,39 @@ function Freshness({ level }) {
4104
4142
  }
4105
4143
 
4106
4144
  // src/SectionHeading.tsx
4107
- var import_jsx_runtime42 = require("react/jsx-runtime");
4145
+ var import_jsx_runtime43 = require("react/jsx-runtime");
4108
4146
  function SectionHeading({ title, description, actions, as: Tag2 = "h2", id, className }) {
4109
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: cn("flex flex-wrap items-end justify-between gap-x-4 gap-y-2", className), children: [
4110
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "min-w-0", children: [
4111
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Tag2, { id, className: "text-base font-semibold text-text-primary", children: title }),
4112
- description && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "mt-0.5 text-dense text-text-secondary", children: description })
4147
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: cn("flex flex-wrap items-end justify-between gap-x-4 gap-y-2", className), children: [
4148
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "min-w-0", children: [
4149
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Tag2, { id, className: "text-base font-semibold text-text-primary", children: title }),
4150
+ description && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "mt-0.5 text-dense text-text-secondary", children: description })
4113
4151
  ] }),
4114
- actions && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions })
4152
+ actions && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions })
4115
4153
  ] });
4116
4154
  }
4117
4155
 
4118
4156
  // src/PageHeader.tsx
4119
4157
  var import_lucide_react25 = require("lucide-react");
4120
- var import_jsx_runtime43 = require("react/jsx-runtime");
4158
+ var import_jsx_runtime44 = require("react/jsx-runtime");
4121
4159
  function PageHeader({ title, description, actions, back, className }) {
4122
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("header", { className: cn("flex flex-wrap items-center justify-between gap-x-6 gap-y-3", className), children: [
4123
- /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "min-w-0", children: [
4124
- back && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
4160
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("header", { className: cn("flex flex-wrap items-center justify-between gap-x-6 gap-y-3", className), children: [
4161
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "min-w-0", children: [
4162
+ back && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
4125
4163
  "a",
4126
4164
  {
4127
4165
  href: back.href ?? "#",
4128
4166
  onClick: back.onClick,
4129
4167
  className: "mb-1.5 inline-flex items-center gap-1.5 rounded-control text-micro font-semibold uppercase tracking-wider text-text-tertiary hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
4130
4168
  children: [
4131
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react25.ArrowLeft, { size: 13, "aria-hidden": "true" }),
4169
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react25.ArrowLeft, { size: 13, "aria-hidden": "true" }),
4132
4170
  back.label
4133
4171
  ]
4134
4172
  }
4135
4173
  ),
4136
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("h1", { className: "text-xl font-semibold tracking-tight text-text-primary", children: title }),
4137
- description && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "mt-0.5 max-w-2xl text-sm text-text-secondary", children: description })
4174
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("h1", { className: "text-xl font-semibold tracking-tight text-text-primary", children: title }),
4175
+ description && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "mt-0.5 max-w-2xl text-sm text-text-secondary", children: description })
4138
4176
  ] }),
4139
- actions && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions })
4177
+ actions && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions })
4140
4178
  ] });
4141
4179
  }
4142
4180
 
@@ -4144,7 +4182,7 @@ function PageHeader({ title, description, actions, back, className }) {
4144
4182
  var import_react19 = require("react");
4145
4183
  var import_react_dom7 = require("react-dom");
4146
4184
  var import_lucide_react26 = require("lucide-react");
4147
- var import_jsx_runtime44 = require("react/jsx-runtime");
4185
+ var import_jsx_runtime45 = require("react/jsx-runtime");
4148
4186
  var WIDTH = {
4149
4187
  sm: "max-w-110",
4150
4188
  md: "max-w-160",
@@ -4194,12 +4232,12 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
4194
4232
  }, [open]);
4195
4233
  if (!open || typeof document === "undefined") return null;
4196
4234
  return (0, import_react_dom7.createPortal)(
4197
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4235
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4198
4236
  "div",
4199
4237
  {
4200
4238
  className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim px-4 py-6",
4201
4239
  onMouseDown: (e) => e.target === e.currentTarget && onClose(),
4202
- children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
4240
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
4203
4241
  "div",
4204
4242
  {
4205
4243
  ref: panel,
@@ -4214,24 +4252,24 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
4214
4252
  className
4215
4253
  ),
4216
4254
  children: [
4217
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex items-start gap-3 px-5 pt-5 pb-3", children: [
4218
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "min-w-0 flex-1", children: [
4219
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
4220
- description && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { id: descId, className: "mt-0.5 text-sm text-text-secondary", children: description })
4255
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-start gap-3 px-5 pt-5 pb-3", children: [
4256
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "min-w-0 flex-1", children: [
4257
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
4258
+ description && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { id: descId, className: "mt-0.5 text-sm text-text-secondary", children: description })
4221
4259
  ] }),
4222
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4260
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4223
4261
  "button",
4224
4262
  {
4225
4263
  type: "button",
4226
4264
  onClick: onClose,
4227
4265
  "aria-label": "Close",
4228
4266
  className: "-mr-1.5 -mt-1 flex size-8 shrink-0 items-center justify-center rounded-control text-text-tertiary hover:bg-subtle hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
4229
- children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react26.X, { size: 16, "aria-hidden": "true" })
4267
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react26.X, { size: 16, "aria-hidden": "true" })
4230
4268
  }
4231
4269
  )
4232
4270
  ] }),
4233
- children && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { "data-modal-body": true, className: "min-h-0 flex-1 overflow-y-auto px-5 pb-5 text-sm text-text-primary", children }),
4234
- footer && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { "data-modal-footer": true, className: "flex items-center justify-end gap-2 border-t border-border-default px-5 py-3", children: footer })
4271
+ children && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { "data-modal-body": true, className: "min-h-0 flex-1 overflow-y-auto px-5 pb-5 text-sm text-text-primary", children }),
4272
+ footer && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { "data-modal-footer": true, className: "flex items-center justify-end gap-2 border-t border-border-default px-5 py-3", children: footer })
4235
4273
  ]
4236
4274
  }
4237
4275
  )
@@ -4242,10 +4280,10 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
4242
4280
  }
4243
4281
 
4244
4282
  // src/EmptyState.tsx
4245
- var import_jsx_runtime45 = require("react/jsx-runtime");
4283
+ var import_jsx_runtime46 = require("react/jsx-runtime");
4246
4284
  function EmptyState({ icon, title, description, action, size = "sm", className }) {
4247
4285
  const md = size === "md";
4248
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
4286
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
4249
4287
  "div",
4250
4288
  {
4251
4289
  className: cn(
@@ -4254,7 +4292,7 @@ function EmptyState({ icon, title, description, action, size = "sm", className }
4254
4292
  className
4255
4293
  ),
4256
4294
  children: [
4257
- icon && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4295
+ icon && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4258
4296
  "span",
4259
4297
  {
4260
4298
  "aria-hidden": "true",
@@ -4265,9 +4303,9 @@ function EmptyState({ icon, title, description, action, size = "sm", className }
4265
4303
  children: icon
4266
4304
  }
4267
4305
  ),
4268
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: cn("font-semibold text-text-primary", md ? "text-base" : "text-sm"), children: title }),
4269
- description && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: cn("max-w-sm text-text-secondary", md ? "text-sm" : "text-xs"), children: description }),
4270
- action && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: md ? "mt-3" : "mt-2", children: action })
4306
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: cn("font-semibold text-text-primary", md ? "text-base" : "text-sm"), children: title }),
4307
+ description && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: cn("max-w-sm text-text-secondary", md ? "text-sm" : "text-xs"), children: description }),
4308
+ action && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: md ? "mt-3" : "mt-2", children: action })
4271
4309
  ]
4272
4310
  }
4273
4311
  );
@@ -4275,7 +4313,7 @@ function EmptyState({ icon, title, description, action, size = "sm", className }
4275
4313
 
4276
4314
  // src/Tabs.tsx
4277
4315
  var import_react20 = require("react");
4278
- var import_jsx_runtime46 = require("react/jsx-runtime");
4316
+ var import_jsx_runtime47 = require("react/jsx-runtime");
4279
4317
  function arrowKeys(e, row) {
4280
4318
  if (!row || !["ArrowLeft", "ArrowRight", "Home", "End"].includes(e.key)) return;
4281
4319
  const items = Array.from(row.querySelectorAll("button:not([disabled])"));
@@ -4287,7 +4325,7 @@ function arrowKeys(e, row) {
4287
4325
  }
4288
4326
  function Tabs({ items, value, onChange, idPrefix = "tabs", className, ...rest }) {
4289
4327
  const row = (0, import_react20.useRef)(null);
4290
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4328
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4291
4329
  "div",
4292
4330
  {
4293
4331
  ref: row,
@@ -4297,7 +4335,7 @@ function Tabs({ items, value, onChange, idPrefix = "tabs", className, ...rest })
4297
4335
  className: cn("flex gap-6 border-b border-border-default", className),
4298
4336
  children: items.map((item) => {
4299
4337
  const on = item.value === value;
4300
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
4338
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
4301
4339
  "button",
4302
4340
  {
4303
4341
  type: "button",
@@ -4309,12 +4347,12 @@ function Tabs({ items, value, onChange, idPrefix = "tabs", className, ...rest })
4309
4347
  disabled: item.disabled,
4310
4348
  onClick: () => onChange(item.value),
4311
4349
  className: cn(
4312
- "-mb-px flex items-center gap-1.5 rounded-control border-b-2 pt-1 pb-2.5 text-sm focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:opacity-50",
4350
+ "-mb-px flex items-center gap-1.5 border-b-2 pt-1 pb-2.5 text-sm focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:opacity-50",
4313
4351
  on ? "border-brand-primaryAction font-semibold text-text-primary" : "border-transparent text-text-secondary hover:text-text-primary"
4314
4352
  ),
4315
4353
  children: [
4316
4354
  item.label,
4317
- item.count !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-xs text-text-tertiary", children: item.count })
4355
+ item.count !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-xs text-text-tertiary", children: item.count })
4318
4356
  ]
4319
4357
  },
4320
4358
  item.value
@@ -4332,7 +4370,7 @@ function SegmentedControl({
4332
4370
  ...rest
4333
4371
  }) {
4334
4372
  const row = (0, import_react20.useRef)(null);
4335
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4373
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4336
4374
  "div",
4337
4375
  {
4338
4376
  ref: row,
@@ -4342,7 +4380,7 @@ function SegmentedControl({
4342
4380
  className: cn("inline-flex w-fit items-stretch gap-0.5 rounded-full bg-subtle p-1", size === "md" ? "h-10" : "h-8", className),
4343
4381
  children: options.map((o) => {
4344
4382
  const on = o.value === value;
4345
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4383
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4346
4384
  "button",
4347
4385
  {
4348
4386
  type: "button",
@@ -4366,7 +4404,7 @@ function SegmentedControl({
4366
4404
 
4367
4405
  // src/TextField.tsx
4368
4406
  var import_react21 = require("react");
4369
- var import_jsx_runtime47 = require("react/jsx-runtime");
4407
+ var import_jsx_runtime48 = require("react/jsx-runtime");
4370
4408
  var HEIGHT2 = { sm: "h-8", md: "h-10", lg: "h-11" };
4371
4409
  var TextField = (0, import_react21.forwardRef)(
4372
4410
  ({ label, hint, error, size = "md", icon, className, id, disabled, ...props }, ref) => {
@@ -4374,9 +4412,9 @@ var TextField = (0, import_react21.forwardRef)(
4374
4412
  const fieldId = id ?? auto;
4375
4413
  const noteId = `${fieldId}-note`;
4376
4414
  const note = error ?? hint;
4377
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: cn("flex flex-col gap-1.5", className), children: [
4378
- label && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("label", { htmlFor: fieldId, className: "text-xs font-medium text-text-secondary", children: label }),
4379
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
4415
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: cn("flex flex-col gap-1.5", className), children: [
4416
+ label && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("label", { htmlFor: fieldId, className: "text-xs font-medium text-text-secondary", children: label }),
4417
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
4380
4418
  "div",
4381
4419
  {
4382
4420
  className: cn(
@@ -4386,8 +4424,8 @@ var TextField = (0, import_react21.forwardRef)(
4386
4424
  disabled && "opacity-50"
4387
4425
  ),
4388
4426
  children: [
4389
- icon && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { "aria-hidden": "true", className: "flex shrink-0 text-text-tertiary", children: icon }),
4390
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4427
+ icon && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { "aria-hidden": "true", className: "flex shrink-0 text-text-tertiary", children: icon }),
4428
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
4391
4429
  "input",
4392
4430
  {
4393
4431
  ref,
@@ -4402,7 +4440,7 @@ var TextField = (0, import_react21.forwardRef)(
4402
4440
  ]
4403
4441
  }
4404
4442
  ),
4405
- note && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { id: noteId, className: cn("text-xs", error ? "text-text-danger" : "text-text-tertiary"), children: note })
4443
+ note && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { id: noteId, className: cn("text-xs", error ? "text-text-danger" : "text-text-tertiary"), children: note })
4406
4444
  ] });
4407
4445
  }
4408
4446
  );
@@ -4410,7 +4448,7 @@ TextField.displayName = "TextField";
4410
4448
 
4411
4449
  // src/DataTable.tsx
4412
4450
  var import_react22 = require("react");
4413
- var import_jsx_runtime48 = require("react/jsx-runtime");
4451
+ var import_jsx_runtime49 = require("react/jsx-runtime");
4414
4452
  var WIDTH2 = { fill: "", sm: "w-24", md: "w-36", lg: "w-48" };
4415
4453
  var MAX_H = { sm: "max-h-80", md: "max-h-120", lg: "max-h-160" };
4416
4454
  var HEAD_PAD = { default: "px-4 py-3", compact: "px-3 py-2" };
@@ -4442,15 +4480,15 @@ function DataTable({
4442
4480
  const col = columns.find((c) => c.key === key);
4443
4481
  onSortChange?.(cycleSort(sort, key, col?.firstDir ?? (col?.numeric ? "desc" : "asc")));
4444
4482
  };
4445
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: cn("flex w-full flex-col overflow-hidden rounded-card border border-border-default bg-surface", className), children: [
4446
- title && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-start justify-between gap-2 p-card-padding", children: [
4447
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "min-w-0", children: [
4448
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("h3", { id: titleId, className: "text-style-card-title", children: title }),
4449
- subtitle && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "mt-0.5 text-xs text-text-tertiary", children: subtitle })
4483
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: cn("flex w-full flex-col overflow-hidden rounded-card border border-border-default bg-surface", className), children: [
4484
+ title && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-start justify-between gap-2 p-card-padding", children: [
4485
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "min-w-0", children: [
4486
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("h3", { id: titleId, className: "text-style-card-title", children: title }),
4487
+ subtitle && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "mt-0.5 text-xs text-text-tertiary", children: subtitle })
4450
4488
  ] }),
4451
- action && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "shrink-0", children: action })
4489
+ action && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "shrink-0", children: action })
4452
4490
  ] }),
4453
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: cn("overflow-x-auto", maxHeight && cn("overflow-y-auto", MAX_H[maxHeight])), children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
4491
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: cn("overflow-x-auto", maxHeight && cn("overflow-y-auto", MAX_H[maxHeight])), children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
4454
4492
  "table",
4455
4493
  {
4456
4494
  "aria-labelledby": title ? titleId : void 0,
@@ -4458,13 +4496,13 @@ function DataTable({
4458
4496
  "aria-busy": loading || void 0,
4459
4497
  className: "w-full border-collapse text-left",
4460
4498
  children: [
4461
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("thead", { className: cn(maxHeight && "sticky top-0 z-10"), children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("tr", { className: "bg-subtle text-micro font-semibold uppercase tracking-wider text-text-secondary", children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
4499
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("thead", { className: cn(maxHeight && "sticky top-0 z-10"), children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("tr", { className: "bg-subtle text-micro font-semibold uppercase tracking-wider text-text-secondary", children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
4462
4500
  "th",
4463
4501
  {
4464
4502
  scope: "col",
4465
4503
  "aria-sort": c.sortable ? ariaSortFor(sort, c.key) : void 0,
4466
4504
  className: cn("border-b border-border-default font-semibold", head, align(c), width(c)),
4467
- children: c.sortable && onSortChange ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
4505
+ children: c.sortable && onSortChange ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
4468
4506
  SortButton,
4469
4507
  {
4470
4508
  label: c.label,
@@ -4477,7 +4515,7 @@ function DataTable({
4477
4515
  },
4478
4516
  c.key
4479
4517
  )) }) }),
4480
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("tbody", { className: "text-dense text-text-primary", children: loading ? Array.from({ length: loadingRows }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("tr", { "aria-hidden": "true", className: "[&:last-child>td]:border-b-0", children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("td", { className: cn("border-b border-border-default", pad, align(c)), children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
4518
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("tbody", { className: "text-dense text-text-primary", children: loading ? Array.from({ length: loadingRows }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("tr", { "aria-hidden": "true", className: "[&:last-child>td]:border-b-0", children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("td", { className: cn("border-b border-border-default", pad, align(c)), children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
4481
4519
  "span",
4482
4520
  {
4483
4521
  className: cn(
@@ -4485,7 +4523,7 @@ function DataTable({
4485
4523
  c.numeric ? "w-12" : "w-2/3"
4486
4524
  )
4487
4525
  }
4488
- ) }, c.key)) }, i)) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("td", { colSpan: columns.length, children: empty ?? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(NoResultsEmptyState, {}) }) }) : rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("tr", { className: "hover:bg-subtle [&:last-child>td]:border-b-0", children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
4526
+ ) }, c.key)) }, i)) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("td", { colSpan: columns.length, className: "px-6 py-12", children: empty ?? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(NoResultsEmptyState, {}) }) }) : rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("tr", { className: "hover:bg-subtle [&:last-child>td]:border-b-0", children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
4489
4527
  "td",
4490
4528
  {
4491
4529
  className: cn("border-b border-border-default", pad, align(c), c.numeric && "tabular-nums"),
@@ -4496,9 +4534,164 @@ function DataTable({
4496
4534
  ]
4497
4535
  }
4498
4536
  ) }),
4499
- footer && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "border-t border-border-default px-4 py-3", children: footer })
4537
+ footer && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "border-t border-border-default px-4 py-3", children: footer })
4500
4538
  ] });
4501
4539
  }
4540
+
4541
+ // src/MediaLabel.tsx
4542
+ var import_jsx_runtime50 = require("react/jsx-runtime");
4543
+ var FILL = {
4544
+ TV: "bg-media-tv",
4545
+ CTV: "bg-media-ctv",
4546
+ Digital: "bg-media-digital",
4547
+ Social: "bg-media-social",
4548
+ Radio: "bg-media-radio",
4549
+ Newspaper: "bg-media-newspaper",
4550
+ Magazine: "bg-media-magazine"
4551
+ };
4552
+ function MediaLabel({ type, className }) {
4553
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
4554
+ "span",
4555
+ {
4556
+ className: cn(
4557
+ "inline-flex items-center whitespace-nowrap rounded-sm px-1.5 py-0.5 text-micro font-semibold text-status-onstatus",
4558
+ FILL[type] ?? "bg-media-other",
4559
+ className
4560
+ ),
4561
+ children: type
4562
+ }
4563
+ );
4564
+ }
4565
+
4566
+ // src/SuggestionChip.tsx
4567
+ var import_jsx_runtime51 = require("react/jsx-runtime");
4568
+ function SuggestionChip({ children, className, type = "button", ...props }) {
4569
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
4570
+ "button",
4571
+ {
4572
+ type,
4573
+ ...props,
4574
+ className: cn(
4575
+ "inline-flex h-8 max-w-full items-center rounded-full border border-border-default bg-surface px-3 text-sm text-text-primary transition-colors duration-(--mr-motion-duration-interactive) ease-interactive hover:border-border-strong hover:bg-subtle focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
4576
+ className
4577
+ ),
4578
+ children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "truncate", children })
4579
+ }
4580
+ );
4581
+ }
4582
+
4583
+ // src/ToggleChip.tsx
4584
+ var import_lucide_react27 = require("lucide-react");
4585
+ var import_jsx_runtime52 = require("react/jsx-runtime");
4586
+ function ToggleChip({ selected, onChange, children, className, type = "button", onClick, ...props }) {
4587
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
4588
+ "button",
4589
+ {
4590
+ type,
4591
+ "aria-pressed": selected,
4592
+ ...props,
4593
+ onClick: (e) => {
4594
+ onClick?.(e);
4595
+ if (!e.defaultPrevented) onChange(!selected);
4596
+ },
4597
+ className: cn(
4598
+ "inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-full border px-3 text-sm transition-colors duration-(--mr-motion-duration-interactive) ease-interactive focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
4599
+ selected ? "border-brand-primaryAction bg-brand-primaryAction/15 font-medium text-brand-primaryAction" : "border-border-default bg-surface text-text-primary hover:border-border-strong hover:bg-subtle",
4600
+ className
4601
+ ),
4602
+ children: [
4603
+ selected && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_lucide_react27.Check, { size: 14, "aria-hidden": "true", className: "-ml-0.5 shrink-0" }),
4604
+ children
4605
+ ]
4606
+ }
4607
+ );
4608
+ }
4609
+
4610
+ // src/CopyButton.tsx
4611
+ var import_react23 = require("react");
4612
+ var import_lucide_react28 = require("lucide-react");
4613
+ var import_jsx_runtime53 = require("react/jsx-runtime");
4614
+ var CONFIRM_MS = 2e3;
4615
+ function CopyButton({ value, label, "aria-label": ariaLabel, size = "xs", className }) {
4616
+ const [copied, setCopied] = (0, import_react23.useState)(false);
4617
+ const timer = (0, import_react23.useRef)(void 0);
4618
+ (0, import_react23.useEffect)(() => () => clearTimeout(timer.current), []);
4619
+ const copy = async () => {
4620
+ try {
4621
+ await navigator.clipboard.writeText(typeof value === "function" ? value() : value);
4622
+ } catch {
4623
+ return;
4624
+ }
4625
+ setCopied(true);
4626
+ clearTimeout(timer.current);
4627
+ timer.current = setTimeout(() => setCopied(false), CONFIRM_MS);
4628
+ };
4629
+ const iconSize = size === "xs" ? 13 : 15;
4630
+ const icon = copied ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react28.Check, { size: iconSize, "aria-hidden": "true", className: "shrink-0 text-text-success" }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react28.Copy, { size: iconSize, "aria-hidden": "true", className: "shrink-0" });
4631
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
4632
+ Button,
4633
+ {
4634
+ type: "button",
4635
+ variant: "ghost",
4636
+ size,
4637
+ iconOnly: !label,
4638
+ "aria-label": label ? void 0 : ariaLabel,
4639
+ onClick: copy,
4640
+ className: cn(!copied && "text-text-secondary", className),
4641
+ children: [
4642
+ icon,
4643
+ label && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { children: copied ? "Copied" : label }),
4644
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { role: "status", className: "sr-only", children: copied ? "Copied" : "" })
4645
+ ]
4646
+ }
4647
+ );
4648
+ }
4649
+
4650
+ // src/InlineMessage.tsx
4651
+ var import_lucide_react29 = require("lucide-react");
4652
+ var import_jsx_runtime54 = require("react/jsx-runtime");
4653
+ var BOX = {
4654
+ info: "border-brand-primaryAction/30 bg-brand-primaryAction/10",
4655
+ success: "border-status-success/40 bg-status-success/10",
4656
+ // Heavier tint for the same reason as Badge: the amber sits close to the warm canvas.
4657
+ warning: "border-status-warning/50 bg-status-warning/15",
4658
+ danger: "border-status-danger/40 bg-status-danger/10"
4659
+ };
4660
+ var ICON_INK = {
4661
+ info: "text-brand-primaryAction",
4662
+ success: "text-text-success",
4663
+ warning: "text-text-warning",
4664
+ danger: "text-text-danger"
4665
+ };
4666
+ var ICON2 = { info: import_lucide_react29.Info, success: import_lucide_react29.CheckCircle2, warning: import_lucide_react29.AlertTriangle, danger: import_lucide_react29.XCircle };
4667
+ function InlineMessage({ tone = "info", title, children, actions, onDismiss, className }) {
4668
+ const Icon = ICON2[tone];
4669
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
4670
+ "div",
4671
+ {
4672
+ role: tone === "warning" || tone === "danger" ? "alert" : "status",
4673
+ className: cn("flex items-start gap-2.5 rounded-control border px-3 py-2.5 text-sm", BOX[tone], className),
4674
+ children: [
4675
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Icon, { size: 16, "aria-hidden": "true", className: cn("mt-0.5 shrink-0", ICON_INK[tone]) }),
4676
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "min-w-0 flex-1", children: [
4677
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "font-semibold text-text-primary", children: title }),
4678
+ children && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "mt-0.5 text-text-secondary", children }),
4679
+ actions && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "mt-2 flex flex-wrap items-center gap-2", children: actions })
4680
+ ] }),
4681
+ onDismiss && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
4682
+ "button",
4683
+ {
4684
+ type: "button",
4685
+ onClick: onDismiss,
4686
+ "aria-label": "Dismiss",
4687
+ className: "-mr-1 -mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-control text-text-tertiary hover:bg-subtle hover:text-text-primary focus-visible:outline-2 focus-visible:outline-border-focus",
4688
+ children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react29.X, { size: 14, "aria-hidden": "true" })
4689
+ }
4690
+ )
4691
+ ]
4692
+ }
4693
+ );
4694
+ }
4502
4695
  // Annotate the CommonJS export names for ESM import in node:
4503
4696
  0 && (module.exports = {
4504
4697
  AISpark,
@@ -4512,6 +4705,7 @@ function DataTable({
4512
4705
  CheckBox,
4513
4706
  CheckBoxBox,
4514
4707
  ChipContent,
4708
+ CopyButton,
4515
4709
  DEFAULT_SEARCH_MATCH,
4516
4710
  DataScopeFilter,
4517
4711
  DataTable,
@@ -4523,7 +4717,9 @@ function DataTable({
4523
4717
  FilterDropdownFooter,
4524
4718
  Freshness,
4525
4719
  InfoTip,
4720
+ InlineMessage,
4526
4721
  LineChartPlaceholder,
4722
+ MediaLabel,
4527
4723
  Modal,
4528
4724
  MultiSelectFilter,
4529
4725
  NO_RESULTS_BODY,
@@ -4546,12 +4742,14 @@ function DataTable({
4546
4742
  SelectionPicker,
4547
4743
  SortButton,
4548
4744
  StackedColumnPlaceholder,
4745
+ SuggestionChip,
4549
4746
  TablePagination,
4550
4747
  Tabs,
4551
4748
  Tag,
4552
4749
  TextField,
4553
4750
  Toast,
4554
4751
  Toggle,
4752
+ ToggleChip,
4555
4753
  Tooltip,
4556
4754
  WorkspaceAvatar,
4557
4755
  WorkspaceSelectedCard,