scb-wc 0.1.141 → 0.1.143

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
- import{h as _,m as v,p as f,v as C,y as S}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as b}from"../../vendor/decorate.js";import"../scb-icon-button/scb-icon-button.js";(function(){try{var y=typeof globalThis<"u"?globalThis:window;if(!y.__scb_ce_guard_installed__){y.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(s,r,t){try{customElements.get(s)||e(s,r,t)}catch(l){var a=String(l||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var p,w=96,E=32,m=(p=class extends _{constructor(...e){super(...e),this.dataSorting=!1,this.columnWidthMode="auto",this._sortedColumn=null,this._sortDirection="asc",this._columnWidthFrame=null,this._onSlotChange=()=>{this._attachThListeners()}}render(){return C`
1
+ import{h as _,m as v,p as f,v as C,y as S}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as b}from"../../vendor/decorate.js";import"../scb-icon-button/scb-icon-button.js";(function(){try{var m=typeof globalThis<"u"?globalThis:window;if(!m.__scb_ce_guard_installed__){m.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(s,r,e){try{customElements.get(s)||t(s,r,e)}catch(l){var a=String(l||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var p,w=96,A=32,y=(p=class extends _{constructor(...t){super(...t),this.dataSorting=!1,this.columnWidthMode="auto",this._sortedColumn=null,this._sortDirection="asc",this._columnWidthFrame=null,this._onSlotChange=()=>{this._attachThListeners()}}render(){return C`
2
2
  <div class="scb-table-scroll-wrapper">
3
3
  <slot @slotchange=${this._onSlotChange}></slot>
4
4
  </div>
5
- `}firstUpdated(){const e=this.shadowRoot?.querySelector("slot");e&&(e.addEventListener("slotchange",()=>this._attachThListeners()),this._attachThListeners())}updated(e){e.has("dataSorting")&&(this.dataSorting||(this._sortedColumn=null,this._sortDirection="asc"),this._attachThListeners()),e.has("columnWidthMode")&&this._queueColumnWidthUpdate()}disconnectedCallback(){super.disconnectedCallback(),this._columnWidthFrame!==null&&(cancelAnimationFrame(this._columnWidthFrame),this._columnWidthFrame=null)}_getTbody(){const e=this.shadowRoot?.querySelector("slot");if(!e)return null;const s=e.assignedNodes({flatten:!0});for(const r of s)if(r.nodeType===Node.ELEMENT_NODE){const t=r,a=t.tagName.toLowerCase()==="tbody"?t:t.querySelector("tbody");if(a)return a}return null}_getTables(){const e=this.shadowRoot?.querySelector("slot");if(!e)return[];const s=e.assignedNodes({flatten:!0}),r=[];return s.forEach(t=>{if(t.nodeType===Node.ELEMENT_NODE){const a=t;a.tagName.toLowerCase()==="table"&&r.push(a),r.push(...Array.from(a.querySelectorAll("table")))}}),r}_attachThListeners(){const e=this.shadowRoot?.querySelector("slot");if(!e)return;const s=e.assignedNodes({flatten:!0}),r=[],t=[],a=[],l=[],n=[];s.forEach(o=>{if(o.nodeType===Node.ELEMENT_NODE){const i=Array.from(o.querySelectorAll("thead"));r.push(...i),i.forEach(h=>{t.push(...Array.from(h.querySelectorAll("th")))}),a.push(...o.querySelectorAll("th")),l.push(...o.querySelectorAll("td")),n.push(...o.querySelectorAll("tr"))}}),r.forEach(o=>{o.style.borderTop="1px solid var(--md-sys-color-on-surface)"}),a.forEach(o=>{const i=t.indexOf(o),h=i!==-1;o.style.textAlign="left",o.style.padding="12px",o.style.position="relative",o.style.backgroundColor="var(--md-sys-color-surface)",o.style.fontFamily="var(--md-sys-typescale-label-medium-font)",o.style.fontSize="var(--md-sys-typescale-label-medium-size)",o.style.lineHeight="var(--md-sys-typescale-label-medium-line-height)",o.style.fontWeight="var(--weight-bold)",o.style.letterSpacing="var(--md-sys-typescale-label-medium-tracking)",o.style.verticalAlign="bottom",o.style.borderRight="1px solid var(--md-sys-color-on-surface)",o.style.borderBottom="1px solid var(--md-sys-color-on-surface)",o.style.overflowWrap="normal",o.style.wordBreak="normal",o.style.hyphens="manual",this._removeGeneratedSortMarkup(o),o.hasAttribute("scope")||(h?o.setAttribute("scope","col"):o.closest("tbody")&&o.setAttribute("scope","row"));const u=this._getOrCreateHeaderLabel(o,i),g=this._getNormalizedText(u.textContent)||`kolumn ${Math.max(i,0)+1}`;if((u instanceof HTMLParagraphElement||u.getAttribute("data-scb-generated-label")==="true")&&this._applyGeneratedCellTextReset(u),this.dataSorting&&h){o.setAttribute("aria-sort",this._getHeaderAriaSort(i));const d=document.createElement("scb-icon-button");d.className="scb-sort-icon",d.onclick=()=>this._onThClick(i),d.setAttribute("variant","standard"),d.setAttribute("size","small"),d.setAttribute("aria-label",this._getSortButtonLabel(g,i)),d.style.alignSelf="end",this._sortedColumn===i?(d.setAttribute("variant","filled-tonal"),d.setAttribute("icon",this._sortDirection==="asc"?"arrow_downward":"arrow_upward")):(d.setAttribute("icon","swap_horiz"),d.style.transform+=" rotate(90deg)"),this._wrapHeaderWithSortControl(o,u,d)}else o.removeAttribute("aria-sort")}),l.forEach(o=>{o.style.padding="12px",o.style.textAlign="left",o.style.borderTop="1px solid var(--md-sys-color-outline-variant)",o.style.verticalAlign="text-top",o.style.backgroundColor="var(--md-sys-color-surface)",o.style.fontFamily="var(--md-sys-typescale-body-medium-font)",o.style.fontSize="var(--md-sys-typescale-body-medium-size)",o.style.lineHeight="var(--md-sys-typescale-body-medium-line-height)",o.style.fontWeight="var(--md-sys-typescale-body-medium-weight)",o.style.letterSpacing="var(--md-sys-typescale-body-medium-tracking)",o.style.borderRight="1px solid var(--md-sys-color-on-surface)",o.style.borderBottom="1px solid var(--md-sys-color-on-surface)",o.style.overflowWrap="normal",o.style.wordBreak="normal",o.style.hyphens="manual"}),n.forEach(o=>{const i=Array.from(o.cells);i.forEach((h,u)=>{h.style.borderRight=u===i.length-1?"none":"1px solid var(--md-sys-color-on-surface)"})});const c=this._getTbody();c&&Array.from(c.querySelectorAll("tr")).forEach((o,i)=>{const h=i%2===0?"var(--md-sys-color-surface-container)":"var(--md-sys-color-surface)";Array.from(o.cells).forEach(u=>{u.style.backgroundColor=h})}),this._queueColumnWidthUpdate()}_applyGeneratedCellTextReset(e){e.style.margin="0",e.style.color="inherit",e.style.fontFamily="inherit",e.style.fontSize="inherit",e.style.lineHeight="inherit",e.style.fontWeight="inherit",e.style.letterSpacing="inherit"}_removeGeneratedSortMarkup(e){e.querySelectorAll("scb-icon-button.scb-sort-icon").forEach(t=>t.remove());const s=e.querySelector(':scope > [data-scb-sort-header="true"]');if(!(s instanceof HTMLElement))return;const r=s.querySelector(':scope > [data-scb-sort-label="true"]');if(r instanceof HTMLElement){s.replaceWith(r);return}s.remove()}_getOrCreateHeaderLabel(e,s){const r=e.querySelector(':scope > [data-scb-sort-label="true"]');if(r instanceof HTMLElement)return r;const t=e.querySelector(":scope > p");if(t instanceof HTMLParagraphElement)return t.setAttribute("data-scb-sort-label","true"),t;const a=Array.from(e.children).find(n=>n instanceof HTMLElement&&!n.matches("scb-icon-button.scb-sort-icon"));if(a)return a.setAttribute("data-scb-sort-label","true"),a;const l=document.createElement("p");return l.setAttribute("data-scb-sort-label","true"),l.setAttribute("data-scb-generated-label","true"),l.textContent=this._getNormalizedText(e.textContent)||`kolumn ${Math.max(s,0)+1}`,e.textContent="",e.appendChild(l),l}_wrapHeaderWithSortControl(e,s,r){const t=document.createElement("div");t.setAttribute("data-scb-sort-header","true"),t.style.display="flex",t.style.gap="8px",t.style.flexWrap="nowrap",t.style.alignItems="center",t.appendChild(s),t.appendChild(r),e.appendChild(t)}_getNormalizedText(e){return(e??"").replace(/\s+/g," ").trim()}_queueColumnWidthUpdate(){this._columnWidthFrame!==null&&cancelAnimationFrame(this._columnWidthFrame),this._columnWidthFrame=requestAnimationFrame(()=>{this._columnWidthFrame=null,this._applyColumnWidthMode()})}_applyColumnWidthMode(){this._getTables().forEach(e=>{if(this._removeGeneratedColGroup(e),e.style.tableLayout="",e.style.width="",e.style.minWidth="",e.style.maxWidth="",this.columnWidthMode!=="header")return;const s=Array.from(e.querySelectorAll("thead tr")),r=s[s.length-1];if(!r)return;const t=Array.from(r.cells).map((l,n)=>{const c=this._measureCellContentWidth(l),o=this._measureColumnReadableBodyWidth(e,n),i=Math.max(c,o);return`${Math.ceil(i>0?Math.max(i,w):0)}px`}),a=t.reduce((l,n)=>l+parseFloat(n),0);this._applyGeneratedColGroup(e,t),e.style.tableLayout="fixed",e.style.width=`${Math.ceil(a)}px`,e.style.minWidth=`${Math.ceil(a)}px`,e.style.maxWidth="none"})}_applyGeneratedColGroup(e,s){const r=document.createElement("colgroup");r.setAttribute("data-scb-generated-column-widths","true"),s.forEach(t=>{const a=document.createElement("col");a.style.width=t,a.style.minWidth=t,r.appendChild(a)}),e.insertBefore(r,e.firstChild)}_removeGeneratedColGroup(e){e.querySelector('colgroup[data-scb-generated-column-widths="true"]')?.remove()}_measureCellContentWidth(e){const s=e.firstElementChild?.cloneNode(!0)??document.createElement("span");e.firstElementChild||(s.textContent=e.textContent??"");const r=window.getComputedStyle(e),t=document.createElement("div");t.style.position="absolute",t.style.left="-99999px",t.style.top="0",t.style.visibility="hidden",t.style.pointerEvents="none",t.style.width="max-content",t.style.maxWidth="none",t.style.whiteSpace="nowrap",t.style.fontFamily=r.fontFamily,t.style.fontSize=r.fontSize,t.style.fontWeight=r.fontWeight,t.style.lineHeight=r.lineHeight,t.style.letterSpacing=r.letterSpacing,s instanceof HTMLElement&&(s.style.width="max-content",s.style.maxWidth="none",s.style.whiteSpace="nowrap"),t.appendChild(s),document.body.appendChild(t);const a=parseFloat(r.paddingLeft||"0"),l=parseFloat(r.paddingRight||"0"),n=parseFloat(r.borderLeftWidth||"0"),c=parseFloat(r.borderRightWidth||"0"),o=t.getBoundingClientRect().width+a+l+n+c;return document.body.removeChild(t),o}_measureColumnReadableBodyWidth(e,s){return Array.from(e.querySelectorAll("tbody tr")).reduce((r,t)=>{const a=t.cells[s];if(!a)return r;const l=(a.textContent??"").replace(/\s+/g," ").trim().split(" ").filter(Boolean).reduce((c,o)=>Math.max(c,this._measureCellTextWidth(a,o)),0),n=l>0?l+E:0;return Math.max(r,n)},0)}_measureCellTextWidth(e,s){const r=window.getComputedStyle(e),t=document.createElement("span");t.textContent=s,t.style.position="absolute",t.style.left="-99999px",t.style.top="0",t.style.visibility="hidden",t.style.pointerEvents="none",t.style.whiteSpace="nowrap",t.style.fontFamily=r.fontFamily,t.style.fontSize=r.fontSize,t.style.fontWeight=r.fontWeight,t.style.lineHeight=r.lineHeight,t.style.letterSpacing=r.letterSpacing,document.body.appendChild(t);const a=parseFloat(r.paddingLeft||"0"),l=parseFloat(r.paddingRight||"0"),n=parseFloat(r.borderLeftWidth||"0"),c=parseFloat(r.borderRightWidth||"0"),o=t.getBoundingClientRect().width+a+l+n+c;return document.body.removeChild(t),o}_onThClick(e){this.dataSorting&&(this._sortedColumn===e?this._sortDirection=this._sortDirection==="asc"?"desc":"asc":(this._sortedColumn=e,this._sortDirection="asc"),this._sortTable(e,this._sortDirection),this._attachThListeners(),this.dispatchEvent(new CustomEvent("tablesortchange",{detail:{sortedColumn:this._sortedColumn,sortDirection:this._sortDirection},bubbles:!0,composed:!0})))}_getHeaderAriaSort(e){return this._sortedColumn!==e?"none":this._sortDirection==="asc"?"ascending":"descending"}_getSortButtonLabel(e,s){return`Sortera ${e||`kolumn ${s+1}`} ${this._sortedColumn===s&&this._sortDirection==="asc"?"fallande":"stigande"}`}_sortTable(e,s){const r=this._getTbody();if(!r)return;const t=Array.from(r.querySelectorAll("tr"));t.sort((a,l)=>{const n=this._getCellSortableValue(a.children[e]),c=this._getCellSortableValue(l.children[e]);return this._compareCellValues(n,c,s)}),t.forEach(a=>r.appendChild(a))}_getCellSortableValue(e){if(!e)return"";const s=e,r=this._getSortableAttributeValue(s);if(r)return r;const t=[],a=s.textContent?.replace(/\s+/g," ").trim();return a&&t.push(a),s.querySelectorAll("[data-sort-value], [data-sort], [aria-label], [label], [value], [title]").forEach(l=>{const n=this._getSortableAttributeValue(l);n&&!t.includes(n)&&t.push(n)}),t.join(" ").trim()}_getSortableAttributeValue(e){return(e.getAttribute("data-sort-value")??e.getAttribute("data-sort")??e.getAttribute("aria-label")??e.getAttribute("label")??e.getAttribute("value")??e.getAttribute("title")??"").replace(/\s+/g," ").trim()}_compareCellValues(e,s,r){const t=this._parseSortableNumber(e),a=this._parseSortableNumber(s);if(t!==null&&a!==null)return r==="asc"?t-a:a-t;const l=Date.parse(e.replace(/\s+/g," ")),n=Date.parse(s.replace(/\s+/g," "));if(!isNaN(l)&&!isNaN(n))return r==="asc"?l-n:n-l;const c=e.localeCompare(s,"sv");return r==="asc"?c:-c}_parseSortableNumber(e){const s=e.trim();if(!/^[+-]?(?:\d+|\d{1,3}(?:[\s\u00a0\u202f]\d{3})+)(?:[,.]\d+)?$/.test(s))return null;const r=Number(s.replace(/[\s\u00a0\u202f]/g,"").replace(",","."));return Number.isNaN(r)?null:r}},p.styles=S`:host{display:block;color:var(--md-sys-color-on-surface);font-family:var(--md-sys-typescale-body-medium-font, var(--brand-font, Inter, Arial, sans-serif))}.scb-table-scroll-wrapper{width:100%;overflow-x:auto;overflow-y:auto;max-width:100%;padding-bottom:24px}.scb-table-scroll-wrapper::-webkit-scrollbar{border-radius:var(--md-sys-shape-corner-large);height:8px;width:10px}.scb-table-scroll-wrapper::-webkit-scrollbar-thumb{background:var(--md-sys-color-on-surface);border-radius:var(--md-sys-shape-corner-large);cursor:pointer}.scb-table-scroll-wrapper::-webkit-scrollbar-track{background:var(--md-sys-color-secondary-container);border-radius:var(--md-sys-shape-corner-large)}::slotted(table){border-collapse:collapse;border-spacing:0;font-family:var(--md-sys-typescale-body-medium-font, var(--brand-font, Inter, Arial, sans-serif));min-width:100%;overflow:hidden}::slotted(th) .scb-sort-icon{pointer-events:none}::slotted(th:hover) .scb-sort-icon{pointer-events:auto}`,p);b([f({type:Boolean,attribute:"data-sorting"})],m.prototype,"dataSorting",void 0);b([f({type:String,attribute:"column-width-mode"})],m.prototype,"columnWidthMode",void 0);m=b([v("scb-table")],m);
5
+ `}firstUpdated(){const t=this.shadowRoot?.querySelector("slot");t&&(t.addEventListener("slotchange",()=>this._attachThListeners()),this._attachThListeners())}updated(t){t.has("dataSorting")&&(this.dataSorting||(this._sortedColumn=null,this._sortDirection="asc"),this._attachThListeners()),t.has("columnWidthMode")&&this._queueColumnWidthUpdate()}disconnectedCallback(){super.disconnectedCallback(),this._columnWidthFrame!==null&&(cancelAnimationFrame(this._columnWidthFrame),this._columnWidthFrame=null)}_getTbody(){const t=this.shadowRoot?.querySelector("slot");if(!t)return null;const s=t.assignedNodes({flatten:!0});for(const r of s)if(r.nodeType===Node.ELEMENT_NODE){const e=r,a=e.tagName.toLowerCase()==="tbody"?e:e.querySelector("tbody");if(a)return a}return null}_getTables(){const t=this.shadowRoot?.querySelector("slot");if(!t)return[];const s=t.assignedNodes({flatten:!0}),r=[];return s.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){const a=e;a.tagName.toLowerCase()==="table"&&r.push(a),r.push(...Array.from(a.querySelectorAll("table")))}}),r}_attachThListeners(){const t=this.shadowRoot?.querySelector("slot");if(!t)return;const s=t.assignedNodes({flatten:!0}),r=[],e=[],a=[],l=[],i=[];s.forEach(o=>{if(o.nodeType===Node.ELEMENT_NODE){const d=Array.from(o.querySelectorAll("thead"));r.push(...d),d.forEach(h=>{e.push(...Array.from(h.querySelectorAll("th")))}),a.push(...o.querySelectorAll("th")),l.push(...o.querySelectorAll("td")),i.push(...o.querySelectorAll("tr"))}}),r.forEach(o=>{o.style.borderTop="1px solid var(--md-sys-color-on-surface)"}),a.forEach(o=>{const d=e.indexOf(o),h=d!==-1;o.style.textAlign="left",o.style.padding="12px",o.style.position="relative",o.style.backgroundColor="var(--md-sys-color-surface)",o.style.fontFamily="var(--md-sys-typescale-label-medium-font)",o.style.fontSize="var(--md-sys-typescale-label-medium-size)",o.style.lineHeight="var(--md-sys-typescale-label-medium-line-height)",o.style.fontWeight="var(--weight-bold)",o.style.letterSpacing="var(--md-sys-typescale-label-medium-tracking)",o.style.verticalAlign="bottom",o.style.borderRight="1px solid var(--md-sys-color-on-surface)",o.style.borderBottom="1px solid var(--md-sys-color-on-surface)",o.style.overflowWrap="normal",o.style.wordBreak="normal",o.style.hyphens="manual",this._removeGeneratedSortMarkup(o),o.hasAttribute("scope")||(h?o.setAttribute("scope","col"):o.closest("tbody")&&o.setAttribute("scope","row"));const u=this._getOrCreateHeaderLabel(o,d),g=this._getHeaderLabelText(o,u,d);if((u instanceof HTMLParagraphElement||u.getAttribute("data-scb-generated-label")==="true")&&this._applyGeneratedCellTextReset(u),this.dataSorting&&h){o.setAttribute("aria-sort",this._getHeaderAriaSort(d));const c=document.createElement("scb-icon-button");c.className="scb-sort-icon",c.onclick=()=>this._onThClick(d),c.setAttribute("variant","standard"),c.setAttribute("size","small"),c.setAttribute("aria-label",this._getSortButtonLabel(g,d)),c.style.alignSelf="end",this._sortedColumn===d?(c.setAttribute("variant","filled-tonal"),c.setAttribute("icon",this._sortDirection==="asc"?"arrow_downward":"arrow_upward")):(c.setAttribute("icon","swap_horiz"),c.style.transform+=" rotate(90deg)"),this._wrapHeaderWithSortControl(o,u,c)}else o.removeAttribute("aria-sort")}),l.forEach(o=>{o.style.padding="12px",o.style.textAlign="left",o.style.borderTop="1px solid var(--md-sys-color-outline-variant)",o.style.verticalAlign="text-top",o.style.backgroundColor="var(--md-sys-color-surface)",o.style.fontFamily="var(--md-sys-typescale-body-medium-font)",o.style.fontSize="var(--md-sys-typescale-body-medium-size)",o.style.lineHeight="var(--md-sys-typescale-body-medium-line-height)",o.style.fontWeight="var(--md-sys-typescale-body-medium-weight)",o.style.letterSpacing="var(--md-sys-typescale-body-medium-tracking)",o.style.borderRight="1px solid var(--md-sys-color-on-surface)",o.style.borderBottom="1px solid var(--md-sys-color-on-surface)",o.style.overflowWrap="normal",o.style.wordBreak="normal",o.style.hyphens="manual"}),i.forEach(o=>{const d=Array.from(o.cells);d.forEach((h,u)=>{h.style.borderRight=u===d.length-1?"none":"1px solid var(--md-sys-color-on-surface)"})});const n=this._getTbody();n&&Array.from(n.querySelectorAll("tr")).forEach((o,d)=>{const h=d%2===0?"var(--md-sys-color-surface-container)":"var(--md-sys-color-surface)";Array.from(o.cells).forEach(u=>{u.style.backgroundColor=h})}),this._queueColumnWidthUpdate()}_applyGeneratedCellTextReset(t){t.style.margin="0",t.style.color="inherit",t.style.fontFamily="inherit",t.style.fontSize="inherit",t.style.lineHeight="inherit",t.style.fontWeight="inherit",t.style.letterSpacing="inherit"}_removeGeneratedSortMarkup(t){t.querySelectorAll("scb-icon-button.scb-sort-icon").forEach(e=>e.remove());const s=t.querySelector(':scope > [data-scb-sort-header="true"]');if(!(s instanceof HTMLElement))return;const r=s.querySelector(':scope > [data-scb-sort-label="true"]');if(r instanceof HTMLElement){s.replaceWith(r);return}s.remove()}_getOrCreateHeaderLabel(t,s){const r=t.querySelector(':scope > [data-scb-sort-label="true"]');if(r instanceof HTMLElement)return r;const e=t.querySelector(":scope > p");if(e instanceof HTMLParagraphElement)return e.setAttribute("data-scb-sort-label","true"),e;const a=Array.from(t.children).find(o=>o instanceof HTMLElement&&!o.matches("scb-icon-button.scb-sort-icon"));if(a)return a.setAttribute("data-scb-sort-label","true"),a;const l=this._getNormalizedText(t.textContent),i=l||this._getNormalizedText(t.getAttribute("aria-label"))||this._getFallbackColumnLabel(s),n=document.createElement("p");return n.setAttribute("data-scb-sort-label","true"),n.setAttribute("data-scb-generated-label","true"),n.textContent=i,l||(n.setAttribute("data-scb-visually-hidden-label","true"),this._applyVisuallyHiddenStyles(n)),t.textContent="",t.appendChild(n),n}_getHeaderLabelText(t,s,r){return this._getNormalizedText(s.textContent)||this._getNormalizedText(t.getAttribute("aria-label"))||this._getFallbackColumnLabel(r)}_getFallbackColumnLabel(t){return`kolumn ${Math.max(t,0)+1}`}_applyVisuallyHiddenStyles(t){t.style.position="absolute",t.style.width="1px",t.style.height="1px",t.style.padding="0",t.style.margin="-1px",t.style.overflow="hidden",t.style.whiteSpace="nowrap",t.style.clip="rect(0, 0, 0, 0)",t.style.clipPath="inset(50%)",t.style.border="0"}_wrapHeaderWithSortControl(t,s,r){const e=document.createElement("div");e.setAttribute("data-scb-sort-header","true"),e.style.display="flex",e.style.gap="8px",e.style.flexWrap="nowrap",e.style.alignItems="center",e.appendChild(s),e.appendChild(r),t.appendChild(e)}_getNormalizedText(t){return(t??"").replace(/\s+/g," ").trim()}_queueColumnWidthUpdate(){this._columnWidthFrame!==null&&cancelAnimationFrame(this._columnWidthFrame),this._columnWidthFrame=requestAnimationFrame(()=>{this._columnWidthFrame=null,this._applyColumnWidthMode()})}_applyColumnWidthMode(){this._getTables().forEach(t=>{if(this._removeGeneratedColGroup(t),t.style.tableLayout="",t.style.width="",t.style.minWidth="",t.style.maxWidth="",this.columnWidthMode!=="header")return;const s=Array.from(t.querySelectorAll("thead tr")),r=s[s.length-1];if(!r)return;const e=Array.from(r.cells).map((l,i)=>{const n=this._measureCellContentWidth(l),o=this._measureColumnReadableBodyWidth(t,i),d=Math.max(n,o);return`${Math.ceil(d>0?Math.max(d,w):0)}px`}),a=e.reduce((l,i)=>l+parseFloat(i),0);this._applyGeneratedColGroup(t,e),t.style.tableLayout="fixed",t.style.width=`${Math.ceil(a)}px`,t.style.minWidth=`${Math.ceil(a)}px`,t.style.maxWidth="none"})}_applyGeneratedColGroup(t,s){const r=document.createElement("colgroup");r.setAttribute("data-scb-generated-column-widths","true"),s.forEach(e=>{const a=document.createElement("col");a.style.width=e,a.style.minWidth=e,r.appendChild(a)}),t.insertBefore(r,t.firstChild)}_removeGeneratedColGroup(t){t.querySelector('colgroup[data-scb-generated-column-widths="true"]')?.remove()}_measureCellContentWidth(t){const s=t.firstElementChild?.cloneNode(!0)??document.createElement("span");t.firstElementChild||(s.textContent=t.textContent??"");const r=window.getComputedStyle(t),e=document.createElement("div");e.style.position="absolute",e.style.left="-99999px",e.style.top="0",e.style.visibility="hidden",e.style.pointerEvents="none",e.style.width="max-content",e.style.maxWidth="none",e.style.whiteSpace="nowrap",e.style.fontFamily=r.fontFamily,e.style.fontSize=r.fontSize,e.style.fontWeight=r.fontWeight,e.style.lineHeight=r.lineHeight,e.style.letterSpacing=r.letterSpacing,s instanceof HTMLElement&&(s.style.width="max-content",s.style.maxWidth="none",s.style.whiteSpace="nowrap"),e.appendChild(s),document.body.appendChild(e);const a=parseFloat(r.paddingLeft||"0"),l=parseFloat(r.paddingRight||"0"),i=parseFloat(r.borderLeftWidth||"0"),n=parseFloat(r.borderRightWidth||"0"),o=e.getBoundingClientRect().width+a+l+i+n;return document.body.removeChild(e),o}_measureColumnReadableBodyWidth(t,s){return Array.from(t.querySelectorAll("tbody tr")).reduce((r,e)=>{const a=e.cells[s];if(!a)return r;const l=(a.textContent??"").replace(/\s+/g," ").trim().split(" ").filter(Boolean).reduce((n,o)=>Math.max(n,this._measureCellTextWidth(a,o)),0),i=l>0?l+A:0;return Math.max(r,i)},0)}_measureCellTextWidth(t,s){const r=window.getComputedStyle(t),e=document.createElement("span");e.textContent=s,e.style.position="absolute",e.style.left="-99999px",e.style.top="0",e.style.visibility="hidden",e.style.pointerEvents="none",e.style.whiteSpace="nowrap",e.style.fontFamily=r.fontFamily,e.style.fontSize=r.fontSize,e.style.fontWeight=r.fontWeight,e.style.lineHeight=r.lineHeight,e.style.letterSpacing=r.letterSpacing,document.body.appendChild(e);const a=parseFloat(r.paddingLeft||"0"),l=parseFloat(r.paddingRight||"0"),i=parseFloat(r.borderLeftWidth||"0"),n=parseFloat(r.borderRightWidth||"0"),o=e.getBoundingClientRect().width+a+l+i+n;return document.body.removeChild(e),o}_onThClick(t){this.dataSorting&&(this._sortedColumn===t?this._sortDirection=this._sortDirection==="asc"?"desc":"asc":(this._sortedColumn=t,this._sortDirection="asc"),this._sortTable(t,this._sortDirection),this._attachThListeners(),this.dispatchEvent(new CustomEvent("tablesortchange",{detail:{sortedColumn:this._sortedColumn,sortDirection:this._sortDirection},bubbles:!0,composed:!0})))}_getHeaderAriaSort(t){return this._sortedColumn!==t?"none":this._sortDirection==="asc"?"ascending":"descending"}_getSortButtonLabel(t,s){return`Sortera ${t||`kolumn ${s+1}`} ${this._sortedColumn===s&&this._sortDirection==="asc"?"fallande":"stigande"}`}_sortTable(t,s){const r=this._getTbody();if(!r)return;const e=Array.from(r.querySelectorAll("tr"));e.sort((a,l)=>{const i=this._getCellSortableValue(a.children[t]),n=this._getCellSortableValue(l.children[t]);return this._compareCellValues(i,n,s)}),e.forEach(a=>r.appendChild(a))}_getCellSortableValue(t){if(!t)return"";const s=t,r=this._getSortableAttributeValue(s);if(r)return r;const e=[],a=s.textContent?.replace(/\s+/g," ").trim();return a&&e.push(a),s.querySelectorAll("[data-sort-value], [data-sort], [aria-label], [label], [value], [title]").forEach(l=>{const i=this._getSortableAttributeValue(l);i&&!e.includes(i)&&e.push(i)}),e.join(" ").trim()}_getSortableAttributeValue(t){return(t.getAttribute("data-sort-value")??t.getAttribute("data-sort")??t.getAttribute("aria-label")??t.getAttribute("label")??t.getAttribute("value")??t.getAttribute("title")??"").replace(/\s+/g," ").trim()}_compareCellValues(t,s,r){const e=this._parseSortableNumber(t),a=this._parseSortableNumber(s);if(e!==null&&a!==null)return r==="asc"?e-a:a-e;const l=Date.parse(t.replace(/\s+/g," ")),i=Date.parse(s.replace(/\s+/g," "));if(!isNaN(l)&&!isNaN(i))return r==="asc"?l-i:i-l;const n=t.localeCompare(s,"sv");return r==="asc"?n:-n}_parseSortableNumber(t){const s=t.trim();if(!/^[+-]?(?:\d+|\d{1,3}(?:[\s\u00a0\u202f]\d{3})+)(?:[,.]\d+)?$/.test(s))return null;const r=Number(s.replace(/[\s\u00a0\u202f]/g,"").replace(",","."));return Number.isNaN(r)?null:r}},p.styles=S`:host{display:block;color:var(--md-sys-color-on-surface);font-family:var(--md-sys-typescale-body-medium-font, var(--brand-font, Inter, Arial, sans-serif))}.scb-table-scroll-wrapper{width:100%;overflow-x:auto;overflow-y:auto;max-width:100%;padding-bottom:24px}.scb-table-scroll-wrapper::-webkit-scrollbar{border-radius:var(--md-sys-shape-corner-large);height:8px;width:10px}.scb-table-scroll-wrapper::-webkit-scrollbar-thumb{background:var(--md-sys-color-on-surface);border-radius:var(--md-sys-shape-corner-large);cursor:pointer}.scb-table-scroll-wrapper::-webkit-scrollbar-track{background:var(--md-sys-color-secondary-container);border-radius:var(--md-sys-shape-corner-large)}::slotted(table){border-collapse:collapse;border-spacing:0;font-family:var(--md-sys-typescale-body-medium-font, var(--brand-font, Inter, Arial, sans-serif));min-width:100%;overflow:hidden}::slotted(th) .scb-sort-icon{pointer-events:none}::slotted(th:hover) .scb-sort-icon{pointer-events:auto}`,p);b([f({type:Boolean,attribute:"data-sorting"})],y.prototype,"dataSorting",void 0);b([f({type:String,attribute:"column-width-mode"})],y.prototype,"columnWidthMode",void 0);y=b([v("scb-table")],y);
@@ -1,36 +1,36 @@
1
- (function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var i=customElements.define.bind(customElements);customElements.define=function(e,a,l){try{customElements.get(e)||i(e,a,l)}catch(n){var r=String(n||"");if(r.indexOf("already been used")===-1&&r.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();function o(t,i){return`<table class="scb-viz-print-table">${t.headers.length?`<thead><tr>${t.headers.map((e,a)=>`<th scope="col" class="${t.alignments[a]==="right"?"align-right":"align-left"}"><span class="scb-viz-print-table-heading-text">${e.html||i(e.text)}</span></th>`).join("")}</tr></thead>`:""}${`<tbody>${t.rows.map((e,a)=>{const l=t.rowHeaderRows[a]===!0;return`<tr>${e.map((r,n)=>{const s=t.alignments[n]==="right"?"align-right":"align-left",c=r.html||i(r.text);return n===0&&l?`<th scope="row" class="${s}">${c}</th>`:`<td class="${s}">${c}</td>`}).join("")}</tr>`}).join("")}</tbody>`}</table>`}function d(t){const i=[];if(t.description&&i.push(`
1
+ (function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(i,a,r){try{customElements.get(i)||e(i,a,r)}catch(n){var l=String(n||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();var d="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;white-space:nowrap;clip:rect(0, 0, 0, 0);clip-path:inset(50%);border:0;";function h(t){return t===0?"Radrubrik":`Kolumn ${t+1}`}function m(t){return(t??"").replace(/\s+/g," ").trim()}function p(t,e,i,a){const r=t.html||i(t.text);return m(r)?r:`<span class="visually-hidden" style="${d}">${i(a.getEmptyHeaderLabel?.(e)??h(e))}</span>`}function b(t,e,i={}){return`<table class="scb-viz-print-table">${t.headers.length?`<thead><tr>${t.headers.map((a,r)=>`<th scope="col" class="${t.alignments[r]==="right"?"align-right":"align-left"}"><span class="scb-viz-print-table-heading-text">${p(a,r,e,i)}</span></th>`).join("")}</tr></thead>`:""}${`<tbody>${t.rows.map((a,r)=>{const l=t.rowHeaderRows[r]===!0;return`<tr>${a.map((n,s)=>{const c=t.alignments[s]==="right"?"align-right":"align-left",o=n.html||e(n.text);return s===0&&l?`<th scope="row" class="${c}">${o}</th>`:`<td class="${c}">${o}</td>`}).join("")}</tr>`}).join("")}</tbody>`}</table>`}function g(t){const e=[];if(t.description&&e.push(`
2
2
  <section class="print-section">
3
3
  <h2>${t.escapeHtml(t.descriptionLabel)}</h2>
4
4
  <div class="body-text-rich">${t.renderRichTextHtml(t.description)}</div>
5
5
  </section>
6
- `),t.comment||t.source||t.footnote||t.officialStatistics){const e=[];t.comment&&e.push(`
6
+ `),t.comment||t.source||t.footnote||t.officialStatistics){const i=[];t.comment&&i.push(`
7
7
  <section class="print-section print-meta-section">
8
8
  <h3>${t.escapeHtml(t.commentLabel)}</h3>
9
9
  <div class="body-text-rich">${t.renderRichTextHtml(t.comment)}</div>
10
10
  </section>
11
- `),t.source&&e.push(`
11
+ `),t.source&&i.push(`
12
12
  <section class="print-section print-meta-section">
13
13
  <h3>${t.escapeHtml(t.sourceLabel)}</h3>
14
14
  <div>${t.escapeHtml(t.source)}</div>
15
15
  </section>
16
- `),t.footnote&&e.push(`
16
+ `),t.footnote&&i.push(`
17
17
  <section class="print-section print-meta-section">
18
18
  <h3>${t.escapeHtml(t.footnoteLabel)}</h3>
19
19
  <div class="body-text-rich">${t.renderRichTextHtml(t.footnote)}</div>
20
20
  </section>
21
- `),t.officialStatistics&&t.sosLogotypeSvg&&e.push(`
21
+ `),t.officialStatistics&&t.sosLogotypeSvg&&i.push(`
22
22
  <div class="print-sos">${t.sosLogotypeSvg}</div>
23
- `),i.push(`
23
+ `),e.push(`
24
24
  <section class="print-section print-more-about-stats">
25
25
  <h2>${t.escapeHtml(t.moreAboutStatsLabel)}</h2>
26
- ${e.join("")}
26
+ ${i.join("")}
27
27
  </section>
28
- `)}return i.join("")}function h(t){const i=t.escapeHtml;return`<!doctype html>
29
- <html lang="${i(t.lang||"sv")}">
28
+ `)}return e.join("")}function f(t){const e=t.escapeHtml;return`<!doctype html>
29
+ <html lang="${e(t.lang||"sv")}">
30
30
  <head>
31
31
  <meta charset="utf-8">
32
32
  <meta name="viewport" content="width=device-width, initial-scale=1">
33
- <title>${i(t.title||(t.lang==="en"?"Visualization":"Visualisering"))}</title>
33
+ <title>${e(t.title||(t.lang==="en"?"Visualization":"Visualisering"))}</title>
34
34
  <style>
35
35
  :root { color-scheme: light; }
36
36
  @page { margin: 16mm; }
@@ -83,16 +83,28 @@
83
83
  .scb-viz-print-table .align-right { text-align: right; }
84
84
  .scb-viz-print-table tbody td.align-right { white-space: nowrap; }
85
85
  .scb-viz-print-table .align-left { text-align: left; }
86
+ .visually-hidden {
87
+ position: absolute !important;
88
+ width: 1px !important;
89
+ height: 1px !important;
90
+ padding: 0 !important;
91
+ margin: -1px !important;
92
+ overflow: hidden !important;
93
+ white-space: nowrap !important;
94
+ clip: rect(0, 0, 0, 0) !important;
95
+ clip-path: inset(50%) !important;
96
+ border: 0 !important;
97
+ }
86
98
  </style>
87
99
  </head>
88
100
  <body>
89
101
  <article class="viz-print">
90
102
  <header class="viz-header">
91
- ${t.title?`<h1 class="viz-title">${i(t.title)}</h1>`:""}
92
- ${t.subtitle?`<div class="viz-subtitle">${i(t.subtitle)}</div>`:""}
103
+ ${t.title?`<h1 class="viz-title">${e(t.title)}</h1>`:""}
104
+ ${t.subtitle?`<div class="viz-subtitle">${e(t.subtitle)}</div>`:""}
93
105
  </header>
94
106
  <div class="viz-content">${t.contentHtml}</div>
95
107
  ${t.footerHtml||""}
96
108
  </article>
97
109
  </body>
98
- </html>`}export{h as buildScbVizPrintDocumentHtml,d as buildScbVizPrintableFooterHtml,o as buildScbVizPrintableTableHtml};
110
+ </html>`}export{f as buildScbVizPrintDocumentHtml,g as buildScbVizPrintableFooterHtml,b as buildScbVizPrintableTableHtml};
@@ -1,4 +1,4 @@
1
- import{f as F,h as U,i as J,m as Y,p as b,t as X,v as u,y as Z}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as m}from"../../vendor/decorate.js";import{n as Q,t as h}from"../../vendor/assertClassBrand.js";import"../scb-accordion/scb-accordion.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-divider/scb-divider.js";import"../scb-chip/scb-chip.js";import"../scb-horizontal-scroller/scb-horizontal-scroller.js";import"../scb-segmented-button/scb-segmented-item.js";import"../scb-segmented-button/scb-segmented-button.js";import"../scb-table/scb-table.js";import{buildScbVizExportFileName as tt,createScbVizCsvBlob as et,createScbVizRasterBlobFromElement as it,createScbVizRasterDataUrlFromElement as st,downloadScbVizBlob as O,getScbVizCurrentFullscreenElement as at,isScbVizFullscreenSupported as rt,openScbVizPrintFrame as nt,runWithScbVizForcedPrintLightMode as ot,toggleScbVizFullscreen as lt}from"./scb-viz-actions-runtime.js";import{buildScbVizPrintDocumentHtml as ct,buildScbVizPrintableFooterHtml as ht,buildScbVizPrintableTableHtml as dt}from"./scb-viz-print-runtime.js";import{getScbVizSeriesDifferentiationPatternKinds as pt}from"./scb-viz-series-differentiation-registry.js";import{clearScbVizSeriesDifferentiationColorClass as ut,clearScbVizSeriesDifferentiationMetadata as ft,ensureScbVizStyledModeSeriesPattern as gt,getScbVizGroupedSeriesDifferentiationVariant as mt,getScbVizHighchartsColorClassName as bt,getScbVizHighchartsSvgRoot as vt,getScbVizLegendSeriesDifferentiationTargets as _t,getScbVizSeriesDifferentiationVariantByIndex as yt,isScbVizGroupedSeriesDifferentiationChart as St,isScbVizHighchartsStyledMode as zt,setScbVizSeriesDifferentiationColorClass as wt,setScbVizSeriesDifferentiationMetadata as Ct,shouldShowScbVizSeriesDifferentiationAction as xt,usesScbVizGroupedPointDifferentiation as Dt}from"./scb-viz-series-differentiation-runtime.js";import{buildScbVizResolvedTableView as Mt,createScbVizCsvRows as $t,inferScbVizTableAlignments as Lt,normalizeScbVizRenderableCell as Tt,readScbVizTableDataFromSlot as Vt}from"./scb-viz-table-runtime.js";(function(){try{var n=typeof globalThis<"u"?globalThis:window;if(!n.__scb_ce_guard_installed__){n.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,i,s){try{customElements.get(e)||t(e,i,s)}catch(r){var a=String(r||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var c,A,j=`<svg version="1.1" id="Lager_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
1
+ import{f as F,h as U,i as J,m as Y,p as v,t as X,v as u,y as Z}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as m}from"../../vendor/decorate.js";import{n as Q,t as c}from"../../vendor/assertClassBrand.js";import"../scb-accordion/scb-accordion.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-divider/scb-divider.js";import"../scb-chip/scb-chip.js";import"../scb-horizontal-scroller/scb-horizontal-scroller.js";import"../scb-segmented-button/scb-segmented-item.js";import"../scb-segmented-button/scb-segmented-button.js";import"../scb-table/scb-table.js";import{buildScbVizExportFileName as tt,createScbVizCsvBlob as et,createScbVizRasterBlobFromElement as it,createScbVizRasterDataUrlFromElement as st,downloadScbVizBlob as O,getScbVizCurrentFullscreenElement as rt,isScbVizFullscreenSupported as at,openScbVizPrintFrame as nt,runWithScbVizForcedPrintLightMode as ot,toggleScbVizFullscreen as lt}from"./scb-viz-actions-runtime.js";import{buildScbVizPrintDocumentHtml as ct,buildScbVizPrintableFooterHtml as ht,buildScbVizPrintableTableHtml as dt}from"./scb-viz-print-runtime.js";import{getScbVizSeriesDifferentiationPatternKinds as pt}from"./scb-viz-series-differentiation-registry.js";import{clearScbVizSeriesDifferentiationColorClass as ut,clearScbVizSeriesDifferentiationMetadata as gt,ensureScbVizStyledModeSeriesPattern as ft,getScbVizGroupedSeriesDifferentiationVariant as mt,getScbVizHighchartsColorClassName as bt,getScbVizHighchartsSvgRoot as vt,getScbVizLegendSeriesDifferentiationTargets as _t,getScbVizSeriesDifferentiationVariantByIndex as yt,isScbVizGroupedSeriesDifferentiationChart as St,isScbVizHighchartsStyledMode as zt,setScbVizSeriesDifferentiationColorClass as wt,setScbVizSeriesDifferentiationMetadata as Ct,shouldShowScbVizSeriesDifferentiationAction as xt,usesScbVizGroupedPointDifferentiation as Dt}from"./scb-viz-series-differentiation-runtime.js";import{buildScbVizResolvedTableView as Mt,createScbVizCsvRows as $t,inferScbVizTableAlignments as Tt,normalizeScbVizRenderableCell as Lt,readScbVizTableDataFromSlot as Vt}from"./scb-viz-table-runtime.js";(function(){try{var o=typeof globalThis<"u"?globalThis:window;if(!o.__scb_ce_guard_installed__){o.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,i,s){try{customElements.get(e)||t(e,i,s)}catch(a){var r=String(a||"");if(r.indexOf("already been used")===-1&&r.indexOf("NotSupportedError")===-1)throw a}}}}catch{}})();var l,A,j=`<svg version="1.1" id="Lager_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
2
2
  viewBox="0 0 727.3 87.3" style="enable-background:new 0 0 727.3 87.3;" xml:space="preserve" fill="currentColor">
3
3
  <style type="text/css">
4
4
  .st0{clip-path:url(#SVGID_00000118375311472882578510000008414848687067442345_);}
@@ -113,7 +113,7 @@ import{f as F,h as U,i as J,m as Y,p as b,t as X,v as u,y as Z}from"../../vendor
113
113
  <path d="M688.2,24.4h5.8v6h-5.8V24.4z M688.2,36.6h5.8v30.1h-5.8V36.6z"/>
114
114
  <path d="M701.8,24.4h5.8v26.3h0.1l11.2-14.1h7l-10,11.7l11.4,18.3H720l-7.7-14l-4.6,5.4v8.7h-5.8V24.4H701.8z"/>
115
115
  </svg>
116
- `,Ft=0,g=(c=new WeakSet,A=class extends U{constructor(...t){super(...t),Q(this,c),this.variant="Standard",this.selectedChip="Diagram",this.title="",this.subtitle="",this.description="",this.comment="",this.source="",this.footnote="",this.lang="sv",this.imageHref="",this.officialStatistics=!1,this.disableToggle=!1,this.contentMaxWidth="",this.containerMaxWidth="",this.contentHeight="",this.toggleHeightMode="stable",this._actionsMenuOpen=!1,this._seriesDifferentiationEnabled=!1,this._isFullscreen=!1,this._seriesDifferentiationSnapshots=new WeakMap,this._diagramReflowFrame=0,this._chartConfigSyncFrame=0,this._fullscreenDiagramSizingFrame=0,this._fullscreenDiagramHeight="",this._instanceId=`scb-viz-${++Ft}`,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._onDocumentFullscreenChange=()=>{this._syncFullscreenState()},this._onWindowResize=()=>{this._isFullscreen&&h(c,this,L).call(this)},this._onToggleFullscreenClick=async()=>{this._closeActionsMenu(),await this._toggleFullscreen()},this._onDocumentPointerDown=e=>{if(!this._actionsMenuOpen)return;const i=e.composedPath(),s=this.shadowRoot?.querySelector(".actions-menu");s&&i.includes(s)||this._closeActionsMenu()},this._onDocumentKeyDown=e=>{this._actionsMenuOpen&&e.key==="Escape"&&(e.preventDefault(),this._closeActionsMenu(),this._focusMenuButton())},this._onPrintClick=async()=>{this._closeActionsMenu(),await h(c,this,Ot).call(this)},this._onDownloadPngClick=async()=>{this._canExportRaster()&&(this._closeActionsMenu(),await h(c,this,P).call(this,"png"))},this._onDownloadJpgClick=async()=>{this._canExportRaster()&&(this._closeActionsMenu(),await h(c,this,P).call(this,"jpeg"))},this._onDownloadCsvClick=()=>{this._canExportCsv()&&(this._closeActionsMenu(),h(c,this,jt).call(this))},this._onToggleSeriesDifferentiationClick=()=>{this._seriesDifferentiationEnabled=!this._seriesDifferentiationEnabled,this._closeActionsMenu(),h(c,this,V).call(this)}}get descriptionLabel(){return this.lang==="en"?"Description of the chart":"Beskrivning av diagrammet"}get moreAboutStatsLabel(){return this.lang==="en"?"More about the statistics":"Mer om statistiken"}get commentLabel(){return this.lang==="en"?"Comments":"Kommentar"}get sourceLabel(){return this.lang==="en"?"Source":"Källa"}get footnoteLabel(){return this.lang==="en"?"Footnotes":"Fotnot"}get officialStatisticsLabel(){return this.lang==="en"?"Official statistics of Sweden":"Sveriges officiella statistik"}get officialStatisticsTitle(){return this.lang==="en"?"Part of Official statistics of Sweden":"Tillhör Sveriges officiella statistik"}get officialStatisticsAlt(){return this.lang==="en"?"Read more about Official statistics of Sweden":"Läs mer om Sveriges officiella statistik"}get actionsMenuLabel(){return this.lang==="en"?"Open menu":"Öppna meny"}get printLabel(){return this.lang==="en"?"Print":"Skriv ut"}get downloadPngLabel(){return this.lang==="en"?"Download PNG":"Ladda ner PNG"}get downloadJpgLabel(){return this.lang==="en"?"Download JPG":"Ladda ner JPG"}get downloadCsvLabel(){return this.lang==="en"?"Download CSV":"Ladda ner CSV"}get enableSeriesDifferentiationLabel(){return this.lang==="en"?"Show symbols and patterns":"Visa symboler och mönster"}get disableSeriesDifferentiationLabel(){return this.lang==="en"?"Hide symbols and patterns":"Dölj symboler och mönster"}get enterFullscreenLabel(){return this.lang==="en"?"View fullscreen":"Visa i helskärm"}get exitFullscreenLabel(){return this.lang==="en"?"Exit fullscreen":"Avsluta helskärm"}_getImageAltText(){return this.lang==="en"?"Chart image":"Diagrambild"}_getTitleId(){return this.title?`${this._instanceId}-title`:void 0}_getSubtitleId(){return this.subtitle?`${this._instanceId}-subtitle`:void 0}_getDescriptionId(){return this.description?`${this._instanceId}-description`:void 0}_getContentAriaLabelledBy(){const t=[this._getTitleId(),this._getSubtitleId()].filter(Boolean);return t.length?t.join(" "):void 0}_getContentAriaDescribedBy(){const t=[this._getDescriptionId()].filter(Boolean);return t.length?t.join(" "):void 0}connectedCallback(){super.connectedCallback(),document.addEventListener("pointerdown",this._onDocumentPointerDown,!0),document.addEventListener("keydown",this._onDocumentKeyDown),document.addEventListener("fullscreenchange",this._onDocumentFullscreenChange),document.addEventListener("webkitfullscreenchange",this._onDocumentFullscreenChange),window.addEventListener("resize",this._onWindowResize),window.visualViewport?.addEventListener("resize",this._onWindowResize)}firstUpdated(t){this._readTableDataFromSlot(),h(c,this,N).call(this),h(c,this,I).call(this),h(c,this,T).call(this),this._syncChipClass(),h(c,this,E).call(this),h(c,this,x).call(this),this._syncFullscreenState(),h(c,this,L).call(this)}updated(t){super.updated(t),(t.has("selectedChip")||t.has("variant"))&&(this._syncChipClass(),this._closeActionsMenu()),t.has("selectedChip")&&this._dispatchSelectedChipChanged(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&h(c,this,N).call(this),t.has("containerMaxWidth")&&h(c,this,I).call(this),t.has("variant")&&h(c,this,E).call(this),(t.has("contentMaxWidth")||t.has("contentHeight")||t.has("toggleHeightMode")||t.has("variant"))&&h(c,this,T).call(this),(t.has("selectedChip")||t.has("variant")||t.has("contentMaxWidth")||t.has("contentHeight")||t.has("toggleHeightMode")||t.has("_isFullscreen"))&&h(c,this,x).call(this),(t.has("selectedChip")||t.has("variant"))&&this._seriesDifferentiationEnabled&&requestAnimationFrame(()=>{h(c,this,V).call(this)}),(t.has("valueFormat")||t.has("timeFormat")||t.has("yAxisSettings")||t.has("selectedChip")||t.has("variant"))&&h(c,this,R).call(this),(t.has("title")||t.has("subtitle")||t.has("description")||t.has("comment")||t.has("source")||t.has("footnote")||t.has("officialStatistics")||t.has("selectedChip")||t.has("variant")||t.has("_isFullscreen"))&&h(c,this,L).call(this)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",this._onDocumentPointerDown,!0),document.removeEventListener("keydown",this._onDocumentKeyDown),document.removeEventListener("fullscreenchange",this._onDocumentFullscreenChange),document.removeEventListener("webkitfullscreenchange",this._onDocumentFullscreenChange),window.removeEventListener("resize",this._onWindowResize),window.visualViewport?.removeEventListener("resize",this._onWindowResize),h(c,this,G).call(this),h(c,this,q).call(this),h(c,this,K).call(this),h(c,this,W).call(this)}_refreshTableDataFromSlot(t){this._readTableDataFromSlot(t||void 0),this.requestUpdate()}_onTableSlotChange(t){const e=t.target;e&&(this._refreshTableDataFromSlot(e),requestAnimationFrame(()=>{this._refreshTableDataFromSlot(e)}))}_onDiagramSlotChange(){h(c,this,T).call(this),h(c,this,x).call(this),h(c,this,R).call(this),this._seriesDifferentiationEnabled&&requestAnimationFrame(()=>{h(c,this,V).call(this)}),this.requestUpdate()}_normalizeRenderableCell(t){return Tt(t)}_readTableDataFromSlot(t){const e=t||this.shadowRoot?.querySelector('slot[name="table"]');this._slottedTableData=Vt(e)}_inferTableAlignments(t){return Lt(t,e=>this._parseTableNumericValue(e))}_parseTableNumericValue(t){if(t==null)return null;if(typeof t=="number")return Number.isFinite(t)?t:null;let e=String(t).replace(/[  \s]+/g,"").trim();if(!e)return null;e.endsWith("%")&&(e=e.slice(0,-1));const i=e.lastIndexOf(","),s=e.lastIndexOf(".");if(i>-1&&s>-1?i>s?e=e.replace(/\./g,"").replace(",","."):e=e.replace(/,/g,""):i>-1&&(e=e.replace(",",".")),!/^-?\d+(?:\.\d+)?$/.test(e))return null;const a=Number(e);return Number.isFinite(a)?a:null}_formatTableCell(t,e,i){const s=this._normalizeRenderableCell(t);if(s.html)return s;const a=s.text;if(!a)return s;if(e===0){const d=this._normalizeTimeFormat(this.timeFormat),f=this._formatCategoryTimeLabel(a,d);return f!==null?{html:"",text:f}:s}if(i[e]!=="right")return s;if(this._shouldPreserveSourceValueFormatting(this.valueFormat)){const d=this._localizeAutomaticNumericText(a);return d!==null?{html:"",text:d}:s}const r=this._parseTableNumericValue(a);if(r===null)return s;const o=this._normalizeValueFormat(this.valueFormat),l=this._formatValueForDisplay(r,o,!0);return l===null?s:{html:"",text:l}}_getViewportHeight(){return Math.round(window.visualViewport?.height||window.innerHeight||document.documentElement.clientHeight||0)}_readCssLength(t){const e=Number.parseFloat(t||"0");return Number.isFinite(e)?e:0}_getElementOuterHeight(t){const e=this.shadowRoot?.querySelector(t);if(!e)return 0;const i=getComputedStyle(e);return e.getBoundingClientRect().height+this._readCssLength(i.marginTop)+this._readCssLength(i.marginBottom)}_getFullscreenDiagramHeight(){if(!this._isFullscreen||this.variant!=="Standard"||this.selectedChip!=="Diagram")return"";const t=this._getViewportHeight();if(!t)return"";const e=getComputedStyle(this),i=this._readCssLength(e.paddingTop)+this._readCssLength(e.paddingBottom)+this._getElementOuterHeight(".header")+this._getElementOuterHeight(".actions-row")+this._getElementOuterHeight(".footer")+16,s=Math.floor(t-i);return!Number.isFinite(s)||s<=0?"":`${Math.max(320,s)}px`}_getResolvedContentMaxWidth(){return this.contentMaxWidth?.trim()||""}_getResolvedDiagramHeight(){return this._fullscreenDiagramHeight||this.contentHeight?.trim()||""}_getResolvedDiagramScrollerWidth(){return this._getResolvedContentMaxWidth()}_getResolvedToggleHeightMode(){return this.toggleHeightMode==="auto"?"auto":"stable"}_getResolvedStandardContentHeight(){return this._getResolvedDiagramHeight()||"600px"}_getResolvedTableData(){return this.tableData??this._slottedTableData}_getResolvedTableView(t){return Mt(t,{inferAlignments:e=>this._inferTableAlignments(e),normalizeCell:e=>this._normalizeRenderableCell(e),formatCell:(e,i,s)=>this._formatTableCell(e,i,s)})}_getDiagramAssignedElements(){const t=this.shadowRoot?.querySelector('slot[name="diagram"]');return t?t.assignedElements({flatten:!0}):[]}_findExportableVisualElement(t){for(const e of t){if(e instanceof SVGSVGElement||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)return e;const i=e.querySelector("svg, canvas, img");if(i instanceof SVGSVGElement||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement)return i}return null}_getExportableVisualElement(){if(this.variant==="Table")return null;if(this.variant==="Image"){const t=this.shadowRoot?.querySelector(".image-content img");return t instanceof HTMLImageElement?t:null}return this._findExportableVisualElement(this._getDiagramAssignedElements())}_getDefaultValueFormat(){return{type:"number",scale:"auto",decimals:0,decimalSeparator:this.lang==="en"?".":","}}_normalizeValueFormat(t){const e=this._getDefaultValueFormat(),i=t&&typeof t=="object"?t:{};return{type:["number","currency","percent"].includes(String(i.type))?String(i.type):e.type,scale:["auto","raw","thousands","millions","billions"].includes(String(i.scale))?String(i.scale):e.scale,decimals:Number.isFinite(Number(i.decimals))?Math.max(0,Math.min(20,Number(i.decimals))):e.decimals,decimalSeparator:String(i.decimalSeparator)==="."?".":String(i.decimalSeparator)===","?",":e.decimalSeparator}}_shouldPreserveSourceValueFormatting(t){const e=this._normalizeValueFormat(t);return e.type==="number"&&e.scale==="auto"}_normalizeTimeFormat(t){const e={mode:"raw",display:"raw"},i=t&&typeof t=="object"?t:{},s=["raw","year","monthCode","quarterCode","weekCode","tertialCode"];let a=typeof i.mode=="string"?i.mode:e.mode,r=typeof i.display=="string"?i.display:e.display;s.includes(a)||(a=e.mode);const o={raw:["raw"],year:["raw","year"],monthCode:["raw","iso-month","short-month","long-month"],quarterCode:["raw","quarter-compact","quarter-short","quarter-long"],weekCode:["raw","week-compact","week-long"],tertialCode:["raw","tertial-compact","tertial-short","tertial-long"]};return o[a].includes(r)||(r=o[a][0]),a==="raw"&&(r="raw"),{mode:a,display:r}}_normalizeYAxisSettings(t){const e=t&&typeof t=="object"?t:{},i=Number.isFinite(Number(e.referenceLineValue))?Number(e.referenceLineValue):null;return{startAtZero:!!e.startAtZero,referenceLineEnabled:!!e.referenceLineEnabled&&Number.isFinite(i),referenceLineValue:i,referenceLineLabel:typeof e.referenceLineLabel=="string"?e.referenceLineLabel:""}}_getShortMonthNames(){return["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec"]}_getLongMonthNames(){return["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"]}_formatCategoryTimeLabel(t,e){if(!t||e.mode==="raw"||e.display==="raw")return null;if(e.mode==="year"){const i=/^\s*(\d{4})\s*$/.exec(t);return i?i[1]:null}if(e.mode==="monthCode"){const i=/^\s*(\d{4})M(0?[1-9]|1[0-2])\s*$/i.exec(t);if(!i)return null;const s=Number(i[2])-1,a=i[1],r=String(s+1).padStart(2,"0");return e.display==="iso-month"?`${a}-${r}`:e.display==="short-month"?`${this._getShortMonthNames()[s]} ${a}`:e.display==="long-month"?`${this._getLongMonthNames()[s]} ${a}`:t}if(e.mode==="quarterCode"){const i=/^\s*(\d{4})(?:K(V)?|Q)(0?[1-4])\s*$/i.exec(t);if(!i)return null;const s=Number(i[3]),a=i[1],r=["första","andra","tredje","fjärde"];return e.display==="quarter-compact"?`${a} K${s}`:e.display==="quarter-short"?`kv ${s} ${a}`:e.display==="quarter-long"?`${r[s-1]} kvartalet ${a}`:t}if(e.mode==="weekCode"){const i=/^\s*(\d{4})(?:V|W)(0?[1-9]|[1-4][0-9]|5[0-3])\s*$/i.exec(t);if(!i)return null;const s=Number(i[2]),a=i[1];return e.display==="week-compact"?`${a} v. ${s}`:e.display==="week-long"?`vecka ${s} ${a}`:t}if(e.mode==="tertialCode"){const i=/^\s*(\d{4})T(0?[1-3])\s*$/i.exec(t);if(!i)return null;const s=Number(i[2]),a=i[1],r=["första","andra","tredje"];return e.display==="tertial-compact"?`${a} T${s}`:e.display==="tertial-short"?`tertial ${s} ${a}`:e.display==="tertial-long"?`${r[s-1]} tertialet ${a}`:t}return null}_localizeAutomaticNumericText(t){const e=this._normalizeValueFormat(this.valueFormat),i=String(t??"").trim();if(!i||i===".."||i==="...")return null;const s=i.replace(/[  \s]/g,"");if(!/^-?\d+(?:[.,]\d+)?$/.test(s))return null;const a=e.decimalSeparator==="."?".":",";return a==="."&&s.indexOf(",")!==-1?s.replace(",","."):a===","&&s.indexOf(".")!==-1?s.replace(".",","):s}_inferAutomaticValueDecimals(t){if(!Number.isFinite(t))return 0;let e=String(t);/e/i.test(e)&&(e=t.toFixed(6).replace(/0+$/,"").replace(/\.$/,""));const i=e.replace(/^-/,"").split(".");return i.length>1?Math.min(i[1].length,6):0}_formatAutomaticValueForDisplay(t,e){if(!Number.isFinite(t))return null;const i=this._localizeAutomaticNumericText(e);if(i!==null)return i;const s=this._normalizeValueFormat(this.valueFormat),a=this._inferAutomaticValueDecimals(t);return this._formatLocalizedNumber(t,a,s.decimalSeparator)}_formatLocalizedNumber(t,e,i){const s=new Intl.NumberFormat(this.lang==="en"?"en-GB":"sv-SE",{minimumFractionDigits:e,maximumFractionDigits:e}),a=i==="."||i===","?i:this.lang==="en"?".":",";return s.formatToParts(t).map(r=>r.type==="decimal"?a:r.value).join("")}_formatValueForDisplay(t,e,i){if(!Number.isFinite(t))return null;const s={raw:1,thousands:1e3,millions:1e6,billions:1e9},a={raw:"",thousands:this.lang==="en"?"k":"t",millions:this.lang==="en"?"M":"mn",billions:this.lang==="en"?"B":"md"};let r=e.scale;if(r==="auto"){const f=Math.abs(t);f>=1e9?r="billions":f>=1e6?r="millions":f>=1e3?r="thousands":r="raw"}const o=t/(s[r]||1);let l=this._formatLocalizedNumber(o,e.decimals,e.decimalSeparator);e.type==="percent"?l=`${l} %`:e.type==="currency"&&(l=i?`${l} kr`:l);const d=a[r]||"";return d&&(l=`${l} ${d}`),l}_isCategoryAxis(t){return t?.categories?.length>0||t?.options?.type==="category"}_isTooltipNumericLikeText(t){if(typeof t!="string")return!1;const e=t.trim();return e?/^-?\d+(?:[.,]\d+)?$/.test(e):!1}_getTooltipPointRowIndex(t){const e=t?.point||t;return Number.isFinite(e?.x)?Number(e.x):Number.isFinite(t?.x)?Number(t.x):Number.isFinite(e?.index)?Number(e.index):Number.isFinite(t?.index)?Number(t.index):null}_getTooltipTableCategoryValue(t){const e=this._getResolvedTableData();if(!e?.rows?.length)return"";const i=this._getTooltipPointRowIndex(t);if(i===null||i<0||i>=e.rows.length)return"";const s=e.rows[i];return!Array.isArray(s)||s.length===0?"":this._normalizeRenderableCell(s[0]).text}_getTooltipSeriesDataCategoryValue(t){const e=t?.point||t,i=e?.series||t?.series,s=this._getTooltipPointRowIndex(t);if(!i||s===null)return"";const a=[i?.options?.data,i?.userOptions?.data];for(const l of a){if(!Array.isArray(l)||s<0||s>=l.length)continue;const d=l[s];if(!d||typeof d!="object")continue;const f=typeof d.category<"u"&&d.category!==null?String(d.category):typeof d.name=="string"?d.name:"";if(f&&!this._isTooltipNumericLikeText(f))return f}const r=typeof e?.options?.category<"u"&&e.options.category!==null?String(e.options.category):"";if(r&&!this._isTooltipNumericLikeText(r))return r;const o=typeof e?.name=="string"?e.name.trim():"";return o&&!this._isTooltipNumericLikeText(o)?o:""}_getTooltipXAxisLabel(t,e){const i=t?.point||t,s=i?.series?.xAxis||t?.series?.xAxis,a=this._getTooltipPointRowIndex(t),r=[];if(s&&Array.isArray(s.categories)&&a!==null){const v=s.categories[a];typeof v<"u"&&v!==null&&r.push(String(v))}typeof i?.category=="string"&&i.category.trim()&&r.push(i.category),typeof t?.key=="string"&&t.key.trim()&&r.push(t.key),typeof t?.x=="string"&&t.x.trim()&&r.push(t.x);const o=this._getTooltipSeriesDataCategoryValue(t);o&&r.push(o);const l=this._getTooltipTableCategoryValue(t);l&&r.push(l);for(const v of r){const S=String(v).trim();if(!(!S||this._isTooltipNumericLikeText(S)))return this._formatCategoryTimeLabel(S,e)??S}const d=r.find(v=>String(v).trim());if(!d)return"";const f=String(d).trim();return this._formatCategoryTimeLabel(f,e)??f}_getTooltipPointLabel(t){const e=t?.point||t,i=e?.series||t?.series,s=String(e?.series?.type||i?.type||e?.series?.options?.type||i?.options?.type||e?.series?.chart?.options?.chart?.type||"").trim().toLowerCase();return["pie","variablepie"].includes(s)?e?.name||i?.name||"":i?.name||e?.name||""}_applyTimeFormatToLiveChart(t){const e=this._normalizeTimeFormat(this.timeFormat);if(e.mode==="raw"||e.display==="raw")return;const i=this._formatCategoryTimeLabel.bind(this);[...t?.xAxis||[],...t?.yAxis||[]].forEach(s=>{if(!this._isCategoryAxis(s))return;const a=s.options?.labels&&typeof s.options.labels=="object"?{...s.options.labels}:{},r=typeof a.formatter=="function"?a.formatter:null;a.formatter=function(){let o="";if(this?.axis&&Array.isArray(this.axis.categories)&&typeof this.pos=="number"){const d=this.axis.categories[this.pos];typeof d<"u"&&d!==null&&(o=String(d))}else typeof this?.value<"u"&&this.value!==null&&(o=String(this.value));const l=i(o,e);return l!==null?l:r?r.call(this):o},delete a.format,s.update({labels:a},!1)})}_applyValueFormatToLiveChart(t){const e=this._normalizeValueFormat(this.valueFormat),i=this._normalizeTimeFormat(this.timeFormat),s=this._formatValueForDisplay.bind(this),a=this._formatAutomaticValueForDisplay.bind(this),r=this._getTooltipXAxisLabel.bind(this),o=this._getTooltipPointLabel.bind(this);if(this._shouldPreserveSourceValueFormatting(this.valueFormat)){const l=t?.options?.tooltip&&typeof t.options.tooltip=="object"?{...t.options.tooltip}:{},d=t?.options?.plotOptions&&typeof t.options.plotOptions=="object"?{...t.options.plotOptions}:{},f=d.series&&typeof d.series=="object"?{...d.series}:{},v=f.dataLabels&&typeof f.dataLabels=="object"?{...f.dataLabels}:{},S=t?.options?.lang&&typeof t.options.lang=="object"?{...t.options.lang}:{};delete v.format,delete v.formatter,S.decimalPoint=e.decimalSeparator==="."?".":",",S.thousandsSep=" ",l.valueDecimals=void 0,l.formatter=function(){const _=Array.isArray(this.points)&&this.points.length?this.points:[this.point||this],y=r(this,i),D=[];return _.forEach(p=>{const z=p?.point||p,w=Number.isFinite(p?.y)?p.y:z?.y,C=o(p),M=a(w,z?.options&&typeof z.options.y<"u"&&z.options.y!==null?String(z.options.y):z&&typeof z.y<"u"&&z.y!==null?String(z.y):"");!Number.isFinite(w)||M===null||M===void 0||D.push(`${C?`${String(C)}: `:""}<b>${String(M)}</b><br/>`)}),`${y?`<span>${String(y)}</span><br/>`:""}${D.join("")}`}.bind(this),t.update({lang:S,tooltip:l,plotOptions:{...d,series:{...f,dataLabels:v}}},!1,!1,!1),(t?.yAxis||[]).forEach(_=>{const y=_.options?.labels&&typeof _.options.labels=="object"?{..._.options.labels}:{};delete y.format,delete y.formatter,_.update({labels:y},!1)});return}t.update({tooltip:{...t.options?.tooltip||{},valueDecimals:e.decimals,formatter:function(){const l=Array.isArray(this.points)&&this.points.length?this.points:[this.point||this],d=r(this,i),f=[];return l.forEach(v=>{const S=v?.point||v,_=s(Number.isFinite(v?.y)?v.y:S?.y,e,!0);if(_===null)return;const y=o(v);f.push(`${y?`${String(y)}: `:""}<b>${_}</b><br/>`)}),`${d?`<span>${String(d)}</span><br/>`:""}${f.join("")}`}},plotOptions:{...t.options?.plotOptions||{},series:{...t.options?.plotOptions?.series||{},dataLabels:{...t.options?.plotOptions?.series?.dataLabels||{},formatter:function(){return s(Number.isFinite(this?.y)?this.y:this?.point?.y,e,e.type==="percent")??null}}}}},!1,!1,!1),(t?.yAxis||[]).forEach(l=>{const d=l.options?.labels&&typeof l.options.labels=="object"?{...l.options.labels}:{},f=typeof d.formatter=="function"?d.formatter:null,v=!(l.options?.title&&typeof l.options.title.text=="string"&&l.options.title.text.trim());d.formatter=function(){const S=s(this?.value,e,v);return S!==null?S:f?f.call(this):this?.value},(e.type==="percent"||e.scale!=="auto")&&delete d.format,l.update({labels:d},!1)})}_applyYAxisSettingsToLiveChart(t){const e=this._normalizeYAxisSettings(this.yAxisSettings),i=t?.yAxis||[];i.length&&i.forEach((s,a)=>{const r=s.options&&typeof s.options=="object"?s.options:{},o={},l=typeof r.min<"u"&&r.min!==null&&r.min!=="";a===0&&e.startAtZero&&!l&&(o.min=0);const d=Array.isArray(r.plotLines)?r.plotLines.filter(f=>f?.id!=="scb-viz-reference-line"):[];a===0&&e.referenceLineEnabled&&Number.isFinite(e.referenceLineValue)&&d.push({id:"scb-viz-reference-line",className:"scb-axis-plotline scb-viz-reference-line",value:e.referenceLineValue}),d.length?o.plotLines=d:Array.isArray(r.plotLines)&&(o.plotLines=[]),s.update(o,!1)})}_getCurrentHighchartsChart(){if(this._getCurrentPrintableView()!=="diagram")return;const t=h(c,this,B).call(this,this._getDiagramAssignedElements());if(t!==void 0)return window.Highcharts?.charts?.[t]}_getSeriesDifferentiationGroup(t,e){const i=String(t?.type||t?.options?.type||e?.options?.chart?.type||"").trim().toLowerCase();return["line","spline","scatter"].includes(i)?"line":["area","areaspline"].includes(i)?"area":["column","bar"].includes(i)?this._isGroupedSeriesDifferentiationChart(t,e)?"grouped-fill":"fill":["pie","variablepie"].includes(i)?"point-fill":null}_getSeriesDifferentiationVariantByIndex(t){return yt(t)}_isGroupedSeriesDifferentiationChart(t,e){return St(t,e)}_usesGroupedPointDifferentiation(t){return Dt(t)}_getGroupedSeriesDifferentiationVariant(t,e,i){const s=mt(t,e,i);return{...s,variantIndex:typeof s.variantIndex=="number"?s.variantIndex:i}}_applyGroupedLegendSeriesDifferentiation(t){(Array.isArray(t?.legend?.allItems)?t.legend.allItems:[]).forEach((e,i)=>{const s=e&&e.series?e.series:e;if(!this._isGroupedSeriesDifferentiationChart(s,t))return;const{variantIndex:a,patternKind:r}=this._getGroupedSeriesDifferentiationVariant(e,t,i),o=this._getHighchartsColorClassName(e?.legendSymbol??e?.legendItem?.symbol??e?.legendItem?.group,a);this._getLegendSeriesDifferentiationTargets(e).fillTargets.forEach(l=>{this._setSeriesDifferentiationMetadata(l,{role:"legend-fill",patternKind:r}),this._setSeriesDifferentiationColorClass(l,o)}),this._ensureStyledModeSeriesPattern(t,o,r)})}_clearGroupedLegendSeriesDifferentiation(t){(Array.isArray(t?.legend?.allItems)?t.legend.allItems:[]).forEach(e=>{const i=e&&e.series?e.series:e;if(!this._isGroupedSeriesDifferentiationChart(i,t))return;const s=this._getLegendSeriesDifferentiationTargets(e);s.graphTargets.forEach(a=>{this._clearSeriesDifferentiationMetadata(a)}),s.fillTargets.forEach(a=>{this._clearSeriesDifferentiationMetadata(a),this._clearSeriesDifferentiationColorClass(a)})})}_shouldShowSeriesDifferentiationAction(){return xt({chart:this._getCurrentHighchartsChart(),getCurrentPrintableView:()=>this._getCurrentPrintableView(),getSeriesDifferentiationGroup:(t,e)=>this._getSeriesDifferentiationGroup(t,e),isHighchartsStyledMode:t=>this._isHighchartsStyledMode(t)})}_getSeriesDifferentiationSnapshotStore(t){let e=this._seriesDifferentiationSnapshots.get(t);return e||(e=new Map,this._seriesDifferentiationSnapshots.set(t,e)),e}_cloneSeriesOptionValue(t){return Array.isArray(t)?t.map(e=>this._cloneSeriesOptionValue(e)):t&&typeof t=="object"?Object.fromEntries(Object.entries(t).map(([e,i])=>[e,this._cloneSeriesOptionValue(i)])):t}_captureSeriesDifferentiationSnapshot(t){const e=this._cloneSeriesOptionValue(t?.options?.marker),i=this._cloneSeriesOptionValue(t?.resetA11yMarkerOptions),s=this._cloneSeriesOptionValue(t?.userOptions?.marker),a=e?.states,r=t?.a11yMarkersForced===!0&&i&&Object.keys(i).length>0||a?.normal?.opacity===0&&i&&Object.keys(i).length>0?i:s;return{marker:r&&Object.keys(r).length>0?r:e&&Object.keys(e).length>0?e:{enabled:!1}}}_isHighchartsStyledMode(t){return zt(t)}_getHighchartsSvgRoot(t){return vt(t)}_getHighchartsColorClassName(t,e){return bt(t,e)}_setSeriesDifferentiationMetadata(t,e){Ct(t,e)}_clearSeriesDifferentiationMetadata(t){ft(t)}_setSeriesDifferentiationColorClass(t,e){wt(t,e)}_clearSeriesDifferentiationColorClass(t){ut(t)}_getLegendSeriesDifferentiationTargets(t){return _t(t)}_ensureStyledModeSeriesPattern(t,e,i){gt(t,e,i)}_applyStyledModeSeriesDifferentiation(t){const e=this._getHighchartsSvgRoot(t);if(!e)return;e.classList.add("scb-viz-series-differentiation-enabled");const i=pt(),s=this._getSeriesDifferentiationSnapshotStore(t);t.series?.forEach((a,r)=>{const o=this._getSeriesDifferentiationGroup(a,t);if(!o)return;const l=String(a?.index??r);s.has(l)||s.set(l,this._captureSeriesDifferentiationSnapshot(a));const d=o==="grouped-fill"&&this._usesGroupedPointDifferentiation(a),f=o==="grouped-fill"?this._getGroupedSeriesDifferentiationVariant(a,t,r):{variantIndex:r,...this._getSeriesDifferentiationVariantByIndex(r)},{dashStyle:v,markerSymbol:S,patternKind:_}=f,y=this._getHighchartsColorClassName(a?.graph??a?.area??a?.group,f.variantIndex),D=this._getLegendSeriesDifferentiationTargets(a);this._setSeriesDifferentiationMetadata(a?.graph,{role:"graph",dashStyle:v}),o==="area"&&(this._setSeriesDifferentiationMetadata(a?.area,{role:"area",patternKind:_}),this._setSeriesDifferentiationColorClass(a?.area,y),this._ensureStyledModeSeriesPattern(t,y,_)),o==="fill"&&(a.points?.forEach(p=>{this._setSeriesDifferentiationMetadata(p?.graphic,{role:"fill",patternKind:_}),this._setSeriesDifferentiationColorClass(p?.graphic,y)}),this._ensureStyledModeSeriesPattern(t,y,_)),o==="grouped-fill"&&(d?a.points?.forEach((p,z)=>{const w=this._getGroupedSeriesDifferentiationVariant(p,t,z),C=this._getHighchartsColorClassName(p?.graphic??p?.legendSymbol??p?.legendItem?.symbol??p?.legendItem?.group,w.variantIndex);this._setSeriesDifferentiationMetadata(p?.graphic,{role:"fill",patternKind:w.patternKind}),this._setSeriesDifferentiationColorClass(p?.graphic,C),this._ensureStyledModeSeriesPattern(t,C,w.patternKind)}):(a.points?.forEach(p=>{this._setSeriesDifferentiationMetadata(p?.graphic,{role:"fill",patternKind:_}),this._setSeriesDifferentiationColorClass(p?.graphic,y)}),this._ensureStyledModeSeriesPattern(t,y,_))),o==="point-fill"&&a.points?.forEach((p,z)=>{const w=i[z%i.length],C=this._getHighchartsColorClassName(p?.graphic??p?.legendSymbol??p?.legendItem?.symbol??p?.legendItem?.group,z),M=this._getLegendSeriesDifferentiationTargets(p);this._setSeriesDifferentiationMetadata(p?.graphic,{role:"fill",patternKind:w}),this._setSeriesDifferentiationColorClass(p?.graphic,C),this._ensureStyledModeSeriesPattern(t,C,w),M.fillTargets.forEach(k=>{this._setSeriesDifferentiationMetadata(k,{role:"legend-fill",patternKind:w}),this._setSeriesDifferentiationColorClass(k,C)})}),(o==="line"||o==="area")&&D.graphTargets.forEach(p=>{this._setSeriesDifferentiationMetadata(p,{role:"legend-symbol",dashStyle:v})}),(o==="area"||o==="fill"||o==="grouped-fill"&&!d)&&D.fillTargets.forEach(p=>{this._setSeriesDifferentiationMetadata(p,{role:"legend-fill",patternKind:_}),this._setSeriesDifferentiationColorClass(p,y)}),(o==="line"||o==="area")&&a.update({marker:{enabled:!0,symbol:S}},!1)}),this._applyGroupedLegendSeriesDifferentiation(t),t.redraw(!1)}_restoreStyledModeSeriesDifferentiation(t){this._getHighchartsSvgRoot(t)?.classList.remove("scb-viz-series-differentiation-enabled");const e=this._getSeriesDifferentiationSnapshotStore(t);t.series?.forEach((i,s)=>{const a=this._getSeriesDifferentiationGroup(i,t);if(!a)return;const r=this._getLegendSeriesDifferentiationTargets(i);if(this._clearSeriesDifferentiationMetadata(i?.graph),this._clearSeriesDifferentiationMetadata(i?.area),this._clearSeriesDifferentiationColorClass(i?.area),i.points?.forEach(o=>{const l=this._getLegendSeriesDifferentiationTargets(o);this._clearSeriesDifferentiationMetadata(o?.graphic),this._clearSeriesDifferentiationColorClass(o?.graphic),l.graphTargets.forEach(d=>{this._clearSeriesDifferentiationMetadata(d)}),l.fillTargets.forEach(d=>{this._clearSeriesDifferentiationMetadata(d),this._clearSeriesDifferentiationColorClass(d)})}),r.graphTargets.forEach(o=>{this._clearSeriesDifferentiationMetadata(o)}),r.fillTargets.forEach(o=>{this._clearSeriesDifferentiationMetadata(o),this._clearSeriesDifferentiationColorClass(o)}),a==="line"||a==="area"){const o=e.get(String(i?.index??s));i.update({marker:this._cloneSeriesOptionValue(o?.marker)},!1)}}),this._clearGroupedLegendSeriesDifferentiation(t),t.redraw(!1),this._seriesDifferentiationSnapshots.delete(t)}_canExportRaster(){return this._getExportableVisualElement()!==null}_canExportCsv(){return!!this._getResolvedTableData()?.rows?.length}_buildExportFileName(t){return tt({lang:this.lang,title:this.title},t)}_getFullscreenTarget(){return this}_getCurrentFullscreenElement(){return at()}_isFullscreenSupported(){return rt(this._getFullscreenTarget())}_syncFullscreenState(){const t=this._getCurrentFullscreenElement()===this._getFullscreenTarget();this._isFullscreen=t,this.toggleAttribute("data-scb-viz-fullscreen",t),h(c,this,L).call(this),h(c,this,x).call(this)}async _toggleFullscreen(){await lt(this._getFullscreenTarget())}_renderActionsMenu(){const t=this._getCurrentPrintableView(),e=this._canExportRaster(),i=this._canExportCsv(),s=e&&(t==="diagram"||t==="image"),a=i&&t==="table",r=this._shouldShowSeriesDifferentiationAction();return u`
116
+ `,Ft="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;white-space:nowrap;clip:rect(0, 0, 0, 0);clip-path:inset(50%);border:0;",At=0,f=(l=new WeakSet,A=class extends U{constructor(...t){super(...t),Q(this,l),this.variant="Standard",this.selectedChip="Diagram",this.title="",this.subtitle="",this.description="",this.comment="",this.source="",this.footnote="",this.lang="sv",this.imageHref="",this.officialStatistics=!1,this.disableToggle=!1,this.contentMaxWidth="",this.containerMaxWidth="",this.contentHeight="",this.toggleHeightMode="stable",this._actionsMenuOpen=!1,this._seriesDifferentiationEnabled=!1,this._isFullscreen=!1,this._seriesDifferentiationSnapshots=new WeakMap,this._diagramReflowFrame=0,this._chartConfigSyncFrame=0,this._fullscreenDiagramSizingFrame=0,this._fullscreenDiagramHeight="",this._instanceId=`scb-viz-${++At}`,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._onDocumentFullscreenChange=()=>{this._syncFullscreenState()},this._onWindowResize=()=>{this._isFullscreen&&c(l,this,T).call(this)},this._onToggleFullscreenClick=async()=>{this._closeActionsMenu(),await this._toggleFullscreen()},this._onDocumentPointerDown=e=>{if(!this._actionsMenuOpen)return;const i=e.composedPath(),s=this.shadowRoot?.querySelector(".actions-menu");s&&i.includes(s)||this._closeActionsMenu()},this._onDocumentKeyDown=e=>{this._actionsMenuOpen&&e.key==="Escape"&&(e.preventDefault(),this._closeActionsMenu(),this._focusMenuButton())},this._onPrintClick=async()=>{this._closeActionsMenu(),await c(l,this,jt).call(this)},this._onDownloadPngClick=async()=>{this._canExportRaster()&&(this._closeActionsMenu(),await c(l,this,P).call(this,"png"))},this._onDownloadJpgClick=async()=>{this._canExportRaster()&&(this._closeActionsMenu(),await c(l,this,P).call(this,"jpeg"))},this._onDownloadCsvClick=()=>{this._canExportCsv()&&(this._closeActionsMenu(),c(l,this,Gt).call(this))},this._onToggleSeriesDifferentiationClick=()=>{this._seriesDifferentiationEnabled=!this._seriesDifferentiationEnabled,this._closeActionsMenu(),c(l,this,V).call(this)}}get descriptionLabel(){return this.lang==="en"?"Description of the chart":"Beskrivning av diagrammet"}get moreAboutStatsLabel(){return this.lang==="en"?"More about the statistics":"Mer om statistiken"}get commentLabel(){return this.lang==="en"?"Comments":"Kommentar"}get sourceLabel(){return this.lang==="en"?"Source":"Källa"}get footnoteLabel(){return this.lang==="en"?"Footnotes":"Fotnot"}get officialStatisticsLabel(){return this.lang==="en"?"Official statistics of Sweden":"Sveriges officiella statistik"}get officialStatisticsTitle(){return this.lang==="en"?"Part of Official statistics of Sweden":"Tillhör Sveriges officiella statistik"}get officialStatisticsAlt(){return this.lang==="en"?"Read more about Official statistics of Sweden":"Läs mer om Sveriges officiella statistik"}get actionsMenuLabel(){return this.lang==="en"?"Open menu":"Öppna meny"}get printLabel(){return this.lang==="en"?"Print":"Skriv ut"}get downloadPngLabel(){return this.lang==="en"?"Download PNG":"Ladda ner PNG"}get downloadJpgLabel(){return this.lang==="en"?"Download JPG":"Ladda ner JPG"}get downloadCsvLabel(){return this.lang==="en"?"Download CSV":"Ladda ner CSV"}get enableSeriesDifferentiationLabel(){return this.lang==="en"?"Show symbols and patterns":"Visa symboler och mönster"}get disableSeriesDifferentiationLabel(){return this.lang==="en"?"Hide symbols and patterns":"Dölj symboler och mönster"}get enterFullscreenLabel(){return this.lang==="en"?"View fullscreen":"Visa i helskärm"}get exitFullscreenLabel(){return this.lang==="en"?"Exit fullscreen":"Avsluta helskärm"}_getImageAltText(){return this.lang==="en"?"Chart image":"Diagrambild"}_getTitleId(){return this.title?`${this._instanceId}-title`:void 0}_getSubtitleId(){return this.subtitle?`${this._instanceId}-subtitle`:void 0}_getDescriptionId(){return this.description?`${this._instanceId}-description`:void 0}_getContentAriaLabelledBy(){const t=[this._getTitleId(),this._getSubtitleId()].filter(Boolean);return t.length?t.join(" "):void 0}_getContentAriaDescribedBy(){const t=[this._getDescriptionId()].filter(Boolean);return t.length?t.join(" "):void 0}connectedCallback(){super.connectedCallback(),document.addEventListener("pointerdown",this._onDocumentPointerDown,!0),document.addEventListener("keydown",this._onDocumentKeyDown),document.addEventListener("fullscreenchange",this._onDocumentFullscreenChange),document.addEventListener("webkitfullscreenchange",this._onDocumentFullscreenChange),window.addEventListener("resize",this._onWindowResize),window.visualViewport?.addEventListener("resize",this._onWindowResize)}firstUpdated(t){this._readTableDataFromSlot(),c(l,this,N).call(this),c(l,this,I).call(this),c(l,this,L).call(this),this._syncChipClass(),c(l,this,k).call(this),c(l,this,x).call(this),this._syncFullscreenState(),c(l,this,T).call(this)}updated(t){super.updated(t),(t.has("selectedChip")||t.has("variant"))&&(this._syncChipClass(),this._closeActionsMenu()),t.has("selectedChip")&&this._dispatchSelectedChipChanged(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&c(l,this,N).call(this),t.has("containerMaxWidth")&&c(l,this,I).call(this),t.has("variant")&&c(l,this,k).call(this),(t.has("contentMaxWidth")||t.has("contentHeight")||t.has("toggleHeightMode")||t.has("variant"))&&c(l,this,L).call(this),(t.has("selectedChip")||t.has("variant")||t.has("contentMaxWidth")||t.has("contentHeight")||t.has("toggleHeightMode")||t.has("_isFullscreen"))&&c(l,this,x).call(this),(t.has("selectedChip")||t.has("variant"))&&this._seriesDifferentiationEnabled&&requestAnimationFrame(()=>{c(l,this,V).call(this)}),(t.has("valueFormat")||t.has("timeFormat")||t.has("yAxisSettings")||t.has("selectedChip")||t.has("variant"))&&c(l,this,R).call(this),(t.has("title")||t.has("subtitle")||t.has("description")||t.has("comment")||t.has("source")||t.has("footnote")||t.has("officialStatistics")||t.has("selectedChip")||t.has("variant")||t.has("_isFullscreen"))&&c(l,this,T).call(this)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",this._onDocumentPointerDown,!0),document.removeEventListener("keydown",this._onDocumentKeyDown),document.removeEventListener("fullscreenchange",this._onDocumentFullscreenChange),document.removeEventListener("webkitfullscreenchange",this._onDocumentFullscreenChange),window.removeEventListener("resize",this._onWindowResize),window.visualViewport?.removeEventListener("resize",this._onWindowResize),c(l,this,G).call(this),c(l,this,q).call(this),c(l,this,K).call(this),c(l,this,W).call(this)}_refreshTableDataFromSlot(t){this._readTableDataFromSlot(t||void 0),this.requestUpdate()}_onTableSlotChange(t){const e=t.target;e&&(this._refreshTableDataFromSlot(e),requestAnimationFrame(()=>{this._refreshTableDataFromSlot(e)}))}_onDiagramSlotChange(){c(l,this,L).call(this),c(l,this,x).call(this),c(l,this,R).call(this),this._seriesDifferentiationEnabled&&requestAnimationFrame(()=>{c(l,this,V).call(this)}),this.requestUpdate()}_normalizeRenderableCell(t){return Lt(t)}_readTableDataFromSlot(t){const e=t||this.shadowRoot?.querySelector('slot[name="table"]');this._slottedTableData=Vt(e)}_inferTableAlignments(t){return Tt(t,e=>this._parseTableNumericValue(e))}_parseTableNumericValue(t){if(t==null)return null;if(typeof t=="number")return Number.isFinite(t)?t:null;let e=String(t).replace(/[  \s]+/g,"").trim();if(!e)return null;e.endsWith("%")&&(e=e.slice(0,-1));const i=e.lastIndexOf(","),s=e.lastIndexOf(".");if(i>-1&&s>-1?i>s?e=e.replace(/\./g,"").replace(",","."):e=e.replace(/,/g,""):i>-1&&(e=e.replace(",",".")),!/^-?\d+(?:\.\d+)?$/.test(e))return null;const r=Number(e);return Number.isFinite(r)?r:null}_formatTableCell(t,e,i){const s=this._normalizeRenderableCell(t);if(s.html)return s;const r=s.text;if(!r)return s;if(e===0){const d=this._normalizeTimeFormat(this.timeFormat),g=this._formatCategoryTimeLabel(r,d);return g!==null?{html:"",text:g}:s}if(i[e]!=="right")return s;if(this._shouldPreserveSourceValueFormatting(this.valueFormat)){const d=this._localizeAutomaticNumericText(r);return d!==null?{html:"",text:d}:s}const a=this._parseTableNumericValue(r);if(a===null)return s;const n=this._normalizeValueFormat(this.valueFormat),h=this._formatValueForDisplay(a,n,!0);return h===null?s:{html:"",text:h}}_getViewportHeight(){return Math.round(window.visualViewport?.height||window.innerHeight||document.documentElement.clientHeight||0)}_readCssLength(t){const e=Number.parseFloat(t||"0");return Number.isFinite(e)?e:0}_getElementOuterHeight(t){const e=this.shadowRoot?.querySelector(t);if(!e)return 0;const i=getComputedStyle(e);return e.getBoundingClientRect().height+this._readCssLength(i.marginTop)+this._readCssLength(i.marginBottom)}_getFullscreenDiagramHeight(){if(!this._isFullscreen||this.variant!=="Standard"||this.selectedChip!=="Diagram")return"";const t=this._getViewportHeight();if(!t)return"";const e=getComputedStyle(this),i=this._readCssLength(e.paddingTop)+this._readCssLength(e.paddingBottom)+this._getElementOuterHeight(".header")+this._getElementOuterHeight(".actions-row")+this._getElementOuterHeight(".footer")+16,s=Math.floor(t-i);return!Number.isFinite(s)||s<=0?"":`${Math.max(320,s)}px`}_getResolvedContentMaxWidth(){return this.contentMaxWidth?.trim()||""}_getResolvedDiagramHeight(){return this._fullscreenDiagramHeight||this.contentHeight?.trim()||""}_getResolvedDiagramScrollerWidth(){return this._getResolvedContentMaxWidth()}_getResolvedToggleHeightMode(){return this.toggleHeightMode==="auto"?"auto":"stable"}_getResolvedStandardContentHeight(){return this._getResolvedDiagramHeight()||"600px"}_getResolvedTableData(){return this.tableData??this._slottedTableData}_getResolvedTableView(t){return Mt(t,{inferAlignments:e=>this._inferTableAlignments(e),normalizeCell:e=>this._normalizeRenderableCell(e),formatCell:(e,i,s)=>this._formatTableCell(e,i,s)})}_getDiagramAssignedElements(){const t=this.shadowRoot?.querySelector('slot[name="diagram"]');return t?t.assignedElements({flatten:!0}):[]}_findExportableVisualElement(t){for(const e of t){if(e instanceof SVGSVGElement||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)return e;const i=e.querySelector("svg, canvas, img");if(i instanceof SVGSVGElement||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement)return i}return null}_getExportableVisualElement(){if(this.variant==="Table")return null;if(this.variant==="Image"){const t=this.shadowRoot?.querySelector(".image-content img");return t instanceof HTMLImageElement?t:null}return this._findExportableVisualElement(this._getDiagramAssignedElements())}_getDefaultValueFormat(){return{type:"number",scale:"auto",decimals:0,decimalSeparator:this.lang==="en"?".":","}}_normalizeValueFormat(t){const e=this._getDefaultValueFormat(),i=t&&typeof t=="object"?t:{};return{type:["number","currency","percent"].includes(String(i.type))?String(i.type):e.type,scale:["auto","raw","thousands","millions","billions"].includes(String(i.scale))?String(i.scale):e.scale,decimals:Number.isFinite(Number(i.decimals))?Math.max(0,Math.min(20,Number(i.decimals))):e.decimals,decimalSeparator:String(i.decimalSeparator)==="."?".":String(i.decimalSeparator)===","?",":e.decimalSeparator}}_shouldPreserveSourceValueFormatting(t){const e=this._normalizeValueFormat(t);return e.type==="number"&&e.scale==="auto"}_normalizeTimeFormat(t){const e={mode:"raw",display:"raw"},i=t&&typeof t=="object"?t:{},s=["raw","year","monthCode","quarterCode","weekCode","tertialCode"];let r=typeof i.mode=="string"?i.mode:e.mode,a=typeof i.display=="string"?i.display:e.display;s.includes(r)||(r=e.mode);const n={raw:["raw"],year:["raw","year"],monthCode:["raw","iso-month","short-month","long-month"],quarterCode:["raw","quarter-compact","quarter-short","quarter-long"],weekCode:["raw","week-compact","week-long"],tertialCode:["raw","tertial-compact","tertial-short","tertial-long"]};return n[r].includes(a)||(a=n[r][0]),r==="raw"&&(a="raw"),{mode:r,display:a}}_normalizeYAxisSettings(t){const e=t&&typeof t=="object"?t:{},i=Number.isFinite(Number(e.referenceLineValue))?Number(e.referenceLineValue):null;return{startAtZero:!!e.startAtZero,referenceLineEnabled:!!e.referenceLineEnabled&&Number.isFinite(i),referenceLineValue:i,referenceLineLabel:typeof e.referenceLineLabel=="string"?e.referenceLineLabel:""}}_getShortMonthNames(){return["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec"]}_getLongMonthNames(){return["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"]}_formatCategoryTimeLabel(t,e){if(!t||e.mode==="raw"||e.display==="raw")return null;if(e.mode==="year"){const i=/^\s*(\d{4})\s*$/.exec(t);return i?i[1]:null}if(e.mode==="monthCode"){const i=/^\s*(\d{4})M(0?[1-9]|1[0-2])\s*$/i.exec(t);if(!i)return null;const s=Number(i[2])-1,r=i[1],a=String(s+1).padStart(2,"0");return e.display==="iso-month"?`${r}-${a}`:e.display==="short-month"?`${this._getShortMonthNames()[s]} ${r}`:e.display==="long-month"?`${this._getLongMonthNames()[s]} ${r}`:t}if(e.mode==="quarterCode"){const i=/^\s*(\d{4})(?:K(V)?|Q)(0?[1-4])\s*$/i.exec(t);if(!i)return null;const s=Number(i[3]),r=i[1],a=["första","andra","tredje","fjärde"];return e.display==="quarter-compact"?`${r} K${s}`:e.display==="quarter-short"?`kv ${s} ${r}`:e.display==="quarter-long"?`${a[s-1]} kvartalet ${r}`:t}if(e.mode==="weekCode"){const i=/^\s*(\d{4})(?:V|W)(0?[1-9]|[1-4][0-9]|5[0-3])\s*$/i.exec(t);if(!i)return null;const s=Number(i[2]),r=i[1];return e.display==="week-compact"?`${r} v. ${s}`:e.display==="week-long"?`vecka ${s} ${r}`:t}if(e.mode==="tertialCode"){const i=/^\s*(\d{4})T(0?[1-3])\s*$/i.exec(t);if(!i)return null;const s=Number(i[2]),r=i[1],a=["första","andra","tredje"];return e.display==="tertial-compact"?`${r} T${s}`:e.display==="tertial-short"?`tertial ${s} ${r}`:e.display==="tertial-long"?`${a[s-1]} tertialet ${r}`:t}return null}_localizeAutomaticNumericText(t){const e=this._normalizeValueFormat(this.valueFormat),i=String(t??"").trim();if(!i||i===".."||i==="...")return null;const s=i.replace(/[  \s]/g,"");if(!/^-?\d+(?:[.,]\d+)?$/.test(s))return null;const r=e.decimalSeparator==="."?".":",";return r==="."&&s.indexOf(",")!==-1?s.replace(",","."):r===","&&s.indexOf(".")!==-1?s.replace(".",","):s}_inferAutomaticValueDecimals(t){if(!Number.isFinite(t))return 0;let e=String(t);/e/i.test(e)&&(e=t.toFixed(6).replace(/0+$/,"").replace(/\.$/,""));const i=e.replace(/^-/,"").split(".");return i.length>1?Math.min(i[1].length,6):0}_formatAutomaticValueForDisplay(t,e){if(!Number.isFinite(t))return null;const i=this._localizeAutomaticNumericText(e);if(i!==null)return i;const s=this._normalizeValueFormat(this.valueFormat),r=this._inferAutomaticValueDecimals(t);return this._formatLocalizedNumber(t,r,s.decimalSeparator)}_formatLocalizedNumber(t,e,i){const s=new Intl.NumberFormat(this.lang==="en"?"en-GB":"sv-SE",{minimumFractionDigits:e,maximumFractionDigits:e}),r=i==="."||i===","?i:this.lang==="en"?".":",";return s.formatToParts(t).map(a=>a.type==="decimal"?r:a.value).join("")}_formatValueForDisplay(t,e,i){if(!Number.isFinite(t))return null;const s={raw:1,thousands:1e3,millions:1e6,billions:1e9},r={raw:"",thousands:this.lang==="en"?"k":"t",millions:this.lang==="en"?"M":"mn",billions:this.lang==="en"?"B":"md"};let a=e.scale;if(a==="auto"){const g=Math.abs(t);g>=1e9?a="billions":g>=1e6?a="millions":g>=1e3?a="thousands":a="raw"}const n=t/(s[a]||1);let h=this._formatLocalizedNumber(n,e.decimals,e.decimalSeparator);e.type==="percent"?h=`${h} %`:e.type==="currency"&&(h=i?`${h} kr`:h);const d=r[a]||"";return d&&(h=`${h} ${d}`),h}_isCategoryAxis(t){return t?.categories?.length>0||t?.options?.type==="category"}_isTooltipNumericLikeText(t){if(typeof t!="string")return!1;const e=t.trim();return e?/^-?\d+(?:[.,]\d+)?$/.test(e):!1}_getTooltipPointRowIndex(t){const e=t?.point||t;return Number.isFinite(e?.x)?Number(e.x):Number.isFinite(t?.x)?Number(t.x):Number.isFinite(e?.index)?Number(e.index):Number.isFinite(t?.index)?Number(t.index):null}_getTooltipTableCategoryValue(t){const e=this._getResolvedTableData();if(!e?.rows?.length)return"";const i=this._getTooltipPointRowIndex(t);if(i===null||i<0||i>=e.rows.length)return"";const s=e.rows[i];return!Array.isArray(s)||s.length===0?"":this._normalizeRenderableCell(s[0]).text}_getTooltipSeriesDataCategoryValue(t){const e=t?.point||t,i=e?.series||t?.series,s=this._getTooltipPointRowIndex(t);if(!i||s===null)return"";const r=[i?.options?.data,i?.userOptions?.data];for(const h of r){if(!Array.isArray(h)||s<0||s>=h.length)continue;const d=h[s];if(!d||typeof d!="object")continue;const g=typeof d.category<"u"&&d.category!==null?String(d.category):typeof d.name=="string"?d.name:"";if(g&&!this._isTooltipNumericLikeText(g))return g}const a=typeof e?.options?.category<"u"&&e.options.category!==null?String(e.options.category):"";if(a&&!this._isTooltipNumericLikeText(a))return a;const n=typeof e?.name=="string"?e.name.trim():"";return n&&!this._isTooltipNumericLikeText(n)?n:""}_getTooltipXAxisLabel(t,e){const i=t?.point||t,s=i?.series?.xAxis||t?.series?.xAxis,r=this._getTooltipPointRowIndex(t),a=[];if(s&&Array.isArray(s.categories)&&r!==null){const b=s.categories[r];typeof b<"u"&&b!==null&&a.push(String(b))}typeof i?.category=="string"&&i.category.trim()&&a.push(i.category),typeof t?.key=="string"&&t.key.trim()&&a.push(t.key),typeof t?.x=="string"&&t.x.trim()&&a.push(t.x);const n=this._getTooltipSeriesDataCategoryValue(t);n&&a.push(n);const h=this._getTooltipTableCategoryValue(t);h&&a.push(h);for(const b of a){const y=String(b).trim();if(!(!y||this._isTooltipNumericLikeText(y)))return this._formatCategoryTimeLabel(y,e)??y}const d=a.find(b=>String(b).trim());if(!d)return"";const g=String(d).trim();return this._formatCategoryTimeLabel(g,e)??g}_getTooltipPointLabel(t){const e=t?.point||t,i=e?.series||t?.series,s=String(e?.series?.type||i?.type||e?.series?.options?.type||i?.options?.type||e?.series?.chart?.options?.chart?.type||"").trim().toLowerCase();return["pie","variablepie"].includes(s)?e?.name||i?.name||"":i?.name||e?.name||""}_applyTimeFormatToLiveChart(t){const e=this._normalizeTimeFormat(this.timeFormat);if(e.mode==="raw"||e.display==="raw")return;const i=this._formatCategoryTimeLabel.bind(this);[...t?.xAxis||[],...t?.yAxis||[]].forEach(s=>{if(!this._isCategoryAxis(s))return;const r=s.options?.labels&&typeof s.options.labels=="object"?{...s.options.labels}:{},a=typeof r.formatter=="function"?r.formatter:null;r.formatter=function(){let n="";if(this?.axis&&Array.isArray(this.axis.categories)&&typeof this.pos=="number"){const d=this.axis.categories[this.pos];typeof d<"u"&&d!==null&&(n=String(d))}else typeof this?.value<"u"&&this.value!==null&&(n=String(this.value));const h=i(n,e);return h!==null?h:a?a.call(this):n},delete r.format,s.update({labels:r},!1)})}_applyValueFormatToLiveChart(t){const e=this._normalizeValueFormat(this.valueFormat),i=this._normalizeTimeFormat(this.timeFormat),s=this._formatValueForDisplay.bind(this),r=this._formatAutomaticValueForDisplay.bind(this),a=this._getTooltipXAxisLabel.bind(this),n=this._getTooltipPointLabel.bind(this);if(this._shouldPreserveSourceValueFormatting(this.valueFormat)){const h=t?.options?.tooltip&&typeof t.options.tooltip=="object"?{...t.options.tooltip}:{},d=t?.options?.plotOptions&&typeof t.options.plotOptions=="object"?{...t.options.plotOptions}:{},g=d.series&&typeof d.series=="object"?{...d.series}:{},b=g.dataLabels&&typeof g.dataLabels=="object"?{...g.dataLabels}:{},y=t?.options?.lang&&typeof t.options.lang=="object"?{...t.options.lang}:{};delete b.format,delete b.formatter,y.decimalPoint=e.decimalSeparator==="."?".":",",y.thousandsSep=" ",h.valueDecimals=void 0,h.formatter=function(){const _=Array.isArray(this.points)&&this.points.length?this.points:[this.point||this],S=a(this,i),D=[];return _.forEach(p=>{const z=p?.point||p,w=Number.isFinite(p?.y)?p.y:z?.y,C=n(p),M=r(w,z?.options&&typeof z.options.y<"u"&&z.options.y!==null?String(z.options.y):z&&typeof z.y<"u"&&z.y!==null?String(z.y):"");!Number.isFinite(w)||M===null||M===void 0||D.push(`${C?`${String(C)}: `:""}<b>${String(M)}</b><br/>`)}),`${S?`<span>${String(S)}</span><br/>`:""}${D.join("")}`}.bind(this),t.update({lang:y,tooltip:h,plotOptions:{...d,series:{...g,dataLabels:b}}},!1,!1,!1),(t?.yAxis||[]).forEach(_=>{const S=_.options?.labels&&typeof _.options.labels=="object"?{..._.options.labels}:{};delete S.format,delete S.formatter,_.update({labels:S},!1)});return}t.update({tooltip:{...t.options?.tooltip||{},valueDecimals:e.decimals,formatter:function(){const h=Array.isArray(this.points)&&this.points.length?this.points:[this.point||this],d=a(this,i),g=[];return h.forEach(b=>{const y=b?.point||b,_=s(Number.isFinite(b?.y)?b.y:y?.y,e,!0);if(_===null)return;const S=n(b);g.push(`${S?`${String(S)}: `:""}<b>${_}</b><br/>`)}),`${d?`<span>${String(d)}</span><br/>`:""}${g.join("")}`}},plotOptions:{...t.options?.plotOptions||{},series:{...t.options?.plotOptions?.series||{},dataLabels:{...t.options?.plotOptions?.series?.dataLabels||{},formatter:function(){return s(Number.isFinite(this?.y)?this.y:this?.point?.y,e,e.type==="percent")??null}}}}},!1,!1,!1),(t?.yAxis||[]).forEach(h=>{const d=h.options?.labels&&typeof h.options.labels=="object"?{...h.options.labels}:{},g=typeof d.formatter=="function"?d.formatter:null,b=!(h.options?.title&&typeof h.options.title.text=="string"&&h.options.title.text.trim());d.formatter=function(){const y=s(this?.value,e,b);return y!==null?y:g?g.call(this):this?.value},(e.type==="percent"||e.scale!=="auto")&&delete d.format,h.update({labels:d},!1)})}_applyYAxisSettingsToLiveChart(t){const e=this._normalizeYAxisSettings(this.yAxisSettings),i=t?.yAxis||[];i.length&&i.forEach((s,r)=>{const a=s.options&&typeof s.options=="object"?s.options:{},n={},h=typeof a.min<"u"&&a.min!==null&&a.min!=="";r===0&&e.startAtZero&&!h&&(n.min=0);const d=Array.isArray(a.plotLines)?a.plotLines.filter(g=>g?.id!=="scb-viz-reference-line"):[];r===0&&e.referenceLineEnabled&&Number.isFinite(e.referenceLineValue)&&d.push({id:"scb-viz-reference-line",className:"scb-axis-plotline scb-viz-reference-line",value:e.referenceLineValue}),d.length?n.plotLines=d:Array.isArray(a.plotLines)&&(n.plotLines=[]),s.update(n,!1)})}_getCurrentHighchartsChart(){if(this._getCurrentPrintableView()!=="diagram")return;const t=c(l,this,B).call(this,this._getDiagramAssignedElements());if(t!==void 0)return window.Highcharts?.charts?.[t]}_getSeriesDifferentiationGroup(t,e){const i=String(t?.type||t?.options?.type||e?.options?.chart?.type||"").trim().toLowerCase();return["line","spline","scatter"].includes(i)?"line":["area","areaspline"].includes(i)?"area":["column","bar"].includes(i)?this._isGroupedSeriesDifferentiationChart(t,e)?"grouped-fill":"fill":["pie","variablepie"].includes(i)?"point-fill":null}_getSeriesDifferentiationVariantByIndex(t){return yt(t)}_isGroupedSeriesDifferentiationChart(t,e){return St(t,e)}_usesGroupedPointDifferentiation(t){return Dt(t)}_getGroupedSeriesDifferentiationVariant(t,e,i){const s=mt(t,e,i);return{...s,variantIndex:typeof s.variantIndex=="number"?s.variantIndex:i}}_applyGroupedLegendSeriesDifferentiation(t){(Array.isArray(t?.legend?.allItems)?t.legend.allItems:[]).forEach((e,i)=>{const s=e&&e.series?e.series:e;if(!this._isGroupedSeriesDifferentiationChart(s,t))return;const{variantIndex:r,patternKind:a}=this._getGroupedSeriesDifferentiationVariant(e,t,i),n=this._getHighchartsColorClassName(e?.legendSymbol??e?.legendItem?.symbol??e?.legendItem?.group,r);this._getLegendSeriesDifferentiationTargets(e).fillTargets.forEach(h=>{this._setSeriesDifferentiationMetadata(h,{role:"legend-fill",patternKind:a}),this._setSeriesDifferentiationColorClass(h,n)}),this._ensureStyledModeSeriesPattern(t,n,a)})}_clearGroupedLegendSeriesDifferentiation(t){(Array.isArray(t?.legend?.allItems)?t.legend.allItems:[]).forEach(e=>{const i=e&&e.series?e.series:e;if(!this._isGroupedSeriesDifferentiationChart(i,t))return;const s=this._getLegendSeriesDifferentiationTargets(e);s.graphTargets.forEach(r=>{this._clearSeriesDifferentiationMetadata(r)}),s.fillTargets.forEach(r=>{this._clearSeriesDifferentiationMetadata(r),this._clearSeriesDifferentiationColorClass(r)})})}_shouldShowSeriesDifferentiationAction(){return xt({chart:this._getCurrentHighchartsChart(),getCurrentPrintableView:()=>this._getCurrentPrintableView(),getSeriesDifferentiationGroup:(t,e)=>this._getSeriesDifferentiationGroup(t,e),isHighchartsStyledMode:t=>this._isHighchartsStyledMode(t)})}_getSeriesDifferentiationSnapshotStore(t){let e=this._seriesDifferentiationSnapshots.get(t);return e||(e=new Map,this._seriesDifferentiationSnapshots.set(t,e)),e}_cloneSeriesOptionValue(t){return Array.isArray(t)?t.map(e=>this._cloneSeriesOptionValue(e)):t&&typeof t=="object"?Object.fromEntries(Object.entries(t).map(([e,i])=>[e,this._cloneSeriesOptionValue(i)])):t}_captureSeriesDifferentiationSnapshot(t){const e=this._cloneSeriesOptionValue(t?.options?.marker),i=this._cloneSeriesOptionValue(t?.resetA11yMarkerOptions),s=this._cloneSeriesOptionValue(t?.userOptions?.marker),r=e?.states,a=t?.a11yMarkersForced===!0&&i&&Object.keys(i).length>0||r?.normal?.opacity===0&&i&&Object.keys(i).length>0?i:s;return{marker:a&&Object.keys(a).length>0?a:e&&Object.keys(e).length>0?e:{enabled:!1}}}_isHighchartsStyledMode(t){return zt(t)}_getHighchartsSvgRoot(t){return vt(t)}_getHighchartsColorClassName(t,e){return bt(t,e)}_setSeriesDifferentiationMetadata(t,e){Ct(t,e)}_clearSeriesDifferentiationMetadata(t){gt(t)}_setSeriesDifferentiationColorClass(t,e){wt(t,e)}_clearSeriesDifferentiationColorClass(t){ut(t)}_getLegendSeriesDifferentiationTargets(t){return _t(t)}_ensureStyledModeSeriesPattern(t,e,i){ft(t,e,i)}_applyStyledModeSeriesDifferentiation(t){const e=this._getHighchartsSvgRoot(t);if(!e)return;e.classList.add("scb-viz-series-differentiation-enabled");const i=pt(),s=this._getSeriesDifferentiationSnapshotStore(t);t.series?.forEach((r,a)=>{const n=this._getSeriesDifferentiationGroup(r,t);if(!n)return;const h=String(r?.index??a);s.has(h)||s.set(h,this._captureSeriesDifferentiationSnapshot(r));const d=n==="grouped-fill"&&this._usesGroupedPointDifferentiation(r),g=n==="grouped-fill"?this._getGroupedSeriesDifferentiationVariant(r,t,a):{variantIndex:a,...this._getSeriesDifferentiationVariantByIndex(a)},{dashStyle:b,markerSymbol:y,patternKind:_}=g,S=this._getHighchartsColorClassName(r?.graph??r?.area??r?.group,g.variantIndex),D=this._getLegendSeriesDifferentiationTargets(r);this._setSeriesDifferentiationMetadata(r?.graph,{role:"graph",dashStyle:b}),n==="area"&&(this._setSeriesDifferentiationMetadata(r?.area,{role:"area",patternKind:_}),this._setSeriesDifferentiationColorClass(r?.area,S),this._ensureStyledModeSeriesPattern(t,S,_)),n==="fill"&&(r.points?.forEach(p=>{this._setSeriesDifferentiationMetadata(p?.graphic,{role:"fill",patternKind:_}),this._setSeriesDifferentiationColorClass(p?.graphic,S)}),this._ensureStyledModeSeriesPattern(t,S,_)),n==="grouped-fill"&&(d?r.points?.forEach((p,z)=>{const w=this._getGroupedSeriesDifferentiationVariant(p,t,z),C=this._getHighchartsColorClassName(p?.graphic??p?.legendSymbol??p?.legendItem?.symbol??p?.legendItem?.group,w.variantIndex);this._setSeriesDifferentiationMetadata(p?.graphic,{role:"fill",patternKind:w.patternKind}),this._setSeriesDifferentiationColorClass(p?.graphic,C),this._ensureStyledModeSeriesPattern(t,C,w.patternKind)}):(r.points?.forEach(p=>{this._setSeriesDifferentiationMetadata(p?.graphic,{role:"fill",patternKind:_}),this._setSeriesDifferentiationColorClass(p?.graphic,S)}),this._ensureStyledModeSeriesPattern(t,S,_))),n==="point-fill"&&r.points?.forEach((p,z)=>{const w=i[z%i.length],C=this._getHighchartsColorClassName(p?.graphic??p?.legendSymbol??p?.legendItem?.symbol??p?.legendItem?.group,z),M=this._getLegendSeriesDifferentiationTargets(p);this._setSeriesDifferentiationMetadata(p?.graphic,{role:"fill",patternKind:w}),this._setSeriesDifferentiationColorClass(p?.graphic,C),this._ensureStyledModeSeriesPattern(t,C,w),M.fillTargets.forEach(H=>{this._setSeriesDifferentiationMetadata(H,{role:"legend-fill",patternKind:w}),this._setSeriesDifferentiationColorClass(H,C)})}),(n==="line"||n==="area")&&D.graphTargets.forEach(p=>{this._setSeriesDifferentiationMetadata(p,{role:"legend-symbol",dashStyle:b})}),(n==="area"||n==="fill"||n==="grouped-fill"&&!d)&&D.fillTargets.forEach(p=>{this._setSeriesDifferentiationMetadata(p,{role:"legend-fill",patternKind:_}),this._setSeriesDifferentiationColorClass(p,S)}),(n==="line"||n==="area")&&r.update({marker:{enabled:!0,symbol:y}},!1)}),this._applyGroupedLegendSeriesDifferentiation(t),t.redraw(!1)}_restoreStyledModeSeriesDifferentiation(t){this._getHighchartsSvgRoot(t)?.classList.remove("scb-viz-series-differentiation-enabled");const e=this._getSeriesDifferentiationSnapshotStore(t);t.series?.forEach((i,s)=>{const r=this._getSeriesDifferentiationGroup(i,t);if(!r)return;const a=this._getLegendSeriesDifferentiationTargets(i);if(this._clearSeriesDifferentiationMetadata(i?.graph),this._clearSeriesDifferentiationMetadata(i?.area),this._clearSeriesDifferentiationColorClass(i?.area),i.points?.forEach(n=>{const h=this._getLegendSeriesDifferentiationTargets(n);this._clearSeriesDifferentiationMetadata(n?.graphic),this._clearSeriesDifferentiationColorClass(n?.graphic),h.graphTargets.forEach(d=>{this._clearSeriesDifferentiationMetadata(d)}),h.fillTargets.forEach(d=>{this._clearSeriesDifferentiationMetadata(d),this._clearSeriesDifferentiationColorClass(d)})}),a.graphTargets.forEach(n=>{this._clearSeriesDifferentiationMetadata(n)}),a.fillTargets.forEach(n=>{this._clearSeriesDifferentiationMetadata(n),this._clearSeriesDifferentiationColorClass(n)}),r==="line"||r==="area"){const n=e.get(String(i?.index??s));i.update({marker:this._cloneSeriesOptionValue(n?.marker)},!1)}}),this._clearGroupedLegendSeriesDifferentiation(t),t.redraw(!1),this._seriesDifferentiationSnapshots.delete(t)}_canExportRaster(){return this._getExportableVisualElement()!==null}_canExportCsv(){return!!this._getResolvedTableData()?.rows?.length}_buildExportFileName(t){return tt({lang:this.lang,title:this.title},t)}_getFullscreenTarget(){return this}_getCurrentFullscreenElement(){return rt()}_isFullscreenSupported(){return at(this._getFullscreenTarget())}_syncFullscreenState(){const t=this._getCurrentFullscreenElement()===this._getFullscreenTarget();this._isFullscreen=t,this.toggleAttribute("data-scb-viz-fullscreen",t),c(l,this,T).call(this),c(l,this,x).call(this)}async _toggleFullscreen(){await lt(this._getFullscreenTarget())}_renderActionsMenu(){const t=this._getCurrentPrintableView(),e=this._canExportRaster(),i=this._canExportCsv(),s=e&&(t==="diagram"||t==="image"),r=i&&t==="table",a=this._shouldShowSeriesDifferentiationAction();return u`
117
117
  <div class="actions-menu">
118
118
  <scb-icon-button
119
119
  icon="more_vert"
@@ -125,7 +125,7 @@ import{f as F,h as U,i as J,m as Y,p as b,t as X,v as u,y as Z}from"../../vendor
125
125
  aria-label=${this.actionsMenuLabel}
126
126
  aria-haspopup="menu"
127
127
  aria-expanded=${this._actionsMenuOpen?"true":"false"}
128
- @click=${o=>this._toggleActionsMenu(o)}
128
+ @click=${n=>this._toggleActionsMenu(n)}
129
129
  ></scb-icon-button>
130
130
  <div
131
131
  class=${`actions-menu-panel ${this._actionsMenuOpen?"actions-menu-panel--open":""}`}
@@ -168,7 +168,7 @@ import{f as F,h as U,i as J,m as Y,p as b,t as X,v as u,y as Z}from"../../vendor
168
168
  </button>
169
169
  </li>
170
170
  `:""}
171
- ${a?u`
171
+ ${r?u`
172
172
  <li>
173
173
  <button
174
174
  type="button"
@@ -181,7 +181,7 @@ import{f as F,h as U,i as J,m as Y,p as b,t as X,v as u,y as Z}from"../../vendor
181
181
  </button>
182
182
  </li>
183
183
  `:""}
184
- ${r?u`
184
+ ${a?u`
185
185
  <li>
186
186
  <button
187
187
  type="button"
@@ -248,15 +248,15 @@ import{f as F,h as U,i as J,m as Y,p as b,t as X,v as u,y as Z}from"../../vendor
248
248
  ${e}
249
249
  ${this._renderActionsMenu()}
250
250
  </div>
251
- `:e}_renderTable(){const t=this._getResolvedTableData();if(!t||!t.rows||t.rows.length===0)return null;const{alignments:e,headers:i,rows:s,rowHeaderRows:a}=this._getResolvedTableView(t),r=[this.title,this.subtitle].map(l=>typeof l=="string"?l.trim():"").filter(Boolean).join(". "),o=l=>l.html?l.html:this._escapeHtml(l.text);return u`
251
+ `:e}_renderTable(){const t=this._getResolvedTableData();if(!t||!t.rows||t.rows.length===0)return null;const{alignments:e,headers:i,rows:s,rowHeaderRows:r}=this._getResolvedTableView(t),a=[this.title,this.subtitle].map(n=>typeof n=="string"?n.trim():"").filter(Boolean).join(". ");return u`
252
252
  <scb-table part="table" column-width-mode="header">
253
- ${J(`<table class="scb-viz-table">${r?`<caption class="visually-hidden">${this._escapeHtml(r)}</caption>`:""}${i.length>0?`<thead><tr>${i.map((l,d)=>`<th scope="col" class="${e[d]==="right"?"align-right":"align-left"}">${o(l)}</th>`).join("")}</tr></thead>`:""}<tbody>${s.map((l,d)=>{const f=a[d]===!0;return`<tr>${l.map((v,S)=>{const _=e[S]==="right"?"align-right":"align-left",y=o(v);return S===0&&f?`<th scope="row" class="${_}">${y}</th>`:`<td class="${_}">${y}</td>`}).join("")}</tr>`}).join("")}</tbody></table>`)}
253
+ ${J(`<table class="scb-viz-table">${a?`<caption class="visually-hidden">${this._escapeHtml(a)}</caption>`:""}${i.length>0?`<thead><tr>${i.map((n,h)=>`<th scope="col" class="${e[h]==="right"?"align-right":"align-left"}">${this._renderTableHeaderContent(n,h)}</th>`).join("")}</tr></thead>`:""}<tbody>${s.map((n,h)=>{const d=r[h]===!0;return`<tr>${n.map((g,b)=>{const y=e[b]==="right"?"align-right":"align-left",_=this._renderTableCellContent(g);return b===0&&d?`<th scope="row" class="${y}">${_}</th>`:`<td class="${y}">${_}</td>`}).join("")}</tr>`}).join("")}</tbody></table>`)}
254
254
  </scb-table>
255
- `}_renderRichText(t){const e=typeof t=="string"?t.replace(/\r\n?/g,`
255
+ `}_renderTableCellContent(t){return t.html?t.html:this._escapeHtml(t.text)}_getNormalizedText(t){return(t??"").replace(/\s+/g," ").trim()}_renderTableHeaderContent(t,e){const i=this._renderTableCellContent(t);return this._getNormalizedText(i)?i:this._renderVisuallyHiddenText(this._getEmptyTableHeaderLabel(e))}_renderVisuallyHiddenText(t){return`<span class="visually-hidden" style="${Ft}">${this._escapeHtml(t)}</span>`}_getEmptyTableHeaderLabel(t){return t===0?this.lang==="en"?"Row header":"Radrubrik":this.lang==="en"?`Column ${t+1}`:`Kolumn ${t+1}`}_renderRichText(t){const e=typeof t=="string"?t.replace(/\r\n?/g,`
256
256
  `):"",i=e.split(/\n{2,}/).filter(s=>s!=="");return i.length?u`${i.map(s=>u`<p class="body-text-paragraph">${s.split(`
257
- `).map((a,r)=>u`${r>0?u`<br />`:""}${a}`)}</p>`)}`:e}_escapeHtml(t){return String(t??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}_renderRichTextHtml(t){const e=typeof t=="string"?t.replace(/\r\n?/g,`
257
+ `).map((r,a)=>u`${a>0?u`<br />`:""}${r}`)}</p>`)}`:e}_escapeHtml(t){return String(t??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}_renderRichTextHtml(t){const e=typeof t=="string"?t.replace(/\r\n?/g,`
258
258
  `):"",i=e.split(/\n{2,}/).filter(s=>s!=="");return i.length?i.map(s=>`<p class="body-text-paragraph">${s.split(`
259
- `).map(a=>this._escapeHtml(a)).join("<br>")}</p>`).join(""):this._escapeHtml(e)}_hasMoreAboutStats(){return!!(this.comment||this.source||this.footnote||this.officialStatistics)}_renderMoreAboutStatsContent(){return u`
259
+ `).map(r=>this._escapeHtml(r)).join("<br>")}</p>`).join(""):this._escapeHtml(e)}_hasMoreAboutStats(){return!!(this.comment||this.source||this.footnote||this.officialStatistics)}_renderMoreAboutStatsContent(){return u`
260
260
  <div class="more-about-stats-content">
261
261
  ${this.comment?u`
262
262
  <div class="section">
@@ -408,4 +408,4 @@ import{f as F,h as U,i as J,m as Y,p as b,t as X,v as u,y as Z}from"../../vendor
408
408
  ></slot>
409
409
  <slot></slot>
410
410
  </div>
411
- `}}}_syncChipClass(){const t=this.variant==="Standard";this.classList.toggle("chip-diagram",t&&this.selectedChip==="Diagram"),this.classList.toggle("chip-table",t&&this.selectedChip==="Table")}_dispatchSelectedChipChanged(){const t={selectedChip:this.selectedChip};this.dispatchEvent(new CustomEvent("selected-chip-changed",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("selectedchipchanged",{detail:t,bubbles:!0,composed:!0}))}_onSegmentedChange(t){const e=t.detail?.value;this.selectedChip===e?this.selectedChip=null:this.selectedChip=e}_toggleActionsMenu(t){t.stopPropagation(),this._actionsMenuOpen=!this._actionsMenuOpen,this._actionsMenuOpen&&requestAnimationFrame(()=>{this._focusFirstMenuItem()})}_closeActionsMenu(){this._actionsMenuOpen=!1}_focusMenuButton(){this.shadowRoot?.querySelector(".actions-menu scb-icon-button")?.focus()}_focusFirstMenuItem(){this.shadowRoot?.querySelector(".actions-menu-item")?.focus()}_getExportSurfaceTarget(){return this.shadowRoot?.querySelector(".viz-container")??this}_getCurrentPrintableView(){return this.variant==="Table"?"table":this.variant==="Image"?"image":this.selectedChip==="Table"?"table":"diagram"}},A.styles=Z`:host{display:block;min-inline-size:0;--_scb-viz-font-family:var(--brand-font, Inter, 'Segoe UI', Arial, sans-serif);--_scb-viz-body-font-size:var(--md-sys-typescale-body-large-size, 1rem);--_scb-viz-body-font-weight:var(--weight-regular, 400);--_scb-viz-body-line-height:var(--md-sys-typescale-body-large-line-height, 1.5);--_scb-viz-body-letter-spacing:var(--md-sys-typescale-body-large-tracking, normal);--_scb-viz-title-size:var(--md-sys-typescale-title-large-size, 1.75rem);--_scb-viz-title-weight:var(--weight-semibold, 600);--_scb-viz-title-line-height:var(--md-sys-typescale-title-large-line-height, 1.25);--_scb-viz-title-letter-spacing:var(--md-sys-typescale-title-large-tracking, normal);--_scb-viz-subtitle-size:var(--md-sys-typescale-body-large-size, 1rem);--_scb-viz-subtitle-weight:var(--weight-regular, 400);--_scb-viz-subtitle-line-height:var(--md-sys-typescale-body-large-line-height, 1.5);--_scb-viz-subtitle-letter-spacing:var(--md-sys-typescale-body-large-tracking, normal);--_scb-viz-section-title-size:var(--md-sys-typescale-title-medium-size, 1rem);--_scb-viz-section-title-weight:var(--weight-semibold, 600);--_scb-viz-section-title-line-height:var(--md-sys-typescale-title-medium-line-height, 1.5);--_scb-viz-section-title-letter-spacing:var(--md-sys-typescale-title-medium-tracking, normal);--_scb-viz-text-color:var(--md-sys-color-on-surface, #1f1f1f);font-family:var(--_scb-viz-font-family);font-size:var(--_scb-viz-body-font-size);font-weight:var(--_scb-viz-body-font-weight);line-height:var(--_scb-viz-body-line-height);letter-spacing:var(--_scb-viz-body-letter-spacing);font-style:normal;text-align:start;color:var(--_scb-viz-text-color);background:var(--scb-viz-surface-color, var(--md-sys-color-surface, #fff));padding:var(--scb-viz-padding, var(--spacing-7, 24px));max-width:var(--scb-viz-container-max-width, 100%);border-radius:var(--scb-viz-border-radius, var(--spacing-04, 16px));border:1px solid var(--scb-viz-outline-color, var(--md-sys-color-outline-variant, #c5c7d0));margin-block-start:var(--scb-viz-spacing-block-start, 0);margin-block-end:var(--scb-viz-spacing-block-end, 0);margin-inline-start:var(--scb-viz-spacing-inline-start, 0);margin-inline-end:var(--scb-viz-spacing-inline-end, 0)}:host,:host *,:host ::after,:host ::before{box-sizing:border-box}scb-segmented-button{--scb-segmented-button-height:var(--icon-size-small, 32px)}scb-accordion,scb-accordion-item,scb-icon-button,scb-segmented-button{--brand-font:var(--_scb-viz-font-family)}scb-accordion,scb-accordion-item,scb-segmented-button{--weight-regular:var(--_scb-viz-body-font-weight);--weight-semibold:var(--_scb-viz-section-title-weight)}scb-accordion,scb-accordion-item{--scb-accordion-title-font-size:var(--_scb-viz-section-title-size);--scb-accordion-title-line-height:var(--_scb-viz-section-title-line-height);--scb-accordion-title-letter-spacing:var(--_scb-viz-section-title-letter-spacing);--scb-accordion-supporting-font-size:var(--_scb-viz-body-font-size);--scb-accordion-supporting-line-height:var(--_scb-viz-body-line-height);--scb-accordion-supporting-letter-spacing:var(--_scb-viz-body-letter-spacing)}.label{font-family:var(--_scb-viz-font-family);font-size:var(--_scb-viz-title-size);font-weight:var(--_scb-viz-title-weight);line-height:var(--_scb-viz-title-line-height);letter-spacing:var(--_scb-viz-title-letter-spacing);text-align:start;margin:0}.sub-label{font-size:var(--_scb-viz-subtitle-size);font-weight:var(--_scb-viz-subtitle-weight);line-height:var(--_scb-viz-subtitle-line-height);letter-spacing:var(--_scb-viz-subtitle-letter-spacing);margin:0}.body-text,.secondary-label,.sub-label{font-family:var(--_scb-viz-font-family);text-align:start}.secondary-label{font-size:var(--_scb-viz-section-title-size);font-weight:var(--_scb-viz-section-title-weight);line-height:var(--_scb-viz-section-title-line-height);letter-spacing:var(--_scb-viz-section-title-letter-spacing);margin:0}.body-text{font-size:var(--_scb-viz-body-font-size);font-weight:var(--_scb-viz-body-font-weight);line-height:var(--_scb-viz-body-line-height);letter-spacing:var(--_scb-viz-body-letter-spacing);font-style:normal}.body-text-rich{display:flex;flex-direction:column;gap:var(--spacing-4, 16px)}.body-text-paragraph{margin:0}.highcharts-visually-hidden,.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;white-space:nowrap!important;clip:rect(0,0,0,0)!important;clip-path:inset(50%)!important;border:0!important}.more-about-stats-content,.section{display:flex;flex-direction:column;color:var(--_scb-viz-text-color);font-family:var(--_scb-viz-font-family);font-style:normal;text-align:start}.section{gap:var(--spacing-2, 8px)}.more-about-stats-content{gap:var(--spacing-7, 24px);max-width:600px}.sos-logotype-link{display:inline-flex;border:0;color:var(--_scb-viz-text-color);line-height:0;text-decoration:none;width:fit-content}.sos-logotype-link:focus-visible{outline:var(--stroke-focus-ring, 2px) solid var(--md-focus-ring-color, currentColor);outline-offset:var(--spacing-1, 4px);border-radius:var(--radius-xs, 4px)}.sos-logotype-small,.sos-logotype-small svg{height:26px;width:auto;display:block}.sos-logotype-small svg{height:100%}@media only screen and (min-width:768px){.sos-logotype-small{height:24px}}.header{margin-bottom:var(--spacing-7, 24px);max-width:600px;color:var(--_scb-viz-text-color);font-family:var(--_scb-viz-font-family);font-style:normal;text-align:start}.actions-row,.header-row{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--spacing-4, 16px)}.header-row{margin-bottom:var(--spacing-7, 24px)}.header-row .header{flex:1 1 auto;margin-bottom:0}.header-row .actions-menu{margin-block-start:0}.actions-row{margin-bottom:var(--spacing-9, 40px)}.flipp-wrapper{flex:1 1 auto;max-width:234px}.actions-menu{position:relative;flex:0 0 auto;display:inline-flex;align-items:flex-start;justify-content:flex-end}.actions-menu-panel{position:absolute;inset-block-start:calc(100% + var(--spacing-2, 8px));inset-inline-end:0;min-width:180px;padding:var(--spacing-2, 8px);border:1px solid var(--scb-viz-outline-color, var(--md-sys-color-outline-variant, #c5c7d0));border-radius:var(--radius-m, 12px);background:var(--scb-viz-surface-color, var(--md-sys-color-surface, #fff));box-shadow:0 8px 24px rgba(0,0,0,.12);display:none;z-index:10}.actions-menu-panel--open{display:block}.actions-menu-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--spacing-1, 4px)}.actions-menu-item{appearance:none;border:0;border-radius:var(--radius-s, 8px);background:0 0;color:var(--_scb-viz-text-color);width:100%;display:flex;align-items:center;gap:var(--scb-viz-actions-menu-item-gap, var(--spacing-2, 8px));text-align:start;font-family:var(--_scb-viz-font-family);font-size:var(--_scb-viz-body-font-size);font-weight:var(--_scb-viz-body-font-weight);line-height:var(--_scb-viz-body-line-height);letter-spacing:var(--_scb-viz-body-letter-spacing);padding-block:var(--spacing-2, 8px);padding-inline:var(--spacing-3, 12px);cursor:pointer}.actions-menu-item-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;font-family:"Material Symbols Outlined";font-size:var(--scb-viz-actions-menu-item-icon-size, var(--icon-size-small, 20px));line-height:1;font-style:normal;font-weight:400;letter-spacing:normal;text-transform:none;white-space:nowrap;direction:ltr;font-variation-settings:"FILL"0,"wght"400,"GRAD"0,"opsz"20;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale}.actions-menu-item-label{flex:1 1 auto;min-width:0}.actions-menu-item:hover{background:var(--md-sys-color-surface-container, #f5f5f5)}.actions-menu-item:focus-visible{outline:var(--stroke-focus-ring, 2px) solid var(--md-focus-ring-color, currentColor);outline-offset:0}.actions-menu-item:disabled{background:0 0;color:var(--md-sys-color-on-surface-variant, rgba(0, 0, 0, 0.56));cursor:default;opacity:.64}.actions-menu-item:disabled:hover{background:0 0}.content,.description,.footer{color:var(--_scb-viz-text-color);font-family:var(--_scb-viz-font-family);font-style:normal;text-align:start}.description{margin-bottom:var(--spacing-8, 32px)}.footer{margin-top:var(--spacing-7, 24px)}.footer-statistics-print{display:none}.print-more-about-stats{max-width:600px}.print-more-about-stats .more-about-stats-content{gap:var(--spacing-5, 16px)}.print-more-about-stats-heading{margin-bottom:var(--spacing-5, 16px)}.description.section{max-width:600px}.diagram-scroller{display:none}.image-content{display:none;width:100%}.diagram-content{width:100%;max-width:var(--scb-viz-content-max-width, none);min-width:var(--scb-viz-content-max-width, 0);min-height:var(--scb-viz-diagram-min-height, 600px);height:var(--scb-viz-diagram-height, auto);overflow:var(--scb-viz-diagram-overflow, visible)}::slotted([slot=diagram]){display:block;width:100%;max-width:100%;min-width:0;min-height:var(--scb-viz-diagram-min-height, 600px);height:var(--scb-viz-diagram-height, auto);overflow:var(--scb-viz-diagram-overflow, visible)}.standard-content-shell{display:block;width:100%;min-width:0}.standard-content-shell--stable{min-height:var(--scb-viz-standard-content-height, var(--scb-viz-diagram-min-height, 600px))}.standard-content-panel{display:none;width:100%;min-width:0}.standard-content-panel--active{display:flex;flex-direction:column}.standard-diagram-scroller{display:flex;width:100%;min-width:0}.table-panel-scroll{width:100%;min-width:0}.standard-content-shell--stable .standard-content-panel--table.standard-content-panel--active{height:var(--scb-viz-standard-content-height, var(--scb-viz-diagram-min-height, 600px));min-height:0;overflow:hidden}.standard-content-shell--stable .standard-content-panel--table.standard-content-panel--active .table-panel-scroll{flex:1 1 auto;min-height:0;overflow:auto}:host([variant='Image']) .image-content{display:block}:host([variant='Image']) img{height:auto;max-width:100%}:host([variant='Image']) .diagram-scroller{display:none}:host([variant='Standard'].chip-diagram) .diagram-scroller{display:flex}.table-source{display:none}:host([data-scb-viz-fullscreen]){width:100%;height:100%;max-width:none;margin:0;border:0;border-radius:0;overflow:auto}:host([data-scb-viz-fullscreen]) .viz-container{min-height:100%}:host([data-scb-viz-force-light]),:host([data-scb-viz-print-preview]){color-scheme:light;--_scb-viz-text-color:#1f1f1f;--scb-viz-surface-color:#fff;--scb-viz-outline-color:#c5c7d0;--md-sys-color-surface:#fff;--md-sys-color-surface-container:#f5f5f5;--md-sys-color-surface-container-highest:#e7e8ec;--md-sys-color-on-surface:#1f1f1f;--md-sys-color-on-surface-variant:rgba(0, 0, 0, 0.72);--md-sys-color-outline-variant:#c5c7d0;--md-focus-ring-color:#1f1f1f}:host([data-scb-viz-print-preview]){background:0 0;border:0;border-radius:0;box-shadow:none;max-width:none;padding:0}:host([data-scb-viz-print-preview]) .actions-menu-panel,:host([data-scb-viz-print-preview]) .actions-row{display:none!important}:host([data-scb-viz-print-preview]) .standard-content-shell--stable,:host([data-scb-viz-print-preview]) .standard-content-shell--stable .diagram-content,:host([data-scb-viz-print-preview]) .standard-content-shell--stable .standard-content-panel--active,:host([data-scb-viz-print-preview]) .standard-content-shell--stable .standard-diagram-scroller,:host([data-scb-viz-print-preview]) .standard-content-shell--stable .table-panel-scroll,:host([data-scb-viz-print-preview]) .standard-content-shell--stable ::slotted([slot=diagram]){height:auto!important;min-height:0!important;overflow:visible!important}:host([data-scb-viz-print-preview]) .table-panel-scroll,:host([data-scb-viz-print-preview]) scb-horizontal-scroller{overflow:visible!important}:host([data-scb-viz-print-preview]) .description{margin-bottom:var(--spacing-5, 16px)}:host([data-scb-viz-print-preview]) .footer{margin-top:var(--spacing-5, 16px)}:host([data-scb-viz-print-preview]) .footer-statistics-screen{display:none!important}:host([data-scb-viz-print-preview]) .footer-statistics-print{display:block!important}:host([data-scb-viz-print-preview]) .viz-container{zoom:var(--scb-viz-print-scale, 1);width:calc(100%/var(--scb-viz-print-scale, 1))}@media print{:host{color-scheme:light;--_scb-viz-text-color:#1f1f1f;--scb-viz-surface-color:#fff;--scb-viz-outline-color:#c5c7d0;--md-sys-color-surface:#fff;--md-sys-color-surface-container:#f5f5f5;--md-sys-color-surface-container-highest:#e7e8ec;--md-sys-color-on-surface:#1f1f1f;--md-sys-color-on-surface-variant:rgba(0, 0, 0, 0.72);--md-sys-color-outline-variant:#c5c7d0;--md-focus-ring-color:#1f1f1f;background:0 0;border:0;border-radius:0;box-shadow:none;max-width:none;padding:0}.actions-menu-panel,.actions-row{display:none!important}.standard-content-shell--stable,.standard-content-shell--stable .diagram-content,.standard-content-shell--stable .standard-content-panel--active,.standard-content-shell--stable .standard-diagram-scroller,.standard-content-shell--stable .table-panel-scroll,.standard-content-shell--stable ::slotted([slot=diagram]){height:auto!important;min-height:0!important;overflow:visible!important}.table-panel-scroll,scb-horizontal-scroller{overflow:visible!important}.description{margin-bottom:var(--spacing-5, 16px)}.footer{margin-top:var(--spacing-5, 16px)}.footer-statistics-screen{display:none!important}.footer-statistics-print{display:block!important}.viz-container{zoom:var(--scb-viz-print-scale, 1);width:calc(100%/var(--scb-viz-print-scale, 1))}}`,A);function E(){if(h(c,this,G).call(this),typeof ResizeObserver>"u")return;const n=this.shadowRoot?.querySelector(".diagram-content");n&&(this._diagramResizeObserver=new ResizeObserver(()=>{h(c,this,x).call(this)}),this._diagramResizeObserver.observe(this),this._diagramResizeObserver.observe(n))}function G(){this._diagramResizeObserver?.disconnect(),this._diagramResizeObserver=void 0}function q(){this._diagramReflowFrame&&(cancelAnimationFrame(this._diagramReflowFrame),this._diagramReflowFrame=0)}function x(){this.variant!=="Standard"||this.selectedChip!=="Diagram"||(h(c,this,q).call(this),this._diagramReflowFrame=requestAnimationFrame(()=>{this._diagramReflowFrame=requestAnimationFrame(()=>{this._diagramReflowFrame=0,h(c,this,At).call(this)})}))}function H(n){const t=n?.getAttribute("data-highcharts-chart");if(!t)return;const e=Number.parseInt(t,10);return Number.isNaN(e)?void 0:e}function B(n){for(const t of n){const e=h(c,this,H).call(this,t);if(e!==void 0)return e;const i=t.querySelector("[data-highcharts-chart]"),s=h(c,this,H).call(this,i);if(s!==void 0)return s}}function At(){if(this.variant!=="Standard"||this.selectedChip!=="Diagram")return;const n=this.shadowRoot?.querySelector('slot[name="diagram"]');if(!n)return;const t=n.assignedElements({flatten:!0});if(t.length===0)return;const e=h(c,this,B).call(this,t);if(e===void 0)return;const i=window.Highcharts?.charts?.[e];i&&(i.setSize?.(null,null,!1),i.reflow?.(),this._seriesDifferentiationEnabled&&h(c,this,V).call(this))}function W(){this._fullscreenDiagramSizingFrame&&(cancelAnimationFrame(this._fullscreenDiagramSizingFrame),this._fullscreenDiagramSizingFrame=0)}function L(){h(c,this,W).call(this),this._fullscreenDiagramSizingFrame=requestAnimationFrame(()=>{this._fullscreenDiagramSizingFrame=requestAnimationFrame(()=>{this._fullscreenDiagramSizingFrame=0,h(c,this,kt).call(this)})})}function kt(){const n=this._getFullscreenDiagramHeight();this._fullscreenDiagramHeight!==n&&(this._fullscreenDiagramHeight=n,h(c,this,T).call(this),h(c,this,x).call(this))}function T(){const n=this.variant==="Standard"?this._getResolvedDiagramHeight():"",t=this.variant==="Standard"&&this._getResolvedToggleHeightMode()==="stable"?this._getResolvedStandardContentHeight():"";this.variant==="Standard"?this.style.setProperty("--scb-viz-diagram-min-height",n||"600px"):this.style.removeProperty("--scb-viz-diagram-min-height"),n?(this.style.setProperty("--scb-viz-diagram-height",n),this.style.setProperty("--scb-viz-diagram-overflow","hidden")):(this.style.removeProperty("--scb-viz-diagram-height"),this.style.removeProperty("--scb-viz-diagram-overflow")),t?this.style.setProperty("--scb-viz-standard-content-height",t):this.style.removeProperty("--scb-viz-standard-content-height")}function K(){this._chartConfigSyncFrame&&(cancelAnimationFrame(this._chartConfigSyncFrame),this._chartConfigSyncFrame=0)}function R(){h(c,this,K).call(this),this._chartConfigSyncFrame=requestAnimationFrame(()=>{this._chartConfigSyncFrame=requestAnimationFrame(()=>{this._chartConfigSyncFrame=0,h(c,this,Et).call(this)})})}function Et(){const n=this._getCurrentHighchartsChart();if(!n)return;let t=!1;typeof this.timeFormat<"u"&&(this._applyTimeFormatToLiveChart(n),t=!0),typeof this.valueFormat<"u"&&(this._applyValueFormatToLiveChart(n),t=!0),typeof this.yAxisSettings<"u"&&(this._applyYAxisSettingsToLiveChart(n),t=!0),t&&n.redraw(!1)}function Ht(n){this._isHighchartsStyledMode(n)&&this._applyStyledModeSeriesDifferentiation(n)}function Rt(n){this._isHighchartsStyledMode(n)&&this._restoreStyledModeSeriesDifferentiation(n)}function V(){const n=this._getCurrentHighchartsChart();if(n){if(this._seriesDifferentiationEnabled){h(c,this,Ht).call(this,n);return}h(c,this,Rt).call(this,n)}}async function P(n){const t=this._getExportableVisualElement();if(!t)return;const e=await it(t,this._getExportSurfaceTarget(),n);e&&O(e,this._buildExportFileName(n==="jpeg"?"jpg":"png"))}function Pt(n){return dt(this._getResolvedTableView(n),t=>this._escapeHtml(t))}function Nt(){return ht({comment:this.comment,commentLabel:this.commentLabel,description:this.description,descriptionLabel:this.descriptionLabel,escapeHtml:n=>this._escapeHtml(n),footnote:this.footnote,footnoteLabel:this.footnoteLabel,moreAboutStatsLabel:this.moreAboutStatsLabel,officialStatistics:this.officialStatistics,renderRichTextHtml:n=>this._renderRichTextHtml(n),sosLogotypeSvg:j,source:this.source,sourceLabel:this.sourceLabel})}function It(n){return ct({contentHtml:n,escapeHtml:t=>this._escapeHtml(t),footerHtml:h(c,this,Nt).call(this),lang:this.lang,subtitle:this.subtitle,title:this.title})}async function Ot(){await ot(this,async()=>{const n=this._getCurrentPrintableView();let t="";if(n==="table"){const e=this._getResolvedTableData();if(!e?.rows?.length)return;t=h(c,this,Pt).call(this,e)}else if(n==="image"){const e=this.shadowRoot?.querySelector(".image-content img"),i=e?.currentSrc||e?.src||this.imageHref;if(!i)return;t=`<img class="viz-image" src="${this._escapeHtml(i)}" alt="${this._escapeHtml(this._getImageAltText())}">`}else{const e=this._getExportableVisualElement();if(!e)return;const i=await st(e,this._getExportSurfaceTarget(),"png");if(!i)return;t=`<img class="viz-chart-image" src="${i}" alt="${this._escapeHtml(this._getImageAltText())}">`}await nt(h(c,this,It).call(this,t))})}function jt(){const n=this._getResolvedTableData();n?.rows?.length&&O(et($t(n,t=>this._normalizeRenderableCell(t)),this.lang),this._buildExportFileName("csv"))}function N(){const n=h(c,this,$).call(this,this.spacing),t=h(c,this,$).call(this,this.spacingTop)??n,e=h(c,this,$).call(this,this.spacingBottom)??n,i=h(c,this,$).call(this,this.spacingLeft),s=h(c,this,$).call(this,this.spacingRight);t?this.style.setProperty("--scb-viz-spacing-block-start",t):this.style.removeProperty("--scb-viz-spacing-block-start"),e?this.style.setProperty("--scb-viz-spacing-block-end",e):this.style.removeProperty("--scb-viz-spacing-block-end"),i?this.style.setProperty("--scb-viz-spacing-inline-start",i):this.style.removeProperty("--scb-viz-spacing-inline-start"),s?this.style.setProperty("--scb-viz-spacing-inline-end",s):this.style.removeProperty("--scb-viz-spacing-inline-end")}function $(n){if(!n)return;const t=String(n).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}function I(){const n=this.containerMaxWidth?.trim();n?this.style.setProperty("--scb-viz-container-max-width",n):this.style.removeProperty("--scb-viz-container-max-width")}m([b({type:String,reflect:!0})],g.prototype,"variant",void 0);m([b({type:String,reflect:!0,attribute:"selected-chip"})],g.prototype,"selectedChip",void 0);m([b({type:String,reflect:!0})],g.prototype,"title",void 0);m([b({type:String,reflect:!0})],g.prototype,"subtitle",void 0);m([b({type:String,reflect:!0})],g.prototype,"description",void 0);m([b({type:String,reflect:!0})],g.prototype,"comment",void 0);m([b({type:String,reflect:!0})],g.prototype,"source",void 0);m([b({type:String,reflect:!0})],g.prototype,"footnote",void 0);m([b({type:String,reflect:!0,attribute:"lang"})],g.prototype,"lang",void 0);m([b({type:String,reflect:!0,attribute:"image-href"})],g.prototype,"imageHref",void 0);m([b({type:Boolean,reflect:!0,attribute:"official-statistics"})],g.prototype,"officialStatistics",void 0);m([b({type:Boolean,reflect:!0,attribute:"disable-toggle"})],g.prototype,"disableToggle",void 0);m([b({type:String,attribute:"content-max-width"})],g.prototype,"contentMaxWidth",void 0);m([b({type:String,attribute:"container-max-width"})],g.prototype,"containerMaxWidth",void 0);m([b({type:String,attribute:"content-height"})],g.prototype,"contentHeight",void 0);m([b({type:String,reflect:!0,attribute:"toggle-height-mode"})],g.prototype,"toggleHeightMode",void 0);m([b({attribute:!1})],g.prototype,"tableData",void 0);m([b({attribute:!1})],g.prototype,"valueFormat",void 0);m([b({attribute:!1})],g.prototype,"timeFormat",void 0);m([b({attribute:!1})],g.prototype,"yAxisSettings",void 0);m([F()],g.prototype,"_slottedTableData",void 0);m([F()],g.prototype,"_actionsMenuOpen",void 0);m([F()],g.prototype,"_seriesDifferentiationEnabled",void 0);m([F()],g.prototype,"_isFullscreen",void 0);m([b({type:String,reflect:!0})],g.prototype,"spacing",void 0);m([b({type:String,attribute:"spacing-top",reflect:!0})],g.prototype,"spacingTop",void 0);m([b({type:String,attribute:"spacing-bottom",reflect:!0})],g.prototype,"spacingBottom",void 0);m([b({type:String,attribute:"spacing-left",reflect:!0})],g.prototype,"spacingLeft",void 0);m([b({type:String,attribute:"spacing-right",reflect:!0})],g.prototype,"spacingRight",void 0);g=m([Y("scb-viz")],g);
411
+ `}}}_syncChipClass(){const t=this.variant==="Standard";this.classList.toggle("chip-diagram",t&&this.selectedChip==="Diagram"),this.classList.toggle("chip-table",t&&this.selectedChip==="Table")}_dispatchSelectedChipChanged(){const t={selectedChip:this.selectedChip};this.dispatchEvent(new CustomEvent("selected-chip-changed",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("selectedchipchanged",{detail:t,bubbles:!0,composed:!0}))}_onSegmentedChange(t){const e=t.detail?.value;this.selectedChip===e?this.selectedChip=null:this.selectedChip=e}_toggleActionsMenu(t){t.stopPropagation(),this._actionsMenuOpen=!this._actionsMenuOpen,this._actionsMenuOpen&&requestAnimationFrame(()=>{this._focusFirstMenuItem()})}_closeActionsMenu(){this._actionsMenuOpen=!1}_focusMenuButton(){this.shadowRoot?.querySelector(".actions-menu scb-icon-button")?.focus()}_focusFirstMenuItem(){this.shadowRoot?.querySelector(".actions-menu-item")?.focus()}_getExportSurfaceTarget(){return this.shadowRoot?.querySelector(".viz-container")??this}_getCurrentPrintableView(){return this.variant==="Table"?"table":this.variant==="Image"?"image":this.selectedChip==="Table"?"table":"diagram"}},A.styles=Z`:host{display:block;min-inline-size:0;--_scb-viz-font-family:var(--brand-font, Inter, 'Segoe UI', Arial, sans-serif);--_scb-viz-body-font-size:var(--md-sys-typescale-body-large-size, 1rem);--_scb-viz-body-font-weight:var(--weight-regular, 400);--_scb-viz-body-line-height:var(--md-sys-typescale-body-large-line-height, 1.5);--_scb-viz-body-letter-spacing:var(--md-sys-typescale-body-large-tracking, normal);--_scb-viz-title-size:var(--md-sys-typescale-title-large-size, 1.75rem);--_scb-viz-title-weight:var(--weight-semibold, 600);--_scb-viz-title-line-height:var(--md-sys-typescale-title-large-line-height, 1.25);--_scb-viz-title-letter-spacing:var(--md-sys-typescale-title-large-tracking, normal);--_scb-viz-subtitle-size:var(--md-sys-typescale-body-large-size, 1rem);--_scb-viz-subtitle-weight:var(--weight-regular, 400);--_scb-viz-subtitle-line-height:var(--md-sys-typescale-body-large-line-height, 1.5);--_scb-viz-subtitle-letter-spacing:var(--md-sys-typescale-body-large-tracking, normal);--_scb-viz-section-title-size:var(--md-sys-typescale-title-medium-size, 1rem);--_scb-viz-section-title-weight:var(--weight-semibold, 600);--_scb-viz-section-title-line-height:var(--md-sys-typescale-title-medium-line-height, 1.5);--_scb-viz-section-title-letter-spacing:var(--md-sys-typescale-title-medium-tracking, normal);--_scb-viz-text-color:var(--md-sys-color-on-surface, #1f1f1f);font-family:var(--_scb-viz-font-family);font-size:var(--_scb-viz-body-font-size);font-weight:var(--_scb-viz-body-font-weight);line-height:var(--_scb-viz-body-line-height);letter-spacing:var(--_scb-viz-body-letter-spacing);font-style:normal;text-align:start;color:var(--_scb-viz-text-color);background:var(--scb-viz-surface-color, var(--md-sys-color-surface, #fff));padding:var(--scb-viz-padding, var(--spacing-7, 24px));max-width:var(--scb-viz-container-max-width, 100%);border-radius:var(--scb-viz-border-radius, var(--spacing-04, 16px));border:1px solid var(--scb-viz-outline-color, var(--md-sys-color-outline-variant, #c5c7d0));margin-block-start:var(--scb-viz-spacing-block-start, 0);margin-block-end:var(--scb-viz-spacing-block-end, 0);margin-inline-start:var(--scb-viz-spacing-inline-start, 0);margin-inline-end:var(--scb-viz-spacing-inline-end, 0)}:host,:host *,:host ::after,:host ::before{box-sizing:border-box}scb-segmented-button{--scb-segmented-button-height:var(--icon-size-small, 32px)}scb-accordion,scb-accordion-item,scb-icon-button,scb-segmented-button{--brand-font:var(--_scb-viz-font-family)}scb-accordion,scb-accordion-item,scb-segmented-button{--weight-regular:var(--_scb-viz-body-font-weight);--weight-semibold:var(--_scb-viz-section-title-weight)}scb-accordion,scb-accordion-item{--scb-accordion-title-font-size:var(--_scb-viz-section-title-size);--scb-accordion-title-line-height:var(--_scb-viz-section-title-line-height);--scb-accordion-title-letter-spacing:var(--_scb-viz-section-title-letter-spacing);--scb-accordion-supporting-font-size:var(--_scb-viz-body-font-size);--scb-accordion-supporting-line-height:var(--_scb-viz-body-line-height);--scb-accordion-supporting-letter-spacing:var(--_scb-viz-body-letter-spacing)}.label{font-family:var(--_scb-viz-font-family);font-size:var(--_scb-viz-title-size);font-weight:var(--_scb-viz-title-weight);line-height:var(--_scb-viz-title-line-height);letter-spacing:var(--_scb-viz-title-letter-spacing);text-align:start;margin:0}.sub-label{font-size:var(--_scb-viz-subtitle-size);font-weight:var(--_scb-viz-subtitle-weight);line-height:var(--_scb-viz-subtitle-line-height);letter-spacing:var(--_scb-viz-subtitle-letter-spacing);margin:0}.body-text,.secondary-label,.sub-label{font-family:var(--_scb-viz-font-family);text-align:start}.secondary-label{font-size:var(--_scb-viz-section-title-size);font-weight:var(--_scb-viz-section-title-weight);line-height:var(--_scb-viz-section-title-line-height);letter-spacing:var(--_scb-viz-section-title-letter-spacing);margin:0}.body-text{font-size:var(--_scb-viz-body-font-size);font-weight:var(--_scb-viz-body-font-weight);line-height:var(--_scb-viz-body-line-height);letter-spacing:var(--_scb-viz-body-letter-spacing);font-style:normal}.body-text-rich{display:flex;flex-direction:column;gap:var(--spacing-4, 16px)}.body-text-paragraph{margin:0}.highcharts-visually-hidden,.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;white-space:nowrap!important;clip:rect(0,0,0,0)!important;clip-path:inset(50%)!important;border:0!important}.more-about-stats-content,.section{display:flex;flex-direction:column;color:var(--_scb-viz-text-color);font-family:var(--_scb-viz-font-family);font-style:normal;text-align:start}.section{gap:var(--spacing-2, 8px)}.more-about-stats-content{gap:var(--spacing-7, 24px);max-width:600px}.sos-logotype-link{display:inline-flex;border:0;color:var(--_scb-viz-text-color);line-height:0;text-decoration:none;width:fit-content}.sos-logotype-link:focus-visible{outline:var(--stroke-focus-ring, 2px) solid var(--md-focus-ring-color, currentColor);outline-offset:var(--spacing-1, 4px);border-radius:var(--radius-xs, 4px)}.sos-logotype-small,.sos-logotype-small svg{height:26px;width:auto;display:block}.sos-logotype-small svg{height:100%}@media only screen and (min-width:768px){.sos-logotype-small{height:24px}}.header{margin-bottom:var(--spacing-7, 24px);max-width:600px;color:var(--_scb-viz-text-color);font-family:var(--_scb-viz-font-family);font-style:normal;text-align:start}.actions-row,.header-row{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--spacing-4, 16px)}.header-row{margin-bottom:var(--spacing-7, 24px)}.header-row .header{flex:1 1 auto;margin-bottom:0}.header-row .actions-menu{margin-block-start:0}.actions-row{margin-bottom:var(--spacing-9, 40px)}.flipp-wrapper{flex:1 1 auto;max-width:234px}.actions-menu{position:relative;flex:0 0 auto;display:inline-flex;align-items:flex-start;justify-content:flex-end}.actions-menu-panel{position:absolute;inset-block-start:calc(100% + var(--spacing-2, 8px));inset-inline-end:0;min-width:180px;padding:var(--spacing-2, 8px);border:1px solid var(--scb-viz-outline-color, var(--md-sys-color-outline-variant, #c5c7d0));border-radius:var(--radius-m, 12px);background:var(--scb-viz-surface-color, var(--md-sys-color-surface, #fff));box-shadow:0 8px 24px rgba(0,0,0,.12);display:none;z-index:10}.actions-menu-panel--open{display:block}.actions-menu-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--spacing-1, 4px)}.actions-menu-item{appearance:none;border:0;border-radius:var(--radius-s, 8px);background:0 0;color:var(--_scb-viz-text-color);width:100%;display:flex;align-items:center;gap:var(--scb-viz-actions-menu-item-gap, var(--spacing-2, 8px));text-align:start;font-family:var(--_scb-viz-font-family);font-size:var(--_scb-viz-body-font-size);font-weight:var(--_scb-viz-body-font-weight);line-height:var(--_scb-viz-body-line-height);letter-spacing:var(--_scb-viz-body-letter-spacing);padding-block:var(--spacing-2, 8px);padding-inline:var(--spacing-3, 12px);cursor:pointer}.actions-menu-item-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;font-family:"Material Symbols Outlined";font-size:var(--scb-viz-actions-menu-item-icon-size, var(--icon-size-small, 20px));line-height:1;font-style:normal;font-weight:400;letter-spacing:normal;text-transform:none;white-space:nowrap;direction:ltr;font-variation-settings:"FILL"0,"wght"400,"GRAD"0,"opsz"20;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale}.actions-menu-item-label{flex:1 1 auto;min-width:0}.actions-menu-item:hover{background:var(--md-sys-color-surface-container, #f5f5f5)}.actions-menu-item:focus-visible{outline:var(--stroke-focus-ring, 2px) solid var(--md-focus-ring-color, currentColor);outline-offset:0}.actions-menu-item:disabled{background:0 0;color:var(--md-sys-color-on-surface-variant, rgba(0, 0, 0, 0.56));cursor:default;opacity:.64}.actions-menu-item:disabled:hover{background:0 0}.content,.description,.footer{color:var(--_scb-viz-text-color);font-family:var(--_scb-viz-font-family);font-style:normal;text-align:start}.description{margin-bottom:var(--spacing-8, 32px)}.footer{margin-top:var(--spacing-7, 24px)}.footer-statistics-print{display:none}.print-more-about-stats{max-width:600px}.print-more-about-stats .more-about-stats-content{gap:var(--spacing-5, 16px)}.print-more-about-stats-heading{margin-bottom:var(--spacing-5, 16px)}.description.section{max-width:600px}.diagram-scroller{display:none}.image-content{display:none;width:100%}.diagram-content{width:100%;max-width:var(--scb-viz-content-max-width, none);min-width:var(--scb-viz-content-max-width, 0);min-height:var(--scb-viz-diagram-min-height, 600px);height:var(--scb-viz-diagram-height, auto);overflow:var(--scb-viz-diagram-overflow, visible)}::slotted([slot=diagram]){display:block;width:100%;max-width:100%;min-width:0;min-height:var(--scb-viz-diagram-min-height, 600px);height:var(--scb-viz-diagram-height, auto);overflow:var(--scb-viz-diagram-overflow, visible)}.standard-content-shell{display:block;width:100%;min-width:0}.standard-content-shell--stable{min-height:var(--scb-viz-standard-content-height, var(--scb-viz-diagram-min-height, 600px))}.standard-content-panel{display:none;width:100%;min-width:0}.standard-content-panel--active{display:flex;flex-direction:column}.standard-diagram-scroller{display:flex;width:100%;min-width:0}.table-panel-scroll{width:100%;min-width:0}.standard-content-shell--stable .standard-content-panel--table.standard-content-panel--active{height:var(--scb-viz-standard-content-height, var(--scb-viz-diagram-min-height, 600px));min-height:0;overflow:hidden}.standard-content-shell--stable .standard-content-panel--table.standard-content-panel--active .table-panel-scroll{flex:1 1 auto;min-height:0;overflow:auto}:host([variant='Image']) .image-content{display:block}:host([variant='Image']) img{height:auto;max-width:100%}:host([variant='Image']) .diagram-scroller{display:none}:host([variant='Standard'].chip-diagram) .diagram-scroller{display:flex}.table-source{display:none}:host([data-scb-viz-fullscreen]){width:100%;height:100%;max-width:none;margin:0;border:0;border-radius:0;overflow:auto}:host([data-scb-viz-fullscreen]) .viz-container{min-height:100%}:host([data-scb-viz-force-light]),:host([data-scb-viz-print-preview]){color-scheme:light;--_scb-viz-text-color:#1f1f1f;--scb-viz-surface-color:#fff;--scb-viz-outline-color:#c5c7d0;--md-sys-color-surface:#fff;--md-sys-color-surface-container:#f5f5f5;--md-sys-color-surface-container-highest:#e7e8ec;--md-sys-color-on-surface:#1f1f1f;--md-sys-color-on-surface-variant:rgba(0, 0, 0, 0.72);--md-sys-color-outline-variant:#c5c7d0;--md-focus-ring-color:#1f1f1f}:host([data-scb-viz-print-preview]){background:0 0;border:0;border-radius:0;box-shadow:none;max-width:none;padding:0}:host([data-scb-viz-print-preview]) .actions-menu-panel,:host([data-scb-viz-print-preview]) .actions-row{display:none!important}:host([data-scb-viz-print-preview]) .standard-content-shell--stable,:host([data-scb-viz-print-preview]) .standard-content-shell--stable .diagram-content,:host([data-scb-viz-print-preview]) .standard-content-shell--stable .standard-content-panel--active,:host([data-scb-viz-print-preview]) .standard-content-shell--stable .standard-diagram-scroller,:host([data-scb-viz-print-preview]) .standard-content-shell--stable .table-panel-scroll,:host([data-scb-viz-print-preview]) .standard-content-shell--stable ::slotted([slot=diagram]){height:auto!important;min-height:0!important;overflow:visible!important}:host([data-scb-viz-print-preview]) .table-panel-scroll,:host([data-scb-viz-print-preview]) scb-horizontal-scroller{overflow:visible!important}:host([data-scb-viz-print-preview]) .description{margin-bottom:var(--spacing-5, 16px)}:host([data-scb-viz-print-preview]) .footer{margin-top:var(--spacing-5, 16px)}:host([data-scb-viz-print-preview]) .footer-statistics-screen{display:none!important}:host([data-scb-viz-print-preview]) .footer-statistics-print{display:block!important}:host([data-scb-viz-print-preview]) .viz-container{zoom:var(--scb-viz-print-scale, 1);width:calc(100%/var(--scb-viz-print-scale, 1))}@media print{:host{color-scheme:light;--_scb-viz-text-color:#1f1f1f;--scb-viz-surface-color:#fff;--scb-viz-outline-color:#c5c7d0;--md-sys-color-surface:#fff;--md-sys-color-surface-container:#f5f5f5;--md-sys-color-surface-container-highest:#e7e8ec;--md-sys-color-on-surface:#1f1f1f;--md-sys-color-on-surface-variant:rgba(0, 0, 0, 0.72);--md-sys-color-outline-variant:#c5c7d0;--md-focus-ring-color:#1f1f1f;background:0 0;border:0;border-radius:0;box-shadow:none;max-width:none;padding:0}.actions-menu-panel,.actions-row{display:none!important}.standard-content-shell--stable,.standard-content-shell--stable .diagram-content,.standard-content-shell--stable .standard-content-panel--active,.standard-content-shell--stable .standard-diagram-scroller,.standard-content-shell--stable .table-panel-scroll,.standard-content-shell--stable ::slotted([slot=diagram]){height:auto!important;min-height:0!important;overflow:visible!important}.table-panel-scroll,scb-horizontal-scroller{overflow:visible!important}.description{margin-bottom:var(--spacing-5, 16px)}.footer{margin-top:var(--spacing-5, 16px)}.footer-statistics-screen{display:none!important}.footer-statistics-print{display:block!important}.viz-container{zoom:var(--scb-viz-print-scale, 1);width:calc(100%/var(--scb-viz-print-scale, 1))}}`,A);function k(){if(c(l,this,G).call(this),typeof ResizeObserver>"u")return;const o=this.shadowRoot?.querySelector(".diagram-content");o&&(this._diagramResizeObserver=new ResizeObserver(()=>{c(l,this,x).call(this)}),this._diagramResizeObserver.observe(this),this._diagramResizeObserver.observe(o))}function G(){this._diagramResizeObserver?.disconnect(),this._diagramResizeObserver=void 0}function q(){this._diagramReflowFrame&&(cancelAnimationFrame(this._diagramReflowFrame),this._diagramReflowFrame=0)}function x(){this.variant!=="Standard"||this.selectedChip!=="Diagram"||(c(l,this,q).call(this),this._diagramReflowFrame=requestAnimationFrame(()=>{this._diagramReflowFrame=requestAnimationFrame(()=>{this._diagramReflowFrame=0,c(l,this,Ht).call(this)})}))}function E(o){const t=o?.getAttribute("data-highcharts-chart");if(!t)return;const e=Number.parseInt(t,10);return Number.isNaN(e)?void 0:e}function B(o){for(const t of o){const e=c(l,this,E).call(this,t);if(e!==void 0)return e;const i=t.querySelector("[data-highcharts-chart]"),s=c(l,this,E).call(this,i);if(s!==void 0)return s}}function Ht(){if(this.variant!=="Standard"||this.selectedChip!=="Diagram")return;const o=this.shadowRoot?.querySelector('slot[name="diagram"]');if(!o)return;const t=o.assignedElements({flatten:!0});if(t.length===0)return;const e=c(l,this,B).call(this,t);if(e===void 0)return;const i=window.Highcharts?.charts?.[e];i&&(i.setSize?.(null,null,!1),i.reflow?.(),this._seriesDifferentiationEnabled&&c(l,this,V).call(this))}function W(){this._fullscreenDiagramSizingFrame&&(cancelAnimationFrame(this._fullscreenDiagramSizingFrame),this._fullscreenDiagramSizingFrame=0)}function T(){c(l,this,W).call(this),this._fullscreenDiagramSizingFrame=requestAnimationFrame(()=>{this._fullscreenDiagramSizingFrame=requestAnimationFrame(()=>{this._fullscreenDiagramSizingFrame=0,c(l,this,kt).call(this)})})}function kt(){const o=this._getFullscreenDiagramHeight();this._fullscreenDiagramHeight!==o&&(this._fullscreenDiagramHeight=o,c(l,this,L).call(this),c(l,this,x).call(this))}function L(){const o=this.variant==="Standard"?this._getResolvedDiagramHeight():"",t=this.variant==="Standard"&&this._getResolvedToggleHeightMode()==="stable"?this._getResolvedStandardContentHeight():"";this.variant==="Standard"?this.style.setProperty("--scb-viz-diagram-min-height",o||"600px"):this.style.removeProperty("--scb-viz-diagram-min-height"),o?(this.style.setProperty("--scb-viz-diagram-height",o),this.style.setProperty("--scb-viz-diagram-overflow","hidden")):(this.style.removeProperty("--scb-viz-diagram-height"),this.style.removeProperty("--scb-viz-diagram-overflow")),t?this.style.setProperty("--scb-viz-standard-content-height",t):this.style.removeProperty("--scb-viz-standard-content-height")}function K(){this._chartConfigSyncFrame&&(cancelAnimationFrame(this._chartConfigSyncFrame),this._chartConfigSyncFrame=0)}function R(){c(l,this,K).call(this),this._chartConfigSyncFrame=requestAnimationFrame(()=>{this._chartConfigSyncFrame=requestAnimationFrame(()=>{this._chartConfigSyncFrame=0,c(l,this,Et).call(this)})})}function Et(){const o=this._getCurrentHighchartsChart();if(!o)return;let t=!1;typeof this.timeFormat<"u"&&(this._applyTimeFormatToLiveChart(o),t=!0),typeof this.valueFormat<"u"&&(this._applyValueFormatToLiveChart(o),t=!0),typeof this.yAxisSettings<"u"&&(this._applyYAxisSettingsToLiveChart(o),t=!0),t&&o.redraw(!1)}function Rt(o){this._isHighchartsStyledMode(o)&&this._applyStyledModeSeriesDifferentiation(o)}function Pt(o){this._isHighchartsStyledMode(o)&&this._restoreStyledModeSeriesDifferentiation(o)}function V(){const o=this._getCurrentHighchartsChart();if(o){if(this._seriesDifferentiationEnabled){c(l,this,Rt).call(this,o);return}c(l,this,Pt).call(this,o)}}async function P(o){const t=this._getExportableVisualElement();if(!t)return;const e=await it(t,this._getExportSurfaceTarget(),o);e&&O(e,this._buildExportFileName(o==="jpeg"?"jpg":"png"))}function Nt(o){return dt(this._getResolvedTableView(o),t=>this._escapeHtml(t),{getEmptyHeaderLabel:t=>this._getEmptyTableHeaderLabel(t)})}function It(){return ht({comment:this.comment,commentLabel:this.commentLabel,description:this.description,descriptionLabel:this.descriptionLabel,escapeHtml:o=>this._escapeHtml(o),footnote:this.footnote,footnoteLabel:this.footnoteLabel,moreAboutStatsLabel:this.moreAboutStatsLabel,officialStatistics:this.officialStatistics,renderRichTextHtml:o=>this._renderRichTextHtml(o),sosLogotypeSvg:j,source:this.source,sourceLabel:this.sourceLabel})}function Ot(o){return ct({contentHtml:o,escapeHtml:t=>this._escapeHtml(t),footerHtml:c(l,this,It).call(this),lang:this.lang,subtitle:this.subtitle,title:this.title})}async function jt(){await ot(this,async()=>{const o=this._getCurrentPrintableView();let t="";if(o==="table"){const e=this._getResolvedTableData();if(!e?.rows?.length)return;t=c(l,this,Nt).call(this,e)}else if(o==="image"){const e=this.shadowRoot?.querySelector(".image-content img"),i=e?.currentSrc||e?.src||this.imageHref;if(!i)return;t=`<img class="viz-image" src="${this._escapeHtml(i)}" alt="${this._escapeHtml(this._getImageAltText())}">`}else{const e=this._getExportableVisualElement();if(!e)return;const i=await st(e,this._getExportSurfaceTarget(),"png");if(!i)return;t=`<img class="viz-chart-image" src="${i}" alt="${this._escapeHtml(this._getImageAltText())}">`}await nt(c(l,this,Ot).call(this,t))})}function Gt(){const o=this._getResolvedTableData();o?.rows?.length&&O(et($t(o,t=>this._normalizeRenderableCell(t)),this.lang),this._buildExportFileName("csv"))}function N(){const o=c(l,this,$).call(this,this.spacing),t=c(l,this,$).call(this,this.spacingTop)??o,e=c(l,this,$).call(this,this.spacingBottom)??o,i=c(l,this,$).call(this,this.spacingLeft),s=c(l,this,$).call(this,this.spacingRight);t?this.style.setProperty("--scb-viz-spacing-block-start",t):this.style.removeProperty("--scb-viz-spacing-block-start"),e?this.style.setProperty("--scb-viz-spacing-block-end",e):this.style.removeProperty("--scb-viz-spacing-block-end"),i?this.style.setProperty("--scb-viz-spacing-inline-start",i):this.style.removeProperty("--scb-viz-spacing-inline-start"),s?this.style.setProperty("--scb-viz-spacing-inline-end",s):this.style.removeProperty("--scb-viz-spacing-inline-end")}function $(o){if(!o)return;const t=String(o).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}function I(){const o=this.containerMaxWidth?.trim();o?this.style.setProperty("--scb-viz-container-max-width",o):this.style.removeProperty("--scb-viz-container-max-width")}m([v({type:String,reflect:!0})],f.prototype,"variant",void 0);m([v({type:String,reflect:!0,attribute:"selected-chip"})],f.prototype,"selectedChip",void 0);m([v({type:String,reflect:!0})],f.prototype,"title",void 0);m([v({type:String,reflect:!0})],f.prototype,"subtitle",void 0);m([v({type:String,reflect:!0})],f.prototype,"description",void 0);m([v({type:String,reflect:!0})],f.prototype,"comment",void 0);m([v({type:String,reflect:!0})],f.prototype,"source",void 0);m([v({type:String,reflect:!0})],f.prototype,"footnote",void 0);m([v({type:String,reflect:!0,attribute:"lang"})],f.prototype,"lang",void 0);m([v({type:String,reflect:!0,attribute:"image-href"})],f.prototype,"imageHref",void 0);m([v({type:Boolean,reflect:!0,attribute:"official-statistics"})],f.prototype,"officialStatistics",void 0);m([v({type:Boolean,reflect:!0,attribute:"disable-toggle"})],f.prototype,"disableToggle",void 0);m([v({type:String,attribute:"content-max-width"})],f.prototype,"contentMaxWidth",void 0);m([v({type:String,attribute:"container-max-width"})],f.prototype,"containerMaxWidth",void 0);m([v({type:String,attribute:"content-height"})],f.prototype,"contentHeight",void 0);m([v({type:String,reflect:!0,attribute:"toggle-height-mode"})],f.prototype,"toggleHeightMode",void 0);m([v({attribute:!1})],f.prototype,"tableData",void 0);m([v({attribute:!1})],f.prototype,"valueFormat",void 0);m([v({attribute:!1})],f.prototype,"timeFormat",void 0);m([v({attribute:!1})],f.prototype,"yAxisSettings",void 0);m([F()],f.prototype,"_slottedTableData",void 0);m([F()],f.prototype,"_actionsMenuOpen",void 0);m([F()],f.prototype,"_seriesDifferentiationEnabled",void 0);m([F()],f.prototype,"_isFullscreen",void 0);m([v({type:String,reflect:!0})],f.prototype,"spacing",void 0);m([v({type:String,attribute:"spacing-top",reflect:!0})],f.prototype,"spacingTop",void 0);m([v({type:String,attribute:"spacing-bottom",reflect:!0})],f.prototype,"spacingBottom",void 0);m([v({type:String,attribute:"spacing-left",reflect:!0})],f.prototype,"spacingLeft",void 0);m([v({type:String,attribute:"spacing-right",reflect:!0})],f.prototype,"spacingRight",void 0);f=m([Y("scb-viz")],f);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scb-wc",
3
- "version": "0.1.141",
3
+ "version": "0.1.143",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -472,5 +472,5 @@
472
472
  },
473
473
  "./mvc/*": "./mvc/*"
474
474
  },
475
- "buildHash": "F0A1E5557AD4C88D12B7A131FDDF2AAE8E4A4B4D6F945425C7666E6C6E0D4643"
475
+ "buildHash": "2350C5B9726EBA0BDC24EA256D37F71182911CC46E80E5FBE134E0A33C97D2D7"
476
476
  }
@@ -17,6 +17,9 @@ export declare class ScbTable extends LitElement {
17
17
  private _applyGeneratedCellTextReset;
18
18
  private _removeGeneratedSortMarkup;
19
19
  private _getOrCreateHeaderLabel;
20
+ private _getHeaderLabelText;
21
+ private _getFallbackColumnLabel;
22
+ private _applyVisuallyHiddenStyles;
20
23
  private _wrapHeaderWithSortControl;
21
24
  private _getNormalizedText;
22
25
  private _queueColumnWidthUpdate;
@@ -22,6 +22,9 @@ export interface ScbVizPrintDocumentOptions {
22
22
  subtitle?: string;
23
23
  title?: string;
24
24
  }
25
- export declare function buildScbVizPrintableTableHtml(tableView: ScbVizResolvedTableView, escapeHtml: (value: string) => string): string;
25
+ export interface ScbVizPrintableTableOptions {
26
+ getEmptyHeaderLabel?: (columnIndex: number) => string;
27
+ }
28
+ export declare function buildScbVizPrintableTableHtml(tableView: ScbVizResolvedTableView, escapeHtml: (value: string) => string, options?: ScbVizPrintableTableOptions): string;
26
29
  export declare function buildScbVizPrintableFooterHtml(options: ScbVizPrintableFooterOptions): string;
27
30
  export declare function buildScbVizPrintDocumentHtml(options: ScbVizPrintDocumentOptions): string;
@@ -180,6 +180,11 @@ export declare class ScbViz extends LitElement {
180
180
  private _renderActions;
181
181
  private _renderHeader;
182
182
  private _renderTable;
183
+ private _renderTableCellContent;
184
+ private _getNormalizedText;
185
+ private _renderTableHeaderContent;
186
+ private _renderVisuallyHiddenText;
187
+ private _getEmptyTableHeaderLabel;
183
188
  private _renderRichText;
184
189
  private _escapeHtml;
185
190
  private _renderRichTextHtml;