scb-wc-test 0.1.60 → 0.1.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{a as d,n as o,i as y,x as g,t as b}from"../../vendor/vendor.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(s,i,a){try{customElements.get(s)||t(s,i,a)}catch(p){var c=String(p||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw p}}}}catch{}})();var v=Object.defineProperty,_=Object.getOwnPropertyDescriptor,f=e=>{throw TypeError(e)},n=(e,t,s,i)=>{for(var a=i>1?void 0:i?_(t,s):t,c=e.length-1,p;c>=0;c--)(p=e[c])&&(a=(i?p(t,s,a):p(a))||a);return i&&a&&v(t,s,a),a},m=(e,t,s)=>t.has(e)||f("Cannot "+s),w=(e,t,s)=>t.has(e)?f("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),u=(e,t,s)=>(m(e,t,"access private method"),s),l,h;let r=class extends y{constructor(){super(...arguments),w(this,l),this.direction="column",this.gap="",this.rowGap="",this.columnGap="",this.align="stretch",this.justify="start",this.wrap=!1,this.inline=!1}firstUpdated(){u(this,l,h).call(this)}updated(){u(this,l,h).call(this)}mapSpacingToken(e){if(!e)return;const t=String(e).trim();return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}parseGapShorthand(e){if(!e)return{};const t=e.trim().split(/\s+/);if(t.length===1){const s=this.mapSpacingToken(t[0]);return{row:s,col:s}}return{row:this.mapSpacingToken(t[0]),col:this.mapSpacingToken(t[1])}}render(){return g`<slot></slot>`}};l=new WeakSet;h=function(){this.style.setProperty("--scb-stack-direction",this.direction);const e="var(--spacing-5, 16px)",t=this.parseGapShorthand(this.gap),s=this.mapSpacingToken(this.rowGap)??t.row??e,i=this.mapSpacingToken(this.columnGap)??t.col??e;this.style.setProperty("--scb-stack-gap",`${s}`),this.style.setProperty("--scb-stack-row-gap",s),this.style.setProperty("--scb-stack-column-gap",i);const a={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch",baseline:"baseline"},c={start:"flex-start",center:"center",end:"flex-end",between:"space-between",around:"space-around",evenly:"space-evenly"};this.style.setProperty("--scb-stack-align",a[this.align]??"stretch"),this.style.setProperty("--scb-stack-justify",c[this.justify]??"flex-start"),this.style.setProperty("--scb-stack-wrap",this.wrap?"wrap":"nowrap")};r.styles=d`
1
+ import{a as d,n as o,i as y,x as g,t as b}from"../../vendor/vendor.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(s,i,a){try{customElements.get(s)||t(s,i,a)}catch(p){var c=String(p||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw p}}}}catch{}})();var v=Object.defineProperty,m=Object.getOwnPropertyDescriptor,u=e=>{throw TypeError(e)},n=(e,t,s,i)=>{for(var a=i>1?void 0:i?m(t,s):t,c=e.length-1,p;c>=0;c--)(p=e[c])&&(a=(i?p(t,s,a):p(a))||a);return i&&a&&v(t,s,a),a},w=(e,t,s)=>t.has(e)||u("Cannot "+s),_=(e,t,s)=>t.has(e)?u("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),f=(e,t,s)=>(w(e,t,"access private method"),s),l,h;let r=class extends y{constructor(){super(...arguments),_(this,l),this.direction="column",this.gap="",this.rowGap="",this.columnGap="",this.align="stretch",this.justify="start",this.wrap=!1,this.inline=!1}firstUpdated(){f(this,l,h).call(this)}updated(){f(this,l,h).call(this)}mapSpacingToken(e){if(!e)return;const t=String(e).trim();return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}parseGapShorthand(e){if(!e)return{};const t=e.trim().split(/\s+/);if(t.length===1){const s=this.mapSpacingToken(t[0]);return{row:s,col:s}}return{row:this.mapSpacingToken(t[0]),col:this.mapSpacingToken(t[1])}}render(){return g`<slot></slot>`}};l=new WeakSet;h=function(){this.style.setProperty("--scb-stack-direction",this.direction);const e="var(--spacing-5, 16px)",t=this.parseGapShorthand(this.gap),s=this.mapSpacingToken(this.rowGap)??t.row??e,i=this.mapSpacingToken(this.columnGap)??t.col??e;this.style.setProperty("--scb-stack-gap",`${s}`),this.style.setProperty("--scb-stack-row-gap",s),this.style.setProperty("--scb-stack-column-gap",i);const a={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch",baseline:"baseline"},c={start:"flex-start",center:"center",end:"flex-end",between:"space-between",around:"space-around",evenly:"space-evenly"};this.style.setProperty("--scb-stack-align",a[this.align]??"stretch"),this.style.setProperty("--scb-stack-justify",c[this.justify]??"flex-start"),this.style.setProperty("--scb-stack-wrap",this.wrap?"wrap":"nowrap")};r.styles=d`
2
2
  :host {
3
3
  box-sizing: border-box;
4
4
  display: var(--scb-stack-display, flex);
@@ -17,4 +17,9 @@ import{a as d,n as o,i as y,x as g,t as b}from"../../vendor/vendor.js";(function
17
17
  min-inline-size: 0;
18
18
  }
19
19
  :host([inline]) { --scb-stack-display: inline-flex; }
20
+
21
+ /* Barnens flex-beteende i rad-läge kan styras via variabeln och defaultar till att inte ta full bredd */
22
+ :host([direction="row"]) ::slotted(*) {
23
+ flex: var(--scb-stack-item-flex, 0 0 auto);
24
+ }
20
25
  `;n([o({type:String,reflect:!0})],r.prototype,"direction",2);n([o({type:String,reflect:!0})],r.prototype,"gap",2);n([o({type:String,attribute:"row-gap",reflect:!0})],r.prototype,"rowGap",2);n([o({type:String,attribute:"column-gap",reflect:!0})],r.prototype,"columnGap",2);n([o({type:String,reflect:!0})],r.prototype,"align",2);n([o({type:String,reflect:!0})],r.prototype,"justify",2);n([o({type:Boolean,reflect:!0})],r.prototype,"wrap",2);n([o({type:Boolean,reflect:!0})],r.prototype,"inline",2);r=n([b("scb-stack")],r);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scb-wc-test",
3
- "version": "0.1.60",
3
+ "version": "0.1.61",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -1,21 +1,21 @@
1
- import { css as f, LitElement as g, html as d } from "lit";
2
- import { property as c, customElement as m } from "lit/decorators.js";
3
- var b = Object.defineProperty, v = Object.getOwnPropertyDescriptor, u = (e) => {
1
+ import { css as y, LitElement as g, html as d } from "lit";
2
+ import { property as i, customElement as b } from "lit/decorators.js";
3
+ var m = Object.defineProperty, v = Object.getOwnPropertyDescriptor, u = (e) => {
4
4
  throw TypeError(e);
5
- }, n = (e, t, s, i) => {
6
- for (var a = i > 1 ? void 0 : i ? v(t, s) : t, p = e.length - 1, l; p >= 0; p--)
7
- (l = e[p]) && (a = (i ? l(t, s, a) : l(a)) || a);
8
- return i && a && b(t, s, a), a;
9
- }, k = (e, t, s) => t.has(e) || u("Cannot " + s), w = (e, t, s) => t.has(e) ? u("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), y = (e, t, s) => (k(e, t, "access private method"), s), o, h;
10
- let r = class extends g {
5
+ }, n = (e, t, s, c) => {
6
+ for (var r = c > 1 ? void 0 : c ? v(t, s) : t, o = e.length - 1, l; o >= 0; o--)
7
+ (l = e[o]) && (r = (c ? l(t, s, r) : l(r)) || r);
8
+ return c && r && m(t, s, r), r;
9
+ }, k = (e, t, s) => t.has(e) || u("Cannot " + s), w = (e, t, s) => t.has(e) ? u("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), f = (e, t, s) => (k(e, t, "access private method"), s), p, h;
10
+ let a = class extends g {
11
11
  constructor() {
12
- super(...arguments), w(this, o), this.direction = "column", this.gap = "", this.rowGap = "", this.columnGap = "", this.align = "stretch", this.justify = "start", this.wrap = !1, this.inline = !1;
12
+ super(...arguments), w(this, p), this.direction = "column", this.gap = "", this.rowGap = "", this.columnGap = "", this.align = "stretch", this.justify = "start", this.wrap = !1, this.inline = !1;
13
13
  }
14
14
  firstUpdated() {
15
- y(this, o, h).call(this);
15
+ f(this, p, h).call(this);
16
16
  }
17
17
  updated() {
18
- y(this, o, h).call(this);
18
+ f(this, p, h).call(this);
19
19
  }
20
20
  mapSpacingToken(e) {
21
21
  if (!e) return;
@@ -35,18 +35,18 @@ let r = class extends g {
35
35
  return d`<slot></slot>`;
36
36
  }
37
37
  };
38
- o = /* @__PURE__ */ new WeakSet();
38
+ p = /* @__PURE__ */ new WeakSet();
39
39
  h = function() {
40
40
  this.style.setProperty("--scb-stack-direction", this.direction);
41
- const e = "var(--spacing-5, 16px)", t = this.parseGapShorthand(this.gap), s = this.mapSpacingToken(this.rowGap) ?? t.row ?? e, i = this.mapSpacingToken(this.columnGap) ?? t.col ?? e;
42
- this.style.setProperty("--scb-stack-gap", `${s}`), this.style.setProperty("--scb-stack-row-gap", s), this.style.setProperty("--scb-stack-column-gap", i);
43
- const a = {
41
+ const e = "var(--spacing-5, 16px)", t = this.parseGapShorthand(this.gap), s = this.mapSpacingToken(this.rowGap) ?? t.row ?? e, c = this.mapSpacingToken(this.columnGap) ?? t.col ?? e;
42
+ this.style.setProperty("--scb-stack-gap", `${s}`), this.style.setProperty("--scb-stack-row-gap", s), this.style.setProperty("--scb-stack-column-gap", c);
43
+ const r = {
44
44
  start: "flex-start",
45
45
  center: "center",
46
46
  end: "flex-end",
47
47
  stretch: "stretch",
48
48
  baseline: "baseline"
49
- }, p = {
49
+ }, o = {
50
50
  start: "flex-start",
51
51
  center: "center",
52
52
  end: "flex-end",
@@ -54,9 +54,9 @@ h = function() {
54
54
  around: "space-around",
55
55
  evenly: "space-evenly"
56
56
  };
57
- this.style.setProperty("--scb-stack-align", a[this.align] ?? "stretch"), this.style.setProperty("--scb-stack-justify", p[this.justify] ?? "flex-start"), this.style.setProperty("--scb-stack-wrap", this.wrap ? "wrap" : "nowrap");
57
+ this.style.setProperty("--scb-stack-align", r[this.align] ?? "stretch"), this.style.setProperty("--scb-stack-justify", o[this.justify] ?? "flex-start"), this.style.setProperty("--scb-stack-wrap", this.wrap ? "wrap" : "nowrap");
58
58
  };
59
- r.styles = f`
59
+ a.styles = y`
60
60
  :host {
61
61
  box-sizing: border-box;
62
62
  display: var(--scb-stack-display, flex);
@@ -75,34 +75,39 @@ r.styles = f`
75
75
  min-inline-size: 0;
76
76
  }
77
77
  :host([inline]) { --scb-stack-display: inline-flex; }
78
+
79
+ /* Barnens flex-beteende i rad-läge kan styras via variabeln och defaultar till att inte ta full bredd */
80
+ :host([direction="row"]) ::slotted(*) {
81
+ flex: var(--scb-stack-item-flex, 0 0 auto);
82
+ }
78
83
  `;
79
84
  n([
80
- c({ type: String, reflect: !0 })
81
- ], r.prototype, "direction", 2);
85
+ i({ type: String, reflect: !0 })
86
+ ], a.prototype, "direction", 2);
82
87
  n([
83
- c({ type: String, reflect: !0 })
84
- ], r.prototype, "gap", 2);
88
+ i({ type: String, reflect: !0 })
89
+ ], a.prototype, "gap", 2);
85
90
  n([
86
- c({ type: String, attribute: "row-gap", reflect: !0 })
87
- ], r.prototype, "rowGap", 2);
91
+ i({ type: String, attribute: "row-gap", reflect: !0 })
92
+ ], a.prototype, "rowGap", 2);
88
93
  n([
89
- c({ type: String, attribute: "column-gap", reflect: !0 })
90
- ], r.prototype, "columnGap", 2);
94
+ i({ type: String, attribute: "column-gap", reflect: !0 })
95
+ ], a.prototype, "columnGap", 2);
91
96
  n([
92
- c({ type: String, reflect: !0 })
93
- ], r.prototype, "align", 2);
97
+ i({ type: String, reflect: !0 })
98
+ ], a.prototype, "align", 2);
94
99
  n([
95
- c({ type: String, reflect: !0 })
96
- ], r.prototype, "justify", 2);
100
+ i({ type: String, reflect: !0 })
101
+ ], a.prototype, "justify", 2);
97
102
  n([
98
- c({ type: Boolean, reflect: !0 })
99
- ], r.prototype, "wrap", 2);
103
+ i({ type: Boolean, reflect: !0 })
104
+ ], a.prototype, "wrap", 2);
100
105
  n([
101
- c({ type: Boolean, reflect: !0 })
102
- ], r.prototype, "inline", 2);
103
- r = n([
104
- m("scb-stack")
105
- ], r);
106
+ i({ type: Boolean, reflect: !0 })
107
+ ], a.prototype, "inline", 2);
108
+ a = n([
109
+ b("scb-stack")
110
+ ], a);
106
111
  export {
107
- r as ScbStack
112
+ a as ScbStack
108
113
  };
@@ -4754,6 +4754,11 @@ var ScbWcTest=function(a){"use strict";var _s;function d(o,e,t,r){var i=argument
4754
4754
  min-inline-size: 0;
4755
4755
  }
4756
4756
  :host([inline]) { --scb-stack-display: inline-flex; }
4757
+
4758
+ /* Barnens flex-beteende i rad-läge kan styras via variabeln och defaultar till att inte ta full bredd */
4759
+ :host([direction="row"]) ::slotted(*) {
4760
+ flex: var(--scb-stack-item-flex, 0 0 auto);
4761
+ }
4757
4762
  `,Oe([l({type:String,reflect:!0})],a.ScbStack.prototype,"direction",2),Oe([l({type:String,reflect:!0})],a.ScbStack.prototype,"gap",2),Oe([l({type:String,attribute:"row-gap",reflect:!0})],a.ScbStack.prototype,"rowGap",2),Oe([l({type:String,attribute:"column-gap",reflect:!0})],a.ScbStack.prototype,"columnGap",2),Oe([l({type:String,reflect:!0})],a.ScbStack.prototype,"align",2),Oe([l({type:String,reflect:!0})],a.ScbStack.prototype,"justify",2),Oe([l({type:Boolean,reflect:!0})],a.ScbStack.prototype,"wrap",2),Oe([l({type:Boolean,reflect:!0})],a.ScbStack.prototype,"inline",2),a.ScbStack=Oe([b("scb-stack")],a.ScbStack);var Kd=Object.defineProperty,Yd=Object.getOwnPropertyDescriptor,Eo=(o,e,t,r)=>{for(var i=r>1?void 0:r?Yd(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&Kd(e,t,i),i};a.ScbHeaderDrawerGroup=class extends g{constructor(){super(...arguments),this.label=""}render(){return c`<slot></slot>`}},a.ScbHeaderDrawerGroup.styles=f`:host{display:none !important}`,Eo([l({type:String})],a.ScbHeaderDrawerGroup.prototype,"label",2),Eo([l({type:String})],a.ScbHeaderDrawerGroup.prototype,"icon",2),a.ScbHeaderDrawerGroup=Eo([b("scb-header-drawer-group")],a.ScbHeaderDrawerGroup);var Xd=Object.defineProperty,Zd=Object.getOwnPropertyDescriptor,oi=(o,e,t,r)=>{for(var i=r>1?void 0:r?Zd(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&Xd(e,t,i),i};a.ScbHeaderDrawerItem=class extends g{constructor(){super(...arguments),this.label="",this.href="#"}render(){return c`<slot></slot>`}},a.ScbHeaderDrawerItem.styles=f`:host{display:none !important}`,oi([l({type:String})],a.ScbHeaderDrawerItem.prototype,"label",2),oi([l({type:String})],a.ScbHeaderDrawerItem.prototype,"href",2),oi([l({type:String})],a.ScbHeaderDrawerItem.prototype,"icon",2),a.ScbHeaderDrawerItem=oi([b("scb-header-drawer-item")],a.ScbHeaderDrawerItem);var Jd=Object.defineProperty,Qd=Object.getOwnPropertyDescriptor,Ao=(o,e,t,r)=>{for(var i=r>1?void 0:r?Qd(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&Jd(e,t,i),i};a.ScbHeaderTab=class extends g{constructor(){super(...arguments),this.label="",this.href="#"}render(){return c`<slot></slot>`}},a.ScbHeaderTab.styles=f`:host{display:none !important}`,Ao([l({type:String})],a.ScbHeaderTab.prototype,"label",2),Ao([l({type:String})],a.ScbHeaderTab.prototype,"href",2),a.ScbHeaderTab=Ao([b("scb-header-tab")],a.ScbHeaderTab);var eh=Object.defineProperty,th=Object.getOwnPropertyDescriptor,ai=(o,e,t,r)=>{for(var i=r>1?void 0:r?th(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&eh(e,t,i),i};a.ScbHeaderUtility=class extends g{constructor(){super(...arguments),this.label="",this.href="#"}render(){return c`<slot></slot>`}},a.ScbHeaderUtility.styles=f`:host{display:none !important}`,ai([l({type:String})],a.ScbHeaderUtility.prototype,"label",2),ai([l({type:String})],a.ScbHeaderUtility.prototype,"href",2),ai([l({type:String})],a.ScbHeaderUtility.prototype,"target",2),a.ScbHeaderUtility=ai([b("scb-header-utility")],a.ScbHeaderUtility);var rh=Object.defineProperty,ih=Object.getOwnPropertyDescriptor,z=(o,e,t,r)=>{for(var i=r>1?void 0:r?ih(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&rh(e,t,i),i};const Io={fromAttribute:o=>o==null?!0:!/^(false|0|off|no)$/i.test(o),toAttribute:o=>String(!!o)};a.ScbHeader=class extends g{constructor(){super(...arguments),this.maxWidth="1440px",this.logoText="",this.logoHref="/",this.banner=!1,this.tabs=[],this.activeTab=0,this.utilityItems=[],this.showDrawer=!0,this.showSearch=!0,this.includeUtilityInDrawer=!1,this._drawerId="main-drawer",this._drawerMounted=!1,this._drawerExpanded=!1,this._searchId="header-search",this._slotTabs=[],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.__drawerLoaded=!1,this.__tabsLoaded=!1,this.__searchLoaded=!1,this._harvest=()=>{const e=this._slotEl;if(!e)return;const t=e.assignedElements({flatten:!0}),r=[],i=[],s=[],n=h=>({label:h.getAttribute("label")??"",href:h.getAttribute("href")??void 0,icon:h.getAttribute("icon")??void 0});for(const h of t){const u=h.tagName.toLowerCase();if(u==="scb-header-tab"){r.push({label:h.getAttribute("label")??"",href:h.getAttribute("href")??"#"});continue}if(u==="scb-header-utility"){i.push({label:h.getAttribute("label")??"",href:h.getAttribute("href")??"#",target:h.getAttribute("target")??void 0});continue}if(u==="scb-header-drawer-group"){const v={label:h.getAttribute("label")??"",icon:h.getAttribute("icon")??void 0,children:[]};h.querySelectorAll("scb-header-drawer-item").forEach(m=>v.children.push(n(m))),s.push(v);continue}u==="scb-header-drawer-item"&&s.push(n(h))}this._slotTabs=r,this._slotUtils=i,this._slotMenu=s,queueMicrotask(()=>{this.updateComplete.then(()=>{this._applyActiveToTabs(),this._scheduleMeasure()})})},this._measure=()=>{var m,_,x;const e=this._top,t=this._logoGroup;if(!e||!t)return;const r=window.innerWidth,i=e.clientWidth,s=this._overflows(this._util),n=this._overflows(this._tabsEl),h=r<this.BP_MD||s||n;this._collapsed?!h&&i>=this._unlockAtWidth&&this._setCollapsed(!1):h&&(this._unlockAtWidth=i+this._HYST,this._setCollapsed(!0));let u=!1;if(this.showSearch&&r>=this.BP_SM&&r<this.BP_MD&&this._searchWrap){const S=getComputedStyle(this._searchWrap),C=Math.max(this._num(S.minWidth,this._tokenPx("--scb-header-search-min",320)),this._tokenPx("--scb-header-search-min",320)),I=this._num(getComputedStyle(e).gap,this._tokenPx("--spacing-7",24)),T=this.showDrawer&&(r<this.BP_MD||this._collapsed)?((m=this._menuBtn)==null?void 0:m.getBoundingClientRect().width)||this._tokenPx("--icon-size-large",48):0;u=t.getBoundingClientRect().width+I+C+I+T+8>i+.5}this._setHideSearch(u);let v=!1;if(this.showDrawer&&(r<this.BP_MD||this._collapsed)&&!this._visible(this._util)&&!this._visible(this._searchWrap)){const S=this._num(getComputedStyle(e).gap,this._tokenPx("--spacing-7",24)),C=((_=this._menuBtn)==null?void 0:_.getBoundingClientRect().width)||this._tokenPx("--icon-size-large",48),I=(((x=this._logoGroup)==null?void 0:x.getBoundingClientRect().width)||0)+S+C;this._hideLogoText?v=!(i>=this._logoTextUnlockAt):I>i+.5&&(v=!0,this._logoTextUnlockAt=i+this._HYST)}else v=!1,this._logoTextUnlockAt=0;this._setHideLogoText(v)},this._onMenuClick=async e=>{e.preventDefault(),e.stopPropagation(),this.showDrawer&&(this.dispatchEvent(new CustomEvent("menu-click",{bubbles:!0,composed:!0})),await this._ensureDrawerMounted(),await a.ScbHeader._nextFrame(),await a.ScbHeader._nextFrame(),this._openDrawerNow())},this._onSearchClick=e=>{var i;const t=this._searchEl;if(t!=null&&t.submit&&typeof t.submit=="function"){t.submit();return}const r=(t==null?void 0:t.value)??void 0;this.dispatchEvent(new CustomEvent("search-click",{detail:{value:r},bubbles:!0,composed:!0})),(i=t==null?void 0:t.focus)==null||i.call(t)},this._onTabsChange=e=>{var n,h,u;const t=e,r=((n=t==null?void 0:t.detail)==null?void 0:n.activeTabIndex)??((h=e.target)==null?void 0:h.activeTabIndex)??0;this.activeTab=r;const s=((u=(this._slotTabs.length?this._slotTabs:this.tabs)[r])==null?void 0:u.href)??"";this.dispatchEvent(new CustomEvent("tab-change",{detail:{index:r,href:s},bubbles:!0,composed:!0}))}}get _HYST(){return this._tokenPx("--spacing-11",64)}get BP_SM(){return this._tokenPx("--bp-sm",a.ScbHeader.BP_SM_DEFAULT)}get BP_MD(){return this._tokenPx("--bp-md",a.ScbHeader.BP_MD_DEFAULT)}_scheduleHarvest(){this._harvestPending||(this._harvestPending=!0,queueMicrotask(()=>{this._harvestPending=!1,this._harvest()}))}async __ensureDrawer(){if(!this.__drawerLoaded)return this.__ensureDrawerPromise??(this.__ensureDrawerPromise=(async()=>{await Promise.resolve().then(()=>kd),this.__drawerLoaded=!0})()),this.__ensureDrawerPromise}async __ensureTabs(){if(!this.__tabsLoaded)return this.__ensureTabsPromise??(this.__ensureTabsPromise=(async()=>{await Promise.all([Promise.resolve().then(()=>Hh),Promise.resolve().then(()=>Bh)]),this.__tabsLoaded=!0})()),this.__ensureTabsPromise}async __ensureSearch(){if(!this.__searchLoaded)return this.__ensureSearchPromise??(this.__ensureSearchPromise=(async()=>{await Promise.resolve().then(()=>Fc),this.__searchLoaded=!0})()),this.__ensureSearchPromise}get _slotEl(){var e;return((e=this.shadowRoot)==null?void 0:e.querySelector("slot#data-slot"))??null}get _top(){return this.renderRoot.querySelector(".top-row")}get _util(){return this.renderRoot.querySelector(".utility")}get _tabsEl(){return this.renderRoot.querySelector("scb-tabs")}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}`)}_attachSlotObservers(){var t;(t=this._slotMo)==null||t.disconnect();const e=new MutationObserver(r=>{this._scheduleHarvest()});this._slotMo=e,e.observe(this,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["label","href","icon","target"]})}_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});const t=this._menuBtn,r=()=>this._ensureDrawerMounted();t==null||t.addEventListener("pointerenter",r,{once:!0}),t==null||t.addEventListener("focusin",r,{once:!0}),t==null||t.addEventListener("touchstart",r,{once:!0,passive:!0});const i=s=>"requestIdleCallback"in window?window.requestIdleCallback(s,{timeout:1500}):setTimeout(s,600);this.showDrawer&&i(()=>{this.__ensureDrawer()}),this._collapsed||i(()=>{this.__ensureTabs()}),this.showSearch&&i(()=>{this.__ensureSearch()})}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("utilityItems")||e.has("tabs")||e.has("logoText")||e.has("activeTab")||e.has("_slotTabs")||e.has("_slotUtils")||e.has("_slotMenu")||e.has("showDrawer")||e.has("showSearch")||e.has("searchMax")||e.has("searchMin"))&&this.updateComplete.then(()=>{this._scheduleMeasure(),this._applyActiveToTabs()}),e.has("showSearch")&&this.showSearch&&!this.__searchLoaded&&this.__ensureSearch()}disconnectedCallback(){var e,t;(e=this._ro)==null||e.disconnect(),(t=this._slotMo)==null||t.disconnect(),window.removeEventListener("resize",this._onWindowResize),super.disconnectedCallback()}async _ensureDrawerMounted(){this._drawerMounted||(await this.__ensureDrawer(),this._drawerMounted=!0,await this.updateComplete)}_openDrawerNow(){var t,r;const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!0,e.setAttribute("open",""),(t=e.show)==null||t.call(e),(r=e.openDrawer)==null||r.call(e),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))}_applyActiveToTabs(){const e=this._tabsEl;if(!e)return;e.activeTabIndex=this.activeTab,e.querySelectorAll("scb-secondary-tab").forEach((r,i)=>{r.selected=i===this.activeTab})}_renderDrawerNodes(e){return!e||e.length===0?c``:c`${e.map(t=>{const r=Array.isArray(t.children)&&t.children.length>0;return c`
4758
4763
  <scb-drawer-item
4759
4764
  label=${t.label}