@oslokommune/punkt-react 15.4.1 → 15.4.2

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.
@@ -37,13 +37,13 @@
37
37
  * @license
38
38
  * Copyright 2018 Google LLC
39
39
  * SPDX-License-Identifier: BSD-3-Clause
40
- */const Ko=new Set(["children","localName","ref","style","className"]),pr=new WeakMap,fr=(s,e,t,i,n)=>{const r=n==null?void 0:n[e];r===void 0?(s[e]=t,t==null&&e in HTMLElement.prototype&&s.removeAttribute(e)):t!==i&&((a,l,d)=>{let p=pr.get(a);p===void 0&&pr.set(a,p=new Map);let m=p.get(l);d!==void 0?m===void 0?(p.set(l,m={handleEvent:d}),a.addEventListener(l,m)):m.handleEvent=d:m!==void 0&&(p.delete(l),a.removeEventListener(l,m))})(s,r,t)},It=({react:s,tagName:e,elementClass:t,events:i,displayName:n})=>{const r=new Set(Object.keys(i??{})),a=s.forwardRef(((l,d)=>{const p=s.useRef(new Map),m=s.useRef(null),v={},y={};for(const[k,g]of Object.entries(l))Ko.has(k)?v[k==="className"?"class":k]=g:r.has(k)||k in t.prototype?y[k]=g:v[k]=g;return s.useLayoutEffect((()=>{if(m.current===null)return;const k=new Map;for(const g in y)fr(m.current,g,l[g],p.current.get(g),i),p.current.delete(g),k.set(g,l[g]);for(const[g,$]of p.current)fr(m.current,g,void 0,$,i);p.current=k})),s.useLayoutEffect((()=>{var k;(k=m.current)==null||k.removeAttribute("defer-hydration")}),[]),v.suppressHydrationWarning=!0,s.createElement(e,{...v,ref:s.useCallback((k=>{m.current=k,typeof d=="function"?d(k):d!==null&&(d.current=k)}),[d])})}));return a.displayName=n??t.name,a};/**
40
+ */const Ko=new Set(["children","localName","ref","style","className"]),pr=new WeakMap,fr=(s,e,t,i,n)=>{const r=n==null?void 0:n[e];r===void 0?(s[e]=t,t==null&&e in HTMLElement.prototype&&s.removeAttribute(e)):t!==i&&((a,l,d)=>{let p=pr.get(a);p===void 0&&pr.set(a,p=new Map);let m=p.get(l);d!==void 0?m===void 0?(p.set(l,m={handleEvent:d}),a.addEventListener(l,m)):m.handleEvent=d:m!==void 0&&(p.delete(l),a.removeEventListener(l,m))})(s,r,t)},It=({react:s,tagName:e,elementClass:t,events:i,displayName:n})=>{const r=new Set(Object.keys(i??{})),a=s.forwardRef(((l,d)=>{const p=s.useRef(new Map),m=s.useRef(null),b={},y={};for(const[k,g]of Object.entries(l))Ko.has(k)?b[k==="className"?"class":k]=g:r.has(k)||k in t.prototype?y[k]=g:b[k]=g;return s.useLayoutEffect((()=>{if(m.current===null)return;const k=new Map;for(const g in y)fr(m.current,g,l[g],p.current.get(g),i),p.current.delete(g),k.set(g,l[g]);for(const[g,$]of p.current)fr(m.current,g,void 0,$,i);p.current=k})),s.useLayoutEffect((()=>{var k;(k=m.current)==null||k.removeAttribute("defer-hydration")}),[]),b.suppressHydrationWarning=!0,s.createElement(e,{...b,ref:s.useCallback((k=>{m.current=k,typeof d=="function"?d(k):d!==null&&(d.current=k)}),[d])})}));return a.displayName=n??t.name,a};/**
41
41
  * @license
42
42
  * Copyright 2017 Google LLC
43
43
  * SPDX-License-Identifier: BSD-3-Clause
44
44
  */const Fi=globalThis,mr=s=>s,Hi=Fi.trustedTypes,gr=Hi?Hi.createPolicy("lit-html",{createHTML:s=>s}):void 0,vr="$lit$",Jt=`lit$${Math.random().toFixed(9).slice(2)}$`,br="?"+Jt,Go=`<${br}>`,us=document,ti=()=>us.createComment(""),si=s=>s===null||typeof s!="object"&&typeof s!="function",yn=Array.isArray,Xo=s=>yn(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",kn=`[
45
45
  \f\r]`,ii=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,yr=/-->/g,kr=/>/g,hs=RegExp(`>|${kn}(?:([^\\s"'>=/]+)(${kn}*=${kn}*(?:[^
46
- \f\r"'\`<>=]|("|')|))|$)`,"g"),_r=/'/g,$r=/"/g,wr=/^(?:script|style|textarea|title)$/i,Qo=s=>(e,...t)=>({_$litType$:s,strings:e,values:t}),b=Qo(1),gt=Symbol.for("lit-noChange"),w=Symbol.for("lit-nothing"),xr=new WeakMap,ps=us.createTreeWalker(us,129);function Sr(s,e){if(!yn(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return gr!==void 0?gr.createHTML(e):e}const Zo=(s,e)=>{const t=s.length-1,i=[];let n,r=e===2?"<svg>":e===3?"<math>":"",a=ii;for(let l=0;l<t;l++){const d=s[l];let p,m,v=-1,y=0;for(;y<d.length&&(a.lastIndex=y,m=a.exec(d),m!==null);)y=a.lastIndex,a===ii?m[1]==="!--"?a=yr:m[1]!==void 0?a=kr:m[2]!==void 0?(wr.test(m[2])&&(n=RegExp("</"+m[2],"g")),a=hs):m[3]!==void 0&&(a=hs):a===hs?m[0]===">"?(a=n??ii,v=-1):m[1]===void 0?v=-2:(v=a.lastIndex-m[2].length,p=m[1],a=m[3]===void 0?hs:m[3]==='"'?$r:_r):a===$r||a===_r?a=hs:a===yr||a===kr?a=ii:(a=hs,n=void 0);const k=a===hs&&s[l+1].startsWith("/>")?" ":"";r+=a===ii?d+Go:v>=0?(i.push(p),d.slice(0,v)+vr+d.slice(v)+Jt+k):d+Jt+(v===-2?l:k)}return[Sr(s,r+(s[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};let _n=class qo{constructor({strings:e,_$litType$:t},i){let n;this.parts=[];let r=0,a=0;const l=e.length-1,d=this.parts,[p,m]=Zo(e,t);if(this.el=qo.createElement(p,i),ps.currentNode=this.el.content,t===2||t===3){const v=this.el.content.firstChild;v.replaceWith(...v.childNodes)}for(;(n=ps.nextNode())!==null&&d.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(const v of n.getAttributeNames())if(v.endsWith(vr)){const y=m[a++],k=n.getAttribute(v).split(Jt),g=/([.?@])?(.*)/.exec(y);d.push({type:1,index:r,name:g[2],strings:k,ctor:g[1]==="."?Ro:g[1]==="?"?el:g[1]==="@"?tl:Ui}),n.removeAttribute(v)}else v.startsWith(Jt)&&(d.push({type:6,index:r}),n.removeAttribute(v));if(wr.test(n.tagName)){const v=n.textContent.split(Jt),y=v.length-1;if(y>0){n.textContent=Hi?Hi.emptyScript:"";for(let k=0;k<y;k++)n.append(v[k],ti()),ps.nextNode(),d.push({type:2,index:++r});n.append(v[y],ti())}}}else if(n.nodeType===8)if(n.data===br)d.push({type:2,index:r});else{let v=-1;for(;(v=n.data.indexOf(Jt,v+1))!==-1;)d.push({type:7,index:r}),v+=Jt.length-1}r++}}static createElement(e,t){const i=us.createElement("template");return i.innerHTML=e,i}};function Es(s,e,t=s,i){var n,r;if(e===gt)return e;let a=i!==void 0?(n=t._$Co)==null?void 0:n[i]:t._$Cl;const l=si(e)?void 0:e._$litDirective$;return(a==null?void 0:a.constructor)!==l&&((r=a==null?void 0:a._$AO)==null||r.call(a,!1),l===void 0?a=void 0:(a=new l(s),a._$AT(s,t,i)),i!==void 0?(t._$Co??(t._$Co=[]))[i]=a:t._$Cl=a),a!==void 0&&(e=Es(s,a._$AS(s,e.values),a,i)),e}let Jo=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:i}=this._$AD,n=((e==null?void 0:e.creationScope)??us).importNode(t,!0);ps.currentNode=n;let r=ps.nextNode(),a=0,l=0,d=i[0];for(;d!==void 0;){if(a===d.index){let p;d.type===2?p=new Vi(r,r.nextSibling,this,e):d.type===1?p=new d.ctor(r,d.name,d.strings,this,e):d.type===6&&(p=new sl(r,this,e)),this._$AV.push(p),d=i[++l]}a!==(d==null?void 0:d.index)&&(r=ps.nextNode(),a++)}return ps.currentNode=us,n}p(e){let t=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}},Vi=class Wo{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,i,n){this.type=2,this._$AH=w,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=n,this._$Cv=(n==null?void 0:n.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Es(this,e,t),si(e)?e===w||e==null||e===""?(this._$AH!==w&&this._$AR(),this._$AH=w):e!==this._$AH&&e!==gt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Xo(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==w&&si(this._$AH)?this._$AA.nextSibling.data=e:this.T(us.createTextNode(e)),this._$AH=e}$(e){var t;const{values:i,_$litType$:n}=e,r=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=_n.createElement(Sr(n.h,n.h[0]),this.options)),n);if(((t=this._$AH)==null?void 0:t._$AD)===r)this._$AH.p(i);else{const a=new Jo(r,this),l=a.u(this.options);a.p(i),this.T(l),this._$AH=a}}_$AC(e){let t=xr.get(e.strings);return t===void 0&&xr.set(e.strings,t=new _n(e)),t}k(e){yn(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,n=0;for(const r of e)n===t.length?t.push(i=new Wo(this.O(ti()),this.O(ti()),this,this.options)):i=t[n],i._$AI(r),n++;n<t.length&&(this._$AR(i&&i._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,t);e!==this._$AB;){const n=mr(e).nextSibling;mr(e).remove(),e=n}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},Ui=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,n,r){this.type=1,this._$AH=w,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=w}_$AI(e,t=this,i,n){const r=this.strings;let a=!1;if(r===void 0)e=Es(this,e,t,0),a=!si(e)||e!==this._$AH&&e!==gt,a&&(this._$AH=e);else{const l=e;let d,p;for(e=r[0],d=0;d<r.length-1;d++)p=Es(this,l[i+d],t,d),p===gt&&(p=this._$AH[d]),a||(a=!si(p)||p!==this._$AH[d]),p===w?e=w:e!==w&&(e+=(p??"")+r[d+1]),this._$AH[d]=p}a&&!n&&this.j(e)}j(e){e===w?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Ro=class extends Ui{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===w?void 0:e}},el=class extends Ui{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==w)}},tl=class extends Ui{constructor(e,t,i,n,r){super(e,t,i,n,r),this.type=5}_$AI(e,t=this){if((e=Es(this,e,t,0)??w)===gt)return;const i=this._$AH,n=e===w&&i!==w||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==w&&(i===w||n);n&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}},sl=class{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){Es(this,e)}};const il={I:Vi},Cr=Fi.litHtmlPolyfillSupport;Cr==null||Cr(_n,Vi),(Fi.litHtmlVersions??(Fi.litHtmlVersions=[])).push("3.3.2");const nl=(s,e,t)=>{const i=(t==null?void 0:t.renderBefore)??e;let n=i._$litPart$;if(n===void 0){const r=(t==null?void 0:t.renderBefore)??null;i._$litPart$=n=new Vi(e.insertBefore(ti(),r),r,void 0,t??{})}return n._$AI(s),n};/**
46
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),_r=/'/g,$r=/"/g,wr=/^(?:script|style|textarea|title)$/i,Qo=s=>(e,...t)=>({_$litType$:s,strings:e,values:t}),v=Qo(1),gt=Symbol.for("lit-noChange"),w=Symbol.for("lit-nothing"),xr=new WeakMap,ps=us.createTreeWalker(us,129);function Sr(s,e){if(!yn(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return gr!==void 0?gr.createHTML(e):e}const Zo=(s,e)=>{const t=s.length-1,i=[];let n,r=e===2?"<svg>":e===3?"<math>":"",a=ii;for(let l=0;l<t;l++){const d=s[l];let p,m,b=-1,y=0;for(;y<d.length&&(a.lastIndex=y,m=a.exec(d),m!==null);)y=a.lastIndex,a===ii?m[1]==="!--"?a=yr:m[1]!==void 0?a=kr:m[2]!==void 0?(wr.test(m[2])&&(n=RegExp("</"+m[2],"g")),a=hs):m[3]!==void 0&&(a=hs):a===hs?m[0]===">"?(a=n??ii,b=-1):m[1]===void 0?b=-2:(b=a.lastIndex-m[2].length,p=m[1],a=m[3]===void 0?hs:m[3]==='"'?$r:_r):a===$r||a===_r?a=hs:a===yr||a===kr?a=ii:(a=hs,n=void 0);const k=a===hs&&s[l+1].startsWith("/>")?" ":"";r+=a===ii?d+Go:b>=0?(i.push(p),d.slice(0,b)+vr+d.slice(b)+Jt+k):d+Jt+(b===-2?l:k)}return[Sr(s,r+(s[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};let _n=class qo{constructor({strings:e,_$litType$:t},i){let n;this.parts=[];let r=0,a=0;const l=e.length-1,d=this.parts,[p,m]=Zo(e,t);if(this.el=qo.createElement(p,i),ps.currentNode=this.el.content,t===2||t===3){const b=this.el.content.firstChild;b.replaceWith(...b.childNodes)}for(;(n=ps.nextNode())!==null&&d.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(const b of n.getAttributeNames())if(b.endsWith(vr)){const y=m[a++],k=n.getAttribute(b).split(Jt),g=/([.?@])?(.*)/.exec(y);d.push({type:1,index:r,name:g[2],strings:k,ctor:g[1]==="."?Ro:g[1]==="?"?el:g[1]==="@"?tl:Ui}),n.removeAttribute(b)}else b.startsWith(Jt)&&(d.push({type:6,index:r}),n.removeAttribute(b));if(wr.test(n.tagName)){const b=n.textContent.split(Jt),y=b.length-1;if(y>0){n.textContent=Hi?Hi.emptyScript:"";for(let k=0;k<y;k++)n.append(b[k],ti()),ps.nextNode(),d.push({type:2,index:++r});n.append(b[y],ti())}}}else if(n.nodeType===8)if(n.data===br)d.push({type:2,index:r});else{let b=-1;for(;(b=n.data.indexOf(Jt,b+1))!==-1;)d.push({type:7,index:r}),b+=Jt.length-1}r++}}static createElement(e,t){const i=us.createElement("template");return i.innerHTML=e,i}};function Es(s,e,t=s,i){var n,r;if(e===gt)return e;let a=i!==void 0?(n=t._$Co)==null?void 0:n[i]:t._$Cl;const l=si(e)?void 0:e._$litDirective$;return(a==null?void 0:a.constructor)!==l&&((r=a==null?void 0:a._$AO)==null||r.call(a,!1),l===void 0?a=void 0:(a=new l(s),a._$AT(s,t,i)),i!==void 0?(t._$Co??(t._$Co=[]))[i]=a:t._$Cl=a),a!==void 0&&(e=Es(s,a._$AS(s,e.values),a,i)),e}let Jo=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:i}=this._$AD,n=((e==null?void 0:e.creationScope)??us).importNode(t,!0);ps.currentNode=n;let r=ps.nextNode(),a=0,l=0,d=i[0];for(;d!==void 0;){if(a===d.index){let p;d.type===2?p=new Vi(r,r.nextSibling,this,e):d.type===1?p=new d.ctor(r,d.name,d.strings,this,e):d.type===6&&(p=new sl(r,this,e)),this._$AV.push(p),d=i[++l]}a!==(d==null?void 0:d.index)&&(r=ps.nextNode(),a++)}return ps.currentNode=us,n}p(e){let t=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}},Vi=class Wo{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,i,n){this.type=2,this._$AH=w,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=n,this._$Cv=(n==null?void 0:n.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Es(this,e,t),si(e)?e===w||e==null||e===""?(this._$AH!==w&&this._$AR(),this._$AH=w):e!==this._$AH&&e!==gt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Xo(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==w&&si(this._$AH)?this._$AA.nextSibling.data=e:this.T(us.createTextNode(e)),this._$AH=e}$(e){var t;const{values:i,_$litType$:n}=e,r=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=_n.createElement(Sr(n.h,n.h[0]),this.options)),n);if(((t=this._$AH)==null?void 0:t._$AD)===r)this._$AH.p(i);else{const a=new Jo(r,this),l=a.u(this.options);a.p(i),this.T(l),this._$AH=a}}_$AC(e){let t=xr.get(e.strings);return t===void 0&&xr.set(e.strings,t=new _n(e)),t}k(e){yn(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,n=0;for(const r of e)n===t.length?t.push(i=new Wo(this.O(ti()),this.O(ti()),this,this.options)):i=t[n],i._$AI(r),n++;n<t.length&&(this._$AR(i&&i._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,t);e!==this._$AB;){const n=mr(e).nextSibling;mr(e).remove(),e=n}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},Ui=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,n,r){this.type=1,this._$AH=w,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=w}_$AI(e,t=this,i,n){const r=this.strings;let a=!1;if(r===void 0)e=Es(this,e,t,0),a=!si(e)||e!==this._$AH&&e!==gt,a&&(this._$AH=e);else{const l=e;let d,p;for(e=r[0],d=0;d<r.length-1;d++)p=Es(this,l[i+d],t,d),p===gt&&(p=this._$AH[d]),a||(a=!si(p)||p!==this._$AH[d]),p===w?e=w:e!==w&&(e+=(p??"")+r[d+1]),this._$AH[d]=p}a&&!n&&this.j(e)}j(e){e===w?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Ro=class extends Ui{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===w?void 0:e}},el=class extends Ui{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==w)}},tl=class extends Ui{constructor(e,t,i,n,r){super(e,t,i,n,r),this.type=5}_$AI(e,t=this){if((e=Es(this,e,t,0)??w)===gt)return;const i=this._$AH,n=e===w&&i!==w||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==w&&(i===w||n);n&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}},sl=class{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){Es(this,e)}};const il={I:Vi},Cr=Fi.litHtmlPolyfillSupport;Cr==null||Cr(_n,Vi),(Fi.litHtmlVersions??(Fi.litHtmlVersions=[])).push("3.3.2");const nl=(s,e,t)=>{const i=(t==null?void 0:t.renderBefore)??e;let n=i._$litPart$;if(n===void 0){const r=(t==null?void 0:t.renderBefore)??null;i._$litPart$=n=new Vi(e.insertBefore(ti(),r),r,void 0,t??{})}return n._$AI(s),n};/**
47
47
  * @license
48
48
  * Copyright 2017 Google LLC
49
49
  * SPDX-License-Identifier: BSD-3-Clause
@@ -95,11 +95,11 @@
95
95
  * @license
96
96
  * Copyright 2017 Google LLC
97
97
  * SPDX-License-Identifier: BSD-3-Clause
98
- */let Tn=class extends Yi{};Tn.directiveName="unsafeSVG",Tn.resultType=2;const Nn=fs(Tn);var El=Object.defineProperty,Pl=Object.getOwnPropertyDescriptor,ci=(s,e,t,i)=>{for(var n=i>1?void 0:i?Pl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&El(e,t,n),n};const Mn="https://punkt-cdn.oslo.kommune.no/15.4/icons/";typeof window<"u"&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||Mn);const di='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',ui={},Al=2,Il=1500,qr=typeof Storage<"u"&&typeof sessionStorage<"u",Ll=s=>window.pktFetch(s).then(e=>{if(!e.ok)throw new Error("Missing icon: "+s);return e.text()}),Wr=async(s,e=Al)=>{try{return await Ll(s)}catch{return e>0?(await new Promise(t=>setTimeout(t,Il)),Wr(s,e-1)):(console.error("Failed to fetch icon: "+s),di)}},Bl=async(s,e)=>{const t=e+s+".svg";return qr&&sessionStorage.getItem(t)?sessionStorage.getItem(t):t in ui?ui[t]:typeof window<"u"&&typeof window.pktFetch=="function"?(ui[t]=Wr(t).then(i=>(i!==di&&qr&&sessionStorage.setItem(t,i),delete ui[t],i)),ui[t]):di};let gs=class extends ke{constructor(){super(...arguments),this.path=typeof window<"u"?window.pktIconPath:Mn,this.name="",this.icon=Nn(di),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),(e==="name"||e==="path")&&this.getIcon(this.name)}async updated(e){super.updated(e),(e.has("name")||e.has("path"))&&this.getIcon(this.name)}async getIcon(e=""){if(this._updatedProps.length>0){this.path||(this.path=typeof window<"u"?window.pktIconPath:Mn);try{this.icon=Nn(await Bl(this.name||"",this.path))}catch{this.icon=Nn(di)}this._updatedProps=[]}else this._updatedProps.includes(e)||this._updatedProps.push(e)}render(){return b`${this.name&&this.icon}`}};ci([c({type:String,reflect:!1})],gs.prototype,"path",2),ci([c({type:String,reflect:!0})],gs.prototype,"name",2),ci([c({type:SVGElement})],gs.prototype,"icon",2),ci([c({type:Array,noAccessor:!0})],gs.prototype,"_updatedProps",2),gs=ci([ee("pkt-icon")],gs);/**
98
+ */let Tn=class extends Yi{};Tn.directiveName="unsafeSVG",Tn.resultType=2;const Nn=fs(Tn);var El=Object.defineProperty,Pl=Object.getOwnPropertyDescriptor,ci=(s,e,t,i)=>{for(var n=i>1?void 0:i?Pl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&El(e,t,n),n};const Mn="https://punkt-cdn.oslo.kommune.no/15.4/icons/";typeof window<"u"&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||Mn);const di='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',ui={},Al=2,Il=1500,qr=typeof Storage<"u"&&typeof sessionStorage<"u",Ll=s=>window.pktFetch(s).then(e=>{if(!e.ok)throw new Error("Missing icon: "+s);return e.text()}),Wr=async(s,e=Al)=>{try{return await Ll(s)}catch{return e>0?(await new Promise(t=>setTimeout(t,Il)),Wr(s,e-1)):(console.error("Failed to fetch icon: "+s),di)}},Bl=async(s,e)=>{const t=e+s+".svg";return qr&&sessionStorage.getItem(t)?sessionStorage.getItem(t):t in ui?ui[t]:typeof window<"u"&&typeof window.pktFetch=="function"?(ui[t]=Wr(t).then(i=>(i!==di&&qr&&sessionStorage.setItem(t,i),delete ui[t],i)),ui[t]):di};let gs=class extends ke{constructor(){super(...arguments),this.path=typeof window<"u"?window.pktIconPath:Mn,this.name="",this.icon=Nn(di),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),(e==="name"||e==="path")&&this.getIcon(this.name)}async updated(e){super.updated(e),(e.has("name")||e.has("path"))&&this.getIcon(this.name)}async getIcon(e=""){if(this._updatedProps.length>0){this.path||(this.path=typeof window<"u"?window.pktIconPath:Mn);try{this.icon=Nn(await Bl(this.name||"",this.path))}catch{this.icon=Nn(di)}this._updatedProps=[]}else this._updatedProps.includes(e)||this._updatedProps.push(e)}render(){return v`${this.name&&this.icon}`}};ci([c({type:String,reflect:!1})],gs.prototype,"path",2),ci([c({type:String,reflect:!0})],gs.prototype,"name",2),ci([c({type:SVGElement})],gs.prototype,"icon",2),ci([c({type:Array,noAccessor:!0})],gs.prototype,"_updatedProps",2),gs=ci([ee("pkt-icon")],gs);/**
99
99
  * @license
100
100
  * Copyright 2018 Google LLC
101
101
  * SPDX-License-Identifier: BSD-3-Clause
102
- */const P=s=>s??w;var Fl=Object.defineProperty,Hl=Object.getOwnPropertyDescriptor,Je=(s,e,t,i)=>{for(var n=i>1?void 0:i?Hl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Fl(e,t,n),n};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/15.4/animations/";let je=class extends ke{constructor(){super(),this.defaultSlot=B(),this.iconName="user",this.secondIconName="user",this.mode="light",this.size="medium",this.fullWidth=!1,this.fullWidthOnMobile=!1,this.skin="primary",this.variant="label-only",this.state="normal",this.type="button",this.form=void 0,this.isLoading=!1,this.disabled=!1,this.loadingAnimationPath=window.pktAnimationPath,this.slotController=new Le(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this.addEventListener("click",e=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(e.preventDefault(),e.stopImmediatePropagation())},!0),this.addEventListener("keydown",e=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopImmediatePropagation())},!0)}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),e==="disabled"&&i==="false"&&(this.disabled=!1),(e==="isloading"||e==="isLoading")&&i==="false"&&(this.isLoading=!1)}firstUpdated(e){super.firstUpdated(e),this.disabled==="false"&&(this.disabled=!1),this.isLoading==="false"&&(this.isLoading=!1)}render(){const e=this.form??this.getAttribute("form")??void 0,t={"pkt-btn":!0,[`pkt-btn--${this.size}`]:!!this.size,[`pkt-btn--${this.skin}`]:!!this.skin,[`pkt-btn--${this.variant}`]:!!this.variant,[`pkt-btn--${this.color}`]:!!this.color,[`pkt-btn--${this.state}`]:!!this.state,"pkt-btn--full":!!this.fullWidth,"pkt-btn--full-small":!!this.fullWidthOnMobile,"pkt-btn--disabled":!!this.disabled,"pkt-btn--isLoading":!!this.isLoading};return b`
102
+ */const P=s=>s??w;var Fl=Object.defineProperty,Hl=Object.getOwnPropertyDescriptor,Je=(s,e,t,i)=>{for(var n=i>1?void 0:i?Hl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Fl(e,t,n),n};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/15.4/animations/";let je=class extends ke{constructor(){super(),this.defaultSlot=B(),this.iconName="user",this.secondIconName="user",this.mode="light",this.size="medium",this.fullWidth=!1,this.fullWidthOnMobile=!1,this.skin="primary",this.variant="label-only",this.state="normal",this.type="button",this.form=void 0,this.isLoading=!1,this.disabled=!1,this.loadingAnimationPath=window.pktAnimationPath,this.slotController=new Le(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this.addEventListener("click",e=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(e.preventDefault(),e.stopImmediatePropagation())},!0),this.addEventListener("keydown",e=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopImmediatePropagation())},!0)}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),e==="disabled"&&i==="false"&&(this.disabled=!1),(e==="isloading"||e==="isLoading")&&i==="false"&&(this.isLoading=!1)}firstUpdated(e){super.firstUpdated(e),this.disabled==="false"&&(this.disabled=!1),this.isLoading==="false"&&(this.isLoading=!1)}render(){const e=this.form??this.getAttribute("form")??void 0,t={"pkt-btn":!0,[`pkt-btn--${this.size}`]:!!this.size,[`pkt-btn--${this.skin}`]:!!this.skin,[`pkt-btn--${this.variant}`]:!!this.variant,[`pkt-btn--${this.color}`]:!!this.color,[`pkt-btn--${this.state}`]:!!this.state,"pkt-btn--full":!!this.fullWidth,"pkt-btn--full-small":!!this.fullWidthOnMobile,"pkt-btn--disabled":!!this.disabled,"pkt-btn--isLoading":!!this.isLoading};return v`
103
103
  <button
104
104
  class=${I(t)}
105
105
  type=${this.type}
@@ -108,24 +108,24 @@
108
108
  aria-disabled=${P(this.disabled||this.isLoading?"true":void 0)}
109
109
  form=${P(e)}
110
110
  >
111
- ${this.isLoading?b`<pkt-icon
111
+ ${this.isLoading?v`<pkt-icon
112
112
  class="pkt-btn__icon pkt-btn__spinner"
113
113
  name="spinner-blue"
114
114
  path=${P(this.loadingAnimationPath)}
115
115
  ></pkt-icon>`:w}
116
- ${this.variant!=="label-only"?b`<pkt-icon
116
+ ${this.variant!=="label-only"?v`<pkt-icon
117
117
  class="pkt-btn__icon pkt-icon"
118
118
  name=${this.iconName}
119
119
  path=${P(this.iconPath)}
120
120
  ></pkt-icon>`:w}
121
121
  <span class="pkt-btn__text" ${F(this.defaultSlot)}></span>
122
- ${this.variant==="icons-right-and-left"?b`<pkt-icon
122
+ ${this.variant==="icons-right-and-left"?v`<pkt-icon
123
123
  class="pkt-btn__icon"
124
124
  name=${this.secondIconName}
125
125
  path=${P(this.secondIconPath)}
126
126
  ></pkt-icon>`:w}
127
127
  </button>
128
- `}};Je([c({type:String})],je.prototype,"iconName",2),Je([c({type:String})],je.prototype,"secondIconName",2),Je([c({type:String})],je.prototype,"iconPath",2),Je([c({type:String})],je.prototype,"secondIconPath",2),Je([c({type:String})],je.prototype,"mode",2),Je([c({type:String})],je.prototype,"size",2),Je([c({type:Boolean,attribute:"full-width"})],je.prototype,"fullWidth",2),Je([c({type:Boolean,attribute:"full-width-on-mobile"})],je.prototype,"fullWidthOnMobile",2),Je([c({type:String})],je.prototype,"color",2),Je([c({type:String})],je.prototype,"skin",2),Je([c({type:String})],je.prototype,"variant",2),Je([c({type:String,reflect:!0})],je.prototype,"state",2),Je([c({type:String,reflect:!0})],je.prototype,"type",2),Je([c({type:String})],je.prototype,"form",2),Je([c({type:Boolean,reflect:!0})],je.prototype,"isLoading",2),Je([c({type:Boolean,reflect:!0})],je.prototype,"disabled",2),Je([c({type:String})],je.prototype,"loadingAnimationPath",2),je=Je([ee("pkt-button")],je);const Vl={skin:{default:"info"},ariaLive:{default:"polite"},compact:{default:!1},closeAlert:{default:!1}},Gi={props:Vl};var Ul=Object.defineProperty,jl=Object.getOwnPropertyDescriptor,Lt=(s,e,t,i)=>{for(var n=i>1?void 0:i?jl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Ul(e,t,n),n};let Dt=class extends ke{constructor(){super(),this.defaultSlot=B(),this.compact=Gi.props.compact.default,this.title="",this.skin=Gi.props.skin.default,this.ariaLive=Gi.props.ariaLive.default,this["aria-live"]=null,this.closeAlert=Gi.props.closeAlert.default,this.date=null,this.role="status",this._isClosed=!1,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:e},bubbles:!0,composed:!0}))},this.slotController=new Le(this,this.defaultSlot),this._isClosed=!1}connectedCallback(){super.connectedCallback(),this["aria-live"]=this.getAttribute("aria-live")||this.ariaLive}attributeChangedCallback(e,t,i){e==="ariaLive"&&(this["aria-live"]=i),super.attributeChangedCallback(e,t,i)}updated(e){super.updated(e),e.has("ariaLive")&&(this["aria-live"]=this.ariaLive),e.has("_isClosed")&&jr(this,"pkt-hide",this._isClosed)}render(){const e={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-hide":this._isClosed},t={"pkt-alert__grid":!0,"pkt-alert__noTitle":!this.title,"pkt-alert__noDate":!this.date};return b`
128
+ `}};Je([c({type:String})],je.prototype,"iconName",2),Je([c({type:String})],je.prototype,"secondIconName",2),Je([c({type:String})],je.prototype,"iconPath",2),Je([c({type:String})],je.prototype,"secondIconPath",2),Je([c({type:String})],je.prototype,"mode",2),Je([c({type:String})],je.prototype,"size",2),Je([c({type:Boolean,attribute:"full-width"})],je.prototype,"fullWidth",2),Je([c({type:Boolean,attribute:"full-width-on-mobile"})],je.prototype,"fullWidthOnMobile",2),Je([c({type:String})],je.prototype,"color",2),Je([c({type:String})],je.prototype,"skin",2),Je([c({type:String})],je.prototype,"variant",2),Je([c({type:String,reflect:!0})],je.prototype,"state",2),Je([c({type:String,reflect:!0})],je.prototype,"type",2),Je([c({type:String})],je.prototype,"form",2),Je([c({type:Boolean,reflect:!0})],je.prototype,"isLoading",2),Je([c({type:Boolean,reflect:!0})],je.prototype,"disabled",2),Je([c({type:String})],je.prototype,"loadingAnimationPath",2),je=Je([ee("pkt-button")],je);const Vl={skin:{default:"info"},ariaLive:{default:"polite"},compact:{default:!1},closeAlert:{default:!1}},Gi={props:Vl};var Ul=Object.defineProperty,jl=Object.getOwnPropertyDescriptor,Lt=(s,e,t,i)=>{for(var n=i>1?void 0:i?jl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Ul(e,t,n),n};let Dt=class extends ke{constructor(){super(),this.defaultSlot=B(),this.compact=Gi.props.compact.default,this.title="",this.skin=Gi.props.skin.default,this.ariaLive=Gi.props.ariaLive.default,this["aria-live"]=null,this.closeAlert=Gi.props.closeAlert.default,this.date=null,this.role="status",this._isClosed=!1,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:e},bubbles:!0,composed:!0}))},this.slotController=new Le(this,this.defaultSlot),this._isClosed=!1}connectedCallback(){super.connectedCallback(),this["aria-live"]=this.getAttribute("aria-live")||this.ariaLive}attributeChangedCallback(e,t,i){e==="ariaLive"&&(this["aria-live"]=i),super.attributeChangedCallback(e,t,i)}updated(e){super.updated(e),e.has("ariaLive")&&(this["aria-live"]=this.ariaLive),e.has("_isClosed")&&jr(this,"pkt-hide",this._isClosed)}render(){const e={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-hide":this._isClosed},t={"pkt-alert__grid":!0,"pkt-alert__noTitle":!this.title,"pkt-alert__noDate":!this.date};return v`
129
129
  <div class=${I(e)} aria-live=${this["aria-live"]}>
130
130
  <div class=${I(t)}>
131
131
  <pkt-icon
@@ -134,7 +134,7 @@
134
134
  name=${this.skin==="info"?"alert-information":`alert-${this.skin}`}
135
135
  ></pkt-icon>
136
136
 
137
- ${this.closeAlert?b`
137
+ ${this.closeAlert?v`
138
138
  <div class="pkt-alert__close">
139
139
  <pkt-button
140
140
  tabindex="0"
@@ -150,14 +150,14 @@
150
150
  </pkt-button>
151
151
  </div>
152
152
  `:w}
153
- ${this.title?b`<div class="pkt-alert__title">${this.title}</div>`:w}
153
+ ${this.title?v`<div class="pkt-alert__title">${this.title}</div>`:w}
154
154
 
155
155
  <div class="pkt-alert__text" ${F(this.defaultSlot)}></div>
156
156
 
157
- ${this.date?b`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>`:w}
157
+ ${this.date?v`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>`:w}
158
158
  </div>
159
159
  </div>
160
- `}};Lt([c({type:Boolean,reflect:!1})],Dt.prototype,"compact",2),Lt([c({type:String,reflect:!0})],Dt.prototype,"title",2),Lt([c({type:String,reflect:!0})],Dt.prototype,"skin",2),Lt([c({type:String})],Dt.prototype,"ariaLive",2),Lt([c({type:String,reflect:!0})],Dt.prototype,"aria-live",2),Lt([c({type:Boolean,reflect:!0})],Dt.prototype,"closeAlert",2),Lt([c({type:String,reflect:!0})],Dt.prototype,"date",2),Lt([c({type:String,reflect:!0})],Dt.prototype,"role",2),Lt([Z()],Dt.prototype,"_isClosed",2),Dt=Lt([ee("pkt-alert")],Dt);var ql=Object.defineProperty,Wl=Object.getOwnPropertyDescriptor,hi=(s,e,t,i)=>{for(var n=i>1?void 0:i?Wl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&ql(e,t,n),n};let Fs=class extends Is{constructor(){super(...arguments),this.ariaLabelledBy="",this.compact=!1,this.skin="borderless",this.name=""}updated(e){e.has("skin")&&this.requestUpdate(),e.has("name")&&this.updateAccordionItemNames()}updateAccordionItemNames(){var e;if(this.name){const t=(e=this.renderRoot)==null?void 0:e.querySelector("slot");t&&t.assignedElements().forEach(i=>{i.tagName.toLowerCase()==="pkt-accordion-item"&&(i.hasAttribute("name")||i.setAttribute("name",this.name))})}}firstUpdated(){var e;const t=(e=this.renderRoot)==null?void 0:e.querySelector("slot");t&&t.addEventListener("slotchange",()=>{this.updateAccordionItemNames()})}render(){const e={"pkt-accordion":!0,"pkt-accordion--compact":this.compact,[`pkt-accordion--${this.skin}`]:this.skin};return b`
160
+ `}};Lt([c({type:Boolean,reflect:!1})],Dt.prototype,"compact",2),Lt([c({type:String,reflect:!0})],Dt.prototype,"title",2),Lt([c({type:String,reflect:!0})],Dt.prototype,"skin",2),Lt([c({type:String})],Dt.prototype,"ariaLive",2),Lt([c({type:String,reflect:!0})],Dt.prototype,"aria-live",2),Lt([c({type:Boolean,reflect:!0})],Dt.prototype,"closeAlert",2),Lt([c({type:String,reflect:!0})],Dt.prototype,"date",2),Lt([c({type:String,reflect:!0})],Dt.prototype,"role",2),Lt([Z()],Dt.prototype,"_isClosed",2),Dt=Lt([ee("pkt-alert")],Dt);var ql=Object.defineProperty,Wl=Object.getOwnPropertyDescriptor,hi=(s,e,t,i)=>{for(var n=i>1?void 0:i?Wl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&ql(e,t,n),n};let Fs=class extends Is{constructor(){super(...arguments),this.ariaLabelledBy="",this.compact=!1,this.skin="borderless",this.name=""}updated(e){e.has("skin")&&this.requestUpdate(),e.has("name")&&this.updateAccordionItemNames()}updateAccordionItemNames(){var e;if(this.name){const t=(e=this.renderRoot)==null?void 0:e.querySelector("slot");t&&t.assignedElements().forEach(i=>{i.tagName.toLowerCase()==="pkt-accordion-item"&&(i.hasAttribute("name")||i.setAttribute("name",this.name))})}}firstUpdated(){var e;const t=(e=this.renderRoot)==null?void 0:e.querySelector("slot");t&&t.addEventListener("slotchange",()=>{this.updateAccordionItemNames()})}render(){const e={"pkt-accordion":!0,"pkt-accordion--compact":this.compact,[`pkt-accordion--${this.skin}`]:this.skin};return v`
161
161
  <div
162
162
  part="container"
163
163
  class=${I(e)}
@@ -166,7 +166,7 @@
166
166
  >
167
167
  <slot></slot>
168
168
  </div>
169
- `}};hi([c({type:String,reflect:!0,attribute:"aria-labelledby"})],Fs.prototype,"ariaLabelledBy",2),hi([c({type:Boolean,reflect:!0,attribute:"compact"})],Fs.prototype,"compact",2),hi([c({type:String,reflect:!0,attribute:"skin"})],Fs.prototype,"skin",2),hi([c({type:String,reflect:!0,attribute:"name"})],Fs.prototype,"name",2),Fs=hi([ee("pkt-accordion")],Fs);var zl=Object.defineProperty,Yl=Object.getOwnPropertyDescriptor,vs=(s,e,t,i)=>{for(var n=i>1?void 0:i?Yl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&zl(e,t,n),n};let Rt=class extends ke{constructor(){super(),this.defaultOpen=!1,this.title="",this.skin=void 0,this.compact=!1,this.isOpen=!1,this.name=void 0,this.accordionItemRef=B(),this.defaultSlot=B(),this.slotController=new Le(this,this.defaultSlot)}firstUpdated(e){this.defaultOpen&&(this.isOpen=!0)}render(){const e={"pkt-accordion-item":!0,"pkt-accordion-item--compact":this.compact,[`pkt-accordion-item--${this.skin}`]:!!this.skin};return b`
169
+ `}};hi([c({type:String,reflect:!0,attribute:"aria-labelledby"})],Fs.prototype,"ariaLabelledBy",2),hi([c({type:Boolean,reflect:!0,attribute:"compact"})],Fs.prototype,"compact",2),hi([c({type:String,reflect:!0,attribute:"skin"})],Fs.prototype,"skin",2),hi([c({type:String,reflect:!0,attribute:"name"})],Fs.prototype,"name",2),Fs=hi([ee("pkt-accordion")],Fs);var zl=Object.defineProperty,Yl=Object.getOwnPropertyDescriptor,vs=(s,e,t,i)=>{for(var n=i>1?void 0:i?Yl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&zl(e,t,n),n};let Rt=class extends ke{constructor(){super(),this.defaultOpen=!1,this.title="",this.skin=void 0,this.compact=!1,this.isOpen=!1,this.name=void 0,this.accordionItemRef=B(),this.defaultSlot=B(),this.slotController=new Le(this,this.defaultSlot)}firstUpdated(e){this.defaultOpen&&(this.isOpen=!0)}render(){const e={"pkt-accordion-item":!0,"pkt-accordion-item--compact":this.compact,[`pkt-accordion-item--${this.skin}`]:!!this.skin};return v`
170
170
  <details
171
171
  class=${I(e)}
172
172
  id=${this.id}
@@ -190,7 +190,7 @@
190
190
  <div class="pkt-accordion-item__content-inner" ${F(this.defaultSlot)}></div>
191
191
  </div>
192
192
  </details>
193
- `}};vs([c({type:Boolean})],Rt.prototype,"defaultOpen",2),vs([c({type:String})],Rt.prototype,"title",2),vs([c({type:String,reflect:!0})],Rt.prototype,"skin",2),vs([c({type:Boolean,reflect:!0})],Rt.prototype,"compact",2),vs([c({type:Boolean,reflect:!0})],Rt.prototype,"isOpen",2),vs([c({type:String,reflect:!0})],Rt.prototype,"name",2),Rt=vs([ee("pkt-accordion-item")],Rt);var Kl=Object.defineProperty,Gl=Object.getOwnPropertyDescriptor,Xi=(s,e,t,i)=>{for(var n=i>1?void 0:i?Gl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Kl(e,t,n),n};let Hs=class extends ke{constructor(){super(...arguments),this.href="",this.text="Forsiden",this.ariaLabel=""}attributeChangedCallback(e,t,i){e==="arialabel"&&this.removeAttribute("arialabel"),e==="href"&&this.removeAttribute("href"),e==="text"&&this.removeAttribute("text"),super.attributeChangedCallback(e,t,i)}render(){return b`<nav
193
+ `}};vs([c({type:Boolean})],Rt.prototype,"defaultOpen",2),vs([c({type:String})],Rt.prototype,"title",2),vs([c({type:String,reflect:!0})],Rt.prototype,"skin",2),vs([c({type:Boolean,reflect:!0})],Rt.prototype,"compact",2),vs([c({type:Boolean,reflect:!0})],Rt.prototype,"isOpen",2),vs([c({type:String,reflect:!0})],Rt.prototype,"name",2),Rt=vs([ee("pkt-accordion-item")],Rt);var Kl=Object.defineProperty,Gl=Object.getOwnPropertyDescriptor,Xi=(s,e,t,i)=>{for(var n=i>1?void 0:i?Gl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Kl(e,t,n),n};let Hs=class extends ke{constructor(){super(...arguments),this.href="",this.text="Forsiden",this.ariaLabel=""}attributeChangedCallback(e,t,i){e==="arialabel"&&this.removeAttribute("arialabel"),e==="href"&&this.removeAttribute("href"),e==="text"&&this.removeAttribute("text"),super.attributeChangedCallback(e,t,i)}render(){return v`<nav
194
194
  class="pkt-back-link"
195
195
  aria-label=${this.ariaLabel||"Gå tilbake til forrige side"}
196
196
  >
@@ -202,7 +202,7 @@
202
202
  ></pkt-icon
203
203
  ><span class="pkt-back-link__text">${this.text}</span></a
204
204
  >
205
- </nav>`}};Xi([c({type:String})],Hs.prototype,"href",2),Xi([c({type:String})],Hs.prototype,"text",2),Xi([c({type:String})],Hs.prototype,"ariaLabel",2),Hs=Xi([ee("pkt-backlink")],Hs);const zr=6048e5,Xl=864e5,Yr=Symbol.for("constructDateFrom");function Bt(s,e){return typeof s=="function"?s(e):s&&typeof s=="object"&&Yr in s?s[Yr](e):s instanceof Date?new s.constructor(e):new Date(e)}function $t(s,e){return Bt(e||s,s)}function Kr(s,e,t){const i=$t(s,void 0);return isNaN(e)?Bt(s,NaN):(e&&i.setDate(i.getDate()+e),i)}let Ql={};function Qi(){return Ql}function pi(s,e){var t,i,n,r;const a=Qi(),l=(e==null?void 0:e.weekStartsOn)??((i=(t=e==null?void 0:e.locale)==null?void 0:t.options)==null?void 0:i.weekStartsOn)??a.weekStartsOn??((r=(n=a.locale)==null?void 0:n.options)==null?void 0:r.weekStartsOn)??0,d=$t(s,e==null?void 0:e.in),p=d.getDay(),m=(p<l?7:0)+p-l;return d.setDate(d.getDate()-m),d.setHours(0,0,0,0),d}function Zi(s,e){return pi(s,{...e,weekStartsOn:1})}function Gr(s,e){const t=$t(s,void 0),i=t.getFullYear(),n=Bt(t,0);n.setFullYear(i+1,0,4),n.setHours(0,0,0,0);const r=Zi(n),a=Bt(t,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=Zi(a);return t.getTime()>=r.getTime()?i+1:t.getTime()>=l.getTime()?i:i-1}function Xr(s){const e=$t(s),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+s-+t}function Qr(s,...e){const t=Bt.bind(null,e.find(i=>typeof i=="object"));return e.map(t)}function Zr(s,e){const t=$t(s,void 0);return t.setHours(0,0,0,0),t}function Zl(s,e,t){const[i,n]=Qr(void 0,s,e),r=Zr(i),a=Zr(n),l=+r-Xr(r),d=+a-Xr(a);return Math.round((l-d)/Xl)}function Jl(s,e){const t=Gr(s),i=Bt(s,0);return i.setFullYear(t,0,4),i.setHours(0,0,0,0),Zi(i)}function Rl(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function ec(s){return!(!Rl(s)&&typeof s!="number"||isNaN(+$t(s)))}function tc(s,e){const[t,i]=Qr(s,e.start,e.end);return{start:t,end:i}}function Jr(s,e){const{start:t,end:i}=tc(void 0,s);let n=+t>+i;const r=n?+t:+i,a=n?i:t;a.setHours(0,0,0,0);let l=1;const d=[];for(;+a<=r;)d.push(Bt(t,a)),a.setDate(a.getDate()+l),a.setHours(0,0,0,0);return n?d.reverse():d}function sc(s,e){const t=$t(s,void 0);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}const ic={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},nc=(s,e,t)=>{let i;const n=ic[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+i:i+" ago":i};function Dn(s){return(e={})=>{const t=e.width?String(e.width):s.defaultWidth;return s.formats[t]||s.formats[s.defaultWidth]}}const rc={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ac={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},oc={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},lc={date:Dn({formats:rc,defaultWidth:"full"}),time:Dn({formats:ac,defaultWidth:"full"}),dateTime:Dn({formats:oc,defaultWidth:"full"})},cc={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},dc=(s,e,t,i)=>cc[s];function fi(s){return(e,t)=>{const i=t!=null&&t.context?String(t.context):"standalone";let n;if(i==="formatting"&&s.formattingValues){const a=s.defaultFormattingWidth||s.defaultWidth,l=t!=null&&t.width?String(t.width):a;n=s.formattingValues[l]||s.formattingValues[a]}else{const a=s.defaultWidth,l=t!=null&&t.width?String(t.width):s.defaultWidth;n=s.values[l]||s.values[a]}const r=s.argumentCallback?s.argumentCallback(e):e;return n[r]}}const uc={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},hc={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},pc={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},fc={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},mc={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},gc={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},vc=(s,e)=>{const t=Number(s),i=t%100;if(i>20||i<10)switch(i%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},bc={ordinalNumber:vc,era:fi({values:uc,defaultWidth:"wide"}),quarter:fi({values:hc,defaultWidth:"wide",argumentCallback:s=>s-1}),month:fi({values:pc,defaultWidth:"wide"}),day:fi({values:fc,defaultWidth:"wide"}),dayPeriod:fi({values:mc,defaultWidth:"wide",formattingValues:gc,defaultFormattingWidth:"wide"})};function mi(s){return(e,t={})=>{const i=t.width,n=i&&s.matchPatterns[i]||s.matchPatterns[s.defaultMatchWidth],r=e.match(n);if(!r)return null;const a=r[0],l=i&&s.parsePatterns[i]||s.parsePatterns[s.defaultParseWidth],d=Array.isArray(l)?kc(l,v=>v.test(a)):yc(l,v=>v.test(a));let p;p=s.valueCallback?s.valueCallback(d):d,p=t.valueCallback?t.valueCallback(p):p;const m=e.slice(a.length);return{value:p,rest:m}}}function yc(s,e){for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t)&&e(s[t]))return t}function kc(s,e){for(let t=0;t<s.length;t++)if(e(s[t]))return t}function _c(s){return(e,t={})=>{const i=e.match(s.matchPattern);if(!i)return null;const n=i[0],r=e.match(s.parsePattern);if(!r)return null;let a=s.valueCallback?s.valueCallback(r[0]):r[0];a=t.valueCallback?t.valueCallback(a):a;const l=e.slice(n.length);return{value:a,rest:l}}}const $c=/^(\d+)(th|st|nd|rd)?/i,wc=/\d+/i,xc={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Sc={any:[/^b/i,/^(a|c)/i]},Cc={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Tc={any:[/1/i,/2/i,/3/i,/4/i]},Nc={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Mc={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Dc={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Oc={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ec={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Pc={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Ac={ordinalNumber:_c({matchPattern:$c,parsePattern:wc,valueCallback:s=>parseInt(s,10)}),era:mi({matchPatterns:xc,defaultMatchWidth:"wide",parsePatterns:Sc,defaultParseWidth:"any"}),quarter:mi({matchPatterns:Cc,defaultMatchWidth:"wide",parsePatterns:Tc,defaultParseWidth:"any",valueCallback:s=>s+1}),month:mi({matchPatterns:Nc,defaultMatchWidth:"wide",parsePatterns:Mc,defaultParseWidth:"any"}),day:mi({matchPatterns:Dc,defaultMatchWidth:"wide",parsePatterns:Oc,defaultParseWidth:"any"}),dayPeriod:mi({matchPatterns:Ec,defaultMatchWidth:"any",parsePatterns:Pc,defaultParseWidth:"any"})},Ic={code:"en-US",formatDistance:nc,formatLong:lc,formatRelative:dc,localize:bc,match:Ac,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Lc(s,e){const t=$t(s,void 0);return Zl(t,sc(t))+1}function Bc(s,e){const t=$t(s,void 0),i=+Zi(t)-+Jl(t);return Math.round(i/zr)+1}function Rr(s,e){var t,i,n,r;const a=$t(s,e==null?void 0:e.in),l=a.getFullYear(),d=Qi(),p=(e==null?void 0:e.firstWeekContainsDate)??((i=(t=e==null?void 0:e.locale)==null?void 0:t.options)==null?void 0:i.firstWeekContainsDate)??d.firstWeekContainsDate??((r=(n=d.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??1,m=Bt((e==null?void 0:e.in)||s,0);m.setFullYear(l+1,0,p),m.setHours(0,0,0,0);const v=pi(m,e),y=Bt((e==null?void 0:e.in)||s,0);y.setFullYear(l,0,p),y.setHours(0,0,0,0);const k=pi(y,e);return+a>=+v?l+1:+a>=+k?l:l-1}function Fc(s,e){var t,i,n,r;const a=Qi(),l=(e==null?void 0:e.firstWeekContainsDate)??((i=(t=e==null?void 0:e.locale)==null?void 0:t.options)==null?void 0:i.firstWeekContainsDate)??a.firstWeekContainsDate??((r=(n=a.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??1,d=Rr(s,e),p=Bt((e==null?void 0:e.in)||s,0);return p.setFullYear(d,0,l),p.setHours(0,0,0,0),pi(p,e)}function ea(s,e){const t=$t(s,e==null?void 0:e.in),i=+pi(t,e)-+Fc(t,e);return Math.round(i/zr)+1}function fe(s,e){const t=s<0?"-":"",i=Math.abs(s).toString().padStart(e,"0");return t+i}const es={y(s,e){const t=s.getFullYear(),i=t>0?t:1-t;return fe(e==="yy"?i%100:i,e.length)},M(s,e){const t=s.getMonth();return e==="M"?String(t+1):fe(t+1,2)},d(s,e){return fe(s.getDate(),e.length)},a(s,e){const t=s.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(s,e){return fe(s.getHours()%12||12,e.length)},H(s,e){return fe(s.getHours(),e.length)},m(s,e){return fe(s.getMinutes(),e.length)},s(s,e){return fe(s.getSeconds(),e.length)},S(s,e){const t=e.length,i=s.getMilliseconds(),n=Math.trunc(i*Math.pow(10,t-3));return fe(n,e.length)}},Vs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ta={G:function(s,e,t){const i=s.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(i,{width:"abbreviated"});case"GGGGG":return t.era(i,{width:"narrow"});case"GGGG":default:return t.era(i,{width:"wide"})}},y:function(s,e,t){if(e==="yo"){const i=s.getFullYear(),n=i>0?i:1-i;return t.ordinalNumber(n,{unit:"year"})}return es.y(s,e)},Y:function(s,e,t,i){const n=Rr(s,i),r=n>0?n:1-n;if(e==="YY"){const a=r%100;return fe(a,2)}return e==="Yo"?t.ordinalNumber(r,{unit:"year"}):fe(r,e.length)},R:function(s,e){const t=Gr(s);return fe(t,e.length)},u:function(s,e){const t=s.getFullYear();return fe(t,e.length)},Q:function(s,e,t){const i=Math.ceil((s.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return fe(i,2);case"Qo":return t.ordinalNumber(i,{unit:"quarter"});case"QQQ":return t.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(i,{width:"wide",context:"formatting"})}},q:function(s,e,t){const i=Math.ceil((s.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return fe(i,2);case"qo":return t.ordinalNumber(i,{unit:"quarter"});case"qqq":return t.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(i,{width:"wide",context:"standalone"})}},M:function(s,e,t){const i=s.getMonth();switch(e){case"M":case"MM":return es.M(s,e);case"Mo":return t.ordinalNumber(i+1,{unit:"month"});case"MMM":return t.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(i,{width:"wide",context:"formatting"})}},L:function(s,e,t){const i=s.getMonth();switch(e){case"L":return String(i+1);case"LL":return fe(i+1,2);case"Lo":return t.ordinalNumber(i+1,{unit:"month"});case"LLL":return t.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(i,{width:"wide",context:"standalone"})}},w:function(s,e,t,i){const n=ea(s,i);return e==="wo"?t.ordinalNumber(n,{unit:"week"}):fe(n,e.length)},I:function(s,e,t){const i=Bc(s);return e==="Io"?t.ordinalNumber(i,{unit:"week"}):fe(i,e.length)},d:function(s,e,t){return e==="do"?t.ordinalNumber(s.getDate(),{unit:"date"}):es.d(s,e)},D:function(s,e,t){const i=Lc(s);return e==="Do"?t.ordinalNumber(i,{unit:"dayOfYear"}):fe(i,e.length)},E:function(s,e,t){const i=s.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(i,{width:"short",context:"formatting"});case"EEEE":default:return t.day(i,{width:"wide",context:"formatting"})}},e:function(s,e,t,i){const n=s.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return fe(r,2);case"eo":return t.ordinalNumber(r,{unit:"day"});case"eee":return t.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(n,{width:"short",context:"formatting"});case"eeee":default:return t.day(n,{width:"wide",context:"formatting"})}},c:function(s,e,t,i){const n=s.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return fe(r,e.length);case"co":return t.ordinalNumber(r,{unit:"day"});case"ccc":return t.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(n,{width:"narrow",context:"standalone"});case"cccccc":return t.day(n,{width:"short",context:"standalone"});case"cccc":default:return t.day(n,{width:"wide",context:"standalone"})}},i:function(s,e,t){const i=s.getDay(),n=i===0?7:i;switch(e){case"i":return String(n);case"ii":return fe(n,e.length);case"io":return t.ordinalNumber(n,{unit:"day"});case"iii":return t.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(i,{width:"short",context:"formatting"});case"iiii":default:return t.day(i,{width:"wide",context:"formatting"})}},a:function(s,e,t){const i=s.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(s,e,t){const i=s.getHours();let n;switch(i===12?n=Vs.noon:i===0?n=Vs.midnight:n=i/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(s,e,t){const i=s.getHours();let n;switch(i>=17?n=Vs.evening:i>=12?n=Vs.afternoon:i>=4?n=Vs.morning:n=Vs.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(s,e,t){if(e==="ho"){let i=s.getHours()%12;return i===0&&(i=12),t.ordinalNumber(i,{unit:"hour"})}return es.h(s,e)},H:function(s,e,t){return e==="Ho"?t.ordinalNumber(s.getHours(),{unit:"hour"}):es.H(s,e)},K:function(s,e,t){const i=s.getHours()%12;return e==="Ko"?t.ordinalNumber(i,{unit:"hour"}):fe(i,e.length)},k:function(s,e,t){let i=s.getHours();return i===0&&(i=24),e==="ko"?t.ordinalNumber(i,{unit:"hour"}):fe(i,e.length)},m:function(s,e,t){return e==="mo"?t.ordinalNumber(s.getMinutes(),{unit:"minute"}):es.m(s,e)},s:function(s,e,t){return e==="so"?t.ordinalNumber(s.getSeconds(),{unit:"second"}):es.s(s,e)},S:function(s,e){return es.S(s,e)},X:function(s,e,t){const i=s.getTimezoneOffset();if(i===0)return"Z";switch(e){case"X":return ia(i);case"XXXX":case"XX":return bs(i);case"XXXXX":case"XXX":default:return bs(i,":")}},x:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"x":return ia(i);case"xxxx":case"xx":return bs(i);case"xxxxx":case"xxx":default:return bs(i,":")}},O:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+sa(i,":");case"OOOO":default:return"GMT"+bs(i,":")}},z:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+sa(i,":");case"zzzz":default:return"GMT"+bs(i,":")}},t:function(s,e,t){const i=Math.trunc(+s/1e3);return fe(i,e.length)},T:function(s,e,t){return fe(+s,e.length)}};function sa(s,e=""){const t=s>0?"-":"+",i=Math.abs(s),n=Math.trunc(i/60),r=i%60;return r===0?t+String(n):t+String(n)+e+fe(r,2)}function ia(s,e){return s%60===0?(s>0?"-":"+")+fe(Math.abs(s)/60,2):bs(s,e)}function bs(s,e=""){const t=s>0?"-":"+",i=Math.abs(s),n=fe(Math.trunc(i/60),2),r=fe(i%60,2);return t+n+e+r}const na=(s,e)=>{switch(s){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},ra=(s,e)=>{switch(s){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Hc=(s,e)=>{const t=s.match(/(P+)(p+)?/)||[],i=t[1],n=t[2];if(!n)return na(s,e);let r;switch(i){case"P":r=e.dateTime({width:"short"});break;case"PP":r=e.dateTime({width:"medium"});break;case"PPP":r=e.dateTime({width:"long"});break;case"PPPP":default:r=e.dateTime({width:"full"});break}return r.replace("{{date}}",na(i,e)).replace("{{time}}",ra(n,e))},Vc={p:ra,P:Hc},Uc=/^D+$/,jc=/^Y+$/,qc=["D","DD","YY","YYYY"];function Wc(s){return Uc.test(s)}function zc(s){return jc.test(s)}function Yc(s,e,t){const i=Kc(s,e,t);if(console.warn(i),qc.includes(s))throw new RangeError(i)}function Kc(s,e,t){const i=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${e}\`) for formatting ${i} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Gc=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Xc=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Qc=/^'([^]*?)'?$/,Zc=/''/g,Jc=/[a-zA-Z]/;function Rc(s,e,t){var i,n,r,a;const l=Qi(),d=l.locale??Ic,p=l.firstWeekContainsDate??((n=(i=l.locale)==null?void 0:i.options)==null?void 0:n.firstWeekContainsDate)??1,m=l.weekStartsOn??((a=(r=l.locale)==null?void 0:r.options)==null?void 0:a.weekStartsOn)??0,v=$t(s,void 0);if(!ec(v))throw new RangeError("Invalid time value");let y=e.match(Xc).map(g=>{const $=g[0];if($==="p"||$==="P"){const T=Vc[$];return T(g,d.formatLong)}return g}).join("").match(Gc).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const $=g[0];if($==="'")return{isToken:!1,value:ed(g)};if(ta[$])return{isToken:!0,value:g};if($.match(Jc))throw new RangeError("Format string contains an unescaped latin alphabet character `"+$+"`");return{isToken:!1,value:g}});d.localize.preprocessor&&(y=d.localize.preprocessor(v,y));const k={firstWeekContainsDate:p,weekStartsOn:m,locale:d};return y.map(g=>{if(!g.isToken)return g.value;const $=g.value;(zc($)||Wc($))&&Yc($,e,String(s));const T=ta[$[0]];return T(v,$,d.localize,k)}).join("")}function ed(s){const e=s.match(Qc);return e?e[1].replace(Zc,"'"):s}function td(s,e){const t=$t(s,void 0).getDay();return t===0?7:t}function sd(s,e,t="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:s,timeZoneName:t}).format(e).split(/\s/g).slice(2).join(" ")}const aa={},gi={};function ys(s,e){try{const t=(aa[s]||(aa[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(e).split("GMT")[1];return t in gi?gi[t]:oa(t,t.split(":"))}catch{if(s in gi)return gi[s];const t=s==null?void 0:s.match(id);return t?oa(s,t.slice(1)):NaN}}const id=/([+-]\d\d):?(\d\d)?/;function oa(s,e){const t=+(e[0]||0),i=+(e[1]||0),n=+(e[2]||0)/60;return gi[s]=t*60+i>0?t*60+i+n:t*60-i-n}let vi=class Li extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(ys(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),ca(this),On(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new Li(...t,e):new Li(Date.now(),e)}withTimeZone(e){return new Li(+this,e)}getTimezoneOffset(){const e=-ys(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),On(this),+this}[Symbol.for("constructDateFrom")](e){return new Li(+new Date(e),this.timeZone)}};const la=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!la.test(s))return;const e=s.replace(la,"$1UTC");vi.prototype[e]&&(s.startsWith("get")?vi.prototype[s]=function(){return this.internal[e]()}:(vi.prototype[s]=function(){return Date.prototype[e].apply(this.internal,arguments),nd(this),+this},vi.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),On(this),+this}))});function On(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-ys(s.timeZone,s)*60))}function nd(s){Date.prototype.setFullYear.call(s,s.internal.getUTCFullYear(),s.internal.getUTCMonth(),s.internal.getUTCDate()),Date.prototype.setHours.call(s,s.internal.getUTCHours(),s.internal.getUTCMinutes(),s.internal.getUTCSeconds(),s.internal.getUTCMilliseconds()),ca(s)}function ca(s){const e=ys(s.timeZone,s),t=e>0?Math.floor(e):Math.ceil(e),i=new Date(+s);i.setUTCHours(i.getUTCHours()-1);const n=-new Date(+s).getTimezoneOffset(),r=-new Date(+i).getTimezoneOffset(),a=n-r,l=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();a&&l&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+a);const d=n-t;d&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+d);const p=new Date(+s);p.setUTCSeconds(0);const m=n>0?p.getSeconds():(p.getSeconds()-60)%60,v=Math.round(-(ys(s.timeZone,s)*60))%60;(v||m)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+v),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+v+m));const y=ys(s.timeZone,s),k=y>0?Math.floor(y):Math.ceil(y),g=-new Date(+s).getTimezoneOffset()-k,$=k!==t,T=g-d;if($&&T){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+T);const M=ys(s.timeZone,s),S=M>0?Math.floor(M):Math.ceil(M),O=k-S;O&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+O),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+O))}}let En=class Bi extends vi{static tz(e,...t){return t.length?new Bi(...t,e):new Bi(Date.now(),e)}toISOString(){const[e,t,i]=this.tzComponents(),n=`${e}${t}:${i}`;return this.internal.toISOString().slice(0,-1)+n}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,i,n]=this.internal.toUTCString().split(" ");return`${e==null?void 0:e.slice(0,-1)} ${i} ${t} ${n}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,i,n]=this.tzComponents();return`${e} GMT${t}${i}${n} (${sd(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),t=e>0?"-":"+",i=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),n=String(Math.abs(e)%60).padStart(2,"0");return[t,i,n]}withTimeZone(e){return new Bi(+this,e)}[Symbol.for("constructDateFrom")](e){return new Bi(+new Date(e),this.timeZone)}};window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const rd=(s=window.pktTz)=>{const e=new En(new Date().toISOString(),s);return e.setHours(0,0,0,0),isNaN(e.getTime())?new Date:new Date(e.getFullYear(),e.getMonth(),e.getDate())};function zt(s){if(!s||s==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[e,t,i]=s.split("-").map(Number);return new Date(e,t-1,i)}if(/^\d{4}-\d{2}$/.test(s)){const[e,t]=s.split("-").map(Number);return new Date(e,t-1,1)}return/^\d{4}$/.test(s)?new Date(Number(s),0,1):new Date(s)}const qe=s=>{if(!s||isNaN(s.getTime()))return"";const e=s.getFullYear(),t=String(s.getMonth()+1).padStart(2,"0"),i=String(s.getDate()).padStart(2,"0");return`${e}-${t}-${i}`},ts=s=>{if(!s)return null;const e=zt(s);return isNaN(e.getTime())?null:e},da=(s,e)=>{const t=Ct(s);return isNaN(t.getTime())?"":Rc(t,e)},Ct=(s="",e)=>{const t=typeof s=="string"?zt(s):s;return!t||isNaN(t.getTime())?new Date:t},ks=(s,e,t=1)=>{if(typeof s!="number"||typeof e!="number"||typeof t!="number"||isNaN(s)||isNaN(e)||isNaN(t))return new Date;const i=new Date(s,e,t);return isNaN(i.getTime())?new Date:i},bi=s=>{let e;return typeof s=="number"?e=new En(s,window.pktTz):e=new En(s,window.pktTz),e.setHours(12,0,0,0),e};let Pn=null,ua;const ad=s=>{if(!s||isNaN(s.getTime()))return"";const e=typeof window<"u"?window.pktTz:void 0;return(!Pn||ua!==e)&&(Pn=new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:e}),ua=e),Pn.format(s)},od=(s,e,t)=>{if(!s||isNaN(s.getTime()))return!1;const i=e?Ct(e):null,n=t?Ct(t):null;return!(i&&s<i||n&&s>n)},ld=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=qe(s);return e.includes(t)},cd=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=s.getDay().toString();return e.includes(t)},ha=(s,e,t,i,n)=>!(!s||isNaN(s.getTime())||!od(s,e,t)||i&&ld(s,i)||n&&cd(s,n)),dd=(s,e,t,i,n)=>s.filter(r=>{const a=ts(r);return a&&ha(a,e,t,i,n)}),pa=s=>s.slice().sort((e,t)=>{const i=ts(e),n=ts(t);return!i||!n?0:i.getTime()-n.getTime()}),ud=(s,e)=>{const t=ts(s),i=ts(e);return!t||!i?!1:t<=i},yi=s=>s?Array.isArray(s)?s.filter(Boolean):String(s).split(",").map(e=>e.trim()).filter(Boolean):[],hd=s=>s.join(","),pd=s=>yi(s),fd=s=>s?zt(s):null,md=s=>{if(typeof s=="string")return s.split(",").map(e=>zt(e));if(Array.isArray(s))return s.map(e=>zt(e))},Us={csvToArray:pd,stringToDate:fd,stringsToDate:md},gd={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},_s={props:gd};function fa(s,e){const t=(e.excludedates??[]).map(i=>typeof i=="string"?i:qe(i));return!ha(s,e.earliest,e.latest,t,e.excludeweekdays??[])}function vd(s,e,t,i){return!!(fa(s,t)||!e&&i.multiple&&i.maxMultiple>0&&i.selectedCount>=i.maxMultiple)}function bd(s,e,t){const i=ks(s,e,0);return!(t&&Ct(t)>i)}function yd(s,e,t){const i=ks(e===11?s+1:s,e===11?0:e+1,1);return!(t&&Ct(t)<i)}const ki=7,kd=6;function _d(s,e){const t=ks(s,e,1),i=ks(s,e+1,0),n=(t.getDay()+kd)%ki,r=i.getDate(),a=Math.ceil((r+n)/ki),l=ks(s,e,0).getDate(),d=ea(t);return{firstDayOfMonth:t,lastDayOfMonth:i,startingDay:n,numDays:r,numRows:a,numDaysPrevMonth:l,initialWeek:d}}function $d(s,e,t,i){const{startingDay:n,numDays:r}=i;return s===0&&e<n?"prev-month":t>r?"next-month":"current-month"}function wd(s,e,t,i){const{startingDay:n,numDaysPrevMonth:r,numDays:a}=i;return s==="prev-month"?r-(n-e-1):s==="next-month"?t-a:t}function js(s){return typeof s=="string"&&(s=s.split(",")),s.length===1&&s[0]===""?[]:s.map(e=>zt(e))}function ma(s,e){const t=Jr({start:s,end:e}),i={};if(Array.isArray(t)&&t.length)for(let n=0;n<t.length;n++){const r=t[n],a=r>s&&r<e;i[qe(r)]=a}return i}function ga(s,e,t,i){if(e.length!==1)return!0;const n=Jr({start:e[0],end:s});if(!Array.isArray(n)||!n.length)return!0;for(let r=0;r<n.length;r++){for(const a of t??[])if(a>e[0]&&a<s)return!1;if((i??[]).includes(td(n[r]).toString()))return!1}return!0}function An(s,e){const t=qe(s);return e.includes(t)?e:[...e,t]}function In(s,e){const t=qe(s),i=e.indexOf(t);if(i===-1)return e;if(e.length===1)return[];const n=[...e];return n.splice(i,1),n}function xd(s,e,t){const i=qe(s);return e.includes(i)?In(s,e):t>0&&e.length>=t?e:An(s,e)}function Sd(s,e,t){const i=qe(s),n=js(e);if(e.includes(i))return e.indexOf(i)===0?[]:In(s,e);if(e.length>1)return[i];if(e.length===1){if(!ga(s,n,t.excludedates,t.excludeweekdays))return[i];if(n[0]>s)return[i]}return An(s,e)}const Cd={ArrowLeft:-1,ArrowRight:1,ArrowUp:-ki,ArrowDown:ki};function Td(s){var e;const t=s.nodeName;return t==="INPUT"||t==="SELECT"||t==="BUTTON"&&!((e=s.dataset)!=null&&e.date)}function Nd(s,e,t){let i=Kr(s,e);if(!i)return null;let n=t(`button[data-date="${qe(i)}"]`);for(;n instanceof HTMLButtonElement&&n.dataset.disabled;)if(i=Kr(i,e),n=t(`button[data-date="${qe(i)}"]`),!n)return null;return i}function Md(s){return Cd[s]??null}var Dd=Object.defineProperty,Od=Object.getOwnPropertyDescriptor,_e=(s,e,t,i)=>{for(var n=i>1?void 0:i?Od(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Dd(e,t,n),n};let ve=class extends ke{constructor(){super(...arguments),this.selected=[],this.multiple=_s.props.multiple.default,this.maxMultiple=_s.props.maxMultiple.default,this.range=_s.props.range.default,this.earliest=_s.props.earliest.default,this.latest=_s.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.weeknumbers=_s.props.weeknumbers.default,this.withcontrols=_s.props.withcontrols.default,this.currentmonth=null,this.today=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.inRange={},this.rangeHovered=null,this.year=0,this.month=0,this.week=0,this.currentmonthtouched=!1,this.focusedDate=null,this.selectableDates=[],this.tabIndexSet=0}get todayDate(){return this.today?zt(this.today):rd()}firstUpdated(e){this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}updated(e){super.updated(e),e.has("selected")&&this.convertSelected()}convertSelected(){typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=js(this.selected),this.range&&this.selected.length===2&&(this.inRange=ma(this._selected[0],this._selected[1])),this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==""){const e=zt(this.selected[this.selected.length-1]);this.currentmonth=isNaN(e.getTime())?bi(this.todayDate):e}else this.currentmonth===null&&(this.currentmonth=bi(this.todayDate));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=bi(this.todayDate)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(e){const t=Md(e.key);t!==null&&this.handleArrowKey(e,t)}handleArrowKey(e,t){const i=e.target;if(Td(i))return;if(e.preventDefault(),!this.focusedDate){this.focusOnCurrentDate();return}const n=this.focusedDate?Ct(this.focusedDate):ks(this.year,this.month,1),r=Nd(n,t,this.querySelector.bind(this));if(r){const a=this.querySelector(`button[data-date="${qe(r)}"]`);a instanceof HTMLButtonElement&&!a.dataset.disabled&&(this.focusedDate=qe(r),a.focus())}}render(){return b`
205
+ </nav>`}};Xi([c({type:String})],Hs.prototype,"href",2),Xi([c({type:String})],Hs.prototype,"text",2),Xi([c({type:String})],Hs.prototype,"ariaLabel",2),Hs=Xi([ee("pkt-backlink")],Hs);const zr=6048e5,Xl=864e5,Yr=Symbol.for("constructDateFrom");function Bt(s,e){return typeof s=="function"?s(e):s&&typeof s=="object"&&Yr in s?s[Yr](e):s instanceof Date?new s.constructor(e):new Date(e)}function $t(s,e){return Bt(e||s,s)}function Kr(s,e,t){const i=$t(s,void 0);return isNaN(e)?Bt(s,NaN):(e&&i.setDate(i.getDate()+e),i)}let Ql={};function Qi(){return Ql}function pi(s,e){var t,i,n,r;const a=Qi(),l=(e==null?void 0:e.weekStartsOn)??((i=(t=e==null?void 0:e.locale)==null?void 0:t.options)==null?void 0:i.weekStartsOn)??a.weekStartsOn??((r=(n=a.locale)==null?void 0:n.options)==null?void 0:r.weekStartsOn)??0,d=$t(s,e==null?void 0:e.in),p=d.getDay(),m=(p<l?7:0)+p-l;return d.setDate(d.getDate()-m),d.setHours(0,0,0,0),d}function Zi(s,e){return pi(s,{...e,weekStartsOn:1})}function Gr(s,e){const t=$t(s,void 0),i=t.getFullYear(),n=Bt(t,0);n.setFullYear(i+1,0,4),n.setHours(0,0,0,0);const r=Zi(n),a=Bt(t,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=Zi(a);return t.getTime()>=r.getTime()?i+1:t.getTime()>=l.getTime()?i:i-1}function Xr(s){const e=$t(s),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+s-+t}function Qr(s,...e){const t=Bt.bind(null,e.find(i=>typeof i=="object"));return e.map(t)}function Zr(s,e){const t=$t(s,void 0);return t.setHours(0,0,0,0),t}function Zl(s,e,t){const[i,n]=Qr(void 0,s,e),r=Zr(i),a=Zr(n),l=+r-Xr(r),d=+a-Xr(a);return Math.round((l-d)/Xl)}function Jl(s,e){const t=Gr(s),i=Bt(s,0);return i.setFullYear(t,0,4),i.setHours(0,0,0,0),Zi(i)}function Rl(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function ec(s){return!(!Rl(s)&&typeof s!="number"||isNaN(+$t(s)))}function tc(s,e){const[t,i]=Qr(s,e.start,e.end);return{start:t,end:i}}function Jr(s,e){const{start:t,end:i}=tc(void 0,s);let n=+t>+i;const r=n?+t:+i,a=n?i:t;a.setHours(0,0,0,0);let l=1;const d=[];for(;+a<=r;)d.push(Bt(t,a)),a.setDate(a.getDate()+l),a.setHours(0,0,0,0);return n?d.reverse():d}function sc(s,e){const t=$t(s,void 0);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}const ic={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},nc=(s,e,t)=>{let i;const n=ic[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+i:i+" ago":i};function Dn(s){return(e={})=>{const t=e.width?String(e.width):s.defaultWidth;return s.formats[t]||s.formats[s.defaultWidth]}}const rc={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ac={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},oc={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},lc={date:Dn({formats:rc,defaultWidth:"full"}),time:Dn({formats:ac,defaultWidth:"full"}),dateTime:Dn({formats:oc,defaultWidth:"full"})},cc={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},dc=(s,e,t,i)=>cc[s];function fi(s){return(e,t)=>{const i=t!=null&&t.context?String(t.context):"standalone";let n;if(i==="formatting"&&s.formattingValues){const a=s.defaultFormattingWidth||s.defaultWidth,l=t!=null&&t.width?String(t.width):a;n=s.formattingValues[l]||s.formattingValues[a]}else{const a=s.defaultWidth,l=t!=null&&t.width?String(t.width):s.defaultWidth;n=s.values[l]||s.values[a]}const r=s.argumentCallback?s.argumentCallback(e):e;return n[r]}}const uc={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},hc={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},pc={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},fc={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},mc={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},gc={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},vc=(s,e)=>{const t=Number(s),i=t%100;if(i>20||i<10)switch(i%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},bc={ordinalNumber:vc,era:fi({values:uc,defaultWidth:"wide"}),quarter:fi({values:hc,defaultWidth:"wide",argumentCallback:s=>s-1}),month:fi({values:pc,defaultWidth:"wide"}),day:fi({values:fc,defaultWidth:"wide"}),dayPeriod:fi({values:mc,defaultWidth:"wide",formattingValues:gc,defaultFormattingWidth:"wide"})};function mi(s){return(e,t={})=>{const i=t.width,n=i&&s.matchPatterns[i]||s.matchPatterns[s.defaultMatchWidth],r=e.match(n);if(!r)return null;const a=r[0],l=i&&s.parsePatterns[i]||s.parsePatterns[s.defaultParseWidth],d=Array.isArray(l)?kc(l,b=>b.test(a)):yc(l,b=>b.test(a));let p;p=s.valueCallback?s.valueCallback(d):d,p=t.valueCallback?t.valueCallback(p):p;const m=e.slice(a.length);return{value:p,rest:m}}}function yc(s,e){for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t)&&e(s[t]))return t}function kc(s,e){for(let t=0;t<s.length;t++)if(e(s[t]))return t}function _c(s){return(e,t={})=>{const i=e.match(s.matchPattern);if(!i)return null;const n=i[0],r=e.match(s.parsePattern);if(!r)return null;let a=s.valueCallback?s.valueCallback(r[0]):r[0];a=t.valueCallback?t.valueCallback(a):a;const l=e.slice(n.length);return{value:a,rest:l}}}const $c=/^(\d+)(th|st|nd|rd)?/i,wc=/\d+/i,xc={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Sc={any:[/^b/i,/^(a|c)/i]},Cc={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Tc={any:[/1/i,/2/i,/3/i,/4/i]},Nc={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Mc={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Dc={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Oc={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ec={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Pc={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Ac={ordinalNumber:_c({matchPattern:$c,parsePattern:wc,valueCallback:s=>parseInt(s,10)}),era:mi({matchPatterns:xc,defaultMatchWidth:"wide",parsePatterns:Sc,defaultParseWidth:"any"}),quarter:mi({matchPatterns:Cc,defaultMatchWidth:"wide",parsePatterns:Tc,defaultParseWidth:"any",valueCallback:s=>s+1}),month:mi({matchPatterns:Nc,defaultMatchWidth:"wide",parsePatterns:Mc,defaultParseWidth:"any"}),day:mi({matchPatterns:Dc,defaultMatchWidth:"wide",parsePatterns:Oc,defaultParseWidth:"any"}),dayPeriod:mi({matchPatterns:Ec,defaultMatchWidth:"any",parsePatterns:Pc,defaultParseWidth:"any"})},Ic={code:"en-US",formatDistance:nc,formatLong:lc,formatRelative:dc,localize:bc,match:Ac,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Lc(s,e){const t=$t(s,void 0);return Zl(t,sc(t))+1}function Bc(s,e){const t=$t(s,void 0),i=+Zi(t)-+Jl(t);return Math.round(i/zr)+1}function Rr(s,e){var t,i,n,r;const a=$t(s,e==null?void 0:e.in),l=a.getFullYear(),d=Qi(),p=(e==null?void 0:e.firstWeekContainsDate)??((i=(t=e==null?void 0:e.locale)==null?void 0:t.options)==null?void 0:i.firstWeekContainsDate)??d.firstWeekContainsDate??((r=(n=d.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??1,m=Bt((e==null?void 0:e.in)||s,0);m.setFullYear(l+1,0,p),m.setHours(0,0,0,0);const b=pi(m,e),y=Bt((e==null?void 0:e.in)||s,0);y.setFullYear(l,0,p),y.setHours(0,0,0,0);const k=pi(y,e);return+a>=+b?l+1:+a>=+k?l:l-1}function Fc(s,e){var t,i,n,r;const a=Qi(),l=(e==null?void 0:e.firstWeekContainsDate)??((i=(t=e==null?void 0:e.locale)==null?void 0:t.options)==null?void 0:i.firstWeekContainsDate)??a.firstWeekContainsDate??((r=(n=a.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??1,d=Rr(s,e),p=Bt((e==null?void 0:e.in)||s,0);return p.setFullYear(d,0,l),p.setHours(0,0,0,0),pi(p,e)}function ea(s,e){const t=$t(s,e==null?void 0:e.in),i=+pi(t,e)-+Fc(t,e);return Math.round(i/zr)+1}function fe(s,e){const t=s<0?"-":"",i=Math.abs(s).toString().padStart(e,"0");return t+i}const es={y(s,e){const t=s.getFullYear(),i=t>0?t:1-t;return fe(e==="yy"?i%100:i,e.length)},M(s,e){const t=s.getMonth();return e==="M"?String(t+1):fe(t+1,2)},d(s,e){return fe(s.getDate(),e.length)},a(s,e){const t=s.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(s,e){return fe(s.getHours()%12||12,e.length)},H(s,e){return fe(s.getHours(),e.length)},m(s,e){return fe(s.getMinutes(),e.length)},s(s,e){return fe(s.getSeconds(),e.length)},S(s,e){const t=e.length,i=s.getMilliseconds(),n=Math.trunc(i*Math.pow(10,t-3));return fe(n,e.length)}},Vs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ta={G:function(s,e,t){const i=s.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(i,{width:"abbreviated"});case"GGGGG":return t.era(i,{width:"narrow"});case"GGGG":default:return t.era(i,{width:"wide"})}},y:function(s,e,t){if(e==="yo"){const i=s.getFullYear(),n=i>0?i:1-i;return t.ordinalNumber(n,{unit:"year"})}return es.y(s,e)},Y:function(s,e,t,i){const n=Rr(s,i),r=n>0?n:1-n;if(e==="YY"){const a=r%100;return fe(a,2)}return e==="Yo"?t.ordinalNumber(r,{unit:"year"}):fe(r,e.length)},R:function(s,e){const t=Gr(s);return fe(t,e.length)},u:function(s,e){const t=s.getFullYear();return fe(t,e.length)},Q:function(s,e,t){const i=Math.ceil((s.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return fe(i,2);case"Qo":return t.ordinalNumber(i,{unit:"quarter"});case"QQQ":return t.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(i,{width:"wide",context:"formatting"})}},q:function(s,e,t){const i=Math.ceil((s.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return fe(i,2);case"qo":return t.ordinalNumber(i,{unit:"quarter"});case"qqq":return t.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(i,{width:"wide",context:"standalone"})}},M:function(s,e,t){const i=s.getMonth();switch(e){case"M":case"MM":return es.M(s,e);case"Mo":return t.ordinalNumber(i+1,{unit:"month"});case"MMM":return t.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(i,{width:"wide",context:"formatting"})}},L:function(s,e,t){const i=s.getMonth();switch(e){case"L":return String(i+1);case"LL":return fe(i+1,2);case"Lo":return t.ordinalNumber(i+1,{unit:"month"});case"LLL":return t.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(i,{width:"wide",context:"standalone"})}},w:function(s,e,t,i){const n=ea(s,i);return e==="wo"?t.ordinalNumber(n,{unit:"week"}):fe(n,e.length)},I:function(s,e,t){const i=Bc(s);return e==="Io"?t.ordinalNumber(i,{unit:"week"}):fe(i,e.length)},d:function(s,e,t){return e==="do"?t.ordinalNumber(s.getDate(),{unit:"date"}):es.d(s,e)},D:function(s,e,t){const i=Lc(s);return e==="Do"?t.ordinalNumber(i,{unit:"dayOfYear"}):fe(i,e.length)},E:function(s,e,t){const i=s.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(i,{width:"short",context:"formatting"});case"EEEE":default:return t.day(i,{width:"wide",context:"formatting"})}},e:function(s,e,t,i){const n=s.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return fe(r,2);case"eo":return t.ordinalNumber(r,{unit:"day"});case"eee":return t.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(n,{width:"short",context:"formatting"});case"eeee":default:return t.day(n,{width:"wide",context:"formatting"})}},c:function(s,e,t,i){const n=s.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return fe(r,e.length);case"co":return t.ordinalNumber(r,{unit:"day"});case"ccc":return t.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(n,{width:"narrow",context:"standalone"});case"cccccc":return t.day(n,{width:"short",context:"standalone"});case"cccc":default:return t.day(n,{width:"wide",context:"standalone"})}},i:function(s,e,t){const i=s.getDay(),n=i===0?7:i;switch(e){case"i":return String(n);case"ii":return fe(n,e.length);case"io":return t.ordinalNumber(n,{unit:"day"});case"iii":return t.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(i,{width:"short",context:"formatting"});case"iiii":default:return t.day(i,{width:"wide",context:"formatting"})}},a:function(s,e,t){const i=s.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(s,e,t){const i=s.getHours();let n;switch(i===12?n=Vs.noon:i===0?n=Vs.midnight:n=i/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(s,e,t){const i=s.getHours();let n;switch(i>=17?n=Vs.evening:i>=12?n=Vs.afternoon:i>=4?n=Vs.morning:n=Vs.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(s,e,t){if(e==="ho"){let i=s.getHours()%12;return i===0&&(i=12),t.ordinalNumber(i,{unit:"hour"})}return es.h(s,e)},H:function(s,e,t){return e==="Ho"?t.ordinalNumber(s.getHours(),{unit:"hour"}):es.H(s,e)},K:function(s,e,t){const i=s.getHours()%12;return e==="Ko"?t.ordinalNumber(i,{unit:"hour"}):fe(i,e.length)},k:function(s,e,t){let i=s.getHours();return i===0&&(i=24),e==="ko"?t.ordinalNumber(i,{unit:"hour"}):fe(i,e.length)},m:function(s,e,t){return e==="mo"?t.ordinalNumber(s.getMinutes(),{unit:"minute"}):es.m(s,e)},s:function(s,e,t){return e==="so"?t.ordinalNumber(s.getSeconds(),{unit:"second"}):es.s(s,e)},S:function(s,e){return es.S(s,e)},X:function(s,e,t){const i=s.getTimezoneOffset();if(i===0)return"Z";switch(e){case"X":return ia(i);case"XXXX":case"XX":return bs(i);case"XXXXX":case"XXX":default:return bs(i,":")}},x:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"x":return ia(i);case"xxxx":case"xx":return bs(i);case"xxxxx":case"xxx":default:return bs(i,":")}},O:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+sa(i,":");case"OOOO":default:return"GMT"+bs(i,":")}},z:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+sa(i,":");case"zzzz":default:return"GMT"+bs(i,":")}},t:function(s,e,t){const i=Math.trunc(+s/1e3);return fe(i,e.length)},T:function(s,e,t){return fe(+s,e.length)}};function sa(s,e=""){const t=s>0?"-":"+",i=Math.abs(s),n=Math.trunc(i/60),r=i%60;return r===0?t+String(n):t+String(n)+e+fe(r,2)}function ia(s,e){return s%60===0?(s>0?"-":"+")+fe(Math.abs(s)/60,2):bs(s,e)}function bs(s,e=""){const t=s>0?"-":"+",i=Math.abs(s),n=fe(Math.trunc(i/60),2),r=fe(i%60,2);return t+n+e+r}const na=(s,e)=>{switch(s){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},ra=(s,e)=>{switch(s){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Hc=(s,e)=>{const t=s.match(/(P+)(p+)?/)||[],i=t[1],n=t[2];if(!n)return na(s,e);let r;switch(i){case"P":r=e.dateTime({width:"short"});break;case"PP":r=e.dateTime({width:"medium"});break;case"PPP":r=e.dateTime({width:"long"});break;case"PPPP":default:r=e.dateTime({width:"full"});break}return r.replace("{{date}}",na(i,e)).replace("{{time}}",ra(n,e))},Vc={p:ra,P:Hc},Uc=/^D+$/,jc=/^Y+$/,qc=["D","DD","YY","YYYY"];function Wc(s){return Uc.test(s)}function zc(s){return jc.test(s)}function Yc(s,e,t){const i=Kc(s,e,t);if(console.warn(i),qc.includes(s))throw new RangeError(i)}function Kc(s,e,t){const i=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${e}\`) for formatting ${i} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Gc=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Xc=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Qc=/^'([^]*?)'?$/,Zc=/''/g,Jc=/[a-zA-Z]/;function Rc(s,e,t){var i,n,r,a;const l=Qi(),d=l.locale??Ic,p=l.firstWeekContainsDate??((n=(i=l.locale)==null?void 0:i.options)==null?void 0:n.firstWeekContainsDate)??1,m=l.weekStartsOn??((a=(r=l.locale)==null?void 0:r.options)==null?void 0:a.weekStartsOn)??0,b=$t(s,void 0);if(!ec(b))throw new RangeError("Invalid time value");let y=e.match(Xc).map(g=>{const $=g[0];if($==="p"||$==="P"){const T=Vc[$];return T(g,d.formatLong)}return g}).join("").match(Gc).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const $=g[0];if($==="'")return{isToken:!1,value:ed(g)};if(ta[$])return{isToken:!0,value:g};if($.match(Jc))throw new RangeError("Format string contains an unescaped latin alphabet character `"+$+"`");return{isToken:!1,value:g}});d.localize.preprocessor&&(y=d.localize.preprocessor(b,y));const k={firstWeekContainsDate:p,weekStartsOn:m,locale:d};return y.map(g=>{if(!g.isToken)return g.value;const $=g.value;(zc($)||Wc($))&&Yc($,e,String(s));const T=ta[$[0]];return T(b,$,d.localize,k)}).join("")}function ed(s){const e=s.match(Qc);return e?e[1].replace(Zc,"'"):s}function td(s,e){const t=$t(s,void 0).getDay();return t===0?7:t}function sd(s,e,t="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:s,timeZoneName:t}).format(e).split(/\s/g).slice(2).join(" ")}const aa={},gi={};function ys(s,e){try{const t=(aa[s]||(aa[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(e).split("GMT")[1];return t in gi?gi[t]:oa(t,t.split(":"))}catch{if(s in gi)return gi[s];const t=s==null?void 0:s.match(id);return t?oa(s,t.slice(1)):NaN}}const id=/([+-]\d\d):?(\d\d)?/;function oa(s,e){const t=+(e[0]||0),i=+(e[1]||0),n=+(e[2]||0)/60;return gi[s]=t*60+i>0?t*60+i+n:t*60-i-n}let vi=class Li extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(ys(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),ca(this),On(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new Li(...t,e):new Li(Date.now(),e)}withTimeZone(e){return new Li(+this,e)}getTimezoneOffset(){const e=-ys(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),On(this),+this}[Symbol.for("constructDateFrom")](e){return new Li(+new Date(e),this.timeZone)}};const la=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!la.test(s))return;const e=s.replace(la,"$1UTC");vi.prototype[e]&&(s.startsWith("get")?vi.prototype[s]=function(){return this.internal[e]()}:(vi.prototype[s]=function(){return Date.prototype[e].apply(this.internal,arguments),nd(this),+this},vi.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),On(this),+this}))});function On(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-ys(s.timeZone,s)*60))}function nd(s){Date.prototype.setFullYear.call(s,s.internal.getUTCFullYear(),s.internal.getUTCMonth(),s.internal.getUTCDate()),Date.prototype.setHours.call(s,s.internal.getUTCHours(),s.internal.getUTCMinutes(),s.internal.getUTCSeconds(),s.internal.getUTCMilliseconds()),ca(s)}function ca(s){const e=ys(s.timeZone,s),t=e>0?Math.floor(e):Math.ceil(e),i=new Date(+s);i.setUTCHours(i.getUTCHours()-1);const n=-new Date(+s).getTimezoneOffset(),r=-new Date(+i).getTimezoneOffset(),a=n-r,l=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();a&&l&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+a);const d=n-t;d&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+d);const p=new Date(+s);p.setUTCSeconds(0);const m=n>0?p.getSeconds():(p.getSeconds()-60)%60,b=Math.round(-(ys(s.timeZone,s)*60))%60;(b||m)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+b),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+b+m));const y=ys(s.timeZone,s),k=y>0?Math.floor(y):Math.ceil(y),g=-new Date(+s).getTimezoneOffset()-k,$=k!==t,T=g-d;if($&&T){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+T);const M=ys(s.timeZone,s),S=M>0?Math.floor(M):Math.ceil(M),O=k-S;O&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+O),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+O))}}let En=class Bi extends vi{static tz(e,...t){return t.length?new Bi(...t,e):new Bi(Date.now(),e)}toISOString(){const[e,t,i]=this.tzComponents(),n=`${e}${t}:${i}`;return this.internal.toISOString().slice(0,-1)+n}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,i,n]=this.internal.toUTCString().split(" ");return`${e==null?void 0:e.slice(0,-1)} ${i} ${t} ${n}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,i,n]=this.tzComponents();return`${e} GMT${t}${i}${n} (${sd(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),t=e>0?"-":"+",i=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),n=String(Math.abs(e)%60).padStart(2,"0");return[t,i,n]}withTimeZone(e){return new Bi(+this,e)}[Symbol.for("constructDateFrom")](e){return new Bi(+new Date(e),this.timeZone)}};window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const rd=(s=window.pktTz)=>{const e=new En(new Date().toISOString(),s);return e.setHours(0,0,0,0),isNaN(e.getTime())?new Date:new Date(e.getFullYear(),e.getMonth(),e.getDate())};function zt(s){if(!s||s==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[e,t,i]=s.split("-").map(Number);return new Date(e,t-1,i)}if(/^\d{4}-\d{2}$/.test(s)){const[e,t]=s.split("-").map(Number);return new Date(e,t-1,1)}return/^\d{4}$/.test(s)?new Date(Number(s),0,1):new Date(s)}const qe=s=>{if(!s||isNaN(s.getTime()))return"";const e=s.getFullYear(),t=String(s.getMonth()+1).padStart(2,"0"),i=String(s.getDate()).padStart(2,"0");return`${e}-${t}-${i}`},ts=s=>{if(!s)return null;const e=zt(s);return isNaN(e.getTime())?null:e},da=(s,e)=>{const t=Ct(s);return isNaN(t.getTime())?"":Rc(t,e)},Ct=(s="",e)=>{const t=typeof s=="string"?zt(s):s;return!t||isNaN(t.getTime())?new Date:t},ks=(s,e,t=1)=>{if(typeof s!="number"||typeof e!="number"||typeof t!="number"||isNaN(s)||isNaN(e)||isNaN(t))return new Date;const i=new Date(s,e,t);return isNaN(i.getTime())?new Date:i},bi=s=>{let e;return typeof s=="number"?e=new En(s,window.pktTz):e=new En(s,window.pktTz),e.setHours(12,0,0,0),e};let Pn=null,ua;const ad=s=>{if(!s||isNaN(s.getTime()))return"";const e=typeof window<"u"?window.pktTz:void 0;return(!Pn||ua!==e)&&(Pn=new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:e}),ua=e),Pn.format(s)},od=(s,e,t)=>{if(!s||isNaN(s.getTime()))return!1;const i=e?Ct(e):null,n=t?Ct(t):null;return!(i&&s<i||n&&s>n)},ld=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=qe(s);return e.includes(t)},cd=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=s.getDay().toString();return e.includes(t)},ha=(s,e,t,i,n)=>!(!s||isNaN(s.getTime())||!od(s,e,t)||i&&ld(s,i)||n&&cd(s,n)),dd=(s,e,t,i,n)=>s.filter(r=>{const a=ts(r);return a&&ha(a,e,t,i,n)}),pa=s=>s.slice().sort((e,t)=>{const i=ts(e),n=ts(t);return!i||!n?0:i.getTime()-n.getTime()}),ud=(s,e)=>{const t=ts(s),i=ts(e);return!t||!i?!1:t<=i},yi=s=>s?Array.isArray(s)?s.filter(Boolean):String(s).split(",").map(e=>e.trim()).filter(Boolean):[],hd=s=>s.join(","),pd=s=>yi(s),fd=s=>s?zt(s):null,md=s=>{if(typeof s=="string")return s.split(",").map(e=>zt(e));if(Array.isArray(s))return s.map(e=>zt(e))},Us={csvToArray:pd,stringToDate:fd,stringsToDate:md},gd={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},_s={props:gd};function fa(s,e){const t=(e.excludedates??[]).map(i=>typeof i=="string"?i:qe(i));return!ha(s,e.earliest,e.latest,t,e.excludeweekdays??[])}function vd(s,e,t,i){return!!(fa(s,t)||!e&&i.multiple&&i.maxMultiple>0&&i.selectedCount>=i.maxMultiple)}function bd(s,e,t){const i=ks(s,e,0);return!(t&&Ct(t)>i)}function yd(s,e,t){const i=ks(e===11?s+1:s,e===11?0:e+1,1);return!(t&&Ct(t)<i)}const ki=7,kd=6;function _d(s,e){const t=ks(s,e,1),i=ks(s,e+1,0),n=(t.getDay()+kd)%ki,r=i.getDate(),a=Math.ceil((r+n)/ki),l=ks(s,e,0).getDate(),d=ea(t);return{firstDayOfMonth:t,lastDayOfMonth:i,startingDay:n,numDays:r,numRows:a,numDaysPrevMonth:l,initialWeek:d}}function $d(s,e,t,i){const{startingDay:n,numDays:r}=i;return s===0&&e<n?"prev-month":t>r?"next-month":"current-month"}function wd(s,e,t,i){const{startingDay:n,numDaysPrevMonth:r,numDays:a}=i;return s==="prev-month"?r-(n-e-1):s==="next-month"?t-a:t}function js(s){return typeof s=="string"&&(s=s.split(",")),s.length===1&&s[0]===""?[]:s.map(e=>zt(e))}function ma(s,e){const t=Jr({start:s,end:e}),i={};if(Array.isArray(t)&&t.length)for(let n=0;n<t.length;n++){const r=t[n],a=r>s&&r<e;i[qe(r)]=a}return i}function ga(s,e,t,i){if(e.length!==1)return!0;const n=Jr({start:e[0],end:s});if(!Array.isArray(n)||!n.length)return!0;for(let r=0;r<n.length;r++){for(const a of t??[])if(a>e[0]&&a<s)return!1;if((i??[]).includes(td(n[r]).toString()))return!1}return!0}function An(s,e){const t=qe(s);return e.includes(t)?e:[...e,t]}function In(s,e){const t=qe(s),i=e.indexOf(t);if(i===-1)return e;if(e.length===1)return[];const n=[...e];return n.splice(i,1),n}function xd(s,e,t){const i=qe(s);return e.includes(i)?In(s,e):t>0&&e.length>=t?e:An(s,e)}function Sd(s,e,t){const i=qe(s),n=js(e);if(e.includes(i))return e.indexOf(i)===0?[]:In(s,e);if(e.length>1)return[i];if(e.length===1){if(!ga(s,n,t.excludedates,t.excludeweekdays))return[i];if(n[0]>s)return[i]}return An(s,e)}const Cd={ArrowLeft:-1,ArrowRight:1,ArrowUp:-ki,ArrowDown:ki};function Td(s){var e;const t=s.nodeName;return t==="INPUT"||t==="SELECT"||t==="BUTTON"&&!((e=s.dataset)!=null&&e.date)}function Nd(s,e,t){let i=Kr(s,e);if(!i)return null;let n=t(`button[data-date="${qe(i)}"]`);for(;n instanceof HTMLButtonElement&&n.dataset.disabled;)if(i=Kr(i,e),n=t(`button[data-date="${qe(i)}"]`),!n)return null;return i}function Md(s){return Cd[s]??null}var Dd=Object.defineProperty,Od=Object.getOwnPropertyDescriptor,_e=(s,e,t,i)=>{for(var n=i>1?void 0:i?Od(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Dd(e,t,n),n};let ve=class extends ke{constructor(){super(...arguments),this.selected=[],this.multiple=_s.props.multiple.default,this.maxMultiple=_s.props.maxMultiple.default,this.range=_s.props.range.default,this.earliest=_s.props.earliest.default,this.latest=_s.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.weeknumbers=_s.props.weeknumbers.default,this.withcontrols=_s.props.withcontrols.default,this.currentmonth=null,this.today=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.inRange={},this.rangeHovered=null,this.year=0,this.month=0,this.week=0,this.currentmonthtouched=!1,this.focusedDate=null,this.selectableDates=[],this.tabIndexSet=0}get todayDate(){return this.today?zt(this.today):rd()}firstUpdated(e){this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}updated(e){super.updated(e),e.has("selected")&&this.convertSelected()}convertSelected(){typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=js(this.selected),this.range&&this.selected.length===2&&(this.inRange=ma(this._selected[0],this._selected[1])),this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==""){const e=zt(this.selected[this.selected.length-1]);this.currentmonth=isNaN(e.getTime())?bi(this.todayDate):e}else this.currentmonth===null&&(this.currentmonth=bi(this.todayDate));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=bi(this.todayDate)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(e){const t=Md(e.key);t!==null&&this.handleArrowKey(e,t)}handleArrowKey(e,t){const i=e.target;if(Td(i))return;if(e.preventDefault(),!this.focusedDate){this.focusOnCurrentDate();return}const n=this.focusedDate?Ct(this.focusedDate):ks(this.year,this.month,1),r=Nd(n,t,this.querySelector.bind(this));if(r){const a=this.querySelector(`button[data-date="${qe(r)}"]`);a instanceof HTMLButtonElement&&!a.dataset.disabled&&(this.focusedDate=qe(r),a.focus())}}render(){return v`
206
206
  <div
207
207
  class="pkt-calendar ${this.weeknumbers?"pkt-cal-weeknumbers":""}"
208
208
  @focusout=${this.closeEvent}
@@ -226,7 +226,7 @@
226
226
  </tbody>
227
227
  </table>
228
228
  </div>
229
- `}renderMonthNavButton(e){const t=e==="prev",i=t?this.isPrevMonthAllowed():this.isNextMonthAllowed(),n=t?this.prevMonthString:this.nextMonthString,r=t?"chevron-thin-left":"chevron-thin-right",a=t?"pkt-calendar__prev-month":"pkt-calendar__next-month",l=t?()=>this.prevMonth():()=>this.nextMonth();return b`<div>
229
+ `}renderMonthNavButton(e){const t=e==="prev",i=t?this.isPrevMonthAllowed():this.isNextMonthAllowed(),n=t?this.prevMonthString:this.nextMonthString,r=t?"chevron-thin-left":"chevron-thin-right",a=t?"pkt-calendar__prev-month":"pkt-calendar__next-month",l=t?()=>this.prevMonth():()=>this.nextMonth();return v`<div>
230
230
  <button
231
231
  type="button"
232
232
  aria-label="${n}"
@@ -240,11 +240,11 @@
240
240
  <pkt-icon class="pkt-btn__icon" name="${r}"></pkt-icon>
241
241
  <span class="pkt-btn__text">${n}</span>
242
242
  </button>
243
- </div>`}renderDayNames(){const e=[];this.weeknumbers&&e.push(b`<th><div class="pkt-calendar__week-number">${this.weekString}</div></th>`);for(let t=0;t<this.dayStrings.length;t++)e.push(b`<th>
243
+ </div>`}renderDayNames(){const e=[];this.weeknumbers&&e.push(v`<th><div class="pkt-calendar__week-number">${this.weekString}</div></th>`);for(let t=0;t<this.dayStrings.length;t++)e.push(v`<th>
244
244
  <div class="pkt-calendar__day-name" aria-label="${this.dayStringsLong[t]}">
245
245
  ${this.dayStrings[t]}
246
246
  </div>
247
- </th>`);return b`<tr class="pkt-cal-week-row">${e}</tr>`}renderMonthNav(){return this.withcontrols?b`<div class="pkt-cal-month-picker">
247
+ </th>`);return v`<tr class="pkt-cal-week-row">${e}</tr>`}renderMonthNav(){return this.withcontrols?v`<div class="pkt-cal-month-picker">
248
248
  <label for="${this.id}-monthnav" class="pkt-hide">${this.strings.dates.month}</label>
249
249
  <select
250
250
  aria-label="${this.strings.dates.month}"
@@ -252,7 +252,7 @@
252
252
  id="${this.id}-monthnav"
253
253
  @change=${e=>{e.stopImmediatePropagation();const t=e.target;this.changeMonth(this.year,parseInt(t.value))}}
254
254
  >
255
- ${this.monthStrings.map((e,t)=>b`<option value=${t} ?selected=${this.month===t}>${e}</option>`)}
255
+ ${this.monthStrings.map((e,t)=>v`<option value=${t} ?selected=${this.month===t}>${e}</option>`)}
256
256
  </select>
257
257
  <label for="${this.id}-yearnav" class="pkt-hide">${this.strings.dates.year}</label>
258
258
  <input
@@ -265,14 +265,14 @@
265
265
  @change=${e=>{e.stopImmediatePropagation();const t=e.target;this.changeMonth(parseInt(t.value),this.month)}}
266
266
  .value=${this.year}
267
267
  />
268
- </div>`:b`<div class="pkt-txt-16-medium pkt-calendar__month-title" aria-live="polite">
268
+ </div>`:v`<div class="pkt-txt-16-medium pkt-calendar__month-title" aria-live="polite">
269
269
  ${this.monthStrings[this.month]} ${this.year}
270
- </div>`}getDayViewData(e,t){const i=ks(this.year,this.month,e),n=qe(i),r=n===qe(t),a=this.selected.includes(n),l=this.isDayDisabled(i,a),d=this.calculateTabIndex(n,l,e);return{currentDate:i,currentDateISO:n,isToday:r,isSelected:a,isDisabled:l,ariaLabel:ad(i),tabindex:d}}getDateConstraints(){return{earliest:this.earliest,latest:this.latest,excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}}isDayDisabled(e,t){return vd(e,t,this.getDateConstraints(),{multiple:this.multiple,maxMultiple:this.maxMultiple,selectedCount:this.selected.length})}calculateTabIndex(e,t,i){return this.focusedDate?this.focusedDate===e&&!t?"0":"-1":!t&&this.tabIndexSet===0?(this.tabIndexSet=i,"0"):this.tabIndexSet===i?"0":"-1"}getDayCellClasses(e){const{currentDateISO:t,isToday:i,isSelected:n}=e,r=this.range&&(this.selected.length===2||this.rangeHovered!==null)&&t===this.selected[0],a=this.range&&this.selected.length===2&&t===this.selected[1];return{"pkt-cal-today":i,"pkt-cal-selected":n,"pkt-cal-in-range":this.inRange[t],"pkt-cal-excluded":this.isExcluded(e.currentDate),"pkt-cal-in-range-first":r,"pkt-cal-in-range-last":a,"pkt-cal-range-hover":this.rangeHovered!==null&&t===qe(this.rangeHovered)}}getDayButtonClasses(e){const{currentDateISO:t,isToday:i,isSelected:n,isDisabled:r}=e,a=this.range&&(this.selected.length===2||this.rangeHovered!==null)&&t===this.selected[0],l=this.range&&this.selected.length===2&&t===this.selected[1];return{"pkt-calendar__date":!0,"pkt-calendar__date--today":i,"pkt-calendar__date--selected":n,"pkt-calendar__date--disabled":r,"pkt-calendar__date--in-range":this.inRange[t],"pkt-calendar__date--in-range-hover":this.rangeHovered!==null&&t===qe(this.rangeHovered),"pkt-calendar__date--range-start":a,"pkt-calendar__date--range-end":l}}handleDayFocus(e,t){this.range&&!this.isExcluded(e)&&this.handleRangeHover(e),this.focusedDate=t}renderDayView(e,t){const i=this.getDayViewData(e,t),{currentDate:n,currentDateISO:r,isSelected:a,isDisabled:l,ariaLabel:d,tabindex:p}=i;this.selectableDates.push({currentDateISO:r,isDisabled:l,tabindex:p});const m=this.getDayCellClasses(i),v=this.getDayButtonClasses(i);return b`<td class=${I(m)}>
270
+ </div>`}getDayViewData(e,t){const i=ks(this.year,this.month,e),n=qe(i),r=n===qe(t),a=this.selected.includes(n),l=this.isDayDisabled(i,a),d=this.calculateTabIndex(n,l,e);return{currentDate:i,currentDateISO:n,isToday:r,isSelected:a,isDisabled:l,ariaLabel:ad(i),tabindex:d}}getDateConstraints(){return{earliest:this.earliest,latest:this.latest,excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}}isDayDisabled(e,t){return vd(e,t,this.getDateConstraints(),{multiple:this.multiple,maxMultiple:this.maxMultiple,selectedCount:this.selected.length})}calculateTabIndex(e,t,i){return this.focusedDate?this.focusedDate===e&&!t?"0":"-1":!t&&this.tabIndexSet===0?(this.tabIndexSet=i,"0"):this.tabIndexSet===i?"0":"-1"}getDayCellClasses(e){const{currentDateISO:t,isToday:i,isSelected:n}=e,r=this.range&&(this.selected.length===2||this.rangeHovered!==null)&&t===this.selected[0],a=this.range&&this.selected.length===2&&t===this.selected[1];return{"pkt-cal-today":i,"pkt-cal-selected":n,"pkt-cal-in-range":this.inRange[t],"pkt-cal-excluded":this.isExcluded(e.currentDate),"pkt-cal-in-range-first":r,"pkt-cal-in-range-last":a,"pkt-cal-range-hover":this.rangeHovered!==null&&t===qe(this.rangeHovered)}}getDayButtonClasses(e){const{currentDateISO:t,isToday:i,isSelected:n,isDisabled:r}=e,a=this.range&&(this.selected.length===2||this.rangeHovered!==null)&&t===this.selected[0],l=this.range&&this.selected.length===2&&t===this.selected[1];return{"pkt-calendar__date":!0,"pkt-calendar__date--today":i,"pkt-calendar__date--selected":n,"pkt-calendar__date--disabled":r,"pkt-calendar__date--in-range":this.inRange[t],"pkt-calendar__date--in-range-hover":this.rangeHovered!==null&&t===qe(this.rangeHovered),"pkt-calendar__date--range-start":a,"pkt-calendar__date--range-end":l}}handleDayFocus(e,t){this.range&&!this.isExcluded(e)&&this.handleRangeHover(e),this.focusedDate=t}renderDayView(e,t){const i=this.getDayViewData(e,t),{currentDate:n,currentDateISO:r,isSelected:a,isDisabled:l,ariaLabel:d,tabindex:p}=i;this.selectableDates.push({currentDateISO:r,isDisabled:l,tabindex:p});const m=this.getDayCellClasses(i),b=this.getDayButtonClasses(i);return v`<td class=${I(m)}>
271
271
  <button
272
272
  type="button"
273
273
  aria-pressed=${a?"true":"false"}
274
274
  ?disabled=${l}
275
- class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${I(v)}"
275
+ class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${I(b)}"
276
276
  @mouseover=${()=>this.range&&!this.isExcluded(n)&&this.handleRangeHover(n)}
277
277
  @focus=${()=>this.handleDayFocus(n,r)}
278
278
  aria-label="${d}"
@@ -284,14 +284,14 @@
284
284
  >
285
285
  <span class="pkt-btn__text pkt-txt-14-light">${e}</span>
286
286
  </button>
287
- </td>`}renderEmptyDayCell(e){return b`<td class="pkt-cal-other">
287
+ </td>`}renderEmptyDayCell(e){return v`<td class="pkt-cal-other">
288
288
  <div
289
289
  class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
290
290
  data-disabled="disabled"
291
291
  >
292
292
  <span class="pkt-btn__text pkt-txt-14-light">${e}</span>
293
293
  </div>
294
- </td>`}renderWeekRow(e){return b`<tr class="pkt-cal-week-row" role="row">${e}</tr>`}renderCalendarBody(){const e=this.todayDate,t=_d(this.year,this.month);this.selectableDates=[],this.tabIndexSet=0;let i=1;this.week=t.initialWeek;const n=[];for(let r=0;r<t.numRows;r++){const a=[];this.weeknumbers&&a.push(b`<td class="pkt-cal-week">${this.week}</td>`),this.week++;for(let l=0;l<ki;l++){const d=$d(r,l,i,t);if(d==="current-month")a.push(this.renderDayView(i,e)),i++;else{const p=wd(d,l,i,t);a.push(this.renderEmptyDayCell(p)),d==="next-month"&&i++}}n.push(this.renderWeekRow(a))}return n}isExcluded(e){return fa(e,this.getDateConstraints())}isPrevMonthAllowed(){return bd(this.year,this.month,this.earliest)}prevMonth(){const e=this.month===0?11:this.month-1,t=this.month===0?this.year-1:this.year;this.changeMonth(t,e)}isNextMonthAllowed(){return yd(this.year,this.month,this.latest)}nextMonth(){const e=this.month===11?0:this.month+1,t=this.month===11?this.year+1:this.year;this.changeMonth(t,e)}changeMonth(e,t){this.year=typeof e=="string"?parseInt(e):e,this.month=typeof t=="string"?parseInt(t):t,this.currentmonth=bi(new Date(this.year,this.month,1)),this.tabIndexSet=0,this.focusedDate=null,this.selectableDates=[]}emptySelected(){this.selected=[],this._selected=[],this.inRange={}}normalizeSelected(){return typeof this.selected=="string"?this.selected.split(","):this.selected}addToSelected(e){this.selected=An(e,this.normalizeSelected()),this._selected=js(this.selected),this.range&&this.selected.length===2&&(this.convertSelected(),this.close())}removeFromSelected(e){this.selected=In(e,this.normalizeSelected()),this._selected=js(this.selected)}toggleSelected(e){this.selected=xd(e,this.normalizeSelected(),this.maxMultiple),this._selected=js(this.selected)}isRangeAllowed(e){return ga(e,this._selected,this.excludedates,this.excludeweekdays)}handleRangeSelect(e){return this.selected=Sd(e,this.normalizeSelected(),{excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}),this._selected=js(this.selected),this.selected.length===2?(this.convertSelected(),this.close()):this.selected.length===1&&(this.inRange={}),Promise.resolve()}handleRangeHover(e){if(!this.range||this._selected.length!==1||!this.isRangeAllowed(e)||this._selected[0]>=e){this.rangeHovered=null;return}this.rangeHovered=e,this.inRange=ma(this._selected[0],e)}handleDateSelect(e){return e&&(this.range?this.handleRangeSelect(e):this.multiple?this.toggleSelected(e):(this.selected.includes(qe(e))?this.emptySelected():(this.emptySelected(),this.addToSelected(e)),this.close()),this.dispatchEvent(new CustomEvent("date-selected",{detail:this.selected,bubbles:!0,composed:!0}))),Promise.resolve()}focusOnCurrentDate(){const e=qe(bi(this.todayDate)),t=this.querySelector(`button[data-date="${e}"]`);if(t instanceof HTMLButtonElement){this.focusedDate=e,t.focus();return}const i=this.selectableDates.find(n=>!n.isDisabled);if(i){const n=this.querySelector(`button[data-date="${i.currentDateISO}"]`);n instanceof HTMLButtonElement&&(this.focusedDate=i.currentDateISO,n.focus())}}closeEvent(e){!this.contains(e.relatedTarget)&&!e.target.classList.contains("pkt-invisible")&&this.close()}close(){this.dispatchEvent(new CustomEvent("close",{detail:!0,bubbles:!0,composed:!0}))}};_e([c({converter:Us.csvToArray})],ve.prototype,"selected",2),_e([c({type:Boolean})],ve.prototype,"multiple",2),_e([c({type:Number,attribute:"max-multiple"})],ve.prototype,"maxMultiple",2),_e([c({type:Boolean})],ve.prototype,"range",2),_e([c({type:String})],ve.prototype,"earliest",2),_e([c({type:String})],ve.prototype,"latest",2),_e([c({converter:Us.stringsToDate})],ve.prototype,"excludedates",2),_e([c({converter:Us.csvToArray})],ve.prototype,"excludeweekdays",2),_e([c({type:Boolean})],ve.prototype,"weeknumbers",2),_e([c({type:Boolean})],ve.prototype,"withcontrols",2),_e([c({converter:Us.stringToDate})],ve.prototype,"currentmonth",2),_e([c({type:String})],ve.prototype,"today",2),_e([c({type:Array,attribute:"day-strings"})],ve.prototype,"dayStrings",2),_e([c({type:Array,attribute:"day-strings-long"})],ve.prototype,"dayStringsLong",2),_e([c({type:Array,attribute:"month-strings"})],ve.prototype,"monthStrings",2),_e([c({type:String,attribute:"week-string"})],ve.prototype,"weekString",2),_e([c({type:String,attribute:"prev-month-string"})],ve.prototype,"prevMonthString",2),_e([c({type:String,attribute:"next-month-string"})],ve.prototype,"nextMonthString",2),_e([c({type:Array})],ve.prototype,"_selected",2),_e([Z()],ve.prototype,"inRange",2),_e([c({type:Date})],ve.prototype,"rangeHovered",2),_e([c({type:Number})],ve.prototype,"year",2),_e([c({type:Number})],ve.prototype,"month",2),_e([c({type:Number})],ve.prototype,"week",2),_e([Z()],ve.prototype,"currentmonthtouched",2),_e([Z()],ve.prototype,"focusedDate",2),ve=_e([ee("pkt-calendar")],ve);const Ed={size:{default:"medium"},skin:{default:"blue"},closeTag:{default:!1},type:{default:"button"}},Ji={props:Ed};var Pd=Object.defineProperty,Ad=Object.getOwnPropertyDescriptor,Ft=(s,e,t,i)=>{for(var n=i>1?void 0:i?Ad(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Pd(e,t,n),n};let Ot=class extends ke{constructor(){super(),this.defaultSlot=B(),this.closeTag=Ji.props.closeTag.default,this.size=Ji.props.size.default,this.skin=Ji.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=Ji.props.type.default,this.ariaLabel=null,this._isClosed=!1,this._ariaDescription=null,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!1,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:e},bubbles:!1,composed:!0}))},this.slotController=new Le(this,this.defaultSlot),this._isClosed=!1}firstUpdated(e){var t,i;if(super.firstUpdated(e),this.closeTag&&!this.ariaLabel){const n=(i=(t=this.defaultSlot.value)==null?void 0:t.textContent)==null?void 0:i.trim();n&&(this._ariaDescription=`Klikk for å fjerne ${n}`)}}render(){const e={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},t={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${this.textStyle}`]:!!this.textStyle,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,"pkt-btn--icons-right-and-left":this.closeTag&&!!this.iconName,"pkt-hide":this._isClosed};return this.closeTag?b`
294
+ </td>`}renderWeekRow(e){return v`<tr class="pkt-cal-week-row" role="row">${e}</tr>`}renderCalendarBody(){const e=this.todayDate,t=_d(this.year,this.month);this.selectableDates=[],this.tabIndexSet=0;let i=1;this.week=t.initialWeek;const n=[];for(let r=0;r<t.numRows;r++){const a=[];this.weeknumbers&&a.push(v`<td class="pkt-cal-week">${this.week}</td>`),this.week++;for(let l=0;l<ki;l++){const d=$d(r,l,i,t);if(d==="current-month")a.push(this.renderDayView(i,e)),i++;else{const p=wd(d,l,i,t);a.push(this.renderEmptyDayCell(p)),d==="next-month"&&i++}}n.push(this.renderWeekRow(a))}return n}isExcluded(e){return fa(e,this.getDateConstraints())}isPrevMonthAllowed(){return bd(this.year,this.month,this.earliest)}prevMonth(){const e=this.month===0?11:this.month-1,t=this.month===0?this.year-1:this.year;this.changeMonth(t,e)}isNextMonthAllowed(){return yd(this.year,this.month,this.latest)}nextMonth(){const e=this.month===11?0:this.month+1,t=this.month===11?this.year+1:this.year;this.changeMonth(t,e)}changeMonth(e,t){this.year=typeof e=="string"?parseInt(e):e,this.month=typeof t=="string"?parseInt(t):t,this.currentmonth=bi(new Date(this.year,this.month,1)),this.tabIndexSet=0,this.focusedDate=null,this.selectableDates=[]}emptySelected(){this.selected=[],this._selected=[],this.inRange={}}normalizeSelected(){return typeof this.selected=="string"?this.selected.split(","):this.selected}addToSelected(e){this.selected=An(e,this.normalizeSelected()),this._selected=js(this.selected),this.range&&this.selected.length===2&&(this.convertSelected(),this.close())}removeFromSelected(e){this.selected=In(e,this.normalizeSelected()),this._selected=js(this.selected)}toggleSelected(e){this.selected=xd(e,this.normalizeSelected(),this.maxMultiple),this._selected=js(this.selected)}isRangeAllowed(e){return ga(e,this._selected,this.excludedates,this.excludeweekdays)}handleRangeSelect(e){return this.selected=Sd(e,this.normalizeSelected(),{excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}),this._selected=js(this.selected),this.selected.length===2?(this.convertSelected(),this.close()):this.selected.length===1&&(this.inRange={}),Promise.resolve()}handleRangeHover(e){if(!this.range||this._selected.length!==1||!this.isRangeAllowed(e)||this._selected[0]>=e){this.rangeHovered=null;return}this.rangeHovered=e,this.inRange=ma(this._selected[0],e)}handleDateSelect(e){return e&&(this.range?this.handleRangeSelect(e):this.multiple?this.toggleSelected(e):(this.selected.includes(qe(e))?this.emptySelected():(this.emptySelected(),this.addToSelected(e)),this.close()),this.dispatchEvent(new CustomEvent("date-selected",{detail:this.selected,bubbles:!0,composed:!0}))),Promise.resolve()}focusOnCurrentDate(){const e=qe(bi(this.todayDate)),t=this.querySelector(`button[data-date="${e}"]`);if(t instanceof HTMLButtonElement){this.focusedDate=e,t.focus();return}const i=this.selectableDates.find(n=>!n.isDisabled);if(i){const n=this.querySelector(`button[data-date="${i.currentDateISO}"]`);n instanceof HTMLButtonElement&&(this.focusedDate=i.currentDateISO,n.focus())}}closeEvent(e){!this.contains(e.relatedTarget)&&!e.target.classList.contains("pkt-invisible")&&this.close()}close(){this.dispatchEvent(new CustomEvent("close",{detail:!0,bubbles:!0,composed:!0}))}};_e([c({converter:Us.csvToArray})],ve.prototype,"selected",2),_e([c({type:Boolean})],ve.prototype,"multiple",2),_e([c({type:Number,attribute:"max-multiple"})],ve.prototype,"maxMultiple",2),_e([c({type:Boolean})],ve.prototype,"range",2),_e([c({type:String})],ve.prototype,"earliest",2),_e([c({type:String})],ve.prototype,"latest",2),_e([c({converter:Us.stringsToDate})],ve.prototype,"excludedates",2),_e([c({converter:Us.csvToArray})],ve.prototype,"excludeweekdays",2),_e([c({type:Boolean})],ve.prototype,"weeknumbers",2),_e([c({type:Boolean})],ve.prototype,"withcontrols",2),_e([c({converter:Us.stringToDate})],ve.prototype,"currentmonth",2),_e([c({type:String})],ve.prototype,"today",2),_e([c({type:Array,attribute:"day-strings"})],ve.prototype,"dayStrings",2),_e([c({type:Array,attribute:"day-strings-long"})],ve.prototype,"dayStringsLong",2),_e([c({type:Array,attribute:"month-strings"})],ve.prototype,"monthStrings",2),_e([c({type:String,attribute:"week-string"})],ve.prototype,"weekString",2),_e([c({type:String,attribute:"prev-month-string"})],ve.prototype,"prevMonthString",2),_e([c({type:String,attribute:"next-month-string"})],ve.prototype,"nextMonthString",2),_e([c({type:Array})],ve.prototype,"_selected",2),_e([Z()],ve.prototype,"inRange",2),_e([c({type:Date})],ve.prototype,"rangeHovered",2),_e([c({type:Number})],ve.prototype,"year",2),_e([c({type:Number})],ve.prototype,"month",2),_e([c({type:Number})],ve.prototype,"week",2),_e([Z()],ve.prototype,"currentmonthtouched",2),_e([Z()],ve.prototype,"focusedDate",2),ve=_e([ee("pkt-calendar")],ve);const Ed={size:{default:"medium"},skin:{default:"blue"},closeTag:{default:!1},type:{default:"button"}},Ji={props:Ed};var Pd=Object.defineProperty,Ad=Object.getOwnPropertyDescriptor,Ft=(s,e,t,i)=>{for(var n=i>1?void 0:i?Ad(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Pd(e,t,n),n};let Ot=class extends ke{constructor(){super(),this.defaultSlot=B(),this.closeTag=Ji.props.closeTag.default,this.size=Ji.props.size.default,this.skin=Ji.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=Ji.props.type.default,this.ariaLabel=null,this._isClosed=!1,this._ariaDescription=null,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!1,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:e},bubbles:!1,composed:!0}))},this.slotController=new Le(this,this.defaultSlot),this._isClosed=!1}firstUpdated(e){var t,i;if(super.firstUpdated(e),this.closeTag&&!this.ariaLabel){const n=(i=(t=this.defaultSlot.value)==null?void 0:t.textContent)==null?void 0:i.trim();n&&(this._ariaDescription=`Klikk for å fjerne ${n}`)}}render(){const e={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},t={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${this.textStyle}`]:!!this.textStyle,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,"pkt-btn--icons-right-and-left":this.closeTag&&!!this.iconName,"pkt-hide":this._isClosed};return this.closeTag?v`
295
295
  <button
296
296
  class=${I(t)}
297
297
  type=${this.type}
@@ -299,7 +299,7 @@
299
299
  aria-label=${P(this.ariaLabel||void 0)}
300
300
  aria-description=${P(this._ariaDescription||void 0)}
301
301
  >
302
- ${this.iconName&&b`<pkt-icon
302
+ ${this.iconName&&v`<pkt-icon
303
303
  class="pkt-tag__icon"
304
304
  name=${this.iconName}
305
305
  aria-hidden="true"
@@ -307,16 +307,16 @@
307
307
  <span ${F(this.defaultSlot)}></span>
308
308
  <pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
309
309
  </button>
310
- `:b`
310
+ `:v`
311
311
  <span class=${I(e)}>
312
- ${this.iconName&&b`<pkt-icon
312
+ ${this.iconName&&v`<pkt-icon
313
313
  class="pkt-tag__icon"
314
314
  name=${this.iconName}
315
315
  aria-hidden="true"
316
316
  ></pkt-icon>`}
317
317
  <span ${F(this.defaultSlot)}></span>
318
318
  </span>
319
- `}};Ft([c({type:Boolean,reflect:!0})],Ot.prototype,"closeTag",2),Ft([c({type:String,reflect:!0})],Ot.prototype,"size",2),Ft([c({type:String,reflect:!0})],Ot.prototype,"skin",2),Ft([c({type:String,reflect:!0})],Ot.prototype,"textStyle",2),Ft([c({type:String,reflect:!0})],Ot.prototype,"iconName",2),Ft([c({type:String})],Ot.prototype,"type",2),Ft([c({type:String})],Ot.prototype,"ariaLabel",2),Ft([Z()],Ot.prototype,"_isClosed",2),Ft([Z()],Ot.prototype,"_ariaDescription",2),Ot=Ft([ee("pkt-tag")],Ot);var Id=Object.defineProperty,Ld=Object.getOwnPropertyDescriptor,qs=(s,e,t,i)=>{for(var n=i>1?void 0:i?Ld(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Id(e,t,n),n};let ss=class extends Wi{constructor(){super(...arguments),this.size=void 0,this.level=2,this.weight=void 0,this.visuallyHidden=!1,this.align=void 0}connectedCallback(){super.connectedCallback(),this.setAttribute("role","heading"),this.setAttribute("aria-level",String(this.level)),this.updateHostClasses()}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),e==="level"&&i&&this.setLevel(Number(i)),e==="visuallyHidden"&&(this.visuallyHidden=i!==null&&i!=="false"),(e==="size"||e==="visuallyHidden"||e==="align"||e==="weight")&&this.updateHostClasses()}updated(e){super.updated(e),e.has("level")&&(this.setLevel(this.level),this.hasAttribute("size")||(this.size=this.defaultSizeForLevel),this.hasAttribute("weight")||(this.weight=this.defaultWeightForLevel)),!this.hasAttribute("size")&&(e.has("level")||this.size===void 0)&&(this.size=this.defaultSizeForLevel),(e.has("size")||e.has("visuallyHidden")||e.has("align")||e.has("weight"))&&this.updateHostClasses()}setLevel(e){e>=1&&e<=6?(this.level=e,this.setAttribute("aria-level",String(e))):console.warn(`Invalid heading level: ${e}. Must be between 1 and 6.`)}get defaultSizeForLevel(){switch(this.level){case 1:return"xlarge";case 2:return"large";case 3:return"medium";case 4:return"small";case 5:return"xsmall";case 6:return"xsmall";default:return"medium"}}get defaultWeightForLevel(){switch(this.level){case 1:return"regular";case 2:return"regular";case 3:return"medium";case 4:return"medium";case 5:return"medium";case 6:return"medium";default:return"medium"}}updateHostClasses(){this.classList.remove("pkt-heading","pkt-heading--xsmall","pkt-heading--small","pkt-heading--medium","pkt-heading--large","pkt-heading--xlarge","pkt-sr-only","pkt-heading--start","pkt-heading--center","pkt-heading--end","pkt-heading--light","pkt-heading--regular","pkt-heading--medium","pkt-heading--bold"),this.classList.add("pkt-heading"),this.size&&this.classList.add(`pkt-heading--${this.size}`),this.weight&&this.classList.add(`pkt-heading--fw-${this.weight}`),this.visuallyHidden&&this.classList.add("pkt-sr-only"),this.align&&this.classList.add(`pkt-heading--${this.align}`)}render(){return b`<slot></slot>`}};qs([c({type:String,reflect:!0})],ss.prototype,"size",2),qs([c({type:Number,reflect:!0})],ss.prototype,"level",2),qs([c({type:String,reflect:!0})],ss.prototype,"weight",2),qs([c({type:Boolean,reflect:!0})],ss.prototype,"visuallyHidden",2),qs([c({type:String,reflect:!0})],ss.prototype,"align",2),ss=qs([ee("pkt-heading")],ss);const Bd={layout:{default:"vertical"},skin:{type:["outlined","outlined-beige","gray","blue","beige","green"],default:"outlined"},padding:{default:"default"}},Ws={props:Bd};var Fd=Object.defineProperty,Hd=Object.getOwnPropertyDescriptor,it=(s,e,t,i)=>{for(var n=i>1?void 0:i?Hd(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Fd(e,t,n),n};let We=class extends ke{constructor(){super(),this.defaultSlot=B(),this.ariaLabel="",this.metaLead=null,this.borderOnHover=!0,this.clickCardLink=null,this.metaTrail=null,this.layout=Ws.props.layout.default,this.heading="",this.headinglevel=3,this.image={src:"",alt:""},this.imageShape="square",this.openLinkInNewTab=!1,this.padding=Ws.props.padding.default,this.skin=Ws.props.skin.default,this.subheading="",this.tagPosition="top",this.tags=[],this.slotController=new Le(this,this.defaultSlot)}connectedCallback(){super.connectedCallback()}render(){var e,t;const i={"pkt-card":!0,[`pkt-card--${this.skin}`]:this.skin,[`pkt-card--${this.layout}`]:this.layout,[`pkt-card--padding-${this.padding}`]:this.padding,"pkt-card--border-on-hover":this.borderOnHover},n=((e=this.ariaLabel)==null?void 0:e.trim())||(this.heading?`${this.heading} lenkekort`:"lenkekort"),r=((t=this.ariaLabel)==null?void 0:t.trim())||(this.heading?this.heading:"kort");return b`
319
+ `}};Ft([c({type:Boolean,reflect:!0})],Ot.prototype,"closeTag",2),Ft([c({type:String,reflect:!0})],Ot.prototype,"size",2),Ft([c({type:String,reflect:!0})],Ot.prototype,"skin",2),Ft([c({type:String,reflect:!0})],Ot.prototype,"textStyle",2),Ft([c({type:String,reflect:!0})],Ot.prototype,"iconName",2),Ft([c({type:String})],Ot.prototype,"type",2),Ft([c({type:String})],Ot.prototype,"ariaLabel",2),Ft([Z()],Ot.prototype,"_isClosed",2),Ft([Z()],Ot.prototype,"_ariaDescription",2),Ot=Ft([ee("pkt-tag")],Ot);var Id=Object.defineProperty,Ld=Object.getOwnPropertyDescriptor,qs=(s,e,t,i)=>{for(var n=i>1?void 0:i?Ld(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Id(e,t,n),n};let ss=class extends Wi{constructor(){super(...arguments),this.size=void 0,this.level=2,this.weight=void 0,this.visuallyHidden=!1,this.align=void 0}connectedCallback(){super.connectedCallback(),this.setAttribute("role","heading"),this.setAttribute("aria-level",String(this.level)),this.updateHostClasses()}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),e==="level"&&i&&this.setLevel(Number(i)),e==="visuallyHidden"&&(this.visuallyHidden=i!==null&&i!=="false"),(e==="size"||e==="visuallyHidden"||e==="align"||e==="weight")&&this.updateHostClasses()}updated(e){super.updated(e),e.has("level")&&(this.setLevel(this.level),this.hasAttribute("size")||(this.size=this.defaultSizeForLevel),this.hasAttribute("weight")||(this.weight=this.defaultWeightForLevel)),!this.hasAttribute("size")&&(e.has("level")||this.size===void 0)&&(this.size=this.defaultSizeForLevel),(e.has("size")||e.has("visuallyHidden")||e.has("align")||e.has("weight"))&&this.updateHostClasses()}setLevel(e){e>=1&&e<=6?(this.level=e,this.setAttribute("aria-level",String(e))):console.warn(`Invalid heading level: ${e}. Must be between 1 and 6.`)}get defaultSizeForLevel(){switch(this.level){case 1:return"xlarge";case 2:return"large";case 3:return"medium";case 4:return"small";case 5:return"xsmall";case 6:return"xsmall";default:return"medium"}}get defaultWeightForLevel(){switch(this.level){case 1:return"regular";case 2:return"regular";case 3:return"medium";case 4:return"medium";case 5:return"medium";case 6:return"medium";default:return"medium"}}updateHostClasses(){this.classList.remove("pkt-heading","pkt-heading--xsmall","pkt-heading--small","pkt-heading--medium","pkt-heading--large","pkt-heading--xlarge","pkt-sr-only","pkt-heading--start","pkt-heading--center","pkt-heading--end","pkt-heading--light","pkt-heading--regular","pkt-heading--medium","pkt-heading--bold"),this.classList.add("pkt-heading"),this.size&&this.classList.add(`pkt-heading--${this.size}`),this.weight&&this.classList.add(`pkt-heading--fw-${this.weight}`),this.visuallyHidden&&this.classList.add("pkt-sr-only"),this.align&&this.classList.add(`pkt-heading--${this.align}`)}render(){return v`<slot></slot>`}};qs([c({type:String,reflect:!0})],ss.prototype,"size",2),qs([c({type:Number,reflect:!0})],ss.prototype,"level",2),qs([c({type:String,reflect:!0})],ss.prototype,"weight",2),qs([c({type:Boolean,reflect:!0})],ss.prototype,"visuallyHidden",2),qs([c({type:String,reflect:!0})],ss.prototype,"align",2),ss=qs([ee("pkt-heading")],ss);const Bd={layout:{default:"vertical"},skin:{type:["outlined","outlined-beige","gray","blue","beige","green"],default:"outlined"},padding:{default:"default"}},Ws={props:Bd};var Fd=Object.defineProperty,Hd=Object.getOwnPropertyDescriptor,it=(s,e,t,i)=>{for(var n=i>1?void 0:i?Hd(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Fd(e,t,n),n};let We=class extends ke{constructor(){super(),this.defaultSlot=B(),this.ariaLabel="",this.metaLead=null,this.borderOnHover=!0,this.clickCardLink=null,this.metaTrail=null,this.layout=Ws.props.layout.default,this.heading="",this.headinglevel=3,this.image={src:"",alt:""},this.imageShape="square",this.openLinkInNewTab=!1,this.padding=Ws.props.padding.default,this.skin=Ws.props.skin.default,this.subheading="",this.tagPosition="top",this.tags=[],this.slotController=new Le(this,this.defaultSlot)}connectedCallback(){super.connectedCallback()}render(){var e,t;const i={"pkt-card":!0,[`pkt-card--${this.skin}`]:this.skin,[`pkt-card--${this.layout}`]:this.layout,[`pkt-card--padding-${this.padding}`]:this.padding,"pkt-card--border-on-hover":this.borderOnHover},n=((e=this.ariaLabel)==null?void 0:e.trim())||(this.heading?`${this.heading} lenkekort`:"lenkekort"),r=((t=this.ariaLabel)==null?void 0:t.trim())||(this.heading?this.heading:"kort");return v`
320
320
  <article
321
321
  class=${I(i)}
322
322
  aria-label=${P(this.clickCardLink?n:r)}
@@ -330,14 +330,14 @@
330
330
  ${this.renderMetadata()}
331
331
  </div>
332
332
  </article>
333
- `}renderImage(){const e={"pkt-card__image":!0,[`pkt-card__image-${this.imageShape}`]:this.imageShape};return b`
334
- ${this.image.src&&b`
333
+ `}renderImage(){const e={"pkt-card__image":!0,[`pkt-card__image-${this.imageShape}`]:this.imageShape};return v`
334
+ ${this.image.src&&v`
335
335
  <div class=${I(e)}>
336
336
  <img src=${this.image.src} alt=${this.image.alt||""} />
337
337
  </div>
338
338
  `}
339
- `}renderHeading(){return b`
340
- ${this.heading&&!this.clickCardLink?b`
339
+ `}renderHeading(){return v`
340
+ ${this.heading&&!this.clickCardLink?v`
341
341
  <pkt-heading
342
342
  class="pkt-card__heading"
343
343
  .level=${this.headinglevel||3}
@@ -348,8 +348,8 @@
348
348
  ${this.heading}
349
349
  </pkt-heading>
350
350
  `:w}
351
- `}renderLinkHeading(){return b`
352
- ${this.clickCardLink?b`
351
+ `}renderLinkHeading(){return v`
352
+ ${this.clickCardLink?v`
353
353
  <pkt-heading
354
354
  class="pkt-card__link-heading pkt-card__heading"
355
355
  .level=${this.headinglevel||3}
@@ -365,24 +365,24 @@
365
365
  >
366
366
  </pkt-heading>
367
367
  `:w}
368
- `}renderSubheading(){return b`
369
- ${this.subheading?b` <p class="pkt-card__subheading ">${this.subheading}</p> `:w}
370
- `}renderHeader(){const e=!!this.heading||!!this.subheading;return b`
371
- ${e?b`
368
+ `}renderSubheading(){return v`
369
+ ${this.subheading?v` <p class="pkt-card__subheading ">${this.subheading}</p> `:w}
370
+ `}renderHeader(){const e=!!this.heading||!!this.subheading;return v`
371
+ ${e?v`
372
372
  <header class="pkt-card__header">
373
373
  ${this.renderHeading()}
374
374
  ${this.renderLinkHeading()}
375
375
  ${this.renderSubheading()}
376
376
  </header>
377
377
  `:w}
378
- `}renderTags(){const e={"pkt-card__tags":!0,[`pkt-card__tags-${this.tagPosition}`]:this.tagPosition};return b`
379
- ${this.tags.length>0?b`
378
+ `}renderTags(){const e={"pkt-card__tags":!0,[`pkt-card__tags-${this.tagPosition}`]:this.tagPosition};return v`
379
+ ${this.tags.length>0?v`
380
380
  <div
381
381
  class=${I(e)}
382
382
  role="list"
383
383
  aria-label=${this.tags.length>1?"merkelapper":"merkelapp"}
384
384
  >
385
- ${this.tags.map(t=>b`
385
+ ${this.tags.map(t=>v`
386
386
  <pkt-tag
387
387
  role="listitem"
388
388
  textStyle="normal-text"
@@ -395,20 +395,20 @@
395
395
  `)}
396
396
  </div>
397
397
  `:w}
398
- `}renderSlot(){return b`
399
- ${this.defaultSlot&&b`<section class="pkt-card__content" ${F(this.defaultSlot)}></section>`}
400
- `}renderMetadata(){return b`
401
- ${this.metaLead||this.metaTrail?b`
398
+ `}renderSlot(){return v`
399
+ ${this.defaultSlot&&v`<section class="pkt-card__content" ${F(this.defaultSlot)}></section>`}
400
+ `}renderMetadata(){return v`
401
+ ${this.metaLead||this.metaTrail?v`
402
402
  <footer class="pkt-card__metadata">
403
- ${this.metaLead?b`<span class="pkt-card__metadata-lead">${this.metaLead}</span>`:w}
404
- ${this.metaTrail?b`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>`:w}
403
+ ${this.metaLead?v`<span class="pkt-card__metadata-lead">${this.metaLead}</span>`:w}
404
+ ${this.metaTrail?v`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>`:w}
405
405
  </footer>
406
406
  `:w}
407
407
  `}};it([c({type:String})],We.prototype,"ariaLabel",2),it([c({type:String})],We.prototype,"metaLead",2),it([c({type:Boolean})],We.prototype,"borderOnHover",2),it([c({type:String,reflect:!0})],We.prototype,"clickCardLink",2),it([c({type:String})],We.prototype,"metaTrail",2),it([c({type:String})],We.prototype,"layout",2),it([c({type:String})],We.prototype,"heading",2),it([c({type:Number})],We.prototype,"headinglevel",2),it([c({type:Object})],We.prototype,"image",2),it([c({type:String})],We.prototype,"imageShape",2),it([c({type:Boolean})],We.prototype,"openLinkInNewTab",2),it([c({type:String})],We.prototype,"padding",2),it([c({type:String,converter:{fromAttribute:s=>{const e=Ws.props.skin.type;return s&&e.includes(s)?s:(s&&!e.includes(s)&&console.warn(`Invalid skin value "${s}". Using default skin "${Ws.props.skin.default}".`),Ws.props.skin.default)},toAttribute:s=>s}})],We.prototype,"skin",2),it([c({type:String})],We.prototype,"subheading",2),it([c({type:String})],We.prototype,"tagPosition",2),it([c({type:Array})],We.prototype,"tags",2),We=it([ee("pkt-card")],We);/**
408
408
  * @license
409
409
  * Copyright 2017 Google LLC
410
410
  * SPDX-License-Identifier: BSD-3-Clause
411
- */const va=(s,e,t)=>{const i=new Map;for(let n=e;n<=t;n++)i.set(s[n],n);return i},Ln=fs(class extends Ls{constructor(s){if(super(s),s.type!==Mt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);const n=[],r=[];let a=0;for(const l of s)n[a]=i?i(l,a):a,r[a]=t(l,a),a++;return{values:r,keys:n}}render(s,e,t){return this.dt(s,e,t).values}update(s,[e,t,i]){const n=Cl(s),{values:r,keys:a}=this.dt(e,t,i);if(!Array.isArray(n))return this.ut=a,r;const l=this.ut??(this.ut=[]),d=[];let p,m,v=0,y=n.length-1,k=0,g=r.length-1;for(;v<=y&&k<=g;)if(n[v]===null)v++;else if(n[y]===null)y--;else if(l[v]===a[k])d[k]=ms(n[v],r[k]),v++,k++;else if(l[y]===a[g])d[g]=ms(n[y],r[g]),y--,g--;else if(l[v]===a[g])d[g]=ms(n[v],r[g]),oi(s,d[g+1],n[v]),v++,g--;else if(l[y]===a[k])d[k]=ms(n[y],r[k]),oi(s,n[v],n[y]),y--,k++;else if(p===void 0&&(p=va(a,k,g),m=va(l,v,y)),p.has(l[v]))if(p.has(l[y])){const $=m.get(a[k]),T=$!==void 0?n[$]:null;if(T===null){const M=oi(s,n[v]);ms(M,r[k]),d[k]=M}else d[k]=ms(T,r[k]),oi(s,n[v],T),n[$]=null;k++}else Sn(n[y]),y--;else Sn(n[v]),v++;for(;k<=g;){const $=oi(s,d[g+1]);ms($,r[k]),d[k++]=$}for(;v<=y;){const $=n[v++];$!==null&&Sn($)}return this.ut=a,Vr(s,d),gt}}),ba=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),Vd=s=>new Promise(e=>setTimeout(e,s)),is=()=>{const s=ba(),e=ba();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+e.slice(1,4)+"-"+e.slice(4)},bt={fromAttribute(s){return s==null?!1:s===""||s==="true"||s===!0?!0:s==="false"||s===!1?!1:!!s},toAttribute(s){return s?"true":"false"}},Ud={helptextDropdownButton:{default:"Les mer <span class='pkt-sr-only'>om feltet</span>"},counter:{default:!1},optionalTag:{default:!1},optionalText:{default:"Valgfritt"},requiredTag:{default:!1},requiredText:{default:"Må fylles ut"},hasError:{default:!1},disabled:{default:!1},inline:{default:!1},hasFieldset:{default:!1},useWrapper:{default:!0}},wt={props:Ud};var jd={},ya;function qd(){return ya||(ya=1,(function(){(function(s){const e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,a=new WeakMap,l=new WeakMap,d=new WeakMap,p=new WeakMap,m=new WeakMap,v=new WeakMap,y=new WeakMap,k=new WeakMap,g=new WeakMap,$=new WeakMap,T={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDescription:"aria-description",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"},M=(f,u)=>{for(let _ in T){u[_]=null;let x=null;const L=T[_];Object.defineProperty(u,_,{get(){return x},set(j){x=j,f.isConnected?C(f,L,j):m.set(f,u)}})}};function S(f){const u=n.get(f),{form:_}=u;Ae(f,_,u),ie(f,u.labels)}const O=(f,u=!1)=>{const _=document.createTreeWalker(f,NodeFilter.SHOW_ELEMENT,{acceptNode(j){return n.has(j)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let x=_.nextNode();const L=!u||f.disabled;for(;x;)x.formDisabledCallback&&L&&H(x,f.disabled),x=_.nextNode()},N={attributes:!0,attributeFilter:["disabled","name"]},U=Se()?new MutationObserver(f=>{for(const u of f){const _=u.target;if(u.attributeName==="disabled"&&(_.constructor.formAssociated?H(_,_.hasAttribute("disabled")):_.localName==="fieldset"&&O(_)),u.attributeName==="name"&&_.constructor.formAssociated){const x=n.get(_),L=p.get(_);x.setFormValue(L)}}}):{};function X(f){f.forEach(u=>{const{addedNodes:_,removedNodes:x}=u,L=Array.from(_),j=Array.from(x);L.forEach(R=>{var ft;if(n.has(R)&&R.constructor.formAssociated&&S(R),m.has(R)){const Qe=m.get(R);Object.keys(T).filter(mt=>Qe[mt]!==null).forEach(mt=>{C(R,T[mt],Qe[mt])}),m.delete(R)}if($.has(R)){const Qe=$.get(R);C(R,"internals-valid",Qe.validity.valid.toString()),C(R,"internals-invalid",(!Qe.validity.valid).toString()),C(R,"aria-invalid",(!Qe.validity.valid).toString()),$.delete(R)}if(R.localName==="form"){const Qe=d.get(R),mt=document.createTreeWalker(R,NodeFilter.SHOW_ELEMENT,{acceptNode(tt){return n.has(tt)&&tt.constructor.formAssociated&&!(Qe&&Qe.has(tt))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let ls=mt.nextNode();for(;ls;)S(ls),ls=mt.nextNode()}R.localName==="fieldset"&&((ft=U.observe)===null||ft===void 0||ft.call(U,R,N),O(R,!0))}),j.forEach(R=>{const ft=n.get(R);ft&&i.get(ft)&&W(ft),l.has(R)&&l.get(R).disconnect()})})}function te(f){f.forEach(u=>{const{removedNodes:_}=u;_.forEach(x=>{const L=k.get(u.target);n.has(x)&&Ve(x),L.disconnect()})})}const $e=f=>{var u,_;const x=new MutationObserver(te);!((u=window==null?void 0:window.ShadyDOM)===null||u===void 0)&&u.inUse&&f.mode&&f.host&&(f=f.host),(_=x.observe)===null||_===void 0||_.call(x,f,{childList:!0}),k.set(f,x)};Se()&&new MutationObserver(X);const q={childList:!0,subtree:!0},C=(f,u,_)=>{f.getAttribute(u)!==_&&f.setAttribute(u,_)},H=(f,u)=>{f.toggleAttribute("internals-disabled",u),u?C(f,"aria-disabled","true"):f.removeAttribute("aria-disabled"),f.formDisabledCallback&&f.formDisabledCallback.apply(f,[u])},W=f=>{i.get(f).forEach(u=>{u.remove()}),i.set(f,[])},Q=(f,u)=>{const _=document.createElement("input");return _.type="hidden",_.name=f.getAttribute("name"),f.after(_),i.get(u).push(_),_},se=(f,u)=>{var _;i.set(u,[]),(_=U.observe)===null||_===void 0||_.call(U,f,N)},ie=(f,u)=>{if(u.length){Array.from(u).forEach(x=>x.addEventListener("click",f.click.bind(f)));let _=u[0].id;u[0].id||(_=`${u[0].htmlFor}_Label`,u[0].id=_),C(f,"aria-labelledby",_)}},ue=f=>{const u=Array.from(f.elements).filter(j=>!j.tagName.includes("-")&&j.validity).map(j=>j.validity.valid),_=d.get(f)||[],x=Array.from(_).filter(j=>j.isConnected).map(j=>n.get(j).validity.valid),L=[...u,...x].includes(!1);f.toggleAttribute("internals-invalid",L),f.toggleAttribute("internals-valid",!L)},ne=f=>{ue(re(f.target))},ge=f=>{ue(re(f.target))},Y=f=>{const u=["button[type=submit]","input[type=submit]","button:not([type])"].map(_=>`${_}:not([disabled])`).map(_=>`${_}:not([form])${f.id?`,${_}[form='${f.id}']`:""}`).join(",");f.addEventListener("click",_=>{if(_.target.closest(u)){const x=d.get(f);if(f.noValidate)return;x.size&&Array.from(x).reverse().map(L=>n.get(L).reportValidity()).includes(!1)&&_.preventDefault()}})},K=f=>{const u=d.get(f.target);u&&u.size&&u.forEach(_=>{_.constructor.formAssociated&&_.formResetCallback&&_.formResetCallback.apply(_)})},Ae=(f,u,_)=>{if(u){const x=d.get(u);if(x)x.add(f);else{const L=new Set;L.add(f),d.set(u,L),Y(u),u.addEventListener("reset",K),u.addEventListener("input",ne),u.addEventListener("change",ge)}a.set(u,{ref:f,internals:_}),f.constructor.formAssociated&&f.formAssociatedCallback&&setTimeout(()=>{f.formAssociatedCallback.apply(f,[u])},0),ue(u)}},re=f=>{let u=f.parentNode;return u&&u.tagName!=="FORM"&&(u=re(u)),u},ae=(f,u,_=DOMException)=>{if(!f.constructor.formAssociated)throw new _(u)},Re=(f,u,_)=>{const x=d.get(f);return x&&x.size&&x.forEach(L=>{n.get(L)[_]()||(u=!1)}),u},Ve=f=>{if(f.constructor.formAssociated){const u=n.get(f),{labels:_,form:x}=u;ie(f,_),Ae(f,x,u)}};function Se(){return typeof MutationObserver<"u"}class Ke{constructor(){this.badInput=!1,this.customError=!1,this.patternMismatch=!1,this.rangeOverflow=!1,this.rangeUnderflow=!1,this.stepMismatch=!1,this.tooLong=!1,this.tooShort=!1,this.typeMismatch=!1,this.valid=!0,this.valueMissing=!1,Object.seal(this)}}const lt=f=>(f.badInput=!1,f.customError=!1,f.patternMismatch=!1,f.rangeOverflow=!1,f.rangeUnderflow=!1,f.stepMismatch=!1,f.tooLong=!1,f.tooShort=!1,f.typeMismatch=!1,f.valid=!0,f.valueMissing=!1,f),we=(f,u,_)=>(f.valid=Ne(u),Object.keys(u).forEach(x=>f[x]=u[x]),_&&ue(_),f),Ne=f=>{let u=!0;for(let _ in f)_!=="valid"&&f[_]!==!1&&(u=!1);return u},Ge=new WeakMap;function Xe(f,u){f.toggleAttribute(u,!0),f.part&&f.part.add(u)}class et extends Set{static get isPolyfilled(){return!0}constructor(u){if(super(),!u||!u.tagName||u.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");Ge.set(this,u)}add(u){if(!/^--/.test(u)||typeof u!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${u} must start with '--'.`);const _=super.add(u),x=Ge.get(this),L=`state${u}`;return x.isConnected?Xe(x,L):setTimeout(()=>{Xe(x,L)}),_}clear(){for(let[u]of this.entries())this.delete(u);super.clear()}delete(u){const _=super.delete(u),x=Ge.get(this);return x.isConnected?(x.toggleAttribute(`state${u}`,!1),x.part&&x.part.remove(`state${u}`)):setTimeout(()=>{x.toggleAttribute(`state${u}`,!1),x.part&&x.part.remove(`state${u}`)}),_}}function ce(f,u,_,x){if(typeof u=="function"?f!==u||!x:!u.has(f))throw new TypeError("Cannot read private member from an object whose class did not declare it");return _==="m"?x:_==="a"?x.call(f):x?x.value:u.get(f)}function be(f,u,_,x,L){if(typeof u=="function"?f!==u||!0:!u.has(f))throw new TypeError("Cannot write private member to an object whose class did not declare it");return u.set(f,_),_}var Ie;class Me{constructor(u){Ie.set(this,void 0),be(this,Ie,u);for(let _=0;_<u.length;_++){let x=u[_];this[_]=x,x.hasAttribute("name")&&(this[x.getAttribute("name")]=x)}Object.freeze(this)}get length(){return ce(this,Ie,"f").length}[(Ie=new WeakMap,Symbol.iterator)](){return ce(this,Ie,"f")[Symbol.iterator]()}item(u){return this[u]==null?null:this[u]}namedItem(u){return this[u]==null?null:this[u]}}function xe(){const f=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=_;const u=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=x;function _(...j){let R=f.apply(this,j);return Re(this,R,"checkValidity")}function x(...j){let R=u.apply(this,j);return Re(this,R,"reportValidity")}const{get:L}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...j){const R=L.call(this,...j),ft=Array.from(d.get(this)||[]);if(ft.length===0)return R;const Qe=Array.from(R).concat(ft).sort((mt,ls)=>mt.compareDocumentPosition?mt.compareDocumentPosition(ls)&2?1:-1:0);return new Me(Qe)}})}class V{static get isPolyfilled(){return!0}constructor(u){if(!u||!u.tagName||u.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const _=u.getRootNode(),x=new Ke;this.states=new et(u),e.set(this,u),t.set(this,x),n.set(u,this),M(u,this),se(u,this),Object.seal(this),_ instanceof DocumentFragment&&$e(_)}checkValidity(){const u=e.get(this);if(ae(u,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const _=t.get(this);if(!_.valid){const x=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});u.dispatchEvent(x)}return _.valid}get form(){const u=e.get(this);ae(u,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let _;return u.constructor.formAssociated===!0&&(_=re(u)),_}get labels(){const u=e.get(this);ae(u,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const _=u.getAttribute("id"),x=u.getRootNode();return x&&_?x.querySelectorAll(`[for="${_}"]`):[]}reportValidity(){const u=e.get(this);if(ae(u,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const _=this.checkValidity(),x=y.get(this);if(x&&!u.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!_&&x&&(u.focus(),x.focus()),_}setFormValue(u){const _=e.get(this);if(ae(_,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),W(this),u!=null&&!(u instanceof FormData)){if(_.getAttribute("name")){const x=Q(_,this);x.value=u}}else u!=null&&u instanceof FormData&&Array.from(u).reverse().forEach(([x,L])=>{if(typeof L=="string"){const j=Q(_,this);j.name=x,j.value=L}});p.set(_,u)}setValidity(u,_,x){const L=e.get(this);if(ae(L,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!u)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");y.set(this,x);const j=t.get(this),R={};for(const mt in u)R[mt]=u[mt];Object.keys(R).length===0&&lt(j);const ft=Object.assign(Object.assign({},j),R);delete ft.valid;const{valid:Qe}=we(j,ft,this.form);if(!Qe&&!_)throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");r.set(this,Qe?"":_),L.isConnected?(L.toggleAttribute("internals-invalid",!Qe),L.toggleAttribute("internals-valid",Qe),C(L,"aria-invalid",`${!Qe}`)):$.set(L,this)}get shadowRoot(){const u=e.get(this);return v.get(u)||null}get validationMessage(){const u=e.get(this);return ae(u,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),r.get(this)}get validity(){const u=e.get(this);return ae(u,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),t.get(this)}get willValidate(){const u=e.get(this);return ae(u,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(u.disabled||u.hasAttribute("disabled")||u.hasAttribute("readonly"))}}function De(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class f extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const u=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(u,f);const _=new f;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(x=>x in _.internals)}let he=!1,ye=!1;function Ue(f){ye||(ye=!0,window.CustomStateSet=et,f&&(HTMLElement.prototype.attachInternals=function(...u){const _=f.call(this,u);return _.states=new et(this),_}))}function ct(f=!0){if(!he){if(he=!0,typeof window<"u"&&(window.ElementInternals=V),typeof CustomElementRegistry<"u"){const u=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(_,x,L){if(x.formAssociated){const j=x.prototype.connectedCallback;x.prototype.connectedCallback=function(){g.has(this)||(g.set(this,!0),this.hasAttribute("disabled")&&H(this,!0)),j!=null&&j.apply(this),Ve(this)}}u.call(this,_,x,L)}}if(typeof HTMLElement<"u"&&(HTMLElement.prototype.attachInternals=function(){if(this.tagName){if(this.tagName.indexOf("-")===-1)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.")}else return{};if(n.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new V(this)}),typeof Element<"u"){let u=function(...x){const L=_.apply(this,x);if(v.set(this,L),Se()){const j=new MutationObserver(X);window.ShadyDOM?j.observe(this,q):j.observe(L,q),l.set(this,j)}return L};const _=Element.prototype.attachShadow;Element.prototype.attachShadow=u}Se()&&typeof document<"u"&&new MutationObserver(X).observe(document.documentElement,q),typeof HTMLFormElement<"u"&&xe(),(f||typeof window<"u"&&!window.CustomStateSet)&&Ue()}}return customElements.polyfillWrapFlushCallback||(De()?typeof window<"u"&&!window.CustomStateSet&&Ue(HTMLElement.prototype.attachInternals):ct(!1)),s.forceCustomStateSetPolyfill=Ue,s.forceElementInternalsPolyfill=ct,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})()),jd}qd();var Wd=Object.defineProperty,J=(s,e,t,i)=>{for(var n=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=a(e,t,n)||n);return n&&Wd(e,t,n),n};const ka="on",Bn="--checked",Ri=",";let z=class extends ke{constructor(){super(),this.defaultValue=null,this.disabled=!1,this.readonly=!1,this.required=!1,this.max=null,this.maxlength=null,this.min=null,this.minlength=null,this.step=null,this.ariaDescribedBy=null,this.ariaLabelledby=null,this.name="",this.pattern=null,this.placeholder=null,this.id=is(),this.counter=!1,this.hasError=!1,this.inline=!1,this.hasFieldset=!1,this.optionalTag=!1,this.requiredTag=!1,this.skipForwardTestid=!1,this.useWrapper=!0,this.fullwidth=!1,this.counterMaxLength=0,this.errorMessage="",this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=wt.props.helptextDropdownButton.default,this.label=null,this.optionalText=vt.forms.labels.optional,this.requiredText=vt.forms.labels.required,this.tagText=null,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(e){var t,i,n,r,a,l,d,p,m,v,y;if(!e){console.warn("manageValidity called without valid input element");return}this.required&&!this.value?this.internals.setValidity({valueMissing:!0},vt.forms.messages.required,e):(t=e.validity)!=null&&t.typeMismatch||(i=e.validity)!=null&&i.badInput?this.internals.setValidity({typeMismatch:!0},vt.forms.messages.invalid,e):(n=e.validity)!=null&&n.patternMismatch?this.internals.setValidity({patternMismatch:!0},vt.forms.messages.invalidPattern,e):(r=e.validity)!=null&&r.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},vt.forms.messages.tooShort,e):(a=e.validity)!=null&&a.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},vt.forms.messages.tooLong,e):(l=e.validity)!=null&&l.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?vt.forms.messages.rangeUnderflowMin.replace("{min}",(d=this.min)==null?void 0:d.toString()):vt.forms.messages.rangeUnderflow,e):(p=e.validity)!=null&&p.stepMismatch?this.internals.setValidity({stepMismatch:!0},vt.forms.messages.invalid,e):(m=e.validity)!=null&&m.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?vt.forms.messages.rangeOverflowMax.replace("{max}",(v=this.max)==null?void 0:v.toString()):vt.forms.messages.rangeOverflow,e):(y=e.validity)!=null&&y.customError?this.internals.setValidity({customError:!0},e.validationMessage,e):this.internals.setValidity({})}setFormValue(e){if(this.internals)if(Array.isArray(e)){const t=new FormData;e.forEach(i=>{t.append(this.name,i)}),this.internals.setFormValue(t)}else this.internals.setFormValue(e)}coordinateRadioGroup(){if(!this.form||!this.name||this.type!=="radio")return;const e=`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`;this.form.querySelectorAll(e).forEach(t=>{var i;if(t!==this&&t.getAttribute("name")===this.name&&t.getAttribute("value")!==this.value){const n=t;n.checked&&(n.checked=!1,n.internals&&(n.internals.setFormValue(null),(i=n.internals.states)==null||i.delete(Bn)))}})}valueChecked(e){if(!this.touched)return;const t=this.internals.form||this.closest("form"),i=t?new FormData(t):null;if(this.type==="radio"&&this.coordinateRadioGroup(),typeof e=="string"?(this.checked=e==="true",this.internals.ariaChecked=String(e==="true")):typeof e=="boolean"&&(this.checked=e,this.internals.ariaChecked=String(e)),this.checked){const n=(typeof this.value=="string"?this.value:"")||ka;this.internals.setFormValue(n),i&&i.append(this.name,n),this.internals.states.add(Bn)}else this.internals.setFormValue(null),i&&i.delete(this.name),this.internals.states.delete(Bn);this.dispatchChangeEvents(this.checked),this.internals.reportValidity()}valueChanged(e,t){(t!==this.value||t!==this._value)&&(typeof e=="string"?((this.multiple||this.range)&&e.includes(Ri)&&(e=e.split(Ri)),this.value=e,this._value=Array.isArray(e)?e:[e]):Array.isArray(e)?(this.value=this.multiple||this.range?e:e[0],this._value=e):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&t&&t.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(t==null?void 0:t.toString())&&this.onChange(this.value))}dispatchChangeEvents(e){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:e,bubbles:!0,composed:!0}))}clearInputValue(){const e=this.multiple||this.range?[]:"";this.value=e,this.setFormValue(e),this.dispatchChangeEvents(e)}onFocus(){this.dispatchEvent(new FocusEvent("focus",{bubbles:!0,composed:!0}))}onBlur(){this.dispatchEvent(new FocusEvent("blur",{bubbles:!0,composed:!0}))}onInput(){this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}normalizeValue(e){return(this.range||this.multiple)&&typeof e=="string"&&e.includes(Ri)?e.split(Ri):!this.multiple&&!this.range&&Array.isArray(e)?e[0]||"":e}validate(){var e,t;(e=this.inputRef)!=null&&e.value&&this.manageValidity(this.inputRef.value),(t=this.inputRefTo)!=null&&t.value&&this.manageValidity(this.inputRefTo.value)}onChange(e){if(!this.touched){this.touched=!0,e&&this.setFormValue(e);return}if(typeof e!="string"&&!Array.isArray(e))return;const t=this.normalizeValue(e);this.setFormValue(t),this.validate(),this.dispatchChangeEvents(t)}formResetCallback(){var e;if(this.touched=!1,this._options&&this._options.length&&this._options.forEach(t=>{"selected"in t&&(t.selected=!1)}),this.checked!==void 0)this.checked=!1,this.internals.ariaChecked="false",this.internals.setFormValue(""),(e=this.inputRef)!=null&&e.value&&"checked"in this.inputRef.value&&(this.inputRef.value.checked=!1),this.valueChecked(this.checked);else{this.internals.setFormValue("");const t=this.defaultValue||(this.multiple||this.range?[]:"");this.value=t,this._value=Array.isArray(t)?t:[t],this.valueChanged(this.value,null)}this.internals.ariaInvalid="false"}updated(e){super.updated(e),e.has("dataTestid")&&this.dataTestid&&this.inputRef.value&&(this.skipForwardTestid?this.hasAttribute("data-testid")||this.setAttribute("data-testid",this.dataTestid):(this.inputRef.value.dataset.testid=this.dataTestid,this.removeAttribute("data-testid")))}firstUpdated(e){if(super.firstUpdated(e),!this.form){const t=this.internals.form||this.closest("form");this.form=t}if(this.value&&this.defaultValue!==null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked="true",this.checked=!0),this.required&&(this.internals.ariaRequired="true"),this.disabled&&(this.internals.ariaDisabled="true"),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const t=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=String(t);const i=t?(typeof this.value=="string"?this.value:"")||ka:null;this.internals.setFormValue(i)}else this.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute("form",""),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute("form",""),this.manageValidity(this.inputRefTo.value))}};J([c({type:Boolean,reflect:!0})],z.prototype,"checked"),J([c({type:Boolean})],z.prototype,"defaultChecked"),J([c({type:Boolean})],z.prototype,"multiple"),J([c({type:Boolean})],z.prototype,"range"),J([c({type:String,reflect:!0})],z.prototype,"type"),J([c()],z.prototype,"defaultValue"),J([c({type:Boolean,reflect:!0})],z.prototype,"disabled"),J([c({type:Boolean,reflect:!0})],z.prototype,"readonly"),J([c({type:Boolean,reflect:!0})],z.prototype,"required"),J([c({reflect:!0,converter:{fromAttribute:s=>s,toAttribute:s=>(s==null?void 0:s.toString())??null}})],z.prototype,"max"),J([c({type:Number,reflect:!0})],z.prototype,"maxlength"),J([c({reflect:!0,converter:{fromAttribute:s=>s,toAttribute:s=>(s==null?void 0:s.toString())??null}})],z.prototype,"min"),J([c({type:Number,reflect:!0})],z.prototype,"minlength"),J([c({type:Number,reflect:!0})],z.prototype,"step"),J([c({type:String})],z.prototype,"ariaDescribedBy"),J([c({type:String})],z.prototype,"ariaLabelledby"),J([c({type:String,reflect:!0})],z.prototype,"name"),J([c({type:String,reflect:!0})],z.prototype,"pattern"),J([c({type:String,reflect:!0})],z.prototype,"placeholder"),J([c({type:String,reflect:!0})],z.prototype,"id"),J([c({type:Boolean})],z.prototype,"counter"),J([c({type:Boolean})],z.prototype,"hasError"),J([c({type:Boolean})],z.prototype,"inline"),J([c({type:Boolean})],z.prototype,"hasFieldset"),J([c({type:Boolean})],z.prototype,"optionalTag"),J([c({type:Boolean})],z.prototype,"requiredTag"),J([c({type:Boolean})],z.prototype,"skipForwardTestid"),J([c({type:Boolean,reflect:!0,converter:bt})],z.prototype,"useWrapper"),J([c({type:Boolean,reflect:!0})],z.prototype,"fullwidth"),J([c({type:Number})],z.prototype,"counterMaxLength"),J([c({type:String})],z.prototype,"errorMessage"),J([c({type:String})],z.prototype,"helptext"),J([c({type:String})],z.prototype,"helptextDropdown"),J([c({type:String,reflect:!1})],z.prototype,"helptextDropdownButton"),J([c({type:String})],z.prototype,"label"),J([c({type:String,reflect:!1})],z.prototype,"optionalText"),J([c({type:String,reflect:!1})],z.prototype,"requiredText"),J([c({type:String,reflect:!1})],z.prototype,"tagText"),J([c({type:String,attribute:"data-testid"})],z.prototype,"dataTestid");let _a=class{constructor(e){this.nodes=[],this.options=[],this.host=e,this.host.addController(this),this.nodes=[],this.options=[],this.observer=new MutationObserver(t=>this.handleMutations(t))}hostConnected(){Array.from(this.host.childNodes).forEach(e=>{(e.nodeName==="OPTION"||e.nodeName==="DATA")&&this.addNode(e)}),this.createOptions(),this.observer.observe(this.host,{childList:!0,subtree:!1,attributes:!0})}hostDisconnected(){this.observer.disconnect()}addNode(e){(e.nodeName==="OPTION"||e.nodeName==="DATA")&&(e.hasAttribute("hidden")&&!e.hasAttribute("data-skip")&&e.setAttribute("data-hidden","true"),!e.hasAttribute("hidden")&&e.hasAttribute("data-skip")&&e.hasAttribute("data-hidden")&&e.removeAttribute("data-hidden"),e.setAttribute("class","pkt-hide"),e.setAttribute("data-skip","true"),e.setAttribute("hidden","true"),this.nodes.push(e))}createOptions(){this.options=this.nodes.map(e=>({value:e.hasAttribute("value")?e.getAttribute("value")??"":e.textContent??"",label:e.textContent||e.getAttribute("value")||"",selected:e.hasAttribute("selected"),disabled:e.hasAttribute("disabled"),hidden:e.hasAttribute("data-hidden")})),this.host.requestUpdate()}handleMutations(e){let t=!1;e.forEach(i=>{i.type==="childList"&&(i.addedNodes.forEach(n=>{Bs(n)&&(this.addNode(n),t=!0)}),i.removedNodes.forEach(n=>{Bs(n)&&(this.nodes=this.nodes.filter(r=>r!==n),t=!0)})),i.type==="attributes"&&Bs(i.target)&&(this.addNode(i.target),t=!0)}),t&&this.createOptions()}};var zd=Object.defineProperty,Yd=Object.getOwnPropertyDescriptor,$s=(s,e,t,i)=>{for(var n=i>1?void 0:i?Yd(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&zd(e,t,n),n};let Yt=class extends ke{constructor(){super(),this.defaultSlot=B(),this.forId=is(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=wt.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new Le(this,this.defaultSlot)}updateSlots(e){this.filledSlots=new Set(e)}render(){const e=()=>{const n=!this.isHelpTextOpen;this.isHelpTextOpen=n,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:n}}))},t=I({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.filledSlots.size>0}),i=()=>this.helptextDropdown?b`<div class="pkt-inputwrapper__helptext-expandable">
411
+ */const va=(s,e,t)=>{const i=new Map;for(let n=e;n<=t;n++)i.set(s[n],n);return i},Ln=fs(class extends Ls{constructor(s){if(super(s),s.type!==Mt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);const n=[],r=[];let a=0;for(const l of s)n[a]=i?i(l,a):a,r[a]=t(l,a),a++;return{values:r,keys:n}}render(s,e,t){return this.dt(s,e,t).values}update(s,[e,t,i]){const n=Cl(s),{values:r,keys:a}=this.dt(e,t,i);if(!Array.isArray(n))return this.ut=a,r;const l=this.ut??(this.ut=[]),d=[];let p,m,b=0,y=n.length-1,k=0,g=r.length-1;for(;b<=y&&k<=g;)if(n[b]===null)b++;else if(n[y]===null)y--;else if(l[b]===a[k])d[k]=ms(n[b],r[k]),b++,k++;else if(l[y]===a[g])d[g]=ms(n[y],r[g]),y--,g--;else if(l[b]===a[g])d[g]=ms(n[b],r[g]),oi(s,d[g+1],n[b]),b++,g--;else if(l[y]===a[k])d[k]=ms(n[y],r[k]),oi(s,n[b],n[y]),y--,k++;else if(p===void 0&&(p=va(a,k,g),m=va(l,b,y)),p.has(l[b]))if(p.has(l[y])){const $=m.get(a[k]),T=$!==void 0?n[$]:null;if(T===null){const M=oi(s,n[b]);ms(M,r[k]),d[k]=M}else d[k]=ms(T,r[k]),oi(s,n[b],T),n[$]=null;k++}else Sn(n[y]),y--;else Sn(n[b]),b++;for(;k<=g;){const $=oi(s,d[g+1]);ms($,r[k]),d[k++]=$}for(;b<=y;){const $=n[b++];$!==null&&Sn($)}return this.ut=a,Vr(s,d),gt}}),ba=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),Vd=s=>new Promise(e=>setTimeout(e,s)),is=()=>{const s=ba(),e=ba();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+e.slice(1,4)+"-"+e.slice(4)},bt={fromAttribute(s){return s==null?!1:s===""||s==="true"||s===!0?!0:s==="false"||s===!1?!1:!!s},toAttribute(s){return s?"true":"false"}},Ud={helptextDropdownButton:{default:"Les mer <span class='pkt-sr-only'>om feltet</span>"},counter:{default:!1},optionalTag:{default:!1},optionalText:{default:"Valgfritt"},requiredTag:{default:!1},requiredText:{default:"Må fylles ut"},hasError:{default:!1},disabled:{default:!1},inline:{default:!1},hasFieldset:{default:!1},useWrapper:{default:!0}},wt={props:Ud};var jd={},ya;function qd(){return ya||(ya=1,(function(){(function(s){const e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,a=new WeakMap,l=new WeakMap,d=new WeakMap,p=new WeakMap,m=new WeakMap,b=new WeakMap,y=new WeakMap,k=new WeakMap,g=new WeakMap,$=new WeakMap,T={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDescription:"aria-description",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"},M=(f,u)=>{for(let _ in T){u[_]=null;let x=null;const L=T[_];Object.defineProperty(u,_,{get(){return x},set(j){x=j,f.isConnected?C(f,L,j):m.set(f,u)}})}};function S(f){const u=n.get(f),{form:_}=u;Ae(f,_,u),ie(f,u.labels)}const O=(f,u=!1)=>{const _=document.createTreeWalker(f,NodeFilter.SHOW_ELEMENT,{acceptNode(j){return n.has(j)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let x=_.nextNode();const L=!u||f.disabled;for(;x;)x.formDisabledCallback&&L&&H(x,f.disabled),x=_.nextNode()},N={attributes:!0,attributeFilter:["disabled","name"]},U=Se()?new MutationObserver(f=>{for(const u of f){const _=u.target;if(u.attributeName==="disabled"&&(_.constructor.formAssociated?H(_,_.hasAttribute("disabled")):_.localName==="fieldset"&&O(_)),u.attributeName==="name"&&_.constructor.formAssociated){const x=n.get(_),L=p.get(_);x.setFormValue(L)}}}):{};function X(f){f.forEach(u=>{const{addedNodes:_,removedNodes:x}=u,L=Array.from(_),j=Array.from(x);L.forEach(R=>{var ft;if(n.has(R)&&R.constructor.formAssociated&&S(R),m.has(R)){const Qe=m.get(R);Object.keys(T).filter(mt=>Qe[mt]!==null).forEach(mt=>{C(R,T[mt],Qe[mt])}),m.delete(R)}if($.has(R)){const Qe=$.get(R);C(R,"internals-valid",Qe.validity.valid.toString()),C(R,"internals-invalid",(!Qe.validity.valid).toString()),C(R,"aria-invalid",(!Qe.validity.valid).toString()),$.delete(R)}if(R.localName==="form"){const Qe=d.get(R),mt=document.createTreeWalker(R,NodeFilter.SHOW_ELEMENT,{acceptNode(tt){return n.has(tt)&&tt.constructor.formAssociated&&!(Qe&&Qe.has(tt))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let ls=mt.nextNode();for(;ls;)S(ls),ls=mt.nextNode()}R.localName==="fieldset"&&((ft=U.observe)===null||ft===void 0||ft.call(U,R,N),O(R,!0))}),j.forEach(R=>{const ft=n.get(R);ft&&i.get(ft)&&W(ft),l.has(R)&&l.get(R).disconnect()})})}function te(f){f.forEach(u=>{const{removedNodes:_}=u;_.forEach(x=>{const L=k.get(u.target);n.has(x)&&Ve(x),L.disconnect()})})}const $e=f=>{var u,_;const x=new MutationObserver(te);!((u=window==null?void 0:window.ShadyDOM)===null||u===void 0)&&u.inUse&&f.mode&&f.host&&(f=f.host),(_=x.observe)===null||_===void 0||_.call(x,f,{childList:!0}),k.set(f,x)};Se()&&new MutationObserver(X);const q={childList:!0,subtree:!0},C=(f,u,_)=>{f.getAttribute(u)!==_&&f.setAttribute(u,_)},H=(f,u)=>{f.toggleAttribute("internals-disabled",u),u?C(f,"aria-disabled","true"):f.removeAttribute("aria-disabled"),f.formDisabledCallback&&f.formDisabledCallback.apply(f,[u])},W=f=>{i.get(f).forEach(u=>{u.remove()}),i.set(f,[])},Q=(f,u)=>{const _=document.createElement("input");return _.type="hidden",_.name=f.getAttribute("name"),f.after(_),i.get(u).push(_),_},se=(f,u)=>{var _;i.set(u,[]),(_=U.observe)===null||_===void 0||_.call(U,f,N)},ie=(f,u)=>{if(u.length){Array.from(u).forEach(x=>x.addEventListener("click",f.click.bind(f)));let _=u[0].id;u[0].id||(_=`${u[0].htmlFor}_Label`,u[0].id=_),C(f,"aria-labelledby",_)}},ue=f=>{const u=Array.from(f.elements).filter(j=>!j.tagName.includes("-")&&j.validity).map(j=>j.validity.valid),_=d.get(f)||[],x=Array.from(_).filter(j=>j.isConnected).map(j=>n.get(j).validity.valid),L=[...u,...x].includes(!1);f.toggleAttribute("internals-invalid",L),f.toggleAttribute("internals-valid",!L)},ne=f=>{ue(re(f.target))},ge=f=>{ue(re(f.target))},K=f=>{const u=["button[type=submit]","input[type=submit]","button:not([type])"].map(_=>`${_}:not([disabled])`).map(_=>`${_}:not([form])${f.id?`,${_}[form='${f.id}']`:""}`).join(",");f.addEventListener("click",_=>{if(_.target.closest(u)){const x=d.get(f);if(f.noValidate)return;x.size&&Array.from(x).reverse().map(L=>n.get(L).reportValidity()).includes(!1)&&_.preventDefault()}})},G=f=>{const u=d.get(f.target);u&&u.size&&u.forEach(_=>{_.constructor.formAssociated&&_.formResetCallback&&_.formResetCallback.apply(_)})},Ae=(f,u,_)=>{if(u){const x=d.get(u);if(x)x.add(f);else{const L=new Set;L.add(f),d.set(u,L),K(u),u.addEventListener("reset",G),u.addEventListener("input",ne),u.addEventListener("change",ge)}a.set(u,{ref:f,internals:_}),f.constructor.formAssociated&&f.formAssociatedCallback&&setTimeout(()=>{f.formAssociatedCallback.apply(f,[u])},0),ue(u)}},re=f=>{let u=f.parentNode;return u&&u.tagName!=="FORM"&&(u=re(u)),u},ae=(f,u,_=DOMException)=>{if(!f.constructor.formAssociated)throw new _(u)},Re=(f,u,_)=>{const x=d.get(f);return x&&x.size&&x.forEach(L=>{n.get(L)[_]()||(u=!1)}),u},Ve=f=>{if(f.constructor.formAssociated){const u=n.get(f),{labels:_,form:x}=u;ie(f,_),Ae(f,x,u)}};function Se(){return typeof MutationObserver<"u"}class Ke{constructor(){this.badInput=!1,this.customError=!1,this.patternMismatch=!1,this.rangeOverflow=!1,this.rangeUnderflow=!1,this.stepMismatch=!1,this.tooLong=!1,this.tooShort=!1,this.typeMismatch=!1,this.valid=!0,this.valueMissing=!1,Object.seal(this)}}const lt=f=>(f.badInput=!1,f.customError=!1,f.patternMismatch=!1,f.rangeOverflow=!1,f.rangeUnderflow=!1,f.stepMismatch=!1,f.tooLong=!1,f.tooShort=!1,f.typeMismatch=!1,f.valid=!0,f.valueMissing=!1,f),we=(f,u,_)=>(f.valid=Ne(u),Object.keys(u).forEach(x=>f[x]=u[x]),_&&ue(_),f),Ne=f=>{let u=!0;for(let _ in f)_!=="valid"&&f[_]!==!1&&(u=!1);return u},Ge=new WeakMap;function Xe(f,u){f.toggleAttribute(u,!0),f.part&&f.part.add(u)}class et extends Set{static get isPolyfilled(){return!0}constructor(u){if(super(),!u||!u.tagName||u.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");Ge.set(this,u)}add(u){if(!/^--/.test(u)||typeof u!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${u} must start with '--'.`);const _=super.add(u),x=Ge.get(this),L=`state${u}`;return x.isConnected?Xe(x,L):setTimeout(()=>{Xe(x,L)}),_}clear(){for(let[u]of this.entries())this.delete(u);super.clear()}delete(u){const _=super.delete(u),x=Ge.get(this);return x.isConnected?(x.toggleAttribute(`state${u}`,!1),x.part&&x.part.remove(`state${u}`)):setTimeout(()=>{x.toggleAttribute(`state${u}`,!1),x.part&&x.part.remove(`state${u}`)}),_}}function ce(f,u,_,x){if(typeof u=="function"?f!==u||!x:!u.has(f))throw new TypeError("Cannot read private member from an object whose class did not declare it");return _==="m"?x:_==="a"?x.call(f):x?x.value:u.get(f)}function be(f,u,_,x,L){if(typeof u=="function"?f!==u||!0:!u.has(f))throw new TypeError("Cannot write private member to an object whose class did not declare it");return u.set(f,_),_}var Ie;class Me{constructor(u){Ie.set(this,void 0),be(this,Ie,u);for(let _=0;_<u.length;_++){let x=u[_];this[_]=x,x.hasAttribute("name")&&(this[x.getAttribute("name")]=x)}Object.freeze(this)}get length(){return ce(this,Ie,"f").length}[(Ie=new WeakMap,Symbol.iterator)](){return ce(this,Ie,"f")[Symbol.iterator]()}item(u){return this[u]==null?null:this[u]}namedItem(u){return this[u]==null?null:this[u]}}function xe(){const f=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=_;const u=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=x;function _(...j){let R=f.apply(this,j);return Re(this,R,"checkValidity")}function x(...j){let R=u.apply(this,j);return Re(this,R,"reportValidity")}const{get:L}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...j){const R=L.call(this,...j),ft=Array.from(d.get(this)||[]);if(ft.length===0)return R;const Qe=Array.from(R).concat(ft).sort((mt,ls)=>mt.compareDocumentPosition?mt.compareDocumentPosition(ls)&2?1:-1:0);return new Me(Qe)}})}class V{static get isPolyfilled(){return!0}constructor(u){if(!u||!u.tagName||u.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const _=u.getRootNode(),x=new Ke;this.states=new et(u),e.set(this,u),t.set(this,x),n.set(u,this),M(u,this),se(u,this),Object.seal(this),_ instanceof DocumentFragment&&$e(_)}checkValidity(){const u=e.get(this);if(ae(u,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const _=t.get(this);if(!_.valid){const x=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});u.dispatchEvent(x)}return _.valid}get form(){const u=e.get(this);ae(u,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let _;return u.constructor.formAssociated===!0&&(_=re(u)),_}get labels(){const u=e.get(this);ae(u,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const _=u.getAttribute("id"),x=u.getRootNode();return x&&_?x.querySelectorAll(`[for="${_}"]`):[]}reportValidity(){const u=e.get(this);if(ae(u,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const _=this.checkValidity(),x=y.get(this);if(x&&!u.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!_&&x&&(u.focus(),x.focus()),_}setFormValue(u){const _=e.get(this);if(ae(_,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),W(this),u!=null&&!(u instanceof FormData)){if(_.getAttribute("name")){const x=Q(_,this);x.value=u}}else u!=null&&u instanceof FormData&&Array.from(u).reverse().forEach(([x,L])=>{if(typeof L=="string"){const j=Q(_,this);j.name=x,j.value=L}});p.set(_,u)}setValidity(u,_,x){const L=e.get(this);if(ae(L,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!u)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");y.set(this,x);const j=t.get(this),R={};for(const mt in u)R[mt]=u[mt];Object.keys(R).length===0&&lt(j);const ft=Object.assign(Object.assign({},j),R);delete ft.valid;const{valid:Qe}=we(j,ft,this.form);if(!Qe&&!_)throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");r.set(this,Qe?"":_),L.isConnected?(L.toggleAttribute("internals-invalid",!Qe),L.toggleAttribute("internals-valid",Qe),C(L,"aria-invalid",`${!Qe}`)):$.set(L,this)}get shadowRoot(){const u=e.get(this);return b.get(u)||null}get validationMessage(){const u=e.get(this);return ae(u,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),r.get(this)}get validity(){const u=e.get(this);return ae(u,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),t.get(this)}get willValidate(){const u=e.get(this);return ae(u,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(u.disabled||u.hasAttribute("disabled")||u.hasAttribute("readonly"))}}function De(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class f extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const u=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(u,f);const _=new f;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(x=>x in _.internals)}let he=!1,ye=!1;function Ue(f){ye||(ye=!0,window.CustomStateSet=et,f&&(HTMLElement.prototype.attachInternals=function(...u){const _=f.call(this,u);return _.states=new et(this),_}))}function ct(f=!0){if(!he){if(he=!0,typeof window<"u"&&(window.ElementInternals=V),typeof CustomElementRegistry<"u"){const u=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(_,x,L){if(x.formAssociated){const j=x.prototype.connectedCallback;x.prototype.connectedCallback=function(){g.has(this)||(g.set(this,!0),this.hasAttribute("disabled")&&H(this,!0)),j!=null&&j.apply(this),Ve(this)}}u.call(this,_,x,L)}}if(typeof HTMLElement<"u"&&(HTMLElement.prototype.attachInternals=function(){if(this.tagName){if(this.tagName.indexOf("-")===-1)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.")}else return{};if(n.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new V(this)}),typeof Element<"u"){let u=function(...x){const L=_.apply(this,x);if(b.set(this,L),Se()){const j=new MutationObserver(X);window.ShadyDOM?j.observe(this,q):j.observe(L,q),l.set(this,j)}return L};const _=Element.prototype.attachShadow;Element.prototype.attachShadow=u}Se()&&typeof document<"u"&&new MutationObserver(X).observe(document.documentElement,q),typeof HTMLFormElement<"u"&&xe(),(f||typeof window<"u"&&!window.CustomStateSet)&&Ue()}}return customElements.polyfillWrapFlushCallback||(De()?typeof window<"u"&&!window.CustomStateSet&&Ue(HTMLElement.prototype.attachInternals):ct(!1)),s.forceCustomStateSetPolyfill=Ue,s.forceElementInternalsPolyfill=ct,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})()),jd}qd();var Wd=Object.defineProperty,J=(s,e,t,i)=>{for(var n=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=a(e,t,n)||n);return n&&Wd(e,t,n),n};const ka="on",Bn="--checked",Ri=",";let z=class extends ke{constructor(){super(),this.defaultValue=null,this.disabled=!1,this.readonly=!1,this.required=!1,this.max=null,this.maxlength=null,this.min=null,this.minlength=null,this.step=null,this.ariaDescribedBy=null,this.ariaLabelledby=null,this.name="",this.pattern=null,this.placeholder=null,this.id=is(),this.counter=!1,this.hasError=!1,this.inline=!1,this.hasFieldset=!1,this.optionalTag=!1,this.requiredTag=!1,this.skipForwardTestid=!1,this.useWrapper=!0,this.fullwidth=!1,this.counterMaxLength=0,this.errorMessage="",this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=wt.props.helptextDropdownButton.default,this.label=null,this.optionalText=vt.forms.labels.optional,this.requiredText=vt.forms.labels.required,this.tagText=null,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(e){var t,i,n,r,a,l,d,p,m,b,y;if(!e){console.warn("manageValidity called without valid input element");return}this.required&&!this.value?this.internals.setValidity({valueMissing:!0},vt.forms.messages.required,e):(t=e.validity)!=null&&t.typeMismatch||(i=e.validity)!=null&&i.badInput?this.internals.setValidity({typeMismatch:!0},vt.forms.messages.invalid,e):(n=e.validity)!=null&&n.patternMismatch?this.internals.setValidity({patternMismatch:!0},vt.forms.messages.invalidPattern,e):(r=e.validity)!=null&&r.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},vt.forms.messages.tooShort,e):(a=e.validity)!=null&&a.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},vt.forms.messages.tooLong,e):(l=e.validity)!=null&&l.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?vt.forms.messages.rangeUnderflowMin.replace("{min}",(d=this.min)==null?void 0:d.toString()):vt.forms.messages.rangeUnderflow,e):(p=e.validity)!=null&&p.stepMismatch?this.internals.setValidity({stepMismatch:!0},vt.forms.messages.invalid,e):(m=e.validity)!=null&&m.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?vt.forms.messages.rangeOverflowMax.replace("{max}",(b=this.max)==null?void 0:b.toString()):vt.forms.messages.rangeOverflow,e):(y=e.validity)!=null&&y.customError?this.internals.setValidity({customError:!0},e.validationMessage,e):this.internals.setValidity({})}setFormValue(e){if(this.internals)if(Array.isArray(e)){const t=new FormData;e.forEach(i=>{t.append(this.name,i)}),this.internals.setFormValue(t)}else this.internals.setFormValue(e)}coordinateRadioGroup(){if(!this.form||!this.name||this.type!=="radio")return;const e=`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`;this.form.querySelectorAll(e).forEach(t=>{var i;if(t!==this&&t.getAttribute("name")===this.name&&t.getAttribute("value")!==this.value){const n=t;n.checked&&(n.checked=!1,n.internals&&(n.internals.setFormValue(null),(i=n.internals.states)==null||i.delete(Bn)))}})}valueChecked(e){if(!this.touched)return;const t=this.internals.form||this.closest("form"),i=t?new FormData(t):null;if(this.type==="radio"&&this.coordinateRadioGroup(),typeof e=="string"?(this.checked=e==="true",this.internals.ariaChecked=String(e==="true")):typeof e=="boolean"&&(this.checked=e,this.internals.ariaChecked=String(e)),this.checked){const n=(typeof this.value=="string"?this.value:"")||ka;this.internals.setFormValue(n),i&&i.append(this.name,n),this.internals.states.add(Bn)}else this.internals.setFormValue(null),i&&i.delete(this.name),this.internals.states.delete(Bn);this.dispatchChangeEvents(this.checked),this.internals.reportValidity()}valueChanged(e,t){(t!==this.value||t!==this._value)&&(typeof e=="string"?((this.multiple||this.range)&&e.includes(Ri)&&(e=e.split(Ri)),this.value=e,this._value=Array.isArray(e)?e:[e]):Array.isArray(e)?(this.value=this.multiple||this.range?e:e[0],this._value=e):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&t&&t.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(t==null?void 0:t.toString())&&this.onChange(this.value))}dispatchChangeEvents(e){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:e,bubbles:!0,composed:!0}))}clearInputValue(){const e=this.multiple||this.range?[]:"";this.value=e,this.setFormValue(e),this.dispatchChangeEvents(e)}onFocus(){this.dispatchEvent(new FocusEvent("focus",{bubbles:!0,composed:!0}))}onBlur(){this.dispatchEvent(new FocusEvent("blur",{bubbles:!0,composed:!0}))}onInput(){this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}normalizeValue(e){return(this.range||this.multiple)&&typeof e=="string"&&e.includes(Ri)?e.split(Ri):!this.multiple&&!this.range&&Array.isArray(e)?e[0]||"":e}validate(){var e,t;(e=this.inputRef)!=null&&e.value&&this.manageValidity(this.inputRef.value),(t=this.inputRefTo)!=null&&t.value&&this.manageValidity(this.inputRefTo.value)}onChange(e){if(!this.touched){this.touched=!0,e&&this.setFormValue(e);return}if(typeof e!="string"&&!Array.isArray(e))return;const t=this.normalizeValue(e);this.setFormValue(t),this.validate(),this.dispatchChangeEvents(t)}formResetCallback(){var e;if(this.touched=!1,this._options&&this._options.length&&this._options.forEach(t=>{"selected"in t&&(t.selected=!1)}),this.checked!==void 0)this.checked=!1,this.internals.ariaChecked="false",this.internals.setFormValue(""),(e=this.inputRef)!=null&&e.value&&"checked"in this.inputRef.value&&(this.inputRef.value.checked=!1),this.valueChecked(this.checked);else{this.internals.setFormValue("");const t=this.defaultValue||(this.multiple||this.range?[]:"");this.value=t,this._value=Array.isArray(t)?t:[t],this.valueChanged(this.value,null)}this.internals.ariaInvalid="false"}updated(e){super.updated(e),e.has("dataTestid")&&this.dataTestid&&this.inputRef.value&&(this.skipForwardTestid?this.hasAttribute("data-testid")||this.setAttribute("data-testid",this.dataTestid):(this.inputRef.value.dataset.testid=this.dataTestid,this.removeAttribute("data-testid")))}firstUpdated(e){if(super.firstUpdated(e),!this.form){const t=this.internals.form||this.closest("form");this.form=t}if(this.value&&this.defaultValue!==null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked="true",this.checked=!0),this.required&&(this.internals.ariaRequired="true"),this.disabled&&(this.internals.ariaDisabled="true"),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const t=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=String(t);const i=t?(typeof this.value=="string"?this.value:"")||ka:null;this.internals.setFormValue(i)}else this.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute("form",""),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute("form",""),this.manageValidity(this.inputRefTo.value))}};J([c({type:Boolean,reflect:!0})],z.prototype,"checked"),J([c({type:Boolean})],z.prototype,"defaultChecked"),J([c({type:Boolean})],z.prototype,"multiple"),J([c({type:Boolean})],z.prototype,"range"),J([c({type:String,reflect:!0})],z.prototype,"type"),J([c()],z.prototype,"defaultValue"),J([c({type:Boolean,reflect:!0})],z.prototype,"disabled"),J([c({type:Boolean,reflect:!0})],z.prototype,"readonly"),J([c({type:Boolean,reflect:!0})],z.prototype,"required"),J([c({reflect:!0,converter:{fromAttribute:s=>s,toAttribute:s=>(s==null?void 0:s.toString())??null}})],z.prototype,"max"),J([c({type:Number,reflect:!0})],z.prototype,"maxlength"),J([c({reflect:!0,converter:{fromAttribute:s=>s,toAttribute:s=>(s==null?void 0:s.toString())??null}})],z.prototype,"min"),J([c({type:Number,reflect:!0})],z.prototype,"minlength"),J([c({type:Number,reflect:!0})],z.prototype,"step"),J([c({type:String})],z.prototype,"ariaDescribedBy"),J([c({type:String})],z.prototype,"ariaLabelledby"),J([c({type:String,reflect:!0})],z.prototype,"name"),J([c({type:String,reflect:!0})],z.prototype,"pattern"),J([c({type:String,reflect:!0})],z.prototype,"placeholder"),J([c({type:String,reflect:!0})],z.prototype,"id"),J([c({type:Boolean})],z.prototype,"counter"),J([c({type:Boolean})],z.prototype,"hasError"),J([c({type:Boolean})],z.prototype,"inline"),J([c({type:Boolean})],z.prototype,"hasFieldset"),J([c({type:Boolean})],z.prototype,"optionalTag"),J([c({type:Boolean})],z.prototype,"requiredTag"),J([c({type:Boolean})],z.prototype,"skipForwardTestid"),J([c({type:Boolean,reflect:!0,converter:bt})],z.prototype,"useWrapper"),J([c({type:Boolean,reflect:!0})],z.prototype,"fullwidth"),J([c({type:Number})],z.prototype,"counterMaxLength"),J([c({type:String})],z.prototype,"errorMessage"),J([c({type:String})],z.prototype,"helptext"),J([c({type:String})],z.prototype,"helptextDropdown"),J([c({type:String,reflect:!1})],z.prototype,"helptextDropdownButton"),J([c({type:String})],z.prototype,"label"),J([c({type:String,reflect:!1})],z.prototype,"optionalText"),J([c({type:String,reflect:!1})],z.prototype,"requiredText"),J([c({type:String,reflect:!1})],z.prototype,"tagText"),J([c({type:String,attribute:"data-testid"})],z.prototype,"dataTestid");let _a=class{constructor(e){this.nodes=[],this.options=[],this.host=e,this.host.addController(this),this.nodes=[],this.options=[],this.observer=new MutationObserver(t=>this.handleMutations(t))}hostConnected(){Array.from(this.host.childNodes).forEach(e=>{(e.nodeName==="OPTION"||e.nodeName==="DATA")&&this.addNode(e)}),this.createOptions(),this.observer.observe(this.host,{childList:!0,subtree:!1,attributes:!0})}hostDisconnected(){this.observer.disconnect()}addNode(e){(e.nodeName==="OPTION"||e.nodeName==="DATA")&&(e.hasAttribute("hidden")&&!e.hasAttribute("data-skip")&&e.setAttribute("data-hidden","true"),!e.hasAttribute("hidden")&&e.hasAttribute("data-skip")&&e.hasAttribute("data-hidden")&&e.removeAttribute("data-hidden"),e.setAttribute("class","pkt-hide"),e.setAttribute("data-skip","true"),e.setAttribute("hidden","true"),this.nodes.push(e))}createOptions(){this.options=this.nodes.map(e=>({value:e.hasAttribute("value")?e.getAttribute("value")??"":e.textContent??"",label:e.textContent||e.getAttribute("value")||"",selected:e.hasAttribute("selected"),disabled:e.hasAttribute("disabled"),hidden:e.hasAttribute("data-hidden")})),this.host.requestUpdate()}handleMutations(e){let t=!1;e.forEach(i=>{i.type==="childList"&&(i.addedNodes.forEach(n=>{Bs(n)&&(this.addNode(n),t=!0)}),i.removedNodes.forEach(n=>{Bs(n)&&(this.nodes=this.nodes.filter(r=>r!==n),t=!0)})),i.type==="attributes"&&Bs(i.target)&&(this.addNode(i.target),t=!0)}),t&&this.createOptions()}};var zd=Object.defineProperty,Yd=Object.getOwnPropertyDescriptor,$s=(s,e,t,i)=>{for(var n=i>1?void 0:i?Yd(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&zd(e,t,n),n};let Yt=class extends ke{constructor(){super(),this.defaultSlot=B(),this.forId=is(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=wt.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new Le(this,this.defaultSlot)}updateSlots(e){this.filledSlots=new Set(e)}render(){const e=()=>{const n=!this.isHelpTextOpen;this.isHelpTextOpen=n,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:n}}))},t=I({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.filledSlots.size>0}),i=()=>this.helptextDropdown?v`<div class="pkt-inputwrapper__helptext-expandable">
412
412
  <button
413
413
  class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
414
414
  type="button"
@@ -425,51 +425,51 @@
425
425
  >
426
426
  ${Ki(this.helptextDropdown)}
427
427
  </div>
428
- </div>`:w;return b`${b`<div class="${t}">
428
+ </div>`:w;return v`${v`<div class="${t}">
429
429
  <div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
430
430
  <div class="pkt-contents" ${F(this.defaultSlot)} name="helptext"></div>
431
431
  ${this.helptext&&Ki(this.helptext)}
432
432
  </div>
433
433
  ${i()}
434
- </div>`}`}};$s([c({type:String,reflect:!0})],Yt.prototype,"forId",2),$s([c({type:String})],Yt.prototype,"helptext",2),$s([c({type:String})],Yt.prototype,"helptextDropdown",2),$s([c({type:String})],Yt.prototype,"helptextDropdownButton",2),$s([Z()],Yt.prototype,"isHelpTextOpen",2),$s([Z()],Yt.prototype,"filledSlots",2),Yt=$s([ee("pkt-helptext")],Yt);var Kd=Object.defineProperty,Gd=Object.getOwnPropertyDescriptor,Oe=(s,e,t,i)=>{for(var n=i>1?void 0:i?Gd(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Kd(e,t,n),n};let Ce=class extends ke{constructor(){super(),this.defaultSlot=B(),this.helptextSlot=B(),this.forId=is(),this.label="",this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=wt.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.counterError=null,this.counterPosition="bottom",this.optionalTag=wt.props.optionalTag.default,this.optionalText=wt.props.optionalText.default,this.requiredTag=wt.props.requiredTag.default,this.requiredText=wt.props.requiredText.default,this.tagText=null,this.hasError=wt.props.hasError.default,this.errorMessage="",this.disabled=wt.props.disabled.default,this.inline=wt.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=wt.props.hasFieldset.default,this.role="group",this.useWrapper=wt.props.useWrapper.default,this.slotController=new Le(this,this.defaultSlot,this.helptextSlot)}updated(e){super.updated(e)}render(){const e={"pkt-inputwrapper":!0,"pkt-inputwrapper--error":this.hasError,"pkt-inputwrapper--disabled":this.disabled,"pkt-inputwrapper--inline":this.inline},t="pkt-tag pkt-tag--small pkt-tag--thin-text",i=this.ariaDescribedby?this.ariaDescribedby:this.helptext?`${this.forId}-helptext`:w,n=()=>b`
435
- ${this.tagText?b`<span class=${t+" pkt-tag--gray"}>${this.tagText}</span>`:w}
436
- ${this.optionalTag?b`<span class=${t+" pkt-tag--blue-light"}>${this.optionalText}</span>`:w}
437
- ${this.requiredTag?b`<span class=${t+" pkt-tag--beige"}>${this.requiredText}</span>`:w}
438
- `,r=()=>this.useWrapper?this.hasFieldset?b`<legend
434
+ </div>`}`}};$s([c({type:String,reflect:!0})],Yt.prototype,"forId",2),$s([c({type:String})],Yt.prototype,"helptext",2),$s([c({type:String})],Yt.prototype,"helptextDropdown",2),$s([c({type:String})],Yt.prototype,"helptextDropdownButton",2),$s([Z()],Yt.prototype,"isHelpTextOpen",2),$s([Z()],Yt.prototype,"filledSlots",2),Yt=$s([ee("pkt-helptext")],Yt);var Kd=Object.defineProperty,Gd=Object.getOwnPropertyDescriptor,Oe=(s,e,t,i)=>{for(var n=i>1?void 0:i?Gd(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Kd(e,t,n),n};let Ce=class extends ke{constructor(){super(),this.defaultSlot=B(),this.helptextSlot=B(),this.forId=is(),this.label="",this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=wt.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.counterError=null,this.counterPosition="bottom",this.optionalTag=wt.props.optionalTag.default,this.optionalText=wt.props.optionalText.default,this.requiredTag=wt.props.requiredTag.default,this.requiredText=wt.props.requiredText.default,this.tagText=null,this.hasError=wt.props.hasError.default,this.errorMessage="",this.disabled=wt.props.disabled.default,this.inline=wt.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=wt.props.hasFieldset.default,this.role="group",this.useWrapper=wt.props.useWrapper.default,this.slotController=new Le(this,this.defaultSlot,this.helptextSlot)}updated(e){super.updated(e)}render(){const e={"pkt-inputwrapper":!0,"pkt-inputwrapper--error":this.hasError,"pkt-inputwrapper--disabled":this.disabled,"pkt-inputwrapper--inline":this.inline},t="pkt-tag pkt-tag--small pkt-tag--thin-text",i=this.ariaDescribedby?this.ariaDescribedby:this.helptext?`${this.forId}-helptext`:w,n=()=>v`
435
+ ${this.tagText?v`<span class=${t+" pkt-tag--gray"}>${this.tagText}</span>`:w}
436
+ ${this.optionalTag?v`<span class=${t+" pkt-tag--blue-light"}>${this.optionalText}</span>`:w}
437
+ ${this.requiredTag?v`<span class=${t+" pkt-tag--beige"}>${this.requiredText}</span>`:w}
438
+ `,r=()=>this.useWrapper?this.hasFieldset?v`<legend
439
439
  class="pkt-inputwrapper__legend"
440
440
  id="${this.forId}-label"
441
441
  @click=${this.handleLabelClick}
442
442
  >
443
443
  ${this.label} ${n()}
444
- </legend>`:b`<label
444
+ </legend>`:v`<label
445
445
  class="pkt-inputwrapper__label"
446
446
  for="${this.forId}"
447
447
  aria-describedby="${i}"
448
448
  id="${this.forId}-label"
449
449
  @click=${this.handleLabelClick}
450
450
  >${this.label}${n()}</label
451
- >`:b`<label
451
+ >`:v`<label
452
452
  for="${this.forId}"
453
453
  class="pkt-sr-only"
454
454
  aria-describedby="${i}"
455
455
  id="${this.forId}-label"
456
456
  >
457
457
  ${this.label}
458
- </label>`,a=()=>b`
458
+ </label>`,a=()=>v`
459
459
  <pkt-helptext
460
460
  class="${P(this.useWrapper?void 0:"pkt-hide")}"
461
461
  .forId=${this.forId}
462
462
  .helptext=${this.helptext}
463
463
  .helptextDropdown=${this.helptextDropdown}
464
464
  .helptextDropdownButton=${this.helptextDropdownButton||wt.props.helptextDropdownButton.default}
465
- @toggleHelpText=${v=>{this.toggleDropdown(v)}}
465
+ @toggleHelpText=${b=>{this.toggleDropdown(b)}}
466
466
  ${F(this.helptextSlot)}
467
467
  name="helptext"
468
468
  ></pkt-helptext>
469
- `,l=()=>this.counter?b`<div class="pkt-input__counter" aria-live="polite" aria-atomic="true">
469
+ `,l=()=>this.counter?v`<div class="pkt-input__counter" aria-live="polite" aria-atomic="true">
470
470
  ${this.counterError?this.counterError:w} ${this.counterCurrent||0}
471
471
  ${this.counterMaxLength?`/${this.counterMaxLength}`:w}
472
- </div>`:w,d=()=>this.hasError&&this.errorMessage?b`<pkt-alert
472
+ </div>`:w,d=()=>this.hasError&&this.errorMessage?v`<pkt-alert
473
473
  skin="error"
474
474
  compact
475
475
  id=${`${this.forId}-error`}
@@ -477,16 +477,16 @@
477
477
  aria-atomic="true"
478
478
  >
479
479
  ${Ki(this.errorMessage)}
480
- </pkt-alert>`:w,p=()=>b`
480
+ </pkt-alert>`:w,p=()=>v`
481
481
  ${r()}
482
482
  ${a()}
483
483
  ${this.counterPosition==="top"?l():w}
484
484
  <div class="pkt-contents" ${F(this.defaultSlot)}></div>
485
485
  ${this.counterPosition==="bottom"?l():w}
486
486
  ${d()}
487
- `,m=()=>this.hasFieldset?b`<fieldset class="pkt-inputwrapper__fieldset" aria-describedby="${i}">
487
+ `,m=()=>this.hasFieldset?v`<fieldset class="pkt-inputwrapper__fieldset" aria-describedby="${i}">
488
488
  ${p()}
489
- </fieldset>`:b`<div class="pkt-inputwrapper__fieldset">${p()}</div>`;return b`<div class=${I(e)}>${m()}</div> `}toggleDropdown(e){this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!1,detail:{isOpen:e.detail.isOpen}}))}handleLabelClick(){this.dispatchEvent(new CustomEvent("labelClick",{bubbles:!0,composed:!0,detail:"label clicked"}))}};Oe([c({type:String})],Ce.prototype,"forId",2),Oe([c({type:String})],Ce.prototype,"label",2),Oe([c({type:String})],Ce.prototype,"helptext",2),Oe([c({type:String})],Ce.prototype,"helptextDropdown",2),Oe([c({type:String})],Ce.prototype,"helptextDropdownButton",2),Oe([c({type:Boolean})],Ce.prototype,"counter",2),Oe([c({type:Number})],Ce.prototype,"counterCurrent",2),Oe([c({type:Number})],Ce.prototype,"counterMaxLength",2),Oe([c({type:String})],Ce.prototype,"counterError",2),Oe([c({type:String,reflect:!1})],Ce.prototype,"counterPosition",2),Oe([c({type:Boolean})],Ce.prototype,"optionalTag",2),Oe([c({type:String})],Ce.prototype,"optionalText",2),Oe([c({type:Boolean})],Ce.prototype,"requiredTag",2),Oe([c({type:String})],Ce.prototype,"requiredText",2),Oe([c({type:String})],Ce.prototype,"tagText",2),Oe([c({type:Boolean})],Ce.prototype,"hasError",2),Oe([c({type:String})],Ce.prototype,"errorMessage",2),Oe([c({type:Boolean})],Ce.prototype,"disabled",2),Oe([c({type:Boolean})],Ce.prototype,"inline",2),Oe([c({type:String})],Ce.prototype,"ariaDescribedby",2),Oe([c({type:Boolean})],Ce.prototype,"hasFieldset",2),Oe([c({type:String,reflect:!0})],Ce.prototype,"role",2),Oe([c({type:Boolean,reflect:!0,converter:bt})],Ce.prototype,"useWrapper",2),Ce=Oe([ee("pkt-input-wrapper")],Ce);var Xd=Object.defineProperty,Qd=Object.getOwnPropertyDescriptor,dt=(s,e,t,i)=>{for(var n=i>1?void 0:i?Qd(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Xd(e,t,n),n};let nt=class extends ke{constructor(){super(...arguments),this.id=is(),this.label=null,this.options=[],this.isOpen=!1,this.disabled=!1,this.includeSearch=!1,this.isMultiSelect=!1,this.allowUserInput=!1,this.maxIsReached=!1,this.customUserInput=null,this.searchPlaceholder=null,this.searchValue=null,this.maxLength=0,this.userMessage=null,this._selectedOptions=0,this._filteredOptions=[]}connectedCallback(){super.connectedCallback(),this.includeSearch&&!this.searchValue&&(this.searchValue=""),this.options.length>0&&this.filterOptions(),this.setAttribute("tabindex","-1"),this.addEventListener("focus",this.focusFirstOrSelectedOption)}updated(e){(e.has("options")||e.has("searchValue"))&&this.filterOptions(),super.updated(e)}attributeChangedCallback(e,t,i){(e==="options"||e==="searchValue"||e==="search-value")&&this.filterOptions(),super.attributeChangedCallback(e,t,i)}render(){return b`
489
+ </fieldset>`:v`<div class="pkt-inputwrapper__fieldset">${p()}</div>`;return v`<div class=${I(e)}>${m()}</div> `}toggleDropdown(e){this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!1,detail:{isOpen:e.detail.isOpen}}))}handleLabelClick(){this.dispatchEvent(new CustomEvent("labelClick",{bubbles:!0,composed:!0,detail:"label clicked"}))}};Oe([c({type:String})],Ce.prototype,"forId",2),Oe([c({type:String})],Ce.prototype,"label",2),Oe([c({type:String})],Ce.prototype,"helptext",2),Oe([c({type:String})],Ce.prototype,"helptextDropdown",2),Oe([c({type:String})],Ce.prototype,"helptextDropdownButton",2),Oe([c({type:Boolean})],Ce.prototype,"counter",2),Oe([c({type:Number})],Ce.prototype,"counterCurrent",2),Oe([c({type:Number})],Ce.prototype,"counterMaxLength",2),Oe([c({type:String})],Ce.prototype,"counterError",2),Oe([c({type:String,reflect:!1})],Ce.prototype,"counterPosition",2),Oe([c({type:Boolean})],Ce.prototype,"optionalTag",2),Oe([c({type:String})],Ce.prototype,"optionalText",2),Oe([c({type:Boolean})],Ce.prototype,"requiredTag",2),Oe([c({type:String})],Ce.prototype,"requiredText",2),Oe([c({type:String})],Ce.prototype,"tagText",2),Oe([c({type:Boolean})],Ce.prototype,"hasError",2),Oe([c({type:String})],Ce.prototype,"errorMessage",2),Oe([c({type:Boolean})],Ce.prototype,"disabled",2),Oe([c({type:Boolean})],Ce.prototype,"inline",2),Oe([c({type:String})],Ce.prototype,"ariaDescribedby",2),Oe([c({type:Boolean})],Ce.prototype,"hasFieldset",2),Oe([c({type:String,reflect:!0})],Ce.prototype,"role",2),Oe([c({type:Boolean,reflect:!0,converter:bt})],Ce.prototype,"useWrapper",2),Ce=Oe([ee("pkt-input-wrapper")],Ce);var Xd=Object.defineProperty,Qd=Object.getOwnPropertyDescriptor,dt=(s,e,t,i)=>{for(var n=i>1?void 0:i?Qd(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Xd(e,t,n),n};let nt=class extends ke{constructor(){super(...arguments),this.id=is(),this.label=null,this.options=[],this.isOpen=!1,this.disabled=!1,this.includeSearch=!1,this.isMultiSelect=!1,this.allowUserInput=!1,this.maxIsReached=!1,this.customUserInput=null,this.searchPlaceholder=null,this.searchValue=null,this.maxLength=0,this.userMessage=null,this._selectedOptions=0,this._filteredOptions=[]}connectedCallback(){super.connectedCallback(),this.includeSearch&&!this.searchValue&&(this.searchValue=""),this.options.length>0&&this.filterOptions(),this.setAttribute("tabindex","-1"),this.addEventListener("focus",this.focusFirstOrSelectedOption)}updated(e){(e.has("options")||e.has("searchValue"))&&this.filterOptions(),super.updated(e)}attributeChangedCallback(e,t,i){(e==="options"||e==="searchValue"||e==="search-value")&&this.filterOptions(),super.attributeChangedCallback(e,t,i)}render(){return v`
490
490
  <div
491
491
  class=${I({"pkt-listbox":!0,"pkt-listbox__open":this.isOpen,"pkt-txt-16-light":!0})}
492
492
  role="listbox"
@@ -500,7 +500,7 @@
500
500
  ${this.renderList()}
501
501
  </ul>
502
502
  </div>
503
- `}renderCheckboxOrCheckIcon(e,t){return this.isMultiSelect?b`
503
+ `}renderCheckboxOrCheckIcon(e,t){return this.isMultiSelect?v`
504
504
  <input
505
505
  class="pkt-input-check__input-checkbox"
506
506
  type="checkbox"
@@ -511,8 +511,8 @@
511
511
  aria-labelledby=${this.id+"-option-label-"+t}
512
512
  ?disabled=${this.disabled||e.disabled||this.maxIsReached&&!e.selected}
513
513
  />
514
- `:e.selected?b`<pkt-icon name="check-big"></pkt-icon>`:w}renderList(){return b`
515
- ${Ln(this._filteredOptions,e=>e.value,(e,t)=>b`
514
+ `:e.selected?v`<pkt-icon name="check-big"></pkt-icon>`:w}renderList(){return v`
515
+ ${Ln(this._filteredOptions,e=>e.value,(e,t)=>v`
516
516
  <li
517
517
  @click=${()=>{this.toggleOption(e)}}
518
518
  aria-selected=${e.selected?"true":"false"}
@@ -528,15 +528,15 @@
528
528
  >
529
529
  ${this.renderCheckboxOrCheckIcon(e,t)}
530
530
  <span class="pkt-listbox__option-label" id=${this.id+"-option-label-"+t}>
531
- ${e.prefix?b`<span class="pkt-listbox__option-prefix">${e.prefix}</span>`:w}
531
+ ${e.prefix?v`<span class="pkt-listbox__option-prefix">${e.prefix}</span>`:w}
532
532
  ${e.label||e.value}
533
533
  </span>
534
- ${e.description?b`<span class="pkt-listbox__option-description pkt-txt-14-light"
534
+ ${e.description?v`<span class="pkt-listbox__option-description pkt-txt-14-light"
535
535
  >${e.description}</span
536
536
  >`:w}
537
537
  </li>
538
538
  `)}
539
- `}renderNewOptionBanner(){return this.allowUserInput&&this.customUserInput?b`
539
+ `}renderNewOptionBanner(){return this.allowUserInput&&this.customUserInput?v`
540
540
  <div
541
541
  class="pkt-listbox__banner pkt-listbox__banner--new-option pkt-listbox__option"
542
542
  data-type="new-option"
@@ -549,18 +549,18 @@
549
549
  <pkt-icon class="pkt-listbox__banner-icon" name="plus-sign" size="large"></pkt-icon>
550
550
  Legg til “${this.customUserInput}”
551
551
  </div>
552
- `:w}renderMaximumReachedBanner(){return this._selectedOptions=this.options.filter(e=>e.selected).length,this.isMultiSelect&&this._selectedOptions>0&&this.maxLength>0?b`
552
+ `:w}renderMaximumReachedBanner(){return this._selectedOptions=this.options.filter(e=>e.selected).length,this.isMultiSelect&&this._selectedOptions>0&&this.maxLength>0?v`
553
553
  <div class="pkt-listbox__banner pkt-listbox__banner--maximum-reached">
554
554
  ${this._selectedOptions} av maks ${this.maxLength} mulige er valgt.
555
555
  </div>
556
- `:w}renderUserMessage(){return this.userMessage?b`<div class="pkt-listbox__banner pkt-listbox__banner--user-message">
556
+ `:w}renderUserMessage(){return this.userMessage?v`<div class="pkt-listbox__banner pkt-listbox__banner--user-message">
557
557
  <pkt-icon
558
558
  class="pkt-listbox__banner-icon"
559
559
  name="exclamation-mark-circle"
560
560
  size="large"
561
561
  ></pkt-icon>
562
562
  ${this.userMessage}
563
- </div>`:w}renderSearch(){return this.includeSearch?b`
563
+ </div>`:w}renderSearch(){return this.includeSearch?v`
564
564
  <div class="pkt-listbox__search">
565
565
  <span class="pkt-listbox__search-icon">
566
566
  <pkt-icon name="magnifying-glass-small" size="large"></pkt-icon>
@@ -580,7 +580,7 @@
580
580
  role="searchbox"
581
581
  />
582
582
  </div>
583
- `:w}handleSearchInput(e){this.searchValue=e.target.value,this.dispatchEvent(new CustomEvent("search",{detail:this.searchValue,bubbles:!1}))}handleSearchKeydown(e){switch(e.key){case"Enter":e.preventDefault();break;case"ArrowUp":case"Escape":this.closeOptions(),e.preventDefault();break;case"ArrowDown":case"Tab":this.focusFirstOrSelectedOption();break}}handleOptionKeydown(e){const t=e.currentTarget,i=t.dataset.value,n=t.dataset.type,r=t.dataset.selected==="true";if(!(!this.getOptionElements().length&&(!this.customUserInput||!this.allowUserInput&&this.customUserInput)&&n!=="new-option"&&n!=="searchbox"))switch(e.key){case" ":case"Enter":this.toggleOption(t),e.preventDefault();break;case"Backspace":i&&(r?this.toggleOption(t):this.closeOptions()),e.preventDefault();break;case"Escape":case"Tab":this.closeOptions();break;case"ArrowDown":e.altKey?this.focusLastOption():n==="searchbox"||n==="new-option"?this.focusFirstOption():this.focusNextOption(t),e.preventDefault();break;case"ArrowUp":if(e.altKey)this.focusFirstOption();else if(t.dataset.index==="0"&&this.includeSearch){const a=this.querySelector('[role="searchbox"]');a&&a.focus()}else if(t.dataset.index==="0"&&this.customUserInput){const a=this.querySelector('[data-type="new-option"]');a&&a.focus()}else this.focusPreviousOption(t);e.preventDefault();break;case"Home":this.focusFirstOption(),e.preventDefault();break;case"End":this.focusLastOption(),e.preventDefault();break;default:(e.metaKey||e.ctrlKey)&&e.key==="a"&&(this.selectAll(),e.preventDefault()),this.isLetterOrSpace(e.key)&&(this.handleTypeAhead(e.key),e.preventDefault());break}}focusAndScrollIntoView(e){e.scrollIntoView({block:"nearest"}),window.setTimeout(()=>e.focus(),0)}focusNextOption(e){const t=e.nextElementSibling;t&&this.focusAndScrollIntoView(t)}focusPreviousOption(e){const t=e.previousElementSibling;if(e.dataset.index==="0"&&this.includeSearch){const i=this.querySelector('[role="searchbox"]');i&&this.focusAndScrollIntoView(i)}else t&&this.focusAndScrollIntoView(t)}focusFirstOption(){const e=this.getOptionElements()[0];e&&this.focusAndScrollIntoView(e)}focusLastOption(){const e=this.getOptionElements().pop();e&&this.focusAndScrollIntoView(e)}focusFirstOrSelectedOption(){if(this.disabled)return;const e=this.getOptionElements().find(t=>t.dataset.selected==="true");if(this.allowUserInput&&this.customUserInput){const t=this.querySelector('[data-type="new-option"]');this.focusAndScrollIntoView(t)}else if(e)this.focusAndScrollIntoView(e);else if(this.includeSearch&&!(document.activeElement instanceof HTMLInputElement)){const t=this.querySelector('[role="searchbox"]');window.setTimeout(()=>t.focus(),0)}else this.focusFirstOption()}toggleOption(e){const t=e instanceof HTMLElement?e.dataset.disabled:e.disabled;if(this.disabled||t)return;const i=e instanceof HTMLElement?e.dataset.value:e.value;this.dispatchEvent(new CustomEvent("option-toggle",{detail:i,bubbles:!1}))}selectAll(){this.dispatchEvent(new CustomEvent("select-all",{bubbles:!1}))}closeOptions(){this.dispatchEvent(new CustomEvent("close-options",{bubbles:!1}))}filterOptions(){this.searchValue?this._filteredOptions=this.options.filter(e=>{var t;return(e.fulltext||e.label+e.value+(e.prefix||"")).toLowerCase().includes(((t=this.searchValue)==null?void 0:t.toLowerCase())||"")}):this._filteredOptions=[...this.options]}isLetterOrSpace(e){return/^[\p{L} ]$/u.test(e)}handleTypeAhead(e){this.typeAheadString+=e.toLowerCase(),this.typeAheadTimeout&&clearTimeout(this.typeAheadTimeout),this.typeAheadTimeout=window.setTimeout(()=>{this.typeAheadString=""},500);const t=this.getOptionElements().find(i=>{var n;return(n=i.textContent)==null?void 0:n.trim().toLowerCase().startsWith(this.typeAheadString)});t&&this.focusAndScrollIntoView(t)}getOptionElements(){return this._filteredOptions.length?Array.from(this.querySelectorAll('[role="option"]:not([data-disabled])')||[]):[]}};dt([c({type:String})],nt.prototype,"id",2),dt([c({type:String})],nt.prototype,"label",2),dt([c({type:Array})],nt.prototype,"options",2),dt([c({type:Boolean,reflect:!0})],nt.prototype,"isOpen",2),dt([c({type:Boolean})],nt.prototype,"disabled",2),dt([c({type:Boolean})],nt.prototype,"includeSearch",2),dt([c({type:Boolean})],nt.prototype,"isMultiSelect",2),dt([c({type:Boolean})],nt.prototype,"allowUserInput",2),dt([c({type:Boolean})],nt.prototype,"maxIsReached",2),dt([c({type:String})],nt.prototype,"customUserInput",2),dt([c({type:String})],nt.prototype,"searchPlaceholder",2),dt([c({type:String})],nt.prototype,"searchValue",2),dt([c({type:Number})],nt.prototype,"maxLength",2),dt([c({type:String})],nt.prototype,"userMessage",2),dt([Z()],nt.prototype,"_filteredOptions",2),nt=dt([ee("pkt-listbox")],nt);const Zd={displayValueAs:{default:"label"}},Jd={props:Zd};var Rd=Object.defineProperty,eu=Object.getOwnPropertyDescriptor,Be=(s,e,t,i)=>{for(var n=i>1?void 0:i?eu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Rd(e,t,n),n};let Pe=class extends z{constructor(){super(),this.helptextSlot=B(),this.value="",this.options=[],this.defaultOptions=[],this.allowUserInput=!1,this.typeahead=!1,this.includeSearch=!1,this.searchPlaceholder="",this.multiple=!1,this.maxlength=null,this.displayValueAs=Jd.props.displayValueAs.default,this.tagPlacement=null,this._options=[],this._value=[],this._isOptionsOpen=!1,this._userInfoMessage="",this._addValueText=null,this._maxIsReached=!1,this._search="",this._inputFocus=!1,this._editingSingleValue=!1,this.inputRef=B(),this.arrowRef=B(),this.listboxRef=B(),this.focusRef=B(),this.optionTagRef=B(),this.optionsController=new _a(this),this.slotController=new Le(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){var e,t;if(super.connectedCallback(),document&&document.body.addEventListener("click",i=>{this._isOptionsOpen&&!this.contains(i.target)&&this.handleFocusOut(i)}),this._options=[],this.defaultOptions&&this.defaultOptions.length){const i=((e=this.options)==null?void 0:e.filter(n=>n.userAdded))||[];this.options=[...i,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if((t=this.optionsController)!=null&&t.nodes&&this.optionsController.nodes.length){const i=[];this.optionsController.nodes.forEach(n=>{if(!n.textContent&&!n.getAttribute("value"))return null;const r={value:n.getAttribute("value")||n.textContent||"",label:n.textContent||n.getAttribute("value")||""};n.getAttribute("data-prefix")&&(r.prefix=n.getAttribute("data-prefix")||void 0),n.getAttribute("tagskincolor")&&(r.tagSkinColor=n.getAttribute("tagskincolor")),n.getAttribute("description")&&(r.description=n.getAttribute("description")||void 0),r.fulltext=r.value+r.label+(r.prefix||""),i.push(r)}),i.length&&(this.options=[...i],this._options=[...i])}}updated(e){if(e.has("_value")&&this.valueChanged(this._value,e.get("_value")),e.has("value")&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]]),this.isMaxItemsReached()),e.has("defaultOptions")&&this.defaultOptions.length){const t=(Array.isArray(this.options)?this.options:[]).filter(i=>i.userAdded)||[];this.options=[...t,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(e.has("options")){const t=(e.get("options")||this._options||[]).filter(n=>n&&n.userAdded).filter(n=>!(Array.isArray(this.options)?this.options:[]).some(r=>r.value===n.value)),i=[...t,...this.options];this._options=i,t.length>0&&(this.options=i),this._options.forEach(n=>{if(n.value&&!n.label&&(n.label=n.value),n.selected&&!this._value.includes(n.value)){const r=[...this._value];this._value=[...this._value,n.value],this.valueChanged(this._value,r)}n.fulltext=n.value+n.label+(n.prefix||""),n.selected=n.selected||this._value.includes(n.value)})}e.has("_search")&&this.dispatchEvent(new CustomEvent("search",{detail:this._search,bubbles:!1})),super.updated(e)}attributeChangedCallback(e,t,i){e==="value"&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]])),e==="options"&&(this._options=Array.isArray(this.options)?[...this.options]:[],this._options.forEach(n=>{n.value&&!n.label&&(n.label=n.value),n.selected&&!this._value.includes(n.value)&&(this._value=[...this._value,n.value]),n.fulltext=n.value+n.label+(n.prefix||"")}),this._search=""),super.attributeChangedCallback(e,t,i)}render(){return b`
583
+ `:w}handleSearchInput(e){this.searchValue=e.target.value,this.dispatchEvent(new CustomEvent("search",{detail:this.searchValue,bubbles:!1}))}handleSearchKeydown(e){switch(e.key){case"Enter":e.preventDefault();break;case"ArrowUp":case"Escape":this.closeOptions(),e.preventDefault();break;case"ArrowDown":case"Tab":this.focusFirstOrSelectedOption();break}}handleOptionKeydown(e){const t=e.currentTarget,i=t.dataset.value,n=t.dataset.type,r=t.dataset.selected==="true";if(!(!this.getOptionElements().length&&(!this.customUserInput||!this.allowUserInput&&this.customUserInput)&&n!=="new-option"&&n!=="searchbox"))switch(e.key){case" ":case"Enter":this.toggleOption(t),e.preventDefault();break;case"Backspace":i&&(r?this.toggleOption(t):this.closeOptions()),e.preventDefault();break;case"Escape":case"Tab":this.closeOptions();break;case"ArrowDown":e.altKey?this.focusLastOption():n==="searchbox"||n==="new-option"?this.focusFirstOption():this.focusNextOption(t),e.preventDefault();break;case"ArrowUp":if(e.altKey)this.focusFirstOption();else if(t.dataset.index==="0"&&this.includeSearch){const a=this.querySelector('[role="searchbox"]');a&&a.focus()}else if(t.dataset.index==="0"&&this.customUserInput){const a=this.querySelector('[data-type="new-option"]');a&&a.focus()}else this.focusPreviousOption(t);e.preventDefault();break;case"Home":this.focusFirstOption(),e.preventDefault();break;case"End":this.focusLastOption(),e.preventDefault();break;default:(e.metaKey||e.ctrlKey)&&e.key==="a"&&(this.selectAll(),e.preventDefault()),this.isLetterOrSpace(e.key)&&(this.handleTypeAhead(e.key),e.preventDefault());break}}focusAndScrollIntoView(e){e.scrollIntoView({block:"nearest"}),window.setTimeout(()=>e.focus(),0)}focusNextOption(e){const t=e.nextElementSibling;t&&this.focusAndScrollIntoView(t)}focusPreviousOption(e){const t=e.previousElementSibling;if(e.dataset.index==="0"&&this.includeSearch){const i=this.querySelector('[role="searchbox"]');i&&this.focusAndScrollIntoView(i)}else t&&this.focusAndScrollIntoView(t)}focusFirstOption(){const e=this.getOptionElements()[0];e&&this.focusAndScrollIntoView(e)}focusLastOption(){const e=this.getOptionElements().pop();e&&this.focusAndScrollIntoView(e)}focusFirstOrSelectedOption(){if(this.disabled)return;const e=this.getOptionElements().find(t=>t.dataset.selected==="true");if(this.allowUserInput&&this.customUserInput){const t=this.querySelector('[data-type="new-option"]');this.focusAndScrollIntoView(t)}else if(e)this.focusAndScrollIntoView(e);else if(this.includeSearch&&!(document.activeElement instanceof HTMLInputElement)){const t=this.querySelector('[role="searchbox"]');window.setTimeout(()=>t.focus(),0)}else this.focusFirstOption()}toggleOption(e){const t=e instanceof HTMLElement?e.dataset.disabled:e.disabled;if(this.disabled||t)return;const i=e instanceof HTMLElement?e.dataset.value:e.value;this.dispatchEvent(new CustomEvent("option-toggle",{detail:i,bubbles:!1}))}selectAll(){this.dispatchEvent(new CustomEvent("select-all",{bubbles:!1}))}closeOptions(){this.dispatchEvent(new CustomEvent("close-options",{bubbles:!1}))}filterOptions(){this.searchValue?this._filteredOptions=this.options.filter(e=>{var t;return(e.fulltext||e.label+e.value+(e.prefix||"")).toLowerCase().includes(((t=this.searchValue)==null?void 0:t.toLowerCase())||"")}):this._filteredOptions=[...this.options]}isLetterOrSpace(e){return/^[\p{L} ]$/u.test(e)}handleTypeAhead(e){this.typeAheadString+=e.toLowerCase(),this.typeAheadTimeout&&clearTimeout(this.typeAheadTimeout),this.typeAheadTimeout=window.setTimeout(()=>{this.typeAheadString=""},500);const t=this.getOptionElements().find(i=>{var n;return(n=i.textContent)==null?void 0:n.trim().toLowerCase().startsWith(this.typeAheadString)});t&&this.focusAndScrollIntoView(t)}getOptionElements(){return this._filteredOptions.length?Array.from(this.querySelectorAll('[role="option"]:not([data-disabled])')||[]):[]}};dt([c({type:String})],nt.prototype,"id",2),dt([c({type:String})],nt.prototype,"label",2),dt([c({type:Array})],nt.prototype,"options",2),dt([c({type:Boolean,reflect:!0})],nt.prototype,"isOpen",2),dt([c({type:Boolean})],nt.prototype,"disabled",2),dt([c({type:Boolean})],nt.prototype,"includeSearch",2),dt([c({type:Boolean})],nt.prototype,"isMultiSelect",2),dt([c({type:Boolean})],nt.prototype,"allowUserInput",2),dt([c({type:Boolean})],nt.prototype,"maxIsReached",2),dt([c({type:String})],nt.prototype,"customUserInput",2),dt([c({type:String})],nt.prototype,"searchPlaceholder",2),dt([c({type:String})],nt.prototype,"searchValue",2),dt([c({type:Number})],nt.prototype,"maxLength",2),dt([c({type:String})],nt.prototype,"userMessage",2),dt([Z()],nt.prototype,"_filteredOptions",2),nt=dt([ee("pkt-listbox")],nt);const Zd={displayValueAs:{default:"label"}},Jd={props:Zd};var Rd=Object.defineProperty,eu=Object.getOwnPropertyDescriptor,Be=(s,e,t,i)=>{for(var n=i>1?void 0:i?eu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Rd(e,t,n),n};let Pe=class extends z{constructor(){super(),this.helptextSlot=B(),this.value="",this.options=[],this.defaultOptions=[],this.allowUserInput=!1,this.typeahead=!1,this.includeSearch=!1,this.searchPlaceholder="",this.multiple=!1,this.maxlength=null,this.displayValueAs=Jd.props.displayValueAs.default,this.tagPlacement=null,this._options=[],this._value=[],this._isOptionsOpen=!1,this._userInfoMessage="",this._addValueText=null,this._maxIsReached=!1,this._search="",this._inputFocus=!1,this._editingSingleValue=!1,this.inputRef=B(),this.arrowRef=B(),this.listboxRef=B(),this.focusRef=B(),this.optionTagRef=B(),this.optionsController=new _a(this),this.slotController=new Le(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){var e,t;if(super.connectedCallback(),document&&document.body.addEventListener("click",i=>{this._isOptionsOpen&&!this.contains(i.target)&&this.handleFocusOut(i)}),this._options=[],this.defaultOptions&&this.defaultOptions.length){const i=((e=this.options)==null?void 0:e.filter(n=>n.userAdded))||[];this.options=[...i,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if((t=this.optionsController)!=null&&t.nodes&&this.optionsController.nodes.length){const i=[];this.optionsController.nodes.forEach(n=>{if(!n.textContent&&!n.getAttribute("value"))return null;const r={value:n.getAttribute("value")||n.textContent||"",label:n.textContent||n.getAttribute("value")||""};n.getAttribute("data-prefix")&&(r.prefix=n.getAttribute("data-prefix")||void 0),n.getAttribute("tagskincolor")&&(r.tagSkinColor=n.getAttribute("tagskincolor")),n.getAttribute("description")&&(r.description=n.getAttribute("description")||void 0),r.fulltext=r.value+r.label+(r.prefix||""),i.push(r)}),i.length&&(this.options=[...i],this._options=[...i])}}updated(e){if(e.has("_value")&&this.valueChanged(this._value,e.get("_value")),e.has("value")&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]]),this.isMaxItemsReached()),e.has("defaultOptions")&&this.defaultOptions.length){const t=(Array.isArray(this.options)?this.options:[]).filter(i=>i.userAdded)||[];this.options=[...t,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(e.has("options")){const t=(e.get("options")||this._options||[]).filter(n=>n&&n.userAdded).filter(n=>!(Array.isArray(this.options)?this.options:[]).some(r=>r.value===n.value)),i=[...t,...this.options];this._options=i,t.length>0&&(this.options=i),this._options.forEach(n=>{if(n.value&&!n.label&&(n.label=n.value),n.selected&&!this._value.includes(n.value)){const r=[...this._value];this._value=[...this._value,n.value],this.valueChanged(this._value,r)}n.fulltext=n.value+n.label+(n.prefix||""),n.selected=n.selected||this._value.includes(n.value)})}e.has("_search")&&this.dispatchEvent(new CustomEvent("search",{detail:this._search,bubbles:!1})),super.updated(e)}attributeChangedCallback(e,t,i){e==="value"&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]])),e==="options"&&(this._options=Array.isArray(this.options)?[...this.options]:[],this._options.forEach(n=>{n.value&&!n.label&&(n.label=n.value),n.selected&&!this._value.includes(n.value)&&(this._value=[...this._value,n.value]),n.fulltext=n.value+n.label+(n.prefix||"")}),this._search=""),super.attributeChangedCallback(e,t,i)}render(){return v`
584
584
  <pkt-input-wrapper
585
585
  .label=${this.label}
586
586
  .helptext=${this.helptext}
@@ -608,7 +608,7 @@
608
608
  tabindex="-1"
609
609
  @click=${this.handleInputClick}
610
610
  >
611
- ${this.placeholder&&(!this._value.length||this.multiple&&this.tagPlacement=="outside")&&!this._inputFocus?b`<span class="pkt-combobox__placeholder" @click=${this.handlePlaceholderClick}
611
+ ${this.placeholder&&(!this._value.length||this.multiple&&this.tagPlacement=="outside")&&!this._inputFocus?v`<span class="pkt-combobox__placeholder" @click=${this.handlePlaceholderClick}
612
612
  >${this.placeholder}</span
613
613
  >`:this.tagPlacement!=="outside"?this.renderSingleOrMultipleValues():w}
614
614
  ${this.renderInputField()}
@@ -662,11 +662,11 @@
662
662
  ></pkt-listbox>
663
663
  </div>
664
664
 
665
- ${this.tagPlacement==="outside"&&this.multiple?b`<div class="pkt-combobox__tags-outside">
665
+ ${this.tagPlacement==="outside"&&this.multiple?v`<div class="pkt-combobox__tags-outside">
666
666
  ${this.renderSingleOrMultipleValues()}
667
667
  </div>`:w}
668
668
  </pkt-input-wrapper>
669
- `}renderInputField(){return this.typeahead||this.allowUserInput?b`
669
+ `}renderInputField(){return this.typeahead||this.allowUserInput?v`
670
670
  <div class="pkt-combobox__input-div combobox__input">
671
671
  <input
672
672
  type="text"
@@ -686,7 +686,7 @@
686
686
  ${F(this.inputRef)}
687
687
  />
688
688
  </div>
689
- `:b`
689
+ `:v`
690
690
  <input
691
691
  type="hidden"
692
692
  id="${this.id}-input"
@@ -694,7 +694,7 @@
694
694
  .value=${this._value.join(",")}
695
695
  ${F(this.inputRef)}
696
696
  />
697
- `}renderSingleOrMultipleValues(){const e=!this.multiple,t=this._editingSingleValue?null:this.renderValueTag(this.findValueInOptions(this._value[0])),i=Ln(this._value,n=>n,n=>{var r;const a=this.findValueInOptions(n),l=(r=this.options.find(d=>d.value===n))==null?void 0:r.tagSkinColor;return b`
697
+ `}renderSingleOrMultipleValues(){const e=!this.multiple,t=this._editingSingleValue?null:this.renderValueTag(this.findValueInOptions(this._value[0])),i=Ln(this._value,n=>n,n=>{var r;const a=this.findValueInOptions(n),l=(r=this.options.find(d=>d.value===n))==null?void 0:r.tagSkinColor;return v`
698
698
  <pkt-tag
699
699
  skin=${l||"blue-dark"}
700
700
  ?closeTag=${!this.disabled}
@@ -702,32 +702,32 @@
702
702
  >
703
703
  ${this.renderValueTag(a)}
704
704
  </pkt-tag>
705
- `});return e?t:i}renderValueTag(e){if(!e)return"";switch(this.displayValueAs){case"prefixAndValue":return b`<span class="pkt-combobox__value" data-focusfix=${this.id}
705
+ `});return e?t:i}renderValueTag(e){if(!e)return"";switch(this.displayValueAs){case"prefixAndValue":return v`<span class="pkt-combobox__value" data-focusfix=${this.id}
706
706
  >${e.prefix||""} ${e.value}</span
707
- >`;case"value":return b`<span class="pkt-combobox__value" data-focusfix=${this.id}
707
+ >`;case"value":return v`<span class="pkt-combobox__value" data-focusfix=${this.id}
708
708
  >${e.value}</span
709
- >`;case"label":default:return b`<span class="pkt-combobox__value" data-focusfix=${this.id}
709
+ >`;case"label":default:return v`<span class="pkt-combobox__value" data-focusfix=${this.id}
710
710
  >${e.label||e.value}</span
711
- >`}}handleInput(e){if(e.stopPropagation(),e.stopImmediatePropagation(),this.disabled)return;this.touched=!0;const t=e.target;if(this._search=t.value,this.checkForMatches(),this.typeahead)if(this._search){if(this._options=this.options.filter(i=>{var n;return(n=i.fulltext)==null?void 0:n.toLowerCase().includes(this._search.toLowerCase())}),e.inputType!=="deleteContentBackward"){const i=this._options.filter(n=>{var r;return!n.selected&&((r=n.label)==null?void 0:r.toLowerCase().startsWith(this._search.toLowerCase()))});if(i.length>0&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const n=i[0];n!=null&&n.label&&(t.value=n.label,window.setTimeout(()=>t.setSelectionRange(this._search.length,t.value.length),0),t.selectionDirection="backward")}}}else this._options=[...this.options]}handleFocus(){if(!this.disabled){if(!this.multiple&&this._value[0]&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const e=this.findValueInOptions(this._value[0]);this._editingSingleValue=!0,this.inputRef.value.value=this.displayValueAs==="label"&&e!=null&&e.label?e.label:this._value[0]}this._inputFocus=!0,this._search="",this._options=[...this.options],this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()}}handleFocusOut(e){var t,i,n,r,a;if(!this.disabled&&((i=(t=e.relatedTarget)==null?void 0:t.closest("pkt-combobox"))==null?void 0:i.id)!==this.id&&((r=(n=e.relatedTarget)==null?void 0:n.closest("pkt-combobox"))==null?void 0:r.id)!==this.id&&((a=e.target)==null?void 0:a.getAttribute("data-focusfix"))!==this.id&&e.relatedTarget!==this.focusRef.value&&e.relatedTarget!==this.inputRef.value&&e.relatedTarget!==this.arrowRef.value&&this._isOptionsOpen){if(this._inputFocus=!1,this._addValueText=null,this._userInfoMessage="",this._search="",this.inputRef.value&&this.inputRef.value.type!=="hidden"&&this.inputRef.value.value!==""){const l=this.inputRef.value.value,d=this.findValueInOptions(l);!this._value.includes(l)&&!d?this.allowUserInput?this.addNewUserValue(l):this.multiple||this.removeValue(this._value[0]):d&&!this._value.includes(d.value)&&this.setSelected(d.value),this.inputRef.value.value=""}this._isOptionsOpen=!1,this.onBlur()}}handleBlur(){this._inputFocus=!1,this._editingSingleValue=!1,this.onBlur()}handleInputClick(e){var t,i;if(this.disabled){e.preventDefault(),e.stopImmediatePropagation();return}e.currentTarget&&e.currentTarget!==this.arrowRef.value&&((t=this.inputRef.value)==null?void 0:t.type)!=="hidden"?((i=this.inputRef.value)==null||i.focus(),this.requestUpdate()):this.handleArrowClick(e)}handlePlaceholderClick(e){this.disabled||(e.stopPropagation(),this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.focus(),this._inputFocus=!0,this.requestUpdate()))}handleArrowClick(e){var t,i;this.disabled||e instanceof KeyboardEvent&&e.key&&e.key!=="Enter"&&e.key!==" "&&e.key!=="ArrowDown"||(e.stopImmediatePropagation(),e.preventDefault(),this._isOptionsOpen=!this._isOptionsOpen,this._isOptionsOpen?(t=this.listboxRef.value)==null||t.focusFirstOrSelectedOption():(i=this.arrowRef.value)==null||i.focus())}handleOptionToggled(e){this.toggleValue(e.detail)}handleSearch(e){e.stopPropagation(),this._search=e.detail.toLowerCase()}handleInputKeydown(e){var t,i,n;switch(e.key){case",":this.multiple&&(e.preventDefault(),this.addValue());break;case"Enter":e.preventDefault(),this.addValue();break;case"Backspace":!this._search&&((t=this.inputRef.value)==null?void 0:t.type)==="hidden"&&this.removeLastValue(e);break;case"Tab":case"ArrowDown":e.shiftKey||((i=this.listboxRef.value)==null||i.focusFirstOrSelectedOption(),e.preventDefault());break;case"Escape":this._isOptionsOpen=!1,(n=this.arrowRef.value)==null||n.focus(),e.preventDefault();break}}handleTagRemove(e){this.removeSelected(e)}blurInput(){this.inputRef.value&&this.inputRef.value.matches(":focus")&&this.inputRef.value.blur()}checkForMatches(){var e;const t=((e=this.inputRef.value)==null?void 0:e.value)||this._search||"",i=t.trim().toLowerCase()||"";if(!i){!this.multiple&&this._value[0]&&this.removeValue(this._value[0]),this.resetComboboxInput(!1);return}const n=this._value.find(l=>l.toLowerCase()===i),r=this._options.filter(l=>{var d;return((d=l.label)==null?void 0:d.toLowerCase().includes(i))??!1}),a=r.find(l=>{var d;return((d=l.label)==null?void 0:d.toLowerCase())===i||l.value.toLowerCase()===i});switch(!0){case((r.length===0||!a)&&this.allowUserInput):this._addValueText=t,this._userInfoMessage="";break;case(r.length===0&&!this._options.length&&!this.allowUserInput):this._addValueText=null,this._userInfoMessage="Ingen match i søket";break;case!!n:this._addValueText=null,this._userInfoMessage="Verdien er allerede valgt";break;case r.length>1:this._addValueText=null,this._userInfoMessage="";break;default:this._addValueText=null,this._userInfoMessage=""}}findValueInOptions(e){return this.options.find(t=>t.value===e||t.label===e)||null}findIndexInOptions(e){return this._options.findIndex(t=>t.value===e||t.label===e)}isMaxItemsReached(){const e=this.maxlength!==null&&this._value.length>=this.maxlength;return e?this._maxIsReached=!0:this._maxIsReached=!1,e}toggleValue(e){var t,i;if(this.disabled)return;this.touched=!0,this._userInfoMessage="",this._addValueText=null;const n=((t=this.findValueInOptions(e))==null?void 0:t.value)||null,r=this._value.includes(e||n||""),a=!!n,l=((i=this._options.find(T=>T.value===e))==null?void 0:i.disabled)||!1,d=!(e!=null&&e.trim()),p=!this.multiple,m=this.multiple,v=this.isMaxItemsReached();let y=!1,k=!0,g="",$="";l||(!a&&this.allowUserInput&&!d?(this.addNewUserValue(e),g="Ny verdi lagt til",y=!m):!a&&!this.allowUserInput?(p&&this._value[0]&&this.removeValue(this._value[0]),k=!1,y=!0,g="Ingen treff i søket"):r?(this.removeValue(n),y=!0):d&&p?(this.removeAllSelected(),y=!0):p?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(n),y=!1,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="",this.inputRef.value.blur())):m&&!v?(this.setSelected(n),y=!0):m&&v?(this._userInfoMessage="Maks antall valg nådd",k=!1,$=e):(p&&this.removeAllSelected(),this._userInfoMessage="Ingen gyldig verdi valgt",k=!1,y=!0,$=e),this._isOptionsOpen=y,y||window.setTimeout(()=>{var T;(T=this.focusRef.value)==null||T.focus()},0),this._userInfoMessage=g,this._search=$||"",this.resetComboboxInput(k),m&&this.isMaxItemsReached())}setSelected(e){if(!this._value.includes(e)){if(this.multiple&&this.isMaxItemsReached()){this._userInfoMessage="Maks antall valg nådd";return}!this.multiple&&this.removeAllSelected(),this._value=e?[...this._value,e]:this._value,this._options=this._options.map(t=>(t.value===e&&(t.selected=!0),t)),this.resetComboboxInput(!0)}}removeSelected(e){if(!e)return;this._value=this._value.filter(i=>i!==e);const t=this.findValueInOptions(e);t?(t.selected=!1,t.userAdded?(this._options=[...this._options.filter(i=>i.value!==e)],this.options=[...this.options.filter(i=>i.value!==e)]):this._options=[...this._options,t]):!e&&!this.multiple&&(this._options=this._options.map(i=>(i.selected=!1,i)))}addAllOptions(){if(this.multiple){if(this.maxlength&&this._options.length>this.maxlength){this._userInfoMessage="For mange valgt";return}this._value=this._options.map(e=>e.value),this._options=this._options.map(e=>(e.selected=!0,e)),this.requestUpdate()}}removeAllSelected(){this._value=[],this._options=this._options.map(e=>(e.selected=!1,e)),this._options=this._options.filter(e=>!e.userAdded),this.requestUpdate()}addValue(){var e;const t=((e=this.inputRef.value)==null?void 0:e.value.trim())||"";this._search=t,this.toggleValue(t)}removeValue(e){this._value=this.multiple?this._value.filter(t=>t!==e):[],this.removeSelected(e)}addNewUserValue(e){if(!e||e.trim()==="")return;if(!this.multiple)this._value[0]&&this.removeSelected(this._value[0]),this._value=[e],this._isOptionsOpen=!1,this.blurInput();else if(!this.findValueInOptions(e)){if(this.isMaxItemsReached())return;this._value=[...this._value,e]}const t={value:e,label:e,userAdded:!0};this.options=[t,...this.options],this._options=[t,...this._options],this.setSelected(e),this.requestUpdate()}resetComboboxInput(e=!0){if(this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&e)if(this._search="",this.multiple)this.inputRef.value.value="";else{const t=this.findValueInOptions(this._value[0]);window.setTimeout(()=>{!this.inputRef.value||this.inputRef.value.type==="hidden"||(this.inputRef.value.value=this.displayValueAs==="label"&&t!=null&&t.label?t.label:this._value[0]||"")},0),this._userInfoMessage=""}this._options=[...this.options]}removeLastValue(e){if(this._value.length===0)return;e.preventDefault();const t=this._value[this._value.length-1];t&&this.removeSelected(t),this.isMaxItemsReached()}};Be([c({type:String,reflect:!0})],Pe.prototype,"value",2),Be([c({type:Array})],Pe.prototype,"options",2),Be([c({type:Array})],Pe.prototype,"defaultOptions",2),Be([c({type:Boolean})],Pe.prototype,"allowUserInput",2),Be([c({type:Boolean})],Pe.prototype,"typeahead",2),Be([c({type:Boolean})],Pe.prototype,"includeSearch",2),Be([c({type:String})],Pe.prototype,"searchPlaceholder",2),Be([c({type:Boolean})],Pe.prototype,"multiple",2),Be([c({type:Number})],Pe.prototype,"maxlength",2),Be([c({type:String})],Pe.prototype,"displayValueAs",2),Be([c({type:String})],Pe.prototype,"tagPlacement",2),Be([Z()],Pe.prototype,"_options",2),Be([Z()],Pe.prototype,"_value",2),Be([Z()],Pe.prototype,"_isOptionsOpen",2),Be([Z()],Pe.prototype,"_userInfoMessage",2),Be([Z()],Pe.prototype,"_addValueText",2),Be([Z()],Pe.prototype,"_maxIsReached",2),Be([Z()],Pe.prototype,"_search",2),Be([Z()],Pe.prototype,"_inputFocus",2),Be([Z()],Pe.prototype,"_editingSingleValue",2),Pe=Be([ee("pkt-combobox")],Pe);const tu={i18n:{nb:{contentPresentation:{title:"Oslo kommune bruker informasjonskapsler",description:["For at nettstedet skal fungere og være trygt, bruker Oslo kommune informasjonskapsler. Noen er teknisk nødvendige, mens andre sikrer ulik funksjonalitet.","Godtar du alle informasjonskapsler, tillater du også at vi samler inn data om statistikk og brukeradferd. Da hjelper du oss med å lage et bedre nettsted uten at du trenger å dele noe personlig informasjon med oss."],buttons:{accept:"Godta alle",reject:"Kun nødvendige",settings:"Innstillinger for informasjonskapsler"}},contentSettings:{title:"Innstillinger for informasjonskapsler",description:["Her kan du velge hvilke typer informasjonskapsler du vil tillate. Tillatelsen gjelder i 90 dager. Husk at nødvendige informasjonskapsler ikke kan velges bort.","Du kan når som helst endre innstillingene og finne mer informasjon nederst på nettstedet under «Innstillinger for informasjonskapsler» og «Personvern og informasjonskapsler»."],buttons:{back:"Tilbake",save:"Lagre innstillinger"}}},en:{contentPresentation:{title:"Before you visit Oslo kommune ...",description:["This website uses cookies to make improvements. In this context, we need your consent to measure the traffic on the website in relation to statistics and feedback.","To read more about what we use cookies for, go to our privacy declaration which you will find at the bottom of our websites."],buttons:{accept:"Yes, I accept",reject:"Only necessary",settings:"Go to settings"}},contentSettings:{title:"Her kan du aktivt velge mellom ulike informasjonskapsler",description:["For å lese mer om hva vi bruker informasjonskapsler til gå til vår personvernserklering som du finner på våre nettsider"],buttons:{back:"Back",save:"Save settings"}}}}};var su=Object.defineProperty,iu=Object.getOwnPropertyDescriptor,Ht=(s,e,t,i)=>{for(var n=i>1?void 0:i?iu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&su(e,t,n),n};let Fn=null;function nu(){return Fn||(Fn=new Promise((s,e)=>{if(document.querySelector("#oslo-consent-script")){s();return}const t=document.createElement("script");t.src="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.js",t.id="oslo-consent-script",t.onload=()=>s(),t.onerror=e,document.head.appendChild(t);const i=document.createElement("link");i.href="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.css",i.type="text/css",i.rel="stylesheet",i.id="oslo-consent-styles",document.head.appendChild(i)}),Fn)}let Tt=class extends ke{constructor(){super(),this.devMode=!1,this.hotjarId=null,this.googleAnalyticsId=null,this.cookieDomain=null,this.cookieSecure=null,this.cookieExpiryDays=null,this.triggerType="button",this.triggerText=null,this.i18nLanguage="nb"}connectedCallback(){super.connectedCallback(),this.triggerText=this.triggerText||tu.i18n[this.i18nLanguage].contentPresentation.buttons.settings}disconnectedCallback(){var e;super.disconnectedCallback(),this._cookieEventHandler&&((e=window.__cookieEvents)==null||e.off("CookieManager.setCookie",this._cookieEventHandler))}returnJsonOrObject(e){let t;try{t=JSON.parse(e)}catch{t=e}return t}emitCookieConsents(e){const t=this.returnJsonOrObject(e.value).items.reduce((i,n)=>(i[n.name]=n.consent,i),{});this.dispatchEvent(new CustomEvent("toggle-consent",{detail:t,bubbles:!0,cancelable:!1}))}async firstUpdated(e){window.cookieBanner_googleAnalyticsId=this.googleAnalyticsId,window.cookieBanner_hotjarId=this.hotjarId,this.cookieDomain&&(window.cookieBanner_cookieDomain=this.cookieDomain),this.cookieSecure&&(window.cookieBanner_cookieSecure=this.cookieSecure),this.cookieExpiryDays&&(window.cookieBanner_cookieExpiryDays=this.cookieExpiryDays),this.devMode&&(window.cookieBanner_devMode=this.devMode),await nu(),this.triggerInit()}triggerInit(){window.document.dispatchEvent(new Event("CookieBannerReady",{bubbles:!0,cancelable:!0})),window.cookieBanner.cookieConsent.validateConsentCookie().then(e=>{if(e){const t={value:window.cookieBanner.cookieConsent.getConsentCookie()};window.setTimeout(()=>this.emitCookieConsents(t),0),this._cookieEventHandler&&window.__cookieEvents.off("CookieManager.setCookie",this._cookieEventHandler),this._cookieEventHandler=i=>{this.emitCookieConsents(i)},window.__cookieEvents.on("CookieManager.setCookie",this._cookieEventHandler)}})}openModal(e){var t;e.preventDefault(),(t=window.cookieBanner)!=null&&t.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner.openCookieModal())}render(){return this.triggerType==="link"?b`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?b`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
711
+ >`}}handleInput(e){if(e.stopPropagation(),e.stopImmediatePropagation(),this.disabled)return;this.touched=!0;const t=e.target;if(this._search=t.value,this.checkForMatches(),this.typeahead)if(this._search){if(this._options=this.options.filter(i=>{var n;return(n=i.fulltext)==null?void 0:n.toLowerCase().includes(this._search.toLowerCase())}),e.inputType!=="deleteContentBackward"){const i=this._options.filter(n=>{var r;return!n.selected&&((r=n.label)==null?void 0:r.toLowerCase().startsWith(this._search.toLowerCase()))});if(i.length>0&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const n=i[0];n!=null&&n.label&&(t.value=n.label,window.setTimeout(()=>t.setSelectionRange(this._search.length,t.value.length),0),t.selectionDirection="backward")}}}else this._options=[...this.options]}handleFocus(){if(!this.disabled){if(!this.multiple&&this._value[0]&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const e=this.findValueInOptions(this._value[0]);this._editingSingleValue=!0,this.inputRef.value.value=this.displayValueAs==="label"&&e!=null&&e.label?e.label:this._value[0]}this._inputFocus=!0,this._search="",this._options=[...this.options],this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()}}handleFocusOut(e){var t,i,n,r,a;if(!this.disabled&&((i=(t=e.relatedTarget)==null?void 0:t.closest("pkt-combobox"))==null?void 0:i.id)!==this.id&&((r=(n=e.relatedTarget)==null?void 0:n.closest("pkt-combobox"))==null?void 0:r.id)!==this.id&&((a=e.target)==null?void 0:a.getAttribute("data-focusfix"))!==this.id&&e.relatedTarget!==this.focusRef.value&&e.relatedTarget!==this.inputRef.value&&e.relatedTarget!==this.arrowRef.value&&this._isOptionsOpen){if(this._inputFocus=!1,this._addValueText=null,this._userInfoMessage="",this._search="",this.inputRef.value&&this.inputRef.value.type!=="hidden"&&this.inputRef.value.value!==""){const l=this.inputRef.value.value,d=this.findValueInOptions(l);!this._value.includes(l)&&!d?this.allowUserInput?this.addNewUserValue(l):this.multiple||this.removeValue(this._value[0]):d&&!this._value.includes(d.value)&&this.setSelected(d.value),this.inputRef.value.value=""}this._isOptionsOpen=!1,this.onBlur()}}handleBlur(){this._inputFocus=!1,this._editingSingleValue=!1,this.onBlur()}handleInputClick(e){var t,i;if(this.disabled){e.preventDefault(),e.stopImmediatePropagation();return}e.currentTarget&&e.currentTarget!==this.arrowRef.value&&((t=this.inputRef.value)==null?void 0:t.type)!=="hidden"?((i=this.inputRef.value)==null||i.focus(),this.requestUpdate()):this.handleArrowClick(e)}handlePlaceholderClick(e){this.disabled||(e.stopPropagation(),this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.focus(),this._inputFocus=!0,this.requestUpdate()))}handleArrowClick(e){var t,i;this.disabled||e instanceof KeyboardEvent&&e.key&&e.key!=="Enter"&&e.key!==" "&&e.key!=="ArrowDown"||(e.stopImmediatePropagation(),e.preventDefault(),this._isOptionsOpen=!this._isOptionsOpen,this._isOptionsOpen?(t=this.listboxRef.value)==null||t.focusFirstOrSelectedOption():(i=this.arrowRef.value)==null||i.focus())}handleOptionToggled(e){this.toggleValue(e.detail)}handleSearch(e){e.stopPropagation(),this._search=e.detail.toLowerCase()}handleInputKeydown(e){var t,i,n;switch(e.key){case",":this.multiple&&(e.preventDefault(),this.addValue());break;case"Enter":e.preventDefault(),this.addValue();break;case"Backspace":!this._search&&((t=this.inputRef.value)==null?void 0:t.type)==="hidden"&&this.removeLastValue(e);break;case"Tab":case"ArrowDown":e.shiftKey||((i=this.listboxRef.value)==null||i.focusFirstOrSelectedOption(),e.preventDefault());break;case"Escape":this._isOptionsOpen=!1,(n=this.arrowRef.value)==null||n.focus(),e.preventDefault();break}}handleTagRemove(e){this.removeSelected(e)}blurInput(){this.inputRef.value&&this.inputRef.value.matches(":focus")&&this.inputRef.value.blur()}checkForMatches(){var e;const t=((e=this.inputRef.value)==null?void 0:e.value)||this._search||"",i=t.trim().toLowerCase()||"";if(!i){!this.multiple&&this._value[0]&&this.removeValue(this._value[0]),this.resetComboboxInput(!1);return}const n=this._value.find(l=>l.toLowerCase()===i),r=this._options.filter(l=>{var d;return((d=l.label)==null?void 0:d.toLowerCase().includes(i))??!1}),a=r.find(l=>{var d;return((d=l.label)==null?void 0:d.toLowerCase())===i||l.value.toLowerCase()===i});switch(!0){case((r.length===0||!a)&&this.allowUserInput):this._addValueText=t,this._userInfoMessage="";break;case(r.length===0&&!this._options.length&&!this.allowUserInput):this._addValueText=null,this._userInfoMessage="Ingen match i søket";break;case!!n:this._addValueText=null,this._userInfoMessage="Verdien er allerede valgt";break;case r.length>1:this._addValueText=null,this._userInfoMessage="";break;default:this._addValueText=null,this._userInfoMessage=""}}findValueInOptions(e){return this.options.find(t=>t.value===e||t.label===e)||null}findIndexInOptions(e){return this._options.findIndex(t=>t.value===e||t.label===e)}isMaxItemsReached(){const e=this.maxlength!==null&&this._value.length>=this.maxlength;return e?this._maxIsReached=!0:this._maxIsReached=!1,e}toggleValue(e){var t,i;if(this.disabled)return;this.touched=!0,this._userInfoMessage="",this._addValueText=null;const n=((t=this.findValueInOptions(e))==null?void 0:t.value)||null,r=this._value.includes(e||n||""),a=!!n,l=((i=this._options.find(T=>T.value===e))==null?void 0:i.disabled)||!1,d=!(e!=null&&e.trim()),p=!this.multiple,m=this.multiple,b=this.isMaxItemsReached();let y=!1,k=!0,g="",$="";l||(!a&&this.allowUserInput&&!d?(this.addNewUserValue(e),g="Ny verdi lagt til",y=!m):!a&&!this.allowUserInput?(p&&this._value[0]&&this.removeValue(this._value[0]),k=!1,y=!0,g="Ingen treff i søket"):r?(this.removeValue(n),y=!0):d&&p?(this.removeAllSelected(),y=!0):p?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(n),y=!1,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="",this.inputRef.value.blur())):m&&!b?(this.setSelected(n),y=!0):m&&b?(this._userInfoMessage="Maks antall valg nådd",k=!1,$=e):(p&&this.removeAllSelected(),this._userInfoMessage="Ingen gyldig verdi valgt",k=!1,y=!0,$=e),this._isOptionsOpen=y,y||window.setTimeout(()=>{var T;(T=this.focusRef.value)==null||T.focus()},0),this._userInfoMessage=g,this._search=$||"",this.resetComboboxInput(k),m&&this.isMaxItemsReached())}setSelected(e){if(!this._value.includes(e)){if(this.multiple&&this.isMaxItemsReached()){this._userInfoMessage="Maks antall valg nådd";return}!this.multiple&&this.removeAllSelected(),this._value=e?[...this._value,e]:this._value,this._options=this._options.map(t=>(t.value===e&&(t.selected=!0),t)),this.resetComboboxInput(!0)}}removeSelected(e){if(!e)return;this._value=this._value.filter(i=>i!==e);const t=this.findValueInOptions(e);t?(t.selected=!1,t.userAdded?(this._options=[...this._options.filter(i=>i.value!==e)],this.options=[...this.options.filter(i=>i.value!==e)]):this._options=[...this._options,t]):!e&&!this.multiple&&(this._options=this._options.map(i=>(i.selected=!1,i)))}addAllOptions(){if(this.multiple){if(this.maxlength&&this._options.length>this.maxlength){this._userInfoMessage="For mange valgt";return}this._value=this._options.map(e=>e.value),this._options=this._options.map(e=>(e.selected=!0,e)),this.requestUpdate()}}removeAllSelected(){this._value=[],this._options=this._options.map(e=>(e.selected=!1,e)),this._options=this._options.filter(e=>!e.userAdded),this.requestUpdate()}addValue(){var e;const t=((e=this.inputRef.value)==null?void 0:e.value.trim())||"";this._search=t,this.toggleValue(t)}removeValue(e){this._value=this.multiple?this._value.filter(t=>t!==e):[],this.removeSelected(e)}addNewUserValue(e){if(!e||e.trim()==="")return;if(!this.multiple)this._value[0]&&this.removeSelected(this._value[0]),this._value=[e],this._isOptionsOpen=!1,this.blurInput();else if(!this.findValueInOptions(e)){if(this.isMaxItemsReached())return;this._value=[...this._value,e]}const t={value:e,label:e,userAdded:!0};this.options=[t,...this.options],this._options=[t,...this._options],this.setSelected(e),this.requestUpdate()}resetComboboxInput(e=!0){if(this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&e)if(this._search="",this.multiple)this.inputRef.value.value="";else{const t=this.findValueInOptions(this._value[0]);window.setTimeout(()=>{!this.inputRef.value||this.inputRef.value.type==="hidden"||(this.inputRef.value.value=this.displayValueAs==="label"&&t!=null&&t.label?t.label:this._value[0]||"")},0),this._userInfoMessage=""}this._options=[...this.options]}removeLastValue(e){if(this._value.length===0)return;e.preventDefault();const t=this._value[this._value.length-1];t&&this.removeSelected(t),this.isMaxItemsReached()}};Be([c({type:String,reflect:!0})],Pe.prototype,"value",2),Be([c({type:Array})],Pe.prototype,"options",2),Be([c({type:Array})],Pe.prototype,"defaultOptions",2),Be([c({type:Boolean})],Pe.prototype,"allowUserInput",2),Be([c({type:Boolean})],Pe.prototype,"typeahead",2),Be([c({type:Boolean})],Pe.prototype,"includeSearch",2),Be([c({type:String})],Pe.prototype,"searchPlaceholder",2),Be([c({type:Boolean})],Pe.prototype,"multiple",2),Be([c({type:Number})],Pe.prototype,"maxlength",2),Be([c({type:String})],Pe.prototype,"displayValueAs",2),Be([c({type:String})],Pe.prototype,"tagPlacement",2),Be([Z()],Pe.prototype,"_options",2),Be([Z()],Pe.prototype,"_value",2),Be([Z()],Pe.prototype,"_isOptionsOpen",2),Be([Z()],Pe.prototype,"_userInfoMessage",2),Be([Z()],Pe.prototype,"_addValueText",2),Be([Z()],Pe.prototype,"_maxIsReached",2),Be([Z()],Pe.prototype,"_search",2),Be([Z()],Pe.prototype,"_inputFocus",2),Be([Z()],Pe.prototype,"_editingSingleValue",2),Pe=Be([ee("pkt-combobox")],Pe);const tu={i18n:{nb:{contentPresentation:{title:"Oslo kommune bruker informasjonskapsler",description:["For at nettstedet skal fungere og være trygt, bruker Oslo kommune informasjonskapsler. Noen er teknisk nødvendige, mens andre sikrer ulik funksjonalitet.","Godtar du alle informasjonskapsler, tillater du også at vi samler inn data om statistikk og brukeradferd. Da hjelper du oss med å lage et bedre nettsted uten at du trenger å dele noe personlig informasjon med oss."],buttons:{accept:"Godta alle",reject:"Kun nødvendige",settings:"Innstillinger for informasjonskapsler"}},contentSettings:{title:"Innstillinger for informasjonskapsler",description:["Her kan du velge hvilke typer informasjonskapsler du vil tillate. Tillatelsen gjelder i 90 dager. Husk at nødvendige informasjonskapsler ikke kan velges bort.","Du kan når som helst endre innstillingene og finne mer informasjon nederst på nettstedet under «Innstillinger for informasjonskapsler» og «Personvern og informasjonskapsler»."],buttons:{back:"Tilbake",save:"Lagre innstillinger"}}},en:{contentPresentation:{title:"Before you visit Oslo kommune ...",description:["This website uses cookies to make improvements. In this context, we need your consent to measure the traffic on the website in relation to statistics and feedback.","To read more about what we use cookies for, go to our privacy declaration which you will find at the bottom of our websites."],buttons:{accept:"Yes, I accept",reject:"Only necessary",settings:"Go to settings"}},contentSettings:{title:"Her kan du aktivt velge mellom ulike informasjonskapsler",description:["For å lese mer om hva vi bruker informasjonskapsler til gå til vår personvernserklering som du finner på våre nettsider"],buttons:{back:"Back",save:"Save settings"}}}}};var su=Object.defineProperty,iu=Object.getOwnPropertyDescriptor,Ht=(s,e,t,i)=>{for(var n=i>1?void 0:i?iu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&su(e,t,n),n};let Fn=null;function nu(){return Fn||(Fn=new Promise((s,e)=>{if(document.querySelector("#oslo-consent-script")){s();return}const t=document.createElement("script");t.src="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.js",t.id="oslo-consent-script",t.onload=()=>s(),t.onerror=e,document.head.appendChild(t);const i=document.createElement("link");i.href="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.css",i.type="text/css",i.rel="stylesheet",i.id="oslo-consent-styles",document.head.appendChild(i)}),Fn)}let Tt=class extends ke{constructor(){super(),this.devMode=!1,this.hotjarId=null,this.googleAnalyticsId=null,this.cookieDomain=null,this.cookieSecure=null,this.cookieExpiryDays=null,this.triggerType="button",this.triggerText=null,this.i18nLanguage="nb"}connectedCallback(){super.connectedCallback(),this.triggerText=this.triggerText||tu.i18n[this.i18nLanguage].contentPresentation.buttons.settings}disconnectedCallback(){var e;super.disconnectedCallback(),this._cookieEventHandler&&((e=window.__cookieEvents)==null||e.off("CookieManager.setCookie",this._cookieEventHandler))}returnJsonOrObject(e){let t;try{t=JSON.parse(e)}catch{t=e}return t}emitCookieConsents(e){const t=this.returnJsonOrObject(e.value).items.reduce((i,n)=>(i[n.name]=n.consent,i),{});this.dispatchEvent(new CustomEvent("toggle-consent",{detail:t,bubbles:!0,cancelable:!1}))}async firstUpdated(e){window.cookieBanner_googleAnalyticsId=this.googleAnalyticsId,window.cookieBanner_hotjarId=this.hotjarId,this.cookieDomain&&(window.cookieBanner_cookieDomain=this.cookieDomain),this.cookieSecure&&(window.cookieBanner_cookieSecure=this.cookieSecure),this.cookieExpiryDays&&(window.cookieBanner_cookieExpiryDays=this.cookieExpiryDays),this.devMode&&(window.cookieBanner_devMode=this.devMode),await nu(),this.triggerInit()}triggerInit(){window.document.dispatchEvent(new Event("CookieBannerReady",{bubbles:!0,cancelable:!0})),window.cookieBanner.cookieConsent.validateConsentCookie().then(e=>{if(e){const t={value:window.cookieBanner.cookieConsent.getConsentCookie()};window.setTimeout(()=>this.emitCookieConsents(t),0),this._cookieEventHandler&&window.__cookieEvents.off("CookieManager.setCookie",this._cookieEventHandler),this._cookieEventHandler=i=>{this.emitCookieConsents(i)},window.__cookieEvents.on("CookieManager.setCookie",this._cookieEventHandler)}})}openModal(e){var t;e.preventDefault(),(t=window.cookieBanner)!=null&&t.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner.openCookieModal())}render(){return this.triggerType==="link"?v`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?v`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
712
712
  <pkt-icon name="chevron-right" class="pkt-footer__link-icon"></pkt-icon>
713
713
  ${this.triggerText}
714
- </a>`:this.triggerType==="icon"?b`<pkt-button
714
+ </a>`:this.triggerType==="icon"?v`<pkt-button
715
715
  skin="tertiary"
716
716
  variant="icon-only"
717
717
  iconName="cookie"
718
718
  @click=${this.openModal}
719
719
  >
720
720
  >${this.triggerText}</pkt-button
721
- >`:b`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`}};Ht([c({type:Boolean})],Tt.prototype,"devMode",2),Ht([c({type:String})],Tt.prototype,"hotjarId",2),Ht([c({type:String})],Tt.prototype,"googleAnalyticsId",2),Ht([c({type:String})],Tt.prototype,"cookieDomain",2),Ht([c({type:String})],Tt.prototype,"cookieSecure",2),Ht([c({type:String})],Tt.prototype,"cookieExpiryDays",2),Ht([c({type:String})],Tt.prototype,"triggerType",2),Ht([c({type:String})],Tt.prototype,"triggerText",2),Ht([c({type:String})],Tt.prototype,"i18nLanguage",2),Tt=Ht([ee("pkt-consent")],Tt);var ru=Object.defineProperty,au=Object.getOwnPropertyDescriptor,ut=(s,e,t,i)=>{for(var n=i>1?void 0:i?au(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&ru(e,t,n),n};let rt=class extends z{constructor(){super(...arguments),this.inputRef=B(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.isSwitch=!1,this.labelPosition="right",this.hideLabel=!1,this.checked=null,this.indeterminate=!1,this.type="checkbox",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut"}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,t,i){e==="defaultChecked"&&!this.checked&&(this.checked=this.defaultChecked),e==="checked"&&(this.checked=this.checked===""||this.checked==="true"||this.checked===!0,this.inputRef.value&&(this.inputRef.value.checked=this.checked)),e==="indeterminate"&&(this.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0,this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate)),super.attributeChangedCallback(e,t,i)}firstUpdated(e){e.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.firstUpdated(e)}updated(e){e.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),e.has("checked")&&this.inputRef.value&&(this.inputRef.value.checked=this.checked===""||this.checked==="true"||this.checked===!0),e.has("indeterminate")&&this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.updated(e)}render(){const e=I({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),t=I({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),i=I({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-input-check__input-label--left":this.labelPosition==="left","pkt-input-check__input-label--right":this.labelPosition==="right","pkt-sr-only":this.hideLabel}),n="pkt-tag pkt-tag--small pkt-tag--thin-text",r=()=>b`
722
- ${this.tagText?b`<span class=${n+" pkt-tag--gray"}>${this.tagText}</span>`:w}
723
- ${this.optionalTag?b`<span class=${n+" pkt-tag--blue-light"}>${this.optionalText}</span>`:w}
724
- ${this.requiredTag?b`<span class=${n+" pkt-tag--beige"}>${this.requiredText}</span>`:w}
725
- `,a=()=>b`
721
+ >`:v`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`}};Ht([c({type:Boolean})],Tt.prototype,"devMode",2),Ht([c({type:String})],Tt.prototype,"hotjarId",2),Ht([c({type:String})],Tt.prototype,"googleAnalyticsId",2),Ht([c({type:String})],Tt.prototype,"cookieDomain",2),Ht([c({type:String})],Tt.prototype,"cookieSecure",2),Ht([c({type:String})],Tt.prototype,"cookieExpiryDays",2),Ht([c({type:String})],Tt.prototype,"triggerType",2),Ht([c({type:String})],Tt.prototype,"triggerText",2),Ht([c({type:String})],Tt.prototype,"i18nLanguage",2),Tt=Ht([ee("pkt-consent")],Tt);var ru=Object.defineProperty,au=Object.getOwnPropertyDescriptor,ut=(s,e,t,i)=>{for(var n=i>1?void 0:i?au(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&ru(e,t,n),n};let rt=class extends z{constructor(){super(...arguments),this.inputRef=B(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.isSwitch=!1,this.labelPosition="right",this.hideLabel=!1,this.checked=null,this.indeterminate=!1,this.type="checkbox",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut"}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,t,i){e==="defaultChecked"&&!this.checked&&(this.checked=this.defaultChecked),e==="checked"&&(this.checked=this.checked===""||this.checked==="true"||this.checked===!0,this.inputRef.value&&(this.inputRef.value.checked=this.checked)),e==="indeterminate"&&(this.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0,this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate)),super.attributeChangedCallback(e,t,i)}firstUpdated(e){e.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.firstUpdated(e)}updated(e){e.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),e.has("checked")&&this.inputRef.value&&(this.inputRef.value.checked=this.checked===""||this.checked==="true"||this.checked===!0),e.has("indeterminate")&&this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.updated(e)}render(){const e=I({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),t=I({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),i=I({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-input-check__input-label--left":this.labelPosition==="left","pkt-input-check__input-label--right":this.labelPosition==="right","pkt-sr-only":this.hideLabel}),n="pkt-tag pkt-tag--small pkt-tag--thin-text",r=()=>v`
722
+ ${this.tagText?v`<span class=${n+" pkt-tag--gray"}>${this.tagText}</span>`:w}
723
+ ${this.optionalTag?v`<span class=${n+" pkt-tag--blue-light"}>${this.optionalText}</span>`:w}
724
+ ${this.requiredTag?v`<span class=${n+" pkt-tag--beige"}>${this.requiredText}</span>`:w}
725
+ `,a=()=>v`
726
726
  <label class=${i} for=${this.id+"-internal"}>
727
727
  ${this.label} ${r()}
728
- ${this.checkHelptext?b`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:w}
728
+ ${this.checkHelptext?v`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:w}
729
729
  </label>
730
- `;return b`
730
+ `;return v`
731
731
  <div class="pkt-input-check">
732
732
  <div class=${e}>
733
733
  ${this.labelPosition==="left"?a():w}
@@ -748,9 +748,9 @@
748
748
  ${this.labelPosition==="right"?a():w}
749
749
  </div>
750
750
  </div>
751
- `}handleClick(e){if(this.disabled)return e.preventDefault(),e.stopImmediatePropagation(),!1}handleChange(e){if(this.disabled)return e.preventDefault(),e.stopImmediatePropagation(),!1;this.toggleChecked(e)}toggleChecked(e){if(this.disabled){e.preventDefault(),e.stopImmediatePropagation();return}const t=e.target;if(t&&t.disabled){e.preventDefault(),e.stopImmediatePropagation();return}e.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this.checked=this.inputRef.value.matches(":checked"),this.valueChecked(this.checked))}};ut([c({type:String,reflect:!0})],rt.prototype,"value",2),ut([c({type:String})],rt.prototype,"checkHelptext",2),ut([c({type:Boolean})],rt.prototype,"defaultChecked",2),ut([c({type:Boolean})],rt.prototype,"hasTile",2),ut([c({type:Boolean})],rt.prototype,"isSwitch",2),ut([c({type:String})],rt.prototype,"labelPosition",2),ut([c({type:Boolean})],rt.prototype,"hideLabel",2),ut([c({type:Boolean,reflect:!0})],rt.prototype,"checked",2),ut([c({type:Boolean,reflect:!0})],rt.prototype,"indeterminate",2),ut([c({type:String,reflect:!0})],rt.prototype,"type",2),ut([c({type:String})],rt.prototype,"tagText",2),ut([c({type:Boolean})],rt.prototype,"optionalTag",2),ut([c({type:String})],rt.prototype,"optionalText",2),ut([c({type:Boolean})],rt.prototype,"requiredTag",2),ut([c({type:String})],rt.prototype,"requiredText",2),rt=ut([ee("pkt-checkbox")],rt);const $a={calendar:{buttonAltText:"Åpne kalender"}},ou={calendar:{buttonAltText:"Åpne kalender"},generic:{from:"Fra",to:"Til"}};var lu=Object.defineProperty,cu=Object.getOwnPropertyDescriptor,_i=(s,e,t,i)=>{for(var n=i>1?void 0:i?cu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&lu(e,t,n),n};let zs=class extends ke{constructor(){super(...arguments),this.dates=[],this.dateformat="dd.MM.yyyy",this.className="pkt-datepicker__tags",this.idBase=is()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},b`
751
+ `}handleClick(e){if(this.disabled)return e.preventDefault(),e.stopImmediatePropagation(),!1}handleChange(e){if(this.disabled)return e.preventDefault(),e.stopImmediatePropagation(),!1;this.toggleChecked(e)}toggleChecked(e){if(this.disabled){e.preventDefault(),e.stopImmediatePropagation();return}const t=e.target;if(t&&t.disabled){e.preventDefault(),e.stopImmediatePropagation();return}e.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this.checked=this.inputRef.value.matches(":checked"),this.valueChecked(this.checked))}};ut([c({type:String,reflect:!0})],rt.prototype,"value",2),ut([c({type:String})],rt.prototype,"checkHelptext",2),ut([c({type:Boolean})],rt.prototype,"defaultChecked",2),ut([c({type:Boolean})],rt.prototype,"hasTile",2),ut([c({type:Boolean})],rt.prototype,"isSwitch",2),ut([c({type:String})],rt.prototype,"labelPosition",2),ut([c({type:Boolean})],rt.prototype,"hideLabel",2),ut([c({type:Boolean,reflect:!0})],rt.prototype,"checked",2),ut([c({type:Boolean,reflect:!0})],rt.prototype,"indeterminate",2),ut([c({type:String,reflect:!0})],rt.prototype,"type",2),ut([c({type:String})],rt.prototype,"tagText",2),ut([c({type:Boolean})],rt.prototype,"optionalTag",2),ut([c({type:String})],rt.prototype,"optionalText",2),ut([c({type:Boolean})],rt.prototype,"requiredTag",2),ut([c({type:String})],rt.prototype,"requiredText",2),rt=ut([ee("pkt-checkbox")],rt);const $a={calendar:{buttonAltText:"Åpne kalender"}},ou={calendar:{buttonAltText:"Åpne kalender"},generic:{from:"Fra",to:"Til"}};var lu=Object.defineProperty,cu=Object.getOwnPropertyDescriptor,_i=(s,e,t,i)=>{for(var n=i>1?void 0:i?cu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&lu(e,t,n),n};let zs=class extends ke{constructor(){super(...arguments),this.dates=[],this.dateformat="dd.MM.yyyy",this.className="pkt-datepicker__tags",this.idBase=is()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},v`
752
752
  <div class=${I(this.classes)} aria-live="polite">
753
- ${Array.isArray(this.dates)&&this.dates[0]?Ln(pa((this.dates??[]).filter(Boolean)),e=>e,e=>{var t;return b` <pkt-tag
753
+ ${Array.isArray(this.dates)&&this.dates[0]?Ln(pa((this.dates??[]).filter(Boolean)),e=>e,e=>{var t;return v` <pkt-tag
754
754
  id=${this.idBase+e+"-tag"}
755
755
  closeTag
756
756
  @close=${()=>{this.dispatchEvent(new CustomEvent("date-tag-removed",{detail:e}))}}
@@ -759,7 +759,7 @@
759
759
  <time datetime=${e}>${da(e,this.dateformat)}</time>
760
760
  </pkt-tag>`}):w}
761
761
  </div>
762
- `}};_i([c({type:Array})],zs.prototype,"dates",2),_i([c({type:String})],zs.prototype,"dateformat",2),_i([c({type:String,attribute:"class"})],zs.prototype,"className",2),_i([c({type:String,attribute:"id-base"})],zs.prototype,"idBase",2),zs=_i([ee("pkt-date-tags")],zs);const du={dateformat:{default:"dd.MM.yyyy"},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},$i={props:du},ws=()=>{const s=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(s)||/Macintosh/.test(s)&&"ontouchend"in document)},uu=()=>ws()?"text":"date",hu=s=>!s||s.length!==2?!0:ud(s[0],s[1]),pu=s=>pa(s),fu=(s,e,t,i,n)=>dd(s,e,t,i,n),mu=(s,e,t,i,n,r)=>({"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":s,"pkt-datepicker--hasrangelabels":e,"pkt-datepicker--multiple":t,"pkt-datepicker--range":i,"ios-readonly-hack":n===!1&&r==="text"}),gu=()=>({"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}),vu=s=>({"pkt-input-prefix":s,"pkt-hide":!s}),bu=(s,e,t)=>!e&&!t?Array.isArray(s)?s[0]||"":s:Array.isArray(s)?s.join(","):s,yu=(s,e,t=!1)=>{var i;if(!s||!e)return;const n=((i=e.parentElement)==null?void 0:i.getBoundingClientRect())||e.getBoundingClientRect(),r=t?n.height+30:n.height,a=s.getBoundingClientRect().height;let l=t?"calc(100% - 30px)":"100%";n&&n.top+a>window.innerHeight&&n.top-a>0&&(l=`calc(100% - ${r}px - ${a}px)`),s.style.top=l},ku=(s,e,t,i,n,r)=>{const{key:a}=s;a===","&&(s.preventDefault(),r?r(s):n&&n()),(a==="Space"||a===" ")&&(s.preventDefault(),e(s)),a==="Enter"&&(s.preventDefault(),t?t():i?i():n&&n())},_u=(s,e)=>{const{key:t}=s;(t==="Enter"||t===" "||t==="Space")&&(s.preventDefault(),e(s))},wa={validateRangeOrder:hu,sortDates:pu,filterSelectableDates:fu},$u={getInputType:uu},wi={submitForm(s){var e;const t=(e=s.internals)==null?void 0:e.form;t&&t.requestSubmit()},submitFormOrFallback(s,e){const t=s==null?void 0:s.form;t?t.requestSubmit():e()},validateDateInput(s,e,t,i,n){var r,a,l,d;const p=s.value;p&&(t&&t>p?e.setValidity({rangeUnderflow:!0},((a=(r=n==null?void 0:n.forms)==null?void 0:r.messages)==null?void 0:a.rangeUnderflow)||"Value is below minimum",s):i&&i<p&&e.setValidity({rangeOverflow:!0},((d=(l=n==null?void 0:n.forms)==null?void 0:l.messages)==null?void 0:d.rangeOverflow)||"Value is above maximum",s))}},en={addToSelected(s,e,t,i){const n=s.target;if(!n.value)return;const r=t?Ct(t):null,a=i?Ct(i):null,l=Ct(n.value.split(",")[0]);l&&!isNaN(l.getTime())&&(!r||l>=r)&&(!a||l<=a)&&e.value&&e.value.handleDateSelect(l),n.value=""},handleCalendarPosition(s,e,t=!1){yu(s.value??null,e.value??null,t)}},Hn={getInputClasses:mu,getButtonClasses:gu,getRangeLabelClasses:vu},Vn={processDateSelection:bu,updateInputValues(s,e,t,i,n,r){s.value&&(i&&e!=null&&e.value?(s.value.value=t[0]??"",e.value.value=t[1]??"",r(s.value),r(e.value)):n||(s.value.value=t.length?t[0]:"",r(s.value)))},processRangeBlur(s,e,t,i,n){var r;const a=s.target;if(a.value){n(a);const l=ts(a.value);l&&((r=t==null?void 0:t.value)==null||r.handleDateSelect(l))}else e[0]&&i()}},tn={handleInputKeydown:ku,handleButtonKeydown:_u};var wu=Object.defineProperty,xu=Object.getOwnPropertyDescriptor,pt=(s,e,t,i)=>{for(var n=i>1?void 0:i?xu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&wu(e,t,n),n};let ht=class extends ke{constructor(){super(...arguments),this.open=!1,this.multiple=!1,this.range=!1,this.weeknumbers=!1,this.withcontrols=!1,this.maxMultiple=null,this.selected=[],this.earliest=null,this.latest=null,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.today=null,this._hasBeenOpened=!1,this.popupRef=B(),this.calendarRef=B(),this.handleDocumentClick=e=>{if(!this.open)return;const t=e.composedPath(),i=this.parentElement,n=this.popupRef.value;!t.includes(this)&&!t.includes(n)&&!(i&&t.includes(i))&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))},this.handleDocumentKeydown=e=>{this.open&&e.key==="Escape"&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))}}firstUpdated(){this.calRef=this.calendarRef}updated(e){super.updated(e),e.has("open")&&(this.open?(this._hasBeenOpened=!0,document.addEventListener("keydown",this.handleDocumentKeydown),document.addEventListener("click",this.handleDocumentClick)):(document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("keydown",this.handleDocumentKeydown)))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("keydown",this.handleDocumentKeydown)}show(){var e;this.open=!0,(e=this.calendarRef.value)==null||e.focus()}hide(){this.open=!1}toggle(){this.open?this.hide():this.show()}contains(e){var t;return!!e&&!!((t=this.popupRef.value)!=null&&t.contains(e))}focusOnCurrentDate(){const e=this.calendarRef.value;e&&typeof e.focusOnCurrentDate=="function"&&e.focusOnCurrentDate()}addToSelected(e,t,i){if(this.calendarRef.value&&typeof en.addToSelected=="function")return en.addToSelected(e,this.calendarRef,t,i);const n=e.target;if(!n.value)return;const r=t?Ct(t):null,a=i?Ct(i):null,l=Ct(n.value.split(",")[0]);l&&!isNaN(l.getTime())&&(!r||l>=r)&&(!a||l<=a)&&this.handleDateSelect(l),n.value=""}handleDateSelect(e){const t=this.calendarRef.value;if(t&&typeof t.handleDateSelect=="function")return t.handleDateSelect(e);const i=qe(e),n=this.selected.indexOf(i)>=0?this.selected.filter(r=>r!==i):[...this.selected,i];this.selected=n,this.dispatchEvent(new CustomEvent("date-selected",{detail:n,bubbles:!0,composed:!0}))}render(){const e={"pkt-calendar-popup":!0,show:this.open,hide:!this.open};return b`
762
+ `}};_i([c({type:Array})],zs.prototype,"dates",2),_i([c({type:String})],zs.prototype,"dateformat",2),_i([c({type:String,attribute:"class"})],zs.prototype,"className",2),_i([c({type:String,attribute:"id-base"})],zs.prototype,"idBase",2),zs=_i([ee("pkt-date-tags")],zs);const du={dateformat:{default:"dd.MM.yyyy"},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},$i={props:du},ws=()=>{const s=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(s)||/Macintosh/.test(s)&&"ontouchend"in document)},uu=()=>ws()?"text":"date",hu=s=>!s||s.length!==2?!0:ud(s[0],s[1]),pu=s=>pa(s),fu=(s,e,t,i,n)=>dd(s,e,t,i,n),mu=(s,e,t,i,n,r)=>({"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":s,"pkt-datepicker--hasrangelabels":e,"pkt-datepicker--multiple":t,"pkt-datepicker--range":i,"ios-readonly-hack":n===!1&&r==="text"}),gu=()=>({"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}),vu=s=>({"pkt-input-prefix":s,"pkt-hide":!s}),bu=(s,e,t)=>!e&&!t?Array.isArray(s)?s[0]||"":s:Array.isArray(s)?s.join(","):s,yu=(s,e,t=!1)=>{var i;if(!s||!e)return;const n=((i=e.parentElement)==null?void 0:i.getBoundingClientRect())||e.getBoundingClientRect(),r=t?n.height+30:n.height,a=s.getBoundingClientRect().height;let l=t?"calc(100% - 30px)":"100%";n&&n.top+a>window.innerHeight&&n.top-a>0&&(l=`calc(100% - ${r}px - ${a}px)`),s.style.top=l},ku=(s,e,t,i,n,r)=>{const{key:a}=s;a===","&&(s.preventDefault(),r?r(s):n&&n()),(a==="Space"||a===" ")&&(s.preventDefault(),e(s)),a==="Enter"&&(s.preventDefault(),t?t():i?i():n&&n())},_u=(s,e)=>{const{key:t}=s;(t==="Enter"||t===" "||t==="Space")&&(s.preventDefault(),e(s))},wa={validateRangeOrder:hu,sortDates:pu,filterSelectableDates:fu},$u={getInputType:uu},wi={submitForm(s){var e;const t=(e=s.internals)==null?void 0:e.form;t&&t.requestSubmit()},submitFormOrFallback(s,e){const t=s==null?void 0:s.form;t?t.requestSubmit():e()},validateDateInput(s,e,t,i,n){var r,a,l,d;const p=s.value;p&&(t&&t>p?e.setValidity({rangeUnderflow:!0},((a=(r=n==null?void 0:n.forms)==null?void 0:r.messages)==null?void 0:a.rangeUnderflow)||"Value is below minimum",s):i&&i<p&&e.setValidity({rangeOverflow:!0},((d=(l=n==null?void 0:n.forms)==null?void 0:l.messages)==null?void 0:d.rangeOverflow)||"Value is above maximum",s))}},en={addToSelected(s,e,t,i){const n=s.target;if(!n.value)return;const r=t?Ct(t):null,a=i?Ct(i):null,l=Ct(n.value.split(",")[0]);l&&!isNaN(l.getTime())&&(!r||l>=r)&&(!a||l<=a)&&e.value&&e.value.handleDateSelect(l),n.value=""},handleCalendarPosition(s,e,t=!1){yu(s.value??null,e.value??null,t)}},Hn={getInputClasses:mu,getButtonClasses:gu,getRangeLabelClasses:vu},Vn={processDateSelection:bu,updateInputValues(s,e,t,i,n,r){s.value&&(i&&e!=null&&e.value?(s.value.value=t[0]??"",e.value.value=t[1]??"",r(s.value),r(e.value)):n||(s.value.value=t.length?t[0]:"",r(s.value)))},processRangeBlur(s,e,t,i,n){var r;const a=s.target;if(a.value){n(a);const l=ts(a.value);l&&((r=t==null?void 0:t.value)==null||r.handleDateSelect(l))}else e[0]&&i()}},tn={handleInputKeydown:ku,handleButtonKeydown:_u};var wu=Object.defineProperty,xu=Object.getOwnPropertyDescriptor,pt=(s,e,t,i)=>{for(var n=i>1?void 0:i?xu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&wu(e,t,n),n};let ht=class extends ke{constructor(){super(...arguments),this.open=!1,this.multiple=!1,this.range=!1,this.weeknumbers=!1,this.withcontrols=!1,this.maxMultiple=null,this.selected=[],this.earliest=null,this.latest=null,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.today=null,this._hasBeenOpened=!1,this.popupRef=B(),this.calendarRef=B(),this.handleDocumentClick=e=>{if(!this.open)return;const t=e.composedPath(),i=this.parentElement,n=this.popupRef.value;!t.includes(this)&&!t.includes(n)&&!(i&&t.includes(i))&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))},this.handleDocumentKeydown=e=>{this.open&&e.key==="Escape"&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))}}firstUpdated(){this.calRef=this.calendarRef}updated(e){super.updated(e),e.has("open")&&(this.open?(this._hasBeenOpened=!0,document.addEventListener("keydown",this.handleDocumentKeydown),document.addEventListener("click",this.handleDocumentClick)):(document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("keydown",this.handleDocumentKeydown)))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("keydown",this.handleDocumentKeydown)}show(){var e;this.open=!0,(e=this.calendarRef.value)==null||e.focus()}hide(){this.open=!1}toggle(){this.open?this.hide():this.show()}contains(e){var t;return!!e&&!!((t=this.popupRef.value)!=null&&t.contains(e))}focusOnCurrentDate(){const e=this.calendarRef.value;e&&typeof e.focusOnCurrentDate=="function"&&e.focusOnCurrentDate()}addToSelected(e,t,i){if(this.calendarRef.value&&typeof en.addToSelected=="function")return en.addToSelected(e,this.calendarRef,t,i);const n=e.target;if(!n.value)return;const r=t?Ct(t):null,a=i?Ct(i):null,l=Ct(n.value.split(",")[0]);l&&!isNaN(l.getTime())&&(!r||l>=r)&&(!a||l<=a)&&this.handleDateSelect(l),n.value=""}handleDateSelect(e){const t=this.calendarRef.value;if(t&&typeof t.handleDateSelect=="function")return t.handleDateSelect(e);const i=qe(e),n=this.selected.indexOf(i)>=0?this.selected.filter(r=>r!==i):[...this.selected,i];this.selected=n,this.dispatchEvent(new CustomEvent("date-selected",{detail:n,bubbles:!0,composed:!0}))}render(){const e={"pkt-calendar-popup":!0,show:this.open,hide:!this.open};return v`
763
763
  <div
764
764
  class="${I(e)}"
765
765
  ${F(this.popupRef)}
@@ -767,7 +767,7 @@
767
767
  ?hidden=${!this.open}
768
768
  aria-hidden="${!this.open}"
769
769
  >
770
- ${this.open||this._hasBeenOpened?b`<pkt-calendar
770
+ ${this.open||this._hasBeenOpened?v`<pkt-calendar
771
771
  ${F(this.calendarRef)}
772
772
  ?multiple=${this.multiple}
773
773
  ?range=${this.range}
@@ -785,7 +785,7 @@
785
785
  @close=${()=>{this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}
786
786
  ></pkt-calendar>`:w}
787
787
  </div>
788
- `}};pt([c({type:Boolean,reflect:!0})],ht.prototype,"open",2),pt([c({type:Boolean})],ht.prototype,"multiple",2),pt([c({type:Boolean})],ht.prototype,"range",2),pt([c({type:Boolean})],ht.prototype,"weeknumbers",2),pt([c({type:Boolean})],ht.prototype,"withcontrols",2),pt([c({type:Number})],ht.prototype,"maxMultiple",2),pt([c({type:Array})],ht.prototype,"selected",2),pt([c({type:String})],ht.prototype,"earliest",2),pt([c({type:String})],ht.prototype,"latest",2),pt([c({type:Array})],ht.prototype,"excludedates",2),pt([c({type:Array})],ht.prototype,"excludeweekdays",2),pt([c({type:String})],ht.prototype,"currentmonth",2),pt([c({type:String})],ht.prototype,"today",2),pt([Z()],ht.prototype,"_hasBeenOpened",2),ht=pt([ee("pkt-datepicker-popup")],ht);var Su=Object.defineProperty,Kt=(s,e,t,i)=>{for(var n=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=a(e,t,n)||n);return n&&Su(e,t,n),n};let Nt=class extends ke{constructor(){super(...arguments),this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.inputClasses={},this.inputRef=B(),this.btnRef=B()}get inputElement(){return this.inputRef.value}get buttonElement(){return this.btnRef.value}get isInputReadonly(){return this.readonly||this.inputType==="text"}dispatchToggleCalendar(e){this.readonly||this.dispatchEvent(new CustomEvent("toggle-calendar",{detail:e,bubbles:!0,composed:!0}))}dispatchInput(e){this.dispatchEvent(new CustomEvent("input-change",{detail:e,bubbles:!0,composed:!0}))}dispatchFocus(){this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0}))}dispatchBlur(e){this.dispatchEvent(new CustomEvent("input-blur",{detail:e,bubbles:!0,composed:!0}))}dispatchChange(e){this.dispatchEvent(new CustomEvent("input-changed",{detail:e,bubbles:!0,composed:!0}))}renderCalendarButton(){var e;return b`
788
+ `}};pt([c({type:Boolean,reflect:!0})],ht.prototype,"open",2),pt([c({type:Boolean})],ht.prototype,"multiple",2),pt([c({type:Boolean})],ht.prototype,"range",2),pt([c({type:Boolean})],ht.prototype,"weeknumbers",2),pt([c({type:Boolean})],ht.prototype,"withcontrols",2),pt([c({type:Number})],ht.prototype,"maxMultiple",2),pt([c({type:Array})],ht.prototype,"selected",2),pt([c({type:String})],ht.prototype,"earliest",2),pt([c({type:String})],ht.prototype,"latest",2),pt([c({type:Array})],ht.prototype,"excludedates",2),pt([c({type:Array})],ht.prototype,"excludeweekdays",2),pt([c({type:String})],ht.prototype,"currentmonth",2),pt([c({type:String})],ht.prototype,"today",2),pt([Z()],ht.prototype,"_hasBeenOpened",2),ht=pt([ee("pkt-datepicker-popup")],ht);var Su=Object.defineProperty,Kt=(s,e,t,i)=>{for(var n=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=a(e,t,n)||n);return n&&Su(e,t,n),n};let Nt=class extends ke{constructor(){super(...arguments),this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.inputClasses={},this.inputRef=B(),this.btnRef=B()}get inputElement(){return this.inputRef.value}get buttonElement(){return this.btnRef.value}get isInputReadonly(){return this.readonly||this.inputType==="text"}dispatchToggleCalendar(e){this.readonly||this.dispatchEvent(new CustomEvent("toggle-calendar",{detail:e,bubbles:!0,composed:!0}))}dispatchInput(e){this.dispatchEvent(new CustomEvent("input-change",{detail:e,bubbles:!0,composed:!0}))}dispatchFocus(){this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0}))}dispatchBlur(e){this.dispatchEvent(new CustomEvent("input-blur",{detail:e,bubbles:!0,composed:!0}))}dispatchChange(e){this.dispatchEvent(new CustomEvent("input-changed",{detail:e,bubbles:!0,composed:!0}))}renderCalendarButton(){var e;return v`
789
789
  <button
790
790
  class="${I(Hn.getButtonClasses())}"
791
791
  type="button"
@@ -797,7 +797,7 @@
797
797
  <pkt-icon name="calendar"></pkt-icon>
798
798
  <span class="pkt-btn__text">${((e=this.strings.calendar)==null?void 0:e.buttonAltText)||"Åpne kalender"}</span>
799
799
  </button>
800
- `}createRenderRoot(){return this}};Kt([c({type:String})],Nt.prototype,"inputType"),Kt([c({type:String})],Nt.prototype,"id"),Kt([c({type:String})],Nt.prototype,"min"),Kt([c({type:String})],Nt.prototype,"max"),Kt([c({type:String})],Nt.prototype,"placeholder"),Kt([c({type:Boolean})],Nt.prototype,"readonly"),Kt([c({type:Boolean})],Nt.prototype,"disabled"),Kt([c({type:Object})],Nt.prototype,"inputClasses"),Kt([c({type:Object})],Nt.prototype,"internals");var Cu=Object.defineProperty,Tu=Object.getOwnPropertyDescriptor,Un=(s,e,t,i)=>{for(var n=i>1?void 0:i?Tu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Cu(e,t,n),n};let sn=class extends Nt{constructor(){super(...arguments),this.value="",this.strings=$a}dispatchManageValidity(e){this.dispatchEvent(new CustomEvent("manage-validity",{detail:e,bubbles:!0,composed:!0}))}render(){return b`
800
+ `}createRenderRoot(){return this}};Kt([c({type:String})],Nt.prototype,"inputType"),Kt([c({type:String})],Nt.prototype,"id"),Kt([c({type:String})],Nt.prototype,"min"),Kt([c({type:String})],Nt.prototype,"max"),Kt([c({type:String})],Nt.prototype,"placeholder"),Kt([c({type:Boolean})],Nt.prototype,"readonly"),Kt([c({type:Boolean})],Nt.prototype,"disabled"),Kt([c({type:Object})],Nt.prototype,"inputClasses"),Kt([c({type:Object})],Nt.prototype,"internals");var Cu=Object.defineProperty,Tu=Object.getOwnPropertyDescriptor,Un=(s,e,t,i)=>{for(var n=i>1?void 0:i?Tu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Cu(e,t,n),n};let sn=class extends Nt{constructor(){super(...arguments),this.value="",this.strings=$a}dispatchManageValidity(e){this.dispatchEvent(new CustomEvent("manage-validity",{detail:e,bubbles:!0,composed:!0}))}render(){return v`
801
801
  <div class="pkt-input__container">
802
802
  <input
803
803
  class="${I(this.inputClasses)}"
@@ -821,9 +821,9 @@
821
821
  />
822
822
  ${this.renderCalendarButton()}
823
823
  </div>
824
- `}};Un([c({type:String})],sn.prototype,"value",2),Un([c({type:Object})],sn.prototype,"strings",2),sn=Un([ee("pkt-datepicker-single")],sn);var Nu=Object.defineProperty,Mu=Object.getOwnPropertyDescriptor,xi=(s,e,t,i)=>{for(var n=i>1?void 0:i?Mu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Nu(e,t,n),n};let Ys=class extends Nt{constructor(){super(...arguments),this.value=[],this.label="",this.showRangeLabels=!1,this.strings=ou,this.inputRefTo=B()}get inputElementTo(){return this.inputRefTo.value}render(){var e,t,i,n;const r=Hn.getRangeLabelClasses(this.showRangeLabels);return b`
824
+ `}};Un([c({type:String})],sn.prototype,"value",2),Un([c({type:Object})],sn.prototype,"strings",2),sn=Un([ee("pkt-datepicker-single")],sn);var Nu=Object.defineProperty,Mu=Object.getOwnPropertyDescriptor,xi=(s,e,t,i)=>{for(var n=i>1?void 0:i?Mu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Nu(e,t,n),n};let Ys=class extends Nt{constructor(){super(...arguments),this.value=[],this.label="",this.showRangeLabels=!1,this.strings=ou,this.inputRefTo=B()}get inputElementTo(){return this.inputRefTo.value}render(){var e,t,i,n;const r=Hn.getRangeLabelClasses(this.showRangeLabels);return v`
825
825
  <div class="pkt-input__container">
826
- ${this.showRangeLabels?b` <div class="pkt-input-prefix">${(e=this.strings.generic)==null?void 0:e.from}</div> `:w}
826
+ ${this.showRangeLabels?v` <div class="pkt-input-prefix">${(e=this.strings.generic)==null?void 0:e.from}</div> `:w}
827
827
  <input
828
828
  class=${I(this.inputClasses)}
829
829
  .type=${this.inputType}
@@ -847,7 +847,7 @@
847
847
  <div class="${I(r)}" id="${this.id}-to-label">
848
848
  ${(i=this.strings.generic)==null?void 0:i.to}
849
849
  </div>
850
- ${this.showRangeLabels?w:b` <div class="pkt-input-separator">–</div> `}
850
+ ${this.showRangeLabels?w:v` <div class="pkt-input-separator">–</div> `}
851
851
  <input
852
852
  class=${I(this.inputClasses)}
853
853
  .type=${this.inputType}
@@ -870,7 +870,7 @@
870
870
  />
871
871
  ${this.renderCalendarButton()}
872
872
  </div>
873
- `}};xi([c({type:Array})],Ys.prototype,"value",2),xi([c({type:String})],Ys.prototype,"label",2),xi([c({type:Boolean})],Ys.prototype,"showRangeLabels",2),xi([c({type:Object})],Ys.prototype,"strings",2),Ys=xi([ee("pkt-datepicker-range")],Ys);var Du=Object.defineProperty,Ou=Object.getOwnPropertyDescriptor,nn=(s,e,t,i)=>{for(var n=i>1?void 0:i?Ou(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Du(e,t,n),n};let Si=class extends Nt{constructor(){super(...arguments),this.value=[],this.strings=$a}get isInputDisabled(){return this.disabled||this.maxlength!==void 0&&this.maxlength!==null&&this.value.length>=this.maxlength}dispatchAddToSelected(e){this.dispatchEvent(new CustomEvent("add-to-selected",{detail:e,bubbles:!0,composed:!0}))}render(){return b`
873
+ `}};xi([c({type:Array})],Ys.prototype,"value",2),xi([c({type:String})],Ys.prototype,"label",2),xi([c({type:Boolean})],Ys.prototype,"showRangeLabels",2),xi([c({type:Object})],Ys.prototype,"strings",2),Ys=xi([ee("pkt-datepicker-range")],Ys);var Du=Object.defineProperty,Ou=Object.getOwnPropertyDescriptor,nn=(s,e,t,i)=>{for(var n=i>1?void 0:i?Ou(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Du(e,t,n),n};let Si=class extends Nt{constructor(){super(...arguments),this.value=[],this.strings=$a}get isInputDisabled(){return this.disabled||this.maxlength!==void 0&&this.maxlength!==null&&this.value.length>=this.maxlength}dispatchAddToSelected(e){this.dispatchEvent(new CustomEvent("add-to-selected",{detail:e,bubbles:!0,composed:!0}))}render(){return v`
874
874
  <div class="pkt-input__container">
875
875
  <input
876
876
  class=${I(this.inputClasses)}
@@ -892,7 +892,7 @@
892
892
  />
893
893
  ${this.renderCalendarButton()}
894
894
  </div>
895
- `}};nn([c({type:Array})],Si.prototype,"value",2),nn([c({type:Number})],Si.prototype,"maxlength",2),nn([c({type:Object})],Si.prototype,"strings",2),Si=nn([ee("pkt-datepicker-multiple")],Si);var Eu=Object.defineProperty,Pu=Object.getOwnPropertyDescriptor,ze=(s,e,t,i)=>{for(var n=i>1?void 0:i?Pu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Eu(e,t,n),n};let He=class extends z{constructor(){super(),this._valueProperty="",this._valueProcessing=!1,this.datepickerPopupRef=B(),this._value=[],this.label="Datovelger",this.dateformat=$i.props.dateformat.default,this.multiple=$i.props.multiple.default,this.maxlength=null,this.range=$i.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=$i.props.weeknumbers.default,this.withcontrols=$i.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.today=null,this.calendarOpen=!1,this.timezone="Europe/Oslo",this.inputClasses={},this.calRef=B(),this.popupRef=B(),this.helptextSlot=B(),this.singleInputRef=B(),this.rangeInputRef=B(),this.multipleInputRef=B(),this.addToSelected=e=>{const t=this.datepickerPopupRef.value;return t&&typeof t.addToSelected=="function"?t.addToSelected(e,this.min,this.max):en.addToSelected(e,this.calRef,this.min,this.max)},this.slotController=new Le(this,this.helptextSlot)}get value(){return this._valueProperty}set value(e){const t=this._valueProperty;this._valueProperty=Array.isArray(e)?e.join(","):e||"",this.valueChanged(this._valueProperty,t),this.requestUpdate("value",t)}get inputType(){return $u.getInputType()}connectedCallback(){super.connectedCallback(),this.timezone&&this.timezone!==window.pktTz&&(window.pktTz=this.timezone)}disconnectedCallback(){super.disconnectedCallback()}onInput(){this.dispatchEvent(new Event("input",{bubbles:!0}))}valueChanged(e,t){if(!(this._valueProcessing||e===t)){this._valueProcessing=!0;try{const i=yi(e),n=this.multiple&&i.length>1?wa.filterSelectableDates(i,this.min,this.max,this.excludedates,this.excludeweekdays):i;if(this.range&&!wa.validateRangeOrder(n)){this._value=[],this._valueProperty="",super.valueChanged("",t);return}this._value=n;const r=hd(n);if(this._valueProperty!==r&&(this._valueProperty=r),this.range&&n.length<2)return;super.valueChanged(r,t)}finally{this._valueProcessing=!1}}}attributeChangedCallback(e,t,i){e==="value"&&this.value!==t&&this.valueChanged(i,t),e==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=yi(i||"")),e==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=yi(i||"")),super.attributeChangedCallback(e,t,i)}updated(e){if(e.has("value")&&(e.has("multiple")||e.has("range"))){const t=Array.isArray(this.value)?this.value.join(","):this.value,i=e.get("value"),n=Array.isArray(i)?i.join(","):i;this.valueChanged(t,n)}e.has("multiple")&&(this.multiple&&!Array.isArray(this._value)?this._value=yi(this.value):!this.multiple&&Array.isArray(this._value)&&(this._value=this._value.filter(Boolean)),!this.multiple&&!this.range&&Array.isArray(this._value)&&(this._value=[this._value[0]??""])),super.updated(e)}get inputRef(){return{value:this.currentInputElement}}get inputRefTo(){return{value:this.currentInputElementTo}}get currentInputElement(){var e,t,i;return this.multiple?(e=this.multipleInputRef.value)==null?void 0:e.inputElement:this.range?(t=this.rangeInputRef.value)==null?void 0:t.inputElement:(i=this.singleInputRef.value)==null?void 0:i.inputElement}get currentInputElementTo(){var e;if(this.range)return(e=this.rangeInputRef.value)==null?void 0:e.inputElementTo}get currentButtonElement(){var e,t,i;return this.multiple?(e=this.multipleInputRef.value)==null?void 0:e.buttonElement:this.range?(t=this.rangeInputRef.value)==null?void 0:t.buttonElement:(i=this.singleInputRef.value)==null?void 0:i.buttonElement}get btnRef(){return{value:this.currentButtonElement}}renderInput(){return b`
895
+ `}};nn([c({type:Array})],Si.prototype,"value",2),nn([c({type:Number})],Si.prototype,"maxlength",2),nn([c({type:Object})],Si.prototype,"strings",2),Si=nn([ee("pkt-datepicker-multiple")],Si);var Eu=Object.defineProperty,Pu=Object.getOwnPropertyDescriptor,ze=(s,e,t,i)=>{for(var n=i>1?void 0:i?Pu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Eu(e,t,n),n};let He=class extends z{constructor(){super(),this._valueProperty="",this._valueProcessing=!1,this.datepickerPopupRef=B(),this._value=[],this.label="Datovelger",this.dateformat=$i.props.dateformat.default,this.multiple=$i.props.multiple.default,this.maxlength=null,this.range=$i.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=$i.props.weeknumbers.default,this.withcontrols=$i.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.today=null,this.calendarOpen=!1,this.timezone="Europe/Oslo",this.inputClasses={},this.calRef=B(),this.popupRef=B(),this.helptextSlot=B(),this.singleInputRef=B(),this.rangeInputRef=B(),this.multipleInputRef=B(),this.addToSelected=e=>{const t=this.datepickerPopupRef.value;return t&&typeof t.addToSelected=="function"?t.addToSelected(e,this.min,this.max):en.addToSelected(e,this.calRef,this.min,this.max)},this.slotController=new Le(this,this.helptextSlot)}get value(){return this._valueProperty}set value(e){const t=this._valueProperty;this._valueProperty=Array.isArray(e)?e.join(","):e||"",this.valueChanged(this._valueProperty,t),this.requestUpdate("value",t)}get inputType(){return $u.getInputType()}connectedCallback(){super.connectedCallback(),this.timezone&&this.timezone!==window.pktTz&&(window.pktTz=this.timezone)}disconnectedCallback(){super.disconnectedCallback()}onInput(){this.dispatchEvent(new Event("input",{bubbles:!0}))}valueChanged(e,t){if(!(this._valueProcessing||e===t)){this._valueProcessing=!0;try{const i=yi(e),n=this.multiple&&i.length>1?wa.filterSelectableDates(i,this.min,this.max,this.excludedates,this.excludeweekdays):i;if(this.range&&!wa.validateRangeOrder(n)){this._value=[],this._valueProperty="",super.valueChanged("",t);return}this._value=n;const r=hd(n);if(this._valueProperty!==r&&(this._valueProperty=r),this.range&&n.length<2)return;super.valueChanged(r,t)}finally{this._valueProcessing=!1}}}attributeChangedCallback(e,t,i){e==="value"&&this.value!==t&&this.valueChanged(i,t),e==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=yi(i||"")),e==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=yi(i||"")),super.attributeChangedCallback(e,t,i)}updated(e){if(e.has("value")&&(e.has("multiple")||e.has("range"))){const t=Array.isArray(this.value)?this.value.join(","):this.value,i=e.get("value"),n=Array.isArray(i)?i.join(","):i;this.valueChanged(t,n)}e.has("multiple")&&(this.multiple&&!Array.isArray(this._value)?this._value=yi(this.value):!this.multiple&&Array.isArray(this._value)&&(this._value=this._value.filter(Boolean)),!this.multiple&&!this.range&&Array.isArray(this._value)&&(this._value=[this._value[0]??""])),super.updated(e)}get inputRef(){return{value:this.currentInputElement}}get inputRefTo(){return{value:this.currentInputElementTo}}get currentInputElement(){var e,t,i;return this.multiple?(e=this.multipleInputRef.value)==null?void 0:e.inputElement:this.range?(t=this.rangeInputRef.value)==null?void 0:t.inputElement:(i=this.singleInputRef.value)==null?void 0:i.inputElement}get currentInputElementTo(){var e;if(this.range)return(e=this.rangeInputRef.value)==null?void 0:e.inputElementTo}get currentButtonElement(){var e,t,i;return this.multiple?(e=this.multipleInputRef.value)==null?void 0:e.buttonElement:this.range?(t=this.rangeInputRef.value)==null?void 0:t.buttonElement:(i=this.singleInputRef.value)==null?void 0:i.buttonElement}get btnRef(){return{value:this.currentButtonElement}}renderInput(){return v`
896
896
  <pkt-datepicker-single
897
897
  .value=${this._value[0]??""}
898
898
  .inputType=${this.inputType}
@@ -914,7 +914,7 @@
914
914
  @input-changed=${()=>{this.touched=!0}}
915
915
  ${F(this.singleInputRef)}
916
916
  ></pkt-datepicker-single>
917
- `}renderRangeInput(){return b`
917
+ `}renderRangeInput(){return v`
918
918
  <pkt-datepicker-range
919
919
  .value=${this._value}
920
920
  .inputType=${this.inputType}
@@ -940,7 +940,7 @@
940
940
  @input-changed=${()=>{this.touched=!0}}
941
941
  ${F(this.rangeInputRef)}
942
942
  ></pkt-datepicker-range>
943
- `}renderMultipleInput(){return b`
943
+ `}renderMultipleInput(){return v`
944
944
  <pkt-datepicker-multiple
945
945
  .value=${this._value}
946
946
  .inputType=${this.inputType}
@@ -962,7 +962,7 @@
962
962
  @input-changed=${()=>{this.touched=!0}}
963
963
  ${F(this.multipleInputRef)}
964
964
  ></pkt-datepicker-multiple>
965
- `}renderCalendar(){return b`
965
+ `}renderCalendar(){return v`
966
966
  <pkt-datepicker-popup
967
967
  class="pkt-contents"
968
968
  ?open=${this.calendarOpen}
@@ -982,7 +982,7 @@
982
982
  @close=${()=>{this.onBlur(),this.hideCalendar()}}
983
983
  ${F(this.datepickerPopupRef)}
984
984
  ></pkt-datepicker-popup>
985
- `}render(){return this.inputClasses=Hn.getInputClasses(this.fullwidth,this.showRangeLabels,this.multiple,this.range,this.readonly,this.inputType),b`
985
+ `}render(){return this.inputClasses=Hn.getInputClasses(this.fullwidth,this.showRangeLabels,this.multiple,this.range,this.readonly,this.inputType),v`
986
986
  <pkt-input-wrapper
987
987
  label="${this.label}"
988
988
  forId="${this.id}-input"
@@ -1008,7 +1008,7 @@
1008
1008
  class="pkt-datepicker"
1009
1009
  >
1010
1010
  <div class="pkt-contents" ${F(this.helptextSlot)} name="helptext" slot="helptext"></div>
1011
- ${this.multiple?b`<pkt-date-tags
1011
+ ${this.multiple?v`<pkt-date-tags
1012
1012
  .dates=${this._value}
1013
1013
  dateformat=${this.dateformat}
1014
1014
  strings=${this.strings}
@@ -1022,13 +1022,13 @@
1022
1022
  </div>
1023
1023
  </pkt-input-wrapper>
1024
1024
  ${this.renderCalendar()}
1025
- `}handleCalendarPosition(){const e=this.multiple&&!!this.maxlength;en.handleCalendarPosition(this.popupRef,this.inputRef,e)}async showCalendar(){var e;const t=this.datepickerPopupRef.value;if(this.calendarOpen=!0,t&&typeof t.show=="function"){t.show(),ws()&&t.focusOnCurrentDate();return}await Vd(20),this.handleCalendarPosition(),ws()&&((e=this.calRef.value)==null||e.focusOnCurrentDate())}hideCalendar(){const e=this.datepickerPopupRef.value;if(this.calendarOpen=!1,e&&typeof e.hide=="function")return e.hide()}async toggleCalendar(e){e.preventDefault();const t=this.datepickerPopupRef.value;if(t&&typeof t.toggle=="function"){const i=!!t.open;t.toggle(),this.calendarOpen=!i;return}this.calendarOpen?this.hideCalendar():this.showCalendar()}clearInputValue(){this._value=[],this.value="",this.internals.setFormValue(this.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:this._value,bubbles:!0,composed:!0}))}};ze([c({type:String,reflect:!0})],He.prototype,"value",1),ze([c({type:String,reflect:!0})],He.prototype,"label",2),ze([c({type:String})],He.prototype,"dateformat",2),ze([c({type:Boolean,reflect:!0})],He.prototype,"multiple",2),ze([c({type:Number,reflect:!0})],He.prototype,"maxlength",2),ze([c({type:Boolean,reflect:!0})],He.prototype,"range",2),ze([c({type:Boolean,attribute:"show-range-labels"})],He.prototype,"showRangeLabels",2),ze([c({type:String,reflect:!0})],He.prototype,"min",2),ze([c({type:String,reflect:!0})],He.prototype,"max",2),ze([c({type:Boolean})],He.prototype,"weeknumbers",2),ze([c({type:Boolean,reflect:!0})],He.prototype,"withcontrols",2),ze([c({converter:Us.csvToArray})],He.prototype,"excludedates",2),ze([c({converter:Us.csvToArray})],He.prototype,"excludeweekdays",2),ze([c({type:String})],He.prototype,"currentmonth",2),ze([c({type:String})],He.prototype,"today",2),ze([c({type:Boolean,reflect:!0,attribute:"calendar-open"})],He.prototype,"calendarOpen",2),ze([c({type:String})],He.prototype,"timezone",2),ze([Z()],He.prototype,"inputClasses",2),He=ze([ee("pkt-datepicker")],He);const Au={href:{default:"#"},target:{default:"_self"}},xa={props:Au};var Iu=Object.defineProperty,Lu=Object.getOwnPropertyDescriptor,Ks=(s,e,t,i)=>{for(var n=i>1?void 0:i?Lu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Iu(e,t,n),n};let xs=class extends ke{constructor(){super(),this.defaultSlot=B(),this.href=xa.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=!1,this.target=xa.props.target.default,this.slotController=new Le(this,this.defaultSlot)}render(){const e={"pkt-link":!0,"pkt-link--icon-left":!!this.iconName&&this.iconPosition==="left"||!!(this.iconName&&!this.iconPosition),"pkt-link--icon-right":!!this.iconName&&this.iconPosition==="right","pkt-link--external":this.external};return b`<a
1025
+ `}handleCalendarPosition(){const e=this.multiple&&!!this.maxlength;en.handleCalendarPosition(this.popupRef,this.inputRef,e)}async showCalendar(){var e;const t=this.datepickerPopupRef.value;if(this.calendarOpen=!0,t&&typeof t.show=="function"){t.show(),ws()&&t.focusOnCurrentDate();return}await Vd(20),this.handleCalendarPosition(),ws()&&((e=this.calRef.value)==null||e.focusOnCurrentDate())}hideCalendar(){const e=this.datepickerPopupRef.value;if(this.calendarOpen=!1,e&&typeof e.hide=="function")return e.hide()}async toggleCalendar(e){e.preventDefault();const t=this.datepickerPopupRef.value;if(t&&typeof t.toggle=="function"){const i=!!t.open;t.toggle(),this.calendarOpen=!i;return}this.calendarOpen?this.hideCalendar():this.showCalendar()}clearInputValue(){this._value=[],this.value="",this.internals.setFormValue(this.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:this._value,bubbles:!0,composed:!0}))}};ze([c({type:String,reflect:!0})],He.prototype,"value",1),ze([c({type:String,reflect:!0})],He.prototype,"label",2),ze([c({type:String})],He.prototype,"dateformat",2),ze([c({type:Boolean,reflect:!0})],He.prototype,"multiple",2),ze([c({type:Number,reflect:!0})],He.prototype,"maxlength",2),ze([c({type:Boolean,reflect:!0})],He.prototype,"range",2),ze([c({type:Boolean,attribute:"show-range-labels"})],He.prototype,"showRangeLabels",2),ze([c({type:String,reflect:!0})],He.prototype,"min",2),ze([c({type:String,reflect:!0})],He.prototype,"max",2),ze([c({type:Boolean})],He.prototype,"weeknumbers",2),ze([c({type:Boolean,reflect:!0})],He.prototype,"withcontrols",2),ze([c({converter:Us.csvToArray})],He.prototype,"excludedates",2),ze([c({converter:Us.csvToArray})],He.prototype,"excludeweekdays",2),ze([c({type:String})],He.prototype,"currentmonth",2),ze([c({type:String})],He.prototype,"today",2),ze([c({type:Boolean,reflect:!0,attribute:"calendar-open"})],He.prototype,"calendarOpen",2),ze([c({type:String})],He.prototype,"timezone",2),ze([Z()],He.prototype,"inputClasses",2),He=ze([ee("pkt-datepicker")],He);const Au={href:{default:"#"},target:{default:"_self"}},xa={props:Au};var Iu=Object.defineProperty,Lu=Object.getOwnPropertyDescriptor,Ks=(s,e,t,i)=>{for(var n=i>1?void 0:i?Lu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Iu(e,t,n),n};let xs=class extends ke{constructor(){super(),this.defaultSlot=B(),this.href=xa.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=!1,this.target=xa.props.target.default,this.slotController=new Le(this,this.defaultSlot)}render(){const e={"pkt-link":!0,"pkt-link--icon-left":!!this.iconName&&this.iconPosition==="left"||!!(this.iconName&&!this.iconPosition),"pkt-link--icon-right":!!this.iconName&&this.iconPosition==="right","pkt-link--external":this.external};return v`<a
1026
1026
  class=${I(e)}
1027
1027
  href=${this.href}
1028
1028
  .target=${this.target}
1029
1029
  .rel=${this.external?"noopener noreferrer":w}
1030
- >${this.iconName?b`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:""} <span ${F(this.defaultSlot)}>Link</span></a
1031
- >`}};Ks([c({type:String,reflect:!0})],xs.prototype,"href",2),Ks([c({type:String,reflect:!0})],xs.prototype,"iconName",2),Ks([c({type:String,reflect:!0})],xs.prototype,"iconPosition",2),Ks([c({type:Boolean,reflect:!0})],xs.prototype,"external",2),Ks([c({type:String,reflect:!0})],xs.prototype,"target",2),xs=Ks([ee("pkt-link")],xs);var Bu=Object.defineProperty,Fu=Object.getOwnPropertyDescriptor,Vt=(s,e,t,i)=>{for(var n=i>1?void 0:i?Fu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Bu(e,t,n),n};let Et=class extends z{constructor(){super(),this.inputRef=B(),this.helptextSlot=B(),this.value="",this.type="text",this.size=null,this.autocomplete=null,this.iconNameRight=null,this.prefix=null,this.suffix=null,this.omitSearchIcon=!1,this.counterCurrent=0,this.slotController=new Le(this,this.helptextSlot)}attributeChangedCallback(e,t,i){e==="value"&&this.value!==t&&(this.counterCurrent=i?i.length:0,this.valueChanged(i,t)),super.attributeChangedCallback(e,t,i)}updated(e){var t;super.updated(e),e.has("value")&&(this.counterCurrent=((t=this.value)==null?void 0:t.length)||0,this.valueChanged(this.value,e.get("value"))),e.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const e=this.type==="search"&&!this.iconNameRight&&!this.omitSearchIcon,t=I({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),i=this.ariaLabelledby||`${this.id}-input-label`;return b`
1030
+ >${this.iconName?v`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:""} <span ${F(this.defaultSlot)}>Link</span></a
1031
+ >`}};Ks([c({type:String,reflect:!0})],xs.prototype,"href",2),Ks([c({type:String,reflect:!0})],xs.prototype,"iconName",2),Ks([c({type:String,reflect:!0})],xs.prototype,"iconPosition",2),Ks([c({type:Boolean,reflect:!0})],xs.prototype,"external",2),Ks([c({type:String,reflect:!0})],xs.prototype,"target",2),xs=Ks([ee("pkt-link")],xs);var Bu=Object.defineProperty,Fu=Object.getOwnPropertyDescriptor,Vt=(s,e,t,i)=>{for(var n=i>1?void 0:i?Fu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Bu(e,t,n),n};let Et=class extends z{constructor(){super(),this.inputRef=B(),this.helptextSlot=B(),this.value="",this.type="text",this.size=null,this.autocomplete=null,this.iconNameRight=null,this.prefix=null,this.suffix=null,this.omitSearchIcon=!1,this.counterCurrent=0,this.slotController=new Le(this,this.helptextSlot)}attributeChangedCallback(e,t,i){e==="value"&&this.value!==t&&(this.counterCurrent=i?i.length:0,this.valueChanged(i,t)),super.attributeChangedCallback(e,t,i)}updated(e){var t;super.updated(e),e.has("value")&&(this.counterCurrent=((t=this.value)==null?void 0:t.length)||0,this.valueChanged(this.value,e.get("value"))),e.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const e=this.type==="search"&&!this.iconNameRight&&!this.omitSearchIcon,t=I({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),i=this.ariaLabelledby||`${this.id}-input-label`;return v`
1032
1032
  <pkt-input-wrapper
1033
1033
  label="${this.label}"
1034
1034
  ?counter=${this.counter}
@@ -1055,7 +1055,7 @@
1055
1055
  >
1056
1056
  <div class="pkt-contents" ${F(this.helptextSlot)} name="helptext" slot="helptext"></div>
1057
1057
  <div class="pkt-input__container">
1058
- ${this.prefix?b`<div class="pkt-input-prefix">${this.prefix}</div>`:w}
1058
+ ${this.prefix?v`<div class="pkt-input-prefix">${this.prefix}</div>`:w}
1059
1059
  <input
1060
1060
  ${F(this.inputRef)}
1061
1061
  class=${t}
@@ -1082,22 +1082,22 @@
1082
1082
  @blur=${n=>{this.value=n.target.value,this.onBlur(),n.stopImmediatePropagation()}}
1083
1083
  @keydown=${n=>{var r;if(n.key==="Enter"){const a=this.internals.form;a?a.requestSubmit():(r=this.inputRef.value)==null||r.blur()}}}
1084
1084
  />
1085
- ${this.suffix?b`<div class="pkt-input-suffix">
1085
+ ${this.suffix?v`<div class="pkt-input-suffix">
1086
1086
  ${this.suffix}
1087
- ${this.iconNameRight?b`<pkt-icon
1087
+ ${this.iconNameRight?v`<pkt-icon
1088
1088
  class="pkt-input-suffix-icon"
1089
1089
  name=${this.iconNameRight}
1090
1090
  ></pkt-icon>`:w}
1091
- ${e?b`<pkt-icon
1091
+ ${e?v`<pkt-icon
1092
1092
  class="pkt-input-suffix-icon"
1093
1093
  name="magnifying-glass-big"
1094
1094
  ></pkt-icon>`:w}
1095
1095
  </div>`:w}
1096
- ${!this.suffix&&this.iconNameRight?b`<pkt-icon class="pkt-input-icon" name=${this.iconNameRight}></pkt-icon>`:w}
1097
- ${!this.suffix&&e?b`<pkt-icon class="pkt-input-icon" name="magnifying-glass-big"></pkt-icon>`:w}
1096
+ ${!this.suffix&&this.iconNameRight?v`<pkt-icon class="pkt-input-icon" name=${this.iconNameRight}></pkt-icon>`:w}
1097
+ ${!this.suffix&&e?v`<pkt-icon class="pkt-input-icon" name="magnifying-glass-big"></pkt-icon>`:w}
1098
1098
  </div>
1099
1099
  </pkt-input-wrapper>
1100
- `}};Vt([c({type:String,reflect:!0})],Et.prototype,"value",2),Vt([c({type:String})],Et.prototype,"type",2),Vt([c({type:Number})],Et.prototype,"size",2),Vt([c({type:String})],Et.prototype,"autocomplete",2),Vt([c({type:String})],Et.prototype,"iconNameRight",2),Vt([c({type:String})],Et.prototype,"prefix",2),Vt([c({type:String})],Et.prototype,"suffix",2),Vt([c({type:Boolean})],Et.prototype,"omitSearchIcon",2),Vt([Z()],Et.prototype,"counterCurrent",2),Et=Vt([ee("pkt-textinput")],Et);const Hu=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},Vu=s=>Hu(s),Uu=s=>{if(!s)return;const e=typeof s=="string"?new Date(s):s;if(!isNaN(e.getTime()))return e.toLocaleDateString("nb-NO",{day:"numeric",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"})};var ju=Object.defineProperty,qu=Object.getOwnPropertyDescriptor,Ss=(s,e,t,i)=>{for(var n=i>1?void 0:i?qu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&ju(e,t,n),n};let ns=class extends ke{constructor(){super(...arguments),this.canChangeRepresentation=!1,this.logoutOnClick=!1}handleChangeRepresentation(){this.dispatchEvent(new CustomEvent("change-representation",{bubbles:!0,composed:!0}))}handleLogout(){this.dispatchEvent(new CustomEvent("log-out",{bubbles:!0,composed:!0}))}handleMenuItemClick(e){"onClick"in e&&typeof e.onClick=="function"&&e.onClick()}renderLinkOrButton(e,t){const i="href"in e,n=I({"pkt-user-menu__link":!0,"pkt-link-button":!i,"pkt-link":!i,"pkt-link--icon-left":!i,[t||""]:!!t});return i?b`
1100
+ `}};Vt([c({type:String,reflect:!0})],Et.prototype,"value",2),Vt([c({type:String})],Et.prototype,"type",2),Vt([c({type:Number})],Et.prototype,"size",2),Vt([c({type:String})],Et.prototype,"autocomplete",2),Vt([c({type:String})],Et.prototype,"iconNameRight",2),Vt([c({type:String})],Et.prototype,"prefix",2),Vt([c({type:String})],Et.prototype,"suffix",2),Vt([c({type:Boolean})],Et.prototype,"omitSearchIcon",2),Vt([Z()],Et.prototype,"counterCurrent",2),Et=Vt([ee("pkt-textinput")],Et);const Hu=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},Vu=s=>Hu(s),Uu=s=>{if(!s)return;const e=typeof s=="string"?new Date(s):s;if(!isNaN(e.getTime()))return e.toLocaleDateString("nb-NO",{day:"numeric",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"})};var ju=Object.defineProperty,qu=Object.getOwnPropertyDescriptor,Ss=(s,e,t,i)=>{for(var n=i>1?void 0:i?qu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&ju(e,t,n),n};let ns=class extends ke{constructor(){super(...arguments),this.canChangeRepresentation=!1,this.logoutOnClick=!1}handleChangeRepresentation(){this.dispatchEvent(new CustomEvent("change-representation",{bubbles:!0,composed:!0}))}handleLogout(){this.dispatchEvent(new CustomEvent("log-out",{bubbles:!0,composed:!0}))}handleMenuItemClick(e){"onClick"in e&&typeof e.onClick=="function"&&e.onClick()}renderLinkOrButton(e,t){const i="href"in e,n=I({"pkt-user-menu__link":!0,"pkt-link-button":!i,"pkt-link":!i,"pkt-link--icon-left":!i,[t||""]:!!t});return i?v`
1101
1101
  <pkt-link
1102
1102
  icon-name=${e.iconName||w}
1103
1103
  href=${e.href}
@@ -1106,30 +1106,30 @@
1106
1106
  >
1107
1107
  ${e.title}
1108
1108
  </pkt-link>
1109
- `:b`
1109
+ `:v`
1110
1110
  <button class=${n} type="button" @click=${()=>this.handleMenuItemClick(e)}>
1111
- ${e.iconName?b`<pkt-icon
1111
+ ${e.iconName?v`<pkt-icon
1112
1112
  name=${e.iconName}
1113
1113
  class="pkt-link__icon"
1114
1114
  aria-hidden="true"
1115
1115
  ></pkt-icon>`:w}
1116
1116
  ${e.title}
1117
1117
  </button>
1118
- `}renderLinkSection(e){return b`
1118
+ `}renderLinkSection(e){return v`
1119
1119
  <ul class="pkt-user-menu__sublist">
1120
- ${e.map(t=>b`
1120
+ ${e.map(t=>v`
1121
1121
  <li class="pkt-user-menu__subitem">${this.renderLinkOrButton(t)}</li>
1122
1122
  `)}
1123
1123
  </ul>
1124
- `}render(){var e;const t=(e=this.userMenu)==null?void 0:e.map(Vu);return b`
1124
+ `}render(){var e;const t=(e=this.userMenu)==null?void 0:e.map(Vu);return v`
1125
1125
  <nav class="pkt-user-menu" aria-label="Meny for innlogget bruker">
1126
1126
  <ul class="pkt-user-menu__list">
1127
1127
  <!-- User section -->
1128
- ${this.user?b`
1128
+ ${this.user?v`
1129
1129
  <li class="pkt-user-menu__item">
1130
1130
  <div class="pkt-user-menu__label">Pålogget som</div>
1131
1131
  <div class="pkt-user-menu__name" translate="no">${this.user.name}</div>
1132
- ${this.formattedLastLoggedIn?b`
1132
+ ${this.formattedLastLoggedIn?v`
1133
1133
  <div class="pkt-user-menu__last-logged-in">
1134
1134
  Sist pålogget: <time>${this.formattedLastLoggedIn}</time>
1135
1135
  </div>
@@ -1138,19 +1138,19 @@
1138
1138
  `:w}
1139
1139
 
1140
1140
  <!-- User menu items -->
1141
- ${t&&t.length>0?b`
1141
+ ${t&&t.length>0?v`
1142
1142
  <li class="pkt-user-menu__item">${this.renderLinkSection(t)}</li>
1143
1143
  `:w}
1144
1144
 
1145
1145
  <!-- Representing section -->
1146
- ${this.representing?b`
1146
+ ${this.representing?v`
1147
1147
  <li class="pkt-user-menu__item">
1148
1148
  <div class="pkt-user-menu__label">Representerer</div>
1149
1149
  <div class="pkt-user-menu__name" translate="no">${this.representing.name}</div>
1150
- ${this.representing.orgNumber?b`<div class="pkt-user-menu__org-number">
1150
+ ${this.representing.orgNumber?v`<div class="pkt-user-menu__org-number">
1151
1151
  Org.nr. ${this.representing.orgNumber}
1152
1152
  </div>`:w}
1153
- ${this.canChangeRepresentation?b`
1153
+ ${this.canChangeRepresentation?v`
1154
1154
  <ul class="pkt-user-menu__sublist mt-size-16">
1155
1155
  <li class="pkt-user-menu__subitem">
1156
1156
  ${this.renderLinkOrButton({title:"Endre organisasjon",iconName:"cogwheel",onClick:()=>this.handleChangeRepresentation()})}
@@ -1161,7 +1161,7 @@
1161
1161
  `:w}
1162
1162
 
1163
1163
  <!-- Change representation without representing object -->
1164
- ${!this.representing&&this.canChangeRepresentation?b`
1164
+ ${!this.representing&&this.canChangeRepresentation?v`
1165
1165
  <li class="pkt-user-menu__item">
1166
1166
  <ul class="pkt-user-menu__sublist">
1167
1167
  <li class="pkt-user-menu__subitem">
@@ -1172,22 +1172,22 @@
1172
1172
  `:w}
1173
1173
 
1174
1174
  <!-- Logout -->
1175
- ${this.logoutOnClick?b`
1175
+ ${this.logoutOnClick?v`
1176
1176
  <li class="pkt-user-menu__item">
1177
1177
  ${this.renderLinkOrButton({title:"Logg ut",iconName:"exit",onClick:()=>this.handleLogout()})}
1178
1178
  </li>
1179
1179
  `:w}
1180
1180
  </ul>
1181
1181
  </nav>
1182
- `}};Ss([c({type:Object})],ns.prototype,"user",2),Ss([c({type:String,attribute:"formatted-last-logged-in"})],ns.prototype,"formattedLastLoggedIn",2),Ss([c({type:Object})],ns.prototype,"representing",2),Ss([c({type:Array,attribute:"user-menu"})],ns.prototype,"userMenu",2),Ss([c({type:Boolean,attribute:"can-change-representation",converter:bt})],ns.prototype,"canChangeRepresentation",2),Ss([c({type:Boolean,attribute:"logout-on-click",converter:bt})],ns.prototype,"logoutOnClick",2),ns=Ss([ee("pkt-header-user-menu")],ns);var Wu=Object.defineProperty,zu=Object.getOwnPropertyDescriptor,pe=(s,e,t,i)=>{for(var n=i>1?void 0:i?zu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Wu(e,t,n),n};const Yu="https://punkt-cdn.oslo.kommune.no/15.4/logos/";let de=class extends ke{constructor(){super(),this.searchPlaceholder="Søk",this.searchValue="",this.mobileBreakpoint=768,this.tabletBreakpoint=1280,this.openedMenu="none",this.logOutButtonPlacement="none",this.position="fixed",this.scrollBehavior="hide",this.slotMenuVariant="icon-only",this.slotMenuText="Meny",this.hideLogo=!1,this.compact=!1,this.showSearch=!1,this.canChangeRepresentation=!1,this.hasLogOut=!1,this.isMobile=!1,this.isTablet=!1,this.openMenu="none",this.isHidden=!1,this.componentWidth=typeof window<"u"?window.innerWidth:0,this.hasSlotContent=!1,this.alignSlotRight=!1,this.alignSearchRight=!1,this.defaultSlot=B(),this.headerRef=B(),this.userContainerRef=B(),this.slotContainerRef=B(),this.searchContainerRef=B(),this.slotContentRef=B(),this.searchMenuRef=B(),this.lastScrollPosition=0,this.savedScrollY=0,this.lastFocusedElement=null,this.shouldRestoreFocus=!1,this.handleScroll=()=>{if(!this.shouldHideOnScroll)return;const e=window.pageYOffset||document.documentElement.scrollTop;e<0||Math.abs(e-this.lastScrollPosition)<60||(this.isHidden=e>this.lastScrollPosition,this.lastScrollPosition=e)},this.handleClickOutside=e=>{const t=e.target;this.user&&this.openMenu==="user"&&!t.closest(".pkt-header-service__user-container")&&(this.openMenu="none"),this.openMenu==="slot"&&!t.closest(".pkt-header-service__slot-container")&&(this.openMenu="none"),this.openMenu==="search"&&!t.closest(".pkt-header-service__search-container")&&!t.closest(".pkt-header-service__search-input")&&(this.openMenu="none")},this.handleFocusOut=(e,t)=>{const i=e.relatedTarget;let n;switch(t){case"user":n=this.userContainerRef;break;case"slot":n=this.slotContainerRef;break;case"search":n=this.searchContainerRef;break;default:return}const r=n.value;r&&(!i||!r.contains(i))&&(this.openMenu="none")},this.handleEscapeKey=e=>{e.key==="Escape"&&this.openMenu!=="none"&&(e.preventDefault(),this.shouldRestoreFocus=!0,this.openMenu="none")},this.slotController=new Le(this,this.defaultSlot)}updateSlots(e){this.hasSlotContent=e.has(null)||e.has(void 0)}connectedCallback(){super.connectedCallback(),this.setupScrollListener()}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.resizeObserver)==null||e.disconnect(),window.removeEventListener("scroll",this.handleScroll),this.unlockScroll()}firstUpdated(){this.setupResizeObserver()}updated(e){if(super.updated(e),e.has("openedMenu")&&this.openedMenu!==this.openMenu&&(this.openMenu=this.openedMenu),(e.has("mobileBreakpoint")||e.has("tabletBreakpoint"))&&(this.updateIsMobile(),this.updateIsTablet()),e.has("openMenu")){const t=e.get("openMenu");this.openMenu!=="none"&&(t==="none"||t===void 0)?(document.addEventListener("mousedown",this.handleClickOutside),document.addEventListener("keydown",this.handleEscapeKey),(this.openMenu==="slot"||this.openMenu==="search")&&requestAnimationFrame(()=>{this.checkDropdownAlignment(this.openMenu)})):this.openMenu==="none"&&t!=="none"&&(document.removeEventListener("mousedown",this.handleClickOutside),document.removeEventListener("keydown",this.handleEscapeKey),this.restoreFocus())}(e.has("openMenu")||e.has("isMobile"))&&this.updateScrollLock()}setupResizeObserver(){const e=this.headerRef.value;e&&(this.componentWidth=e.offsetWidth,this.updateIsMobile(),this.updateIsTablet(),this.resizeObserver=new ResizeObserver(t=>{for(const i of t)i.borderBoxSize&&i.borderBoxSize.length>0?this.componentWidth=i.borderBoxSize[0].inlineSize:this.componentWidth=i.contentRect.width,this.updateIsMobile(),this.updateIsTablet()}),this.resizeObserver.observe(e))}updateIsMobile(){this.isMobile=this.componentWidth<this.mobileBreakpoint}updateIsTablet(){this.isTablet=this.componentWidth<this.tabletBreakpoint}updateScrollLock(){this.position==="fixed"&&this.isMobile&&this.openMenu!=="none"?this.lockScroll():this.unlockScroll()}lockScroll(){const e=document.body,t=document.documentElement;this.savedScrollY=window.scrollY||window.pageYOffset;const i=window.innerWidth-t.clientWidth;i>0&&(e.style.paddingRight=`${i}px`),e.style.position="fixed",e.style.top=`-${this.savedScrollY}px`,e.style.left="0",e.style.right="0",e.style.width="100%",e.style.overflow="hidden",t.classList.add("is-scroll-locked")}unlockScroll(){const e=document.body,t=document.documentElement;t.classList.contains("is-scroll-locked")&&(e.style.removeProperty("position"),e.style.removeProperty("top"),e.style.removeProperty("left"),e.style.removeProperty("right"),e.style.removeProperty("width"),e.style.removeProperty("overflow"),e.style.removeProperty("padding-right"),t.classList.remove("is-scroll-locked"),window.scrollTo({top:this.savedScrollY}))}setupScrollListener(){window.addEventListener("scroll",this.handleScroll)}restoreFocus(){this.shouldRestoreFocus&&this.lastFocusedElement&&document.contains(this.lastFocusedElement)&&this.lastFocusedElement.focus(),this.lastFocusedElement=null,this.shouldRestoreFocus=!1}checkDropdownAlignment(e){const t=e==="slot"?this.slotContainerRef:this.searchContainerRef,i=e==="slot"?this.slotContentRef:this.searchMenuRef;if(!t.value||!i.value||!this.isTablet||this.isMobile)return;const n=t.value.getBoundingClientRect(),r=i.value.offsetWidth,a=n.left+r>window.innerWidth;e==="slot"?this.alignSlotRight=a:this.alignSearchRight=a}handleMenuToggle(e){this.openMenu!=="none"?this.openMenu="none":(this.lastFocusedElement=document.activeElement,this.openMenu=e)}handleLogoClick(e){this.dispatchEvent(new CustomEvent("logo-click",{bubbles:!0,composed:!0,detail:{originalEvent:e}}))}handleServiceClick(e){this.dispatchEvent(new CustomEvent("service-click",{bubbles:!0,composed:!0,detail:{originalEvent:e}}))}handleLogout(){this.dispatchEvent(new CustomEvent("log-out",{bubbles:!0,composed:!0}))}handleSearch(e){this.dispatchEvent(new CustomEvent("search",{detail:{query:e},bubbles:!0,composed:!0}))}handleSearchChange(e){this.dispatchEvent(new CustomEvent("search-change",{detail:{query:e},bubbles:!0,composed:!0}))}handleSearchInputChange(e){const t=e.target.value;this.handleSearchChange(t)}handleSearchKeyDown(e){e.key==="Enter"&&this.handleSearch(e.target.value)}get formattedLastLoggedIn(){var e;return Uu((e=this.user)==null?void 0:e.lastLoggedIn)}get isFixed(){return this.position==="fixed"}get shouldHideOnScroll(){return this.scrollBehavior==="hide"}get showLogoutInHeader(){return this.hasLogOut&&(this.logOutButtonPlacement==="header"||this.logOutButtonPlacement==="both")}get showLogoutInUserMenu(){return this.hasLogOut&&(this.logOutButtonPlacement==="userMenu"||this.logOutButtonPlacement==="both")}renderLogo(){if(this.hideLogo)return w;const e=b`
1182
+ `}};Ss([c({type:Object})],ns.prototype,"user",2),Ss([c({type:String,attribute:"formatted-last-logged-in"})],ns.prototype,"formattedLastLoggedIn",2),Ss([c({type:Object})],ns.prototype,"representing",2),Ss([c({type:Array,attribute:"user-menu"})],ns.prototype,"userMenu",2),Ss([c({type:Boolean,attribute:"can-change-representation",converter:bt})],ns.prototype,"canChangeRepresentation",2),Ss([c({type:Boolean,attribute:"logout-on-click",converter:bt})],ns.prototype,"logoutOnClick",2),ns=Ss([ee("pkt-header-user-menu")],ns);var Wu=Object.defineProperty,zu=Object.getOwnPropertyDescriptor,pe=(s,e,t,i)=>{for(var n=i>1?void 0:i?zu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Wu(e,t,n),n};const Yu="https://punkt-cdn.oslo.kommune.no/15.4/logos/";let de=class extends ke{constructor(){super(),this.searchPlaceholder="Søk",this.searchValue="",this.mobileBreakpoint=768,this.tabletBreakpoint=1280,this.openedMenu="none",this.logOutButtonPlacement="none",this.position="fixed",this.scrollBehavior="hide",this.slotMenuVariant="icon-only",this.slotMenuText="Meny",this.hideLogo=!1,this.compact=!1,this.showSearch=!1,this.canChangeRepresentation=!1,this.hasLogOut=!1,this.isMobile=!1,this.isTablet=!1,this.openMenu="none",this.isHidden=!1,this.componentWidth=typeof window<"u"?window.innerWidth:0,this.hasSlotContent=!1,this.alignSlotRight=!1,this.alignSearchRight=!1,this.defaultSlot=B(),this.headerRef=B(),this.userContainerRef=B(),this.slotContainerRef=B(),this.searchContainerRef=B(),this.slotContentRef=B(),this.searchMenuRef=B(),this.lastScrollPosition=0,this.savedScrollY=0,this.lastFocusedElement=null,this.shouldRestoreFocus=!1,this.handleScroll=()=>{if(!this.shouldHideOnScroll)return;const e=window.pageYOffset||document.documentElement.scrollTop;e<0||Math.abs(e-this.lastScrollPosition)<60||(this.isHidden=e>this.lastScrollPosition,this.lastScrollPosition=e)},this.handleClickOutside=e=>{const t=e.target;this.user&&this.openMenu==="user"&&!t.closest(".pkt-header-service__user-container")&&(this.openMenu="none"),this.openMenu==="slot"&&!t.closest(".pkt-header-service__slot-container")&&(this.openMenu="none"),this.openMenu==="search"&&!t.closest(".pkt-header-service__search-container")&&!t.closest(".pkt-header-service__search-input")&&(this.openMenu="none")},this.handleFocusOut=(e,t)=>{const i=e.relatedTarget;let n;switch(t){case"user":n=this.userContainerRef;break;case"slot":n=this.slotContainerRef;break;case"search":n=this.searchContainerRef;break;default:return}const r=n.value;r&&(!i||!r.contains(i))&&(this.openMenu="none")},this.handleEscapeKey=e=>{e.key==="Escape"&&this.openMenu!=="none"&&(e.preventDefault(),this.shouldRestoreFocus=!0,this.openMenu="none")},this.slotController=new Le(this,this.defaultSlot)}updateSlots(e){this.hasSlotContent=e.has(null)||e.has(void 0)}connectedCallback(){super.connectedCallback(),this.setupScrollListener()}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.resizeObserver)==null||e.disconnect(),window.removeEventListener("scroll",this.handleScroll),this.unlockScroll()}firstUpdated(){this.setupResizeObserver()}updated(e){if(super.updated(e),e.has("openedMenu")&&this.openedMenu!==this.openMenu&&(this.openMenu=this.openedMenu),(e.has("mobileBreakpoint")||e.has("tabletBreakpoint"))&&(this.updateIsMobile(),this.updateIsTablet()),e.has("openMenu")){const t=e.get("openMenu");this.openMenu!=="none"&&(t==="none"||t===void 0)?(document.addEventListener("mousedown",this.handleClickOutside),document.addEventListener("keydown",this.handleEscapeKey),(this.openMenu==="slot"||this.openMenu==="search")&&requestAnimationFrame(()=>{this.checkDropdownAlignment(this.openMenu)})):this.openMenu==="none"&&t!=="none"&&(document.removeEventListener("mousedown",this.handleClickOutside),document.removeEventListener("keydown",this.handleEscapeKey),this.restoreFocus())}(e.has("openMenu")||e.has("isMobile"))&&this.updateScrollLock()}setupResizeObserver(){const e=this.headerRef.value;e&&(this.componentWidth=e.offsetWidth,this.updateIsMobile(),this.updateIsTablet(),this.resizeObserver=new ResizeObserver(t=>{for(const i of t)i.borderBoxSize&&i.borderBoxSize.length>0?this.componentWidth=i.borderBoxSize[0].inlineSize:this.componentWidth=i.contentRect.width,this.updateIsMobile(),this.updateIsTablet()}),this.resizeObserver.observe(e))}updateIsMobile(){this.isMobile=this.componentWidth<this.mobileBreakpoint}updateIsTablet(){this.isTablet=this.componentWidth<this.tabletBreakpoint}updateScrollLock(){this.position==="fixed"&&this.isMobile&&this.openMenu!=="none"?this.lockScroll():this.unlockScroll()}lockScroll(){const e=document.body,t=document.documentElement;this.savedScrollY=window.scrollY||window.pageYOffset;const i=window.innerWidth-t.clientWidth;i>0&&(e.style.paddingRight=`${i}px`),e.style.position="fixed",e.style.top=`-${this.savedScrollY}px`,e.style.left="0",e.style.right="0",e.style.width="100%",e.style.overflow="hidden",t.classList.add("is-scroll-locked")}unlockScroll(){const e=document.body,t=document.documentElement;t.classList.contains("is-scroll-locked")&&(e.style.removeProperty("position"),e.style.removeProperty("top"),e.style.removeProperty("left"),e.style.removeProperty("right"),e.style.removeProperty("width"),e.style.removeProperty("overflow"),e.style.removeProperty("padding-right"),t.classList.remove("is-scroll-locked"),window.scrollTo({top:this.savedScrollY}))}setupScrollListener(){window.addEventListener("scroll",this.handleScroll)}restoreFocus(){this.shouldRestoreFocus&&this.lastFocusedElement&&document.contains(this.lastFocusedElement)&&this.lastFocusedElement.focus(),this.lastFocusedElement=null,this.shouldRestoreFocus=!1}checkDropdownAlignment(e){const t=e==="slot"?this.slotContainerRef:this.searchContainerRef,i=e==="slot"?this.slotContentRef:this.searchMenuRef;if(!t.value||!i.value||!this.isTablet||this.isMobile)return;const n=t.value.getBoundingClientRect(),r=i.value.offsetWidth,a=n.left+r>window.innerWidth;e==="slot"?this.alignSlotRight=a:this.alignSearchRight=a}handleMenuToggle(e){this.openMenu!=="none"?this.openMenu="none":(this.lastFocusedElement=document.activeElement,this.openMenu=e)}handleLogoClick(e){this.dispatchEvent(new CustomEvent("logo-click",{bubbles:!0,composed:!0,detail:{originalEvent:e}}))}handleServiceClick(e){this.dispatchEvent(new CustomEvent("service-click",{bubbles:!0,composed:!0,detail:{originalEvent:e}}))}handleLogout(){this.dispatchEvent(new CustomEvent("log-out",{bubbles:!0,composed:!0}))}handleSearch(e){this.dispatchEvent(new CustomEvent("search",{detail:{query:e},bubbles:!0,composed:!0}))}handleSearchChange(e){this.dispatchEvent(new CustomEvent("search-change",{detail:{query:e},bubbles:!0,composed:!0}))}handleSearchInputChange(e){const t=e.target.value;this.handleSearchChange(t)}handleSearchKeyDown(e){e.key==="Enter"&&this.handleSearch(e.target.value)}get formattedLastLoggedIn(){var e;return Uu((e=this.user)==null?void 0:e.lastLoggedIn)}get isFixed(){return this.position==="fixed"}get shouldHideOnScroll(){return this.scrollBehavior==="hide"}get showLogoutInHeader(){return this.hasLogOut&&(this.logOutButtonPlacement==="header"||this.logOutButtonPlacement==="both")}get showLogoutInUserMenu(){return this.hasLogOut&&(this.logOutButtonPlacement==="userMenu"||this.logOutButtonPlacement==="both")}renderLogo(){if(this.hideLogo)return w;const e=v`
1183
1183
  <pkt-icon name="oslologo" aria-hidden="true" path=${Yu}></pkt-icon>
1184
- `;return this.logoLink&&typeof this.logoLink=="string"?b`
1184
+ `;return this.logoLink&&typeof this.logoLink=="string"?v`
1185
1185
  <span class="pkt-header-service__logo">
1186
1186
  <a href=${this.logoLink} aria-label="Tilbake til forside" @click=${this.handleLogoClick}>
1187
1187
  ${e}
1188
1188
  </a>
1189
1189
  </span>
1190
- `:this.hasAttribute("logo-link")?b`
1190
+ `:this.hasAttribute("logo-link")?v`
1191
1191
  <span class="pkt-header-service__logo">
1192
1192
  <button
1193
1193
  aria-label="Tilbake til forside"
@@ -1197,9 +1197,9 @@
1197
1197
  ${e}
1198
1198
  </button>
1199
1199
  </span>
1200
- `:b`
1200
+ `:v`
1201
1201
  <span class="pkt-header-service__logo" @click=${this.handleLogoClick}>${e}</span>
1202
- `}renderServiceName(){return this.serviceName?this.serviceLink&&typeof this.serviceLink=="string"?b`
1202
+ `}renderServiceName(){return this.serviceName?this.serviceLink&&typeof this.serviceLink=="string"?v`
1203
1203
  <span class="pkt-header-service__service-name">
1204
1204
  <pkt-link
1205
1205
  href=${this.serviceLink}
@@ -1209,7 +1209,7 @@
1209
1209
  ${this.serviceName}
1210
1210
  </pkt-link>
1211
1211
  </span>
1212
- `:this.hasAttribute("service-link")?b`
1212
+ `:this.hasAttribute("service-link")?v`
1213
1213
  <span class="pkt-header-service__service-name">
1214
1214
  <button
1215
1215
  class="pkt-link-button pkt-link pkt-header-service__service-link"
@@ -1218,17 +1218,17 @@
1218
1218
  ${this.serviceName}
1219
1219
  </button>
1220
1220
  </span>
1221
- `:b`
1221
+ `:v`
1222
1222
  <span class="pkt-header-service__service-name" @click=${this.handleServiceClick}>
1223
1223
  <span class="pkt-header-service__service-link">${this.serviceName}</span>
1224
1224
  </span>
1225
- `:w}renderSlotContainer(){const e=I({"pkt-header-service__slot-container":!0,"is-open":this.openMenu==="slot"}),t=I({"pkt-header-service__slot-content":!0,"align-right":this.alignSlotRight});return b`
1225
+ `:w}renderSlotContainer(){const e=I({"pkt-header-service__slot-container":!0,"is-open":this.openMenu==="slot"}),t=I({"pkt-header-service__slot-content":!0,"align-right":this.alignSlotRight});return v`
1226
1226
  <div
1227
1227
  class=${e}
1228
1228
  @focusout=${i=>this.handleFocusOut(i,"slot")}
1229
1229
  ${F(this.slotContainerRef)}
1230
1230
  >
1231
- ${this.isTablet&&this.hasSlotContent?b`
1231
+ ${this.isTablet&&this.hasSlotContent?v`
1232
1232
  <pkt-button
1233
1233
  skin="secondary"
1234
1234
  variant=${this.slotMenuVariant}
@@ -1252,7 +1252,7 @@
1252
1252
  ${F(this.defaultSlot)}
1253
1253
  ></div>
1254
1254
  </div>
1255
- `}renderSearch(){if(!this.showSearch)return w;if(this.isTablet){const e=I({"pkt-header-service__search-container":!0,"is-open":this.openMenu==="search"}),t=I({"pkt-header-service__mobile-menu":!0,"is-open":this.openMenu==="search","align-right":this.alignSearchRight});return b`
1255
+ `}renderSearch(){if(!this.showSearch)return w;if(this.isTablet){const e=I({"pkt-header-service__search-container":!0,"is-open":this.openMenu==="search"}),t=I({"pkt-header-service__mobile-menu":!0,"is-open":this.openMenu==="search","align-right":this.alignSearchRight});return v`
1256
1256
  <div
1257
1257
  class=${e}
1258
1258
  @focusout=${i=>this.handleFocusOut(i,"search")}
@@ -1272,7 +1272,7 @@
1272
1272
  Søk
1273
1273
  </pkt-button>
1274
1274
  <div class=${t} ${F(this.searchMenuRef)}>
1275
- ${this.openMenu==="search"?b`
1275
+ ${this.openMenu==="search"?v`
1276
1276
  <pkt-textinput
1277
1277
  id="mobile-search-menu"
1278
1278
  class="pkt-header-service__search-input"
@@ -1289,7 +1289,7 @@
1289
1289
  `:w}
1290
1290
  </div>
1291
1291
  </div>
1292
- `}return b`
1292
+ `}return v`
1293
1293
  <pkt-textinput
1294
1294
  id="header-service-search"
1295
1295
  class="pkt-header-service__search-input"
@@ -1301,7 +1301,7 @@
1301
1301
  @input=${this.handleSearchInputChange}
1302
1302
  @keydown=${this.handleSearchKeyDown}
1303
1303
  ></pkt-textinput>
1304
- `}renderUserButton(){var e;if(!this.user)return w;const t=I({"pkt-header-service__user-menu":this.isMobile===!1,"pkt-header-service__mobile-menu":this.isMobile===!0,"is-open":this.openMenu==="user"});return b`
1304
+ `}renderUserButton(){var e;if(!this.user)return w;const t=I({"pkt-header-service__user-menu":this.isMobile===!1,"pkt-header-service__mobile-menu":this.isMobile===!0,"is-open":this.openMenu==="user"});return v`
1305
1305
  <div
1306
1306
  class="pkt-header-service__user-container"
1307
1307
  @focusout=${i=>this.handleFocusOut(i,"user")}
@@ -1320,7 +1320,7 @@
1320
1320
  <span class="pkt-sr-only">Brukermeny: </span>
1321
1321
  ${((e=this.representing)==null?void 0:e.name)||this.user.name}
1322
1322
  </pkt-button>
1323
- ${this.openMenu==="user"&&this.user?b`
1323
+ ${this.openMenu==="user"&&this.user?v`
1324
1324
  <div class=${t}>
1325
1325
  <pkt-header-user-menu
1326
1326
  .user=${this.user}
@@ -1335,13 +1335,13 @@
1335
1335
  </div>
1336
1336
  `:w}
1337
1337
  </div>
1338
- `}renderHeader(){const e=I({"pkt-header-service":!0,"pkt-header-service--compact":this.compact,"pkt-header-service--mobile":this.isMobile,"pkt-header-service--tablet":this.isTablet,"pkt-header-service--fixed":this.isFixed,"pkt-header-service--scroll-to-hide":this.shouldHideOnScroll,"pkt-header-service--hidden":this.isHidden}),t=I({"pkt-header-service__logo-area":!0,"pkt-header-service__logo-area--without-service":!this.serviceName});return b`
1338
+ `}renderHeader(){const e=I({"pkt-header-service":!0,"pkt-header-service--compact":this.compact,"pkt-header-service--mobile":this.isMobile,"pkt-header-service--tablet":this.isTablet,"pkt-header-service--fixed":this.isFixed,"pkt-header-service--scroll-to-hide":this.shouldHideOnScroll,"pkt-header-service--hidden":this.isHidden}),t=I({"pkt-header-service__logo-area":!0,"pkt-header-service__logo-area--without-service":!this.serviceName});return v`
1339
1339
  <header class=${e} ${F(this.headerRef)}>
1340
1340
  <div class=${t}>${this.renderLogo()} ${this.renderServiceName()}</div>
1341
1341
 
1342
1342
  <div class="pkt-header-service__content">
1343
1343
  ${this.renderSlotContainer()} ${this.renderSearch()}
1344
- ${this.isTablet&&this.showLogoutInHeader?b`
1344
+ ${this.isTablet&&this.showLogoutInHeader?v`
1345
1345
  <pkt-button
1346
1346
  skin="secondary"
1347
1347
  size=${this.isMobile?"small":"medium"}
@@ -1356,7 +1356,7 @@
1356
1356
 
1357
1357
  <div class="pkt-header-service__user">
1358
1358
  ${this.renderUserButton()}
1359
- ${!this.isTablet&&this.showLogoutInHeader?b`
1359
+ ${!this.isTablet&&this.showLogoutInHeader?v`
1360
1360
  <pkt-button
1361
1361
  skin="tertiary"
1362
1362
  size="medium"
@@ -1369,12 +1369,12 @@
1369
1369
  `:w}
1370
1370
  </div>
1371
1371
  </header>
1372
- `}render(){const e=this.renderHeader();if(this.isFixed){const t=I({"pkt-header-service-spacer":!0,"pkt-header-service-spacer--compact":this.compact,"pkt-header-service-spacer--has-user":!!this.user,"pkt-header-service-spacer--mobile":this.isMobile});return b`
1372
+ `}render(){const e=this.renderHeader();if(this.isFixed){const t=I({"pkt-header-service-spacer":!0,"pkt-header-service-spacer--compact":this.compact,"pkt-header-service-spacer--has-user":!!this.user,"pkt-header-service-spacer--mobile":this.isMobile});return v`
1373
1373
  <div class="pkt-header-service-wrapper">
1374
1374
  ${e}
1375
1375
  <div class=${t}></div>
1376
1376
  </div>
1377
- `}return e}};pe([c({type:String,attribute:"service-name"})],de.prototype,"serviceName",2),pe([c({type:String,attribute:"service-link"})],de.prototype,"serviceLink",2),pe([c({type:String,attribute:"logo-link"})],de.prototype,"logoLink",2),pe([c({type:String,attribute:"search-placeholder"})],de.prototype,"searchPlaceholder",2),pe([c({type:String,attribute:"search-value"})],de.prototype,"searchValue",2),pe([c({type:Number,attribute:"mobile-breakpoint"})],de.prototype,"mobileBreakpoint",2),pe([c({type:Number,attribute:"tablet-breakpoint"})],de.prototype,"tabletBreakpoint",2),pe([c({type:String,attribute:"opened-menu"})],de.prototype,"openedMenu",2),pe([c({type:String,attribute:"log-out-button-placement"})],de.prototype,"logOutButtonPlacement",2),pe([c({type:String})],de.prototype,"position",2),pe([c({type:String,attribute:"scroll-behavior"})],de.prototype,"scrollBehavior",2),pe([c({type:String,attribute:"slot-menu-variant"})],de.prototype,"slotMenuVariant",2),pe([c({type:String,attribute:"slot-menu-text"})],de.prototype,"slotMenuText",2),pe([c({type:Boolean,attribute:"hide-logo",converter:bt})],de.prototype,"hideLogo",2),pe([c({type:Boolean,converter:bt})],de.prototype,"compact",2),pe([c({type:Boolean,attribute:"show-search",converter:bt})],de.prototype,"showSearch",2),pe([c({type:Boolean,attribute:"can-change-representation",converter:bt})],de.prototype,"canChangeRepresentation",2),pe([c({type:Boolean,attribute:"has-log-out",converter:bt})],de.prototype,"hasLogOut",2),pe([c({type:Object})],de.prototype,"user",2),pe([c({type:Array,attribute:"user-menu"})],de.prototype,"userMenu",2),pe([c({type:Object})],de.prototype,"representing",2),pe([Z()],de.prototype,"isMobile",2),pe([Z()],de.prototype,"isTablet",2),pe([Z()],de.prototype,"openMenu",2),pe([Z()],de.prototype,"isHidden",2),pe([Z()],de.prototype,"componentWidth",2),pe([Z()],de.prototype,"hasSlotContent",2),pe([Z()],de.prototype,"alignSlotRight",2),pe([Z()],de.prototype,"alignSearchRight",2),de=pe([ee("pkt-header-service")],de);var Ku=Object.defineProperty,Gu=Object.getOwnPropertyDescriptor,Ee=(s,e,t,i)=>{for(var n=i>1?void 0:i?Gu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Ku(e,t,n),n};let Te=class extends ke{constructor(){super(),this.defaultSlot=B(),this.searchPlaceholder="Søk",this.searchValue="",this.mobileBreakpoint=768,this.tabletBreakpoint=1280,this.openedMenu="none",this.logOutButtonPlacement="none",this.position="fixed",this.scrollBehavior="hide",this.slotMenuVariant="icon-only",this.slotMenuText="Meny",this.hideLogo=!1,this.compact=!1,this.showSearch=!1,this.canChangeRepresentation=!1,this.hasLogOut=!1,this.slotController=new Le(this,this.defaultSlot)}firstUpdated(e){super.firstUpdated(e),this.emitDeprecationWarnings()}emitDeprecationWarnings(){this.userMenuFooter!==void 0&&console.warn("[PktHeader] userMenuFooter is deprecated. Use userMenu instead."),this.userOptions!==void 0&&console.warn("[PktHeader] userOptions is deprecated. Use userMenu instead.")}get effectiveUserMenu(){const e=this.userMenu||[],t=this.userMenuFooter||[],i=this.userOptions||[];return t.length||i.length?[...e,...i,...t]:this.userMenu}render(){return b`
1377
+ `}return e}};pe([c({type:String,attribute:"service-name"})],de.prototype,"serviceName",2),pe([c({type:String,attribute:"service-link"})],de.prototype,"serviceLink",2),pe([c({type:String,attribute:"logo-link"})],de.prototype,"logoLink",2),pe([c({type:String,attribute:"search-placeholder"})],de.prototype,"searchPlaceholder",2),pe([c({type:String,attribute:"search-value"})],de.prototype,"searchValue",2),pe([c({type:Number,attribute:"mobile-breakpoint"})],de.prototype,"mobileBreakpoint",2),pe([c({type:Number,attribute:"tablet-breakpoint"})],de.prototype,"tabletBreakpoint",2),pe([c({type:String,attribute:"opened-menu"})],de.prototype,"openedMenu",2),pe([c({type:String,attribute:"log-out-button-placement"})],de.prototype,"logOutButtonPlacement",2),pe([c({type:String})],de.prototype,"position",2),pe([c({type:String,attribute:"scroll-behavior"})],de.prototype,"scrollBehavior",2),pe([c({type:String,attribute:"slot-menu-variant"})],de.prototype,"slotMenuVariant",2),pe([c({type:String,attribute:"slot-menu-text"})],de.prototype,"slotMenuText",2),pe([c({type:Boolean,attribute:"hide-logo",converter:bt})],de.prototype,"hideLogo",2),pe([c({type:Boolean,converter:bt})],de.prototype,"compact",2),pe([c({type:Boolean,attribute:"show-search",converter:bt})],de.prototype,"showSearch",2),pe([c({type:Boolean,attribute:"can-change-representation",converter:bt})],de.prototype,"canChangeRepresentation",2),pe([c({type:Boolean,attribute:"has-log-out",converter:bt})],de.prototype,"hasLogOut",2),pe([c({type:Object})],de.prototype,"user",2),pe([c({type:Array,attribute:"user-menu"})],de.prototype,"userMenu",2),pe([c({type:Object})],de.prototype,"representing",2),pe([Z()],de.prototype,"isMobile",2),pe([Z()],de.prototype,"isTablet",2),pe([Z()],de.prototype,"openMenu",2),pe([Z()],de.prototype,"isHidden",2),pe([Z()],de.prototype,"componentWidth",2),pe([Z()],de.prototype,"hasSlotContent",2),pe([Z()],de.prototype,"alignSlotRight",2),pe([Z()],de.prototype,"alignSearchRight",2),de=pe([ee("pkt-header-service")],de);var Ku=Object.defineProperty,Gu=Object.getOwnPropertyDescriptor,Ee=(s,e,t,i)=>{for(var n=i>1?void 0:i?Gu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Ku(e,t,n),n};let Te=class extends ke{constructor(){super(),this.defaultSlot=B(),this.searchPlaceholder="Søk",this.searchValue="",this.mobileBreakpoint=768,this.tabletBreakpoint=1280,this.openedMenu="none",this.logOutButtonPlacement="none",this.position="fixed",this.scrollBehavior="hide",this.slotMenuVariant="icon-only",this.slotMenuText="Meny",this.hideLogo=!1,this.compact=!1,this.showSearch=!1,this.canChangeRepresentation=!1,this.hasLogOut=!1,this.slotController=new Le(this,this.defaultSlot)}firstUpdated(e){super.firstUpdated(e),this.emitDeprecationWarnings()}emitDeprecationWarnings(){this.userMenuFooter!==void 0&&console.warn("[PktHeader] userMenuFooter is deprecated. Use userMenu instead."),this.userOptions!==void 0&&console.warn("[PktHeader] userOptions is deprecated. Use userMenu instead.")}get effectiveUserMenu(){const e=this.userMenu||[],t=this.userMenuFooter||[],i=this.userOptions||[];return t.length||i.length?[...e,...i,...t]:this.userMenu}render(){return v`
1378
1378
  <pkt-header-service
1379
1379
  service-name=${P(this.serviceName)}
1380
1380
  service-link=${P(this.serviceLink)}
@@ -1400,35 +1400,35 @@
1400
1400
  >
1401
1401
  <div class="pkt-contents" ${F(this.defaultSlot)}></div>
1402
1402
  </pkt-header-service>
1403
- `}};Ee([c({type:String,attribute:"service-name"})],Te.prototype,"serviceName",2),Ee([c({type:String,attribute:"service-link"})],Te.prototype,"serviceLink",2),Ee([c({type:String,attribute:"logo-link"})],Te.prototype,"logoLink",2),Ee([c({type:String,attribute:"search-placeholder"})],Te.prototype,"searchPlaceholder",2),Ee([c({type:String,attribute:"search-value"})],Te.prototype,"searchValue",2),Ee([c({type:Number,attribute:"mobile-breakpoint"})],Te.prototype,"mobileBreakpoint",2),Ee([c({type:Number,attribute:"tablet-breakpoint"})],Te.prototype,"tabletBreakpoint",2),Ee([c({type:String,attribute:"opened-menu"})],Te.prototype,"openedMenu",2),Ee([c({type:String,attribute:"log-out-button-placement"})],Te.prototype,"logOutButtonPlacement",2),Ee([c({type:String})],Te.prototype,"position",2),Ee([c({type:String,attribute:"scroll-behavior"})],Te.prototype,"scrollBehavior",2),Ee([c({type:String,attribute:"slot-menu-variant"})],Te.prototype,"slotMenuVariant",2),Ee([c({type:String,attribute:"slot-menu-text"})],Te.prototype,"slotMenuText",2),Ee([c({type:Boolean,attribute:"hide-logo",converter:bt})],Te.prototype,"hideLogo",2),Ee([c({type:Boolean,converter:bt})],Te.prototype,"compact",2),Ee([c({type:Boolean,attribute:"show-search",converter:bt})],Te.prototype,"showSearch",2),Ee([c({type:Boolean,attribute:"can-change-representation",converter:bt})],Te.prototype,"canChangeRepresentation",2),Ee([c({type:Boolean,attribute:"has-log-out",converter:bt})],Te.prototype,"hasLogOut",2),Ee([c({type:Object})],Te.prototype,"user",2),Ee([c({type:Array,attribute:"user-menu"})],Te.prototype,"userMenu",2),Ee([c({type:Object})],Te.prototype,"representing",2),Ee([c({type:Array,attribute:"user-menu-footer"})],Te.prototype,"userMenuFooter",2),Ee([c({type:Array,attribute:"user-options"})],Te.prototype,"userOptions",2),Te=Ee([ee("pkt-header")],Te);var Xu=Object.defineProperty,Qu=Object.getOwnPropertyDescriptor,Cs=(s,e,t,i)=>{for(var n=i>1?void 0:i?Qu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Xu(e,t,n),n};let rs=class extends ke{constructor(){super(),this.defaultSlot=B(),this.title="",this.href="#",this.iconName="",this.external=!1,this.openInNewTab=!1,this.skin="normal",this.slotController=new Le(this,this.defaultSlot)}render(){const e=["pkt-linkcard",this.skin&&`pkt-linkcard--${this.skin}`].filter(Boolean).join(" "),t=["pkt-linkcard__title",this.external&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return b`
1403
+ `}};Ee([c({type:String,attribute:"service-name"})],Te.prototype,"serviceName",2),Ee([c({type:String,attribute:"service-link"})],Te.prototype,"serviceLink",2),Ee([c({type:String,attribute:"logo-link"})],Te.prototype,"logoLink",2),Ee([c({type:String,attribute:"search-placeholder"})],Te.prototype,"searchPlaceholder",2),Ee([c({type:String,attribute:"search-value"})],Te.prototype,"searchValue",2),Ee([c({type:Number,attribute:"mobile-breakpoint"})],Te.prototype,"mobileBreakpoint",2),Ee([c({type:Number,attribute:"tablet-breakpoint"})],Te.prototype,"tabletBreakpoint",2),Ee([c({type:String,attribute:"opened-menu"})],Te.prototype,"openedMenu",2),Ee([c({type:String,attribute:"log-out-button-placement"})],Te.prototype,"logOutButtonPlacement",2),Ee([c({type:String})],Te.prototype,"position",2),Ee([c({type:String,attribute:"scroll-behavior"})],Te.prototype,"scrollBehavior",2),Ee([c({type:String,attribute:"slot-menu-variant"})],Te.prototype,"slotMenuVariant",2),Ee([c({type:String,attribute:"slot-menu-text"})],Te.prototype,"slotMenuText",2),Ee([c({type:Boolean,attribute:"hide-logo",converter:bt})],Te.prototype,"hideLogo",2),Ee([c({type:Boolean,converter:bt})],Te.prototype,"compact",2),Ee([c({type:Boolean,attribute:"show-search",converter:bt})],Te.prototype,"showSearch",2),Ee([c({type:Boolean,attribute:"can-change-representation",converter:bt})],Te.prototype,"canChangeRepresentation",2),Ee([c({type:Boolean,attribute:"has-log-out",converter:bt})],Te.prototype,"hasLogOut",2),Ee([c({type:Object})],Te.prototype,"user",2),Ee([c({type:Array,attribute:"user-menu"})],Te.prototype,"userMenu",2),Ee([c({type:Object})],Te.prototype,"representing",2),Ee([c({type:Array,attribute:"user-menu-footer"})],Te.prototype,"userMenuFooter",2),Ee([c({type:Array,attribute:"user-options"})],Te.prototype,"userOptions",2),Te=Ee([ee("pkt-header")],Te);var Xu=Object.defineProperty,Qu=Object.getOwnPropertyDescriptor,Cs=(s,e,t,i)=>{for(var n=i>1?void 0:i?Qu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Xu(e,t,n),n};let rs=class extends ke{constructor(){super(),this.defaultSlot=B(),this.title="",this.href="#",this.iconName="",this.external=!1,this.openInNewTab=!1,this.skin="normal",this.slotController=new Le(this,this.defaultSlot)}render(){const e=["pkt-linkcard",this.skin&&`pkt-linkcard--${this.skin}`].filter(Boolean).join(" "),t=["pkt-linkcard__title",this.external&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return v`
1404
1404
  <a
1405
1405
  href=${this.href}
1406
1406
  class=${e}
1407
1407
  target=${this.openInNewTab?"_blank":"_self"}
1408
1408
  rel=${P(this.openInNewTab?"noopener noreferrer":void 0)}
1409
1409
  >
1410
- ${this.iconName&&b`<pkt-icon class="pkt-link__icon" name="${this.iconName}" />`}
1411
- ${this.title&&b`<div class=${t}>${this.title}</div>`}
1410
+ ${this.iconName&&v`<pkt-icon class="pkt-link__icon" name="${this.iconName}" />`}
1411
+ ${this.title&&v`<div class=${t}>${this.title}</div>`}
1412
1412
 
1413
1413
  <div class="pkt-linkcard__text" ${F(this.defaultSlot)}></div>
1414
1414
  </a>
1415
- `}};Cs([c({type:String,reflect:!0})],rs.prototype,"title",2),Cs([c({type:String,reflect:!0})],rs.prototype,"href",2),Cs([c({type:String,reflect:!0})],rs.prototype,"iconName",2),Cs([c({type:Boolean,reflect:!0})],rs.prototype,"external",2),Cs([c({type:Boolean,reflect:!0})],rs.prototype,"openInNewTab",2),Cs([c({type:String,reflect:!0})],rs.prototype,"skin",2),rs=Cs([ee("pkt-linkcard")],rs);var Zu=Object.defineProperty,Ju=Object.getOwnPropertyDescriptor,Gt=(s,e,t,i)=>{for(var n=i>1?void 0:i?Ju(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Zu(e,t,n),n};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/15.4/animations/";let Pt=class extends ke{constructor(){super(),this.defaultSlot=B(),this.delay=0,this.inline=!1,this.isLoading=!0,this.message=null,this.size="medium",this.variant="shapes",this.loadingAnimationPath=window.pktAnimationPath,this._shouldDisplayLoader=!1,this.slotController=new Le(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(e){e.has("delay")&&this.setupLoader()}render(){const e=I({"pkt-loader":!0,[`pkt-loader--${this.inline?"inline":"box"}`]:!0,[`pkt-loader--${this.size}`]:!0}),t=I({"pkt-contents":!0,"pkt-hide":this.isLoading});return b`<div
1415
+ `}};Cs([c({type:String,reflect:!0})],rs.prototype,"title",2),Cs([c({type:String,reflect:!0})],rs.prototype,"href",2),Cs([c({type:String,reflect:!0})],rs.prototype,"iconName",2),Cs([c({type:Boolean,reflect:!0})],rs.prototype,"external",2),Cs([c({type:Boolean,reflect:!0})],rs.prototype,"openInNewTab",2),Cs([c({type:String,reflect:!0})],rs.prototype,"skin",2),rs=Cs([ee("pkt-linkcard")],rs);var Zu=Object.defineProperty,Ju=Object.getOwnPropertyDescriptor,Gt=(s,e,t,i)=>{for(var n=i>1?void 0:i?Ju(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Zu(e,t,n),n};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/15.4/animations/";let Pt=class extends ke{constructor(){super(),this.defaultSlot=B(),this.delay=0,this.inline=!1,this.isLoading=!0,this.message=null,this.size="medium",this.variant="shapes",this.loadingAnimationPath=window.pktAnimationPath,this._shouldDisplayLoader=!1,this.slotController=new Le(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(e){e.has("delay")&&this.setupLoader()}render(){const e=I({"pkt-loader":!0,[`pkt-loader--${this.inline?"inline":"box"}`]:!0,[`pkt-loader--${this.size}`]:!0}),t=I({"pkt-contents":!0,"pkt-hide":this.isLoading});return v`<div
1416
1416
  role="status"
1417
1417
  aria-live="polite"
1418
1418
  aria-busy=${this.isLoading?"true":"false"}
1419
1419
  class=${e}
1420
1420
  >
1421
- ${this.isLoading&&this._shouldDisplayLoader?b`<div class="pkt-loader__spinner">
1421
+ ${this.isLoading&&this._shouldDisplayLoader?v`<div class="pkt-loader__spinner">
1422
1422
  <pkt-icon
1423
1423
  name=${this.getVariant(this.variant)}
1424
1424
  path=${this.loadingAnimationPath}
1425
1425
  class="pkt-loader__svg pkt-loader__${this.variant}"
1426
1426
  ></pkt-icon>
1427
- ${this.message&&b`<p>${this.message}</p>`}
1427
+ ${this.message&&v`<p>${this.message}</p>`}
1428
1428
  </div>`:w}
1429
1429
  <div class=${t} ${F(this.defaultSlot)}></div>
1430
- </div>`}getVariant(e){switch(e){case"blue":return"spinner-blue";case"rainbow":return"spinner";default:return"loader"}}setupLoader(){this.delay>0&&(this._shouldDisplayLoader=!1,setTimeout(()=>{this._shouldDisplayLoader=!0,this.requestUpdate()},this.delay))}};Gt([c({type:Number})],Pt.prototype,"delay",2),Gt([c({type:Boolean})],Pt.prototype,"inline",2),Gt([c({type:Boolean})],Pt.prototype,"isLoading",2),Gt([c({type:String})],Pt.prototype,"message",2),Gt([c({type:String})],Pt.prototype,"size",2),Gt([c({type:String})],Pt.prototype,"variant",2),Gt([c({type:String})],Pt.prototype,"loadingAnimationPath",2),Gt([Z()],Pt.prototype,"_shouldDisplayLoader",2),Pt=Gt([ee("pkt-loader")],Pt);const Ru={skin:{default:"beige"},compact:{default:!1},closable:{default:!1}},jn={props:Ru};var eh=Object.defineProperty,th=Object.getOwnPropertyDescriptor,Gs=(s,e,t,i)=>{for(var n=i>1?void 0:i?th(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&eh(e,t,n),n};let Ts=class extends ke{constructor(){super(),this.defaultSlot=B(),this.closable=jn.props.closable.default,this.compact=jn.props.compact.default,this.title="",this.skin=jn.props.skin.default,this._isClosed=!1,this.close=s=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:s},bubbles:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:s},bubbles:!0}))},this.slotController=new Le(this,this.defaultSlot),this._isClosed=!1}updated(s){super.updated(s),s.has("_isClosed")&&jr(this,"pkt-hide",this._isClosed)}render(){const s={"pkt-messagebox":!0,"pkt-messagebox--compact":this.compact,[`pkt-messagebox--${this.skin}`]:this.skin,"pkt-messagebox--closable":this.closable,"pkt-hide":this._isClosed};return b`<div class=${I(s)}>
1431
- ${this.closable?b`<div class="pkt-messagebox__close">
1430
+ </div>`}getVariant(e){switch(e){case"blue":return"spinner-blue";case"rainbow":return"spinner";default:return"loader"}}setupLoader(){this.delay>0&&(this._shouldDisplayLoader=!1,setTimeout(()=>{this._shouldDisplayLoader=!0,this.requestUpdate()},this.delay))}};Gt([c({type:Number})],Pt.prototype,"delay",2),Gt([c({type:Boolean})],Pt.prototype,"inline",2),Gt([c({type:Boolean})],Pt.prototype,"isLoading",2),Gt([c({type:String})],Pt.prototype,"message",2),Gt([c({type:String})],Pt.prototype,"size",2),Gt([c({type:String})],Pt.prototype,"variant",2),Gt([c({type:String})],Pt.prototype,"loadingAnimationPath",2),Gt([Z()],Pt.prototype,"_shouldDisplayLoader",2),Pt=Gt([ee("pkt-loader")],Pt);const Ru={skin:{default:"beige"},compact:{default:!1},closable:{default:!1}},jn={props:Ru};var eh=Object.defineProperty,th=Object.getOwnPropertyDescriptor,Gs=(s,e,t,i)=>{for(var n=i>1?void 0:i?th(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&eh(e,t,n),n};let Ts=class extends ke{constructor(){super(),this.defaultSlot=B(),this.closable=jn.props.closable.default,this.compact=jn.props.compact.default,this.title="",this.skin=jn.props.skin.default,this._isClosed=!1,this.close=s=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:s},bubbles:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:s},bubbles:!0}))},this.slotController=new Le(this,this.defaultSlot),this._isClosed=!1}updated(s){super.updated(s),s.has("_isClosed")&&jr(this,"pkt-hide",this._isClosed)}render(){const s={"pkt-messagebox":!0,"pkt-messagebox--compact":this.compact,[`pkt-messagebox--${this.skin}`]:this.skin,"pkt-messagebox--closable":this.closable,"pkt-hide":this._isClosed};return v`<div class=${I(s)}>
1431
+ ${this.closable?v`<div class="pkt-messagebox__close">
1432
1432
  <button
1433
1433
  @click=${this.close}
1434
1434
  class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only"
@@ -1437,9 +1437,9 @@
1437
1437
  <pkt-icon name="close" class="pkt-link__icon"></pkt-icon>
1438
1438
  </button>
1439
1439
  </div>`:w}
1440
- ${this.title?b`<div class="pkt-messagebox__title">${this.title}</div>`:w}
1440
+ ${this.title?v`<div class="pkt-messagebox__title">${this.title}</div>`:w}
1441
1441
  <div class="pkt-messagebox__text" ${F(this.defaultSlot)}></div>
1442
- </div>`}};Gs([c({type:Boolean,reflect:!0})],Ts.prototype,"closable",2),Gs([c({type:Boolean,reflect:!0})],Ts.prototype,"compact",2),Gs([c({type:String,reflect:!0})],Ts.prototype,"title",2),Gs([c({type:String,reflect:!0})],Ts.prototype,"skin",2),Gs([Z()],Ts.prototype,"_isClosed",2),Ts=Gs([ee("pkt-messagebox")],Ts);const sh={hideCloseButton:{default:!1},closeOnBackdropClick:{default:!1},size:{default:"medium"}},qn={props:sh};var ih=Object.defineProperty,nh=Object.getOwnPropertyDescriptor,At=(s,e,t,i)=>{for(var n=i>1?void 0:i?nh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&ih(e,t,n),n};let xt=class extends ke{constructor(){super(),this.headingText="",this.removePadding=!1,this.hideCloseButton=qn.props.hideCloseButton.default,this.closeOnBackdropClick=qn.props.closeOnBackdropClick.default,this.closeButtonSkin="blue",this.size=qn.props.size.default,this.variant="dialog",this.drawerPosition="right",this.transparentBackdrop=!1,this.defaultSlot=B(),this.dialogRef=B(),this._isOpen=!1,this.close=(s,e=!1)=>{var t;if(!this._isOpen)return;this._isOpen=!1,document.body.classList.remove("pkt-modal--open");const i=document.activeElement;i&&!this.isElementInViewport(i)&&i.scrollIntoView({behavior:"smooth",block:"nearest"}),this.dispatchEvent(new CustomEvent("close",{detail:{origin:s},bubbles:!0,composed:!0})),e||(t=this.dialogRef.value)==null||t.close(),this.requestUpdate()},this.showModal=(s=null)=>{var e;this._isOpen=!0,(e=this.dialogRef.value)==null||e.showModal();const t=document.querySelector(".pkt-modal");requestAnimationFrame(()=>{var i;this.dialogRef.value&&((i=this.dialogRef.value)==null||i.focus())}),t&&document.body.classList.add("pkt-modal--open"),this.dispatchEvent(new CustomEvent("showModal",{detail:{origin:s},bubbles:!0,composed:!0})),this.requestUpdate()},this.slotController=new Le(this,this.defaultSlot),this._isOpen=!1}async connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleKeyDown.bind(this)),document.addEventListener("click",this.handleBackdropClick.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("click",this.handleBackdropClick)}async firstUpdated(s){super.firstUpdated(s),this.dialogRef.value&&!window.HTMLDialogElement&&!this.dialogRef.value.showModal&&("document"in window&&"createElement"in document&&(await Promise.resolve().then(()=>Wm).then(e=>e.default)).registerDialog(this.dialogRef.value),this.dialogRef.value.addEventListener("close",()=>{this.close(new Event("close"),!0)}))}handleKeyDown(s){s.key==="Escape"&&this.close(s)}handleBackdropClick(s){var e;this.closeOnBackdropClick&&s.target===((e=this.dialogRef)==null?void 0:e.value)&&this.close(s)}isElementInViewport(s){const e=s.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}render(){const s={"pkt-modal":!0,"pkt-modal--removePadding":this.removePadding??!1,"pkt-modal--noHeadingText":this.headingText===""||this.headingText===void 0,"pkt-modal--noShadow":this.closeButtonSkin==="yellow-filled","pkt-modal--transparentBackdrop":this.transparentBackdrop??!1,[`pkt-modal--${this.size}`]:this.size!==void 0,[`pkt-modal__${this.variant}`]:this.variant!==void 0,[`pkt-modal__drawer--${this.drawerPosition}`]:this.variant==="drawer"},e={"pkt-modal__headingText":!0,"pkt-txt-24":!0},t={"pkt-modal__content":!0,"pkt-txt-18-light":!0},i=this.closeButtonSkin==="blue",n={"pkt-modal__closeButton":!0,[`pkt-modal__closeButton--${this.closeButtonSkin}`]:!0};return b`
1442
+ </div>`}};Gs([c({type:Boolean,reflect:!0})],Ts.prototype,"closable",2),Gs([c({type:Boolean,reflect:!0})],Ts.prototype,"compact",2),Gs([c({type:String,reflect:!0})],Ts.prototype,"title",2),Gs([c({type:String,reflect:!0})],Ts.prototype,"skin",2),Gs([Z()],Ts.prototype,"_isClosed",2),Ts=Gs([ee("pkt-messagebox")],Ts);const sh={hideCloseButton:{default:!1},closeOnBackdropClick:{default:!1},size:{default:"medium"}},qn={props:sh};var ih=Object.defineProperty,nh=Object.getOwnPropertyDescriptor,At=(s,e,t,i)=>{for(var n=i>1?void 0:i?nh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&ih(e,t,n),n};let xt=class extends ke{constructor(){super(),this.headingText="",this.removePadding=!1,this.hideCloseButton=qn.props.hideCloseButton.default,this.closeOnBackdropClick=qn.props.closeOnBackdropClick.default,this.closeButtonSkin="blue",this.size=qn.props.size.default,this.variant="dialog",this.drawerPosition="right",this.transparentBackdrop=!1,this.defaultSlot=B(),this.dialogRef=B(),this._isOpen=!1,this.close=(s,e=!1)=>{var t;if(!this._isOpen)return;this._isOpen=!1,document.body.classList.remove("pkt-modal--open");const i=document.activeElement;i&&!this.isElementInViewport(i)&&i.scrollIntoView({behavior:"smooth",block:"nearest"}),this.dispatchEvent(new CustomEvent("close",{detail:{origin:s},bubbles:!0,composed:!0})),e||(t=this.dialogRef.value)==null||t.close(),this.requestUpdate()},this.showModal=(s=null)=>{var e;this._isOpen=!0,(e=this.dialogRef.value)==null||e.showModal();const t=document.querySelector(".pkt-modal");requestAnimationFrame(()=>{var i;this.dialogRef.value&&((i=this.dialogRef.value)==null||i.focus())}),t&&document.body.classList.add("pkt-modal--open"),this.dispatchEvent(new CustomEvent("showModal",{detail:{origin:s},bubbles:!0,composed:!0})),this.requestUpdate()},this.slotController=new Le(this,this.defaultSlot),this._isOpen=!1}async connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleKeyDown.bind(this)),document.addEventListener("click",this.handleBackdropClick.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("click",this.handleBackdropClick)}async firstUpdated(s){super.firstUpdated(s),this.dialogRef.value&&!window.HTMLDialogElement&&!this.dialogRef.value.showModal&&("document"in window&&"createElement"in document&&(await Promise.resolve().then(()=>Wm).then(e=>e.default)).registerDialog(this.dialogRef.value),this.dialogRef.value.addEventListener("close",()=>{this.close(new Event("close"),!0)}))}handleKeyDown(s){s.key==="Escape"&&this.close(s)}handleBackdropClick(s){var e;this.closeOnBackdropClick&&s.target===((e=this.dialogRef)==null?void 0:e.value)&&this.close(s)}isElementInViewport(s){const e=s.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}render(){const s={"pkt-modal":!0,"pkt-modal--removePadding":this.removePadding??!1,"pkt-modal--noHeadingText":this.headingText===""||this.headingText===void 0,"pkt-modal--noShadow":this.closeButtonSkin==="yellow-filled","pkt-modal--transparentBackdrop":this.transparentBackdrop??!1,[`pkt-modal--${this.size}`]:this.size!==void 0,[`pkt-modal__${this.variant}`]:this.variant!==void 0,[`pkt-modal__drawer--${this.drawerPosition}`]:this.variant==="drawer"},e={"pkt-modal__headingText":!0,"pkt-txt-24":!0},t={"pkt-modal__content":!0,"pkt-txt-18-light":!0},i=this.closeButtonSkin==="blue",n={"pkt-modal__closeButton":!0,[`pkt-modal__closeButton--${this.closeButtonSkin}`]:!0};return v`
1443
1443
  <dialog
1444
1444
  class=${I(s)}
1445
1445
  ${F(this.dialogRef)}
@@ -1448,12 +1448,12 @@
1448
1448
  @close=${r=>this.close(r,!0)}
1449
1449
  >
1450
1450
  <div class="pkt-modal__wrapper">
1451
- ${this.headingText||!this.hideCloseButton?b`<div class="pkt-modal__header">
1451
+ ${this.headingText||!this.hideCloseButton?v`<div class="pkt-modal__header">
1452
1452
  <div class="pkt-modal__header-background"></div>
1453
- ${this.headingText?b`<h1 id="pkt-modal__headingText" class=${I(e)}>
1453
+ ${this.headingText?v`<h1 id="pkt-modal__headingText" class=${I(e)}>
1454
1454
  ${this.headingText}
1455
- </h1>`:b`<div class="pkt-modal__headingText"></div>`}
1456
- ${this.hideCloseButton?b`<div class="pkt-modal__noCloseButton"></div>`:b`<div class="${I(n)}">
1455
+ </h1>`:v`<div class="pkt-modal__headingText"></div>`}
1456
+ ${this.hideCloseButton?v`<div class="pkt-modal__noCloseButton"></div>`:v`<div class="${I(n)}">
1457
1457
  <pkt-button
1458
1458
  @click=${r=>this.close(r)}
1459
1459
  aria-label="close"
@@ -1479,32 +1479,32 @@
1479
1479
  * @license
1480
1480
  * Copyright 2018 Google LLC
1481
1481
  * SPDX-License-Identifier: BSD-3-Clause
1482
- */const Sa="important",rh=" !"+Sa,ah=fs(class extends Ls{constructor(s){var e;if(super(s),s.type!==Mt.ATTRIBUTE||s.name!=="style"||((e=s.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(s){return Object.keys(s).reduce((e,t)=>{const i=s[t];return i==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(s,[e]){const{style:t}=s.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const i of this.ft)e[i]==null&&(this.ft.delete(i),i.includes("-")?t.removeProperty(i):t[i]=null);for(const i in e){const n=e[i];if(n!=null){this.ft.add(i);const r=typeof n=="string"&&n.endsWith(rh);i.includes("-")||r?t.setProperty(i,r?n.slice(0,-11):n,r?Sa:""):t[i]=n}}return gt}});var oh=Object.defineProperty,lh=Object.getOwnPropertyDescriptor,Ye=(s,e,t,i)=>{for(var n=i>1?void 0:i?lh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&oh(e,t,n),n};let Fe=class extends ke{constructor(){super(),this.ariaLabel=null,this.ariaLabelledby=null,this.ariaValueText=null,this.ariaLive="polite",this.id=is(),this.role="progressbar",this.skin="dark-blue",this.statusPlacement="following",this.statusType="none",this.title="",this.titlePosition="left",this.valueCurrent=0,this.valueMax=100,this.valueMin=0,this.labelWidth=0,this.progressbarId=this.id,this.computedAriaLabelledby=null,this.computedAriaValueText="",this.labelRef=B(),this.progressBarRef=B()}firstUpdated(e){super.firstUpdated(e),this.setComputedValues(),this.syncAttributes()}updated(e){super.updated(e),e.has("valueCurrent")&&this.labelRef.value&&(this.labelWidth=this.labelRef.value.getBoundingClientRect().width||0),e.has("id")&&this.id&&(this.progressBarId=this.id),(e.has("statusType")||e.has("id")||e.has("ariaLabelledby"))&&(this.progressbarId=this.id||is(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`),(e.has("ariaValueText")||e.has("valueCurrent")||e.has("valueMax"))&&(this.computedAriaValueText=this.statusType==="fraction"&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||""),this.syncAttributes()}render(){const e=this.statusType!=="none",t=this.valueMax-this.valueMin,i=this.valueCurrent/t*100,n=this.statusType==="fraction"?Math.round(i):Math.round((this.valueCurrent-this.valueMin)/(this.valueMax-this.valueMin)*100),r=`${this.valueCurrent} av ${t}`,a=I({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),l=I({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition==="center"}),d=I({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement==="center"}),p=I({"pkt-progressbar__status-placement--following":this.statusPlacement==="following","pkt-progressbar__status-placement--center":this.statusPlacement==="center","pkt-progressbar__status-placement--left":this.statusPlacement==="left"});return b` <div
1482
+ */const Sa="important",rh=" !"+Sa,ah=fs(class extends Ls{constructor(s){var e;if(super(s),s.type!==Mt.ATTRIBUTE||s.name!=="style"||((e=s.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(s){return Object.keys(s).reduce((e,t)=>{const i=s[t];return i==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(s,[e]){const{style:t}=s.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const i of this.ft)e[i]==null&&(this.ft.delete(i),i.includes("-")?t.removeProperty(i):t[i]=null);for(const i in e){const n=e[i];if(n!=null){this.ft.add(i);const r=typeof n=="string"&&n.endsWith(rh);i.includes("-")||r?t.setProperty(i,r?n.slice(0,-11):n,r?Sa:""):t[i]=n}}return gt}});var oh=Object.defineProperty,lh=Object.getOwnPropertyDescriptor,Ye=(s,e,t,i)=>{for(var n=i>1?void 0:i?lh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&oh(e,t,n),n};let Fe=class extends ke{constructor(){super(),this.ariaLabel=null,this.ariaLabelledby=null,this.ariaValueText=null,this.ariaLive="polite",this.id=is(),this.role="progressbar",this.skin="dark-blue",this.statusPlacement="following",this.statusType="none",this.title="",this.titlePosition="left",this.valueCurrent=0,this.valueMax=100,this.valueMin=0,this.labelWidth=0,this.progressbarId=this.id,this.computedAriaLabelledby=null,this.computedAriaValueText="",this.labelRef=B(),this.progressBarRef=B()}firstUpdated(e){super.firstUpdated(e),this.setComputedValues(),this.syncAttributes()}updated(e){super.updated(e),e.has("valueCurrent")&&this.labelRef.value&&(this.labelWidth=this.labelRef.value.getBoundingClientRect().width||0),e.has("id")&&this.id&&(this.progressBarId=this.id),(e.has("statusType")||e.has("id")||e.has("ariaLabelledby"))&&(this.progressbarId=this.id||is(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`),(e.has("ariaValueText")||e.has("valueCurrent")||e.has("valueMax"))&&(this.computedAriaValueText=this.statusType==="fraction"&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||""),this.syncAttributes()}render(){const e=this.statusType!=="none",t=this.valueMax-this.valueMin,i=this.valueCurrent/t*100,n=this.statusType==="fraction"?Math.round(i):Math.round((this.valueCurrent-this.valueMin)/(this.valueMax-this.valueMin)*100),r=`${this.valueCurrent} av ${t}`,a=I({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),l=I({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition==="center"}),d=I({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement==="center"}),p=I({"pkt-progressbar__status-placement--following":this.statusPlacement==="following","pkt-progressbar__status-placement--center":this.statusPlacement==="center","pkt-progressbar__status-placement--left":this.statusPlacement==="left"});return v` <div
1483
1483
  class="pkt-progressbar__container"
1484
1484
  .ref=${this.progressBarRef}
1485
1485
  style=${ah({"--pkt-progress-label-width":`${this.labelWidth}px`,"--pkt-progress-width":`${n}%`})}
1486
1486
  >
1487
- ${this.title?b`<p id=${`${this.progressBarId}-title`} class=${l}>${this.title}</p>`:w}
1487
+ ${this.title?v`<p id=${`${this.progressBarId}-title`} class=${l}>${this.title}</p>`:w}
1488
1488
 
1489
1489
  <div class="pkt-progressbar__bar-wrapper">
1490
1490
  <div class=${a}></div>
1491
1491
  </div>
1492
1492
 
1493
- ${e?b`<div class=${d}>
1493
+ ${e?v`<div class=${d}>
1494
1494
  <span class=${p} ${F(this.labelRef)}>
1495
1495
  ${this.statusType==="percentage"?`${n}%`:r}
1496
1496
  </span>
1497
1497
  </div>`:w}
1498
- </div>`}setComputedValues(){this.progressbarId=this.id||is(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`,this.computedAriaValueText=this.statusType==="fraction"&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||""}syncAttributes(){this._handleAttribute("aria-live",this.ariaLive),this._handleAttribute("aria-valuenow",this.valueCurrent),this._handleAttribute("aria-valuemin",this.valueMin),this._handleAttribute("aria-valuemax",this.valueMax),this._handleAttribute("aria-valuetext",this.computedAriaValueText),this._handleAttribute("aria-label",this.ariaLabel),this._handleAttribute("role",this.role),this._handleAttribute("aria-atomic","true"),this._handleAttribute("id",this.progressbarId),this.ariaLabel||this._handleAttribute("aria-labelledby",this.computedAriaLabelledby)}_handleAttribute(e,t){t==null||t===""?this.removeAttribute(e):this.setAttribute(e,String(t))}};Ye([c({type:String})],Fe.prototype,"ariaLabel",2),Ye([c({type:String,reflect:!0})],Fe.prototype,"ariaLabelledby",2),Ye([c({type:String,reflect:!0})],Fe.prototype,"ariaValueText",2),Ye([c({type:String})],Fe.prototype,"ariaLive",2),Ye([c({type:String,reflect:!0})],Fe.prototype,"id",2),Ye([c({type:String})],Fe.prototype,"role",2),Ye([c({type:String})],Fe.prototype,"skin",2),Ye([c({type:String})],Fe.prototype,"statusPlacement",2),Ye([c({type:String})],Fe.prototype,"statusType",2),Ye([c({type:String,reflect:!0})],Fe.prototype,"title",2),Ye([c({type:String})],Fe.prototype,"titlePosition",2),Ye([c({type:Number,reflect:!0})],Fe.prototype,"valueCurrent",2),Ye([c({type:Number})],Fe.prototype,"valueMax",2),Ye([c({type:Number})],Fe.prototype,"valueMin",2),Ye([Z()],Fe.prototype,"labelWidth",2),Ye([Z()],Fe.prototype,"progressbarId",2),Ye([Z()],Fe.prototype,"computedAriaLabelledby",2),Ye([Z()],Fe.prototype,"computedAriaValueText",2),Fe=Ye([ee("pkt-progressbar")],Fe);var ch=Object.defineProperty,dh=Object.getOwnPropertyDescriptor,St=(s,e,t,i)=>{for(var n=i>1?void 0:i?dh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&ch(e,t,n),n};let yt=class extends z{constructor(){super(...arguments),this.inputRef=B(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.checked=null,this.type="radio",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut",this._checked=!1}connectedCallback(){super.connectedCallback()}attributeChangedCallback(s,e,t){s==="defaultChecked"&&(this._checked=this.defaultChecked),s==="checked"&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(s,e,t)}render(){const s=I({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),e=I({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),t=I({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-sr-only":this.hideLabel}),i="pkt-tag pkt-tag--small pkt-tag--thin-text",n=()=>b`
1499
- ${this.tagText?b`<span class=${i+" pkt-tag--gray"}>${this.tagText}</span>`:w}
1500
- ${this.optionalTag?b`<span class=${i+" pkt-tag--blue-light"}>${this.optionalText}</span>`:w}
1501
- ${this.requiredTag?b`<span class=${i+" pkt-tag--beige"}>${this.requiredText}</span>`:w}
1502
- `,r=()=>b`
1498
+ </div>`}setComputedValues(){this.progressbarId=this.id||is(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`,this.computedAriaValueText=this.statusType==="fraction"&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||""}syncAttributes(){this._handleAttribute("aria-live",this.ariaLive),this._handleAttribute("aria-valuenow",this.valueCurrent),this._handleAttribute("aria-valuemin",this.valueMin),this._handleAttribute("aria-valuemax",this.valueMax),this._handleAttribute("aria-valuetext",this.computedAriaValueText),this._handleAttribute("aria-label",this.ariaLabel),this._handleAttribute("role",this.role),this._handleAttribute("aria-atomic","true"),this._handleAttribute("id",this.progressbarId),this.ariaLabel||this._handleAttribute("aria-labelledby",this.computedAriaLabelledby)}_handleAttribute(e,t){t==null||t===""?this.removeAttribute(e):this.setAttribute(e,String(t))}};Ye([c({type:String})],Fe.prototype,"ariaLabel",2),Ye([c({type:String,reflect:!0})],Fe.prototype,"ariaLabelledby",2),Ye([c({type:String,reflect:!0})],Fe.prototype,"ariaValueText",2),Ye([c({type:String})],Fe.prototype,"ariaLive",2),Ye([c({type:String,reflect:!0})],Fe.prototype,"id",2),Ye([c({type:String})],Fe.prototype,"role",2),Ye([c({type:String})],Fe.prototype,"skin",2),Ye([c({type:String})],Fe.prototype,"statusPlacement",2),Ye([c({type:String})],Fe.prototype,"statusType",2),Ye([c({type:String,reflect:!0})],Fe.prototype,"title",2),Ye([c({type:String})],Fe.prototype,"titlePosition",2),Ye([c({type:Number,reflect:!0})],Fe.prototype,"valueCurrent",2),Ye([c({type:Number})],Fe.prototype,"valueMax",2),Ye([c({type:Number})],Fe.prototype,"valueMin",2),Ye([Z()],Fe.prototype,"labelWidth",2),Ye([Z()],Fe.prototype,"progressbarId",2),Ye([Z()],Fe.prototype,"computedAriaLabelledby",2),Ye([Z()],Fe.prototype,"computedAriaValueText",2),Fe=Ye([ee("pkt-progressbar")],Fe);var ch=Object.defineProperty,dh=Object.getOwnPropertyDescriptor,St=(s,e,t,i)=>{for(var n=i>1?void 0:i?dh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&ch(e,t,n),n};let yt=class extends z{constructor(){super(...arguments),this.inputRef=B(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.checked=null,this.type="radio",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut",this._checked=!1}connectedCallback(){super.connectedCallback()}attributeChangedCallback(s,e,t){s==="defaultChecked"&&(this._checked=this.defaultChecked),s==="checked"&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(s,e,t)}render(){const s=I({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),e=I({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),t=I({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-sr-only":this.hideLabel}),i="pkt-tag pkt-tag--small pkt-tag--thin-text",n=()=>v`
1499
+ ${this.tagText?v`<span class=${i+" pkt-tag--gray"}>${this.tagText}</span>`:w}
1500
+ ${this.optionalTag?v`<span class=${i+" pkt-tag--blue-light"}>${this.optionalText}</span>`:w}
1501
+ ${this.requiredTag?v`<span class=${i+" pkt-tag--beige"}>${this.requiredText}</span>`:w}
1502
+ `,r=()=>v`
1503
1503
  <label class=${t} for=${this.id+"-internal"}>
1504
1504
  ${this.label} ${n()}
1505
- ${this.checkHelptext?b`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:w}
1505
+ ${this.checkHelptext?v`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:w}
1506
1506
  </label>
1507
- `;return b`
1507
+ `;return v`
1508
1508
  <div class="pkt-input-check">
1509
1509
  <div class=${s}>
1510
1510
  <input
@@ -1553,15 +1553,15 @@
1553
1553
  * @license
1554
1554
  * Copyright 2022 Google LLC
1555
1555
  * SPDX-License-Identifier: BSD-3-Clause
1556
- */function fh({context:s,subscribe:e}){return(t,i)=>{typeof i=="object"?i.addInitializer((function(){new Ta(this,{context:s,callback:n=>{t.set.call(this,n)},subscribe:e})})):t.constructor.addInitializer((n=>{new Ta(n,{context:s,callback:r=>{n[i]=r},subscribe:e})}))}}const Ma=Symbol("pkt-tabs-context");var mh=Object.defineProperty,gh=Object.getOwnPropertyDescriptor,Xs=(s,e,t,i)=>{for(var n=i>1?void 0:i?gh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&mh(e,t,n),n};let Ns=class extends ke{constructor(){super(),this.arrowNav=!0,this.disableArrowNav=!1,this.tabRefs=[],this.tabCount=0,this.defaultSlot=B(),this.context={useArrowNav:this.useArrowNav,registerTab:this.registerTab.bind(this),handleClick:this.handleClick.bind(this),handleKeyUp:this.handleKeyUp.bind(this)},this.slotController=new Le(this,this.defaultSlot)}get useArrowNav(){return this.arrowNav&&!this.disableArrowNav}updated(e){(e.has("arrowNav")||e.has("disableArrowNav"))&&(this.context={...this.context,useArrowNav:this.useArrowNav})}registerTab(e,t){this.tabRefs[t]=e,this.tabCount=Math.max(this.tabCount,t+1)}handleClick(e){this.dispatchEvent(new CustomEvent("tab-selected",{detail:{index:e},bubbles:!0,composed:!0}))}handleKeyUp(e,t){var i,n;this.useArrowNav&&(e.code==="ArrowLeft"&&t!==0&&((i=this.tabRefs[t-1])==null||i.focus()),e.code==="ArrowRight"&&t<this.tabCount-1&&((n=this.tabRefs[t+1])==null||n.focus()),(e.code==="ArrowDown"||e.code==="Space")&&this.dispatchEvent(new CustomEvent("tab-selected",{detail:{index:t},bubbles:!0,composed:!0})))}render(){const e=this.useArrowNav?"tablist":"navigation";return b`
1556
+ */function fh({context:s,subscribe:e}){return(t,i)=>{typeof i=="object"?i.addInitializer((function(){new Ta(this,{context:s,callback:n=>{t.set.call(this,n)},subscribe:e})})):t.constructor.addInitializer((n=>{new Ta(n,{context:s,callback:r=>{n[i]=r},subscribe:e})}))}}const Ma=Symbol("pkt-tabs-context");var mh=Object.defineProperty,gh=Object.getOwnPropertyDescriptor,Xs=(s,e,t,i)=>{for(var n=i>1?void 0:i?gh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&mh(e,t,n),n};let Ns=class extends ke{constructor(){super(),this.arrowNav=!0,this.disableArrowNav=!1,this.tabRefs=[],this.tabCount=0,this.defaultSlot=B(),this.context={useArrowNav:this.useArrowNav,registerTab:this.registerTab.bind(this),handleClick:this.handleClick.bind(this),handleKeyUp:this.handleKeyUp.bind(this)},this.slotController=new Le(this,this.defaultSlot)}get useArrowNav(){return this.arrowNav&&!this.disableArrowNav}updated(e){(e.has("arrowNav")||e.has("disableArrowNav"))&&(this.context={...this.context,useArrowNav:this.useArrowNav})}registerTab(e,t){this.tabRefs[t]=e,this.tabCount=Math.max(this.tabCount,t+1)}handleClick(e){this.dispatchEvent(new CustomEvent("tab-selected",{detail:{index:e},bubbles:!0,composed:!0}))}handleKeyUp(e,t){var i,n;this.useArrowNav&&(e.code==="ArrowLeft"&&t!==0&&((i=this.tabRefs[t-1])==null||i.focus()),e.code==="ArrowRight"&&t<this.tabCount-1&&((n=this.tabRefs[t+1])==null||n.focus()),(e.code==="ArrowDown"||e.code==="Space")&&this.dispatchEvent(new CustomEvent("tab-selected",{detail:{index:t},bubbles:!0,composed:!0})))}render(){const e=this.useArrowNav?"tablist":"navigation";return v`
1557
1557
  <div class="pkt-tabs">
1558
1558
  <div class="pkt-tabs__list" role=${e} ${F(this.defaultSlot)}></div>
1559
1559
  </div>
1560
- `}};Xs([c({type:Boolean,reflect:!0,attribute:"arrow-nav"})],Ns.prototype,"arrowNav",2),Xs([c({type:Boolean,reflect:!0,attribute:"disable-arrow-nav"})],Ns.prototype,"disableArrowNav",2),Xs([Z()],Ns.prototype,"tabRefs",2),Xs([Z()],Ns.prototype,"tabCount",2),Xs([ph({context:Ma}),Z()],Ns.prototype,"context",2),Ns=Xs([ee("pkt-tabs")],Ns);var vh=Object.defineProperty,bh=Object.getOwnPropertyDescriptor,Xt=(s,e,t,i)=>{for(var n=i>1?void 0:i?bh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&vh(e,t,n),n};let Ut=class extends ke{constructor(){super(),this.active=!1,this.href="",this.icon="",this.controls="",this.tag="",this.tagSkin="blue",this.index=0,this.elementRef=B(),this.defaultSlot=B(),this.slotController=new Le(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index)})}handleClick(){this.context&&this.context.handleClick(this.index)}handleKeyUp(e){this.context&&this.context.handleKeyUp(e,this.index)}render(){var e;const t=((e=this.context)==null?void 0:e.useArrowNav)??!0,i=this.active?"active":"",n=t?"tab":void 0,r=t?this.active:void 0,a=this.active||!t?void 0:-1,l=b`
1561
- ${this.icon?b`<pkt-icon name=${this.icon} class="pkt-icon--small"></pkt-icon>`:""}
1560
+ `}};Xs([c({type:Boolean,reflect:!0,attribute:"arrow-nav"})],Ns.prototype,"arrowNav",2),Xs([c({type:Boolean,reflect:!0,attribute:"disable-arrow-nav"})],Ns.prototype,"disableArrowNav",2),Xs([Z()],Ns.prototype,"tabRefs",2),Xs([Z()],Ns.prototype,"tabCount",2),Xs([ph({context:Ma}),Z()],Ns.prototype,"context",2),Ns=Xs([ee("pkt-tabs")],Ns);var vh=Object.defineProperty,bh=Object.getOwnPropertyDescriptor,Xt=(s,e,t,i)=>{for(var n=i>1?void 0:i?bh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&vh(e,t,n),n};let Ut=class extends ke{constructor(){super(),this.active=!1,this.href="",this.icon="",this.controls="",this.tag="",this.tagSkin="blue",this.index=0,this.elementRef=B(),this.defaultSlot=B(),this.slotController=new Le(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index)})}handleClick(){this.context&&this.context.handleClick(this.index)}handleKeyUp(e){this.context&&this.context.handleKeyUp(e,this.index)}render(){var e;const t=((e=this.context)==null?void 0:e.useArrowNav)??!0,i=this.active?"active":"",n=t?"tab":void 0,r=t?this.active:void 0,a=this.active||!t?void 0:-1,l=v`
1561
+ ${this.icon?v`<pkt-icon name=${this.icon} class="pkt-icon--small"></pkt-icon>`:""}
1562
1562
  <span ${F(this.defaultSlot)}></span>
1563
- ${this.tag?b`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>`:""}
1564
- `;return this.href?b`
1563
+ ${this.tag?v`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>`:""}
1564
+ `;return this.href?v`
1565
1565
  <a
1566
1566
  ${F(this.elementRef)}
1567
1567
  href=${this.href}
@@ -1575,7 +1575,7 @@
1575
1575
  >
1576
1576
  ${l}
1577
1577
  </a>
1578
- `:b`
1578
+ `:v`
1579
1579
  <button
1580
1580
  ${F(this.elementRef)}
1581
1581
  type="button"
@@ -1593,7 +1593,7 @@
1593
1593
  * @license
1594
1594
  * Copyright 2020 Google LLC
1595
1595
  * SPDX-License-Identifier: BSD-3-Clause
1596
- */const yh=fs(class extends Ls{constructor(s){if(super(s),s.type!==Mt.PROPERTY&&s.type!==Mt.ATTRIBUTE&&s.type!==Mt.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Fr(s))throw Error("`live` bindings can only contain a single expression")}render(s){return s}update(s,[e]){if(e===gt||e===w)return e;const t=s.element,i=s.name;if(s.type===Mt.PROPERTY){if(e===t[i])return gt}else if(s.type===Mt.BOOLEAN_ATTRIBUTE){if(!!e===t.hasAttribute(i))return gt}else if(s.type===Mt.ATTRIBUTE&&t.getAttribute(i)===e+"")return gt;return Vr(s),e}});var kh=Object.defineProperty,_h=Object.getOwnPropertyDescriptor,Ci=(s,e,t,i)=>{for(var n=i>1?void 0:i?_h(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&kh(e,t,n),n};let Qs=class extends z{constructor(){super(),this.inputRef=B(),this.helptextSlot=B(),this.value="",this.autocomplete="off",this.rows=null,this.counterCurrent=0,this.slotController=new Le(this,this.helptextSlot)}attributeChangedCallback(s,e,t){s==="value"&&this.value!==e&&(this.counterCurrent=t?t.length:0,this.valueChanged(t,e)),super.attributeChangedCallback(s,e,t)}updated(s){var e;super.updated(s),s.has("value")&&(this.counterCurrent=((e=this.value)==null?void 0:e.length)||0,this.valueChanged(this.value,s.get("value"))),s.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const s=I({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),e=this.ariaLabelledby||`${this.id}-input-label`;return b`<pkt-input-wrapper
1596
+ */const yh=fs(class extends Ls{constructor(s){if(super(s),s.type!==Mt.PROPERTY&&s.type!==Mt.ATTRIBUTE&&s.type!==Mt.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Fr(s))throw Error("`live` bindings can only contain a single expression")}render(s){return s}update(s,[e]){if(e===gt||e===w)return e;const t=s.element,i=s.name;if(s.type===Mt.PROPERTY){if(e===t[i])return gt}else if(s.type===Mt.BOOLEAN_ATTRIBUTE){if(!!e===t.hasAttribute(i))return gt}else if(s.type===Mt.ATTRIBUTE&&t.getAttribute(i)===e+"")return gt;return Vr(s),e}});var kh=Object.defineProperty,_h=Object.getOwnPropertyDescriptor,Ci=(s,e,t,i)=>{for(var n=i>1?void 0:i?_h(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&kh(e,t,n),n};let Qs=class extends z{constructor(){super(),this.inputRef=B(),this.helptextSlot=B(),this.value="",this.autocomplete="off",this.rows=null,this.counterCurrent=0,this.slotController=new Le(this,this.helptextSlot)}attributeChangedCallback(s,e,t){s==="value"&&this.value!==e&&(this.counterCurrent=t?t.length:0,this.valueChanged(t,e)),super.attributeChangedCallback(s,e,t)}updated(s){var e;super.updated(s),s.has("value")&&(this.counterCurrent=((e=this.value)==null?void 0:e.length)||0,this.valueChanged(this.value,s.get("value"))),s.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const s=I({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),e=this.ariaLabelledby||`${this.id}-input-label`;return v`<pkt-input-wrapper
1597
1597
  label=${this.label}
1598
1598
  ?counter=${this.counter}
1599
1599
  ?disabled=${this.disabled}
@@ -1638,7 +1638,7 @@
1638
1638
  @focus=${t=>{this.onFocus(),t.stopImmediatePropagation()}}
1639
1639
  @blur=${t=>{this.value=t.target.value,this.onBlur(),t.stopImmediatePropagation()}}
1640
1640
  ></textarea>
1641
- </pkt-input-wrapper>`}};Ci([c({type:String,reflect:!0})],Qs.prototype,"value",2),Ci([c({type:String})],Qs.prototype,"autocomplete",2),Ci([c({type:Number})],Qs.prototype,"rows",2),Ci([Z()],Qs.prototype,"counterCurrent",2),Qs=Ci([ee("pkt-textarea")],Qs);var $h=Object.defineProperty,Da=(s,e,t,i)=>{for(var n=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=a(e,t,n)||n);return n&&$h(e,t,n),n};let Wn=class extends z{constructor(){super(...arguments),this._optionsProp=[],this._options=[]}get options(){return this._options.map(e=>({...e,selected:this.isOptionSelected(e)}))}set options(e){this._optionsProp=e,this.requestUpdate("_optionsProp",this._options)}isOptionSelected(e){return Array.isArray(this.value)?this.value.includes(e.value):e.value===this.value}findOptionByValue(e){return this._options.find(t=>t.value===e)}getSelectedOptions(){return this._options.filter(e=>this.isOptionSelected(e))}parseOptions(){var e,t;const i=this._optionsProp.length>0,n=((t=(e=this.optionsController)==null?void 0:e.nodes)==null?void 0:t.length)&&this.optionsController.nodes.length>0;i?this._options=this._optionsProp:n&&(this._options=this.optionsController.options)}willUpdate(e){super.willUpdate(e),this.parseOptions()}};Da([c({type:Array,attribute:"options"})],Wn.prototype,"_optionsProp"),Da([Z()],Wn.prototype,"_options");var wh=Object.defineProperty,xh=Object.getOwnPropertyDescriptor,Oa=(s,e,t,i)=>{for(var n=i>1?void 0:i?xh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&wh(e,t,n),n};let zn=class extends Wn{constructor(){super(),this.inputRef=B(),this.helptextSlot=B(),this.value="",this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new _a(this),this.slotController=new Le(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){super.connectedCallback(),this.parseOptions(),this._options.forEach(s=>{s.selected&&!this.value&&(this.value=s.value)})}add(s,e){const t={value:s.value||s.text,label:s.text||s.value,selected:s.selected,disabled:s.disabled};if(e===void 0)this._options.push(t);else if(typeof e=="number")this._options.splice(e,0,t);else{const i=e.value||e.text,n=this._options.findIndex(r=>r.value===i);n>=0?this._options.splice(n,0,t):this._options.push(t)}s.selected&&(this.value=s.value||s.text,this.selectedIndex=this._options.findIndex(i=>i.value===this.value)),this.requestUpdate()}remove(s){var e;typeof s=="number"&&(this.selectedIndex===s&&(this.value=((e=this._options[0])==null?void 0:e.value)||""),this._options.splice(s,1),this.requestUpdate())}item(s){var e;return(e=this.inputRef.value)==null?void 0:e.item(s)}namedItem(s){var e;return(e=this.inputRef.value)==null?void 0:e.namedItem(s)}showPicker(){this.inputRef.value&&"showPicker"in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(s,e,t){var i,n;s==="options"&&(this._options=t?JSON.parse(t):[]),s==="value"&&this.value!==e&&(this.selectedIndex=this.touched?this.returnNumberOrNull((i=this.inputRef.value)==null?void 0:i.selectedIndex):this._options.findIndex(r=>r.value===t),this.selectedOptions=(n=this.inputRef.value)==null?void 0:n.selectedOptions,this.valueChanged(t,e)),super.attributeChangedCallback(s,e,t)}update(s){var e,t;super.update(s),s.has("_optionsProp")&&this._optionsProp.length>0&&(this._options=this._optionsProp,this.requestUpdate("_options"),!this.value&&this._options.length>0&&(this.value=this._options[0].value,this.selectedIndex=0)),s.has("value")&&this.value!==s.get("value")&&(this.selectedIndex=this.touched?this.returnNumberOrNull((e=this.inputRef.value)==null?void 0:e.selectedIndex):this._options.findIndex(i=>i.value===this.value),this.selectedOptions=(t=this.inputRef.value)==null?void 0:t.selectedOptions,this.valueChanged(this.value,s.get("value"))),s.has("id")&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(s){var e;super.firstUpdated(s),this._optionsProp.length&&(this._options=this._optionsProp),!this.value&&this._options.length>0?(this.value=this._options[0].value,this.selectedIndex=0):this.selectedIndex=this._options.findIndex(t=>t.value===this.value),this.selectedOptions=(e=this.inputRef.value)==null?void 0:e.selectedOptions}render(){const s=`pkt-input ${this.fullwidth?"pkt-input--fullwidth":""}`;return b`
1641
+ </pkt-input-wrapper>`}};Ci([c({type:String,reflect:!0})],Qs.prototype,"value",2),Ci([c({type:String})],Qs.prototype,"autocomplete",2),Ci([c({type:Number})],Qs.prototype,"rows",2),Ci([Z()],Qs.prototype,"counterCurrent",2),Qs=Ci([ee("pkt-textarea")],Qs);var $h=Object.defineProperty,Da=(s,e,t,i)=>{for(var n=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=a(e,t,n)||n);return n&&$h(e,t,n),n};let Wn=class extends z{constructor(){super(...arguments),this._optionsProp=[],this._options=[]}get options(){return this._options.map(e=>({...e,selected:this.isOptionSelected(e)}))}set options(e){this._optionsProp=e,this.requestUpdate("_optionsProp",this._options)}isOptionSelected(e){return Array.isArray(this.value)?this.value.includes(e.value):e.value===this.value}findOptionByValue(e){return this._options.find(t=>t.value===e)}getSelectedOptions(){return this._options.filter(e=>this.isOptionSelected(e))}parseOptions(){var e,t;const i=this._optionsProp.length>0,n=((t=(e=this.optionsController)==null?void 0:e.nodes)==null?void 0:t.length)&&this.optionsController.nodes.length>0;i?this._options=this._optionsProp:n&&(this._options=this.optionsController.options)}willUpdate(e){super.willUpdate(e),this.parseOptions()}};Da([c({type:Array,attribute:"options"})],Wn.prototype,"_optionsProp"),Da([Z()],Wn.prototype,"_options");var wh=Object.defineProperty,xh=Object.getOwnPropertyDescriptor,Oa=(s,e,t,i)=>{for(var n=i>1?void 0:i?xh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&wh(e,t,n),n};let zn=class extends Wn{constructor(){super(),this.inputRef=B(),this.helptextSlot=B(),this.value="",this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new _a(this),this.slotController=new Le(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){super.connectedCallback(),this.parseOptions(),this._options.forEach(s=>{s.selected&&!this.value&&(this.value=s.value)})}add(s,e){const t={value:s.value||s.text,label:s.text||s.value,selected:s.selected,disabled:s.disabled};if(e===void 0)this._options.push(t);else if(typeof e=="number")this._options.splice(e,0,t);else{const i=e.value||e.text,n=this._options.findIndex(r=>r.value===i);n>=0?this._options.splice(n,0,t):this._options.push(t)}s.selected&&(this.value=s.value||s.text,this.selectedIndex=this._options.findIndex(i=>i.value===this.value)),this.requestUpdate()}remove(s){var e;typeof s=="number"&&(this.selectedIndex===s&&(this.value=((e=this._options[0])==null?void 0:e.value)||""),this._options.splice(s,1),this.requestUpdate())}item(s){var e;return(e=this.inputRef.value)==null?void 0:e.item(s)}namedItem(s){var e;return(e=this.inputRef.value)==null?void 0:e.namedItem(s)}showPicker(){this.inputRef.value&&"showPicker"in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(s,e,t){var i,n;s==="options"&&(this._options=t?JSON.parse(t):[]),s==="value"&&this.value!==e&&(this.selectedIndex=this.touched?this.returnNumberOrNull((i=this.inputRef.value)==null?void 0:i.selectedIndex):this._options.findIndex(r=>r.value===t),this.selectedOptions=(n=this.inputRef.value)==null?void 0:n.selectedOptions,this.valueChanged(t,e)),super.attributeChangedCallback(s,e,t)}update(s){var e,t;super.update(s),s.has("_optionsProp")&&this._optionsProp.length>0&&(this._options=this._optionsProp,this.requestUpdate("_options"),!this.value&&this._options.length>0&&(this.value=this._options[0].value,this.selectedIndex=0)),s.has("value")&&this.value!==s.get("value")&&(this.selectedIndex=this.touched?this.returnNumberOrNull((e=this.inputRef.value)==null?void 0:e.selectedIndex):this._options.findIndex(i=>i.value===this.value),this.selectedOptions=(t=this.inputRef.value)==null?void 0:t.selectedOptions,this.valueChanged(this.value,s.get("value"))),s.has("id")&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(s){var e;super.firstUpdated(s),this._optionsProp.length&&(this._options=this._optionsProp),!this.value&&this._options.length>0?(this.value=this._options[0].value,this.selectedIndex=0):this.selectedIndex=this._options.findIndex(t=>t.value===this.value),this.selectedOptions=(e=this.inputRef.value)==null?void 0:e.selectedOptions}render(){const s=`pkt-input ${this.fullwidth?"pkt-input--fullwidth":""}`;return v`
1642
1642
  <pkt-input-wrapper
1643
1643
  ?counter=${this.counter}
1644
1644
  ?disabled=${this.disabled}
@@ -1675,7 +1675,7 @@
1675
1675
  @blur=${e=>{this.onBlur(),e.stopImmediatePropagation()}}
1676
1676
  ${F(this.inputRef)}
1677
1677
  >
1678
- ${this._options.length>0?this._options.map(e=>b`<option
1678
+ ${this._options.length>0?this._options.map(e=>v`<option
1679
1679
  value=${e.value}
1680
1680
  ?selected=${this.value==e.value||e.selected}
1681
1681
  ?disabled=${e.disabled}
@@ -1686,8 +1686,8 @@
1686
1686
  </select>
1687
1687
  <div class="pkt-contents" ${F(this.helptextSlot)} name="helptext" slot="helptext"></div>
1688
1688
  </pkt-input-wrapper>
1689
- `}returnNumberOrNull(s){return s==null||isNaN(s)?null:s}};Oa([c({type:String})],zn.prototype,"value",2),zn=Oa([ee("pkt-select")],zn);const G=It({tagName:"pkt-icon",elementClass:gs,react:h,displayName:"PktIcon",events:{}}),Ea=h.forwardRef(({defaultOpen:s=!1,id:e,title:t,skin:i,compact:n=!1,isOpen:r,children:a,name:l,className:d,onClick:p,onToggle:m},v)=>{const[y,k]=h.useState(s),{name:g}=Yo(),$=l||g,T=r!==void 0?r:y;h.useEffect(()=>{r===void 0&&k(s)},[s,r]);const M=N=>{const X=N.currentTarget.open;r===void 0&&k(X),m==null||m(N)},S=N=>{setTimeout(()=>{p==null||p(N)},0)},O=["pkt-accordion-item",n&&"pkt-accordion-item--compact",i&&`pkt-accordion-item--${i}`,d].filter(Boolean).join(" ");return o.jsxs("details",{ref:v,className:O,id:e,open:T,onClick:S,name:$,onToggle:M,children:[o.jsxs("summary",{className:"pkt-accordion-item__title",id:`pkt-accordion-item-summary-${e}`,children:[t,o.jsx(G,{name:"chevron-thin-down",className:"pkt-accordion-item__icon","aria-hidden":"true"})]}),o.jsx("div",{className:"pkt-accordion-item__content",id:`pkt-accordion-item__content-${e}`,role:"region",children:o.jsx("div",{className:"pkt-accordion-item__content-inner",children:a})})]})});Ea.displayName="PktAccordionItem";function Sh(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Yn={exports:{}};/*!
1689
+ `}returnNumberOrNull(s){return s==null||isNaN(s)?null:s}};Oa([c({type:String})],zn.prototype,"value",2),zn=Oa([ee("pkt-select")],zn);const Y=It({tagName:"pkt-icon",elementClass:gs,react:h,displayName:"PktIcon",events:{}}),Ea=h.forwardRef(({defaultOpen:s=!1,id:e,title:t,skin:i,compact:n=!1,isOpen:r,children:a,name:l,className:d,onClick:p,onToggle:m},b)=>{const[y,k]=h.useState(s),{name:g}=Yo(),$=l||g,T=r!==void 0?r:y;h.useEffect(()=>{r===void 0&&k(s)},[s,r]);const M=N=>{const X=N.currentTarget.open;r===void 0&&k(X),m==null||m(N)},S=N=>{setTimeout(()=>{p==null||p(N)},0)},O=["pkt-accordion-item",n&&"pkt-accordion-item--compact",i&&`pkt-accordion-item--${i}`,d].filter(Boolean).join(" ");return o.jsxs("details",{ref:b,className:O,id:e,open:T,onClick:S,name:$,onToggle:M,children:[o.jsxs("summary",{className:"pkt-accordion-item__title",id:`pkt-accordion-item-summary-${e}`,children:[t,o.jsx(Y,{name:"chevron-thin-down",className:"pkt-accordion-item__icon","aria-hidden":"true"})]}),o.jsx("div",{className:"pkt-accordion-item__content",id:`pkt-accordion-item__content-${e}`,role:"region",children:o.jsx("div",{className:"pkt-accordion-item__content-inner",children:a})})]})});Ea.displayName="PktAccordionItem";function Sh(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Yn={exports:{}};/*!
1690
1690
  Copyright (c) 2018 Jed Watson.
1691
1691
  Licensed under the MIT License (MIT), see
1692
1692
  http://jedwatson.github.io/classnames
1693
- */var Pa;function Ch(){return Pa||(Pa=1,(function(s){(function(){var e={}.hasOwnProperty;function t(){for(var r="",a=0;a<arguments.length;a++){var l=arguments[a];l&&(r=n(r,i(l)))}return r}function i(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var a="";for(var l in r)e.call(r,l)&&r[l]&&(a=n(a,l));return a}function n(r,a){return a?r?r+" "+a:r+a:r}s.exports?(t.default=t,s.exports=t):window.classNames=t})()})(Yn)),Yn.exports}var Th=Ch();const oe=Sh(Th),rn=({children:s,closeAlert:e,compact:t,title:i,date:n,ariaLive:r,"aria-live":a="polite",role:l="status",skin:d="info",className:p,...m})=>{const[v,y]=h.useState(!1),k={"pkt-alert":!0,"pkt-alert--compact":t,[`pkt-alert--${d}`]:d,"pkt-hide":v},g={"pkt-alert__grid":!0,"pkt-alert__noTitle":!i,"pkt-alert__noDate":!n},$=h.useCallback(()=>{y(!0),m.onClose&&m.onClose(new CustomEvent("close",{detail:{origin:event},bubbles:!0,composed:!0}))},[m.onClose,y]),T=r||a;return o.jsx("div",{...m,"aria-live":T,role:l,className:oe(k,p),children:o.jsxs("div",{className:oe(g),children:[o.jsx(G,{className:"pkt-alert__icon","aria-hidden":"true",name:d==="info"?"alert-information":`alert-${d}`}),e&&o.jsx("div",{className:"pkt-alert__close",children:o.jsx(at,{tabIndex:0,"aria-label":"close",size:t?"small":"medium",type:"button",skin:"tertiary",iconName:"close",variant:"icon-only",onClick:$,children:o.jsx("span",{className:"sr-only",children:"Lukk"})})}),i&&o.jsx("div",{className:"pkt-alert__title",children:i}),o.jsx("div",{className:"pkt-alert__text",children:s}),n&&o.jsxs("div",{className:"pkt-alert__date",children:["Sist oppdatert: ",n]})]})})};rn.displayName="PktAlert";const Aa=It({tagName:"pkt-backlink",elementClass:Hs,react:h,displayName:"PktBackLink"});Aa.displayName="PktBackLink";const Ia=h.forwardRef(({breadcrumbs:s,navigationType:e,renderLink:t,className:i,...n},r)=>{const a=s,l=a[a.length-2],d=[i,"pkt-breadcrumbs"].filter(Boolean).join(" "),p=t||(e==="router"?({href:m,className:v,children:y,props:k})=>o.jsx(zo.Link,{to:m,className:v,...k,children:y}):({href:m,className:v,children:y,props:k})=>o.jsx("a",{href:m,className:v,...k,children:y}));return o.jsxs("nav",{ref:r,"aria-label":"brødsmulemeny",className:d,children:[o.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:a.map((m,v)=>o.jsx("li",{className:"pkt-breadcrumbs__item",children:v===a.length-1?o.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:o.jsx("span",{className:"pkt-breadcrumbs__text",children:m.text})}):p({href:m.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",children:o.jsxs(o.Fragment,{children:[o.jsx(G,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),o.jsx("span",{className:"pkt-breadcrumbs__text",children:m.text})]}),props:n})},`breadcrumb-${v}`))}),p({href:l.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",children:o.jsxs(o.Fragment,{children:[o.jsx(G,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),o.jsx("span",{className:"pkt-breadcrumbs__text",children:l.text})]}),props:n})]})});Ia.displayName="PktBreadcrumbs",window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/15.4/animations/";const at=h.forwardRef(({children:s,className:e,iconName:t="user",secondIconName:i="user",iconPath:n,secondIconPath:r,size:a="medium",fullWidth:l=!1,fullWidthOnMobile:d=!1,skin:p="primary",type:m="button",variant:v="label-only",state:y,color:k,isLoading:g=void 0,disabled:$=void 0,loadingAnimationPath:T=window.pktAnimationPath,...M},S)=>{const O=[e,"pkt-btn",a&&`pkt-btn--${a}`,l&&"pkt-btn--full",d&&"pkt-btn--full-small",p&&`pkt-btn--${p}`,v&&`pkt-btn--${v}`,k&&`pkt-btn--${k}`,y&&`pkt-btn--${y}`,g&&"pkt-btn--isLoading"].filter(Boolean).join(" ");return o.jsxs("button",{...M,"aria-busy":g||void 0,"aria-disabled":$||void 0,disabled:$,className:O,type:m,ref:S,children:[g&&o.jsx(G,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:T}),v!=="label-only"&&o.jsx(G,{className:"pkt-btn__icon",name:t,...n&&{path:n}}),o.jsx("span",{className:"pkt-btn__text",children:s}),v==="icons-right-and-left"&&o.jsx(G,{className:"pkt-btn__icon",name:i,...r&&{path:r}})]})});at.displayName="PktButton";const La=6048e5,Nh=864e5,Ba=Symbol.for("constructDateFrom");function jt(s,e){return typeof s=="function"?s(e):s&&typeof s=="object"&&Ba in s?s[Ba](e):s instanceof Date?new s.constructor(e):new Date(e)}function kt(s,e){return jt(e||s,s)}function Fa(s,e,t){const i=kt(s,t==null?void 0:t.in);return isNaN(e)?jt(s,NaN):(e&&i.setDate(i.getDate()+e),i)}let Mh={};function an(){return Mh}function Ti(s,e){var l,d,p,m;const t=an(),i=(e==null?void 0:e.weekStartsOn)??((d=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:d.weekStartsOn)??t.weekStartsOn??((m=(p=t.locale)==null?void 0:p.options)==null?void 0:m.weekStartsOn)??0,n=kt(s,e==null?void 0:e.in),r=n.getDay(),a=(r<i?7:0)+r-i;return n.setDate(n.getDate()-a),n.setHours(0,0,0,0),n}function on(s,e){return Ti(s,{...e,weekStartsOn:1})}function Ha(s,e){const t=kt(s,e==null?void 0:e.in),i=t.getFullYear(),n=jt(t,0);n.setFullYear(i+1,0,4),n.setHours(0,0,0,0);const r=on(n),a=jt(t,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=on(a);return t.getTime()>=r.getTime()?i+1:t.getTime()>=l.getTime()?i:i-1}function Va(s){const e=kt(s),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+s-+t}function Ua(s,...e){const t=jt.bind(null,e.find(i=>typeof i=="object"));return e.map(t)}function Kn(s,e){const t=kt(s,e==null?void 0:e.in);return t.setHours(0,0,0,0),t}function Dh(s,e,t){const[i,n]=Ua(t==null?void 0:t.in,s,e),r=Kn(i),a=Kn(n),l=+r-Va(r),d=+a-Va(a);return Math.round((l-d)/Nh)}function Oh(s,e){const t=Ha(s,e),i=jt(s,0);return i.setFullYear(t,0,4),i.setHours(0,0,0,0),on(i)}function Eh(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function Ph(s){return!(!Eh(s)&&typeof s!="number"||isNaN(+kt(s)))}function Ah(s,e){const t=kt(s,e==null?void 0:e.in);return t.setHours(23,59,59,999),t}function Ih(s,e){const[t,i]=Ua(s,e.start,e.end);return{start:t,end:i}}function ja(s,e){const{start:t,end:i}=Ih(e==null?void 0:e.in,s);let n=+t>+i;const r=n?+t:+i,a=n?i:t;a.setHours(0,0,0,0);let l=1;const d=[];for(;+a<=r;)d.push(jt(t,a)),a.setDate(a.getDate()+l),a.setHours(0,0,0,0);return n?d.reverse():d}function Lh(s,e){const t=kt(s,e==null?void 0:e.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}const Bh={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Fh=(s,e,t)=>{let i;const n=Bh[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+i:i+" ago":i};function Gn(s){return(e={})=>{const t=e.width?String(e.width):s.defaultWidth;return s.formats[t]||s.formats[s.defaultWidth]}}const Hh={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Vh={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Uh={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},jh={date:Gn({formats:Hh,defaultWidth:"full"}),time:Gn({formats:Vh,defaultWidth:"full"}),dateTime:Gn({formats:Uh,defaultWidth:"full"})},qh={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Wh=(s,e,t,i)=>qh[s];function Ni(s){return(e,t)=>{const i=t!=null&&t.context?String(t.context):"standalone";let n;if(i==="formatting"&&s.formattingValues){const a=s.defaultFormattingWidth||s.defaultWidth,l=t!=null&&t.width?String(t.width):a;n=s.formattingValues[l]||s.formattingValues[a]}else{const a=s.defaultWidth,l=t!=null&&t.width?String(t.width):s.defaultWidth;n=s.values[l]||s.values[a]}const r=s.argumentCallback?s.argumentCallback(e):e;return n[r]}}const zh={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Yh={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Kh={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Gh={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Xh={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Qh={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Zh={ordinalNumber:(s,e)=>{const t=Number(s),i=t%100;if(i>20||i<10)switch(i%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},era:Ni({values:zh,defaultWidth:"wide"}),quarter:Ni({values:Yh,defaultWidth:"wide",argumentCallback:s=>s-1}),month:Ni({values:Kh,defaultWidth:"wide"}),day:Ni({values:Gh,defaultWidth:"wide"}),dayPeriod:Ni({values:Xh,defaultWidth:"wide",formattingValues:Qh,defaultFormattingWidth:"wide"})};function Mi(s){return(e,t={})=>{const i=t.width,n=i&&s.matchPatterns[i]||s.matchPatterns[s.defaultMatchWidth],r=e.match(n);if(!r)return null;const a=r[0],l=i&&s.parsePatterns[i]||s.parsePatterns[s.defaultParseWidth],d=Array.isArray(l)?Rh(l,v=>v.test(a)):Jh(l,v=>v.test(a));let p;p=s.valueCallback?s.valueCallback(d):d,p=t.valueCallback?t.valueCallback(p):p;const m=e.slice(a.length);return{value:p,rest:m}}}function Jh(s,e){for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t)&&e(s[t]))return t}function Rh(s,e){for(let t=0;t<s.length;t++)if(e(s[t]))return t}function ep(s){return(e,t={})=>{const i=e.match(s.matchPattern);if(!i)return null;const n=i[0],r=e.match(s.parsePattern);if(!r)return null;let a=s.valueCallback?s.valueCallback(r[0]):r[0];a=t.valueCallback?t.valueCallback(a):a;const l=e.slice(n.length);return{value:a,rest:l}}}const tp=/^(\d+)(th|st|nd|rd)?/i,sp=/\d+/i,ip={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},np={any:[/^b/i,/^(a|c)/i]},rp={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ap={any:[/1/i,/2/i,/3/i,/4/i]},op={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},lp={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},cp={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},dp={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},up={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},hp={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},pp={ordinalNumber:ep({matchPattern:tp,parsePattern:sp,valueCallback:s=>parseInt(s,10)}),era:Mi({matchPatterns:ip,defaultMatchWidth:"wide",parsePatterns:np,defaultParseWidth:"any"}),quarter:Mi({matchPatterns:rp,defaultMatchWidth:"wide",parsePatterns:ap,defaultParseWidth:"any",valueCallback:s=>s+1}),month:Mi({matchPatterns:op,defaultMatchWidth:"wide",parsePatterns:lp,defaultParseWidth:"any"}),day:Mi({matchPatterns:cp,defaultMatchWidth:"wide",parsePatterns:dp,defaultParseWidth:"any"}),dayPeriod:Mi({matchPatterns:up,defaultMatchWidth:"any",parsePatterns:hp,defaultParseWidth:"any"})},fp={code:"en-US",formatDistance:Fh,formatLong:jh,formatRelative:Wh,localize:Zh,match:pp,options:{weekStartsOn:0,firstWeekContainsDate:1}};function mp(s,e){const t=kt(s,e==null?void 0:e.in);return Dh(t,Lh(t))+1}function gp(s,e){const t=kt(s,e==null?void 0:e.in),i=+on(t)-+Oh(t);return Math.round(i/La)+1}function qa(s,e){var m,v,y,k;const t=kt(s,e==null?void 0:e.in),i=t.getFullYear(),n=an(),r=(e==null?void 0:e.firstWeekContainsDate)??((v=(m=e==null?void 0:e.locale)==null?void 0:m.options)==null?void 0:v.firstWeekContainsDate)??n.firstWeekContainsDate??((k=(y=n.locale)==null?void 0:y.options)==null?void 0:k.firstWeekContainsDate)??1,a=jt((e==null?void 0:e.in)||s,0);a.setFullYear(i+1,0,r),a.setHours(0,0,0,0);const l=Ti(a,e),d=jt((e==null?void 0:e.in)||s,0);d.setFullYear(i,0,r),d.setHours(0,0,0,0);const p=Ti(d,e);return+t>=+l?i+1:+t>=+p?i:i-1}function vp(s,e){var l,d,p,m;const t=an(),i=(e==null?void 0:e.firstWeekContainsDate)??((d=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:d.firstWeekContainsDate)??t.firstWeekContainsDate??((m=(p=t.locale)==null?void 0:p.options)==null?void 0:m.firstWeekContainsDate)??1,n=qa(s,e),r=jt((e==null?void 0:e.in)||s,0);return r.setFullYear(n,0,i),r.setHours(0,0,0,0),Ti(r,e)}function Wa(s,e){const t=kt(s,e==null?void 0:e.in),i=+Ti(t,e)-+vp(t,e);return Math.round(i/La)+1}function me(s,e){const t=s<0?"-":"",i=Math.abs(s).toString().padStart(e,"0");return t+i}const as={y(s,e){const t=s.getFullYear(),i=t>0?t:1-t;return me(e==="yy"?i%100:i,e.length)},M(s,e){const t=s.getMonth();return e==="M"?String(t+1):me(t+1,2)},d(s,e){return me(s.getDate(),e.length)},a(s,e){const t=s.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(s,e){return me(s.getHours()%12||12,e.length)},H(s,e){return me(s.getHours(),e.length)},m(s,e){return me(s.getMinutes(),e.length)},s(s,e){return me(s.getSeconds(),e.length)},S(s,e){const t=e.length,i=s.getMilliseconds(),n=Math.trunc(i*Math.pow(10,t-3));return me(n,e.length)}},Zs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},za={G:function(s,e,t){const i=s.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(i,{width:"abbreviated"});case"GGGGG":return t.era(i,{width:"narrow"});case"GGGG":default:return t.era(i,{width:"wide"})}},y:function(s,e,t){if(e==="yo"){const i=s.getFullYear(),n=i>0?i:1-i;return t.ordinalNumber(n,{unit:"year"})}return as.y(s,e)},Y:function(s,e,t,i){const n=qa(s,i),r=n>0?n:1-n;if(e==="YY"){const a=r%100;return me(a,2)}return e==="Yo"?t.ordinalNumber(r,{unit:"year"}):me(r,e.length)},R:function(s,e){const t=Ha(s);return me(t,e.length)},u:function(s,e){const t=s.getFullYear();return me(t,e.length)},Q:function(s,e,t){const i=Math.ceil((s.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return me(i,2);case"Qo":return t.ordinalNumber(i,{unit:"quarter"});case"QQQ":return t.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(i,{width:"wide",context:"formatting"})}},q:function(s,e,t){const i=Math.ceil((s.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return me(i,2);case"qo":return t.ordinalNumber(i,{unit:"quarter"});case"qqq":return t.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(i,{width:"wide",context:"standalone"})}},M:function(s,e,t){const i=s.getMonth();switch(e){case"M":case"MM":return as.M(s,e);case"Mo":return t.ordinalNumber(i+1,{unit:"month"});case"MMM":return t.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(i,{width:"wide",context:"formatting"})}},L:function(s,e,t){const i=s.getMonth();switch(e){case"L":return String(i+1);case"LL":return me(i+1,2);case"Lo":return t.ordinalNumber(i+1,{unit:"month"});case"LLL":return t.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(i,{width:"wide",context:"standalone"})}},w:function(s,e,t,i){const n=Wa(s,i);return e==="wo"?t.ordinalNumber(n,{unit:"week"}):me(n,e.length)},I:function(s,e,t){const i=gp(s);return e==="Io"?t.ordinalNumber(i,{unit:"week"}):me(i,e.length)},d:function(s,e,t){return e==="do"?t.ordinalNumber(s.getDate(),{unit:"date"}):as.d(s,e)},D:function(s,e,t){const i=mp(s);return e==="Do"?t.ordinalNumber(i,{unit:"dayOfYear"}):me(i,e.length)},E:function(s,e,t){const i=s.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(i,{width:"short",context:"formatting"});case"EEEE":default:return t.day(i,{width:"wide",context:"formatting"})}},e:function(s,e,t,i){const n=s.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return me(r,2);case"eo":return t.ordinalNumber(r,{unit:"day"});case"eee":return t.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(n,{width:"short",context:"formatting"});case"eeee":default:return t.day(n,{width:"wide",context:"formatting"})}},c:function(s,e,t,i){const n=s.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return me(r,e.length);case"co":return t.ordinalNumber(r,{unit:"day"});case"ccc":return t.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(n,{width:"narrow",context:"standalone"});case"cccccc":return t.day(n,{width:"short",context:"standalone"});case"cccc":default:return t.day(n,{width:"wide",context:"standalone"})}},i:function(s,e,t){const i=s.getDay(),n=i===0?7:i;switch(e){case"i":return String(n);case"ii":return me(n,e.length);case"io":return t.ordinalNumber(n,{unit:"day"});case"iii":return t.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(i,{width:"short",context:"formatting"});case"iiii":default:return t.day(i,{width:"wide",context:"formatting"})}},a:function(s,e,t){const n=s.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(s,e,t){const i=s.getHours();let n;switch(i===12?n=Zs.noon:i===0?n=Zs.midnight:n=i/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(s,e,t){const i=s.getHours();let n;switch(i>=17?n=Zs.evening:i>=12?n=Zs.afternoon:i>=4?n=Zs.morning:n=Zs.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(s,e,t){if(e==="ho"){let i=s.getHours()%12;return i===0&&(i=12),t.ordinalNumber(i,{unit:"hour"})}return as.h(s,e)},H:function(s,e,t){return e==="Ho"?t.ordinalNumber(s.getHours(),{unit:"hour"}):as.H(s,e)},K:function(s,e,t){const i=s.getHours()%12;return e==="Ko"?t.ordinalNumber(i,{unit:"hour"}):me(i,e.length)},k:function(s,e,t){let i=s.getHours();return i===0&&(i=24),e==="ko"?t.ordinalNumber(i,{unit:"hour"}):me(i,e.length)},m:function(s,e,t){return e==="mo"?t.ordinalNumber(s.getMinutes(),{unit:"minute"}):as.m(s,e)},s:function(s,e,t){return e==="so"?t.ordinalNumber(s.getSeconds(),{unit:"second"}):as.s(s,e)},S:function(s,e){return as.S(s,e)},X:function(s,e,t){const i=s.getTimezoneOffset();if(i===0)return"Z";switch(e){case"X":return Ka(i);case"XXXX":case"XX":return Ms(i);case"XXXXX":case"XXX":default:return Ms(i,":")}},x:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"x":return Ka(i);case"xxxx":case"xx":return Ms(i);case"xxxxx":case"xxx":default:return Ms(i,":")}},O:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Ya(i,":");case"OOOO":default:return"GMT"+Ms(i,":")}},z:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Ya(i,":");case"zzzz":default:return"GMT"+Ms(i,":")}},t:function(s,e,t){const i=Math.trunc(+s/1e3);return me(i,e.length)},T:function(s,e,t){return me(+s,e.length)}};function Ya(s,e=""){const t=s>0?"-":"+",i=Math.abs(s),n=Math.trunc(i/60),r=i%60;return r===0?t+String(n):t+String(n)+e+me(r,2)}function Ka(s,e){return s%60===0?(s>0?"-":"+")+me(Math.abs(s)/60,2):Ms(s,e)}function Ms(s,e=""){const t=s>0?"-":"+",i=Math.abs(s),n=me(Math.trunc(i/60),2),r=me(i%60,2);return t+n+e+r}const Ga=(s,e)=>{switch(s){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Xa=(s,e)=>{switch(s){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},bp={p:Xa,P:(s,e)=>{const t=s.match(/(P+)(p+)?/)||[],i=t[1],n=t[2];if(!n)return Ga(s,e);let r;switch(i){case"P":r=e.dateTime({width:"short"});break;case"PP":r=e.dateTime({width:"medium"});break;case"PPP":r=e.dateTime({width:"long"});break;case"PPPP":default:r=e.dateTime({width:"full"});break}return r.replace("{{date}}",Ga(i,e)).replace("{{time}}",Xa(n,e))}},yp=/^D+$/,kp=/^Y+$/,_p=["D","DD","YY","YYYY"];function $p(s){return yp.test(s)}function wp(s){return kp.test(s)}function xp(s,e,t){const i=Sp(s,e,t);if(console.warn(i),_p.includes(s))throw new RangeError(i)}function Sp(s,e,t){const i=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${e}\`) for formatting ${i} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Cp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Tp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Np=/^'([^]*?)'?$/,Mp=/''/g,Dp=/[a-zA-Z]/;function Op(s,e,t){var m,v,y,k;const i=an(),n=i.locale??fp,r=i.firstWeekContainsDate??((v=(m=i.locale)==null?void 0:m.options)==null?void 0:v.firstWeekContainsDate)??1,a=i.weekStartsOn??((k=(y=i.locale)==null?void 0:y.options)==null?void 0:k.weekStartsOn)??0,l=kt(s,t==null?void 0:t.in);if(!Ph(l))throw new RangeError("Invalid time value");let d=e.match(Tp).map(g=>{const $=g[0];if($==="p"||$==="P"){const T=bp[$];return T(g,n.formatLong)}return g}).join("").match(Cp).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const $=g[0];if($==="'")return{isToken:!1,value:Ep(g)};if(za[$])return{isToken:!0,value:g};if($.match(Dp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+$+"`");return{isToken:!1,value:g}});n.localize.preprocessor&&(d=n.localize.preprocessor(l,d));const p={firstWeekContainsDate:r,weekStartsOn:a,locale:n};return d.map(g=>{if(!g.isToken)return g.value;const $=g.value;(wp($)||$p($))&&xp($,e,String(s));const T=za[$[0]];return T(l,$,n.localize,p)}).join("")}function Ep(s){const e=s.match(Np);return e?e[1].replace(Mp,"'"):s}function Pp(s,e){const t=kt(s,e==null?void 0:e.in).getDay();return t===0?7:t}function Ap(s,e,t="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:s,timeZoneName:t}).format(e).split(/\s/g).slice(2).join(" ")}const Xn={},Di={};function Ds(s,e){try{const i=(Xn[s]||(Xn[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(e).split("GMT")[1];return i in Di?Di[i]:Qa(i,i.split(":"))}catch{if(s in Di)return Di[s];const t=s==null?void 0:s.match(Ip);return t?Qa(s,t.slice(1)):NaN}}const Ip=/([+-]\d\d):?(\d\d)?/;function Qa(s,e){const t=+(e[0]||0),i=+(e[1]||0),n=+(e[2]||0)/60;return Di[s]=t*60+i>0?t*60+i+n:t*60-i-n}class qt extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Ds(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),Ja(this),Qn(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new qt(...t,e):new qt(Date.now(),e)}withTimeZone(e){return new qt(+this,e)}getTimezoneOffset(){const e=-Ds(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Qn(this),+this}[Symbol.for("constructDateFrom")](e){return new qt(+new Date(e),this.timeZone)}}const Za=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!Za.test(s))return;const e=s.replace(Za,"$1UTC");qt.prototype[e]&&(s.startsWith("get")?qt.prototype[s]=function(){return this.internal[e]()}:(qt.prototype[s]=function(){return Date.prototype[e].apply(this.internal,arguments),Lp(this),+this},qt.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),Qn(this),+this}))});function Qn(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-Ds(s.timeZone,s)*60))}function Lp(s){Date.prototype.setFullYear.call(s,s.internal.getUTCFullYear(),s.internal.getUTCMonth(),s.internal.getUTCDate()),Date.prototype.setHours.call(s,s.internal.getUTCHours(),s.internal.getUTCMinutes(),s.internal.getUTCSeconds(),s.internal.getUTCMilliseconds()),Ja(s)}function Ja(s){const e=Ds(s.timeZone,s),t=e>0?Math.floor(e):Math.ceil(e),i=new Date(+s);i.setUTCHours(i.getUTCHours()-1);const n=-new Date(+s).getTimezoneOffset(),r=-new Date(+i).getTimezoneOffset(),a=n-r,l=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();a&&l&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+a);const d=n-t;d&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+d);const p=new Date(+s);p.setUTCSeconds(0);const m=n>0?p.getSeconds():(p.getSeconds()-60)%60,v=Math.round(-(Ds(s.timeZone,s)*60))%60;(v||m)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+v),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+v+m));const y=Ds(s.timeZone,s),k=y>0?Math.floor(y):Math.ceil(y),$=-new Date(+s).getTimezoneOffset()-k,T=k!==t,M=$-d;if(T&&M){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+M);const S=Ds(s.timeZone,s),O=S>0?Math.floor(S):Math.ceil(S),N=k-O;N&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+N),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+N))}}class os extends qt{static tz(e,...t){return t.length?new os(...t,e):new os(Date.now(),e)}toISOString(){const[e,t,i]=this.tzComponents(),n=`${e}${t}:${i}`;return this.internal.toISOString().slice(0,-1)+n}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,i,n]=this.internal.toUTCString().split(" ");return`${e==null?void 0:e.slice(0,-1)} ${i} ${t} ${n}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,i,n]=this.tzComponents();return`${e} GMT${t}${i}${n} (${Ap(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),t=e>0?"-":"+",i=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),n=String(Math.abs(e)%60).padStart(2,"0");return[t,i,n]}withTimeZone(e){return new os(+this,e)}[Symbol.for("constructDateFrom")](e){return new os(+new Date(e),this.timeZone)}}window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const Bp=(s=window.pktTz)=>{const e=new os(new Date().toISOString(),s);return e.setHours(0,0,0,0),isNaN(e.getTime())?new Date:new Date(e.getFullYear(),e.getMonth(),e.getDate())};function Wt(s){if(!s||s==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[e,t,i]=s.split("-").map(Number);return new Date(e,t-1,i)}if(/^\d{4}-\d{2}$/.test(s)){const[e,t]=s.split("-").map(Number);return new Date(e,t-1,1)}return/^\d{4}$/.test(s)?new Date(Number(s),0,1):new Date(s)}const ot=s=>{if(!s||isNaN(s.getTime()))return"";const e=s.getFullYear(),t=String(s.getMonth()+1).padStart(2,"0"),i=String(s.getDate()).padStart(2,"0");return`${e}-${t}-${i}`},Oi=s=>{if(!s)return null;const e=Wt(s);return isNaN(e.getTime())?null:e},Fp=(s,e)=>{const t=Qt(s);return isNaN(t.getTime())?"":Op(t,e)},Qt=(s="",e)=>{const t=typeof s=="string"?Wt(s):s;return!t||isNaN(t.getTime())?new Date:e?e==="end"?Ah(t):Kn(t):t},Js=(s,e,t=1)=>{if(typeof s!="number"||typeof e!="number"||typeof t!="number"||isNaN(s)||isNaN(e)||isNaN(t))return new Date;const i=new Date(s,e,t);return isNaN(i.getTime())?new Date:i},Ei=s=>{let e;return typeof s=="number"?e=new os(s,window.pktTz):e=new os(s,window.pktTz),e.setHours(12,0,0,0),e};let Zn=null,Ra;const Hp=s=>{if(!s||isNaN(s.getTime()))return"";const e=typeof window<"u"?window.pktTz:void 0;return(!Zn||Ra!==e)&&(Zn=new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:e}),Ra=e),Zn.format(s)},Vp=(s,e,t)=>{if(!s||isNaN(s.getTime()))return!1;const i=e?Qt(e):null,n=t?Qt(t):null;return!(i&&s<i||n&&s>n)},Up=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=ot(s);return e.includes(t)},jp=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=s.getDay().toString();return e.includes(t)},eo=(s,e,t,i,n)=>!(!s||isNaN(s.getTime())||!Vp(s,e,t)||i&&Up(s,i)||n&&jp(s,n)),qp=(s,e,t,i,n)=>s.filter(r=>{const a=Oi(r);return a&&eo(a,e,t,i,n)}),Wp=s=>s.slice().sort((e,t)=>{const i=Oi(e),n=Oi(t);return!i||!n?0:i.getTime()-n.getTime()}),zp=(s,e)=>{const t=Oi(s),i=Oi(e);return!t||!i?!1:t<=i};function to(s,e){const t=(e.excludedates??[]).map(i=>typeof i=="string"?i:ot(i));return!eo(s,e.earliest,e.latest,t,e.excludeweekdays??[])}function Yp(s,e,t,i){return!!(to(s,t)||!e&&i.multiple&&i.maxMultiple>0&&i.selectedCount>=i.maxMultiple)}function Kp(s,e,t){const i=Js(s,e,0);return!(t&&Qt(t)>i)}function Gp(s,e,t){const i=Js(e===11?s+1:s,e===11?0:e+1,1);return!(t&&Qt(t)<i)}function so(s){return typeof s=="string"&&(s=s.split(",")),s.length===1&&s[0]===""?[]:s.map(e=>Wt(e))}function io(s,e){const t=ja({start:s,end:e}),i={};if(Array.isArray(t)&&t.length)for(let n=0;n<t.length;n++){const r=t[n],a=r>s&&r<e;i[ot(r)]=a}return i}function no(s,e,t,i){if(e.length!==1)return!0;const n=ja({start:e[0],end:s});if(!Array.isArray(n)||!n.length)return!0;for(let r=0;r<n.length;r++){for(const a of t??[])if(a>e[0]&&a<s)return!1;if((i??[]).includes(Pp(n[r]).toString()))return!1}return!0}function Jn(s,e){const t=ot(s);return e.includes(t)?e:[...e,t]}function Rn(s,e){const t=ot(s),i=e.indexOf(t);if(i===-1)return e;if(e.length===1)return[];const n=[...e];return n.splice(i,1),n}function ro(s,e,t){const i=ot(s);return e.includes(i)?Rn(s,e):t>0&&e.length>=t?e:Jn(s,e)}function Xp(s,e,t){const i=ot(s),n=so(e);if(e.includes(i))return e.indexOf(i)===0?[]:Rn(s,e);if(e.length>1)return[i];if(e.length===1){if(!no(s,n,t.excludedates,t.excludeweekdays))return[i];if(n[0]>s)return[i]}return Jn(s,e)}const Pi=7,Qp=6;function Zp(s,e){const t=Js(s,e,1),i=Js(s,e+1,0),n=(t.getDay()+Qp)%Pi,r=i.getDate(),a=Math.ceil((r+n)/Pi),d=Js(s,e,0).getDate(),p=Wa(t);return{firstDayOfMonth:t,lastDayOfMonth:i,startingDay:n,numDays:r,numRows:a,numDaysPrevMonth:d,initialWeek:p}}function Jp(s,e,t,i){const{startingDay:n,numDays:r}=i;return s===0&&e<n?"prev-month":t>r?"next-month":"current-month"}function Rp(s,e,t,i){const{startingDay:n,numDaysPrevMonth:r,numDays:a}=i;return s==="prev-month"?r-(n-e-1):s==="next-month"?t-a:t}const ef={ArrowLeft:-1,ArrowRight:1,ArrowUp:-Pi,ArrowDown:Pi};function tf(s){var t;const e=s.nodeName;return e==="INPUT"||e==="SELECT"||e==="BUTTON"&&!((t=s.dataset)!=null&&t.date)}function sf(s,e,t){let i=Fa(s,e);if(!i)return null;let n=t(`button[data-date="${ot(i)}"]`);for(;n instanceof HTMLButtonElement&&n.dataset.disabled;)if(i=Fa(i,e),n=t(`button[data-date="${ot(i)}"]`),!n)return null;return i}function nf(s){return ef[s]??null}const rf={month:"Måned",year:"År",days:["Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Man","Tir","Ons","Tor","Fre","Lør","Søn"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],week:"Uke",prevMonth:"Forrige måned",nextMonth:"Neste måned"};function af(s){const{selected:e,multiple:t=!1,maxMultiple:i=0,range:n=!1,earliest:r=null,latest:a=null,excludedates:l,excludeweekdays:d=[],weeknumbers:p=!1,withcontrols:m=!1,currentmonth:v,today:y,strings:k,onDateSelected:g,onClose:$,id:T,className:M}=s,S=h.useId(),O=T??S,N=h.useMemo(()=>({...rf,...k}),[k]),U=h.useMemo(()=>y?Wt(y):Bp(),[y]),X=h.useMemo(()=>l?l.map(f=>typeof f=="string"?Wt(f):f):[],[l]),te=e!==void 0,[$e,q]=h.useState([]),C=te?e:$e,H=h.useMemo(()=>so(C),[C]),[W,Q]=h.useState(0),[se,ie]=h.useState(0),[ue,ne]=h.useState({}),[ge,Y]=h.useState(null),[K,Ae]=h.useState(null),re=h.useRef(null),ae=h.useRef([]),Re=h.useRef(0),Ve=h.useRef(!1),Se=h.useRef(!1),Ke=h.useMemo(()=>({earliest:r,latest:a,excludedates:X,excludeweekdays:d}),[r,a,X,d]);h.useEffect(()=>{let f=null;if(v!=null&&(v instanceof Date?f=Ei(v):typeof v=="string"&&(f=Wt(v))),!f||isNaN(f.getTime()))if(C.length>0&&C[0]!==""){const u=Wt(C[C.length-1]);f=isNaN(u.getTime())?Ei(U):u}else f=Ei(U);if((!f||isNaN(f.getTime()))&&(f=Ei(U)),a){const u=typeof a=="string"?Wt(a):a;!isNaN(u.getTime())&&f>u&&(f=u)}if(r){const u=typeof r=="string"?Wt(r):r;!isNaN(u.getTime())&&f<u&&(f=u)}Q(f.getFullYear()),ie(f.getMonth()),Se.current=!0},[]),h.useEffect(()=>{if(Se.current&&!Ve.current&&C.length>0&&C[0]!==""){const f=Wt(C[C.length-1]);isNaN(f.getTime())||(Q(f.getFullYear()),ie(f.getMonth()))}},[C]),h.useEffect(()=>{n&&H.length===2?ne(io(H[0],H[1])):(!n||H.length<2)&&ne({})},[n,H]);const lt=h.useCallback(f=>{te||q(f),g==null||g(f)},[te,g]),we=h.useCallback(()=>{$==null||$()},[$]),Ne=h.useCallback((f,u)=>{Q(typeof f=="string"?parseInt(f):f),ie(typeof u=="string"?parseInt(u):u),Re.current=0,Ae(null),ae.current=[],Ve.current=!0},[]),Ge=h.useCallback(()=>{const f=se===0?11:se-1,u=se===0?W-1:W;Ne(u,f)},[W,se,Ne]),Xe=h.useCallback(()=>{const f=se===11?0:se+1,u=se===11?W+1:W;Ne(u,f)},[W,se,Ne]),et=h.useCallback(f=>to(f,Ke),[Ke]),ce=h.useCallback((f,u)=>Yp(f,u,Ke,{multiple:t,maxMultiple:i,selectedCount:C.length}),[Ke,t,i,C.length]),be=h.useCallback(()=>typeof C=="string"?C.split(","):C,[C]),Ie=h.useCallback(f=>{if(!n||H.length!==1||!no(f,H,X,d)||H[0]>=f){Y(null);return}Y(f),ne(io(H[0],f))},[n,H,X,d]),Me=h.useCallback(f=>{if(!f)return;let u;if(n)u=Xp(f,be(),{excludedates:X,excludeweekdays:d}),te||q(u),u.length===2?(g==null||g(u),we()):(u.length===1&&ne({}),g==null||g(u));else if(t)u=ro(f,be(),i),lt(u);else{const _=ot(f);C.includes(_)?u=[]:u=[_],lt(u),we()}},[n,t,i,be,C,X,d,te,lt,we,g]),xe=h.useCallback(f=>{const u=Jn(f,be());te||q(u),n&&u.length===2&&(g==null||g(u),we())},[be,te,n,g,we]),V=h.useCallback(f=>{const u=Rn(f,be());te||q(u)},[be,te]),De=h.useCallback(f=>{const u=ro(f,be(),i);te||q(u)},[be,i,te]),he=h.useCallback(()=>{var x,L;const f=ot(Ei(U)),u=(x=re.current)==null?void 0:x.querySelector(`button[data-date="${f}"]`);if(u instanceof HTMLButtonElement){Ae(f),u.focus();return}const _=ae.current.find(j=>!j.isDisabled);if(_){const j=(L=re.current)==null?void 0:L.querySelector(`button[data-date="${_.currentDateISO}"]`);j instanceof HTMLButtonElement&&(Ae(_.currentDateISO),j.focus())}},[]),ye=h.useCallback((f,u)=>{const _=f.target;if(tf(_))return;if(f.preventDefault(),!K){he();return}const x=Qt(K),L=sf(x,u,re.current.querySelector.bind(re.current));if(L){const j=re.current.querySelector(`button[data-date="${ot(L)}"]`);j instanceof HTMLButtonElement&&!j.dataset.disabled&&(Ae(ot(L)),j.focus())}},[K,he]),Ue=h.useCallback(f=>{if(f.key==="Escape"){f.preventDefault(),we();return}const u=nf(f.key);u!==null&&ye(f.nativeEvent,u)},[we,ye]),ct=h.useCallback(f=>{re.current&&!re.current.contains(f.relatedTarget)&&!f.target.classList.contains("pkt-hide")&&we()},[we]);return{componentId:O,strings:N,todayDate:U,year:W,month:se,activeSelected:C,_selected:H,inRange:ue,rangeHovered:ge,focusedDate:K,range:n,multiple:t,weeknumbers:p,withcontrols:m,earliest:r,latest:a,excludedates:X,excludeweekdays:d,className:M,dateConstraints:Ke,calendarRef:re,selectableDatesRef:ae,tabIndexSetRef:Re,prevMonth:Ge,nextMonth:Xe,changeMonth:Ne,handleDateSelect:Me,addToSelected:xe,removeFromSelected:V,toggleSelectedDate:De,handleRangeHover:Ie,isExcluded:et,isDayDisabled:ce,focusOnCurrentDate:he,handleKeydown:Ue,handleFocusOut:ct,close:we,setFocusedDate:Ae}}const of=({componentId:s,strings:e,year:t,month:i,earliest:n,latest:r,withcontrols:a,prevMonth:l,nextMonth:d,changeMonth:p})=>{const m=y=>{const k=y==="prev",g=k?Kp(t,i,n):Gp(t,i,r),$=k?e.prevMonth:e.nextMonth,T=k?"chevron-thin-left":"chevron-thin-right",M=k?"pkt-calendar__prev-month":"pkt-calendar__next-month",S=k?l:d;return o.jsx("div",{children:o.jsxs("button",{type:"button","aria-label":$,onClick:()=>g&&S(),onKeyDown:O=>{(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),g&&S())},className:["pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only",M,!g&&"pkt-invisible"].filter(Boolean).join(" "),"data-disabled":g?void 0:"disabled","aria-disabled":!g||void 0,tabIndex:g?0:-1,children:[o.jsx(G,{className:"pkt-btn__icon",name:T}),o.jsx("span",{className:"pkt-btn__text",children:$})]})})},v=()=>a?o.jsxs("div",{className:"pkt-cal-month-picker",children:[o.jsx("label",{htmlFor:`${s}-monthnav`,className:"pkt-hide",children:e.month}),o.jsx("select",{"aria-label":e.month,className:"pkt-input pkt-input-compact",id:`${s}-monthnav`,value:i,onChange:y=>{y.stopPropagation(),p(t,parseInt(y.target.value))},children:e.months.map((y,k)=>o.jsx("option",{value:k,children:y},k))}),o.jsx("label",{htmlFor:`${s}-yearnav`,className:"pkt-hide",children:e.year}),o.jsx("input",{"aria-label":e.year,className:"pkt-input pkt-cal-input-year pkt-input-compact",id:`${s}-yearnav`,type:"number",size:4,placeholder:"0000",value:t,onChange:y=>{y.stopPropagation(),p(parseInt(y.target.value),i)}})]}):o.jsxs("div",{className:"pkt-txt-16-medium pkt-calendar__month-title","aria-live":"polite",children:[e.months[i]," ",t]});return o.jsxs("nav",{className:"pkt-cal-month-nav",children:[m("prev"),v(),m("next")]})};function lf(s,e,t){const i=Js(t.year,t.month,s),n=ot(i),r=n===ot(e),a=t.activeSelected.includes(n),l=t.isDayDisabled(i,a);let d;return t.focusedDate?d=t.focusedDate===n&&!l?"0":"-1":!l&&t.tabIndexSetRef.current===0?(t.tabIndexSetRef.current=s,d="0"):d=t.tabIndexSetRef.current===s?"0":"-1",{currentDate:i,currentDateISO:n,isToday:r,isSelected:a,isDisabled:l,ariaLabel:Hp(i),tabindex:d}}function cf(s,e){const{currentDateISO:t,isToday:i,isSelected:n}=s,r=e.range&&(e.activeSelected.length===2||e.rangeHovered!==null)&&t===e.activeSelected[0],a=e.range&&e.activeSelected.length===2&&t===e.activeSelected[1];return oe({"pkt-cal-today":i,"pkt-cal-selected":n,"pkt-cal-in-range":e.inRange[t],"pkt-cal-excluded":e.isExcluded(s.currentDate),"pkt-cal-in-range-first":r,"pkt-cal-in-range-last":a,"pkt-cal-range-hover":e.rangeHovered!==null&&t===ot(e.rangeHovered)})}function df(s,e){const{currentDateISO:t,isToday:i,isSelected:n,isDisabled:r}=s,a=e.range&&(e.activeSelected.length===2||e.rangeHovered!==null)&&t===e.activeSelected[0],l=e.range&&e.activeSelected.length===2&&t===e.activeSelected[1];return oe({"pkt-calendar__date":!0,"pkt-calendar__date--today":i,"pkt-calendar__date--selected":n,"pkt-calendar__date--disabled":r,"pkt-calendar__date--in-range":e.inRange[t],"pkt-calendar__date--in-range-hover":e.rangeHovered!==null&&t===ot(e.rangeHovered),"pkt-calendar__date--range-start":a,"pkt-calendar__date--range-end":l})}const uf=({state:s})=>{const{strings:e,year:t,month:i,activeSelected:n,focusedDate:r,inRange:a,rangeHovered:l,range:d,multiple:p,weeknumbers:m,selectableDatesRef:v,tabIndexSetRef:y,handleDateSelect:k,handleRangeHover:g,isExcluded:$,isDayDisabled:T,setFocusedDate:M,todayDate:S}=s,O={year:t,month:i,activeSelected:n,focusedDate:r,tabIndexSetRef:y,isDayDisabled:T},N={range:d,activeSelected:n,rangeHovered:l,inRange:a,isExcluded:$},U=()=>{const q=[];m&&q.push(o.jsx("th",{children:o.jsx("div",{className:"pkt-calendar__week-number",children:e.week})},"week-header"));for(let C=0;C<e.daysShort.length;C++)q.push(o.jsx("th",{children:o.jsx("div",{className:"pkt-calendar__day-name","aria-label":e.days[C],children:e.daysShort[C]})},`day-${C}`));return o.jsx("tr",{className:"pkt-cal-week-row",children:q})},X=(q,C)=>{const H=lf(q,C,O),{currentDate:W,currentDateISO:Q,isSelected:se,isDisabled:ie,ariaLabel:ue,tabindex:ne}=H;v.current.push({currentDateISO:Q,isDisabled:ie,tabindex:ne});const ge=cf(H,N),Y=df(H,N);return o.jsx("td",{className:ge,children:o.jsx("button",{type:"button","aria-pressed":se?"true":"false",disabled:ie,className:`pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${Y}`,onMouseOver:()=>d&&!$(W)&&g(W),onFocus:()=>{d&&!$(W)&&g(W),M(Q)},"aria-label":ue,tabIndex:parseInt(ne),"data-disabled":ie?"disabled":void 0,"data-date":Q,onKeyDown:K=>{(K.key==="Enter"||K.key===" ")&&(K.preventDefault(),k(W))},onClick:K=>{ie||(K.preventDefault(),k(W))},children:o.jsx("span",{className:"pkt-btn__text pkt-txt-14-light",children:q})})},Q)},te=(q,C)=>o.jsx("td",{className:"pkt-cal-other",children:o.jsx("div",{className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only","data-disabled":"disabled",children:o.jsx("span",{className:"pkt-btn__text pkt-txt-14-light",children:q})})},C),$e=()=>{const q=S,C=Zp(t,i);v.current=[],y.current=0;let H=1,W=C.initialWeek;const Q=[];for(let se=0;se<C.numRows;se++){const ie=[];m&&ie.push(o.jsx("td",{className:"pkt-cal-week",children:W},`week-${W}`)),W++;for(let ue=0;ue<Pi;ue++){const ne=Jp(se,ue,H,C);if(ne==="current-month")ie.push(X(H,q)),H++;else{const ge=Rp(ne,ue,H,C);ie.push(te(ge,`${ne}-${se}-${ue}`)),ne==="next-month"&&H++}}Q.push(o.jsx("tr",{className:"pkt-cal-week-row",role:"row",children:ie},`row-${se}`))}return Q};return o.jsxs("table",{className:"pkt-cal-days pkt-txt-12-medium pkt-calendar__body",role:"grid","aria-multiselectable":d||p||void 0,children:[o.jsx("thead",{children:U()}),o.jsx("tbody",{children:$e()})]})},er=h.forwardRef((s,e)=>{const t=af(s);return h.useImperativeHandle(e,()=>({handleDateSelect:t.handleDateSelect,addToSelected:t.addToSelected,removeFromSelected:t.removeFromSelected,toggleSelected:t.toggleSelectedDate,focusOnCurrentDate:t.focusOnCurrentDate,close:t.close}),[t.handleDateSelect,t.addToSelected,t.removeFromSelected,t.toggleSelectedDate,t.focusOnCurrentDate,t.close]),o.jsxs("div",{ref:t.calendarRef,className:["pkt-calendar",t.weeknumbers&&"pkt-cal-weeknumbers",t.className].filter(Boolean).join(" "),onBlur:t.handleFocusOut,onKeyDown:t.handleKeydown,children:[o.jsx(of,{componentId:t.componentId,strings:t.strings,year:t.year,month:t.month,earliest:t.earliest,latest:t.latest,withcontrols:t.withcontrols,prevMonth:t.prevMonth,nextMonth:t.nextMonth,changeMonth:t.changeMonth}),o.jsx(uf,{state:t})]})});er.displayName="PktCalendar";const hf=It({tagName:"pkt-card",elementClass:We,react:h,displayName:"PktCard",events:{}}),ao=h.forwardRef(({children:s,...e},t)=>o.jsx(hf,{...e,ref:t,children:o.jsx("div",{className:"pkt-contents",children:s})}));ao.displayName="PktCard";const oo=h.forwardRef(({id:s,hasTile:e=!1,disabled:t=!1,label:i,checkHelptext:n,hasError:r=!1,className:a,isSwitch:l=!1,hideLabel:d=!1,labelPosition:p="right",defaultChecked:m,checked:v,indeterminate:y,optionalTag:k,optionalText:g="Valgfritt",requiredTag:$,requiredText:T="Må fylles ut",tagText:M,...S},O)=>{const N=h.useRef(null);h.useEffect(()=>{N.current&&y!==void 0&&(N.current.indeterminate=y)},[y]),h.useEffect(()=>{typeof O=="function"?O(N.current):O&&(O.current=N.current)},[O]);const U=[a,"pkt-input-check"].filter(Boolean).join(" "),X=["pkt-input-check__input-label",t?"pkt-input-check__input-label--disabled":"",`pkt-input-check__input-label--${p}`,d?"pkt-sr-only":""].filter(Boolean).join(" "),te=["pkt-input-check__input",e?"pkt-input-check__input--tile":"",t&&e?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),$e=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),q=()=>o.jsxs(o.Fragment,{children:[M&&o.jsx("span",{className:$e+" pkt-tag--gray",children:M}),k&&o.jsx("span",{className:$e+" pkt-tag--blue-light",children:g}),$&&o.jsx("span",{className:$e+" pkt-tag--beige",children:T})]});return o.jsx("div",{className:U,children:o.jsxs("div",{className:te,children:[p==="left"&&o.jsxs("label",{className:X,htmlFor:s,children:[i," ",q(),n&&o.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]}),o.jsx("input",{role:l?"switch":"checkbox",ref:N,className:`pkt-input-check__input-checkbox ${r?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:s,disabled:t,...v!==void 0?{checked:v}:{defaultChecked:m},...S}),p==="right"&&o.jsxs("label",{className:X,htmlFor:s,children:[i," ",q(),n&&o.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]})]})})});oo.displayName="PktCheckbox";const pf=It({tagName:"pkt-combobox",elementClass:Pe,react:h,displayName:"PktCombobox",events:{onClick:"click",onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),lo=h.forwardRef(({children:s,helptext:e,...t},i)=>o.jsxs(pf,{...t,ref:i,children:[e&&o.jsx("div",{slot:"helptext",className:"pkt-contents",children:e}),s]}));lo.displayName="PktCombobox";const ln=It({tagName:"pkt-consent",elementClass:Tt,react:h,displayName:"PktConsent",events:{onToggleConsent:"toggle-consent"}});ln.displayName="PktConsent";const Os=h.forwardRef(({forId:s,label:e,helptext:t,helptextDropdown:i,helptextDropdownButton:n,counter:r,counterCurrent:a=0,counterMaxLength:l,optionalTag:d=!1,optionalText:p="Valgfritt",requiredTag:m=!1,requiredText:v="Må fylles ut",tagText:y=null,hasError:k=!1,errorMessage:g,disabled:$=!1,inline:T=!1,ariaDescribedby:M,useWrapper:S=!0,children:O,className:N="",hasFieldset:U=!1,role:X="group",counterPosition:te="bottom"},$e)=>{const[q,C]=h.useState(!1),H=M||(t?`${s}-helptext`:void 0),W=!!r,Q=W&&te==="top",se=W&&te==="bottom",ie=()=>C(ae=>!ae),ue=["pkt-inputwrapper",N,k?"pkt-inputwrapper--error":"",$?"pkt-inputwrapper--disabled":"",T?"pkt-inputwrapper--inline":""].filter(Boolean).join(" "),ne=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),ge=()=>W?o.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":"true",children:[a,l?`/${l}`:""]}):null,Y=()=>o.jsxs(o.Fragment,{children:[y&&o.jsx("span",{className:ne+" pkt-tag--gray",children:y}),d&&o.jsx("span",{className:ne+" pkt-tag--blue-light",children:p}),m&&o.jsx("span",{className:ne+" pkt-tag--beige",children:v})]}),K=()=>{const ae=o.jsxs(o.Fragment,{children:[e," ",Y()]});return S?U?o.jsx("legend",{className:"pkt-inputwrapper__legend",id:`${s}-label`,children:ae}):o.jsx("label",{className:"pkt-inputwrapper__label",htmlFor:s,"aria-describedby":H,id:`${s}-label`,children:ae}):o.jsx("label",{htmlFor:s,className:"pkt-sr-only","aria-describedby":H,id:`${s}-label`,children:e})},Ae=()=>!t&&!i?null:o.jsxs(o.Fragment,{children:[t&&S&&o.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${s}-helptext`,children:t}),i&&o.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[o.jsx(at,{skin:"tertiary",size:"small",variant:"icon-right",iconName:q?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:ie,children:o.jsx("span",{dangerouslySetInnerHTML:{__html:n??'Les mer <span class="pkt-sr-only">om inputfeltet</span>'}})}),o.jsx("div",{className:`pkt-inputwrapper__helptext ${q?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i})]})]}),re=o.jsxs(o.Fragment,{children:[K(),Ae(),Q&&o.jsx(ge,{}),O,se&&o.jsx(ge,{}),k&&g&&o.jsx("div",{className:"pkt-inputwrapper__alert-wrapper",children:o.jsx(rn,{skin:"error","aria-live":"assertive",role:"alert",id:`${s}-error`,compact:!0,children:g})})]});return o.jsx("div",{className:ue,ref:$e,role:X,children:U?o.jsx("fieldset",{className:"pkt-inputwrapper__fieldset","aria-describedby":H,children:re}):o.jsx("div",{className:"pkt-inputwrapper__fieldset",children:re})})});Os.displayName="PktInputWrapper";const co=()=>{const s=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(s)||/Macintosh/.test(s)&&"ontouchend"in document)},ff=()=>co()?"text":"date",mf=s=>!s||s.length!==2?!0:zp(s[0],s[1]),gf=(s,e,t,i,n,r)=>({"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":s,"pkt-datepicker--hasrangelabels":e,"pkt-datepicker--multiple":t,"pkt-datepicker--range":i,"ios-readonly-hack":n===!1&&r==="text"}),vf=()=>({"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}),bf=s=>({"pkt-input-prefix":s,"pkt-hide":!s}),yf=(s,e,t)=>!e&&!t?Array.isArray(s)?s[0]||"":s:Array.isArray(s)?s.join(","):s,kf=(s,e,t=!1)=>{var l;if(!s||!e)return;const i=((l=e.parentElement)==null?void 0:l.getBoundingClientRect())||e.getBoundingClientRect(),n=t?i.height+30:i.height,r=s.getBoundingClientRect().height;let a=t?"calc(100% - 30px)":"100%";i&&i.top+r>window.innerHeight&&i.top-r>0&&(a=`calc(100% - ${n}px - ${r}px)`),s.style.top=a},cn=(s,e,t,i,n,r)=>{const{key:a}=s;a===","&&(s.preventDefault(),r?r(s):n&&n()),(a==="Space"||a===" ")&&(s.preventDefault(),e(s)),a==="Enter"&&(s.preventDefault(),t?t():i?i():n&&n())},_f=({open:s,multiple:e=!1,range:t=!1,weeknumbers:i=!1,withcontrols:n=!1,selected:r=[],earliest:a,latest:l,excludedates:d,excludeweekdays:p,maxMultiple:m,currentmonth:v,today:y,inputRef:k,hasCounter:g=!1,onDateSelected:$,onClose:T})=>{const M=h.useRef(null),S=h.useRef(!1);s&&(S.current=!0),h.useEffect(()=>{s&&kf(M.current,(k==null?void 0:k.current)??null,g)},[s,k,g]);const O=["pkt-calendar-popup",s?"show":"hide"].join(" "),N=s||S.current;return o.jsx("div",{ref:M,className:O,hidden:!s,"aria-hidden":!s,children:N&&o.jsx(er,{multiple:e,range:t,weeknumbers:i,withcontrols:n,selected:r,earliest:a,latest:l,excludedates:d,excludeweekdays:p,maxMultiple:m,currentmonth:v,today:y,onDateSelected:$,onClose:T})})},dn=h.forwardRef(({children:s,skin:e,textStyle:t,size:i,closeTag:n,className:r,iconName:a,ariaLabel:l,onClose:d,type:p,"aria-description":m,...v},y)=>{const[k,g]=h.useState(!1),$=h.useCallback(()=>{g(!0),d&&d()},[d]),T=h.useRef(null),[M,S]=h.useState("");h.useEffect(()=>{var X,te;S(((te=(X=T.current)==null?void 0:X.textContent)==null?void 0:te.trim())??"")},[s]);const O=h.useMemo(()=>{if(n&&!l)return M&&`Klikk for å fjerne ${M}`||m},[n,l,M,m]),N={"pkt-tag":!0,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${e}`]:!!e,[`pkt-tag--${t}`]:!!t},U={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${t}`]:!!t,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${e}`]:!!e,"pkt-btn--icons-right-and-left":n&&!!a,"pkt-hide":k};return n?o.jsxs("button",{...v,className:oe(U,r),type:p,onClick:$,"aria-label":l,"aria-description":O,ref:y,children:[a&&o.jsx(G,{className:"pkt-tag__icon",name:a}),o.jsx("span",{ref:T,children:s}),o.jsx(G,{className:"pkt-tag__close-btn",name:"close"})]}):o.jsxs("span",{...v,className:oe(N,r),ref:y,children:[a&&o.jsx(G,{className:"pkt-tag__icon",name:a,"aria-hidden":"true"}),o.jsx("span",{ref:T,children:s})]})});dn.displayName="PktTag";const $f=({dates:s,dateformat:e,idBase:t,strings:i,onDateRemoved:n})=>{var l;const r=Wp(s),a=((l=i==null?void 0:i.calendar)==null?void 0:l.buttonAltText)??"Slett dato";return o.jsx("div",{className:"pkt-date-tags pkt-datepicker__tags","aria-live":"polite",children:r.map(d=>{const p=Fp(d,e);return o.jsx(dn,{id:`${t}${d}-tag`,closeTag:!0,ariaLabel:`${a} ${p}`,onClose:()=>n(d),children:o.jsx("time",{dateTime:d,children:p})},d)})})},wf=({state:s})=>{var Ke,lt,we,Ne;const{id:e,inputId:t,values:i,dateformat:n,multiple:r,range:a,showRangeLabels:l,disabled:d,readOnly:p,required:m,label:v,name:y,placeholder:k,hasError:g,helptext:$,minStr:T,maxStr:M,inputType:S,isIOSDevice:O,strings:N,inputClasses:U,buttonClasses:X,rangeLabelClasses:te,datepickerInputsClasses:$e,isInputDisabled:q,inputRef:C,inputRefTo:H,btnRef:W,toggleCalendar:Q,handleFocus:se,handleSingleInputChange:ie,handleRangeFromChange:ue,handleRangeToChange:ne,handleRangeBlur:ge,handleMultipleBlur:Y,handleTagRemoved:K,handleSingleKeydown:Ae,handleRangeFromKeydown:re,handleRangeToKeydown:ae,handleMultipleKeydown:Re,restProps:Ve}=s,Se=()=>{var Ge,Xe;return o.jsxs("button",{ref:W,className:X,type:"button",onClick:Q,disabled:d,"aria-label":((Ge=N.calendar)==null?void 0:Ge.buttonAltText)??"Åpne kalender",children:[o.jsx(G,{name:"calendar"}),o.jsx("span",{className:"pkt-btn__text",children:((Xe=N.calendar)==null?void 0:Xe.buttonAltText)??"Åpne kalender"})]})};return r?o.jsxs(o.Fragment,{children:[o.jsx($f,{dates:i,dateformat:n,idBase:e,strings:N,onDateRemoved:K}),o.jsx("div",{className:"pkt-datepicker__inputs",children:o.jsxs("div",{className:"pkt-input__container",children:[o.jsx("input",{...Ve,ref:C,className:U,type:S,id:t,name:y??e,placeholder:k,readOnly:p||O&&!p,disabled:q,"aria-describedby":$?`${e}-helptext`:void 0,"aria-invalid":g,"aria-errormessage":g?`${e}-error`:void 0,onClick:Q,onKeyDown:Re,onFocus:se,onBlur:Y}),Se()]})})]}):a?o.jsx("div",{className:$e,children:o.jsxs("div",{className:"pkt-input__container",children:[l&&o.jsx("div",{className:"pkt-input-prefix",children:((Ke=N.generic)==null?void 0:Ke.from)??"Fra"}),o.jsx("input",{...Ve,ref:C,className:U,type:S,id:t,name:y?`${y}-from`:`${e}-from`,value:i[0]??"",min:T,max:M,placeholder:k,readOnly:p||O&&!p,disabled:d,required:m,"aria-label":`${v} ${((lt=N.generic)==null?void 0:lt.from)??"Fra"}`,"aria-describedby":$?`${e}-helptext`:void 0,"aria-invalid":g,"aria-errormessage":g?`${e}-error`:void 0,onClick:Q,onKeyDown:re,onFocus:se,onBlur:ge,onChange:ue}),o.jsx("div",{className:te,id:`${e}-to-label`,children:((we=N.generic)==null?void 0:we.to)??"Til"}),!l&&o.jsx("div",{className:"pkt-input-separator",children:"–"}),o.jsx("input",{ref:H,className:U,type:S,id:`${e}-to`,name:y?`${y}-to`:`${e}-to`,value:i[1]??"",min:T,max:M,readOnly:p||O&&!p,disabled:d,"aria-label":`${v} ${((Ne=N.generic)==null?void 0:Ne.to)??"Til"}`,"aria-invalid":g,onClick:Q,onKeyDown:ae,onFocus:se,onBlur:ge,onChange:ne}),Se()]})}):o.jsx("div",{className:"pkt-datepicker__inputs",children:o.jsxs("div",{className:"pkt-input__container",children:[o.jsx("input",{...Ve,ref:C,className:U,type:S,id:t,name:y??e,value:i[0]??"",min:T,max:M,placeholder:k,readOnly:p||O&&!p,disabled:d,required:m,"aria-describedby":$?`${e}-helptext`:void 0,"aria-invalid":g,"aria-errormessage":g?`${e}-error`:void 0,onClick:Q,onKeyDown:Ae,onFocus:se,onBlur:void 0,onChange:ie}),Se()]})})},xf={calendar:{buttonAltText:"Åpne kalender"}},Sf={calendar:{buttonAltText:"Åpne kalender"},generic:{from:"Fra",to:"Til"}},uo=s=>s?Array.isArray(s)?s.filter(Boolean):String(s).split(",").map(e=>e.trim()).filter(Boolean):[];function Cf(s,e){const{id:t,label:i,value:n,defaultValue:r,dateformat:a="dd.MM.yyyy",multiple:l=!1,maxlength:d,range:p=!1,showRangeLabels:m=!1,weeknumbers:v=!1,withcontrols:y=!1,excludedates:k,excludeweekdays:g,currentmonth:$,today:T,calendarOpen:M,timezone:S,fullwidth:O=!1,hasFieldset:N=!1,inline:U=!1,helptext:X,helptextDropdown:te,helptextDropdownButton:$e,hasError:q=!1,errorMessage:C,optionalTag:H=!1,optionalText:W,requiredTag:Q=!1,requiredText:se,tagText:ie,useWrapper:ue=!0,strings:ne,disabled:ge=!1,readOnly:Y=!1,required:K=!1,name:Ae,min:re,max:ae,placeholder:Re,onChange:Ve,onValueChange:Se,className:Ke,...lt}=s,we=h.useCallback(D=>D===void 0?[]:uo(D),[]),Ne=n!==void 0,Ge=typeof r=="number"?void 0:r,[Xe,et]=h.useState(()=>we(n??Ge)),ce=Ne?we(n):Xe;h.useEffect(()=>{Ne&&et(we(n))},[n,Ne,we]);const[be,Ie]=h.useState(M??!1);h.useEffect(()=>{M!==void 0&&Ie(M)},[M]);const Me=h.useRef(null),xe=h.useRef(null),V=h.useRef(null),De=h.useRef(null),he=h.useRef(null),ye=h.useMemo(()=>ff(),[]),Ue=h.useMemo(()=>co(),[]),ct=h.useMemo(()=>ne??(p?Sf:xf),[ne,p]),f=typeof re=="string"?re:re!==void 0?String(re):void 0,u=typeof ae=="string"?ae:ae!==void 0?String(ae):void 0,_=h.useMemo(()=>{const D=gf(O,m,l,p,Y,ye);return Object.entries(D).filter(([,E])=>E).map(([E])=>E).join(" ")},[O,m,l,p,Y,ye]),x=h.useMemo(()=>{const D=vf();return Object.entries(D).filter(([,E])=>E).map(([E])=>E).join(" ")},[]),L=h.useMemo(()=>{const D=bf(m);return Object.entries(D).filter(([,E])=>E).map(([E])=>E).join(" ")},[m]),j=h.useMemo(()=>["pkt-datepicker__inputs",p&&m&&"pkt-input__range-inputs"].filter(Boolean).join(" "),[p,m]),R=h.useMemo(()=>{if($)return $;if(u)return u.slice(0,7)},[$,u]),ft=ge||l&&d!=null&&ce.length>=d,Qe=l&&d!=null,mt=`${t}-input`,ls=ce.join(",");h.useEffect(()=>{V.current&&(V.current.value=ls)},[ls]),h.useEffect(()=>{S&&typeof window<"u"&&S!==window.pktTz&&(window.pktTz=S)},[S]);const tt=h.useCallback((D,E=!0)=>{Ne||et(D),E&&(Se==null||Se(D))},[Ne,Se]),dr=h.useMemo(()=>{var D;return(D=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"))==null?void 0:D.set},[]),_t=h.useCallback(D=>{const E=V.current;!E||!dr||(dr.call(E,D.join(",")),E.dispatchEvent(new Event("input",{bubbles:!0})))},[dr]),Zt=h.useCallback(()=>{ge||Ie(D=>!D)},[ge]),cs=h.useCallback(()=>{Ie(!1)},[]);h.useEffect(()=>{if(!be)return;const D=st=>{var vn;const Ze=st.target;he.current&&!he.current.contains(Ze)&&!((vn=Ze.closest)!=null&&vn.call(Ze,".pkt-calendar-popup"))&&cs()},E=st=>{var Ze;st.key==="Escape"&&(cs(),(Ze=Me.current)==null||Ze.focus())};return document.addEventListener("click",D,!0),document.addEventListener("keydown",E),()=>{document.removeEventListener("click",D,!0),document.removeEventListener("keydown",E)}},[be,cs]);const zm=h.useCallback(()=>{Ue&&!be&&Ie(!0)},[Ue,be]),Ym=h.useCallback(D=>{var Ze;const E=yf(D,l,p),st=uo(E);tt(st),_t(st),!l&&!p&&(cs(),(Ze=Me.current)==null||Ze.focus())},[l,p,tt,_t,cs]),Km=h.useCallback(()=>{var D;cs(),(D=Me.current)==null||D.focus()},[cs]),Gm=h.useCallback(D=>{const E=D.target.value,st=E?[E]:[];tt(st),_t(st)},[tt,_t]),Xm=h.useCallback(D=>{const E=D.target.value,st=ce[1]??"",Ze=[E,st].filter(Boolean);tt(Ze),_t(Ze)},[ce,tt,_t]),Qm=h.useCallback(D=>{const E=ce[0]??"",st=D.target.value,Ze=[E,st].filter(Boolean);tt(Ze),_t(Ze)},[ce,tt,_t]),Zm=h.useCallback(()=>{ce.length===2&&!mf(ce)&&(tt([ce[0]]),_t([ce[0]]))},[ce,tt,_t]),gn=h.useCallback(D=>{const E=Qt(D),st=f?Qt(f):null,Ze=u?Qt(u):null;if(E&&!isNaN(E.getTime())&&(!st||E>=st)&&(!Ze||E<=Ze)){const vn=qp([...ce,D],f,u,k,g),jo=[...new Set(vn)];tt(jo),_t(jo)}},[ce,f,u,k,g,tt,_t]),Jm=h.useCallback(D=>{const E=D.target;E.value&&(gn(E.value.split(",")[0]),E.value="")},[gn]),Uo=h.useCallback(D=>{const E=D.target;E.value&&(gn(E.value.split(",")[0]),E.value="")},[gn]),Rm=h.useCallback(D=>{const E=ce.filter(st=>st!==D);tt(E),_t(E)},[ce,tt,_t]),ds=h.useCallback(D=>{const E=D==null?void 0:D.closest("form");E?E.requestSubmit():D==null||D.blur()},[]),eg=h.useCallback(D=>{cn(D.nativeEvent,()=>Zt(),()=>ds(Me.current),void 0,()=>{var E;return(E=Me.current)==null?void 0:E.blur()})},[Zt,ds]),tg=h.useCallback(D=>{cn(D.nativeEvent,()=>Zt(),()=>ds(Me.current),()=>{var E;return(E=xe.current)==null?void 0:E.focus()},()=>{var E;return(E=Me.current)==null?void 0:E.blur()})},[Zt,ds]),sg=h.useCallback(D=>{cn(D.nativeEvent,()=>Zt(),()=>ds(xe.current),void 0,()=>{var E;return(E=xe.current)==null?void 0:E.blur()})},[Zt,ds]),ig=h.useCallback(D=>{cn(D.nativeEvent,()=>Zt(),()=>ds(Me.current),void 0,()=>{var E;return(E=Me.current)==null?void 0:E.blur()},Uo)},[Zt,ds,Uo]);return h.useImperativeHandle(e,()=>({get value(){var D;return((D=V.current)==null?void 0:D.value)??""},set value(D){const E=D?D.split(",").filter(Boolean):[];et(E),V.current&&(V.current.value=D??"")},focus(){var D;(D=Me.current)==null||D.focus()},blur(){var D;(D=Me.current)==null||D.blur()}}),[]),{id:t,inputId:mt,label:i,values:ce,calendarOpen:be,dateformat:a,multiple:l,maxlength:d,range:p,showRangeLabels:m,weeknumbers:v,withcontrols:y,excludedates:k,excludeweekdays:g,disabled:ge,readOnly:Y,required:K,name:Ae,placeholder:Re,fullwidth:O,hasFieldset:N,inline:U,helptext:X,helptextDropdown:te,helptextDropdownButton:$e,hasError:q,errorMessage:C,optionalTag:H,optionalText:W,requiredTag:Q,requiredText:se,tagText:ie,useWrapper:ue,className:Ke,minStr:f,maxStr:u,effectiveCurrentMonth:R,today:T,inputType:ye,isIOSDevice:Ue,strings:ct,inputClasses:_,buttonClasses:x,rangeLabelClasses:L,datepickerInputsClasses:j,isInputDisabled:ft,hasCounter:Qe,inputRef:Me,inputRefTo:xe,changeInputRef:V,btnRef:De,wrapperRef:he,onChange:Ve,toggleCalendar:Zt,hideCalendar:cs,handleDateSelected:Ym,handleCalendarClose:Km,handleFocus:zm,handleSingleInputChange:Gm,handleRangeFromChange:Xm,handleRangeToChange:Qm,handleRangeBlur:Zm,handleMultipleBlur:Jm,handleTagRemoved:Rm,handleSingleKeydown:eg,handleRangeFromKeydown:tg,handleRangeToKeydown:sg,handleMultipleKeydown:ig,restProps:lt}}const ho=h.forwardRef((s,e)=>{const t=Cf(s,e),i=["pkt-datepicker",t.className].filter(Boolean).join(" ");return o.jsxs("div",{className:i,children:[o.jsx(Os,{ref:t.wrapperRef,forId:t.inputId,label:t.label,hasFieldset:t.hasFieldset,inline:t.inline,helptext:t.helptext,helptextDropdown:t.helptextDropdown,helptextDropdownButton:t.helptextDropdownButton,hasError:t.hasError,errorMessage:t.errorMessage,disabled:t.disabled,optionalTag:t.optionalTag,optionalText:t.optionalText,requiredTag:t.requiredTag,requiredText:t.requiredText,tagText:t.tagText,useWrapper:t.useWrapper,counter:t.hasCounter,counterCurrent:t.values.length,counterMaxLength:t.maxlength,children:o.jsx(wf,{state:t})}),o.jsx(_f,{open:t.calendarOpen,multiple:t.multiple,range:t.range,weeknumbers:t.weeknumbers,withcontrols:t.withcontrols,selected:t.values,earliest:t.minStr,latest:t.maxStr,excludedates:t.excludedates,excludeweekdays:t.excludeweekdays,maxMultiple:t.maxlength,currentmonth:t.effectiveCurrentMonth,today:t.today,inputRef:t.inputRef,hasCounter:t.hasCounter,onDateSelected:t.handleDateSelected,onClose:t.handleCalendarClose}),o.jsx("input",{ref:t.changeInputRef,type:"text",name:t.name,onChange:t.onChange,tabIndex:-1,"aria-hidden":"true",className:"pkt-visually-hidden"})]})});ho.displayName="PktDatepicker";const Tf={dropFilesHere:"Slipp filene her ...",selectOrDragFiles:"Dra filer hit for å laste dem opp eller ",chooseFiles:"velg filer"},Nf={dropFilesHere:"Slipp filen her ...",selectOrDragFiles:"Dra en fil for å laste den opp eller ",chooseFiles:"velg en fil"},Mf={dropFilesHere:"Slipp bildene her ...",selectOrDragFiles:"Dra bilder hit for å laste dem opp eller ",chooseFiles:"velg fra kamerarull"},Df={dropFilesHere:"Slipp bildet her ...",selectOrDragFiles:"Dra et bilde for å laste det opp eller ",chooseFiles:"velg fra kamerarull"},po=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),Of=()=>{const s=po(),e=po();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+e.slice(1,4)+"-"+e.slice(4)};class fo{constructor(e,t){bn(this,"fileId");bn(this,"file");bn(this,"attributes",{});this.fileId=t||Of(),this.file=e,this.attributes={targetFilename:e.name}}}const tr=h.createContext({}),Ef=".PDF, .JPEG, .JPG, .PNG, .HEIC, .DOC, .DOCX, .ODT",Pf=h.forwardRef(({id:s,multiple:e,value:t,onFilesAdded:i=()=>{},name:n,uploadStrategy:r,accept:a,isThumbnailView:l=!1,disabled:d=!1,srAnnouncementIds:p,...m},v)=>{const y=h.useRef(null),k=typeof a=="string"&&a.trim().length>0?a:void 0,g=h.useMemo(()=>k?k.split(/\s*,\s*/).map(C=>C.trim()).filter(Boolean).join(", ").toUpperCase():Ef,[k]);h.useImperativeHandle(v,()=>y.current);const[$,T]=h.useState(!1),M=h.useMemo(()=>l?e?Mf:Df:e?Tf:Nf,[e,l]),S=h.useCallback(C=>{if(y.current)try{y.current.files=Af(C)}catch{}},[y.current,t]);h.useEffect(()=>{S(t)},[y,t]);const O=h.useCallback(C=>{const H=C.map(W=>new fo(W));i(H),y.current&&(y.current.value="")},[i]),N=C=>{const H=C.target.files;if(H.length===0){e&&S(t);return}O(Array.from(H))},U=C=>{O(C)},X=C=>{if(C.preventDefault(),T(!1),d)return;const H=C.dataTransfer.files,W=Array.from(H);U(W)},te=C=>{C.preventDefault(),!d&&T(!0)},$e=()=>{T(!1)},q=h.useCallback(C=>{var W;d||C.target.closest(".pkt-fileupload__drop-zone__placeholder__title__open-file-dialog")||(W=y.current)==null||W.click()},[d]);return o.jsxs("div",{onDrop:X,onDragOver:te,onDragLeave:$e,onClick:q,className:oe("pkt-fileupload__drop-zone",{"pkt-fileupload__drop-zone--drag-active":$,"pkt-fileupload__drop-zone--disabled":d}),children:[o.jsx("input",{...m,id:s,type:"file",ref:y,multiple:e,onChange:N,accept:k,disabled:d,name:r==="form"&&n||void 0,"aria-label":e?"Velg filer":"Velg fil"}),r==="custom"&&o.jsx(o.Fragment,{children:t==null?void 0:t.map(C=>o.jsx("input",{type:"hidden",name:n,value:C.fileId},C.fileId))}),o.jsxs("div",{className:"pkt-fileupload__drop-zone__placeholder",children:[o.jsx(G,{name:"attachment",className:"pkt-fileupload__drop-zone__placeholder__icon","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__drop-zone__placeholder__title",children:$?`${M.dropFilesHere} ...`:o.jsxs(o.Fragment,{children:[M.selectOrDragFiles," ",o.jsx("button",{className:"pkt-fileupload__drop-zone__placeholder__title__open-file-dialog",onClick:C=>{var H;C.preventDefault(),C.stopPropagation(),(H=y.current)==null||H.click()},type:"button",children:M.chooseFiles})]})}),o.jsxs("p",{className:"pkt-fileupload__drop-zone__placeholder__formats",children:["Format: ",g]})]})]})}),Af=s=>{const e=new DataTransfer;for(const t of s)e.items.add(t.file);return e.files},sr=h.forwardRef(({id:s,ariaDescribedby:e,ariaLabelledby:t,counter:i,counterMaxLength:n,className:r,disabled:a,errorMessage:l,hasError:d,helptext:p,helptextDropdown:m,helptextDropdownButton:v,inline:y,fullwidth:k=!1,label:g,name:$,optionalTag:T=!1,optionalText:M,requiredTag:S=!1,requiredText:O,tagText:N=null,placeholder:U,rows:X,useWrapper:te=!0,onChange:$e,value:q,autoComplete:C="off",minLength:H,maxLength:W,readOnly:Q,skipForwardTestid:se=!1,...ie},ue)=>{const ne=[r,"pkt-textinput","pkt-textarea"].join(" "),ge=`${s}-input`,Y=`${ge}-label`,K=t||Y,[Ae,re]=h.useState(0),ae=Re=>{var Ve,Se;i&&re(((Se=(Ve=Re.currentTarget)==null?void 0:Ve.value)==null?void 0:Se.length)||0),$e&&$e(Re)};return h.useEffect(()=>{q!==void 0&&re((q==null?void 0:q.length)||0)},[q]),o.jsx(Os,{ariaDescribedby:e,className:ne,disabled:a,errorMessage:l,forId:ge,hasError:d,helptext:p,helptextDropdown:m,helptextDropdownButton:v,inline:y,label:g,optionalTag:T,optionalText:M,requiredTag:S,requiredText:O,tagText:N,useWrapper:te,counter:i,counterCurrent:Ae,counterMaxLength:n,children:o.jsx("textarea",{ref:ue,className:`pkt-input ${k?"pkt-input--fullwidth":""} ${n&&Ae>n?"pkt-input--counter-error":""}`,name:`${$||s}`,id:ge,placeholder:U,disabled:a,rows:X,"aria-labelledby":K,"aria-invalid":d,"aria-errormessage":`${s}-error`,...ie,onChange:ae,value:q,autoComplete:C,minLength:H,maxLength:W,readOnly:Q,"data-skip-forward-testid":se?"true":void 0})})});sr.displayName="PktTextarea";const If=Symbol("comment"),Lf=s=>{const e=String(s.getDate()).padStart(2,"0"),t=String(s.getMonth()+1).padStart(2,"0"),i=s.getFullYear(),n=String(s.getHours()).padStart(2,"0"),r=String(s.getMinutes()).padStart(2,"0");return`${e}.${t}.${i} kl. ${n}:${r}`},Bf=({fileItem:s,closeOperationUi:e,onAddComment:t,existingComment:i})=>{const n=h.useRef(null),r=!!i,a=()=>{var d,p;const l=(p=(d=n.current)==null?void 0:d.value)==null?void 0:p.trim();l&&t({text:l,timestamp:new Date}),e()};return h.useLayoutEffect(()=>{const l=setTimeout(()=>{var d;return(d=n.current)==null?void 0:d.focus({preventScroll:!0})},0);return()=>clearTimeout(l)},[s.fileId]),o.jsxs(o.Fragment,{children:[o.jsx(sr,{autoFocus:!0,label:r?"Rediger kommentar":"Legg til kommentar",name:`comment-${s.fileId}`,className:"pkt-fileupload__queue-display__item__comment-input",placeholder:"Skriv inn kommentar",rows:2,id:`comment-${s.fileId}`,ref:n,defaultValue:i==null?void 0:i.text}),o.jsx(at,{skin:"secondary",size:"small",onClick:a,children:r?"Lagre kommentar":"Legg til kommentar"}),o.jsx(at,{skin:"tertiary",size:"small",onClick:e,children:"Avbryt"})]})},Ff=({comments:s,onDeleteComment:e,onEditComment:t})=>s&&s.length>0?o.jsx("div",{className:"pkt-fileupload__queue-display__item__comments",children:s.map((i,n)=>o.jsxs("div",{className:"pkt-fileupload__queue-display__item__comment",children:[o.jsxs("div",{className:"pkt-fileupload__queue-display__item__comment__content",children:[o.jsx("span",{className:"pkt-fileupload__queue-display__item__comment__text","aria-label":"Kommentar tekst",children:i.text}),o.jsx("time",{className:"pkt-fileupload__queue-display__item__comment__time",children:Lf(i.timestamp)})]}),o.jsxs("div",{className:"pkt-fileupload__queue-display__item__comment__actions",children:[e&&o.jsx("button",{type:"button",className:"pkt-fileupload__queue-display__item__comment__action",onClick:()=>e(n),"aria-label":"Slett kommentar",children:o.jsx(G,{name:"trash-can"})}),t&&o.jsx("button",{type:"button",className:"pkt-fileupload__queue-display__item__comment__action",onClick:()=>t(n),"aria-label":"Rediger kommentar",children:o.jsx(G,{name:"edit"})})]})]},n))}):null,Hf=s=>{const e=h.useContext(tr);return o.jsx("input",{type:"hidden",name:`${e.name}-comments`,value:s.comments?JSON.stringify(s.comments):""})},Vf=s=>{const e=s("comments"),t=(n,r)=>{e.set(n,[r])},i=(n,r)=>{const l=(e.get(n)||[]).filter((d,p)=>p!==r);e.set(n,l.length>0?l:void 0)};return{title:n=>{const r=e.get(n.fileId);return r&&r.length>0?"":"Legg til kommentar"},renderExtendedUI:(n,r)=>{const a=e.get(n.fileId),l=a==null?void 0:a[0];return o.jsx(Bf,{fileItem:n,closeOperationUi:r,onAddComment:d=>t(n.fileId,d),existingComment:l})},renderContent:(n,r,a)=>{if(a)return null;const l=e.get(n.fileId);return o.jsx(Ff,{comments:l,onDeleteComment:d=>i(n.fileId,d),onEditComment:r?()=>r():void 0})},renderHidden:n=>o.jsx(Hf,{comments:e.get(n.fileId)},`comments${n.fileId}`),symbol:If}},Uf=Symbol("deleteFile"),jf=s=>({title:"Slett",ariaLabel:"Slett fil",onClick:e=>s(e.fileId),symbol:Uf}),qf=Symbol("renameFile"),Wf=s=>{const e=h.useRef(null),t=h.useId(),i=()=>{var n;s.onSave(((n=e.current)==null?void 0:n.value)??"")};return o.jsxs(o.Fragment,{children:[o.jsx("label",{htmlFor:t,className:"pkt-sr-only",children:"Endre filnavn"}),o.jsx("input",{id:t,ref:e,type:"text",autoFocus:!0,defaultValue:s.value,className:"pkt-fileupload__queue-display__item__rename-input",onKeyDown:n=>{n.key==="Enter"&&(n.preventDefault(),n.stopPropagation(),i()),n.key==="Escape"&&(n.preventDefault(),n.stopPropagation(),s.onCancel())}}),o.jsx(at,{skin:"secondary",size:"small",onClick:()=>s.onSave(e.current.value),children:"Lagre"}),o.jsx(at,{skin:"tertiary",size:"small",onClick:s.onCancel,children:"Avbryt"})]})},zf=s=>{const e=h.useContext(tr);return o.jsx("input",{type:"hidden",name:`${e.name}-targetFilename`,value:s.targetFilename})},Yf=s=>{const e=s("targetFilename");return{title:"Rediger",ariaLabel:"Rediger filnavn",renderInlineUI:(t,i)=>o.jsx(Wf,{value:e.get(t.fileId)||void 0,onSave:n=>{e.set(t.fileId,n),i()},onCancel:i}),renderHidden:t=>o.jsx(zf,{targetFilename:e.get(t.fileId)||t.file.name},`rename${t.fileId}`),symbol:qf}},Kf=(s,e)=>{const t=h.useCallback((r,a,l)=>{const d=s.find(m=>m.fileId===r),p=d.attributes||{};d.attributes={...p,[a]:l},e(r,{attributes:d.attributes})},[e,s]),i=h.useCallback((r,a)=>(s.find(p=>p.fileId===r).attributes||{})[a],[s]);return{fileAttributes:h.useCallback(r=>({get:a=>i(a,r),set:(a,l)=>{t(a,r,l)}}),[i,t])}},Gf=s=>{const[e,t]=h.useState(!1),[i,n]=h.useState(0),r=h.useRef(null),a=h.useCallback(p=>{var v;const m=s.findIndex(y=>y.fileId===p);m>=0&&(n(m),t(!0),(v=r.current)==null||v.showModal())},[s]),l=h.useCallback(()=>{var p;t(!1),(p=r.current)==null||p.close()},[]),d=h.useCallback(p=>{s.length!==0&&n(m=>p==="prev"?m<=0?s.length-1:m-1:m>=s.length-1?0:m+1)},[s.length]);return{isOpen:e,currentIndex:i,modalRef:r,open:a,close:l,navigate:d}},Xf=s=>{const[e,t]=h.useState({}),i=h.useCallback(a=>{const l=e[a];if(l)return s.find(d=>d.symbol===l)},[e,s]),n=h.useCallback((a,l)=>{t(d=>({...d,[a]:l.symbol}))},[]),r=h.useCallback(a=>{t(l=>{const d={...l};return delete d[a],d})},[]);return{getActivated:i,activate:n,close:r}},Qf=It({tagName:"pkt-modal",elementClass:xt,react:h,displayName:"PktModal",events:{}}),ir=h.forwardRef(({children:s,...e},t)=>o.jsx(Qf,{...e,ref:t,children:o.jsx("div",{className:"pkt-contents",children:s})}));ir.displayName="PktModal";const mo=2,Zf=s=>{const e=window.getComputedStyle(s),t=parseFloat(e.lineHeight);if(!Number.isNaN(t)&&t>0)return t;const i=parseFloat(e.fontSize);return(!Number.isNaN(i)&&i>0?i:16)*1.2},Jf=(s,e,t)=>{const i=e*t;return s.getBoundingClientRect().height>i+.5},go=h.createContext({tail:5}),Ai=({children:s,tail:e,...t})=>{const i=s,n=h.useContext(go),r=e!==void 0?e:n.tail||0,a=s.length<=r+3?null:s.slice(-r),l=h.useRef(null),d=h.useRef(null),[p,m]=h.useState(!1),v=h.useCallback(()=>{const k=l.current,g=d.current;if(!k||!g)return;const $=Zf(k);m(Jf(g,$,mo))},[]),y=h.useMemo(()=>new ResizeObserver(k=>{k.some(g=>g.target===l.current)&&v()}),[v]);return h.useLayoutEffect(()=>(l.current&&y.observe(l.current),v(),()=>y.disconnect()),[s,y,v]),o.jsxs("span",{ref:l,...t,"data-pkt-truncate-part":"wrapper",style:{maxWidth:"100%",width:"100%",display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",alignItems:"end",columnGap:"0.25rem",overflow:"hidden",position:"relative",...t.style},children:[o.jsx("span",{"data-pkt-truncate-part":"first",style:{minWidth:0,display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:mo,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal",overflowWrap:"anywhere"},children:i}),r!==0&&o.jsx("span",{"data-pkt-truncate-part":"tail",style:{whiteSpace:"nowrap",display:p?"inline":"none",paddingRight:"0.5rem"},"aria-hidden":!0,children:a}),o.jsx("span",{ref:d,"aria-hidden":!0,"data-pkt-truncate-part":"measure",style:{position:"absolute",top:0,left:0,width:"100%",visibility:"hidden",pointerEvents:"none",whiteSpace:"normal",overflowWrap:"anywhere"},children:s})]})},Rf=s=>{if(typeof s=="number")return s;const e=s.trim().match(/^(\d+(?:\.\d+)?)\s*(B|KB|MB|GB)$/i);if(!e)return console.warn(`PktFileUpload: Invalid maxFileSize format "${s}". Use format like "5MB", "500KB", or a number in bytes.`),0;const t=parseFloat(e[1]);switch(e[2].toUpperCase()){case"B":return t;case"KB":return t*1024;case"MB":return t*1024*1024;case"GB":return t*1024*1024*1024;default:return t}},un=s=>s<1024?`${s} B`:s<1024*1024?`${Math.round(s/1024)} KB`:s<1024*1024*1024?`${Math.round(s/(1024*1024))} MB`:`${Math.round(s/(1024*1024*1024))} GB`,nr=s=>o.jsx("button",{onClick:s.onClick,className:"pkt-fileupload__queue-display__item__cancel-button","aria-label":s.ariaLabel||"Avbryt opplasting",children:s.label||"Avbryt"}),em=()=>{const[s,e]=h.useState(1);return h.useEffect(()=>{const t=setInterval(()=>{e(i=>i>=3?1:i+1)},400);return()=>clearInterval(t)},[]),o.jsxs("span",{className:"pkt-fileupload__queue-display__item__loading-text","aria-label":"Laster opp fil",children:["Laster opp",".".repeat(s)]})},tm=({cancelTransfer:s,transferItem:e})=>{const t=e.showProgress??e.progress!==0;return o.jsxs(o.Fragment,{children:[o.jsx(G,{name:"document-text",className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__queue-display__item__title","aria-label":"Filnavn",children:o.jsx(Ai,{children:e.attributes.targetFilename})}),o.jsx(nr,{onClick:s}),t?o.jsxs(o.Fragment,{children:[o.jsx(mn,{valueCurrent:e.progress*100,statusType:"none",valueMax:100,statusPlacement:"following",className:"pkt-fileupload__queue-display__item__progress"}),o.jsx("span",{className:"pkt-fileupload__queue-display__item__filesize",children:un(e.file.size)}),o.jsx("span",{className:"pkt-fileupload__queue-display__item__percentage","aria-hidden":"true",children:`${Math.round(e.progress*100)}%`})]}):o.jsx(em,{})]})},sm=({transferItem:s,onRemove:e})=>{const t=(s.lastProgress??1)*100;return o.jsxs(o.Fragment,{children:[o.jsx(G,{className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium",name:"alert-error","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__queue-display__item__title",children:o.jsx(Ai,{children:s.attributes.targetFilename})}),o.jsx(nr,{onClick:e,label:"Fjern",ariaLabel:"Fjern fil som feilet under opplasting"}),o.jsx(mn,{valueCurrent:t,statusType:"none",valueMax:100,statusPlacement:"following",className:"pkt-fileupload__queue-display__item__progress pkt-fileupload__queue-display__item__progress--error"}),o.jsx("span",{className:"pkt-fileupload__queue-display__item__filesize",children:un(s.file.size)}),s.errorMessage&&o.jsx("span",{className:"pkt-fileupload__queue-display__item__error-message",children:s.errorMessage})]})},im=({transferItem:s,onRemove:e})=>o.jsxs(o.Fragment,{children:[o.jsx(G,{className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium",name:"alert-error","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__queue-display__item__title",children:o.jsx(Ai,{children:s.attributes.targetFilename})}),o.jsx(nr,{onClick:e,label:"Fjern",ariaLabel:"Fjern fil som feilet under opplasting"}),s.errorMessage&&o.jsx("span",{className:"pkt-fileupload__queue-display__item__error-message",children:s.errorMessage})]}),nm=({transferItem:s,onRemove:e})=>s.showProgress?o.jsx(sm,{transferItem:s,onRemove:e}):o.jsx(im,{transferItem:s,onRemove:e}),rm=({operation:s,onActivate:e,transferItem:t})=>{const i=typeof s.title=="function"?s.title(t):s.title;if(!i)return null;const n=()=>{(s.renderInlineUI||s.renderExtendedUI)&&e(t.fileId,s),s.onClick&&s.onClick(t)};return o.jsx("button",{type:"button",className:"pkt-fileupload__queue-display__item__operation",onClick:n,"aria-label":typeof s.ariaLabel=="function"?s.ariaLabel(t):s.ariaLabel,children:i})},vo=({transferItem:s})=>o.jsxs(o.Fragment,{children:[o.jsx(G,{name:"document-text",className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__queue-display__item__title",children:o.jsx(Ai,{children:s.attributes.targetFilename})}),o.jsx("span",{className:"pkt-fileupload__queue-display__item__filesize",children:un(s.file.size)})]}),am=({transferItem:s,onPreviewClick:e})=>{const[t,i]=h.useState(null),n=s.file;h.useEffect(()=>{if(n.type.startsWith("image/")){const l=URL.createObjectURL(n);return i(l),()=>{URL.revokeObjectURL(l)}}},[n]);const r=t&&o.jsx("img",{src:t,alt:s.attributes.targetFilename})||o.jsx(G,{name:"document-text",className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium"}),a=!!e;return o.jsxs("div",{className:"pkt-fileupload__queue-display__item__thumbnail",children:[o.jsxs(at,{className:"pkt-fileupload__queue-display__item__thumbnail__image-wrapper","aria-label":`Forhåndsvis bilde ${s.attributes.targetFilename}`,type:"button",skin:"secondary",onClick:e,children:[a&&o.jsx(G,{name:"expand",className:"pkt-fileupload__queue-display__item__thumbnail__expand-icon","aria-hidden":"true"}),r]}),o.jsx(Ai,{className:"pkt-fileupload__queue-display__item__thumbnail__title",children:s.attributes.targetFilename})]})},bo=h.forwardRef(({isOpen:s,images:e,currentIndex:t,onClose:i,onNavigate:n},r)=>{const[a,l]=h.useState(null),d=e[t],p=e.length>1;return h.useEffect(()=>{if(d&&d.file.type.startsWith("image/")){const m=URL.createObjectURL(d.file);return l(m),()=>URL.revokeObjectURL(m)}l(null)},[d]),h.useEffect(()=>{if(!s)return;const m=v=>{switch(v.key){case"ArrowLeft":v.preventDefault(),n("prev");break;case"ArrowRight":v.preventDefault(),n("next");break;case"Escape":v.preventDefault(),i();break}};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[s,n,i]),d?o.jsx(ir,{ref:r,headingText:d.attributes.targetFilename,closeOnBackdropClick:!0,className:"pkt-fileupload__image-preview-modal",children:o.jsxs("div",{className:"pkt-fileupload__image-preview",children:[p&&o.jsx(at,{variant:"icon-only",iconName:"chevron-thin-left",skin:"secondary",size:"small",className:"pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--prev",onClick:()=>n("prev"),"aria-label":`Forrige bilde ${t} / ${e.length}`}),o.jsx("div",{className:"pkt-fileupload__image-preview__content",children:a&&o.jsx("img",{src:a,alt:`${d.attributes.targetFilename} - ${t+1} av ${e.length}`,className:"pkt-fileupload__image-preview__image"})}),p&&o.jsxs("span",{className:"pkt-fileupload__image-preview__counter",children:[t+1," / ",e.length]}),p&&o.jsx(at,{variant:"icon-only",iconName:"chevron-thin-right",skin:"secondary",size:"small",className:"pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--next",onClick:()=>n("next"),"aria-label":`Neste bilde ${t+2} / ${e.length}`})]})}):null});bo.displayName="ImagePreviewModal";const om=s=>{var e;return(e=s.file.type)!=null&&e.startsWith("image/")?!0:/\.(jpe?g|png|gif|webp|heic|heif|bmp|svg)$/i.test(s.file.name||"")},rr=s=>typeof s=="number"?"in-progress":s==="error"?"error":"idle",lm=({operations:s,activatedOperation:e,onActivate:t,transferItem:i})=>o.jsx("div",{className:"pkt-fileupload__queue-display__item__actions",children:s.filter(n=>!e||n.symbol!==e.symbol).map(n=>o.jsx(rm,{operation:n,onActivate:t,transferItem:i},n.symbol.toString()))}),cm=({operations:s,activatedOperation:e,onActivate:t,transferItem:i})=>o.jsx(o.Fragment,{children:s.filter(n=>n.renderContent).map(n=>o.jsx("div",{className:"pkt-fileupload__queue-display__item__operation-content",children:n.renderContent(i,()=>t(i.fileId,n),(e==null?void 0:e.symbol)===n.symbol)},n.symbol.toString()))}),dm=({transferItem:s,activatedOperation:e,operations:t,ItemRenderer:i,onActivate:n,onClose:r,onPreviewClick:a})=>{const l=()=>r(s.fileId),p=(e==null?void 0:e.renderInlineUI)||(e==null?void 0:e.renderExtendedUI)?[]:t;return o.jsxs(o.Fragment,{children:[e!=null&&e.renderInlineUI?o.jsxs(o.Fragment,{children:[o.jsx(G,{name:"document-text",className:"pkt-fileupload__queue-display__item__icon"}),o.jsx("div",{className:"pkt-fileupload__queue-display__item__inline-ui",children:e.renderInlineUI(s,l)})]}):o.jsx(i,{transferItem:s,queueItemOperations:t,onPreviewClick:a}),p.length>0&&o.jsx(lm,{operations:p,activatedOperation:e,onActivate:n,transferItem:s}),o.jsx(cm,{operations:t,activatedOperation:e,onActivate:n,transferItem:s}),(e==null?void 0:e.renderExtendedUI)&&o.jsx("div",{className:"pkt-fileupload__queue-display__item__expanded-operation-ui",children:e.renderExtendedUI(s,l)})]})},um=({transferItem:s,activatedOperation:e,operations:t,ItemRenderer:i,enableImagePreview:n,onActivate:r,onClose:a,onCancelTransfer:l,onOpenPreview:d})=>{const p=rr(s.progress),m=n&&s.progress==="done"&&om(s);switch(p){case"in-progress":return o.jsx(tm,{"aria-live":"off",transferItem:s,cancelTransfer:()=>l(s.fileId)});case"error":return o.jsx(nm,{transferItem:s,onRemove:()=>l(s.fileId)});case"idle":return o.jsx(dm,{transferItem:s,activatedOperation:e,operations:t,ItemRenderer:i,onActivate:r,onClose:a,onPreviewClick:m?()=>d(s.fileId):void 0})}},hm=s=>{var e;return(e=s.file.type)!=null&&e.startsWith("image/")?!0:/\.(jpe?g|png|gif|webp|heic|heif|bmp|svg)$/i.test(s.file.name||"")},pm=(s,e,t)=>h.useMemo(()=>{const i=s.map(r=>{const a=e.find(l=>l.fileId===r.fileId);return{...r,progress:(a==null?void 0:a.progress)??(t==="form"?"done":"queued"),errorMessage:a==null?void 0:a.errorMessage,showProgress:a==null?void 0:a.showProgress,lastProgress:a==null?void 0:a.lastProgress}}),n={"in-progress":0,error:1,idle:2};return i.sort((r,a)=>n[rr(r.progress)]-n[rr(a.progress)])},[s,e,t]),fm=(s,e)=>h.useMemo(()=>e?s.filter(t=>t.progress==="done"&&hm(t)):[],[s,e]),mm=({files:s,cancelTransfer:e,transfers:t=[],queueItemOperations:i=[],ItemRenderer:n=vo,truncateTail:r,enableImagePreview:a=!1,uploadStrategy:l="form"})=>{const d=pm(s,t,l),p=fm(d,a),m=Xf(i),v=Gf(p);return o.jsxs(o.Fragment,{children:[o.jsx("ul",{className:"pkt-fileupload__queue-display",children:o.jsx(go.Provider,{value:{tail:r},children:d.map(y=>o.jsxs("li",{className:oe("pkt-fileupload__queue-display__item",{"pkt-fileupload__queue-display__item--in-progress":typeof y.progress=="number",[`pkt-fileupload__queue-display__item--${y.progress}`]:typeof y.progress=="string"}),children:[i.filter(k=>k.renderHidden).map(k=>k.renderHidden(y)),o.jsx(um,{transferItem:y,activatedOperation:m.getActivated(y.fileId),operations:i,ItemRenderer:n,enableImagePreview:a,onActivate:m.activate,onClose:m.close,onCancelTransfer:e,onOpenPreview:v.open})]},y.fileId))})}),a&&p.length>0&&o.jsx(bo,{ref:v.modalRef,isOpen:v.isOpen,images:p,currentIndex:v.currentIndex,onClose:v.close,onNavigate:v.navigate})]})},ar={filename:vo,thumbnail:am},yo=h.forwardRef(({value:s,defaultValue:e,id:t="fileupload-id",multiple:i=!1,uploadStrategy:n="form",addCommentsEnabled:r=!1,renameFilesEnabled:a=!1,truncateTail:l,onFilesChanged:d,onFileUploadRequested:p,extraOperations:m=[],itemRenderer:v=ar.filename,fullWidth:y=!1,allowedFormats:k,formatErrorMessage:g,maxFileSize:$,sizeErrorMessage:T,onFileValidation:M,errorMessage:S,hasError:O=!1,disabled:N=!1,label:U,helptext:X,optionalTag:te,requiredTag:$e,enableImagePreview:q=!1,...C},H)=>{const W="transfers"in C?C.transfers:void 0,[Q,se]=h.useState(null),ie=O||!!Q,ue=S||Q,ne=$?Rf($):void 0,ge=h.useCallback(V=>{var De;if(k&&k.length>0){const he=((De=V.name.split(".").pop())==null?void 0:De.toLowerCase())||"",ye=V.type.toLowerCase();if(!k.some(ct=>{const f=ct.toLowerCase().replace(/^\./,"");if(f.includes("/")){if(f.endsWith("/*")){const u=f.replace("/*","");return ye.startsWith(u+"/")}return ye===f}return he===f})){const ct=k.join(", "),f=`Ugyldig filtype. Tillatte formater: ${ct}`;return(g==null?void 0:g.replace("{formats}",ct))||f}}if(ne&&V.size>ne){const he=un(ne),ye=`Filen er for stor. Maks størrelse er ${he}.`;return(T==null?void 0:T.replace("{maxSize}",he))||ye}return M?M(V):null},[k,g,ne,T,M]);s!==void 0&&e!==void 0&&console.warn("PktFileupload: Både value og defaultValue er angitt. Komponenten kan være enten 'controlled' eller 'uncontrolled', ikke begge deler. Bruk kun én av dem. Se https://react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable"),s!==void 0&&d===void 0&&console.warn("PktFileupload: value-prop er angitt uten onFilesChanged-callback. Når en komponent er 'controlled', må endringer håndteres via en callback. Vennligst legg til onFilesChanged-callback for å håndtere endringer i fil-listen. Se https://react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable");const K=s!==void 0?s:e||[],Ae=typeof v=="string"?ar[v]:v,re=v==="thumbnail",ae=typeof C.accept=="string"?C.accept.trim():void 0,Re=h.useMemo(()=>{if(!(!k||k.length===0))return k.map(V=>V.trim()).filter(Boolean).map(V=>{const De=V.toLowerCase();return De.includes("/")||De.startsWith(".")?De:`.${De}`}).join(", ")},[k]),Ve=ae||Re,Se=a&&!re,Ke=r&&!re,lt=h.useCallback(V=>{for(const he of V){const ye=ge(he.file);if(ye){se(ye);return}}se(null);const De=i?[...K,...V]:[V[0]];d&&d(De),n==="custom"&&p&&V.forEach(he=>{p==null||p(he)})},[d,K,i,n,p,ge]),we=h.useCallback((V,De)=>{const he=K.map(ye=>ye.fileId===V?{...ye,...De}:ye);d&&d(he)},[d,K]),Ne=h.useCallback(V=>{var he;const De=K.filter(ye=>ye.fileId!==V);d&&d(De),"onTransferCancelled"in C&&C.onTransferCancelled&&((he=C.onTransferCancelled)==null||he.call(C,V))},[d,K,C]),{fileAttributes:Ge}=Kf(K,we),Xe=h.useMemo(()=>[{op:Yf,enabled:Se},{op:V=>Vf(V),enabled:Ke}].filter(({enabled:V})=>V).map(({op:V})=>V).concat(...m),[Se,Ke]),et=h.useMemo(()=>({uploaded:`${t}-uploaded`,errors:`${t}-errors`}),[t]),{totalCount:ce,uploadedCount:be,failedCount:Ie}=h.useMemo(()=>{const V=K.length;if(!W)return{totalCount:V,uploadedCount:0,failedCount:0};let De=0,he=0;for(const ye of K){const Ue=W.find(ct=>ct.fileId===ye.fileId);(Ue==null?void 0:Ue.progress)==="done"&&De++,(Ue==null?void 0:Ue.progress)==="error"&&he++}return{totalCount:V,uploadedCount:De,failedCount:he}},[K,W]),Me=ce===1?"fil":"filer",xe=o.jsx("div",{className:oe("pkt-fileupload",{"pkt-fileupload--full-width":y,"pkt-fileupload--error":ie,"pkt-fileupload--disabled":N}),"aria-disabled":N,...N?{inert:""}:{},children:o.jsxs(tr.Provider,{value:{name:C.name||"",multiple:!!i,id:t},children:[o.jsx("div",{id:et.uploaded,className:"pkt-sr-only","aria-live":"polite","aria-atomic":"true",children:ce>0&&be>0&&`${be} av ${ce} ${Me} lastet opp`}),o.jsx("div",{id:et.errors,className:"pkt-sr-only","aria-live":"assertive","aria-atomic":"true",children:ce>0&&Ie>0&&`Feil ved opplasting: ${Ie} av ${ce} ${Me} feilet`}),o.jsx(Pf,{id:t,name:C.name||"",value:K,onFilesAdded:lt,multiple:i,uploadStrategy:n,ref:H,accept:re?".jpeg, .jpg, .png, .gif, .webp, .heic":Ve,isThumbnailView:re,disabled:N,srAnnouncementIds:et}),ie&&ue&&o.jsx(rn,{skin:"error","aria-live":"assertive",role:"alert",compact:!0,children:ue}),o.jsx(mm,{files:K,cancelTransfer:Ne,truncateTail:l,transfers:W,uploadStrategy:n,ItemRenderer:Ae,enableImagePreview:re&&q,queueItemOperations:Xe.map(V=>V(Ge)).concat(jf(Ne))})]})});return U?o.jsx(Os,{forId:t,label:U,helptext:X,disabled:N,hasError:ie,optionalTag:te,requiredTag:$e,className:oe("pkt-fileupload-wrapper",{"pkt-fileupload-wrapper--full-width":y}),children:xe}):xe});yo.displayName="PktFileUpload";const gm=({columnOne:s,columnTwo:e,socialLinks:t,className:i,openLinksInNewTab:n=!1,personvernOgInfoLink:r="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:a="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:l=!1,hotjarId:d=null,googleAnalyticsId:p=null,devMode:m=!1,cookieDomain:v=null,cookieSecure:y=null,cookieExpiryDays:k=null,onToggleConsent:g=$=>{console.log($.detail)}})=>{var T,M;const $=[i,"pkt-footer"].filter(Boolean).join(" ");return o.jsx("footer",{className:$,"data-mode":"dark",children:o.jsxs("div",{className:"pkt-footer__container",children:[o.jsxs("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[o.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[o.jsx("h2",{className:"pkt-footer__title",children:s.title}),o.jsxs("ul",{className:"pkt-footer__list",children:[s.text&&o.jsx("li",{className:"pkt-footer__text",children:s.text}),(T=s.links)==null?void 0:T.map((S,O)=>o.jsx("li",{className:"pkt-footer__list-item",children:o.jsxs("a",{className:`pkt-footer__link ${S.external?"pkt-link--external":""}`,href:S.href,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:[o.jsx(G,{className:"pkt-footer__link-icon",name:"chevron-right"}),S.text]})},`links-${O}`))]})]}),o.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[o.jsx("h2",{className:"pkt-footer__title",children:e.title}),o.jsxs("ul",{className:"pkt-footer__list",children:[e.text&&o.jsx("li",{className:"pkt-footer__text",children:e.text}),(M=e.links)==null?void 0:M.map((S,O)=>o.jsx("li",{className:"pkt-footer__list-item",children:o.jsxs("a",{className:`pkt-footer__link ${S.external?"pkt-link--external":""}`,href:S.href,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:[o.jsx(G,{className:"pkt-footer__link-icon",name:"chevron-right"}),S.text]})},`links-${O}`))]})]}),o.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[o.jsx("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),o.jsxs("ul",{className:"pkt-footer__list",children:[o.jsx("li",{className:"pkt-footer__list-item",children:o.jsxs("a",{className:"pkt-footer__link",href:r,target:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[o.jsx(G,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),o.jsx("li",{className:"pkt-footer__list-item",children:o.jsxs("a",{className:"pkt-footer__link",href:a,target:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[o.jsx(G,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),l&&o.jsx("li",{className:"pkt-footer__list-item",children:o.jsx(ln,{triggerType:"footerlink",hotjarId:d,googleAnalyticsId:p,devMode:m,cookieDomain:v,cookieSecure:y,cookieExpiryDays:k,onToggleConsent:g})})]})]})]}),t&&o.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[o.jsx("div",{className:"pkt-footer__social-languages",children:t.filter(S=>S.language).map((S,O)=>o.jsx("div",{className:"pkt-footer__social-language",children:o.jsx("a",{href:S.href,"aria-label":`til ${S.language} versjon av nettsiden`,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:S.language})},`sociallinks-language-${O}`))}),o.jsx("div",{className:"pkt-footer__social-icons",children:t.filter(S=>S.iconName).map((S,O)=>o.jsx(h.Fragment,{children:o.jsx("a",{href:S.href,"aria-label":`til ${S.iconName}`,className:"pkt-footer__social-icon-link",target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:o.jsx(G,{className:"pkt-footer__social-icon",name:S.iconName})})},`sociallinks-${O}`))})]})]})})},vm=({links:s=[],openLinksInNewTab:e=!1,personvernOgInfoLink:t="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:i="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:n=!1,hotjarId:r=null,googleAnalyticsId:a=null,devMode:l=!1,cookieDomain:d=null,cookieSecure:p=null,cookieExpiryDays:m=null,onToggleConsent:v=k=>{console.log(k.detail)},className:y})=>{const k=[y,"pkt-footer-simple"].filter(Boolean).join(" ");return o.jsx("footer",{className:k,"data-mode":"dark",children:o.jsx("div",{className:"pkt-footer-simple__container",children:o.jsxs("ul",{className:"pkt-footer-simple__list",children:[s.map((g,$)=>o.jsx("li",{className:"pkt-footer-simple__list-item",children:o.jsxs("a",{className:`pkt-footer-simple__link ${g.external?" pkt-link--external":""}`,href:g.href,target:g.openInNewTab||e?"_blank":"_self",rel:g.openInNewTab||e?"noopener noreferrer":void 0,children:[o.jsx(G,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),g.text]})},$)),o.jsx("li",{className:"pkt-footer-simple__list-item",children:o.jsxs("a",{className:"pkt-footer-simple__link",href:t,target:e?"_blank":"_self",rel:e?"noopener noreferrer":void 0,children:[o.jsx(G,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),o.jsx("li",{className:"pkt-footer-simple__list-item",children:o.jsxs("a",{className:"pkt-footer-simple__link",href:i,target:e?"_blank":"_self",rel:e?"noopener noreferrer":void 0,children:[o.jsx(G,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),n&&o.jsx("li",{className:"pkt-footer-simple__list-item",children:o.jsx(ln,{triggerType:"footerlink",hotjarId:r,googleAnalyticsId:a,devMode:l,cookieDomain:d,cookieSecure:p,cookieExpiryDays:m,onToggleConsent:v})})]})})})},bm=(s,e)=>{const t=()=>typeof window>"u"?0:window.innerWidth,[i,n]=h.useState(t);return h.useEffect(()=>{const r=s.current;if(!r)return;if(n(r.offsetWidth),typeof ResizeObserver>"u"){const l=()=>{r&&n(r.offsetWidth)};return window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)}const a=new ResizeObserver(l=>{for(const d of l)d.borderBoxSize&&d.borderBoxSize.length>0?n(d.borderBoxSize[0].inlineSize):n(d.contentRect.width)});return a.observe(r),()=>{a.disconnect()}},[s]),i};function ym(s){const e=h.useRef(0);h.useEffect(()=>{const t=document.body,i=document.documentElement;if(s){e.current=window.scrollY||window.pageYOffset;const n=window.innerWidth-i.clientWidth;n>0&&(t.style.paddingRight=`${n}px`),t.style.position="fixed",t.style.top=`-${e.current}px`,t.style.left="0",t.style.right="0",t.style.width="100%",t.style.overflow="hidden",i.classList.add("is-scroll-locked")}else t.style.removeProperty("position"),t.style.removeProperty("top"),t.style.removeProperty("left"),t.style.removeProperty("right"),t.style.removeProperty("width"),t.style.removeProperty("overflow"),t.style.removeProperty("padding-right"),document.documentElement.classList.remove("is-scroll-locked"),window.scrollTo({top:e.current});return()=>{s&&(t.style.cssText="",document.documentElement.classList.remove("is-scroll-locked"),window.scrollTo({top:e.current}))}},[s])}const hn=({href:s,iconName:e,className:t,iconPosition:i,external:n,target:r,children:a,...l})=>{const d={"pkt-link":!0,"pkt-link--icon-left":!!e&&i==="left"||!!(e&&!i),"pkt-link--icon-right":!!e&&i==="right","pkt-link--external":n};return o.jsxs("a",{...l,className:oe(d,t),href:s,target:r,rel:n?"noopener noreferrer":void 0,children:[e&&o.jsx(G,{name:e,className:"pkt-link__icon"}),a]})};hn.displayName="PktLink";const km=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},pn=({item:s,className:e})=>"href"in s?o.jsx(hn,{iconName:s.iconName,href:s.href,"aria-hidden":"true",className:oe("pkt-user-menu__link",e),children:s.title}):o.jsxs("button",{className:oe("pkt-user-menu__link pkt-link-button pkt-link pkt-link--icon-left",e),type:"button",onClick:()=>{"onClick"in s&&typeof s.onClick=="function"?s.onClick():console.error("UserMenuButton item is missing onClick handler or onClick is not a function:",s)},children:[s.iconName&&o.jsx(G,{name:s.iconName,className:"pkt-link__icon","aria-hidden":"true"}),s.title]}),_m=({links:s})=>o.jsx("ul",{className:"pkt-user-menu__sublist",children:s.map((e,t)=>o.jsx("li",{className:"pkt-user-menu__subitem",children:o.jsx(pn,{item:e})},t))}),ko=h.forwardRef(({user:s,formattedLastLoggedIn:e,representing:t,userMenu:i,canChangeRepresentation:n,changeRepresentation:r,logoutOnClick:a},l)=>{const d=i==null?void 0:i.map(km);return o.jsx("nav",{className:"pkt-user-menu",ref:l,"aria-label":"Meny for innlogget bruker",children:o.jsxs("ul",{className:"pkt-user-menu__list",children:[s&&o.jsxs("li",{className:"pkt-user-menu__item",children:[o.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),o.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:s.name}),e&&o.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",o.jsx("time",{children:e})]})]}),d&&d.length>0&&o.jsx("li",{className:"pkt-user-menu__item",children:o.jsx(_m,{links:d})}),t&&o.jsxs("li",{className:"pkt-user-menu__item",children:[o.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),o.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:t.name}),t.orgNumber&&o.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",t.orgNumber]}),n&&r&&o.jsx("ul",{className:"pkt-user-menu__sublist mt-size-16",children:o.jsx("li",{className:"pkt-user-menu__subitem",children:o.jsx(pn,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:r}})})})]}),!t&&n&&r&&o.jsx("li",{className:"pkt-user-menu__item",children:o.jsx("ul",{className:"pkt-user-menu__sublist",children:o.jsx("li",{className:"pkt-user-menu__subitem",children:o.jsx(pn,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:r}})})})}),a&&o.jsx("li",{className:"pkt-user-menu__item",children:o.jsx(pn,{item:{title:"Logg ut",iconName:"exit",onClick:a}})})]})})});ko.displayName="PktHeaderUserMenu";const fn=h.forwardRef(({id:s,ariaDescribedby:e,ariaLabelledby:t,autocomplete:i="off",counter:n,counterMaxLength:r,className:a,disabled:l=!1,errorMessage:d,hasError:p=!1,helptext:m,helptextDropdown:v,helptextDropdownButton:y,iconNameRight:k,inline:g=!1,fullwidth:$=!1,label:T,name:M,optionalTag:S=!1,optionalText:O,requiredTag:N=!1,requiredText:U,tagText:X=null,placeholder:te,prefix:$e,suffix:q,type:C="text",useWrapper:H=!0,omitSearchIcon:W=!1,value:Q,minLength:se,maxLength:ie,min:ue,max:ne,step:ge,size:Y,readonly:K,required:Ae,dataTestid:re,onChange:ae,skipForwardTestid:Re=!1,...Ve},Se)=>{const Ke=[a,"pkt-textinput"].join(" "),lt=C==="search"&&!k&&!W,we=C==="date"&&Q?Q.slice(0,10):Q,[Ne,Ge]=h.useState((Q==null?void 0:Q.length)||0),Xe=`${s}`,et=`${Xe}-label`,ce=t||et,be=Ie=>{var Me,xe;n&&Ge(((xe=(Me=Ie.currentTarget)==null?void 0:Me.value)==null?void 0:xe.length)||0),ae&&ae(Ie)};return h.useEffect(()=>{Q!==void 0&&Ge((Q==null?void 0:Q.length)||0)},[Q]),o.jsx(Os,{ariaDescribedby:e,className:Ke,disabled:l,errorMessage:d,forId:Xe,hasError:p,helptext:m,helptextDropdown:v,helptextDropdownButton:y,inline:g,label:T,optionalTag:S,optionalText:O,requiredTag:N,requiredText:U,tagText:X,useWrapper:H,counter:n,counterCurrent:Ne,counterMaxLength:r,children:o.jsxs("div",{className:"pkt-input__container","data-testid":re,"data-skip-forward-testid":Re?"true":void 0,children:[$e&&o.jsx("div",{className:"pkt-input-prefix",children:$e}),o.jsx("input",{...Ve,ref:Se,className:`pkt-input ${$?"pkt-input--fullwidth":""} ${r&&Ne>r?"pkt-input--counter-error":""}`,type:C,name:`${M||s}`,value:we,id:Xe,placeholder:te,autoComplete:i,disabled:l,"aria-invalid":p,"aria-errormessage":`${s}-error`,"aria-labelledby":ce,min:ue,max:ne,onChange:be,step:ge,minLength:se,maxLength:ie,size:Y,readOnly:K,required:Ae}),q&&o.jsxs("p",{className:"pkt-input-suffix",children:[q,k&&o.jsx(G,{className:"pkt-input-suffix-icon",name:k}),lt&&o.jsx(G,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!q&&k&&o.jsx(G,{className:"pkt-input-icon",name:k}),!q&&lt&&o.jsx(G,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})});fn.displayName="PktTextinput";const or=h.forwardRef(({mobileBreakpoint:s=768,tabletBreakpoint:e=1280,children:t,className:i,compact:n=!1,"data-mode":r,logOutButtonPlacement:a="none",logOut:l,openedMenu:d,showSearch:p=!1,onSearch:m,onSearchChange:v,searchValue:y,searchPlaceholder:k="Søk",representing:g,serviceLink:$,serviceClick:T,serviceName:M,user:S,userMenu:O,userMenuFooter:N,userOptions:U,canChangeRepresentation:X=!1,changeRepresentation:te,hideLogo:$e=!1,logoLink:q,logoClick:C,position:H="fixed",scrollBehavior:W="hide",slotMenuVariant:Q="icon-only",slotMenuText:se="Meny"},ie)=>{const ue=H==="fixed",ne=W==="hide";h.useEffect(()=>{N&&console.warn('PktHeaderService: The "userMenuFooter" prop is deprecated and will be removed in a future version. Please use "userMenu" instead.')},[N]),h.useEffect(()=>{U&&console.warn('PktHeaderService: The "userOptions" prop is no longer available. Please use "userMenu" instead.')},[U]),h.useEffect(()=>{S!=null&&S.shortname&&console.warn('PktHeaderService: The "shortname" property on the user object is deprecated and will be removed in a future version.'),g!=null&&g.shortname&&console.warn('PktHeaderService: The "shortname" property on the representing object is deprecated and will be removed in a future version.')},[S==null?void 0:S.shortname,g==null?void 0:g.shortname]);const ge=h.useMemo(()=>{if(S!=null&&S.lastLoggedIn)return typeof S.lastLoggedIn=="string"?S.lastLoggedIn:new Date(S.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"})},[S==null?void 0:S.lastLoggedIn]),[Y,K]=h.useState(d||"none");h.useEffect(()=>{d!==void 0&&K(d)},[d]);const[Ae,re]=h.useState(!1),[ae,Re]=h.useState(0),[Ve,Se]=h.useState(!1),[Ke,lt]=h.useState(!1),we=h.useRef(null),Ne=h.useRef(null),Ge=h.useRef(null),Xe=h.useRef(null),et=h.useRef(null),ce=h.useRef(null),be=h.useRef(null),Ie=h.useRef(!1),Me=bm(we),xe=Me<s,V=Me<e,De=h.useCallback(u=>{we.current=u,typeof ie=="function"?ie(u):ie&&(ie.current=u)},[ie]);ym(ue&&xe&&Y!=="none");const he=h.useCallback((u,_)=>{const x=u.relatedTarget;let L;switch(_){case"user":L=Ne;break;case"slot":L=Ge;break;case"search":L=Xe;break;default:return}const j=L.current;j&&(!x||!j.contains(x))&&K("none")},[]),ye=h.useCallback(()=>{Ie.current&&be.current&&document.contains(be.current)&&be.current.focus(),be.current=null,Ie.current=!1},[]);h.useEffect(()=>{const u=x=>{S&&Y==="user"&&!x.target.closest(".pkt-header-service__user-container")&&K("none"),Y==="slot"&&!x.target.closest(".pkt-header-service__slot-container")&&K("none"),Y==="search"&&!x.target.closest(".pkt-header-service__search-container")&&!x.target.closest(".pkt-header-service__search-input")&&K("none")},_=x=>{x.key==="Escape"&&Y!=="none"&&(x.preventDefault(),Ie.current=!0,K("none"))};if(Y!=="none")return document.addEventListener("mousedown",u),document.addEventListener("keydown",_),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",_)};ye()},[Y,S,ye]),h.useEffect(()=>{const u=()=>{if(ne){const _=window.pageYOffset||document.documentElement.scrollTop;if(_<0||Math.abs(_-ae)<60)return;re(_>ae),Re(_)}};return document&&window.addEventListener("scroll",u),()=>{document&&window.removeEventListener("scroll",u)}},[ne,ae]);const Ue=h.useCallback(u=>{const _=u==="slot"?Ge:Xe,x=u==="slot"?et:ce;if(!_.current||!x.current||!V||xe)return;const L=_.current.getBoundingClientRect(),j=x.current.offsetWidth,R=L.left+j>window.innerWidth;u==="slot"?Se(R):lt(R)},[V,xe]),ct=h.useCallback(u=>{Y!=="none"?K("none"):(be.current=document.activeElement,K(u))},[Y]);h.useEffect(()=>{(Y==="slot"||Y==="search")&&requestAnimationFrame(()=>{Ue(Y)})},[Y,Ue]);const f=o.jsxs("header",{className:oe("pkt-header-service",n&&"pkt-header-service--compact",xe&&"pkt-header-service--mobile",V&&"pkt-header-service--tablet",ue&&"pkt-header-service--fixed",ne&&"pkt-header-service--scroll-to-hide",Ae&&"pkt-header-service--hidden",i),"data-mode":r,ref:De,children:[o.jsxs("div",{className:oe("pkt-header-service__logo-area",(!M||M==="")&&"pkt-header-service__logo-area--without-service"),children:[!$e&&o.jsx("span",{className:"pkt-header-service__logo",children:q?o.jsx("a",{href:q,"aria-label":"Tilbake til forside",children:o.jsx(G,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/15.4/logos/"})}):C?o.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header-service__logo-link",onClick:C,children:o.jsx(G,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/15.4/logos/"})}):o.jsx(G,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/15.4/logos/"})}),M&&o.jsx("span",{className:"pkt-header-service__service-name",children:$?o.jsx(hn,{href:$,className:"pkt-header-service__service-link ",children:M}):T?o.jsx("button",{className:"pkt-link-button pkt-link pkt-header-service__service-link",onClick:T,children:M}):o.jsx("span",{className:"pkt-header-service__service-link",children:M})})]}),o.jsxs("div",{className:"pkt-header-service__content",children:[o.jsxs("div",{className:oe("pkt-header-service__slot-container",Y==="slot"&&"is-open"),onBlur:u=>he(u,"slot"),ref:Ge,children:[V&&t&&o.jsx(at,{skin:"secondary",variant:Q,iconName:"menu",size:xe?"small":"medium",state:Y==="slot"?"active":"normal",onClick:()=>ct("slot"),"aria-expanded":Y==="slot","aria-controls":"mobile-slot-menu","aria-label":"Åpne meny",children:se}),o.jsx("div",{className:oe("pkt-header-service__slot-content",Ve&&"align-right"),id:"mobile-slot-menu",role:V?"menu":void 0,"aria-label":V?"Meny":void 0,ref:et,children:o.jsx("div",{className:"pkt-contents",children:t})})]}),p&&o.jsx(o.Fragment,{children:V?o.jsxs("div",{className:oe("pkt-header-service__search-container",Y==="search"&&"is-open"),onBlur:u=>he(u,"search"),ref:Xe,children:[o.jsx(at,{skin:"secondary",variant:"icon-only",iconName:"magnifying-glass-big",size:xe?"small":"medium",onClick:()=>ct("search"),state:Y==="search"?"active":"normal","aria-expanded":Y==="search","aria-controls":"mobile-search-menu","aria-label":"Åpne søkefelt",children:"Søk"}),o.jsx("div",{className:oe("pkt-header-service__mobile-menu",Y==="search"&&"is-open",Ke&&"align-right"),ref:ce,children:Y==="search"&&o.jsx(fn,{id:"mobile-search-menu",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:k,value:y,autoFocus:!0,fullwidth:!0,onChange:u=>v==null?void 0:v(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(m==null||m(u.target.value))}})})]}):o.jsx(fn,{id:"header-service-search",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:k,value:y,onChange:u=>v==null?void 0:v(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(m==null||m(u.target.value))}})}),V&&l&&(a==="header"||a==="both")&&o.jsx(at,{skin:"secondary",size:xe?"small":"medium",variant:"icon-only",iconName:"exit",onClick:l,children:"Logg ut"})]}),o.jsxs("div",{className:"pkt-header-service__user",children:[S&&o.jsxs("div",{className:"pkt-header-service__user-container",onBlur:u=>he(u,"user"),ref:Ne,children:[o.jsxs(at,{className:oe("pkt-header-service__user-button",xe&&"pkt-header-service__user-button--mobile"),skin:"secondary",size:xe?"small":"medium",state:Y==="user"?"active":"normal",variant:"icons-right-and-left",iconName:"user",secondIconName:Y==="user"?"chevron-thin-up":"chevron-thin-down",onClick:()=>ct("user"),children:[o.jsx("span",{className:"pkt-sr-only",children:"Brukermeny: "}),(g==null?void 0:g.name)||S.name]}),Y==="user"&&S&&o.jsx("div",{className:oe(xe?"pkt-header-service__mobile-menu":"pkt-header-service__user-menu","is-open"),children:o.jsx(ko,{user:S,formattedLastLoggedIn:ge,representing:g,userMenu:O,canChangeRepresentation:X,changeRepresentation:te,logoutOnClick:a==="userMenu"||a==="both"?l:void 0})})]}),!xe&&l&&(a==="header"||a==="both")&&o.jsx(at,{skin:"tertiary",size:"medium",variant:"icon-right",iconName:"exit",onClick:l,children:"Logg ut"})]})]});return ue?o.jsxs("div",{className:"pkt-header-service-wrapper",children:[f,o.jsx("div",{className:oe("pkt-header-service-spacer",n&&"pkt-header-service-spacer--compact",S&&"pkt-header-service-spacer--has-user",xe&&"pkt-header-service-spacer--mobile",V&&"pkt-header-service-spacer--tablet")})]}):f});or.displayName="PktHeaderService";const _o=h.forwardRef((s,e)=>o.jsx(or,{...s,ref:e}));_o.displayName="PktHeader";const $m=It({tagName:"pkt-heading",elementClass:ss,react:h,displayName:"PktHeading"}),$o=h.forwardRef(({children:s,...e},t)=>o.jsx($m,{"data-testid":"pkt-heading",...e,ref:t,children:s}));$o.displayName="PktHeading";const wm=It({tagName:"pkt-helptext",elementClass:Yt,react:h,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),wo=h.forwardRef(({children:s,...e},t)=>o.jsx(wm,{...e,ref:t,children:o.jsx("div",{className:"pkt-contents",children:s})}));wo.displayName="PktHelptext";const xo=h.forwardRef(({label:s,id:e,children:t,...i},n)=>o.jsxs("div",{className:"pkt-form-group",children:[o.jsx("label",{htmlFor:e,className:"pkt-form-label",children:s}),o.jsx("input",{className:"pkt-form-input",id:e,...i,ref:n}),t]}));xo.displayName="PktInput";const So=({children:s,skin:e,title:t,href:i,iconName:n,openInNewTab:r,external:a,className:l,...d})=>{const p=["pkt-linkcard",e&&`pkt-linkcard--${e}`].filter(Boolean).join(" "),m=["pkt-linkcard__title",a&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return o.jsxs("a",{...d,href:i,className:oe(p,l),target:r?"_blank":"_self",rel:r?"noopener noreferrer":void 0,children:[n&&o.jsx(G,{className:"pkt-link__icon",name:n}),t&&o.jsx("div",{className:oe(m),children:t}),o.jsx("div",{className:"pkt-linkcard__text",children:s})]})};So.displayName="PktLinkCard";const xm=It({tagName:"pkt-loader",elementClass:Pt,react:h,displayName:"PktLoader",events:{}}),Co=h.forwardRef(({children:s,...e},t)=>o.jsx(xm,{...e,ref:t,children:o.jsx("div",{className:"pkt-contents",children:s})}));Co.displayName="PktLoader";const To=({children:s,className:e,skin:t,title:i,compact:n,closable:r,onClose:a,...l})=>{const[d,p]=h.useState(!1),m={"pkt-messagebox":!0,"pkt-messagebox--compact":n,[`pkt-messagebox--${t}`]:t,"pkt-messagebox--closable":r,"pkt-hide":d},v=h.createRef(),y=h.useCallback(()=>{p(!0),a&&a()},[p,a]);return o.jsxs("div",{...l,className:oe(m,e),ref:v,children:[r&&o.jsx("div",{className:"pkt-messagebox__close",children:o.jsx("button",{onClick:y,className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only","aria-label":"Lukk",children:o.jsx(G,{name:"close",className:"pkt-link__icon"})})}),i&&o.jsx("div",{className:"pkt-messagebox__title",children:i}),o.jsx("div",{className:"pkt-messagebox__text",children:s})]})};To.displayName="PktMessagebox";const Sm=It({tagName:"pkt-progressbar",elementClass:Fe,react:h,displayName:"PktProgressbar",events:{}}),mn=h.forwardRef(({children:s,...e},t)=>o.jsx(Sm,{ref:t,...e,children:o.jsx("div",{className:"pkt-contents",children:s})}));mn.displayName="PktProgressbar";const No=h.forwardRef(({id:s,name:e,label:t,className:i,hasTile:n=!1,disabled:r=!1,checkHelptext:a,hasError:l=!1,defaultChecked:d,checked:p,optionalTag:m,optionalText:v,requiredTag:y,requiredText:k,tagText:g,...$},T)=>{const M=[i,"pkt-input-check"].filter(Boolean).join(" "),S=["pkt-input-check__input",n?"pkt-input-check__input--tile":"",r&&n?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),O=["pkt-input-check__input-checkbox",l?"pkt-input-check__input-checkbox--error":""].filter(Boolean).join(" "),N=["pkt-input-check__input-label",r?"pkt-input-check__input-label--disabled":""].filter(Boolean).join(" "),U=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),X=()=>o.jsxs(o.Fragment,{children:[g&&o.jsx("span",{className:U+" pkt-tag--gray",children:g}),m&&o.jsx("span",{className:U+" pkt-tag--blue-light",children:v}),y&&o.jsx("span",{className:U+" pkt-tag--beige",children:k})]});return o.jsx("div",{className:M,children:o.jsxs("div",{className:S,children:[o.jsx("input",{ref:T,id:s,type:"radio",name:e,disabled:r,className:O,...p!==void 0?{checked:p}:{defaultChecked:d},...$}),o.jsxs("label",{className:N,htmlFor:s,children:[t," ",X(),a&&o.jsx("div",{className:"pkt-input-check__input-helptext",children:a})]})]})})});No.displayName="PktRadioButton";const Mo=h.forwardRef(({appearance:s="local",disabled:e=!1,fullwidth:t=!1,id:i,label:n,name:r,placeholder:a="Søk…",suggestions:l,value:d="",action:p,method:m,onChange:v,onSearch:y,onSuggestionClick:k,...g},$)=>{const T=(N,U)=>{N?N():k&&k(U)},M=N=>{d=N.target.value},S=`pkt-searchinput pkt-searchinput--${s} ${t?"pkt-searchinput--fullwidth":""}`;let O;return p?O=N=>o.jsx("form",{role:"search",className:S,action:p,method:m,children:N}):O=N=>o.jsx("div",{role:"search",className:S,children:N}),O(o.jsxs(o.Fragment,{children:[n&&o.jsx("label",{htmlFor:n?i:void 0,className:n?"pkt-inputwrapper__label":"",children:n}),o.jsxs("div",{className:s==="local"?"pkt-input__container":"pkt-searchinput__field",children:[o.jsx("input",{className:`pkt-input ${t?"pkt-input--fullwidth":""}`,type:"search",name:r||i,id:i,placeholder:a,defaultValue:d,disabled:e,autoComplete:"off","aria-autocomplete":"list",ref:$,"aria-controls":`${i}-suggestions`,onChange:v||M,onKeyUp:y&&(N=>{N.key==="Enter"&&(N.preventDefault(),y(d))}),...g}),o.jsx(at,{className:`pkt-searchinput__button ${s==="local"?"pkt-input-icon":""}`,variant:"icon-only",iconName:"magnifying-glass-big",skin:s==="local"?"tertiary":"primary",color:s==="global"?"yellow":void 0,type:"submit",disabled:e,onClick:y&&(N=>{N.preventDefault(),y(d)}),children:n||a})]}),l&&o.jsx("ul",{id:`${i}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:l.map((N,U)=>o.jsx("li",{children:h.createElement(N.href?"a":N.onClick?"button":"div",{href:N.href,className:`pkt-searchinput__suggestion ${N.onClick?"pkt-link-button":""} ${N.href||N.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:N.onClick?"button":void 0,onClick:()=>T(N.onClick,U),onKeyUp:X=>X.key==="Enter"&&T(N.onClick,U)},o.jsxs(o.Fragment,{children:[N.title&&o.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:N.title}),N.text&&o.jsx("p",{className:"pkt-searchinput__suggestion-text",children:N.text})]}))},`search-suggestion-${U}`))})]}))});Mo.displayName="PktSearchInput";const Do=h.forwardRef(({ariaDescribedby:s,ariaLabelledby:e,children:t,className:i,disabled:n=!1,errorMessage:r,hasError:a,helptext:l,helptextDropdown:d,helptextDropdownButton:p,id:m,inline:v=!1,fullwidth:y=!1,label:k,name:g,optionalTag:$=!1,optionalText:T,requiredTag:M=!1,requiredText:S,tagText:O,...N},U)=>{const X=[i,"pkt-select"].join(" ");return o.jsx(Os,{className:X,forId:`${m}-input`,label:k,helptext:l,helptextDropdown:d,helptextDropdownButton:p,optionalTag:$,optionalText:T,requiredTag:M,requiredText:S,tagText:O,hasError:a,errorMessage:r,disabled:n,inline:v,ariaDescribedby:s,children:o.jsx("select",{ref:U,className:`pkt-input ${y?"pkt-input--fullwidth":""}`,"aria-invalid":a,"aria-errormessage":`${m}-error`,"aria-labelledby":e||void 0,disabled:n,id:`${m}-input`,name:g||m,...N,children:t})})});Do.displayName="PktSelect";const Cm=o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:o.jsx("circle",{cx:"12",cy:"12",r:"7",style:{fill:"var(--pkt-color-grays-grey-200, #CCC)"}})}),Tm=o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[o.jsx("circle",{opacity:".15",cx:"12",cy:"12",r:"12",fill:"#2A2859"}),o.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"#2A2859"})]}),Nm=o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[o.jsx("path",{fill:"#2A2859",d:"M3 3h18v18H3z"}),o.jsx("path",{d:"m10.34 16-1.11-1.14L7 12.58l1.11-1.15 2.23 2.28L15.88 8 17 9.15l-5.55 5.71L10.34 16Z",fill:"#F1FDFF"})]}),Mm=({children:s,className:e,status:t="incomplete",title:i})=>o.jsxs("li",{className:oe("pkt-step",e,`pkt-step--${t}`),"data-testid":"pkt-step",children:[o.jsx("span",{className:"pkt-step__line pkt-step__line--1","aria-hidden":!0}),o.jsx("span",{className:"pkt-step__line pkt-step__line--2","aria-hidden":!0}),o.jsx("span",{className:oe("pkt-step__indicator"),children:t==="current"?Tm:t==="completed"?Nm:Cm}),o.jsx("span",{className:"pkt-step__line pkt-step__line--3","aria-hidden":!0}),o.jsxs("div",{className:"pkt-step__wrapper",children:[o.jsx("div",{className:"pkt-step__title",children:i}),o.jsx("div",{className:"pkt-step__content",children:s})]})]}),Oo=h.forwardRef(({activeStep:s,className:e,children:t,hideNonActiveSteps:i=!1,hideNonActiveStepsContent:n=!0,orientation:r="vertical",...a},l)=>{const d=oe(e,"pkt-stepper",r==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),p=h.Children.map(t,(m,v)=>h.isValidElement(m)?h.cloneElement(m,{className:oe(m.props.className,{"pkt-step--hideStep":i&&v!==s,"pkt-step--hideContent":n&&v!==s})}):m);return o.jsx("ol",{"data-testid":"pkt-stepper",className:d,ref:l,...a,children:p})});Oo.displayName="PktStepper";const Dm=({className:s,compact:e=!1,skin:t="basic",responsiveView:i=!0,children:n,...r})=>o.jsx("table",{"data-testid":"pkt-table",className:oe(s,"pkt-table",{"pkt-table--responsive":i,"pkt-table--compact":e,"pkt-table--basic":t==="basic","pkt-table--zebra-blue":t==="zebra-blue"}),role:"table",...r,children:n}),Om=({id:s,children:e,className:t,...i})=>o.jsx("tbody",{id:s,className:oe(t,"pkt-table__body",{}),...i,role:"rowgroup",children:e}),Em=({children:s,className:e,dataLabel:t,...i})=>o.jsx("td",{className:oe(e,"pkt-table__data-cell",{}),"data-label":t,role:"cell","data-testid":"pkt-table__data-cell",...i,children:s}),Pm=({className:s,children:e,...t})=>o.jsx("thead",{className:oe(s,"pkt-table__header",{}),role:"rowgroup",...t,children:e}),Am=({className:s,children:e,...t})=>o.jsx("th",{className:oe(s,"pkt-table__header-cell",{}),role:"columnheader",...t,children:e}),Im=({className:s,children:e,...t})=>o.jsx("tr",{className:oe(s,"pkt-table__row",{}),role:"row",...t,children:e}),lr=h.forwardRef(({children:s,active:e,href:t,onClick:i,icon:n,controls:r,tag:a,tagSkin:l,index:d=0},p)=>{const{arrowNav:m,registerTabRef:v,handleKeyPress:y,selectTab:k}=Lm(),$={"aria-selected":m?!!e:void 0,"aria-controls":r,role:m?"tab":void 0,onKeyUp:M=>y(d,M),onClick:M=>{k(d),i==null||i(M)},tabIndex:e||!m?void 0:-1,ref:M=>{v(d,M),typeof p=="function"?p(M):p&&(p.current=M)}},T=o.jsxs(o.Fragment,{children:[n&&o.jsx(G,{name:n,className:"pkt-icon--small"}),s,a&&o.jsx(dn,{skin:l,size:"small",children:a})]});return t?o.jsx("a",{...$,href:t,className:`pkt-tabs__link ${e?"active":""}`,children:T}):o.jsx("button",{...$,type:"button",className:`pkt-tabs__button pkt-link-button ${e?"active":""}`,children:T})});lr.displayName="PktTabItem";const Eo=h.createContext(null),Lm=()=>{const s=h.useContext(Eo);if(!s)throw new Error("TabItem must be used within a Tabs component");return s},Po=h.forwardRef(({arrowNav:s=!0,disableArrowNav:e=!1,tabs:t,onTabSelected:i,children:n},r)=>{const a=h.useRef([]),l=s&&!e,p=n&&h.Children.count(n)>0?h.Children.count(n):(t==null?void 0:t.length)||0;h.useEffect(()=>{a.current=a.current.slice(0,p)},[p]);const m=g=>{const $=t==null?void 0:t[g];$!=null&&$.action&&$.action(g),i&&i(g)},v=(g,$)=>{var T,M;l&&($.code==="ArrowLeft"&&g!==0&&((T=a.current[g-1])==null||T.focus()),$.code==="ArrowRight"&&g<p-1&&((M=a.current[g+1])==null||M.focus()),($.code==="ArrowDown"||$.code==="Space")&&m(g))},y=(g,$)=>{a.current[g]=$},k=t==null?void 0:t.map((g,$)=>{var T,M;return o.jsx(lr,{active:g.active,href:g.href,onClick:()=>m($),icon:g.icon,controls:g.controls,tag:(T=g.tag)==null?void 0:T.text,tagSkin:(M=g.tag)==null?void 0:M.skin,index:$,children:g.text},$)});return o.jsx(Eo.Provider,{value:{arrowNav:l,registerTabRef:y,handleKeyPress:v,selectTab:m},children:o.jsx("div",{className:"pkt-tabs",ref:r,children:o.jsx("div",{className:"pkt-tabs__list",role:l?"tablist":"navigation",children:n||k})})})});Po.displayName="PktTabs";var Rs=window.CustomEvent;(!Rs||typeof Rs=="object")&&(Rs=function(s,e){e=e||{};var t=document.createEvent("CustomEvent");return t.initCustomEvent(s,!!e.bubbles,!!e.cancelable,e.detail||null),t},Rs.prototype=window.Event.prototype);function Ao(s,e){var t="on"+e.type.toLowerCase();return typeof s[t]=="function"&&s[t](e),s.dispatchEvent(e)}function Bm(s){for(;s&&s!==document.body;){var e=window.getComputedStyle(s),t=function(i,n){return!(e[i]===void 0||e[i]===n)};if(e.opacity<1||t("zIndex","auto")||t("transform","none")||t("mixBlendMode","normal")||t("filter","none")||t("perspective","none")||e.isolation==="isolate"||e.position==="fixed"||e.webkitOverflowScrolling==="touch")return!0;s=s.parentElement}return!1}function Ii(s){for(;s;){if(s.localName==="dialog")return s;s.parentElement?s=s.parentElement:s.parentNode?s=s.parentNode.host:s=null}return null}function Io(s){for(;s&&s.shadowRoot&&s.shadowRoot.activeElement;)s=s.shadowRoot.activeElement;s&&s.blur&&s!==document.body&&s.blur()}function Fm(s,e){for(var t=0;t<s.length;++t)if(s[t]===e)return!0;return!1}function cr(s){return!s||!s.hasAttribute("method")?!1:s.getAttribute("method").toLowerCase()==="dialog"}function Lo(s){var e=["button","input","keygen","select","textarea"],t=e.map(function(a){return a+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');var i=s.querySelector(t.join(", "));if(!i&&"attachShadow"in Element.prototype)for(var n=s.querySelectorAll("*"),r=0;r<n.length&&!(n[r].tagName&&n[r].shadowRoot&&(i=Lo(n[r].shadowRoot),i));r++);return i}function Bo(s){return s.isConnected||document.body.contains(s)}function Fo(s){if(s.submitter)return s.submitter;var e=s.target;if(!(e instanceof HTMLFormElement))return null;var t=le.formSubmitter;if(!t){var i=s.target,n="getRootNode"in i&&i.getRootNode()||document;t=n.activeElement}return!t||t.form!==e?null:t}function Hm(s){if(!s.defaultPrevented){var e=s.target,t=le.imagemapUseValue,i=Fo(s);t===null&&i&&(t=i.value);var n=Ii(e);if(n){var r=i&&i.getAttribute("formmethod")||e.getAttribute("method");r==="dialog"&&(s.preventDefault(),t!=null?n.close(t):n.close())}}}function Ho(s){if(this.dialog_=s,this.replacedStyleTop_=!1,this.openAsModal_=!1,s.hasAttribute("role")||s.setAttribute("role","dialog"),s.show=this.show.bind(this),s.showModal=this.showModal.bind(this),s.close=this.close.bind(this),s.addEventListener("submit",Hm,!1),"returnValue"in s||(s.returnValue=""),"MutationObserver"in window){var e=new MutationObserver(this.maybeHideModal.bind(this));e.observe(s,{attributes:!0,attributeFilter:["open"]})}else{var t=!1,i=(function(){t?this.downgradeModal():this.maybeHideModal(),t=!1}).bind(this),n,r=function(a){if(a.target===s){var l="DOMNodeRemoved";t|=a.type.substr(0,l.length)===l,window.clearTimeout(n),n=window.setTimeout(i,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(a){s.addEventListener(a,r)})}Object.defineProperty(s,"open",{set:this.setOpen.bind(this),get:s.hasAttribute.bind(s,"open")}),this.backdrop_=document.createElement("div"),this.backdrop_.className="backdrop",this.backdrop_.addEventListener("mouseup",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("mousedown",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("click",this.backdropMouseEvent_.bind(this))}Ho.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&Bo(this.dialog_)||this.downgradeModal()},downgradeModal:function(){this.openAsModal_&&(this.openAsModal_=!1,this.dialog_.style.zIndex="",this.replacedStyleTop_&&(this.dialog_.style.top="",this.replacedStyleTop_=!1),this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_),le.dm.removeDialog(this))},setOpen:function(s){s?this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open",""):(this.dialog_.removeAttribute("open"),this.maybeHideModal())},backdropMouseEvent_:function(s){if(this.dialog_.hasAttribute("tabindex"))this.dialog_.focus();else{var e=document.createElement("div");this.dialog_.insertBefore(e,this.dialog_.firstChild),e.tabIndex=-1,e.focus(),this.dialog_.removeChild(e)}var t=document.createEvent("MouseEvents");t.initMouseEvent(s.type,s.bubbles,s.cancelable,window,s.detail,s.screenX,s.screenY,s.clientX,s.clientY,s.ctrlKey,s.altKey,s.shiftKey,s.metaKey,s.button,s.relatedTarget),this.dialog_.dispatchEvent(t),s.stopPropagation()},focus_:function(){var s=this.dialog_.querySelector("[autofocus]:not([disabled])");!s&&this.dialog_.tabIndex>=0&&(s=this.dialog_),s||(s=Lo(this.dialog_)),Io(document.activeElement),s&&s.focus()},updateZIndex:function(s,e){if(s<e)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=s,this.backdrop_.style.zIndex=e},show:function(){this.dialog_.open||(this.setOpen(!0),this.focus_())},showModal:function(){if(this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.");if(!Bo(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!le.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");Bm(this.dialog_.parentElement)&&console.warn("A dialog is being shown inside a stacking context. This may cause it to be unusable. For more information, see this link: https://github.com/GoogleChrome/dialog-polyfill/#stacking-context"),this.setOpen(!0),this.openAsModal_=!0,le.needsCentering(this.dialog_)?(le.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(s){if(!this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.");this.setOpen(!1),s!==void 0&&(this.dialog_.returnValue=s);var e=new Rs("close",{bubbles:!1,cancelable:!1});Ao(this.dialog_,e)}};var le={};if(le.reposition=function(s){var e=document.body.scrollTop||document.documentElement.scrollTop,t=e+(window.innerHeight-s.offsetHeight)/2;s.style.top=Math.max(e,t)+"px"},le.isInlinePositionSetByStylesheet=function(s){for(var e=0;e<document.styleSheets.length;++e){var t=document.styleSheets[e],i=null;try{i=t.cssRules}catch{}if(i)for(var n=0;n<i.length;++n){var r=i[n],a=null;try{a=document.querySelectorAll(r.selectorText)}catch{}if(!(!a||!Fm(a,s))){var l=r.style.getPropertyValue("top"),d=r.style.getPropertyValue("bottom");if(l&&l!=="auto"||d&&d!=="auto")return!0}}}return!1},le.needsCentering=function(s){var e=window.getComputedStyle(s);return e.position!=="absolute"||s.style.top!=="auto"&&s.style.top!==""||s.style.bottom!=="auto"&&s.style.bottom!==""?!1:!le.isInlinePositionSetByStylesheet(s)},le.forceRegisterDialog=function(s){if((window.HTMLDialogElement||s.showModal)&&console.warn("This browser already supports <dialog>, the polyfill may not work correctly",s),s.localName!=="dialog")throw new Error("Failed to register dialog: The element is not a dialog.");new Ho(s)},le.registerDialog=function(s){s.showModal||le.forceRegisterDialog(s)},le.DialogManager=function(){this.pendingDialogStack=[];var s=this.checkDOM_.bind(this);this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",(function(e){this.forwardTab_=void 0,e.stopPropagation(),s([])}).bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=100150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver(function(e){var t=[];e.forEach(function(i){for(var n=0,r;r=i.removedNodes[n];++n){if(r instanceof Element)r.localName==="dialog"&&t.push(r);else continue;t=t.concat(r.querySelectorAll("dialog"))}}),t.length&&s(t)}))},le.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0),document.addEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})},le.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},le.DialogManager.prototype.updateStacking=function(){for(var s=this.zIndexHigh_,e=0,t;t=this.pendingDialogStack[e];++e)t.updateZIndex(--s,--s),e===0&&(this.overlay.style.zIndex=--s);var i=this.pendingDialogStack[0];if(i){var n=i.dialog.parentNode||document.body;n.appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},le.DialogManager.prototype.containedByTopDialog_=function(s){for(;s=Ii(s);){for(var e=0,t;t=this.pendingDialogStack[e];++e)if(t.dialog===s)return e===0;s=s.parentElement}return!1},le.DialogManager.prototype.handleFocus_=function(s){var e=s.composedPath?s.composedPath()[0]:s.target;if(!this.containedByTopDialog_(e)&&document.activeElement!==document.documentElement&&(s.preventDefault(),s.stopPropagation(),Io(e),this.forwardTab_!==void 0)){var t=this.pendingDialogStack[0],i=t.dialog,n=i.compareDocumentPosition(e);return n&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?t.focus_():e!==document.documentElement&&document.documentElement.focus()),!1}},le.DialogManager.prototype.handleKey_=function(s){if(this.forwardTab_=void 0,s.keyCode===27){s.preventDefault(),s.stopPropagation();var e=new Rs("cancel",{bubbles:!1,cancelable:!0}),t=this.pendingDialogStack[0];t&&Ao(t.dialog,e)&&t.dialog.close()}else s.keyCode===9&&(this.forwardTab_=!s.shiftKey)},le.DialogManager.prototype.checkDOM_=function(s){var e=this.pendingDialogStack.slice();e.forEach(function(t){s.indexOf(t.dialog)!==-1?t.downgradeModal():t.maybeHideModal()})},le.DialogManager.prototype.pushDialog=function(s){var e=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=e?!1:(this.pendingDialogStack.unshift(s)===1&&this.blockDocument(),this.updateStacking(),!0)},le.DialogManager.prototype.removeDialog=function(s){var e=this.pendingDialogStack.indexOf(s);e!==-1&&(this.pendingDialogStack.splice(e,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())},le.dm=new le.DialogManager,le.formSubmitter=null,le.imagemapUseValue=null,window.HTMLDialogElement===void 0){var Vo=document.createElement("form");if(Vo.setAttribute("method","dialog"),Vo.method!=="dialog"){var ei=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(ei){var Vm=ei.get;ei.get=function(){return cr(this)?"dialog":Vm.call(this)};var Um=ei.set;ei.set=function(s){return typeof s=="string"&&s.toLowerCase()==="dialog"?this.setAttribute("method",s):Um.call(this,s)},Object.defineProperty(HTMLFormElement.prototype,"method",ei)}}document.addEventListener("click",function(s){if(le.formSubmitter=null,le.imagemapUseValue=null,!s.defaultPrevented){var e=s.target;if("composedPath"in s){var t=s.composedPath();e=t.shift()||e}if(!(!e||!cr(e.form))){var i=e.type==="submit"&&["button","input"].indexOf(e.localName)>-1;if(!i){if(!(e.localName==="input"&&e.type==="image"))return;le.imagemapUseValue=s.offsetX+","+s.offsetY}var n=Ii(e);n&&(le.formSubmitter=e)}}},!1),document.addEventListener("submit",function(s){var e=s.target,t=Ii(e);if(!t){var i=Fo(s),n=i&&i.getAttribute("formmethod")||e.getAttribute("method");n==="dialog"&&s.preventDefault()}});var jm=HTMLFormElement.prototype.submit,qm=function(){if(!cr(this))return jm.call(this);var s=Ii(this);s&&s.close()};HTMLFormElement.prototype.submit=qm}const Wm=Object.freeze(Object.defineProperty({__proto__:null,default:le},Symbol.toStringTag,{value:"Module"}));A.FileItem=fo,A.ItemRenderers=ar,A.PktAccordion=hr,A.PktAccordionItem=Ea,A.PktAlert=rn,A.PktBackLink=Aa,A.PktBreadcrumbs=Ia,A.PktButton=at,A.PktCalendar=er,A.PktCard=ao,A.PktCheckbox=oo,A.PktCombobox=lo,A.PktConsent=ln,A.PktDatepicker=ho,A.PktFileUpload=yo,A.PktFooter=gm,A.PktFooterSimple=vm,A.PktHeader=_o,A.PktHeaderService=or,A.PktHeading=$o,A.PktHelptext=wo,A.PktIcon=G,A.PktInput=xo,A.PktInputWrapper=Os,A.PktLink=hn,A.PktLinkCard=So,A.PktLoader=Co,A.PktMessagebox=To,A.PktModal=ir,A.PktProgressbar=mn,A.PktRadioButton=No,A.PktSearchInput=Mo,A.PktSelect=Do,A.PktStep=Mm,A.PktStepper=Oo,A.PktTabItem=lr,A.PktTable=Dm,A.PktTableBody=Om,A.PktTableDataCell=Em,A.PktTableHeader=Pm,A.PktTableHeaderCell=Am,A.PktTableRow=Im,A.PktTabs=Po,A.PktTag=dn,A.PktTextarea=sr,A.PktTextinput=fn,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})}));
1693
+ */var Pa;function Ch(){return Pa||(Pa=1,(function(s){(function(){var e={}.hasOwnProperty;function t(){for(var r="",a=0;a<arguments.length;a++){var l=arguments[a];l&&(r=n(r,i(l)))}return r}function i(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var a="";for(var l in r)e.call(r,l)&&r[l]&&(a=n(a,l));return a}function n(r,a){return a?r?r+" "+a:r+a:r}s.exports?(t.default=t,s.exports=t):window.classNames=t})()})(Yn)),Yn.exports}var Th=Ch();const oe=Sh(Th),rn=({children:s,closeAlert:e,compact:t,title:i,date:n,ariaLive:r,"aria-live":a="polite",role:l="status",skin:d="info",className:p,...m})=>{const[b,y]=h.useState(!1),k={"pkt-alert":!0,"pkt-alert--compact":t,[`pkt-alert--${d}`]:d,"pkt-hide":b},g={"pkt-alert__grid":!0,"pkt-alert__noTitle":!i,"pkt-alert__noDate":!n},$=h.useCallback(()=>{y(!0),m.onClose&&m.onClose(new CustomEvent("close",{detail:{origin:event},bubbles:!0,composed:!0}))},[m.onClose,y]),T=r||a;return o.jsx("div",{...m,"aria-live":T,role:l,className:oe(k,p),children:o.jsxs("div",{className:oe(g),children:[o.jsx(Y,{className:"pkt-alert__icon","aria-hidden":"true",name:d==="info"?"alert-information":`alert-${d}`}),e&&o.jsx("div",{className:"pkt-alert__close",children:o.jsx(at,{tabIndex:0,"aria-label":"close",size:t?"small":"medium",type:"button",skin:"tertiary",iconName:"close",variant:"icon-only",onClick:$,children:o.jsx("span",{className:"sr-only",children:"Lukk"})})}),i&&o.jsx("div",{className:"pkt-alert__title",children:i}),o.jsx("div",{className:"pkt-alert__text",children:s}),n&&o.jsxs("div",{className:"pkt-alert__date",children:["Sist oppdatert: ",n]})]})})};rn.displayName="PktAlert";const Aa=It({tagName:"pkt-backlink",elementClass:Hs,react:h,displayName:"PktBackLink"});Aa.displayName="PktBackLink";const Ia=h.forwardRef(({breadcrumbs:s,navigationType:e,renderLink:t,className:i,...n},r)=>{const a=s,l=a[a.length-2],d=[i,"pkt-breadcrumbs"].filter(Boolean).join(" "),p=t||(e==="router"?({href:m,className:b,children:y,props:k})=>o.jsx(zo.Link,{to:m,className:b,...k,children:y}):({href:m,className:b,children:y,props:k})=>o.jsx("a",{href:m,className:b,...k,children:y}));return o.jsxs("nav",{ref:r,"aria-label":"brødsmulemeny",className:d,children:[o.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:a.map((m,b)=>o.jsx("li",{className:"pkt-breadcrumbs__item",children:b===a.length-1?o.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:o.jsx("span",{className:"pkt-breadcrumbs__text",children:m.text})}):p({href:m.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",children:o.jsxs(o.Fragment,{children:[o.jsx(Y,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),o.jsx("span",{className:"pkt-breadcrumbs__text",children:m.text})]}),props:n})},`breadcrumb-${b}`))}),p({href:l.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",children:o.jsxs(o.Fragment,{children:[o.jsx(Y,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),o.jsx("span",{className:"pkt-breadcrumbs__text",children:l.text})]}),props:n})]})});Ia.displayName="PktBreadcrumbs",window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/15.4/animations/";const at=h.forwardRef(({children:s,className:e,iconName:t="user",secondIconName:i="user",iconPath:n,secondIconPath:r,size:a="medium",fullWidth:l=!1,fullWidthOnMobile:d=!1,skin:p="primary",type:m="button",variant:b="label-only",state:y,color:k,isLoading:g=void 0,disabled:$=void 0,loadingAnimationPath:T=window.pktAnimationPath,...M},S)=>{const O=[e,"pkt-btn",a&&`pkt-btn--${a}`,l&&"pkt-btn--full",d&&"pkt-btn--full-small",p&&`pkt-btn--${p}`,b&&`pkt-btn--${b}`,k&&`pkt-btn--${k}`,y&&`pkt-btn--${y}`,g&&"pkt-btn--isLoading"].filter(Boolean).join(" ");return o.jsxs("button",{...M,"aria-busy":g||void 0,"aria-disabled":$||void 0,disabled:$,className:O,type:m,ref:S,children:[g&&o.jsx(Y,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:T}),b!=="label-only"&&o.jsx(Y,{className:"pkt-btn__icon",name:t,...n&&{path:n}}),o.jsx("span",{className:"pkt-btn__text",children:s}),b==="icons-right-and-left"&&o.jsx(Y,{className:"pkt-btn__icon",name:i,...r&&{path:r}})]})});at.displayName="PktButton";const La=6048e5,Nh=864e5,Ba=Symbol.for("constructDateFrom");function jt(s,e){return typeof s=="function"?s(e):s&&typeof s=="object"&&Ba in s?s[Ba](e):s instanceof Date?new s.constructor(e):new Date(e)}function kt(s,e){return jt(e||s,s)}function Fa(s,e,t){const i=kt(s,t==null?void 0:t.in);return isNaN(e)?jt(s,NaN):(e&&i.setDate(i.getDate()+e),i)}let Mh={};function an(){return Mh}function Ti(s,e){var l,d,p,m;const t=an(),i=(e==null?void 0:e.weekStartsOn)??((d=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:d.weekStartsOn)??t.weekStartsOn??((m=(p=t.locale)==null?void 0:p.options)==null?void 0:m.weekStartsOn)??0,n=kt(s,e==null?void 0:e.in),r=n.getDay(),a=(r<i?7:0)+r-i;return n.setDate(n.getDate()-a),n.setHours(0,0,0,0),n}function on(s,e){return Ti(s,{...e,weekStartsOn:1})}function Ha(s,e){const t=kt(s,e==null?void 0:e.in),i=t.getFullYear(),n=jt(t,0);n.setFullYear(i+1,0,4),n.setHours(0,0,0,0);const r=on(n),a=jt(t,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=on(a);return t.getTime()>=r.getTime()?i+1:t.getTime()>=l.getTime()?i:i-1}function Va(s){const e=kt(s),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+s-+t}function Ua(s,...e){const t=jt.bind(null,e.find(i=>typeof i=="object"));return e.map(t)}function Kn(s,e){const t=kt(s,e==null?void 0:e.in);return t.setHours(0,0,0,0),t}function Dh(s,e,t){const[i,n]=Ua(t==null?void 0:t.in,s,e),r=Kn(i),a=Kn(n),l=+r-Va(r),d=+a-Va(a);return Math.round((l-d)/Nh)}function Oh(s,e){const t=Ha(s,e),i=jt(s,0);return i.setFullYear(t,0,4),i.setHours(0,0,0,0),on(i)}function Eh(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function Ph(s){return!(!Eh(s)&&typeof s!="number"||isNaN(+kt(s)))}function Ah(s,e){const t=kt(s,e==null?void 0:e.in);return t.setHours(23,59,59,999),t}function Ih(s,e){const[t,i]=Ua(s,e.start,e.end);return{start:t,end:i}}function ja(s,e){const{start:t,end:i}=Ih(e==null?void 0:e.in,s);let n=+t>+i;const r=n?+t:+i,a=n?i:t;a.setHours(0,0,0,0);let l=1;const d=[];for(;+a<=r;)d.push(jt(t,a)),a.setDate(a.getDate()+l),a.setHours(0,0,0,0);return n?d.reverse():d}function Lh(s,e){const t=kt(s,e==null?void 0:e.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}const Bh={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Fh=(s,e,t)=>{let i;const n=Bh[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+i:i+" ago":i};function Gn(s){return(e={})=>{const t=e.width?String(e.width):s.defaultWidth;return s.formats[t]||s.formats[s.defaultWidth]}}const Hh={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Vh={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Uh={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},jh={date:Gn({formats:Hh,defaultWidth:"full"}),time:Gn({formats:Vh,defaultWidth:"full"}),dateTime:Gn({formats:Uh,defaultWidth:"full"})},qh={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Wh=(s,e,t,i)=>qh[s];function Ni(s){return(e,t)=>{const i=t!=null&&t.context?String(t.context):"standalone";let n;if(i==="formatting"&&s.formattingValues){const a=s.defaultFormattingWidth||s.defaultWidth,l=t!=null&&t.width?String(t.width):a;n=s.formattingValues[l]||s.formattingValues[a]}else{const a=s.defaultWidth,l=t!=null&&t.width?String(t.width):s.defaultWidth;n=s.values[l]||s.values[a]}const r=s.argumentCallback?s.argumentCallback(e):e;return n[r]}}const zh={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Yh={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Kh={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Gh={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Xh={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Qh={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Zh={ordinalNumber:(s,e)=>{const t=Number(s),i=t%100;if(i>20||i<10)switch(i%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},era:Ni({values:zh,defaultWidth:"wide"}),quarter:Ni({values:Yh,defaultWidth:"wide",argumentCallback:s=>s-1}),month:Ni({values:Kh,defaultWidth:"wide"}),day:Ni({values:Gh,defaultWidth:"wide"}),dayPeriod:Ni({values:Xh,defaultWidth:"wide",formattingValues:Qh,defaultFormattingWidth:"wide"})};function Mi(s){return(e,t={})=>{const i=t.width,n=i&&s.matchPatterns[i]||s.matchPatterns[s.defaultMatchWidth],r=e.match(n);if(!r)return null;const a=r[0],l=i&&s.parsePatterns[i]||s.parsePatterns[s.defaultParseWidth],d=Array.isArray(l)?Rh(l,b=>b.test(a)):Jh(l,b=>b.test(a));let p;p=s.valueCallback?s.valueCallback(d):d,p=t.valueCallback?t.valueCallback(p):p;const m=e.slice(a.length);return{value:p,rest:m}}}function Jh(s,e){for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t)&&e(s[t]))return t}function Rh(s,e){for(let t=0;t<s.length;t++)if(e(s[t]))return t}function ep(s){return(e,t={})=>{const i=e.match(s.matchPattern);if(!i)return null;const n=i[0],r=e.match(s.parsePattern);if(!r)return null;let a=s.valueCallback?s.valueCallback(r[0]):r[0];a=t.valueCallback?t.valueCallback(a):a;const l=e.slice(n.length);return{value:a,rest:l}}}const tp=/^(\d+)(th|st|nd|rd)?/i,sp=/\d+/i,ip={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},np={any:[/^b/i,/^(a|c)/i]},rp={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ap={any:[/1/i,/2/i,/3/i,/4/i]},op={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},lp={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},cp={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},dp={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},up={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},hp={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},pp={ordinalNumber:ep({matchPattern:tp,parsePattern:sp,valueCallback:s=>parseInt(s,10)}),era:Mi({matchPatterns:ip,defaultMatchWidth:"wide",parsePatterns:np,defaultParseWidth:"any"}),quarter:Mi({matchPatterns:rp,defaultMatchWidth:"wide",parsePatterns:ap,defaultParseWidth:"any",valueCallback:s=>s+1}),month:Mi({matchPatterns:op,defaultMatchWidth:"wide",parsePatterns:lp,defaultParseWidth:"any"}),day:Mi({matchPatterns:cp,defaultMatchWidth:"wide",parsePatterns:dp,defaultParseWidth:"any"}),dayPeriod:Mi({matchPatterns:up,defaultMatchWidth:"any",parsePatterns:hp,defaultParseWidth:"any"})},fp={code:"en-US",formatDistance:Fh,formatLong:jh,formatRelative:Wh,localize:Zh,match:pp,options:{weekStartsOn:0,firstWeekContainsDate:1}};function mp(s,e){const t=kt(s,e==null?void 0:e.in);return Dh(t,Lh(t))+1}function gp(s,e){const t=kt(s,e==null?void 0:e.in),i=+on(t)-+Oh(t);return Math.round(i/La)+1}function qa(s,e){var m,b,y,k;const t=kt(s,e==null?void 0:e.in),i=t.getFullYear(),n=an(),r=(e==null?void 0:e.firstWeekContainsDate)??((b=(m=e==null?void 0:e.locale)==null?void 0:m.options)==null?void 0:b.firstWeekContainsDate)??n.firstWeekContainsDate??((k=(y=n.locale)==null?void 0:y.options)==null?void 0:k.firstWeekContainsDate)??1,a=jt((e==null?void 0:e.in)||s,0);a.setFullYear(i+1,0,r),a.setHours(0,0,0,0);const l=Ti(a,e),d=jt((e==null?void 0:e.in)||s,0);d.setFullYear(i,0,r),d.setHours(0,0,0,0);const p=Ti(d,e);return+t>=+l?i+1:+t>=+p?i:i-1}function vp(s,e){var l,d,p,m;const t=an(),i=(e==null?void 0:e.firstWeekContainsDate)??((d=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:d.firstWeekContainsDate)??t.firstWeekContainsDate??((m=(p=t.locale)==null?void 0:p.options)==null?void 0:m.firstWeekContainsDate)??1,n=qa(s,e),r=jt((e==null?void 0:e.in)||s,0);return r.setFullYear(n,0,i),r.setHours(0,0,0,0),Ti(r,e)}function Wa(s,e){const t=kt(s,e==null?void 0:e.in),i=+Ti(t,e)-+vp(t,e);return Math.round(i/La)+1}function me(s,e){const t=s<0?"-":"",i=Math.abs(s).toString().padStart(e,"0");return t+i}const as={y(s,e){const t=s.getFullYear(),i=t>0?t:1-t;return me(e==="yy"?i%100:i,e.length)},M(s,e){const t=s.getMonth();return e==="M"?String(t+1):me(t+1,2)},d(s,e){return me(s.getDate(),e.length)},a(s,e){const t=s.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(s,e){return me(s.getHours()%12||12,e.length)},H(s,e){return me(s.getHours(),e.length)},m(s,e){return me(s.getMinutes(),e.length)},s(s,e){return me(s.getSeconds(),e.length)},S(s,e){const t=e.length,i=s.getMilliseconds(),n=Math.trunc(i*Math.pow(10,t-3));return me(n,e.length)}},Zs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},za={G:function(s,e,t){const i=s.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(i,{width:"abbreviated"});case"GGGGG":return t.era(i,{width:"narrow"});case"GGGG":default:return t.era(i,{width:"wide"})}},y:function(s,e,t){if(e==="yo"){const i=s.getFullYear(),n=i>0?i:1-i;return t.ordinalNumber(n,{unit:"year"})}return as.y(s,e)},Y:function(s,e,t,i){const n=qa(s,i),r=n>0?n:1-n;if(e==="YY"){const a=r%100;return me(a,2)}return e==="Yo"?t.ordinalNumber(r,{unit:"year"}):me(r,e.length)},R:function(s,e){const t=Ha(s);return me(t,e.length)},u:function(s,e){const t=s.getFullYear();return me(t,e.length)},Q:function(s,e,t){const i=Math.ceil((s.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return me(i,2);case"Qo":return t.ordinalNumber(i,{unit:"quarter"});case"QQQ":return t.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(i,{width:"wide",context:"formatting"})}},q:function(s,e,t){const i=Math.ceil((s.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return me(i,2);case"qo":return t.ordinalNumber(i,{unit:"quarter"});case"qqq":return t.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(i,{width:"wide",context:"standalone"})}},M:function(s,e,t){const i=s.getMonth();switch(e){case"M":case"MM":return as.M(s,e);case"Mo":return t.ordinalNumber(i+1,{unit:"month"});case"MMM":return t.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(i,{width:"wide",context:"formatting"})}},L:function(s,e,t){const i=s.getMonth();switch(e){case"L":return String(i+1);case"LL":return me(i+1,2);case"Lo":return t.ordinalNumber(i+1,{unit:"month"});case"LLL":return t.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(i,{width:"wide",context:"standalone"})}},w:function(s,e,t,i){const n=Wa(s,i);return e==="wo"?t.ordinalNumber(n,{unit:"week"}):me(n,e.length)},I:function(s,e,t){const i=gp(s);return e==="Io"?t.ordinalNumber(i,{unit:"week"}):me(i,e.length)},d:function(s,e,t){return e==="do"?t.ordinalNumber(s.getDate(),{unit:"date"}):as.d(s,e)},D:function(s,e,t){const i=mp(s);return e==="Do"?t.ordinalNumber(i,{unit:"dayOfYear"}):me(i,e.length)},E:function(s,e,t){const i=s.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(i,{width:"short",context:"formatting"});case"EEEE":default:return t.day(i,{width:"wide",context:"formatting"})}},e:function(s,e,t,i){const n=s.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return me(r,2);case"eo":return t.ordinalNumber(r,{unit:"day"});case"eee":return t.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(n,{width:"short",context:"formatting"});case"eeee":default:return t.day(n,{width:"wide",context:"formatting"})}},c:function(s,e,t,i){const n=s.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return me(r,e.length);case"co":return t.ordinalNumber(r,{unit:"day"});case"ccc":return t.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(n,{width:"narrow",context:"standalone"});case"cccccc":return t.day(n,{width:"short",context:"standalone"});case"cccc":default:return t.day(n,{width:"wide",context:"standalone"})}},i:function(s,e,t){const i=s.getDay(),n=i===0?7:i;switch(e){case"i":return String(n);case"ii":return me(n,e.length);case"io":return t.ordinalNumber(n,{unit:"day"});case"iii":return t.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(i,{width:"short",context:"formatting"});case"iiii":default:return t.day(i,{width:"wide",context:"formatting"})}},a:function(s,e,t){const n=s.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(s,e,t){const i=s.getHours();let n;switch(i===12?n=Zs.noon:i===0?n=Zs.midnight:n=i/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(s,e,t){const i=s.getHours();let n;switch(i>=17?n=Zs.evening:i>=12?n=Zs.afternoon:i>=4?n=Zs.morning:n=Zs.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(s,e,t){if(e==="ho"){let i=s.getHours()%12;return i===0&&(i=12),t.ordinalNumber(i,{unit:"hour"})}return as.h(s,e)},H:function(s,e,t){return e==="Ho"?t.ordinalNumber(s.getHours(),{unit:"hour"}):as.H(s,e)},K:function(s,e,t){const i=s.getHours()%12;return e==="Ko"?t.ordinalNumber(i,{unit:"hour"}):me(i,e.length)},k:function(s,e,t){let i=s.getHours();return i===0&&(i=24),e==="ko"?t.ordinalNumber(i,{unit:"hour"}):me(i,e.length)},m:function(s,e,t){return e==="mo"?t.ordinalNumber(s.getMinutes(),{unit:"minute"}):as.m(s,e)},s:function(s,e,t){return e==="so"?t.ordinalNumber(s.getSeconds(),{unit:"second"}):as.s(s,e)},S:function(s,e){return as.S(s,e)},X:function(s,e,t){const i=s.getTimezoneOffset();if(i===0)return"Z";switch(e){case"X":return Ka(i);case"XXXX":case"XX":return Ms(i);case"XXXXX":case"XXX":default:return Ms(i,":")}},x:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"x":return Ka(i);case"xxxx":case"xx":return Ms(i);case"xxxxx":case"xxx":default:return Ms(i,":")}},O:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Ya(i,":");case"OOOO":default:return"GMT"+Ms(i,":")}},z:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Ya(i,":");case"zzzz":default:return"GMT"+Ms(i,":")}},t:function(s,e,t){const i=Math.trunc(+s/1e3);return me(i,e.length)},T:function(s,e,t){return me(+s,e.length)}};function Ya(s,e=""){const t=s>0?"-":"+",i=Math.abs(s),n=Math.trunc(i/60),r=i%60;return r===0?t+String(n):t+String(n)+e+me(r,2)}function Ka(s,e){return s%60===0?(s>0?"-":"+")+me(Math.abs(s)/60,2):Ms(s,e)}function Ms(s,e=""){const t=s>0?"-":"+",i=Math.abs(s),n=me(Math.trunc(i/60),2),r=me(i%60,2);return t+n+e+r}const Ga=(s,e)=>{switch(s){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Xa=(s,e)=>{switch(s){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},bp={p:Xa,P:(s,e)=>{const t=s.match(/(P+)(p+)?/)||[],i=t[1],n=t[2];if(!n)return Ga(s,e);let r;switch(i){case"P":r=e.dateTime({width:"short"});break;case"PP":r=e.dateTime({width:"medium"});break;case"PPP":r=e.dateTime({width:"long"});break;case"PPPP":default:r=e.dateTime({width:"full"});break}return r.replace("{{date}}",Ga(i,e)).replace("{{time}}",Xa(n,e))}},yp=/^D+$/,kp=/^Y+$/,_p=["D","DD","YY","YYYY"];function $p(s){return yp.test(s)}function wp(s){return kp.test(s)}function xp(s,e,t){const i=Sp(s,e,t);if(console.warn(i),_p.includes(s))throw new RangeError(i)}function Sp(s,e,t){const i=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${e}\`) for formatting ${i} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Cp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Tp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Np=/^'([^]*?)'?$/,Mp=/''/g,Dp=/[a-zA-Z]/;function Op(s,e,t){var m,b,y,k;const i=an(),n=i.locale??fp,r=i.firstWeekContainsDate??((b=(m=i.locale)==null?void 0:m.options)==null?void 0:b.firstWeekContainsDate)??1,a=i.weekStartsOn??((k=(y=i.locale)==null?void 0:y.options)==null?void 0:k.weekStartsOn)??0,l=kt(s,t==null?void 0:t.in);if(!Ph(l))throw new RangeError("Invalid time value");let d=e.match(Tp).map(g=>{const $=g[0];if($==="p"||$==="P"){const T=bp[$];return T(g,n.formatLong)}return g}).join("").match(Cp).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const $=g[0];if($==="'")return{isToken:!1,value:Ep(g)};if(za[$])return{isToken:!0,value:g};if($.match(Dp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+$+"`");return{isToken:!1,value:g}});n.localize.preprocessor&&(d=n.localize.preprocessor(l,d));const p={firstWeekContainsDate:r,weekStartsOn:a,locale:n};return d.map(g=>{if(!g.isToken)return g.value;const $=g.value;(wp($)||$p($))&&xp($,e,String(s));const T=za[$[0]];return T(l,$,n.localize,p)}).join("")}function Ep(s){const e=s.match(Np);return e?e[1].replace(Mp,"'"):s}function Pp(s,e){const t=kt(s,e==null?void 0:e.in).getDay();return t===0?7:t}function Ap(s,e,t="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:s,timeZoneName:t}).format(e).split(/\s/g).slice(2).join(" ")}const Xn={},Di={};function Ds(s,e){try{const i=(Xn[s]||(Xn[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(e).split("GMT")[1];return i in Di?Di[i]:Qa(i,i.split(":"))}catch{if(s in Di)return Di[s];const t=s==null?void 0:s.match(Ip);return t?Qa(s,t.slice(1)):NaN}}const Ip=/([+-]\d\d):?(\d\d)?/;function Qa(s,e){const t=+(e[0]||0),i=+(e[1]||0),n=+(e[2]||0)/60;return Di[s]=t*60+i>0?t*60+i+n:t*60-i-n}class qt extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Ds(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),Ja(this),Qn(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new qt(...t,e):new qt(Date.now(),e)}withTimeZone(e){return new qt(+this,e)}getTimezoneOffset(){const e=-Ds(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Qn(this),+this}[Symbol.for("constructDateFrom")](e){return new qt(+new Date(e),this.timeZone)}}const Za=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!Za.test(s))return;const e=s.replace(Za,"$1UTC");qt.prototype[e]&&(s.startsWith("get")?qt.prototype[s]=function(){return this.internal[e]()}:(qt.prototype[s]=function(){return Date.prototype[e].apply(this.internal,arguments),Lp(this),+this},qt.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),Qn(this),+this}))});function Qn(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-Ds(s.timeZone,s)*60))}function Lp(s){Date.prototype.setFullYear.call(s,s.internal.getUTCFullYear(),s.internal.getUTCMonth(),s.internal.getUTCDate()),Date.prototype.setHours.call(s,s.internal.getUTCHours(),s.internal.getUTCMinutes(),s.internal.getUTCSeconds(),s.internal.getUTCMilliseconds()),Ja(s)}function Ja(s){const e=Ds(s.timeZone,s),t=e>0?Math.floor(e):Math.ceil(e),i=new Date(+s);i.setUTCHours(i.getUTCHours()-1);const n=-new Date(+s).getTimezoneOffset(),r=-new Date(+i).getTimezoneOffset(),a=n-r,l=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();a&&l&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+a);const d=n-t;d&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+d);const p=new Date(+s);p.setUTCSeconds(0);const m=n>0?p.getSeconds():(p.getSeconds()-60)%60,b=Math.round(-(Ds(s.timeZone,s)*60))%60;(b||m)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+b),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+b+m));const y=Ds(s.timeZone,s),k=y>0?Math.floor(y):Math.ceil(y),$=-new Date(+s).getTimezoneOffset()-k,T=k!==t,M=$-d;if(T&&M){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+M);const S=Ds(s.timeZone,s),O=S>0?Math.floor(S):Math.ceil(S),N=k-O;N&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+N),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+N))}}class os extends qt{static tz(e,...t){return t.length?new os(...t,e):new os(Date.now(),e)}toISOString(){const[e,t,i]=this.tzComponents(),n=`${e}${t}:${i}`;return this.internal.toISOString().slice(0,-1)+n}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,i,n]=this.internal.toUTCString().split(" ");return`${e==null?void 0:e.slice(0,-1)} ${i} ${t} ${n}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,i,n]=this.tzComponents();return`${e} GMT${t}${i}${n} (${Ap(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),t=e>0?"-":"+",i=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),n=String(Math.abs(e)%60).padStart(2,"0");return[t,i,n]}withTimeZone(e){return new os(+this,e)}[Symbol.for("constructDateFrom")](e){return new os(+new Date(e),this.timeZone)}}window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const Bp=(s=window.pktTz)=>{const e=new os(new Date().toISOString(),s);return e.setHours(0,0,0,0),isNaN(e.getTime())?new Date:new Date(e.getFullYear(),e.getMonth(),e.getDate())};function Wt(s){if(!s||s==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[e,t,i]=s.split("-").map(Number);return new Date(e,t-1,i)}if(/^\d{4}-\d{2}$/.test(s)){const[e,t]=s.split("-").map(Number);return new Date(e,t-1,1)}return/^\d{4}$/.test(s)?new Date(Number(s),0,1):new Date(s)}const ot=s=>{if(!s||isNaN(s.getTime()))return"";const e=s.getFullYear(),t=String(s.getMonth()+1).padStart(2,"0"),i=String(s.getDate()).padStart(2,"0");return`${e}-${t}-${i}`},Oi=s=>{if(!s)return null;const e=Wt(s);return isNaN(e.getTime())?null:e},Fp=(s,e)=>{const t=Qt(s);return isNaN(t.getTime())?"":Op(t,e)},Qt=(s="",e)=>{const t=typeof s=="string"?Wt(s):s;return!t||isNaN(t.getTime())?new Date:e?e==="end"?Ah(t):Kn(t):t},Js=(s,e,t=1)=>{if(typeof s!="number"||typeof e!="number"||typeof t!="number"||isNaN(s)||isNaN(e)||isNaN(t))return new Date;const i=new Date(s,e,t);return isNaN(i.getTime())?new Date:i},Ei=s=>{let e;return typeof s=="number"?e=new os(s,window.pktTz):e=new os(s,window.pktTz),e.setHours(12,0,0,0),e};let Zn=null,Ra;const Hp=s=>{if(!s||isNaN(s.getTime()))return"";const e=typeof window<"u"?window.pktTz:void 0;return(!Zn||Ra!==e)&&(Zn=new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:e}),Ra=e),Zn.format(s)},Vp=(s,e,t)=>{if(!s||isNaN(s.getTime()))return!1;const i=e?Qt(e):null,n=t?Qt(t):null;return!(i&&s<i||n&&s>n)},Up=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=ot(s);return e.includes(t)},jp=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=s.getDay().toString();return e.includes(t)},eo=(s,e,t,i,n)=>!(!s||isNaN(s.getTime())||!Vp(s,e,t)||i&&Up(s,i)||n&&jp(s,n)),qp=(s,e,t,i,n)=>s.filter(r=>{const a=Oi(r);return a&&eo(a,e,t,i,n)}),Wp=s=>s.slice().sort((e,t)=>{const i=Oi(e),n=Oi(t);return!i||!n?0:i.getTime()-n.getTime()}),zp=(s,e)=>{const t=Oi(s),i=Oi(e);return!t||!i?!1:t<=i};function to(s,e){const t=(e.excludedates??[]).map(i=>typeof i=="string"?i:ot(i));return!eo(s,e.earliest,e.latest,t,e.excludeweekdays??[])}function Yp(s,e,t,i){return!!(to(s,t)||!e&&i.multiple&&i.maxMultiple>0&&i.selectedCount>=i.maxMultiple)}function Kp(s,e,t){const i=Js(s,e,0);return!(t&&Qt(t)>i)}function Gp(s,e,t){const i=Js(e===11?s+1:s,e===11?0:e+1,1);return!(t&&Qt(t)<i)}function so(s){return typeof s=="string"&&(s=s.split(",")),s.length===1&&s[0]===""?[]:s.map(e=>Wt(e))}function io(s,e){const t=ja({start:s,end:e}),i={};if(Array.isArray(t)&&t.length)for(let n=0;n<t.length;n++){const r=t[n],a=r>s&&r<e;i[ot(r)]=a}return i}function no(s,e,t,i){if(e.length!==1)return!0;const n=ja({start:e[0],end:s});if(!Array.isArray(n)||!n.length)return!0;for(let r=0;r<n.length;r++){for(const a of t??[])if(a>e[0]&&a<s)return!1;if((i??[]).includes(Pp(n[r]).toString()))return!1}return!0}function Jn(s,e){const t=ot(s);return e.includes(t)?e:[...e,t]}function Rn(s,e){const t=ot(s),i=e.indexOf(t);if(i===-1)return e;if(e.length===1)return[];const n=[...e];return n.splice(i,1),n}function ro(s,e,t){const i=ot(s);return e.includes(i)?Rn(s,e):t>0&&e.length>=t?e:Jn(s,e)}function Xp(s,e,t){const i=ot(s),n=so(e);if(e.includes(i))return e.indexOf(i)===0?[]:Rn(s,e);if(e.length>1)return[i];if(e.length===1){if(!no(s,n,t.excludedates,t.excludeweekdays))return[i];if(n[0]>s)return[i]}return Jn(s,e)}const Pi=7,Qp=6;function Zp(s,e){const t=Js(s,e,1),i=Js(s,e+1,0),n=(t.getDay()+Qp)%Pi,r=i.getDate(),a=Math.ceil((r+n)/Pi),d=Js(s,e,0).getDate(),p=Wa(t);return{firstDayOfMonth:t,lastDayOfMonth:i,startingDay:n,numDays:r,numRows:a,numDaysPrevMonth:d,initialWeek:p}}function Jp(s,e,t,i){const{startingDay:n,numDays:r}=i;return s===0&&e<n?"prev-month":t>r?"next-month":"current-month"}function Rp(s,e,t,i){const{startingDay:n,numDaysPrevMonth:r,numDays:a}=i;return s==="prev-month"?r-(n-e-1):s==="next-month"?t-a:t}const ef={ArrowLeft:-1,ArrowRight:1,ArrowUp:-Pi,ArrowDown:Pi};function tf(s){var t;const e=s.nodeName;return e==="INPUT"||e==="SELECT"||e==="BUTTON"&&!((t=s.dataset)!=null&&t.date)}function sf(s,e,t){let i=Fa(s,e);if(!i)return null;let n=t(`button[data-date="${ot(i)}"]`);for(;n instanceof HTMLButtonElement&&n.dataset.disabled;)if(i=Fa(i,e),n=t(`button[data-date="${ot(i)}"]`),!n)return null;return i}function nf(s){return ef[s]??null}const rf={month:"Måned",year:"År",days:["Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Man","Tir","Ons","Tor","Fre","Lør","Søn"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],week:"Uke",prevMonth:"Forrige måned",nextMonth:"Neste måned"};function af(s){const{selected:e,multiple:t=!1,maxMultiple:i=0,range:n=!1,earliest:r=null,latest:a=null,excludedates:l,excludeweekdays:d=[],weeknumbers:p=!1,withcontrols:m=!1,currentmonth:b,today:y,strings:k,onDateSelected:g,onClose:$,id:T,className:M}=s,S=h.useId(),O=T??S,N=h.useMemo(()=>({...rf,...k}),[k]),U=h.useMemo(()=>y?Wt(y):Bp(),[y]),X=h.useMemo(()=>l?l.map(f=>typeof f=="string"?Wt(f):f):[],[l]),te=e!==void 0,[$e,q]=h.useState([]),C=te?e:$e,H=h.useMemo(()=>so(C),[C]),[W,Q]=h.useState(0),[se,ie]=h.useState(0),[ue,ne]=h.useState({}),[ge,K]=h.useState(null),[G,Ae]=h.useState(null),re=h.useRef(null),ae=h.useRef([]),Re=h.useRef(0),Ve=h.useRef(!1),Se=h.useRef(!1),Ke=h.useMemo(()=>({earliest:r,latest:a,excludedates:X,excludeweekdays:d}),[r,a,X,d]);h.useEffect(()=>{let f=null;if(b!=null&&(b instanceof Date?f=Ei(b):typeof b=="string"&&(f=Wt(b))),!f||isNaN(f.getTime()))if(C.length>0&&C[0]!==""){const u=Wt(C[C.length-1]);f=isNaN(u.getTime())?Ei(U):u}else f=Ei(U);if((!f||isNaN(f.getTime()))&&(f=Ei(U)),a){const u=typeof a=="string"?Wt(a):a;!isNaN(u.getTime())&&f>u&&(f=u)}if(r){const u=typeof r=="string"?Wt(r):r;!isNaN(u.getTime())&&f<u&&(f=u)}Q(f.getFullYear()),ie(f.getMonth()),Se.current=!0},[]),h.useEffect(()=>{if(Se.current&&!Ve.current&&C.length>0&&C[0]!==""){const f=Wt(C[C.length-1]);isNaN(f.getTime())||(Q(f.getFullYear()),ie(f.getMonth()))}},[C]),h.useEffect(()=>{n&&H.length===2?ne(io(H[0],H[1])):(!n||H.length<2)&&ne({})},[n,H]);const lt=h.useCallback(f=>{te||q(f),g==null||g(f)},[te,g]),we=h.useCallback(()=>{$==null||$()},[$]),Ne=h.useCallback((f,u)=>{Q(typeof f=="string"?parseInt(f):f),ie(typeof u=="string"?parseInt(u):u),Re.current=0,Ae(null),ae.current=[],Ve.current=!0},[]),Ge=h.useCallback(()=>{const f=se===0?11:se-1,u=se===0?W-1:W;Ne(u,f)},[W,se,Ne]),Xe=h.useCallback(()=>{const f=se===11?0:se+1,u=se===11?W+1:W;Ne(u,f)},[W,se,Ne]),et=h.useCallback(f=>to(f,Ke),[Ke]),ce=h.useCallback((f,u)=>Yp(f,u,Ke,{multiple:t,maxMultiple:i,selectedCount:C.length}),[Ke,t,i,C.length]),be=h.useCallback(()=>typeof C=="string"?C.split(","):C,[C]),Ie=h.useCallback(f=>{if(!n||H.length!==1||!no(f,H,X,d)||H[0]>=f){K(null);return}K(f),ne(io(H[0],f))},[n,H,X,d]),Me=h.useCallback(f=>{if(!f)return;let u;if(n)u=Xp(f,be(),{excludedates:X,excludeweekdays:d}),te||q(u),u.length===2?(g==null||g(u),we()):(u.length===1&&ne({}),g==null||g(u));else if(t)u=ro(f,be(),i),lt(u);else{const _=ot(f);C.includes(_)?u=[]:u=[_],lt(u),we()}},[n,t,i,be,C,X,d,te,lt,we,g]),xe=h.useCallback(f=>{const u=Jn(f,be());te||q(u),n&&u.length===2&&(g==null||g(u),we())},[be,te,n,g,we]),V=h.useCallback(f=>{const u=Rn(f,be());te||q(u)},[be,te]),De=h.useCallback(f=>{const u=ro(f,be(),i);te||q(u)},[be,i,te]),he=h.useCallback(()=>{var x,L;const f=ot(Ei(U)),u=(x=re.current)==null?void 0:x.querySelector(`button[data-date="${f}"]`);if(u instanceof HTMLButtonElement){Ae(f),u.focus();return}const _=ae.current.find(j=>!j.isDisabled);if(_){const j=(L=re.current)==null?void 0:L.querySelector(`button[data-date="${_.currentDateISO}"]`);j instanceof HTMLButtonElement&&(Ae(_.currentDateISO),j.focus())}},[]),ye=h.useCallback((f,u)=>{const _=f.target;if(tf(_))return;if(f.preventDefault(),!G){he();return}const x=Qt(G),L=sf(x,u,re.current.querySelector.bind(re.current));if(L){const j=re.current.querySelector(`button[data-date="${ot(L)}"]`);j instanceof HTMLButtonElement&&!j.dataset.disabled&&(Ae(ot(L)),j.focus())}},[G,he]),Ue=h.useCallback(f=>{if(f.key==="Escape"){f.preventDefault(),we();return}const u=nf(f.key);u!==null&&ye(f.nativeEvent,u)},[we,ye]),ct=h.useCallback(f=>{re.current&&!re.current.contains(f.relatedTarget)&&!f.target.classList.contains("pkt-hide")&&we()},[we]);return{componentId:O,strings:N,todayDate:U,year:W,month:se,activeSelected:C,_selected:H,inRange:ue,rangeHovered:ge,focusedDate:G,range:n,multiple:t,weeknumbers:p,withcontrols:m,earliest:r,latest:a,excludedates:X,excludeweekdays:d,className:M,dateConstraints:Ke,calendarRef:re,selectableDatesRef:ae,tabIndexSetRef:Re,prevMonth:Ge,nextMonth:Xe,changeMonth:Ne,handleDateSelect:Me,addToSelected:xe,removeFromSelected:V,toggleSelectedDate:De,handleRangeHover:Ie,isExcluded:et,isDayDisabled:ce,focusOnCurrentDate:he,handleKeydown:Ue,handleFocusOut:ct,close:we,setFocusedDate:Ae}}const of=({componentId:s,strings:e,year:t,month:i,earliest:n,latest:r,withcontrols:a,prevMonth:l,nextMonth:d,changeMonth:p})=>{const m=y=>{const k=y==="prev",g=k?Kp(t,i,n):Gp(t,i,r),$=k?e.prevMonth:e.nextMonth,T=k?"chevron-thin-left":"chevron-thin-right",M=k?"pkt-calendar__prev-month":"pkt-calendar__next-month",S=k?l:d;return o.jsx("div",{children:o.jsxs("button",{type:"button","aria-label":$,onClick:()=>g&&S(),onKeyDown:O=>{(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),g&&S())},className:["pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only",M,!g&&"pkt-invisible"].filter(Boolean).join(" "),"data-disabled":g?void 0:"disabled","aria-disabled":!g||void 0,tabIndex:g?0:-1,children:[o.jsx(Y,{className:"pkt-btn__icon",name:T}),o.jsx("span",{className:"pkt-btn__text",children:$})]})})},b=()=>a?o.jsxs("div",{className:"pkt-cal-month-picker",children:[o.jsx("label",{htmlFor:`${s}-monthnav`,className:"pkt-hide",children:e.month}),o.jsx("select",{"aria-label":e.month,className:"pkt-input pkt-input-compact",id:`${s}-monthnav`,value:i,onChange:y=>{y.stopPropagation(),p(t,parseInt(y.target.value))},children:e.months.map((y,k)=>o.jsx("option",{value:k,children:y},k))}),o.jsx("label",{htmlFor:`${s}-yearnav`,className:"pkt-hide",children:e.year}),o.jsx("input",{"aria-label":e.year,className:"pkt-input pkt-cal-input-year pkt-input-compact",id:`${s}-yearnav`,type:"number",size:4,placeholder:"0000",value:t,onChange:y=>{y.stopPropagation(),p(parseInt(y.target.value),i)}})]}):o.jsxs("div",{className:"pkt-txt-16-medium pkt-calendar__month-title","aria-live":"polite",children:[e.months[i]," ",t]});return o.jsxs("nav",{className:"pkt-cal-month-nav",children:[m("prev"),b(),m("next")]})};function lf(s,e,t){const i=Js(t.year,t.month,s),n=ot(i),r=n===ot(e),a=t.activeSelected.includes(n),l=t.isDayDisabled(i,a);let d;return t.focusedDate?d=t.focusedDate===n&&!l?"0":"-1":!l&&t.tabIndexSetRef.current===0?(t.tabIndexSetRef.current=s,d="0"):d=t.tabIndexSetRef.current===s?"0":"-1",{currentDate:i,currentDateISO:n,isToday:r,isSelected:a,isDisabled:l,ariaLabel:Hp(i),tabindex:d}}function cf(s,e){const{currentDateISO:t,isToday:i,isSelected:n}=s,r=e.range&&(e.activeSelected.length===2||e.rangeHovered!==null)&&t===e.activeSelected[0],a=e.range&&e.activeSelected.length===2&&t===e.activeSelected[1];return oe({"pkt-cal-today":i,"pkt-cal-selected":n,"pkt-cal-in-range":e.inRange[t],"pkt-cal-excluded":e.isExcluded(s.currentDate),"pkt-cal-in-range-first":r,"pkt-cal-in-range-last":a,"pkt-cal-range-hover":e.rangeHovered!==null&&t===ot(e.rangeHovered)})}function df(s,e){const{currentDateISO:t,isToday:i,isSelected:n,isDisabled:r}=s,a=e.range&&(e.activeSelected.length===2||e.rangeHovered!==null)&&t===e.activeSelected[0],l=e.range&&e.activeSelected.length===2&&t===e.activeSelected[1];return oe({"pkt-calendar__date":!0,"pkt-calendar__date--today":i,"pkt-calendar__date--selected":n,"pkt-calendar__date--disabled":r,"pkt-calendar__date--in-range":e.inRange[t],"pkt-calendar__date--in-range-hover":e.rangeHovered!==null&&t===ot(e.rangeHovered),"pkt-calendar__date--range-start":a,"pkt-calendar__date--range-end":l})}const uf=({state:s})=>{const{strings:e,year:t,month:i,activeSelected:n,focusedDate:r,inRange:a,rangeHovered:l,range:d,multiple:p,weeknumbers:m,selectableDatesRef:b,tabIndexSetRef:y,handleDateSelect:k,handleRangeHover:g,isExcluded:$,isDayDisabled:T,setFocusedDate:M,todayDate:S}=s,O={year:t,month:i,activeSelected:n,focusedDate:r,tabIndexSetRef:y,isDayDisabled:T},N={range:d,activeSelected:n,rangeHovered:l,inRange:a,isExcluded:$},U=()=>{const q=[];m&&q.push(o.jsx("th",{children:o.jsx("div",{className:"pkt-calendar__week-number",children:e.week})},"week-header"));for(let C=0;C<e.daysShort.length;C++)q.push(o.jsx("th",{children:o.jsx("div",{className:"pkt-calendar__day-name","aria-label":e.days[C],children:e.daysShort[C]})},`day-${C}`));return o.jsx("tr",{className:"pkt-cal-week-row",children:q})},X=(q,C)=>{const H=lf(q,C,O),{currentDate:W,currentDateISO:Q,isSelected:se,isDisabled:ie,ariaLabel:ue,tabindex:ne}=H;b.current.push({currentDateISO:Q,isDisabled:ie,tabindex:ne});const ge=cf(H,N),K=df(H,N);return o.jsx("td",{className:ge,children:o.jsx("button",{type:"button","aria-pressed":se?"true":"false",disabled:ie,className:`pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${K}`,onMouseOver:()=>d&&!$(W)&&g(W),onFocus:()=>{d&&!$(W)&&g(W),M(Q)},"aria-label":ue,tabIndex:parseInt(ne),"data-disabled":ie?"disabled":void 0,"data-date":Q,onKeyDown:G=>{(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),k(W))},onClick:G=>{ie||(G.preventDefault(),k(W))},children:o.jsx("span",{className:"pkt-btn__text pkt-txt-14-light",children:q})})},Q)},te=(q,C)=>o.jsx("td",{className:"pkt-cal-other",children:o.jsx("div",{className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only","data-disabled":"disabled",children:o.jsx("span",{className:"pkt-btn__text pkt-txt-14-light",children:q})})},C),$e=()=>{const q=S,C=Zp(t,i);b.current=[],y.current=0;let H=1,W=C.initialWeek;const Q=[];for(let se=0;se<C.numRows;se++){const ie=[];m&&ie.push(o.jsx("td",{className:"pkt-cal-week",children:W},`week-${W}`)),W++;for(let ue=0;ue<Pi;ue++){const ne=Jp(se,ue,H,C);if(ne==="current-month")ie.push(X(H,q)),H++;else{const ge=Rp(ne,ue,H,C);ie.push(te(ge,`${ne}-${se}-${ue}`)),ne==="next-month"&&H++}}Q.push(o.jsx("tr",{className:"pkt-cal-week-row",role:"row",children:ie},`row-${se}`))}return Q};return o.jsxs("table",{className:"pkt-cal-days pkt-txt-12-medium pkt-calendar__body",role:"grid","aria-multiselectable":d||p||void 0,children:[o.jsx("thead",{children:U()}),o.jsx("tbody",{children:$e()})]})},er=h.forwardRef((s,e)=>{const t=af(s);return h.useImperativeHandle(e,()=>({handleDateSelect:t.handleDateSelect,addToSelected:t.addToSelected,removeFromSelected:t.removeFromSelected,toggleSelected:t.toggleSelectedDate,focusOnCurrentDate:t.focusOnCurrentDate,close:t.close}),[t.handleDateSelect,t.addToSelected,t.removeFromSelected,t.toggleSelectedDate,t.focusOnCurrentDate,t.close]),o.jsxs("div",{ref:t.calendarRef,className:["pkt-calendar",t.weeknumbers&&"pkt-cal-weeknumbers",t.className].filter(Boolean).join(" "),onBlur:t.handleFocusOut,onKeyDown:t.handleKeydown,children:[o.jsx(of,{componentId:t.componentId,strings:t.strings,year:t.year,month:t.month,earliest:t.earliest,latest:t.latest,withcontrols:t.withcontrols,prevMonth:t.prevMonth,nextMonth:t.nextMonth,changeMonth:t.changeMonth}),o.jsx(uf,{state:t})]})});er.displayName="PktCalendar";const hf=It({tagName:"pkt-card",elementClass:We,react:h,displayName:"PktCard",events:{}}),ao=h.forwardRef(({children:s,...e},t)=>o.jsx(hf,{...e,ref:t,children:o.jsx("div",{className:"pkt-contents",children:s})}));ao.displayName="PktCard";const oo=h.forwardRef(({id:s,hasTile:e=!1,disabled:t=!1,label:i,checkHelptext:n,hasError:r=!1,className:a,isSwitch:l=!1,hideLabel:d=!1,labelPosition:p="right",defaultChecked:m,checked:b,indeterminate:y,optionalTag:k,optionalText:g="Valgfritt",requiredTag:$,requiredText:T="Må fylles ut",tagText:M,...S},O)=>{const N=h.useRef(null);h.useEffect(()=>{N.current&&y!==void 0&&(N.current.indeterminate=y)},[y]),h.useEffect(()=>{typeof O=="function"?O(N.current):O&&(O.current=N.current)},[O]);const U=[a,"pkt-input-check"].filter(Boolean).join(" "),X=["pkt-input-check__input-label",t?"pkt-input-check__input-label--disabled":"",`pkt-input-check__input-label--${p}`,d?"pkt-sr-only":""].filter(Boolean).join(" "),te=["pkt-input-check__input",e?"pkt-input-check__input--tile":"",t&&e?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),$e=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),q=()=>o.jsxs(o.Fragment,{children:[M&&o.jsx("span",{className:$e+" pkt-tag--gray",children:M}),k&&o.jsx("span",{className:$e+" pkt-tag--blue-light",children:g}),$&&o.jsx("span",{className:$e+" pkt-tag--beige",children:T})]});return o.jsx("div",{className:U,children:o.jsxs("div",{className:te,children:[p==="left"&&o.jsxs("label",{className:X,htmlFor:s,children:[i," ",q(),n&&o.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]}),o.jsx("input",{role:l?"switch":"checkbox",ref:N,className:`pkt-input-check__input-checkbox ${r?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:s,disabled:t,...b!==void 0?{checked:b}:{defaultChecked:m},...S}),p==="right"&&o.jsxs("label",{className:X,htmlFor:s,children:[i," ",q(),n&&o.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]})]})})});oo.displayName="PktCheckbox";const pf=It({tagName:"pkt-combobox",elementClass:Pe,react:h,displayName:"PktCombobox",events:{onClick:"click",onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),lo=h.forwardRef(({children:s,helptext:e,...t},i)=>o.jsxs(pf,{...t,ref:i,children:[e&&o.jsx("div",{slot:"helptext",className:"pkt-contents",children:e}),s]}));lo.displayName="PktCombobox";const ln=It({tagName:"pkt-consent",elementClass:Tt,react:h,displayName:"PktConsent",events:{onToggleConsent:"toggle-consent"}});ln.displayName="PktConsent";const Os=h.forwardRef(({forId:s,label:e,helptext:t,helptextDropdown:i,helptextDropdownButton:n,counter:r,counterCurrent:a=0,counterMaxLength:l,optionalTag:d=!1,optionalText:p="Valgfritt",requiredTag:m=!1,requiredText:b="Må fylles ut",tagText:y=null,hasError:k=!1,errorMessage:g,disabled:$=!1,inline:T=!1,ariaDescribedby:M,useWrapper:S=!0,children:O,className:N="",hasFieldset:U=!1,role:X="group",counterPosition:te="bottom"},$e)=>{const[q,C]=h.useState(!1),H=M||(t?`${s}-helptext`:void 0),W=!!r,Q=W&&te==="top",se=W&&te==="bottom",ie=()=>C(ae=>!ae),ue=["pkt-inputwrapper",N,k?"pkt-inputwrapper--error":"",$?"pkt-inputwrapper--disabled":"",T?"pkt-inputwrapper--inline":""].filter(Boolean).join(" "),ne=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),ge=()=>W?o.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":"true",children:[a,l?`/${l}`:""]}):null,K=()=>o.jsxs(o.Fragment,{children:[y&&o.jsx("span",{className:ne+" pkt-tag--gray",children:y}),d&&o.jsx("span",{className:ne+" pkt-tag--blue-light",children:p}),m&&o.jsx("span",{className:ne+" pkt-tag--beige",children:b})]}),G=()=>{const ae=o.jsxs(o.Fragment,{children:[e," ",K()]});return S?U?o.jsx("legend",{className:"pkt-inputwrapper__legend",id:`${s}-label`,children:ae}):o.jsx("label",{className:"pkt-inputwrapper__label",htmlFor:s,"aria-describedby":H,id:`${s}-label`,children:ae}):o.jsx("label",{htmlFor:s,className:"pkt-sr-only","aria-describedby":H,id:`${s}-label`,children:e})},Ae=()=>!t&&!i?null:o.jsxs(o.Fragment,{children:[t&&S&&o.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${s}-helptext`,children:t}),i&&o.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[o.jsx(at,{skin:"tertiary",size:"small",variant:"icon-right",iconName:q?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:ie,children:o.jsx("span",{dangerouslySetInnerHTML:{__html:n??'Les mer <span class="pkt-sr-only">om inputfeltet</span>'}})}),o.jsx("div",{className:`pkt-inputwrapper__helptext ${q?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i})]})]}),re=o.jsxs(o.Fragment,{children:[G(),Ae(),Q&&o.jsx(ge,{}),O,se&&o.jsx(ge,{}),k&&g&&o.jsx("div",{className:"pkt-inputwrapper__alert-wrapper",children:o.jsx(rn,{skin:"error","aria-live":"assertive",role:"alert",id:`${s}-error`,compact:!0,children:g})})]});return o.jsx("div",{className:ue,ref:$e,role:X,children:U?o.jsx("fieldset",{className:"pkt-inputwrapper__fieldset","aria-describedby":H,children:re}):o.jsx("div",{className:"pkt-inputwrapper__fieldset",children:re})})});Os.displayName="PktInputWrapper";const co=()=>{const s=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(s)||/Macintosh/.test(s)&&"ontouchend"in document)},ff=()=>co()?"text":"date",mf=s=>!s||s.length!==2?!0:zp(s[0],s[1]),gf=(s,e,t,i,n,r)=>({"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":s,"pkt-datepicker--hasrangelabels":e,"pkt-datepicker--multiple":t,"pkt-datepicker--range":i,"ios-readonly-hack":n===!1&&r==="text"}),vf=()=>({"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}),bf=s=>({"pkt-input-prefix":s,"pkt-hide":!s}),yf=(s,e,t)=>!e&&!t?Array.isArray(s)?s[0]||"":s:Array.isArray(s)?s.join(","):s,kf=(s,e,t=!1)=>{var l;if(!s||!e)return;const i=((l=e.parentElement)==null?void 0:l.getBoundingClientRect())||e.getBoundingClientRect(),n=t?i.height+30:i.height,r=s.getBoundingClientRect().height;let a=t?"calc(100% - 30px)":"100%";i&&i.top+r>window.innerHeight&&i.top-r>0&&(a=`calc(100% - ${n}px - ${r}px)`),s.style.top=a},cn=(s,e,t,i,n,r)=>{const{key:a}=s;a===","&&(s.preventDefault(),r?r(s):n&&n()),(a==="Space"||a===" ")&&(s.preventDefault(),e(s)),a==="Enter"&&(s.preventDefault(),t?t():i?i():n&&n())},_f=({open:s,multiple:e=!1,range:t=!1,weeknumbers:i=!1,withcontrols:n=!1,selected:r=[],earliest:a,latest:l,excludedates:d,excludeweekdays:p,maxMultiple:m,currentmonth:b,today:y,inputRef:k,hasCounter:g=!1,onDateSelected:$,onClose:T})=>{const M=h.useRef(null),S=h.useRef(!1);s&&(S.current=!0),h.useEffect(()=>{s&&kf(M.current,(k==null?void 0:k.current)??null,g)},[s,k,g]);const O=["pkt-calendar-popup",s?"show":"hide"].join(" "),N=s||S.current;return o.jsx("div",{ref:M,className:O,hidden:!s,"aria-hidden":!s,children:N&&o.jsx(er,{multiple:e,range:t,weeknumbers:i,withcontrols:n,selected:r,earliest:a,latest:l,excludedates:d,excludeweekdays:p,maxMultiple:m,currentmonth:b,today:y,onDateSelected:$,onClose:T})})},dn=h.forwardRef(({children:s,skin:e,textStyle:t,size:i,closeTag:n,className:r,iconName:a,ariaLabel:l,onClose:d,type:p,"aria-description":m,...b},y)=>{const[k,g]=h.useState(!1),$=h.useCallback(()=>{g(!0),d&&d()},[d]),T=h.useRef(null),[M,S]=h.useState("");h.useEffect(()=>{var X,te;S(((te=(X=T.current)==null?void 0:X.textContent)==null?void 0:te.trim())??"")},[s]);const O=h.useMemo(()=>{if(n&&!l)return M&&`Klikk for å fjerne ${M}`||m},[n,l,M,m]),N={"pkt-tag":!0,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${e}`]:!!e,[`pkt-tag--${t}`]:!!t},U={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${t}`]:!!t,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${e}`]:!!e,"pkt-btn--icons-right-and-left":n&&!!a,"pkt-hide":k};return n?o.jsxs("button",{...b,className:oe(U,r),type:p,onClick:$,"aria-label":l,"aria-description":O,ref:y,children:[a&&o.jsx(Y,{className:"pkt-tag__icon",name:a}),o.jsx("span",{ref:T,children:s}),o.jsx(Y,{className:"pkt-tag__close-btn",name:"close"})]}):o.jsxs("span",{...b,className:oe(N,r),ref:y,children:[a&&o.jsx(Y,{className:"pkt-tag__icon",name:a,"aria-hidden":"true"}),o.jsx("span",{ref:T,children:s})]})});dn.displayName="PktTag";const $f=({dates:s,dateformat:e,idBase:t,strings:i,onDateRemoved:n})=>{var l;const r=Wp(s),a=((l=i==null?void 0:i.calendar)==null?void 0:l.buttonAltText)??"Slett dato";return o.jsx("div",{className:"pkt-date-tags pkt-datepicker__tags","aria-live":"polite",children:r.map(d=>{const p=Fp(d,e);return o.jsx(dn,{id:`${t}${d}-tag`,closeTag:!0,ariaLabel:`${a} ${p}`,onClose:()=>n(d),children:o.jsx("time",{dateTime:d,children:p})},d)})})},wf=({state:s})=>{var Ke,lt,we,Ne;const{id:e,inputId:t,values:i,dateformat:n,multiple:r,range:a,showRangeLabels:l,disabled:d,readOnly:p,required:m,label:b,name:y,placeholder:k,hasError:g,helptext:$,minStr:T,maxStr:M,inputType:S,isIOSDevice:O,strings:N,inputClasses:U,buttonClasses:X,rangeLabelClasses:te,datepickerInputsClasses:$e,isInputDisabled:q,inputRef:C,inputRefTo:H,btnRef:W,toggleCalendar:Q,handleFocus:se,handleSingleInputChange:ie,handleRangeFromChange:ue,handleRangeToChange:ne,handleRangeBlur:ge,handleMultipleBlur:K,handleTagRemoved:G,handleSingleKeydown:Ae,handleRangeFromKeydown:re,handleRangeToKeydown:ae,handleMultipleKeydown:Re,restProps:Ve}=s,Se=()=>{var Ge,Xe;return o.jsxs("button",{ref:W,className:X,type:"button",onClick:Q,disabled:d,"aria-label":((Ge=N.calendar)==null?void 0:Ge.buttonAltText)??"Åpne kalender",children:[o.jsx(Y,{name:"calendar"}),o.jsx("span",{className:"pkt-btn__text",children:((Xe=N.calendar)==null?void 0:Xe.buttonAltText)??"Åpne kalender"})]})};return r?o.jsxs(o.Fragment,{children:[o.jsx($f,{dates:i,dateformat:n,idBase:e,strings:N,onDateRemoved:G}),o.jsx("div",{className:"pkt-datepicker__inputs",children:o.jsxs("div",{className:"pkt-input__container",children:[o.jsx("input",{...Ve,ref:C,className:U,type:S,id:t,name:y??e,placeholder:k,readOnly:p||O&&!p,disabled:q,"aria-describedby":$?`${e}-helptext`:void 0,"aria-invalid":g,"aria-errormessage":g?`${e}-error`:void 0,onClick:Q,onKeyDown:Re,onFocus:se,onBlur:K}),Se()]})})]}):a?o.jsx("div",{className:$e,children:o.jsxs("div",{className:"pkt-input__container",children:[l&&o.jsx("div",{className:"pkt-input-prefix",children:((Ke=N.generic)==null?void 0:Ke.from)??"Fra"}),o.jsx("input",{...Ve,ref:C,className:U,type:S,id:t,name:y?`${y}-from`:`${e}-from`,value:i[0]??"",min:T,max:M,placeholder:k,readOnly:p||O&&!p,disabled:d,required:m,"aria-label":`${b} ${((lt=N.generic)==null?void 0:lt.from)??"Fra"}`,"aria-describedby":$?`${e}-helptext`:void 0,"aria-invalid":g,"aria-errormessage":g?`${e}-error`:void 0,onClick:Q,onKeyDown:re,onFocus:se,onBlur:ge,onChange:ue}),o.jsx("div",{className:te,id:`${e}-to-label`,children:((we=N.generic)==null?void 0:we.to)??"Til"}),!l&&o.jsx("div",{className:"pkt-input-separator",children:"–"}),o.jsx("input",{ref:H,className:U,type:S,id:`${e}-to`,name:y?`${y}-to`:`${e}-to`,value:i[1]??"",min:T,max:M,readOnly:p||O&&!p,disabled:d,"aria-label":`${b} ${((Ne=N.generic)==null?void 0:Ne.to)??"Til"}`,"aria-invalid":g,onClick:Q,onKeyDown:ae,onFocus:se,onBlur:ge,onChange:ne}),Se()]})}):o.jsx("div",{className:"pkt-datepicker__inputs",children:o.jsxs("div",{className:"pkt-input__container",children:[o.jsx("input",{...Ve,ref:C,className:U,type:S,id:t,name:y??e,value:i[0]??"",min:T,max:M,placeholder:k,readOnly:p||O&&!p,disabled:d,required:m,"aria-describedby":$?`${e}-helptext`:void 0,"aria-invalid":g,"aria-errormessage":g?`${e}-error`:void 0,onClick:Q,onKeyDown:Ae,onFocus:se,onBlur:void 0,onChange:ie}),Se()]})})},xf={calendar:{buttonAltText:"Åpne kalender"}},Sf={calendar:{buttonAltText:"Åpne kalender"},generic:{from:"Fra",to:"Til"}},uo=s=>s?Array.isArray(s)?s.filter(Boolean):String(s).split(",").map(e=>e.trim()).filter(Boolean):[];function Cf(s,e){const{id:t,label:i,value:n,defaultValue:r,dateformat:a="dd.MM.yyyy",multiple:l=!1,maxlength:d,range:p=!1,showRangeLabels:m=!1,weeknumbers:b=!1,withcontrols:y=!1,excludedates:k,excludeweekdays:g,currentmonth:$,today:T,calendarOpen:M,timezone:S,fullwidth:O=!1,hasFieldset:N=!1,inline:U=!1,helptext:X,helptextDropdown:te,helptextDropdownButton:$e,hasError:q=!1,errorMessage:C,optionalTag:H=!1,optionalText:W,requiredTag:Q=!1,requiredText:se,tagText:ie,useWrapper:ue=!0,strings:ne,disabled:ge=!1,readOnly:K=!1,required:G=!1,name:Ae,min:re,max:ae,placeholder:Re,onChange:Ve,onValueChange:Se,className:Ke,...lt}=s,we=h.useCallback(D=>D===void 0?[]:uo(D),[]),Ne=n!==void 0,Ge=typeof r=="number"?void 0:r,[Xe,et]=h.useState(()=>we(n??Ge)),ce=Ne?we(n):Xe;h.useEffect(()=>{Ne&&et(we(n))},[n,Ne,we]);const[be,Ie]=h.useState(M??!1);h.useEffect(()=>{M!==void 0&&Ie(M)},[M]);const Me=h.useRef(null),xe=h.useRef(null),V=h.useRef(null),De=h.useRef(null),he=h.useRef(null),ye=h.useMemo(()=>ff(),[]),Ue=h.useMemo(()=>co(),[]),ct=h.useMemo(()=>ne??(p?Sf:xf),[ne,p]),f=typeof re=="string"?re:re!==void 0?String(re):void 0,u=typeof ae=="string"?ae:ae!==void 0?String(ae):void 0,_=h.useMemo(()=>{const D=gf(O,m,l,p,K,ye);return Object.entries(D).filter(([,E])=>E).map(([E])=>E).join(" ")},[O,m,l,p,K,ye]),x=h.useMemo(()=>{const D=vf();return Object.entries(D).filter(([,E])=>E).map(([E])=>E).join(" ")},[]),L=h.useMemo(()=>{const D=bf(m);return Object.entries(D).filter(([,E])=>E).map(([E])=>E).join(" ")},[m]),j=h.useMemo(()=>["pkt-datepicker__inputs",p&&m&&"pkt-input__range-inputs"].filter(Boolean).join(" "),[p,m]),R=h.useMemo(()=>{if($)return $;if(u)return u.slice(0,7)},[$,u]),ft=ge||l&&d!=null&&ce.length>=d,Qe=l&&d!=null,mt=`${t}-input`,ls=ce.join(",");h.useEffect(()=>{V.current&&(V.current.value=ls)},[ls]),h.useEffect(()=>{S&&typeof window<"u"&&S!==window.pktTz&&(window.pktTz=S)},[S]);const tt=h.useCallback((D,E=!0)=>{Ne||et(D),E&&(Se==null||Se(D))},[Ne,Se]),dr=h.useMemo(()=>{var D;return(D=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"))==null?void 0:D.set},[]),_t=h.useCallback(D=>{const E=V.current;!E||!dr||(dr.call(E,D.join(",")),E.dispatchEvent(new Event("input",{bubbles:!0})))},[dr]),Zt=h.useCallback(()=>{ge||Ie(D=>!D)},[ge]),cs=h.useCallback(()=>{Ie(!1)},[]);h.useEffect(()=>{if(!be)return;const D=st=>{var vn;const Ze=st.target;he.current&&!he.current.contains(Ze)&&!((vn=Ze.closest)!=null&&vn.call(Ze,".pkt-calendar-popup"))&&cs()},E=st=>{var Ze;st.key==="Escape"&&(cs(),(Ze=Me.current)==null||Ze.focus())};return document.addEventListener("click",D,!0),document.addEventListener("keydown",E),()=>{document.removeEventListener("click",D,!0),document.removeEventListener("keydown",E)}},[be,cs]);const zm=h.useCallback(()=>{Ue&&!be&&Ie(!0)},[Ue,be]),Ym=h.useCallback(D=>{var Ze;const E=yf(D,l,p),st=uo(E);tt(st),_t(st),!l&&!p&&(cs(),(Ze=Me.current)==null||Ze.focus())},[l,p,tt,_t,cs]),Km=h.useCallback(()=>{var D;cs(),(D=Me.current)==null||D.focus()},[cs]),Gm=h.useCallback(D=>{const E=D.target.value,st=E?[E]:[];tt(st),_t(st)},[tt,_t]),Xm=h.useCallback(D=>{const E=D.target.value,st=ce[1]??"",Ze=[E,st].filter(Boolean);tt(Ze),_t(Ze)},[ce,tt,_t]),Qm=h.useCallback(D=>{const E=ce[0]??"",st=D.target.value,Ze=[E,st].filter(Boolean);tt(Ze),_t(Ze)},[ce,tt,_t]),Zm=h.useCallback(()=>{ce.length===2&&!mf(ce)&&(tt([ce[0]]),_t([ce[0]]))},[ce,tt,_t]),gn=h.useCallback(D=>{const E=Qt(D),st=f?Qt(f):null,Ze=u?Qt(u):null;if(E&&!isNaN(E.getTime())&&(!st||E>=st)&&(!Ze||E<=Ze)){const vn=qp([...ce,D],f,u,k,g),jo=[...new Set(vn)];tt(jo),_t(jo)}},[ce,f,u,k,g,tt,_t]),Jm=h.useCallback(D=>{const E=D.target;E.value&&(gn(E.value.split(",")[0]),E.value="")},[gn]),Uo=h.useCallback(D=>{const E=D.target;E.value&&(gn(E.value.split(",")[0]),E.value="")},[gn]),Rm=h.useCallback(D=>{const E=ce.filter(st=>st!==D);tt(E),_t(E)},[ce,tt,_t]),ds=h.useCallback(D=>{const E=D==null?void 0:D.closest("form");E?E.requestSubmit():D==null||D.blur()},[]),eg=h.useCallback(D=>{cn(D.nativeEvent,()=>Zt(),()=>ds(Me.current),void 0,()=>{var E;return(E=Me.current)==null?void 0:E.blur()})},[Zt,ds]),tg=h.useCallback(D=>{cn(D.nativeEvent,()=>Zt(),()=>ds(Me.current),()=>{var E;return(E=xe.current)==null?void 0:E.focus()},()=>{var E;return(E=Me.current)==null?void 0:E.blur()})},[Zt,ds]),sg=h.useCallback(D=>{cn(D.nativeEvent,()=>Zt(),()=>ds(xe.current),void 0,()=>{var E;return(E=xe.current)==null?void 0:E.blur()})},[Zt,ds]),ig=h.useCallback(D=>{cn(D.nativeEvent,()=>Zt(),()=>ds(Me.current),void 0,()=>{var E;return(E=Me.current)==null?void 0:E.blur()},Uo)},[Zt,ds,Uo]);return h.useImperativeHandle(e,()=>({get value(){var D;return((D=V.current)==null?void 0:D.value)??""},set value(D){const E=D?D.split(",").filter(Boolean):[];et(E),V.current&&(V.current.value=D??"")},focus(){var D;(D=Me.current)==null||D.focus()},blur(){var D;(D=Me.current)==null||D.blur()}}),[]),{id:t,inputId:mt,label:i,values:ce,calendarOpen:be,dateformat:a,multiple:l,maxlength:d,range:p,showRangeLabels:m,weeknumbers:b,withcontrols:y,excludedates:k,excludeweekdays:g,disabled:ge,readOnly:K,required:G,name:Ae,placeholder:Re,fullwidth:O,hasFieldset:N,inline:U,helptext:X,helptextDropdown:te,helptextDropdownButton:$e,hasError:q,errorMessage:C,optionalTag:H,optionalText:W,requiredTag:Q,requiredText:se,tagText:ie,useWrapper:ue,className:Ke,minStr:f,maxStr:u,effectiveCurrentMonth:R,today:T,inputType:ye,isIOSDevice:Ue,strings:ct,inputClasses:_,buttonClasses:x,rangeLabelClasses:L,datepickerInputsClasses:j,isInputDisabled:ft,hasCounter:Qe,inputRef:Me,inputRefTo:xe,changeInputRef:V,btnRef:De,wrapperRef:he,onChange:Ve,toggleCalendar:Zt,hideCalendar:cs,handleDateSelected:Ym,handleCalendarClose:Km,handleFocus:zm,handleSingleInputChange:Gm,handleRangeFromChange:Xm,handleRangeToChange:Qm,handleRangeBlur:Zm,handleMultipleBlur:Jm,handleTagRemoved:Rm,handleSingleKeydown:eg,handleRangeFromKeydown:tg,handleRangeToKeydown:sg,handleMultipleKeydown:ig,restProps:lt}}const ho=h.forwardRef((s,e)=>{const t=Cf(s,e),i=["pkt-datepicker",t.className].filter(Boolean).join(" ");return o.jsxs("div",{className:i,children:[o.jsx(Os,{ref:t.wrapperRef,forId:t.inputId,label:t.label,hasFieldset:t.hasFieldset,inline:t.inline,helptext:t.helptext,helptextDropdown:t.helptextDropdown,helptextDropdownButton:t.helptextDropdownButton,hasError:t.hasError,errorMessage:t.errorMessage,disabled:t.disabled,optionalTag:t.optionalTag,optionalText:t.optionalText,requiredTag:t.requiredTag,requiredText:t.requiredText,tagText:t.tagText,useWrapper:t.useWrapper,counter:t.hasCounter,counterCurrent:t.values.length,counterMaxLength:t.maxlength,children:o.jsx(wf,{state:t})}),o.jsx(_f,{open:t.calendarOpen,multiple:t.multiple,range:t.range,weeknumbers:t.weeknumbers,withcontrols:t.withcontrols,selected:t.values,earliest:t.minStr,latest:t.maxStr,excludedates:t.excludedates,excludeweekdays:t.excludeweekdays,maxMultiple:t.maxlength,currentmonth:t.effectiveCurrentMonth,today:t.today,inputRef:t.inputRef,hasCounter:t.hasCounter,onDateSelected:t.handleDateSelected,onClose:t.handleCalendarClose}),o.jsx("input",{ref:t.changeInputRef,type:"text",name:t.name,onChange:t.onChange,tabIndex:-1,"aria-hidden":"true",className:"pkt-visually-hidden"})]})});ho.displayName="PktDatepicker";const Tf={dropFilesHere:"Slipp filene her ...",selectOrDragFiles:"Dra filer hit for å laste dem opp eller ",chooseFiles:"velg filer"},Nf={dropFilesHere:"Slipp filen her ...",selectOrDragFiles:"Dra en fil for å laste den opp eller ",chooseFiles:"velg en fil"},Mf={dropFilesHere:"Slipp bildene her ...",selectOrDragFiles:"Dra bilder hit for å laste dem opp eller ",chooseFiles:"velg fra kamerarull"},Df={dropFilesHere:"Slipp bildet her ...",selectOrDragFiles:"Dra et bilde for å laste det opp eller ",chooseFiles:"velg fra kamerarull"},po=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),Of=()=>{const s=po(),e=po();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+e.slice(1,4)+"-"+e.slice(4)};class fo{constructor(e,t){bn(this,"fileId");bn(this,"file");bn(this,"attributes",{});this.fileId=t||Of(),this.file=e,this.attributes={targetFilename:e.name}}}const tr=h.createContext({}),Ef=".PDF, .JPEG, .JPG, .PNG, .HEIC, .DOC, .DOCX, .ODT",Pf=h.forwardRef(({id:s,multiple:e,value:t,onFilesAdded:i=()=>{},name:n,uploadStrategy:r,accept:a,isThumbnailView:l=!1,disabled:d=!1,srAnnouncementIds:p,...m},b)=>{const y=h.useRef(null),k=typeof a=="string"&&a.trim().length>0?a:void 0,g=h.useMemo(()=>k?k.split(/\s*,\s*/).map(C=>C.trim()).filter(Boolean).join(", ").toUpperCase():Ef,[k]);h.useImperativeHandle(b,()=>y.current);const[$,T]=h.useState(!1),M=h.useMemo(()=>l?e?Mf:Df:e?Tf:Nf,[e,l]),S=h.useCallback(C=>{if(y.current)try{y.current.files=Af(C)}catch{}},[y.current,t]);h.useEffect(()=>{S(t)},[y,t]);const O=h.useCallback(C=>{const H=C.map(W=>new fo(W));i(H),y.current&&(y.current.value="")},[i]),N=C=>{const H=C.target.files;if(H.length===0){e&&S(t);return}O(Array.from(H))},U=C=>{O(C)},X=C=>{if(C.preventDefault(),T(!1),d)return;const H=C.dataTransfer.files,W=Array.from(H);U(W)},te=C=>{C.preventDefault(),!d&&T(!0)},$e=()=>{T(!1)},q=h.useCallback(C=>{var W;d||C.target.closest(".pkt-fileupload__drop-zone__placeholder__title__open-file-dialog")||(W=y.current)==null||W.click()},[d]);return o.jsxs("div",{onDrop:X,onDragOver:te,onDragLeave:$e,onClick:q,className:oe("pkt-fileupload__drop-zone",{"pkt-fileupload__drop-zone--drag-active":$,"pkt-fileupload__drop-zone--disabled":d}),children:[o.jsx("input",{...m,id:s,type:"file",ref:y,multiple:e,onChange:N,accept:k,disabled:d,name:r==="form"&&n||void 0,"aria-label":e?"Velg filer":"Velg fil"}),r==="custom"&&o.jsx(o.Fragment,{children:t==null?void 0:t.map(C=>o.jsx("input",{type:"hidden",name:n,value:C.fileId},C.fileId))}),o.jsxs("div",{className:"pkt-fileupload__drop-zone__placeholder",children:[o.jsx(Y,{name:"attachment",className:"pkt-fileupload__drop-zone__placeholder__icon","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__drop-zone__placeholder__title",children:$?`${M.dropFilesHere} ...`:o.jsxs(o.Fragment,{children:[M.selectOrDragFiles," ",o.jsx("button",{className:"pkt-fileupload__drop-zone__placeholder__title__open-file-dialog",onClick:C=>{var H;C.preventDefault(),C.stopPropagation(),(H=y.current)==null||H.click()},type:"button",children:M.chooseFiles})]})}),o.jsxs("p",{className:"pkt-fileupload__drop-zone__placeholder__formats",children:["Format: ",g]})]})]})}),Af=s=>{const e=new DataTransfer;for(const t of s)e.items.add(t.file);return e.files},sr=h.forwardRef(({id:s,ariaDescribedby:e,ariaLabelledby:t,counter:i,counterMaxLength:n,className:r,disabled:a,errorMessage:l,hasError:d,helptext:p,helptextDropdown:m,helptextDropdownButton:b,inline:y,fullwidth:k=!1,label:g,name:$,optionalTag:T=!1,optionalText:M,requiredTag:S=!1,requiredText:O,tagText:N=null,placeholder:U,rows:X,useWrapper:te=!0,onChange:$e,value:q,autoComplete:C="off",minLength:H,maxLength:W,readOnly:Q,skipForwardTestid:se=!1,...ie},ue)=>{const ne=[r,"pkt-textinput","pkt-textarea"].join(" "),ge=`${s}-input`,K=`${ge}-label`,G=t||K,[Ae,re]=h.useState(0),ae=Re=>{var Ve,Se;i&&re(((Se=(Ve=Re.currentTarget)==null?void 0:Ve.value)==null?void 0:Se.length)||0),$e&&$e(Re)};return h.useEffect(()=>{q!==void 0&&re((q==null?void 0:q.length)||0)},[q]),o.jsx(Os,{ariaDescribedby:e,className:ne,disabled:a,errorMessage:l,forId:ge,hasError:d,helptext:p,helptextDropdown:m,helptextDropdownButton:b,inline:y,label:g,optionalTag:T,optionalText:M,requiredTag:S,requiredText:O,tagText:N,useWrapper:te,counter:i,counterCurrent:Ae,counterMaxLength:n,children:o.jsx("textarea",{ref:ue,className:`pkt-input ${k?"pkt-input--fullwidth":""} ${n&&Ae>n?"pkt-input--counter-error":""}`,name:`${$||s}`,id:ge,placeholder:U,disabled:a,rows:X,"aria-labelledby":G,"aria-invalid":d,"aria-errormessage":`${s}-error`,...ie,onChange:ae,value:q,autoComplete:C,minLength:H,maxLength:W,readOnly:Q,"data-skip-forward-testid":se?"true":void 0})})});sr.displayName="PktTextarea";const If=Symbol("comment"),Lf=s=>{const e=String(s.getDate()).padStart(2,"0"),t=String(s.getMonth()+1).padStart(2,"0"),i=s.getFullYear(),n=String(s.getHours()).padStart(2,"0"),r=String(s.getMinutes()).padStart(2,"0");return`${e}.${t}.${i} kl. ${n}:${r}`},Bf=({fileItem:s,closeOperationUi:e,onAddComment:t,existingComment:i})=>{const n=h.useRef(null),r=!!i,a=()=>{var d,p;const l=(p=(d=n.current)==null?void 0:d.value)==null?void 0:p.trim();l&&t({text:l,timestamp:new Date}),e()};return h.useLayoutEffect(()=>{const l=setTimeout(()=>{var d;return(d=n.current)==null?void 0:d.focus({preventScroll:!0})},0);return()=>clearTimeout(l)},[s.fileId]),o.jsxs(o.Fragment,{children:[o.jsx(sr,{autoFocus:!0,label:r?"Rediger kommentar":"Legg til kommentar",name:`comment-${s.fileId}`,className:"pkt-fileupload__queue-display__item__comment-input",placeholder:"Skriv inn kommentar",rows:2,id:`comment-${s.fileId}`,ref:n,defaultValue:i==null?void 0:i.text}),o.jsx(at,{skin:"secondary",size:"small",onClick:a,children:r?"Lagre kommentar":"Legg til kommentar"}),o.jsx(at,{skin:"tertiary",size:"small",onClick:e,children:"Avbryt"})]})},Ff=({comments:s,onDeleteComment:e,onEditComment:t})=>s&&s.length>0?o.jsx("div",{className:"pkt-fileupload__queue-display__item__comments",children:s.map((i,n)=>o.jsxs("div",{className:"pkt-fileupload__queue-display__item__comment",children:[o.jsxs("div",{className:"pkt-fileupload__queue-display__item__comment__content",children:[o.jsx("span",{className:"pkt-fileupload__queue-display__item__comment__text","aria-label":"Kommentar tekst",children:i.text}),o.jsx("time",{className:"pkt-fileupload__queue-display__item__comment__time",children:Lf(i.timestamp)})]}),o.jsxs("div",{className:"pkt-fileupload__queue-display__item__comment__actions",children:[e&&o.jsx("button",{type:"button",className:"pkt-fileupload__queue-display__item__comment__action",onClick:()=>e(n),"aria-label":"Slett kommentar",children:o.jsx(Y,{name:"trash-can"})}),t&&o.jsx("button",{type:"button",className:"pkt-fileupload__queue-display__item__comment__action",onClick:()=>t(n),"aria-label":"Rediger kommentar",children:o.jsx(Y,{name:"edit"})})]})]},n))}):null,Hf=s=>{const e=h.useContext(tr);return o.jsx("input",{type:"hidden",name:`${e.name}-comments`,value:s.comments?JSON.stringify(s.comments):""})},Vf=s=>{const e=s("comments"),t=(n,r)=>{e.set(n,[r])},i=(n,r)=>{const l=(e.get(n)||[]).filter((d,p)=>p!==r);e.set(n,l.length>0?l:void 0)};return{title:n=>{const r=e.get(n.fileId);return r&&r.length>0?"":"Legg til kommentar"},renderExtendedUI:(n,r)=>{const a=e.get(n.fileId),l=a==null?void 0:a[0];return o.jsx(Bf,{fileItem:n,closeOperationUi:r,onAddComment:d=>t(n.fileId,d),existingComment:l})},renderContent:(n,r,a)=>{if(a)return null;const l=e.get(n.fileId);return o.jsx(Ff,{comments:l,onDeleteComment:d=>i(n.fileId,d),onEditComment:r?()=>r():void 0})},renderHidden:n=>o.jsx(Hf,{comments:e.get(n.fileId)},`comments${n.fileId}`),symbol:If}},Uf=Symbol("deleteFile"),jf=s=>({title:"Slett",ariaLabel:"Slett fil",onClick:e=>s(e.fileId),symbol:Uf}),qf=Symbol("renameFile"),Wf=s=>{const e=h.useRef(null),t=h.useId(),i=()=>{var n;s.onSave(((n=e.current)==null?void 0:n.value)??"")};return o.jsxs(o.Fragment,{children:[o.jsx("label",{htmlFor:t,className:"pkt-sr-only",children:"Endre filnavn"}),o.jsx("input",{id:t,ref:e,type:"text",autoFocus:!0,defaultValue:s.value,className:"pkt-fileupload__queue-display__item__rename-input",onKeyDown:n=>{n.key==="Enter"&&(n.preventDefault(),n.stopPropagation(),i()),n.key==="Escape"&&(n.preventDefault(),n.stopPropagation(),s.onCancel())}}),o.jsx(at,{skin:"secondary",size:"small",onClick:()=>s.onSave(e.current.value),children:"Lagre"}),o.jsx(at,{skin:"tertiary",size:"small",onClick:s.onCancel,children:"Avbryt"})]})},zf=s=>{const e=h.useContext(tr);return o.jsx("input",{type:"hidden",name:`${e.name}-targetFilename`,value:s.targetFilename})},Yf=s=>{const e=s("targetFilename");return{title:"Rediger",ariaLabel:"Rediger filnavn",renderInlineUI:(t,i)=>o.jsx(Wf,{value:e.get(t.fileId)||void 0,onSave:n=>{e.set(t.fileId,n),i()},onCancel:i}),renderHidden:t=>o.jsx(zf,{targetFilename:e.get(t.fileId)||t.file.name},`rename${t.fileId}`),symbol:qf}},Kf=(s,e)=>{const t=h.useCallback((r,a,l)=>{const d=s.find(m=>m.fileId===r),p=d.attributes||{};d.attributes={...p,[a]:l},e(r,{attributes:d.attributes})},[e,s]),i=h.useCallback((r,a)=>(s.find(p=>p.fileId===r).attributes||{})[a],[s]);return{fileAttributes:h.useCallback(r=>({get:a=>i(a,r),set:(a,l)=>{t(a,r,l)}}),[i,t])}},Gf=s=>{const[e,t]=h.useState(!1),[i,n]=h.useState(0),r=h.useRef(null),a=h.useCallback(p=>{var b;const m=s.findIndex(y=>y.fileId===p);m>=0&&(n(m),t(!0),(b=r.current)==null||b.showModal())},[s]),l=h.useCallback(()=>{var p;t(!1),(p=r.current)==null||p.close()},[]),d=h.useCallback(p=>{s.length!==0&&n(m=>p==="prev"?m<=0?s.length-1:m-1:m>=s.length-1?0:m+1)},[s.length]);return{isOpen:e,currentIndex:i,modalRef:r,open:a,close:l,navigate:d}},Xf=s=>{const[e,t]=h.useState({}),i=h.useCallback(a=>{const l=e[a];if(l)return s.find(d=>d.symbol===l)},[e,s]),n=h.useCallback((a,l)=>{t(d=>({...d,[a]:l.symbol}))},[]),r=h.useCallback(a=>{t(l=>{const d={...l};return delete d[a],d})},[]);return{getActivated:i,activate:n,close:r}},Qf=It({tagName:"pkt-modal",elementClass:xt,react:h,displayName:"PktModal",events:{}}),ir=h.forwardRef(({children:s,...e},t)=>o.jsx(Qf,{...e,ref:t,children:o.jsx("div",{className:"pkt-contents",children:s})}));ir.displayName="PktModal";const mo=2,Zf=s=>{const e=window.getComputedStyle(s),t=parseFloat(e.lineHeight);if(!Number.isNaN(t)&&t>0)return t;const i=parseFloat(e.fontSize);return(!Number.isNaN(i)&&i>0?i:16)*1.2},Jf=(s,e,t)=>{const i=e*t;return s.getBoundingClientRect().height>i+.5},go=h.createContext({tail:5}),Ai=({children:s,tail:e,...t})=>{const i=s,n=h.useContext(go),r=e!==void 0?e:n.tail||0,a=s.length<=r+3?null:s.slice(-r),l=h.useRef(null),d=h.useRef(null),[p,m]=h.useState(!1),b=h.useCallback(()=>{const k=l.current,g=d.current;if(!k||!g)return;const $=Zf(k);m(Jf(g,$,mo))},[]),y=h.useMemo(()=>new ResizeObserver(k=>{k.some(g=>g.target===l.current)&&b()}),[b]);return h.useLayoutEffect(()=>(l.current&&y.observe(l.current),b(),()=>y.disconnect()),[s,y,b]),o.jsxs("span",{ref:l,...t,"data-pkt-truncate-part":"wrapper",style:{maxWidth:"100%",width:"100%",display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",alignItems:"end",columnGap:"0.25rem",overflow:"hidden",position:"relative",...t.style},children:[o.jsx("span",{"data-pkt-truncate-part":"first",style:{minWidth:0,display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:mo,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal",overflowWrap:"anywhere"},children:i}),r!==0&&o.jsx("span",{"data-pkt-truncate-part":"tail",style:{whiteSpace:"nowrap",display:p?"inline":"none",paddingRight:"0.5rem"},"aria-hidden":!0,children:a}),o.jsx("span",{ref:d,"aria-hidden":!0,"data-pkt-truncate-part":"measure",style:{position:"absolute",top:0,left:0,width:"100%",visibility:"hidden",pointerEvents:"none",whiteSpace:"normal",overflowWrap:"anywhere"},children:s})]})},Rf=s=>{if(typeof s=="number")return s;const e=s.trim().match(/^(\d+(?:\.\d+)?)\s*(B|KB|MB|GB)$/i);if(!e)return console.warn(`PktFileUpload: Invalid maxFileSize format "${s}". Use format like "5MB", "500KB", or a number in bytes.`),0;const t=parseFloat(e[1]);switch(e[2].toUpperCase()){case"B":return t;case"KB":return t*1024;case"MB":return t*1024*1024;case"GB":return t*1024*1024*1024;default:return t}},un=s=>s<1024?`${s} B`:s<1024*1024?`${Math.round(s/1024)} KB`:s<1024*1024*1024?`${Math.round(s/(1024*1024))} MB`:`${Math.round(s/(1024*1024*1024))} GB`,nr=s=>o.jsx("button",{onClick:s.onClick,className:"pkt-fileupload__queue-display__item__cancel-button","aria-label":s.ariaLabel||"Avbryt opplasting",children:s.label||"Avbryt"}),em=()=>{const[s,e]=h.useState(1);return h.useEffect(()=>{const t=setInterval(()=>{e(i=>i>=3?1:i+1)},400);return()=>clearInterval(t)},[]),o.jsxs("span",{className:"pkt-fileupload__queue-display__item__loading-text","aria-label":"Laster opp fil",children:["Laster opp",".".repeat(s)]})},tm=({cancelTransfer:s,transferItem:e})=>{const t=e.showProgress??e.progress!==0;return o.jsxs(o.Fragment,{children:[o.jsx(Y,{name:"document-text",className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__queue-display__item__title","aria-label":"Filnavn",children:o.jsx(Ai,{children:e.attributes.targetFilename})}),o.jsx(nr,{onClick:s}),t?o.jsxs(o.Fragment,{children:[o.jsx(mn,{valueCurrent:e.progress*100,statusType:"none",valueMax:100,statusPlacement:"following",className:"pkt-fileupload__queue-display__item__progress"}),o.jsx("span",{className:"pkt-fileupload__queue-display__item__filesize",children:un(e.file.size)}),o.jsx("span",{className:"pkt-fileupload__queue-display__item__percentage","aria-hidden":"true",children:`${Math.round(e.progress*100)}%`})]}):o.jsx(em,{})]})},sm=({transferItem:s,onRemove:e})=>{const t=(s.lastProgress??1)*100;return o.jsxs(o.Fragment,{children:[o.jsx(Y,{className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium",name:"alert-error","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__queue-display__item__title",children:o.jsx(Ai,{children:s.attributes.targetFilename})}),o.jsx(nr,{onClick:e,label:"Fjern",ariaLabel:"Fjern fil som feilet under opplasting"}),o.jsx(mn,{valueCurrent:t,statusType:"none",valueMax:100,statusPlacement:"following",className:"pkt-fileupload__queue-display__item__progress pkt-fileupload__queue-display__item__progress--error"}),o.jsx("span",{className:"pkt-fileupload__queue-display__item__filesize",children:un(s.file.size)}),s.errorMessage&&o.jsx("span",{className:"pkt-fileupload__queue-display__item__error-message",children:s.errorMessage})]})},im=({transferItem:s,onRemove:e})=>o.jsxs(o.Fragment,{children:[o.jsx(Y,{className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium",name:"alert-error","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__queue-display__item__title",children:o.jsx(Ai,{children:s.attributes.targetFilename})}),o.jsx(nr,{onClick:e,label:"Fjern",ariaLabel:"Fjern fil som feilet under opplasting"}),s.errorMessage&&o.jsx("span",{className:"pkt-fileupload__queue-display__item__error-message",children:s.errorMessage})]}),nm=({transferItem:s,onRemove:e})=>s.showProgress?o.jsx(sm,{transferItem:s,onRemove:e}):o.jsx(im,{transferItem:s,onRemove:e}),rm=({operation:s,onActivate:e,transferItem:t})=>{const i=typeof s.title=="function"?s.title(t):s.title;if(!i)return null;const n=()=>{(s.renderInlineUI||s.renderExtendedUI)&&e(t.fileId,s),s.onClick&&s.onClick(t)};return o.jsx("button",{type:"button",className:"pkt-fileupload__queue-display__item__operation",onClick:n,"aria-label":typeof s.ariaLabel=="function"?s.ariaLabel(t):s.ariaLabel,children:i})},vo=({transferItem:s})=>o.jsxs(o.Fragment,{children:[o.jsx(Y,{name:"document-text",className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__queue-display__item__title",children:o.jsx(Ai,{children:s.attributes.targetFilename})}),o.jsx("span",{className:"pkt-fileupload__queue-display__item__filesize",children:un(s.file.size)})]}),am=({transferItem:s,onPreviewClick:e})=>{const[t,i]=h.useState(null),[n,r]=h.useState(!1),a=s.file;h.useEffect(()=>{if(r(!1),a.type.startsWith("image/")){const m=URL.createObjectURL(a);return i(m),()=>{URL.revokeObjectURL(m)}}i(null)},[a]);const l=t&&!n&&o.jsx("img",{src:t,alt:s.attributes.targetFilename,onError:()=>r(!0)})||o.jsx(Y,{name:"document-text",className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium"}),d=!!e,p=!!t&&!n;return o.jsxs("div",{className:`pkt-fileupload__queue-display__item__thumbnail${p?"":" pkt-fileupload__queue-display__item__thumbnail--fallback"}`,children:[o.jsxs(at,{className:"pkt-fileupload__queue-display__item__thumbnail__image-wrapper","aria-label":`Forhåndsvis bilde ${s.attributes.targetFilename}`,type:"button",skin:"secondary",onClick:e,children:[d&&o.jsx(Y,{name:"expand",className:"pkt-fileupload__queue-display__item__thumbnail__expand-icon","aria-hidden":"true"}),l]}),o.jsx(Ai,{className:"pkt-fileupload__queue-display__item__thumbnail__title",children:s.attributes.targetFilename})]})},bo=h.forwardRef(({isOpen:s,images:e,currentIndex:t,onClose:i,onNavigate:n},r)=>{const[a,l]=h.useState(null),[d,p]=h.useState(!1),m=e[t],b=e.length>1;return h.useEffect(()=>{if(p(!1),m&&m.file.type.startsWith("image/")){const y=URL.createObjectURL(m.file);return l(y),()=>URL.revokeObjectURL(y)}l(null)},[m]),h.useEffect(()=>{if(!s)return;const y=k=>{switch(k.key){case"ArrowLeft":k.preventDefault(),n("prev");break;case"ArrowRight":k.preventDefault(),n("next");break;case"Escape":k.preventDefault(),i();break}};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[s,n,i]),m?o.jsx(ir,{ref:r,headingText:m.attributes.targetFilename,closeOnBackdropClick:!0,className:"pkt-fileupload__image-preview-modal",children:o.jsxs("div",{className:"pkt-fileupload__image-preview",children:[b&&o.jsx(at,{variant:"icon-only",iconName:"chevron-thin-left",skin:"secondary",size:"small",className:"pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--prev",onClick:()=>n("prev"),"aria-label":`Forrige bilde ${t} / ${e.length}`}),o.jsx("div",{className:"pkt-fileupload__image-preview__content",children:a&&!d?o.jsx("img",{src:a,alt:`${m.attributes.targetFilename} - ${t+1} av ${e.length}`,className:"pkt-fileupload__image-preview__image",onError:()=>p(!0)}):o.jsx(Y,{name:"picture",className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium"})}),b&&o.jsxs("span",{className:"pkt-fileupload__image-preview__counter",children:[t+1," / ",e.length]}),b&&o.jsx(at,{variant:"icon-only",iconName:"chevron-thin-right",skin:"secondary",size:"small",className:"pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--next",onClick:()=>n("next"),"aria-label":`Neste bilde ${t+2} / ${e.length}`})]})}):null});bo.displayName="ImagePreviewModal";const om=s=>{var e;return(e=s.file.type)!=null&&e.startsWith("image/")?!0:/\.(jpe?g|png|gif|webp|heic|heif|bmp|svg)$/i.test(s.file.name||"")},rr=s=>typeof s=="number"?"in-progress":s==="error"?"error":"idle",lm=({operations:s,activatedOperation:e,onActivate:t,transferItem:i})=>o.jsx("div",{className:"pkt-fileupload__queue-display__item__actions",children:s.filter(n=>!e||n.symbol!==e.symbol).map(n=>o.jsx(rm,{operation:n,onActivate:t,transferItem:i},n.symbol.toString()))}),cm=({operations:s,activatedOperation:e,onActivate:t,transferItem:i})=>o.jsx(o.Fragment,{children:s.filter(n=>n.renderContent).map(n=>o.jsx("div",{className:"pkt-fileupload__queue-display__item__operation-content",children:n.renderContent(i,()=>t(i.fileId,n),(e==null?void 0:e.symbol)===n.symbol)},n.symbol.toString()))}),dm=({transferItem:s,activatedOperation:e,operations:t,ItemRenderer:i,onActivate:n,onClose:r,onPreviewClick:a})=>{const l=()=>r(s.fileId),p=(e==null?void 0:e.renderInlineUI)||(e==null?void 0:e.renderExtendedUI)?[]:t;return o.jsxs(o.Fragment,{children:[e!=null&&e.renderInlineUI?o.jsxs(o.Fragment,{children:[o.jsx(Y,{name:"document-text",className:"pkt-fileupload__queue-display__item__icon"}),o.jsx("div",{className:"pkt-fileupload__queue-display__item__inline-ui",children:e.renderInlineUI(s,l)})]}):o.jsx(i,{transferItem:s,queueItemOperations:t,onPreviewClick:a}),p.length>0&&o.jsx(lm,{operations:p,activatedOperation:e,onActivate:n,transferItem:s}),o.jsx(cm,{operations:t,activatedOperation:e,onActivate:n,transferItem:s}),(e==null?void 0:e.renderExtendedUI)&&o.jsx("div",{className:"pkt-fileupload__queue-display__item__expanded-operation-ui",children:e.renderExtendedUI(s,l)})]})},um=({transferItem:s,activatedOperation:e,operations:t,ItemRenderer:i,enableImagePreview:n,onActivate:r,onClose:a,onCancelTransfer:l,onOpenPreview:d})=>{const p=rr(s.progress),m=n&&s.progress==="done"&&om(s);switch(p){case"in-progress":return o.jsx(tm,{"aria-live":"off",transferItem:s,cancelTransfer:()=>l(s.fileId)});case"error":return o.jsx(nm,{transferItem:s,onRemove:()=>l(s.fileId)});case"idle":return o.jsx(dm,{transferItem:s,activatedOperation:e,operations:t,ItemRenderer:i,onActivate:r,onClose:a,onPreviewClick:m?()=>d(s.fileId):void 0})}},hm=s=>{var e;return(e=s.file.type)!=null&&e.startsWith("image/")?!0:/\.(jpe?g|png|gif|webp|heic|heif|bmp|svg)$/i.test(s.file.name||"")},pm=(s,e,t)=>h.useMemo(()=>{const i=s.map(r=>{const a=e.find(l=>l.fileId===r.fileId);return{...r,progress:(a==null?void 0:a.progress)??(t==="form"?"done":"queued"),errorMessage:a==null?void 0:a.errorMessage,showProgress:a==null?void 0:a.showProgress,lastProgress:a==null?void 0:a.lastProgress}}),n={"in-progress":0,error:1,idle:2};return i.sort((r,a)=>n[rr(r.progress)]-n[rr(a.progress)])},[s,e,t]),fm=(s,e)=>h.useMemo(()=>e?s.filter(t=>t.progress==="done"&&hm(t)):[],[s,e]),mm=({files:s,cancelTransfer:e,transfers:t=[],queueItemOperations:i=[],ItemRenderer:n=vo,truncateTail:r,enableImagePreview:a=!1,uploadStrategy:l="form"})=>{const d=pm(s,t,l),p=fm(d,a),m=Xf(i),b=Gf(p);return o.jsxs(o.Fragment,{children:[o.jsx("ul",{className:"pkt-fileupload__queue-display",children:o.jsx(go.Provider,{value:{tail:r},children:d.map(y=>o.jsxs("li",{className:oe("pkt-fileupload__queue-display__item",{"pkt-fileupload__queue-display__item--in-progress":typeof y.progress=="number",[`pkt-fileupload__queue-display__item--${y.progress}`]:typeof y.progress=="string"}),children:[i.filter(k=>k.renderHidden).map(k=>k.renderHidden(y)),o.jsx(um,{transferItem:y,activatedOperation:m.getActivated(y.fileId),operations:i,ItemRenderer:n,enableImagePreview:a,onActivate:m.activate,onClose:m.close,onCancelTransfer:e,onOpenPreview:b.open})]},y.fileId))})}),a&&p.length>0&&o.jsx(bo,{ref:b.modalRef,isOpen:b.isOpen,images:p,currentIndex:b.currentIndex,onClose:b.close,onNavigate:b.navigate})]})},ar={filename:vo,thumbnail:am},yo=h.forwardRef(({value:s,defaultValue:e,id:t="fileupload-id",multiple:i=!1,uploadStrategy:n="form",addCommentsEnabled:r=!1,renameFilesEnabled:a=!1,truncateTail:l,onFilesChanged:d,onFileUploadRequested:p,extraOperations:m=[],itemRenderer:b=ar.filename,fullWidth:y=!1,allowedFormats:k,formatErrorMessage:g,maxFileSize:$,sizeErrorMessage:T,onFileValidation:M,errorMessage:S,hasError:O=!1,disabled:N=!1,label:U,helptext:X,optionalTag:te,requiredTag:$e,enableImagePreview:q=!1,...C},H)=>{const W="transfers"in C?C.transfers:void 0,[Q,se]=h.useState(null),ie=O||!!Q,ue=S||Q,ne=$?Rf($):void 0,ge=h.useCallback(V=>{var De;if(k&&k.length>0){const he=((De=V.name.split(".").pop())==null?void 0:De.toLowerCase())||"",ye=V.type.toLowerCase();if(!k.some(ct=>{const f=ct.toLowerCase().replace(/^\./,"");if(f.includes("/")){if(f.endsWith("/*")){const u=f.replace("/*","");return ye.startsWith(u+"/")}return ye===f}return he===f})){const ct=k.join(", "),f=`Ugyldig filtype. Tillatte formater: ${ct}`;return(g==null?void 0:g.replace("{formats}",ct))||f}}if(ne&&V.size>ne){const he=un(ne),ye=`Filen er for stor. Maks størrelse er ${he}.`;return(T==null?void 0:T.replace("{maxSize}",he))||ye}return M?M(V):null},[k,g,ne,T,M]);s!==void 0&&e!==void 0&&console.warn("PktFileupload: Både value og defaultValue er angitt. Komponenten kan være enten 'controlled' eller 'uncontrolled', ikke begge deler. Bruk kun én av dem. Se https://react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable"),s!==void 0&&d===void 0&&console.warn("PktFileupload: value-prop er angitt uten onFilesChanged-callback. Når en komponent er 'controlled', må endringer håndteres via en callback. Vennligst legg til onFilesChanged-callback for å håndtere endringer i fil-listen. Se https://react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable");const G=s!==void 0?s:e||[],Ae=typeof b=="string"?ar[b]:b,re=b==="thumbnail",ae=typeof C.accept=="string"?C.accept.trim():void 0,Re=h.useMemo(()=>{if(!(!k||k.length===0))return k.map(V=>V.trim()).filter(Boolean).map(V=>{const De=V.toLowerCase();return De.includes("/")||De.startsWith(".")?De:`.${De}`}).join(", ")},[k]),Ve=ae||Re,Se=a&&!re,Ke=r&&!re,lt=h.useCallback(V=>{for(const he of V){const ye=ge(he.file);if(ye){se(ye);return}}se(null);const De=i?[...G,...V]:[V[0]];d&&d(De),n==="custom"&&p&&V.forEach(he=>{p==null||p(he)})},[d,G,i,n,p,ge]),we=h.useCallback((V,De)=>{const he=G.map(ye=>ye.fileId===V?{...ye,...De}:ye);d&&d(he)},[d,G]),Ne=h.useCallback(V=>{var he;const De=G.filter(ye=>ye.fileId!==V);d&&d(De),"onTransferCancelled"in C&&C.onTransferCancelled&&((he=C.onTransferCancelled)==null||he.call(C,V))},[d,G,C]),{fileAttributes:Ge}=Kf(G,we),Xe=h.useMemo(()=>[{op:Yf,enabled:Se},{op:V=>Vf(V),enabled:Ke}].filter(({enabled:V})=>V).map(({op:V})=>V).concat(...m),[Se,Ke]),et=h.useMemo(()=>({uploaded:`${t}-uploaded`,errors:`${t}-errors`}),[t]),{totalCount:ce,uploadedCount:be,failedCount:Ie}=h.useMemo(()=>{const V=G.length;if(!W)return{totalCount:V,uploadedCount:0,failedCount:0};let De=0,he=0;for(const ye of G){const Ue=W.find(ct=>ct.fileId===ye.fileId);(Ue==null?void 0:Ue.progress)==="done"&&De++,(Ue==null?void 0:Ue.progress)==="error"&&he++}return{totalCount:V,uploadedCount:De,failedCount:he}},[G,W]),Me=ce===1?"fil":"filer",xe=o.jsx("div",{className:oe("pkt-fileupload",{"pkt-fileupload--full-width":y,"pkt-fileupload--error":ie,"pkt-fileupload--disabled":N}),"aria-disabled":N,...N?{inert:""}:{},children:o.jsxs(tr.Provider,{value:{name:C.name||"",multiple:!!i,id:t},children:[o.jsx("div",{id:et.uploaded,className:"pkt-sr-only","aria-live":"polite","aria-atomic":"true",children:ce>0&&be>0&&`${be} av ${ce} ${Me} lastet opp`}),o.jsx("div",{id:et.errors,className:"pkt-sr-only","aria-live":"assertive","aria-atomic":"true",children:ce>0&&Ie>0&&`Feil ved opplasting: ${Ie} av ${ce} ${Me} feilet`}),o.jsx(Pf,{id:t,name:C.name||"",value:G,onFilesAdded:lt,multiple:i,uploadStrategy:n,ref:H,accept:re?".jpeg, .jpg, .png, .gif, .webp, .heic":Ve,isThumbnailView:re,disabled:N,srAnnouncementIds:et}),ie&&ue&&o.jsx(rn,{skin:"error","aria-live":"assertive",role:"alert",compact:!0,children:ue}),o.jsx(mm,{files:G,cancelTransfer:Ne,truncateTail:l,transfers:W,uploadStrategy:n,ItemRenderer:Ae,enableImagePreview:re&&q,queueItemOperations:Xe.map(V=>V(Ge)).concat(jf(Ne))})]})});return U?o.jsx(Os,{forId:t,label:U,helptext:X,disabled:N,hasError:ie,optionalTag:te,requiredTag:$e,className:oe("pkt-fileupload-wrapper",{"pkt-fileupload-wrapper--full-width":y}),children:xe}):xe});yo.displayName="PktFileUpload";const gm=({columnOne:s,columnTwo:e,socialLinks:t,className:i,openLinksInNewTab:n=!1,personvernOgInfoLink:r="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:a="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:l=!1,hotjarId:d=null,googleAnalyticsId:p=null,devMode:m=!1,cookieDomain:b=null,cookieSecure:y=null,cookieExpiryDays:k=null,onToggleConsent:g=$=>{console.log($.detail)}})=>{var T,M;const $=[i,"pkt-footer"].filter(Boolean).join(" ");return o.jsx("footer",{className:$,"data-mode":"dark",children:o.jsxs("div",{className:"pkt-footer__container",children:[o.jsxs("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[o.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[o.jsx("h2",{className:"pkt-footer__title",children:s.title}),o.jsxs("ul",{className:"pkt-footer__list",children:[s.text&&o.jsx("li",{className:"pkt-footer__text",children:s.text}),(T=s.links)==null?void 0:T.map((S,O)=>o.jsx("li",{className:"pkt-footer__list-item",children:o.jsxs("a",{className:`pkt-footer__link ${S.external?"pkt-link--external":""}`,href:S.href,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:[o.jsx(Y,{className:"pkt-footer__link-icon",name:"chevron-right"}),S.text]})},`links-${O}`))]})]}),o.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[o.jsx("h2",{className:"pkt-footer__title",children:e.title}),o.jsxs("ul",{className:"pkt-footer__list",children:[e.text&&o.jsx("li",{className:"pkt-footer__text",children:e.text}),(M=e.links)==null?void 0:M.map((S,O)=>o.jsx("li",{className:"pkt-footer__list-item",children:o.jsxs("a",{className:`pkt-footer__link ${S.external?"pkt-link--external":""}`,href:S.href,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:[o.jsx(Y,{className:"pkt-footer__link-icon",name:"chevron-right"}),S.text]})},`links-${O}`))]})]}),o.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[o.jsx("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),o.jsxs("ul",{className:"pkt-footer__list",children:[o.jsx("li",{className:"pkt-footer__list-item",children:o.jsxs("a",{className:"pkt-footer__link",href:r,target:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[o.jsx(Y,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),o.jsx("li",{className:"pkt-footer__list-item",children:o.jsxs("a",{className:"pkt-footer__link",href:a,target:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[o.jsx(Y,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),l&&o.jsx("li",{className:"pkt-footer__list-item",children:o.jsx(ln,{triggerType:"footerlink",hotjarId:d,googleAnalyticsId:p,devMode:m,cookieDomain:b,cookieSecure:y,cookieExpiryDays:k,onToggleConsent:g})})]})]})]}),t&&o.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[o.jsx("div",{className:"pkt-footer__social-languages",children:t.filter(S=>S.language).map((S,O)=>o.jsx("div",{className:"pkt-footer__social-language",children:o.jsx("a",{href:S.href,"aria-label":`til ${S.language} versjon av nettsiden`,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:S.language})},`sociallinks-language-${O}`))}),o.jsx("div",{className:"pkt-footer__social-icons",children:t.filter(S=>S.iconName).map((S,O)=>o.jsx(h.Fragment,{children:o.jsx("a",{href:S.href,"aria-label":`til ${S.iconName}`,className:"pkt-footer__social-icon-link",target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:o.jsx(Y,{className:"pkt-footer__social-icon",name:S.iconName})})},`sociallinks-${O}`))})]})]})})},vm=({links:s=[],openLinksInNewTab:e=!1,personvernOgInfoLink:t="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:i="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:n=!1,hotjarId:r=null,googleAnalyticsId:a=null,devMode:l=!1,cookieDomain:d=null,cookieSecure:p=null,cookieExpiryDays:m=null,onToggleConsent:b=k=>{console.log(k.detail)},className:y})=>{const k=[y,"pkt-footer-simple"].filter(Boolean).join(" ");return o.jsx("footer",{className:k,"data-mode":"dark",children:o.jsx("div",{className:"pkt-footer-simple__container",children:o.jsxs("ul",{className:"pkt-footer-simple__list",children:[s.map((g,$)=>o.jsx("li",{className:"pkt-footer-simple__list-item",children:o.jsxs("a",{className:`pkt-footer-simple__link ${g.external?" pkt-link--external":""}`,href:g.href,target:g.openInNewTab||e?"_blank":"_self",rel:g.openInNewTab||e?"noopener noreferrer":void 0,children:[o.jsx(Y,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),g.text]})},$)),o.jsx("li",{className:"pkt-footer-simple__list-item",children:o.jsxs("a",{className:"pkt-footer-simple__link",href:t,target:e?"_blank":"_self",rel:e?"noopener noreferrer":void 0,children:[o.jsx(Y,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),o.jsx("li",{className:"pkt-footer-simple__list-item",children:o.jsxs("a",{className:"pkt-footer-simple__link",href:i,target:e?"_blank":"_self",rel:e?"noopener noreferrer":void 0,children:[o.jsx(Y,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),n&&o.jsx("li",{className:"pkt-footer-simple__list-item",children:o.jsx(ln,{triggerType:"footerlink",hotjarId:r,googleAnalyticsId:a,devMode:l,cookieDomain:d,cookieSecure:p,cookieExpiryDays:m,onToggleConsent:b})})]})})})},bm=(s,e)=>{const t=()=>typeof window>"u"?0:window.innerWidth,[i,n]=h.useState(t);return h.useEffect(()=>{const r=s.current;if(!r)return;if(n(r.offsetWidth),typeof ResizeObserver>"u"){const l=()=>{r&&n(r.offsetWidth)};return window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)}const a=new ResizeObserver(l=>{for(const d of l)d.borderBoxSize&&d.borderBoxSize.length>0?n(d.borderBoxSize[0].inlineSize):n(d.contentRect.width)});return a.observe(r),()=>{a.disconnect()}},[s]),i};function ym(s){const e=h.useRef(0);h.useEffect(()=>{const t=document.body,i=document.documentElement;if(s){e.current=window.scrollY||window.pageYOffset;const n=window.innerWidth-i.clientWidth;n>0&&(t.style.paddingRight=`${n}px`),t.style.position="fixed",t.style.top=`-${e.current}px`,t.style.left="0",t.style.right="0",t.style.width="100%",t.style.overflow="hidden",i.classList.add("is-scroll-locked")}else t.style.removeProperty("position"),t.style.removeProperty("top"),t.style.removeProperty("left"),t.style.removeProperty("right"),t.style.removeProperty("width"),t.style.removeProperty("overflow"),t.style.removeProperty("padding-right"),document.documentElement.classList.remove("is-scroll-locked"),window.scrollTo({top:e.current});return()=>{s&&(t.style.cssText="",document.documentElement.classList.remove("is-scroll-locked"),window.scrollTo({top:e.current}))}},[s])}const hn=({href:s,iconName:e,className:t,iconPosition:i,external:n,target:r,children:a,...l})=>{const d={"pkt-link":!0,"pkt-link--icon-left":!!e&&i==="left"||!!(e&&!i),"pkt-link--icon-right":!!e&&i==="right","pkt-link--external":n};return o.jsxs("a",{...l,className:oe(d,t),href:s,target:r,rel:n?"noopener noreferrer":void 0,children:[e&&o.jsx(Y,{name:e,className:"pkt-link__icon"}),a]})};hn.displayName="PktLink";const km=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},pn=({item:s,className:e})=>"href"in s?o.jsx(hn,{iconName:s.iconName,href:s.href,"aria-hidden":"true",className:oe("pkt-user-menu__link",e),children:s.title}):o.jsxs("button",{className:oe("pkt-user-menu__link pkt-link-button pkt-link pkt-link--icon-left",e),type:"button",onClick:()=>{"onClick"in s&&typeof s.onClick=="function"?s.onClick():console.error("UserMenuButton item is missing onClick handler or onClick is not a function:",s)},children:[s.iconName&&o.jsx(Y,{name:s.iconName,className:"pkt-link__icon","aria-hidden":"true"}),s.title]}),_m=({links:s})=>o.jsx("ul",{className:"pkt-user-menu__sublist",children:s.map((e,t)=>o.jsx("li",{className:"pkt-user-menu__subitem",children:o.jsx(pn,{item:e})},t))}),ko=h.forwardRef(({user:s,formattedLastLoggedIn:e,representing:t,userMenu:i,canChangeRepresentation:n,changeRepresentation:r,logoutOnClick:a},l)=>{const d=i==null?void 0:i.map(km);return o.jsx("nav",{className:"pkt-user-menu",ref:l,"aria-label":"Meny for innlogget bruker",children:o.jsxs("ul",{className:"pkt-user-menu__list",children:[s&&o.jsxs("li",{className:"pkt-user-menu__item",children:[o.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),o.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:s.name}),e&&o.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",o.jsx("time",{children:e})]})]}),d&&d.length>0&&o.jsx("li",{className:"pkt-user-menu__item",children:o.jsx(_m,{links:d})}),t&&o.jsxs("li",{className:"pkt-user-menu__item",children:[o.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),o.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:t.name}),t.orgNumber&&o.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",t.orgNumber]}),n&&r&&o.jsx("ul",{className:"pkt-user-menu__sublist mt-size-16",children:o.jsx("li",{className:"pkt-user-menu__subitem",children:o.jsx(pn,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:r}})})})]}),!t&&n&&r&&o.jsx("li",{className:"pkt-user-menu__item",children:o.jsx("ul",{className:"pkt-user-menu__sublist",children:o.jsx("li",{className:"pkt-user-menu__subitem",children:o.jsx(pn,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:r}})})})}),a&&o.jsx("li",{className:"pkt-user-menu__item",children:o.jsx(pn,{item:{title:"Logg ut",iconName:"exit",onClick:a}})})]})})});ko.displayName="PktHeaderUserMenu";const fn=h.forwardRef(({id:s,ariaDescribedby:e,ariaLabelledby:t,autocomplete:i="off",counter:n,counterMaxLength:r,className:a,disabled:l=!1,errorMessage:d,hasError:p=!1,helptext:m,helptextDropdown:b,helptextDropdownButton:y,iconNameRight:k,inline:g=!1,fullwidth:$=!1,label:T,name:M,optionalTag:S=!1,optionalText:O,requiredTag:N=!1,requiredText:U,tagText:X=null,placeholder:te,prefix:$e,suffix:q,type:C="text",useWrapper:H=!0,omitSearchIcon:W=!1,value:Q,minLength:se,maxLength:ie,min:ue,max:ne,step:ge,size:K,readonly:G,required:Ae,dataTestid:re,onChange:ae,skipForwardTestid:Re=!1,...Ve},Se)=>{const Ke=[a,"pkt-textinput"].join(" "),lt=C==="search"&&!k&&!W,we=C==="date"&&Q?Q.slice(0,10):Q,[Ne,Ge]=h.useState((Q==null?void 0:Q.length)||0),Xe=`${s}`,et=`${Xe}-label`,ce=t||et,be=Ie=>{var Me,xe;n&&Ge(((xe=(Me=Ie.currentTarget)==null?void 0:Me.value)==null?void 0:xe.length)||0),ae&&ae(Ie)};return h.useEffect(()=>{Q!==void 0&&Ge((Q==null?void 0:Q.length)||0)},[Q]),o.jsx(Os,{ariaDescribedby:e,className:Ke,disabled:l,errorMessage:d,forId:Xe,hasError:p,helptext:m,helptextDropdown:b,helptextDropdownButton:y,inline:g,label:T,optionalTag:S,optionalText:O,requiredTag:N,requiredText:U,tagText:X,useWrapper:H,counter:n,counterCurrent:Ne,counterMaxLength:r,children:o.jsxs("div",{className:"pkt-input__container","data-testid":re,"data-skip-forward-testid":Re?"true":void 0,children:[$e&&o.jsx("div",{className:"pkt-input-prefix",children:$e}),o.jsx("input",{...Ve,ref:Se,className:`pkt-input ${$?"pkt-input--fullwidth":""} ${r&&Ne>r?"pkt-input--counter-error":""}`,type:C,name:`${M||s}`,value:we,id:Xe,placeholder:te,autoComplete:i,disabled:l,"aria-invalid":p,"aria-errormessage":`${s}-error`,"aria-labelledby":ce,min:ue,max:ne,onChange:be,step:ge,minLength:se,maxLength:ie,size:K,readOnly:G,required:Ae}),q&&o.jsxs("p",{className:"pkt-input-suffix",children:[q,k&&o.jsx(Y,{className:"pkt-input-suffix-icon",name:k}),lt&&o.jsx(Y,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!q&&k&&o.jsx(Y,{className:"pkt-input-icon",name:k}),!q&&lt&&o.jsx(Y,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})});fn.displayName="PktTextinput";const or=h.forwardRef(({mobileBreakpoint:s=768,tabletBreakpoint:e=1280,children:t,className:i,compact:n=!1,"data-mode":r,logOutButtonPlacement:a="none",logOut:l,openedMenu:d,showSearch:p=!1,onSearch:m,onSearchChange:b,searchValue:y,searchPlaceholder:k="Søk",representing:g,serviceLink:$,serviceClick:T,serviceName:M,user:S,userMenu:O,userMenuFooter:N,userOptions:U,canChangeRepresentation:X=!1,changeRepresentation:te,hideLogo:$e=!1,logoLink:q,logoClick:C,position:H="fixed",scrollBehavior:W="hide",slotMenuVariant:Q="icon-only",slotMenuText:se="Meny"},ie)=>{const ue=H==="fixed",ne=W==="hide";h.useEffect(()=>{N&&console.warn('PktHeaderService: The "userMenuFooter" prop is deprecated and will be removed in a future version. Please use "userMenu" instead.')},[N]),h.useEffect(()=>{U&&console.warn('PktHeaderService: The "userOptions" prop is no longer available. Please use "userMenu" instead.')},[U]),h.useEffect(()=>{S!=null&&S.shortname&&console.warn('PktHeaderService: The "shortname" property on the user object is deprecated and will be removed in a future version.'),g!=null&&g.shortname&&console.warn('PktHeaderService: The "shortname" property on the representing object is deprecated and will be removed in a future version.')},[S==null?void 0:S.shortname,g==null?void 0:g.shortname]);const ge=h.useMemo(()=>{if(S!=null&&S.lastLoggedIn)return typeof S.lastLoggedIn=="string"?S.lastLoggedIn:new Date(S.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"})},[S==null?void 0:S.lastLoggedIn]),[K,G]=h.useState(d||"none");h.useEffect(()=>{d!==void 0&&G(d)},[d]);const[Ae,re]=h.useState(!1),[ae,Re]=h.useState(0),[Ve,Se]=h.useState(!1),[Ke,lt]=h.useState(!1),we=h.useRef(null),Ne=h.useRef(null),Ge=h.useRef(null),Xe=h.useRef(null),et=h.useRef(null),ce=h.useRef(null),be=h.useRef(null),Ie=h.useRef(!1),Me=bm(we),xe=Me<s,V=Me<e,De=h.useCallback(u=>{we.current=u,typeof ie=="function"?ie(u):ie&&(ie.current=u)},[ie]);ym(ue&&xe&&K!=="none");const he=h.useCallback((u,_)=>{const x=u.relatedTarget;let L;switch(_){case"user":L=Ne;break;case"slot":L=Ge;break;case"search":L=Xe;break;default:return}const j=L.current;j&&(!x||!j.contains(x))&&G("none")},[]),ye=h.useCallback(()=>{Ie.current&&be.current&&document.contains(be.current)&&be.current.focus(),be.current=null,Ie.current=!1},[]);h.useEffect(()=>{const u=x=>{S&&K==="user"&&!x.target.closest(".pkt-header-service__user-container")&&G("none"),K==="slot"&&!x.target.closest(".pkt-header-service__slot-container")&&G("none"),K==="search"&&!x.target.closest(".pkt-header-service__search-container")&&!x.target.closest(".pkt-header-service__search-input")&&G("none")},_=x=>{x.key==="Escape"&&K!=="none"&&(x.preventDefault(),Ie.current=!0,G("none"))};if(K!=="none")return document.addEventListener("mousedown",u),document.addEventListener("keydown",_),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",_)};ye()},[K,S,ye]),h.useEffect(()=>{const u=()=>{if(ne){const _=window.pageYOffset||document.documentElement.scrollTop;if(_<0||Math.abs(_-ae)<60)return;re(_>ae),Re(_)}};return document&&window.addEventListener("scroll",u),()=>{document&&window.removeEventListener("scroll",u)}},[ne,ae]);const Ue=h.useCallback(u=>{const _=u==="slot"?Ge:Xe,x=u==="slot"?et:ce;if(!_.current||!x.current||!V||xe)return;const L=_.current.getBoundingClientRect(),j=x.current.offsetWidth,R=L.left+j>window.innerWidth;u==="slot"?Se(R):lt(R)},[V,xe]),ct=h.useCallback(u=>{K!=="none"?G("none"):(be.current=document.activeElement,G(u))},[K]);h.useEffect(()=>{(K==="slot"||K==="search")&&requestAnimationFrame(()=>{Ue(K)})},[K,Ue]);const f=o.jsxs("header",{className:oe("pkt-header-service",n&&"pkt-header-service--compact",xe&&"pkt-header-service--mobile",V&&"pkt-header-service--tablet",ue&&"pkt-header-service--fixed",ne&&"pkt-header-service--scroll-to-hide",Ae&&"pkt-header-service--hidden",i),"data-mode":r,ref:De,children:[o.jsxs("div",{className:oe("pkt-header-service__logo-area",(!M||M==="")&&"pkt-header-service__logo-area--without-service"),children:[!$e&&o.jsx("span",{className:"pkt-header-service__logo",children:q?o.jsx("a",{href:q,"aria-label":"Tilbake til forside",children:o.jsx(Y,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/15.4/logos/"})}):C?o.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header-service__logo-link",onClick:C,children:o.jsx(Y,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/15.4/logos/"})}):o.jsx(Y,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/15.4/logos/"})}),M&&o.jsx("span",{className:"pkt-header-service__service-name",children:$?o.jsx(hn,{href:$,className:"pkt-header-service__service-link ",children:M}):T?o.jsx("button",{className:"pkt-link-button pkt-link pkt-header-service__service-link",onClick:T,children:M}):o.jsx("span",{className:"pkt-header-service__service-link",children:M})})]}),o.jsxs("div",{className:"pkt-header-service__content",children:[o.jsxs("div",{className:oe("pkt-header-service__slot-container",K==="slot"&&"is-open"),onBlur:u=>he(u,"slot"),ref:Ge,children:[V&&t&&o.jsx(at,{skin:"secondary",variant:Q,iconName:"menu",size:xe?"small":"medium",state:K==="slot"?"active":"normal",onClick:()=>ct("slot"),"aria-expanded":K==="slot","aria-controls":"mobile-slot-menu","aria-label":"Åpne meny",children:se}),o.jsx("div",{className:oe("pkt-header-service__slot-content",Ve&&"align-right"),id:"mobile-slot-menu",role:V?"menu":void 0,"aria-label":V?"Meny":void 0,ref:et,children:o.jsx("div",{className:"pkt-contents",children:t})})]}),p&&o.jsx(o.Fragment,{children:V?o.jsxs("div",{className:oe("pkt-header-service__search-container",K==="search"&&"is-open"),onBlur:u=>he(u,"search"),ref:Xe,children:[o.jsx(at,{skin:"secondary",variant:"icon-only",iconName:"magnifying-glass-big",size:xe?"small":"medium",onClick:()=>ct("search"),state:K==="search"?"active":"normal","aria-expanded":K==="search","aria-controls":"mobile-search-menu","aria-label":"Åpne søkefelt",children:"Søk"}),o.jsx("div",{className:oe("pkt-header-service__mobile-menu",K==="search"&&"is-open",Ke&&"align-right"),ref:ce,children:K==="search"&&o.jsx(fn,{id:"mobile-search-menu",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:k,value:y,autoFocus:!0,fullwidth:!0,onChange:u=>b==null?void 0:b(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(m==null||m(u.target.value))}})})]}):o.jsx(fn,{id:"header-service-search",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:k,value:y,onChange:u=>b==null?void 0:b(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(m==null||m(u.target.value))}})}),V&&l&&(a==="header"||a==="both")&&o.jsx(at,{skin:"secondary",size:xe?"small":"medium",variant:"icon-only",iconName:"exit",onClick:l,children:"Logg ut"})]}),o.jsxs("div",{className:"pkt-header-service__user",children:[S&&o.jsxs("div",{className:"pkt-header-service__user-container",onBlur:u=>he(u,"user"),ref:Ne,children:[o.jsxs(at,{className:oe("pkt-header-service__user-button",xe&&"pkt-header-service__user-button--mobile"),skin:"secondary",size:xe?"small":"medium",state:K==="user"?"active":"normal",variant:"icons-right-and-left",iconName:"user",secondIconName:K==="user"?"chevron-thin-up":"chevron-thin-down",onClick:()=>ct("user"),children:[o.jsx("span",{className:"pkt-sr-only",children:"Brukermeny: "}),(g==null?void 0:g.name)||S.name]}),K==="user"&&S&&o.jsx("div",{className:oe(xe?"pkt-header-service__mobile-menu":"pkt-header-service__user-menu","is-open"),children:o.jsx(ko,{user:S,formattedLastLoggedIn:ge,representing:g,userMenu:O,canChangeRepresentation:X,changeRepresentation:te,logoutOnClick:a==="userMenu"||a==="both"?l:void 0})})]}),!xe&&l&&(a==="header"||a==="both")&&o.jsx(at,{skin:"tertiary",size:"medium",variant:"icon-right",iconName:"exit",onClick:l,children:"Logg ut"})]})]});return ue?o.jsxs("div",{className:"pkt-header-service-wrapper",children:[f,o.jsx("div",{className:oe("pkt-header-service-spacer",n&&"pkt-header-service-spacer--compact",S&&"pkt-header-service-spacer--has-user",xe&&"pkt-header-service-spacer--mobile",V&&"pkt-header-service-spacer--tablet")})]}):f});or.displayName="PktHeaderService";const _o=h.forwardRef((s,e)=>o.jsx(or,{...s,ref:e}));_o.displayName="PktHeader";const $m=It({tagName:"pkt-heading",elementClass:ss,react:h,displayName:"PktHeading"}),$o=h.forwardRef(({children:s,...e},t)=>o.jsx($m,{"data-testid":"pkt-heading",...e,ref:t,children:s}));$o.displayName="PktHeading";const wm=It({tagName:"pkt-helptext",elementClass:Yt,react:h,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),wo=h.forwardRef(({children:s,...e},t)=>o.jsx(wm,{...e,ref:t,children:o.jsx("div",{className:"pkt-contents",children:s})}));wo.displayName="PktHelptext";const xo=h.forwardRef(({label:s,id:e,children:t,...i},n)=>o.jsxs("div",{className:"pkt-form-group",children:[o.jsx("label",{htmlFor:e,className:"pkt-form-label",children:s}),o.jsx("input",{className:"pkt-form-input",id:e,...i,ref:n}),t]}));xo.displayName="PktInput";const So=({children:s,skin:e,title:t,href:i,iconName:n,openInNewTab:r,external:a,className:l,...d})=>{const p=["pkt-linkcard",e&&`pkt-linkcard--${e}`].filter(Boolean).join(" "),m=["pkt-linkcard__title",a&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return o.jsxs("a",{...d,href:i,className:oe(p,l),target:r?"_blank":"_self",rel:r?"noopener noreferrer":void 0,children:[n&&o.jsx(Y,{className:"pkt-link__icon",name:n}),t&&o.jsx("div",{className:oe(m),children:t}),o.jsx("div",{className:"pkt-linkcard__text",children:s})]})};So.displayName="PktLinkCard";const xm=It({tagName:"pkt-loader",elementClass:Pt,react:h,displayName:"PktLoader",events:{}}),Co=h.forwardRef(({children:s,...e},t)=>o.jsx(xm,{...e,ref:t,children:o.jsx("div",{className:"pkt-contents",children:s})}));Co.displayName="PktLoader";const To=({children:s,className:e,skin:t,title:i,compact:n,closable:r,onClose:a,...l})=>{const[d,p]=h.useState(!1),m={"pkt-messagebox":!0,"pkt-messagebox--compact":n,[`pkt-messagebox--${t}`]:t,"pkt-messagebox--closable":r,"pkt-hide":d},b=h.createRef(),y=h.useCallback(()=>{p(!0),a&&a()},[p,a]);return o.jsxs("div",{...l,className:oe(m,e),ref:b,children:[r&&o.jsx("div",{className:"pkt-messagebox__close",children:o.jsx("button",{onClick:y,className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only","aria-label":"Lukk",children:o.jsx(Y,{name:"close",className:"pkt-link__icon"})})}),i&&o.jsx("div",{className:"pkt-messagebox__title",children:i}),o.jsx("div",{className:"pkt-messagebox__text",children:s})]})};To.displayName="PktMessagebox";const Sm=It({tagName:"pkt-progressbar",elementClass:Fe,react:h,displayName:"PktProgressbar",events:{}}),mn=h.forwardRef(({children:s,...e},t)=>o.jsx(Sm,{ref:t,...e,children:o.jsx("div",{className:"pkt-contents",children:s})}));mn.displayName="PktProgressbar";const No=h.forwardRef(({id:s,name:e,label:t,className:i,hasTile:n=!1,disabled:r=!1,checkHelptext:a,hasError:l=!1,defaultChecked:d,checked:p,optionalTag:m,optionalText:b,requiredTag:y,requiredText:k,tagText:g,...$},T)=>{const M=[i,"pkt-input-check"].filter(Boolean).join(" "),S=["pkt-input-check__input",n?"pkt-input-check__input--tile":"",r&&n?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),O=["pkt-input-check__input-checkbox",l?"pkt-input-check__input-checkbox--error":""].filter(Boolean).join(" "),N=["pkt-input-check__input-label",r?"pkt-input-check__input-label--disabled":""].filter(Boolean).join(" "),U=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),X=()=>o.jsxs(o.Fragment,{children:[g&&o.jsx("span",{className:U+" pkt-tag--gray",children:g}),m&&o.jsx("span",{className:U+" pkt-tag--blue-light",children:b}),y&&o.jsx("span",{className:U+" pkt-tag--beige",children:k})]});return o.jsx("div",{className:M,children:o.jsxs("div",{className:S,children:[o.jsx("input",{ref:T,id:s,type:"radio",name:e,disabled:r,className:O,...p!==void 0?{checked:p}:{defaultChecked:d},...$}),o.jsxs("label",{className:N,htmlFor:s,children:[t," ",X(),a&&o.jsx("div",{className:"pkt-input-check__input-helptext",children:a})]})]})})});No.displayName="PktRadioButton";const Mo=h.forwardRef(({appearance:s="local",disabled:e=!1,fullwidth:t=!1,id:i,label:n,name:r,placeholder:a="Søk…",suggestions:l,value:d="",action:p,method:m,onChange:b,onSearch:y,onSuggestionClick:k,...g},$)=>{const T=(N,U)=>{N?N():k&&k(U)},M=N=>{d=N.target.value},S=`pkt-searchinput pkt-searchinput--${s} ${t?"pkt-searchinput--fullwidth":""}`;let O;return p?O=N=>o.jsx("form",{role:"search",className:S,action:p,method:m,children:N}):O=N=>o.jsx("div",{role:"search",className:S,children:N}),O(o.jsxs(o.Fragment,{children:[n&&o.jsx("label",{htmlFor:n?i:void 0,className:n?"pkt-inputwrapper__label":"",children:n}),o.jsxs("div",{className:s==="local"?"pkt-input__container":"pkt-searchinput__field",children:[o.jsx("input",{className:`pkt-input ${t?"pkt-input--fullwidth":""}`,type:"search",name:r||i,id:i,placeholder:a,defaultValue:d,disabled:e,autoComplete:"off","aria-autocomplete":"list",ref:$,"aria-controls":`${i}-suggestions`,onChange:b||M,onKeyUp:y&&(N=>{N.key==="Enter"&&(N.preventDefault(),y(d))}),...g}),o.jsx(at,{className:`pkt-searchinput__button ${s==="local"?"pkt-input-icon":""}`,variant:"icon-only",iconName:"magnifying-glass-big",skin:s==="local"?"tertiary":"primary",color:s==="global"?"yellow":void 0,type:"submit",disabled:e,onClick:y&&(N=>{N.preventDefault(),y(d)}),children:n||a})]}),l&&o.jsx("ul",{id:`${i}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:l.map((N,U)=>o.jsx("li",{children:h.createElement(N.href?"a":N.onClick?"button":"div",{href:N.href,className:`pkt-searchinput__suggestion ${N.onClick?"pkt-link-button":""} ${N.href||N.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:N.onClick?"button":void 0,onClick:()=>T(N.onClick,U),onKeyUp:X=>X.key==="Enter"&&T(N.onClick,U)},o.jsxs(o.Fragment,{children:[N.title&&o.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:N.title}),N.text&&o.jsx("p",{className:"pkt-searchinput__suggestion-text",children:N.text})]}))},`search-suggestion-${U}`))})]}))});Mo.displayName="PktSearchInput";const Do=h.forwardRef(({ariaDescribedby:s,ariaLabelledby:e,children:t,className:i,disabled:n=!1,errorMessage:r,hasError:a,helptext:l,helptextDropdown:d,helptextDropdownButton:p,id:m,inline:b=!1,fullwidth:y=!1,label:k,name:g,optionalTag:$=!1,optionalText:T,requiredTag:M=!1,requiredText:S,tagText:O,...N},U)=>{const X=[i,"pkt-select"].join(" ");return o.jsx(Os,{className:X,forId:`${m}-input`,label:k,helptext:l,helptextDropdown:d,helptextDropdownButton:p,optionalTag:$,optionalText:T,requiredTag:M,requiredText:S,tagText:O,hasError:a,errorMessage:r,disabled:n,inline:b,ariaDescribedby:s,children:o.jsx("select",{ref:U,className:`pkt-input ${y?"pkt-input--fullwidth":""}`,"aria-invalid":a,"aria-errormessage":`${m}-error`,"aria-labelledby":e||void 0,disabled:n,id:`${m}-input`,name:g||m,...N,children:t})})});Do.displayName="PktSelect";const Cm=o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:o.jsx("circle",{cx:"12",cy:"12",r:"7",style:{fill:"var(--pkt-color-grays-grey-200, #CCC)"}})}),Tm=o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[o.jsx("circle",{opacity:".15",cx:"12",cy:"12",r:"12",fill:"#2A2859"}),o.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"#2A2859"})]}),Nm=o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[o.jsx("path",{fill:"#2A2859",d:"M3 3h18v18H3z"}),o.jsx("path",{d:"m10.34 16-1.11-1.14L7 12.58l1.11-1.15 2.23 2.28L15.88 8 17 9.15l-5.55 5.71L10.34 16Z",fill:"#F1FDFF"})]}),Mm=({children:s,className:e,status:t="incomplete",title:i})=>o.jsxs("li",{className:oe("pkt-step",e,`pkt-step--${t}`),"data-testid":"pkt-step",children:[o.jsx("span",{className:"pkt-step__line pkt-step__line--1","aria-hidden":!0}),o.jsx("span",{className:"pkt-step__line pkt-step__line--2","aria-hidden":!0}),o.jsx("span",{className:oe("pkt-step__indicator"),children:t==="current"?Tm:t==="completed"?Nm:Cm}),o.jsx("span",{className:"pkt-step__line pkt-step__line--3","aria-hidden":!0}),o.jsxs("div",{className:"pkt-step__wrapper",children:[o.jsx("div",{className:"pkt-step__title",children:i}),o.jsx("div",{className:"pkt-step__content",children:s})]})]}),Oo=h.forwardRef(({activeStep:s,className:e,children:t,hideNonActiveSteps:i=!1,hideNonActiveStepsContent:n=!0,orientation:r="vertical",...a},l)=>{const d=oe(e,"pkt-stepper",r==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),p=h.Children.map(t,(m,b)=>h.isValidElement(m)?h.cloneElement(m,{className:oe(m.props.className,{"pkt-step--hideStep":i&&b!==s,"pkt-step--hideContent":n&&b!==s})}):m);return o.jsx("ol",{"data-testid":"pkt-stepper",className:d,ref:l,...a,children:p})});Oo.displayName="PktStepper";const Dm=({className:s,compact:e=!1,skin:t="basic",responsiveView:i=!0,children:n,...r})=>o.jsx("table",{"data-testid":"pkt-table",className:oe(s,"pkt-table",{"pkt-table--responsive":i,"pkt-table--compact":e,"pkt-table--basic":t==="basic","pkt-table--zebra-blue":t==="zebra-blue"}),role:"table",...r,children:n}),Om=({id:s,children:e,className:t,...i})=>o.jsx("tbody",{id:s,className:oe(t,"pkt-table__body",{}),...i,role:"rowgroup",children:e}),Em=({children:s,className:e,dataLabel:t,...i})=>o.jsx("td",{className:oe(e,"pkt-table__data-cell",{}),"data-label":t,role:"cell","data-testid":"pkt-table__data-cell",...i,children:s}),Pm=({className:s,children:e,...t})=>o.jsx("thead",{className:oe(s,"pkt-table__header",{}),role:"rowgroup",...t,children:e}),Am=({className:s,children:e,...t})=>o.jsx("th",{className:oe(s,"pkt-table__header-cell",{}),role:"columnheader",...t,children:e}),Im=({className:s,children:e,...t})=>o.jsx("tr",{className:oe(s,"pkt-table__row",{}),role:"row",...t,children:e}),lr=h.forwardRef(({children:s,active:e,href:t,onClick:i,icon:n,controls:r,tag:a,tagSkin:l,index:d=0},p)=>{const{arrowNav:m,registerTabRef:b,handleKeyPress:y,selectTab:k}=Lm(),$={"aria-selected":m?!!e:void 0,"aria-controls":r,role:m?"tab":void 0,onKeyUp:M=>y(d,M),onClick:M=>{k(d),i==null||i(M)},tabIndex:e||!m?void 0:-1,ref:M=>{b(d,M),typeof p=="function"?p(M):p&&(p.current=M)}},T=o.jsxs(o.Fragment,{children:[n&&o.jsx(Y,{name:n,className:"pkt-icon--small"}),s,a&&o.jsx(dn,{skin:l,size:"small",children:a})]});return t?o.jsx("a",{...$,href:t,className:`pkt-tabs__link ${e?"active":""}`,children:T}):o.jsx("button",{...$,type:"button",className:`pkt-tabs__button pkt-link-button ${e?"active":""}`,children:T})});lr.displayName="PktTabItem";const Eo=h.createContext(null),Lm=()=>{const s=h.useContext(Eo);if(!s)throw new Error("TabItem must be used within a Tabs component");return s},Po=h.forwardRef(({arrowNav:s=!0,disableArrowNav:e=!1,tabs:t,onTabSelected:i,children:n},r)=>{const a=h.useRef([]),l=s&&!e,p=n&&h.Children.count(n)>0?h.Children.count(n):(t==null?void 0:t.length)||0;h.useEffect(()=>{a.current=a.current.slice(0,p)},[p]);const m=g=>{const $=t==null?void 0:t[g];$!=null&&$.action&&$.action(g),i&&i(g)},b=(g,$)=>{var T,M;l&&($.code==="ArrowLeft"&&g!==0&&((T=a.current[g-1])==null||T.focus()),$.code==="ArrowRight"&&g<p-1&&((M=a.current[g+1])==null||M.focus()),($.code==="ArrowDown"||$.code==="Space")&&m(g))},y=(g,$)=>{a.current[g]=$},k=t==null?void 0:t.map((g,$)=>{var T,M;return o.jsx(lr,{active:g.active,href:g.href,onClick:()=>m($),icon:g.icon,controls:g.controls,tag:(T=g.tag)==null?void 0:T.text,tagSkin:(M=g.tag)==null?void 0:M.skin,index:$,children:g.text},$)});return o.jsx(Eo.Provider,{value:{arrowNav:l,registerTabRef:y,handleKeyPress:b,selectTab:m},children:o.jsx("div",{className:"pkt-tabs",ref:r,children:o.jsx("div",{className:"pkt-tabs__list",role:l?"tablist":"navigation",children:n||k})})})});Po.displayName="PktTabs";var Rs=window.CustomEvent;(!Rs||typeof Rs=="object")&&(Rs=function(s,e){e=e||{};var t=document.createEvent("CustomEvent");return t.initCustomEvent(s,!!e.bubbles,!!e.cancelable,e.detail||null),t},Rs.prototype=window.Event.prototype);function Ao(s,e){var t="on"+e.type.toLowerCase();return typeof s[t]=="function"&&s[t](e),s.dispatchEvent(e)}function Bm(s){for(;s&&s!==document.body;){var e=window.getComputedStyle(s),t=function(i,n){return!(e[i]===void 0||e[i]===n)};if(e.opacity<1||t("zIndex","auto")||t("transform","none")||t("mixBlendMode","normal")||t("filter","none")||t("perspective","none")||e.isolation==="isolate"||e.position==="fixed"||e.webkitOverflowScrolling==="touch")return!0;s=s.parentElement}return!1}function Ii(s){for(;s;){if(s.localName==="dialog")return s;s.parentElement?s=s.parentElement:s.parentNode?s=s.parentNode.host:s=null}return null}function Io(s){for(;s&&s.shadowRoot&&s.shadowRoot.activeElement;)s=s.shadowRoot.activeElement;s&&s.blur&&s!==document.body&&s.blur()}function Fm(s,e){for(var t=0;t<s.length;++t)if(s[t]===e)return!0;return!1}function cr(s){return!s||!s.hasAttribute("method")?!1:s.getAttribute("method").toLowerCase()==="dialog"}function Lo(s){var e=["button","input","keygen","select","textarea"],t=e.map(function(a){return a+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');var i=s.querySelector(t.join(", "));if(!i&&"attachShadow"in Element.prototype)for(var n=s.querySelectorAll("*"),r=0;r<n.length&&!(n[r].tagName&&n[r].shadowRoot&&(i=Lo(n[r].shadowRoot),i));r++);return i}function Bo(s){return s.isConnected||document.body.contains(s)}function Fo(s){if(s.submitter)return s.submitter;var e=s.target;if(!(e instanceof HTMLFormElement))return null;var t=le.formSubmitter;if(!t){var i=s.target,n="getRootNode"in i&&i.getRootNode()||document;t=n.activeElement}return!t||t.form!==e?null:t}function Hm(s){if(!s.defaultPrevented){var e=s.target,t=le.imagemapUseValue,i=Fo(s);t===null&&i&&(t=i.value);var n=Ii(e);if(n){var r=i&&i.getAttribute("formmethod")||e.getAttribute("method");r==="dialog"&&(s.preventDefault(),t!=null?n.close(t):n.close())}}}function Ho(s){if(this.dialog_=s,this.replacedStyleTop_=!1,this.openAsModal_=!1,s.hasAttribute("role")||s.setAttribute("role","dialog"),s.show=this.show.bind(this),s.showModal=this.showModal.bind(this),s.close=this.close.bind(this),s.addEventListener("submit",Hm,!1),"returnValue"in s||(s.returnValue=""),"MutationObserver"in window){var e=new MutationObserver(this.maybeHideModal.bind(this));e.observe(s,{attributes:!0,attributeFilter:["open"]})}else{var t=!1,i=(function(){t?this.downgradeModal():this.maybeHideModal(),t=!1}).bind(this),n,r=function(a){if(a.target===s){var l="DOMNodeRemoved";t|=a.type.substr(0,l.length)===l,window.clearTimeout(n),n=window.setTimeout(i,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(a){s.addEventListener(a,r)})}Object.defineProperty(s,"open",{set:this.setOpen.bind(this),get:s.hasAttribute.bind(s,"open")}),this.backdrop_=document.createElement("div"),this.backdrop_.className="backdrop",this.backdrop_.addEventListener("mouseup",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("mousedown",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("click",this.backdropMouseEvent_.bind(this))}Ho.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&Bo(this.dialog_)||this.downgradeModal()},downgradeModal:function(){this.openAsModal_&&(this.openAsModal_=!1,this.dialog_.style.zIndex="",this.replacedStyleTop_&&(this.dialog_.style.top="",this.replacedStyleTop_=!1),this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_),le.dm.removeDialog(this))},setOpen:function(s){s?this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open",""):(this.dialog_.removeAttribute("open"),this.maybeHideModal())},backdropMouseEvent_:function(s){if(this.dialog_.hasAttribute("tabindex"))this.dialog_.focus();else{var e=document.createElement("div");this.dialog_.insertBefore(e,this.dialog_.firstChild),e.tabIndex=-1,e.focus(),this.dialog_.removeChild(e)}var t=document.createEvent("MouseEvents");t.initMouseEvent(s.type,s.bubbles,s.cancelable,window,s.detail,s.screenX,s.screenY,s.clientX,s.clientY,s.ctrlKey,s.altKey,s.shiftKey,s.metaKey,s.button,s.relatedTarget),this.dialog_.dispatchEvent(t),s.stopPropagation()},focus_:function(){var s=this.dialog_.querySelector("[autofocus]:not([disabled])");!s&&this.dialog_.tabIndex>=0&&(s=this.dialog_),s||(s=Lo(this.dialog_)),Io(document.activeElement),s&&s.focus()},updateZIndex:function(s,e){if(s<e)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=s,this.backdrop_.style.zIndex=e},show:function(){this.dialog_.open||(this.setOpen(!0),this.focus_())},showModal:function(){if(this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.");if(!Bo(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!le.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");Bm(this.dialog_.parentElement)&&console.warn("A dialog is being shown inside a stacking context. This may cause it to be unusable. For more information, see this link: https://github.com/GoogleChrome/dialog-polyfill/#stacking-context"),this.setOpen(!0),this.openAsModal_=!0,le.needsCentering(this.dialog_)?(le.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(s){if(!this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.");this.setOpen(!1),s!==void 0&&(this.dialog_.returnValue=s);var e=new Rs("close",{bubbles:!1,cancelable:!1});Ao(this.dialog_,e)}};var le={};if(le.reposition=function(s){var e=document.body.scrollTop||document.documentElement.scrollTop,t=e+(window.innerHeight-s.offsetHeight)/2;s.style.top=Math.max(e,t)+"px"},le.isInlinePositionSetByStylesheet=function(s){for(var e=0;e<document.styleSheets.length;++e){var t=document.styleSheets[e],i=null;try{i=t.cssRules}catch{}if(i)for(var n=0;n<i.length;++n){var r=i[n],a=null;try{a=document.querySelectorAll(r.selectorText)}catch{}if(!(!a||!Fm(a,s))){var l=r.style.getPropertyValue("top"),d=r.style.getPropertyValue("bottom");if(l&&l!=="auto"||d&&d!=="auto")return!0}}}return!1},le.needsCentering=function(s){var e=window.getComputedStyle(s);return e.position!=="absolute"||s.style.top!=="auto"&&s.style.top!==""||s.style.bottom!=="auto"&&s.style.bottom!==""?!1:!le.isInlinePositionSetByStylesheet(s)},le.forceRegisterDialog=function(s){if((window.HTMLDialogElement||s.showModal)&&console.warn("This browser already supports <dialog>, the polyfill may not work correctly",s),s.localName!=="dialog")throw new Error("Failed to register dialog: The element is not a dialog.");new Ho(s)},le.registerDialog=function(s){s.showModal||le.forceRegisterDialog(s)},le.DialogManager=function(){this.pendingDialogStack=[];var s=this.checkDOM_.bind(this);this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",(function(e){this.forwardTab_=void 0,e.stopPropagation(),s([])}).bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=100150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver(function(e){var t=[];e.forEach(function(i){for(var n=0,r;r=i.removedNodes[n];++n){if(r instanceof Element)r.localName==="dialog"&&t.push(r);else continue;t=t.concat(r.querySelectorAll("dialog"))}}),t.length&&s(t)}))},le.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0),document.addEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})},le.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},le.DialogManager.prototype.updateStacking=function(){for(var s=this.zIndexHigh_,e=0,t;t=this.pendingDialogStack[e];++e)t.updateZIndex(--s,--s),e===0&&(this.overlay.style.zIndex=--s);var i=this.pendingDialogStack[0];if(i){var n=i.dialog.parentNode||document.body;n.appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},le.DialogManager.prototype.containedByTopDialog_=function(s){for(;s=Ii(s);){for(var e=0,t;t=this.pendingDialogStack[e];++e)if(t.dialog===s)return e===0;s=s.parentElement}return!1},le.DialogManager.prototype.handleFocus_=function(s){var e=s.composedPath?s.composedPath()[0]:s.target;if(!this.containedByTopDialog_(e)&&document.activeElement!==document.documentElement&&(s.preventDefault(),s.stopPropagation(),Io(e),this.forwardTab_!==void 0)){var t=this.pendingDialogStack[0],i=t.dialog,n=i.compareDocumentPosition(e);return n&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?t.focus_():e!==document.documentElement&&document.documentElement.focus()),!1}},le.DialogManager.prototype.handleKey_=function(s){if(this.forwardTab_=void 0,s.keyCode===27){s.preventDefault(),s.stopPropagation();var e=new Rs("cancel",{bubbles:!1,cancelable:!0}),t=this.pendingDialogStack[0];t&&Ao(t.dialog,e)&&t.dialog.close()}else s.keyCode===9&&(this.forwardTab_=!s.shiftKey)},le.DialogManager.prototype.checkDOM_=function(s){var e=this.pendingDialogStack.slice();e.forEach(function(t){s.indexOf(t.dialog)!==-1?t.downgradeModal():t.maybeHideModal()})},le.DialogManager.prototype.pushDialog=function(s){var e=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=e?!1:(this.pendingDialogStack.unshift(s)===1&&this.blockDocument(),this.updateStacking(),!0)},le.DialogManager.prototype.removeDialog=function(s){var e=this.pendingDialogStack.indexOf(s);e!==-1&&(this.pendingDialogStack.splice(e,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())},le.dm=new le.DialogManager,le.formSubmitter=null,le.imagemapUseValue=null,window.HTMLDialogElement===void 0){var Vo=document.createElement("form");if(Vo.setAttribute("method","dialog"),Vo.method!=="dialog"){var ei=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(ei){var Vm=ei.get;ei.get=function(){return cr(this)?"dialog":Vm.call(this)};var Um=ei.set;ei.set=function(s){return typeof s=="string"&&s.toLowerCase()==="dialog"?this.setAttribute("method",s):Um.call(this,s)},Object.defineProperty(HTMLFormElement.prototype,"method",ei)}}document.addEventListener("click",function(s){if(le.formSubmitter=null,le.imagemapUseValue=null,!s.defaultPrevented){var e=s.target;if("composedPath"in s){var t=s.composedPath();e=t.shift()||e}if(!(!e||!cr(e.form))){var i=e.type==="submit"&&["button","input"].indexOf(e.localName)>-1;if(!i){if(!(e.localName==="input"&&e.type==="image"))return;le.imagemapUseValue=s.offsetX+","+s.offsetY}var n=Ii(e);n&&(le.formSubmitter=e)}}},!1),document.addEventListener("submit",function(s){var e=s.target,t=Ii(e);if(!t){var i=Fo(s),n=i&&i.getAttribute("formmethod")||e.getAttribute("method");n==="dialog"&&s.preventDefault()}});var jm=HTMLFormElement.prototype.submit,qm=function(){if(!cr(this))return jm.call(this);var s=Ii(this);s&&s.close()};HTMLFormElement.prototype.submit=qm}const Wm=Object.freeze(Object.defineProperty({__proto__:null,default:le},Symbol.toStringTag,{value:"Module"}));A.FileItem=fo,A.ItemRenderers=ar,A.PktAccordion=hr,A.PktAccordionItem=Ea,A.PktAlert=rn,A.PktBackLink=Aa,A.PktBreadcrumbs=Ia,A.PktButton=at,A.PktCalendar=er,A.PktCard=ao,A.PktCheckbox=oo,A.PktCombobox=lo,A.PktConsent=ln,A.PktDatepicker=ho,A.PktFileUpload=yo,A.PktFooter=gm,A.PktFooterSimple=vm,A.PktHeader=_o,A.PktHeaderService=or,A.PktHeading=$o,A.PktHelptext=wo,A.PktIcon=Y,A.PktInput=xo,A.PktInputWrapper=Os,A.PktLink=hn,A.PktLinkCard=So,A.PktLoader=Co,A.PktMessagebox=To,A.PktModal=ir,A.PktProgressbar=mn,A.PktRadioButton=No,A.PktSearchInput=Mo,A.PktSelect=Do,A.PktStep=Mm,A.PktStepper=Oo,A.PktTabItem=lr,A.PktTable=Dm,A.PktTableBody=Om,A.PktTableDataCell=Em,A.PktTableHeader=Pm,A.PktTableHeaderCell=Am,A.PktTableRow=Im,A.PktTabs=Po,A.PktTag=dn,A.PktTextarea=sr,A.PktTextinput=fn,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})}));