@mattilsynet/design 3.3.3 → 3.3.5
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.
- package/mtds/atlas/atlas-element.js +1 -1
- package/mtds/deprecations.js +50 -36
- package/mtds/deprecations.js.map +1 -1
- package/mtds/external/@u-elements/u-details/dist/u-details.js +105 -0
- package/mtds/external/@u-elements/u-details/dist/u-details.js.map +1 -0
- package/mtds/field/field.js +14 -13
- package/mtds/field/field.js.map +1 -1
- package/mtds/index.d.ts +1 -0
- package/mtds/index.iife.js +15 -10
- package/mtds/index.js +23 -29
- package/mtds/index.js.map +1 -1
- package/mtds/package.json.js +1 -1
- package/mtds/pagination/pagination.js +30 -17
- package/mtds/pagination/pagination.js.map +1 -1
- package/mtds/styles.css +1 -1
- package/mtds/table/table-observer.js +7 -10
- package/mtds/table/table-observer.js.map +1 -1
- package/mtds/tooltip/tooltip-element.js +17 -5
- package/mtds/tooltip/tooltip-element.js.map +1 -1
- package/package.json +1 -1
package/mtds/index.iife.js
CHANGED
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
var mtds=(function($){"use strict";var
|
|
1
|
+
var mtds=(function($){"use strict";var uo=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",re=uo(),zs=re?navigator.userAgent:"",fo=/iPad|iPhone|iPod/.test(zs),mo;re&&/^Mac/i.test(((mo=navigator.userAgentData)==null?void 0:mo.platform)||navigator.platform);var Fs=re&&window.CSSStyleSheet&&document.adoptedStyleSheets,Ws=typeof HTMLElement>"u"?class{}:HTMLElement,H=(t,e,n)=>n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),Vs=(t,e)=>{const n=t.shadowRoot||t.attachShadow({mode:"open"});if(n.querySelector("slot")||n.append(po("slot")),!n.querySelector("style"))if(!Fs)n.append(po("style",null,e));else{const o=new CSSStyleSheet;o.replaceSync(e),n.adoptedStyleSheets=[o]}return n},Gs=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},js=t=>{var e;const n=H(t,"aria-label")||"";return[...(((e=H(t,"aria-labelledby"))==null?void 0:e.split(" "))||[]).map(i=>document.getElementById(i.trim()||"-")),...Array.from(t.labels||[])].reduce((i,r)=>{var s;return i||((s=r?.innerText)==null?void 0:s.trim())||""},n).trim()},Xs=t=>{if(!t||!re)return null;if(window.uElementsId||(window.uElementsId={}),!t.id){const e=t.nodeName.toLowerCase();window.uElementsId[e]||(window.uElementsId[e]=1),t.id=`:${e}${window.uElementsId[e]++}`}return t.id},po=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,r]of Object.entries(e))H(o,i,r);return o},Ks={define:(t,e)=>!uo()||window.customElements.get(t)||window.customElements.define(t,e)},se="value",je="max",Ys=`:host(:not([hidden])) { box-sizing: border-box; border: 1px solid; display: inline-block; height: .5em; width: 10em; overflow: hidden }
|
|
2
2
|
:host::before { content: ''; display: block; height: 100%; background: currentColor; width: var(--percentage, 0%); transition: width .2s }
|
|
3
3
|
:host(:not([value])) { background: linear-gradient(90deg,currentColor 25%, transparent 50%, currentColor 75%) 50%/400% }
|
|
4
4
|
@media (prefers-reduced-motion: no-preference) { :host { animation: indeterminate 2s linear infinite } }
|
|
5
|
-
@keyframes indeterminate { from { background-position-x: 100% } to { background-position-x: 0 } }`,uo=class extends Os{constructor(){var t;super(),this._skipAttrChange=!1,Ms(this,Hs),this._internals=(t=this.attachInternals)==null?void 0:t.call(this)}static get observedAttributes(){return["aria-label","aria-labelledby",se,Ve]}connectedCallback(){q(this,"aria-valuemin","0"),q(this,"aria-valuemax","100"),q(this,"role",ao?"img":"progressbar"),this.attributeChangedCallback()}attributeChangedCallback(){if(this._skipAttrChange||!this.hasAttribute("role"))return;this._skipAttrChange=!0;const t=this.position,e=Math.max(0,Math.round(t*100));this.style.setProperty("--percentage",`${e}%`);let n=Ps(this);ao&&(n=`${n.replace(/\(\d+%\)$/,"")} (${e}%)`.trim()),q(this,"aria-busy",`${t===-1}`),q(this,"aria-label",n),q(this,"aria-labelledby",null),q(this,"aria-valuenow",t===-1?null:`${e}`),this._skipAttrChange=!1}get labels(){var t;const e=(t=this._internals)==null?void 0:t.labels;if(e)return e;const n=Ns(this),o=this.closest("label:not([for])");return o&&q(o,"for",n),Ds(this).querySelectorAll(`label[for="${n}"]`)}get position(){return this.hasAttribute(se)?Math.min(this.value/this.max,1):-1}get value(){return Math.min(fo(this,se),this.max)}set value(t){mo(this,se,t)}get max(){return fo(this,Ve,1)}set max(t){mo(this,Ve,t,1)}};uo.formAssociated=!0;var fo=(t,e,n=0)=>{const o=q(t,e),i=Number(o);return o===null?n:Number.isFinite(i)&&Math.max(n,i)||n},mo=(t,e,n,o=0)=>{const i=Number(n);if(Number.isFinite(i))return q(t,e,`${Math.max(o,i)||o}`);throw new Error(`Failed to set the '${e}' property on 'UHTMLProgressElement': The provided double value is non-finite.`)};qs.define("u-progress",uo);function Bs(){return typeof HTMLButtonElement<"u"&&"command"in HTMLButtonElement.prototype&&"source"in((globalThis.CommandEvent||{}).prototype||{})}function zs(){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,p,b=!0){Object.defineProperty(f,p,{...Object.getOwnPropertyDescriptor(f,p),enumerable:b})}function e(f){return f&&typeof f.getRootNode=="function"?f.getRootNode():f&&f.parentNode?e(f.parentNode):f}let n=new WeakMap,o=new WeakMap;class i extends Event{constructor(p,b={}){super(p,b);let{source:y,command:_}=b;if(y!=null&&!(y instanceof Element))throw TypeError("source must be an element");n.set(this,y||null),o.set(this,_===void 0?"":String(_))}get[Symbol.toStringTag](){return"CommandEvent"}get source(){if(!n.has(this))throw TypeError("illegal invocation");let p=n.get(this);if(!(p instanceof Element))return null;let b=e(p);return b===e(this.target||document)?p:b.host}get command(){if(!o.has(this))throw TypeError("illegal invocation");return o.get(this)}}t(i.prototype,"source"),t(i.prototype,"command");let r=new WeakMap;function s(f){Object.defineProperties(f.prototype,{commandForElement:{enumerable:!0,configurable:!0,set(p){if(p===null)this.removeAttribute("commandfor"),r.delete(this);else if(p instanceof Element){this.setAttribute("commandfor","");let b=e(p);e(this)===b||b===this.ownerDocument?r.set(this,p):r.delete(this)}else throw TypeError("commandForElement must be an element or null")},get(){if(this.localName!=="button"||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;let p=r.get(this);if(p)return p.isConnected?p:(r.delete(this),null);let b=e(this),y=this.getAttribute("commandfor");return(b instanceof Document||b instanceof ShadowRoot)&&y&&b.getElementById(y)||null}},command:{enumerable:!0,configurable:!0,get(){let p=this.getAttribute("command")||"";if(p.startsWith("--"))return p;let b=p.toLowerCase();switch(b){case"show-modal":case"request-close":case"close":case"toggle-popover":case"hide-popover":case"show-popover":return b}return""},set(p){this.setAttribute("command",p)}}})}let a=new WeakMap;Object.defineProperties(HTMLElement.prototype,{oncommand:{enumerable:!0,configurable:!0,get(){return c.takeRecords(),a.get(this)||null},set(f){let p=a.get(this)||null;p&&this.removeEventListener("command",p),a.set(this,typeof f=="object"||typeof f=="function"?f:null),typeof f=="function"&&this.addEventListener("command",f)}}});function l(f){for(let p of f)p.oncommand=Function("event",p.getAttribute("oncommand"))}let c=new MutationObserver(f=>{for(let p of f){let{target:b}=p;p.type==="childList"?l(b.querySelectorAll("[oncommand]")):l([b])}});c.observe(document,{subtree:!0,childList:!0,attributeFilter:["oncommand"]}),l(document.querySelectorAll("[oncommand]"));let u=new WeakSet;function d(f){if(u.has(f)||(u.add(f),f.defaultPrevented)||f.type!=="click")return;let p=f.composedPath().find(w=>w.matches?.("button[commandfor], button[command]"));if(!p)return;if(p.form&&p.getAttribute("type")!=="button")throw f.preventDefault(),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(p.hasAttribute("command")!==p.hasAttribute("commandfor")){let w=p.hasAttribute("command")?"command":"commandfor",x=p.hasAttribute("command")?"commandfor":"command";throw Error(`Element with ${w} attribute must also have a ${x} attribute to function.`)}if(p.command!=="show-popover"&&p.command!=="hide-popover"&&p.command!=="toggle-popover"&&p.command!=="show-modal"&&p.command!=="request-close"&&p.command!=="close"&&!p.command.startsWith("--")){console.warn(`"${p.command}" is not a valid command value. Custom commands must begin with --`);return}let b=p.commandForElement;if(!b)return;let y=new i("command",{command:p.command,source:p,cancelable:!0});if(b.dispatchEvent(y),y.defaultPrevented)return;let _=y.command.toLowerCase();if(b.popover){let w=!b.matches(":popover-open");w&&(_==="toggle-popover"||_==="show-popover")?b.showPopover({source:p}):!w&&_==="hide-popover"&&b.hidePopover()}else if(b.localName==="dialog"){let w=!b.hasAttribute("open");w&&_=="show-modal"?b.showModal():!w&&_=="close"?b.close(p.value?p.value:void 0):!w&&_=="request-close"&&(HTMLDialogElement.prototype.requestClose||(HTMLDialogElement.prototype.requestClose=function(){let x=new Event("cancel",{cancelable:!0});this.dispatchEvent(x),x.defaultPrevented||this.close()}),b.requestClose(p.value?p.value:void 0))}}function m(f){f.addEventListener("click",d,!0)}function h(f,p){let b=f.prototype.attachShadow;f.prototype.attachShadow=function(_){let w=b.call(this,_);return p(w),w};let y=f.prototype.attachInternals;f.prototype.attachInternals=function(){let _=y.call(this);return _.shadowRoot&&p(_.shadowRoot),_}}s(HTMLButtonElement),h(HTMLElement,f=>{m(f),c.observe(f,{attributeFilter:["oncommand"]}),l(f.querySelectorAll("[oncommand]"))}),m(document),Object.assign(globalThis,{CommandEvent:i})}const z={passive:!0,capture:!0},G=()=>typeof window<"u"&&typeof document<"u",Fs=()=>G()&&/^Win/i.test(navigator.userAgentData?.platform||navigator.platform),ae=typeof HTMLElement>"u"?class{}:HTMLElement;function po(t,e){let n;return function(...o){clearTimeout(n),n=setTimeout(()=>t.apply(this,o),e)}}const mt=(t,...e)=>!G()||window.dsWarnings===!1||console.log(`\x1B[1mDesignsystemet:\x1B[m ${t}`,...e),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),Ge=(t,e)=>getComputedStyle(t).getPropertyValue(e).trim(),Us=/^["']|["']$/g,Ct=(t,e)=>{let n=v(t,e);return n||=Ge(t,`--_ds-${e}`).replace(Us,"").trim(),n||mt(`Missing ${e} on:`,t),n||null},I=(t,...e)=>{let[n,...o]=e;for(let i of n.split(" "))t.addEventListener(i,...o);return()=>je(t,...e)},je=(t,...e)=>{let[n,...o]=e;for(let i of n.split(" "))t.removeEventListener(i,...o)},tt=(t,e)=>{G()&&(window._dsHotReloadCleanup||(window._dsHotReloadCleanup=new Map),window._dsHotReloadCleanup?.get(t)?.map(n=>n()),window._dsHotReloadCleanup?.set(t,e()))},et=(t,e,n)=>{let o=()=>i.disconnect(),i=new MutationObserver(r=>{if(!G()||!t.isConnected)return o();e(t,r)});return e(t),i.observe(t,n),o},ho=(t,e)=>{let n=document.createElement(t);if(e)for(let[o,i]of Object.entries(e))v(n,o,i);return n},nt={define:(t,e)=>!G()||window.customElements.get(t)||window.customElements.define(t,e)};let Ws=0;function ot(t){return G()?(window.dsUseId||(window.dsUseId=0),t&&!t.id&&(t.id=`:ds:${++window.dsUseId}`),t?.id||""):`:ds:${++Ws}`}let j,Vs=0,go=0;const Xe=t=>{clearTimeout(go),j&&(j.textContent=`${t}${Vs++%2?" ":""}`),t&&(go=setTimeout(Xe,2e3,""))},Gs=()=>{document.readyState==="complete"&&(j||(j=ho("div",{"aria-live":"assertive"}),j.style.overflow="hidden",j.style.position="fixed",j.style.whiteSpace="nowrap",j.style.width="1px"),j.isConnected||document.body.appendChild(j))};tt("announce",()=>[I(document,"focus mouseover",Gs,z)]);const bo=":click-delegate-hover",vo="data-clickdelegatefor",js=`[${vo}]`,Xs=t=>{let e=t.button===1||t.metaKey||t.ctrlKey,n=t.button<2&&yo(t);if(!(!n||n.contains(t.target))){if(e&&n instanceof HTMLAnchorElement)return window.open(n.href,void 0,n.rel);t.stopImmediatePropagation(),n.click()}};let le;const Ks=t=>{let e=yo(t);le!==e&&(le&&le.classList.remove(bo),e&&e.classList.add(bo),le=e)},yo=({target:t})=>{let e=(t instanceof Element?t.closest(js):null)?.getAttribute(vo),n=e&&document.getElementById(e)||void 0,o=n&&t.closest('a,button,label,input,select,textarea,details,dialog,[role="button"],[popover],[contenteditable]');return(!o||o===n)&&!n?.disabled?n:void 0};tt("clickdelegatefor",()=>[I(window,"click auxclick",Xs,!0),I(document,"mouseover",Ks,z)]);let Ke=!1;const Ys=({type:t,target:e,clientX:n=0,clientY:o=0})=>{if(t==="pointerdown"){let i=e?.closest?.("dialog")?.getBoundingClientRect();Ke=!!(i&&i.top<=o&&o<=i.bottom&&i.left<=n&&n<=i.right)}else{let i=e instanceof HTMLDialogElement&&!Ke&&v(e,"closedby")==="any";Ke=!1,i&&requestAnimationFrame(()=>e.open&&e.close())}},Qs=G()?document.getElementsByTagName("button"):[],Zs=()=>{for(let t of Qs)t.getAttribute("command")?.endsWith("-modal")&&t.setAttribute("aria-haspopup","dialog")},Js=({command:t,target:e})=>t==="--show-non-modal"&&e instanceof HTMLDialogElement&&e.show();tt("dialog",()=>[I(document,"command",Js,z),I(document,"pointerdown pointerup",Ys,z),et(document,Zs,{attributeFilter:["command"],attributes:!0,childList:!0,subtree:!0})]);const ta=G()?document.getElementsByTagName("fieldset"):[],ea=()=>{for(let t of ta)t.hasAttribute("aria-labelledby")||v(t,"aria-labelledby",`${ot(t.querySelector("legend"))} ${ot(t.querySelector(':scope > :is([data-field="description"],legend + p)'))}`.trim()||null)};tt("fieldset",()=>[et(document,ea,{childList:!0,subtree:!0})]);const At=Math.min,H=Math.max,ce=Math.round,de=Math.floor,X=t=>({x:t,y:t}),na={left:"right",right:"left",bottom:"top",top:"bottom"};function wo(t,e,n){return H(t,At(e,n))}function pt(t,e){return typeof t=="function"?t(e):t}function it(t){return t.split("-")[0]}function Bt(t){return t.split("-")[1]}function Ye(t){return t==="x"?"y":"x"}function _o(t){return t==="y"?"height":"width"}function K(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function xo(t){return Ye(K(t))}function oa(t,e,n){n===void 0&&(n=!1);const o=Bt(t),i=xo(t),r=_o(i);let s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=ue(s)),[s,ue(s)]}function ia(t){const e=ue(t);return[Qe(t),e,Qe(e)]}function Qe(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const So=["left","right"],Eo=["right","left"],ra=["top","bottom"],sa=["bottom","top"];function aa(t,e,n){switch(t){case"top":case"bottom":return n?e?Eo:So:e?So:Eo;case"left":case"right":return e?ra:sa;default:return[]}}function la(t,e,n,o){const i=Bt(t);let r=aa(it(t),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(Qe)))),r}function ue(t){const e=it(t);return na[e]+t.slice(e.length)}function ca(t){return{top:0,right:0,bottom:0,left:0,...t}}function da(t){return typeof t!="number"?ca(t):{top:t,right:t,bottom:t,left:t}}function fe(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 $o(t,e,n){let{reference:o,floating:i}=t;const r=K(e),s=xo(e),a=_o(s),l=it(e),c=r==="y",u=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,m=o[a]/2-i[a]/2;let h;switch(l){case"top":h={x:u,y:o.y-i.height};break;case"bottom":h={x:u,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:d};break;case"left":h={x:o.x-i.width,y:d};break;default:h={x:o.x,y:o.y}}switch(Bt(e)){case"start":h[s]-=m*(n&&c?-1:1);break;case"end":h[s]+=m*(n&&c?-1:1);break}return h}async function ua(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:r,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:m=!1,padding:h=0}=pt(e,t),f=da(h),b=a[m?d==="floating"?"reference":"floating":d],y=fe(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(b)))==null||n?b:b.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),_=d==="floating"?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),x=await(r.isElement==null?void 0:r.isElement(w))?await(r.getScale==null?void 0:r.getScale(w))||{x:1,y:1}:{x:1,y:1},A=fe(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:_,offsetParent:w,strategy:l}):_);return{top:(y.top-A.top+f.top)/x.y,bottom:(A.bottom-y.bottom+f.bottom)/x.y,left:(y.left-A.left+f.left)/x.x,right:(A.right-y.right+f.right)/x.x}}const fa=50,ma=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:ua},l=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=$o(c,o,l),m=o,h=0;const f={};for(let p=0;p<r.length;p++){const b=r[p];if(!b)continue;const{name:y,fn:_}=b,{x:w,y:x,data:A,reset:k}=await _({x:u,y:d,initialPlacement:o,placement:m,strategy:i,middlewareData:f,rects:c,platform:a,elements:{reference:t,floating:e}});u=w??u,d=x??d,f[y]={...f[y],...A},k&&h<fa&&(h++,typeof k=="object"&&(k.placement&&(m=k.placement),k.rects&&(c=k.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):k.rects),{x:u,y:d}=$o(c,m,l)),p=-1)}return{x:u,y:d,placement:m,strategy:i,middlewareData:f}},pa=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:p=!0,...b}=pt(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const y=it(i),_=K(a),w=it(a)===a,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),A=m||(w||!p?[ue(a)]:ia(a)),k=f!=="none";!m&&k&&A.push(...la(a,p,f,x));const J=[a,...A],xt=await l.detectOverflow(e,b),St=[];let lt=((o=r.flip)==null?void 0:o.overflows)||[];if(u&&St.push(xt[y]),d){const Et=oa(i,s,x);St.push(xt[Et[0]],xt[Et[1]])}if(lt=[...lt,{placement:i,overflows:St}],!St.every(Et=>Et<=0)){var ee,ne;const Et=(((ee=r.flip)==null?void 0:ee.index)||0)+1,ro=J[Et];if(ro&&(!(d==="alignment"?_!==K(ro):!1)||lt.every(V=>K(V.placement)===_?V.overflows[0]>0:!0)))return{data:{index:Et,overflows:lt},reset:{placement:ro}};let ie=(ne=lt.filter($t=>$t.overflows[0]<=0).sort(($t,V)=>$t.overflows[1]-V.overflows[1])[0])==null?void 0:ne.placement;if(!ie)switch(h){case"bestFit":{var oe;const $t=(oe=lt.filter(V=>{if(k){const ft=K(V.placement);return ft===_||ft==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(ft=>ft>0).reduce((ft,Cu)=>ft+Cu,0)]).sort((V,ft)=>V[1]-ft[1])[0])==null?void 0:oe[0];$t&&(ie=$t);break}case"initialPlacement":ie=a;break}if(i!==ie)return{reset:{placement:ie}}}return{}}}},Co=new Set(["left","top"]);async function ha(t,e){const{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=it(n),a=Bt(n),l=K(n)==="y",c=Co.has(s)?-1:1,u=r&&l?-1:1,d=pt(e,t);let{mainAxis:m,crossAxis:h,alignmentAxis:f}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof f=="number"&&(h=a==="end"?f*-1:f),l?{x:h*u,y:m*c}:{x:m*c,y:h*u}}const ga=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:a}=e,l=await ha(e,t);return s===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:s}}}}},ba=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:r}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:y=>{let{x:_,y:w}=y;return{x:_,y:w}}},...c}=pt(t,e),u={x:n,y:o},d=await r.detectOverflow(e,c),m=K(it(i)),h=Ye(m);let f=u[h],p=u[m];if(s){const y=h==="y"?"top":"left",_=h==="y"?"bottom":"right",w=f+d[y],x=f-d[_];f=wo(w,f,x)}if(a){const y=m==="y"?"top":"left",_=m==="y"?"bottom":"right",w=p+d[y],x=p-d[_];p=wo(w,p,x)}const b=l.fn({...e,[h]:f,[m]:p});return{...b,data:{x:b.x-n,y:b.y-o,enabled:{[h]:s,[m]:a}}}}}},va=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:i,rects:r,middlewareData:s}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=pt(t,e),u={x:n,y:o},d=K(i),m=Ye(d);let h=u[m],f=u[d];const p=pt(a,e),b=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const w=m==="y"?"height":"width",x=r.reference[m]-r.floating[w]+b.mainAxis,A=r.reference[m]+r.reference[w]-b.mainAxis;h<x?h=x:h>A&&(h=A)}if(c){var y,_;const w=m==="y"?"width":"height",x=Co.has(it(i)),A=r.reference[d]-r.floating[w]+(x&&((y=s.offset)==null?void 0:y[d])||0)+(x?0:b.crossAxis),k=r.reference[d]+r.reference[w]+(x?0:((_=s.offset)==null?void 0:_[d])||0)-(x?b.crossAxis:0);f<A?f=A:f>k&&(f=k)}return{[m]:h,[d]:f}}}},ya=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:r,platform:s,elements:a}=e,{apply:l=()=>{},...c}=pt(t,e),u=await s.detectOverflow(e,c),d=it(i),m=Bt(i),h=K(i)==="y",{width:f,height:p}=r.floating;let b,y;d==="top"||d==="bottom"?(b=d,y=m===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,b=m==="end"?"top":"bottom");const _=p-u.top-u.bottom,w=f-u.left-u.right,x=At(p-u[b],_),A=At(f-u[y],w),k=!e.middlewareData.shift;let J=x,xt=A;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(xt=w),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(J=_),k&&!m){const lt=H(u.left,0),ee=H(u.right,0),ne=H(u.top,0),oe=H(u.bottom,0);h?xt=f-2*(lt!==0||ee!==0?lt+ee:H(u.left,u.right)):J=p-2*(ne!==0||oe!==0?ne+oe:H(u.top,u.bottom))}await l({...e,availableWidth:xt,availableHeight:J});const St=await s.getDimensions(a.floating);return f!==St.width||p!==St.height?{reset:{rects:!0}}:{}}}};function me(){return typeof window<"u"}function Tt(t){return Ao(t)?(t.nodeName||"").toLowerCase():"#document"}function B(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Y(t){var e;return(e=(Ao(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ao(t){return me()?t instanceof Node||t instanceof B(t).Node:!1}function F(t){return me()?t instanceof Element||t instanceof B(t).Element:!1}function rt(t){return me()?t instanceof HTMLElement||t instanceof B(t).HTMLElement:!1}function To(t){return!me()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof B(t).ShadowRoot}function zt(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=U(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&i!=="inline"&&i!=="contents"}function wa(t){return/^(table|td|th)$/.test(Tt(t))}function pe(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const _a=/transform|translate|scale|rotate|perspective|filter/,xa=/paint|layout|strict|content/,ht=t=>!!t&&t!=="none";let Ze;function Je(t){const e=F(t)?U(t):t;return ht(e.transform)||ht(e.translate)||ht(e.scale)||ht(e.rotate)||ht(e.perspective)||!tn()&&(ht(e.backdropFilter)||ht(e.filter))||_a.test(e.willChange||"")||xa.test(e.contain||"")}function Sa(t){let e=ct(t);for(;rt(e)&&!kt(e);){if(Je(e))return e;if(pe(e))return null;e=ct(e)}return null}function tn(){return Ze==null&&(Ze=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ze}function kt(t){return/^(html|body|#document)$/.test(Tt(t))}function U(t){return B(t).getComputedStyle(t)}function he(t){return F(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ct(t){if(Tt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||To(t)&&t.host||Y(t);return To(e)?e.host:e}function ko(t){const e=ct(t);return kt(e)?t.ownerDocument?t.ownerDocument.body:t.body:rt(e)&&zt(e)?e:ko(e)}function Ft(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=ko(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),s=B(i);if(r){const a=en(s);return e.concat(s,s.visualViewport||[],zt(i)?i:[],a&&n?Ft(a):[])}else return e.concat(i,Ft(i,[],n))}function en(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Lo(t){const e=U(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=rt(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,a=ce(n)!==r||ce(o)!==s;return a&&(n=r,o=s),{width:n,height:o,$:a}}function nn(t){return F(t)?t:t.contextElement}function Lt(t){const e=nn(t);if(!rt(e))return X(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=Lo(e);let s=(r?ce(n.width):n.width)/o,a=(r?ce(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Ea=X(0);function Ro(t){const e=B(t);return!tn()||!e.visualViewport?Ea:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function $a(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==B(t)?!1:e}function gt(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=nn(t);let s=X(1);e&&(o?F(o)&&(s=Lt(o)):s=Lt(t));const a=$a(r,n,o)?Ro(r):X(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,d=i.height/s.y;if(r){const m=B(r),h=o&&F(o)?B(o):o;let f=m,p=en(f);for(;p&&o&&h!==f;){const b=Lt(p),y=p.getBoundingClientRect(),_=U(p),w=y.left+(p.clientLeft+parseFloat(_.paddingLeft))*b.x,x=y.top+(p.clientTop+parseFloat(_.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,d*=b.y,l+=w,c+=x,f=B(p),p=en(f)}}return fe({width:u,height:d,x:l,y:c})}function ge(t,e){const n=he(t).scrollLeft;return e?e.left+n:gt(Y(t)).left+n}function Io(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-ge(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function Ca(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r=i==="fixed",s=Y(o),a=e?pe(e.floating):!1;if(o===s||a&&r)return n;let l={scrollLeft:0,scrollTop:0},c=X(1);const u=X(0),d=rt(o);if((d||!d&&!r)&&((Tt(o)!=="body"||zt(s))&&(l=he(o)),d)){const h=gt(o);c=Lt(o),u.x=h.x+o.clientLeft,u.y=h.y+o.clientTop}const m=s&&!d&&!r?Io(s,l):X(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+m.x,y:n.y*c.y-l.scrollTop*c.y+u.y+m.y}}function Aa(t){return Array.from(t.getClientRects())}function Ta(t){const e=Y(t),n=he(t),o=t.ownerDocument.body,i=H(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=H(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+ge(t);const a=-n.scrollTop;return U(o).direction==="rtl"&&(s+=H(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:a}}const Oo=25;function ka(t,e){const n=B(t),o=Y(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,a=0,l=0;if(i){r=i.width,s=i.height;const u=tn();(!u||u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const c=ge(o);if(c<=0){const u=o.ownerDocument,d=u.body,m=getComputedStyle(d),h=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,f=Math.abs(o.clientWidth-d.clientWidth-h);f<=Oo&&(r-=f)}else c<=Oo&&(r+=c);return{width:r,height:s,x:a,y:l}}function La(t,e){const n=gt(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=rt(t)?Lt(t):X(1),s=t.clientWidth*r.x,a=t.clientHeight*r.y,l=i*r.x,c=o*r.y;return{width:s,height:a,x:l,y:c}}function Mo(t,e,n){let o;if(e==="viewport")o=ka(t,n);else if(e==="document")o=Ta(Y(t));else if(F(e))o=La(e,n);else{const i=Ro(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return fe(o)}function Do(t,e){const n=ct(t);return n===e||!F(n)||kt(n)?!1:U(n).position==="fixed"||Do(n,e)}function Ra(t,e){const n=e.get(t);if(n)return n;let o=Ft(t,[],!1).filter(a=>F(a)&&Tt(a)!=="body"),i=null;const r=U(t).position==="fixed";let s=r?ct(t):t;for(;F(s)&&!kt(s);){const a=U(s),l=Je(s);!l&&a.position==="fixed"&&(i=null),(r?!l&&!i:!l&&a.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||zt(s)&&!l&&Do(t,s))?o=o.filter(u=>u!==s):i=a,s=ct(s)}return e.set(t,o),o}function Ia(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const s=[...n==="clippingAncestors"?pe(e)?[]:Ra(e,this._c):[].concat(n),o],a=Mo(e,s[0],i);let l=a.top,c=a.right,u=a.bottom,d=a.left;for(let m=1;m<s.length;m++){const h=Mo(e,s[m],i);l=H(h.top,l),c=At(h.right,c),u=At(h.bottom,u),d=H(h.left,d)}return{width:c-d,height:u-l,x:d,y:l}}function Oa(t){const{width:e,height:n}=Lo(t);return{width:e,height:n}}function Ma(t,e,n){const o=rt(e),i=Y(e),r=n==="fixed",s=gt(t,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=X(0);function c(){l.x=ge(i)}if(o||!o&&!r)if((Tt(e)!=="body"||zt(i))&&(a=he(e)),o){const h=gt(e,!0,r,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}else i&&c();r&&!o&&i&&c();const u=i&&!o&&!r?Io(i,a):X(0),d=s.left+a.scrollLeft-l.x-u.x,m=s.top+a.scrollTop-l.y-u.y;return{x:d,y:m,width:s.width,height:s.height}}function on(t){return U(t).position==="static"}function Po(t,e){if(!rt(t)||U(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Y(t)===n&&(n=n.ownerDocument.body),n}function No(t,e){const n=B(t);if(pe(t))return n;if(!rt(t)){let i=ct(t);for(;i&&!kt(i);){if(F(i)&&!on(i))return i;i=ct(i)}return n}let o=Po(t,e);for(;o&&wa(o)&&on(o);)o=Po(o,e);return o&&kt(o)&&on(o)&&!Je(o)?n:o||Sa(t)||n}const Da=async function(t){const e=this.getOffsetParent||No,n=this.getDimensions,o=await n(t.floating);return{reference:Ma(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Pa(t){return U(t).direction==="rtl"}const Na={convertOffsetParentRelativeRectToViewportRelativeRect:Ca,getDocumentElement:Y,getClippingRect:Ia,getOffsetParent:No,getElementRects:Da,getClientRects:Aa,getDimensions:Oa,getScale:Lt,isElement:F,isRTL:Pa};function qo(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function qa(t,e){let n=null,o;const i=Y(t);function r(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),r();const c=t.getBoundingClientRect(),{left:u,top:d,width:m,height:h}=c;if(a||e(),!m||!h)return;const f=de(d),p=de(i.clientWidth-(u+m)),b=de(i.clientHeight-(d+h)),y=de(u),w={rootMargin:-f+"px "+-p+"px "+-b+"px "+-y+"px",threshold:H(0,At(1,l))||1};let x=!0;function A(k){const J=k[0].intersectionRatio;if(J!==l){if(!x)return s();J?s(!1,J):o=setTimeout(()=>{s(!1,1e-7)},1e3)}J===1&&!qo(c,t.getBoundingClientRect())&&s(),x=!1}try{n=new IntersectionObserver(A,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(A,w)}n.observe(t)}return s(!0),r}function Ha(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,c=nn(t),u=i||r?[...c?Ft(c):[],...e?Ft(e):[]]:[];u.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),r&&y.addEventListener("resize",n)});const d=c&&a?qa(c,n):null;let m=-1,h=null;s&&(h=new ResizeObserver(y=>{let[_]=y;_&&_.target===c&&h&&e&&(h.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(e)})),n()}),c&&!l&&h.observe(c),e&&h.observe(e));let f,p=l?gt(t):null;l&&b();function b(){const y=gt(t);p&&!qo(p,y)&&n(),p=y,f=requestAnimationFrame(b)}return n(),()=>{var y;u.forEach(_=>{i&&_.removeEventListener("scroll",n),r&&_.removeEventListener("resize",n)}),d?.(),(y=h)==null||y.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const Ba=ga,za=ba,Fa=pa,Ua=ya,Wa=va,Va=(t,e,n)=>{const o=new Map,i={platform:Na,...n},r={...i.platform,_c:o};return ma(t,e,{...i,platform:r})},Ho="data-placement",Bo="data-autoplacement",Ut=new Map;function Ga(t){let{newState:e,oldState:n,target:o,source:i=t.detail}=t,r=o instanceof HTMLElement&&v(o,"popover")!==null&&Ge(o,"--_ds-floating");if(!r)return;if(e==="closed")return Ut.get(o)?.();if(!i){let f=o.getRootNode(),p=`[popovertarget="${o.id}"],[commandfor="${o.id}"]`;i=o.id&&f?.querySelector?.(p)||void 0}if(!i||i===o||n&&n===e)return;let s=Ge(o,"--_ds-floating-overscroll"),a=v(o,Ho)||v(i,Ho)||r,l=v(o,Bo)||v(i,Bo),c=parseFloat(getComputedStyle(o,"::before").height)||0,u=a.match(/left|right/gi)?"Height":"Width",d=i[`offset${u}`]/2+c;if(a==="none")return;let m={strategy:"absolute",placement:a,middleware:[Ba(c||0),za({padding:10,limiter:Wa({offset:{mainAxis:d}})}),Xa(),...l==="false"?[]:[Fa({padding:10,crossAxis:!1})],...s?[Ua({apply({availableHeight:f}){s==="fit"&&(o.style.width=`${i.offsetWidth}px`),o.style.maxHeight=`${Math.max(50,f-20)}px`}})]:[]]},h=Ha(i,o,async()=>{if(!i?.isConnected)return Ut.get(o)?.();let{x:f,y:p}=await Va(i,o,m);o.style.translate=`${f}px ${p}px`});Ut.set(o,()=>Ut.delete(o)&&h())}let be;const ja=({type:t})=>{if(t==="mousedown"&&(be=!1),t==="scroll"&&be===!1&&(be=!0),t==="mouseup"&&be)for(let[e]of Ut)e.showPopover()};tt("popover",()=>[I(document,"mousedown scroll mouseup",ja,!0),I(document,"toggle ds-toggle-source",Ga,z)]);const Xa=()=>({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),v(e,"data-floating",t.placement),t}}),rn=t=>(t instanceof HTMLSelectElement||t instanceof HTMLInputElement)&&(t.hasAttribute("readonly")||v(t,"aria-readonly")==="true"),Ka=t=>{if(t.key!=="Tab"&&rn(t.target)){let e=t.key?.startsWith("Arrow"),n=t.altKey||t.ctrlKey||t.metaKey;if((e||!n)&&t.preventDefault(),e&&v(t.target,"type")==="radio"){let o=document.querySelectorAll(`input[name="${t.target.name}"]`),i=t.key?.match(/Arrow(Right|Down)/)?1:-1;o[(o.length+[...o].indexOf(t.target)+i)%o.length]?.focus()}}},Ya=t=>{let e=t.target?.closest?.("label")?.control||t.target;rn(e)&&(t.preventDefault(),e.focus())},Qa=t=>{t.target instanceof HTMLSelectElement&&rn(t.target)&&t.preventDefault()};tt("readonly",()=>[I(document,"keydown",Ka),I(document,"click",Ya),I(document,"mousedown",Qa)]);const zo="aria-label",ve="data-toggle-group",Fo=`[${ve}]`,Za=()=>{for(let t of document.querySelectorAll(Fo))v(t,"aria-label",Ct(t,ve))},Ja=t=>{let{key:e,target:n}=t,o=n instanceof HTMLInputElement&&n.closest(Fo);if(o&&(!v(o,zo)&&!v(o,"aria-labelledby")&&v(o,zo,Ct(o,ve)),e==="Enter"&&n.click(),e?.startsWith("Arrow"))){t.preventDefault?.();let i=[...o.getElementsByTagName("input")],r=i.indexOf(n),s=e.match(/Arrow(Right|Down)/)?1:-1,a=r;for(let l=0;l<i.length;l++)if(a=(i.length+a+s)%i.length,!i[a]?.disabled){i[a]?.focus();break}}};tt("toggle-group",()=>[I(document,"keydown",Ja),et(document,Za,{attributeFilter:[ve],attributes:!0,childList:!0,subtree:!0})]);let T,Wt,ye=!1,sn=0,an=0;const tl=G()&&/iPad|iPhone|iPod/.test(navigator.userAgent),Rt="data-tooltip",ln="data-color",Uo="aria-label",Wo="aria-description",el=`[${ln}]`,nl=`[${Rt}]`,cn="data-color-scheme",ol=`[${cn}]`,Vo=t=>{t&&!(t instanceof HTMLElement)&&mt("setTooltipElement expects an HTMLElement, got: ",t),clearTimeout(an),clearTimeout(sn),Wt=void 0,ye=!1,T=t||void 0},il=()=>{for(let t of document.querySelectorAll(nl)){let e=Ct(t,Rt);if(!e)return;if(e!==(t.getAttribute(Uo)||t.getAttribute(Wo))){let i=v(t,"role")!=="img"&&t.textContent?.trim();v(t,Rt,e),v(t,Uo,i?null:e),v(t,Wo,i?e:null),t.matches("a,button,input,label,select,textarea,[tabindex]")||mt('Missing tabindex="0" attribute on: ',t)}let n=t===Wt&&T?.offsetHeight&&T?.offsetWidth,o=n&&e&&T?.textContent!==e;n&&o&&(T&&(T.textContent=e),document.activeElement===t&&Xe(e))}},Go=({type:t,target:e})=>{if(clearTimeout(sn),e===T)return;if(t==="mouseover"&&!ye&&!tl){sn=setTimeout(Go,300,{target:e});return}let n=e?.closest?.(`[${Rt}]`);if(n===Wt)return;if(!n)return jo();T||=ho("div",{class:"ds-tooltip"}),T.isConnected||document.body.appendChild(T);let o=n.closest(el),i=n.closest(ol),r=o!==i&&o?.contains(i);clearTimeout(an),v(T,"popover","manual"),v(T,cn,i?.getAttribute(cn)||null),v(T,ln,r&&o?.getAttribute(ln)||null),T.textContent=v(n,Rt),T.showPopover(),T.dispatchEvent(new CustomEvent("ds-toggle-source",{detail:n})),ye=!0,Wt=n},jo=()=>T?.isConnected&&T.popover&&T.hidePopover(),Xo=t=>{if(t?.type==="keydown")return t?.key==="Escape"&&jo();t?t.target===T&&t.newState==="closed"&&(Wt=void 0,an=setTimeout(Xo,300)):ye=!1};tt("tooltip",()=>[I(document,"blur focus mouseover",Go,z),I(document,"toggle keydown",Xo,z),et(document,il,{attributeFilter:[Rt],attributes:!0,childList:!0,subtree:!0})]);const dn="aria-label";var Ko=class extends ae{_items;_label=null;_unresize;_unmutate;static get observedAttributes(){return[dn]}connectedCallback(){let e=po(()=>un(this),100);this._label=Ct(this,dn),this._items=this.getElementsByTagName("a"),this._unresize=I(window,"resize",e),this._unmutate=et(this,un,{childList:!0,subtree:!0})}attributeChangedCallback(e,n,o){!this._unmutate||!o||(this._label=o,un(this))}disconnectedCallback(){this._unresize?.(),this._unmutate?.(),this._unresize=this._unmutate=this._items=void 0}};const un=t=>{let e=t._items?.[t._items.length-1],n=e?.parentElement===t?null:e,o=!n?.offsetHeight;v(t,"role",o?null:"navigation"),v(t,dn,o?null:t._label);for(let i of t._items||[])v(i,"aria-current",i===n?"page":null)};nt.define("ds-breadcrumbs",Ko);var Yo=class extends ae{_unmutate;connectedCallback(){I(this,"animationend",this,z),v(this,"role","group"),v(this,"tabindex","-1"),this._unmutate=et(this,rl,{childList:!0,subtree:!0}),this.focus()}handleEvent({target:e}){e===this&&this.focus()}disconnectedCallback(){je(this,"animationend",this,z),this._unmutate?.(),this._unmutate=void 0}};const rl=t=>{let e=v(t,"aria-label")?.trim(),n=v(t,"aria-labelledby")?.trim(),o=t.querySelector("h2,h3,h4,h5,h6");o&&!e&&!n&&v(t,"aria-labelledby",ot(o)),!o&&!e&&!n&&mt("Missing accessible name on:",t,`
|
|
6
|
-
Add a heading (h2–h6), or set aria-label or aria-labelledby to provide an accessible name for screen readers.`)};nt.define("ds-error-summary",
|
|
5
|
+
@keyframes indeterminate { from { background-position-x: 100% } to { background-position-x: 0 } }`,ho=class extends Ws{constructor(){var t;super(),this._skipAttrChange=!1,Vs(this,Ys),this._internals=(t=this.attachInternals)==null?void 0:t.call(this)}static get observedAttributes(){return["aria-label","aria-labelledby",se,je]}connectedCallback(){H(this,"aria-valuemin","0"),H(this,"aria-valuemax","100"),H(this,"role",fo?"img":"progressbar"),this.attributeChangedCallback()}attributeChangedCallback(){if(this._skipAttrChange||!this.hasAttribute("role"))return;this._skipAttrChange=!0;const t=this.position,e=Math.max(0,Math.round(t*100));this.style.setProperty("--percentage",`${e}%`);let n=js(this);fo&&(n=`${n.replace(/\(\d+%\)$/,"")} (${e}%)`.trim()),H(this,"aria-busy",`${t===-1}`),H(this,"aria-label",n),H(this,"aria-labelledby",null),H(this,"aria-valuenow",t===-1?null:`${e}`),this._skipAttrChange=!1}get labels(){var t;const e=(t=this._internals)==null?void 0:t.labels;if(e)return e;const n=Xs(this),o=this.closest("label:not([for])");return o&&H(o,"for",n),Gs(this).querySelectorAll(`label[for="${n}"]`)}get position(){return this.hasAttribute(se)?Math.min(this.value/this.max,1):-1}get value(){return Math.min(go(this,se),this.max)}set value(t){bo(this,se,t)}get max(){return go(this,je,1)}set max(t){bo(this,je,t,1)}};ho.formAssociated=!0;var go=(t,e,n=0)=>{const o=H(t,e),i=Number(o);return o===null?n:Number.isFinite(i)&&Math.max(n,i)||n},bo=(t,e,n,o=0)=>{const i=Number(n);if(Number.isFinite(i))return H(t,e,`${Math.max(o,i)||o}`);throw new Error(`Failed to set the '${e}' property on 'UHTMLProgressElement': The provided double value is non-finite.`)};Ks.define("u-progress",ho);function Qs(){return typeof HTMLButtonElement<"u"&&"command"in HTMLButtonElement.prototype&&"source"in((globalThis.CommandEvent||{}).prototype||{})}function Zs(){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,p,b=!0){Object.defineProperty(f,p,{...Object.getOwnPropertyDescriptor(f,p),enumerable:b})}function e(f){return f&&typeof f.getRootNode=="function"?f.getRootNode():f&&f.parentNode?e(f.parentNode):f}let n=new WeakMap,o=new WeakMap;class i extends Event{constructor(p,b={}){super(p,b);let{source:y,command:_}=b;if(y!=null&&!(y instanceof Element))throw TypeError("source must be an element");n.set(this,y||null),o.set(this,_===void 0?"":String(_))}get[Symbol.toStringTag](){return"CommandEvent"}get source(){if(!n.has(this))throw TypeError("illegal invocation");let p=n.get(this);if(!(p instanceof Element))return null;let b=e(p);return b===e(this.target||document)?p:b.host}get command(){if(!o.has(this))throw TypeError("illegal invocation");return o.get(this)}}t(i.prototype,"source"),t(i.prototype,"command");let r=new WeakMap;function s(f){Object.defineProperties(f.prototype,{commandForElement:{enumerable:!0,configurable:!0,set(p){if(p===null)this.removeAttribute("commandfor"),r.delete(this);else if(p instanceof Element){this.setAttribute("commandfor","");let b=e(p);e(this)===b||b===this.ownerDocument?r.set(this,p):r.delete(this)}else throw TypeError("commandForElement must be an element or null")},get(){if(this.localName!=="button"||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;let p=r.get(this);if(p)return p.isConnected?p:(r.delete(this),null);let b=e(this),y=this.getAttribute("commandfor");return(b instanceof Document||b instanceof ShadowRoot)&&y&&b.getElementById(y)||null}},command:{enumerable:!0,configurable:!0,get(){let p=this.getAttribute("command")||"";if(p.startsWith("--"))return p;let b=p.toLowerCase();switch(b){case"show-modal":case"request-close":case"close":case"toggle-popover":case"hide-popover":case"show-popover":return b}return""},set(p){this.setAttribute("command",p)}}})}let a=new WeakMap;Object.defineProperties(HTMLElement.prototype,{oncommand:{enumerable:!0,configurable:!0,get(){return c.takeRecords(),a.get(this)||null},set(f){let p=a.get(this)||null;p&&this.removeEventListener("command",p),a.set(this,typeof f=="object"||typeof f=="function"?f:null),typeof f=="function"&&this.addEventListener("command",f)}}});function l(f){for(let p of f)p.oncommand=Function("event",p.getAttribute("oncommand"))}let c=new MutationObserver(f=>{for(let p of f){let{target:b}=p;p.type==="childList"?l(b.querySelectorAll("[oncommand]")):l([b])}});c.observe(document,{subtree:!0,childList:!0,attributeFilter:["oncommand"]}),l(document.querySelectorAll("[oncommand]"));let u=new WeakSet;function d(f){if(u.has(f)||(u.add(f),f.defaultPrevented)||f.type!=="click")return;let p=f.composedPath().find(w=>w.matches?.("button[commandfor], button[command]"));if(!p)return;if(p.form&&p.getAttribute("type")!=="button")throw f.preventDefault(),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(p.hasAttribute("command")!==p.hasAttribute("commandfor")){let w=p.hasAttribute("command")?"command":"commandfor",S=p.hasAttribute("command")?"commandfor":"command";throw Error(`Element with ${w} attribute must also have a ${S} attribute to function.`)}if(p.command!=="show-popover"&&p.command!=="hide-popover"&&p.command!=="toggle-popover"&&p.command!=="show-modal"&&p.command!=="request-close"&&p.command!=="close"&&!p.command.startsWith("--")){console.warn(`"${p.command}" is not a valid command value. Custom commands must begin with --`);return}let b=p.commandForElement;if(!b)return;let y=new i("command",{command:p.command,source:p,cancelable:!0});if(b.dispatchEvent(y),y.defaultPrevented)return;let _=y.command.toLowerCase();if(b.popover){let w=!b.matches(":popover-open");w&&(_==="toggle-popover"||_==="show-popover")?b.showPopover({source:p}):!w&&_==="hide-popover"&&b.hidePopover()}else if(b.localName==="dialog"){let w=!b.hasAttribute("open");w&&_=="show-modal"?b.showModal():!w&&_=="close"?b.close(p.value?p.value:void 0):!w&&_=="request-close"&&(HTMLDialogElement.prototype.requestClose||(HTMLDialogElement.prototype.requestClose=function(){let S=new Event("cancel",{cancelable:!0});this.dispatchEvent(S),S.defaultPrevented||this.close()}),b.requestClose(p.value?p.value:void 0))}}function m(f){f.addEventListener("click",d,!0)}function h(f,p){let b=f.prototype.attachShadow;f.prototype.attachShadow=function(_){let w=b.call(this,_);return p(w),w};let y=f.prototype.attachInternals;f.prototype.attachInternals=function(){let _=y.call(this);return _.shadowRoot&&p(_.shadowRoot),_}}s(HTMLButtonElement),h(HTMLElement,f=>{m(f),c.observe(f,{attributeFilter:["oncommand"]}),l(f.querySelectorAll("[oncommand]"))}),m(document),Object.assign(globalThis,{CommandEvent:i})}const U={passive:!0,capture:!0},G=()=>typeof window<"u"&&typeof document<"u",Js=()=>G()&&/^Win/i.test(navigator.userAgentData?.platform||navigator.platform),ae=typeof HTMLElement>"u"?class{}:HTMLElement;function vo(t,e){let n;return function(...o){clearTimeout(n),n=setTimeout(()=>t.apply(this,o),e)}}const pt=(t,...e)=>!G()||window.dsWarnings===!1||console.log(`\x1B[1mDesignsystemet:\x1B[m ${t}`,...e),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),Xe=(t,e)=>getComputedStyle(t).getPropertyValue(e).trim(),ta=/^["']|["']$/g,At=(t,e)=>{let n=v(t,e);return n||=Xe(t,`--_ds-${e}`).replace(ta,"").trim(),n||pt(`Missing ${e} on:`,t),n||null},O=(t,...e)=>{let[n,...o]=e;for(let i of n.split(" "))t.addEventListener(i,...o);return()=>Ke(t,...e)},Ke=(t,...e)=>{let[n,...o]=e;for(let i of n.split(" "))t.removeEventListener(i,...o)},tt=(t,e)=>{G()&&(window._dsHotReloadCleanup||(window._dsHotReloadCleanup=new Map),window._dsHotReloadCleanup?.get(t)?.map(n=>n()),window._dsHotReloadCleanup?.set(t,e()))},et=(t,e,n)=>{let o=()=>i.disconnect(),i=new MutationObserver(r=>{if(!G()||!t.isConnected)return o();e(t,r)});return e(t),i.observe(t,n),o},yo=(t,e)=>{let n=document.createElement(t);if(e)for(let[o,i]of Object.entries(e))v(n,o,i);return n},nt={define:(t,e)=>!G()||window.customElements.get(t)||window.customElements.define(t,e)};let ea=0;function ot(t){return G()?(window.dsUseId||(window.dsUseId=0),t&&!t.id&&(t.id=`:ds:${++window.dsUseId}`),t?.id||""):`:ds:${++ea}`}let j,na=0,wo=0;const Ye=t=>{clearTimeout(wo),j&&(j.textContent=`${t}${na++%2?" ":""}`),t&&(wo=setTimeout(Ye,2e3,""))},oa=()=>{document.readyState==="complete"&&(j||(j=yo("div",{"aria-live":"assertive"}),j.style.overflow="hidden",j.style.position="fixed",j.style.whiteSpace="nowrap",j.style.width="1px"),j.isConnected||document.body.appendChild(j))};tt("announce",()=>[O(document,"focus mouseover",oa,U)]);const _o=":click-delegate-hover",So="data-clickdelegatefor",ia=`[${So}]`,ra=t=>{let e=t.button===1||t.metaKey||t.ctrlKey,n=t.button<2&&xo(t);if(!(!n||n.contains(t.target))){if(e&&n instanceof HTMLAnchorElement)return window.open(n.href,void 0,n.rel);t.stopImmediatePropagation(),n.click()}};let le;const sa=t=>{let e=xo(t);le!==e&&(le&&le.classList.remove(_o),e&&e.classList.add(_o),le=e)},xo=({target:t})=>{let e=(t instanceof Element?t.closest(ia):null)?.getAttribute(So),n=e&&document.getElementById(e)||void 0,o=n&&t.closest('a,button,label,input,select,textarea,details,dialog,[role="button"],[popover],[contenteditable]');return(!o||o===n)&&!n?.disabled?n:void 0};tt("clickdelegatefor",()=>[O(window,"click auxclick",ra,!0),O(document,"mouseover",sa,U)]);let Qe=!1;const aa=({type:t,target:e,clientX:n=0,clientY:o=0})=>{if(t==="pointerdown"){let i=e?.closest?.("dialog")?.getBoundingClientRect();Qe=!!(i&&i.top<=o&&o<=i.bottom&&i.left<=n&&n<=i.right)}else{let i=e instanceof HTMLDialogElement&&!Qe&&v(e,"closedby")==="any";Qe=!1,i&&requestAnimationFrame(()=>e.open&&e.close())}},la=G()?document.getElementsByTagName("button"):[],ca=()=>{for(let t of la)t.getAttribute("command")?.endsWith("-modal")&&t.setAttribute("aria-haspopup","dialog")},da=({command:t,target:e})=>t==="--show-non-modal"&&e instanceof HTMLDialogElement&&e.show();tt("dialog",()=>[O(document,"command",da,U),O(document,"pointerdown pointerup",aa,U),et(document,ca,{attributeFilter:["command"],attributes:!0,childList:!0,subtree:!0})]);const ua=G()?document.getElementsByTagName("fieldset"):[],fa=()=>{for(let t of ua)t.hasAttribute("aria-labelledby")||v(t,"aria-labelledby",`${ot(t.querySelector("legend"))} ${ot(t.querySelector(':scope > :is([data-field="description"],legend + p)'))}`.trim()||null)};tt("fieldset",()=>[et(document,fa,{childList:!0,subtree:!0})]);const Tt=Math.min,q=Math.max,ce=Math.round,de=Math.floor,X=t=>({x:t,y:t}),ma={left:"right",right:"left",bottom:"top",top:"bottom"};function Eo(t,e,n){return q(t,Tt(e,n))}function ht(t,e){return typeof t=="function"?t(e):t}function it(t){return t.split("-")[0]}function Ut(t){return t.split("-")[1]}function Ze(t){return t==="x"?"y":"x"}function $o(t){return t==="y"?"height":"width"}function K(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Co(t){return Ze(K(t))}function pa(t,e,n){n===void 0&&(n=!1);const o=Ut(t),i=Co(t),r=$o(i);let s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=ue(s)),[s,ue(s)]}function ha(t){const e=ue(t);return[Je(t),e,Je(e)]}function Je(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Ao=["left","right"],To=["right","left"],ga=["top","bottom"],ba=["bottom","top"];function va(t,e,n){switch(t){case"top":case"bottom":return n?e?To:Ao:e?Ao:To;case"left":case"right":return e?ga:ba;default:return[]}}function ya(t,e,n,o){const i=Ut(t);let r=va(it(t),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(Je)))),r}function ue(t){const e=it(t);return ma[e]+t.slice(e.length)}function wa(t){return{top:0,right:0,bottom:0,left:0,...t}}function _a(t){return typeof t!="number"?wa(t):{top:t,right:t,bottom:t,left:t}}function fe(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 ko(t,e,n){let{reference:o,floating:i}=t;const r=K(e),s=Co(e),a=$o(s),l=it(e),c=r==="y",u=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,m=o[a]/2-i[a]/2;let h;switch(l){case"top":h={x:u,y:o.y-i.height};break;case"bottom":h={x:u,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:d};break;case"left":h={x:o.x-i.width,y:d};break;default:h={x:o.x,y:o.y}}switch(Ut(e)){case"start":h[s]-=m*(n&&c?-1:1);break;case"end":h[s]+=m*(n&&c?-1:1);break}return h}async function Sa(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:r,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:m=!1,padding:h=0}=ht(e,t),f=_a(h),b=a[m?d==="floating"?"reference":"floating":d],y=fe(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(b)))==null||n?b:b.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),_=d==="floating"?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),S=await(r.isElement==null?void 0:r.isElement(w))?await(r.getScale==null?void 0:r.getScale(w))||{x:1,y:1}:{x:1,y:1},A=fe(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:_,offsetParent:w,strategy:l}):_);return{top:(y.top-A.top+f.top)/S.y,bottom:(A.bottom-y.bottom+f.bottom)/S.y,left:(y.left-A.left+f.left)/S.x,right:(A.right-y.right+f.right)/S.x}}const xa=50,Ea=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:Sa},l=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=ko(c,o,l),m=o,h=0;const f={};for(let p=0;p<r.length;p++){const b=r[p];if(!b)continue;const{name:y,fn:_}=b,{x:w,y:S,data:A,reset:k}=await _({x:u,y:d,initialPlacement:o,placement:m,strategy:i,middlewareData:f,rects:c,platform:a,elements:{reference:t,floating:e}});u=w??u,d=S??d,f[y]={...f[y],...A},k&&h<xa&&(h++,typeof k=="object"&&(k.placement&&(m=k.placement),k.rects&&(c=k.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):k.rects),{x:u,y:d}=ko(c,m,l)),p=-1)}return{x:u,y:d,placement:m,strategy:i,middlewareData:f}},$a=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:p=!0,...b}=ht(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const y=it(i),_=K(a),w=it(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),A=m||(w||!p?[ue(a)]:ha(a)),k=f!=="none";!m&&k&&A.push(...ya(a,p,f,S));const J=[a,...A],xt=await l.detectOverflow(e,b),Et=[];let lt=((o=r.flip)==null?void 0:o.overflows)||[];if(u&&Et.push(xt[y]),d){const $t=pa(i,s,S);Et.push(xt[$t[0]],xt[$t[1]])}if(lt=[...lt,{placement:i,overflows:Et}],!Et.every($t=>$t<=0)){var ee,ne;const $t=(((ee=r.flip)==null?void 0:ee.index)||0)+1,co=J[$t];if(co&&(!(d==="alignment"?_!==K(co):!1)||lt.every(V=>K(V.placement)===_?V.overflows[0]>0:!0)))return{data:{index:$t,overflows:lt},reset:{placement:co}};let ie=(ne=lt.filter(Ct=>Ct.overflows[0]<=0).sort((Ct,V)=>Ct.overflows[1]-V.overflows[1])[0])==null?void 0:ne.placement;if(!ie)switch(h){case"bestFit":{var oe;const Ct=(oe=lt.filter(V=>{if(k){const mt=K(V.placement);return mt===_||mt==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(mt=>mt>0).reduce((mt,Fu)=>mt+Fu,0)]).sort((V,mt)=>V[1]-mt[1])[0])==null?void 0:oe[0];Ct&&(ie=Ct);break}case"initialPlacement":ie=a;break}if(i!==ie)return{reset:{placement:ie}}}return{}}}},Lo=new Set(["left","top"]);async function Ca(t,e){const{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=it(n),a=Ut(n),l=K(n)==="y",c=Lo.has(s)?-1:1,u=r&&l?-1:1,d=ht(e,t);let{mainAxis:m,crossAxis:h,alignmentAxis:f}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof f=="number"&&(h=a==="end"?f*-1:f),l?{x:h*u,y:m*c}:{x:m*c,y:h*u}}const Aa=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:a}=e,l=await Ca(e,t);return s===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:s}}}}},Ta=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:r}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:y=>{let{x:_,y:w}=y;return{x:_,y:w}}},...c}=ht(t,e),u={x:n,y:o},d=await r.detectOverflow(e,c),m=K(it(i)),h=Ze(m);let f=u[h],p=u[m];if(s){const y=h==="y"?"top":"left",_=h==="y"?"bottom":"right",w=f+d[y],S=f-d[_];f=Eo(w,f,S)}if(a){const y=m==="y"?"top":"left",_=m==="y"?"bottom":"right",w=p+d[y],S=p-d[_];p=Eo(w,p,S)}const b=l.fn({...e,[h]:f,[m]:p});return{...b,data:{x:b.x-n,y:b.y-o,enabled:{[h]:s,[m]:a}}}}}},ka=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:i,rects:r,middlewareData:s}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=ht(t,e),u={x:n,y:o},d=K(i),m=Ze(d);let h=u[m],f=u[d];const p=ht(a,e),b=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const w=m==="y"?"height":"width",S=r.reference[m]-r.floating[w]+b.mainAxis,A=r.reference[m]+r.reference[w]-b.mainAxis;h<S?h=S:h>A&&(h=A)}if(c){var y,_;const w=m==="y"?"width":"height",S=Lo.has(it(i)),A=r.reference[d]-r.floating[w]+(S&&((y=s.offset)==null?void 0:y[d])||0)+(S?0:b.crossAxis),k=r.reference[d]+r.reference[w]+(S?0:((_=s.offset)==null?void 0:_[d])||0)-(S?b.crossAxis:0);f<A?f=A:f>k&&(f=k)}return{[m]:h,[d]:f}}}},La=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:r,platform:s,elements:a}=e,{apply:l=()=>{},...c}=ht(t,e),u=await s.detectOverflow(e,c),d=it(i),m=Ut(i),h=K(i)==="y",{width:f,height:p}=r.floating;let b,y;d==="top"||d==="bottom"?(b=d,y=m===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,b=m==="end"?"top":"bottom");const _=p-u.top-u.bottom,w=f-u.left-u.right,S=Tt(p-u[b],_),A=Tt(f-u[y],w),k=!e.middlewareData.shift;let J=S,xt=A;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(xt=w),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(J=_),k&&!m){const lt=q(u.left,0),ee=q(u.right,0),ne=q(u.top,0),oe=q(u.bottom,0);h?xt=f-2*(lt!==0||ee!==0?lt+ee:q(u.left,u.right)):J=p-2*(ne!==0||oe!==0?ne+oe:q(u.top,u.bottom))}await l({...e,availableWidth:xt,availableHeight:J});const Et=await s.getDimensions(a.floating);return f!==Et.width||p!==Et.height?{reset:{rects:!0}}:{}}}};function me(){return typeof window<"u"}function kt(t){return Ro(t)?(t.nodeName||"").toLowerCase():"#document"}function B(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Y(t){var e;return(e=(Ro(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ro(t){return me()?t instanceof Node||t instanceof B(t).Node:!1}function z(t){return me()?t instanceof Element||t instanceof B(t).Element:!1}function rt(t){return me()?t instanceof HTMLElement||t instanceof B(t).HTMLElement:!1}function Io(t){return!me()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof B(t).ShadowRoot}function zt(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=F(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&i!=="inline"&&i!=="contents"}function Ra(t){return/^(table|td|th)$/.test(kt(t))}function pe(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const Ia=/transform|translate|scale|rotate|perspective|filter/,Oa=/paint|layout|strict|content/,gt=t=>!!t&&t!=="none";let tn;function en(t){const e=z(t)?F(t):t;return gt(e.transform)||gt(e.translate)||gt(e.scale)||gt(e.rotate)||gt(e.perspective)||!nn()&&(gt(e.backdropFilter)||gt(e.filter))||Ia.test(e.willChange||"")||Oa.test(e.contain||"")}function Ma(t){let e=ct(t);for(;rt(e)&&!Lt(e);){if(en(e))return e;if(pe(e))return null;e=ct(e)}return null}function nn(){return tn==null&&(tn=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),tn}function Lt(t){return/^(html|body|#document)$/.test(kt(t))}function F(t){return B(t).getComputedStyle(t)}function he(t){return z(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ct(t){if(kt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Io(t)&&t.host||Y(t);return Io(e)?e.host:e}function Oo(t){const e=ct(t);return Lt(e)?t.ownerDocument?t.ownerDocument.body:t.body:rt(e)&&zt(e)?e:Oo(e)}function Ft(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Oo(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),s=B(i);if(r){const a=on(s);return e.concat(s,s.visualViewport||[],zt(i)?i:[],a&&n?Ft(a):[])}else return e.concat(i,Ft(i,[],n))}function on(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Mo(t){const e=F(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=rt(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,a=ce(n)!==r||ce(o)!==s;return a&&(n=r,o=s),{width:n,height:o,$:a}}function rn(t){return z(t)?t:t.contextElement}function Rt(t){const e=rn(t);if(!rt(e))return X(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=Mo(e);let s=(r?ce(n.width):n.width)/o,a=(r?ce(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Da=X(0);function Do(t){const e=B(t);return!nn()||!e.visualViewport?Da:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Pa(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==B(t)?!1:e}function bt(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=rn(t);let s=X(1);e&&(o?z(o)&&(s=Rt(o)):s=Rt(t));const a=Pa(r,n,o)?Do(r):X(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,d=i.height/s.y;if(r){const m=B(r),h=o&&z(o)?B(o):o;let f=m,p=on(f);for(;p&&o&&h!==f;){const b=Rt(p),y=p.getBoundingClientRect(),_=F(p),w=y.left+(p.clientLeft+parseFloat(_.paddingLeft))*b.x,S=y.top+(p.clientTop+parseFloat(_.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,d*=b.y,l+=w,c+=S,f=B(p),p=on(f)}}return fe({width:u,height:d,x:l,y:c})}function ge(t,e){const n=he(t).scrollLeft;return e?e.left+n:bt(Y(t)).left+n}function Po(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-ge(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function Na(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r=i==="fixed",s=Y(o),a=e?pe(e.floating):!1;if(o===s||a&&r)return n;let l={scrollLeft:0,scrollTop:0},c=X(1);const u=X(0),d=rt(o);if((d||!d&&!r)&&((kt(o)!=="body"||zt(s))&&(l=he(o)),d)){const h=bt(o);c=Rt(o),u.x=h.x+o.clientLeft,u.y=h.y+o.clientTop}const m=s&&!d&&!r?Po(s,l):X(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+m.x,y:n.y*c.y-l.scrollTop*c.y+u.y+m.y}}function Ha(t){return Array.from(t.getClientRects())}function qa(t){const e=Y(t),n=he(t),o=t.ownerDocument.body,i=q(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=q(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+ge(t);const a=-n.scrollTop;return F(o).direction==="rtl"&&(s+=q(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:a}}const No=25;function Ba(t,e){const n=B(t),o=Y(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,a=0,l=0;if(i){r=i.width,s=i.height;const u=nn();(!u||u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const c=ge(o);if(c<=0){const u=o.ownerDocument,d=u.body,m=getComputedStyle(d),h=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,f=Math.abs(o.clientWidth-d.clientWidth-h);f<=No&&(r-=f)}else c<=No&&(r+=c);return{width:r,height:s,x:a,y:l}}function Ua(t,e){const n=bt(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=rt(t)?Rt(t):X(1),s=t.clientWidth*r.x,a=t.clientHeight*r.y,l=i*r.x,c=o*r.y;return{width:s,height:a,x:l,y:c}}function Ho(t,e,n){let o;if(e==="viewport")o=Ba(t,n);else if(e==="document")o=qa(Y(t));else if(z(e))o=Ua(e,n);else{const i=Do(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return fe(o)}function qo(t,e){const n=ct(t);return n===e||!z(n)||Lt(n)?!1:F(n).position==="fixed"||qo(n,e)}function za(t,e){const n=e.get(t);if(n)return n;let o=Ft(t,[],!1).filter(a=>z(a)&&kt(a)!=="body"),i=null;const r=F(t).position==="fixed";let s=r?ct(t):t;for(;z(s)&&!Lt(s);){const a=F(s),l=en(s);!l&&a.position==="fixed"&&(i=null),(r?!l&&!i:!l&&a.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||zt(s)&&!l&&qo(t,s))?o=o.filter(u=>u!==s):i=a,s=ct(s)}return e.set(t,o),o}function Fa(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const s=[...n==="clippingAncestors"?pe(e)?[]:za(e,this._c):[].concat(n),o],a=Ho(e,s[0],i);let l=a.top,c=a.right,u=a.bottom,d=a.left;for(let m=1;m<s.length;m++){const h=Ho(e,s[m],i);l=q(h.top,l),c=Tt(h.right,c),u=Tt(h.bottom,u),d=q(h.left,d)}return{width:c-d,height:u-l,x:d,y:l}}function Wa(t){const{width:e,height:n}=Mo(t);return{width:e,height:n}}function Va(t,e,n){const o=rt(e),i=Y(e),r=n==="fixed",s=bt(t,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=X(0);function c(){l.x=ge(i)}if(o||!o&&!r)if((kt(e)!=="body"||zt(i))&&(a=he(e)),o){const h=bt(e,!0,r,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}else i&&c();r&&!o&&i&&c();const u=i&&!o&&!r?Po(i,a):X(0),d=s.left+a.scrollLeft-l.x-u.x,m=s.top+a.scrollTop-l.y-u.y;return{x:d,y:m,width:s.width,height:s.height}}function sn(t){return F(t).position==="static"}function Bo(t,e){if(!rt(t)||F(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Y(t)===n&&(n=n.ownerDocument.body),n}function Uo(t,e){const n=B(t);if(pe(t))return n;if(!rt(t)){let i=ct(t);for(;i&&!Lt(i);){if(z(i)&&!sn(i))return i;i=ct(i)}return n}let o=Bo(t,e);for(;o&&Ra(o)&&sn(o);)o=Bo(o,e);return o&&Lt(o)&&sn(o)&&!en(o)?n:o||Ma(t)||n}const Ga=async function(t){const e=this.getOffsetParent||Uo,n=this.getDimensions,o=await n(t.floating);return{reference:Va(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function ja(t){return F(t).direction==="rtl"}const Xa={convertOffsetParentRelativeRectToViewportRelativeRect:Na,getDocumentElement:Y,getClippingRect:Fa,getOffsetParent:Uo,getElementRects:Ga,getClientRects:Ha,getDimensions:Wa,getScale:Rt,isElement:z,isRTL:ja};function zo(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Ka(t,e){let n=null,o;const i=Y(t);function r(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),r();const c=t.getBoundingClientRect(),{left:u,top:d,width:m,height:h}=c;if(a||e(),!m||!h)return;const f=de(d),p=de(i.clientWidth-(u+m)),b=de(i.clientHeight-(d+h)),y=de(u),w={rootMargin:-f+"px "+-p+"px "+-b+"px "+-y+"px",threshold:q(0,Tt(1,l))||1};let S=!0;function A(k){const J=k[0].intersectionRatio;if(J!==l){if(!S)return s();J?s(!1,J):o=setTimeout(()=>{s(!1,1e-7)},1e3)}J===1&&!zo(c,t.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(A,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(A,w)}n.observe(t)}return s(!0),r}function Ya(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,c=rn(t),u=i||r?[...c?Ft(c):[],...e?Ft(e):[]]:[];u.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),r&&y.addEventListener("resize",n)});const d=c&&a?Ka(c,n):null;let m=-1,h=null;s&&(h=new ResizeObserver(y=>{let[_]=y;_&&_.target===c&&h&&e&&(h.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(e)})),n()}),c&&!l&&h.observe(c),e&&h.observe(e));let f,p=l?bt(t):null;l&&b();function b(){const y=bt(t);p&&!zo(p,y)&&n(),p=y,f=requestAnimationFrame(b)}return n(),()=>{var y;u.forEach(_=>{i&&_.removeEventListener("scroll",n),r&&_.removeEventListener("resize",n)}),d?.(),(y=h)==null||y.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const Qa=Aa,Za=Ta,Ja=$a,tl=La,el=ka,nl=(t,e,n)=>{const o=new Map,i={platform:Xa,...n},r={...i.platform,_c:o};return Ea(t,e,{...i,platform:r})},Fo="data-placement",Wo="data-autoplacement",Wt=new Map;function ol(t){let{newState:e,oldState:n,target:o,source:i=t.detail}=t,r=o instanceof HTMLElement&&v(o,"popover")!==null&&Xe(o,"--_ds-floating");if(!r)return;if(e==="closed")return Wt.get(o)?.();if(!i){let f=o.getRootNode(),p=`[popovertarget="${o.id}"],[commandfor="${o.id}"]`;i=o.id&&f?.querySelector?.(p)||void 0}if(!i||i===o||n&&n===e)return;let s=Xe(o,"--_ds-floating-overscroll"),a=v(o,Fo)||v(i,Fo)||r,l=v(o,Wo)||v(i,Wo),c=parseFloat(getComputedStyle(o,"::before").height)||0,u=a.match(/left|right/gi)?"Height":"Width",d=i[`offset${u}`]/2+c;if(a==="none")return;let m={strategy:"absolute",placement:a,middleware:[Qa(c||0),Za({padding:10,limiter:el({offset:{mainAxis:d}})}),rl(),...l==="false"?[]:[Ja({padding:10,crossAxis:!1})],...s?[tl({apply({availableHeight:f}){s==="fit"&&(o.style.width=`${i.offsetWidth}px`),o.style.maxHeight=`${Math.max(50,f-20)}px`}})]:[]]},h=Ya(i,o,async()=>{if(!i?.isConnected)return Wt.get(o)?.();let{x:f,y:p}=await nl(i,o,m);o.style.translate=`${f}px ${p}px`});Wt.set(o,()=>Wt.delete(o)&&h())}let be;const il=({type:t})=>{if(t==="mousedown"&&(be=!1),t==="scroll"&&be===!1&&(be=!0),t==="mouseup"&&be)for(let[e]of Wt)e.showPopover()};tt("popover",()=>[O(document,"mousedown scroll mouseup",il,!0),O(document,"toggle ds-toggle-source",ol,U)]);const rl=()=>({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),v(e,"data-floating",t.placement),t}}),an=t=>(t instanceof HTMLSelectElement||t instanceof HTMLInputElement)&&(t.hasAttribute("readonly")||v(t,"aria-readonly")==="true"),sl=t=>{if(t.key!=="Tab"&&an(t.target)){let e=t.key?.startsWith("Arrow"),n=t.altKey||t.ctrlKey||t.metaKey;if((e||!n)&&t.preventDefault(),e&&v(t.target,"type")==="radio"){let o=document.querySelectorAll(`input[name="${t.target.name}"]`),i=t.key?.match(/Arrow(Right|Down)/)?1:-1;o[(o.length+[...o].indexOf(t.target)+i)%o.length]?.focus()}}},al=t=>{let e=t.target?.closest?.("label")?.control||t.target;an(e)&&(t.preventDefault(),e.focus())},ll=t=>{t.target instanceof HTMLSelectElement&&an(t.target)&&t.preventDefault()};tt("readonly",()=>[O(document,"keydown",sl),O(document,"click",al),O(document,"mousedown",ll)]);const Vo="aria-label",ve="data-toggle-group",Go=`[${ve}]`,cl=()=>{for(let t of document.querySelectorAll(Go))v(t,"aria-label",At(t,ve))},dl=t=>{let{key:e,target:n}=t,o=n instanceof HTMLInputElement&&n.closest(Go);if(o&&(!v(o,Vo)&&!v(o,"aria-labelledby")&&v(o,Vo,At(o,ve)),e==="Enter"&&n.click(),e?.startsWith("Arrow"))){t.preventDefault?.();let i=[...o.getElementsByTagName("input")],r=i.indexOf(n),s=e.match(/Arrow(Right|Down)/)?1:-1,a=r;for(let l=0;l<i.length;l++)if(a=(i.length+a+s)%i.length,!i[a]?.disabled){i[a]?.focus();break}}};tt("toggle-group",()=>[O(document,"keydown",dl),et(document,cl,{attributeFilter:[ve],attributes:!0,childList:!0,subtree:!0})]);let T,Vt,ye=!1,ln=0,cn=0;const ul=G()&&/iPad|iPhone|iPod/.test(navigator.userAgent),It="data-tooltip",dn="data-color",jo="aria-label",Xo="aria-description",fl=`[${dn}]`,ml=`[${It}]`,un="data-color-scheme",pl=`[${un}]`,Ko=t=>{t&&!(t instanceof HTMLElement)&&pt("setTooltipElement expects an HTMLElement, got: ",t),clearTimeout(cn),clearTimeout(ln),Vt=void 0,ye=!1,T=t||void 0},hl=()=>{for(let t of document.querySelectorAll(ml)){let e=At(t,It);if(!e)return;if(e!==(t.getAttribute(jo)||t.getAttribute(Xo))){let i=v(t,"role")!=="img"&&t.textContent?.trim();v(t,It,e),v(t,jo,i?null:e),v(t,Xo,i?e:null),t.matches("a,button,input,label,select,textarea,[tabindex]")||pt('Missing tabindex="0" attribute on: ',t)}let n=t===Vt&&T?.offsetHeight&&T?.offsetWidth,o=n&&e&&T?.textContent!==e;n&&o&&(T&&(T.textContent=e),document.activeElement===t&&Ye(e))}},Yo=({type:t,target:e})=>{if(clearTimeout(ln),e===T)return;if(t==="mouseover"&&!ye&&!ul){ln=setTimeout(Yo,300,{target:e});return}let n=e?.closest?.(`[${It}]`);if(n===Vt)return;if(!n)return Qo();T||=yo("div",{class:"ds-tooltip"}),T.isConnected||document.body.appendChild(T);let o=n.closest(fl),i=n.closest(pl),r=o!==i&&o?.contains(i);clearTimeout(cn),v(T,"popover","manual"),v(T,un,i?.getAttribute(un)||null),v(T,dn,r&&o?.getAttribute(dn)||null),T.textContent=v(n,It),T.showPopover(),T.dispatchEvent(new CustomEvent("ds-toggle-source",{detail:n})),ye=!0,Vt=n},Qo=()=>T?.isConnected&&T.popover&&T.hidePopover(),Zo=t=>{if(t?.type==="keydown")return t?.key==="Escape"&&Qo();t?t.target===T&&t.newState==="closed"&&(Vt=void 0,cn=setTimeout(Zo,300)):ye=!1};tt("tooltip",()=>[O(document,"blur focus mouseover",Yo,U),O(document,"toggle keydown",Zo,U),et(document,hl,{attributeFilter:[It],attributes:!0,childList:!0,subtree:!0})]);const fn="aria-label";var Jo=class extends ae{_items;_label=null;_unresize;_unmutate;static get observedAttributes(){return[fn]}connectedCallback(){let e=vo(()=>mn(this),100);this._label=At(this,fn),this._items=this.getElementsByTagName("a"),this._unresize=O(window,"resize",e),this._unmutate=et(this,mn,{childList:!0,subtree:!0})}attributeChangedCallback(e,n,o){!this._unmutate||!o||(this._label=o,mn(this))}disconnectedCallback(){this._unresize?.(),this._unmutate?.(),this._unresize=this._unmutate=this._items=void 0}};const mn=t=>{let e=t._items?.[t._items.length-1],n=e?.parentElement===t?null:e,o=!n?.offsetHeight;v(t,"role",o?null:"navigation"),v(t,fn,o?null:t._label);for(let i of t._items||[])v(i,"aria-current",i===n?"page":null)};nt.define("ds-breadcrumbs",Jo);var ti=class extends ae{_unmutate;connectedCallback(){O(this,"animationend",this,U),v(this,"role","group"),v(this,"tabindex","-1"),this._unmutate=et(this,gl,{childList:!0,subtree:!0}),this.focus()}handleEvent({target:e}){e===this&&this.focus()}disconnectedCallback(){Ke(this,"animationend",this,U),this._unmutate?.(),this._unmutate=void 0}};const gl=t=>{let e=v(t,"aria-label")?.trim(),n=v(t,"aria-labelledby")?.trim(),o=t.querySelector("h2,h3,h4,h5,h6");o&&!e&&!n&&v(t,"aria-labelledby",ot(o)),!o&&!e&&!n&&pt("Missing accessible name on:",t,`
|
|
6
|
+
Add a heading (h2–h6), or set aria-label or aria-labelledby to provide an accessible name for screen readers.`)};nt.define("ds-error-summary",ti);const pn="aria-invalid",ei="aria-describedby",ni="data-indeterminate",bl=Js()?800:200,oi=new WeakMap,Gt=new Map,hn=new WeakSet,vl=(t,e=[])=>{for(let{target:n}of e){let o=n instanceof HTMLFieldSetElement;for(let[i]of Gt)(o?n.contains(i):i.contains(n))&&ii(i)}},ii=t=>{let e=[],n=[],o=Gt.get(t)||[],i,r,s=!1,a=!1;for(let m of t.getElementsByTagName("*"))if(m instanceof HTMLLabelElement&&e.push(m),!m.hidden)if(_l(m))i?pt("Fields should only have one input element. Use <fieldset> to group multiple fields:",t):i=m;else{let h=m.getAttribute("data-field");h==="counter"&&(r=m),h==="validation"?(n.unshift(ot(m)),s=!0,a||=si(m)):h&&n.push(ot(m))}if(!i)return;r&&oi.set(i,r);for(let m of e)v(m,"for",ot(i));let l=t.closest("fieldset")?.querySelector(':scope > [data-field="validation"]');l&&!l?.hidden&&(s=!0,a||=si(l),n.unshift(ot(l)));let c=v(i,ni);c&&(i.indeterminate=c==="true"),(i.type==="radio"||i.type==="checkbox")&&v(t,"data-clickdelegatefor",ot(i));let u=v(i,ei)?.trim().split(/\s+/)?.filter(m=>!o.includes(m))||[];v(i,ei,[...n,...u].join(" ")||null),Gt.set(t,n);let d=hn.has(i);s&&!d&&!i.hasAttribute(pn)?(v(i,pn,"true"),hn.add(i)):!s&&d&&(v(i,pn,null),hn.delete(i)),ri(i)},yl={over:"%d tegn for mye",under:"%d tegn igjen"},ri=t=>{let e=t.target||t,n=oi.get(e);if(n?.isConnected){let o=(Number(v(n,"data-limit"))||0)-e.value.length,i=o<0?"over":"under",r=(At(n,`data-${i}`)||yl[i])?.replace("%d",`${Math.abs(o)}`);v(n,"data-label",r),v(n,"data-state",i),v(n,"data-color",o<0?"danger":null),t.type==="input"&&r&&wl(e,r)}e instanceof HTMLTextAreaElement&&(e.style.setProperty("--_ds-field-sizing","auto"),e.style.setProperty("--_ds-field-sizing",`${e.scrollHeight}px`))},wl=vo((t,e)=>{document.activeElement===t&&Ye(e)},bl),si=t=>t.getAttribute("data-color")!=="success",_l=t=>t instanceof HTMLElement&&"validity"in t&&!(t instanceof HTMLButtonElement)&&t.type!=="hidden";var we=class extends ae{connectedCallback(){Gt.set(this,[]),ii(this)}disconnectedCallback(){Gt.delete(this)}};nt.define("ds-field",we),tt("field",()=>[O(document,"input",ri,U),et(document,vl,{attributeFilter:["data-field","data-limit","hidden","id","value",ni],attributes:!0,childList:!0,subtree:!0})]);const gn="aria-label",_e="data-current",Se="data-total",ai="data-href",li=({current:t=1,total:e=10,show:n=7})=>({prev:t>1?t-1:0,next:t<e?t+1:0,pages:Sl(t,e,n).map((o,i)=>({current:o===t&&"page",key:`key-${o}-${i}`,page:o}))});var ci=class extends ae{_unmutate;_render;static get observedAttributes(){return[gn,_e,Se,ai]}connectedCallback(){let t=v(this,Se),e=v(this,_e);e&&!t&&pt(`Missing ${Se} attribute on:`,this),t&&!e&&pt(`Missing ${_e} attribute on:`,this),v(this,gn,At(this,gn)),v(this,"role","navigation"),this._unmutate=et(this,di,{childList:!0,subtree:!0})}attributeChangedCallback(){this._unmutate&&di(this)}disconnectedCallback(){this._unmutate?.(),this._unmutate=this._render=void 0}};const di=t=>{let e=Number(v(t,_e)),n=Number(v(t,Se));if(e&&n){let o=t.querySelectorAll("button,a"),i=o.length-2,r=v(t,ai),{next:s,prev:a,pages:l}=li({current:e,total:n,show:i});o.forEach((c,u)=>{let d=u?o[u+1]?l[u-1]?.page:s:a;v(c,"aria-current",l[u-1]?.current?"true":null),v(c,"aria-label",`${d??"hidden"}`),v(c,"role",d?null:"none"),v(c,"tabindex",d?null:"-1"),c instanceof HTMLButtonElement&&v(c,"value",`${d}`),r&&c instanceof HTMLAnchorElement&&v(c,"href",r.replace("%d",`${d}`))})}},Sl=(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),s=Array.from({length:r+1-i},(a,l)=>l+i);return n>4&&i>1&&s.splice(0,2,1,0),n>3&&r<e&&s.splice(-2,2,0,e),s};nt.define("ds-pagination",ci);var xl=Object.defineProperty,ui=Object.getOwnPropertySymbols,El=Object.prototype.hasOwnProperty,$l=Object.prototype.propertyIsEnumerable,fi=(t,e,n)=>e in t?xl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Cl=(t,e)=>{for(var n in e||(e={}))El.call(e,n)&&fi(t,n,e[n]);if(ui)for(var n of ui(e))$l.call(e,n)&&fi(t,n,e[n]);return t},bn=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",xe=bn(),vn=xe?navigator.userAgent:"",mi=/android/i.test(vn),Al=/firefox/i.test(vn),pi=/iPad|iPhone|iPod/.test(vn),hi,Tl=xe&&/^Mac/i.test(((hi=navigator.userAgentData)==null?void 0:hi.platform)||navigator.platform),kl=xe&&window.CSSStyleSheet&&document.adoptedStyleSheets,gi={once:!0,capture:!0,passive:!0},Ll=":host(:not([hidden])) { display: block }",Rl="outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color",Il=`${mi?"data":"aria"}-multiselectable`,Ol=typeof HTMLElement>"u"?class{}:HTMLElement,x=(t,e,n)=>n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),yn=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.addEventListener(i,...o);return()=>bi(t,...e)},bi=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.removeEventListener(i,...o)},Ml=(t,e)=>{const n=t.shadowRoot||t.attachShadow({mode:"open"});if(n.querySelector("slot")||n.append(jt("slot")),!n.querySelector("style"))if(!kl)n.append(jt("style",null,e));else{const o=new CSSStyleSheet;o.replaceSync(e),n.adoptedStyleSheets=[o]}return n},Dl=(t,e,n)=>{const o=new MutationObserver(r=>{if(!bn()||!t.isConnected)return i();e(t,r)}),i=Object.assign(()=>o.disconnect(),{takeRecords:()=>o.takeRecords()});return e(t),o.observe(t,n),i},Pl=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},wn=t=>Pl(t).activeElement,Nl=t=>{var e;const n=x(t,"aria-label")||"";return[...(((e=x(t,"aria-labelledby"))==null?void 0:e.split(" "))||[]).map(i=>document.getElementById(i.trim()||"-")),...Array.from(t.labels||[])].reduce((i,r)=>{var s;return i||((s=r?.innerText)==null?void 0:s.trim())||""},n).trim()},Hl=t=>{if(!t||!xe)return null;if(window.uElementsId||(window.uElementsId={}),!t.id){const e=t.nodeName.toLowerCase();window.uElementsId[e]||(window.uElementsId[e]=1),t.id=`:${e}${window.uElementsId[e]++}`}return t.id},jt=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,r]of Object.entries(e))x(o,i,r);return o},ql={define:(t,e)=>!bn()||window.customElements.get(t)||window.customElements.define(t,e)},vi=(t,e,n="")=>{var o,i;const r={bubbles:!0,composed:!0,data:e,inputType:n},s=HTMLInputElement.prototype;t.dispatchEvent(new InputEvent("beforeinput",r)),(i=(o=Object.getOwnPropertyDescriptor(s,"value"))==null?void 0:o.set)==null||i.call(t,e),t.dispatchEvent(new InputEvent("input",r)),t.dispatchEvent(new Event("change",{bubbles:!0}))},_n=new WeakSet,yi=(t,e)=>(e?.type==="pointerdown"&&(_n.add(t),yn(document,"pointerup",()=>_n.delete(t),gi)),_n.has(t)),Bl=(t,e="<slot></slot>")=>`<template shadowrootmode="open">${e}<style>${t}</style></template>`,Ul=t=>{const e=x(t,"form");x(t,"form","#"),setTimeout(zl,0,t,e)},zl=(t,e)=>x(t,"form",e),Ot=t=>{var e;return((e=t?.textContent)==null?void 0:e.trim())||""},Q,Fl=0,wi=0,Ee=t=>{clearTimeout(wi),Q||(Q=jt("div",{"aria-live":"assertive"}),Q.style.overflow="hidden",Q.style.position="fixed",Q.style.whiteSpace="nowrap",Q.style.width="1px"),Q.isConnected||document.body.append(Q),t===""&&(Q.textContent=""),t&&(Q.textContent=`${t}${Fl++%2?" ":""}`,wi=setTimeout(Ee,!Tl&&Al?2e3:300,""))},Sn=`${Ll}
|
|
7
7
|
:is(:host(:not([data-multiple])), :host([data-multiple="false"])) [part="items"] { display: none }
|
|
8
8
|
[role="listbox"] { display: contents }
|
|
9
9
|
::slotted(button[type="reset"]),::slotted(del) { font: inherit; border: 0; padding: 0; background: none; color: inherit; cursor: pointer; text-decoration: none }
|
|
10
10
|
::slotted(data) { cursor: pointer; pointer-events: none }
|
|
11
11
|
::slotted(data)::after { padding-inline: .5ch; pointer-events: auto }
|
|
12
12
|
::slotted(data)::after,::slotted(button[type="reset"]:empty)::before,::slotted(del:empty)::before { content: '\\00D7'; content: '\\00D7' / '' }
|
|
13
|
-
::slotted(data:focus),::slotted(del:focus),::slotted(button[type="reset"]:focus) { ${wl} }`,Ol=kl(wn),dt="aria-label",Ml='button[type="reset"],del',Dl='datalist,[role="listbox"]',Pl='option,[role="option"]',bi="blur focus click input keydown pointerdown",$e="false",Ce={added:"Added",clear:"Clear input",empty:"No selected",found:"Navigate left to find %d selected",invalid:"Invalid value",items:"Selected",of:"of",remove:"Press to remove",removed:"Removed"},_n=class extends xl{constructor(){super(),this._focusMoved=!1,this._itemSingleVale="",this._speak="",this._texts=hl({},Ce),this._value="";const t=Sl(this,wn);this._listbox=t.querySelector('[role="listbox"]')||Gt("div"),this._listbox.innerHTML='<slot name="items"></slot>',S(this._listbox,"aria-orientation","horizontal"),S(this._listbox,"role","listbox"),S(this._listbox,"part","items"),S(this._listbox,"tabindex","-1"),t.prepend(this._listbox)}static get observedAttributes(){return Object.keys(Ce).map(t=>`data-sr-${t}`)}connectedCallback(){bn(this,bi,this,!0),this._umutate=El(this,Wl,{attributeFilter:["id","value","role"],attributes:!0,characterData:!0,childList:!0,subtree:!0}),Ae(this),xn(this)}attributeChangedCallback(t,e,n){const o=t.split("data-sr-")[1];Ce[o]&&(this._texts[o]=n||Ce[o]),o==="clear"&&this.clear&&S(this.clear,dt,this._texts.clear)}disconnectedCallback(){var t;mi(this,bi,this,!0),(t=this._umutate)==null||t.call(this),this._umutate=this._list=this._options=this._match=void 0,this._items=this._clear=this._control=this._select=void 0}handleEvent(t){var e,n;(e=this.control)!=null&&e.disabled||(n=this.control)!=null&&n.readOnly||(t.type==="blur"&&Nl(this),t.type==="click"&&Hl(this,t),t.type==="focus"&&Ee(),t.type==="input"&&Bl(this,t),t.type==="keydown"&&zl(this,t),t.type==="pointerdown"&&hi(this,t))}get multiple(){var t;return((t=S(this,"data-multiple"))!=null?t:$e)!==$e}set multiple(t){S(this,"data-multiple",t?"":null)}get creatable(){var t;return((t=S(this,"data-creatable"))!=null?t:$e)!==$e}set creatable(t){S(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(Dl),this._options=void 0),this._list}get clear(){var t;return(t=this._clear)!=null&&t.isConnected||(this._clear=this.querySelector(Ml)),this._clear}get items(){return this._items||(this._items=this.getElementsByTagName("data")),this._items}get options(){var t,e,n;const o=!this._options&&((e=(t=this.list)==null?void 0:t.querySelector(Pl))==null?void 0:e.nodeName);return o&&(this._options=(n=this.list)==null?void 0:n.getElementsByTagName(o)),this._options||this.getElementsByTagName("-")}get values(){return Array.from(this.items,({value:t})=>t)}},vi=t=>{var e;const{creatable:n,control:o,options:i,multiple:r}=t,s=((e=o?.value)==null?void 0:e.trim())||"",a=s.toLowerCase()||null;let l=[...i].find(u=>u.label.trim().toLowerCase()===a);const c={bubbles:!0,cancelable:!0,detail:l};if(t.dispatchEvent(new CustomEvent("comboboxbeforematch",c))||(l=[...i].find(u=>u.selected)),r)wi(t);else for(const u of i)u.selected=u===l;return!l&&n&&s?{value:s,label:s}:l&&{value:l.value,label:l.label}},Ot=(t,e,n=!0)=>{const{_texts:o,control:i,items:r,multiple:s}=t;if(!e)return s?Ee(o.invalid):!i?.value&&r[0]?Ot(t,r[0]):Ae(t);const a=[...r].findIndex(m=>m.value===e.value),l=r[a],c=l===vn(t)&&(s&&(r[a-1]||r[a+1])||i);if(l&&!n)return Ae(t);c&&c.focus(),t._focusMoved=!!c;const u=Gt("data",{value:e.value},e.label||e.value),d={bubbles:!0,cancelable:!0,detail:l||u};if(t.dispatchEvent(new CustomEvent("comboboxbeforeselect",d))){if(!s)for(const m of[...r])m.remove();l?l.remove():i?.insertAdjacentElement("beforebegin",u),t.dispatchEvent(new CustomEvent("comboboxafterselect",d))}},Nl=t=>hi(t)||setTimeout(ql,0,t),ql=t=>t.multiple||t.contains(vn(t))||Ot(t,t._match,!1),Hl=(t,e)=>{const{clientX:n,clientY:o,target:i}=e,{clear:r,control:s,items:a}=t;if(s&&r?.contains(i))return e.preventDefault(),pi(s,"","deleteContentBackward"),s.focus();for(const l of a){if(l.contains(i))return Ot(t,l);const c=l.getBoundingClientRect(),{top:u,right:d,bottom:m,left:h,width:f,height:p}=c;if(f&&p&&o>=u&&o<=m&&n>=h&&n<=d)return l.focus()}i===t&&s?.focus()},Bl=(t,e)=>{var n;const{control:o,options:i,multiple:r}=t,s=o?.value||null,a=e instanceof InputEvent?!e.inputType||e.inputType==="insertReplacementText":!!o?.value;if(a||(t._value=o?.value||""),a){(n=e.stopImmediatePropagation)==null||n.call(e);const l=[...i].find(c=>c.value===s);if(o&&(o.value=t._value),l)return Ot(t,l,r)}else r||(t._match=vi(t));xn(t)},zl=(t,e)=>{e.ctrlKey||e.metaKey||e.shiftKey||e.key==="Alt"||(t.control===e.target?Fl(t,e):Ul(t,e))},Fl=(t,e)=>{var n;const{_match:o,clear:i,control:r,items:s,multiple:a}=t;(e.key==="ArrowLeft"||e.key==="Backspace")&&!r?.selectionEnd&&((n=s[s.length-1])==null||n.focus()),e.key==="Enter"&&r&&(Ll(r),Ot(t,a?vi(t):o,a)),e.key==="Tab"&&!e.shiftKey&&i&&!i.hidden&&(e.preventDefault(),S(i,"aria-hidden","false"),S(i,"tabindex","0"),i.focus(),bn(i,"blur",()=>xn(t),fi))},Ul=(t,e)=>{var n,o,i;const{clear:r,control:s,items:a}=t,{key:l,repeat:c,target:u}=e,d=[...a].indexOf(u);if((l===" "||l==="Enter")&&(a[d]||u===r))return(n=a[d]||r)==null||n.click(),e.preventDefault();if(a[d]){if(l==="ArrowLeft")return(o=a[d-1])==null?void 0:o.focus();if(l==="ArrowRight")return(i=a[d+1]||s)==null?void 0:i.focus();if(l==="Backspace")return e.preventDefault(),c||Ot(t,a[d]);s?.focus()}},Wl=(t,e)=>{var n;if(!t.control)return;const{_texts:o,control:i,items:r,list:s,multiple:a}=t,l=[];for(const{addedNodes:m,removedNodes:h}of e||[]){for(const f of m)f instanceof HTMLDataElement&&l.unshift(f);for(const f of h)f instanceof HTMLDataElement&&l.push(f)}const c=vn(t);if((a?l.length===1:l[0]===c)&&t.contains(c)){const m=i?S(i,dt):null;t._speak=`${o[l[0].isConnected?"added":"removed"]} ${It(l[0])}, `,S(i,dt,`${t._speak}${Cl(i)}`),t._focusMoved||setTimeout(()=>Ee(t._speak.slice(0,-2))),setTimeout(Vl,300,t,m)}if(!a){const m=It(r[0]);m!==t._itemSingleVale&&Ae(t),t._itemSingleVale=m}yi(t),wi(t),Gl(t);const d=`${r.length?o.found.replace("%d",`${r.length}`):o.empty}`;S(i,"aria-description",a?d:null),S(i,"list",Al(s)),S(t._listbox,dt,o.items),(n=t._umutate)==null||n.takeRecords()},Vl=(t,e)=>{t._speak="",t.control&&S(t.control,dt,e),yi(t)},yi=t=>{const{_texts:e,_speak:n,items:o}=t;let i=0;for(const r of o){const s=`${n}${It(r)}, ${e.remove}${di?`, ${++i} ${e.of} ${o.length}`:""}`;S(r,dt,s),S(r,"role","option"),S(r,"slot","items"),S(r,"tabindex","-1"),S(r,"value",r.value||It(r))}},Gl=t=>{var e,n;if((e=t._select)!=null&&e.isConnected||(t._select=t.querySelector("select")),!t._select)return;const{_select:o,items:i,multiple:r}=t,s=[];let a=0;S(o,"multiple",r?"":null);for(const l of i){const c=o?.options[a++],u=It(l),d=l?.value;c?Object.assign(c,{defaultSelected:!0,selected:!0,text:u,value:d}):s.push(new Option(u,d,!0,!0))}if(s.length)o.append(...s);else for(const l of[...o.options].slice(a))l.remove();(n=t._umutate)==null||n.takeRecords()},xn=t=>{if(!t.clear)return;const{clear:e,control:n}=t,o=!n?.value||n?.disabled||n?.readOnly;e.nodeName==="DEL"&&S(e,"role","button"),S(e,dt)||S(e,dt,t._texts.clear),S(e,"aria-hidden",`${di||ci}`),S(e,"hidden",o?"":null),S(e,"tabindex","-1")},wi=t=>{if(!t.list)return;const{_texts:e,list:n,multiple:o,options:i,values:r}=t;S(n,"data-sr-of",e.of),S(n,_l,`${o}`);for(const s of i)s.selected=r.includes(s.value)},Ae=t=>{if(!t.control||t.multiple)return;const{control:e,items:n}=t,o=It(n[0]),i=o?"insertText":"deleteContentBackward";o!==e.value&&pi(e,o,i)};Tl.define("u-combobox",_n);var _i=class extends _n{_unmutate;connectedCallback(){super.connectedCallback(),this._unmutate=et(this,jl,{childList:!0}),I(this,"toggle",xi,z)}disconnectedCallback(){super.disconnectedCallback(),this._unmutate?.(),this._unmutate=void 0,je(this,"toggle",xi,z)}};const jl=({control:t,list:e})=>{t&&!t.placeholder&&v(t,"placeholder"," "),t&&v(t,"popovertarget",ot(e)||null),e&&v(e,"popover","manual"),e&&v(e,"data-is-floating","true")},xi=t=>{let e=t.currentTarget,n=t.newState==="open"&&e.control;n&&e.list?.dispatchEvent(new CustomEvent("ds-toggle-source",{detail:n}))};nt.define("ds-suggestion",_i);var Sn=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",Te=Sn(),Xl=Te?navigator.userAgent:"",Kl=/android/i.test(Xl),Si;Te&&/^Mac/i.test(((Si=navigator.userAgentData)==null?void 0:Si.platform)||navigator.platform);var Yl=Te&&window.CSSStyleSheet&&document.adoptedStyleSheets,En=":host(:not([hidden])) { display: block }",Ql=`${Kl?"data":"aria"}-labelledby`,ke=typeof HTMLElement>"u"?class{}:HTMLElement,L=(t,e,n)=>n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),Zl=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.addEventListener(i,...o);return()=>Ei(t,...e)},Ei=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.removeEventListener(i,...o)},$n=(t,e)=>{const n=t.shadowRoot||t.attachShadow({mode:"open"});if(n.querySelector("slot")||n.append(Ci("slot")),!n.querySelector("style"))if(!Yl)n.append(Ci("style",null,e));else{const o=new CSSStyleSheet;o.replaceSync(e),n.adoptedStyleSheets=[o]}return n},Jl=(t,e,n)=>{const o=new MutationObserver(r=>{if(!Sn()||!t.isConnected)return i();e(t,r)}),i=Object.assign(()=>o.disconnect(),{takeRecords:()=>o.takeRecords()});return e(t),o.observe(t,n),i},$i=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},Cn=t=>{if(!t||!Te)return null;if(window.uElementsId||(window.uElementsId={}),!t.id){const e=t.nodeName.toLowerCase();window.uElementsId[e]||(window.uElementsId[e]=1),t.id=`:${e}${window.uElementsId[e]++}`}return t.id},Ci=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,r]of Object.entries(e))L(o,i,r);return o},Le={define:(t,e)=>!Sn()||window.customElements.get(t)||window.customElements.define(t,e)},Mt="aria-controls",Ai="aria-disabled",jt="aria-selected",Xt="tabindex",tc=En,ec=En,nc=`${En}
|
|
13
|
+
::slotted(data:focus),::slotted(del:focus),::slotted(button[type="reset"]:focus) { ${Rl} }`,Wl=Bl(Sn),dt="aria-label",Vl='button[type="reset"],del',Gl='datalist,[role="listbox"]',jl='option,[role="option"]',_i="blur focus click input keydown pointerdown",$e="false",Ce={added:"Added",clear:"Clear input",empty:"No selected",found:"Navigate left to find %d selected",invalid:"Invalid value",items:"Selected",of:"of",remove:"Press to remove",removed:"Removed"},xn=class extends Ol{constructor(){super(),this._focusMoved=!1,this._itemSingleVale="",this._speak="",this._texts=Cl({},Ce),this._value="";const t=Ml(this,Sn);this._listbox=t.querySelector('[role="listbox"]')||jt("div"),this._listbox.innerHTML='<slot name="items"></slot>',x(this._listbox,"aria-orientation","horizontal"),x(this._listbox,"role","listbox"),x(this._listbox,"part","items"),x(this._listbox,"tabindex","-1"),t.prepend(this._listbox)}static get observedAttributes(){return Object.keys(Ce).map(t=>`data-sr-${t}`)}connectedCallback(){yn(this,_i,this,!0),this._umutate=Dl(this,ec,{attributeFilter:["id","value","role"],attributes:!0,characterData:!0,childList:!0,subtree:!0}),Ae(this),En(this)}attributeChangedCallback(t,e,n){const o=t.split("data-sr-")[1];Ce[o]&&(this._texts[o]=n||Ce[o]),o==="clear"&&this.clear&&x(this.clear,dt,this._texts.clear)}disconnectedCallback(){var t;bi(this,_i,this,!0),(t=this._umutate)==null||t.call(this),this._umutate=this._list=this._options=this._match=void 0,this._items=this._clear=this._control=this._select=void 0}handleEvent(t){var e,n;(e=this.control)!=null&&e.disabled||(n=this.control)!=null&&n.readOnly||(t.type==="blur"&&Xl(this),t.type==="click"&&Yl(this,t),t.type==="focus"&&Ee(),t.type==="input"&&Ql(this,t),t.type==="keydown"&&Zl(this,t),t.type==="pointerdown"&&yi(this,t))}get multiple(){var t;return((t=x(this,"data-multiple"))!=null?t:$e)!==$e}set multiple(t){x(this,"data-multiple",t?"":null)}get creatable(){var t;return((t=x(this,"data-creatable"))!=null?t:$e)!==$e}set creatable(t){x(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(Gl),this._options=void 0),this._list}get clear(){var t;return(t=this._clear)!=null&&t.isConnected||(this._clear=this.querySelector(Vl)),this._clear}get items(){return this._items||(this._items=this.getElementsByTagName("data")),this._items}get options(){var t,e,n;const o=!this._options&&((e=(t=this.list)==null?void 0:t.querySelector(jl))==null?void 0:e.nodeName);return o&&(this._options=(n=this.list)==null?void 0:n.getElementsByTagName(o)),this._options||this.getElementsByTagName("-")}get values(){return Array.from(this.items,({value:t})=>t)}},Si=t=>{var e;const{creatable:n,control:o,options:i,multiple:r}=t,s=((e=o?.value)==null?void 0:e.trim())||"",a=s.toLowerCase()||null;let l=[...i].find(u=>u.label.trim().toLowerCase()===a);const c={bubbles:!0,cancelable:!0,detail:l};if(t.dispatchEvent(new CustomEvent("comboboxbeforematch",c))||(l=[...i].find(u=>u.selected)),r)Ei(t);else for(const u of i)u.selected=u===l;return!l&&n&&s?{value:s,label:s}:l&&{value:l.value,label:l.label}},Mt=(t,e,n=!0)=>{const{_texts:o,control:i,items:r,multiple:s}=t;if(!e)return s?Ee(o.invalid):!i?.value&&r[0]?Mt(t,r[0]):Ae(t);const a=[...r].findIndex(m=>m.value===e.value),l=r[a],c=l===wn(t)&&(s&&(r[a-1]||r[a+1])||i);if(l&&!n)return Ae(t);c&&c.focus(),t._focusMoved=!!c;const u=jt("data",{value:e.value},e.label||e.value),d={bubbles:!0,cancelable:!0,detail:l||u};if(t.dispatchEvent(new CustomEvent("comboboxbeforeselect",d))){if(!s)for(const m of[...r])m.remove();l?l.remove():i?.insertAdjacentElement("beforebegin",u),t.dispatchEvent(new CustomEvent("comboboxafterselect",d))}},Xl=t=>yi(t)||setTimeout(Kl,0,t),Kl=t=>t.multiple||t.contains(wn(t))||Mt(t,t._match,!1),Yl=(t,e)=>{const{clientX:n,clientY:o,target:i}=e,{clear:r,control:s,items:a}=t;if(s&&r?.contains(i))return e.preventDefault(),vi(s,"","deleteContentBackward"),s.focus();for(const l of a){if(l.contains(i))return Mt(t,l);const c=l.getBoundingClientRect(),{top:u,right:d,bottom:m,left:h,width:f,height:p}=c;if(f&&p&&o>=u&&o<=m&&n>=h&&n<=d)return l.focus()}i===t&&s?.focus()},Ql=(t,e)=>{var n;const{control:o,options:i,multiple:r}=t,s=o?.value||null,a=e instanceof InputEvent?!e.inputType||e.inputType==="insertReplacementText":!!o?.value;if(a||(t._value=o?.value||""),a){(n=e.stopImmediatePropagation)==null||n.call(e);const l=[...i].find(c=>c.value===s);if(o&&(o.value=t._value),l)return Mt(t,l,r)}else r||(t._match=Si(t));En(t)},Zl=(t,e)=>{e.ctrlKey||e.metaKey||e.shiftKey||e.key==="Alt"||(t.control===e.target?Jl(t,e):tc(t,e))},Jl=(t,e)=>{var n;const{_match:o,clear:i,control:r,items:s,multiple:a}=t;(e.key==="ArrowLeft"||e.key==="Backspace")&&!r?.selectionEnd&&((n=s[s.length-1])==null||n.focus()),e.key==="Enter"&&r&&(Ul(r),Mt(t,a?Si(t):o,a)),e.key==="Tab"&&!e.shiftKey&&i&&!i.hidden&&(e.preventDefault(),x(i,"aria-hidden","false"),x(i,"tabindex","0"),i.focus(),yn(i,"blur",()=>En(t),gi))},tc=(t,e)=>{var n,o,i;const{clear:r,control:s,items:a}=t,{key:l,repeat:c,target:u}=e,d=[...a].indexOf(u);if((l===" "||l==="Enter")&&(a[d]||u===r))return(n=a[d]||r)==null||n.click(),e.preventDefault();if(a[d]){if(l==="ArrowLeft")return(o=a[d-1])==null?void 0:o.focus();if(l==="ArrowRight")return(i=a[d+1]||s)==null?void 0:i.focus();if(l==="Backspace")return e.preventDefault(),c||Mt(t,a[d]);s?.focus()}},ec=(t,e)=>{var n;if(!t.control)return;const{_texts:o,control:i,items:r,list:s,multiple:a}=t,l=[];for(const{addedNodes:m,removedNodes:h}of e||[]){for(const f of m)f instanceof HTMLDataElement&&l.unshift(f);for(const f of h)f instanceof HTMLDataElement&&l.push(f)}const c=wn(t);if((a?l.length===1:l[0]===c)&&t.contains(c)){const m=i?x(i,dt):null;t._speak=`${o[l[0].isConnected?"added":"removed"]} ${Ot(l[0])}, `,x(i,dt,`${t._speak}${Nl(i)}`),t._focusMoved||setTimeout(()=>Ee(t._speak.slice(0,-2))),setTimeout(nc,300,t,m)}if(!a){const m=Ot(r[0]);m!==t._itemSingleVale&&Ae(t),t._itemSingleVale=m}xi(t),Ei(t),oc(t);const d=`${r.length?o.found.replace("%d",`${r.length}`):o.empty}`;x(i,"aria-description",a?d:null),x(i,"list",Hl(s)),x(t._listbox,dt,o.items),(n=t._umutate)==null||n.takeRecords()},nc=(t,e)=>{t._speak="",t.control&&x(t.control,dt,e),xi(t)},xi=t=>{const{_texts:e,_speak:n,items:o}=t;let i=0;for(const r of o){const s=`${n}${Ot(r)}, ${e.remove}${pi?`, ${++i} ${e.of} ${o.length}`:""}`;x(r,dt,s),x(r,"role","option"),x(r,"slot","items"),x(r,"tabindex","-1"),x(r,"value",r.value||Ot(r))}},oc=t=>{var e,n;if((e=t._select)!=null&&e.isConnected||(t._select=t.querySelector("select")),!t._select)return;const{_select:o,items:i,multiple:r}=t,s=[];let a=0;x(o,"multiple",r?"":null);for(const l of i){const c=o?.options[a++],u=Ot(l),d=l?.value;c?Object.assign(c,{defaultSelected:!0,selected:!0,text:u,value:d}):s.push(new Option(u,d,!0,!0))}if(s.length)o.append(...s);else for(const l of[...o.options].slice(a))l.remove();(n=t._umutate)==null||n.takeRecords()},En=t=>{if(!t.clear)return;const{clear:e,control:n}=t,o=!n?.value||n?.disabled||n?.readOnly;e.nodeName==="DEL"&&x(e,"role","button"),x(e,dt)||x(e,dt,t._texts.clear),x(e,"aria-hidden",`${pi||mi}`),x(e,"hidden",o?"":null),x(e,"tabindex","-1")},Ei=t=>{if(!t.list)return;const{_texts:e,list:n,multiple:o,options:i,values:r}=t;x(n,"data-sr-of",e.of),x(n,Il,`${o}`);for(const s of i)s.selected=r.includes(s.value)},Ae=t=>{if(!t.control||t.multiple)return;const{control:e,items:n}=t,o=Ot(n[0]),i=o?"insertText":"deleteContentBackward";o!==e.value&&vi(e,o,i)};ql.define("u-combobox",xn);var $i=class extends xn{_unmutate;connectedCallback(){super.connectedCallback(),this._unmutate=et(this,ic,{childList:!0}),O(this,"toggle",Ci,U)}disconnectedCallback(){super.disconnectedCallback(),this._unmutate?.(),this._unmutate=void 0,Ke(this,"toggle",Ci,U)}};const ic=({control:t,list:e})=>{t&&!t.placeholder&&v(t,"placeholder"," "),t&&v(t,"popovertarget",ot(e)||null),e&&v(e,"popover","manual"),e&&v(e,"data-is-floating","true")},Ci=t=>{let e=t.currentTarget,n=t.newState==="open"&&e.control;n&&e.list?.dispatchEvent(new CustomEvent("ds-toggle-source",{detail:n}))};nt.define("ds-suggestion",$i);var $n=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",Te=$n(),rc=Te?navigator.userAgent:"",sc=/android/i.test(rc),Ai;Te&&/^Mac/i.test(((Ai=navigator.userAgentData)==null?void 0:Ai.platform)||navigator.platform);var ac=Te&&window.CSSStyleSheet&&document.adoptedStyleSheets,Cn=":host(:not([hidden])) { display: block }",lc=`${sc?"data":"aria"}-labelledby`,ke=typeof HTMLElement>"u"?class{}:HTMLElement,L=(t,e,n)=>n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),cc=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.addEventListener(i,...o);return()=>Ti(t,...e)},Ti=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.removeEventListener(i,...o)},An=(t,e)=>{const n=t.shadowRoot||t.attachShadow({mode:"open"});if(n.querySelector("slot")||n.append(Li("slot")),!n.querySelector("style"))if(!ac)n.append(Li("style",null,e));else{const o=new CSSStyleSheet;o.replaceSync(e),n.adoptedStyleSheets=[o]}return n},dc=(t,e,n)=>{const o=new MutationObserver(r=>{if(!$n()||!t.isConnected)return i();e(t,r)}),i=Object.assign(()=>o.disconnect(),{takeRecords:()=>o.takeRecords()});return e(t),o.observe(t,n),i},ki=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},Tn=t=>{if(!t||!Te)return null;if(window.uElementsId||(window.uElementsId={}),!t.id){const e=t.nodeName.toLowerCase();window.uElementsId[e]||(window.uElementsId[e]=1),t.id=`:${e}${window.uElementsId[e]++}`}return t.id},Li=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,r]of Object.entries(e))L(o,i,r);return o},Le={define:(t,e)=>!$n()||window.customElements.get(t)||window.customElements.define(t,e)},Dt="aria-controls",Ri="aria-disabled",Xt="aria-selected",Kt="tabindex",uc=Cn,fc=Cn,mc=`${Cn}
|
|
14
14
|
::slotted([role="tab"]:not([hidden])) { display: inline-block; cursor: pointer }
|
|
15
|
-
::slotted([role="tab"][${
|
|
15
|
+
::slotted([role="tab"][${Ri}="true"]) { cursor: default }`,kn=class extends ke{constructor(){super(),An(this,uc)}get tabList(){return this.querySelector('[role="tablist"]:not(:scope [role="tabpanel"] [role="tablist"])')}get selectedIndex(){const t=vt(this.tabList);return t.indexOf(Nt(t))}set selectedIndex(t){yt(this.tabs[t])}get tabs(){return this.querySelectorAll('[role="tab"]:not(:scope [role="tabpanel"] [role="tab"])')}get panels(){return this.querySelectorAll('[role="tabpanel"]:not(:scope [role="tabpanel"] [role="tabpanel"])')}},Ln=class extends ke{constructor(){super(),An(this,mc)}connectedCallback(){L(this,"role","tablist"),cc(this,"click keydown",this),this._umutate=dc(this,pc,{attributeFilter:["id","role",Dt,Xt],attributes:!0,childList:!0,subtree:!0})}disconnectedCallback(){var t;Ti(this,"click keydown",this),(t=this._umutate)==null||t.call(this),this._umutate=void 0}handleEvent(t){var e,n,o,i;const{key:r,type:s,target:a}=t,l=vt(this),c=l.findIndex(m=>m.contains(a)),u=r===" "||r==="Enter";let d=c;if(!(t.defaultPrevented||c===-1)&&(s==="click"&&yt(l[c]),s==="keydown")){if(u){(e=t.preventDefault)==null||e.call(t);const m={bubbles:!0,cancelable:!0,composed:!0};return l[c].dispatchEvent(new MouseEvent("click",m))}if(r==="ArrowDown"||r==="ArrowRight")d=(c+1)%l.length;else if(r==="ArrowUp"||r==="ArrowLeft")d=(c||l.length)-1;else if(r==="End")d=l.length-1;else if(r==="Home")d=0;else if(r==="Tab"&&!Pt(l[c])){const m=Nt(l);return m&&L(m,Kt,"-1"),m&&setTimeout(()=>L(m,Kt,"0"))}else return;(n=t.preventDefault)==null||n.call(t),(i=(o=l[d]).focus)==null||i.call(o)}}get tabsElement(){return Ht(this)}get tabs(){return this.querySelectorAll(':scope > [role="tab"]')}get selectedIndex(){const t=vt(this);return t.indexOf(Nt(t))}set selectedIndex(t){yt(this.tabs[t])}},Ii=class extends ke{static get observedAttributes(){return["id",Xt,Dt]}connectedCallback(){var t;L(this,"role","tab"),L(this,Xt,`${this.selected}`),L(this,Kt,this.selected?"0":"-1"),Nt((t=this.parentElement)==null?void 0:t.children)||yt(this)}attributeChangedCallback(){!Rn.has(this.parentElement)&&this.selected&&yt(this)}get tabsElement(){return Ht(this)}get tabList(){const t=this.parentElement;return t instanceof Ln?t:null}get selected(){return Pt(this)}set selected(t){t&&yt(this)}get index(){return Math.max(vt(this.parentElement).indexOf(this),0)}get panel(){var t;const e=(t=Ht(this))==null?void 0:t.panels,n=vt(this.parentElement).indexOf(this);return In(this,e?.[n])}},Oi=class extends ke{constructor(){super(),An(this,fc)}connectedCallback(){L(this,"role","tabpanel");const t=new Set(this.tabs),e=Ht(this),n=e?.tabs[Array.prototype.indexOf.call(e?.panels,this)];n&&!n.hasAttribute(Dt)&&t.add(n);const o=Nt(t)||t.values().next().value;Di(o,()=>Mi(this,o,!!o&&Pt(o)))}get tabsElement(){return Ht(this)}get tabs(){return ki(this).querySelectorAll(`[${Dt}="${Tn(this)}"]`)}},pc=(t,e=[])=>{let n;const o=vt(t);for(const{target:i}of e)i instanceof Element&&L(i,"role")==="tab"&&Pt(i)&&(n=i);!n&&!Nt(o)&&(n=o.find(Pi)),yt(n)},Mi=(t,e,n=!1)=>{L(t,"aria-hidden",`${!n}`),L(t,"hidden",n?null:""),L(t,Kt,n?"0":null),e&&L(e,Dt,Tn(t)),e&&n&&Pt(e)&&L(t,lc,Tn(e))},Rn=new Set,Di=(t,e)=>{var n;const o=t?.parentElement;o&&Rn.add(o),e(),o&&Rn.delete(o),(n=o?._umutate)==null||n.takeRecords()},Pi=t=>L(t,Ri)!=="true",Pt=t=>L(t,Xt)==="true",Nt=(t=[])=>{for(const e of t)if(Pt(e))return e},vt=t=>{const e=[];for(const n of t?.children||[])n.getAttribute("role")==="tab"&&e.push(n);return e},In=(t,e=null)=>{const n=L(t,Dt);return n?ki(t).getElementById(n):e},Ht=t=>{for(let e=t;e;e=e.parentNode||e.host)if(e instanceof kn)return e;return null},yt=t=>t&&Pi(t)&&Di(t,()=>{var e;const n=vt(t.parentElement),o=((e=Ht(t))==null?void 0:e.panels)||[],i=In(t,o?.[n.indexOf(t)]);let r=0;for(const s of n){const a=In(s,o[r++]);L(s,Xt,`${s===t}`),L(s,Kt,s===t?"0":"-1"),a&&Mi(a,s,a===i)}});Le.define("u-tabs",kn),Le.define("u-tablist",Ln),Le.define("u-tab",Ii),Le.define("u-tabpanel",Oi);var Ni=class extends kn{},Hi=class extends Ln{},qi=class extends Ii{},Bi=class extends Oi{};nt.define("ds-tabs",Ni),nt.define("ds-tablist",Hi),nt.define("ds-tab",qi),nt.define("ds-tabpanel",Bi);var On=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",Ui=On(),zi=Ui?navigator.userAgent:"",hc=/android/i.test(zi),gc=/firefox/i.test(zi),Fi;Ui&&/^Mac/i.test(((Fi=navigator.userAgentData)==null?void 0:Fi.platform)||navigator.platform);var Wi=(t,e,n)=>n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),bc=(t,e,n)=>{const o=new MutationObserver(r=>{if(!On()||!t.isConnected)return i();e(t,r)}),i=Object.assign(()=>o.disconnect(),{takeRecords:()=>o.takeRecords()});return e(t),o.observe(t,n),i},Vi="__uDetailsPolyfillSummarys";if(On()&&hc&&gc&&!window[Vi]){const t=document.getElementsByTagName("summary"),e=()=>{for(const n of t){const o=n.parentElement;Wi(n,"role","button"),Wi(n,"aria-expanded",`${!!o?.open}`)}};window[Vi]=bc(document,e,{attributeFilter:["open"],attributes:!0,childList:!0,subtree:!0})}var vc=Object.defineProperty,Gi=Object.getOwnPropertySymbols,yc=Object.prototype.hasOwnProperty,wc=Object.prototype.propertyIsEnumerable,ji=(t,e,n)=>e in t?vc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,_c=(t,e)=>{for(var n in e||(e={}))yc.call(e,n)&&ji(t,n,e[n]);if(Gi)for(var n of Gi(e))wc.call(e,n)&&ji(t,n,e[n]);return t},Re=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",Ie=Re(),Mn=Ie?navigator.userAgent:"",Oe=/android/i.test(Mn),Sc=/firefox/i.test(Mn),xc=/iPad|iPhone|iPod/.test(Mn),Xi,Ec=Ie&&/^Mac/i.test(((Xi=navigator.userAgentData)==null?void 0:Xi.platform)||navigator.platform),$c=Ie&&window.CSSStyleSheet&&document.adoptedStyleSheets,Cc={once:!0,capture:!0,passive:!0},Ac=":host(:not([hidden])) { display: block }",Tc="outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color",kc=`${Oe?"data":"aria"}-multiselectable`,Ki=typeof HTMLElement>"u"?class{}:HTMLElement,E=(t,e,n)=>n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),Dn=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.addEventListener(i,...o);return()=>Me(t,...e)},Me=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.removeEventListener(i,...o)},Lc=(t,e)=>{const n=t.shadowRoot||t.attachShadow({mode:"open"});if(n.querySelector("slot")||n.append(Pn("slot")),!n.querySelector("style"))if(!$c)n.append(Pn("style",null,e));else{const o=new CSSStyleSheet;o.replaceSync(e),n.adoptedStyleSheets=[o]}return n},Rc=(t,e,n)=>{const o=new MutationObserver(r=>{if(!Re()||!t.isConnected)return i();e(t,r)}),i=Object.assign(()=>o.disconnect(),{takeRecords:()=>o.takeRecords()});return e(t),o.observe(t,n),i},De=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},Yi=t=>De(t).activeElement,Yt=t=>{if(!t||!Ie)return null;if(window.uElementsId||(window.uElementsId={}),!t.id){const e=t.nodeName.toLowerCase();window.uElementsId[e]||(window.uElementsId[e]=1),t.id=`:${e}${window.uElementsId[e]++}`}return t.id},Pn=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,r]of Object.entries(e))E(o,i,r);return o},Qi={define:(t,e)=>!Re()||window.customElements.get(t)||window.customElements.define(t,e)},Ic=(t,e,n="")=>{var o,i;const r={bubbles:!0,composed:!0,data:e,inputType:n},s=HTMLInputElement.prototype;t.dispatchEvent(new InputEvent("beforeinput",r)),(i=(o=Object.getOwnPropertyDescriptor(s,"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,Hn=t=>(t?.type==="pointerup"&&(Nn=!1),t?.type==="pointerdown"&&(Nn=!0,Dn(document,"pointerup",Hn,Cc)),Nn),Oc=(t,e="<slot></slot>")=>`<template shadowrootmode="open">${e}<style>${t}</style></template>`,Mc=t=>{const e=E(t,"form");E(t,"form","#"),setTimeout(Dc,0,t,e)},Dc=(t,e)=>E(t,"form",e),Z,Pc=0,Zi=0,qn=t=>{clearTimeout(Zi),Z||(Z=Pn("div",{"aria-live":"assertive"}),Z.style.overflow="hidden",Z.style.position="fixed",Z.style.whiteSpace="nowrap",Z.style.width="1px"),Z.isConnected||document.body.append(Z),t===""&&(Z.textContent=""),t&&(Z.textContent=`${t}${Pc++%2?" ":""}`,Zi=setTimeout(qn,!Ec&&Sc?2e3:300,""))},Bn="disabled",Qt="selected",Nc=class extends Ki{constructor(){super(...arguments),this._skipAttrChange=!1}static get observedAttributes(){return["id",Bn,Qt]}connectedCallback(){Oe&&(this.tabIndex=-1),this.hasAttribute("role")||E(this,"role","option"),E(this,"aria-disabled",`${this.disabled}`),E(this,"aria-selected",`${this.selected}`),Yt(this)}attributeChangedCallback(t){this._skipAttrChange||(this._skipAttrChange=!0,t==="id"?Yt(this):E(this,`aria-${t}`,`${this[t]}`),this._skipAttrChange=!1)}get defaultSelected(){return this[Qt]}set defaultSelected(t){this[Qt]=t}get disabled(){return E(this,Bn)!==null}set disabled(t){E(this,Bn,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=E(this,"label"))!=null?t:this.text}set label(t){E(this,"label",t)}get selected(){return E(this,Qt)!==null}set selected(t){E(this,Qt,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=E(this,"value"))!=null?t:this.text}set value(t){E(this,"value",t)}};Qi.define("u-option",Nc);var Ji="data-activedescendant",Pe="aria-hidden",Un=`${Ac}
|
|
16
16
|
::slotted([role="option"]) { display: block; cursor: pointer }
|
|
17
|
-
::slotted([role="option"][${
|
|
18
|
-
::slotted([role="option"]:is([${Pe}="true"], [disabled], [hidden])) { display: none !important }`,Ac=xc(Hn),Bn,Yi="focus click keydown",zn="focusout input pointerdown",Ne={of:"of",plural:"%d hits",singular:"%d hit"},Qi=class extends Vi{constructor(){super(),this._texts=dc({},Ne),yc(this,Hn)}static get observedAttributes(){return["id",...Object.keys(Ne).map(t=>`data-sr-${t}`)]}connectedCallback(){this._root=De(this),E(this,"hidden",""),E(this,"role","listbox"),E(this,"tabindex","-1"),On(this._root,Yi,this,!0),this._umutate=wc(this,tr,{attributeFilter:["disabled","hidden","label","value"],attributes:!0,characterData:!0,childList:!0,subtree:!0})}disconnectedCallback(){var t;this._root&&Me(this._root,Yi,this,!0),this._root&&Me(this._root,zn,this),qe(this,null),(t=this._umutate)==null||t.call(this),this._umutate=this._root=this._input=void 0}attributeChangedCallback(t,e,n){const o=t?.split("data-sr-")[1];if(Ne[o])this._texts[o]=n||Ne[o];else if(this.id){const i=`input[list="${this.id}"]`,r=De(this).querySelector(i);r&&qe(this,r)}}handleEvent(t){t.defaultPrevented||(t.type==="focus"&&Un(this,t),t.type==="focusout"&&kc(this,t),t.type==="click"&&Rc(this,t),t.type==="input"&&tr(this),t.type==="keydown"&&Ic(this,t),t.type==="pointerdown"&&Lc(this,t))}get options(){const t=!this._options&&this.querySelector('[role="option"],option');return t&&(this._options=this.getElementsByTagName(t?.nodeName)),this._options||this.getElementsByTagName("option")}},Zi=t=>t.disabled||t.readOnly,Fn=t=>t instanceof HTMLInputElement,Tc=t=>E(t,Pe)!=="true"&&t.clientHeight,Qt=(t,e)=>{t._input&&E(t._input,"aria-expanded",`${e}`),!(!t.isConnected||t.hidden!==e)&&(e||Ji(t),t.popover&&t.togglePopover(e),e&&setTimeout(()=>clearTimeout(Bn)),t.hidden=!e)},Ji=(t,e)=>{t._input&&E(t._input,"aria-activedescendant",Kt(e));for(const n of t.options)E(n,Ki,n===e?"":null);e?.scrollIntoView({block:"nearest"})},qe=(t,e)=>{const n=e||t._input;n&&(t.popover&&(E(t,"popover","manual"),E(n,"popovertarget",e&&Kt(t))),E(n,"aria-autocomplete",e&&"list"),E(n,"aria-controls",e&&Kt(t)),E(n,"autocomplete",e&&"off"),E(n,"enterkeyhint","done"),E(n,"role",e&&!Zi(n)?"combobox":null))},Un=(t,{target:e})=>{var n,o;if(t._input!==e)if(Fn(e)&&e.getAttribute("list")===t.id){if(qe(t,null),qe(t,e),Zi(e))return;t._root&&On(t._root,zn,t),E(t,"aria-label",((o=(n=e.labels)==null?void 0:n[0])==null?void 0:o.textContent.trim())||null),Nn(),t._input=e,Oe&&Qt(t,!0)}else Wn(t)},kc=(t,e)=>{Pn()?e.stopImmediatePropagation():Oe||setTimeout(Wn,0,t,e)},Wn=t=>{const e=Gi(t);t._input===e||t.contains(e)||(t._root&&Me(t._root,zn,t),Qt(t,!1),t._input=void 0)},Lc=(t,e)=>t.contains(e.target)&&Pn(e),Rc=(t,e)=>{var n;if(Fn(e.target)&&Un(t,e),t._input===e.target)return Qt(t,!0);if(!t.contains(e.target))return Wn(t);for(const o of t.options)if(o.contains(e.target))return(n=t._input)==null||n.focus(),t._input&&_c(t._input,o.value),Qt(t,E(t,vc)==="true")},Ic=(t,e)=>{if(Fn(e.target)&&Un(t,e),t._input!==e.target)return;const{key:n,ctrlKey:o,metaKey:i,shiftKey:r,altKey:s}=e;if(o||i||r||n==="Tab"||s&&!n.startsWith("Arrow"))return;n==="Escape"&&!t.hidden&&e.preventDefault(),Qt(t,n!=="Escape");const a=n==="Enter",l=E(t._input,"aria-activedescendant"),c=[];let u=-1,d=-1;for(const m of t.options)Tc(m)&&(c.push(m),m.id===l&&(u=c.length-1));!s&&n==="ArrowDown"&&(d=(u+1)%c.length),!s&&n==="ArrowUp"&&(d=(u||c.length)-1),~u&&((n==="Home"||n==="PageUp")&&(d=0),(n==="End"||n==="PageDown")&&(d=c.length-1),a&&(d=u)),c[d]&&(e.preventDefault(),t._input.focus()),a&&c[d]?(e.stopImmediatePropagation(),Sc(t._input),c[d].click()):Ji(t,c[d])},tr=t=>{var e;if(!t._input||t.hidden)return;const n=t._input.value.toLowerCase().trim()||"",o=!t.hasAttribute("data-nofilter"),i=[],r=[];for(const s of t.options)(s.disabled||s.hidden||o&&!s.label.toLowerCase().includes(n)?i:r).push(s);for(const s of i)E(s,Pe,"true");for(const s of r)E(s,Pe,"false");clearTimeout(Bn),Bn=setTimeout(Oc,500,t,r),fc&&r.forEach((s,a,{length:l})=>{E(s,"title",`${a+1} ${t._texts.of} ${l}`)}),(e=t._umutate)==null||e.takeRecords()},Oc=(t,e)=>!t.hidden&&t._input===Gi(t)&&Nn(`${e.some(({value:n})=>n)?`${t._texts[e[1]?"plural":"singular"]}`.replace("%d",`${e.length}`):t.innerText}`);Re()&&Object.defineProperty(HTMLInputElement.prototype,"list",{configurable:!0,enumerable:!0,get(){const t=E(this,"list");return t&&De(this).getElementById(t)}}),ji.define("u-datalist",Qi),G()&&!Bs()&&zs();const Mc="3.3.3",er="_alert_14zqc_1 _ds-alert_o04yn_1",nr="_app_14zqc_1",or="_sticky_14zqc_1",ir="_avatar_14zqc_1 _ds-avatar_o04yn_1",rr="_badge_14zqc_1",sr="_breadcrumbs_14zqc_1 _ds-breadcrumbs_o04yn_3",ar="_button_14zqc_1 _ds-button_o04yn_1",lr="_card_14zqc_1",cr="_group_14zqc_1",dr="_chip_14zqc_1 _ds-chip_o04yn_3",ur="_details_14zqc_1 _ds-details_o04yn_1",fr="_dialog_14zqc_1 _ds-dialog_o04yn_3",mr="__drawer_14zqc_1",pr="_divider_14zqc_1",hr="_errorsummary_14zqc_1 _ds-error-summary_o04yn_3",gr="_field_14zqc_1 _ds-field_o04yn_1",br="_suggestion_14zqc_1 _ds-suggestion_o04yn_3",vr="_affixes_14zqc_1 _ds-field-affixes_o04yn_1",yr="_fieldset_14zqc_1 _ds-fieldset_o04yn_1",wr="_fileupload_14zqc_1",_r="_helptext_14zqc_1 _ds-focus_o04yn_1",xr="_input_14zqc_1 _ds-input_o04yn_1",Sr="_law_14zqc_1",Er="_grid_14zqc_1",$r="_flex_14zqc_1",Cr="_link_14zqc_1",Ar="_logo_14zqc_1",Tr="__logo_14zqc_1",kr="_pagination_14zqc_1 _ds-pagination_o04yn_3",Lr="_popover_14zqc_1 _ds-popover_o04yn_1",Rr="_print_14zqc_1",Ir="_progress_14zqc_1",Or="__indeterminate_14zqc_1",Mr="_skeleton_14zqc_1 _ds-skeleton_o04yn_3",Dr="__skeleton_14zqc_1",Pr="_spinner_14zqc_1",Nr="_steps_14zqc_1",qr="_table_14zqc_1 _ds-table_o04yn_3",Hr="__scrollShadow_14zqc_1",Br="_tabs_14zqc_1 _ds-tabs_o04yn_3",zr="__scrollMask_14zqc_1",Fr="_tag_14zqc_1 _ds-tag_o04yn_3",Ur="_toast_14zqc_1",Wr="__toastClose_14zqc_1",Vr="__toastOpen_14zqc_1",Gr="__toastTimeout_14zqc_1",jr="_togglegroup_14zqc_1 _ds-toggle-group_o04yn_3",Xr="__tooltip_14zqc_1 _ds-tooltip_o04yn_3",Kr="_heading_14zqc_1 _ds-heading_o04yn_1",Yr="_ingress_14zqc_1",Qr="_muted_14zqc_1",Zr="_info_14zqc_1",Jr="_prose_14zqc_1",ts="_validation_14zqc_1 _ds-validation-message_o04yn_1",es="_body_14zqc_162",ns="__checked_14zqc_1",C={alert:er,app:nr,sticky:or,avatar:ir,badge:rr,breadcrumbs:sr,button:ar,card:lr,group:cr,chip:dr,details:ur,dialog:fr,_drawer:mr,divider:pr,errorsummary:hr,field:gr,suggestion:br,affixes:vr,fieldset:yr,fileupload:wr,helptext:_r,input:xr,law:Sr,grid:Er,flex:$r,link:Cr,logo:Ar,_logo:Tr,pagination:kr,popover:Lr,print:Rr,progress:Ir,_indeterminate:Or,skeleton:Mr,_skeleton:Dr,spinner:Pr,steps:Nr,table:qr,_scrollShadow:Hr,tabs:Br,_scrollMask:zr,tag:Fr,toast:Ur,_toastClose:Wr,_toastOpen:Vr,_toastTimeout:Gr,togglegroup:jr,_tooltip:Xr,heading:Kr,ingress:Yr,muted:Qr,info:Zr,prose:Jr,validation:ts,body:es,_checked:ns},Dc=Object.freeze(Object.defineProperty({__proto__:null,_checked:ns,_drawer:mr,_indeterminate:Or,_logo:Tr,_scrollMask:zr,_scrollShadow:Hr,_skeleton:Dr,_toastClose:Wr,_toastOpen:Vr,_toastTimeout:Gr,_tooltip:Xr,affixes:vr,alert:er,app:nr,avatar:ir,badge:rr,body:es,breadcrumbs:sr,button:ar,card:lr,chip:dr,default:C,details:ur,dialog:fr,divider:pr,errorsummary:hr,field:gr,fieldset:yr,fileupload:wr,flex:$r,grid:Er,group:cr,heading:Kr,helptext:_r,info:Zr,ingress:Yr,input:xr,law:Sr,link:Cr,logo:Ar,muted:Qr,pagination:kr,popover:Lr,print:Rr,progress:Ir,prose:Jr,skeleton:Mr,spinner:Pr,steps:Nr,sticky:or,suggestion:br,table:qr,tabs:Br,tag:Fr,toast:Ur,togglegroup:jr,validation:ts},Symbol.toStringTag,{value:"Module"}));function os(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=os(t[e]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function Pc(){for(var t,e,n=0,o="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=os(t))&&(o&&(o+=" "),o+=e);return o}const Zt={capture:!0,passive:!0},P=()=>typeof window<"u"&&typeof document<"u",yt=t=>P()?document.getElementsByClassName(C[t].split(" ")[0]):[];function qt(t,e){let n;return function(...o){clearTimeout(n),n=setTimeout(()=>t.apply(this,o),e)}}const g=(t,e,n)=>n===void 0?t.getAttribute(e)??null:(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),O=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.addEventListener(i,...o);return()=>is(t,...e)},is=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.removeEventListener(i,...o)},st=(t,e)=>{if(!P())return;window._mtdsHotReloadCleanup||(window._mtdsHotReloadCleanup=new Map);const n=()=>{window._mtdsHotReloadCleanup?.get(t)?.map(o=>o()),window._mtdsHotReloadCleanup?.set(t,e())};document.readyState!=="complete"?O(window,"load",n):document.fonts?.ready?.then(n)||setTimeout(n,0)},Jt=(t,e,n)=>{let o=0;const i=()=>{if(!t.isConnected)return r();e(s),s.takeRecords(),o=0},r=()=>s?.disconnect?.(),s=new MutationObserver(()=>{o||(o=requestAnimationFrame(i))});return s.observe(t,n),i(),r},R=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,r]of Object.entries(e))g(o,i,r);return o},Nc=typeof HTMLElement>"u"?class{}:HTMLElement,qc=(t,e)=>!P()||window.customElements.get(t)||window.customElements.define(t,e),Hc=typeof window<"u"&&window.CSSStyleSheet&&document.adoptedStyleSheets,Bc=(t,e)=>{if(!Hc)return;t.shadowRoot||t.attachShadow({mode:"open"}).append(R("slot"));const n=new CSSStyleSheet;n.replaceSync(e),t.shadowRoot.adoptedStyleSheets=[n]},zc=`[data-command="toggle-app-expanded"],.${C.app.split(" ")[0]} > [command="show-modal"]`,Fc=`.${C.breadcrumbs.split(" ")[0]}`,Uc=`.${C.card.split(" ")[0]}`,rs=`.${C.chip.split(" ")[0]}`,Wc=`.${C.helptext.split(" ")[0]}`,Vc=`.${C.pagination.split(" ")[0]}`,Gc='summary,u-summary,a,button,[role="tab"],[role="button"]',Vn="mattilsynet.matomo.cloud",jc=["setCustomUrl","setDocumentTitle","setReferrerUrl"],W="mtds-analytics-banner",Xc="https://www.mattilsynet.no/om-mattilsynet/personvernerklaering/informasjonskapsler";function ss(t,e={}){if(P()){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"&&Kc();const s=r?`https://cdn.matomo.cloud/${Vn}/container_${r}.js`:`https://cdn.matomo.cloud/${Vn}/matomo.js`;document.querySelector(`script[src="${s}"]`)||document.head.append(R("script",{async:"",src:s}))}}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,s=["trackEvent",n,o,i,r];let a=location.href;window._paq.push([function(){a=this.getCurrentUrl()}]),window._paq.push(["setCustomUrl",a.split("#")[0]]),window._paq.push(s.filter(l=>l!==void 0)),window._paq.push(["setCustomUrl",a])}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;jc.includes(n?.[0])&&typeof n[1]!="string"&&(n[1]=`${n[1]??""}`),window._paq.push(n)}}}}function Kc(){if(document.getElementById(W)||window.localStorage.getItem(W))return;document.body.insertAdjacentHTML("afterbegin",`<dialog id="${W}" data-analytics="ignore"><style>
|
|
17
|
+
::slotted([role="option"][${Ji}]) { ${Tc} }
|
|
18
|
+
::slotted([role="option"]:is([${Pe}="true"], [disabled], [hidden])) { display: none !important }`,Hc=Oc(Un),zn,tr="focus click keydown",Fn="focusout input pointerdown",Ne={of:"of",plural:"%d hits",singular:"%d hit"},er=class extends Ki{constructor(){super(),this._texts=_c({},Ne),Lc(this,Un)}static get observedAttributes(){return["id",...Object.keys(Ne).map(t=>`data-sr-${t}`)]}connectedCallback(){this._root=De(this),E(this,"hidden",""),E(this,"role","listbox"),E(this,"tabindex","-1"),Dn(this._root,tr,this,!0),this._umutate=Rc(this,ir,{attributeFilter:["disabled","hidden","label","value"],attributes:!0,characterData:!0,childList:!0,subtree:!0})}disconnectedCallback(){var t;this._root&&Me(this._root,tr,this,!0),this._root&&Me(this._root,Fn,this),He(this,null),(t=this._umutate)==null||t.call(this),this._umutate=this._root=this._input=void 0}attributeChangedCallback(t,e,n){const o=t?.split("data-sr-")[1];if(Ne[o])this._texts[o]=n||Ne[o];else if(this.id){const i=`input[list="${this.id}"]`,r=De(this).querySelector(i);r&&He(this,r)}}handleEvent(t){t.defaultPrevented||(t.type==="focus"&&Vn(this,t),t.type==="focusout"&&Bc(this,t),t.type==="click"&&zc(this,t),t.type==="input"&&ir(this),t.type==="keydown"&&Fc(this,t),t.type==="pointerdown"&&Uc(this,t))}get options(){const t=!this._options&&this.querySelector('[role="option"],option');return t&&(this._options=this.getElementsByTagName(t?.nodeName)),this._options||this.getElementsByTagName("option")}},nr=t=>t.disabled||t.readOnly,Wn=t=>t instanceof HTMLInputElement,qc=t=>E(t,Pe)!=="true"&&t.clientHeight,Zt=(t,e)=>{t._input&&E(t._input,"aria-expanded",`${e}`),!(!t.isConnected||t.hidden!==e)&&(e||or(t),t.popover&&t.togglePopover(e),e&&setTimeout(()=>clearTimeout(zn)),t.hidden=!e)},or=(t,e)=>{t._input&&E(t._input,"aria-activedescendant",Yt(e));for(const n of t.options)E(n,Ji,n===e?"":null);e?.scrollIntoView({block:"nearest"})},He=(t,e)=>{const n=e||t._input;n&&(t.popover&&(E(t,"popover","manual"),E(n,"popovertarget",e&&Yt(t))),E(n,"aria-autocomplete",e&&"list"),E(n,"aria-controls",e&&Yt(t)),E(n,"autocomplete",e&&"off"),E(n,"enterkeyhint","done"),E(n,"role",e&&!nr(n)?"combobox":null))},Vn=(t,{target:e})=>{var n,o;if(t._input!==e)if(Wn(e)&&e.getAttribute("list")===t.id){if(He(t,null),He(t,e),nr(e))return;t._root&&Dn(t._root,Fn,t),E(t,"aria-label",((o=(n=e.labels)==null?void 0:n[0])==null?void 0:o.textContent.trim())||null),qn(),t._input=e,Oe&&Zt(t,!0)}else Gn(t)},Bc=(t,e)=>{Hn()?e.stopImmediatePropagation():Oe||setTimeout(Gn,0,t,e)},Gn=t=>{const e=Yi(t);t._input===e||t.contains(e)||(t._root&&Me(t._root,Fn,t),Zt(t,!1),t._input=void 0)},Uc=(t,e)=>t.contains(e.target)&&Hn(e),zc=(t,e)=>{var n;if(Wn(e.target)&&Vn(t,e),t._input===e.target)return Zt(t,!0);if(!t.contains(e.target))return Gn(t);for(const o of t.options)if(o.contains(e.target))return(n=t._input)==null||n.focus(),t._input&&Ic(t._input,o.value),Zt(t,E(t,kc)==="true")},Fc=(t,e)=>{if(Wn(e.target)&&Vn(t,e),t._input!==e.target)return;const{key:n,ctrlKey:o,metaKey:i,shiftKey:r,altKey:s}=e;if(o||i||r||n==="Tab"||s&&!n.startsWith("Arrow"))return;n==="Escape"&&!t.hidden&&e.preventDefault(),Zt(t,n!=="Escape");const a=n==="Enter",l=E(t._input,"aria-activedescendant"),c=[];let u=-1,d=-1;for(const m of t.options)qc(m)&&(c.push(m),m.id===l&&(u=c.length-1));!s&&n==="ArrowDown"&&(d=(u+1)%c.length),!s&&n==="ArrowUp"&&(d=(u||c.length)-1),~u&&((n==="Home"||n==="PageUp")&&(d=0),(n==="End"||n==="PageDown")&&(d=c.length-1),a&&(d=u)),c[d]&&(e.preventDefault(),t._input.focus()),a&&c[d]?(e.stopImmediatePropagation(),Mc(t._input),c[d].click()):or(t,c[d])},ir=t=>{var e;if(!t._input||t.hidden)return;const n=t._input.value.toLowerCase().trim()||"",o=!t.hasAttribute("data-nofilter"),i=[],r=[];for(const s of t.options)(s.disabled||s.hidden||o&&!s.label.toLowerCase().includes(n)?i:r).push(s);for(const s of i)E(s,Pe,"true");for(const s of r)E(s,Pe,"false");clearTimeout(zn),zn=setTimeout(Wc,500,t,r),xc&&r.forEach((s,a,{length:l})=>{E(s,"title",`${a+1} ${t._texts.of} ${l}`)}),(e=t._umutate)==null||e.takeRecords()},Wc=(t,e)=>!t.hidden&&t._input===Yi(t)&&qn(`${e.some(({value:n})=>n)?`${t._texts[e[1]?"plural":"singular"]}`.replace("%d",`${e.length}`):t.innerText}`);Re()&&Object.defineProperty(HTMLInputElement.prototype,"list",{configurable:!0,enumerable:!0,get(){const t=E(this,"list");return t&&De(this).getElementById(t)}}),Qi.define("u-datalist",er),G()&&!Qs()&&Zs();var rr=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",sr=rr(),ar;sr&&/^Mac/i.test(((ar=navigator.userAgentData)==null?void 0:ar.platform)||navigator.platform);var Vc=sr&&window.CSSStyleSheet&&document.adoptedStyleSheets,Gc=":host(:not([hidden])) { display: block }",lr=typeof HTMLElement>"u"?class{}:HTMLElement,st=(t,e,n)=>n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),cr=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.addEventListener(i,...o);return()=>jn(t,...e)},jn=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.removeEventListener(i,...o)},jc=(t,e)=>{const n=t.shadowRoot||t.attachShadow({mode:"open"});if(n.querySelector("slot")||n.append(qe("slot")),!n.querySelector("style"))if(!Vc)n.append(qe("style",null,e));else{const o=new CSSStyleSheet;o.replaceSync(e),n.adoptedStyleSheets=[o]}return n},Xc=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},qe=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,r]of Object.entries(e))st(o,i,r);return o},dr={define:(t,e)=>!rr()||window.customElements.get(t)||window.customElements.define(t,e)},Kc=(t,e="<slot></slot>")=>`<template shadowrootmode="open">${e}<style>${t}</style></template>`,Xn=`${Gc}
|
|
19
|
+
::slotted([slot="summary"]) { cursor: pointer; display: block }
|
|
20
|
+
::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 }
|
|
21
|
+
::slotted([slot="summary"][aria-expanded="true"])::before { rotate: 90deg }
|
|
22
|
+
:host > [part="details-content"]:not([hidden=""]) { display: block }`,Yc=Kc(Xn,'<slot name="summary"></slot><slot part="details-content" hidden="until-found"></slot>'),ur=class extends lr{static get observedAttributes(){return["open"]}constructor(){var t;super(),jc(this,Xn),(t=this.shadowRoot)==null||t.prepend(qe("slot",{name:"summary"}),qe("slot",{part:"details-content"})),console.warn(`\x1B[1m<u-details> is deprecated as <details> now has sufficient screen reader support 🎉\x1B[0m
|
|
23
|
+
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)}connectedCallback(){var t;this._content=(t=this.shadowRoot)==null?void 0:t.children[1],st(this,"role","group"),cr(this._content,"beforematch",this),cr(this,"click keydown",this),this.attributeChangedCallback()}disconnectedCallback(){this._content&&jn(this._content,"beforematch",this),jn(this,"click keydown",this),this._content=void 0}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"&&st(r,"aria-expanded",`${i}`);if(this._content&&(st(this._content,"aria-hidden",`${!i}`),st(this._content,"tabindex",i?null:"-1"),this._content.hidden=i?!1:o),i&&this.name){const r=Xc(this).querySelectorAll(`${this.nodeName}[name="${this.name}"]`);for(const s of r)s!==this&&(s.open=!1)}t==="open"&&e===null!=(n===null)&&this.dispatchEvent(new Event("toggle"))}handleEvent(t){var e,n;const o=t.key===" "||t.key==="Enter",i=t.target instanceof Element&&((e=t.target.closest('[slot="summary"]'))==null?void 0:e.parentElement)===this;t.defaultPrevented||(t.type==="beforematch"&&(this.open=!0),i&&t.type==="click"&&(this.open=!this.open),i&&t.type==="keydown"&&o&&((n=t.preventDefault)==null||n.call(t),t.target.dispatchEvent(new MouseEvent("click",t))))}get open(){return this.hasAttribute("open")}set open(t){st(this,"open",t?"":null)}get name(){return st(this,"name")||""}set name(t){st(this,"name",t)}},fr=class extends lr{connectedCallback(){st(this,"role","button"),this.slot="summary",this.tabIndex=0}};dr.define("u-details",ur),dr.define("u-summary",fr);const Qc="3.3.5",mr="_alert_14zqc_1 _ds-alert_o04yn_1",pr="_app_14zqc_1",hr="_sticky_14zqc_1",gr="_avatar_14zqc_1 _ds-avatar_o04yn_1",br="_badge_14zqc_1",vr="_breadcrumbs_14zqc_1 _ds-breadcrumbs_o04yn_3",yr="_button_14zqc_1 _ds-button_o04yn_1",wr="_card_14zqc_1",_r="_group_14zqc_1",Sr="_chip_14zqc_1 _ds-chip_o04yn_3",xr="_details_14zqc_1 _ds-details_o04yn_1",Er="_dialog_14zqc_1 _ds-dialog_o04yn_3",$r="__drawer_14zqc_1",Cr="_divider_14zqc_1",Ar="_errorsummary_14zqc_1 _ds-error-summary_o04yn_3",Tr="_field_14zqc_1 _ds-field_o04yn_1",kr="_suggestion_14zqc_1 _ds-suggestion_o04yn_3",Lr="_affixes_14zqc_1 _ds-field-affixes_o04yn_1",Rr="_fieldset_14zqc_1 _ds-fieldset_o04yn_1",Ir="_fileupload_14zqc_1",Or="_helptext_14zqc_1 _ds-focus_o04yn_1",Mr="_input_14zqc_1 _ds-input_o04yn_1",Dr="_law_14zqc_1",Pr="_grid_14zqc_1",Nr="_flex_14zqc_1",Hr="_link_14zqc_1",qr="_logo_14zqc_1",Br="__logo_14zqc_1",Ur="_pagination_14zqc_1 _ds-pagination_o04yn_3",zr="_popover_14zqc_1 _ds-popover_o04yn_1",Fr="_print_14zqc_1",Wr="_progress_14zqc_1",Vr="__indeterminate_14zqc_1",Gr="_skeleton_14zqc_1 _ds-skeleton_o04yn_3",jr="__skeleton_14zqc_1",Xr="_spinner_14zqc_1",Kr="_steps_14zqc_1",Yr="_table_14zqc_1 _ds-table_o04yn_3",Qr="__scrollShadow_14zqc_1",Zr="_tabs_14zqc_1 _ds-tabs_o04yn_3",Jr="__scrollMask_14zqc_1",ts="_tag_14zqc_1 _ds-tag_o04yn_3",es="_toast_14zqc_1",ns="__toastClose_14zqc_1",os="__toastOpen_14zqc_1",is="__toastTimeout_14zqc_1",rs="_togglegroup_14zqc_1 _ds-toggle-group_o04yn_3",ss="__tooltip_14zqc_1 _ds-tooltip_o04yn_3",as="_heading_14zqc_1 _ds-heading_o04yn_1",ls="_ingress_14zqc_1",cs="_muted_14zqc_1",ds="_info_14zqc_1",us="_prose_14zqc_1",fs="_validation_14zqc_1 _ds-validation-message_o04yn_1",ms="_body_14zqc_162",ps="__checked_14zqc_1",C={alert:mr,app:pr,sticky:hr,avatar:gr,badge:br,breadcrumbs:vr,button:yr,card:wr,group:_r,chip:Sr,details:xr,dialog:Er,_drawer:$r,divider:Cr,errorsummary:Ar,field:Tr,suggestion:kr,affixes:Lr,fieldset:Rr,fileupload:Ir,helptext:Or,input:Mr,law:Dr,grid:Pr,flex:Nr,link:Hr,logo:qr,_logo:Br,pagination:Ur,popover:zr,print:Fr,progress:Wr,_indeterminate:Vr,skeleton:Gr,_skeleton:jr,spinner:Xr,steps:Kr,table:Yr,_scrollShadow:Qr,tabs:Zr,_scrollMask:Jr,tag:ts,toast:es,_toastClose:ns,_toastOpen:os,_toastTimeout:is,togglegroup:rs,_tooltip:ss,heading:as,ingress:ls,muted:cs,info:ds,prose:us,validation:fs,body:ms,_checked:ps},Zc=Object.freeze(Object.defineProperty({__proto__:null,_checked:ps,_drawer:$r,_indeterminate:Vr,_logo:Br,_scrollMask:Jr,_scrollShadow:Qr,_skeleton:jr,_toastClose:ns,_toastOpen:os,_toastTimeout:is,_tooltip:ss,affixes:Lr,alert:mr,app:pr,avatar:gr,badge:br,body:ms,breadcrumbs:vr,button:yr,card:wr,chip:Sr,default:C,details:xr,dialog:Er,divider:Cr,errorsummary:Ar,field:Tr,fieldset:Rr,fileupload:Ir,flex:Nr,grid:Pr,group:_r,heading:as,helptext:Or,info:ds,ingress:ls,input:Mr,law:Dr,link:Hr,logo:qr,muted:cs,pagination:Ur,popover:zr,print:Fr,progress:Wr,prose:us,skeleton:Gr,spinner:Xr,steps:Kr,sticky:hr,suggestion:kr,table:Yr,tabs:Zr,tag:ts,toast:es,togglegroup:rs,validation:fs},Symbol.toStringTag,{value:"Module"}));function hs(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=hs(t[e]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function Jc(){for(var t,e,n=0,o="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=hs(t))&&(o&&(o+=" "),o+=e);return o}const Jt={capture:!0,passive:!0},N=()=>typeof window<"u"&&typeof document<"u",wt=t=>N()?document.getElementsByClassName(C[t].split(" ")[0]):[];function qt(t,e){let n;return function(...o){clearTimeout(n),n=setTimeout(()=>t.apply(this,o),e)}}const g=(t,e,n)=>n===void 0?t.getAttribute(e)??null:(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),M=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.addEventListener(i,...o);return()=>gs(t,...e)},gs=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.removeEventListener(i,...o)},ut=(t,e)=>{if(!N())return;window._mtdsHotReloadCleanup||(window._mtdsHotReloadCleanup=new Map);const n=()=>{window._mtdsHotReloadCleanup?.get(t)?.map(o=>o()),window._mtdsHotReloadCleanup?.set(t,e())};document.readyState!=="complete"?M(window,"load",n):document.fonts?.ready?.then(n)||setTimeout(n,0)},Be=(t,e,n)=>{let o=0;const i=()=>{if(!t.isConnected)return r();e(s),s.takeRecords(),o=0},r=()=>s?.disconnect?.(),s=new MutationObserver(()=>{o||(o=requestAnimationFrame(i))});return s.observe(t,n),i(),r},R=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,r]of Object.entries(e))g(o,i,r);return o},td=typeof HTMLElement>"u"?class{}:HTMLElement,ed=(t,e)=>!N()||window.customElements.get(t)||window.customElements.define(t,e),nd=typeof window<"u"&&window.CSSStyleSheet&&document.adoptedStyleSheets,od=(t,e)=>{if(!nd)return;t.shadowRoot||t.attachShadow({mode:"open"}).append(R("slot"));const n=new CSSStyleSheet;n.replaceSync(e),t.shadowRoot.adoptedStyleSheets=[n]},id=`[data-command="toggle-app-expanded"],.${C.app.split(" ")[0]} > [command="show-modal"]`,rd=`.${C.breadcrumbs.split(" ")[0]}`,sd=`.${C.card.split(" ")[0]}`,bs=`.${C.chip.split(" ")[0]}`,ad=`.${C.helptext.split(" ")[0]}`,ld=`.${C.pagination.split(" ")[0]}`,cd='summary,u-summary,a,button,[role="tab"],[role="button"]',Kn="mattilsynet.matomo.cloud",dd=["setCustomUrl","setDocumentTitle","setReferrerUrl"],W="mtds-analytics-banner",ud="https://www.mattilsynet.no/om-mattilsynet/personvernerklaering/informasjonskapsler";function vs(t,e={}){if(N()){if(window._paq||(window._paq=[],window._paq.push(["HeatmapSessionRecording::disable"]),window._paq.push(["enableLinkTracking"]),window._paq.push(["setTrackerUrl",`https://${Kn}/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"&&fd();const s=r?`https://cdn.matomo.cloud/${Kn}/container_${r}.js`:`https://cdn.matomo.cloud/${Kn}/matomo.js`;document.querySelector(`script[src="${s}"]`)||document.head.append(R("script",{async:"",src:s}))}}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,s=["trackEvent",n,o,i,r];let a=location.href;window._paq.push([function(){a=this.getCurrentUrl()}]),window._paq.push(["setCustomUrl",a.split("#")[0]]),window._paq.push(s.filter(l=>l!==void 0)),window._paq.push(["setCustomUrl",a])}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;dd.includes(n?.[0])&&typeof n[1]!="string"&&(n[1]=`${n[1]??""}`),window._paq.push(n)}}}}function fd(){if(document.getElementById(W)||window.localStorage.getItem(W))return;document.body.insertAdjacentHTML("afterbegin",`<dialog id="${W}" data-analytics="ignore"><style>
|
|
19
24
|
#${W}[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 }
|
|
20
25
|
#${W} 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 }
|
|
21
26
|
#${W} button:focus-visible { outline: 2px solid }
|
|
@@ -23,9 +28,9 @@ Add a heading (h2–h6), or set aria-label or aria-labelledby to provide an acce
|
|
|
23
28
|
#${W} button:active { background: #054449; scale: .9 }
|
|
24
29
|
#${W} p { margin: 0 .25em }
|
|
25
30
|
</style>
|
|
26
|
-
<p>Vi bruker <a href="${
|
|
31
|
+
<p>Vi bruker <a href="${ud}" target="_blank">informasjonskapsler</a> for å forbedre brukeropplevelsen.</p>
|
|
27
32
|
<form method="dialog" data-analytics="ignore"><button type="submit" aria-label="OK">×</button></form>
|
|
28
|
-
</dialog>`);const e=document.getElementById(W),n=()=>window.localStorage.setItem(W,"seen");e.addEventListener("close",n,{once:!0}),e.show()}function
|
|
33
|
+
</dialog>`);const e=document.getElementById(W),n=()=>window.localStorage.setItem(W,"seen");e.addEventListener("close",n,{once:!0}),e.show()}function md(t){window._mtdsTracking?.enabled&&setTimeout(pd,0,t)}function pd({type:t,target:e}){const n=t==="click"?e?.closest?.(cd):e;if(!(n instanceof Element)||n.closest('[data-analytics="ignore"]'))return;let o="click",i="Button",r=ys(n)||bd(n)||g(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 s=g(n,"type"),a=s==="checkbox"||s==="radio"?n.closest("fieldset"):null;i=n.closest(bs)?"Chip":"Form",o="change",r=ys(a||n)||te(a?.querySelector("legend"))||te(n?.labels?.[0])}else if(g(n,"role")==="tab")i="Tab",o="navigate";else if(g(n,"popovertarget")){if(!hd(n)?.matches(":popover-open"))return;i=n.closest(ad)?"HelpText":"Popover",o="open"}else if(n.nodeName.endsWith("SUMMARY")){if(!n.parentElement.open)return;i="Details",o="open"}else if(n.matches(id)){const s=gd(n,"--mtds-tooltip-position")==="none";i="Sidebar",o=s?"expand":"minimize",r=s&&g(n,"data-tooltip")||te(n)}else if(n.closest(rd))i="Breadcrumbs",o="navigate";else if(n.closest(ld))i="Pagination",o="navigate";else if(n.closest(sd))i="Card",o=n instanceof HTMLAnchorElement?"navigate":"click";else if(n.closest(bs))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(g(n,"aria-expanded")!=="true")return;i="Expand",o="open"}else n.nodeName.startsWith("MTDS-ATLAS-")&&(i="Map Marker",o="open");(t==="change"||t==="submit")&&(i=n.closest("form")?.getAttribute("data-analytics-category")||i),vs("event",{category:g(n,"data-analytics-category")??i,action:g(n,"data-analytics-action")??o,name:g(n,"data-analytics-name")??r})}const te=t=>t?.textContent?.trim()||"",ys=t=>t&&g(t,"aria-label")||"",hd=t=>document.getElementById(g(t,"popovertarget")||""),gd=(t,e)=>window.getComputedStyle(t).getPropertyValue(e)?.trim(),bd=t=>{const e=te(t),n=te(t.querySelector("h1,h2,h3,h4,h5,h6"));return e.startsWith(n)&&n||e.slice(0,100).trim()};ut("analytics",()=>[M(document,"click toggle submit change",md,Jt)]),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 Yn=C.app.split(" ")[0],vd=`[data-command="toggle-app-expanded"],.${Yn} > [command="show-modal"]`,Qn=`.${Yn} > dialog,.${Yn} dialog ~ main`,ws=wt("sticky"),_s=t=>{document.startViewTransition?document.startViewTransition(t):t()},Ss=t=>_s(()=>window.mtdsToggleAppExpanded?.(t));function yd(t){const{target:e,defaultPrevented:n}=t,o=e?.closest?.("a");if(o?.closest("dialog")&&o?.closest(Qn))return xs();if(n||!(e instanceof HTMLButtonElement)||!e.matches(vd))return;const i=getComputedStyle(e).position==="sticky";t.preventDefault(),i?Ss():_s(()=>{const r=document.querySelector(Qn);r?.setAttribute("closedby","any"),r?.showModal()})}function xs(){document.querySelector(Qn)?.close()}let Zn=0,Bt,at=0,Jn=0,Ue=0,to=!1,eo=0,_t=0;function wd(){if(!ws?.length)return;const t=ws[0],e=window.scrollY,n=e<_t;_t=e,n!==Bt&&(Zn=(t.parentElement?.getBoundingClientRect().top||0)+_t,Bt=n,Jn=t.offsetHeight,Ue=t.getBoundingClientRect().top+_t,to=t.offsetHeight<=window.innerHeight,eo=window.innerHeight),!(at===-1&&to)&&(at!==-1&&(to||Bt&&_t<=Ue)?(t.style.setProperty("--pos","sticky"),t.style.setProperty("--top","0px"),at=-1):at===-1&&!Bt?(t.style.setProperty("--pos","relative"),t.style.setProperty("--top",`${Math.max(0,_t-Zn)}px`),at=0):at!==1&&!Bt&&_t+eo>=Ue+Jn?(t.style.setProperty("--pos","sticky"),t.style.setProperty("--top",`${eo-Jn}px`),at=1):at===1&&Bt&&(t.style.setProperty("--pos","relative"),t.style.setProperty("--top",`${Ue-Zn}px`),at=0))}ut("app",()=>[M(document,"click",yd,!0),M(window,"resize",qt(xs,100),Jt),M(window,"scroll",wd,Jt)]);const _d=/<[^>]+\bid="([^"]+)[^>]+>/gi,Es=/\([^)]{1,4}\).{1,9}\d+\/\d+/i,Sd=/<(h\d|[^>]+role="heading")[^>]*>(.*?)<\/?(h\d|br|div)/i,xd=/kapittel-\d+-ledd-\d+/,Ed=/<button[^>]+>.*?<\/button>/g,$d=/►m\d+/i,ze=/<[^>]+>/g,Cd=/<dt([^>]*class="([^"]+)")?[^>]*>(.*?)<\/dt><dd[^>]*>(.*?)<\/dd>/gis,Ad=/<(\/?)(article|footer|section)/gi,Td=/(src|href)="([^"]+)"/gi,kd=/(<li[^>]*)>\s*<div([^>]*>)|<\/div>(<\/li>)/gi,Ld=/(<li[^>]+data-name="([^"]+)[^>]+>)(\s*<(ul|ol|div)[^>]+>)/gis,Rd=/(<[^>]+class="[^"]*\bnumberedLegalP\b[^>]+>\s*)(\d+\.)(.*?)(?=<\/?(ul|ol|div)|$)/gis,$s="https://lovdata.no/",Id="https://www.mattilsynet.no/regelveiledning/?regelverk=",Od={dokid:{label:"DokumentID",value:""},legacyid:{label:"Datokode",value:""},refid:{label:"RefID",value:""},title:{label:"Tittel",value:""},titleshort:{label:"Korttittel",value:""},url:{label:"Url",value:""}},no=t=>Array.from(Array.isArray(t)?t:[t],e=>e instanceof HTMLButtonElement?e.value:e),Md=t=>Array.from(t?.querySelectorAll('button[aria-checked="true"]')||[],e=>e.value),Dd=(t,e)=>{const n=no(t);e?.querySelectorAll("button").forEach(o=>{n.includes(o.value)&&g(o,"aria-checked",`${g(o,"aria-checked")!=="true"}`)})},Pd=(t,e)=>{const n=no(t);e?.querySelectorAll("button").forEach(o=>{g(o,"aria-checked",`${n.includes(o.value)||!1}`)})},Nd=(t,e)=>{const n=Cs(e);return no(t).map(o=>qd(o,n)).filter(o=>!!o)},Hd=t=>{const e=t.slice(0,t.indexOf("</dl>")),n={...Od};for(const o of e.matchAll(Cd)){const i=o[2].replace(/-/g,"").toLowerCase();n[i]={label:o[3],value:o[4]}}return n},Cs=t=>t.includes("<main")?(t.split(/<\/?main[^>]*>/)[1]||"").replace(Ad,"<$1div").replace(kd,"$1$2$3").replace(Td,(e,n,o)=>`${n}="${o.includes(":")?"":$s}${o}" ${n==="href"?'rel="noopener noreferrer" target="_blank"':""}`).replace(Rd,(e,n,o,i)=>`${n}<span class="data-originalId">${o}</span><div class="legalP" id="${St("id",n)}-ledd-0">${i}</div>`).replace(Ld,(e,n,o,i)=>`${n}<span class="data-originalId">${o}</span>${i}`).replace(_d,(e,n,o,i)=>{const r=As(e,n,o,i);return`${e}${r?`<button type="button" role="checkbox" aria-label="${r}" value="${n}"></button>`:""}`}):t,qd=(t,e)=>{const n=xd.test(t),o=t.split("-").map((c,u,d)=>u%2?Bd(d.slice(0,u+1).join("-"),e,n):null).filter(c=>!!c);if(!o.length)return null;const i=o.filter(({guideUrl:c})=>c).pop()?.guideUrl,r=o.filter(({url:c})=>c).pop(),s=o.filter(c=>c.className==="section"&&Es.test(c.label)).pop(),a=r?`${$s}${r.url}`:"",l=o.slice(o.indexOf(s||o[0])).map(({label:c})=>c).join(", ");return{...o.slice(-1)[0],path:o,label:l,url:a,guideUrl:i}},Bd=(t,e,n)=>{const o=e.lastIndexOf("<",e.indexOf(` id="${t}"`)),i=e.slice(o,e.indexOf(">",o)+1),r=St("class",i),s=St("data-lovdata-url",i),a=As(i,t,o,e),[l,c,u]=s.match(/(lov|forskrift)\/([^/]+)/)||[],d=`${c?.slice(0,3).toUpperCase()}-${u}`;return{id:t,className:r,guideUrl:s&&`${Id}${d}_${t}`,html:Ud(t,e),url:s,label:!n&&r==="section"&&a?.match(Es)?.[0]||a}},St=(t,e)=>{const n=` ${t.toLowerCase()}="`,o=e.toLowerCase().indexOf(n),i=o+n.length;return o===-1?"":e.slice(i,e.indexOf('"',i))},Ud=(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 s=e.indexOf(">",i)+1;return i?e.slice(n,s).replace(Ed,""):""},As=(t,e,n,o)=>zd[St("class",t)]?.(t,e,n,o)||"",zd={numberedLegalP:t=>`nr. ${St("data-numerator",t)}.`,section:(t,e,n,o)=>o.slice(n).match(Sd)?.[2]?.replace(ze,"")?.replace($d,"").trim()||"",legalArticle:(t,e,n,o)=>{const i=o.indexOf(">",o.indexOf("legalArticleValue",n));return o.slice(i+1,o.indexOf("</span>",i)).replace(ze,"").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("-")}"`,s=o.lastIndexOf(r,n),a=o.slice(o.indexOf("<ol",s),n),l=St("data-name",t)||"-",c=St("type",a)||"-";let u="punkt";return c==="1"&&(u="tall"),c==="a"&&(u="bokstav"),c==="i"&&(u="romtertall"),`${u} ${l==="-"?i.pop():l.replace(ze,"")}`},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(ze,"")}`}};function D(t,e={}){const n=document.getElementById(e.id||"")||R("dialog");return g(n,"aria-busy",e.busy?"true":null),g(n,"class",Jc(C.toast,e.className)),g(n,"closedby",e.closedby||null),g(n,"data-color",e.color||null),g(n,"data-icon",`${e.icon??""}`||null),g(n,"data-timeout",`${e.timeout??""}`||null),g(n,"id",e.id||`${Date.now()}`),g(n,"open",e.open===!1?null:""),n.innerHTML=t,M(n,"animationend",Fd,{once:!0}),document.body.appendChild(n),n.id}function Fd({animationName:t,target:e}){t===C._toastClose&&e.remove()}D.success=(t,e)=>D(t,{color:"success",...e}),D.danger=(t,e)=>D(t,{color:"danger",...e}),D.info=(t,e)=>D(t,{color:"info",...e}),D.warning=(t,e)=>D(t,{color:"warning",...e}),D.neutral=(t,e)=>D(t,{color:"neutral",...e}),D.promise=async function(e,n){const{loading:o,success:i,error:r,...s}=n,a=D(o,{busy:!0,...s});try{const l=await e();return D.success(i,{id:a,busy:!1}),l}catch(l){throw D.danger(r,{id:a,busy:!1}),l}};const Wd=`/* NOTE: Using --mtds- not --mtds- since we're inside shadow dom */
|
|
29
34
|
:host(:not([hidden])) { display: grid; gap: var(--mtds-6) }
|
|
30
35
|
[data-event] { cursor: pointer } /* Used to forward clicks from Chart ShaowDOM to relevant cell in child table */
|
|
31
36
|
|
|
@@ -207,4 +212,4 @@ Add a heading (h2–h6), or set aria-label or aria-labelledby to provide an acce
|
|
|
207
212
|
vertical-align: middle;
|
|
208
213
|
width: var(--mtds-5);
|
|
209
214
|
}
|
|
210
|
-
`,Td=[.1,.2,.25,.5,1];function kd(t,{aspect:e,type:n}){const i=n==="stacked",r=t[0].reduce((f,p,b)=>{const y=t.map(w=>w[b].number),_=y.reduce((w,x)=>w+x,0);return Math.max(f,...i?[_]:y)},0),s=r/10,a=10**`${Math.round(s)}`.length,l=s/a,c=(Td.find(f=>f>l)||1)*a,u=Math.ceil(r/c)*c,d=R("div",{"aria-label":t[0][0].value||null,class:"axis",role:"figure"});e&&d.style.setProperty("--mtdsc-chart-aspect",e),d.style.setProperty("--bars",`${t[0]?.length-1}`),d.style.setProperty("--groups",`${t.length-1}`),d.style.setProperty("--total",`${u}`);const m=d.appendChild(R("div",{class:"axisSteps"})),h=d.appendChild(R("div",{class:"axisGroups"}));return Array.from({length:u/c+1},(f,p)=>Ld(c*p)).reverse().map(f=>m.append(R("div",{class:"axisStep","data-label":f}))),{total:u,groups:h,axis:d}}const Ld=new Intl.NumberFormat().format;function Rd(t){return t[0].slice(1).map(({value:e,event:n},o)=>{const i=R("div",{class:"axisGroup","data-label":e}),r=i.appendChild(R("div",{class:"axisGroupContent"}));return t.slice(1).map(s=>s[o+1]).map(({tooltip:s,color:a,number:l})=>{const c=R("div",{"aria-label":s,"data-event":n,class:"bar",role:"img",tabindex:"0"});return c.style.setProperty("--color",a),c.style.setProperty("--value",`${l}`),r.appendChild(c)}),i})}function Id(t,{total:e,type:n,variant:o}){const i=Number.parseFloat(n||"0")||0,r=R("div",{class:"axisGroup"});return t.slice(1).forEach(([,...s])=>{const a=R("div",{class:"lineContainer",role:"list"});a.style.setProperty("--color",s[0].color);const l=Od(s.map(({number:d},m,{length:h})=>[100/(h-1)*m,100-d/e*100]),i/100),c=document.createElementNS("http://www.w3.org/2000/svg","svg");g(c,"aria-hidden","true"),g(c,"preserveAspectRatio","none"),g(c,"viewBox","0 0 100 100");const u=document.createElementNS("http://www.w3.org/2000/svg","path");if(g(u,"class","line"),g(u,"d",l),g(u,"fill","none"),g(u,"stroke","currentColor"),o==="area"){const d=u.cloneNode(!0);g(d,"d",`M-100,100 L${l.slice(1)}L200,100`),g(d,"class","lineShade"),c.append(d)}s.forEach(({number:d,tooltip:m,event:h},f)=>{const p=R("div",{role:"listitem"}),b=R("div",{"aria-label":m,"data-event":h,tabindex:"0",class:"linePoint",role:"img"});g(p,"data-label",t[0][f+1]?.value),b.style.setProperty("--value",`${d}`),p.appendChild(b),a.append(p)}),a.appendChild(c).append(u),r.append(a)}),r}const Od=(t,e)=>t.map(([n,o],i,r)=>i?Md(i,r,e):`M${n},${o}`).join(" "),gs=([t,e],[n,o])=>[t+n,e+o],bs=([t,e],[n,o])=>[t-n,e-o],vs=(t,[e,n])=>[t*e,t*n],Md=(t,e,n)=>{const o=e[t-1],i=e[t],[r,s]=gs(o,vs(n,bs(i,e[t-2]||o))),[a,l]=gs(i,vs(n,bs(o,e[t+1]||i)));return`C ${r},${s} ${a},${l} ${i[0]},${i[1]}`};function Dd(t,{aspect:e,variant:n}){const o=document.createElementNS("http://www.w3.org/2000/svg","svg");e&&o.style.setProperty("--mtdsc-chart-aspect",e),g(o,"class","pie"),g(o,"viewBox","0 0 100 100");let i=0;const r=50,s=n==="doughnut"?25:0,a=t.slice(1).reduce((l,[,c])=>l+c.number,0);return t.slice(1).forEach(([,{tooltip:l,number:c,event:u,color:d}])=>{if(!c)return;const m=document.createElementNS("http://www.w3.org/2000/svg","path"),h=i/a;i+=c;const f=Math.min(i/a,.99999),p=f-h>.5?1:0,b=2*Math.PI*(h-.25),y=2*Math.PI*(f-.25),_=Math.cos(b),w=Math.sin(b),x=Math.cos(y),A=Math.sin(y),k=`M ${r+s*_} ${r+s*w} L ${r+r*_} ${r+r*w} A ${r} ${r} 0 ${p} 1 ${r+r*x} ${r+r*A} L ${r+s*x} ${r+s*A} A ${s} ${s} 0 ${p} 0 ${r+s*_} ${r+s*w}`;m.style.setProperty("--color",d),g(m,"aria-label",l),g(m,"data-event",u),g(m,"d",k),g(m,"role","img"),g(m,"tabindex","0"),o.appendChild(m)}),o}const ys="click keydown mousemove mouseout",ws="mtds-chart-tooltip",ut=P()?document.getElementById(ws)||R("div",{"aria-hidden":"true",class:C._tooltip,hidden:"",id:ws}):null;class Pd extends Nc{#t;#e;static get observedAttributes(){return["data-variant","data-aspect"]}constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const e=qt(()=>this.attributeChangedCallback(),100),n=new ResizeObserver(()=>this.handleResize());n.observe(this),this.#e=()=>n.disconnect(),this.#t=Jt(this,e,{attributeFilter:["data-tooltip"],attributes:!0,characterData:!0,childList:!0,subtree:!0}),requestAnimationFrame(()=>this.attributeChangedCallback()),O(this,ys,this)}disconnectedCallback(){ut&&(ut.hidden=!0),is(this,ys,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(c=>c.remove());const[n,o]=(g(this,"data-variant")||"column").split("-"),i=g(this,"data-aspect")||void 0,r=R("div",{"aria-hidden":"hidden",class:"legends",role:"group"});e.slice(1).forEach(([{value:c,color:u}])=>{const d=R("div",{class:"legend"},c);r.appendChild(d).style.setProperty("--color",u)});const{axis:s,groups:a,total:l}=kd(e,{aspect:i,type:o});(n==="column"||n==="bar")&&a.append(...Rd(e)),(n==="line"||n==="area")&&a.append(Id(e,{total:l,variant:n,type:o})),(n==="doughnut"||n==="pie")&&this.shadowRoot?.append(Dd(e,{aspect:i,variant:n})),this.shadowRoot?.append(s,r),Bc(this,Ad)}handleEvent(e){e.type==="click"||e.type==="keydown"?Nd(e,this):qd(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 Nd(t,e){if(t instanceof KeyboardEvent&&t.key!=="Enter")return;const n=t.composedPath()[0],o=e.querySelector("table"),[i,r]=n instanceof Element&&g(n,"data-event")?.split("-").map(Number)||[];o?.rows[i]?.cells[r]?.querySelector("a,button")?.click?.()}let _s="";function qd(t){if(!ut)return;ut?.isConnected||document.body.append(ut);const e=t.composedPath()[0],n=e instanceof Element&&e.getAttribute("aria-label")||"";n&&(ut.style.transform=`translate(${Math.min(t.clientX,window.innerWidth)}px, ${t.clientY}px)`),n!==_s&&(n&&(ut.textContent=n),_s=n,ut.hidden=!n)}const Jn=t=>t?.textContent?.trim()||"",Hd=t=>Array.from(t?.rows||[]).map((e,n,{length:o})=>Array.from(e.cells,(i,r)=>{const s=Jn(e.cells[0]),a=Jn(t?.rows[0].cells[r]),l=Jn(i),c=o===2?`${a}: ${l}`:`${s}: ${l}${a?` (${a})`:""}`;return g(i,"tabindex","-1"),{number:r&&n&&Number.parseFloat(l)||0,event:i.querySelector("a,button")&&`${n}-${r}`,color:`var(--mtdsc-chart-color-${n}-${r}, var(--mtdsc-chart-color-${n}, var(--mtdsc-chart-color-base)))`,value:l,tooltip:g(i,"data-tooltip")||c}}));qc("mtds-chart",Pd);const xs=new WeakSet,N=t=>!xs.has(t)&&xs.add(t),M=(t,e,n)=>window.dsWarnings===!1||console.warn(`\x1B[1m@mattilsynet/design:\x1B[m ${t} is deprecated, please use ${e}:`,n),Bd=yt("togglegroup"),Ss=C.button.split(" "),zd=()=>{for(const t of Bd){N(t)&&!t.hasAttribute("data-toggle-group")&&(g(t,"data-toggle-group","Valgknapper"),M('Only setting class="styles.togglegroup"','data-toggle-group="LABEL-HERE" attribute also for better accessibility',t));for(const e of t.getElementsByTagName("label"))N(e)&&!e.classList.contains(Ss[0])&&(e.classList.add(...Ss),M('Only setting class="styles.button"','<label class="styles.button">',e))}},Fd=yt("breadcrumbs"),Ud=()=>{for(const t of Fd)N(t)&&t.nodeName!=="DS-BREADCRUMBS"&&(t.classList.add(...C.breadcrumbs.split(" ")),M('Only setting class="styles.breadcrumbs"','<ds-breadcrumbs class="styles.breadcrumbs">',t))},Wd=yt("errorsummary"),Vd=()=>{for(const t of Wd)N(t)&&t.nodeName!=="DS-ERROR-SUMMARY"&&M('Only setting class="styles.errorsummary"','<ds-error-summary class="styles.errorsummary">',t)},Gd=yt("dialog"),Es=()=>{for(const t of Gd){if(N(t)){const e=g(t,"data-closedby");e&&(g(t,"closedby",e),M(`<dialog data-closedby="${e}">`,`<dialog closedby="${e}">`,t)),t.hasAttribute("data-variant")&&M('<dialog data-variant="drawer">','<dialog data-placement="center|left|right|top|bottom">',t)}t.isConnected&&t.showModal&&t.close&&(t.matches('[open][data-modal]:not([data-modal="false"]):not(:modal)')?(M('<dialog data-modal="true">','.showModal() or <button command="show-modal" commandfor="DIALOG-ID"></button>',t),g(t,"open",null),t.showModal()):t.matches(":modal:not([open])")&&(g(t,"open",""),t.close()))}},jd=()=>{for(const t of document.querySelectorAll("[data-count]"))if(N(t)){const e=g(t,"data-count");t.classList.add(...C.validation.split(" ")),g(t,"data-limit",e),M(`data-count="${e}"`,`class="styles.validation" data-field="counter" data-limit="${e}"`,t)}},Xd=()=>{for(const t of document.querySelectorAll("[data-command]"))if(N(t)){const e=g(t,"data-command");e==="row"?M(`<${t.nodeName.toLowerCase()} data-command="${e}">`,`<tr data-clickdelegatefor="${t.nodeName}-ID">`,t):M(`<button data-command="${e}">`,`<button command="${e?.replace("toggle-app-expanded","show-modal")}" commandfor="TARGET-ID">`,t)}},Kd=P()?document.getElementsByTagName("u-tabs"):[],Yd=()=>{for(const t of Kd)N(t)&&M("u-tabs","ds-tabs",t)},to=C.suggestion.split(" "),Qd=P()?document.getElementsByTagName("u-combobox"):[],Zd=P()?document.getElementsByTagName("ds-suggestion"):[],Jd=()=>{for(const t of Qd)N(t)&&(t.classList.add(...to),M("<u-combobox>",'<ds-suggestion class="styles.suggestion">',t));for(const t of Zd)N(t)&&!t.classList.contains(to[0])&&(t.classList.add(...to),M("Only using <ds-suggestion>",'<ds-suggestion class="styles.suggestion">',t))},tu=({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()},eu=yt("field"),ze=new Set,nu=()=>{for(const t of eu)t.nodeName!=="DS-FIELD"&&(N(t)||M('Only setting class="styles.field"','<ds-field class="styles.field">',t),!ze.has(t)&&ze.add(t)&&we.prototype.connectedCallback.call(t))},ou=()=>{for(const t of ze)we.prototype.disconnectedCallback.call(t),ze.delete(t)},iu=`[data-description], .${C.field.split(" ")[0]} label + p`,ru=()=>{for(const t of document.querySelectorAll(iu))N(t)&&t.getAttribute("data-field")!=="description"&&(g(t,"data-field","description"),M("Descriptions created by data-description of <p> only",'data-field="data-description"',t))},su=yt("validation"),au=()=>{for(const t of su)N(t)&&!t.hasAttribute("data-field")&&(g(t,"data-field","validation"),M('Only setting class="styles.validation"','class="styles.validation" data-field="validation"',t))},lu=()=>{for(const t of document.querySelectorAll("[popover][data-position]"))N(t)&&(g(t,"data-placement",g(t,"data-position")),M("data-position","data-placement",t))},cu=qt(()=>{P()&&(jd(),Xd(),Ud(),Es(),Vd(),ru(),au(),lu(),nu(),zd(),Jd(),Yd())},200);st("deprecations",()=>[ou,O(document,"click",tu,Zt),O(document,"toggle",Es,!0),Jt(document,cu,{attributeFilter:["class","data-command","data-count","data-description","data-variant","open"],attributes:!0,childList:!0,subtree:!0})]);const du=qt(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"),s=i.getPropertyValue("--mtdsc-logo-background"),a=n.outerHTML.replace(/\n+/g," ").replace(/(fill|width|height|xmlns)="[^"]+"/gi,"").replace("<svg",`<svg width="40" height="40" fill="${r}"`);document.head.appendChild(R("link",{href:`data:image/svg+xml,${encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 55 55'><rect fill='${o?"none":s}' 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)">${a}</g></svg>`)}`,rel:"icon"}))}},200);st("logo",()=>[O(document,"animationend",du)]);const uu=C.popover.split(" ")[0];function fu({target:t}){const e=t?.closest?.('a,button,[role="button"]'),n=e instanceof HTMLButtonElement,o=e&&g(e,"popovertarget"),i=o?document.getElementById(o):e?.closest("[popover]");if(!(o&&n)&&i?.classList.contains(uu)&&e){const r=g(e,"popovertargetaction"),s=r==="show"||(r==="hide"?!1:void 0);if(n&&!r&&i.contains(e))return;i instanceof HTMLElement&&i.popover&&i.togglePopover(s)}}st("popover",()=>[O(document,"click",fu)]);const eo=new WeakSet,mu=P()?document.getElementsByTagName("table"):[],$s=P()&&window.ResizeObserver?new ResizeObserver(qt(Cs,200)):null;function Cs(t){for(const{target:e,contentRect:n}of t)if(!e.isConnected)eo.delete(e)&&$s?.unobserve(e);else{const i=e.getAttribute("data-mobile-source")==="self"?n.width:window.innerWidth,r=Number(e.getAttribute("data-mobile-size"))||768;g(e,"data-mobile-active",i<r?"":null)}}function pu(){for(const t of mu)if(t.hasAttribute("data-mobile")){const e=Array.from(t.tHead?.rows[0]?.cells||[],n=>n.innerText.trim());eo.has(t)||(eo.add(t),$s?.observe(t),Cs([{target:t,contentRect:t.getBoundingClientRect()}]));for(const n of t.tBodies)for(const o of n.rows)for(const i of o.cells)g(i,"data-th",e[i.cellIndex]||":empty")}}st("table",()=>[Jt(document,pu,{attributeFilter:["data-mobile"],attributes:!0,childList:!0,subtree:!0})]);const As=C.toast.split(" ")[0],Fe="data-sort";function hu({animationName:t,target:e}){const n=e;if(t===C._toastTimeout&&n.close(),t!==C._toastOpen)return;const o=Number(g(n,"data-timeout"));n.style.setProperty("--mtdsc-toast-timeout",o?`${o}ms`:null),n.hasAttribute(Fe)||g(n,Fe,`${Date.now()}`),g(n,"tabindex","0"),[...document.querySelectorAll(`.${As}[open]`)].sort((i,r)=>Number(g(r,Fe))-Number(g(i,Fe))).reduce((i,r)=>(r.style.translate=`0 ${r===e?0:i}px`,i+r.offsetHeight+5),0)}function gu({target:t,clientX:e,clientY:n}){if(t instanceof HTMLDialogElement&&t.classList.contains(As)&&g(t,"data-closedby")!=="none"){const o=t.getBoundingClientRect(),i=window.getComputedStyle(t),r=window.getComputedStyle(t,"::after"),s=o.top+Number.parseInt(i.paddingTop,10),a=s+Number.parseInt(r.height,10),l=o.right-Number.parseInt(i.paddingRight,10),c=l-Number.parseInt(r.width,10);s<=n&&n<=a&&c<=e&&e<=l&&t.close()}}st("toast",()=>[O(document,"animationstart",hu),O(document,"click",gu)]),P()&&Vo(document.getElementById("mtds-tooltip")||R("div",{class:C._tooltip,id:"mtds-tooltip",popover:"manual"}));const no=`.${C.field.split(" ")[0]}`,bu=`${no} :is(input,textarea,select)`,vu="ds-suggestion,u-combobox",yu=C.validation.split(" ")[0],Ue=t=>t instanceof HTMLFormElement&&g(t,"data-validation")==="form",oo=t=>t.closest(no),io=t=>t?.querySelectorAll(bu)||[],We=t=>t?.getElementsByClassName(yu)||[],Ts=t=>{const e=!t.clientHeight||t.disabled||t.readOnly||g(t,"aria-readonly")==="true"||g(t,"aria-disabled")==="true",n=t.closest(vu)?.items,o=g(t,"aria-required")!=="true"||!!n?.length;return n&&t.setCustomValidity(e||o?"":"Required"),e?!1:t.matches(":user-invalid")},ks=t=>{const e=t.target?.form||t.target;let n;if(Ue(e)){for(const o of e.querySelectorAll(no)){const i=[...io(o)].find(Ts);!n&&i&&(n=i);for(const r of We(o))g(r,"hidden",i?null:"")}for(const o of e.querySelectorAll("fieldset")){const i=[...io(o)].some(Ts);for(const r of We(o))oo(r)||g(r,"hidden",i?null:"")}n&&(t.preventDefault(),n.focus())}},wu=({target:t})=>{const e=t;if(Ue(e.form))for(const n of We(e.closest("fieldset")||oo(e)))g(n,"hidden","")},_u=t=>Ue(t.target.form)&&t?.preventDefault(),xu=P()?We(document):[],Su=()=>{for(const t of xu)if(!t.hasAttribute("data-validation")){const e=io(oo(t))[0];g(t,"data-validation","form"),Ue(e?.form)&&g(t,"hidden","")}};st("validations",()=>[O(document,"input comboboxbeforeselect",wu,!0),O(document,"invalid",_u,!0),O(document,"invalid",qt(ks,10),Zt),O(document,"submit",ks,!0),Jt(document,Su,{childList:!0,subtree:!0})]);const Eu=P()?document.getElementsByTagName("u-datalist"):[],Ls=new WeakSet,$u=()=>{for(const t of Eu)Ls.has(t)||(t.closest("ds-suggestion")?.connectedCallback(),Ls.add(t))};return st("deprecations",()=>[Jt(document,$u,{childList:!0,subtree:!0})]),$.DSBreadcrumbsElement=Ko,$.DSErrorSummaryElement=Yo,$.DSFieldElement=we,$.DSPaginationElement=ri,$.DSSuggestionElement=_i,$.DSTabElement=Di,$.DSTabListElement=Mi,$.DSTabPanelElement=Pi,$.DSTabsElement=Oi,$.UHTMLComboboxElement=_n,$.UHTMLComboboxShadowRoot=Ol,$.UHTMLComboboxStyle=wn,$.UHTMLDataListElement=Qi,$.UHTMLDataListShadowRoot=Ac,$.UHTMLDataListStyle=Hn,$.analytics=ss,$.fixLawHtml=ps,$.getLawChecked=bd,$.pagination=ii,$.parseLawIds=wd,$.parseLawMeta=_d,$.setLawChecked=yd,$.setTooltipElement=Vo,$.styles=Dc,$.toast=D,$.toggleAppExpanded=ds,$.toggleLawChecked=vd,$.version=Mc,Object.defineProperty($,Symbol.toStringTag,{value:"Module"}),$})({});
|
|
215
|
+
`,Vd=[.1,.2,.25,.5,1];function Gd(t,{aspect:e,type:n}){const i=n==="stacked",r=t[0].reduce((f,p,b)=>{const y=t.map(w=>w[b].number),_=y.reduce((w,S)=>w+S,0);return Math.max(f,...i?[_]:y)},0),s=r/10,a=10**`${Math.round(s)}`.length,l=s/a,c=(Vd.find(f=>f>l)||1)*a,u=Math.ceil(r/c)*c,d=R("div",{"aria-label":t[0][0].value||null,class:"axis",role:"figure"});e&&d.style.setProperty("--mtdsc-chart-aspect",e),d.style.setProperty("--bars",`${t[0]?.length-1}`),d.style.setProperty("--groups",`${t.length-1}`),d.style.setProperty("--total",`${u}`);const m=d.appendChild(R("div",{class:"axisSteps"})),h=d.appendChild(R("div",{class:"axisGroups"}));return Array.from({length:u/c+1},(f,p)=>jd(c*p)).reverse().map(f=>m.append(R("div",{class:"axisStep","data-label":f}))),{total:u,groups:h,axis:d}}const jd=new Intl.NumberFormat().format;function Xd(t){return t[0].slice(1).map(({value:e,event:n},o)=>{const i=R("div",{class:"axisGroup","data-label":e}),r=i.appendChild(R("div",{class:"axisGroupContent"}));return t.slice(1).map(s=>s[o+1]).map(({tooltip:s,color:a,number:l})=>{const c=R("div",{"aria-label":s,"data-event":n,class:"bar",role:"img",tabindex:"0"});return c.style.setProperty("--color",a),c.style.setProperty("--value",`${l}`),r.appendChild(c)}),i})}function Kd(t,{total:e,type:n,variant:o}){const i=Number.parseFloat(n||"0")||0,r=R("div",{class:"axisGroup"});return t.slice(1).forEach(([,...s])=>{const a=R("div",{class:"lineContainer",role:"list"});a.style.setProperty("--color",s[0].color);const l=Yd(s.map(({number:d},m,{length:h})=>[100/(h-1)*m,100-d/e*100]),i/100),c=document.createElementNS("http://www.w3.org/2000/svg","svg");g(c,"aria-hidden","true"),g(c,"preserveAspectRatio","none"),g(c,"viewBox","0 0 100 100");const u=document.createElementNS("http://www.w3.org/2000/svg","path");if(g(u,"class","line"),g(u,"d",l),g(u,"fill","none"),g(u,"stroke","currentColor"),o==="area"){const d=u.cloneNode(!0);g(d,"d",`M-100,100 L${l.slice(1)}L200,100`),g(d,"class","lineShade"),c.append(d)}s.forEach(({number:d,tooltip:m,event:h},f)=>{const p=R("div",{role:"listitem"}),b=R("div",{"aria-label":m,"data-event":h,tabindex:"0",class:"linePoint",role:"img"});g(p,"data-label",t[0][f+1]?.value),b.style.setProperty("--value",`${d}`),p.appendChild(b),a.append(p)}),a.appendChild(c).append(u),r.append(a)}),r}const Yd=(t,e)=>t.map(([n,o],i,r)=>i?Qd(i,r,e):`M${n},${o}`).join(" "),Ts=([t,e],[n,o])=>[t+n,e+o],ks=([t,e],[n,o])=>[t-n,e-o],Ls=(t,[e,n])=>[t*e,t*n],Qd=(t,e,n)=>{const o=e[t-1],i=e[t],[r,s]=Ts(o,Ls(n,ks(i,e[t-2]||o))),[a,l]=Ts(i,Ls(n,ks(o,e[t+1]||i)));return`C ${r},${s} ${a},${l} ${i[0]},${i[1]}`};function Zd(t,{aspect:e,variant:n}){const o=document.createElementNS("http://www.w3.org/2000/svg","svg");e&&o.style.setProperty("--mtdsc-chart-aspect",e),g(o,"class","pie"),g(o,"viewBox","0 0 100 100");let i=0;const r=50,s=n==="doughnut"?25:0,a=t.slice(1).reduce((l,[,c])=>l+c.number,0);return t.slice(1).forEach(([,{tooltip:l,number:c,event:u,color:d}])=>{if(!c)return;const m=document.createElementNS("http://www.w3.org/2000/svg","path"),h=i/a;i+=c;const f=Math.min(i/a,.99999),p=f-h>.5?1:0,b=2*Math.PI*(h-.25),y=2*Math.PI*(f-.25),_=Math.cos(b),w=Math.sin(b),S=Math.cos(y),A=Math.sin(y),k=`M ${r+s*_} ${r+s*w} L ${r+r*_} ${r+r*w} A ${r} ${r} 0 ${p} 1 ${r+r*S} ${r+r*A} L ${r+s*S} ${r+s*A} A ${s} ${s} 0 ${p} 0 ${r+s*_} ${r+s*w}`;m.style.setProperty("--color",d),g(m,"aria-label",l),g(m,"data-event",u),g(m,"d",k),g(m,"role","img"),g(m,"tabindex","0"),o.appendChild(m)}),o}const Rs="click keydown mousemove mouseout",Is="mtds-chart-tooltip",ft=N()?document.getElementById(Is)||R("div",{"aria-hidden":"true",class:C._tooltip,hidden:"",id:Is}):null;class Jd extends td{#t;#e;static get observedAttributes(){return["data-variant","data-aspect"]}constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const e=qt(()=>this.attributeChangedCallback(),100),n=new ResizeObserver(()=>this.handleResize());n.observe(this),this.#e=()=>n.disconnect(),this.#t=Be(this,e,{attributeFilter:["data-tooltip"],attributes:!0,characterData:!0,childList:!0,subtree:!0}),requestAnimationFrame(()=>this.attributeChangedCallback()),M(this,Rs,this)}disconnectedCallback(){ft&&(ft.hidden=!0),gs(this,Rs,this),this.#e?.(),this.#t?.(),this.#t=this.#e=void 0}attributeChangedCallback(){const e=nu(this.querySelector("table"));if(!e[0])return;Array.from(this.shadowRoot?.children||[]).map(c=>c.remove());const[n,o]=(g(this,"data-variant")||"column").split("-"),i=g(this,"data-aspect")||void 0,r=R("div",{"aria-hidden":"hidden",class:"legends",role:"group"});e.slice(1).forEach(([{value:c,color:u}])=>{const d=R("div",{class:"legend"},c);r.appendChild(d).style.setProperty("--color",u)});const{axis:s,groups:a,total:l}=Gd(e,{aspect:i,type:o});(n==="column"||n==="bar")&&a.append(...Xd(e)),(n==="line"||n==="area")&&a.append(Kd(e,{total:l,variant:n,type:o})),(n==="doughnut"||n==="pie")&&this.shadowRoot?.append(Zd(e,{aspect:i,variant:n})),this.shadowRoot?.append(s,r),od(this,Wd)}handleEvent(e){e.type==="click"||e.type==="keydown"?tu(e,this):eu(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 tu(t,e){if(t instanceof KeyboardEvent&&t.key!=="Enter")return;const n=t.composedPath()[0],o=e.querySelector("table"),[i,r]=n instanceof Element&&g(n,"data-event")?.split("-").map(Number)||[];o?.rows[i]?.cells[r]?.querySelector("a,button")?.click?.()}let Os="";function eu(t){if(!ft)return;ft?.isConnected||document.body.append(ft);const e=t.composedPath()[0],n=e instanceof Element&&e.getAttribute("aria-label")||"";n&&(ft.style.transform=`translate(${Math.min(t.clientX,window.innerWidth)}px, ${t.clientY}px)`),n!==Os&&(n&&(ft.textContent=n),Os=n,ft.hidden=!n)}const oo=t=>t?.textContent?.trim()||"",nu=t=>Array.from(t?.rows||[]).map((e,n,{length:o})=>Array.from(e.cells,(i,r)=>{const s=oo(e.cells[0]),a=oo(t?.rows[0].cells[r]),l=oo(i),c=o===2?`${a}: ${l}`:`${s}: ${l}${a?` (${a})`:""}`;return g(i,"tabindex","-1"),{number:r&&n&&Number.parseFloat(l)||0,event:i.querySelector("a,button")&&`${n}-${r}`,color:`var(--mtdsc-chart-color-${n}-${r}, var(--mtdsc-chart-color-${n}, var(--mtdsc-chart-color-base)))`,value:l,tooltip:g(i,"data-tooltip")||c}}));ed("mtds-chart",Jd);const Ms=new WeakSet,P=t=>!Ms.has(t)&&Ms.add(t),I=(t,e,n)=>window.dsWarnings===!1||console.warn(`\x1B[1m@mattilsynet/design:\x1B[m ${t} is deprecated, please use ${e}:`,n),ou=wt("togglegroup"),Ds=C.button.split(" "),iu=()=>{for(const t of ou){P(t)&&!t.hasAttribute("data-toggle-group")&&(g(t,"data-toggle-group","Valgknapper"),I('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(Ds[0])&&(e.classList.add(...Ds),I('Only setting class="styles.button"','<label class="styles.button">',e))}},ru=wt("breadcrumbs"),su=()=>{for(const t of ru)P(t)&&t.nodeName!=="DS-BREADCRUMBS"&&(t.classList.add(...C.breadcrumbs.split(" ")),I('Only setting class="styles.breadcrumbs"','<ds-breadcrumbs class="styles.breadcrumbs">',t))},au=wt("errorsummary"),lu=()=>{for(const t of au)P(t)&&t.nodeName!=="DS-ERROR-SUMMARY"&&I('Only setting class="styles.errorsummary"','<ds-error-summary class="styles.errorsummary">',t)},cu=wt("dialog"),Ps=()=>{for(const t of cu){if(P(t)){const e=g(t,"data-closedby");e&&(g(t,"closedby",e),I(`<dialog data-closedby="${e}">`,`<dialog closedby="${e}">`,t)),t.hasAttribute("data-variant")&&I('<dialog data-variant="drawer">','<dialog data-placement="center|left|right|top|bottom">',t)}t.isConnected&&t.showModal&&t.close&&(t.matches('[open][data-modal]:not([data-modal="false"]):not(:modal)')?(I('<dialog data-modal="true">','.showModal() or <button command="show-modal" commandfor="DIALOG-ID"></button>',t),g(t,"open",null),t.showModal()):t.matches(":modal:not([open])")&&(g(t,"open",""),t.close()))}},du=()=>{for(const t of document.querySelectorAll("[data-count]"))if(P(t)){const e=g(t,"data-count");t.classList.add(...C.validation.split(" ")),g(t,"data-limit",e),I(`data-count="${e}"`,`class="styles.validation" data-field="counter" data-limit="${e}"`,t)}},uu=()=>{for(const t of document.querySelectorAll("[data-command]"))if(P(t)){const e=g(t,"data-command");e==="row"?I(`<${t.nodeName.toLowerCase()} data-command="${e}">`,`<tr data-clickdelegatefor="${t.nodeName}-ID">`,t):I(`<button data-command="${e}">`,`<button command="${e?.replace("toggle-app-expanded","show-modal")}" commandfor="TARGET-ID">`,t)}},fu=N()?document.getElementsByTagName("u-tabs"):[],mu=()=>{for(const t of fu)P(t)&&I("u-tabs","ds-tabs",t)},pu=N()?document.getElementsByTagName("u-details"):[],hu=()=>{for(const t of pu)P(t)&&I("u-details","details",t)},io=C.suggestion.split(" "),gu=N()?document.getElementsByTagName("u-combobox"):[],bu=N()?document.getElementsByTagName("ds-suggestion"):[],vu=()=>{for(const t of gu)P(t)&&(t.classList.add(...io),I("<u-combobox>",'<ds-suggestion class="styles.suggestion">',t));for(const t of bu)P(t)&&!t.classList.contains(io[0])&&(t.classList.add(...io),I("Only using <ds-suggestion>",'<ds-suggestion class="styles.suggestion">',t))},yu=({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()},wu=wt("field"),Fe=new Set,_u=()=>{for(const t of wu)t.nodeName!=="DS-FIELD"&&(P(t)||I('Only setting class="styles.field"','<ds-field class="styles.field">',t),!Fe.has(t)&&Fe.add(t)&&we.prototype.connectedCallback.call(t))},Su=()=>{for(const t of Fe)we.prototype.disconnectedCallback.call(t),Fe.delete(t)},xu=`[data-description], .${C.field.split(" ")[0]} label + p`,Eu=()=>{for(const t of document.querySelectorAll(xu))P(t)&&t.getAttribute("data-field")!=="description"&&(g(t,"data-field","description"),I("Descriptions created by data-description of <p> only",'data-field="data-description"',t))},$u=wt("validation"),Cu=()=>{for(const t of $u)P(t)&&!t.hasAttribute("data-field")&&(g(t,"data-field","validation"),I('Only setting class="styles.validation"','class="styles.validation" data-field="validation"',t))},Au=()=>{for(const t of document.querySelectorAll("[popover][data-position]"))P(t)&&(g(t,"data-placement",g(t,"data-position")),I("data-position","data-placement",t))},Tu=qt(()=>{N()&&(du(),uu(),su(),Ps(),lu(),Eu(),Cu(),Au(),_u(),iu(),vu(),mu(),hu())},200);ut("deprecations",()=>[Su,M(document,"click",yu,Jt),M(document,"toggle",Ps,!0),Be(document,Tu,{attributeFilter:["class","data-command","data-count","data-description","data-variant","open"],attributes:!0,childList:!0,subtree:!0})]);const ku=qt(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"),s=i.getPropertyValue("--mtdsc-logo-background"),a=n.outerHTML.replace(/\n+/g," ").replace(/(fill|width|height|xmlns)="[^"]+"/gi,"").replace("<svg",`<svg width="40" height="40" fill="${r}"`);document.head.appendChild(R("link",{href:`data:image/svg+xml,${encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 55 55'><rect fill='${o?"none":s}' 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)">${a}</g></svg>`)}`,rel:"icon"}))}},200);ut("logo",()=>[M(document,"animationend",ku)]);const Lu=C.popover.split(" ")[0];function Ru({target:t}){const e=t?.closest?.('a,button,[role="button"]'),n=e instanceof HTMLButtonElement,o=e&&g(e,"popovertarget"),i=o?document.getElementById(o):e?.closest("[popover]");if(!(o&&n)&&i?.classList.contains(Lu)&&e){const r=g(e,"popovertargetaction"),s=r==="show"||(r==="hide"?!1:void 0);if(n&&!r&&i.contains(e))return;i instanceof HTMLElement&&i.popover&&i.togglePopover(s)}}ut("popover",()=>[M(document,"click",Ru)]);const ro=new WeakSet,Iu=N()?document.getElementsByTagName("table"):[],Ns=N()&&window.ResizeObserver?new ResizeObserver(qt(Hs,200)):null;function Hs(t){for(const{target:e,contentRect:n}of t)if(!e.isConnected)ro.delete(e)&&Ns?.unobserve(e);else{const i=e.getAttribute("data-mobile-source")==="self"?n.width:window.innerWidth,r=Number(e.getAttribute("data-mobile-size"))||768;g(e,"data-mobile-active",i<r?"":null)}}function Ou(){for(const t of Iu)if(t.hasAttribute("data-mobile")){const e=Array.from(t.tHead?.rows[0]?.cells||[],n=>(n.innerText??n.textContent)?.trim()||"");ro.has(t)||(ro.add(t),Ns?.observe(t),Hs([{target:t,contentRect:t.getBoundingClientRect()}]));for(const n of t.tBodies)for(const o of n.rows)for(const i of o.cells)g(i,"data-th",e[i.cellIndex]||":empty")}}ut("table",()=>[Be(document,Ou,{attributeFilter:["data-mobile"],attributes:!0,childList:!0,subtree:!0})]);const qs=C.toast.split(" ")[0],We="data-sort";function Mu({animationName:t,target:e}){const n=e;if(t===C._toastTimeout&&n.close(),t!==C._toastOpen)return;const o=Number(g(n,"data-timeout"));n.style.setProperty("--mtdsc-toast-timeout",o?`${o}ms`:null),n.hasAttribute(We)||g(n,We,`${Date.now()}`),g(n,"tabindex","0"),[...document.querySelectorAll(`.${qs}[open]`)].sort((i,r)=>Number(g(r,We))-Number(g(i,We))).reduce((i,r)=>(r.style.translate=`0 ${r===e?0:i}px`,i+r.offsetHeight+5),0)}function Du({target:t,clientX:e,clientY:n}){if(t instanceof HTMLDialogElement&&t.classList.contains(qs)&&g(t,"data-closedby")!=="none"){const o=t.getBoundingClientRect(),i=window.getComputedStyle(t),r=window.getComputedStyle(t,"::after"),s=o.top+Number.parseInt(i.paddingTop,10),a=s+Number.parseInt(r.height,10),l=o.right-Number.parseInt(i.paddingRight,10),c=l-Number.parseInt(r.width,10);s<=n&&n<=a&&c<=e&&e<=l&&t.close()}}ut("toast",()=>[M(document,"animationstart",Mu),M(document,"click",Du)]),N()&&Ko(document.getElementById("mtds-tooltip")||R("div",{class:C._tooltip,id:"mtds-tooltip",popover:"manual"}));const so=`.${C.field.split(" ")[0]}`,Pu=`${so} :is(input,textarea,select)`,Nu="ds-suggestion,u-combobox",Hu=C.validation.split(" ")[0],Ve=t=>t instanceof HTMLFormElement&&g(t,"data-validation")==="form",ao=t=>t.closest(so),lo=t=>t?.querySelectorAll(Pu)||[],Ge=t=>t?.getElementsByClassName(Hu)||[],Bs=t=>{const e=!t.clientHeight||t.disabled||t.readOnly||g(t,"aria-readonly")==="true"||g(t,"aria-disabled")==="true",n=t.closest(Nu)?.items,o=g(t,"aria-required")!=="true"||!!n?.length;return n&&t.setCustomValidity(e||o?"":"Required"),e?!1:t.matches(":user-invalid")},Us=t=>{const e=t.target?.form||t.target;let n;if(Ve(e)){for(const o of e.querySelectorAll(so)){const i=[...lo(o)].find(Bs);!n&&i&&(n=i);for(const r of Ge(o))g(r,"hidden",i?null:"")}for(const o of e.querySelectorAll("fieldset")){const i=[...lo(o)].some(Bs);for(const r of Ge(o))ao(r)||g(r,"hidden",i?null:"")}n&&(t.preventDefault(),n.focus())}},qu=({target:t})=>{const e=t;if(Ve(e.form))for(const n of Ge(e.closest("fieldset")||ao(e)))g(n,"hidden","")},Bu=t=>Ve(t.target.form)&&t?.preventDefault(),Uu=N()?Ge(document):[],zu=()=>{for(const t of Uu)if(!t.hasAttribute("data-validation")){const e=lo(ao(t))[0];g(t,"data-validation","form"),Ve(e?.form)&&g(t,"hidden","")}};return ut("validations",()=>[M(document,"input comboboxbeforeselect",qu,!0),M(document,"invalid",Bu,!0),M(document,"invalid",qt(Us,10),Jt),M(document,"submit",Us,!0),Be(document,zu,{childList:!0,subtree:!0})]),$.DSBreadcrumbsElement=Jo,$.DSErrorSummaryElement=ti,$.DSFieldElement=we,$.DSPaginationElement=ci,$.DSSuggestionElement=$i,$.DSTabElement=qi,$.DSTabListElement=Hi,$.DSTabPanelElement=Bi,$.DSTabsElement=Ni,$.UHTMLComboboxElement=xn,$.UHTMLComboboxShadowRoot=Wl,$.UHTMLComboboxStyle=Sn,$.UHTMLDataListElement=er,$.UHTMLDataListShadowRoot=Hc,$.UHTMLDataListStyle=Un,$.UHTMLDetailsElement=ur,$.UHTMLDetailsShadowRoot=Yc,$.UHTMLDetailsStyle=Xn,$.UHTMLSummaryElement=fr,$.analytics=vs,$.fixLawHtml=Cs,$.getLawChecked=Md,$.pagination=li,$.parseLawIds=Nd,$.parseLawMeta=Hd,$.setLawChecked=Pd,$.setTooltipElement=Ko,$.styles=Zc,$.toast=D,$.toggleAppExpanded=Ss,$.toggleLawChecked=Dd,$.version=Qc,Object.defineProperty($,Symbol.toStringTag,{value:"Module"}),$})({});
|