scb-wc-test 0.1.157 → 0.1.159

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/all.js +8 -0
  2. package/blazor/ScbBlazorInteropBase.cs +2 -2
  3. package/blazor/scb-blazor-bridge.js +15 -16
  4. package/index.d.ts +4 -0
  5. package/index.js +90 -82
  6. package/mvc/components/all.js +4 -0
  7. package/mvc/components/scb-dropdown/scb-dropdown.js +2 -2
  8. package/mvc/components/scb-header/scb-header.js +1 -1
  9. package/mvc/components/scb-menu/scb-menu-item.js +183 -53
  10. package/mvc/components/scb-menu/scb-menu-section.js +42 -0
  11. package/mvc/components/scb-menu/scb-menu.js +144 -36
  12. package/mvc/components/scb-menu/scb-sub-menu.js +6 -29
  13. package/mvc/components/scb-options-menu/scb-options-menu-item.js +62 -0
  14. package/mvc/components/scb-options-menu/scb-options-menu.js +46 -0
  15. package/mvc/components/scb-options-menu/scb-options-sub-menu.js +33 -0
  16. package/mvc/scb-blazor-bridge.js +15 -16
  17. package/package.json +18 -2
  18. package/scb-dropdown/scb-dropdown.js +4 -4
  19. package/scb-header/scb-header.d.ts +1 -1
  20. package/scb-header/scb-header.js +1 -1
  21. package/scb-menu/scb-menu-item.d.ts +41 -13
  22. package/scb-menu/scb-menu-item.js +299 -148
  23. package/scb-menu/scb-menu-section.d.ts +11 -0
  24. package/scb-menu/scb-menu-section.js +67 -0
  25. package/scb-menu/scb-menu.d.ts +32 -12
  26. package/scb-menu/scb-menu.js +327 -128
  27. package/scb-menu/scb-sub-menu.d.ts +8 -5
  28. package/scb-menu/scb-sub-menu.js +30 -54
  29. package/scb-options-menu/scb-options-menu-item.d.ts +22 -0
  30. package/scb-options-menu/scb-options-menu-item.js +174 -0
  31. package/scb-options-menu/scb-options-menu.d.ts +26 -0
  32. package/scb-options-menu/scb-options-menu.js +167 -0
  33. package/scb-options-menu/scb-options-sub-menu.d.ts +11 -0
  34. package/scb-options-menu/scb-options-sub-menu.js +73 -0
  35. package/scb-wc-test.bundle.js +947 -555
package/all.js CHANGED
@@ -46,10 +46,14 @@ import './mvc/components/scb-link/scb-link.js';
46
46
  import './mvc/components/scb-list/scb-list-item.js';
47
47
  import './mvc/components/scb-list/scb-list.js';
48
48
  import './mvc/components/scb-menu/scb-menu-item.js';
49
+ import './mvc/components/scb-menu/scb-menu-section.js';
49
50
  import './mvc/components/scb-menu/scb-menu.js';
50
51
  import './mvc/components/scb-menu/scb-sub-menu.js';
51
52
  import './mvc/components/scb-nav/scb-nav.js';
52
53
  import './mvc/components/scb-notification-card/scb-notification-card.js';
54
+ import './mvc/components/scb-options-menu/scb-options-menu-item.js';
55
+ import './mvc/components/scb-options-menu/scb-options-menu.js';
56
+ import './mvc/components/scb-options-menu/scb-options-sub-menu.js';
53
57
  import './mvc/components/scb-pagination/scb-pagination.js';
54
58
  import './mvc/components/scb-progress-indicator/scb-progress-indicator.js';
55
59
  import './mvc/components/scb-progress-stepper/scb-progress-step.js';
@@ -125,10 +129,14 @@ import './scb-link/scb-link.js';
125
129
  import './scb-list/scb-list-item.js';
126
130
  import './scb-list/scb-list.js';
127
131
  import './scb-menu/scb-menu-item.js';
132
+ import './scb-menu/scb-menu-section.js';
128
133
  import './scb-menu/scb-menu.js';
129
134
  import './scb-menu/scb-sub-menu.js';
130
135
  import './scb-nav/scb-nav.js';
131
136
  import './scb-notification-card/scb-notification-card.js';
137
+ import './scb-options-menu/scb-options-menu-item.js';
138
+ import './scb-options-menu/scb-options-menu.js';
139
+ import './scb-options-menu/scb-options-sub-menu.js';
132
140
  import './scb-pagination/scb-pagination.js';
133
141
  import './scb-progress-indicator/scb-progress-indicator.js';
134
142
  import './scb-progress-stepper/scb-progress-step.js';
@@ -26,10 +26,10 @@ namespace ScbBlazorDemo
26
26
  // Drawer (scb-drawer): öppet/stängt och texter
27
27
  protected DrawerState Drawer { get; private set; } = new();
28
28
 
29
- // Meny (scb-menu): övergripande öppet/stängt-läge
29
+ // Meny (scb-options-menu): övergripande öppet/stängt-läge
30
30
  protected MenuState Menu { get; private set; } = new();
31
31
 
32
- // Alla submenyer (scb-sub-menu) på sidan
32
+ // Alla submenyer (scb-options-sub-menu) på sidan
33
33
  protected SubMenuState[] SubMenus { get; private set; } = Array.Empty<SubMenuState>();
34
34
 
35
35
  // Breadcrumb (scb-breadcrumb): övergripande state
@@ -529,10 +529,10 @@
529
529
  prop: 'tooltip',
530
530
  },
531
531
 
532
- // scb-menu
533
- { sel: 'scb-menu', from: 'open', to: 'openchange', prop: 'open' },
534
- { sel: 'scb-menu', from: 'close', to: 'openchange', prop: 'open' },
535
- { sel: 'scb-menu', from: 'toggle', to: 'openchange', prop: 'open' },
532
+ // scb-options-menu
533
+ { sel: 'scb-options-menu', from: 'open', to: 'openchange', prop: 'open' },
534
+ { sel: 'scb-options-menu', from: 'close', to: 'openchange', prop: 'open' },
535
+ { sel: 'scb-options-menu', from: 'toggle', to: 'openchange', prop: 'open' },
536
536
 
537
537
  // scb-search (fristående search-komponent, inte headern)
538
538
  {
@@ -759,8 +759,8 @@
759
759
  { sel: 'scb-accordion-item', attr: 'open', to: 'openchange' },
760
760
  { sel: 'scb-icon-button', attr: 'selected', to: 'selectedchange' },
761
761
  { sel: 'scb-checkbox', attr: 'checked', to: 'checkedchange' },
762
- { sel: 'scb-menu', attr: 'open', to: 'openchange' },
763
- { sel: 'scb-sub-menu', attr: 'open', to: 'openchange' },
762
+ { sel: 'scb-options-menu', attr: 'open', to: 'openchange' },
763
+ { sel: 'scb-options-sub-menu', attr: 'open', to: 'openchange' },
764
764
  { sel: 'scb-chip', attr: 'selected', to: 'selectedchange' },
765
765
  { sel: 'scb-notification-card', attr: 'open', to: 'openchange' },
766
766
 
@@ -977,14 +977,13 @@
977
977
  to: 'imghrefimagechange',
978
978
  },
979
979
 
980
- { sel: 'scb-menu-item', attr: 'leading-icon', to: 'leadingiconchange' },
980
+ { sel: 'scb-options-menu-item', attr: 'leading-icon', to: 'leadingiconchange' },
981
981
  {
982
- sel: 'scb-menu-item',
982
+ sel: 'scb-options-menu-item',
983
983
  attr: 'trailing-icon',
984
984
  to: 'trailingiconchange',
985
985
  },
986
- { sel: 'scb-menu-item', attr: 'item-href', to: 'itemhrefchange' },
987
-
986
+ { sel: 'scb-options-menu-item', attr: 'item-href', to: 'itemhrefchange' },
988
987
  {
989
988
  sel: 'scb-notification-card',
990
989
  attr: 'direction',
@@ -1094,7 +1093,7 @@ window.SCBBlazor.getState = function () {
1094
1093
  const calendarViews = document.querySelectorAll('scb-calendar');
1095
1094
  const cards = document.querySelectorAll('scb-card');
1096
1095
  const keyfigures = document.querySelectorAll('scb-keyfigure-card');
1097
- const menu = document.querySelector('scb-menu');
1096
+ const menu = document.querySelector('scb-options-menu');
1098
1097
  const dialog = document.querySelector('scb-dialog');
1099
1098
  const notifications = document.querySelectorAll('scb-notification-card');
1100
1099
  const radioGroups = document.querySelectorAll('scb-radio-group');
@@ -1111,7 +1110,7 @@ window.SCBBlazor.getState = function () {
1111
1110
  const vizs = document.querySelectorAll('scb-viz');
1112
1111
  const lists = document.querySelectorAll('scb-list');
1113
1112
  const links = document.querySelectorAll('scb-link');
1114
- const subMenus = document.querySelectorAll('scb-sub-menu');
1113
+ const subMenus = document.querySelectorAll('scb-options-sub-menu');
1115
1114
 
1116
1115
  // Headerstate hämtas från attributen på första scb-header
1117
1116
  const headerState = {
@@ -1371,7 +1370,7 @@ window.SCBBlazor.getState = function () {
1371
1370
  unit: card.getAttribute('unit') || '',
1372
1371
  }));
1373
1372
 
1374
- // Meny (första scb-menu)
1373
+ // Meny (första scb-options-menu)
1375
1374
  const menuState = {
1376
1375
  open: menu ? menu.hasAttribute('open') : false,
1377
1376
  };
@@ -2507,7 +2506,7 @@ window.SCBBlazor.registerScbEventHandlers = function (dotNetRef) {
2507
2506
  };
2508
2507
 
2509
2508
  api.setMenuOpen = function (open) {
2510
- const menu = document.querySelector('scb-menu');
2509
+ const menu = document.querySelector('scb-options-menu');
2511
2510
  if (!menu) return;
2512
2511
  const isOpen = toBool(open);
2513
2512
  try {
@@ -2519,7 +2518,7 @@ window.SCBBlazor.registerScbEventHandlers = function (dotNetRef) {
2519
2518
  };
2520
2519
 
2521
2520
  api.setSubMenuOpen = function (index, open) {
2522
- const subMenu = getByIndex('scb-sub-menu', index);
2521
+ const subMenu = getByIndex('scb-options-sub-menu', index);
2523
2522
  if (!subMenu) return;
2524
2523
  const isOpen = toBool(open);
2525
2524
  try {
@@ -2531,7 +2530,7 @@ window.SCBBlazor.registerScbEventHandlers = function (dotNetRef) {
2531
2530
  };
2532
2531
 
2533
2532
  api.setSubMenuOpenById = function (id, open) {
2534
- const subMenu = getById(id, 'scb-sub-menu');
2533
+ const subMenu = getById(id, 'scb-optionssub-menu');
2535
2534
  if (!subMenu) return;
2536
2535
  const isOpen = toBool(open);
2537
2536
  try {
package/index.d.ts CHANGED
@@ -42,10 +42,14 @@ export * from './scb-link/scb-link';
42
42
  export * from './scb-list/scb-list-item';
43
43
  export * from './scb-list/scb-list';
44
44
  export * from './scb-menu/scb-menu-item';
45
+ export * from './scb-menu/scb-menu-section';
45
46
  export * from './scb-menu/scb-menu';
46
47
  export * from './scb-menu/scb-sub-menu';
47
48
  export * from './scb-nav/scb-nav';
48
49
  export * from './scb-notification-card/scb-notification-card';
50
+ export * from './scb-options-menu/scb-options-menu-item';
51
+ export * from './scb-options-menu/scb-options-menu';
52
+ export * from './scb-options-menu/scb-options-sub-menu';
49
53
  export * from './scb-pagination/scb-pagination';
50
54
  export * from './scb-progress-indicator/scb-progress-indicator';
51
55
  export * from './scb-progress-stepper/scb-progress-step';
package/index.js CHANGED
@@ -3,9 +3,9 @@ import { ScbAccordion as c } from "./scb-accordion/scb-accordion.js";
3
3
  import { ScbAppBar as p } from "./scb-app-bar/scb-app-bar.js";
4
4
  import { ScbAvatar as b } from "./scb-avatar/scb-avatar.js";
5
5
  import { ScbBadge as f } from "./scb-badge/scb-badge.js";
6
- import { SCBBreadcrumbItem as i } from "./scb-breadcrumb/scb-breadcrumb-item.js";
6
+ import { SCBBreadcrumbItem as n } from "./scb-breadcrumb/scb-breadcrumb-item.js";
7
7
  import { SCBBreadcrumb as d } from "./scb-breadcrumb/scb-breadcrumb.js";
8
- import { ScbButton as C } from "./scb-button/scb-button.js";
8
+ import { ScbButton as l } from "./scb-button/scb-button.js";
9
9
  import { ScbCalendarEvent as s } from "./scb-calendar/scb-calendar-event.js";
10
10
  import { ScbCalendar as B } from "./scb-calendar/scb-calendar.js";
11
11
  import { ScbCalendarCard as g } from "./scb-calendar-card/scb-calendar-card.js";
@@ -13,11 +13,11 @@ import { ScbCard as w } from "./scb-card/scb-card.js";
13
13
  import { ScbCheckboxGroup as F } from "./scb-checkbox/scb-checkbox-group.js";
14
14
  import { ScbCheckbox as P } from "./scb-checkbox/scb-checkbox.js";
15
15
  import { ScbChip as y } from "./scb-chip/scb-chip.js";
16
- import { ScbCollapse as v } from "./scb-collapse/scb-collapse.js";
17
- import { ScbCookiesConsent as L } from "./scb-cookies-consent/scb-cookies-consent.js";
18
- import { ScbDatepicker as z } from "./scb-datepicker/scb-datepicker.js";
19
- import { ScbDialog as R } from "./scb-dialog/scb-dialog.js";
20
- import { ScbDivider as K } from "./scb-divider/scb-divider.js";
16
+ import { ScbCollapse as M } from "./scb-collapse/scb-collapse.js";
17
+ import { ScbCookiesConsent as A } from "./scb-cookies-consent/scb-cookies-consent.js";
18
+ import { ScbDatepicker as L } from "./scb-datepicker/scb-datepicker.js";
19
+ import { ScbDialog as N } from "./scb-dialog/scb-dialog.js";
20
+ import { ScbDivider as E } from "./scb-divider/scb-divider.js";
21
21
  import { ScbDrawerItem as U } from "./scb-drawer/scb-drawer-item.js";
22
22
  import { ScbDrawerSection as j } from "./scb-drawer/scb-drawer-section.js";
23
23
  import { ScbDrawer as J } from "./scb-drawer/scb-drawer.js";
@@ -30,9 +30,9 @@ import { ScbFooter as cr } from "./scb-footer/scb-footer.js";
30
30
  import { ScbGridItem as pr } from "./scb-grid/scb-grid-item.js";
31
31
  import { ScbGrid as br } from "./scb-grid/scb-grid.js";
32
32
  import { ScbStack as fr } from "./scb-grid/scb-stack.js";
33
- import { ScbHeaderDrawerGroup as ir } from "./scb-header/scb-header-drawer-group.js";
33
+ import { ScbHeaderDrawerGroup as nr } from "./scb-header/scb-header-drawer-group.js";
34
34
  import { ScbHeaderDrawerItem as dr } from "./scb-header/scb-header-drawer-item.js";
35
- import { ScbHeaderTab as Cr } from "./scb-header/scb-header-tab.js";
35
+ import { ScbHeaderTab as lr } from "./scb-header/scb-header-tab.js";
36
36
  import { ScbHeaderUtility as sr } from "./scb-header/scb-header-utility.js";
37
37
  import { ScbHeader as Br } from "./scb-header/scb-header.js";
38
38
  import { ScbHorizontalScroller as gr } from "./scb-horizontal-scroller/scb-horizontal-scroller.js";
@@ -40,47 +40,51 @@ import { ScbIconButton as wr } from "./scb-icon-button/scb-icon-button.js";
40
40
  import { ScbKeyFigureCard as Fr } from "./scb-keyfigure-card/scb-keyfigure-card.js";
41
41
  import { ScbLink as Pr } from "./scb-link/scb-link.js";
42
42
  import { ScbListItem as yr } from "./scb-list/scb-list-item.js";
43
- import { ScbList as vr } from "./scb-list/scb-list.js";
44
- import { ScbMenuItem as Lr } from "./scb-menu/scb-menu-item.js";
45
- import { ScbMenu as zr } from "./scb-menu/scb-menu.js";
46
- import { ScbSubMenu as Rr } from "./scb-menu/scb-sub-menu.js";
47
- import { ScbNav as Kr } from "./scb-nav/scb-nav.js";
48
- import { ScbNotificationCard as Ur } from "./scb-notification-card/scb-notification-card.js";
49
- import { ScbPagination as jr } from "./scb-pagination/scb-pagination.js";
50
- import { ScbProgressIndicator as Jr } from "./scb-progress-indicator/scb-progress-indicator.js";
51
- import { ScbProgressStep as Wr } from "./scb-progress-stepper/scb-progress-step.js";
52
- import { ScbProgressStepper as Yr } from "./scb-progress-stepper/scb-progress-stepper.js";
53
- import { ScbRadioButton as _r } from "./scb-radio-button/scb-radio-button.js";
54
- import { ScbRadioGroup as ro } from "./scb-radio-button/scb-radio-group.js";
55
- import { ScbScrollspy as eo } from "./scb-scrollspy/scb-scrollspy.js";
56
- import { ScbSearch as co } from "./scb-search/scb-search.js";
57
- import { ScbSegmentedButton as po } from "./scb-segmented-button/scb-segmented-button.js";
58
- import { ScbSegmentedItem as bo } from "./scb-segmented-button/scb-segmented-item.js";
59
- import { ScbSelectOption as fo } from "./scb-select/scb-select-option.js";
60
- import { ScbSelect as io } from "./scb-select/scb-select.js";
61
- import { ScbSkeleton as lo } from "./scb-skeleton/scb-skeleton.js";
62
- import { ScbSnackbar as uo } from "./scb-snackbar/scb-snackbar.js";
63
- import { ScbStatusPill as Io } from "./scb-status-pill/scb-status-pill.js";
64
- import { ScbStep as Do } from "./scb-stepper/scb-step.js";
65
- import { ScbStepper as ko } from "./scb-stepper/scb-stepper.js";
66
- import { ScbSwitch as To } from "./scb-switch/scb-switch.js";
67
- import { ScbPrimaryTab as Ho } from "./scb-tabs/scb-primary-tab.js";
68
- import { ScbSecondaryTab as ho } from "./scb-tabs/scb-secondary-tab.js";
69
- import { ScbTabs as Go } from "./scb-tabs/scb-tabs.js";
70
- import { ScbTextField as Ao } from "./scb-textfield/scb-textfield.js";
71
- import { ScbTocItem as Mo } from "./scb-toc/scb-toc-item.js";
72
- import { ScbToc as No } from "./scb-toc/scb-toc.js";
73
- import { ScbTooltip as Eo } from "./scb-tooltip/scb-tooltip.js";
74
- import { ScbViz as Oo } from "./scb-viz/scb-viz.js";
43
+ import { ScbList as Mr } from "./scb-list/scb-list.js";
44
+ import { ScbMenuItem as Ar } from "./scb-menu/scb-menu-item.js";
45
+ import { ScbmenuSection as Lr } from "./scb-menu/scb-menu-section.js";
46
+ import { ScbMenu as Nr } from "./scb-menu/scb-menu.js";
47
+ import { ScbSubmenu as Er } from "./scb-menu/scb-sub-menu.js";
48
+ import { ScbNav as Ur } from "./scb-nav/scb-nav.js";
49
+ import { ScbNotificationCard as jr } from "./scb-notification-card/scb-notification-card.js";
50
+ import { ScbOptionsMenuItem as Jr } from "./scb-options-menu/scb-options-menu-item.js";
51
+ import { ScbOptionsMenu as Wr } from "./scb-options-menu/scb-options-menu.js";
52
+ import { ScbOptionsSubMenu as Yr } from "./scb-options-menu/scb-options-sub-menu.js";
53
+ import { ScbPagination as _r } from "./scb-pagination/scb-pagination.js";
54
+ import { ScbProgressIndicator as ro } from "./scb-progress-indicator/scb-progress-indicator.js";
55
+ import { ScbProgressStep as eo } from "./scb-progress-stepper/scb-progress-step.js";
56
+ import { ScbProgressStepper as co } from "./scb-progress-stepper/scb-progress-stepper.js";
57
+ import { ScbRadioButton as po } from "./scb-radio-button/scb-radio-button.js";
58
+ import { ScbRadioGroup as bo } from "./scb-radio-button/scb-radio-group.js";
59
+ import { ScbScrollspy as fo } from "./scb-scrollspy/scb-scrollspy.js";
60
+ import { ScbSearch as no } from "./scb-search/scb-search.js";
61
+ import { ScbSegmentedButton as uo } from "./scb-segmented-button/scb-segmented-button.js";
62
+ import { ScbSegmentedItem as Co } from "./scb-segmented-button/scb-segmented-item.js";
63
+ import { ScbSelectOption as Io } from "./scb-select/scb-select-option.js";
64
+ import { ScbSelect as Do } from "./scb-select/scb-select.js";
65
+ import { ScbSkeleton as ko } from "./scb-skeleton/scb-skeleton.js";
66
+ import { ScbSnackbar as To } from "./scb-snackbar/scb-snackbar.js";
67
+ import { ScbStatusPill as Ho } from "./scb-status-pill/scb-status-pill.js";
68
+ import { ScbStep as ho } from "./scb-stepper/scb-step.js";
69
+ import { ScbStepper as Go } from "./scb-stepper/scb-stepper.js";
70
+ import { ScbSwitch as vo } from "./scb-switch/scb-switch.js";
71
+ import { ScbPrimaryTab as Oo } from "./scb-tabs/scb-primary-tab.js";
72
+ import { ScbSecondaryTab as zo } from "./scb-tabs/scb-secondary-tab.js";
73
+ import { ScbTabs as Ro } from "./scb-tabs/scb-tabs.js";
74
+ import { ScbTextField as Ko } from "./scb-textfield/scb-textfield.js";
75
+ import { ScbTocItem as Vo } from "./scb-toc/scb-toc-item.js";
76
+ import { ScbToc as qo } from "./scb-toc/scb-toc.js";
77
+ import { ScbTooltip as Qo } from "./scb-tooltip/scb-tooltip.js";
78
+ import { ScbViz as Xo } from "./scb-viz/scb-viz.js";
75
79
  export {
76
80
  d as SCBBreadcrumb,
77
- i as SCBBreadcrumbItem,
81
+ n as SCBBreadcrumbItem,
78
82
  c as ScbAccordion,
79
83
  e as ScbAccordionItem,
80
84
  p as ScbAppBar,
81
85
  b as ScbAvatar,
82
86
  f as ScbBadge,
83
- C as ScbButton,
87
+ l as ScbButton,
84
88
  B as ScbCalendar,
85
89
  g as ScbCalendarCard,
86
90
  s as ScbCalendarEvent,
@@ -88,11 +92,11 @@ export {
88
92
  P as ScbCheckbox,
89
93
  F as ScbCheckboxGroup,
90
94
  y as ScbChip,
91
- v as ScbCollapse,
92
- L as ScbCookiesConsent,
93
- z as ScbDatepicker,
94
- R as ScbDialog,
95
- K as ScbDivider,
95
+ M as ScbCollapse,
96
+ A as ScbCookiesConsent,
97
+ L as ScbDatepicker,
98
+ N as ScbDialog,
99
+ E as ScbDivider,
96
100
  J as ScbDrawer,
97
101
  U as ScbDrawerItem,
98
102
  j as ScbDrawerSection,
@@ -104,47 +108,51 @@ export {
104
108
  br as ScbGrid,
105
109
  pr as ScbGridItem,
106
110
  Br as ScbHeader,
107
- ir as ScbHeaderDrawerGroup,
111
+ nr as ScbHeaderDrawerGroup,
108
112
  dr as ScbHeaderDrawerItem,
109
- Cr as ScbHeaderTab,
113
+ lr as ScbHeaderTab,
110
114
  sr as ScbHeaderUtility,
111
115
  gr as ScbHorizontalScroller,
112
116
  wr as ScbIconButton,
113
117
  Fr as ScbKeyFigureCard,
114
118
  Pr as ScbLink,
115
- vr as ScbList,
119
+ Mr as ScbList,
116
120
  yr as ScbListItem,
117
- zr as ScbMenu,
118
- Lr as ScbMenuItem,
119
- Kr as ScbNav,
120
- Ur as ScbNotificationCard,
121
- jr as ScbPagination,
122
- Ho as ScbPrimaryTab,
123
- Jr as ScbProgressIndicator,
124
- Wr as ScbProgressStep,
125
- Yr as ScbProgressStepper,
126
- _r as ScbRadioButton,
127
- ro as ScbRadioGroup,
128
- eo as ScbScrollspy,
129
- co as ScbSearch,
130
- ho as ScbSecondaryTab,
131
- po as ScbSegmentedButton,
132
- bo as ScbSegmentedItem,
133
- io as ScbSelect,
134
- fo as ScbSelectOption,
135
- lo as ScbSkeleton,
136
- uo as ScbSnackbar,
121
+ Nr as ScbMenu,
122
+ Ar as ScbMenuItem,
123
+ Ur as ScbNav,
124
+ jr as ScbNotificationCard,
125
+ Wr as ScbOptionsMenu,
126
+ Jr as ScbOptionsMenuItem,
127
+ Yr as ScbOptionsSubMenu,
128
+ _r as ScbPagination,
129
+ Oo as ScbPrimaryTab,
130
+ ro as ScbProgressIndicator,
131
+ eo as ScbProgressStep,
132
+ co as ScbProgressStepper,
133
+ po as ScbRadioButton,
134
+ bo as ScbRadioGroup,
135
+ fo as ScbScrollspy,
136
+ no as ScbSearch,
137
+ zo as ScbSecondaryTab,
138
+ uo as ScbSegmentedButton,
139
+ Co as ScbSegmentedItem,
140
+ Do as ScbSelect,
141
+ Io as ScbSelectOption,
142
+ ko as ScbSkeleton,
143
+ To as ScbSnackbar,
137
144
  fr as ScbStack,
138
- Io as ScbStatusPill,
139
- Do as ScbStep,
140
- ko as ScbStepper,
145
+ Ho as ScbStatusPill,
146
+ ho as ScbStep,
147
+ Go as ScbStepper,
141
148
  W as ScbSubDrawer,
142
- Rr as ScbSubMenu,
143
- To as ScbSwitch,
144
- Go as ScbTabs,
145
- Ao as ScbTextField,
146
- No as ScbToc,
147
- Mo as ScbTocItem,
148
- Eo as ScbTooltip,
149
- Oo as ScbViz
149
+ Er as ScbSubmenu,
150
+ vo as ScbSwitch,
151
+ Ro as ScbTabs,
152
+ Ko as ScbTextField,
153
+ qo as ScbToc,
154
+ Vo as ScbTocItem,
155
+ Qo as ScbTooltip,
156
+ Xo as ScbViz,
157
+ Lr as ScbmenuSection
150
158
  };
@@ -43,9 +43,13 @@ import './scb-list/scb-list.js';
43
43
  import './scb-list/scb-list-item.js';
44
44
  import './scb-menu/scb-menu.js';
45
45
  import './scb-menu/scb-menu-item.js';
46
+ import './scb-menu/scb-menu-section.js';
46
47
  import './scb-menu/scb-sub-menu.js';
47
48
  import './scb-nav/scb-nav.js';
48
49
  import './scb-notification-card/scb-notification-card.js';
50
+ import './scb-options-menu/scb-options-menu.js';
51
+ import './scb-options-menu/scb-options-menu-item.js';
52
+ import './scb-options-menu/scb-options-sub-menu.js';
49
53
  import './scb-pagination/scb-pagination.js';
50
54
  import './scb-progress-indicator/scb-progress-indicator.js';
51
55
  import './scb-progress-stepper/scb-progress-step.js';
@@ -1,4 +1,4 @@
1
- import{a as f,n as p,e as c,i as _,E as m,x as u,t as g}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";import"../scb-button/scb-button.js";import"../scb-menu/scb-menu.js";import"../scb-menu/scb-menu-item.js";import"../scb-divider/scb-divider.js";import"../scb-menu/scb-sub-menu.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(n,s,i){try{customElements.get(n)||t(n,s,i)}catch(d){var a=String(d||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var y=Object.defineProperty,v=Object.getOwnPropertyDescriptor,o=(e,t,n,s)=>{for(var i=s>1?void 0:s?v(t,n):t,a=e.length-1,d;a>=0;a--)(d=e[a])&&(i=(s?d(t,n,i):d(i))||i);return s&&i&&y(t,n,i),i};let r=class extends _{constructor(){super(...arguments),this.label="Dropdown",this.variant="filled",this.open=!1,this.disabled=!1,this.menuGap="3",this.width=null,this.minWidth=null,this.maxWidth=null,this.dataIndex=null,this.ariaCurrent=null,this._slottedMenuEl=null,this._openSettledTimer=null,this._menuCloseTimer=null,this._panelResizeObserver=null,this._panelHeightSyncRaf=null,this._onDocumentClickBound=e=>{if(!this.open)return;const t=e.composedPath(),n=t.find(s=>s instanceof HTMLElement&&s.tagName.toLowerCase()==="scb-dropdown");if(n&&n!==this){this.open=!1;return}t.includes(this)||(this.open=!1)},this._onDocumentKeydownBound=e=>{this.open&&e.key==="Escape"&&(this.open=!1)},this._onDrawerSelectBound=e=>{if(!this.open)return;const n=e.detail?.item;if(!n||!!n.querySelector("scb-sub-drawer"))return;const i=n.getAttribute("item-href")?.trim()??"",a=n.getAttribute("href")?.trim()??"";(i!==""||a!=="")&&this._dispatchTabActivate(),this.open=!1},this._onSlottedMenuOpen=()=>{this.open||(this.open=!0)},this._onSlottedMenuClose=()=>{this.open&&(this.open=!1)},this._onSlotChange=()=>{this._syncSlottedMenu(),this._applyPanelSizing(),this._applyInertByOpen(),this.requestUpdate()},this._onTriggerClick=e=>{this.hasAttribute("as-tab")||e.stopPropagation(),!this.disabled&&(this.open=!this.open)}}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._onDocumentClickBound,!0),document.addEventListener("keydown",this._onDocumentKeydownBound),this.addEventListener("scb-drawer-select",this._onDrawerSelectBound)}disconnectedCallback(){document.removeEventListener("click",this._onDocumentClickBound,!0),document.removeEventListener("keydown",this._onDocumentKeydownBound),this.removeEventListener("scb-drawer-select",this._onDrawerSelectBound),this._detachSlottedMenuListeners(),this._panelResizeObserver&&(this._panelResizeObserver.disconnect(),this._panelResizeObserver=null),this._panelHeightSyncRaf!==null&&(window.cancelAnimationFrame(this._panelHeightSyncRaf),this._panelHeightSyncRaf=null),this._openSettledTimer!==null&&(window.clearTimeout(this._openSettledTimer),this._openSettledTimer=null),this._menuCloseTimer!==null&&(window.clearTimeout(this._menuCloseTimer),this._menuCloseTimer=null),super.disconnectedCallback()}firstUpdated(e){super.firstUpdated(e),this._syncSlottedMenu(),this._applyPanelVars(),this._applyPanelSizing(),this._applyChevronState(),this._applyInertByOpen(),this._setupPanelResizeObserver(),this._syncPanelMaxHeightByOpen(),this._syncOverflowVisibilityByOpen()}updated(e){super.updated(e),e.has("menuGap")&&this._applyPanelVars(),(e.has("width")||e.has("minWidth")||e.has("maxWidth"))&&this._applyPanelSizing(),e.has("open")&&(this.open||this._closeAllSubMenus(),this._syncSlottedMenuOpen(),this._applyChevronState(),this._applyInertByOpen(),this._syncPanelMaxHeightByOpen(),this._syncOverflowVisibilityByOpen())}_applyPanelVars(){if(this.menuGap==null||String(this.menuGap).trim()===""){this.style.removeProperty("--scb-dropdown-panel-gap");return}this.style.setProperty("--scb-dropdown-panel-gap",this._mapSpacingToken(this.menuGap))}_applyPanelSizing(){const e=this.renderRoot.querySelector(".panel-surface");e&&(this.width&&String(this.width).trim()!==""?e.style.inlineSize=this.width:e.style.removeProperty("inline-size"),this.minWidth&&String(this.minWidth).trim()!==""?e.style.minInlineSize=this.minWidth:e.style.removeProperty("min-inline-size"),this.maxWidth&&String(this.maxWidth).trim()!==""?e.style.maxInlineSize=this.maxWidth:e.style.removeProperty("max-inline-size")),this._slottedMenuEl&&(this.width&&String(this.width).trim()!==""?this._slottedMenuEl.style.inlineSize=this.width:this._slottedMenuEl.style.removeProperty("inline-size"),this.minWidth&&String(this.minWidth).trim()!==""?this._slottedMenuEl.style.minInlineSize=this.minWidth:this._slottedMenuEl.style.removeProperty("min-inline-size"),this.maxWidth&&String(this.maxWidth).trim()!==""?this._slottedMenuEl.style.maxInlineSize=this.maxWidth:this._slottedMenuEl.style.removeProperty("max-inline-size")),this._schedulePanelHeightSync()}_setupPanelResizeObserver(){if(this._panelResizeObserver||typeof ResizeObserver>"u")return;const e=this._panelInnerEl;e&&(this._panelResizeObserver=new ResizeObserver(()=>{this._schedulePanelHeightSync()}),this._panelResizeObserver.observe(e))}_schedulePanelHeightSync(){this._panelHeightSyncRaf===null&&(this._panelHeightSyncRaf=window.requestAnimationFrame(()=>{this._panelHeightSyncRaf=null,this._syncPanelMaxHeightByOpen()}))}_syncPanelMaxHeightByOpen(){const e=this._panelSurfaceEl;if(!e)return;if(this._slottedMenuEl){e.style.removeProperty("--scb-dropdown-panel-current-max-height");return}if(!this.open){e.style.setProperty("--scb-dropdown-panel-current-max-height","0px");return}const t=this._panelInnerEl;if(!t)return;const n=`${Math.ceil(t.scrollHeight)}px`;e.style.getPropertyValue("--scb-dropdown-panel-current-max-height").trim()!==n&&e.style.setProperty("--scb-dropdown-panel-current-max-height",n)}_mapSpacingToken(e){const t=String(e).trim();return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}_syncSlottedMenu(){const t=(this._slotEl?.assignedElements({flatten:!0})??[]).find(n=>n.tagName.toLowerCase()==="scb-menu");if(t===this._slottedMenuEl){this._syncSlottedMenuOpen();return}this._detachSlottedMenuListeners(),this._slottedMenuEl=t??null,this._slottedMenuEl&&(this._slottedMenuEl.addEventListener("open",this._onSlottedMenuOpen),this._slottedMenuEl.addEventListener("close",this._onSlottedMenuClose),this._syncSlottedMenuOpen())}_detachSlottedMenuListeners(){this._slottedMenuEl&&(this._slottedMenuEl.removeEventListener("open",this._onSlottedMenuOpen),this._slottedMenuEl.removeEventListener("close",this._onSlottedMenuClose))}_syncSlottedMenuOpen(){if(!this._slottedMenuEl)return;if(this._menuCloseTimer!==null&&(window.clearTimeout(this._menuCloseTimer),this._menuCloseTimer=null),this.open){this._slottedMenuEl.open=!0;return}const e=this._getPanelTransitionMs();if(e<=0){this._slottedMenuEl.open=!1;return}this._menuCloseTimer=window.setTimeout(()=>{this._menuCloseTimer=null,!this.open&&this._slottedMenuEl&&(this._slottedMenuEl.open=!1)},e)}_syncOverflowVisibilityByOpen(){if(this._openSettledTimer!==null&&(window.clearTimeout(this._openSettledTimer),this._openSettledTimer=null),this.removeAttribute("data-open-settled"),!this.open)return;const e=this.renderRoot.querySelector(".panel-surface");if(!e){this.setAttribute("data-open-settled","");return}const t=this._getTransitionMs(e);if(t<=0){this.setAttribute("data-open-settled","");return}this._openSettledTimer=window.setTimeout(()=>{this._openSettledTimer=null,this.open&&this.setAttribute("data-open-settled","")},t)}_getPanelTransitionMs(){const e=this.renderRoot.querySelector(".panel-surface");return e?this._getTransitionMs(e):0}_getTransitionMs(e){const t=getComputedStyle(e),n=t.transitionDuration.split(",").map(l=>l.trim()),s=t.transitionDelay.split(",").map(l=>l.trim()),i=l=>{const h=parseFloat(l);return Number.isFinite(h)?l.endsWith("ms")?h:l.endsWith("s")?h*1e3:h:0},a=Math.max(n.length,s.length);let d=0;for(let l=0;l<a;l+=1){const h=i(n[l]??n[n.length-1]??"0s"),b=i(s[l]??s[s.length-1]??"0s");d=Math.max(d,h+b)}return Math.ceil(d)}_applyInertByOpen(){const e=this.renderRoot.querySelector(".panel");e&&(this.open?(e.removeAttribute("inert"),e.setAttribute("aria-hidden","false"),this._restoreTabIndexesIfNeeded()):(e.setAttribute("inert",""),e.setAttribute("aria-hidden","true"),this._removeTabIndexesIfNeeded()))}_supportsInert(){return"inert"in HTMLElement.prototype}_collectFocusableFromSlot(){const e=this._slotEl;if(!e)return[];const t=e.assignedElements({flatten:!0}),n=[],s=i=>{i instanceof HTMLElement&&i.matches("a,button,input,select,textarea,[tabindex]")&&n.push(i)};return t.forEach(i=>{s(i),i.querySelectorAll?.("a,button,input,select,textarea,[tabindex]").forEach(a=>s(a))}),n}_removeTabIndexesIfNeeded(){if(this._supportsInert())return;this._collectFocusableFromSlot().forEach(t=>{const n=t.getAttribute("tabindex");n!==null&&t.setAttribute("data-scb-prev-tabindex",n),t.setAttribute("tabindex","-1")})}_restoreTabIndexesIfNeeded(){if(this._supportsInert())return;this._collectFocusableFromSlot().forEach(t=>{const n=t.getAttribute("data-scb-prev-tabindex");n!==null?(t.setAttribute("tabindex",n),t.removeAttribute("data-scb-prev-tabindex")):t.removeAttribute("tabindex")})}_closeAllSubMenus(){const e=this.querySelectorAll("scb-sub-menu");for(const t of e)t.removeAttribute("open")}focus(e){const t=this._triggerEl;if(t?.focus){t.focus(e);return}super.focus(e)}_dispatchTabActivate(){this.hasAttribute("as-tab")&&this.dispatchEvent(new CustomEvent("scb-dropdown-tab-activate",{bubbles:!0,composed:!0,detail:{dataIndex:this.dataIndex}}))}_applyChevronState(){if(this.hasAttribute("as-tab"))return;const e=this._getChevronIconEl();e&&(e.style.transition="transform var(--motion-duration-medium, 200ms) var(--motion-easing-standard, ease)",e.style.transformOrigin="center",e.style.transform=this.open?"rotate(180deg)":"rotate(0deg)")}_getChevronIconEl(){const e=this._triggerEl;if(e?.tagName?.toLowerCase?.()!=="scb-button")return null;const t=e?.shadowRoot;return t?t.querySelector('md-icon[slot="icon"]')??t.querySelector("md-icon"):null}render(){const e=!!this._slottedMenuEl,t=this.hasAttribute("as-tab"),n=this.dataIndex,i=this.ariaCurrent==="page"?"page":m,a=t?u`
1
+ import{a as f,n as p,e as c,i as _,E as m,x as u,t as g}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";import"../scb-button/scb-button.js";import"../scb-options-menu/scb-options-menu.js";import"../scb-options-menu/scb-options-menu-item.js";import"../scb-divider/scb-divider.js";import"../scb-options-menu/scb-options-sub-menu.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(n,s,i){try{customElements.get(n)||t(n,s,i)}catch(d){var a=String(d||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var y=Object.defineProperty,v=Object.getOwnPropertyDescriptor,o=(e,t,n,s)=>{for(var i=s>1?void 0:s?v(t,n):t,a=e.length-1,d;a>=0;a--)(d=e[a])&&(i=(s?d(t,n,i):d(i))||i);return s&&i&&y(t,n,i),i};let r=class extends _{constructor(){super(...arguments),this.label="Dropdown",this.variant="filled",this.open=!1,this.disabled=!1,this.menuGap="3",this.width=null,this.minWidth=null,this.maxWidth=null,this.dataIndex=null,this.ariaCurrent=null,this._slottedMenuEl=null,this._openSettledTimer=null,this._menuCloseTimer=null,this._panelResizeObserver=null,this._panelHeightSyncRaf=null,this._onDocumentClickBound=e=>{if(!this.open)return;const t=e.composedPath(),n=t.find(s=>s instanceof HTMLElement&&s.tagName.toLowerCase()==="scb-dropdown");if(n&&n!==this){this.open=!1;return}t.includes(this)||(this.open=!1)},this._onDocumentKeydownBound=e=>{this.open&&e.key==="Escape"&&(this.open=!1)},this._onDrawerSelectBound=e=>{if(!this.open)return;const n=e.detail?.item;if(!n||!!n.querySelector("scb-sub-drawer"))return;const i=n.getAttribute("item-href")?.trim()??"",a=n.getAttribute("href")?.trim()??"";(i!==""||a!=="")&&this._dispatchTabActivate(),this.open=!1},this._onSlottedMenuOpen=()=>{this.open||(this.open=!0)},this._onSlottedMenuClose=()=>{this.open&&(this.open=!1)},this._onSlotChange=()=>{this._syncSlottedMenu(),this._applyPanelSizing(),this._applyInertByOpen(),this.requestUpdate()},this._onTriggerClick=e=>{this.hasAttribute("as-tab")||e.stopPropagation(),!this.disabled&&(this.open=!this.open)}}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._onDocumentClickBound,!0),document.addEventListener("keydown",this._onDocumentKeydownBound),this.addEventListener("scb-drawer-select",this._onDrawerSelectBound)}disconnectedCallback(){document.removeEventListener("click",this._onDocumentClickBound,!0),document.removeEventListener("keydown",this._onDocumentKeydownBound),this.removeEventListener("scb-drawer-select",this._onDrawerSelectBound),this._detachSlottedMenuListeners(),this._panelResizeObserver&&(this._panelResizeObserver.disconnect(),this._panelResizeObserver=null),this._panelHeightSyncRaf!==null&&(window.cancelAnimationFrame(this._panelHeightSyncRaf),this._panelHeightSyncRaf=null),this._openSettledTimer!==null&&(window.clearTimeout(this._openSettledTimer),this._openSettledTimer=null),this._menuCloseTimer!==null&&(window.clearTimeout(this._menuCloseTimer),this._menuCloseTimer=null),super.disconnectedCallback()}firstUpdated(e){super.firstUpdated(e),this._syncSlottedMenu(),this._applyPanelVars(),this._applyPanelSizing(),this._applyChevronState(),this._applyInertByOpen(),this._setupPanelResizeObserver(),this._syncPanelMaxHeightByOpen(),this._syncOverflowVisibilityByOpen()}updated(e){super.updated(e),e.has("menuGap")&&this._applyPanelVars(),(e.has("width")||e.has("minWidth")||e.has("maxWidth"))&&this._applyPanelSizing(),e.has("open")&&(this.open||this._closeAllSubMenus(),this._syncSlottedMenuOpen(),this._applyChevronState(),this._applyInertByOpen(),this._syncPanelMaxHeightByOpen(),this._syncOverflowVisibilityByOpen())}_applyPanelVars(){if(this.menuGap==null||String(this.menuGap).trim()===""){this.style.removeProperty("--scb-dropdown-panel-gap");return}this.style.setProperty("--scb-dropdown-panel-gap",this._mapSpacingToken(this.menuGap))}_applyPanelSizing(){const e=this.renderRoot.querySelector(".panel-surface");e&&(this.width&&String(this.width).trim()!==""?e.style.inlineSize=this.width:e.style.removeProperty("inline-size"),this.minWidth&&String(this.minWidth).trim()!==""?e.style.minInlineSize=this.minWidth:e.style.removeProperty("min-inline-size"),this.maxWidth&&String(this.maxWidth).trim()!==""?e.style.maxInlineSize=this.maxWidth:e.style.removeProperty("max-inline-size")),this._slottedMenuEl&&(this.width&&String(this.width).trim()!==""?this._slottedMenuEl.style.inlineSize=this.width:this._slottedMenuEl.style.removeProperty("inline-size"),this.minWidth&&String(this.minWidth).trim()!==""?this._slottedMenuEl.style.minInlineSize=this.minWidth:this._slottedMenuEl.style.removeProperty("min-inline-size"),this.maxWidth&&String(this.maxWidth).trim()!==""?this._slottedMenuEl.style.maxInlineSize=this.maxWidth:this._slottedMenuEl.style.removeProperty("max-inline-size")),this._schedulePanelHeightSync()}_setupPanelResizeObserver(){if(this._panelResizeObserver||typeof ResizeObserver>"u")return;const e=this._panelInnerEl;e&&(this._panelResizeObserver=new ResizeObserver(()=>{this._schedulePanelHeightSync()}),this._panelResizeObserver.observe(e))}_schedulePanelHeightSync(){this._panelHeightSyncRaf===null&&(this._panelHeightSyncRaf=window.requestAnimationFrame(()=>{this._panelHeightSyncRaf=null,this._syncPanelMaxHeightByOpen()}))}_syncPanelMaxHeightByOpen(){const e=this._panelSurfaceEl;if(!e)return;if(this._slottedMenuEl){e.style.removeProperty("--scb-dropdown-panel-current-max-height");return}if(!this.open){e.style.setProperty("--scb-dropdown-panel-current-max-height","0px");return}const t=this._panelInnerEl;if(!t)return;const n=`${Math.ceil(t.scrollHeight)}px`;e.style.getPropertyValue("--scb-dropdown-panel-current-max-height").trim()!==n&&e.style.setProperty("--scb-dropdown-panel-current-max-height",n)}_mapSpacingToken(e){const t=String(e).trim();return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}_syncSlottedMenu(){const t=(this._slotEl?.assignedElements({flatten:!0})??[]).find(n=>n.tagName.toLowerCase()==="scb-options-menu");if(t===this._slottedMenuEl){this._syncSlottedMenuOpen();return}this._detachSlottedMenuListeners(),this._slottedMenuEl=t??null,this._slottedMenuEl&&(this._slottedMenuEl.addEventListener("open",this._onSlottedMenuOpen),this._slottedMenuEl.addEventListener("close",this._onSlottedMenuClose),this._syncSlottedMenuOpen())}_detachSlottedMenuListeners(){this._slottedMenuEl&&(this._slottedMenuEl.removeEventListener("open",this._onSlottedMenuOpen),this._slottedMenuEl.removeEventListener("close",this._onSlottedMenuClose))}_syncSlottedMenuOpen(){if(!this._slottedMenuEl)return;if(this._menuCloseTimer!==null&&(window.clearTimeout(this._menuCloseTimer),this._menuCloseTimer=null),this.open){this._slottedMenuEl.open=!0;return}const e=this._getPanelTransitionMs();if(e<=0){this._slottedMenuEl.open=!1;return}this._menuCloseTimer=window.setTimeout(()=>{this._menuCloseTimer=null,!this.open&&this._slottedMenuEl&&(this._slottedMenuEl.open=!1)},e)}_syncOverflowVisibilityByOpen(){if(this._openSettledTimer!==null&&(window.clearTimeout(this._openSettledTimer),this._openSettledTimer=null),this.removeAttribute("data-open-settled"),!this.open)return;const e=this.renderRoot.querySelector(".panel-surface");if(!e){this.setAttribute("data-open-settled","");return}const t=this._getTransitionMs(e);if(t<=0){this.setAttribute("data-open-settled","");return}this._openSettledTimer=window.setTimeout(()=>{this._openSettledTimer=null,this.open&&this.setAttribute("data-open-settled","")},t)}_getPanelTransitionMs(){const e=this.renderRoot.querySelector(".panel-surface");return e?this._getTransitionMs(e):0}_getTransitionMs(e){const t=getComputedStyle(e),n=t.transitionDuration.split(",").map(l=>l.trim()),s=t.transitionDelay.split(",").map(l=>l.trim()),i=l=>{const h=parseFloat(l);return Number.isFinite(h)?l.endsWith("ms")?h:l.endsWith("s")?h*1e3:h:0},a=Math.max(n.length,s.length);let d=0;for(let l=0;l<a;l+=1){const h=i(n[l]??n[n.length-1]??"0s"),b=i(s[l]??s[s.length-1]??"0s");d=Math.max(d,h+b)}return Math.ceil(d)}_applyInertByOpen(){const e=this.renderRoot.querySelector(".panel");e&&(this.open?(e.removeAttribute("inert"),e.setAttribute("aria-hidden","false"),this._restoreTabIndexesIfNeeded()):(e.setAttribute("inert",""),e.setAttribute("aria-hidden","true"),this._removeTabIndexesIfNeeded()))}_supportsInert(){return"inert"in HTMLElement.prototype}_collectFocusableFromSlot(){const e=this._slotEl;if(!e)return[];const t=e.assignedElements({flatten:!0}),n=[],s=i=>{i instanceof HTMLElement&&i.matches("a,button,input,select,textarea,[tabindex]")&&n.push(i)};return t.forEach(i=>{s(i),i.querySelectorAll?.("a,button,input,select,textarea,[tabindex]").forEach(a=>s(a))}),n}_removeTabIndexesIfNeeded(){if(this._supportsInert())return;this._collectFocusableFromSlot().forEach(t=>{const n=t.getAttribute("tabindex");n!==null&&t.setAttribute("data-scb-prev-tabindex",n),t.setAttribute("tabindex","-1")})}_restoreTabIndexesIfNeeded(){if(this._supportsInert())return;this._collectFocusableFromSlot().forEach(t=>{const n=t.getAttribute("data-scb-prev-tabindex");n!==null?(t.setAttribute("tabindex",n),t.removeAttribute("data-scb-prev-tabindex")):t.removeAttribute("tabindex")})}_closeAllSubMenus(){const e=this.querySelectorAll("scb-options-sub-menu");for(const t of e)t.removeAttribute("open")}focus(e){const t=this._triggerEl;if(t?.focus){t.focus(e);return}super.focus(e)}_dispatchTabActivate(){this.hasAttribute("as-tab")&&this.dispatchEvent(new CustomEvent("scb-dropdown-tab-activate",{bubbles:!0,composed:!0,detail:{dataIndex:this.dataIndex}}))}_applyChevronState(){if(this.hasAttribute("as-tab"))return;const e=this._getChevronIconEl();e&&(e.style.transition="transform var(--motion-duration-medium, 200ms) var(--motion-easing-standard, ease)",e.style.transformOrigin="center",e.style.transform=this.open?"rotate(180deg)":"rotate(0deg)")}_getChevronIconEl(){const e=this._triggerEl;if(e?.tagName?.toLowerCase?.()!=="scb-button")return null;const t=e?.shadowRoot;return t?t.querySelector('md-icon[slot="icon"]')??t.querySelector("md-icon"):null}render(){const e=!!this._slottedMenuEl,t=this.hasAttribute("as-tab"),n=this.dataIndex,i=this.ariaCurrent==="page"?"page":m,a=t?u`
2
2
  <div class="tab-wrap">
3
3
  <button
4
4
  type="button"
@@ -201,7 +201,7 @@ import{a as f,n as p,e as c,i as _,E as m,x as u,t as g}from"../../vendor/vendor
201
201
  overflow: visible;
202
202
  }
203
203
 
204
- ::slotted(scb-menu) {
204
+ ::slotted(scb-options-menu) {
205
205
  position: static !important;
206
206
  transform: none !important;
207
207
  width: fit-content;
@@ -1,4 +1,4 @@
1
- import{a as w,n as h,r as m,i as x,x as c,E as u,t as S}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";import"../scb-grid/scb-grid-item.js";import"../scb-grid/scb-grid.js";import"../scb-link/scb-link.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-button/scb-button.js";import"../scb-search/scb-search.js";import"../scb-drawer/scb-drawer.js";import"../scb-dropdown/scb-dropdown.js";import"../scb-grid/scb-stack.js";import"../../vendor/preload-helper.js";import"../scb-tooltip/scb-tooltip.js";import"../scb-list/scb-list.js";import"../scb-list/scb-list-item.js";import"../scb-divider/scb-divider.js";import"../scb-menu/scb-menu.js";import"../scb-menu/scb-menu-item.js";import"../scb-menu/scb-sub-menu.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(r,i,o){try{customElements.get(r)||t(r,i,o)}catch(a){var l=String(a||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw a}}}}catch{}})();var A=Object.defineProperty,C=Object.getOwnPropertyDescriptor,n=(e,t,r,i)=>{for(var o=i>1?void 0:i?C(t,r):t,l=e.length-1,a;l>=0;l--)(a=e[l])&&(o=(i?a(t,r,o):a(o))||o);return i&&o&&A(t,r,o),o};const v={fromAttribute:e=>e==null?!0:!/^(false|0|off|no)$/i.test(e),toAttribute:e=>String(!!e)},k={fromAttribute:e=>e==="small"||e==="large"?e:"medium",toAttribute:e=>{const t=String(e??"");return t==="small"||t==="large"?t:null}};let s=class extends x{constructor(){super(...arguments),this.maxWidth="1440px",this.size="medium",this.logoText="",this.logoHref="/",this.logoSrc="",this.logoHeight="",this.logoInvertDm=!1,this.banner=!1,this.tabs=[],this.activeTab=0,this.utilityItems=[],this.showDrawer=!0,this.showSearch=!0,this.includeUtilityInDrawer=!1,this.drawerOverlay=!0,this.searchText="",this._drawerId="main-drawer",this._drawerExpanded=!1,this._searchId="header-search",this._slotNavItems=[],this._slotUtils=[],this._slotMenu=[],this._measureScheduled=!1,this._scheduleMeasure=()=>{this._measureScheduled||(this._measureScheduled=!0,requestAnimationFrame(()=>{this._measureScheduled=!1,this._measure()}))},this._onWindowResize=()=>{this._scheduleMeasure()},this._onDrawerSelect=e=>{this.dispatchEvent(new CustomEvent("drawer-select",{detail:e.detail,bubbles:!0,composed:!0})),this._closeDrawerNow()},this._collapsed=!1,this._unlockAtWidth=0,this._hideLogoText=!1,this._logoTextUnlockAt=0,this._harvestPending=!1,this._harvest=()=>{const e=Array.from(this.children),t=[],r=[],i=[];let o=-1;const l=a=>({label:a.getAttribute("label")??"",href:a.getAttribute("href")??void 0,icon:a.getAttribute("icon")??void 0});for(const a of e){const b=a.tagName.toLowerCase();if(b==="scb-header-tab"){const d=a.getAttribute("label")??"",g=a.getAttribute("href"),p=g&&g.trim()!==""?g:void 0;(a.hasAttribute("selected")||a.getAttribute("selected")==="true"||a.getAttribute("active")==="true"||a.getAttribute("aria-current")==="page")&&o===-1&&(o=t.length),t.push({kind:"tab",label:d,href:p});continue}if(b==="scb-dropdown"){const d=a.getAttribute("label")??"";(a.hasAttribute("selected")||a.getAttribute("selected")==="true"||a.getAttribute("active")==="true"||a.getAttribute("aria-current")==="page")&&o===-1&&(o=t.length);const p=`scb-header-tab-${t.length}`;a.getAttribute("slot")!==p&&a.setAttribute("slot",p),a.hasAttribute("as-tab")||a.setAttribute("as-tab",""),t.push({kind:"dropdown",slotName:p,label:d});continue}if(b==="scb-header-utility"){r.push({label:a.getAttribute("label")??"",href:a.getAttribute("href")??"#",target:a.getAttribute("target")??void 0});continue}if(b==="scb-header-drawer-group"){const d={label:a.getAttribute("label")??"",icon:a.getAttribute("icon")??void 0,children:[]};a.querySelectorAll("scb-header-drawer-item").forEach(p=>d.children.push(l(p))),i.push(d);continue}b==="scb-header-drawer-item"&&i.push(l(a))}this._slotNavItems=t,this._slotUtils=r,this._slotMenu=i,!this.hasAttribute("active-tab")&&o>=0&&(this.activeTab=o),queueMicrotask(()=>{this.updateComplete.then(()=>{this._scheduleMeasure()})})},this._measure=()=>{const e=this._top,t=this._logoGroup;if(!e||!t)return;const r=window.innerWidth,i=e.clientWidth,o=this._overflows(this._util),l=this._overflows(this._tabsNav),a=r<this.BP_MD||o||l;this._collapsed?!a&&i>=this._unlockAtWidth&&this._setCollapsed(!1):a&&(this._unlockAtWidth=i+this._HYST,this._setCollapsed(!0));let b=!1;if(this.showSearch&&r>=this.BP_SM&&r<this.BP_MD&&this._searchWrap){const p=getComputedStyle(this._searchWrap),y=Math.max(this._num(p.minWidth,this._tokenPx("--scb-header-search-min",320)),this._tokenPx("--scb-header-search-min",320)),f=this._num(getComputedStyle(e).gap,this._tokenPx("--spacing-7",24)),_=this.showDrawer&&(r<this.BP_MD||this._collapsed)?this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-large",48):0;b=t.getBoundingClientRect().width+f+y+f+_+8>i+.5}this._setHideSearch(b);let d=!1;if(this.showDrawer&&(r<this.BP_MD||this._collapsed)&&!this._visible(this._util)&&!this._visible(this._searchWrap)){const p=this._num(getComputedStyle(e).gap,this._tokenPx("--spacing-7",24)),y=this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-large",48),f=(this._logoGroup?.getBoundingClientRect().width||0)+p+y;this._hideLogoText?d=!(i>=this._logoTextUnlockAt):f>i+.5&&(d=!0,this._logoTextUnlockAt=i+this._HYST)}else d=!1,this._logoTextUnlockAt=0;this._setHideLogoText(d)},this._onMenuClick=async e=>{e.preventDefault(),e.stopPropagation(),this.showDrawer&&(this.dispatchEvent(new CustomEvent("menu-click",{bubbles:!0,composed:!0})),await s._nextFrame(),await s._nextFrame(),this._openDrawerNow())},this._onSearchClick=e=>{const t=this._searchEl;if(t?.submit&&typeof t.submit=="function"){t.submit();return}const r=t?.value??"";this.searchText=r,this.dispatchEvent(new CustomEvent("search-click",{detail:{value:r},bubbles:!0,composed:!0})),t?.focus?.()},this._onTabClick=e=>{const t=e.currentTarget;if(!t)return;const r=t.tagName.toLowerCase()==="a";if(r&&(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey))return;const i=t.getAttribute("data-index"),o=i!=null?Number(i):0,a=this._getNavItems()[o];if(a?.kind==="dropdown")return;this.activeTab=o;const b=a?.kind==="tab"?a.href??"":"",d=new CustomEvent("tab-change",{detail:{index:o,href:b},bubbles:!0,composed:!0,cancelable:!0});!this.dispatchEvent(d)&&r&&e.preventDefault()},this._onDropdownTabActivate=e=>{const t=e.detail?.dataIndex,r=typeof t=="number"?t:typeof t=="string"?Number(t):this._readTabIndexFromEvent(e);if(r==null||!Number.isFinite(r))return;const i=this._getNavItems();r<0||r>=i.length||i[r]?.kind==="dropdown"&&(this.activeTab=r,this.dispatchEvent(new CustomEvent("tab-change",{detail:{index:r,href:""},bubbles:!0,composed:!0,cancelable:!0})))},this._onTabsKeydown=e=>{const t=e.key;if(t!=="ArrowLeft"&&t!=="ArrowRight"&&t!=="Home"&&t!=="End")return;const r=this._getNavItems();if(!r.length)return;const i=this._readTabIndexFromEvent(e);if(i==null)return;let o=Math.max(0,Math.min(r.length-1,i));t==="ArrowRight"?o=(o+1)%r.length:t==="ArrowLeft"?o=(o-1+r.length)%r.length:t==="Home"?o=0:t==="End"&&(o=r.length-1),e.preventDefault(),this._focusTabAtIndex(o)},this._onSearchInput=e=>{this.searchText=e.detail?.value??"",this.dispatchEvent(new CustomEvent("search-input",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:this.searchText},bubbles:!0,composed:!0}))},this._onSearchSubmit=e=>{this.searchText=e.detail?.value??"",this.dispatchEvent(new CustomEvent("search-change",{detail:{value:this.searchText,active:e.detail?.active},bubbles:!0,composed:!0}))},this._onSearchClear=()=>{this.searchText="",this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:""},bubbles:!0,composed:!0}))}}get _HYST(){return this._tokenPx("--spacing-11",64)}get BP_SM(){return this._tokenPx("--bp-sm",s.BP_SM_DEFAULT)}get BP_MD(){return this._tokenPx("--bp-md",s.BP_MD_DEFAULT)}_scheduleHarvest(){this._harvestPending||(this._harvestPending=!0,queueMicrotask(()=>{this._harvestPending=!1,this._harvest()}))}get _top(){return this.renderRoot.querySelector(".top-row")}get _util(){return this.renderRoot.querySelector(".utility")}get _logoGroup(){return this.renderRoot.querySelector(".logo-wrap")||this.renderRoot.querySelector(".logo-group")}get _searchWrap(){return this.renderRoot.querySelector(".search")}get _menuBtn(){return this.renderRoot.querySelector(".menu-trigger")}get _searchEl(){return this.renderRoot.querySelector(`#${this._searchId}`)}get _tabsNav(){return this.renderRoot.querySelector(".tabs-nav")}_attachSlotObservers(){this._slotMo?.disconnect();const e=new MutationObserver(t=>{this._scheduleHarvest()});this._slotMo=e,e.observe(this,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["label","href","icon","target","selected","aria-current","active"]})}_setCollapsed(e){this._collapsed!==e&&(this._collapsed=e,e?this.setAttribute("data-collapsed",""):this.removeAttribute("data-collapsed"))}_setHideSearch(e){e?this.setAttribute("data-hide-search",""):this.removeAttribute("data-hide-search")}_setHideLogoText(e){this._hideLogoText!==e&&(this._hideLogoText=e,e?this.setAttribute("data-hide-logo-text",""):this.removeAttribute("data-hide-logo-text"))}_num(e,t){const r=Number.parseFloat(String(e??"").trim());return Number.isFinite(r)?r:t}_tokenPx(e,t){const r=getComputedStyle(this);return this._num(r.getPropertyValue(e),t)}_visible(e){return e?getComputedStyle(e).display!=="none":!1}_overflows(e){return!e||!this._visible(e)?!1:e.scrollWidth>e.clientWidth+1}firstUpdated(){this.updateComplete.then(()=>{this._harvest(),this._attachSlotObservers()});const e=this._top;e&&(this._ro=new ResizeObserver(()=>this._scheduleMeasure()),this._ro.observe(e)),window.addEventListener("resize",this._onWindowResize,{passive:!0})}updated(e){e.has("searchMax")&&this.style.setProperty("--scb-header-search-max",this.searchMax??"480px"),e.has("searchMin")&&this.style.setProperty("--scb-header-search-min",this.searchMin??"320px"),e.has("searchHeight")&&(this.searchHeight&&this.searchHeight.trim()?this.style.setProperty("--scb-search-height",this.searchHeight.trim()):this.style.removeProperty("--scb-search-height")),e.has("logoHeight")&&(this.logoHeight&&this.logoHeight.trim()?this.style.setProperty("--scb-header-logo-img-h",this.logoHeight.trim()):this.style.removeProperty("--scb-header-logo-img-h")),(e.has("utilityItems")||e.has("tabs")||e.has("logoText")||e.has("logoSrc")||e.has("logoHeight")||e.has("activeTab")||e.has("_slotNavItems")||e.has("_slotUtils")||e.has("_slotMenu")||e.has("showDrawer")||e.has("showSearch")||e.has("searchMax")||e.has("searchMin")||e.has("size"))&&this.updateComplete.then(()=>{this._scheduleMeasure()}),(e.has("activeTab")||e.has("_slotNavItems")||e.has("tabs"))&&this.updateComplete.then(()=>{this._syncDropdownTabs()})}disconnectedCallback(){this._ro?.disconnect(),this._slotMo?.disconnect(),window.removeEventListener("resize",this._onWindowResize),super.disconnectedCallback()}_openDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!0,e.setAttribute("open",""),e.show?.(),e.openDrawer?.(),this._drawerExpanded=!0,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-open",{bubbles:!0,composed:!0})))}_closeDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!1),this._drawerExpanded=!1,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-close",{bubbles:!0,composed:!0}))}_syncMenuBtnAria(){const e=this.renderRoot.querySelector(".menu-trigger");e&&e.setAttribute("aria-expanded",String(this._drawerExpanded))}_getNavItems(){return this._slotNavItems.length?this._slotNavItems:(this.tabs??[]).map(e=>({kind:"tab",...e}))}_syncDropdownTabs(){this._getNavItems().forEach((t,r)=>{if(t.kind!=="dropdown")return;const i=this.querySelector(`scb-dropdown[slot="${t.slotName}"]`);if(!i)return;const o=String(r);i.getAttribute("data-index")!==o&&i.setAttribute("data-index",o),i.hasAttribute("as-tab")||i.setAttribute("as-tab",""),r===this.activeTab?i.getAttribute("aria-current")!=="page"&&i.setAttribute("aria-current","page"):i.hasAttribute("aria-current")&&i.removeAttribute("aria-current")})}_readTabIndexFromEvent(e){const t=e.composedPath?e.composedPath():[];for(const r of t){if(!(r instanceof HTMLElement))continue;const i=r.getAttribute("data-index");if(i==null)continue;const o=Number(i);if(Number.isFinite(o))return o}return null}_focusTabAtIndex(e){const r=this._getNavItems()[e];if(!r)return;if(r.kind==="dropdown"){this.querySelector(`scb-dropdown[slot="${r.slotName}"]`)?.focus?.();return}this.renderRoot.querySelector(`.tab-link[data-index="${e}"]`)?.focus?.()}_renderDrawerNodes(e){return!e||e.length===0?c``:c`${e.map(t=>{const r=Array.isArray(t.children)&&t.children.length>0;return c`
1
+ import{a as w,n as h,r as m,i as x,x as c,E as u,t as S}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";import"../scb-grid/scb-grid-item.js";import"../scb-grid/scb-grid.js";import"../scb-link/scb-link.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-button/scb-button.js";import"../scb-search/scb-search.js";import"../scb-drawer/scb-drawer.js";import"../scb-dropdown/scb-dropdown.js";import"../scb-grid/scb-stack.js";import"../../vendor/preload-helper.js";import"../scb-tooltip/scb-tooltip.js";import"../scb-list/scb-list.js";import"../scb-list/scb-list-item.js";import"../scb-divider/scb-divider.js";import"../scb-options-menu/scb-options-menu.js";import"../scb-options-menu/scb-options-menu-item.js";import"../scb-options-menu/scb-options-sub-menu.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(r,i,o){try{customElements.get(r)||t(r,i,o)}catch(a){var l=String(a||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw a}}}}catch{}})();var A=Object.defineProperty,C=Object.getOwnPropertyDescriptor,n=(e,t,r,i)=>{for(var o=i>1?void 0:i?C(t,r):t,l=e.length-1,a;l>=0;l--)(a=e[l])&&(o=(i?a(t,r,o):a(o))||o);return i&&o&&A(t,r,o),o};const v={fromAttribute:e=>e==null?!0:!/^(false|0|off|no)$/i.test(e),toAttribute:e=>String(!!e)},k={fromAttribute:e=>e==="small"||e==="large"?e:"medium",toAttribute:e=>{const t=String(e??"");return t==="small"||t==="large"?t:null}};let s=class extends x{constructor(){super(...arguments),this.maxWidth="1440px",this.size="medium",this.logoText="",this.logoHref="/",this.logoSrc="",this.logoHeight="",this.logoInvertDm=!1,this.banner=!1,this.tabs=[],this.activeTab=null,this.utilityItems=[],this.showDrawer=!0,this.showSearch=!0,this.includeUtilityInDrawer=!1,this.drawerOverlay=!0,this.searchText="",this._drawerId="main-drawer",this._drawerExpanded=!1,this._searchId="header-search",this._slotNavItems=[],this._slotUtils=[],this._slotMenu=[],this._measureScheduled=!1,this._scheduleMeasure=()=>{this._measureScheduled||(this._measureScheduled=!0,requestAnimationFrame(()=>{this._measureScheduled=!1,this._measure()}))},this._onWindowResize=()=>{this._scheduleMeasure()},this._onDrawerSelect=e=>{this.dispatchEvent(new CustomEvent("drawer-select",{detail:e.detail,bubbles:!0,composed:!0})),this._closeDrawerNow()},this._collapsed=!1,this._unlockAtWidth=0,this._hideLogoText=!1,this._logoTextUnlockAt=0,this._harvestPending=!1,this._harvest=()=>{const e=Array.from(this.children),t=[],r=[],i=[];let o=-1;const l=a=>({label:a.getAttribute("label")??"",href:a.getAttribute("href")??void 0,icon:a.getAttribute("icon")??void 0});for(const a of e){const b=a.tagName.toLowerCase();if(b==="scb-header-tab"){const d=a.getAttribute("label")??"",g=a.getAttribute("href"),p=g&&g.trim()!==""?g:void 0;(a.hasAttribute("selected")||a.getAttribute("selected")==="true"||a.getAttribute("active")==="true"||a.getAttribute("aria-current")==="page")&&o===-1&&(o=t.length),t.push({kind:"tab",label:d,href:p});continue}if(b==="scb-dropdown"){const d=a.getAttribute("label")??"";(a.hasAttribute("selected")||a.getAttribute("selected")==="true"||a.getAttribute("active")==="true"||a.getAttribute("aria-current")==="page")&&o===-1&&(o=t.length);const p=`scb-header-tab-${t.length}`;a.getAttribute("slot")!==p&&a.setAttribute("slot",p),a.hasAttribute("as-tab")||a.setAttribute("as-tab",""),t.push({kind:"dropdown",slotName:p,label:d});continue}if(b==="scb-header-utility"){r.push({label:a.getAttribute("label")??"",href:a.getAttribute("href")??"#",target:a.getAttribute("target")??void 0});continue}if(b==="scb-header-drawer-group"){const d={label:a.getAttribute("label")??"",icon:a.getAttribute("icon")??void 0,children:[]};a.querySelectorAll("scb-header-drawer-item").forEach(p=>d.children.push(l(p))),i.push(d);continue}b==="scb-header-drawer-item"&&i.push(l(a))}this._slotNavItems=t,this._slotUtils=r,this._slotMenu=i,!this.hasAttribute("active-tab")&&o>=0&&(this.activeTab=o),queueMicrotask(()=>{this.updateComplete.then(()=>{this._scheduleMeasure()})})},this._measure=()=>{const e=this._top,t=this._logoGroup;if(!e||!t)return;const r=window.innerWidth,i=e.clientWidth,o=this._overflows(this._util),l=this._overflows(this._tabsNav),a=r<this.BP_MD||o||l;this._collapsed?!a&&i>=this._unlockAtWidth&&this._setCollapsed(!1):a&&(this._unlockAtWidth=i+this._HYST,this._setCollapsed(!0));let b=!1;if(this.showSearch&&r>=this.BP_SM&&r<this.BP_MD&&this._searchWrap){const p=getComputedStyle(this._searchWrap),y=Math.max(this._num(p.minWidth,this._tokenPx("--scb-header-search-min",320)),this._tokenPx("--scb-header-search-min",320)),f=this._num(getComputedStyle(e).gap,this._tokenPx("--spacing-7",24)),_=this.showDrawer&&(r<this.BP_MD||this._collapsed)?this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-large",48):0;b=t.getBoundingClientRect().width+f+y+f+_+8>i+.5}this._setHideSearch(b);let d=!1;if(this.showDrawer&&(r<this.BP_MD||this._collapsed)&&!this._visible(this._util)&&!this._visible(this._searchWrap)){const p=this._num(getComputedStyle(e).gap,this._tokenPx("--spacing-7",24)),y=this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-large",48),f=(this._logoGroup?.getBoundingClientRect().width||0)+p+y;this._hideLogoText?d=!(i>=this._logoTextUnlockAt):f>i+.5&&(d=!0,this._logoTextUnlockAt=i+this._HYST)}else d=!1,this._logoTextUnlockAt=0;this._setHideLogoText(d)},this._onMenuClick=async e=>{e.preventDefault(),e.stopPropagation(),this.showDrawer&&(this.dispatchEvent(new CustomEvent("menu-click",{bubbles:!0,composed:!0})),await s._nextFrame(),await s._nextFrame(),this._openDrawerNow())},this._onSearchClick=e=>{const t=this._searchEl;if(t?.submit&&typeof t.submit=="function"){t.submit();return}const r=t?.value??"";this.searchText=r,this.dispatchEvent(new CustomEvent("search-click",{detail:{value:r},bubbles:!0,composed:!0})),t?.focus?.()},this._onTabClick=e=>{const t=e.currentTarget;if(!t)return;const r=t.tagName.toLowerCase()==="a";if(r&&(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey))return;const i=t.getAttribute("data-index"),o=i!=null?Number(i):0,a=this._getNavItems()[o];if(a?.kind==="dropdown")return;this.activeTab=o;const b=a?.kind==="tab"?a.href??"":"",d=new CustomEvent("tab-change",{detail:{index:o,href:b},bubbles:!0,composed:!0,cancelable:!0});!this.dispatchEvent(d)&&r&&e.preventDefault()},this._onDropdownTabActivate=e=>{const t=e.detail?.dataIndex,r=typeof t=="number"?t:typeof t=="string"?Number(t):this._readTabIndexFromEvent(e);if(r==null||!Number.isFinite(r))return;const i=this._getNavItems();r<0||r>=i.length||i[r]?.kind==="dropdown"&&(this.activeTab=r,this.dispatchEvent(new CustomEvent("tab-change",{detail:{index:r,href:""},bubbles:!0,composed:!0,cancelable:!0})))},this._onTabsKeydown=e=>{const t=e.key;if(t!=="ArrowLeft"&&t!=="ArrowRight"&&t!=="Home"&&t!=="End")return;const r=this._getNavItems();if(!r.length)return;const i=this._readTabIndexFromEvent(e);if(i==null)return;let o=Math.max(0,Math.min(r.length-1,i));t==="ArrowRight"?o=(o+1)%r.length:t==="ArrowLeft"?o=(o-1+r.length)%r.length:t==="Home"?o=0:t==="End"&&(o=r.length-1),e.preventDefault(),this._focusTabAtIndex(o)},this._onSearchInput=e=>{this.searchText=e.detail?.value??"",this.dispatchEvent(new CustomEvent("search-input",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:this.searchText},bubbles:!0,composed:!0}))},this._onSearchSubmit=e=>{this.searchText=e.detail?.value??"",this.dispatchEvent(new CustomEvent("search-change",{detail:{value:this.searchText,active:e.detail?.active},bubbles:!0,composed:!0}))},this._onSearchClear=()=>{this.searchText="",this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:""},bubbles:!0,composed:!0}))}}get _HYST(){return this._tokenPx("--spacing-11",64)}get BP_SM(){return this._tokenPx("--bp-sm",s.BP_SM_DEFAULT)}get BP_MD(){return this._tokenPx("--bp-md",s.BP_MD_DEFAULT)}_scheduleHarvest(){this._harvestPending||(this._harvestPending=!0,queueMicrotask(()=>{this._harvestPending=!1,this._harvest()}))}get _top(){return this.renderRoot.querySelector(".top-row")}get _util(){return this.renderRoot.querySelector(".utility")}get _logoGroup(){return this.renderRoot.querySelector(".logo-wrap")||this.renderRoot.querySelector(".logo-group")}get _searchWrap(){return this.renderRoot.querySelector(".search")}get _menuBtn(){return this.renderRoot.querySelector(".menu-trigger")}get _searchEl(){return this.renderRoot.querySelector(`#${this._searchId}`)}get _tabsNav(){return this.renderRoot.querySelector(".tabs-nav")}_attachSlotObservers(){this._slotMo?.disconnect();const e=new MutationObserver(t=>{this._scheduleHarvest()});this._slotMo=e,e.observe(this,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["label","href","icon","target","selected","aria-current","active"]})}_setCollapsed(e){this._collapsed!==e&&(this._collapsed=e,e?this.setAttribute("data-collapsed",""):this.removeAttribute("data-collapsed"))}_setHideSearch(e){e?this.setAttribute("data-hide-search",""):this.removeAttribute("data-hide-search")}_setHideLogoText(e){this._hideLogoText!==e&&(this._hideLogoText=e,e?this.setAttribute("data-hide-logo-text",""):this.removeAttribute("data-hide-logo-text"))}_num(e,t){const r=Number.parseFloat(String(e??"").trim());return Number.isFinite(r)?r:t}_tokenPx(e,t){const r=getComputedStyle(this);return this._num(r.getPropertyValue(e),t)}_visible(e){return e?getComputedStyle(e).display!=="none":!1}_overflows(e){return!e||!this._visible(e)?!1:e.scrollWidth>e.clientWidth+1}firstUpdated(){this.updateComplete.then(()=>{this._harvest(),this._attachSlotObservers()});const e=this._top;e&&(this._ro=new ResizeObserver(()=>this._scheduleMeasure()),this._ro.observe(e)),window.addEventListener("resize",this._onWindowResize,{passive:!0})}updated(e){e.has("searchMax")&&this.style.setProperty("--scb-header-search-max",this.searchMax??"480px"),e.has("searchMin")&&this.style.setProperty("--scb-header-search-min",this.searchMin??"320px"),e.has("searchHeight")&&(this.searchHeight&&this.searchHeight.trim()?this.style.setProperty("--scb-search-height",this.searchHeight.trim()):this.style.removeProperty("--scb-search-height")),e.has("logoHeight")&&(this.logoHeight&&this.logoHeight.trim()?this.style.setProperty("--scb-header-logo-img-h",this.logoHeight.trim()):this.style.removeProperty("--scb-header-logo-img-h")),(e.has("utilityItems")||e.has("tabs")||e.has("logoText")||e.has("logoSrc")||e.has("logoHeight")||e.has("activeTab")||e.has("_slotNavItems")||e.has("_slotUtils")||e.has("_slotMenu")||e.has("showDrawer")||e.has("showSearch")||e.has("searchMax")||e.has("searchMin")||e.has("size"))&&this.updateComplete.then(()=>{this._scheduleMeasure()}),(e.has("activeTab")||e.has("_slotNavItems")||e.has("tabs"))&&this.updateComplete.then(()=>{this._syncDropdownTabs()})}disconnectedCallback(){this._ro?.disconnect(),this._slotMo?.disconnect(),window.removeEventListener("resize",this._onWindowResize),super.disconnectedCallback()}_openDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!0,e.setAttribute("open",""),e.show?.(),e.openDrawer?.(),this._drawerExpanded=!0,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-open",{bubbles:!0,composed:!0})))}_closeDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!1),this._drawerExpanded=!1,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-close",{bubbles:!0,composed:!0}))}_syncMenuBtnAria(){const e=this.renderRoot.querySelector(".menu-trigger");e&&e.setAttribute("aria-expanded",String(this._drawerExpanded))}_getNavItems(){return this._slotNavItems.length?this._slotNavItems:(this.tabs??[]).map(e=>({kind:"tab",...e}))}_syncDropdownTabs(){this._getNavItems().forEach((t,r)=>{if(t.kind!=="dropdown")return;const i=this.querySelector(`scb-dropdown[slot="${t.slotName}"]`);if(!i)return;const o=String(r);i.getAttribute("data-index")!==o&&i.setAttribute("data-index",o),i.hasAttribute("as-tab")||i.setAttribute("as-tab",""),r===this.activeTab?i.getAttribute("aria-current")!=="page"&&i.setAttribute("aria-current","page"):i.hasAttribute("aria-current")&&i.removeAttribute("aria-current")})}_readTabIndexFromEvent(e){const t=e.composedPath?e.composedPath():[];for(const r of t){if(!(r instanceof HTMLElement))continue;const i=r.getAttribute("data-index");if(i==null)continue;const o=Number(i);if(Number.isFinite(o))return o}return null}_focusTabAtIndex(e){const r=this._getNavItems()[e];if(!r)return;if(r.kind==="dropdown"){this.querySelector(`scb-dropdown[slot="${r.slotName}"]`)?.focus?.();return}this.renderRoot.querySelector(`.tab-link[data-index="${e}"]`)?.focus?.()}_renderDrawerNodes(e){return!e||e.length===0?c``:c`${e.map(t=>{const r=Array.isArray(t.children)&&t.children.length>0;return c`
2
2
  <scb-drawer-item
3
3
  label=${t.label}
4
4
  ?selected=${!1}