@mattilsynet/design 3.0.2 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var mtds=(function(k){"use strict";var ma=Object.defineProperty,Qn=Object.getOwnPropertySymbols,fa=Object.prototype.hasOwnProperty,ha=Object.prototype.propertyIsEnumerable,_n=(t,e,n)=>e in t?ma(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ga=(t,e)=>{for(var n in e||(e={}))fa.call(e,n)&&_n(t,n,e[n]);if(Qn)for(var n of Qn(e))ha.call(e,n)&&_n(t,n,e[n]);return t},_t=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",va=_t&&/android/i.test(navigator.userAgent),$n=_t&&/iPad|iPhone|iPod/.test(navigator.userAgent),to;_t&&/^Mac/i.test(((to=navigator.userAgentData)==null?void 0:to.platform)||navigator.platform);var ba="outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color",wa=typeof HTMLElement>"u"?class{}:HTMLElement;function T(t,e,n){return n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}var eo=(t,e,n)=>{for(const o of n[0].split(","))n[0]=o,Element.prototype[`${t}EventListener`].apply(e,n)},$t=(t,...e)=>eo("add",t,e),ya=(t,...e)=>eo("remove",t,e),te=new WeakMap,De=(t,e)=>{if(e===void 0)return te.get(t);try{te.get(t).disconnect(),te.delete(t)}catch{}if(e){const n=new MutationObserver(o=>t.handleEvent({type:"mutation",detail:o}));n.observe(t,e),te.set(t,n)}},xa=t=>{var e;const n=t.key===" "||t.key==="Enter";return n&&((e=t.preventDefault)==null||e.call(t)),n&&t.target instanceof HTMLElement&&t.target.dispatchEvent(new MouseEvent("click",t)),n},no=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},Ea=0,oo=t=>t?(t.id||(t.id=`:${t.nodeName.toLowerCase()}${(++Ea).toString(32)}`),t.id):"",xt=(t,e,n)=>{const o=document.createElement(t);if(e&&(o[t==="style"?"textContent":"innerHTML"]=e),n)for(const[i,r]of Object.entries(n))T(o,i,r);return o},Sa={define:(t,e)=>!_t||window.customElements.get(t)||window.customElements.define(t,e)},ka=t=>{var e;const n=T(t,"aria-label")||"";return[...(((e=T(t,"aria-labelledby"))==null?void 0:e.trim().split(/\s+/))||[]).map(i=>document.getElementById(i)),...Array.from(t.labels||[])].reduce((i,r)=>{var a;return i||((a=r?.innerText)==null?void 0:a.trim())||""},n)},st,Ta=0,ze=t=>{st||(st=xt("div"),st.style.cssText="position:fixed;overflow:hidden;width:1px;white-space:nowrap",T(st,"aria-live","assertive")),st.isConnected||document.body.append(st),t&&(st.textContent=`${t}${Ta++%2?" ":""}`)},io=(t,e,n="")=>{var o,i;const r={bubbles:!0,composed:!0,data:e,inputType:n},a=HTMLInputElement.prototype;t.dispatchEvent(new InputEvent("beforeinput",r)),(i=(o=Object.getOwnPropertyDescriptor(a,"value"))==null?void 0:o.set)==null||i.call(t,e),t.dispatchEvent(new InputEvent("input",r)),t.dispatchEvent(new Event("change",{bubbles:!0}))},Fe=!1,Be=t=>(t?.type==="mouseup"&&(Fe=!1),t?.type==="mousedown"&&(Fe=!0,$t(document,"mouseup",Be,{once:!0})),Fe),Aa=(t,e="<slot></slot>")=>`<template shadowrootmode="open">${e}<style>${t}</style></template>`,Ge=`:host(:not([hidden])) { display: block; -webkit-tap-highlight-color: rgba(0, 0, 0, 0) } /* Must be display block in Safari to allow focus inside */
1
+ var mtds=(function(k){"use strict";var ma=Object.defineProperty,Qn=Object.getOwnPropertySymbols,fa=Object.prototype.hasOwnProperty,ha=Object.prototype.propertyIsEnumerable,_n=(t,e,n)=>e in t?ma(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ga=(t,e)=>{for(var n in e||(e={}))fa.call(e,n)&&_n(t,n,e[n]);if(Qn)for(var n of Qn(e))ha.call(e,n)&&_n(t,n,e[n]);return t},Qt=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",va=Qt&&/android/i.test(navigator.userAgent),$n=Qt&&/iPad|iPhone|iPod/.test(navigator.userAgent),to;Qt&&/^Mac/i.test(((to=navigator.userAgentData)==null?void 0:to.platform)||navigator.platform);var ba="outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color",wa=typeof HTMLElement>"u"?class{}:HTMLElement;function T(t,e,n){return n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}var eo=(t,e,n)=>{for(const o of n[0].split(","))n[0]=o,Element.prototype[`${t}EventListener`].apply(e,n)},_t=(t,...e)=>eo("add",t,e),ya=(t,...e)=>eo("remove",t,e),$t=new WeakMap,Ue=(t,e)=>{if(e===void 0)return $t.get(t);try{$t.get(t).disconnect(),$t.delete(t)}catch{}if(e){const n=new MutationObserver(o=>t.handleEvent({type:"mutation",detail:o}));n.observe(t,e),$t.set(t,n)}},xa=t=>{var e;const n=t.key===" "||t.key==="Enter";return n&&((e=t.preventDefault)==null||e.call(t)),n&&t.target instanceof HTMLElement&&t.target.dispatchEvent(new MouseEvent("click",t)),n},no=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},Ea=0,oo=t=>t?(t.id||(t.id=`:${t.nodeName.toLowerCase()}${(++Ea).toString(32)}`),t.id):"",xt=(t,e,n)=>{const o=document.createElement(t);if(e&&(o[t==="style"?"textContent":"innerHTML"]=e),n)for(const[i,r]of Object.entries(n))T(o,i,r);return o},Sa={define:(t,e)=>!Qt||window.customElements.get(t)||window.customElements.define(t,e)},ka=t=>{var e;const n=T(t,"aria-label")||"";return[...(((e=T(t,"aria-labelledby"))==null?void 0:e.trim().split(/\s+/))||[]).map(i=>document.getElementById(i)),...Array.from(t.labels||[])].reduce((i,r)=>{var a;return i||((a=r?.innerText)==null?void 0:a.trim())||""},n)},st,Ta=0,De=t=>{st||(st=xt("div"),st.style.cssText="position:fixed;overflow:hidden;width:1px;white-space:nowrap",T(st,"aria-live","assertive")),st.isConnected||document.body.append(st),t&&(st.textContent=`${t}${Ta++%2?" ":""}`)},io=(t,e,n="")=>{var o,i;const r={bubbles:!0,composed:!0,data:e,inputType:n},a=HTMLInputElement.prototype;t.dispatchEvent(new InputEvent("beforeinput",r)),(i=(o=Object.getOwnPropertyDescriptor(a,"value"))==null?void 0:o.set)==null||i.call(t,e),t.dispatchEvent(new InputEvent("input",r)),t.dispatchEvent(new Event("change",{bubbles:!0}))},ze=!1,Fe=t=>(t?.type==="mouseup"&&(ze=!1),t?.type==="mousedown"&&(ze=!0,_t(document,"mouseup",Fe,{once:!0})),ze),Aa=(t,e="<slot></slot>")=>`<template shadowrootmode="open">${e}<style>${t}</style></template>`,Be=`:host(:not([hidden])) { display: block; -webkit-tap-highlight-color: rgba(0, 0, 0, 0) } /* Must be display block in Safari to allow focus inside */
2
2
  :host(:not([data-multiple])) ::slotted(data),
3
3
  :host([data-multiple="false"]) ::slotted(data) { display: none } /* Hide data if not multiple */
4
4
  [role="listbox"] { position: absolute } /* Avoid affecting CSS like flex on the <u-combobox> */
@@ -6,11 +6,11 @@ var mtds=(function(k){"use strict";var ma=Object.defineProperty,Qn=Object.getOwn
6
6
  ::slotted(del) { text-decoration: none }
7
7
  ::slotted(data:not([hidden])) { display: inline-block; pointer-events: none }
8
8
  ::slotted(data)::after { content: '\\00D7'; content: '\\00D7' / ''; padding-inline: .5ch; pointer-events: auto; cursor: pointer }
9
- ::slotted(data:focus) { ${ba} }`,La=Aa(Ge),ro="beforeinput,blur,focus,click,input,keydown,mousedown",ao={once:!0,capture:!0,passive:!0},ee="false",ne=va||$n,so="​".repeat(5),lo="deleteContentBackward",Ca="insertText",Oa=" ",oe={added:"Added",empty:"No selected",found:"Navigate left to find %d selected",invalid:"Invalid value",items:"Selected",of:"of",remove:"Press to remove",removed:"Removed"},Je=class extends wa{constructor(){super(),this._item="",this._speak="",this._texts=ga({},oe),this._value="",this.shadowRoot||this.attachShadow({mode:"open"}).append(xt("slot",null,{"aria-orientation":"horizontal",tabindex:"-1",role:"listbox",name:"items"}),xt("slot"),xt("div",'<div role="option" tabindex="-1"></div>',{"aria-hidden":"true",role:"listbox"}),xt("style",Ge))}static get observedAttributes(){return Object.keys(oe).map(t=>`data-sr-${t}`)}connectedCallback(){this._root=no(this),$t(this,ro,this,!0),De(this,{attributeFilter:["value","id","role"],attributes:!0,characterData:!0,childList:!0,subtree:!0}),setTimeout(ie,0,this),setTimeout(re,0,this)}attributeChangedCallback(t,e,n){const o=t.split("data-sr-")[1];oe[o]&&(this._texts[o]=n||oe[o])}disconnectedCallback(){De(this,!1),ya(this,ro,this,!0),this._items=this._clear=this._focus=this._control=void 0,this._list=this._options=this._root=this._form=void 0}handleEvent(t){const e=t.target;je(this)||(t.type==="beforeinput"&&(this._value=e?.value||""),t.type==="blur"&&Ia(this),t.type==="click"&&Ra(this,t),t.type==="focus"&&Ma(this,t),t.type==="input"&&qa(this,t),t.type==="keydown"&&Wa(this,t),t.type==="mousedown"&&Be(t),t.type==="mutation"&&ie(this,t))}get multiple(){var t;return((t=T(this,"data-multiple"))!=null?t:ee)!==ee}set multiple(t){T(this,"data-multiple",t?"":null)}get creatable(){var t;return((t=T(this,"data-creatable"))!=null?t:ee)!==ee}set creatable(t){T(this,"data-creatable",t?"":null)}get control(){var t;return(t=this._control)!=null&&t.isConnected||(this._control=this.querySelector("input")),this._control}get list(){var t;return(t=this._list)!=null&&t.isConnected||(this._list=this.querySelector('datalist,[role="listbox"]')),this._list}get clear(){var t;return(t=this._clear)!=null&&t.isConnected||(this._clear=this.querySelector("del")),this._clear}get items(){return this._items||(this._items=this.getElementsByTagName("data")),this._items}get options(){var t,e;if(!this._options){const n=(e=(t=this.list)==null?void 0:t.querySelector('[role="option"],option'))==null?void 0:e.nodeName;n&&(this._options=this.getElementsByTagName(n))}return this._options}get values(){return[...this.items].map(({value:t})=>t)}},lt=t=>{var e;return((e=t?.textContent)==null?void 0:e.trim())||""},He=t=>t instanceof HTMLDataElement,je=({control:t})=>t?.disabled||t?.readOnly||!1,ie=(t,e)=>{var n,o;const{_focus:i,_texts:r,items:a,control:s,list:l,multiple:c}=t;if(!s)return;const d=ka(s),u=d.endsWith(so)?T(s,"data-label"):d;T(s,"data-label",u);let p=`${u}${c?`, ${a.length?r.found.replace("%d",`${a.length}`):r.empty}`:""}`;const m=[];for(const{addedNodes:x,removedNodes:S}of e?.detail||[]){for(const A of x)He(A)&&m.unshift(A);for(const A of S)He(A)&&m.push(A)}const b=c?m.length===1:m[0]===i;if(i&&b){const x=T(s,"aria-expanded"),S=T(s,"inputmode"),A=He(i)?s:i,I=!m[0].isConnected;t._speak=`${r[I?"removed":"added"]} ${lt(m[0])}, `,(ne||i===s)&&ze(t._speak),s!==A&&(ne&&T(s,"aria-expanded",null),ne&&T(s,"inputmode","none"),p=Oa,s.focus()),setTimeout(()=>{var F;T(s,"aria-expanded",x),T(s,"inputmode",I?"none":S),(F=A?.focus)==null||F.call(A),T(s,"inputmode",S),t._speak="",ne?setTimeout(ie,100,t):$t(t,"blur",()=>ie(t),ao)},100)}let f=0;const g=t.querySelector("select"),h=je(t)?"":r.remove,w=(n=t.shadowRoot)==null?void 0:n.firstElementChild;w&&T(w,"aria-label",r.items);for(const x of a){const S=g?.options[f++],A=lt(x),I=x.value||A,F=`${t._speak}${A}, ${h}`;T(x,"aria-label",F),T(x,"aria-selected","true"),T(x,"role","option"),T(x,"slot","items"),T(x,"tabindex","-1"),T(x,"value",I),S?Object.assign(S,{textContent:A,value:I}):g?.appendChild(new Option(A,I,!0,!0)),$n&&T(x,"title",`${f} ${r.of} ${a.length}`)}g&&T(g,"multiple",c?"":null);for(const x of[...g?.options||[]].slice(f))x.remove();!c&&f>1&&console.warn(t," Multiple <data> found in single mode."),l&&(T(l,"aria-multiselectable",`${c}`),T(s,"list",oo(l)),T(s,"aria-label",`${t._speak}${p}${so}`),l.hasAttribute("popover")&&(T(s,"popovertarget",oo(l)),T(l,"popover","manual")),l._of=r.of);const E=lt(a[0]);E!==t._item&&re(t),t._item=E,co(t),uo(t),(o=De(t))==null||o.takeRecords()},co=t=>{var e;t.clear&&T(t.clear,"role","button"),t.clear&&(t.clear.hidden=!((e=t.control)!=null&&e.value)||je(t))},uo=t=>{var e;const{_speak:n,options:o=[],values:i}=t;for(const r of o){const a=(e=T(r,"value"))!=null?e:lt(r);T(r,"aria-label",n?`${n}${lt(r)}`:null),T(r,"selected",i.includes(a)?"":null)}},re=t=>{const{multiple:e,control:n,items:o}=t,i=lt(o[0]);!e&&n&&i!==n.value&&io(n,i,i?Ca:lo)},Xe=(t,e=!0)=>{var n;const{_texts:o,options:i=[],creatable:r,control:a,items:s,multiple:l}=t,c=((n=a?.value)==null?void 0:n.trim())||"",d=c.toLowerCase()||null;let u=[...i].find(m=>(T(m,"label")||lt(m)).trim().toLowerCase()===d);const p={bubbles:!0,cancelable:!0,detail:u};if(t.dispatchEvent(new CustomEvent("comboboxbeforematch",p))||(u=[...i].find(m=>m.selected)),e)return uo(t),u?Et(t,u,!1):r&&c?Et(t,{value:c},!1):(!l&&!c&&s[0]?Et(t,s[0]):re(t),ze(o.invalid));for(const m of i)m.selected=m===u},Et=(t,e,n=!0)=>{var o,i,r;const{control:a,items:s,multiple:l}=t,c=xt("data",e.label||e.value,{value:e.value}),d=[...s].find(m=>m.value===e.value),u={bubbles:!0,cancelable:!0,detail:d||c};if(d&&!n)return re(t);if(d===((o=no(t))==null?void 0:o.activeElement)&&((r=(i=t.shadowRoot)==null?void 0:i.querySelector('[role="option"]'))==null||r.focus()),t.dispatchEvent(new CustomEvent("comboboxbeforeselect",u))){if(!l)for(const m of[...s])m.remove();d?d.remove():a?.insertAdjacentElement("beforebegin",c),t.dispatchEvent(new CustomEvent("comboboxafterselect",u))}},Ma=(t,{target:e})=>{const{_form:n,control:o,multiple:i}=t;e instanceof HTMLElement&&(t._focus=e),i&&n===void 0&&o&&e===o&&(t._form=T(o,"form"),T(o,"form","#")),ze()},Ia=t=>Be()||setTimeout(Na,0,t),Na=t=>{const{_focus:e,_root:n,_form:o,multiple:i,control:r}=t;!e||t.contains(n?.activeElement)||(i||Xe(t),o&&r&&T(r,"form",o),t._focus=t._form=void 0)},Ra=(t,e)=>{const{clientX:n,clientY:o,target:i}=e,{clear:r,control:a,items:s}=t;if(r?.contains(i))return a&&io(a,"",lo),a?.focus();for(const l of s){const{top:c,right:d,bottom:u,left:p}=l.getBoundingClientRect();if(l.contains(i))return Et(t,l);if(o>=c&&o<=u&&n>=p&&n<=d)return l.focus()}i===t&&a?.focus()},qa=(t,e)=>{var n;const{options:o=[],control:i,multiple:r}=t,a=((n=i?.value)==null?void 0:n.trim())||"";if(e instanceof InputEvent?!e.inputType||e.inputType==="insertReplacementText":!!a){e.stopImmediatePropagation(),i&&(i.value=t._value);for(const l of o)if(l.value&&l.value===a)return Et(t,l,r)}else r||Xe(t,!1);co(t)},Wa=(t,e)=>{var n;const{clear:o,control:i,items:r}=t,{key:a,repeat:s,target:l}=e,c=i&&i===l,d=c&&i.selectionEnd,u=e.ctrlKey||e.metaKey||e.shiftKey||e.key==="Alt";let p=c?r.length:[...r].indexOf(l);if(c&&a==="Tab"&&!e.shiftKey&&o&&!o.hidden&&(e.preventDefault(),o.tabIndex=0,o.focus(),$t(o,"blur",()=>T(o,"tabindex",null),ao)),!(!c&&xa(e)||p===-1||u)){if(a==="ArrowRight"&&!c)p+=1;else if(a==="ArrowLeft"&&!d)p-=1;else{if(a==="Enter"&&c)return Xe(t);if(a==="Backspace"&&!d){if(e.preventDefault(),!s&&r[p])return Et(t,r[p]);c&&(p-=1)}else return c||i?.focus()}e.preventDefault(),(n=r[Math.max(0,p)]||i)==null||n.focus()}};Sa.define("u-combobox",Je);var Ze=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",Pa=Ze&&/android/i.test(navigator.userAgent),po;Ze&&/^Mac/i.test(((po=navigator.userAgentData)==null?void 0:po.platform)||navigator.platform);var Va=`${Pa?"data":"aria"}-labelledby`,Ke=":host(:not([hidden])) { display: block }",ae=typeof HTMLElement>"u"?class{}:HTMLElement;function O(t,e,n){return n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}var mo=(t,e,n)=>{for(const o of n[0].split(","))n[0]=o,Element.prototype[`${t}EventListener`].apply(e,n)},Ua=(t,...e)=>mo("add",t,e),Da=(t,...e)=>mo("remove",t,e),se=(t,e)=>t.shadowRoot||t.attachShadow({mode:"open"}).append(vo("slot"),vo("style",e)),le=new WeakMap,fo=(t,e)=>{if(e===void 0)return le.get(t);try{le.get(t).disconnect(),le.delete(t)}catch{}if(e){const n=new MutationObserver(o=>t.handleEvent({type:"mutation",detail:o}));n.observe(t,e),le.set(t,n)}},za=t=>{var e;const n=t.key===" "||t.key==="Enter";return n&&((e=t.preventDefault)==null||e.call(t)),n&&t.target instanceof HTMLElement&&t.target.dispatchEvent(new MouseEvent("click",t)),n},ho=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},Fa=0,go=t=>t?(t.id||(t.id=`:${t.nodeName.toLowerCase()}${(++Fa).toString(32)}`),t.id):"",vo=(t,e,n)=>{const o=document.createElement(t);return e&&(o[t==="style"?"textContent":"innerHTML"]=e),o},ce={define:(t,e)=>!Ze||window.customElements.get(t)||window.customElements.define(t,e)},de=(t,e="<slot></slot>")=>`<template shadowrootmode="open">${e}<style>${t}</style></template>`,Ye=Ke,Qe=Ke,_e=Ke,$e=':host(:not([hidden])) { display: inline-block; cursor: pointer }:host([aria-disabled="true"]) { cursor: default }',Ba=de(Ye),Ga=de(Qe),Ja=de($e),Ha=de(_e),ue="aria-controls",St="aria-selected",bo="data-utabs",tn=class extends ae{constructor(){super(),se(this,Ye)}connectedCallback(){O(this,bo,"")}get tabList(){return pe("tablist",this)[0]||null}get selectedIndex(){return me(this.tabs)}set selectedIndex(t){dn(this.tabs[t])}get tabs(){return pe("tab",this)}get panels(){return pe("tabpanel",this)}},en=class extends ae{constructor(){super(),se(this,Qe)}connectedCallback(){O(this,"role","tablist"),Ua(this,"click,keydown",this),fo(this,{childList:!0}),requestAnimationFrame(()=>this.handleEvent())}disconnectedCallback(){Da(this,"click,keydown",this),fo(this,!1)}handleEvent(t){var e,n;if(!t||t.type==="mutation"){const s=this.tabs[Math.max(this.selectedIndex,0)];return s?.setAttribute(St,"true")}const{key:o}=t,i=[...this.tabs],r=i.findIndex(s=>s.contains(t.target));let a=r;if(!(t.defaultPrevented||r===-1)&&(t.type==="click"&&dn(i[r]),t.type==="keydown"&&!za(t))){if(o==="ArrowDown"||o==="ArrowRight")a=(r+1)%i.length;else if(o==="ArrowUp"||o==="ArrowLeft")a=(r||i.length)-1;else if(o==="End")a=i.length-1;else if(o==="Home")a=0;else if(o==="Tab")a=me(i);else return;setTimeout(()=>{O(i[r],"tabindex","-1"),O(i[a],"tabindex","0")}),o!=="Tab"&&(t.preventDefault(),(n=(e=i[a]).focus)==null||n.call(e))}}get tabsElement(){return ln(this)}get tabs(){return cn(this)}get selectedIndex(){return me(this.tabs)}set selectedIndex(t){dn(this.tabs[t])}},nn=!1,on=class extends ae{static get observedAttributes(){return["id",St,ue]}constructor(){super(),se(this,$e)}connectedCallback(){O(this,"role","tab"),O(this,"tabindex",this.selected?"0":"-1")}attributeChangedCallback(){if(!nn&&this.selected&&this.tabList){nn=!0;const t=this.tabList?cn(this.tabList):[],e=pe("tabpanel",this.tabsElement||this),n=sn(this,e[[...t].indexOf(this)]);n&&O(n,Va,go(this));let o=0;for(const i of t){const r=sn(i,e[o++]);O(i,"tabindex",i===this?"0":"-1"),O(i,St,`${i===this}`),r?.id&&O(i,ue,r.id),r&&(r.hidden=r!==n)}nn=!1}}get tabsElement(){return ln(this)}get tabList(){const t=this.parentElement;return t?.getAttribute("role")==="tablist"?t:null}get selected(){return O(this,St)==="true"}set selected(t){O(this,St,`${!!t}`)}get index(){const t=this.tabList;return t?[...cn(t)].indexOf(this):0}get panel(){return sn(this)}},rn=!1,an=class extends ae{static get observedAttributes(){return["id","hidden"]}constructor(){super(),se(this,_e)}connectedCallback(){var t,e;O(this,"role","tabpanel"),(e=(t=this.tabsElement)==null?void 0:t.tabList)==null||e.handleEvent(),this.attributeChangedCallback()}attributeChangedCallback(){if(rn)return;rn=!0;const t=ja(this.firstChild);this.hidden=me(this.tabs)===-1,O(this,"aria-hidden",`${this.hidden}`),O(this,"tabindex",this.hidden||t?null:"0"),rn=!1}get tabsElement(){return ln(this)}get tabs(){return ho(this).querySelectorAll(`[role="tab"][${ue}="${this.id}"]`)}},pe=(t,e)=>e.querySelectorAll(`[role="${t}"]:not(:scope [role="tabpanel"] [role="${t}"])`),sn=(t,e)=>ho(t).getElementById(O(t,ue)||go(e)),me=t=>[...t].findIndex(e=>O(e,St)==="true"),ln=t=>t.closest(`[${bo}]`),cn=t=>t.querySelectorAll(':scope > [role="tab"]'),dn=t=>t&&O(t,"aria-disabled")!=="true"&&O(t,"aria-selected","true"),ja=t=>t instanceof Element&&!t.matches(':disabled,[tabindex^="-"]')&&t.matches('[contenteditable],[controls],[href],[tabindex],input:not([type="hidden"]),select,textarea,button,summary,iframe');ce.define("u-tabs",tn),ce.define("u-tablist",en),ce.define("u-tab",on),ce.define("u-tabpanel",an);var wo=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",yo;wo&&/^Mac/i.test(((yo=navigator.userAgentData)==null?void 0:yo.platform)||navigator.platform);var Xa=":host(:not([hidden])) { display: block }",xo=typeof HTMLElement>"u"?class{}:HTMLElement;function _(t,e,n){return n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}var Eo=(t,e,n)=>{for(const o of n[0].split(","))n[0]=o,Element.prototype[`${t}EventListener`].apply(e,n)},So=(t,...e)=>Eo("add",t,e),ko=(t,...e)=>Eo("remove",t,e),Za=t=>{var e;const n=t.key===" "||t.key==="Enter";return n&&((e=t.preventDefault)==null||e.call(t)),n&&t.target instanceof HTMLElement&&t.target.dispatchEvent(new MouseEvent("click",t)),n},Ka=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},un=(t,e,n)=>{const o=document.createElement(t);if(e&&(o[t==="style"?"textContent":"innerHTML"]=e),n)for(const[i,r]of Object.entries(n))_(o,i,r);return o},To={define:(t,e)=>!wo||window.customElements.get(t)||window.customElements.define(t,e)},Ya=`${Xa}
9
+ ::slotted(data:focus) { ${ba} }`,La=Aa(Be),ro="beforeinput,blur,focus,click,input,keydown,mousedown",ao={once:!0,capture:!0,passive:!0},te="false",ee=va||$n,so="​".repeat(5),lo="deleteContentBackward",Ca="insertText",Ma=" ",ne={added:"Added",empty:"No selected",found:"Navigate left to find %d selected",invalid:"Invalid value",items:"Selected",of:"of",remove:"Press to remove",removed:"Removed"},Ge=class extends wa{constructor(){super(),this._item="",this._speak="",this._texts=ga({},ne),this._value="",this.shadowRoot||this.attachShadow({mode:"open"}).append(xt("slot",null,{"aria-orientation":"horizontal",tabindex:"-1",role:"listbox",name:"items"}),xt("slot"),xt("div",'<div role="option" tabindex="-1"></div>',{"aria-hidden":"true",role:"listbox"}),xt("style",Be))}static get observedAttributes(){return Object.keys(ne).map(t=>`data-sr-${t}`)}connectedCallback(){this._root=no(this),_t(this,ro,this,!0),Ue(this,{attributeFilter:["value","id","role"],attributes:!0,characterData:!0,childList:!0,subtree:!0}),setTimeout(oe,0,this),setTimeout(ie,0,this)}attributeChangedCallback(t,e,n){const o=t.split("data-sr-")[1];ne[o]&&(this._texts[o]=n||ne[o])}disconnectedCallback(){Ue(this,!1),ya(this,ro,this,!0),this._items=this._clear=this._focus=this._control=void 0,this._list=this._options=this._root=this._form=void 0}handleEvent(t){const e=t.target;He(this)||(t.type==="beforeinput"&&(this._value=e?.value||""),t.type==="blur"&&Ia(this),t.type==="click"&&Ra(this,t),t.type==="focus"&&Oa(this,t),t.type==="input"&&qa(this,t),t.type==="keydown"&&Wa(this,t),t.type==="mousedown"&&Fe(t),t.type==="mutation"&&oe(this,t))}get multiple(){var t;return((t=T(this,"data-multiple"))!=null?t:te)!==te}set multiple(t){T(this,"data-multiple",t?"":null)}get creatable(){var t;return((t=T(this,"data-creatable"))!=null?t:te)!==te}set creatable(t){T(this,"data-creatable",t?"":null)}get control(){var t;return(t=this._control)!=null&&t.isConnected||(this._control=this.querySelector("input")),this._control}get list(){var t;return(t=this._list)!=null&&t.isConnected||(this._list=this.querySelector('datalist,[role="listbox"]')),this._list}get clear(){var t;return(t=this._clear)!=null&&t.isConnected||(this._clear=this.querySelector("del")),this._clear}get items(){return this._items||(this._items=this.getElementsByTagName("data")),this._items}get options(){var t,e;if(!this._options){const n=(e=(t=this.list)==null?void 0:t.querySelector('[role="option"],option'))==null?void 0:e.nodeName;n&&(this._options=this.getElementsByTagName(n))}return this._options}get values(){return[...this.items].map(({value:t})=>t)}},lt=t=>{var e;return((e=t?.textContent)==null?void 0:e.trim())||""},Je=t=>t instanceof HTMLDataElement,He=({control:t})=>t?.disabled||t?.readOnly||!1,oe=(t,e)=>{var n,o;const{_focus:i,_texts:r,items:a,control:s,list:c,multiple:l}=t;if(!s)return;const d=ka(s),u=d.endsWith(so)?T(s,"data-label"):d;T(s,"data-label",u);let p=`${u}${l?`, ${a.length?r.found.replace("%d",`${a.length}`):r.empty}`:""}`;const m=[];for(const{addedNodes:x,removedNodes:S}of e?.detail||[]){for(const A of x)Je(A)&&m.unshift(A);for(const A of S)Je(A)&&m.push(A)}const b=l?m.length===1:m[0]===i;if(i&&b){const x=T(s,"aria-expanded"),S=T(s,"inputmode"),A=Je(i)?s:i,I=!m[0].isConnected;t._speak=`${r[I?"removed":"added"]} ${lt(m[0])}, `,(ee||i===s)&&De(t._speak),s!==A&&(ee&&T(s,"aria-expanded",null),ee&&T(s,"inputmode","none"),p=Ma,s.focus()),setTimeout(()=>{var F;T(s,"aria-expanded",x),T(s,"inputmode",I?"none":S),(F=A?.focus)==null||F.call(A),T(s,"inputmode",S),t._speak="",ee?setTimeout(oe,100,t):_t(t,"blur",()=>oe(t),ao)},100)}let f=0;const g=t.querySelector("select"),h=He(t)?"":r.remove,w=(n=t.shadowRoot)==null?void 0:n.firstElementChild;w&&T(w,"aria-label",r.items);for(const x of a){const S=g?.options[f++],A=lt(x),I=x.value||A,F=`${t._speak}${A}, ${h}`;T(x,"aria-label",F),T(x,"aria-selected","true"),T(x,"role","option"),T(x,"slot","items"),T(x,"tabindex","-1"),T(x,"value",I),S?Object.assign(S,{textContent:A,value:I}):g?.appendChild(new Option(A,I,!0,!0)),$n&&T(x,"title",`${f} ${r.of} ${a.length}`)}g&&T(g,"multiple",l?"":null);for(const x of[...g?.options||[]].slice(f))x.remove();!l&&f>1&&console.warn(t," Multiple <data> found in single mode."),c&&(T(c,"aria-multiselectable",`${l}`),T(s,"list",oo(c)),T(s,"aria-label",`${t._speak}${p}${so}`),c.hasAttribute("popover")&&(T(s,"popovertarget",oo(c)),T(c,"popover","manual")),c._of=r.of);const E=lt(a[0]);E!==t._item&&ie(t),t._item=E,co(t),uo(t),(o=Ue(t))==null||o.takeRecords()},co=t=>{var e;t.clear&&T(t.clear,"role","button"),t.clear&&(t.clear.hidden=!((e=t.control)!=null&&e.value)||He(t))},uo=t=>{var e;const{_speak:n,options:o=[],values:i}=t;for(const r of o){const a=(e=T(r,"value"))!=null?e:lt(r);T(r,"aria-label",n?`${n}${lt(r)}`:null),T(r,"selected",i.includes(a)?"":null)}},ie=t=>{const{multiple:e,control:n,items:o}=t,i=lt(o[0]);!e&&n&&i!==n.value&&io(n,i,i?Ca:lo)},je=(t,e=!0)=>{var n;const{_texts:o,options:i=[],creatable:r,control:a,items:s,multiple:c}=t,l=((n=a?.value)==null?void 0:n.trim())||"",d=l.toLowerCase()||null;let u=[...i].find(m=>(T(m,"label")||lt(m)).trim().toLowerCase()===d);const p={bubbles:!0,cancelable:!0,detail:u};if(t.dispatchEvent(new CustomEvent("comboboxbeforematch",p))||(u=[...i].find(m=>m.selected)),e)return uo(t),u?Et(t,u,!1):r&&l?Et(t,{value:l},!1):(!c&&!l&&s[0]?Et(t,s[0]):ie(t),De(o.invalid));for(const m of i)m.selected=m===u},Et=(t,e,n=!0)=>{var o,i,r;const{control:a,items:s,multiple:c}=t,l=xt("data",e.label||e.value,{value:e.value}),d=[...s].find(m=>m.value===e.value),u={bubbles:!0,cancelable:!0,detail:d||l};if(d&&!n)return ie(t);if(d===((o=no(t))==null?void 0:o.activeElement)&&((r=(i=t.shadowRoot)==null?void 0:i.querySelector('[role="option"]'))==null||r.focus()),t.dispatchEvent(new CustomEvent("comboboxbeforeselect",u))){if(!c)for(const m of[...s])m.remove();d?d.remove():a?.insertAdjacentElement("beforebegin",l),t.dispatchEvent(new CustomEvent("comboboxafterselect",u))}},Oa=(t,{target:e})=>{const{_form:n,control:o,multiple:i}=t;e instanceof HTMLElement&&(t._focus=e),i&&n===void 0&&o&&e===o&&(t._form=T(o,"form"),T(o,"form","#")),De()},Ia=t=>Fe()||setTimeout(Na,0,t),Na=t=>{const{_focus:e,_root:n,_form:o,multiple:i,control:r}=t;!e||t.contains(n?.activeElement)||(i||je(t),o&&r&&T(r,"form",o),t._focus=t._form=void 0)},Ra=(t,e)=>{const{clientX:n,clientY:o,target:i}=e,{clear:r,control:a,items:s}=t;if(r?.contains(i))return a&&io(a,"",lo),a?.focus();for(const c of s){const{top:l,right:d,bottom:u,left:p}=c.getBoundingClientRect();if(c.contains(i))return Et(t,c);if(o>=l&&o<=u&&n>=p&&n<=d)return c.focus()}i===t&&a?.focus()},qa=(t,e)=>{var n;const{options:o=[],control:i,multiple:r}=t,a=((n=i?.value)==null?void 0:n.trim())||"";if(e instanceof InputEvent?!e.inputType||e.inputType==="insertReplacementText":!!a){e.stopImmediatePropagation(),i&&(i.value=t._value);for(const c of o)if(c.value&&c.value===a)return Et(t,c,r)}else r||je(t,!1);co(t)},Wa=(t,e)=>{var n;const{clear:o,control:i,items:r}=t,{key:a,repeat:s,target:c}=e,l=i&&i===c,d=l&&i.selectionEnd,u=e.ctrlKey||e.metaKey||e.shiftKey||e.key==="Alt";let p=l?r.length:[...r].indexOf(c);if(l&&a==="Tab"&&!e.shiftKey&&o&&!o.hidden&&(e.preventDefault(),o.tabIndex=0,o.focus(),_t(o,"blur",()=>T(o,"tabindex",null),ao)),!(!l&&xa(e)||p===-1||u)){if(a==="ArrowRight"&&!l)p+=1;else if(a==="ArrowLeft"&&!d)p-=1;else{if(a==="Enter"&&l)return je(t);if(a==="Backspace"&&!d){if(e.preventDefault(),!s&&r[p])return Et(t,r[p]);l&&(p-=1)}else return l||i?.focus()}e.preventDefault(),(n=r[Math.max(0,p)]||i)==null||n.focus()}};Sa.define("u-combobox",Ge);var Xe=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",Pa=Xe&&/android/i.test(navigator.userAgent),po;Xe&&/^Mac/i.test(((po=navigator.userAgentData)==null?void 0:po.platform)||navigator.platform);var Va=`${Pa?"data":"aria"}-labelledby`,Ze=":host(:not([hidden])) { display: block }",re=typeof HTMLElement>"u"?class{}:HTMLElement;function M(t,e,n){return n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}var mo=(t,e,n)=>{for(const o of n[0].split(","))n[0]=o,Element.prototype[`${t}EventListener`].apply(e,n)},Ua=(t,...e)=>mo("add",t,e),Da=(t,...e)=>mo("remove",t,e),ae=(t,e)=>t.shadowRoot||t.attachShadow({mode:"open"}).append(vo("slot"),vo("style",e)),se=new WeakMap,fo=(t,e)=>{if(e===void 0)return se.get(t);try{se.get(t).disconnect(),se.delete(t)}catch{}if(e){const n=new MutationObserver(o=>t.handleEvent({type:"mutation",detail:o}));n.observe(t,e),se.set(t,n)}},za=t=>{var e;const n=t.key===" "||t.key==="Enter";return n&&((e=t.preventDefault)==null||e.call(t)),n&&t.target instanceof HTMLElement&&t.target.dispatchEvent(new MouseEvent("click",t)),n},ho=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},Fa=0,go=t=>t?(t.id||(t.id=`:${t.nodeName.toLowerCase()}${(++Fa).toString(32)}`),t.id):"",vo=(t,e,n)=>{const o=document.createElement(t);return e&&(o[t==="style"?"textContent":"innerHTML"]=e),o},le={define:(t,e)=>!Xe||window.customElements.get(t)||window.customElements.define(t,e)},ce=(t,e="<slot></slot>")=>`<template shadowrootmode="open">${e}<style>${t}</style></template>`,Ke=Ze,Ye=Ze,Qe=Ze,_e=':host(:not([hidden])) { display: inline-block; cursor: pointer }:host([aria-disabled="true"]) { cursor: default }',Ba=ce(Ke),Ga=ce(Ye),Ja=ce(_e),Ha=ce(Qe),de="aria-controls",St="aria-selected",bo="data-utabs",$e=class extends re{constructor(){super(),ae(this,Ke)}connectedCallback(){M(this,bo,"")}get tabList(){return ue("tablist",this)[0]||null}get selectedIndex(){return pe(this.tabs)}set selectedIndex(t){cn(this.tabs[t])}get tabs(){return ue("tab",this)}get panels(){return ue("tabpanel",this)}},tn=class extends re{constructor(){super(),ae(this,Ye)}connectedCallback(){M(this,"role","tablist"),Ua(this,"click,keydown",this),fo(this,{childList:!0}),requestAnimationFrame(()=>this.handleEvent())}disconnectedCallback(){Da(this,"click,keydown",this),fo(this,!1)}handleEvent(t){var e,n;if(!t||t.type==="mutation"){const s=this.tabs[Math.max(this.selectedIndex,0)];return s?.setAttribute(St,"true")}const{key:o}=t,i=[...this.tabs],r=i.findIndex(s=>s.contains(t.target));let a=r;if(!(t.defaultPrevented||r===-1)&&(t.type==="click"&&cn(i[r]),t.type==="keydown"&&!za(t))){if(o==="ArrowDown"||o==="ArrowRight")a=(r+1)%i.length;else if(o==="ArrowUp"||o==="ArrowLeft")a=(r||i.length)-1;else if(o==="End")a=i.length-1;else if(o==="Home")a=0;else if(o==="Tab")a=pe(i);else return;setTimeout(()=>{M(i[r],"tabindex","-1"),M(i[a],"tabindex","0")}),o!=="Tab"&&(t.preventDefault(),(n=(e=i[a]).focus)==null||n.call(e))}}get tabsElement(){return sn(this)}get tabs(){return ln(this)}get selectedIndex(){return pe(this.tabs)}set selectedIndex(t){cn(this.tabs[t])}},en=!1,nn=class extends re{static get observedAttributes(){return["id",St,de]}constructor(){super(),ae(this,_e)}connectedCallback(){M(this,"role","tab"),M(this,"tabindex",this.selected?"0":"-1")}attributeChangedCallback(){if(!en&&this.selected&&this.tabList){en=!0;const t=this.tabList?ln(this.tabList):[],e=ue("tabpanel",this.tabsElement||this),n=an(this,e[[...t].indexOf(this)]);n&&M(n,Va,go(this));let o=0;for(const i of t){const r=an(i,e[o++]);M(i,"tabindex",i===this?"0":"-1"),M(i,St,`${i===this}`),r?.id&&M(i,de,r.id),r&&(r.hidden=r!==n)}en=!1}}get tabsElement(){return sn(this)}get tabList(){const t=this.parentElement;return t?.getAttribute("role")==="tablist"?t:null}get selected(){return M(this,St)==="true"}set selected(t){M(this,St,`${!!t}`)}get index(){const t=this.tabList;return t?[...ln(t)].indexOf(this):0}get panel(){return an(this)}},on=!1,rn=class extends re{static get observedAttributes(){return["id","hidden"]}constructor(){super(),ae(this,Qe)}connectedCallback(){var t,e;M(this,"role","tabpanel"),(e=(t=this.tabsElement)==null?void 0:t.tabList)==null||e.handleEvent(),this.attributeChangedCallback()}attributeChangedCallback(){if(on)return;on=!0;const t=ja(this.firstChild);this.hidden=pe(this.tabs)===-1,M(this,"aria-hidden",`${this.hidden}`),M(this,"tabindex",this.hidden||t?null:"0"),on=!1}get tabsElement(){return sn(this)}get tabs(){return ho(this).querySelectorAll(`[role="tab"][${de}="${this.id}"]`)}},ue=(t,e)=>e.querySelectorAll(`[role="${t}"]:not(:scope [role="tabpanel"] [role="${t}"])`),an=(t,e)=>ho(t).getElementById(M(t,de)||go(e)),pe=t=>[...t].findIndex(e=>M(e,St)==="true"),sn=t=>t.closest(`[${bo}]`),ln=t=>t.querySelectorAll(':scope > [role="tab"]'),cn=t=>t&&M(t,"aria-disabled")!=="true"&&M(t,"aria-selected","true"),ja=t=>t instanceof Element&&!t.matches(':disabled,[tabindex^="-"]')&&t.matches('[contenteditable],[controls],[href],[tabindex],input:not([type="hidden"]),select,textarea,button,summary,iframe');le.define("u-tabs",$e),le.define("u-tablist",tn),le.define("u-tab",nn),le.define("u-tabpanel",rn);var wo=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",yo;wo&&/^Mac/i.test(((yo=navigator.userAgentData)==null?void 0:yo.platform)||navigator.platform);var Xa=":host(:not([hidden])) { display: block }",xo=typeof HTMLElement>"u"?class{}:HTMLElement;function _(t,e,n){return n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}var Eo=(t,e,n)=>{for(const o of n[0].split(","))n[0]=o,Element.prototype[`${t}EventListener`].apply(e,n)},So=(t,...e)=>Eo("add",t,e),ko=(t,...e)=>Eo("remove",t,e),Za=t=>{var e;const n=t.key===" "||t.key==="Enter";return n&&((e=t.preventDefault)==null||e.call(t)),n&&t.target instanceof HTMLElement&&t.target.dispatchEvent(new MouseEvent("click",t)),n},Ka=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},dn=(t,e,n)=>{const o=document.createElement(t);if(e&&(o[t==="style"?"textContent":"innerHTML"]=e),n)for(const[i,r]of Object.entries(n))_(o,i,r);return o},To={define:(t,e)=>!wo||window.customElements.get(t)||window.customElements.define(t,e)},Ya=`${Xa}
10
10
  ::slotted([slot="summary"]) { cursor: pointer; display: block }
11
11
  ::slotted([slot="summary"])::before { content: ''; display: inline-block; vertical-align: middle; margin-inline: .05em .3125em; border-block: .3125em solid transparent; border-inline-start: .5em solid }
12
12
  ::slotted([slot="summary"][aria-expanded="true"])::before { rotate: 90deg }
13
- :host > [part="details-content"]:not([hidden=""]) { display: block }`,Qa=class extends xo{constructor(){super(),this._content=null,this.shadowRoot||this.attachShadow({mode:"open"}).append(un("slot",null,{name:"summary"}),un("slot",null,{part:"details-content"}),un("style",Ya)),console.warn(`\x1B[1m<u-details> is deprecated as <details> now has sufficient screen reader support 🎉\x1B[0m
13
+ :host > [part="details-content"]:not([hidden=""]) { display: block }`,Qa=class extends xo{constructor(){super(),this._content=null,this.shadowRoot||this.attachShadow({mode:"open"}).append(dn("slot",null,{name:"summary"}),dn("slot",null,{part:"details-content"}),dn("style",Ya)),console.warn(`\x1B[1m<u-details> is deprecated as <details> now has sufficient screen reader support 🎉\x1B[0m
14
14
  Please use <details> and <summary>, but import '@u-elements/u-details/polyfill' to polyfill support for Talkback screen reader when used with Firefox on Android.`,this)}static get observedAttributes(){return["open"]}connectedCallback(){var t;this._content=(t=this.shadowRoot)==null?void 0:t.children[1],_(this,"role","group"),So(this._content,"beforematch",this),So(this,"click,keydown",this),this.attributeChangedCallback()}disconnectedCallback(){this._content&&ko(this._content,"beforematch",this),ko(this,"click,keydown",this),this._content=null}attributeChangedCallback(t,e,n){const o="onbeforematch"in this?"until-found":!0,i=this.open;for(const r of this.children)r.nodeName==="U-SUMMARY"&&_(r,"aria-expanded",`${i}`);if(this._content&&(_(this._content,"aria-hidden",`${!i}`),_(this._content,"tabindex",i?null:"-1"),this._content.hidden=i?!1:o),i&&this.name){const r=Ka(this).querySelectorAll(`${this.nodeName}[name="${this.name}"]`);for(const a of r)a!==this&&(a.open=!1)}t==="open"&&e===null!=(n===null)&&this.dispatchEvent(new Event("toggle"))}handleEvent(t){var e;const n=t.target instanceof Element&&((e=t.target.closest('[slot="summary"]'))==null?void 0:e.parentElement)===this;t.defaultPrevented||(t.type==="beforematch"&&(this.open=!0),n&&t.type==="keydown"&&Za(t),n&&t.type==="click"&&(this.open=!this.open))}get open(){return this.hasAttribute("open")}set open(t){_(this,"open",t?"":null)}get name(){return _(this,"name")||""}set name(t){_(this,"name",t)}},_a=class extends xo{connectedCallback(){_(this,"role","button"),this.slot="summary",this.tabIndex=0}};To.define("u-details",Qa),To.define("u-summary",_a);const $a=`@font-face {
15
15
  font-family: 'Mattilsynet Sans';
16
16
  font-style: normal italic;
@@ -31,7 +31,8 @@ Please use <details> and <summary>, but import '@u-elements/u-details/polyfill'
31
31
  --mtdsc-print-font-sm: 8.5pt;
32
32
  --mtdsc-print-font-md: 11pt;
33
33
  --mtdsc-print-font-lg: 14pt;
34
- --mtdsc-print-font-xl: 30pt;
34
+ --mtdsc-print-font-xl: 20pt;
35
+ --mtdsc-print-font-2xl: 30pt;
35
36
 
36
37
  --mtdsc-print-width: 210mm;
37
38
  --mtdsc-print-height: 297mm;
@@ -40,33 +41,39 @@ Please use <details> and <summary>, but import '@u-elements/u-details/polyfill'
40
41
  --mtdsc-print-logo-height: 27mm;
41
42
  --mtdsc-print-footer-height: 42mm;
42
43
 
44
+ --mtdsc-print-border: 0.3pt solid #68B096;
45
+ --mtdsc-print-front-background: #e2f1df;
46
+ --mtdsc-print-front-color: #054449;
47
+ --mtdsc-print-back-background: #e2f1df;
48
+ --mtdsc-print-back-color: #054449;
49
+ --mtdsc-print-back-tagline: "Sammen trygger vi framtiden\\00000afor mennesker, dyr og natur";
50
+ --mtdsc-print-back-footer: "Mattilsynet\\00000a" var(--mtdsc-print-bottom-center);;
43
51
  --mtdsc-print-bottom-left: "Mattilsynet\\00000a" var(--mtdsc-print-office) "\\00000a" var(--mtdsc-print-department);
44
- --mtdsc-print-bottom-center: "Postadresse: Felles postmottak\\00000aPostboks 383\\00000a2381 BRUMUNDDAL";
52
+ --mtdsc-print-bottom-center: "Felles postmottak\\00000aPostboks 383\\00000a2381 BRUMUNDDAL";
45
53
  --mtdsc-print-bottom-right: "Tlf: 22 40 00 00\\00000aE-post: postmottak@mattilsynet.no\\00000aOrg.nr: 985399077";
46
54
  --mtdsc-print-office: "hovedkontoret";
47
55
  --mtdsc-print-deparment: "";
48
56
  --mtdsc-print-classification: "Unntatt offentlighet\\00000affl. § 13 første ledd jf fvl. § 13 første ledd";
49
- }
50
57
 
51
- /* Config if front page exits */
52
- :root:has(.print + .print) {
53
- --mtdsc-print-first-color: #054449;
54
- --mtdsc-print-first-background: #e2f1df;
58
+ --_mtdsc-print-footer-demo: "Footer added when printing\\00000aor when generating PDF";
55
59
  }
56
60
 
57
- /* Components */
58
- .print { box-sizing: border-box; font-family: var(--mtdsc-print-font-family); font-size: var(--mtdsc-print-font-md); line-height: var(--mtdsc-print-line-height); position: relative }
61
+ /* Pages, where first page should always have logo */
62
+ .print { -webkit-font-smoothing: subpixel-antialiased; box-sizing: border-box; font-family: var(--mtdsc-print-font-family); font-size: var(--mtdsc-print-font-md); line-height: var(--mtdsc-print-line-height); position: relative }
59
63
  .print:not(.print + .print) { padding-top: var(--mtdsc-print-logo-height); background-repeat: no-repeat; background-image: url("data:image/svg+xml,%3Csvg role='img' aria-label='Mattilsynet' xmlns='http://www.w3.org/2000/svg' width='52mm' height='27mm' viewBox='0 0 4595 800' preserveAspectRatio='xMinYMin meet' fill='%23054449'%3E%3Cpath d='m2251.97 582.65 2.06-.41v71.12l-1.05.47c-6.93 2.95-22.82 7.91-51.18 7.91-65.17 0-105.6-39.93-105.6-104.23V379.09h-64.04v-67.78h19.52c32.8 0 51.63-18.97 51.63-51.99v-54.9h78.16v105.29h71.85v69.34h-71.85v164.97c0 28.98 12.68 41.35 42.37 41.35 11.69 0 25.16-2.19 28.13-2.78v.06Zm265.43-.03h-.01v-.03c-2.96.59-16.49 2.78-28.14 2.78-29.69 0-42.34-12.38-42.34-41.35V379.05h71.85v-69.34h-71.85V204.42h-78.15v54.9c0 33.01-18.84 51.99-51.64 51.99h-19.51v67.78h64.04v178.42c0 64.3 40.43 104.23 105.61 104.23 28.34 0 44.23-4.97 51.17-7.91l1.07-.47v-71.12l-2.1.41v-.03Zm-529.19 71.84.41 2.1h-80l-.41-1.22c-.76-2.12-3.24-14.55-3.62-38.65-12.89 18.26-44.23 50.48-104.8 50.48-34.76 0-64.77-11.04-86.89-31.99-20.57-19.52-31.93-45.67-31.93-73.61 0-56.61 39.56-96.07 105.79-105.61l88.7-13.45c21.55-3.03 24.05-14.56 24.05-23 0-31.66-25.38-50.56-63.6-50.56s-64.44 22.52-68.97 58.81l-78.64-17.72c6.96-54.23 55.44-111.71 146.94-111.71 134.15 0 148.64 91.16 148.64 130.35v170.99c0 33.35 4.03 53.92 4.2 54.79h.13Zm-88.69-155.98h-.05l-88.14 13.16c-16.66 2.77-44.64 12.25-44.64 44.9 0 20.61 15.23 42.79 48.65 42.79 38.38 0 84.15-15.14 84.15-87.29h.03v-13.57.01Zm696.18 159.14h85.76V309.21h-85.76v348.41ZM400.01 236.99c72.4 0 152 51.01 162.7 148.77 72.05-35.09 153.01-49.95 233.24-42.9C768.25 149.02 601.57 0 400.09 0 210.65 0 51.99 131.74 10.68 308.61a445.05 445.05 0 0 1 228.93 61.44c18.58-89.32 92.94-133.07 160.39-133.07l.01.01ZM1.99 361.84c-20.4 201.27 118.42 386.08 308.91 428v-2.24a444.14 444.14 0 0 1 53.07-211.24C297.36 443.08 151.25 355.8 1.99 361.84Zm1322.76 170.79-162.34-378.91-.47-1.03H1045v504.93h86.84V296.65l152.26 358.66h78.43l153.68-360.1v362.42h88.27V152.72h-119.04l-160.69 379.91ZM364.54 798.28C596.78 820.02 801.24 633.39 800 399.93c0-1.14 0-2.26-.02-3.38-234.54-27.38-443.96 165.76-435.44 401.73Zm3979.84-319.46c0 22-2.16 27.88-2.16 27.88h-253.34c2.89 49.34 42.55 86.28 92.83 86.28 37.12 0 63.43-14.59 78.49-43.24v.05h81.71a198.72 198.72 0 0 1-17.1 40.97c-24.42 41.01-70.86 76.39-143.14 76.39-48.02 0-92.49-17.41-125.07-49-35.25-34.14-53.91-81.6-53.91-137.16 0-51.5 18.47-98.56 52.07-132.51 31.45-31.87 74.64-50.15 118.41-50.15 105.62 0 171.21 69.02 171.21 180.51v-.02Zm-86.87-35.69c-2.86-53.72-46.72-72.85-83.61-72.85s-78.12 25.54-82.81 72.85h166.42Zm-440.7-143.46c-42.48 0-79.66 19.15-100.83 51.47v-41.59h-83.9v348.02h86.03V457.04c0-48.37 27.56-79.59 70.19-79.59 60.45 0 69.48 46.78 69.48 74.65v205.5h86.04V437.95c0-85.31-48.66-138.28-127.01-138.29v.01Zm-406.67 224.46-98.17-213.91-.48-1.03h-97.32l149.18 304.64-82.02 177.12v.04h92.17l220.45-481.79h-91.52l-92.29 214.93Zm1182.83 58.51v-.05c-3.03.59-16.52 2.78-28.14 2.78-29.74 0-42.43-12.38-42.43-41.35V379.05h71.91v-69.34h-71.91V204.42h-78.13v54.9c0 33.01-18.87 51.99-51.64 51.99h-19.52v67.78h64v178.42c0 64.3 40.51 104.23 105.64 104.23 29.42 0 45.63-5.51 51.19-7.91l1.06-.47v-71.12l-2.03.4ZM2643.01 135a55.32 55.32 0 0 0-55.49 55.48c0 30.59 24.01 54.76 55.49 54.76s56.14-24.04 56.14-54.76-25.2-55.48-56.14-55.48Zm135.82 522.63h85.77V141.81h-85.77v515.82Zm325.89-208.77h-.08l.08.02v-.02Zm-.17 0h.09l-52.61-10.58c-20.98-4.15-33.49-17.01-33.49-34.32 0-21.23 21.13-37.86 48.08-37.86 52.47 0 61.13 41.72 62.38 50.1l.29 1.94 73.16-20.75-.25-1.53c-1.82-10.68-8.62-38.16-33.24-61.72-24.8-23.75-59.27-35.81-102.34-35.81-71.24 0-129.2 50.54-129.2 112.67 0 50.89 35.36 89.08 94.6 102.02l51.32 11.32c25.65 5.22 39.19 17.82 39.19 36.44 0 18.62-15.54 37.86-50.26 37.86-46.91 0-66.35-30.76-68.79-57.07l-.18-2.1-75.37 20.75.13 1.47c2.6 23.77 16.07 49.02 36.04 67.62 26.61 24.71 64.24 37.86 108.8 37.86 87.16 0 132.74-56.32 132.74-112s-36.82-92.46-101.09-106.3v-.01Z'/%3E%3C/svg%3E") }
60
64
  .print:not(.print + .print)::before { content: var(--mtdsc-print-classification); position: absolute; top: 0; right: 0; text-align: right; font-size: var(--mtdsc-print-font-sm); white-space: pre-wrap }
61
- .print:has(+ .print) { display: grid; min-height: calc(var(--mtdsc-print-inner-height) - var(--mtdsc-print-footer-height)); color: var(--mtdsc-print-first-color); page-break-after: always; break-after: page } /* Need to set color to ensure elements can inhert */
62
- .print:has(+ .print) h1 { font-size: var(--mtdsc-print-font-xl); line-height: 1.3; }
65
+ .print[data-variant="front"] { page: mtds_print_front; display: grid; min-height: calc(var(--mtdsc-print-inner-height) - var(--mtdsc-print-footer-height)); color: var(--mtdsc-print-front-color); break-after: page } /* Need to set color to ensure elements can inhert */
66
+ .print[data-variant="front"] h1 { font-size: var(--mtdsc-print-font-2xl); font-weight: bold; line-height: 1.3 }
67
+ .print[data-variant="back"] { page: mtds_print_back; display: grid; min-height: calc(var(--mtdsc-print-inner-height) - var(--mtdsc-print-footer-height)); color: var(--mtdsc-print-back-color); break-before: page }
68
+ .print[data-variant="back"]::before { content: var(--mtdsc-print-back-tagline); white-space: pre-wrap; padding-top: var(--mtdsc-print-top); font-size: var(--mtdsc-print-font-xl); font-weight: bold; line-height: 1.3 }
69
+
63
70
 
64
71
  /* Typography */
65
72
  .print :first-child { margin-top: 0 }
66
73
  .print :last-child { margin-bottom: 0 }
67
74
  .print small { font-size: var(--mtdsc-print-font-sm) }
68
75
  .print h1 { font-size: var(--mtdsc-print-font-lg); font-weight: 700; margin-block: 0 1rem }
69
- .print h2 { font-size: inherit; margin-block: 1.5rem .5rem; page-break-after: avoid; break-after: avoid-page }
76
+ .print h2 { font-size: inherit; margin-block: 1.5rem .5rem; break-after: avoid-page }
70
77
  .print h2 + * { margin-top: 0; page-break-before: avoid; break-before: avoid-page }
71
78
 
72
79
  /* Structure */
@@ -92,9 +99,12 @@ Please use <details> and <summary>, but import '@u-elements/u-details/polyfill'
92
99
  padding: var(--mtdsc-print-top) var(--mtdsc-print-right) var(--mtdsc-print-bottom) var(--mtdsc-print-left);
93
100
  width: 98%;
94
101
  }
95
- .print:has(+ .print) { height: var(--mtdsc-print-height); padding-bottom: calc(var(--mtdsc-print-bottom) + var(--mtdsc-print-footer-height)); color: var(--mtdsc-print-first-color); background-color: var(--mtdsc-print-first-background) }
96
102
  .print:not(.print + .print) { padding-top: calc(var(--mtdsc-print-top) + var(--mtdsc-print-logo-height)); background-position: var(--mtdsc-print-left) var(--mtdsc-print-top) }
97
103
  .print:not(.print + .print)::before { top: var(--mtdsc-print-top); right: var(--mtdsc-print-right) }
104
+ .print[data-variant="front"] { height: var(--mtdsc-print-height); padding-bottom: calc(var(--mtdsc-print-bottom) + var(--mtdsc-print-footer-height)); color: var(--mtdsc-print-front-color); background-color: var(--mtdsc-print-front-background) }
105
+ .print[data-variant="back"] { height: var(--mtdsc-print-height); padding-bottom: calc(var(--mtdsc-print-bottom) + var(--mtdsc-print-footer-height)); color: var(--mtdsc-print-back-color); background-color: var(--mtdsc-print-back-background) }
106
+ .print[data-variant="front"]::after { box-sizing: border-box; columns: 3; content: var(--_mtdsc-print-footer-demo) "\\00000a\\00000a" var(--_mtdsc-print-footer-demo) "\\00000a\\00000a" var(--_mtdsc-print-footer-demo); font-size: var(--mtdsc-print-font-sm); line-height: var(--mtdsc-print-line-height); padding-top: 5mm; white-space: pre-wrap; position: absolute; inset: auto var(--mtdsc-print-right) 0 var(--mtdsc-print-left); height: var(--mtdsc-print-footer-height); border-top: var(--mtdsc-print-border) }
107
+ .print[data-variant="back"]::after { box-sizing: border-box; content: var(--mtdsc-print-back-footer); font-size: var(--mtdsc-print-font-sm); line-height: var(--mtdsc-print-line-height); white-space: pre-wrap; position: absolute; inset: auto auto 0 var(--mtdsc-print-left); width: calc(var(--mtdsc-print-inner-width) / 3); height: var(--mtdsc-print-footer-height) }
98
108
  }
99
109
 
100
110
  @media print{
@@ -119,12 +129,9 @@ Please use <details> and <summary>, but import '@u-elements/u-details/polyfill'
119
129
  }
120
130
  }
121
131
  @page :first {
122
- background: var(--mtdsc-print-first-background);
123
132
  margin-bottom: var(--mtdsc-print-footer-height);
124
133
 
125
134
  @bottom-left {
126
- border-top: 0.3pt solid #68B096;
127
- color: var(--mtdsc-print-first-color);
128
135
  content: var(--mtdsc-print-bottom-left);
129
136
  font-family: var(--mtdsc-print-font-family);
130
137
  font-size: var(--mtdsc-print-font-sm);
@@ -136,8 +143,6 @@ Please use <details> and <summary>, but import '@u-elements/u-details/polyfill'
136
143
  width: calc(var(--mtdsc-print-inner-width) / 3 + 1mm);
137
144
  }
138
145
  @bottom-center {
139
- border-top: 0.3pt solid #68B096;
140
- color: var(--mtdsc-print-first-color);
141
146
  content: var(--mtdsc-print-bottom-center);
142
147
  font-family: var(--mtdsc-print-font-family);
143
148
  font-size: var(--mtdsc-print-font-sm);
@@ -149,8 +154,6 @@ Please use <details> and <summary>, but import '@u-elements/u-details/polyfill'
149
154
  width: calc(var(--mtdsc-print-inner-width) / 3 + 1mm);
150
155
  }
151
156
  @bottom-right {
152
- border-top: 0.3pt solid #68B096;
153
- color: var(--mtdsc-print-first-color);
154
157
  content: var(--mtdsc-print-bottom-right);
155
158
  font-family: var(--mtdsc-print-font-family);
156
159
  font-size: var(--mtdsc-print-font-sm);
@@ -161,22 +164,49 @@ Please use <details> and <summary>, but import '@u-elements/u-details/polyfill'
161
164
  white-space: pre-wrap;
162
165
  width: calc(var(--mtdsc-print-inner-width) / 3);
163
166
  }
164
- }`,X={passive:!0,capture:!0},$=()=>typeof window<"u"&&typeof document<"u",ts=()=>$()&&/^Win/i.test(navigator.userAgentData?.platform||navigator.platform),fe=typeof HTMLElement>"u"?class{}:HTMLElement;function kt(t,e){let n;return function(...o){clearTimeout(n),n=setTimeout(()=>t.apply(this,o),e)}}const Tt=(t,...e)=>typeof window>"u"||window.dsWarnings===!1||console.warn(`Designsystemet: ${t}`,...e),y=(t,e,n)=>n===void 0?t.getAttribute(e)??null:(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),Ao=t=>{let e=(t.closest("[lang]")||document.documentElement)?.getAttribute("lang")?.toLowerCase().split("-")[0]||"";return e||console.warn("Designsystemet: Missing lang attribute on <html> element"),e==="nb"||e==="nn"||e==="no"},V=(t,...e)=>{let[n,...o]=e;for(let i of n.split(" "))t.addEventListener(i,...o);return()=>pn(t,...e)},pn=(t,...e)=>{let[n,...o]=e;for(let i of n.split(" "))t.removeEventListener(i,...o)},At=(t,e)=>{if(!$())return;window._dsHotReloadCleanup||(window._dsHotReloadCleanup=new Map);let n=()=>{window._dsHotReloadCleanup?.get(t)?.map(o=>o()),window._dsHotReloadCleanup?.set(t,e())};document.readyState==="complete"?document.fonts?.ready?.then(n)||setTimeout(n,0):V(window,"load",n)},Lt=(t,e,n)=>{let o=0,i=()=>{if(!$())return r();e(a),a.takeRecords(),o=0},r=()=>a?.disconnect?.(),a=new MutationObserver(()=>{o||=requestAnimationFrame(i)});return a.observe(t,n),i(),r};if($()){let t=!1,e=document.createElement("dialog");e.addEventListener("beforetoggle",n=>{t="source"in n}),e.show(),t||Object.defineProperty(ToggleEvent.prototype,"source",{configurable:!0,enumerable:!0,get(){let n=this.target.id,o=this.target.getRootNode(),i=`[popovertarget="${n}"],[commandfor="${n}"]`;return n?o?.querySelector?.(i):null}})}const Lo=(t,e)=>{let n=document.createElement(t);if(e)for(let[o,i]of Object.entries(e))y(n,o,i);return n},tt={define:(t,e)=>!$()||window.customElements.get(t)||window.customElements.define(t,e)};let es=0;const ns=`${Date.now().toString(36)}${Math.random().toString(36).slice(2,5)}`;function ct(t){return t&&!t.id&&(t.id=`${ns}${++es}`),t?.id||""}let R,he,Co=0,Oo=0;const mn="data-color",os=`[${mn}]`,fn="data-color-scheme",is=`[${fn}]`,Mo=t=>{R=t||void 0},rs=kt(()=>{for(let t of document.querySelectorAll("[data-tooltip]")){let e=t.textContent?.trim(),n=y(t,"data-tooltip");y(t,e?"aria-description":"aria-label",n),t.matches("a,button,input,label,select,textarea,[tabindex]")||console.log('Designsystemet: Missing tabindex="0" attribute on: ',t)}},200),Io=({type:t,target:e})=>{if(clearTimeout(Co),R||=document.querySelector("[data-tooltip-element]")||Lo("div",{class:"ds-tooltip"}),!R||e===R)return;if(t==="mouseover"&&!he){Co=setTimeout(Io,300,{target:e});return}let n=e?.closest?.("[data-tooltip]");if(n===he)return;if(R.isConnected||document.body.appendChild(R),y(R,"popover","manual"),!n)return R?.hidePopover();let o=n.closest(os),i=n.closest(is),r=o!==i&&o?.contains(i);clearTimeout(Oo),y(R,fn,i?.getAttribute(fn)),y(R,mn,r?null:o?.getAttribute(mn)),R.textContent=y(n,"data-tooltip"),R.showPopover(),R.dispatchEvent(new CustomEvent("ds-toggle-source",{detail:n})),he=n},No=t=>{if(t?.type==="keydown")return t?.key==="Escape"&&R?.hidePopover();t?t.target===R&&t.newState==="closed"&&(Oo=setTimeout(No,300)):he=void 0};At("tooltip",()=>[V(document,"blur focus mouseover",Io,X),V(document,"toggle keydown",No,X),Lt(document,rs,{attributeFilter:["data-tooltip"],attributes:!0,childList:!0,subtree:!0})]);const hn="data-toggle-group",Ro=`[${hn}]`,as=kt(()=>{for(let t of document.querySelectorAll(Ro))y(t,"aria-label",y(t,hn))},200),ss=t=>{let e=t.target instanceof HTMLInputElement&&t.target.closest(Ro);if(e&&(t.key==="Enter"&&t.target.click(),t.key?.startsWith("Arrow"))){t.preventDefault?.();let n=e.getElementsByTagName("input"),o=[...n].indexOf(t.target),i=t.key.match(/Arrow(Right|Down)/)?1:-1;n[(n.length+o+i)%n.length]?.focus()}};At("toggle-group",()=>[V(document,"keydown",ss),Lt(document,as,{attributeFilter:[hn],attributes:!0,childList:!0,subtree:!0})]);const Ct=Math.min,U=Math.max,ge=Math.round,ve=Math.floor,Z=t=>({x:t,y:t}),ls={left:"right",right:"left",bottom:"top",top:"bottom"},cs={start:"end",end:"start"};function qo(t,e,n){return U(t,Ct(e,n))}function dt(t,e){return typeof t=="function"?t(e):t}function et(t){return t.split("-")[0]}function qt(t){return t.split("-")[1]}function gn(t){return t==="x"?"y":"x"}function Wo(t){return t==="y"?"height":"width"}const ds=new Set(["top","bottom"]);function K(t){return ds.has(et(t))?"y":"x"}function Po(t){return gn(K(t))}function us(t,e,n){n===void 0&&(n=!1);const o=qt(t),i=Po(t),r=Wo(i);let a=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(a=be(a)),[a,be(a)]}function ps(t){const e=be(t);return[vn(t),e,vn(e)]}function vn(t){return t.replace(/start|end/g,e=>cs[e])}const Vo=["left","right"],Uo=["right","left"],ms=["top","bottom"],fs=["bottom","top"];function hs(t,e,n){switch(t){case"top":case"bottom":return n?e?Uo:Vo:e?Vo:Uo;case"left":case"right":return e?ms:fs;default:return[]}}function gs(t,e,n,o){const i=qt(t);let r=hs(et(t),n==="start",o);return i&&(r=r.map(a=>a+"-"+i),e&&(r=r.concat(r.map(vn)))),r}function be(t){return t.replace(/left|right|bottom|top/g,e=>ls[e])}function vs(t){return{top:0,right:0,bottom:0,left:0,...t}}function bs(t){return typeof t!="number"?vs(t):{top:t,right:t,bottom:t,left:t}}function we(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Do(t,e,n){let{reference:o,floating:i}=t;const r=K(e),a=Po(e),s=Wo(a),l=et(e),c=r==="y",d=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,p=o[s]/2-i[s]/2;let m;switch(l){case"top":m={x:d,y:o.y-i.height};break;case"bottom":m={x:d,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:u};break;case"left":m={x:o.x-i.width,y:u};break;default:m={x:o.x,y:o.y}}switch(qt(e)){case"start":m[a]-=p*(n&&c?-1:1);break;case"end":m[a]+=p*(n&&c?-1:1);break}return m}const ws=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:a}=n,s=r.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:u}=Do(c,o,l),p=o,m={},b=0;for(let f=0;f<s.length;f++){const{name:g,fn:h}=s[f],{x:w,y:E,data:x,reset:S}=await h({x:d,y:u,initialPlacement:o,placement:p,strategy:i,middlewareData:m,rects:c,platform:a,elements:{reference:t,floating:e}});d=w??d,u=E??u,m={...m,[g]:{...m[g],...x}},S&&b<=50&&(b++,typeof S=="object"&&(S.placement&&(p=S.placement),S.rects&&(c=S.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:i}):S.rects),{x:d,y:u}=Do(c,p,l)),f=-1)}return{x:d,y:u,placement:p,strategy:i,middlewareData:m}};async function bn(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:r,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:m=0}=dt(e,t),b=bs(m),g=s[p?u==="floating"?"reference":"floating":u],h=we(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(g)))==null||n?g:g.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),w=u==="floating"?{x:o,y:i,width:a.floating.width,height:a.floating.height}:a.reference,E=await(r.getOffsetParent==null?void 0:r.getOffsetParent(s.floating)),x=await(r.isElement==null?void 0:r.isElement(E))?await(r.getScale==null?void 0:r.getScale(E))||{x:1,y:1}:{x:1,y:1},S=we(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:E,strategy:l}):w);return{top:(h.top-S.top+b.top)/x.y,bottom:(S.bottom-h.bottom+b.bottom)/x.y,left:(h.left-S.left+b.left)/x.x,right:(S.right-h.right+b.right)/x.x}}const ys=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:a,initialPlacement:s,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:f=!0,...g}=dt(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const h=et(i),w=K(s),E=et(s)===s,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=p||(E||!f?[be(s)]:ps(s)),A=b!=="none";!p&&A&&S.push(...gs(s,f,b,x));const I=[s,...S],F=await bn(e,g),bt=[];let ot=((o=r.flip)==null?void 0:o.overflows)||[];if(d&&bt.push(F[h]),u){const wt=us(i,a,x);bt.push(F[wt[0]],F[wt[1]])}if(ot=[...ot,{placement:i,overflows:bt}],!bt.every(wt=>wt<=0)){var Zt,Kt;const wt=(((Zt=r.flip)==null?void 0:Zt.index)||0)+1,Yn=I[wt];if(Yn&&(!(u==="alignment"?w!==K(Yn):!1)||ot.every(j=>K(j.placement)===w?j.overflows[0]>0:!0)))return{data:{index:wt,overflows:ot},reset:{placement:Yn}};let Qt=(Kt=ot.filter(yt=>yt.overflows[0]<=0).sort((yt,j)=>yt.overflows[1]-j.overflows[1])[0])==null?void 0:Kt.placement;if(!Qt)switch(m){case"bestFit":{var Yt;const yt=(Yt=ot.filter(j=>{if(A){const at=K(j.placement);return at===w||at==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(at=>at>0).reduce((at,Pd)=>at+Pd,0)]).sort((j,at)=>j[1]-at[1])[0])==null?void 0:Yt[0];yt&&(Qt=yt);break}case"initialPlacement":Qt=s;break}if(i!==Qt)return{reset:{placement:Qt}}}return{}}}},zo=new Set(["left","top"]);async function xs(t,e){const{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),a=et(n),s=qt(n),l=K(n)==="y",c=zo.has(a)?-1:1,d=r&&l?-1:1,u=dt(e,t);let{mainAxis:p,crossAxis:m,alignmentAxis:b}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&typeof b=="number"&&(m=s==="end"?b*-1:b),l?{x:m*d,y:p*c}:{x:p*c,y:m*d}}const Es=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:a,middlewareData:s}=e,l=await xs(e,t);return a===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:a}}}}},Ss=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:r=!0,crossAxis:a=!1,limiter:s={fn:g=>{let{x:h,y:w}=g;return{x:h,y:w}}},...l}=dt(t,e),c={x:n,y:o},d=await bn(e,l),u=K(et(i)),p=gn(u);let m=c[p],b=c[u];if(r){const g=p==="y"?"top":"left",h=p==="y"?"bottom":"right",w=m+d[g],E=m-d[h];m=qo(w,m,E)}if(a){const g=u==="y"?"top":"left",h=u==="y"?"bottom":"right",w=b+d[g],E=b-d[h];b=qo(w,b,E)}const f=s.fn({...e,[p]:m,[u]:b});return{...f,data:{x:f.x-n,y:f.y-o,enabled:{[p]:r,[u]:a}}}}}},ks=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:i,rects:r,middlewareData:a}=e,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=dt(t,e),d={x:n,y:o},u=K(i),p=gn(u);let m=d[p],b=d[u];const f=dt(s,e),g=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(l){const E=p==="y"?"height":"width",x=r.reference[p]-r.floating[E]+g.mainAxis,S=r.reference[p]+r.reference[E]-g.mainAxis;m<x?m=x:m>S&&(m=S)}if(c){var h,w;const E=p==="y"?"width":"height",x=zo.has(et(i)),S=r.reference[u]-r.floating[E]+(x&&((h=a.offset)==null?void 0:h[u])||0)+(x?0:g.crossAxis),A=r.reference[u]+r.reference[E]+(x?0:((w=a.offset)==null?void 0:w[u])||0)-(x?g.crossAxis:0);b<S?b=S:b>A&&(b=A)}return{[p]:m,[u]:b}}}},Ts=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:r,platform:a,elements:s}=e,{apply:l=()=>{},...c}=dt(t,e),d=await bn(e,c),u=et(i),p=qt(i),m=K(i)==="y",{width:b,height:f}=r.floating;let g,h;u==="top"||u==="bottom"?(g=u,h=p===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(h=u,g=p==="end"?"top":"bottom");const w=f-d.top-d.bottom,E=b-d.left-d.right,x=Ct(f-d[g],w),S=Ct(b-d[h],E),A=!e.middlewareData.shift;let I=x,F=S;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(F=E),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(I=w),A&&!p){const ot=U(d.left,0),Zt=U(d.right,0),Kt=U(d.top,0),Yt=U(d.bottom,0);m?F=b-2*(ot!==0||Zt!==0?ot+Zt:U(d.left,d.right)):I=f-2*(Kt!==0||Yt!==0?Kt+Yt:U(d.top,d.bottom))}await l({...e,availableWidth:F,availableHeight:I});const bt=await a.getDimensions(s.floating);return b!==bt.width||f!==bt.height?{reset:{rects:!0}}:{}}}};function ye(){return typeof window<"u"}function Ot(t){return Fo(t)?(t.nodeName||"").toLowerCase():"#document"}function D(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Y(t){var e;return(e=(Fo(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Fo(t){return ye()?t instanceof Node||t instanceof D(t).Node:!1}function B(t){return ye()?t instanceof Element||t instanceof D(t).Element:!1}function Q(t){return ye()?t instanceof HTMLElement||t instanceof D(t).HTMLElement:!1}function Bo(t){return!ye()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof D(t).ShadowRoot}const As=new Set(["inline","contents"]);function Wt(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=G(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!As.has(i)}const Ls=new Set(["table","td","th"]);function Cs(t){return Ls.has(Ot(t))}const Os=[":popover-open",":modal"];function xe(t){return Os.some(e=>{try{return t.matches(e)}catch{return!1}})}const Ms=["transform","translate","scale","rotate","perspective"],Is=["transform","translate","scale","rotate","perspective","filter"],Ns=["paint","layout","strict","content"];function wn(t){const e=yn(),n=B(t)?G(t):t;return Ms.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Is.some(o=>(n.willChange||"").includes(o))||Ns.some(o=>(n.contain||"").includes(o))}function Rs(t){let e=it(t);for(;Q(e)&&!Mt(e);){if(wn(e))return e;if(xe(e))return null;e=it(e)}return null}function yn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const qs=new Set(["html","body","#document"]);function Mt(t){return qs.has(Ot(t))}function G(t){return D(t).getComputedStyle(t)}function Ee(t){return B(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function it(t){if(Ot(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Bo(t)&&t.host||Y(t);return Bo(e)?e.host:e}function Go(t){const e=it(t);return Mt(e)?t.ownerDocument?t.ownerDocument.body:t.body:Q(e)&&Wt(e)?e:Go(e)}function Pt(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Go(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),a=D(i);if(r){const s=xn(a);return e.concat(a,a.visualViewport||[],Wt(i)?i:[],s&&n?Pt(s):[])}return e.concat(i,Pt(i,[],n))}function xn(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Jo(t){const e=G(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=Q(t),r=i?t.offsetWidth:n,a=i?t.offsetHeight:o,s=ge(n)!==r||ge(o)!==a;return s&&(n=r,o=a),{width:n,height:o,$:s}}function En(t){return B(t)?t:t.contextElement}function It(t){const e=En(t);if(!Q(e))return Z(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=Jo(e);let a=(r?ge(n.width):n.width)/o,s=(r?ge(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Ws=Z(0);function Ho(t){const e=D(t);return!yn()||!e.visualViewport?Ws:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ps(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==D(t)?!1:e}function ut(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=En(t);let a=Z(1);e&&(o?B(o)&&(a=It(o)):a=It(t));const s=Ps(r,n,o)?Ho(r):Z(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,d=i.width/a.x,u=i.height/a.y;if(r){const p=D(r),m=o&&B(o)?D(o):o;let b=p,f=xn(b);for(;f&&o&&m!==b;){const g=It(f),h=f.getBoundingClientRect(),w=G(f),E=h.left+(f.clientLeft+parseFloat(w.paddingLeft))*g.x,x=h.top+(f.clientTop+parseFloat(w.paddingTop))*g.y;l*=g.x,c*=g.y,d*=g.x,u*=g.y,l+=E,c+=x,b=D(f),f=xn(b)}}return we({width:d,height:u,x:l,y:c})}function Se(t,e){const n=Ee(t).scrollLeft;return e?e.left+n:ut(Y(t)).left+n}function jo(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-Se(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function Vs(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r=i==="fixed",a=Y(o),s=e?xe(e.floating):!1;if(o===a||s&&r)return n;let l={scrollLeft:0,scrollTop:0},c=Z(1);const d=Z(0),u=Q(o);if((u||!u&&!r)&&((Ot(o)!=="body"||Wt(a))&&(l=Ee(o)),Q(o))){const m=ut(o);c=It(o),d.x=m.x+o.clientLeft,d.y=m.y+o.clientTop}const p=a&&!u&&!r?jo(a,l):Z(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+p.x,y:n.y*c.y-l.scrollTop*c.y+d.y+p.y}}function Us(t){return Array.from(t.getClientRects())}function Ds(t){const e=Y(t),n=Ee(t),o=t.ownerDocument.body,i=U(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=U(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+Se(t);const s=-n.scrollTop;return G(o).direction==="rtl"&&(a+=U(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:a,y:s}}const Xo=25;function zs(t,e){const n=D(t),o=Y(t),i=n.visualViewport;let r=o.clientWidth,a=o.clientHeight,s=0,l=0;if(i){r=i.width,a=i.height;const d=yn();(!d||d&&e==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}const c=Se(o);if(c<=0){const d=o.ownerDocument,u=d.body,p=getComputedStyle(u),m=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,b=Math.abs(o.clientWidth-u.clientWidth-m);b<=Xo&&(r-=b)}else c<=Xo&&(r+=c);return{width:r,height:a,x:s,y:l}}const Fs=new Set(["absolute","fixed"]);function Bs(t,e){const n=ut(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=Q(t)?It(t):Z(1),a=t.clientWidth*r.x,s=t.clientHeight*r.y,l=i*r.x,c=o*r.y;return{width:a,height:s,x:l,y:c}}function Zo(t,e,n){let o;if(e==="viewport")o=zs(t,n);else if(e==="document")o=Ds(Y(t));else if(B(e))o=Bs(e,n);else{const i=Ho(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return we(o)}function Ko(t,e){const n=it(t);return n===e||!B(n)||Mt(n)?!1:G(n).position==="fixed"||Ko(n,e)}function Gs(t,e){const n=e.get(t);if(n)return n;let o=Pt(t,[],!1).filter(s=>B(s)&&Ot(s)!=="body"),i=null;const r=G(t).position==="fixed";let a=r?it(t):t;for(;B(a)&&!Mt(a);){const s=G(a),l=wn(a);!l&&s.position==="fixed"&&(i=null),(r?!l&&!i:!l&&s.position==="static"&&!!i&&Fs.has(i.position)||Wt(a)&&!l&&Ko(t,a))?o=o.filter(d=>d!==a):i=s,a=it(a)}return e.set(t,o),o}function Js(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const a=[...n==="clippingAncestors"?xe(e)?[]:Gs(e,this._c):[].concat(n),o],s=a[0],l=a.reduce((c,d)=>{const u=Zo(e,d,i);return c.top=U(u.top,c.top),c.right=Ct(u.right,c.right),c.bottom=Ct(u.bottom,c.bottom),c.left=U(u.left,c.left),c},Zo(e,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Hs(t){const{width:e,height:n}=Jo(t);return{width:e,height:n}}function js(t,e,n){const o=Q(e),i=Y(e),r=n==="fixed",a=ut(t,!0,r,e);let s={scrollLeft:0,scrollTop:0};const l=Z(0);function c(){l.x=Se(i)}if(o||!o&&!r)if((Ot(e)!=="body"||Wt(i))&&(s=Ee(e)),o){const m=ut(e,!0,r,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}else i&&c();r&&!o&&i&&c();const d=i&&!o&&!r?jo(i,s):Z(0),u=a.left+s.scrollLeft-l.x-d.x,p=a.top+s.scrollTop-l.y-d.y;return{x:u,y:p,width:a.width,height:a.height}}function Sn(t){return G(t).position==="static"}function Yo(t,e){if(!Q(t)||G(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Y(t)===n&&(n=n.ownerDocument.body),n}function Qo(t,e){const n=D(t);if(xe(t))return n;if(!Q(t)){let i=it(t);for(;i&&!Mt(i);){if(B(i)&&!Sn(i))return i;i=it(i)}return n}let o=Yo(t,e);for(;o&&Cs(o)&&Sn(o);)o=Yo(o,e);return o&&Mt(o)&&Sn(o)&&!wn(o)?n:o||Rs(t)||n}const Xs=async function(t){const e=this.getOffsetParent||Qo,n=this.getDimensions,o=await n(t.floating);return{reference:js(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Zs(t){return G(t).direction==="rtl"}const Ks={convertOffsetParentRelativeRectToViewportRelativeRect:Vs,getDocumentElement:Y,getClippingRect:Js,getOffsetParent:Qo,getElementRects:Xs,getClientRects:Us,getDimensions:Hs,getScale:It,isElement:B,isRTL:Zs};function _o(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Ys(t,e){let n=null,o;const i=Y(t);function r(){var s;clearTimeout(o),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),r();const c=t.getBoundingClientRect(),{left:d,top:u,width:p,height:m}=c;if(s||e(),!p||!m)return;const b=ve(u),f=ve(i.clientWidth-(d+p)),g=ve(i.clientHeight-(u+m)),h=ve(d),E={rootMargin:-b+"px "+-f+"px "+-g+"px "+-h+"px",threshold:U(0,Ct(1,l))||1};let x=!0;function S(A){const I=A[0].intersectionRatio;if(I!==l){if(!x)return a();I?a(!1,I):o=setTimeout(()=>{a(!1,1e-7)},1e3)}I===1&&!_o(c,t.getBoundingClientRect())&&a(),x=!1}try{n=new IntersectionObserver(S,{...E,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,E)}n.observe(t)}return a(!0),r}function Qs(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,c=En(t),d=i||r?[...c?Pt(c):[],...Pt(e)]:[];d.forEach(h=>{i&&h.addEventListener("scroll",n,{passive:!0}),r&&h.addEventListener("resize",n)});const u=c&&s?Ys(c,n):null;let p=-1,m=null;a&&(m=new ResizeObserver(h=>{let[w]=h;w&&w.target===c&&m&&(m.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var E;(E=m)==null||E.observe(e)})),n()}),c&&!l&&m.observe(c),m.observe(e));let b,f=l?ut(t):null;l&&g();function g(){const h=ut(t);f&&!_o(f,h)&&n(),f=h,b=requestAnimationFrame(g)}return n(),()=>{var h;d.forEach(w=>{i&&w.removeEventListener("scroll",n),r&&w.removeEventListener("resize",n)}),u?.(),(h=m)==null||h.disconnect(),m=null,l&&cancelAnimationFrame(b)}}const _s=Es,$s=Ss,tl=ys,el=Ts,nl=ks,ol=(t,e,n)=>{const o=new Map,i={platform:Ks,...n},r={...i.platform,_c:o};return ws(t,e,{...i,platform:r})},$o="data-placement",ti="data-autoplacement",Vt=new Map;function il(t){let{newState:e,oldState:n,target:o,source:i=t.detail}=t,r=o instanceof HTMLElement&&ei(o,"--_ds-floating");if(!r)return;if(e==="closed")return Vt.get(o)?.();if(!i||i===o||n&&n===e)return;let a=ei(o,"--_ds-floating-overscroll"),s=y(o,$o)||y(i,$o)||r,l=y(o,ti)||y(i,ti),c=parseFloat(getComputedStyle(o,"::before").height)||0,d=i[`offset${s.match(/left|right/gi)?"Height":"Width"}`]/2+c,u={strategy:"absolute",placement:s,middleware:[_s(c),$s({padding:10,limiter:nl({offset:{mainAxis:d}})}),al(),...l==="false"?[]:[tl({padding:10,crossAxis:!1})],...a?[el({apply({availableHeight:m}){a==="fit"&&(o.style.width=`${i.clientWidth}px`),o.style.maxHeight=`${Math.max(50,m-20)}px`}})]:[]]},p=Qs(i,o,async()=>{if(!i?.isConnected)return Vt.get(o)?.();let{x:m,y:b}=await ol(i,o,u);o.style.translate=`${m}px ${b}px`});Vt.set(o,()=>Vt.delete(o)&&p())}let ke;const rl=({type:t})=>{if(t==="mousedown"&&(ke=!1),t==="scroll"&&ke===!1&&(ke=!0),t==="mouseup"&&ke)for(let[e]of Vt)e.showPopover()};At("popover",()=>[V(document,"mousedown scroll mouseup",rl,!0),V(document,"toggle ds-toggle-source",il,X)]);const ei=(t,e)=>getComputedStyle(t).getPropertyValue(e).trim(),al=()=>({name:"arrowPseudo",fn(t){let e=t.elements.floating,n=t.rects.reference,o=`${Math.round(n.width/2+n.x-t.x)}px`,i=`${Math.round(n.height/2+n.y-t.y)}px`;return e.style.setProperty("--_ds-floating-arrow-x",o),e.style.setProperty("--_ds-floating-arrow-y",i),y(e,"data-floating",t.placement),t}});let kn=!1;const sl=({type:t,target:e,clientX:n=0,clientY:o=0})=>{if(t==="pointerdown"){let i=e?.closest?.("dialog")?.getBoundingClientRect();kn=!!(i&&i.top<=o&&o<=i.bottom&&i.left<=n&&n<=i.right)}else{let i=e instanceof HTMLDialogElement&&!kn&&y(e,"closedby")==="any";kn=!1,i&&requestAnimationFrame(()=>e.open&&e.close())}};At("dialog-closedby",()=>[V(document,"pointerdown pointerup",sl,X)]);const ni=":click-delegate-hover",oi="data-clickdelegatefor",ll=`[${oi}]`,cl=t=>{let e=t.button===1||t.metaKey||t.ctrlKey,n=t.isTrusted&&t.button<2&&ii(t);n instanceof HTMLAnchorElement&&e?window.open(n.href,void 0,n.rel):n instanceof HTMLElement&&!n.contains(t.target)&&(t.stopImmediatePropagation(),n.click())};let Te;const dl=t=>{let e=ii(t);Te!==e&&(Te&&Te.classList.remove(ni),e&&e.classList.add(ni),Te=e)},ii=({target:t})=>{let e=(t instanceof Element?t.closest(ll):null)?.getAttribute(oi),n=document.getElementById(e||""),o=n&&t.closest('a,button,label,input,select,textarea,details,dialog,[role="button"],[popover],[contenteditable]');return(!o||o===n)&&n||void 0};At("clickdelegatefor",()=>[V(window,"click auxclick",cl,!0),V(document,"mouseover",dl,X)]);const Nt="aria-label",Ae="data-label";var ri=class extends fe{_items;_unresize;_unmutate;static get observedAttributes(){return[Nt]}connectedCallback(){!y(this,Ae)&&!y(this,Nt)&&(Ao(this)?y(this,Nt,"Du er her"):Tt("Missing aria-label on:",this));let e=kt(this.attributeChangedCallback.bind(this),100);this._items=this.getElementsByTagName("a"),this._unresize=V(window,"resize",e),this._unmutate=Lt(this,e,{childList:!0,subtree:!0})}attributeChangedCallback(){let e=this._items?.[this._items.length-1],n=e?.parentElement===this?null:e,o=!n?.offsetHeight,i=y(this,Ae),r=y(this,Nt);y(this,"role",o?null:"navigation"),o&&!i&&r?(y(this,Ae,r),y(this,Nt,null)):!o&&i&&!r&&(y(this,Nt,i),y(this,Ae,null));for(let a of this._items||[])y(a,"aria-current",a===n?"page":null)}disconnectedCallback(){this._unresize?.(),this._unmutate?.(),this._unresize=this._unmutate=this._items=void 0}};tt.define("ds-breadcrumbs",ri);var ai=class extends fe{connectedCallback(){V(this,"animationend",this,X),requestAnimationFrame(()=>this.handleEvent({target:this}))}handleEvent({target:e}){if(e!==this)return;let n=this.querySelector("h2,h3,h4,h5,h6");n&&y(n,"aria-labelledby",ct(n)),y(this,"tabindex","-1"),this.focus()}disconnectedCallback(){pn(this,"animationend",this,X)}};tt.define("ds-error-summary",ai);const Tn=new Set,si=new WeakMap,ul=$()?document.getElementsByTagName("fieldset"):[],pl=$()&&CSS.supports("field-sizing","content"),ml=ts()?800:200,fl={over:"%d tegn for mye",under:"%d tegn igjen"},li=kt(()=>{for(let t of ul)y(t,"aria-labelledby",`${ct(t.querySelector("legend"))} ${ct(t.querySelector(':scope > :is([data-field="description"],legend + p)'))}`.trim());for(let t of Tn){let e=[],n=[],o,i,r=!1;for(let a of t.getElementsByTagName("*"))if(a instanceof HTMLLabelElement)n.push(a);else if(gl(a))o&&Tt("Fields should only have one input element. Use <fieldset> to group multiple fields:",t),An(a)&&a.type!=="hidden"&&(o=a);else if(An(a)){let s=a.getAttribute("data-field");s==="counter"&&(i=a),s==="validation"?(e.unshift(a),r||=di(a)):s&&e.push(a)}if(!o)Tt("Field is missing input element:",t);else{i&&si.set(o,i);for(let l of n)y(l,"for",ct(o));let a=o.type==="radio"||o.type==="checkbox",s=t.closest("fieldset")?.querySelector(':scope > [data-field="validation"]');An(s)&&(r||=di(s),e.unshift(s)),y(t,"data-clickdelegatefor",a?ct(o):null),y(o,"aria-describedby",e.map(ct).join(" ")),y(o,"aria-invalid",`${r}`),ci(o)}}},100),Ut=$()?Lo("div",{"aria-live":"polite",style:"position:fixed;white-space:nowrap;clip:rect(0 0 0 0)"}):null,ci=t=>{let e=t.target||t,n=si.get(e);if(n?.isConnected){let o=(Number(y(n,"data-limit"))||0)-e.value.length,i=o<0?"over":"under",r=(y(n,`data-${i}`)||fl[i]).replace("%d",`${Math.abs(o)}`);y(n,"aria-label",r),y(n,"data-state",i),y(n,"data-color",o<0?"danger":null),t.type==="input"&&Ut&&(Ut?.isConnected||document.body.appendChild(Ut),hl(e,r))}!pl&&e instanceof HTMLTextAreaElement&&(e.style.setProperty("--_ds-field-sizing","auto"),e.style.setProperty("--_ds-field-sizing",`${e.scrollHeight}px`))},hl=kt((t,e)=>{let n=t.getRootNode();Ut&&n?.activeElement===t&&(Ut.textContent=e)},ml),di=t=>y(t,"data-color")!=="success",An=t=>!!t&&!t.hidden,gl=t=>t instanceof HTMLElement&&"validity"in t&&!(t instanceof HTMLButtonElement);var Le=class extends fe{connectedCallback(){Tn.add(this),li()}disconnectedCallback(){Tn.delete(this)}};tt.define("ds-field",Le),At("field",()=>[V(document,"input ds-field-update",ci,X),Lt(document,li,{attributeFilter:["hidden","data-field"],attributes:!0,childList:!0,subtree:!0})]);const Ln="aria-label",Dt="data-current",zt="data-total",ui="data-href",pi=({current:t=1,total:e=10,show:n=7})=>({prev:t>1?t-1:0,next:t<e?t+1:0,pages:vl(t,e,n).map((o,i)=>({current:o===t&&"page",key:`key-${o}-${i}`,page:o}))});var mi=class extends fe{_unmutate;static get observedAttributes(){return[Dt,zt]}connectedCallback(){let e=y(this,zt),n=y(this,Dt);n&&!e&&Tt(`Missing ${zt} attribute on:`,this),e&&!n&&Tt(`Missing ${Dt} attribute on:`,this),y(this,Ln)||(Ao(this)?y(this,Ln,"Bla i sider"):Tt(`Missing ${Ln} attribute on:`,this)),y(this,"role","navigation"),this._unmutate=Lt(this,this.render.bind(this),{attributeFilter:[Dt,zt,ui],attributes:!0,childList:!0,subtree:!0})}disconnectedCallback(){this._unmutate?.(),this._unmutate=void 0}render(){let e=this.querySelectorAll("button,a"),n=y(this,ui),o=Number(y(this,Dt)),i=Number(y(this,zt)),r=e.length-2;if(o&&i){let{next:a,prev:s,pages:l}=pi({current:o,total:i,show:r});e.forEach((c,d)=>{let u=d?e[d+1]?l[d-1]?.page:a:s;y(c,"aria-current",l[d-1]?.current?"true":null),y(c,"aria-hidden",u?null:"true"),y(c,"data-page",`${u}`),y(c,"role",u?null:"none"),y(c,"tabindex",u?null:"-1"),c instanceof HTMLButtonElement&&y(c,"value",`${u}`),n&&y(c,"href",n.replace("%d",`${u}`))})}}};const vl=(t,e,n=1/0)=>{let o=(n-1)/2,i=Math.max(Math.min(t-Math.floor(o),e-n+1),1),r=Math.min(Math.max(t+Math.ceil(o),n),e),a=Array.from({length:r+1-i},(s,l)=>l+i);return n>4&&i>1&&a.splice(0,2,1,0),n>3&&r<e&&a.splice(-2,2,0,e),a};tt.define("ds-pagination",mi);var fi=class extends Je{_unmutate;connectedCallback(){super.connectedCallback();let t=kt(()=>bl(this),100);this._unmutate=Lt(this,t,{childList:!0,subtree:!0}),V(this,"toggle",hi,X),t()}disconnectedCallback(){super.disconnectedCallback(),this._unmutate?.(),this._unmutate=void 0,pn(this,"toggle",hi,X)}};const bl=({control:t,list:e})=>{t&&!t.placeholder&&y(t,"placeholder"," "),t&&y(t,"popovertarget",ct(e)||null),e&&y(e,"popover","manual")},hi=t=>{let e=t.currentTarget,n=t.newState==="open"&&e.control;n&&e.list?.dispatchEvent(new CustomEvent("ds-toggle-source",{detail:n}))};tt.define("ds-suggestion",fi);var gi=class extends tn{},vi=class extends en{},bi=class extends on{},wi=class extends an{};tt.define("ds-tabs",gi),tt.define("ds-tablist",vi),tt.define("ds-tab",bi),tt.define("ds-tabpanel",wi);function wl(){return typeof HTMLButtonElement<"u"&&"command"in HTMLButtonElement.prototype&&"source"in((globalThis.CommandEvent||{}).prototype||{})}function yl(){document.addEventListener("invoke",f=>{f.type=="invoke"&&f.isTrusted&&(f.stopImmediatePropagation(),f.preventDefault())},!0),document.addEventListener("command",f=>{f.type=="command"&&f.isTrusted&&(f.stopImmediatePropagation(),f.preventDefault())},!0);function t(f,g,h=!0){Object.defineProperty(f,g,{...Object.getOwnPropertyDescriptor(f,g),enumerable:h})}function e(f){return f&&typeof f.getRootNode=="function"?f.getRootNode():f&&f.parentNode?e(f.parentNode):f}const n=new WeakMap,o=new WeakMap;class i extends Event{constructor(g,h={}){super(g,h);const{source:w,command:E}=h;if(w!=null&&!(w instanceof Element))throw new TypeError("source must be an element");n.set(this,w||null),o.set(this,E!==void 0?String(E):"")}get[Symbol.toStringTag](){return"CommandEvent"}get source(){if(!n.has(this))throw new TypeError("illegal invocation");const g=n.get(this);if(!(g instanceof Element))return null;const h=e(g);return h!==e(this.target||document)?h.host:g}get command(){if(!o.has(this))throw new TypeError("illegal invocation");return o.get(this)}get action(){throw new Error("CommandEvent#action was renamed to CommandEvent#command")}get invoker(){throw new Error("CommandEvent#invoker was renamed to CommandEvent#source")}}t(i.prototype,"source"),t(i.prototype,"command");class r extends Event{constructor(g,h={}){throw super(g,h),new Error("InvokeEvent has been deprecated, it has been renamed to `CommandEvent`")}}const a=new WeakMap;function s(f){Object.defineProperties(f.prototype,{commandForElement:{enumerable:!0,configurable:!0,set(g){if(this.hasAttribute("invokeaction"))throw new TypeError("Element has deprecated `invokeaction` attribute, replace with `command`");if(this.hasAttribute("invoketarget"))throw new TypeError("Element has deprecated `invoketarget` attribute, replace with `commandfor`");if(g===null)this.removeAttribute("commandfor"),a.delete(this);else if(g instanceof Element){this.setAttribute("commandfor","");const h=e(g);e(this)===h||h===this.ownerDocument?a.set(this,g):a.delete(this)}else throw new TypeError("commandForElement must be an element or null")},get(){if(this.localName!=="button")return null;if(this.hasAttribute("invokeaction")||this.hasAttribute("invoketarget"))return console.warn("Element has deprecated `invoketarget` or `invokeaction` attribute, use `commandfor` and `command` instead"),null;if(this.disabled)return null;if(this.form&&this.getAttribute("type")!=="button")return console.warn("Element with `commandFor` is a form participant. It should explicitly set `type=button` in order for `commandFor` to work"),null;const g=a.get(this);if(g)return g.isConnected?g:(a.delete(this),null);const h=e(this),w=this.getAttribute("commandfor");return(h instanceof Document||h instanceof ShadowRoot)&&w&&h.getElementById(w)||null}},command:{enumerable:!0,configurable:!0,get(){const g=this.getAttribute("command")||"";if(g.startsWith("--"))return g;const h=g.toLowerCase();switch(h){case"show-modal":case"request-close":case"close":case"toggle-popover":case"hide-popover":case"show-popover":return h}return""},set(g){this.setAttribute("command",g)}},invokeAction:{enumerable:!1,configurable:!0,get(){throw new Error("invokeAction is deprecated. It has been renamed to command")},set(g){throw new Error("invokeAction is deprecated. It has been renamed to command")}},invokeTargetElement:{enumerable:!1,configurable:!0,get(){throw new Error("invokeTargetElement is deprecated. It has been renamed to command")},set(g){throw new Error("invokeTargetElement is deprecated. It has been renamed to command")}}})}const l=new WeakMap;Object.defineProperties(HTMLElement.prototype,{oncommand:{enumerable:!0,configurable:!0,get(){return d.takeRecords(),l.get(this)||null},set(f){const g=l.get(this)||null;g&&this.removeEventListener("command",g),l.set(this,typeof f=="object"||typeof f=="function"?f:null),typeof f=="function"&&this.addEventListener("command",f)}}});function c(f){for(const g of f)g.oncommand=new Function("event",g.getAttribute("oncommand"))}const d=new MutationObserver(f=>{for(const g of f){const{target:h}=g;g.type==="childList"?c(h.querySelectorAll("[oncommand]")):c([h])}});d.observe(document,{subtree:!0,childList:!0,attributeFilter:["oncommand"]}),c(document.querySelectorAll("[oncommand]"));const u=new WeakSet;function p(f){if(u.has(f)||(u.add(f),f.defaultPrevented)||f.type!=="click")return;const g=f.target.closest("button[invoketarget], button[invokeaction], input[invoketarget], input[invokeaction]");if(g&&(console.warn("Elements with `invoketarget` or `invokeaction` are deprecated and should be renamed to use `commandfor` and `command` respectively"),g.matches("input")))throw new Error("Input elements no longer support `commandfor`");const h=f.target.closest("button[commandfor], button[command]");if(!h)return;if(h.form&&h.getAttribute("type")!=="button")throw f.preventDefault(),new Error("Element with `commandFor` is a form participant. It should explicitly set `type=button` in order for `commandFor` to work. In order for it to act as a Submit button, it must not have command or commandfor attributes");if(h.hasAttribute("command")!==h.hasAttribute("commandfor")){const S=h.hasAttribute("command")?"command":"commandfor",A=h.hasAttribute("command")?"commandfor":"command";throw new Error(`Element with ${S} attribute must also have a ${A} attribute to function.`)}if(h.command!=="show-popover"&&h.command!=="hide-popover"&&h.command!=="toggle-popover"&&h.command!=="show-modal"&&h.command!=="request-close"&&h.command!=="close"&&!h.command.startsWith("--")){console.warn(`"${h.command}" is not a valid command value. Custom commands must begin with --`);return}const w=h.commandForElement;if(!w)return;const E=new i("command",{command:h.command,source:h,cancelable:!0});if(w.dispatchEvent(E),E.defaultPrevented)return;const x=E.command.toLowerCase();if(w.popover){const S=!w.matches(":popover-open");S&&(x==="toggle-popover"||x==="show-popover")?w.showPopover({source:h}):!S&&x==="hide-popover"&&w.hidePopover()}else if(w.localName==="dialog"){const S=!w.hasAttribute("open");S&&x=="show-modal"?w.showModal():!S&&x=="close"?w.close(h.value?h.value:void 0):!S&&x=="request-close"&&(HTMLDialogElement.prototype.requestClose||(HTMLDialogElement.prototype.requestClose=function(){const A=new Event("cancel",{cancelable:!0});this.dispatchEvent(A),A.defaultPrevented||this.close()}),w.requestClose(h.value?h.value:void 0))}}function m(f){f.addEventListener("click",p,!0)}function b(f,g){const h=f.prototype.attachShadow;f.prototype.attachShadow=function(E){const x=h.call(this,E);return g(x),x};const w=f.prototype.attachInternals;f.prototype.attachInternals=function(){const E=w.call(this);return E.shadowRoot&&g(E.shadowRoot),E}}s(HTMLButtonElement),b(HTMLElement,f=>{m(f),d.observe(f,{attributeFilter:["oncommand"]}),c(f.querySelectorAll("[oncommand]"))}),m(document),Object.assign(globalThis,{CommandEvent:i,InvokeEvent:r})}var Ce=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",xl=Ce&&/android/i.test(navigator.userAgent),El=Ce&&/firefox/i.test(navigator.userAgent),yi;Ce&&/^Mac/i.test(((yi=navigator.userAgentData)==null?void 0:yi.platform)||navigator.platform);function xi(t,e,n){return n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}var Oe="__uDetailsPolyfillSummarys";if(Ce&&xl&&El&&!window[Oe]){window[Oe]=document.getElementsByTagName("summary");const t=()=>{if(window[Oe])for(const e of window[Oe]){const n=e.parentElement;xi(e,"role","button"),xi(e,"aria-expanded",`${!!n&&!!n.open}`)}};requestAnimationFrame(t),new MutationObserver(t).observe(document,{attributeFilter:["open"],attributes:!0,childList:!0,subtree:!0})}var Sl=Object.defineProperty,Ei=Object.getOwnPropertySymbols,kl=Object.prototype.hasOwnProperty,Tl=Object.prototype.propertyIsEnumerable,Si=(t,e,n)=>e in t?Sl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Al=(t,e)=>{for(var n in e||(e={}))kl.call(e,n)&&Si(t,n,e[n]);if(Ei)for(var n of Ei(e))Tl.call(e,n)&&Si(t,n,e[n]);return t},Ft=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",Me=Ft&&/android/i.test(navigator.userAgent),Cn=Ft&&/iPad|iPhone|iPod/.test(navigator.userAgent),ki;Ft&&/^Mac/i.test(((ki=navigator.userAgentData)==null?void 0:ki.platform)||navigator.platform);var Ll=`${Me?"data":"aria"}-labelledby`,Cl=":host(:not([hidden])) { display: block }",Ol="outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color",Ti=typeof HTMLElement>"u"?class{}:HTMLElement;function L(t,e,n){return n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}var Ai=(t,e,n)=>{for(const o of n[0].split(","))n[0]=o,Element.prototype[`${t}EventListener`].apply(e,n)},Bt=(t,...e)=>Ai("add",t,e),Ie=(t,...e)=>Ai("remove",t,e),Ml=(t,e)=>t.shadowRoot||t.attachShadow({mode:"open"}).append(In("slot"),In("style",e)),Ne=new WeakMap,On=(t,e)=>{if(e===void 0)return Ne.get(t);try{Ne.get(t).disconnect(),Ne.delete(t)}catch{}if(e){const n=new MutationObserver(o=>t.handleEvent({type:"mutation",detail:o}));n.observe(t,e),Ne.set(t,n)}},Li=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},Il=0,Mn=t=>t?(t.id||(t.id=`:${t.nodeName.toLowerCase()}${(++Il).toString(32)}`),t.id):"",In=(t,e,n)=>{const o=document.createElement(t);return e&&(o[t==="style"?"textContent":"innerHTML"]=e),o},Ci={define:(t,e)=>!Ft||window.customElements.get(t)||window.customElements.define(t,e)},pt,Nl=0,Oi=t=>{pt||(pt=In("div"),pt.style.cssText="position:fixed;overflow:hidden;width:1px;white-space:nowrap",L(pt,"aria-live","assertive")),pt.isConnected||document.body.append(pt),t&&(pt.textContent=`${t}${Nl++%2?" ":""}`)},Rl=(t,e,n="")=>{var o,i;const r={bubbles:!0,composed:!0,data:e,inputType:n},a=HTMLInputElement.prototype;t.dispatchEvent(new InputEvent("beforeinput",r)),(i=(o=Object.getOwnPropertyDescriptor(a,"value"))==null?void 0:o.set)==null||i.call(t,e),t.dispatchEvent(new InputEvent("input",r)),t.dispatchEvent(new Event("change",{bubbles:!0}))},Nn=!1,Rn=t=>(t?.type==="mouseup"&&(Nn=!1),t?.type==="mousedown"&&(Nn=!0,Bt(document,"mouseup",Rn,{once:!0})),Nn),ql=(t,e="<slot></slot>")=>`<template shadowrootmode="open">${e}<style>${t}</style></template>`,qn="disabled",Gt="selected",Wl=class extends Ti{static get observedAttributes(){return[qn,Gt]}connectedCallback(){Cn||(this.tabIndex=-1),this.hasAttribute("role")||L(this,"role","option"),this.attributeChangedCallback()}attributeChangedCallback(){L(this,"aria-disabled",`${this.disabled}`),L(this,"aria-selected",`${this.selected}`)}get defaultSelected(){return this[Gt]}set defaultSelected(t){this[Gt]=t}get disabled(){return L(this,qn)!==null}set disabled(t){L(this,qn,t?"":null)}get form(){return this.closest("form")}get index(){var t;return[...((t=this.parentElement)==null?void 0:t.options)||[this]].indexOf(this)}get label(){var t;return(t=L(this,"label"))!=null?t:this.text}set label(t){L(this,"label",t)}get selected(){return L(this,Gt)!==null}set selected(t){L(this,Gt,t?"":null)}get text(){var t;return((t=this.textContent)==null?void 0:t.trim())||""}set text(t){this.textContent=t}get value(){var t;return(t=L(this,"value"))!=null?t:this.text}set value(t){L(this,"value",t)}};Ci.define("u-option",Wl);var Wn=`${Cl}
167
+ }
168
+ @page mtds_print_front {
169
+ background: var(--mtdsc-print-front-background);
170
+
171
+ @bottom-left { border-top: var(--mtdsc-print-border); color: var(--mtdsc-print-front-color) }
172
+ @bottom-center { border-top: var(--mtdsc-print-border); color: var(--mtdsc-print-front-color) }
173
+ @bottom-right { border-top: var(--mtdsc-print-border); color: var(--mtdsc-print-front-color) }
174
+ }
175
+
176
+ @page mtds_print_back {
177
+ background: var(--mtdsc-print-back-background);
178
+ margin-bottom: var(--mtdsc-print-footer-height);
179
+
180
+ @bottom-left {
181
+ color: var(--mtdsc-print-back-color);
182
+ content: var(--mtdsc-print-back-footer);
183
+ font-family: var(--mtdsc-print-font-family);
184
+ font-size: var(--mtdsc-print-font-sm);
185
+ line-height: var(--mtdsc-print-line-height);
186
+ padding-top: 5mm;
187
+ text-align: left;
188
+ vertical-align: top;
189
+ white-space: pre-wrap;
190
+ width: calc(var(--mtdsc-print-inner-width) / 3 + 1mm);
191
+ }
192
+ @bottom-center { content: none }
193
+ @bottom-right { content: none }
194
+ }`,j={passive:!0,capture:!0},$=()=>typeof window<"u"&&typeof document<"u",ts=()=>$()&&/^Win/i.test(navigator.userAgentData?.platform||navigator.platform),me=typeof HTMLElement>"u"?class{}:HTMLElement;function kt(t,e){let n;return function(...o){clearTimeout(n),n=setTimeout(()=>t.apply(this,o),e)}}const Tt=(t,...e)=>typeof window>"u"||window.dsWarnings===!1||console.warn(`Designsystemet: ${t}`,...e),y=(t,e,n)=>n===void 0?t.getAttribute(e)??null:(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),Ao=t=>{let e=(t.closest("[lang]")||document.documentElement)?.getAttribute("lang")?.toLowerCase().split("-")[0]||"";return e||console.warn("Designsystemet: Missing lang attribute on <html> element"),e==="nb"||e==="nn"||e==="no"},V=(t,...e)=>{let[n,...o]=e;for(let i of n.split(" "))t.addEventListener(i,...o);return()=>un(t,...e)},un=(t,...e)=>{let[n,...o]=e;for(let i of n.split(" "))t.removeEventListener(i,...o)},At=(t,e)=>{if(!$())return;window._dsHotReloadCleanup||(window._dsHotReloadCleanup=new Map);let n=()=>{window._dsHotReloadCleanup?.get(t)?.map(o=>o()),window._dsHotReloadCleanup?.set(t,e())};document.readyState==="complete"?document.fonts?.ready?.then(n)||setTimeout(n,0):V(window,"load",n)},Lt=(t,e,n)=>{let o=0,i=()=>{if(!$())return r();e(a),a.takeRecords(),o=0},r=()=>a?.disconnect?.(),a=new MutationObserver(()=>{o||=requestAnimationFrame(i)});return a.observe(t,n),i(),r};if($()){let t=!1,e=document.createElement("dialog");e.addEventListener("beforetoggle",n=>{t="source"in n}),e.show(),t||Object.defineProperty(ToggleEvent.prototype,"source",{configurable:!0,enumerable:!0,get(){let n=this.target.id,o=this.target.getRootNode(),i=`[popovertarget="${n}"],[commandfor="${n}"]`;return n?o?.querySelector?.(i):null}})}const Lo=(t,e)=>{let n=document.createElement(t);if(e)for(let[o,i]of Object.entries(e))y(n,o,i);return n},tt={define:(t,e)=>!$()||window.customElements.get(t)||window.customElements.define(t,e)};let es=0;const ns=`${Date.now().toString(36)}${Math.random().toString(36).slice(2,5)}`;function ct(t){return t&&!t.id&&(t.id=`${ns}${++es}`),t?.id||""}let R,fe,Co=0,Mo=0;const pn="data-color",os=`[${pn}]`,mn="data-color-scheme",is=`[${mn}]`,Oo=t=>{R=t||void 0},rs=kt(()=>{for(let t of document.querySelectorAll("[data-tooltip]")){let e=t.textContent?.trim(),n=y(t,"data-tooltip");y(t,e?"aria-description":"aria-label",n),t.matches("a,button,input,label,select,textarea,[tabindex]")||console.log('Designsystemet: Missing tabindex="0" attribute on: ',t)}},200),Io=({type:t,target:e})=>{if(clearTimeout(Co),R||=document.querySelector("[data-tooltip-element]")||Lo("div",{class:"ds-tooltip"}),!R||e===R)return;if(t==="mouseover"&&!fe){Co=setTimeout(Io,300,{target:e});return}let n=e?.closest?.("[data-tooltip]");if(n===fe)return;if(R.isConnected||document.body.appendChild(R),y(R,"popover","manual"),!n)return R?.hidePopover();let o=n.closest(os),i=n.closest(is),r=o!==i&&o?.contains(i);clearTimeout(Mo),y(R,mn,i?.getAttribute(mn)),y(R,pn,r?null:o?.getAttribute(pn)),R.textContent=y(n,"data-tooltip"),R.showPopover(),R.dispatchEvent(new CustomEvent("ds-toggle-source",{detail:n})),fe=n},No=t=>{if(t?.type==="keydown")return t?.key==="Escape"&&R?.hidePopover();t?t.target===R&&t.newState==="closed"&&(Mo=setTimeout(No,300)):fe=void 0};At("tooltip",()=>[V(document,"blur focus mouseover",Io,j),V(document,"toggle keydown",No,j),Lt(document,rs,{attributeFilter:["data-tooltip"],attributes:!0,childList:!0,subtree:!0})]);const fn="data-toggle-group",Ro=`[${fn}]`,as=kt(()=>{for(let t of document.querySelectorAll(Ro))y(t,"aria-label",y(t,fn))},200),ss=t=>{let e=t.target instanceof HTMLInputElement&&t.target.closest(Ro);if(e&&(t.key==="Enter"&&t.target.click(),t.key?.startsWith("Arrow"))){t.preventDefault?.();let n=e.getElementsByTagName("input"),o=[...n].indexOf(t.target),i=t.key.match(/Arrow(Right|Down)/)?1:-1;n[(n.length+o+i)%n.length]?.focus()}};At("toggle-group",()=>[V(document,"keydown",ss),Lt(document,as,{attributeFilter:[fn],attributes:!0,childList:!0,subtree:!0})]);const Ct=Math.min,U=Math.max,he=Math.round,ge=Math.floor,X=t=>({x:t,y:t}),ls={left:"right",right:"left",bottom:"top",top:"bottom"},cs={start:"end",end:"start"};function qo(t,e,n){return U(t,Ct(e,n))}function dt(t,e){return typeof t=="function"?t(e):t}function et(t){return t.split("-")[0]}function qt(t){return t.split("-")[1]}function hn(t){return t==="x"?"y":"x"}function Wo(t){return t==="y"?"height":"width"}const ds=new Set(["top","bottom"]);function Z(t){return ds.has(et(t))?"y":"x"}function Po(t){return hn(Z(t))}function us(t,e,n){n===void 0&&(n=!1);const o=qt(t),i=Po(t),r=Wo(i);let a=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(a=ve(a)),[a,ve(a)]}function ps(t){const e=ve(t);return[gn(t),e,gn(e)]}function gn(t){return t.replace(/start|end/g,e=>cs[e])}const Vo=["left","right"],Uo=["right","left"],ms=["top","bottom"],fs=["bottom","top"];function hs(t,e,n){switch(t){case"top":case"bottom":return n?e?Uo:Vo:e?Vo:Uo;case"left":case"right":return e?ms:fs;default:return[]}}function gs(t,e,n,o){const i=qt(t);let r=hs(et(t),n==="start",o);return i&&(r=r.map(a=>a+"-"+i),e&&(r=r.concat(r.map(gn)))),r}function ve(t){return t.replace(/left|right|bottom|top/g,e=>ls[e])}function vs(t){return{top:0,right:0,bottom:0,left:0,...t}}function bs(t){return typeof t!="number"?vs(t):{top:t,right:t,bottom:t,left:t}}function be(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Do(t,e,n){let{reference:o,floating:i}=t;const r=Z(e),a=Po(e),s=Wo(a),c=et(e),l=r==="y",d=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,p=o[s]/2-i[s]/2;let m;switch(c){case"top":m={x:d,y:o.y-i.height};break;case"bottom":m={x:d,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:u};break;case"left":m={x:o.x-i.width,y:u};break;default:m={x:o.x,y:o.y}}switch(qt(e)){case"start":m[a]-=p*(n&&l?-1:1);break;case"end":m[a]+=p*(n&&l?-1:1);break}return m}const ws=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:a}=n,s=r.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(e));let l=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:u}=Do(l,o,c),p=o,m={},b=0;for(let f=0;f<s.length;f++){const{name:g,fn:h}=s[f],{x:w,y:E,data:x,reset:S}=await h({x:d,y:u,initialPlacement:o,placement:p,strategy:i,middlewareData:m,rects:l,platform:a,elements:{reference:t,floating:e}});d=w??d,u=E??u,m={...m,[g]:{...m[g],...x}},S&&b<=50&&(b++,typeof S=="object"&&(S.placement&&(p=S.placement),S.rects&&(l=S.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:i}):S.rects),{x:d,y:u}=Do(l,p,c)),f=-1)}return{x:d,y:u,placement:p,strategy:i,middlewareData:m}};async function vn(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:r,rects:a,elements:s,strategy:c}=t,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:m=0}=dt(e,t),b=bs(m),g=s[p?u==="floating"?"reference":"floating":u],h=be(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(g)))==null||n?g:g.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(s.floating)),boundary:l,rootBoundary:d,strategy:c})),w=u==="floating"?{x:o,y:i,width:a.floating.width,height:a.floating.height}:a.reference,E=await(r.getOffsetParent==null?void 0:r.getOffsetParent(s.floating)),x=await(r.isElement==null?void 0:r.isElement(E))?await(r.getScale==null?void 0:r.getScale(E))||{x:1,y:1}:{x:1,y:1},S=be(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:E,strategy:c}):w);return{top:(h.top-S.top+b.top)/x.y,bottom:(S.bottom-h.bottom+b.bottom)/x.y,left:(h.left-S.left+b.left)/x.x,right:(S.right-h.right+b.right)/x.x}}const ys=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:a,initialPlacement:s,platform:c,elements:l}=e,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:f=!0,...g}=dt(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const h=et(i),w=Z(s),E=et(s)===s,x=await(c.isRTL==null?void 0:c.isRTL(l.floating)),S=p||(E||!f?[ve(s)]:ps(s)),A=b!=="none";!p&&A&&S.push(...gs(s,f,b,x));const I=[s,...S],F=await vn(e,g),bt=[];let ot=((o=r.flip)==null?void 0:o.overflows)||[];if(d&&bt.push(F[h]),u){const wt=us(i,a,x);bt.push(F[wt[0]],F[wt[1]])}if(ot=[...ot,{placement:i,overflows:bt}],!bt.every(wt=>wt<=0)){var Xt,Zt;const wt=(((Xt=r.flip)==null?void 0:Xt.index)||0)+1,Yn=I[wt];if(Yn&&(!(u==="alignment"?w!==Z(Yn):!1)||ot.every(H=>Z(H.placement)===w?H.overflows[0]>0:!0)))return{data:{index:wt,overflows:ot},reset:{placement:Yn}};let Yt=(Zt=ot.filter(yt=>yt.overflows[0]<=0).sort((yt,H)=>yt.overflows[1]-H.overflows[1])[0])==null?void 0:Zt.placement;if(!Yt)switch(m){case"bestFit":{var Kt;const yt=(Kt=ot.filter(H=>{if(A){const at=Z(H.placement);return at===w||at==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(at=>at>0).reduce((at,Vd)=>at+Vd,0)]).sort((H,at)=>H[1]-at[1])[0])==null?void 0:Kt[0];yt&&(Yt=yt);break}case"initialPlacement":Yt=s;break}if(i!==Yt)return{reset:{placement:Yt}}}return{}}}},zo=new Set(["left","top"]);async function xs(t,e){const{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),a=et(n),s=qt(n),c=Z(n)==="y",l=zo.has(a)?-1:1,d=r&&c?-1:1,u=dt(e,t);let{mainAxis:p,crossAxis:m,alignmentAxis:b}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&typeof b=="number"&&(m=s==="end"?b*-1:b),c?{x:m*d,y:p*l}:{x:p*l,y:m*d}}const Es=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:a,middlewareData:s}=e,c=await xs(e,t);return a===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:i+c.x,y:r+c.y,data:{...c,placement:a}}}}},Ss=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:r=!0,crossAxis:a=!1,limiter:s={fn:g=>{let{x:h,y:w}=g;return{x:h,y:w}}},...c}=dt(t,e),l={x:n,y:o},d=await vn(e,c),u=Z(et(i)),p=hn(u);let m=l[p],b=l[u];if(r){const g=p==="y"?"top":"left",h=p==="y"?"bottom":"right",w=m+d[g],E=m-d[h];m=qo(w,m,E)}if(a){const g=u==="y"?"top":"left",h=u==="y"?"bottom":"right",w=b+d[g],E=b-d[h];b=qo(w,b,E)}const f=s.fn({...e,[p]:m,[u]:b});return{...f,data:{x:f.x-n,y:f.y-o,enabled:{[p]:r,[u]:a}}}}}},ks=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:i,rects:r,middlewareData:a}=e,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=dt(t,e),d={x:n,y:o},u=Z(i),p=hn(u);let m=d[p],b=d[u];const f=dt(s,e),g=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const E=p==="y"?"height":"width",x=r.reference[p]-r.floating[E]+g.mainAxis,S=r.reference[p]+r.reference[E]-g.mainAxis;m<x?m=x:m>S&&(m=S)}if(l){var h,w;const E=p==="y"?"width":"height",x=zo.has(et(i)),S=r.reference[u]-r.floating[E]+(x&&((h=a.offset)==null?void 0:h[u])||0)+(x?0:g.crossAxis),A=r.reference[u]+r.reference[E]+(x?0:((w=a.offset)==null?void 0:w[u])||0)-(x?g.crossAxis:0);b<S?b=S:b>A&&(b=A)}return{[p]:m,[u]:b}}}},Ts=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:r,platform:a,elements:s}=e,{apply:c=()=>{},...l}=dt(t,e),d=await vn(e,l),u=et(i),p=qt(i),m=Z(i)==="y",{width:b,height:f}=r.floating;let g,h;u==="top"||u==="bottom"?(g=u,h=p===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(h=u,g=p==="end"?"top":"bottom");const w=f-d.top-d.bottom,E=b-d.left-d.right,x=Ct(f-d[g],w),S=Ct(b-d[h],E),A=!e.middlewareData.shift;let I=x,F=S;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(F=E),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(I=w),A&&!p){const ot=U(d.left,0),Xt=U(d.right,0),Zt=U(d.top,0),Kt=U(d.bottom,0);m?F=b-2*(ot!==0||Xt!==0?ot+Xt:U(d.left,d.right)):I=f-2*(Zt!==0||Kt!==0?Zt+Kt:U(d.top,d.bottom))}await c({...e,availableWidth:F,availableHeight:I});const bt=await a.getDimensions(s.floating);return b!==bt.width||f!==bt.height?{reset:{rects:!0}}:{}}}};function we(){return typeof window<"u"}function Mt(t){return Fo(t)?(t.nodeName||"").toLowerCase():"#document"}function D(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function K(t){var e;return(e=(Fo(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Fo(t){return we()?t instanceof Node||t instanceof D(t).Node:!1}function B(t){return we()?t instanceof Element||t instanceof D(t).Element:!1}function Y(t){return we()?t instanceof HTMLElement||t instanceof D(t).HTMLElement:!1}function Bo(t){return!we()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof D(t).ShadowRoot}const As=new Set(["inline","contents"]);function Wt(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=G(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!As.has(i)}const Ls=new Set(["table","td","th"]);function Cs(t){return Ls.has(Mt(t))}const Ms=[":popover-open",":modal"];function ye(t){return Ms.some(e=>{try{return t.matches(e)}catch{return!1}})}const Os=["transform","translate","scale","rotate","perspective"],Is=["transform","translate","scale","rotate","perspective","filter"],Ns=["paint","layout","strict","content"];function bn(t){const e=wn(),n=B(t)?G(t):t;return Os.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Is.some(o=>(n.willChange||"").includes(o))||Ns.some(o=>(n.contain||"").includes(o))}function Rs(t){let e=it(t);for(;Y(e)&&!Ot(e);){if(bn(e))return e;if(ye(e))return null;e=it(e)}return null}function wn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const qs=new Set(["html","body","#document"]);function Ot(t){return qs.has(Mt(t))}function G(t){return D(t).getComputedStyle(t)}function xe(t){return B(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function it(t){if(Mt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Bo(t)&&t.host||K(t);return Bo(e)?e.host:e}function Go(t){const e=it(t);return Ot(e)?t.ownerDocument?t.ownerDocument.body:t.body:Y(e)&&Wt(e)?e:Go(e)}function Pt(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Go(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),a=D(i);if(r){const s=yn(a);return e.concat(a,a.visualViewport||[],Wt(i)?i:[],s&&n?Pt(s):[])}return e.concat(i,Pt(i,[],n))}function yn(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Jo(t){const e=G(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=Y(t),r=i?t.offsetWidth:n,a=i?t.offsetHeight:o,s=he(n)!==r||he(o)!==a;return s&&(n=r,o=a),{width:n,height:o,$:s}}function xn(t){return B(t)?t:t.contextElement}function It(t){const e=xn(t);if(!Y(e))return X(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=Jo(e);let a=(r?he(n.width):n.width)/o,s=(r?he(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Ws=X(0);function Ho(t){const e=D(t);return!wn()||!e.visualViewport?Ws:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ps(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==D(t)?!1:e}function ut(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=xn(t);let a=X(1);e&&(o?B(o)&&(a=It(o)):a=It(t));const s=Ps(r,n,o)?Ho(r):X(0);let c=(i.left+s.x)/a.x,l=(i.top+s.y)/a.y,d=i.width/a.x,u=i.height/a.y;if(r){const p=D(r),m=o&&B(o)?D(o):o;let b=p,f=yn(b);for(;f&&o&&m!==b;){const g=It(f),h=f.getBoundingClientRect(),w=G(f),E=h.left+(f.clientLeft+parseFloat(w.paddingLeft))*g.x,x=h.top+(f.clientTop+parseFloat(w.paddingTop))*g.y;c*=g.x,l*=g.y,d*=g.x,u*=g.y,c+=E,l+=x,b=D(f),f=yn(b)}}return be({width:d,height:u,x:c,y:l})}function Ee(t,e){const n=xe(t).scrollLeft;return e?e.left+n:ut(K(t)).left+n}function jo(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-Ee(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function Vs(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r=i==="fixed",a=K(o),s=e?ye(e.floating):!1;if(o===a||s&&r)return n;let c={scrollLeft:0,scrollTop:0},l=X(1);const d=X(0),u=Y(o);if((u||!u&&!r)&&((Mt(o)!=="body"||Wt(a))&&(c=xe(o)),Y(o))){const m=ut(o);l=It(o),d.x=m.x+o.clientLeft,d.y=m.y+o.clientTop}const p=a&&!u&&!r?jo(a,c):X(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+d.x+p.x,y:n.y*l.y-c.scrollTop*l.y+d.y+p.y}}function Us(t){return Array.from(t.getClientRects())}function Ds(t){const e=K(t),n=xe(t),o=t.ownerDocument.body,i=U(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=U(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+Ee(t);const s=-n.scrollTop;return G(o).direction==="rtl"&&(a+=U(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:a,y:s}}const Xo=25;function zs(t,e){const n=D(t),o=K(t),i=n.visualViewport;let r=o.clientWidth,a=o.clientHeight,s=0,c=0;if(i){r=i.width,a=i.height;const d=wn();(!d||d&&e==="fixed")&&(s=i.offsetLeft,c=i.offsetTop)}const l=Ee(o);if(l<=0){const d=o.ownerDocument,u=d.body,p=getComputedStyle(u),m=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,b=Math.abs(o.clientWidth-u.clientWidth-m);b<=Xo&&(r-=b)}else l<=Xo&&(r+=l);return{width:r,height:a,x:s,y:c}}const Fs=new Set(["absolute","fixed"]);function Bs(t,e){const n=ut(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=Y(t)?It(t):X(1),a=t.clientWidth*r.x,s=t.clientHeight*r.y,c=i*r.x,l=o*r.y;return{width:a,height:s,x:c,y:l}}function Zo(t,e,n){let o;if(e==="viewport")o=zs(t,n);else if(e==="document")o=Ds(K(t));else if(B(e))o=Bs(e,n);else{const i=Ho(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return be(o)}function Ko(t,e){const n=it(t);return n===e||!B(n)||Ot(n)?!1:G(n).position==="fixed"||Ko(n,e)}function Gs(t,e){const n=e.get(t);if(n)return n;let o=Pt(t,[],!1).filter(s=>B(s)&&Mt(s)!=="body"),i=null;const r=G(t).position==="fixed";let a=r?it(t):t;for(;B(a)&&!Ot(a);){const s=G(a),c=bn(a);!c&&s.position==="fixed"&&(i=null),(r?!c&&!i:!c&&s.position==="static"&&!!i&&Fs.has(i.position)||Wt(a)&&!c&&Ko(t,a))?o=o.filter(d=>d!==a):i=s,a=it(a)}return e.set(t,o),o}function Js(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const a=[...n==="clippingAncestors"?ye(e)?[]:Gs(e,this._c):[].concat(n),o],s=a[0],c=a.reduce((l,d)=>{const u=Zo(e,d,i);return l.top=U(u.top,l.top),l.right=Ct(u.right,l.right),l.bottom=Ct(u.bottom,l.bottom),l.left=U(u.left,l.left),l},Zo(e,s,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Hs(t){const{width:e,height:n}=Jo(t);return{width:e,height:n}}function js(t,e,n){const o=Y(e),i=K(e),r=n==="fixed",a=ut(t,!0,r,e);let s={scrollLeft:0,scrollTop:0};const c=X(0);function l(){c.x=Ee(i)}if(o||!o&&!r)if((Mt(e)!=="body"||Wt(i))&&(s=xe(e)),o){const m=ut(e,!0,r,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}else i&&l();r&&!o&&i&&l();const d=i&&!o&&!r?jo(i,s):X(0),u=a.left+s.scrollLeft-c.x-d.x,p=a.top+s.scrollTop-c.y-d.y;return{x:u,y:p,width:a.width,height:a.height}}function En(t){return G(t).position==="static"}function Yo(t,e){if(!Y(t)||G(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return K(t)===n&&(n=n.ownerDocument.body),n}function Qo(t,e){const n=D(t);if(ye(t))return n;if(!Y(t)){let i=it(t);for(;i&&!Ot(i);){if(B(i)&&!En(i))return i;i=it(i)}return n}let o=Yo(t,e);for(;o&&Cs(o)&&En(o);)o=Yo(o,e);return o&&Ot(o)&&En(o)&&!bn(o)?n:o||Rs(t)||n}const Xs=async function(t){const e=this.getOffsetParent||Qo,n=this.getDimensions,o=await n(t.floating);return{reference:js(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Zs(t){return G(t).direction==="rtl"}const Ks={convertOffsetParentRelativeRectToViewportRelativeRect:Vs,getDocumentElement:K,getClippingRect:Js,getOffsetParent:Qo,getElementRects:Xs,getClientRects:Us,getDimensions:Hs,getScale:It,isElement:B,isRTL:Zs};function _o(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Ys(t,e){let n=null,o;const i=K(t);function r(){var s;clearTimeout(o),(s=n)==null||s.disconnect(),n=null}function a(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),r();const l=t.getBoundingClientRect(),{left:d,top:u,width:p,height:m}=l;if(s||e(),!p||!m)return;const b=ge(u),f=ge(i.clientWidth-(d+p)),g=ge(i.clientHeight-(u+m)),h=ge(d),E={rootMargin:-b+"px "+-f+"px "+-g+"px "+-h+"px",threshold:U(0,Ct(1,c))||1};let x=!0;function S(A){const I=A[0].intersectionRatio;if(I!==c){if(!x)return a();I?a(!1,I):o=setTimeout(()=>{a(!1,1e-7)},1e3)}I===1&&!_o(l,t.getBoundingClientRect())&&a(),x=!1}try{n=new IntersectionObserver(S,{...E,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,E)}n.observe(t)}return a(!0),r}function Qs(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,l=xn(t),d=i||r?[...l?Pt(l):[],...Pt(e)]:[];d.forEach(h=>{i&&h.addEventListener("scroll",n,{passive:!0}),r&&h.addEventListener("resize",n)});const u=l&&s?Ys(l,n):null;let p=-1,m=null;a&&(m=new ResizeObserver(h=>{let[w]=h;w&&w.target===l&&m&&(m.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var E;(E=m)==null||E.observe(e)})),n()}),l&&!c&&m.observe(l),m.observe(e));let b,f=c?ut(t):null;c&&g();function g(){const h=ut(t);f&&!_o(f,h)&&n(),f=h,b=requestAnimationFrame(g)}return n(),()=>{var h;d.forEach(w=>{i&&w.removeEventListener("scroll",n),r&&w.removeEventListener("resize",n)}),u?.(),(h=m)==null||h.disconnect(),m=null,c&&cancelAnimationFrame(b)}}const _s=Es,$s=Ss,tl=ys,el=Ts,nl=ks,ol=(t,e,n)=>{const o=new Map,i={platform:Ks,...n},r={...i.platform,_c:o};return ws(t,e,{...i,platform:r})},$o="data-placement",ti="data-autoplacement",Vt=new Map;function il(t){let{newState:e,oldState:n,target:o,source:i=t.detail}=t,r=o instanceof HTMLElement&&ei(o,"--_ds-floating");if(!r)return;if(e==="closed")return Vt.get(o)?.();if(!i||i===o||n&&n===e)return;let a=ei(o,"--_ds-floating-overscroll"),s=y(o,$o)||y(i,$o)||r,c=y(o,ti)||y(i,ti),l=parseFloat(getComputedStyle(o,"::before").height)||0,d=i[`offset${s.match(/left|right/gi)?"Height":"Width"}`]/2+l,u={strategy:"absolute",placement:s,middleware:[_s(l),$s({padding:10,limiter:nl({offset:{mainAxis:d}})}),al(),...c==="false"?[]:[tl({padding:10,crossAxis:!1})],...a?[el({apply({availableHeight:m}){a==="fit"&&(o.style.width=`${i.clientWidth}px`),o.style.maxHeight=`${Math.max(50,m-20)}px`}})]:[]]},p=Qs(i,o,async()=>{if(!i?.isConnected)return Vt.get(o)?.();let{x:m,y:b}=await ol(i,o,u);o.style.translate=`${m}px ${b}px`});Vt.set(o,()=>Vt.delete(o)&&p())}let Se;const rl=({type:t})=>{if(t==="mousedown"&&(Se=!1),t==="scroll"&&Se===!1&&(Se=!0),t==="mouseup"&&Se)for(let[e]of Vt)e.showPopover()};At("popover",()=>[V(document,"mousedown scroll mouseup",rl,!0),V(document,"toggle ds-toggle-source",il,j)]);const ei=(t,e)=>getComputedStyle(t).getPropertyValue(e).trim(),al=()=>({name:"arrowPseudo",fn(t){let e=t.elements.floating,n=t.rects.reference,o=`${Math.round(n.width/2+n.x-t.x)}px`,i=`${Math.round(n.height/2+n.y-t.y)}px`;return e.style.setProperty("--_ds-floating-arrow-x",o),e.style.setProperty("--_ds-floating-arrow-y",i),y(e,"data-floating",t.placement),t}});let Sn=!1;const sl=({type:t,target:e,clientX:n=0,clientY:o=0})=>{if(t==="pointerdown"){let i=e?.closest?.("dialog")?.getBoundingClientRect();Sn=!!(i&&i.top<=o&&o<=i.bottom&&i.left<=n&&n<=i.right)}else{let i=e instanceof HTMLDialogElement&&!Sn&&y(e,"closedby")==="any";Sn=!1,i&&requestAnimationFrame(()=>e.open&&e.close())}};At("dialog-closedby",()=>[V(document,"pointerdown pointerup",sl,j)]);const ni=":click-delegate-hover",oi="data-clickdelegatefor",ll=`[${oi}]`,cl=t=>{let e=t.button===1||t.metaKey||t.ctrlKey,n=t.isTrusted&&t.button<2&&ii(t);n instanceof HTMLAnchorElement&&e?window.open(n.href,void 0,n.rel):n instanceof HTMLElement&&!n.contains(t.target)&&(t.stopImmediatePropagation(),n.click())};let ke;const dl=t=>{let e=ii(t);ke!==e&&(ke&&ke.classList.remove(ni),e&&e.classList.add(ni),ke=e)},ii=({target:t})=>{let e=(t instanceof Element?t.closest(ll):null)?.getAttribute(oi),n=document.getElementById(e||""),o=n&&t.closest('a,button,label,input,select,textarea,details,dialog,[role="button"],[popover],[contenteditable]');return(!o||o===n)&&n||void 0};At("clickdelegatefor",()=>[V(window,"click auxclick",cl,!0),V(document,"mouseover",dl,j)]);const Nt="aria-label",Te="data-label";var ri=class extends me{_items;_unresize;_unmutate;static get observedAttributes(){return[Nt]}connectedCallback(){!y(this,Te)&&!y(this,Nt)&&(Ao(this)?y(this,Nt,"Du er her"):Tt("Missing aria-label on:",this));let e=kt(this.attributeChangedCallback.bind(this),100);this._items=this.getElementsByTagName("a"),this._unresize=V(window,"resize",e),this._unmutate=Lt(this,e,{childList:!0,subtree:!0})}attributeChangedCallback(){let e=this._items?.[this._items.length-1],n=e?.parentElement===this?null:e,o=!n?.offsetHeight,i=y(this,Te),r=y(this,Nt);y(this,"role",o?null:"navigation"),o&&!i&&r?(y(this,Te,r),y(this,Nt,null)):!o&&i&&!r&&(y(this,Nt,i),y(this,Te,null));for(let a of this._items||[])y(a,"aria-current",a===n?"page":null)}disconnectedCallback(){this._unresize?.(),this._unmutate?.(),this._unresize=this._unmutate=this._items=void 0}};tt.define("ds-breadcrumbs",ri);var ai=class extends me{connectedCallback(){V(this,"animationend",this,j),requestAnimationFrame(()=>this.handleEvent({target:this}))}handleEvent({target:e}){if(e!==this)return;let n=this.querySelector("h2,h3,h4,h5,h6");n&&y(n,"aria-labelledby",ct(n)),y(this,"tabindex","-1"),this.focus()}disconnectedCallback(){un(this,"animationend",this,j)}};tt.define("ds-error-summary",ai);const kn=new Set,si=new WeakMap,ul=$()?document.getElementsByTagName("fieldset"):[],pl=$()&&CSS.supports("field-sizing","content"),ml=ts()?800:200,fl={over:"%d tegn for mye",under:"%d tegn igjen"},li=kt(()=>{for(let t of ul)y(t,"aria-labelledby",`${ct(t.querySelector("legend"))} ${ct(t.querySelector(':scope > :is([data-field="description"],legend + p)'))}`.trim());for(let t of kn){let e=[],n=[],o,i,r=!1;for(let a of t.getElementsByTagName("*"))if(a instanceof HTMLLabelElement)n.push(a);else if(gl(a))o&&Tt("Fields should only have one input element. Use <fieldset> to group multiple fields:",t),Tn(a)&&a.type!=="hidden"&&(o=a);else if(Tn(a)){let s=a.getAttribute("data-field");s==="counter"&&(i=a),s==="validation"?(e.unshift(a),r||=di(a)):s&&e.push(a)}if(!o)Tt("Field is missing input element:",t);else{i&&si.set(o,i);for(let c of n)y(c,"for",ct(o));let a=o.type==="radio"||o.type==="checkbox",s=t.closest("fieldset")?.querySelector(':scope > [data-field="validation"]');Tn(s)&&(r||=di(s),e.unshift(s)),y(t,"data-clickdelegatefor",a?ct(o):null),y(o,"aria-describedby",e.map(ct).join(" ")),y(o,"aria-invalid",`${r}`),ci(o)}}},100),Ut=$()?Lo("div",{"aria-live":"polite",style:"position:fixed;white-space:nowrap;clip:rect(0 0 0 0)"}):null,ci=t=>{let e=t.target||t,n=si.get(e);if(n?.isConnected){let o=(Number(y(n,"data-limit"))||0)-e.value.length,i=o<0?"over":"under",r=(y(n,`data-${i}`)||fl[i]).replace("%d",`${Math.abs(o)}`);y(n,"aria-label",r),y(n,"data-state",i),y(n,"data-color",o<0?"danger":null),t.type==="input"&&Ut&&(Ut?.isConnected||document.body.appendChild(Ut),hl(e,r))}!pl&&e instanceof HTMLTextAreaElement&&(e.style.setProperty("--_ds-field-sizing","auto"),e.style.setProperty("--_ds-field-sizing",`${e.scrollHeight}px`))},hl=kt((t,e)=>{let n=t.getRootNode();Ut&&n?.activeElement===t&&(Ut.textContent=e)},ml),di=t=>y(t,"data-color")!=="success",Tn=t=>!!t&&!t.hidden,gl=t=>t instanceof HTMLElement&&"validity"in t&&!(t instanceof HTMLButtonElement);var Ae=class extends me{connectedCallback(){kn.add(this),li()}disconnectedCallback(){kn.delete(this)}};tt.define("ds-field",Ae),At("field",()=>[V(document,"input ds-field-update",ci,j),Lt(document,li,{attributeFilter:["hidden","data-field"],attributes:!0,childList:!0,subtree:!0})]);const An="aria-label",Dt="data-current",zt="data-total",ui="data-href",pi=({current:t=1,total:e=10,show:n=7})=>({prev:t>1?t-1:0,next:t<e?t+1:0,pages:vl(t,e,n).map((o,i)=>({current:o===t&&"page",key:`key-${o}-${i}`,page:o}))});var mi=class extends me{_unmutate;static get observedAttributes(){return[Dt,zt]}connectedCallback(){let e=y(this,zt),n=y(this,Dt);n&&!e&&Tt(`Missing ${zt} attribute on:`,this),e&&!n&&Tt(`Missing ${Dt} attribute on:`,this),y(this,An)||(Ao(this)?y(this,An,"Bla i sider"):Tt(`Missing ${An} attribute on:`,this)),y(this,"role","navigation"),this._unmutate=Lt(this,this.render.bind(this),{attributeFilter:[Dt,zt,ui],attributes:!0,childList:!0,subtree:!0})}disconnectedCallback(){this._unmutate?.(),this._unmutate=void 0}render(){let e=this.querySelectorAll("button,a"),n=y(this,ui),o=Number(y(this,Dt)),i=Number(y(this,zt)),r=e.length-2;if(o&&i){let{next:a,prev:s,pages:c}=pi({current:o,total:i,show:r});e.forEach((l,d)=>{let u=d?e[d+1]?c[d-1]?.page:a:s;y(l,"aria-current",c[d-1]?.current?"true":null),y(l,"aria-hidden",u?null:"true"),y(l,"data-page",`${u}`),y(l,"role",u?null:"none"),y(l,"tabindex",u?null:"-1"),l instanceof HTMLButtonElement&&y(l,"value",`${u}`),n&&y(l,"href",n.replace("%d",`${u}`))})}}};const vl=(t,e,n=1/0)=>{let o=(n-1)/2,i=Math.max(Math.min(t-Math.floor(o),e-n+1),1),r=Math.min(Math.max(t+Math.ceil(o),n),e),a=Array.from({length:r+1-i},(s,c)=>c+i);return n>4&&i>1&&a.splice(0,2,1,0),n>3&&r<e&&a.splice(-2,2,0,e),a};tt.define("ds-pagination",mi);var fi=class extends Ge{_unmutate;connectedCallback(){super.connectedCallback();let t=kt(()=>bl(this),100);this._unmutate=Lt(this,t,{childList:!0,subtree:!0}),V(this,"toggle",hi,j),t()}disconnectedCallback(){super.disconnectedCallback(),this._unmutate?.(),this._unmutate=void 0,un(this,"toggle",hi,j)}};const bl=({control:t,list:e})=>{t&&!t.placeholder&&y(t,"placeholder"," "),t&&y(t,"popovertarget",ct(e)||null),e&&y(e,"popover","manual")},hi=t=>{let e=t.currentTarget,n=t.newState==="open"&&e.control;n&&e.list?.dispatchEvent(new CustomEvent("ds-toggle-source",{detail:n}))};tt.define("ds-suggestion",fi);var gi=class extends $e{},vi=class extends tn{},bi=class extends nn{},wi=class extends rn{};tt.define("ds-tabs",gi),tt.define("ds-tablist",vi),tt.define("ds-tab",bi),tt.define("ds-tabpanel",wi);function wl(){return typeof HTMLButtonElement<"u"&&"command"in HTMLButtonElement.prototype&&"source"in((globalThis.CommandEvent||{}).prototype||{})}function yl(){document.addEventListener("invoke",f=>{f.type=="invoke"&&f.isTrusted&&(f.stopImmediatePropagation(),f.preventDefault())},!0),document.addEventListener("command",f=>{f.type=="command"&&f.isTrusted&&(f.stopImmediatePropagation(),f.preventDefault())},!0);function t(f,g,h=!0){Object.defineProperty(f,g,{...Object.getOwnPropertyDescriptor(f,g),enumerable:h})}function e(f){return f&&typeof f.getRootNode=="function"?f.getRootNode():f&&f.parentNode?e(f.parentNode):f}const n=new WeakMap,o=new WeakMap;class i extends Event{constructor(g,h={}){super(g,h);const{source:w,command:E}=h;if(w!=null&&!(w instanceof Element))throw new TypeError("source must be an element");n.set(this,w||null),o.set(this,E!==void 0?String(E):"")}get[Symbol.toStringTag](){return"CommandEvent"}get source(){if(!n.has(this))throw new TypeError("illegal invocation");const g=n.get(this);if(!(g instanceof Element))return null;const h=e(g);return h!==e(this.target||document)?h.host:g}get command(){if(!o.has(this))throw new TypeError("illegal invocation");return o.get(this)}get action(){throw new Error("CommandEvent#action was renamed to CommandEvent#command")}get invoker(){throw new Error("CommandEvent#invoker was renamed to CommandEvent#source")}}t(i.prototype,"source"),t(i.prototype,"command");class r extends Event{constructor(g,h={}){throw super(g,h),new Error("InvokeEvent has been deprecated, it has been renamed to `CommandEvent`")}}const a=new WeakMap;function s(f){Object.defineProperties(f.prototype,{commandForElement:{enumerable:!0,configurable:!0,set(g){if(this.hasAttribute("invokeaction"))throw new TypeError("Element has deprecated `invokeaction` attribute, replace with `command`");if(this.hasAttribute("invoketarget"))throw new TypeError("Element has deprecated `invoketarget` attribute, replace with `commandfor`");if(g===null)this.removeAttribute("commandfor"),a.delete(this);else if(g instanceof Element){this.setAttribute("commandfor","");const h=e(g);e(this)===h||h===this.ownerDocument?a.set(this,g):a.delete(this)}else throw new TypeError("commandForElement must be an element or null")},get(){if(this.localName!=="button")return null;if(this.hasAttribute("invokeaction")||this.hasAttribute("invoketarget"))return console.warn("Element has deprecated `invoketarget` or `invokeaction` attribute, use `commandfor` and `command` instead"),null;if(this.disabled)return null;if(this.form&&this.getAttribute("type")!=="button")return console.warn("Element with `commandFor` is a form participant. It should explicitly set `type=button` in order for `commandFor` to work"),null;const g=a.get(this);if(g)return g.isConnected?g:(a.delete(this),null);const h=e(this),w=this.getAttribute("commandfor");return(h instanceof Document||h instanceof ShadowRoot)&&w&&h.getElementById(w)||null}},command:{enumerable:!0,configurable:!0,get(){const g=this.getAttribute("command")||"";if(g.startsWith("--"))return g;const h=g.toLowerCase();switch(h){case"show-modal":case"request-close":case"close":case"toggle-popover":case"hide-popover":case"show-popover":return h}return""},set(g){this.setAttribute("command",g)}},invokeAction:{enumerable:!1,configurable:!0,get(){throw new Error("invokeAction is deprecated. It has been renamed to command")},set(g){throw new Error("invokeAction is deprecated. It has been renamed to command")}},invokeTargetElement:{enumerable:!1,configurable:!0,get(){throw new Error("invokeTargetElement is deprecated. It has been renamed to command")},set(g){throw new Error("invokeTargetElement is deprecated. It has been renamed to command")}}})}const c=new WeakMap;Object.defineProperties(HTMLElement.prototype,{oncommand:{enumerable:!0,configurable:!0,get(){return d.takeRecords(),c.get(this)||null},set(f){const g=c.get(this)||null;g&&this.removeEventListener("command",g),c.set(this,typeof f=="object"||typeof f=="function"?f:null),typeof f=="function"&&this.addEventListener("command",f)}}});function l(f){for(const g of f)g.oncommand=new Function("event",g.getAttribute("oncommand"))}const d=new MutationObserver(f=>{for(const g of f){const{target:h}=g;g.type==="childList"?l(h.querySelectorAll("[oncommand]")):l([h])}});d.observe(document,{subtree:!0,childList:!0,attributeFilter:["oncommand"]}),l(document.querySelectorAll("[oncommand]"));const u=new WeakSet;function p(f){if(u.has(f)||(u.add(f),f.defaultPrevented)||f.type!=="click")return;const g=f.target.closest("button[invoketarget], button[invokeaction], input[invoketarget], input[invokeaction]");if(g&&(console.warn("Elements with `invoketarget` or `invokeaction` are deprecated and should be renamed to use `commandfor` and `command` respectively"),g.matches("input")))throw new Error("Input elements no longer support `commandfor`");const h=f.target.closest("button[commandfor], button[command]");if(!h)return;if(h.form&&h.getAttribute("type")!=="button")throw f.preventDefault(),new Error("Element with `commandFor` is a form participant. It should explicitly set `type=button` in order for `commandFor` to work. In order for it to act as a Submit button, it must not have command or commandfor attributes");if(h.hasAttribute("command")!==h.hasAttribute("commandfor")){const S=h.hasAttribute("command")?"command":"commandfor",A=h.hasAttribute("command")?"commandfor":"command";throw new Error(`Element with ${S} attribute must also have a ${A} attribute to function.`)}if(h.command!=="show-popover"&&h.command!=="hide-popover"&&h.command!=="toggle-popover"&&h.command!=="show-modal"&&h.command!=="request-close"&&h.command!=="close"&&!h.command.startsWith("--")){console.warn(`"${h.command}" is not a valid command value. Custom commands must begin with --`);return}const w=h.commandForElement;if(!w)return;const E=new i("command",{command:h.command,source:h,cancelable:!0});if(w.dispatchEvent(E),E.defaultPrevented)return;const x=E.command.toLowerCase();if(w.popover){const S=!w.matches(":popover-open");S&&(x==="toggle-popover"||x==="show-popover")?w.showPopover({source:h}):!S&&x==="hide-popover"&&w.hidePopover()}else if(w.localName==="dialog"){const S=!w.hasAttribute("open");S&&x=="show-modal"?w.showModal():!S&&x=="close"?w.close(h.value?h.value:void 0):!S&&x=="request-close"&&(HTMLDialogElement.prototype.requestClose||(HTMLDialogElement.prototype.requestClose=function(){const A=new Event("cancel",{cancelable:!0});this.dispatchEvent(A),A.defaultPrevented||this.close()}),w.requestClose(h.value?h.value:void 0))}}function m(f){f.addEventListener("click",p,!0)}function b(f,g){const h=f.prototype.attachShadow;f.prototype.attachShadow=function(E){const x=h.call(this,E);return g(x),x};const w=f.prototype.attachInternals;f.prototype.attachInternals=function(){const E=w.call(this);return E.shadowRoot&&g(E.shadowRoot),E}}s(HTMLButtonElement),b(HTMLElement,f=>{m(f),d.observe(f,{attributeFilter:["oncommand"]}),l(f.querySelectorAll("[oncommand]"))}),m(document),Object.assign(globalThis,{CommandEvent:i,InvokeEvent:r})}var Le=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",xl=Le&&/android/i.test(navigator.userAgent),El=Le&&/firefox/i.test(navigator.userAgent),yi;Le&&/^Mac/i.test(((yi=navigator.userAgentData)==null?void 0:yi.platform)||navigator.platform);function xi(t,e,n){return n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}var Ce="__uDetailsPolyfillSummarys";if(Le&&xl&&El&&!window[Ce]){window[Ce]=document.getElementsByTagName("summary");const t=()=>{if(window[Ce])for(const e of window[Ce]){const n=e.parentElement;xi(e,"role","button"),xi(e,"aria-expanded",`${!!n&&!!n.open}`)}};requestAnimationFrame(t),new MutationObserver(t).observe(document,{attributeFilter:["open"],attributes:!0,childList:!0,subtree:!0})}var Sl=Object.defineProperty,Ei=Object.getOwnPropertySymbols,kl=Object.prototype.hasOwnProperty,Tl=Object.prototype.propertyIsEnumerable,Si=(t,e,n)=>e in t?Sl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Al=(t,e)=>{for(var n in e||(e={}))kl.call(e,n)&&Si(t,n,e[n]);if(Ei)for(var n of Ei(e))Tl.call(e,n)&&Si(t,n,e[n]);return t},Ft=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",Me=Ft&&/android/i.test(navigator.userAgent),Ln=Ft&&/iPad|iPhone|iPod/.test(navigator.userAgent),ki;Ft&&/^Mac/i.test(((ki=navigator.userAgentData)==null?void 0:ki.platform)||navigator.platform);var Ll=`${Me?"data":"aria"}-labelledby`,Cl=":host(:not([hidden])) { display: block }",Ml="outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color",Ti=typeof HTMLElement>"u"?class{}:HTMLElement;function L(t,e,n){return n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}var Ai=(t,e,n)=>{for(const o of n[0].split(","))n[0]=o,Element.prototype[`${t}EventListener`].apply(e,n)},Bt=(t,...e)=>Ai("add",t,e),Oe=(t,...e)=>Ai("remove",t,e),Ol=(t,e)=>t.shadowRoot||t.attachShadow({mode:"open"}).append(On("slot"),On("style",e)),Ie=new WeakMap,Cn=(t,e)=>{if(e===void 0)return Ie.get(t);try{Ie.get(t).disconnect(),Ie.delete(t)}catch{}if(e){const n=new MutationObserver(o=>t.handleEvent({type:"mutation",detail:o}));n.observe(t,e),Ie.set(t,n)}},Li=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},Il=0,Mn=t=>t?(t.id||(t.id=`:${t.nodeName.toLowerCase()}${(++Il).toString(32)}`),t.id):"",On=(t,e,n)=>{const o=document.createElement(t);return e&&(o[t==="style"?"textContent":"innerHTML"]=e),o},Ci={define:(t,e)=>!Ft||window.customElements.get(t)||window.customElements.define(t,e)},pt,Nl=0,Mi=t=>{pt||(pt=On("div"),pt.style.cssText="position:fixed;overflow:hidden;width:1px;white-space:nowrap",L(pt,"aria-live","assertive")),pt.isConnected||document.body.append(pt),t&&(pt.textContent=`${t}${Nl++%2?" ":""}`)},Rl=(t,e,n="")=>{var o,i;const r={bubbles:!0,composed:!0,data:e,inputType:n},a=HTMLInputElement.prototype;t.dispatchEvent(new InputEvent("beforeinput",r)),(i=(o=Object.getOwnPropertyDescriptor(a,"value"))==null?void 0:o.set)==null||i.call(t,e),t.dispatchEvent(new InputEvent("input",r)),t.dispatchEvent(new Event("change",{bubbles:!0}))},In=!1,Nn=t=>(t?.type==="mouseup"&&(In=!1),t?.type==="mousedown"&&(In=!0,Bt(document,"mouseup",Nn,{once:!0})),In),ql=(t,e="<slot></slot>")=>`<template shadowrootmode="open">${e}<style>${t}</style></template>`,Rn="disabled",Gt="selected",Wl=class extends Ti{static get observedAttributes(){return[Rn,Gt]}connectedCallback(){Ln||(this.tabIndex=-1),this.hasAttribute("role")||L(this,"role","option"),this.attributeChangedCallback()}attributeChangedCallback(){L(this,"aria-disabled",`${this.disabled}`),L(this,"aria-selected",`${this.selected}`)}get defaultSelected(){return this[Gt]}set defaultSelected(t){this[Gt]=t}get disabled(){return L(this,Rn)!==null}set disabled(t){L(this,Rn,t?"":null)}get form(){return this.closest("form")}get index(){var t;return[...((t=this.parentElement)==null?void 0:t.options)||[this]].indexOf(this)}get label(){var t;return(t=L(this,"label"))!=null?t:this.text}set label(t){L(this,"label",t)}get selected(){return L(this,Gt)!==null}set selected(t){L(this,Gt,t?"":null)}get text(){var t;return((t=this.textContent)==null?void 0:t.trim())||""}set text(t){this.textContent=t}get value(){var t;return(t=L(this,"value"))!=null?t:this.text}set value(t){L(this,"value",t)}};Ci.define("u-option",Wl);var qn=`${Cl}
165
195
  ::slotted([role="option"]) { display: block; cursor: pointer }
166
- ::slotted([role="option"]:focus) { ${Ol} }
196
+ ::slotted([role="option"]:focus) { ${Ml} }
167
197
  ::slotted([role="option"][aria-hidden="true"]),
168
198
  ::slotted([role="option"][disabled]),
169
- ::slotted([role="option"][hidden]) { display: none !important }`,Pl=ql(Wn),Mi,Ii=0,Vl=Cn||Me,Ni="click,focusout,input,keydown,mousedown,mouseup",Ri="focus,focusin,blur,focusout",Re={singular:"%d hit",plural:"%d hits"},qi=class extends Ti{constructor(){super(),this._texts=Al({},Re),this._value="",this._of="/",Ml(this,Wn)}static get observedAttributes(){return["id",...Object.keys(Re).map(t=>`data-sr-${t}`)]}connectedCallback(){this.hidden=!0,this._root=Li(this),L(this,"role","listbox"),L(this,"tabindex","-1"),Bt(this._root,"focusin",this),Bt(this._root,"focus",this,!0),On(this,{attributeFilter:["disabled","hidden","label","value"],attributes:!0,characterData:!0,childList:!0,subtree:!0}),setTimeout(()=>this.attributeChangedCallback())}disconnectedCallback(){Ie(this._root||this,"focus",this,!0),Ie(this._root||this,"focusin",this),On(this,!1),Pn(this),this._root=void 0}attributeChangedCallback(t,e,n){const o=t?.split("data-sr-")[1],i=`input[list="${this.id}"]`;if(Re[o])this._texts[o]=n||Re[o];else if(this._root){this._input&&Vn(this,this._input);for(const r of this._root.querySelectorAll(i))Vn(this,r)}}handleEvent(t){const{target:e,type:n}=t;t.defaultPrevented||(n==="click"&&zl(this,t),(n==="focus"||n==="focusin")&&Ul(this,t),(n==="blur"||n==="focusout")&&Dl(this,t),n==="keydown"&&Fl(this,t),n==="mousedown"&&this.contains(e)&&Rn(t),(n==="mutation"||n==="input")&&(clearTimeout(Ii),Ii=setTimeout(Vi,0,this,t)))}get options(){var t;if(!this._options){const e=(t=this.querySelector('[role="option"],option'))==null?void 0:t.nodeName;e&&(this._options=this.getElementsByTagName(e))}return this._options||this.getElementsByTagName("option")}},Wi=t=>t?.disabled||t?.readOnly||!1,Jt=(t,e)=>{var n,o,i;if(t.hidden!==e)return;t.hidden=Wi(t?._input)||!e,(n=On(t))==null||n.takeRecords();const r=t.isConnected&&t.popover&&((o=t._input)==null?void 0:o.isConnected)&&((i=t._input)==null?void 0:i.popoverTargetElement)===t;t._input&&Vn(t,t._input,e),r&&L(t,"popover","manual"),r&&t.togglePopover(e),e&&Vi(t)},Pn=t=>{t._input&&(Ie(t._input||t,Ri,t),Ie(t._root||t,Ni,t),Jt(t,!1),t._input=void 0)},Vn=(t,e,n=!1)=>{t.popover&&L(e,"popovertarget",Mn(t)),Bt(e,Ri,t,!0),L(e,"aria-autocomplete","list"),L(e,"aria-controls",Mn(t)),L(e,"aria-expanded",`${!Vl||n}`),L(e,"autocomplete","off"),L(e,"role",Wi(e)?null:"combobox")},Ul=(t,e)=>{var n;const o=e.target instanceof HTMLInputElement;o&&e.isTrusted&&e.stopImmediatePropagation(),t._input!==e.target&&o&&e.target.list===t&&(t._input&&Pn(t),t._input=e.target,t._input.dispatchEvent(new FocusEvent("focus")),t._input.dispatchEvent(new FocusEvent("focusin",{bubbles:!0})),L(t,Ll,Mn((n=t._input.labels)==null?void 0:n[0])),Bt(t._root||t,Ni,t),Jt(t,L(t._input,"inputmode")!=="none"),Oi())},Dl=(t,e)=>{!Me&&!Rn()&&t._input&&setTimeout(Pi,0,t),e.target===t._input&&e.isTrusted&&e.stopImmediatePropagation()},Pi=t=>{var e;const n=((e=t._root)==null?void 0:e.activeElement)||null,o=t._input;o&&o!==n&&!t.contains(n)&&(o.dispatchEvent(new FocusEvent("blur",{relatedTarget:n})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:n})),Pn(t))},zl=(t,{target:e})=>{var n;if(!t._input||t._input===e)return Jt(t,!0);for(const o of t.options)if(o.contains(e))return L(t,"aria-multiselectable")!=="true"&&((n=t._input)==null||n.focus(),Jt(t,!1)),Rl(t._input,o.value);Me&&Pi(t)},Fl=(t,e)=>{var n;const{key:o,target:i,altKey:r,ctrlKey:a,shiftKey:s,metaKey:l}=e,c=o==="Escape"||o==="Esc";if(r||a||l||s||o==="Tab")return;c&&!t.hidden&&e?.preventDefault(),Jt(t,!c);const d=[...t.options].filter(m=>L(m,"aria-hidden")!=="true"&&m.offsetHeight),u=d.indexOf(i);let p=-1;if(o==="ArrowDown"&&(p=(u+1)%d.length),o==="ArrowUp"&&(p=(~u?u:d.length)-1),~u&&((o==="Home"||o==="PageUp")&&(p=0),(o==="End"||o==="PageDown")&&(p=d.length-1),o==="Enter"))return d[u].click(),e.preventDefault();if(d[p])for(const m of d)m.tabIndex=-1;d[p]&&e.preventDefault(),(n=d[p]||t._input)==null||n.focus(),!d[p]&&o==="ArrowUp"&&setTimeout(()=>{var m;return(m=t._input)==null?void 0:m.setSelectionRange(999,999)})},Vi=(t,e)=>{const{_texts:n,_root:o,_input:i,options:r}=t,a=i?.value.toLowerCase().trim()||"",s=!t.hasAttribute("data-nofilter"),l=[],c=[];for(const p of r)(p.disabled||p.hidden||s&&!p.label.toLowerCase().includes(a)?l:c).push(p);for(const p of l)L(p,"aria-hidden","true");for(const p of c)L(p,"aria-hidden","false");const d=c.length;clearTimeout(Mi),e?.type==="input"&&a!==t._value&&(Mi=setTimeout(()=>{const p=`${!d&&t.innerText.trim()||`${n[d===1?"singular":"plural"]}`.replace("%d",`${d}`)}`;!t.hidden&&o?.activeElement===i&&Oi(p),t._value=a},1e3));let u=0;if(Cn)for(const p of c)L(p,"title",`${++u} ${t._of} ${d}`)};Ft&&Object.defineProperty(HTMLInputElement.prototype,"list",{configurable:!0,enumerable:!0,get(){return Li(this).getElementById(L(this,"list")||"")}}),Ci.define("u-datalist",qi),$()&&!wl()&&yl();const Bl="3.0.2",Ui="_alert_1d3iq_1 _ds-alert_17fn9_3",Di="_app_1d3iq_1",zi="_sticky_1d3iq_1",Fi="_avatar_1d3iq_1 _ds-avatar_17fn9_1",Bi="_badge_1d3iq_1",Gi="_breadcrumbs_1d3iq_1 _ds-breadcrumbs_17fn9_5",Ji="_button_1d3iq_1 _ds-button_17fn9_1",Hi="_card_1d3iq_1",ji="_group_1d3iq_1",Xi="_chip_1d3iq_1 _ds-chip_17fn9_5",Zi="_details_1d3iq_1 _ds-details_17fn9_3",Ki="_dialog_1d3iq_1 _ds-dialog_17fn9_5",Yi="__drawer_1d3iq_1",Qi="_divider_1d3iq_1",_i="_errorsummary_1d3iq_1 _ds-error-summary_17fn9_5",$i="_field_1d3iq_1 _ds-field_17fn9_1",tr="_suggestion_1d3iq_1 _ds-suggestion_17fn9_5",er="_affixes_1d3iq_1 _ds-field-affixes_17fn9_3",nr="_fieldset_1d3iq_1 _ds-fieldset_17fn9_3",or="_fileupload_1d3iq_1",ir="_helptext_1d3iq_1 _ds-focus_17fn9_1",rr="_input_1d3iq_1 _ds-input_17fn9_1",ar="_law_1d3iq_1",sr="_grid_1d3iq_1",lr="_flex_1d3iq_1",cr="_link_1d3iq_1",dr="_logo_1d3iq_1",ur="__logo_1d3iq_1",pr="_pagination_1d3iq_1 _ds-pagination_17fn9_5",mr="_popover_1d3iq_1 _ds-popover_17fn9_3",fr="_progress_1d3iq_1",hr="__indeterminate_1d3iq_1",gr="_skeleton_1d3iq_1 _ds-skeleton_17fn9_5",vr="__skeleton_1d3iq_1",br="_spinner_1d3iq_1",wr="_steps_1d3iq_1",yr="_table_1d3iq_1 _ds-table_17fn9_5",xr="__scrollShadow_1d3iq_1",Er="_tabs_1d3iq_1 _ds-tabs_17fn9_5",Sr="__scrollMask_1d3iq_1",kr="_tag_1d3iq_1 _ds-tag_17fn9_5",Tr="_toast_1d3iq_1",Ar="__toastClose_1d3iq_1",Lr="__toastOpen_1d3iq_1",Cr="__toastTimeout_1d3iq_1",Or="_togglegroup_1d3iq_1 _ds-toggle-group_17fn9_5",Mr="__tooltip_1d3iq_1 _ds-tooltip_17fn9_5",Ir="_heading_1d3iq_1 _ds-heading_17fn9_1",Nr="_ingress_1d3iq_1",Rr="_muted_1d3iq_1",qr="_info_1d3iq_1",Wr="_prose_1d3iq_1",Pr="_validation_1d3iq_1 _ds-validation-message_17fn9_1",Vr="_body_1d3iq_161",Ur="__checked_1d3iq_1",C={alert:Ui,app:Di,sticky:zi,avatar:Fi,badge:Bi,breadcrumbs:Gi,button:Ji,card:Hi,group:ji,chip:Xi,details:Zi,dialog:Ki,_drawer:Yi,divider:Qi,errorsummary:_i,field:$i,suggestion:tr,affixes:er,fieldset:nr,fileupload:or,helptext:ir,input:rr,law:ar,grid:sr,flex:lr,link:cr,logo:dr,_logo:ur,pagination:pr,popover:mr,progress:fr,_indeterminate:hr,skeleton:gr,_skeleton:vr,spinner:br,steps:wr,table:yr,_scrollShadow:xr,tabs:Er,_scrollMask:Sr,tag:kr,toast:Tr,_toastClose:Ar,_toastOpen:Lr,_toastTimeout:Cr,togglegroup:Or,_tooltip:Mr,heading:Ir,ingress:Nr,muted:Rr,info:qr,prose:Wr,validation:Pr,body:Vr,_checked:Ur},Gl=Object.freeze(Object.defineProperty({__proto__:null,_checked:Ur,_drawer:Yi,_indeterminate:hr,_logo:ur,_scrollMask:Sr,_scrollShadow:xr,_skeleton:vr,_toastClose:Ar,_toastOpen:Lr,_toastTimeout:Cr,_tooltip:Mr,affixes:er,alert:Ui,app:Di,avatar:Fi,badge:Bi,body:Vr,breadcrumbs:Gi,button:Ji,card:Hi,chip:Xi,default:C,details:Zi,dialog:Ki,divider:Qi,errorsummary:_i,field:$i,fieldset:nr,fileupload:or,flex:lr,grid:sr,group:ji,heading:Ir,helptext:ir,info:qr,ingress:Nr,input:rr,law:ar,link:cr,logo:dr,muted:Rr,pagination:pr,popover:mr,progress:fr,prose:Wr,skeleton:gr,spinner:br,steps:wr,sticky:zi,suggestion:tr,table:yr,tabs:Er,tag:kr,toast:Tr,togglegroup:Or,validation:Pr},Symbol.toStringTag,{value:"Module"}));function Dr(t){var e,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=Dr(t[e]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function Jl(){for(var t,e,n=0,o="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=Dr(t))&&(o&&(o+=" "),o+=e);return o}const Ht={capture:!0,passive:!0},J=()=>typeof window<"u"&&typeof document<"u",mt=t=>J()?document.getElementsByClassName(C[t].split(" ")[0]):[];function ft(t,e){let n;return function(...o){clearTimeout(n),n=setTimeout(()=>t.apply(this,o),e)}}function v(t,e,n){return n===void 0?t.getAttribute(e)??null:(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}const W=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.addEventListener(i,...o);return()=>zr(t,...e)},zr=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.removeEventListener(i,...o)},ht=(t,e)=>{if(!J())return;window._mtdsHotReloadCleanup||(window._mtdsHotReloadCleanup=new Map);const n=()=>{window._mtdsHotReloadCleanup?.get(t)?.map(o=>o()),window._mtdsHotReloadCleanup?.set(t,e())};document.readyState!=="complete"?W(window,"load",n):document.fonts?.ready?.then(n)||setTimeout(n,0)},qe=(t,e,n)=>{let o=0;const i=()=>{if(!J())return r();e(a),a.takeRecords(),o=0},r=()=>a?.disconnect?.(),a=new MutationObserver(()=>{o||(o=requestAnimationFrame(i))});return a.observe(t,n),i(),r},M=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,r]of Object.entries(e))v(o,i,r);return o},Hl=typeof HTMLElement>"u"?class{}:HTMLElement,jl=(t,e)=>!J()||window.customElements.get(t)||window.customElements.define(t,e),Xl=`[data-command="toggle-app-expanded"],.${C.app.split(" ")[0]} > [command="show-modal"]`,Zl=`.${C.breadcrumbs.split(" ")[0]}`,Kl=`.${C.card.split(" ")[0]}`,Fr=`.${C.chip.split(" ")[0]}`,Yl=`.${C.helptext.split(" ")[0]}`,Ql=`.${C.pagination.split(" ")[0]}`,_l='summary,u-summary,a,button,[role="tab"],[role="button"]',Un="mattilsynet.matomo.cloud",$l=["setCustomUrl","setDocumentTitle","setReferrerUrl"],H="mtds-analytics-banner",tc="https://www.mattilsynet.no/om-mattilsynet/personvernerklaering/informasjonskapsler";function Br(t,e={}){if(J()){if(window._paq||(window._paq=[],window._paq.push(["HeatmapSessionRecording::disable"]),window._paq.push(["enableLinkTracking"]),window._paq.push(["setTrackerUrl",`https://${Un}/matomo.php`])),window._mtm||(window._mtm=window._mtm||[],window._mtm.push({"mtm.startTime":Date.now(),event:"mtm.Start"})),t==="init"){window._mtdsTracking={enabled:window.location.hostname!=="localhost",...window._mtdsTracking,...e};const{consent:n,enabled:o,matomoId:i,matomoTagManagerId:r}=window._mtdsTracking;if(i&&window._paq.push(["setSiteId",i]),o){n!=="custom"&&ec();const a=r?`https://cdn.matomo.cloud/${Un}/container_${r}.js`:`https://cdn.matomo.cloud/${Un}/matomo.js`;document.querySelector(`script[src="${a}"]`)||document.head.append(M("script",{async:"",src:a}))}}if(window._mtdsTracking?.enabled!==!1){if(window._mtdsTracking?.enabled==="debug")return console.info(`analytics ${t}:`,e);if(t==="pageview"){const{url:n,title:o}=e;window._paq.push(["setCustomUrl",n||location.href]),window._paq.push(["setDocumentTitle",o||document.title]),window._paq.push(["trackPageView"])}else if(t==="event"){const{category:n,action:o,name:i,value:r}=e,a=["trackEvent",n,o,i,r];let s=location.href;window._paq.push([function(){s=this.getCurrentUrl()}]),window._paq.push(["setCustomUrl",s.split("#")[0]]),window._paq.push(a.filter(l=>l!==void 0)),window._paq.push(["setCustomUrl",s])}else if(t==="search"){const{query:n,category:o=!1,results:i=!1}=e;window._paq.push(["trackSiteSearch",n,o,i])}else if(t==="matomo"){const n=e;$l.includes(n?.[0])&&typeof n[1]!="string"&&(n[1]=`${n[1]??""}`),window._paq.push(n)}}}}function ec(){if(document.getElementById(H)||window.localStorage.getItem(H))return;document.body.insertAdjacentHTML("afterbegin",`<dialog id="${H}" data-analytics="ignore"><style>
170
- #${H}[open] { box-sizing: border-box; display: flex; align-items: center; background: #116e6b; border-radius: .5em; border: 0; box-shadow: 0 .25em .5em rgba(0,0,0,.3); color: #fff; font-size: .875em; inset: auto auto 1em 1em; max-width: calc(100vw - 2em); outline: 0; padding: .5em; position: fixed; z-index: 99999 }
171
- #${H} button { all: unset; box-sizing: border-box; cursor: pointer; display: flex; width: 1.5em; height: 1.5em; font: 300 1.5em/1.35 sans-serif; border-radius: .25em; place-content: center; transition: .2s; transition-property: background, scale }
172
- #${H} button:focus-visible { outline: 2px solid }
173
- #${H} button:hover { background: #0a4e4f }
174
- #${H} button:active { background: #054449; scale: .9 }
175
- #${H} p { margin: 0 .25em }
199
+ ::slotted([role="option"][hidden]) { display: none !important }`,Pl=ql(qn),Oi,Ii=0,Vl=Ln||Me,Ni="click,focusout,input,keydown,mousedown,mouseup",Ri="focus,focusin,blur,focusout",Ne={singular:"%d hit",plural:"%d hits"},qi=class extends Ti{constructor(){super(),this._texts=Al({},Ne),this._value="",this._of="/",Ol(this,qn)}static get observedAttributes(){return["id",...Object.keys(Ne).map(t=>`data-sr-${t}`)]}connectedCallback(){this.hidden=!0,this._root=Li(this),L(this,"role","listbox"),L(this,"tabindex","-1"),Bt(this._root,"focusin",this),Bt(this._root,"focus",this,!0),Cn(this,{attributeFilter:["disabled","hidden","label","value"],attributes:!0,characterData:!0,childList:!0,subtree:!0}),setTimeout(()=>this.attributeChangedCallback())}disconnectedCallback(){Oe(this._root||this,"focus",this,!0),Oe(this._root||this,"focusin",this),Cn(this,!1),Wn(this),this._root=void 0}attributeChangedCallback(t,e,n){const o=t?.split("data-sr-")[1],i=`input[list="${this.id}"]`;if(Ne[o])this._texts[o]=n||Ne[o];else if(this._root){this._input&&Pn(this,this._input);for(const r of this._root.querySelectorAll(i))Pn(this,r)}}handleEvent(t){const{target:e,type:n}=t;t.defaultPrevented||(n==="click"&&zl(this,t),(n==="focus"||n==="focusin")&&Ul(this,t),(n==="blur"||n==="focusout")&&Dl(this,t),n==="keydown"&&Fl(this,t),n==="mousedown"&&this.contains(e)&&Nn(t),(n==="mutation"||n==="input")&&(clearTimeout(Ii),Ii=setTimeout(Vi,0,this,t)))}get options(){var t;if(!this._options){const e=(t=this.querySelector('[role="option"],option'))==null?void 0:t.nodeName;e&&(this._options=this.getElementsByTagName(e))}return this._options||this.getElementsByTagName("option")}},Wi=t=>t?.disabled||t?.readOnly||!1,Jt=(t,e)=>{var n,o,i;if(t.hidden!==e)return;t.hidden=Wi(t?._input)||!e,(n=Cn(t))==null||n.takeRecords();const r=t.isConnected&&t.popover&&((o=t._input)==null?void 0:o.isConnected)&&((i=t._input)==null?void 0:i.popoverTargetElement)===t;t._input&&Pn(t,t._input,e),r&&L(t,"popover","manual"),r&&t.togglePopover(e),e&&Vi(t)},Wn=t=>{t._input&&(Oe(t._input||t,Ri,t),Oe(t._root||t,Ni,t),Jt(t,!1),t._input=void 0)},Pn=(t,e,n=!1)=>{t.popover&&L(e,"popovertarget",Mn(t)),Bt(e,Ri,t,!0),L(e,"aria-autocomplete","list"),L(e,"aria-controls",Mn(t)),L(e,"aria-expanded",`${!Vl||n}`),L(e,"autocomplete","off"),L(e,"role",Wi(e)?null:"combobox")},Ul=(t,e)=>{var n;const o=e.target instanceof HTMLInputElement;o&&e.isTrusted&&e.stopImmediatePropagation(),t._input!==e.target&&o&&e.target.list===t&&(t._input&&Wn(t),t._input=e.target,t._input.dispatchEvent(new FocusEvent("focus")),t._input.dispatchEvent(new FocusEvent("focusin",{bubbles:!0})),L(t,Ll,Mn((n=t._input.labels)==null?void 0:n[0])),Bt(t._root||t,Ni,t),Jt(t,L(t._input,"inputmode")!=="none"),Mi())},Dl=(t,e)=>{!Me&&!Nn()&&t._input&&setTimeout(Pi,0,t),e.target===t._input&&e.isTrusted&&e.stopImmediatePropagation()},Pi=t=>{var e;const n=((e=t._root)==null?void 0:e.activeElement)||null,o=t._input;o&&o!==n&&!t.contains(n)&&(o.dispatchEvent(new FocusEvent("blur",{relatedTarget:n})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:n})),Wn(t))},zl=(t,{target:e})=>{var n;if(!t._input||t._input===e)return Jt(t,!0);for(const o of t.options)if(o.contains(e))return L(t,"aria-multiselectable")!=="true"&&((n=t._input)==null||n.focus(),Jt(t,!1)),Rl(t._input,o.value);Me&&Pi(t)},Fl=(t,e)=>{var n;const{key:o,target:i,altKey:r,ctrlKey:a,shiftKey:s,metaKey:c}=e,l=o==="Escape"||o==="Esc";if(r||a||c||s||o==="Tab")return;l&&!t.hidden&&e?.preventDefault(),Jt(t,!l);const d=[...t.options].filter(m=>L(m,"aria-hidden")!=="true"&&m.offsetHeight),u=d.indexOf(i);let p=-1;if(o==="ArrowDown"&&(p=(u+1)%d.length),o==="ArrowUp"&&(p=(~u?u:d.length)-1),~u&&((o==="Home"||o==="PageUp")&&(p=0),(o==="End"||o==="PageDown")&&(p=d.length-1),o==="Enter"))return d[u].click(),e.preventDefault();if(d[p])for(const m of d)m.tabIndex=-1;d[p]&&e.preventDefault(),(n=d[p]||t._input)==null||n.focus(),!d[p]&&o==="ArrowUp"&&setTimeout(()=>{var m;return(m=t._input)==null?void 0:m.setSelectionRange(999,999)})},Vi=(t,e)=>{const{_texts:n,_root:o,_input:i,options:r}=t,a=i?.value.toLowerCase().trim()||"",s=!t.hasAttribute("data-nofilter"),c=[],l=[];for(const p of r)(p.disabled||p.hidden||s&&!p.label.toLowerCase().includes(a)?c:l).push(p);for(const p of c)L(p,"aria-hidden","true");for(const p of l)L(p,"aria-hidden","false");const d=l.length;clearTimeout(Oi),e?.type==="input"&&a!==t._value&&(Oi=setTimeout(()=>{const p=`${!d&&t.innerText.trim()||`${n[d===1?"singular":"plural"]}`.replace("%d",`${d}`)}`;!t.hidden&&o?.activeElement===i&&Mi(p),t._value=a},1e3));let u=0;if(Ln)for(const p of l)L(p,"title",`${++u} ${t._of} ${d}`)};Ft&&Object.defineProperty(HTMLInputElement.prototype,"list",{configurable:!0,enumerable:!0,get(){return Li(this).getElementById(L(this,"list")||"")}}),Ci.define("u-datalist",qi),$()&&!wl()&&yl();const Bl="3.0.4",Ui="_alert_1d3iq_1 _ds-alert_17fn9_3",Di="_app_1d3iq_1",zi="_sticky_1d3iq_1",Fi="_avatar_1d3iq_1 _ds-avatar_17fn9_1",Bi="_badge_1d3iq_1",Gi="_breadcrumbs_1d3iq_1 _ds-breadcrumbs_17fn9_5",Ji="_button_1d3iq_1 _ds-button_17fn9_1",Hi="_card_1d3iq_1",ji="_group_1d3iq_1",Xi="_chip_1d3iq_1 _ds-chip_17fn9_5",Zi="_details_1d3iq_1 _ds-details_17fn9_3",Ki="_dialog_1d3iq_1 _ds-dialog_17fn9_5",Yi="__drawer_1d3iq_1",Qi="_divider_1d3iq_1",_i="_errorsummary_1d3iq_1 _ds-error-summary_17fn9_5",$i="_field_1d3iq_1 _ds-field_17fn9_1",tr="_suggestion_1d3iq_1 _ds-suggestion_17fn9_5",er="_affixes_1d3iq_1 _ds-field-affixes_17fn9_3",nr="_fieldset_1d3iq_1 _ds-fieldset_17fn9_3",or="_fileupload_1d3iq_1",ir="_helptext_1d3iq_1 _ds-focus_17fn9_1",rr="_input_1d3iq_1 _ds-input_17fn9_1",ar="_law_1d3iq_1",sr="_grid_1d3iq_1",lr="_flex_1d3iq_1",cr="_link_1d3iq_1",dr="_logo_1d3iq_1",ur="__logo_1d3iq_1",pr="_pagination_1d3iq_1 _ds-pagination_17fn9_5",mr="_popover_1d3iq_1 _ds-popover_17fn9_3",fr="_progress_1d3iq_1",hr="__indeterminate_1d3iq_1",gr="_skeleton_1d3iq_1 _ds-skeleton_17fn9_5",vr="__skeleton_1d3iq_1",br="_spinner_1d3iq_1",wr="_steps_1d3iq_1",yr="_table_1d3iq_1 _ds-table_17fn9_5",xr="__scrollShadow_1d3iq_1",Er="_tabs_1d3iq_1 _ds-tabs_17fn9_5",Sr="__scrollMask_1d3iq_1",kr="_tag_1d3iq_1 _ds-tag_17fn9_5",Tr="_toast_1d3iq_1",Ar="__toastClose_1d3iq_1",Lr="__toastOpen_1d3iq_1",Cr="__toastTimeout_1d3iq_1",Mr="_togglegroup_1d3iq_1 _ds-toggle-group_17fn9_5",Or="__tooltip_1d3iq_1 _ds-tooltip_17fn9_5",Ir="_heading_1d3iq_1 _ds-heading_17fn9_1",Nr="_ingress_1d3iq_1",Rr="_muted_1d3iq_1",qr="_info_1d3iq_1",Wr="_prose_1d3iq_1",Pr="_validation_1d3iq_1 _ds-validation-message_17fn9_1",Vr="_body_1d3iq_161",Ur="__checked_1d3iq_1",C={alert:Ui,app:Di,sticky:zi,avatar:Fi,badge:Bi,breadcrumbs:Gi,button:Ji,card:Hi,group:ji,chip:Xi,details:Zi,dialog:Ki,_drawer:Yi,divider:Qi,errorsummary:_i,field:$i,suggestion:tr,affixes:er,fieldset:nr,fileupload:or,helptext:ir,input:rr,law:ar,grid:sr,flex:lr,link:cr,logo:dr,_logo:ur,pagination:pr,popover:mr,progress:fr,_indeterminate:hr,skeleton:gr,_skeleton:vr,spinner:br,steps:wr,table:yr,_scrollShadow:xr,tabs:Er,_scrollMask:Sr,tag:kr,toast:Tr,_toastClose:Ar,_toastOpen:Lr,_toastTimeout:Cr,togglegroup:Mr,_tooltip:Or,heading:Ir,ingress:Nr,muted:Rr,info:qr,prose:Wr,validation:Pr,body:Vr,_checked:Ur},Gl=Object.freeze(Object.defineProperty({__proto__:null,_checked:Ur,_drawer:Yi,_indeterminate:hr,_logo:ur,_scrollMask:Sr,_scrollShadow:xr,_skeleton:vr,_toastClose:Ar,_toastOpen:Lr,_toastTimeout:Cr,_tooltip:Or,affixes:er,alert:Ui,app:Di,avatar:Fi,badge:Bi,body:Vr,breadcrumbs:Gi,button:Ji,card:Hi,chip:Xi,default:C,details:Zi,dialog:Ki,divider:Qi,errorsummary:_i,field:$i,fieldset:nr,fileupload:or,flex:lr,grid:sr,group:ji,heading:Ir,helptext:ir,info:qr,ingress:Nr,input:rr,law:ar,link:cr,logo:dr,muted:Rr,pagination:pr,popover:mr,progress:fr,prose:Wr,skeleton:gr,spinner:br,steps:wr,sticky:zi,suggestion:tr,table:yr,tabs:Er,tag:kr,toast:Tr,togglegroup:Mr,validation:Pr},Symbol.toStringTag,{value:"Module"}));function Dr(t){var e,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=Dr(t[e]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function Jl(){for(var t,e,n=0,o="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=Dr(t))&&(o&&(o+=" "),o+=e);return o}const Ht={capture:!0,passive:!0},Q=()=>typeof window<"u"&&typeof document<"u",mt=t=>Q()?document.getElementsByClassName(C[t].split(" ")[0]):[];function ft(t,e){let n;return function(...o){clearTimeout(n),n=setTimeout(()=>t.apply(this,o),e)}}const v=(t,e,n)=>n===void 0?t.getAttribute(e)??null:(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),W=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.addEventListener(i,...o);return()=>zr(t,...e)},zr=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.removeEventListener(i,...o)},ht=(t,e)=>{if(!Q())return;window._mtdsHotReloadCleanup||(window._mtdsHotReloadCleanup=new Map);const n=()=>{window._mtdsHotReloadCleanup?.get(t)?.map(o=>o()),window._mtdsHotReloadCleanup?.set(t,e())};document.readyState!=="complete"?W(window,"load",n):document.fonts?.ready?.then(n)||setTimeout(n,0)},Re=(t,e,n)=>{let o=0;const i=()=>{if(!t.isConnected)return r();e(a),a.takeRecords(),o=0},r=()=>a?.disconnect?.(),a=new MutationObserver(()=>{o||(o=requestAnimationFrame(i))});return a.observe(t,n),i(),r},O=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,r]of Object.entries(e))v(o,i,r);return o},Hl=typeof HTMLElement>"u"?class{}:HTMLElement,jl=(t,e)=>!Q()||window.customElements.get(t)||window.customElements.define(t,e),Xl=`[data-command="toggle-app-expanded"],.${C.app.split(" ")[0]} > [command="show-modal"]`,Zl=`.${C.breadcrumbs.split(" ")[0]}`,Kl=`.${C.card.split(" ")[0]}`,Fr=`.${C.chip.split(" ")[0]}`,Yl=`.${C.helptext.split(" ")[0]}`,Ql=`.${C.pagination.split(" ")[0]}`,_l='summary,u-summary,a,button,[role="tab"],[role="button"]',Vn="mattilsynet.matomo.cloud",$l=["setCustomUrl","setDocumentTitle","setReferrerUrl"],J="mtds-analytics-banner",tc="https://www.mattilsynet.no/om-mattilsynet/personvernerklaering/informasjonskapsler";function Br(t,e={}){if(Q()){if(window._paq||(window._paq=[],window._paq.push(["HeatmapSessionRecording::disable"]),window._paq.push(["enableLinkTracking"]),window._paq.push(["setTrackerUrl",`https://${Vn}/matomo.php`])),window._mtm||(window._mtm=window._mtm||[],window._mtm.push({"mtm.startTime":Date.now(),event:"mtm.Start"})),t==="init"){window._mtdsTracking={enabled:window.location.hostname!=="localhost",...window._mtdsTracking,...e};const{consent:n,enabled:o,matomoId:i,matomoTagManagerId:r}=window._mtdsTracking;if(i&&window._paq.push(["setSiteId",i]),o){n!=="custom"&&ec();const a=r?`https://cdn.matomo.cloud/${Vn}/container_${r}.js`:`https://cdn.matomo.cloud/${Vn}/matomo.js`;document.querySelector(`script[src="${a}"]`)||document.head.append(O("script",{async:"",src:a}))}}if(window._mtdsTracking?.enabled!==!1){if(window._mtdsTracking?.enabled==="debug")return console.info(`analytics ${t}:`,e);if(t==="pageview"){const{url:n,title:o}=e;window._paq.push(["setCustomUrl",n||location.href]),window._paq.push(["setDocumentTitle",o||document.title]),window._paq.push(["trackPageView"])}else if(t==="event"){const{category:n,action:o,name:i,value:r}=e,a=["trackEvent",n,o,i,r];let s=location.href;window._paq.push([function(){s=this.getCurrentUrl()}]),window._paq.push(["setCustomUrl",s.split("#")[0]]),window._paq.push(a.filter(c=>c!==void 0)),window._paq.push(["setCustomUrl",s])}else if(t==="search"){const{query:n,category:o=!1,results:i=!1}=e;window._paq.push(["trackSiteSearch",n,o,i])}else if(t==="matomo"){const n=e;$l.includes(n?.[0])&&typeof n[1]!="string"&&(n[1]=`${n[1]??""}`),window._paq.push(n)}}}}function ec(){if(document.getElementById(J)||window.localStorage.getItem(J))return;document.body.insertAdjacentHTML("afterbegin",`<dialog id="${J}" data-analytics="ignore"><style>
200
+ #${J}[open] { box-sizing: border-box; display: flex; align-items: center; background: #116e6b; border-radius: .5em; border: 0; box-shadow: 0 .25em .5em rgba(0,0,0,.3); color: #fff; font-size: .875em; inset: auto auto 1em 1em; max-width: calc(100vw - 2em); outline: 0; padding: .5em; position: fixed; z-index: 99999 }
201
+ #${J} button { all: unset; box-sizing: border-box; cursor: pointer; display: flex; width: 1.5em; height: 1.5em; font: 300 1.5em/1.35 sans-serif; border-radius: .25em; place-content: center; transition: .2s; transition-property: background, scale }
202
+ #${J} button:focus-visible { outline: 2px solid }
203
+ #${J} button:hover { background: #0a4e4f }
204
+ #${J} button:active { background: #054449; scale: .9 }
205
+ #${J} p { margin: 0 .25em }
176
206
  </style>
177
207
  <p>Vi bruker <a href="${tc}" target="_blank">informasjonskapsler</a> for å forbedre brukeropplevelsen.</p>
178
208
  <form method="dialog" data-analytics="ignore"><button type="submit" aria-label="OK">&times;</button></form>
179
- </dialog>`);const e=document.getElementById(H),n=()=>window.localStorage.setItem(H,"seen");e.addEventListener("close",n,{once:!0}),e.show()}function nc(t){window._mtdsTracking?.enabled&&setTimeout(oc,0,t)}function oc({type:t,target:e}){const n=t==="click"?e?.closest?.(_l):e;if(!(n instanceof Element)||n.closest('[data-analytics="ignore"]'))return;let o="click",i="Button",r=Gr(n)||ac(n)||v(n,"data-tooltip")||"";if(t==="submit")i="Form",o="submit",r=r||document.title;else if(t==="toggle"){if(!n.matches("dialog:modal"))return;i="Dialog",o="open"}else if(t==="change"){const a=v(n,"type"),s=a==="checkbox"||a==="radio"?n.closest("fieldset"):null;i=n.closest(Fr)?"Chip":"Form",o="change",r=Gr(s||n)||jt(s?.querySelector("legend"))||jt(n?.labels?.[0])}else if(v(n,"role")==="tab")i="Tab",o="navigate";else if(v(n,"popovertarget")){if(!ic(n)?.matches(":popover-open"))return;i=n.closest(Yl)?"HelpText":"Popover",o="open"}else if(n.nodeName.endsWith("SUMMARY")){if(!n.parentElement.open)return;i="Details",o="open"}else if(n.matches(Xl)){const a=rc(n,"--mtds-tooltip-position")==="none";i="Sidebar",o=a?"expand":"minimize",r=a&&v(n,"data-tooltip")||jt(n)}else if(n.closest(Zl))i="Breadcrumbs",o="navigate";else if(n.closest(Ql))i="Pagination",o="navigate";else if(n.closest(Kl))i="Card",o=n instanceof HTMLAnchorElement?"navigate":"click";else if(n.closest(Fr))i="Chip",o=n.hasAttribute("data-removable")?"remove":"click";else if(n.closest("th[aria-sort]"))i="Table",o="sort";else if(n instanceof HTMLAnchorElement)i="Link",o=n.protocol==="mailto:"?"email":"navigate",n.hasAttribute("download")?o="download":n.hash&&n.href.startsWith(location.href.split("#")[0])&&(o="anchor");else if(n.hasAttribute("aria-expanded")){if(v(n,"aria-expanded")!=="true")return;i="Expand",o="open"}else n.nodeName.startsWith("MTDS-ATLAS-")&&(i="Map Marker",o="open");Br("event",{category:v(n,"data-analytics-category")??i,action:v(n,"data-analytics-action")??o,name:v(n,"data-analytics-name")??r})}const jt=t=>t?.textContent?.trim()||"",Gr=t=>t&&v(t,"aria-label")||"",ic=t=>document.getElementById(v(t,"popovertarget")||""),rc=(t,e)=>window.getComputedStyle(t).getPropertyValue(e)?.trim(),ac=t=>{const e=jt(t),n=jt(t.querySelector("h1,h2,h3,h4,h5,h6"));return e.startsWith(n)&&n||e.slice(0,100).trim()};ht("analytics",()=>[W(document,"click toggle submit change",nc,Ht)]),typeof window<"u"&&window.CSSStyleSheet&&document.adoptedStyleSheets&&(()=>{const t="--mtds-app-expanded",e=new CSSStyleSheet,n=()=>!window.localStorage.getItem(t)?.includes("false");document.adoptedStyleSheets.push(e),window.mtdsToggleAppExpanded=o=>{try{const i=o??!n();e.replaceSync?.(`:root { ${t}: var(${t}--${i})}`),window.localStorage.setItem(t,i)}catch{}},window.mtdsToggleAppExpanded(n())})();const Dn=C.app.split(" ")[0],sc=`[data-command="toggle-app-expanded"],.${Dn} > [command="show-modal"]`,zn=`.${Dn} > dialog,.${Dn} dialog ~ main`,Jr=mt("sticky"),Hr=t=>{document.startViewTransition?document.startViewTransition(t):t()},jr=t=>Hr(()=>window.mtdsToggleAppExpanded?.(t));function lc(t){const{target:e,defaultPrevented:n}=t,o=e?.closest?.("a");if(o?.closest("dialog")&&o?.closest(zn))return Xr();if(n||!(e instanceof HTMLButtonElement)||!e.matches(sc))return;const i=getComputedStyle(e).position==="sticky";t.preventDefault(),i?jr():Hr(()=>{const r=document.querySelector(zn);r?.setAttribute("closedby","any"),r?.showModal()})}function Xr(){document.querySelector(zn)?.close()}let Fn=0,Rt,nt=0,Bn=0,We=0,Gn=!1,Jn=0,gt=0;function cc(){if(!Jr?.length)return;const t=Jr[0],e=window.scrollY,n=e<gt;gt=e,n!==Rt&&(Fn=(t.parentElement?.getBoundingClientRect().top||0)+gt,Rt=n,Bn=t.offsetHeight,We=t.getBoundingClientRect().top+gt,Gn=t.offsetHeight<=window.innerHeight,Jn=window.innerHeight),!(nt===-1&&Gn)&&(nt!==-1&&(Gn||Rt&&gt<=We)?(t.style.setProperty("--pos","sticky"),t.style.setProperty("--top","0px"),nt=-1):nt===-1&&!Rt?(t.style.setProperty("--pos","relative"),t.style.setProperty("--top",`${Math.max(0,gt-Fn)}px`),nt=0):nt!==1&&!Rt&&gt+Jn>=We+Bn?(t.style.setProperty("--pos","sticky"),t.style.setProperty("--top",`${Jn-Bn}px`),nt=1):nt===1&&Rt&&(t.style.setProperty("--pos","relative"),t.style.setProperty("--top",`${We-Fn}px`),nt=0))}ht("app",()=>[W(document,"click",lc,!0),W(window,"resize",ft(Xr,100),Ht),W(window,"scroll",cc,Ht)]);const dc=/<[^>]+\bid="([^"]+)[^>]+>/gi,Zr=/\([^)]{1,4}\).{1,9}\d+\/\d+/i,uc=/<(h\d|[^>]+role="heading")[^>]*>(.*?)<\/?(h\d|br|div)/i,pc=/kapittel-\d+-ledd-\d+/,mc=/<button[^>]+>.*?<\/button>/g,fc=/►m\d+/i,Pe=/<[^>]+>/g,hc=/<dt([^>]*class="([^"]+)")?[^>]*>(.*?)<\/dt><dd[^>]*>(.*?)<\/dd>/gis,gc=/<(\/?)(article|footer|section)/gi,vc=/(src|href)="([^"]+)"/gi,bc=/(<li[^>]*)>\s*<div([^>]*>)|<\/div>(<\/li>)/gi,wc=/(<li[^>]+data-name="([^"]+)[^>]+>)(\s*<(ul|ol|div)[^>]+>)/gis,yc=/(<[^>]+class="[^"]*\bnumberedLegalP\b[^>]+>\s*)(\d+\.)(.*?)(?=<\/?(ul|ol|div)|$)/gis,Kr="https://lovdata.no/",xc={legacyid:{label:"Datokode",value:""},titleshort:{label:"Korttittel",value:""},title:{label:"Tittel",value:""},url:{label:"Url",value:""}},Hn=t=>Array.from(Array.isArray(t)?t:[t],e=>e instanceof HTMLButtonElement?e.value:e),Ec=t=>Array.from(t?.querySelectorAll('button[aria-checked="true"]')||[],e=>e.value),Sc=(t,e)=>{const n=Hn(t);e?.querySelectorAll("button").forEach(o=>{n.includes(o.value)&&v(o,"aria-checked",`${v(o,"aria-checked")!=="true"}`)})},kc=(t,e)=>{const n=Hn(t);e?.querySelectorAll("button").forEach(o=>{v(o,"aria-checked",`${n.includes(o.value)||!1}`)})},Tc=(t,e)=>{const n=Yr(e);return Hn(t).map(o=>Lc(o,n)).filter(o=>!!o)},Ac=t=>{const e=t.slice(0,t.indexOf("</dl>")),n={...xc};for(const o of e.matchAll(hc)){const i=o[2].replace(/-/g,"").toLowerCase();n[i]={label:o[3],value:o[4]}}return n},Yr=t=>t.includes("<main")?(t.split(/<\/?main[^>]*>/)[1]||"").replace(gc,"<$1div").replace(bc,"$1$2$3").replace(vc,(e,n,o)=>`${n}="${o.includes(":")?"":Kr}${o}" ${n==="href"?'rel="noopener noreferrer" target="_blank"':""}`).replace(yc,(e,n,o,i)=>`${n}<span class="data-originalId">${o}</span><div class="legalP" id="${vt("id",n)}-ledd-0">${i}</div>`).replace(wc,(e,n,o,i)=>`${n}<span class="data-originalId">${o}</span>${i}`).replace(dc,(e,n,o,i)=>{const r=Qr(e,n,o,i);return`${e}${r?`<button type="button" role="checkbox" aria-label="${r}" value="${n}"></button>`:""}`}):t,Lc=(t,e)=>{const n=pc.test(t),o=t.split("-").map((s,l,c)=>l%2?Cc(c.slice(0,l+1).join("-"),e,n):null).filter(s=>!!s);if(!o.length)return null;const i=o.filter(({url:s})=>s).pop()?.url||"",r=o.filter(s=>s.className==="section"&&Zr.test(s.label)),a=o.slice(o.indexOf(r.pop()||o[0])).map(s=>s.label).join(", ");return{...o.slice(-1)[0],path:o,label:a,url:i}},Cc=(t,e,n)=>{const o=e.lastIndexOf("<",e.indexOf(` id="${t}"`)),i=e.slice(o,e.indexOf(">",o)+1),r=vt("class",i),a=vt("data-lovdata-url",i),s=Qr(i,t,o,e);return{id:t,className:r,html:Oc(t,e),url:a?`${Kr}${a}`:"",label:!n&&r==="section"&&s?.match(Zr)?.[0]||s}},vt=(t,e)=>{const n=` ${t.toLowerCase()}="`,o=e.toLowerCase().indexOf(n),i=o+n.length;return o===-1?"":e.slice(i,e.indexOf('"',i))},Oc=(t,e)=>{const n=e.lastIndexOf("<",e.indexOf(` id="${t}"`)),o=e.length;let i=n+1,r=0;for(;i&&i<o;)if(i=e.indexOf("<",i)+1,e[i]!=="/")r++;else if(--r<0)break;const a=e.indexOf(">",i)+1;return i?e.slice(n,a).replace(mc,""):""},Qr=(t,e,n,o)=>Mc[vt("class",t)]?.(t,e,n,o)||"",Mc={numberedLegalP:t=>`nr. ${vt("data-numerator",t)}.`,section:(t,e,n,o)=>o.slice(n).match(uc)?.[2]?.replace(Pe,"")?.replace(fc,"").trim()||"",legalArticle:(t,e,n,o)=>{const i=o.indexOf(">",o.indexOf("legalArticleValue",n));return o.slice(i+1,o.indexOf("</span>",i)).replace(Pe,"").replace("Artikkel","artikkel")},legalP:(t,e)=>{const[n,o,i,r]=e.split("-").reverse();return`avsnitt ${(o==="nummer"?1:Number(n))+(r==="nummer"?1:0)}`},listArticle:(t,e,n,o)=>{const i=e.split("-"),r=` id="${i.slice(0,-2).join("-")}"`,a=o.lastIndexOf(r,n),s=o.slice(o.indexOf("<ol",a),n),l=vt("data-name",t)||"-",c=vt("type",s)||"-";let d="punkt";return c==="1"&&(d="tall"),c==="a"&&(d="bokstav"),c==="i"&&(d="romtertall"),`${d} ${l==="-"?i.pop():l.replace(Pe,"")}`},marginIdArticle:(t,e,n,o)=>{const i=o.indexOf(">",o.indexOf("data-marginOriginalId",n));return`nr. ${o.slice(i+1,o.indexOf("</span>",i)).replace(Pe,"")}`}};function q(t,e={}){const n=document.getElementById(e.id||"")||M("dialog");return v(n,"aria-busy",e.busy?"true":null),v(n,"class",Jl(C.toast,e.className)),v(n,"closedby",e.closedby||null),v(n,"data-color",e.color||null),v(n,"data-icon",`${e.icon??""}`||null),v(n,"data-timeout",`${e.timeout??""}`||null),v(n,"id",e.id||`${Date.now()}`),v(n,"open",e.open===!1?null:""),n.innerHTML=t,W(n,"animationend",Ic,{once:!0}),document.body.appendChild(n),n.id}function Ic({animationName:t,target:e}){t===C._toastClose&&e.remove()}q.success=(t,e)=>q(t,{color:"success",...e}),q.danger=(t,e)=>q(t,{color:"danger",...e}),q.info=(t,e)=>q(t,{color:"info",...e}),q.warning=(t,e)=>q(t,{color:"warning",...e}),q.neutral=(t,e)=>q(t,{color:"neutral",...e}),q.promise=async function(e,n){const{loading:o,success:i,error:r,...a}=n,s=q(o,{busy:!0,...a});try{const l=await e();return q.success(i,{id:s,busy:!1}),l}catch(l){throw q.danger(r,{id:s,busy:!1}),l}};const _r=new WeakSet,P=t=>!_r.has(t)&&_r.add(t),N=(t,e,n)=>window.dsWarnings===!1||console.warn(`\x1B[1m@mattilsynet/design:\x1B[m ${t} is deprecated, please use ${e}:`,n),Nc=mt("togglegroup"),$r=C.button.split(" "),Rc=()=>{for(const t of Nc){P(t)&&!t.hasAttribute("data-toggle-group")&&(v(t,"data-toggle-group","Valgknapper"),N('Only setting class="styles.togglegroup"','data-toggle-group="LABEL-HERE" attribute also for better accessibility',t));for(const e of t.getElementsByTagName("label"))P(e)&&!e.classList.contains($r[0])&&(e.classList.add(...$r),N('Only setting class="styles.button"','<label class="styles.button">',e))}},qc=mt("breadcrumbs"),Wc=()=>{for(const t of qc)P(t)&&t.nodeName!=="DS-BREADCRUMBS"&&(t.classList.add(...C.breadcrumbs.split(" ")),N('Only setting class="styles.breadcrumbs"','<ds-breadcrumbs class="styles.breadcrumbs">',t))},Pc=mt("errorsummary"),Vc=()=>{for(const t of Pc)P(t)&&t.nodeName!=="DS-ERROR-SUMMARY"&&N('Only setting class="styles.errorsummary"','<ds-error-summary class="styles.errorsummary">',t)},Uc=mt("dialog"),Dc=()=>{for(const t of Uc)if(P(t)&&(t.hasAttribute("data-variant")&&N('<dialog data-variant="drawer">','<dialog data-placement="center|left|right|top|bottom">',t),t.isConnected&&t.showModal&&t.close)){const e=v(t,"data-closedby");e&&(v(t,"closedby",e),N(`<dialog data-closedby="${e}">`,`<dialog closedby="${e}">`,t)),t.matches('[open]:not([data-modal="false"]):not(:modal)')?(N('<dialog data-modal="true">','.showModal() or <button command="show-modal" commandfor="DIALOG-ID"></button>',t),v(t,"open",null),t.showModal()):t.matches(":modal:not([open])")&&(v(t,"open",""),t.close())}},zc=()=>{for(const t of document.querySelectorAll("[data-count]"))if(P(t)){const e=v(t,"data-count");t.classList.add(...C.validation.split(" ")),v(t,"data-limit",e),N(`data-count="${e}"`,`class="styles.validation" data-field="counter" data-limit="${e}"`,t)}},Fc=()=>{for(const t of document.querySelectorAll("[data-command]"))if(P(t)){const e=v(t,"data-command");e==="row"?N(`<${t.nodeName.toLowerCase()} data-command="${e}">`,`<tr data-clickdelegatefor="${t.nodeName}-ID">`,t):N(`<button data-command="${e}">`,`<button command="${e?.replace("toggle-app-expanded","show-modal")}" commandfor="TARGET-ID">`,t)}},Bc=J()?document.getElementsByTagName("u-tabs"):[],Gc=()=>{for(const t of Bc)P(t)&&N("u-tabs","ds-tabs",t)},jn=C.suggestion.split(" "),Jc=J()?document.getElementsByTagName("u-combobox"):[],Hc=J()?document.getElementsByTagName("ds-suggestion"):[],jc=()=>{for(const t of Jc)P(t)&&(t.classList.add(...jn),N("<u-combobox>",'<ds-suggestion class="styles.suggestion">',t));for(const t of Hc)P(t)&&!t.classList.contains(jn[0])&&(t.classList.add(...jn),N("Only using <ds-suggestion>",'<ds-suggestion class="styles.suggestion">',t))},Xc=({target:t})=>{if(!(t instanceof Element))return;const e=t?.closest("tr")?.querySelector('[data-command="row"]');e&&!t?.closest('a,button,label,input,select,textarea,[role="button"]')&&e.click();const o=t?.closest("dialog");o&&t?.closest('[data-command="close"]')&&o.close()},Zc=mt("field"),Ve=new Set,Kc=()=>{for(const t of Zc)t.nodeName!=="DS-FIELD"&&(P(t)||N('Only setting class="styles.field"','<ds-field class="styles.field">',t),!Ve.has(t)&&Ve.add(t)&&Le.prototype.connectedCallback.call(t))},Yc=()=>{for(const t of Ve)Le.prototype.disconnectedCallback.call(t),Ve.delete(t)},Qc=`[data-description], .${C.field.split(" ")[0]} label + p`,_c=()=>{for(const t of document.querySelectorAll(Qc))P(t)&&t.getAttribute("data-field")!=="description"&&(v(t,"data-field","description"),N("Descriptions created by data-description of <p> only",'data-field="data-description"',t))},$c=mt("validation"),td=()=>{for(const t of $c)P(t)&&!t.hasAttribute("data-field")&&(v(t,"data-field","validation"),N('Only setting class="styles.validation"','class="styles.validation" data-field="validation"',t))},ed=()=>{for(const t of document.querySelectorAll("[popover][data-position]"))P(t)&&(v(t,"data-placement",v(t,"data-position")),N("data-position","data-placement",t))},nd=ft(()=>{zc(),Fc(),Wc(),Dc(),Vc(),_c(),td(),ed(),Kc(),Rc(),jc(),Gc()},200);ht("deprecations",()=>[Yc,W(document,"click",Xc,Ht),qe(document,nd,{attributeFilter:["class","data-command","data-count","data-description","data-variant","open"],attributes:!0,childList:!0,subtree:!0})]);const od=`/* NOTE: Using --mtds- not --mtds- since we're inside shadow dom */
209
+ </dialog>`);const e=document.getElementById(J),n=()=>window.localStorage.setItem(J,"seen");e.addEventListener("close",n,{once:!0}),e.show()}function nc(t){window._mtdsTracking?.enabled&&setTimeout(oc,0,t)}function oc({type:t,target:e}){const n=t==="click"?e?.closest?.(_l):e;if(!(n instanceof Element)||n.closest('[data-analytics="ignore"]'))return;let o="click",i="Button",r=Gr(n)||ac(n)||v(n,"data-tooltip")||"";if(t==="submit")i="Form",o="submit",r=r||document.title;else if(t==="toggle"){if(!n.matches("dialog:modal"))return;i="Dialog",o="open"}else if(t==="change"){const a=v(n,"type"),s=a==="checkbox"||a==="radio"?n.closest("fieldset"):null;i=n.closest(Fr)?"Chip":"Form",o="change",r=Gr(s||n)||jt(s?.querySelector("legend"))||jt(n?.labels?.[0])}else if(v(n,"role")==="tab")i="Tab",o="navigate";else if(v(n,"popovertarget")){if(!ic(n)?.matches(":popover-open"))return;i=n.closest(Yl)?"HelpText":"Popover",o="open"}else if(n.nodeName.endsWith("SUMMARY")){if(!n.parentElement.open)return;i="Details",o="open"}else if(n.matches(Xl)){const a=rc(n,"--mtds-tooltip-position")==="none";i="Sidebar",o=a?"expand":"minimize",r=a&&v(n,"data-tooltip")||jt(n)}else if(n.closest(Zl))i="Breadcrumbs",o="navigate";else if(n.closest(Ql))i="Pagination",o="navigate";else if(n.closest(Kl))i="Card",o=n instanceof HTMLAnchorElement?"navigate":"click";else if(n.closest(Fr))i="Chip",o=n.hasAttribute("data-removable")?"remove":"click";else if(n.closest("th[aria-sort]"))i="Table",o="sort";else if(n instanceof HTMLAnchorElement)i="Link",o=n.protocol==="mailto:"?"email":"navigate",n.hasAttribute("download")?o="download":n.hash&&n.href.startsWith(location.href.split("#")[0])&&(o="anchor");else if(n.hasAttribute("aria-expanded")){if(v(n,"aria-expanded")!=="true")return;i="Expand",o="open"}else n.nodeName.startsWith("MTDS-ATLAS-")&&(i="Map Marker",o="open");Br("event",{category:v(n,"data-analytics-category")??i,action:v(n,"data-analytics-action")??o,name:v(n,"data-analytics-name")??r})}const jt=t=>t?.textContent?.trim()||"",Gr=t=>t&&v(t,"aria-label")||"",ic=t=>document.getElementById(v(t,"popovertarget")||""),rc=(t,e)=>window.getComputedStyle(t).getPropertyValue(e)?.trim(),ac=t=>{const e=jt(t),n=jt(t.querySelector("h1,h2,h3,h4,h5,h6"));return e.startsWith(n)&&n||e.slice(0,100).trim()};ht("analytics",()=>[W(document,"click toggle submit change",nc,Ht)]),typeof window<"u"&&window.CSSStyleSheet&&document.adoptedStyleSheets&&(()=>{const t="--mtds-app-expanded",e=new CSSStyleSheet,n=()=>!window.localStorage.getItem(t)?.includes("false");document.adoptedStyleSheets.push(e),window.mtdsToggleAppExpanded=o=>{try{const i=o??!n();e.replaceSync?.(`:root { ${t}: var(${t}--${i})}`),window.localStorage.setItem(t,i)}catch{}},window.mtdsToggleAppExpanded(n())})();const Un=C.app.split(" ")[0],sc=`[data-command="toggle-app-expanded"],.${Un} > [command="show-modal"]`,Dn=`.${Un} > dialog,.${Un} dialog ~ main`,Jr=mt("sticky"),Hr=t=>{document.startViewTransition?document.startViewTransition(t):t()},jr=t=>Hr(()=>window.mtdsToggleAppExpanded?.(t));function lc(t){const{target:e,defaultPrevented:n}=t,o=e?.closest?.("a");if(o?.closest("dialog")&&o?.closest(Dn))return Xr();if(n||!(e instanceof HTMLButtonElement)||!e.matches(sc))return;const i=getComputedStyle(e).position==="sticky";t.preventDefault(),i?jr():Hr(()=>{const r=document.querySelector(Dn);r?.setAttribute("closedby","any"),r?.showModal()})}function Xr(){document.querySelector(Dn)?.close()}let zn=0,Rt,nt=0,Fn=0,qe=0,Bn=!1,Gn=0,gt=0;function cc(){if(!Jr?.length)return;const t=Jr[0],e=window.scrollY,n=e<gt;gt=e,n!==Rt&&(zn=(t.parentElement?.getBoundingClientRect().top||0)+gt,Rt=n,Fn=t.offsetHeight,qe=t.getBoundingClientRect().top+gt,Bn=t.offsetHeight<=window.innerHeight,Gn=window.innerHeight),!(nt===-1&&Bn)&&(nt!==-1&&(Bn||Rt&&gt<=qe)?(t.style.setProperty("--pos","sticky"),t.style.setProperty("--top","0px"),nt=-1):nt===-1&&!Rt?(t.style.setProperty("--pos","relative"),t.style.setProperty("--top",`${Math.max(0,gt-zn)}px`),nt=0):nt!==1&&!Rt&&gt+Gn>=qe+Fn?(t.style.setProperty("--pos","sticky"),t.style.setProperty("--top",`${Gn-Fn}px`),nt=1):nt===1&&Rt&&(t.style.setProperty("--pos","relative"),t.style.setProperty("--top",`${qe-zn}px`),nt=0))}ht("app",()=>[W(document,"click",lc,!0),W(window,"resize",ft(Xr,100),Ht),W(window,"scroll",cc,Ht)]);const dc=/<[^>]+\bid="([^"]+)[^>]+>/gi,Zr=/\([^)]{1,4}\).{1,9}\d+\/\d+/i,uc=/<(h\d|[^>]+role="heading")[^>]*>(.*?)<\/?(h\d|br|div)/i,pc=/kapittel-\d+-ledd-\d+/,mc=/<button[^>]+>.*?<\/button>/g,fc=/►m\d+/i,We=/<[^>]+>/g,hc=/<dt([^>]*class="([^"]+)")?[^>]*>(.*?)<\/dt><dd[^>]*>(.*?)<\/dd>/gis,gc=/<(\/?)(article|footer|section)/gi,vc=/(src|href)="([^"]+)"/gi,bc=/(<li[^>]*)>\s*<div([^>]*>)|<\/div>(<\/li>)/gi,wc=/(<li[^>]+data-name="([^"]+)[^>]+>)(\s*<(ul|ol|div)[^>]+>)/gis,yc=/(<[^>]+class="[^"]*\bnumberedLegalP\b[^>]+>\s*)(\d+\.)(.*?)(?=<\/?(ul|ol|div)|$)/gis,Kr="https://lovdata.no/",xc="https://www.mattilsynet.no/regelveiledning/?regelverk=",Ec={dokid:{label:"DokumentID",value:""},legacyid:{label:"Datokode",value:""},refid:{label:"RefID",value:""},title:{label:"Tittel",value:""},titleshort:{label:"Korttittel",value:""},url:{label:"Url",value:""}},Jn=t=>Array.from(Array.isArray(t)?t:[t],e=>e instanceof HTMLButtonElement?e.value:e),Sc=t=>Array.from(t?.querySelectorAll('button[aria-checked="true"]')||[],e=>e.value),kc=(t,e)=>{const n=Jn(t);e?.querySelectorAll("button").forEach(o=>{n.includes(o.value)&&v(o,"aria-checked",`${v(o,"aria-checked")!=="true"}`)})},Tc=(t,e)=>{const n=Jn(t);e?.querySelectorAll("button").forEach(o=>{v(o,"aria-checked",`${n.includes(o.value)||!1}`)})},Ac=(t,e)=>{const n=Yr(e);return Jn(t).map(o=>Cc(o,n)).filter(o=>!!o)},Lc=t=>{const e=t.slice(0,t.indexOf("</dl>")),n={...Ec};for(const o of e.matchAll(hc)){const i=o[2].replace(/-/g,"").toLowerCase();n[i]={label:o[3],value:o[4]}}return n},Yr=t=>t.includes("<main")?(t.split(/<\/?main[^>]*>/)[1]||"").replace(gc,"<$1div").replace(bc,"$1$2$3").replace(vc,(e,n,o)=>`${n}="${o.includes(":")?"":Kr}${o}" ${n==="href"?'rel="noopener noreferrer" target="_blank"':""}`).replace(yc,(e,n,o,i)=>`${n}<span class="data-originalId">${o}</span><div class="legalP" id="${vt("id",n)}-ledd-0">${i}</div>`).replace(wc,(e,n,o,i)=>`${n}<span class="data-originalId">${o}</span>${i}`).replace(dc,(e,n,o,i)=>{const r=Qr(e,n,o,i);return`${e}${r?`<button type="button" role="checkbox" aria-label="${r}" value="${n}"></button>`:""}`}):t,Cc=(t,e)=>{const n=pc.test(t),o=t.split("-").map((l,d,u)=>d%2?Mc(u.slice(0,d+1).join("-"),e,n):null).filter(l=>!!l);if(!o.length)return null;const i=o.filter(({guideUrl:l})=>l).pop()?.guideUrl,r=o.filter(({url:l})=>l).pop(),a=o.filter(l=>l.className==="section"&&Zr.test(l.label)).pop(),s=r?`${Kr}${r.url}`:"",c=o.slice(o.indexOf(a||o[0])).map(({label:l})=>l).join(", ");return{...o.slice(-1)[0],path:o,label:c,url:s,guideUrl:i}},Mc=(t,e,n)=>{const o=e.lastIndexOf("<",e.indexOf(` id="${t}"`)),i=e.slice(o,e.indexOf(">",o)+1),r=vt("class",i),a=vt("data-lovdata-url",i),s=Qr(i,t,o,e),[c,l,d]=a.match(/(lov|forskrift)\/([^/]+)/)||[],u=`${l?.slice(0,3).toUpperCase()}-${d}`;return{id:t,className:r,guideUrl:a&&`${xc}${u}_${t}`,html:Oc(t,e),url:a,label:!n&&r==="section"&&s?.match(Zr)?.[0]||s}},vt=(t,e)=>{const n=` ${t.toLowerCase()}="`,o=e.toLowerCase().indexOf(n),i=o+n.length;return o===-1?"":e.slice(i,e.indexOf('"',i))},Oc=(t,e)=>{const n=e.lastIndexOf("<",e.indexOf(` id="${t}"`)),o=e.length;let i=n+1,r=0;for(;i&&i<o;)if(i=e.indexOf("<",i)+1,e[i]!=="/")r++;else if(--r<0)break;const a=e.indexOf(">",i)+1;return i?e.slice(n,a).replace(mc,""):""},Qr=(t,e,n,o)=>Ic[vt("class",t)]?.(t,e,n,o)||"",Ic={numberedLegalP:t=>`nr. ${vt("data-numerator",t)}.`,section:(t,e,n,o)=>o.slice(n).match(uc)?.[2]?.replace(We,"")?.replace(fc,"").trim()||"",legalArticle:(t,e,n,o)=>{const i=o.indexOf(">",o.indexOf("legalArticleValue",n));return o.slice(i+1,o.indexOf("</span>",i)).replace(We,"").replace("Artikkel","artikkel")},legalP:(t,e)=>{const[n,o,i,r]=e.split("-").reverse();return`avsnitt ${(o==="nummer"?1:Number(n))+(r==="nummer"?1:0)}`},listArticle:(t,e,n,o)=>{const i=e.split("-"),r=` id="${i.slice(0,-2).join("-")}"`,a=o.lastIndexOf(r,n),s=o.slice(o.indexOf("<ol",a),n),c=vt("data-name",t)||"-",l=vt("type",s)||"-";let d="punkt";return l==="1"&&(d="tall"),l==="a"&&(d="bokstav"),l==="i"&&(d="romtertall"),`${d} ${c==="-"?i.pop():c.replace(We,"")}`},marginIdArticle:(t,e,n,o)=>{const i=o.indexOf(">",o.indexOf("data-marginOriginalId",n));return`nr. ${o.slice(i+1,o.indexOf("</span>",i)).replace(We,"")}`}};function q(t,e={}){const n=document.getElementById(e.id||"")||O("dialog");return v(n,"aria-busy",e.busy?"true":null),v(n,"class",Jl(C.toast,e.className)),v(n,"closedby",e.closedby||null),v(n,"data-color",e.color||null),v(n,"data-icon",`${e.icon??""}`||null),v(n,"data-timeout",`${e.timeout??""}`||null),v(n,"id",e.id||`${Date.now()}`),v(n,"open",e.open===!1?null:""),n.innerHTML=t,W(n,"animationend",Nc,{once:!0}),document.body.appendChild(n),n.id}function Nc({animationName:t,target:e}){t===C._toastClose&&e.remove()}q.success=(t,e)=>q(t,{color:"success",...e}),q.danger=(t,e)=>q(t,{color:"danger",...e}),q.info=(t,e)=>q(t,{color:"info",...e}),q.warning=(t,e)=>q(t,{color:"warning",...e}),q.neutral=(t,e)=>q(t,{color:"neutral",...e}),q.promise=async function(e,n){const{loading:o,success:i,error:r,...a}=n,s=q(o,{busy:!0,...a});try{const c=await e();return q.success(i,{id:s,busy:!1}),c}catch(c){throw q.danger(r,{id:s,busy:!1}),c}};const _r=new WeakSet,P=t=>!_r.has(t)&&_r.add(t),N=(t,e,n)=>window.dsWarnings===!1||console.warn(`\x1B[1m@mattilsynet/design:\x1B[m ${t} is deprecated, please use ${e}:`,n),Rc=mt("togglegroup"),$r=C.button.split(" "),qc=()=>{for(const t of Rc){P(t)&&!t.hasAttribute("data-toggle-group")&&(v(t,"data-toggle-group","Valgknapper"),N('Only setting class="styles.togglegroup"','data-toggle-group="LABEL-HERE" attribute also for better accessibility',t));for(const e of t.getElementsByTagName("label"))P(e)&&!e.classList.contains($r[0])&&(e.classList.add(...$r),N('Only setting class="styles.button"','<label class="styles.button">',e))}},Wc=mt("breadcrumbs"),Pc=()=>{for(const t of Wc)P(t)&&t.nodeName!=="DS-BREADCRUMBS"&&(t.classList.add(...C.breadcrumbs.split(" ")),N('Only setting class="styles.breadcrumbs"','<ds-breadcrumbs class="styles.breadcrumbs">',t))},Vc=mt("errorsummary"),Uc=()=>{for(const t of Vc)P(t)&&t.nodeName!=="DS-ERROR-SUMMARY"&&N('Only setting class="styles.errorsummary"','<ds-error-summary class="styles.errorsummary">',t)},Dc=mt("dialog"),zc=()=>{for(const t of Dc)if(P(t)&&(t.hasAttribute("data-variant")&&N('<dialog data-variant="drawer">','<dialog data-placement="center|left|right|top|bottom">',t),t.isConnected&&t.showModal&&t.close)){const e=v(t,"data-closedby");e&&(v(t,"closedby",e),N(`<dialog data-closedby="${e}">`,`<dialog closedby="${e}">`,t)),t.matches('[open]:not([data-modal="false"]):not(:modal)')?(N('<dialog data-modal="true">','.showModal() or <button command="show-modal" commandfor="DIALOG-ID"></button>',t),v(t,"open",null),t.showModal()):t.matches(":modal:not([open])")&&(v(t,"open",""),t.close())}},Fc=()=>{for(const t of document.querySelectorAll("[data-count]"))if(P(t)){const e=v(t,"data-count");t.classList.add(...C.validation.split(" ")),v(t,"data-limit",e),N(`data-count="${e}"`,`class="styles.validation" data-field="counter" data-limit="${e}"`,t)}},Bc=()=>{for(const t of document.querySelectorAll("[data-command]"))if(P(t)){const e=v(t,"data-command");e==="row"?N(`<${t.nodeName.toLowerCase()} data-command="${e}">`,`<tr data-clickdelegatefor="${t.nodeName}-ID">`,t):N(`<button data-command="${e}">`,`<button command="${e?.replace("toggle-app-expanded","show-modal")}" commandfor="TARGET-ID">`,t)}},Gc=Q()?document.getElementsByTagName("u-tabs"):[],Jc=()=>{for(const t of Gc)P(t)&&N("u-tabs","ds-tabs",t)},Hn=C.suggestion.split(" "),Hc=Q()?document.getElementsByTagName("u-combobox"):[],jc=Q()?document.getElementsByTagName("ds-suggestion"):[],Xc=()=>{for(const t of Hc)P(t)&&(t.classList.add(...Hn),N("<u-combobox>",'<ds-suggestion class="styles.suggestion">',t));for(const t of jc)P(t)&&!t.classList.contains(Hn[0])&&(t.classList.add(...Hn),N("Only using <ds-suggestion>",'<ds-suggestion class="styles.suggestion">',t))},Zc=({target:t})=>{if(!(t instanceof Element))return;const e=t?.closest("tr")?.querySelector('[data-command="row"]');e&&!t?.closest('a,button,label,input,select,textarea,[role="button"]')&&e.click();const o=t?.closest("dialog");o&&t?.closest('[data-command="close"]')&&o.close()},Kc=mt("field"),Pe=new Set,Yc=()=>{for(const t of Kc)t.nodeName!=="DS-FIELD"&&(P(t)||N('Only setting class="styles.field"','<ds-field class="styles.field">',t),!Pe.has(t)&&Pe.add(t)&&Ae.prototype.connectedCallback.call(t))},Qc=()=>{for(const t of Pe)Ae.prototype.disconnectedCallback.call(t),Pe.delete(t)},_c=`[data-description], .${C.field.split(" ")[0]} label + p`,$c=()=>{for(const t of document.querySelectorAll(_c))P(t)&&t.getAttribute("data-field")!=="description"&&(v(t,"data-field","description"),N("Descriptions created by data-description of <p> only",'data-field="data-description"',t))},td=mt("validation"),ed=()=>{for(const t of td)P(t)&&!t.hasAttribute("data-field")&&(v(t,"data-field","validation"),N('Only setting class="styles.validation"','class="styles.validation" data-field="validation"',t))},nd=()=>{for(const t of document.querySelectorAll("[popover][data-position]"))P(t)&&(v(t,"data-placement",v(t,"data-position")),N("data-position","data-placement",t))},od=ft(()=>{Fc(),Bc(),Pc(),zc(),Uc(),$c(),ed(),nd(),Yc(),qc(),Xc(),Jc()},200);ht("deprecations",()=>[Qc,W(document,"click",Zc,Ht),Re(document,od,{attributeFilter:["class","data-command","data-count","data-description","data-variant","open"],attributes:!0,childList:!0,subtree:!0})]);const id=`/* NOTE: Using --mtds- not --mtds- since we're inside shadow dom */
180
210
  :host(:not([hidden])) { display: grid; gap: var(--mtds-6) }
181
211
  [data-event] { cursor: pointer } /* Used to forward clicks from Chart ShaowDOM to relevant cell in child table */
182
212
 
@@ -343,8 +373,8 @@ Please use <details> and <summary>, but import '@u-elements/u-details/polyfill'
343
373
  vertical-align: middle;
344
374
  width: var(--mtds-5);
345
375
  }
346
- `,id=[.1,.2,.25,.5,1];function rd(t,{aspect:e,type:n}){const i=n==="stacked",r=t[0].reduce((b,f,g)=>{const h=t.map(E=>E[g].number),w=h.reduce((E,x)=>E+x,0);return Math.max(b,...i?[w]:h)},0),a=r/10,s=10**`${Math.round(a)}`.length,l=a/s,c=(id.find(b=>b>l)||1)*s,d=Math.ceil(r/c)*c,u=M("div",{"aria-label":t[0][0].value||null,class:"axis",role:"figure",style:`${e?`--mtdsc-chart-aspect: ${e};`:""} --bars: ${t[0]?.length-1}; --groups: ${t.length-1}; --total: ${d}`}),p=u.appendChild(M("div",{class:"axisSteps"})),m=u.appendChild(M("div",{class:"axisGroups"}));return Array.from({length:d/c+1},(b,f)=>ad(c*f)).reverse().map(b=>p.append(M("div",{class:"axisStep","data-label":b}))),{total:d,groups:m,axis:u}}const ad=new Intl.NumberFormat().format;function sd(t){return t[0].slice(1).map(({value:e,event:n},o)=>{const i=M("div",{class:"axisGroup","data-label":e}),r=i.appendChild(M("div",{class:"axisGroupContent"}));return t.slice(1).map(a=>a[o+1]).map(({tooltip:a,style:s,number:l})=>r.appendChild(M("div",{"aria-label":a,"data-event":n,class:"bar",role:"img",style:`${s}; --value: ${l}`,tabindex:"0"}))),i})}function ld(t,{total:e,type:n,variant:o}){const i=Number.parseFloat(n||"0")||0,r=M("div",{class:"axisGroup"});return t.slice(1).forEach(([,...a])=>{const s=M("div",{class:"lineContainer",role:"list",style:a[0].style}),l=cd(a.map(({number:u},p,{length:m})=>[100/(m-1)*p,100-u/e*100]),i/100),c=document.createElementNS("http://www.w3.org/2000/svg","svg");v(c,"aria-hidden","true"),v(c,"preserveAspectRatio","none"),v(c,"viewBox","0 0 100 100");const d=document.createElementNS("http://www.w3.org/2000/svg","path");if(v(d,"class","line"),v(d,"d",l),v(d,"fill","none"),v(d,"stroke","currentColor"),o==="area"){const u=d.cloneNode(!0);v(u,"d",`M-100,100 L${l.slice(1)}L200,100`),v(u,"class","lineShade"),c.append(u)}a.forEach(({number:u,tooltip:p,event:m})=>{const b=M("div",{role:"listitem"});b.appendChild(M("div",{"aria-label":p,"data-event":m,tabindex:"0",class:"linePoint",role:"img",style:`--value: ${u}`})),s.append(b)}),s.appendChild(c).append(d),r.append(s)}),r}const cd=(t,e)=>t.map(([n,o],i,r)=>i?dd(i,r,e):`M${n},${o}`).join(" "),ta=([t,e],[n,o])=>[t+n,e+o],ea=([t,e],[n,o])=>[t-n,e-o],na=(t,[e,n])=>[t*e,t*n],dd=(t,e,n)=>{const o=e[t-1],i=e[t],[r,a]=ta(o,na(n,ea(i,e[t-2]||o))),[s,l]=ta(i,na(n,ea(o,e[t+1]||i)));return`C ${r},${a} ${s},${l} ${i[0]},${i[1]}`};function ud(t,{aspect:e,variant:n}){const o=document.createElementNS("http://www.w3.org/2000/svg","svg");e&&o.style.setProperty("--mtdsc-chart-aspect",e),v(o,"class","pie"),v(o,"viewBox","0 0 100 100");let i=0;const r=50,a=n==="doughnut"?25:0,s=t.slice(1).reduce((l,[,c])=>l+c.number,0);return t.slice(1).forEach(([,{tooltip:l,number:c,event:d,style:u}])=>{if(!c)return;const p=document.createElementNS("http://www.w3.org/2000/svg","path"),m=i/s;i+=c;const b=Math.min(i/s,.99999),f=b-m>.5?1:0,g=2*Math.PI*(m-.25),h=2*Math.PI*(b-.25),w=Math.cos(g),E=Math.sin(g),x=Math.cos(h),S=Math.sin(h),A=`M ${r+a*w} ${r+a*E} L ${r+r*w} ${r+r*E} A ${r} ${r} 0 ${f} 1 ${r+r*x} ${r+r*S} L ${r+a*x} ${r+a*S} A ${a} ${a} 0 ${f} 0 ${r+a*w} ${r+a*E}`;v(p,"aria-label",l),v(p,"data-event",d),v(p,"style",u),v(p,"d",A),v(p,"role","img"),v(p,"tabindex","0"),o.appendChild(p)}),o}const oa="click keydown mousemove mouseout",ia="mtds-chart-tooltip",rt=J()?document.getElementById(ia)||M("div",{"aria-hidden":"true",class:C._tooltip,hidden:"",id:ia}):null;class pd extends Hl{#t;#e;static get observedAttributes(){return["data-variant","data-aspect"]}constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const e=ft(()=>this.attributeChangedCallback(),100),n=new ResizeObserver(()=>this.handleResize());n.observe(this),this.#e=()=>n.disconnect(),this.#t=qe(this,e,{attributeFilter:["data-tooltip"],attributes:!0,characterData:!0,childList:!0,subtree:!0}),requestAnimationFrame(()=>this.attributeChangedCallback()),W(this,oa,this)}disconnectedCallback(){rt&&(rt.hidden=!0),zr(this,oa,this),this.#e?.(),this.#t?.(),this.#t=this.#e=void 0}attributeChangedCallback(){const e=hd(this.querySelector("table"));if(!e[0])return;Array.from(this.shadowRoot?.children||[]).map(d=>d.remove());const[n,o]=(v(this,"data-variant")||"column").split("-"),i=v(this,"data-aspect")||void 0,r=M("style",{},od),a=M("div",{"aria-hidden":"hidden",class:"legends",role:"group"});e.slice(1).forEach(([{value:d,style:u}])=>{a.appendChild(M("div",{class:"legend",style:u},d))});const{axis:s,groups:l,total:c}=rd(e,{aspect:i,type:o});(n==="column"||n==="bar")&&l.append(...sd(e)),(n==="line"||n==="area")&&l.append(ld(e,{total:c,variant:n,type:o})),(n==="doughnut"||n==="pie")&&this.shadowRoot?.append(ud(e,{aspect:i,variant:n})),this.shadowRoot?.append(s,a,r)}handleEvent(e){e.type==="click"||e.type==="keydown"?md(e,this):fd(e)}handleResize(){const e=this.shadowRoot?.firstElementChild,n=e?.firstElementChild;e?.classList.toggle("axisStepsYHalf",(n?.offsetHeight||0)<400),e?.classList.toggle("axisStepsXHalf",(n?.offsetWidth||0)<500)}}function md(t,e){if(t instanceof KeyboardEvent&&t.key!=="Enter")return;const n=t.composedPath()[0],o=e.querySelector("table"),[i,r]=n instanceof Element&&v(n,"data-event")?.split("-").map(Number)||[];o?.rows[i]?.cells[r]?.querySelector("a,button")?.click?.()}let ra="";function fd(t){if(!rt)return;rt?.isConnected||document.body.append(rt);const e=t.composedPath()[0],n=e instanceof Element&&e.getAttribute("aria-label")||"";n&&(rt.style.transform=`translate(${Math.min(t.clientX,window.innerWidth)}px, ${t.clientY}px)`),n!==ra&&(n&&(rt.textContent=n),ra=n,rt.hidden=!n)}const Xt=t=>t?.textContent?.trim()||"",hd=t=>Array.from(t?.rows||[],(e,n)=>Array.from(e.cells,(o,i)=>{const r=Xt(e.cells[0]),a=Xt(t?.rows[0].cells[i]),s=`${r}: ${Xt(o)}${a?` (${a})`:""}`;return v(o,"tabindex","-1"),{number:i&&n&&Number.parseFloat(Xt(o))||0,event:o.querySelector("a,button")&&`${n}-${i}`,style:`--color: var(--mtdsc-chart-color-${n}, var(--mtdsc-chart-color-base))`,value:Xt(o),tooltip:v(o,"data-tooltip")||s}}));jl("mtds-chart",pd);const gd=ft(t=>{if(t.animationName!==C._logo)return;const e=t.target.closest?.(`.${C.logo.split(" ")[0]}`),n=e?.firstElementChild;if(n instanceof SVGSVGElement){for(const l of document.head.querySelectorAll("link[rel~='icon']"))l.setAttribute("rel","disabled");const o=e?.hasAttribute("data-env"),i=window.getComputedStyle(n),r=i.getPropertyValue("color"),a=i.getPropertyValue("--mtdsc-logo-background"),s=n.outerHTML.replace(/\n+/g," ").replace(/(fill|width|height|xmlns)="[^"]+"/gi,"").replace("<svg",`<svg width="40" height="40" fill="${r}"`);document.head.appendChild(M("link",{href:`data:image/svg+xml,${encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 55 55'><rect fill='${o?"none":a}' width='51' height='51' x='2' y='2' stroke='${r}' stroke-dasharray='0.09 6.38' stroke-linecap='round' stroke-opacity='${o?.6:0}' stroke-width='2.3' rx='25.5'/><g transform="translate(7.5 7.5)">${s}</g></svg>`)}`,rel:"icon"}))}},200);ht("logo",()=>[W(document,"animationend",gd)]);const vd=J()?document.getElementsByTagName("table"):[],bd=()=>{for(const t of vd){const e=Array.from(t.tHead?.rows[0]?.cells||[],n=>n.innerText.trim());for(const n of t.tBodies)for(const o of n.rows)for(const i of o.cells)v(i,"data-th",e[i.cellIndex]||":empty")}};ht("table",()=>[qe(document,ft(bd,200),{attributeFilter:["data-mobile"],attributes:!0,childList:!0,subtree:!0})]);const aa=C.toast.split(" ")[0],Ue="data-sort";function wd({animationName:t,target:e}){const n=e;if(t===C._toastTimeout&&n.close(),t!==C._toastOpen)return;const o=Number(v(n,"data-timeout"));n.style.setProperty("--mtdsc-toast-timeout",o?`${o}ms`:null),n.hasAttribute(Ue)||v(n,Ue,`${Date.now()}`),v(n,"tabindex","0"),[...document.querySelectorAll(`.${aa}[open]`)].sort((i,r)=>Number(v(r,Ue))-Number(v(i,Ue))).reduce((i,r)=>(r.style.translate=`0 ${r===e?0:i}px`,i+r.offsetHeight+5),0)}function yd({target:t,clientX:e,clientY:n}){if(t instanceof HTMLDialogElement&&t.classList.contains(aa)&&v(t,"data-closedby")!=="none"){const o=t.getBoundingClientRect(),i=window.getComputedStyle(t),r=window.getComputedStyle(t,"::after"),a=o.top+Number.parseInt(i.paddingTop,10),s=a+Number.parseInt(r.height,10),l=o.right-Number.parseInt(i.paddingRight,10),c=l-Number.parseInt(r.width,10);a<=n&&n<=s&&c<=e&&e<=l&&t.close()}}ht("toast",()=>[W(document,"animationstart",wd),W(document,"click",yd)]),J()&&Mo(document.getElementById("mtds-tooltip")||M("div",{class:C._tooltip,id:"mtds-tooltip"}));const xd=`.${C.field.split(" ")[0]}`,Ed=":is(input,textarea,select)",Sd="ds-suggestion,u-combobox",kd=C.validation.split(" ")[0],Td='[data-validation="form"]',Xn=t=>{const e=t?.type==="input",n=!e&&t;for(const o of document.forms)if(o.getAttribute("data-validation")==="form"){let i;for(const r of o.querySelectorAll(Ed)){if(!r.clientHeight)continue;const a=r.closest("fieldset")||r.closest(xd)||o,s=r.closest(Sd),l=s?v(r,"aria-required")==="true"&&!!s?.items.length:r.validity.valid;if(!i&&!l&&(i=r),!e||t.target===r)for(const c of a.getElementsByClassName(kd)){const d=a.nodeName==="FIELDSET"&&c.parentElement!==a;v(c,"hidden",d||!n||l?"":null)}}i&&n&&o.contains(t?.target)&&(t.preventDefault(),i.focus())}},Ad=t=>t.target?.closest?.(Td)&&t?.preventDefault();ht("validations",()=>[W(document,"submit",Xn,!0),W(document,"invalid",Ad,!0),W(document,"invalid input",ft(Xn,10),Ht),qe(document,ft(()=>Xn(),10),{childList:!0,subtree:!0})]);var Zn=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",sa=Zn&&/iPad|iPhone|iPod/.test(navigator.userAgent),la;Zn&&/^Mac/i.test(((la=navigator.userAgentData)==null?void 0:la.platform)||navigator.platform);var Ld=typeof HTMLElement>"u"?class{}:HTMLElement;function z(t,e,n){return n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}var Cd=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},Od=0,Md=t=>t?(t.id||(t.id=`:${t.nodeName.toLowerCase()}${(++Od).toString(32)}`),t.id):"",Id=(t,e,n)=>{const o=document.createElement(t);return o.textContent=e,o},Nd={define:(t,e)=>!Zn||window.customElements.get(t)||window.customElements.define(t,e)},Rd=t=>{var e;const n=z(t,"aria-label")||"";return[...(((e=z(t,"aria-labelledby"))==null?void 0:e.trim().split(/\s+/))||[]).map(i=>document.getElementById(i)),...Array.from(t.labels||[])].reduce((i,r)=>{var a;return i||((a=r?.innerText)==null?void 0:a.trim())||""},n)},qd=`:host(:not([hidden])) { box-sizing: border-box; border: 1px solid; display: inline-block; height: .5em; width: 10em; overflow: hidden }
376
+ `,rd=[.1,.2,.25,.5,1];function ad(t,{aspect:e,type:n}){const i=n==="stacked",r=t[0].reduce((b,f,g)=>{const h=t.map(E=>E[g].number),w=h.reduce((E,x)=>E+x,0);return Math.max(b,...i?[w]:h)},0),a=r/10,s=10**`${Math.round(a)}`.length,c=a/s,l=(rd.find(b=>b>c)||1)*s,d=Math.ceil(r/l)*l,u=O("div",{"aria-label":t[0][0].value||null,class:"axis",role:"figure",style:`${e?`--mtdsc-chart-aspect: ${e};`:""} --bars: ${t[0]?.length-1}; --groups: ${t.length-1}; --total: ${d}`}),p=u.appendChild(O("div",{class:"axisSteps"})),m=u.appendChild(O("div",{class:"axisGroups"}));return Array.from({length:d/l+1},(b,f)=>sd(l*f)).reverse().map(b=>p.append(O("div",{class:"axisStep","data-label":b}))),{total:d,groups:m,axis:u}}const sd=new Intl.NumberFormat().format;function ld(t){return t[0].slice(1).map(({value:e,event:n},o)=>{const i=O("div",{class:"axisGroup","data-label":e}),r=i.appendChild(O("div",{class:"axisGroupContent"}));return t.slice(1).map(a=>a[o+1]).map(({tooltip:a,style:s,number:c})=>r.appendChild(O("div",{"aria-label":a,"data-event":n,class:"bar",role:"img",style:`${s}; --value: ${c}`,tabindex:"0"}))),i})}function cd(t,{total:e,type:n,variant:o}){const i=Number.parseFloat(n||"0")||0,r=O("div",{class:"axisGroup"});return t.slice(1).forEach(([,...a])=>{const s=O("div",{class:"lineContainer",role:"list",style:a[0].style}),c=dd(a.map(({number:u},p,{length:m})=>[100/(m-1)*p,100-u/e*100]),i/100),l=document.createElementNS("http://www.w3.org/2000/svg","svg");v(l,"aria-hidden","true"),v(l,"preserveAspectRatio","none"),v(l,"viewBox","0 0 100 100");const d=document.createElementNS("http://www.w3.org/2000/svg","path");if(v(d,"class","line"),v(d,"d",c),v(d,"fill","none"),v(d,"stroke","currentColor"),o==="area"){const u=d.cloneNode(!0);v(u,"d",`M-100,100 L${c.slice(1)}L200,100`),v(u,"class","lineShade"),l.append(u)}a.forEach(({number:u,tooltip:p,event:m})=>{const b=O("div",{role:"listitem"});b.appendChild(O("div",{"aria-label":p,"data-event":m,tabindex:"0",class:"linePoint",role:"img",style:`--value: ${u}`})),s.append(b)}),s.appendChild(l).append(d),r.append(s)}),r}const dd=(t,e)=>t.map(([n,o],i,r)=>i?ud(i,r,e):`M${n},${o}`).join(" "),ta=([t,e],[n,o])=>[t+n,e+o],ea=([t,e],[n,o])=>[t-n,e-o],na=(t,[e,n])=>[t*e,t*n],ud=(t,e,n)=>{const o=e[t-1],i=e[t],[r,a]=ta(o,na(n,ea(i,e[t-2]||o))),[s,c]=ta(i,na(n,ea(o,e[t+1]||i)));return`C ${r},${a} ${s},${c} ${i[0]},${i[1]}`};function pd(t,{aspect:e,variant:n}){const o=document.createElementNS("http://www.w3.org/2000/svg","svg");e&&o.style.setProperty("--mtdsc-chart-aspect",e),v(o,"class","pie"),v(o,"viewBox","0 0 100 100");let i=0;const r=50,a=n==="doughnut"?25:0,s=t.slice(1).reduce((c,[,l])=>c+l.number,0);return t.slice(1).forEach(([,{tooltip:c,number:l,event:d,style:u}])=>{if(!l)return;const p=document.createElementNS("http://www.w3.org/2000/svg","path"),m=i/s;i+=l;const b=Math.min(i/s,.99999),f=b-m>.5?1:0,g=2*Math.PI*(m-.25),h=2*Math.PI*(b-.25),w=Math.cos(g),E=Math.sin(g),x=Math.cos(h),S=Math.sin(h),A=`M ${r+a*w} ${r+a*E} L ${r+r*w} ${r+r*E} A ${r} ${r} 0 ${f} 1 ${r+r*x} ${r+r*S} L ${r+a*x} ${r+a*S} A ${a} ${a} 0 ${f} 0 ${r+a*w} ${r+a*E}`;v(p,"aria-label",c),v(p,"data-event",d),v(p,"style",u),v(p,"d",A),v(p,"role","img"),v(p,"tabindex","0"),o.appendChild(p)}),o}const oa="click keydown mousemove mouseout",ia="mtds-chart-tooltip",rt=Q()?document.getElementById(ia)||O("div",{"aria-hidden":"true",class:C._tooltip,hidden:"",id:ia}):null;class md extends Hl{#t;#e;static get observedAttributes(){return["data-variant","data-aspect"]}constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const e=ft(()=>this.attributeChangedCallback(),100),n=new ResizeObserver(()=>this.handleResize());n.observe(this),this.#e=()=>n.disconnect(),this.#t=Re(this,e,{attributeFilter:["data-tooltip"],attributes:!0,characterData:!0,childList:!0,subtree:!0}),requestAnimationFrame(()=>this.attributeChangedCallback()),W(this,oa,this)}disconnectedCallback(){rt&&(rt.hidden=!0),zr(this,oa,this),this.#e?.(),this.#t?.(),this.#t=this.#e=void 0}attributeChangedCallback(){const e=gd(this.querySelector("table"));if(!e[0])return;Array.from(this.shadowRoot?.children||[]).map(d=>d.remove());const[n,o]=(v(this,"data-variant")||"column").split("-"),i=v(this,"data-aspect")||void 0,r=O("style",{},id),a=O("div",{"aria-hidden":"hidden",class:"legends",role:"group"});e.slice(1).forEach(([{value:d,style:u}])=>{a.appendChild(O("div",{class:"legend",style:u},d))});const{axis:s,groups:c,total:l}=ad(e,{aspect:i,type:o});(n==="column"||n==="bar")&&c.append(...ld(e)),(n==="line"||n==="area")&&c.append(cd(e,{total:l,variant:n,type:o})),(n==="doughnut"||n==="pie")&&this.shadowRoot?.append(pd(e,{aspect:i,variant:n})),this.shadowRoot?.append(s,a,r)}handleEvent(e){e.type==="click"||e.type==="keydown"?fd(e,this):hd(e)}handleResize(){const e=this.shadowRoot?.firstElementChild,n=e?.firstElementChild;e?.classList.toggle("axisStepsYHalf",(n?.offsetHeight||0)<400),e?.classList.toggle("axisStepsXHalf",(n?.offsetWidth||0)<500)}}function fd(t,e){if(t instanceof KeyboardEvent&&t.key!=="Enter")return;const n=t.composedPath()[0],o=e.querySelector("table"),[i,r]=n instanceof Element&&v(n,"data-event")?.split("-").map(Number)||[];o?.rows[i]?.cells[r]?.querySelector("a,button")?.click?.()}let ra="";function hd(t){if(!rt)return;rt?.isConnected||document.body.append(rt);const e=t.composedPath()[0],n=e instanceof Element&&e.getAttribute("aria-label")||"";n&&(rt.style.transform=`translate(${Math.min(t.clientX,window.innerWidth)}px, ${t.clientY}px)`),n!==ra&&(n&&(rt.textContent=n),ra=n,rt.hidden=!n)}const jn=t=>t?.textContent?.trim()||"",gd=t=>Array.from(t?.rows||[]).map((e,n,{length:o})=>Array.from(e.cells,(i,r)=>{const a=jn(e.cells[0]),s=jn(t?.rows[0].cells[r]),c=jn(i),l=o===2?`${s}: ${c}`:`${a}: ${c}${s?` (${s})`:""}`;return v(i,"tabindex","-1"),{number:r&&n&&Number.parseFloat(c)||0,event:i.querySelector("a,button")&&`${n}-${r}`,style:`--color: var(--mtdsc-chart-color-${n}, var(--mtdsc-chart-color-base))`,value:c,tooltip:v(i,"data-tooltip")||l}}));jl("mtds-chart",md);const vd=ft(t=>{if(t.animationName!==C._logo)return;const e=t.target.closest?.(`.${C.logo.split(" ")[0]}`),n=e?.firstElementChild;if(n instanceof SVGSVGElement){for(const c of document.head.querySelectorAll("link[rel~='icon']"))c.setAttribute("rel","disabled");const o=e?.hasAttribute("data-env"),i=window.getComputedStyle(n),r=i.getPropertyValue("color"),a=i.getPropertyValue("--mtdsc-logo-background"),s=n.outerHTML.replace(/\n+/g," ").replace(/(fill|width|height|xmlns)="[^"]+"/gi,"").replace("<svg",`<svg width="40" height="40" fill="${r}"`);document.head.appendChild(O("link",{href:`data:image/svg+xml,${encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 55 55'><rect fill='${o?"none":a}' width='51' height='51' x='2' y='2' stroke='${r}' stroke-dasharray='0.09 6.38' stroke-linecap='round' stroke-opacity='${o?.6:0}' stroke-width='2.3' rx='25.5'/><g transform="translate(7.5 7.5)">${s}</g></svg>`)}`,rel:"icon"}))}},200);ht("logo",()=>[W(document,"animationend",vd)]);const bd=Q()?document.getElementsByTagName("table"):[],wd=()=>{for(const t of bd){const e=Array.from(t.tHead?.rows[0]?.cells||[],n=>n.innerText.trim());for(const n of t.tBodies)for(const o of n.rows)for(const i of o.cells)v(i,"data-th",e[i.cellIndex]||":empty")}};ht("table",()=>[Re(document,ft(wd,200),{attributeFilter:["data-mobile"],attributes:!0,childList:!0,subtree:!0})]);const aa=C.toast.split(" ")[0],Ve="data-sort";function yd({animationName:t,target:e}){const n=e;if(t===C._toastTimeout&&n.close(),t!==C._toastOpen)return;const o=Number(v(n,"data-timeout"));n.style.setProperty("--mtdsc-toast-timeout",o?`${o}ms`:null),n.hasAttribute(Ve)||v(n,Ve,`${Date.now()}`),v(n,"tabindex","0"),[...document.querySelectorAll(`.${aa}[open]`)].sort((i,r)=>Number(v(r,Ve))-Number(v(i,Ve))).reduce((i,r)=>(r.style.translate=`0 ${r===e?0:i}px`,i+r.offsetHeight+5),0)}function xd({target:t,clientX:e,clientY:n}){if(t instanceof HTMLDialogElement&&t.classList.contains(aa)&&v(t,"data-closedby")!=="none"){const o=t.getBoundingClientRect(),i=window.getComputedStyle(t),r=window.getComputedStyle(t,"::after"),a=o.top+Number.parseInt(i.paddingTop,10),s=a+Number.parseInt(r.height,10),c=o.right-Number.parseInt(i.paddingRight,10),l=c-Number.parseInt(r.width,10);a<=n&&n<=s&&l<=e&&e<=c&&t.close()}}ht("toast",()=>[W(document,"animationstart",yd),W(document,"click",xd)]),Q()&&Oo(document.getElementById("mtds-tooltip")||O("div",{class:C._tooltip,id:"mtds-tooltip"}));const Ed=`.${C.field.split(" ")[0]}`,Sd=":is(input,textarea,select)",kd="ds-suggestion,u-combobox",Td=C.validation.split(" ")[0],Ad='[data-validation="form"]',Xn=t=>{const e=t?.type==="input",n=!e&&t;for(const o of document.forms)if(o.getAttribute("data-validation")==="form"){let i;for(const r of o.querySelectorAll(Sd)){if(!r.clientHeight)continue;const a=r.closest("fieldset")||r.closest(Ed)||o,s=r.closest(kd),c=s?v(r,"aria-required")==="true"&&!!s?.items.length:r.validity.valid;if(!i&&!c&&(i=r),!e||t.target===r)for(const l of a.getElementsByClassName(Td)){const d=a.nodeName==="FIELDSET"&&l.parentElement!==a;v(l,"hidden",d||!n||c?"":null)}}i&&n&&o.contains(t?.target)&&(t.preventDefault(),i.focus())}},Ld=t=>t.target?.closest?.(Ad)&&t?.preventDefault();ht("validations",()=>[W(document,"submit",Xn,!0),W(document,"invalid",Ld,!0),W(document,"invalid input",ft(Xn,10),Ht),Re(document,ft(()=>Xn(),10),{childList:!0,subtree:!0})]);var Zn=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",sa=Zn&&/iPad|iPhone|iPod/.test(navigator.userAgent),la;Zn&&/^Mac/i.test(((la=navigator.userAgentData)==null?void 0:la.platform)||navigator.platform);var Cd=typeof HTMLElement>"u"?class{}:HTMLElement;function z(t,e,n){return n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}var Md=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},Od=0,Id=t=>t?(t.id||(t.id=`:${t.nodeName.toLowerCase()}${(++Od).toString(32)}`),t.id):"",Nd=(t,e,n)=>{const o=document.createElement(t);return o.textContent=e,o},Rd={define:(t,e)=>!Zn||window.customElements.get(t)||window.customElements.define(t,e)},qd=t=>{var e;const n=z(t,"aria-label")||"";return[...(((e=z(t,"aria-labelledby"))==null?void 0:e.trim().split(/\s+/))||[]).map(i=>document.getElementById(i)),...Array.from(t.labels||[])].reduce((i,r)=>{var a;return i||((a=r?.innerText)==null?void 0:a.trim())||""},n)},Wd=`:host(:not([hidden])) { box-sizing: border-box; border: 1px solid; display: inline-block; height: .5em; width: 10em; overflow: hidden }
347
377
  :host::before { content: ''; display: block; height: 100%; background: currentColor; width: var(--percentage, 0%); transition: width .2s }
348
378
  :host(:not([value])) { background: linear-gradient(90deg,currentColor 25%, transparent 50%, currentColor 75%) 50%/400% }
349
379
  @media (prefers-reduced-motion: no-preference) { :host { animation: indeterminate 2s linear infinite } }
350
- @keyframes indeterminate { from { background-position-x: 100% } to { background-position-x: 0 } }`,Kn=!1,ca=class extends Ld{static get observedAttributes(){return["aria-label","aria-labelledby","value","max"]}constructor(){super(),this.shadowRoot||this.attachShadow({mode:"open"}).append(Id("style",qd))}connectedCallback(){this.attributeChangedCallback()}attributeChangedCallback(){if(Kn)return;Kn=!0;const t=Math.max(0,Math.round(this.position*100));this.style.setProperty("--percentage",`${t}%`);let e=Rd(this);sa&&(e=`${e.replace(/\d+%$/,"")} ${t}%`),z(this,"aria-busy",`${this.position===-1}`),z(this,"aria-label",e.trim()),z(this,"aria-labelledby",null),z(this,"aria-valuemax","100"),z(this,"aria-valuemin","0"),z(this,"aria-valuenow",`${t}`),z(this,"role",sa?"img":"progressbar"),Kn=!1}get labels(){const t=this.closest("label:not([for])"),e=Md(this);return t&&(t.htmlFor=e),Cd(this).querySelectorAll(`label[for="${e}"]`)}get position(){return this.value===null?-1:Math.min(this.value/this.max,1)}get value(){return ua(this,"value")}set value(t){pa(this,"value",t)}get max(){return ua(this,"max")||1}set max(t){pa(this,"max",t)}};ca.formAssociated=!0;var da=t=>!Number.isNaN(Number.parseFloat(`${t}`))&&Number.isFinite(Number(t)),ua=(t,e)=>{const n=z(t,e);return da(n)?Math.max(0,Number.parseFloat(n)):null},pa=(t,e,n)=>{if(n===null||da(n))z(t,e,`${n}`);else throw new Error(`Failed to set non-numeric '${z}': '${n}'`)};Nd.define("u-progress",ca);const Wd=String($a).replace(/\/\*[^!][^*]*\*\//gs,"").replace(/(\n|\t)/g,"").replace(/\s+/g," ");return k.DSBreadcrumbsElement=ri,k.DSErrorSummaryElement=ai,k.DSFieldElement=Le,k.DSPaginationElement=mi,k.DSSuggestionElement=fi,k.DSTabElement=bi,k.DSTabListElement=vi,k.DSTabPanelElement=wi,k.DSTabsElement=gi,k.UHTMLComboboxElement=Je,k.UHTMLComboboxShadowRoot=La,k.UHTMLComboboxStyle=Ge,k.UHTMLDataListElement=qi,k.UHTMLDataListShadowRoot=Pl,k.UHTMLDataListStyle=Wn,k.UHTMLTabElement=on,k.UHTMLTabListElement=en,k.UHTMLTabListShadowRoot=Ga,k.UHTMLTabListStyle=Qe,k.UHTMLTabPanelElement=an,k.UHTMLTabPanelShadowRoot=Ha,k.UHTMLTabPanelStyle=_e,k.UHTMLTabShadowRoot=Ja,k.UHTMLTabStyle=$e,k.UHTMLTabsElement=tn,k.UHTMLTabsShadowRoot=Ba,k.UHTMLTabsStyle=Ye,k.analytics=Br,k.fixLawHtml=Yr,k.getLawChecked=Ec,k.pagination=pi,k.parseLawIds=Tc,k.parseLawMeta=Ac,k.printcss=Wd,k.setLawChecked=kc,k.setTooltipElement=Mo,k.styles=Gl,k.toast=q,k.toggleAppExpanded=jr,k.toggleLawChecked=Sc,k.version=Bl,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}),k})({});
380
+ @keyframes indeterminate { from { background-position-x: 100% } to { background-position-x: 0 } }`,Kn=!1,ca=class extends Cd{static get observedAttributes(){return["aria-label","aria-labelledby","value","max"]}constructor(){super(),this.shadowRoot||this.attachShadow({mode:"open"}).append(Nd("style",Wd))}connectedCallback(){this.attributeChangedCallback()}attributeChangedCallback(){if(Kn)return;Kn=!0;const t=Math.max(0,Math.round(this.position*100));this.style.setProperty("--percentage",`${t}%`);let e=qd(this);sa&&(e=`${e.replace(/\d+%$/,"")} ${t}%`),z(this,"aria-busy",`${this.position===-1}`),z(this,"aria-label",e.trim()),z(this,"aria-labelledby",null),z(this,"aria-valuemax","100"),z(this,"aria-valuemin","0"),z(this,"aria-valuenow",`${t}`),z(this,"role",sa?"img":"progressbar"),Kn=!1}get labels(){const t=this.closest("label:not([for])"),e=Id(this);return t&&(t.htmlFor=e),Md(this).querySelectorAll(`label[for="${e}"]`)}get position(){return this.value===null?-1:Math.min(this.value/this.max,1)}get value(){return ua(this,"value")}set value(t){pa(this,"value",t)}get max(){return ua(this,"max")||1}set max(t){pa(this,"max",t)}};ca.formAssociated=!0;var da=t=>!Number.isNaN(Number.parseFloat(`${t}`))&&Number.isFinite(Number(t)),ua=(t,e)=>{const n=z(t,e);return da(n)?Math.max(0,Number.parseFloat(n)):null},pa=(t,e,n)=>{if(n===null||da(n))z(t,e,`${n}`);else throw new Error(`Failed to set non-numeric '${z}': '${n}'`)};Rd.define("u-progress",ca);const Pd=String($a).replace(/\/\*[^!][^*]*\*\//gs,"").replace(/(\n|\t)/g,"").replace(/\s+/g," ");return k.DSBreadcrumbsElement=ri,k.DSErrorSummaryElement=ai,k.DSFieldElement=Ae,k.DSPaginationElement=mi,k.DSSuggestionElement=fi,k.DSTabElement=bi,k.DSTabListElement=vi,k.DSTabPanelElement=wi,k.DSTabsElement=gi,k.UHTMLComboboxElement=Ge,k.UHTMLComboboxShadowRoot=La,k.UHTMLComboboxStyle=Be,k.UHTMLDataListElement=qi,k.UHTMLDataListShadowRoot=Pl,k.UHTMLDataListStyle=qn,k.UHTMLTabElement=nn,k.UHTMLTabListElement=tn,k.UHTMLTabListShadowRoot=Ga,k.UHTMLTabListStyle=Ye,k.UHTMLTabPanelElement=rn,k.UHTMLTabPanelShadowRoot=Ha,k.UHTMLTabPanelStyle=Qe,k.UHTMLTabShadowRoot=Ja,k.UHTMLTabStyle=_e,k.UHTMLTabsElement=$e,k.UHTMLTabsShadowRoot=Ba,k.UHTMLTabsStyle=Ke,k.analytics=Br,k.fixLawHtml=Yr,k.getLawChecked=Sc,k.pagination=pi,k.parseLawIds=Ac,k.parseLawMeta=Lc,k.printcss=Pd,k.setLawChecked=Tc,k.setTooltipElement=Oo,k.styles=Gl,k.toast=q,k.toggleAppExpanded=jr,k.toggleLawChecked=kc,k.version=Bl,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}),k})({});