scb-wc 0.1.56 → 0.1.58

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,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../scb-drawer/scb-drawer.js","../../vendor/decorate.js","../../vendor/vendor.js","../../vendor/vendor-lit.js","../scb-divider/scb-divider.js","../../vendor/assertClassBrand.js","../scb-menu/scb-menu.js","../scb-menu/scb-menu-item.js","../../vendor/preload-helper.js","../../vendor/scb-chevron.js","../scb-menu/scb-menu-section.js","../scb-menu/scb-sub-menu.js"])))=>i.map(i=>d[i]);
2
- import"../../vendor/vendor-material.js";import{_ as M,b as E,g as P,h as c,m as x,v as f,y as m}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as n}from"../../vendor/decorate.js";import"../scb-button/scb-button.js";import{t as $}from"../../vendor/preload-helper.js";import"../scb-search/scb-search.js";import"../scb-link/scb-link.js";import"../scb-dropdown/scb-dropdown.js";import"../scb-grid/scb-grid-item.js";import"../scb-grid/scb-grid.js";import"../scb-skeleton/scb-skeleton.js";(function(){try{var b=typeof globalThis<"u"?globalThis:window;if(!b.__scb_ce_guard_installed__){b.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,s,r){try{customElements.get(t)||e(t,s,r)}catch(a){var i=String(a||"");if(i.indexOf("already been used")===-1&&i.indexOf("NotSupportedError")===-1)throw a}}}}catch{}})();var S,C,I=0,N=()=>{if(typeof window>"u"||typeof document>"u"||!("customElements"in window)||document.head.querySelector("style[data-scb-header-pre-upgrade]"))return;const b=document.createElement("style");b.setAttribute("data-scb-header-pre-upgrade",""),b.textContent=`
2
+ import"../../vendor/vendor-material.js";import{_ as E,b as P,g as I,h as c,m as x,v as f,y as g}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as n}from"../../vendor/decorate.js";import"../scb-button/scb-button.js";import{t as M}from"../../vendor/preload-helper.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-search/scb-search.js";import"../scb-dropdown/scb-dropdown.js";import"../scb-grid/scb-grid-item.js";import"../scb-grid/scb-grid.js";import"../scb-skeleton/scb-skeleton.js";(function(){try{var b=typeof globalThis<"u"?globalThis:window;if(!b.__scb_ce_guard_installed__){b.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,s,r){try{customElements.get(t)||e(t,s,r)}catch(a){var i=String(a||"");if(i.indexOf("already been used")===-1&&i.indexOf("NotSupportedError")===-1)throw a}}}}catch{}})();var A,$,z=0,N=()=>{if(typeof window>"u"||typeof document>"u"||!("customElements"in window)||document.head.querySelector("style[data-scb-header-pre-upgrade]"))return;const b=document.createElement("style");b.setAttribute("data-scb-header-pre-upgrade",""),b.textContent=`
3
3
  scb-header:not(:defined),
4
4
  scb-header[data-upgrading] {
5
5
  display: block;
@@ -50,24 +50,36 @@ import"../../vendor/vendor-material.js";import{_ as M,b as E,g as P,h as c,m as
50
50
  );
51
51
  }
52
52
  }
53
- `,document.head.appendChild(b);const e=l=>{const u=String(l??"").trim();if(u)return/^\d+$/.test(u)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(u,10)))})`:u},t=l=>{const u=String(l??"").trim();if(!u)return!1;try{const p=JSON.parse(u);return Array.isArray(p)&&p.length>0}catch{return!1}},s=l=>l!=null&&!/^(false|0|off|no)$/i.test(l.trim()),r=l=>{for(const u of Array.from(l.children)){const p=u.tagName.toLowerCase();if(p==="scb-header-tab"||p==="scb-dropdown")return!0}return!1},i=l=>{r(l)||t(l.getAttribute("tabs"))||s(l.getAttribute("reserve-tabs"))||s(l.getAttribute("layout-pending"))?l.setAttribute("data-pre-has-tabs",""):l.removeAttribute("data-pre-has-tabs");const u=e(l.getAttribute("spacing")),p=e(l.getAttribute("spacing-top"))??u,y=e(l.getAttribute("spacing-bottom"))??u;p?l.style.setProperty("--scb-header-spacing-block-start",p):l.style.removeProperty("--scb-header-spacing-block-start"),y?l.style.setProperty("--scb-header-spacing-block-end",y):l.style.removeProperty("--scb-header-spacing-block-end");const h=(l.getAttribute("logo-width")??"").trim();h?l.style.setProperty("--scb-header-pre-logo-w",h):l.style.removeProperty("--scb-header-pre-logo-w");const _=(l.getAttribute("logo-height")??"").trim();_?l.style.setProperty("--scb-header-pre-logo-img-h",_):l.style.removeProperty("--scb-header-pre-logo-img-h");const g=(l.getAttribute("search-height")??"").trim();g?l.style.setProperty("--scb-header-pre-control-size",g):l.style.removeProperty("--scb-header-pre-control-size")};document.querySelectorAll("scb-header").forEach(i);const d=new MutationObserver(l=>{for(const u of l){if(u.type==="attributes"){const p=u.target;p instanceof HTMLElement&&p.tagName.toLowerCase()==="scb-header"&&i(p);continue}if(u.type==="childList"){const p=[...Array.from(u.addedNodes),...Array.from(u.removedNodes)];for(const y of p){if(!(y instanceof HTMLElement))continue;if(y.tagName.toLowerCase()==="scb-header"){i(y);continue}const h=y.closest?.("scb-header");h&&i(h)}}}});d.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabs","spacing","spacing-top","spacing-bottom","logo-width","logo-height","logo-aspect-ratio","logo-alt","logotype-text","search-height","reserve-tabs","layout-pending"]}),customElements.whenDefined("scb-header").then(()=>{d.disconnect()})};N();var T={fromAttribute:b=>b==null?!0:!/^(false|0|off|no)$/i.test(b),toAttribute:b=>String(!!b)},A={fromAttribute:b=>b==null?!1:!/^(false|0|off|no)$/i.test(b),toAttribute:b=>b?"":null},z={fromAttribute:b=>b==="small"||b==="large"?b:"medium",toAttribute:b=>{const e=String(b??"");return e==="small"||e==="large"?e:null}},o=(S=class extends M{constructor(){super(),this.maxWidth="1440px",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.size="medium",this.logoText="",this.logotypeText="",this.logoAlt="",this.logoHref="/",this.logoSrc="",this.logoWidth="",this.logoHeight="",this.logoAspectRatio="",this.logoInvertDm=!1,this.banner=!1,this.tabs=[],this.activeTab=null,this.reserveTabs=!1,this.layoutPending=!1,this.utilityItems=[],this.searchButtonLabel="Sök",this.menuButtonLabel="Meny",this.deferDrawer=!1,this.showDrawer=!0,this.alwaysShowMenuButton=!1,this.showSearch=!0,this.includeUtilityInMenu=!1,this.drawerOverlay=!0,this.searchText="",this._drawerId="main-drawer",this._menuExpanded=!1,this._searchId="header-search",this._drawerReady=!1,this._initialUpgradeComplete=!1,this._slotNavItems=[],this._slotUtils=[],this._slotMenu=[],this._measureScheduled=!1,this._scheduleMeasure=()=>{this.layoutPending||this._measureScheduled||(this._measureScheduled=!0,requestAnimationFrame(()=>{this._measureScheduled=!1,this._measure()}))},this._onWindowResize=()=>{this._scheduleMeasure()},this._onMenuSelect=t=>{const s=t.detail;this.dispatchEvent(new CustomEvent("scb-menu-select",{detail:s,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbmenuselect",{detail:s,bubbles:!0,composed:!0}));const r=s?.item,i=typeof s?.href=="string"?s.href:typeof s?.itemHref=="string"?s.itemHref:typeof s?.item_href=="string"?s.item_href:"",a=r?r.getAttribute("item-href")??r.getAttribute("href")??"":"";String(i||a||"").trim()&&this._closeDrawerNow()},this._collapsed=!1,this._unlockAtWidth=0,this._hideLogoText=!1,this._logoTextUnlockAt=0,this._slotWatchers=[],this._harvestPending=!1,this._harvest=(t={})=>{const s=Array.from(this.children),r=[],i=[],a=[];let d=-1;const l=h=>({label:h.getAttribute("label")??"",href:h.getAttribute("href")??void 0,icon:h.getAttribute("icon")??void 0});for(const h of s){const _=h.tagName.toLowerCase();if(_==="scb-header-tab"){const g=h.getAttribute("label")??"",w=h.getAttribute("href"),v=w&&w.trim()!==""?w:void 0;(h.hasAttribute("selected")||h.getAttribute("selected")==="true"||h.getAttribute("active")==="true"||h.getAttribute("aria-current")==="page")&&d===-1&&(d=r.length),r.push({kind:"tab",label:g,href:v});continue}if(_==="scb-badge"){const g=h.querySelector("scb-dropdown");if(g){const w=g.getAttribute("label")??"";(g.hasAttribute("selected")||g.getAttribute("selected")==="true"||g.getAttribute("active")==="true"||g.getAttribute("aria-current")==="page")&&d===-1&&(d=r.length);const v=`scb-header-tab-${r.length}`;h.getAttribute("slot")!==v&&h.setAttribute("slot",v),g.hasAttribute("slot")&&g.removeAttribute("slot"),g.hasAttribute("as-tab")||g.setAttribute("as-tab",""),r.push({kind:"dropdown",slotName:v,label:w});continue}}if(_==="scb-dropdown"){const g=h.getAttribute("label")??"";(h.hasAttribute("selected")||h.getAttribute("selected")==="true"||h.getAttribute("active")==="true"||h.getAttribute("aria-current")==="page")&&d===-1&&(d=r.length);const w=`scb-header-tab-${r.length}`;h.getAttribute("slot")!==w&&h.setAttribute("slot",w),h.hasAttribute("as-tab")||h.setAttribute("as-tab",""),r.push({kind:"dropdown",slotName:w,label:g});continue}if(_==="scb-header-utility"){i.push({label:h.getAttribute("label")??"",href:h.getAttribute("href")??"#",target:h.getAttribute("target")??void 0});continue}if(_==="scb-header-menu-group"){const g={label:h.getAttribute("label")??"",icon:h.getAttribute("icon")??void 0,children:[]};h.querySelectorAll("scb-header-menu-item").forEach(w=>g.children.push(l(w))),a.push(g);continue}_==="scb-header-menu-item"&&a.push(l(h))}const u=!this._sameNavItems(this._slotNavItems,r),p=!this._sameUtilityItems(this._slotUtils,i),y=!this._sameMenuNodes(this._slotMenu,a);u&&(this._slotNavItems=r),p&&(this._slotUtils=i),y&&(this._slotMenu=a),!this.hasAttribute("active-tab")&&d>=0&&this.activeTab!==d&&(this.activeTab=d),(t.scheduleMeasure??!0)&&queueMicrotask(()=>{this.updateComplete.then(()=>{this._scheduleMeasure()})})},this._measure=()=>{if(this.layoutPending)return;const t=this._top,s=this._logoGroup;if(!t||!s)return;const r=window.innerWidth,i=t.clientWidth,a=this._overflows(this._util),d=this._tabsOverflows(),l=r<this.BP_MD||a||d;this._collapsed?!l&&i>=this._unlockAtWidth&&this._setCollapsed(!1):l&&(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 y=getComputedStyle(this._searchWrap),h=Math.max(this._num(y.minWidth,this._tokenPx("--scb-header-search-min",250)),this._tokenPx("--scb-header-search-min",250)),_=this._num(getComputedStyle(t).gap,this._tokenPx("--spacing-7",24)),g=this.showDrawer&&(this.alwaysShowMenuButton||r<this.BP_MD||this._collapsed)?this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-extra-extra-large",48):0;u=s.getBoundingClientRect().width+_+h+_+g+8>i+.5}this._setHideSearch(u);let p=!1;if(this.showDrawer&&(this.alwaysShowMenuButton||r<this.BP_MD||this._collapsed)&&!this._visible(this._util)&&!this._visible(this._searchWrap)){const y=this._num(getComputedStyle(t).gap,this._tokenPx("--spacing-7",24)),h=this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-extra-extra-large",48),_=(this._logoGroup?.getBoundingClientRect().width||0)+y+h;this._hideLogoText?p=!(i>=this._logoTextUnlockAt):_>i+.5&&(p=!0,this._logoTextUnlockAt=i+this._HYST)}else p=!1,this._logoTextUnlockAt=0;this._setHideLogoText(p)},this._onDrawerOpened=()=>{this._menuExpanded=!0,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-open",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("draweropen",{bubbles:!0,composed:!0}))},this._onDrawerClosed=()=>{this._menuExpanded=!1,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-close",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("drawerclose",{bubbles:!0,composed:!0}))},this._onMenuClick=async t=>{this.showDrawer&&(this.dispatchEvent(new CustomEvent("menu-click",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("menuclick",{bubbles:!0,composed:!0})),!this._drawerReady&&(t.stopPropagation(),await this._ensureDrawerReady(),await this.updateComplete,this._openDrawerNow()))},this._onSearchClick=t=>{const s=this._searchEl;if(s?.submit&&typeof s.submit=="function"){s.submit();return}const r=s?.value??"";this.searchText=r,this.dispatchEvent(new CustomEvent("search-click",{detail:{value:r},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchclick",{detail:{value:r},bubbles:!0,composed:!0})),s?.focus?.()},this._onTabClick=t=>{const s=t.currentTarget;if(!s)return;const r=s.tagName.toLowerCase()==="a";if(r&&(t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey))return;const i=s.getAttribute("data-index"),a=i!=null?Number(i):0,d=this._getNavItems()[a];if(d?.kind==="dropdown")return;this.activeTab=a;const l=d?.kind==="tab"?d.href??"":"",u=new CustomEvent("tab-change",{detail:{index:a,href:l},bubbles:!0,composed:!0,cancelable:!0}),p=new CustomEvent("tabchange",{detail:{index:a,href:l},bubbles:!0,composed:!0,cancelable:!0});!(this.dispatchEvent(u)&&this.dispatchEvent(p))&&r&&t.preventDefault()},this._onDropdownTabActivate=t=>{const s=t.detail?.dataIndex,r=typeof s=="number"?s:typeof s=="string"?Number(s):this._readTabIndexFromEvent(t);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.dispatchEvent(new CustomEvent("tabchange",{detail:{index:r,href:""},bubbles:!0,composed:!0,cancelable:!0})))},this._onTabsKeydown=t=>{const s=t.key;if(s!=="ArrowLeft"&&s!=="ArrowRight"&&s!=="Home"&&s!=="End")return;const r=this._getNavItems();if(!r.length)return;const i=this._readTabIndexFromEvent(t);if(i==null)return;let a=Math.max(0,Math.min(r.length-1,i));s==="ArrowRight"?a=(a+1)%r.length:s==="ArrowLeft"?a=(a-1+r.length)%r.length:s==="Home"?a=0:s==="End"&&(a=r.length-1),t.preventDefault(),this._focusTabAtIndex(a)},this._onSearchInput=t=>{this.searchText=t.detail?.value??"",this.dispatchEvent(new CustomEvent("search-input",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchinput",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchtextchange",{detail:{value:this.searchText},bubbles:!0,composed:!0}))},this._onSearchSubmit=t=>{this.searchText=t.detail?.value??"",this.dispatchEvent(new CustomEvent("search-change",{detail:{value:this.searchText,active:t.detail?.active},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchchange",{detail:{value:this.searchText,active:t.detail?.active},bubbles:!0,composed:!0}))},this._onSearchClear=()=>{this.searchText="",this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:""},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchtextchange",{detail:{value:""},bubbles:!0,composed:!0}))};const e=++I;this._drawerId=`scb-header-drawer-${e}`,this._searchId=`scb-header-search-${e}`}requestLayout(){this.layoutPending||(this.setAttribute("data-layout-settling",""),this.updateComplete.then(()=>{this.isConnected&&(this._measure(),this.removeAttribute("data-layout-settling"))}))}get _HYST(){return this._tokenPx("--spacing-11",64)}get BP_SM(){return this._tokenPx("--bp-sm",C.BP_SM_DEFAULT)}get BP_MD(){return this._tokenPx("--bp-md",C.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(),this._slotWatchers.forEach(i=>i.disconnect()),this._slotWatchers=[];const e=["label","href","icon","target","selected","aria-current","active"],t=i=>{const a=new MutationObserver(d=>{this._scheduleHarvest()});this._slotWatchers.push(a),a.observe(i,{attributes:!0,attributeFilter:e})},s=()=>{this._slotWatchers.forEach(a=>a.disconnect()),this._slotWatchers=[];const i=Array.from(this.children);for(const a of i){const d=a.tagName.toLowerCase();if((d==="scb-header-tab"||d==="scb-dropdown"||d==="scb-header-utility"||d==="scb-header-menu-item"||d==="scb-header-menu-group"||d==="scb-badge")&&t(a),d==="scb-badge"){const l=a,u=new MutationObserver(y=>{s(),this._scheduleHarvest()});this._slotWatchers.push(u),u.observe(l,{childList:!0});const p=l.querySelector("scb-dropdown");p&&t(p);continue}if(d==="scb-header-menu-group"){const l=a,u=new MutationObserver(p=>{s(),this._scheduleHarvest()});this._slotWatchers.push(u),u.observe(l,{childList:!0,subtree:!0}),l.querySelectorAll("scb-header-menu-item").forEach(p=>t(p))}}},r=new MutationObserver(i=>{let a=!1;for(const d of i)if(d.type==="childList"){a=!0;break}a&&s(),this._scheduleHarvest()});this._slotMo=r,r.observe(this,{childList:!0}),s()}_sameNavItems(e,t){if(e.length!==t.length)return!1;for(let s=0;s<e.length;s+=1){const r=e[s],i=t[s];if(!r||!i||r.kind!==i.kind||r.label!==i.label)return!1;if(r.kind==="tab"&&i.kind==="tab"){if((r.href??"")!==(i.href??""))return!1}else if(r.kind==="dropdown"&&i.kind==="dropdown"&&r.slotName!==i.slotName)return!1}return!0}_sameUtilityItems(e,t){if(e.length!==t.length)return!1;for(let s=0;s<e.length;s+=1){const r=e[s],i=t[s];if(!r||!i||r.label!==i.label||r.href!==i.href||(r.target??"")!==(i.target??""))return!1}return!0}_sameMenuNodes(e,t){if(e.length!==t.length)return!1;for(let s=0;s<e.length;s+=1){const r=e[s],i=t[s];if(!r||!i||r.label!==i.label||(r.href??"")!==(i.href??"")||(r.icon??"")!==(i.icon??"")||!this._sameMenuNodes(r.children??[],i.children??[]))return!1}return!0}_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 s=Number.parseFloat(String(e??"").trim());return Number.isFinite(s)?s:t}_tokenPx(e,t){const s=getComputedStyle(this);return this._num(s.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}_tabsOverflows(){const e=this._tabsNav;if(!e||!this._visible(e))return!1;const t=Array.from(e.querySelectorAll(".tab-wrap"));if(t.length===0)return!1;const s=e.getBoundingClientRect();let r=s.left;for(const i of t){const a=i.getBoundingClientRect();a.width<=0||a.right>r&&(r=a.right)}return r-s.left>s.width+1}connectedCallback(){super.connectedCallback(),this._initialUpgradeComplete||this.setAttribute("data-upgrading",""),this._harvest({scheduleMeasure:!1}),this._attachSlotObservers()}_finishInitialUpgrade(){this._initialUpgradeComplete||(this._initialUpgradeComplete=!0,requestAnimationFrame(()=>{this.isConnected&&(this._measure(),this.removeAttribute("data-upgrading"))}))}firstUpdated(){this.showDrawer&&!this.deferDrawer&&this._ensureDrawerReady(),this.updateComplete.then(()=>{this._harvest({scheduleMeasure:!1}),this._attachSlotObservers(),this._syncDropdownTabs(),this._finishInitialUpgrade()});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??"380px"),e.has("searchMin")&&this.style.setProperty("--scb-header-search-min",this.searchMin??"250px"),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("logoWidth")||e.has("logoHeight")||e.has("logoAspectRatio"))&&this._applyLogoSizing(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom"))&&this._applySpacing(),(e.has("utilityItems")||e.has("tabs")||e.has("logoText")||e.has("logotypeText")||e.has("logoSrc")||e.has("logoWidth")||e.has("logoHeight")||e.has("logoAspectRatio")||e.has("activeTab")||e.has("_slotNavItems")||e.has("_slotUtils")||e.has("_slotMenu")||e.has("showDrawer")||e.has("alwaysShowMenuButton")||e.has("showSearch")||e.has("layoutPending")||e.has("searchMax")||e.has("searchMin")||e.has("size"))&&this.updateComplete.then(()=>{this._scheduleMeasure()}),(e.has("showDrawer")||e.has("deferDrawer"))&&this.showDrawer&&!this.deferDrawer&&this._ensureDrawerReady(),e.has("layoutPending")&&!this.layoutPending&&this.requestLayout(),(e.has("activeTab")||e.has("_slotNavItems")||e.has("tabs")||e.has("size"))&&this.updateComplete.then(()=>{this._syncDropdownTabs()})}disconnectedCallback(){this._ro?.disconnect(),this._slotMo?.disconnect(),this._slotWatchers.forEach(e=>e.disconnect()),this._slotWatchers=[],window.removeEventListener("resize",this._onWindowResize),super.disconnectedCallback()}_mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}_applySpacing(){const e=this._mapSpacingToken(this.spacing),t=this._mapSpacingToken(this.spacingTop)??e,s=this._mapSpacingToken(this.spacingBottom)??e;t?this.style.setProperty("--scb-header-spacing-block-start",t):this.style.removeProperty("--scb-header-spacing-block-start"),s?this.style.setProperty("--scb-header-spacing-block-end",s):this.style.removeProperty("--scb-header-spacing-block-end")}_applyLogoSizing(){const e=(this.logoWidth??"").trim(),t=(this.logoHeight??"").trim(),s=(this.logoAspectRatio??"").trim();e?this.style.setProperty("--scb-header-logo-img-w",e):this.style.removeProperty("--scb-header-logo-img-w"),t?this.style.setProperty("--scb-header-logo-img-h",t):e?this.style.setProperty("--scb-header-logo-img-h","auto"):this.style.removeProperty("--scb-header-logo-img-h"),s?this.style.setProperty("--scb-header-logo-img-aspect-ratio",s):this.style.removeProperty("--scb-header-logo-img-aspect-ratio")}_closeDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!1)}_openDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!0)}async _ensureDrawerReady(){this._drawerReady||(this._drawerImportPromise??(this._drawerImportPromise=Promise.all([$(()=>import("../scb-drawer/scb-drawer.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),$(()=>import("../scb-menu/scb-menu.js"),__vite__mapDeps([6,5,1,2,3,4,7,8,9,10,11]),import.meta.url)]).then(()=>{})),await this._drawerImportPromise,this._drawerReady=!0)}_syncMenuBtnAria(){this.renderRoot.querySelectorAll(".menu-trigger").forEach(e=>{e.setAttribute("aria-expanded",String(this._menuExpanded))})}_getNavItems(){return this._slotNavItems.length?this._slotNavItems:(this.tabs??[]).map(e=>({kind:"tab",...e}))}_getDropdownForSlot(e){const t=this.querySelector(`[slot="${e}"]`);return t?t.tagName.toLowerCase()==="scb-dropdown"?t:t.querySelector("scb-dropdown"):null}_syncDropdownTabs(){this._getNavItems().forEach((e,t)=>{if(e.kind!=="dropdown")return;const s=this._getDropdownForSlot(e.slotName);if(!s)return;const r=String(t);s.getAttribute("data-index")!==r&&s.setAttribute("data-index",r),s.hasAttribute("as-tab")||s.setAttribute("as-tab","");const i=this.size,a=s;a?.size!==i&&(a.size=i),t===this.activeTab?s.getAttribute("aria-current")!=="page"&&s.setAttribute("aria-current","page"):s.hasAttribute("aria-current")&&s.removeAttribute("aria-current")})}_readTabIndexFromEvent(e){const t=e.composedPath?e.composedPath():[];for(const s of t){if(!(s instanceof HTMLElement))continue;const r=s.getAttribute("data-index");if(r==null)continue;const i=Number(r);if(Number.isFinite(i))return i}return null}_focusTabAtIndex(e){const t=this._getNavItems()[e];if(t){if(t.kind==="dropdown"){this._getDropdownForSlot(t.slotName)?.focus?.();return}this.renderRoot.querySelector(`.tab-link[data-index="${e}"]`)?.focus?.()}}_renderMenuNodes(e){return!e||e.length===0?m``:m`${e.map(t=>this._renderMenuNode(t))}`}_renderMenuNode(e){const t=Array.isArray(e.children)&&e.children.length>0,s=(e.href??"").trim(),r=(e.icon??"").trim();return m`
53
+ `,document.head.appendChild(b);const e=l=>{const u=String(l??"").trim();if(u)return/^\d+$/.test(u)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(u,10)))})`:u},t=l=>{const u=String(l??"").trim();if(!u)return!1;try{const p=JSON.parse(u);return Array.isArray(p)&&p.length>0}catch{return!1}},s=l=>l!=null&&!/^(false|0|off|no)$/i.test(l.trim()),r=l=>{for(const u of Array.from(l.children)){const p=u.tagName.toLowerCase();if(p==="scb-header-tab"||p==="scb-dropdown")return!0}return!1},i=l=>{r(l)||t(l.getAttribute("tabs"))||s(l.getAttribute("reserve-tabs"))||s(l.getAttribute("layout-pending"))?l.setAttribute("data-pre-has-tabs",""):l.removeAttribute("data-pre-has-tabs");const u=e(l.getAttribute("spacing")),p=e(l.getAttribute("spacing-top"))??u,v=e(l.getAttribute("spacing-bottom"))??u;p?l.style.setProperty("--scb-header-spacing-block-start",p):l.style.removeProperty("--scb-header-spacing-block-start"),v?l.style.setProperty("--scb-header-spacing-block-end",v):l.style.removeProperty("--scb-header-spacing-block-end");const h=(l.getAttribute("logo-width")??"").trim();h?l.style.setProperty("--scb-header-pre-logo-w",h):l.style.removeProperty("--scb-header-pre-logo-w");const y=(l.getAttribute("logo-height")??"").trim();y?l.style.setProperty("--scb-header-pre-logo-img-h",y):l.style.removeProperty("--scb-header-pre-logo-img-h");const m=(l.getAttribute("search-height")??"").trim();m?l.style.setProperty("--scb-header-pre-control-size",m):l.style.removeProperty("--scb-header-pre-control-size")};document.querySelectorAll("scb-header").forEach(i);const d=new MutationObserver(l=>{for(const u of l){if(u.type==="attributes"){const p=u.target;p instanceof HTMLElement&&p.tagName.toLowerCase()==="scb-header"&&i(p);continue}if(u.type==="childList"){const p=[...Array.from(u.addedNodes),...Array.from(u.removedNodes)];for(const v of p){if(!(v instanceof HTMLElement))continue;if(v.tagName.toLowerCase()==="scb-header"){i(v);continue}const h=v.closest?.("scb-header");h&&i(h)}}}});d.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabs","spacing","spacing-top","spacing-bottom","logo-width","logo-height","logo-aspect-ratio","logo-alt","logotype-text","search-height","reserve-tabs","layout-pending"]}),customElements.whenDefined("scb-header").then(()=>{d.disconnect()})};N();var T={fromAttribute:b=>b==null?!0:!/^(false|0|off|no)$/i.test(b),toAttribute:b=>String(!!b)},k={fromAttribute:b=>b==null?!1:!/^(false|0|off|no)$/i.test(b),toAttribute:b=>b?"":null},D={fromAttribute:b=>b==="small"||b==="large"?b:"medium",toAttribute:b=>{const e=String(b??"");return e==="small"||e==="large"?e:null}},o=(A=class extends E{constructor(){super(),this.maxWidth="1440px",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.size="medium",this.logoText="",this.logotypeText="",this.logoAlt="",this.logoHref="/",this.logoSrc="",this.logoWidth="",this.logoHeight="",this.logoAspectRatio="",this.logoInvertDm=!1,this.banner=!1,this.tabs=[],this.activeTab=null,this.reserveTabs=!1,this.layoutPending=!1,this.utilityItems=[],this.searchButtonLabel="Sök",this.menuButtonLabel="Meny",this.deferDrawer=!1,this.showDrawer=!0,this.alwaysShowMenuButton=!1,this.showSearch=!0,this.includeUtilityInMenu=!1,this.drawerOverlay=!0,this.searchText="",this._drawerId="main-drawer",this._menuExpanded=!1,this._searchId="header-search",this._drawerReady=!1,this._mobileSearchOpen=!1,this._initialUpgradeComplete=!1,this._slotNavItems=[],this._slotUtils=[],this._slotMenu=[],this._measureScheduled=!1,this._scheduleMeasure=()=>{this.layoutPending||this._measureScheduled||(this._measureScheduled=!0,requestAnimationFrame(()=>{this._measureScheduled=!1,this._measure()}))},this._onWindowResize=()=>{window.innerWidth>=this.BP_SM&&this._mobileSearchOpen&&this._setMobileSearchOpen(!1),this._scheduleMeasure()},this._onMenuSelect=t=>{const s=t.detail;this.dispatchEvent(new CustomEvent("scb-menu-select",{detail:s,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbmenuselect",{detail:s,bubbles:!0,composed:!0}));const r=s?.item,i=typeof s?.href=="string"?s.href:typeof s?.itemHref=="string"?s.itemHref:typeof s?.item_href=="string"?s.item_href:"",a=r?r.getAttribute("item-href")??r.getAttribute("href")??"":"";String(i||a||"").trim()&&this._closeDrawerNow()},this._collapsed=!1,this._unlockAtWidth=0,this._hideLogoText=!1,this._logoTextUnlockAt=0,this._slotWatchers=[],this._harvestPending=!1,this._harvest=(t={})=>{const s=Array.from(this.children),r=[],i=[],a=[];let d=-1;const l=h=>({label:h.getAttribute("label")??"",href:h.getAttribute("href")??void 0,icon:h.getAttribute("icon")??void 0});for(const h of s){const y=h.tagName.toLowerCase();if(y==="scb-header-tab"){const m=h.getAttribute("label")??"",_=h.getAttribute("href"),S=_&&_.trim()!==""?_:void 0;(h.hasAttribute("selected")||h.getAttribute("selected")==="true"||h.getAttribute("active")==="true"||h.getAttribute("aria-current")==="page")&&d===-1&&(d=r.length),r.push({kind:"tab",label:m,href:S});continue}if(y==="scb-badge"){const m=h.querySelector("scb-dropdown");if(m){const _=m.getAttribute("label")??"";(m.hasAttribute("selected")||m.getAttribute("selected")==="true"||m.getAttribute("active")==="true"||m.getAttribute("aria-current")==="page")&&d===-1&&(d=r.length);const S=`scb-header-tab-${r.length}`;h.getAttribute("slot")!==S&&h.setAttribute("slot",S),m.hasAttribute("slot")&&m.removeAttribute("slot"),m.hasAttribute("as-tab")||m.setAttribute("as-tab",""),r.push({kind:"dropdown",slotName:S,label:_});continue}}if(y==="scb-dropdown"){const m=h.getAttribute("label")??"";(h.hasAttribute("selected")||h.getAttribute("selected")==="true"||h.getAttribute("active")==="true"||h.getAttribute("aria-current")==="page")&&d===-1&&(d=r.length);const _=`scb-header-tab-${r.length}`;h.getAttribute("slot")!==_&&h.setAttribute("slot",_),h.hasAttribute("as-tab")||h.setAttribute("as-tab",""),r.push({kind:"dropdown",slotName:_,label:m});continue}if(y==="scb-header-utility"){i.push({label:h.getAttribute("label")??"",href:h.getAttribute("href")??"#",target:h.getAttribute("target")??void 0});continue}if(y==="scb-header-menu-group"){const m={label:h.getAttribute("label")??"",icon:h.getAttribute("icon")??void 0,children:[]};h.querySelectorAll("scb-header-menu-item").forEach(_=>m.children.push(l(_))),a.push(m);continue}y==="scb-header-menu-item"&&a.push(l(h))}const u=!this._sameNavItems(this._slotNavItems,r),p=!this._sameUtilityItems(this._slotUtils,i),v=!this._sameMenuNodes(this._slotMenu,a);u&&(this._slotNavItems=r),p&&(this._slotUtils=i),v&&(this._slotMenu=a),!this.hasAttribute("active-tab")&&d>=0&&this.activeTab!==d&&(this.activeTab=d),(t.scheduleMeasure??!0)&&queueMicrotask(()=>{this.updateComplete.then(()=>{this._scheduleMeasure()})})},this._measure=()=>{if(this.layoutPending)return;const t=this._top,s=this._logoGroup;if(!t||!s)return;const r=window.innerWidth,i=t.clientWidth,a=this._overflows(this._util),d=this._tabsOverflows(),l=r<this.BP_MD||a||d;this._collapsed?!l&&i>=this._unlockAtWidth&&this._setCollapsed(!1):l&&(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 v=getComputedStyle(this._searchWrap),h=Math.max(this._num(v.minWidth,this._tokenPx("--scb-header-search-min",250)),this._tokenPx("--scb-header-search-min",250)),y=this._num(getComputedStyle(t).gap,this._tokenPx("--spacing-7",24)),m=this.showDrawer&&(this.alwaysShowMenuButton||r<this.BP_MD||this._collapsed)?this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-extra-extra-large",48):0;u=s.getBoundingClientRect().width+y+h+y+m+8>i+.5}this._setHideSearch(u);let p=!1;if(this.showDrawer&&(this.alwaysShowMenuButton||r<this.BP_MD||this._collapsed)&&!this._visible(this._util)&&!this._visible(this._searchWrap)){const v=this._num(getComputedStyle(t).gap,this._tokenPx("--spacing-7",24)),h=this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-extra-extra-large",48),y=(this._logoGroup?.getBoundingClientRect().width||0)+v+h;this._hideLogoText?p=!(i>=this._logoTextUnlockAt):y>i+.5&&(p=!0,this._logoTextUnlockAt=i+this._HYST)}else p=!1,this._logoTextUnlockAt=0;this._setHideLogoText(p)},this._onDrawerOpened=()=>{this._menuExpanded=!0,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-open",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("draweropen",{bubbles:!0,composed:!0}))},this._onDrawerClosed=()=>{this._menuExpanded=!1,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-close",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("drawerclose",{bubbles:!0,composed:!0}))},this._onMenuClick=async t=>{this.showDrawer&&(this._setMobileSearchOpen(!1),this.dispatchEvent(new CustomEvent("menu-click",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("menuclick",{bubbles:!0,composed:!0})),!this._drawerReady&&(t.stopPropagation(),await this._ensureDrawerReady(),await this.updateComplete,this._openDrawerNow()))},this._onSearchClick=t=>{const s=this._searchEl;if(s?.submit&&typeof s.submit=="function"){s.submit();return}const r=s?.value??"";this.searchText=r,this.dispatchEvent(new CustomEvent("search-click",{detail:{value:r},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchclick",{detail:{value:r},bubbles:!0,composed:!0})),s?.focus?.()},this._onMobileSearchToggle=()=>{const t=!this._mobileSearchOpen;this._setMobileSearchOpen(t),t&&this.updateComplete.then(()=>{this.renderRoot.querySelector(".mobile-search-panel scb-search")?.focus?.()})},this._onTabClick=t=>{const s=t.currentTarget;if(!s)return;const r=s.tagName.toLowerCase()==="a";if(r&&(t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey))return;const i=s.getAttribute("data-index"),a=i!=null?Number(i):0,d=this._getNavItems()[a];if(d?.kind==="dropdown")return;this.activeTab=a;const l=d?.kind==="tab"?d.href??"":"",u=new CustomEvent("tab-change",{detail:{index:a,href:l},bubbles:!0,composed:!0,cancelable:!0}),p=new CustomEvent("tabchange",{detail:{index:a,href:l},bubbles:!0,composed:!0,cancelable:!0});!(this.dispatchEvent(u)&&this.dispatchEvent(p))&&r&&t.preventDefault()},this._onDropdownTabActivate=t=>{const s=t.detail?.dataIndex,r=typeof s=="number"?s:typeof s=="string"?Number(s):this._readTabIndexFromEvent(t);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.dispatchEvent(new CustomEvent("tabchange",{detail:{index:r,href:""},bubbles:!0,composed:!0,cancelable:!0})))},this._onTabsKeydown=t=>{const s=t.key;if(s!=="ArrowLeft"&&s!=="ArrowRight"&&s!=="Home"&&s!=="End")return;const r=this._getNavItems();if(!r.length)return;const i=this._readTabIndexFromEvent(t);if(i==null)return;let a=Math.max(0,Math.min(r.length-1,i));s==="ArrowRight"?a=(a+1)%r.length:s==="ArrowLeft"?a=(a-1+r.length)%r.length:s==="Home"?a=0:s==="End"&&(a=r.length-1),t.preventDefault(),this._focusTabAtIndex(a)},this._onSearchInput=t=>{this.searchText=t.detail?.value??"",this.dispatchEvent(new CustomEvent("search-input",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchinput",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchtextchange",{detail:{value:this.searchText},bubbles:!0,composed:!0}))},this._onSearchSubmit=t=>{this.searchText=t.detail?.value??"",this.dispatchEvent(new CustomEvent("search-change",{detail:{value:this.searchText,active:t.detail?.active},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchchange",{detail:{value:this.searchText,active:t.detail?.active},bubbles:!0,composed:!0}))},this._onSearchClear=()=>{this.searchText="",this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:""},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchtextchange",{detail:{value:""},bubbles:!0,composed:!0}))};const e=++z;this._drawerId=`scb-header-drawer-${e}`,this._searchId=`scb-header-search-${e}`}requestLayout(){this.layoutPending||(this.setAttribute("data-layout-settling",""),this.updateComplete.then(()=>{this.isConnected&&(this._measure(),this.removeAttribute("data-layout-settling"))}))}get _HYST(){return this._tokenPx("--spacing-11",64)}get BP_SM(){return this._tokenPx("--bp-sm",$.BP_SM_DEFAULT)}get BP_MD(){return this._tokenPx("--bp-md",$.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(),this._slotWatchers.forEach(i=>i.disconnect()),this._slotWatchers=[];const e=["label","href","icon","target","selected","aria-current","active"],t=i=>{const a=new MutationObserver(d=>{this._scheduleHarvest()});this._slotWatchers.push(a),a.observe(i,{attributes:!0,attributeFilter:e})},s=()=>{this._slotWatchers.forEach(a=>a.disconnect()),this._slotWatchers=[];const i=Array.from(this.children);for(const a of i){const d=a.tagName.toLowerCase();if((d==="scb-header-tab"||d==="scb-dropdown"||d==="scb-header-utility"||d==="scb-header-menu-item"||d==="scb-header-menu-group"||d==="scb-badge")&&t(a),d==="scb-badge"){const l=a,u=new MutationObserver(v=>{s(),this._scheduleHarvest()});this._slotWatchers.push(u),u.observe(l,{childList:!0});const p=l.querySelector("scb-dropdown");p&&t(p);continue}if(d==="scb-header-menu-group"){const l=a,u=new MutationObserver(p=>{s(),this._scheduleHarvest()});this._slotWatchers.push(u),u.observe(l,{childList:!0,subtree:!0}),l.querySelectorAll("scb-header-menu-item").forEach(p=>t(p))}}},r=new MutationObserver(i=>{let a=!1;for(const d of i)if(d.type==="childList"){a=!0;break}a&&s(),this._scheduleHarvest()});this._slotMo=r,r.observe(this,{childList:!0}),s()}_sameNavItems(e,t){if(e.length!==t.length)return!1;for(let s=0;s<e.length;s+=1){const r=e[s],i=t[s];if(!r||!i||r.kind!==i.kind||r.label!==i.label)return!1;if(r.kind==="tab"&&i.kind==="tab"){if((r.href??"")!==(i.href??""))return!1}else if(r.kind==="dropdown"&&i.kind==="dropdown"&&r.slotName!==i.slotName)return!1}return!0}_sameUtilityItems(e,t){if(e.length!==t.length)return!1;for(let s=0;s<e.length;s+=1){const r=e[s],i=t[s];if(!r||!i||r.label!==i.label||r.href!==i.href||(r.target??"")!==(i.target??""))return!1}return!0}_sameMenuNodes(e,t){if(e.length!==t.length)return!1;for(let s=0;s<e.length;s+=1){const r=e[s],i=t[s];if(!r||!i||r.label!==i.label||(r.href??"")!==(i.href??"")||(r.icon??"")!==(i.icon??"")||!this._sameMenuNodes(r.children??[],i.children??[]))return!1}return!0}_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"))}_setMobileSearchOpen(e){this._mobileSearchOpen!==e&&(this._mobileSearchOpen=e,this.toggleAttribute("data-mobile-search-open",e))}_num(e,t){const s=Number.parseFloat(String(e??"").trim());return Number.isFinite(s)?s:t}_tokenPx(e,t){const s=getComputedStyle(this);return this._num(s.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}_tabsOverflows(){const e=this._tabsNav;if(!e||!this._visible(e))return!1;const t=Array.from(e.querySelectorAll(".tab-wrap"));if(t.length===0)return!1;const s=e.getBoundingClientRect();let r=s.left;for(const i of t){const a=i.getBoundingClientRect();a.width<=0||a.right>r&&(r=a.right)}return r-s.left>s.width+1}connectedCallback(){super.connectedCallback(),this._initialUpgradeComplete||this.setAttribute("data-upgrading",""),this._harvest({scheduleMeasure:!1}),this._attachSlotObservers()}_finishInitialUpgrade(){this._initialUpgradeComplete||(this._initialUpgradeComplete=!0,requestAnimationFrame(()=>{this.isConnected&&(this._measure(),this.removeAttribute("data-upgrading"))}))}firstUpdated(){this.showDrawer&&!this.deferDrawer&&this._ensureDrawerReady(),this.updateComplete.then(()=>{this._harvest({scheduleMeasure:!1}),this._attachSlotObservers(),this._syncDropdownTabs(),this._finishInitialUpgrade()});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??"380px"),e.has("searchMin")&&this.style.setProperty("--scb-header-search-min",this.searchMin??"250px"),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("logoWidth")||e.has("logoHeight")||e.has("logoAspectRatio"))&&this._applyLogoSizing(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom"))&&this._applySpacing(),(e.has("utilityItems")||e.has("tabs")||e.has("logoText")||e.has("logotypeText")||e.has("logoSrc")||e.has("logoWidth")||e.has("logoHeight")||e.has("logoAspectRatio")||e.has("activeTab")||e.has("_slotNavItems")||e.has("_slotUtils")||e.has("_slotMenu")||e.has("showDrawer")||e.has("alwaysShowMenuButton")||e.has("showSearch")||e.has("layoutPending")||e.has("searchMax")||e.has("searchMin")||e.has("size"))&&this.updateComplete.then(()=>{this._scheduleMeasure()}),(e.has("showDrawer")||e.has("deferDrawer"))&&this.showDrawer&&!this.deferDrawer&&this._ensureDrawerReady(),e.has("showSearch")&&!this.showSearch&&this._setMobileSearchOpen(!1),e.has("layoutPending")&&!this.layoutPending&&this.requestLayout(),(e.has("activeTab")||e.has("_slotNavItems")||e.has("tabs")||e.has("size"))&&this.updateComplete.then(()=>{this._syncDropdownTabs()})}disconnectedCallback(){this._ro?.disconnect(),this._slotMo?.disconnect(),this._slotWatchers.forEach(e=>e.disconnect()),this._slotWatchers=[],window.removeEventListener("resize",this._onWindowResize),super.disconnectedCallback()}_mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}_applySpacing(){const e=this._mapSpacingToken(this.spacing),t=this._mapSpacingToken(this.spacingTop)??e,s=this._mapSpacingToken(this.spacingBottom)??e;t?this.style.setProperty("--scb-header-spacing-block-start",t):this.style.removeProperty("--scb-header-spacing-block-start"),s?this.style.setProperty("--scb-header-spacing-block-end",s):this.style.removeProperty("--scb-header-spacing-block-end")}_applyLogoSizing(){const e=(this.logoWidth??"").trim(),t=(this.logoHeight??"").trim(),s=(this.logoAspectRatio??"").trim();e?this.style.setProperty("--scb-header-logo-img-w",e):this.style.removeProperty("--scb-header-logo-img-w"),t?this.style.setProperty("--scb-header-logo-img-h",t):e?this.style.setProperty("--scb-header-logo-img-h","auto"):this.style.removeProperty("--scb-header-logo-img-h"),s?this.style.setProperty("--scb-header-logo-img-aspect-ratio",s):this.style.removeProperty("--scb-header-logo-img-aspect-ratio")}_closeDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!1)}_openDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!0)}async _ensureDrawerReady(){this._drawerReady||(this._drawerImportPromise??(this._drawerImportPromise=Promise.all([M(()=>import("../scb-drawer/scb-drawer.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),M(()=>import("../scb-menu/scb-menu.js"),__vite__mapDeps([6,5,1,2,3,4,7,8,9,10,11]),import.meta.url)]).then(()=>{})),await this._drawerImportPromise,this._drawerReady=!0)}_syncMenuBtnAria(){this.renderRoot.querySelectorAll(".menu-trigger").forEach(e=>{e.setAttribute("aria-expanded",String(this._menuExpanded))})}_getNavItems(){return this._slotNavItems.length?this._slotNavItems:(this.tabs??[]).map(e=>({kind:"tab",...e}))}_getDropdownForSlot(e){const t=this.querySelector(`[slot="${e}"]`);return t?t.tagName.toLowerCase()==="scb-dropdown"?t:t.querySelector("scb-dropdown"):null}_syncDropdownTabs(){this._getNavItems().forEach((e,t)=>{if(e.kind!=="dropdown")return;const s=this._getDropdownForSlot(e.slotName);if(!s)return;const r=String(t);s.getAttribute("data-index")!==r&&s.setAttribute("data-index",r),s.hasAttribute("as-tab")||s.setAttribute("as-tab","");const i=this.size,a=s;a?.size!==i&&(a.size=i),t===this.activeTab?s.getAttribute("aria-current")!=="page"&&s.setAttribute("aria-current","page"):s.hasAttribute("aria-current")&&s.removeAttribute("aria-current")})}_readTabIndexFromEvent(e){const t=e.composedPath?e.composedPath():[];for(const s of t){if(!(s instanceof HTMLElement))continue;const r=s.getAttribute("data-index");if(r==null)continue;const i=Number(r);if(Number.isFinite(i))return i}return null}_focusTabAtIndex(e){const t=this._getNavItems()[e];if(t){if(t.kind==="dropdown"){this._getDropdownForSlot(t.slotName)?.focus?.();return}this.renderRoot.querySelector(`.tab-link[data-index="${e}"]`)?.focus?.()}}_renderMenuNodes(e){return!e||e.length===0?g``:g`${e.map(t=>this._renderMenuNode(t))}`}_renderMenuNode(e){const t=Array.isArray(e.children)&&e.children.length>0,s=(e.href??"").trim(),r=(e.icon??"").trim();return g`
54
54
  <scb-menu-item
55
55
  label=${e.label}
56
56
  ?selected=${!1}
57
57
  leading-icon=${r||f}
58
58
  item-href=${s||f}
59
59
  >
60
- ${t?m`
60
+ ${t?g`
61
61
  <scb-sub-menu label=${e.label}>
62
62
  ${e.children.map(i=>this._renderMenuNode(i))}
63
63
  </scb-sub-menu>
64
64
  `:f}
65
65
  </scb-menu-item>
66
- `}_syncFlags(e,t){this.toggleAttribute("data-no-utility",e),this.toggleAttribute("data-no-search",t)}_renderMenuButton(e=""){return m`
66
+ `}_syncFlags(e,t){this.toggleAttribute("data-no-utility",e),this.toggleAttribute("data-no-search",t)}_renderMenuButton(e="",t=!1){const s=e?`menu-trigger ${e}`:"menu-trigger",r=(this.menuButtonLabel??"").trim()||"Meny";return t?g`
67
+ <scb-icon-button
68
+ class=${s}
69
+ icon="menu"
70
+ .size=${this.size}
71
+ aria-label=${r}
72
+ aria-controls=${this._drawerId}
73
+ aria-haspopup="dialog"
74
+ aria-expanded=${String(this._menuExpanded)}
75
+ title="Öppna meny"
76
+ @click=${this._onMenuClick}
77
+ ></scb-icon-button>
78
+ `:g`
67
79
  <scb-button
68
- class=${e?`menu-trigger ${e}`:"menu-trigger"}
80
+ class=${s}
69
81
  variant="text"
70
- label=${(this.menuButtonLabel??"").trim()||"Meny"}
82
+ label=${r}
71
83
  icon="menu"
72
84
  trailing-icon
73
85
  .size=${this.size}
@@ -77,7 +89,7 @@ import"../../vendor/vendor-material.js";import{_ as M,b as E,g as P,h as c,m as
77
89
  title="Öppna meny"
78
90
  @click=${this._onMenuClick}
79
91
  ></scb-button>
80
- `}render(){const e=this._getNavItems(),t=this._slotUtils.length?this._slotUtils:this.utilityItems,s=this._slotMenu.length?this._slotMenu:this.menuData??[],r=this.logoText||this.logotypeText,i=this.logoAlt||r||"Gå till startsidan",a=this.querySelector('[slot="drawer-menu"]')!==null;this._syncFlags(t.length===0,!this.showSearch);const d=this.searchHeight&&this.searchHeight.trim()?`--scb-search-height:${this.searchHeight.trim()}`:f,l=e.length>0||this.reserveTabs||this.layoutPending,u=(this.reserveTabs||this.layoutPending)&&(this.layoutPending||e.length===0),p=this.showDrawer&&(!this.deferDrawer||this._drawerReady),y=typeof window<"u"&&window.innerWidth>=this.BP_MD,h=this.showDrawer&&(y?this.alwaysShowMenuButton||this._collapsed:!0),_=h&&!y,g=h&&y,w=(this.searchButtonLabel??"").trim()||"Sök";return m`
92
+ `}render(){const e=this._getNavItems(),t=this._slotUtils.length?this._slotUtils:this.utilityItems,s=this._slotMenu.length?this._slotMenu:this.menuData??[],r=this.logoText||this.logotypeText,i=this.logoAlt||r||"Gå till startsidan",a=this.querySelector('[slot="drawer-menu"]')!==null;this._syncFlags(t.length===0,!this.showSearch);const d=this.searchHeight&&this.searchHeight.trim()?`--scb-search-height:${this.searchHeight.trim()}`:f,l=e.length>0||this.reserveTabs||this.layoutPending,u=(this.reserveTabs||this.layoutPending)&&(this.layoutPending||e.length===0),p=this.showDrawer&&(!this.deferDrawer||this._drawerReady),v=typeof window<"u"&&window.innerWidth>=this.BP_MD,h=this.showDrawer&&(v?this.alwaysShowMenuButton||this._collapsed:!0),y=h&&!v,m=h&&v,_=(this.searchButtonLabel??"").trim()||"Sök",S=this.showSearch&&!this._mobileSearchOpen;return g`
81
93
  <slot
82
94
  id="data-slot"
83
95
  @slotchange=${()=>{this._harvest(),this._attachSlotObservers()}}
@@ -116,16 +128,17 @@ import"../../vendor/vendor-material.js";import{_ as M,b as E,g as P,h as c,m as
116
128
 
117
129
  <div class="actions">
118
130
  <nav class="utility" aria-label="Funktionslänkar">
119
- ${t.map(v=>m`
120
- <scb-link
121
- .href=${v.href}
122
- .target=${v.target??void 0}
123
- >${v.label}</scb-link
124
- >
131
+ ${t.map(w=>g`
132
+ <scb-button
133
+ variant="text"
134
+ .href=${w.href}
135
+ .target=${w.target??""}
136
+ label=${w.label}
137
+ ></scb-button>
125
138
  `)}
126
139
  </nav>
127
140
 
128
- ${this.showSearch?m`
141
+ ${this.showSearch?g`
129
142
  <div class="search" style=${d}>
130
143
  <scb-search
131
144
  id=${this._searchId}
@@ -139,15 +152,44 @@ import"../../vendor/vendor-material.js";import{_ as M,b as E,g as P,h as c,m as
139
152
  ></scb-search>
140
153
  <scb-button
141
154
  variant="filled-tonal"
142
- label=${w}
155
+ label=${_}
143
156
  .size=${this.size}
144
157
  @click=${this._onSearchClick}
145
158
  ></scb-button>
146
159
  </div>
147
160
  `:f}
148
- ${_?this._renderMenuButton():f}
161
+ ${S?g`
162
+ <scb-icon-button
163
+ class="mobile-search-trigger"
164
+ variant="filled-tonal"
165
+ icon="search"
166
+ .size=${this.size}
167
+ @click=${this._onMobileSearchToggle}
168
+ ></scb-icon-button>
169
+ `:f}
170
+ ${y?this._renderMenuButton("",!0):f}
149
171
  </div>
150
172
 
173
+ ${this.showSearch&&this._mobileSearchOpen?g`
174
+ <div class="mobile-search-panel" style=${d}>
175
+ <scb-search
176
+ .size=${this.size}
177
+ style=${d}
178
+ .value=${this.searchText}
179
+ .supportingText=${this.searchPlaceholder??""}
180
+ @scb-search-input=${this._onSearchInput}
181
+ @scb-search-submit=${this._onSearchSubmit}
182
+ @scb-search-clear=${this._onSearchClear}
183
+ ></scb-search>
184
+ <scb-icon-button
185
+ variant="filled-tonal"
186
+ icon="close"
187
+ .size=${this.size}
188
+ @click=${this._onMobileSearchToggle}
189
+ ></scb-icon-button>
190
+ </div>
191
+ `:f}
192
+
151
193
  </div>
152
194
  </scb-grid-item>
153
195
 
@@ -157,13 +199,13 @@ import"../../vendor/vendor-material.js";import{_ as M,b as E,g as P,h as c,m as
157
199
  col-span-expanded="12"
158
200
  >
159
201
  <div class="tabs-row">
160
- ${l?u?m`
202
+ ${l?u?g`
161
203
  <div class="tabs-inset">
162
204
  <div class="tabs-nav tabs-nav--skeleton" aria-hidden="true">
163
205
  ${this._renderTabSkeletons()}
164
206
  </div>
165
207
  </div>
166
- `:e.length?m`
208
+ `:e.length?g`
167
209
  <div class="tabs-inset">
168
210
  <nav
169
211
  class="tabs-nav"
@@ -171,33 +213,33 @@ import"../../vendor/vendor-material.js";import{_ as M,b as E,g as P,h as c,m as
171
213
  @keydown=${this._onTabsKeydown}
172
214
  @scb-dropdown-tab-activate=${this._onDropdownTabActivate}
173
215
  >
174
- ${e.map((v,k)=>v.kind==="dropdown"?m`
216
+ ${e.map((w,C)=>w.kind==="dropdown"?g`
175
217
  <div class="tab-wrap">
176
- <slot name=${v.slotName}></slot>
218
+ <slot name=${w.slotName}></slot>
177
219
  </div>
178
- `:v.href?m`
220
+ `:w.href?g`
179
221
  <div class="tab-wrap">
180
222
  <a
181
223
  class="tab-link"
182
- href=${v.href}
183
- data-index=${k}
184
- aria-current=${k===this.activeTab?"page":f}
224
+ href=${w.href}
225
+ data-index=${C}
226
+ aria-current=${C===this.activeTab?"page":f}
185
227
  @click=${this._onTabClick}
186
228
  >
187
- ${v.label}
229
+ ${w.label}
188
230
  </a>
189
231
  <md-focus-ring></md-focus-ring>
190
232
  </div>
191
- `:m`
233
+ `:g`
192
234
  <div class="tab-wrap">
193
235
  <button
194
236
  type="button"
195
237
  class="tab-link"
196
- data-index=${k}
197
- aria-current=${k===this.activeTab?"page":f}
238
+ data-index=${C}
239
+ aria-current=${C===this.activeTab?"page":f}
198
240
  @click=${this._onTabClick}
199
241
  >
200
- ${v.label}
242
+ ${w.label}
201
243
  </button>
202
244
  <md-focus-ring></md-focus-ring>
203
245
  </div>
@@ -206,14 +248,14 @@ import"../../vendor/vendor-material.js";import{_ as M,b as E,g as P,h as c,m as
206
248
  </div>
207
249
  `:f:f}
208
250
 
209
- ${g?this._renderMenuButton("menu-trigger--tabs-right"):f}
251
+ ${m?this._renderMenuButton("menu-trigger--tabs-right"):f}
210
252
  </div>
211
253
  </scb-grid-item>
212
254
  </scb-grid>
213
255
  <div class="divider" role="presentation"></div>
214
256
  </div>
215
257
 
216
- ${p?m`
258
+ ${p?g`
217
259
  <scb-drawer
218
260
  id=${this._drawerId}
219
261
  floating
@@ -228,7 +270,7 @@ import"../../vendor/vendor-material.js";import{_ as M,b as E,g as P,h as c,m as
228
270
  >
229
271
  <slot name="drawer-menu"></slot>
230
272
 
231
- ${a?f:m`
273
+ ${a?f:g`
232
274
  <scb-menu
233
275
  .label=${this.menuLabel??""}
234
276
  .subLabel=${this.menuSubLabel??""}
@@ -238,7 +280,7 @@ import"../../vendor/vendor-material.js";import{_ as M,b as E,g as P,h as c,m as
238
280
  .supportingText=${this.menuSearchPlaceholder??""}
239
281
  ></scb-search>
240
282
 
241
- ${this.menuSectionLabel?m`
283
+ ${this.menuSectionLabel?g`
242
284
  <scb-menu-section
243
285
  .label=${this.menuSectionLabel}
244
286
  ></scb-menu-section>
@@ -246,12 +288,12 @@ import"../../vendor/vendor-material.js";import{_ as M,b as E,g as P,h as c,m as
246
288
 
247
289
  ${this._renderMenuNodes(s)}
248
290
 
249
- ${this.includeUtilityInMenu&&(t?.length??0)>0?m`
291
+ ${this.includeUtilityInMenu&&(t?.length??0)>0?g`
250
292
  <scb-menu-section label=''></scb-menu-section>
251
- ${t.map(v=>m`
293
+ ${t.map(w=>g`
252
294
  <scb-menu-item
253
- label=${v.label}
254
- item-href=${v.href}
295
+ label=${w.label}
296
+ item-href=${w.href}
255
297
  ></scb-menu-item>
256
298
  `)}
257
299
  `:f}
@@ -259,7 +301,7 @@ import"../../vendor/vendor-material.js";import{_ as M,b as E,g as P,h as c,m as
259
301
  `}
260
302
  </scb-drawer>
261
303
  `:f}
262
- `}_renderTabSkeletons(){const e=["96px","72px","88px","64px"],t=(this.reserveTabsWidths??"").split(/[\s,]+/).map(a=>a.trim()).filter(Boolean).map(a=>/^\d+(?:\.\d+)?$/.test(a)?`${a}px`:a),s=t.length>0?t:e,r=Number(this.reserveTabsCount),i=Number.isFinite(r)&&r>0?Math.floor(r):t.length>0?t.length:e.length;return m`${Array.from({length:i},(a,d)=>s[d%s.length]).map(a=>m`<scb-skeleton variant="rounded" width=${a} height="16px"></scb-skeleton>`)}`}_renderLogo(){const e=(this.logoSrc??"").trim();return e?m`<img class="logo" src=${e} alt="" aria-hidden="true" />`:m`
304
+ `}_renderTabSkeletons(){const e=["96px","72px","88px","64px"],t=(this.reserveTabsWidths??"").split(/[\s,]+/).map(a=>a.trim()).filter(Boolean).map(a=>/^\d+(?:\.\d+)?$/.test(a)?`${a}px`:a),s=t.length>0?t:e,r=Number(this.reserveTabsCount),i=Number.isFinite(r)&&r>0?Math.floor(r):t.length>0?t.length:e.length;return g`${Array.from({length:i},(a,d)=>s[d%s.length]).map(a=>g`<scb-skeleton variant="rounded" width=${a} height="16px"></scb-skeleton>`)}`}_renderLogo(){const e=(this.logoSrc??"").trim();return e?g`<img class="logo" src=${e} alt="" aria-hidden="true" />`:g`
263
305
  <svg
264
306
  class="logo"
265
307
  viewBox="0 0 48 54"
@@ -293,7 +335,7 @@ import"../../vendor/vendor-material.js";import{_ as M,b as E,g as P,h as c,m as
293
335
  </clipPath>
294
336
  </defs>
295
337
  </svg>
296
- `}},C=S,S._JSON_ARRAY={fromAttribute:b=>{if(b==null||b==="")return[];try{const e=JSON.parse(b);return Array.isArray(e)?e:[]}catch{return[]}},toAttribute:b=>b==null?null:JSON.stringify(b)},S.BP_SM_DEFAULT=600,S.BP_MD_DEFAULT=840,S.styles=E`
338
+ `}},$=A,A._JSON_ARRAY={fromAttribute:b=>{if(b==null||b==="")return[];try{const e=JSON.parse(b);return Array.isArray(e)?e:[]}catch{return[]}},toAttribute:b=>b==null?null:JSON.stringify(b)},A.BP_SM_DEFAULT=600,A.BP_MD_DEFAULT=840,A.styles=P`
297
339
  :host {
298
340
  display: block;
299
341
  margin-block-start: var(--scb-header-spacing-block-start, 0);
@@ -413,6 +455,7 @@ import"../../vendor/vendor-material.js";import{_ as M,b as E,g as P,h as c,m as
413
455
  gap: var(--spacing-7, 24px);
414
456
  padding-block: var(--spacing-5, 16px);
415
457
  min-width: 0;
458
+ position: relative;
416
459
  }
417
460
 
418
461
  .logo-wrap {
@@ -496,9 +539,9 @@ import"../../vendor/vendor-material.js";import{_ as M,b as E,g as P,h as c,m as
496
539
  .actions {
497
540
  display: flex;
498
541
  align-items: center;
499
- gap: var(--spacing-7, 24px);
500
542
  margin-left: auto;
501
543
  width: 100%;
544
+ gap: var(--spacing-3, 8px);
502
545
  justify-content: flex-end;
503
546
  min-width: 0;
504
547
  }
@@ -507,26 +550,8 @@ import"../../vendor/vendor-material.js";import{_ as M,b as E,g as P,h as c,m as
507
550
  display: none;
508
551
  flex-wrap: nowrap;
509
552
  align-items: center;
510
- gap: var(--spacing-5, 16px);
511
553
  min-width: 0;
512
554
  }
513
- .utility scb-link {
514
- font-family: var(--md-sys-typescale-body-medium-font, var(--brand-font)),
515
- sans-serif;
516
- font-size: var(
517
- --scb-header-utility-font-size,
518
- var(--md-sys-typescale-body-medium-size)
519
- );
520
- line-height: var(
521
- --scb-header-utility-line-height,
522
- var(--md-sys-typescale-body-medium-line-height)
523
- );
524
- font-weight: var(--md-sys-typescale-body-medium-weight);
525
- letter-spacing: var(--md-sys-typescale-body-medium-tracking);
526
- --scb-link-color: var(--md-sys-color-primary);
527
- --scb-link-white-space: nowrap;
528
- }
529
-
530
555
 
531
556
  @media (min-width: 840px) {
532
557
  .utility {
@@ -547,7 +572,7 @@ import"../../vendor/vendor-material.js";import{_ as M,b as E,g as P,h as c,m as
547
572
 
548
573
  .menu-trigger {
549
574
  display: none;
550
- align-self: stretch;
575
+ align-self: center;
551
576
  color: var(--md-sys-color-on-surface, #1b1b1f);
552
577
  --md-sys-color-primary: var(--md-sys-color-on-surface, #1b1b1f);
553
578
  }
@@ -592,6 +617,46 @@ import"../../vendor/vendor-material.js";import{_ as M,b as E,g as P,h as c,m as
592
617
  display: flex;
593
618
  }
594
619
  }
620
+
621
+ .mobile-search-trigger {
622
+ display: inline-flex;
623
+ color: var(--md-sys-color-on-surface, #1b1b1f);
624
+ --md-sys-color-primary: var(--md-sys-color-on-surface, #1b1b1f);
625
+ }
626
+
627
+ @media (min-width: 600px) {
628
+ .mobile-search-trigger {
629
+ display: none;
630
+ }
631
+ }
632
+
633
+ .mobile-search-panel {
634
+ display: none;
635
+ position: absolute;
636
+ inset: 0;
637
+ z-index: 2;
638
+ align-items: center;
639
+ gap: var(--spacing-3, 8px);
640
+ padding-block: var(--spacing-5, 16px);
641
+ background: var(--scb-header-background, transparent);
642
+ }
643
+
644
+ .mobile-search-panel scb-search {
645
+ flex: 1 1 auto;
646
+ min-width: 0;
647
+ }
648
+
649
+ @media (max-width: 599.98px) {
650
+ :host([data-mobile-search-open]) .mobile-search-panel {
651
+ display: flex;
652
+ }
653
+
654
+ :host([data-mobile-search-open]) .logo-wrap,
655
+ :host([data-mobile-search-open]) .actions {
656
+ visibility: hidden;
657
+ pointer-events: none;
658
+ }
659
+ }
595
660
  @media (min-width: 600px) and (max-width: 839.98px) {
596
661
  :host([data-hide-search]) .search {
597
662
  display: none !important;
@@ -734,4 +799,4 @@ import"../../vendor/vendor-material.js";import{_ as M,b as E,g as P,h as c,m as
734
799
  :host([data-hide-logo-text]) .logo-text {
735
800
  display: none;
736
801
  }
737
- `,S);n([c({type:String,attribute:"max-width"})],o.prototype,"maxWidth",void 0);n([c({type:String,reflect:!0})],o.prototype,"spacing",void 0);n([c({type:String,attribute:"spacing-top",reflect:!0})],o.prototype,"spacingTop",void 0);n([c({type:String,attribute:"spacing-bottom",reflect:!0})],o.prototype,"spacingBottom",void 0);n([c({type:String,reflect:!0,converter:z})],o.prototype,"size",void 0);n([c({type:String,attribute:"logo-text"})],o.prototype,"logoText",void 0);n([c({type:String,attribute:"logotype-text"})],o.prototype,"logotypeText",void 0);n([c({type:String,attribute:"logo-alt"})],o.prototype,"logoAlt",void 0);n([c({type:String,attribute:"logo-href"})],o.prototype,"logoHref",void 0);n([c({type:String,attribute:"logo-src"})],o.prototype,"logoSrc",void 0);n([c({type:String,attribute:"logo-width"})],o.prototype,"logoWidth",void 0);n([c({type:String,attribute:"logo-height"})],o.prototype,"logoHeight",void 0);n([c({type:String,attribute:"logo-aspect-ratio"})],o.prototype,"logoAspectRatio",void 0);n([c({type:Boolean,attribute:"logo-invert-dm",reflect:!0,converter:A})],o.prototype,"logoInvertDm",void 0);n([c({type:Boolean,reflect:!0})],o.prototype,"banner",void 0);n([c({type:String,attribute:"banner-label"})],o.prototype,"bannerLabel",void 0);n([c({type:Array,attribute:"tabs",converter:o._JSON_ARRAY})],o.prototype,"tabs",void 0);n([c({type:Number,attribute:"active-tab"})],o.prototype,"activeTab",void 0);n([c({type:Boolean,attribute:"reserve-tabs",reflect:!0,converter:A})],o.prototype,"reserveTabs",void 0);n([c({type:Number,attribute:"reserve-tabs-count"})],o.prototype,"reserveTabsCount",void 0);n([c({type:String,attribute:"reserve-tabs-widths"})],o.prototype,"reserveTabsWidths",void 0);n([c({type:Boolean,attribute:"layout-pending",reflect:!0,converter:A})],o.prototype,"layoutPending",void 0);n([c({type:Array,attribute:"utility-items",converter:o._JSON_ARRAY})],o.prototype,"utilityItems",void 0);n([c({type:String,attribute:"search-placeholder"})],o.prototype,"searchPlaceholder",void 0);n([c({type:String,attribute:"search-button-label"})],o.prototype,"searchButtonLabel",void 0);n([c({type:String,attribute:"menu-label"})],o.prototype,"menuLabel",void 0);n([c({type:String,attribute:"menu-button-label"})],o.prototype,"menuButtonLabel",void 0);n([c({type:String,attribute:"menu-sub-label"})],o.prototype,"menuSubLabel",void 0);n([c({type:String,attribute:"menu-section-label"})],o.prototype,"menuSectionLabel",void 0);n([c({type:String,attribute:"menu-search-placeholder"})],o.prototype,"menuSearchPlaceholder",void 0);n([c({type:Array,attribute:"menu-data",converter:o._JSON_ARRAY})],o.prototype,"menuData",void 0);n([c({type:Boolean,attribute:"defer-drawer",reflect:!0,converter:A})],o.prototype,"deferDrawer",void 0);n([c({type:Boolean,attribute:"show-drawer",reflect:!0,converter:T})],o.prototype,"showDrawer",void 0);n([c({type:Boolean,attribute:"always-show-menu-button",reflect:!0,converter:A})],o.prototype,"alwaysShowMenuButton",void 0);n([c({type:Boolean,attribute:"show-search",reflect:!0,converter:T})],o.prototype,"showSearch",void 0);n([c({type:Boolean,attribute:"include-utility-in-menu",reflect:!0,converter:A})],o.prototype,"includeUtilityInMenu",void 0);n([c({type:Boolean,attribute:"drawer-overlay",reflect:!0,converter:T})],o.prototype,"drawerOverlay",void 0);n([c({type:String,attribute:"search-max"})],o.prototype,"searchMax",void 0);n([c({type:String,attribute:"search-min"})],o.prototype,"searchMin",void 0);n([c({type:String,attribute:"search-height"})],o.prototype,"searchHeight",void 0);n([c({type:String,attribute:"search-text",reflect:!0})],o.prototype,"searchText",void 0);n([x()],o.prototype,"_drawerId",void 0);n([x()],o.prototype,"_menuExpanded",void 0);n([x()],o.prototype,"_searchId",void 0);n([x()],o.prototype,"_drawerReady",void 0);n([x()],o.prototype,"_slotNavItems",void 0);n([x()],o.prototype,"_slotUtils",void 0);n([x()],o.prototype,"_slotMenu",void 0);n([x()],o.prototype,"_collapsed",void 0);n([x()],o.prototype,"_hideLogoText",void 0);o=C=n([P("scb-header")],o);
802
+ `,A);n([c({type:String,attribute:"max-width"})],o.prototype,"maxWidth",void 0);n([c({type:String,reflect:!0})],o.prototype,"spacing",void 0);n([c({type:String,attribute:"spacing-top",reflect:!0})],o.prototype,"spacingTop",void 0);n([c({type:String,attribute:"spacing-bottom",reflect:!0})],o.prototype,"spacingBottom",void 0);n([c({type:String,reflect:!0,converter:D})],o.prototype,"size",void 0);n([c({type:String,attribute:"logo-text"})],o.prototype,"logoText",void 0);n([c({type:String,attribute:"logotype-text"})],o.prototype,"logotypeText",void 0);n([c({type:String,attribute:"logo-alt"})],o.prototype,"logoAlt",void 0);n([c({type:String,attribute:"logo-href"})],o.prototype,"logoHref",void 0);n([c({type:String,attribute:"logo-src"})],o.prototype,"logoSrc",void 0);n([c({type:String,attribute:"logo-width"})],o.prototype,"logoWidth",void 0);n([c({type:String,attribute:"logo-height"})],o.prototype,"logoHeight",void 0);n([c({type:String,attribute:"logo-aspect-ratio"})],o.prototype,"logoAspectRatio",void 0);n([c({type:Boolean,attribute:"logo-invert-dm",reflect:!0,converter:k})],o.prototype,"logoInvertDm",void 0);n([c({type:Boolean,reflect:!0})],o.prototype,"banner",void 0);n([c({type:String,attribute:"banner-label"})],o.prototype,"bannerLabel",void 0);n([c({type:Array,attribute:"tabs",converter:o._JSON_ARRAY})],o.prototype,"tabs",void 0);n([c({type:Number,attribute:"active-tab"})],o.prototype,"activeTab",void 0);n([c({type:Boolean,attribute:"reserve-tabs",reflect:!0,converter:k})],o.prototype,"reserveTabs",void 0);n([c({type:Number,attribute:"reserve-tabs-count"})],o.prototype,"reserveTabsCount",void 0);n([c({type:String,attribute:"reserve-tabs-widths"})],o.prototype,"reserveTabsWidths",void 0);n([c({type:Boolean,attribute:"layout-pending",reflect:!0,converter:k})],o.prototype,"layoutPending",void 0);n([c({type:Array,attribute:"utility-items",converter:o._JSON_ARRAY})],o.prototype,"utilityItems",void 0);n([c({type:String,attribute:"search-placeholder"})],o.prototype,"searchPlaceholder",void 0);n([c({type:String,attribute:"search-button-label"})],o.prototype,"searchButtonLabel",void 0);n([c({type:String,attribute:"menu-label"})],o.prototype,"menuLabel",void 0);n([c({type:String,attribute:"menu-button-label"})],o.prototype,"menuButtonLabel",void 0);n([c({type:String,attribute:"menu-sub-label"})],o.prototype,"menuSubLabel",void 0);n([c({type:String,attribute:"menu-section-label"})],o.prototype,"menuSectionLabel",void 0);n([c({type:String,attribute:"menu-search-placeholder"})],o.prototype,"menuSearchPlaceholder",void 0);n([c({type:Array,attribute:"menu-data",converter:o._JSON_ARRAY})],o.prototype,"menuData",void 0);n([c({type:Boolean,attribute:"defer-drawer",reflect:!0,converter:k})],o.prototype,"deferDrawer",void 0);n([c({type:Boolean,attribute:"show-drawer",reflect:!0,converter:T})],o.prototype,"showDrawer",void 0);n([c({type:Boolean,attribute:"always-show-menu-button",reflect:!0,converter:k})],o.prototype,"alwaysShowMenuButton",void 0);n([c({type:Boolean,attribute:"show-search",reflect:!0,converter:T})],o.prototype,"showSearch",void 0);n([c({type:Boolean,attribute:"include-utility-in-menu",reflect:!0,converter:k})],o.prototype,"includeUtilityInMenu",void 0);n([c({type:Boolean,attribute:"drawer-overlay",reflect:!0,converter:T})],o.prototype,"drawerOverlay",void 0);n([c({type:String,attribute:"search-max"})],o.prototype,"searchMax",void 0);n([c({type:String,attribute:"search-min"})],o.prototype,"searchMin",void 0);n([c({type:String,attribute:"search-height"})],o.prototype,"searchHeight",void 0);n([c({type:String,attribute:"search-text",reflect:!0})],o.prototype,"searchText",void 0);n([x()],o.prototype,"_drawerId",void 0);n([x()],o.prototype,"_menuExpanded",void 0);n([x()],o.prototype,"_searchId",void 0);n([x()],o.prototype,"_drawerReady",void 0);n([x()],o.prototype,"_mobileSearchOpen",void 0);n([x()],o.prototype,"_slotNavItems",void 0);n([x()],o.prototype,"_slotUtils",void 0);n([x()],o.prototype,"_slotMenu",void 0);n([x()],o.prototype,"_collapsed",void 0);n([x()],o.prototype,"_hideLogoText",void 0);o=$=n([I("scb-header")],o);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scb-wc",
3
- "version": "0.1.56",
3
+ "version": "0.1.58",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -440,5 +440,5 @@
440
440
  },
441
441
  "./mvc/*": "./mvc/*"
442
442
  },
443
- "buildHash": "E34410E631930335C9DFAE78E48489348CEAA78A9A0C97486228D9A317FADC4A"
443
+ "buildHash": "494EF739F1F7D419BE52EED67ECB85BCF697D91817CA27FB7CBC1BD0334C60B2"
444
444
  }
@@ -63,6 +63,7 @@ export declare class ScbHeader extends LitElement {
63
63
  private _menuExpanded;
64
64
  private _searchId;
65
65
  private _drawerReady;
66
+ private _mobileSearchOpen;
66
67
  private _drawerImportPromise?;
67
68
  private _initialUpgradeComplete;
68
69
  private _slotNavItems;
@@ -103,6 +104,7 @@ export declare class ScbHeader extends LitElement {
103
104
  private _setCollapsed;
104
105
  private _setHideSearch;
105
106
  private _setHideLogoText;
107
+ private _setMobileSearchOpen;
106
108
  private _num;
107
109
  private _tokenPx;
108
110
  private _visible;
@@ -125,6 +127,7 @@ export declare class ScbHeader extends LitElement {
125
127
  private _syncMenuBtnAria;
126
128
  private _onMenuClick;
127
129
  private _onSearchClick;
130
+ private _onMobileSearchToggle;
128
131
  private _getNavItems;
129
132
  private _getDropdownForSlot;
130
133
  private _syncDropdownTabs;