@oslokommune/punkt-react 16.10.0 → 16.11.0

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.
@@ -34,35 +34,35 @@
34
34
  };
35
35
  }
36
36
  (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`react`),require(`react/jsx-runtime`),require(`react-router-dom`)):typeof define==`function`&&define.amd?define([`exports`,`react`,`react/jsx-runtime`,`react-router-dom`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e[`punkt-react`]={},e.React,e.ReactJsxRuntime,e.ReactRouterDOM))})(this,function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t)=>()=>(e&&(t=e(e=0)),t),d=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),f=(e,t)=>{let n={};for(var r in e)a(n,r,{get:e[r],enumerable:!0});return t||a(n,Symbol.toStringTag,{value:`Module`}),n},p=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=s(t),c=0,u=i.length,d;c<u;c++)d=i[c],!l.call(e,d)&&d!==n&&a(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=o(t,d))||r.enumerable});return e},m=(e,t,n)=>(n=e==null?{}:i(c(e)),p(t||!e||!e.__esModule?a(n,`default`,{value:e,enumerable:!0}):n,e));t=m(t,1);var h=(0,t.createContext)({}),g=()=>(0,t.useContext)(h),_=(0,t.forwardRef)(({compact:e=!1,skin:t=`borderless`,ariaLabelledBy:r,children:i,name:a,className:o},s)=>{let c=[`pkt-accordion`,e&&`pkt-accordion--compact`,t&&`pkt-accordion--${t}`,o].filter(Boolean).join(` `);return(0,n.jsx)(h.Provider,{value:{name:a},children:(0,n.jsx)(`div`,{ref:s,className:c,"data-testid":`pkt-accordion`,"aria-labelledby":r||void 0,children:i})})});_.displayName=`PktAccordion`;var v=new Set([`children`,`localName`,`ref`,`style`,`className`]),y=new WeakMap,b=(e,t,n,r,i)=>{let a=i?.[t];a===void 0?(e[t]=n,n==null&&t in HTMLElement.prototype&&e.removeAttribute(t)):n!==r&&((e,t,n)=>{let r=y.get(e);r===void 0&&y.set(e,r=new Map);let i=r.get(t);n===void 0?i!==void 0&&(r.delete(t),e.removeEventListener(t,i)):i===void 0?(r.set(t,i={handleEvent:n}),e.addEventListener(t,i)):i.handleEvent=n})(e,a,n)},x=({react:e,tagName:t,elementClass:n,events:r,displayName:i})=>{let a=new Set(Object.keys(r??{})),o=e.forwardRef(((i,o)=>{let s=e.useRef(new Map),c=e.useRef(null),l={},u={};for(let[e,t]of Object.entries(i))v.has(e)?l[e===`className`?`class`:e]=t:a.has(e)||e in n.prototype?u[e]=t:l[e]=t;return e.useLayoutEffect((()=>{if(c.current===null)return;let e=new Map;for(let t in u)b(c.current,t,i[t],s.current.get(t),r),s.current.delete(t),e.set(t,i[t]);for(let[e,t]of s.current)b(c.current,e,void 0,t,r);s.current=e})),e.useLayoutEffect((()=>{c.current?.removeAttribute(`defer-hydration`)}),[]),l.suppressHydrationWarning=!0,e.createElement(t,{...l,ref:e.useCallback((e=>{c.current=e,typeof o==`function`?o(e):o!==null&&(o.current=e)}),[o])})}));return o.displayName=i??n.name,o},S=globalThis,C=e=>e,w=S.trustedTypes,ee=w?w.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,T=`$lit$`,E=`lit$${Math.random().toFixed(9).slice(2)}$`,te=`?`+E,ne=`<${te}>`,re=document,D=()=>re.createComment(``),ie=e=>e===null||typeof e!=`object`&&typeof e!=`function`,ae=Array.isArray,oe=e=>ae(e)||typeof e?.[Symbol.iterator]==`function`,se=`[
37
- \f\r]`,ce=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,O=/-->/g,le=/>/g,k=RegExp(`>|${se}(?:([^\\s"'>=/]+)(${se}*=${se}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),A=/'/g,ue=/"/g,de=/^(?:script|style|textarea|title)$/i,j=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),M=Symbol.for(`lit-noChange`),N=Symbol.for(`lit-nothing`),P=new WeakMap,F=re.createTreeWalker(re,129);function I(e,t){if(!ae(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return ee===void 0?t:ee.createHTML(t)}var fe=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=ce;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===ce?c[1]===`!--`?o=O:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=k):(de.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=k):o=le:o===k?c[0]===`>`?(o=i??ce,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?k:c[3]===`"`?ue:A):o===ue||o===A?o=k:o===O||o===le?o=ce:(o=k,i=void 0);let d=o===k&&e[t+1].startsWith(`/>`)?` `:``;a+=o===ce?n+ne:l>=0?(r.push(s),n.slice(0,l)+T+n.slice(l)+E+d):n+E+(l===-2?t:d)}return[I(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},pe=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=fe(t,n);if(this.el=e.createElement(l,r),F.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=F.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(T)){let t=u[o++],n=i.getAttribute(e).split(E),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?z:r[1]===`?`?B:r[1]===`@`?V:he}),i.removeAttribute(e)}else e.startsWith(E)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(de.test(i.tagName)){let e=i.textContent.split(E),t=e.length-1;if(t>0){i.textContent=w?w.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],D()),F.nextNode(),c.push({type:2,index:++a});i.append(e[t],D())}}}else if(i.nodeType===8)if(i.data===te)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(E,e+1))!==-1;)c.push({type:7,index:a}),e+=E.length-1}a++}}static createElement(e,t){let n=re.createElement(`template`);return n.innerHTML=e,n}};function L(e,t,n=e,r){if(t===M)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=ie(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=L(e,i._$AS(e,t.values),i,r)),t}var R=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){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??re).importNode(t,!0);F.currentNode=r;let i=F.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new me(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new ge(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=F.nextNode(),a++)}return F.currentNode=re,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},me=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=N,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=L(this,e,t),ie(e)?e===N||e==null||e===``?(this._$AH!==N&&this._$AR(),this._$AH=N):e!==this._$AH&&e!==M&&this._(e):e._$litType$===void 0?e.nodeType===void 0?oe(e)?this.k(e):this._(e):this.T(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!==N&&ie(this._$AH)?this._$AA.nextSibling.data=e:this.T(re.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=pe.createElement(I(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new R(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=P.get(e.strings);return t===void 0&&P.set(e.strings,t=new pe(e)),t}k(t){ae(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(D()),this.O(D()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=C(e).nextSibling;C(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},he=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=N,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=N}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=L(this,e,t,0),a=!ie(e)||e!==this._$AH&&e!==M,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=L(this,r[n+o],t,o),s===M&&(s=this._$AH[o]),a||=!ie(s)||s!==this._$AH[o],s===N?e=N:e!==N&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===N?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},z=class extends he{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===N?void 0:e}},B=class extends he{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==N)}},V=class extends he{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=L(this,e,t,0)??N)===M)return;let n=this._$AH,r=e===N&&n!==N||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==N&&(n===N||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},ge=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){L(this,e)}},H={M:T,P:E,A:te,C:1,L:fe,R,D:oe,V:L,I:me,H:he,N:B,U:V,B:z,F:ge},_e=S.litHtmlPolyfillSupport;_e?.(pe,me),(S.litHtmlVersions??=[]).push(`3.3.2`);var ve=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new me(t.insertBefore(D(),e),e,void 0,n??{})}return i._$AI(e),i},U=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer(()=>{customElements.define(e,t)})},ye=globalThis,be=ye.ShadowRoot&&(ye.ShadyCSS===void 0||ye.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,xe=Symbol(),Se=new WeakMap,Ce=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==xe)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(be&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=Se.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Se.set(t,e))}return e}toString(){return this.cssText}},we=e=>new Ce(typeof e==`string`?e:e+``,void 0,xe),Te=(e,t)=>{if(be)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let n of t){let t=document.createElement(`style`),r=ye.litNonce;r!==void 0&&t.setAttribute(`nonce`,r),t.textContent=n.cssText,e.appendChild(t)}},Ee=be?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return we(t)})(e):e,{is:De,defineProperty:Oe,getOwnPropertyDescriptor:ke,getOwnPropertyNames:Ae,getOwnPropertySymbols:je,getPrototypeOf:Me}=Object,Ne=globalThis,Pe=Ne.trustedTypes,Fe=Pe?Pe.emptyScript:``,Ie=Ne.reactiveElementPolyfillSupport,Le=(e,t)=>e,Re={toAttribute(e,t){switch(t){case Boolean:e=e?Fe:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},ze=(e,t)=>!De(e,t),Be={attribute:!0,type:String,converter:Re,reflect:!1,useDefault:!1,hasChanged:ze};Symbol.metadata??=Symbol(`metadata`),Ne.litPropertyMetadata??=new WeakMap;var Ve=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Be){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&Oe(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=ke(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Be}static _$Ei(){if(this.hasOwnProperty(Le(`elementProperties`)))return;let e=Me(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Le(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Le(`properties`))){let e=this.properties,t=[...Ae(e),...je(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(Ee(e))}else e!==void 0&&t.push(Ee(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Te(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?Re:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?Re:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??ze)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};Ve.elementStyles=[],Ve.shadowRootOptions={mode:`open`},Ve[Le(`elementProperties`)]=new Map,Ve[Le(`finalized`)]=new Map,Ie?.({ReactiveElement:Ve}),(Ne.reactiveElementVersions??=[]).push(`2.1.2`);var He={attribute:!0,type:String,converter:Re,reflect:!1,hasChanged:ze},Ue=(e=He,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function W(e){return(t,n)=>typeof n==`object`?Ue(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function G(e){return W({...e,state:!0,attribute:!1})}var We=globalThis,Ge=class extends Ve{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ve(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return M}};Ge._$litElement$=!0,Ge.finalized=!0,We.litElementHydrateSupport?.({LitElement:Ge});var Ke=We.litElementPolyfillSupport;Ke?.({LitElement:Ge}),(We.litElementVersions??=[]).push(`4.2.2`);var qe={example:{hi:`Hei!`},generic:{from:`Fra`,to:`Til`},calendar:{buttonAltText:`Åpne kalender`,deleteDate:`Fjern dato`},dates:{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`],monthsShort:[`Jan`,`Feb`,`Mar`,`Apr`,`Mai`,`Jun`,`Jul`,`Aug`,`Sep`,`Okt`,`Nov`,`Des`],week:`Uke`,prevMonth:`Forrige måned`,nextMonth:`Neste måned`},timepicker:{hours:`Timer`,minutes:`Minutter`,openPicker:`Åpne tidspunkt-velger`,prevTime:`Forrige tidspunkt`,nextTime:`Neste tidspunkt`,selectTime:`Velg tidspunkt`},forms:{search:{placeholder:`Søk…`},labels:{optional:`Valgfritt`,required:`Må fylles ut`},messages:{required:`Dette feltet er påkrevd`,invalid:`Ugyldig verdi`,invalidPattern:`Ugyldig format`,tooShort:`For kort`,tooLong:`For lang`,rangeUnderflow:`For lav verdi`,rangeOverflow:`For høy verdi`,stepMismatch:`Må treffe på steget som er definert i elementet`,timeStepMismatch:`Må treffe på et steg, for eksempel 0, {step} minutter`,timeStepMismatchHour:`Må treffe på hver hele time`,timeStepMismatchHalfHour:`Må treffe på hver hele eller halve time`,rangeUnderflowMin:`Verdien må være større enn eller lik {min}.`,rangeOverflowMax:`Verdien må være mindre enn eller lik {max}.`,dateUnderflow:`For tidlig dato`,dateOverflow:`For sen dato`},helptext:{helptextDropdownButton:`Les mer`},date:{multiple:`Her kan du velge flere datoer. Trykk komma eller enter når du har skrevet inn en dato.`}}};function K(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var Je=class extends Ge{constructor(...e){super(...e),this.strings=qe,this.role=null}hotReplacedCallback(){this.requestUpdate()}};K([W({type:Object})],Je.prototype,`strings`,void 0),K([W({type:String})],Je.prototype,`role`,void 0);var Ye=class extends Je{createRenderRoot(){return this}},Xe={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Ze=e=>(...t)=>({_$litDirective$:e,values:t}),Qe=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}},q=Ze(class extends Qe{constructor(e){if(super(e),e.type!==Xe.ATTRIBUTE||e.name!==`class`||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return` `+Object.keys(e).filter(t=>e[t]).join(` `)+` `}update(e,[t]){if(this.st===void 0){this.st=new Set,e.strings!==void 0&&(this.nt=new Set(e.strings.join(` `).split(/\s/).filter(e=>e!==``)));for(let e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}let n=e.element.classList;for(let e of this.st)e in t||(n.remove(e),this.st.delete(e));for(let e in t){let r=!!t[e];r===this.st.has(e)||this.nt?.has(e)||(r?(n.add(e),this.st.add(e)):(n.remove(e),this.st.delete(e)))}return M}}),{I:$e}=H,et=e=>e,tt=e=>e.strings===void 0,nt=()=>document.createComment(``),rt=(e,t,n)=>{let r=e._$AA.parentNode,i=t===void 0?e._$AB:t._$AA;if(n===void 0)n=new $e(r.insertBefore(nt(),i),r.insertBefore(nt(),i),e,e.options);else{let t=n._$AB.nextSibling,a=n._$AM,o=a!==e;if(o){let t;n._$AQ?.(e),n._$AM=e,n._$AP!==void 0&&(t=e._$AU)!==a._$AU&&n._$AP(t)}if(t!==i||o){let e=n._$AA;for(;e!==t;){let t=et(e).nextSibling;et(r).insertBefore(e,i),e=t}}}return n},it=(e,t,n=e)=>(e._$AI(t,n),e),at={},ot=(e,t=at)=>e._$AH=t,st=e=>e._$AH,ct=e=>{e._$AR(),e._$AA.remove()},lt=(e,t)=>{let n=e._$AN;if(n===void 0)return!1;for(let e of n)e._$AO?.(t,!1),lt(e,t);return!0},ut=e=>{let t,n;do{if((t=e._$AM)===void 0)break;n=t._$AN,n.delete(e),e=t}while(n?.size===0)},dt=e=>{for(let t;t=e._$AM;e=t){let n=t._$AN;if(n===void 0)t._$AN=n=new Set;else if(n.has(e))break;n.add(e),mt(t)}};function ft(e){this._$AN===void 0?this._$AM=e:(ut(this),this._$AM=e,dt(this))}function pt(e,t=!1,n=0){let r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(t)if(Array.isArray(r))for(let e=n;e<r.length;e++)lt(r[e],!1),ut(r[e]);else r!=null&&(lt(r,!1),ut(r));else lt(this,e)}var mt=e=>{e.type==Xe.CHILD&&(e._$AP??=pt,e._$AQ??=ft)},ht=class extends Qe{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),dt(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(lt(this,e),ut(this))}setValue(e){if(tt(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};function gt(e){return e.classList&&(e.classList.contains(`_dialog_overlay`)||e.classList.contains(`backdrop`))?!0:typeof e.hasAttribute==`function`&&e.hasAttribute(`data-skip`)}function _t(e){return e.nodeName===`OPTION`||e.nodeName===`DATA`}function vt(e){return e.nodeType===Node.TEXT_NODE&&e.nodeValue?.trim()!==``}var yt=new WeakMap;function bt(e){let t=yt.get(e);return t||(t=new Tt(e),yt.set(e,t)),t}var xt=Symbol(`default`);function St(e){return e===void 0?xt:e}function Ct(e,t){if(e.nodeType===Node.COMMENT_NODE)return!1;if(e.nodeType===Node.TEXT_NODE)return vt(e)?(wt(t,xt,e),!0):!1;if(e.nodeType===Node.ELEMENT_NODE){let n=e;if(gt(n)||_t(n))return!1;if(n instanceof HTMLTemplateElement){let e=Array.from(n.content.childNodes),r=St(n.getAttribute(`slot`)??void 0);for(let n of e)wt(t,r,n);return!0}let r=n.getAttribute(`slot`);return wt(t,r===null?xt:St(r),e),!0}return!1}function wt(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}var Tt=class e{static{this.PLACEHOLDER_PREFIX=`pkt-slot`}constructor(e){this.observer=null,this.nodesBySlot=new Map,this.directives=new Set,this.observing=!1,this.trackedNodes=new Set,this.generation=0,this.initialCollectionDone=!1,this.processingMutations=!1,this.placeholderToNode=new Map,this.nodeToPlaceholder=new Map,this.host=e}collectNodes(){if(this.initialCollectionDone)return;this.initialCollectionDone=!0,this.generation++;let e=Array.from(this.host.childNodes);for(let t of e)Ct(t,this.nodesBySlot)&&this.trackedNodes.add(t)}addDirective(e){this.directives.add(e),this.startObserving()}removeDirective(e){this.directives.delete(e),this.directives.size===0&&this.stopObserving()}getNodes(e){return this.nodesBySlot.get(St(e))??[]}hasContent(e){return this.getNodes(e).length>0}ensurePlaceholder(t){if(this.nodeToPlaceholder.has(t)||t.parentNode!==this.host)return;let n=document.createComment(e.PLACEHOLDER_PREFIX);this.host.insertBefore(n,t),this.placeholderToNode.set(n,t),this.nodeToPlaceholder.set(t,n)}startObserving(){this.observing||(this.observing=!0,setTimeout(()=>{this.observing&&(this.observer=new MutationObserver(e=>{this.handleMutations(e)}),this.observer.observe(this.host,{childList:!0}))},0))}stopObserving(){this.observing&&(this.observing=!1,this.observer?.disconnect(),this.observer=null)}handleMutations(e){if(this.processingMutations)return;this.processingMutations=!0;let t=!1;for(let n of e)if(n.target===this.host){for(let e of n.removedNodes){let n=this.placeholderToNode.get(e);if(n){n.parentNode?.removeChild(n),this.trackedNodes.delete(n),this.removeFromSlots(n),this.placeholderToNode.delete(e),this.nodeToPlaceholder.delete(n),t=!0;continue}if(this.trackedNodes.has(e)){this.trackedNodes.delete(e),this.removeFromSlots(e);let n=this.nodeToPlaceholder.get(e);n&&(n.parentNode?.removeChild(n),this.placeholderToNode.delete(n),this.nodeToPlaceholder.delete(e)),t=!0}}for(let e of n.addedNodes)this.placeholderToNode.has(e)||!this.trackedNodes.has(e)&&this.isUserContent(e)&&Ct(e,this.nodesBySlot)&&(this.trackedNodes.add(e),t=!0)}t&&(this.generation++,this.notifyDirectives()),this.observer?.takeRecords(),this.processingMutations=!1}isUserContent(e){if(e.nodeType===Node.COMMENT_NODE)return!1;if(e.nodeType===Node.TEXT_NODE)return vt(e);if(e.nodeType===Node.ELEMENT_NODE){let t=e;return!(gt(t)||_t(t))}return!1}removeFromSlots(e){for(let[t,n]of this.nodesBySlot){let r=n.indexOf(e);if(r!==-1){n.splice(r,1),n.length===0&&this.nodesBySlot.delete(t);return}}}notifyDirectives(){for(let e of this.directives)e.handleNodesChanged()}},Et=Ze(class extends ht{constructor(e){if(super(e),this.manager=null,this.lastGeneration=-1,e.type!==Xe.CHILD)throw Error(`slotContent() can only be used in child expressions`)}render(e,t){return M}update(e,[t,n]){return this.slotName=n,this.manager||(this.manager=bt(t),this.manager.collectNodes(),this.manager.addDirective(this)),this.ensurePlaceholders(),this.getNodesOrNoChange()}handleNodesChanged(){if(!this.isConnected||!this.manager)return;this.ensurePlaceholders();let e=this.getNodesOrNoChange();e!==M&&this.setValue(e)}ensurePlaceholders(){if(!this.manager)return;let e=this.manager.getNodes(this.slotName);for(let t of e)this.manager.ensurePlaceholder(t)}disconnected(){this.manager?.removeDirective(this),this.manager=null,this.lastGeneration=-1}reconnected(){}getNodesOrNoChange(){if(!this.manager)return M;let e=this.manager.generation;return e===this.lastGeneration?M:(this.lastGeneration=e,this.manager.getNodes(this.slotName))}}),Dt=class extends Ye{connectedCallback(){bt(this).collectNodes(),super.connectedCallback()}hasSlotContent(e){return bt(this).hasContent(e)}};function Ot(e,t,n){let r=e.getAttribute(`class`)||``,i=new Set(r.split(/\s+/).filter(Boolean));n?i.add(t):i.delete(t),e.setAttribute(`class`,Array.from(i).join(` `))}var kt=class extends Qe{constructor(e){if(super(e),this.it=N,e.type!==Xe.CHILD)throw Error(this.constructor.directiveName+`() can only be used in child bindings`)}render(e){if(e===N||e==null)return this._t=void 0,this.it=e;if(e===M)return e;if(typeof e!=`string`)throw Error(this.constructor.directiveName+`() called with a non-string value`);if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};kt.directiveName=`unsafeHTML`,kt.resultType=1;var At=Ze(kt),jt=class extends kt{};jt.directiveName=`unsafeSVG`,jt.resultType=2;var Mt=Ze(jt),Nt=`https://punkt-cdn.oslo.kommune.no/16.10/icons/`;typeof window<`u`&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||Nt);var Pt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>`,Ft={},It=2,Lt=1500,Rt=typeof Storage<`u`&&typeof sessionStorage<`u`,zt=e=>window.pktFetch(e).then(t=>{if(!t.ok)throw Error(`Missing icon: `+e);return t.text()}),Bt=async(e,t=It)=>{try{return await zt(e)}catch{return t>0?(await new Promise(e=>setTimeout(e,Lt)),Bt(e,t-1)):(console.error(`Failed to fetch icon: `+e),Pt)}},Vt=async(e,t)=>{let n=t+e+`.svg`;return Rt&&sessionStorage.getItem(n)?sessionStorage.getItem(n):n in Ft?Ft[n]:typeof window<`u`&&typeof window.pktFetch==`function`?(Ft[n]=Bt(n).then(e=>(e!==Pt&&Rt&&sessionStorage.setItem(n,e),delete Ft[n],e)),Ft[n]):Pt},Ht=class extends Ye{constructor(...e){super(...e),this.path=typeof window<`u`?window.pktIconPath:Nt,this.name=``,this.icon=Mt(Pt),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add(`pkt-icon`)}async attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),(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||=typeof window<`u`?window.pktIconPath:Nt;try{this.icon=Mt(await Vt(this.name||``,this.path))}catch{this.icon=Mt(Pt)}this._updatedProps=[]}else this._updatedProps.includes(e)||this._updatedProps.push(e)}render(){return j`${this.name&&this.icon}`}};K([W({type:String,reflect:!1})],Ht.prototype,`path`,void 0),K([W({type:String,reflect:!0})],Ht.prototype,`name`,void 0),K([W({type:SVGElement})],Ht.prototype,`icon`,void 0),K([W({type:Array,noAccessor:!0})],Ht.prototype,`_updatedProps`,void 0);try{U(`pkt-icon`)(Ht)}catch{console.warn(`Forsøker å definere <pkt-icon>, men den er allerede definert`)}var J=e=>e??N;window.pktAnimationPath=window.pktAnimationPath||`https://punkt-cdn.oslo.kommune.no/16.10/animations/`;var Ut=class extends Dt{constructor(...e){super(...e),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}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,n){super.attributeChangedCallback(e,t,n),e===`disabled`&&n===`false`&&(this.disabled=!1),(e===`isloading`||e===`isLoading`)&&n===`false`&&(this.isLoading=!1)}firstUpdated(e){super.firstUpdated(e),this.disabled===`false`&&(this.disabled=!1),this.isLoading===`false`&&(this.isLoading=!1)}render(){let e=this.form??this.getAttribute(`form`)??void 0;return j`
37
+ \f\r]`,ce=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,O=/-->/g,le=/>/g,k=RegExp(`>|${se}(?:([^\\s"'>=/]+)(${se}*=${se}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),A=/'/g,ue=/"/g,de=/^(?:script|style|textarea|title)$/i,j=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),M=Symbol.for(`lit-noChange`),N=Symbol.for(`lit-nothing`),P=new WeakMap,F=re.createTreeWalker(re,129);function I(e,t){if(!ae(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return ee===void 0?t:ee.createHTML(t)}var fe=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=ce;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===ce?c[1]===`!--`?o=O:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=k):(de.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=k):o=le:o===k?c[0]===`>`?(o=i??ce,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?k:c[3]===`"`?ue:A):o===ue||o===A?o=k:o===O||o===le?o=ce:(o=k,i=void 0);let d=o===k&&e[t+1].startsWith(`/>`)?` `:``;a+=o===ce?n+ne:l>=0?(r.push(s),n.slice(0,l)+T+n.slice(l)+E+d):n+E+(l===-2?t:d)}return[I(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},pe=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=fe(t,n);if(this.el=e.createElement(l,r),F.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=F.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(T)){let t=u[o++],n=i.getAttribute(e).split(E),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?R:r[1]===`?`?z:r[1]===`@`?B:ge}),i.removeAttribute(e)}else e.startsWith(E)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(de.test(i.tagName)){let e=i.textContent.split(E),t=e.length-1;if(t>0){i.textContent=w?w.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],D()),F.nextNode(),c.push({type:2,index:++a});i.append(e[t],D())}}}else if(i.nodeType===8)if(i.data===te)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(E,e+1))!==-1;)c.push({type:7,index:a}),e+=E.length-1}a++}}static createElement(e,t){let n=re.createElement(`template`);return n.innerHTML=e,n}};function me(e,t,n=e,r){if(t===M)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=ie(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=me(e,i._$AS(e,t.values),i,r)),t}var L=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){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??re).importNode(t,!0);F.currentNode=r;let i=F.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new he(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new _e(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=F.nextNode(),a++)}return F.currentNode=re,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},he=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=N,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=me(this,e,t),ie(e)?e===N||e==null||e===``?(this._$AH!==N&&this._$AR(),this._$AH=N):e!==this._$AH&&e!==M&&this._(e):e._$litType$===void 0?e.nodeType===void 0?oe(e)?this.k(e):this._(e):this.T(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!==N&&ie(this._$AH)?this._$AA.nextSibling.data=e:this.T(re.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=pe.createElement(I(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new L(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=P.get(e.strings);return t===void 0&&P.set(e.strings,t=new pe(e)),t}k(t){ae(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(D()),this.O(D()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=C(e).nextSibling;C(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},ge=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=N,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=N}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=me(this,e,t,0),a=!ie(e)||e!==this._$AH&&e!==M,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=me(this,r[n+o],t,o),s===M&&(s=this._$AH[o]),a||=!ie(s)||s!==this._$AH[o],s===N?e=N:e!==N&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===N?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},R=class extends ge{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===N?void 0:e}},z=class extends ge{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==N)}},B=class extends ge{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=me(this,e,t,0)??N)===M)return;let n=this._$AH,r=e===N&&n!==N||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==N&&(n===N||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},_e=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){me(this,e)}},V={M:T,P:E,A:te,C:1,L:fe,R:L,D:oe,V:me,I:he,H:ge,N:z,U:B,B:R,F:_e},ve=S.litHtmlPolyfillSupport;ve?.(pe,he),(S.litHtmlVersions??=[]).push(`3.3.2`);var ye=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new he(t.insertBefore(D(),e),e,void 0,n??{})}return i._$AI(e),i},H=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer(()=>{customElements.define(e,t)})},be=globalThis,xe=be.ShadowRoot&&(be.ShadyCSS===void 0||be.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,Se=Symbol(),Ce=new WeakMap,we=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Se)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(xe&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=Ce.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Ce.set(t,e))}return e}toString(){return this.cssText}},Te=e=>new we(typeof e==`string`?e:e+``,void 0,Se),Ee=(e,t)=>{if(xe)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let n of t){let t=document.createElement(`style`),r=be.litNonce;r!==void 0&&t.setAttribute(`nonce`,r),t.textContent=n.cssText,e.appendChild(t)}},De=xe?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return Te(t)})(e):e,{is:Oe,defineProperty:ke,getOwnPropertyDescriptor:Ae,getOwnPropertyNames:je,getOwnPropertySymbols:Me,getPrototypeOf:Ne}=Object,Pe=globalThis,Fe=Pe.trustedTypes,Ie=Fe?Fe.emptyScript:``,Le=Pe.reactiveElementPolyfillSupport,Re=(e,t)=>e,ze={toAttribute(e,t){switch(t){case Boolean:e=e?Ie:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},Be=(e,t)=>!Oe(e,t),Ve={attribute:!0,type:String,converter:ze,reflect:!1,useDefault:!1,hasChanged:Be};Symbol.metadata??=Symbol(`metadata`),Pe.litPropertyMetadata??=new WeakMap;var He=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Ve){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&ke(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=Ae(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Ve}static _$Ei(){if(this.hasOwnProperty(Re(`elementProperties`)))return;let e=Ne(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Re(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Re(`properties`))){let e=this.properties,t=[...je(e),...Me(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(De(e))}else e!==void 0&&t.push(De(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ee(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?ze:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?ze:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??Be)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};He.elementStyles=[],He.shadowRootOptions={mode:`open`},He[Re(`elementProperties`)]=new Map,He[Re(`finalized`)]=new Map,Le?.({ReactiveElement:He}),(Pe.reactiveElementVersions??=[]).push(`2.1.2`);var Ue={attribute:!0,type:String,converter:ze,reflect:!1,hasChanged:Be},We=(e=Ue,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function U(e){return(t,n)=>typeof n==`object`?We(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function W(e){return U({...e,state:!0,attribute:!1})}var Ge=globalThis,Ke=class extends He{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ye(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return M}};Ke._$litElement$=!0,Ke.finalized=!0,Ge.litElementHydrateSupport?.({LitElement:Ke});var qe=Ge.litElementPolyfillSupport;qe?.({LitElement:Ke}),(Ge.litElementVersions??=[]).push(`4.2.2`);var Je={example:{hi:`Hei!`},generic:{from:`Fra`,to:`Til`},calendar:{buttonAltText:`Åpne kalender`,deleteDate:`Fjern dato`},dates:{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`],monthsShort:[`Jan`,`Feb`,`Mar`,`Apr`,`Mai`,`Jun`,`Jul`,`Aug`,`Sep`,`Okt`,`Nov`,`Des`],week:`Uke`,prevMonth:`Forrige måned`,nextMonth:`Neste måned`},timepicker:{hours:`Timer`,minutes:`Minutter`,openPicker:`Åpne tidspunkt-velger`,prevTime:`Forrige tidspunkt`,nextTime:`Neste tidspunkt`,selectTime:`Velg tidspunkt`},forms:{search:{placeholder:`Søk…`},labels:{optional:`Valgfritt`,required:`Må fylles ut`},messages:{required:`Dette feltet er påkrevd`,invalid:`Ugyldig verdi`,invalidPattern:`Ugyldig format`,tooShort:`For kort`,tooLong:`For lang`,rangeUnderflow:`For lav verdi`,rangeOverflow:`For høy verdi`,stepMismatch:`Må treffe på steget som er definert i elementet`,timeStepMismatch:`Må treffe på et steg, for eksempel 0, {step} minutter`,timeStepMismatchHour:`Må treffe på hver hele time`,timeStepMismatchHalfHour:`Må treffe på hver hele eller halve time`,rangeUnderflowMin:`Verdien må være større enn eller lik {min}.`,rangeOverflowMax:`Verdien må være mindre enn eller lik {max}.`,dateUnderflow:`For tidlig dato`,dateOverflow:`For sen dato`},helptext:{helptextDropdownButton:`Les mer`},date:{multiple:`Her kan du velge flere datoer. Trykk komma eller enter når du har skrevet inn en dato.`}}};function G(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var Ye=class extends Ke{constructor(...e){super(...e),this.strings=Je,this.role=null}hotReplacedCallback(){this.requestUpdate()}};G([U({type:Object})],Ye.prototype,`strings`,void 0),G([U({type:String})],Ye.prototype,`role`,void 0);var Xe=class extends Ye{createRenderRoot(){return this}},Ze={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Qe=e=>(...t)=>({_$litDirective$:e,values:t}),$e=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}},K=Qe(class extends $e{constructor(e){if(super(e),e.type!==Ze.ATTRIBUTE||e.name!==`class`||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return` `+Object.keys(e).filter(t=>e[t]).join(` `)+` `}update(e,[t]){if(this.st===void 0){this.st=new Set,e.strings!==void 0&&(this.nt=new Set(e.strings.join(` `).split(/\s/).filter(e=>e!==``)));for(let e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}let n=e.element.classList;for(let e of this.st)e in t||(n.remove(e),this.st.delete(e));for(let e in t){let r=!!t[e];r===this.st.has(e)||this.nt?.has(e)||(r?(n.add(e),this.st.add(e)):(n.remove(e),this.st.delete(e)))}return M}}),{I:et}=V,tt=e=>e,nt=e=>e.strings===void 0,rt=()=>document.createComment(``),it=(e,t,n)=>{let r=e._$AA.parentNode,i=t===void 0?e._$AB:t._$AA;if(n===void 0)n=new et(r.insertBefore(rt(),i),r.insertBefore(rt(),i),e,e.options);else{let t=n._$AB.nextSibling,a=n._$AM,o=a!==e;if(o){let t;n._$AQ?.(e),n._$AM=e,n._$AP!==void 0&&(t=e._$AU)!==a._$AU&&n._$AP(t)}if(t!==i||o){let e=n._$AA;for(;e!==t;){let t=tt(e).nextSibling;tt(r).insertBefore(e,i),e=t}}}return n},at=(e,t,n=e)=>(e._$AI(t,n),e),ot={},st=(e,t=ot)=>e._$AH=t,ct=e=>e._$AH,lt=e=>{e._$AR(),e._$AA.remove()},ut=(e,t)=>{let n=e._$AN;if(n===void 0)return!1;for(let e of n)e._$AO?.(t,!1),ut(e,t);return!0},dt=e=>{let t,n;do{if((t=e._$AM)===void 0)break;n=t._$AN,n.delete(e),e=t}while(n?.size===0)},ft=e=>{for(let t;t=e._$AM;e=t){let n=t._$AN;if(n===void 0)t._$AN=n=new Set;else if(n.has(e))break;n.add(e),ht(t)}};function pt(e){this._$AN===void 0?this._$AM=e:(dt(this),this._$AM=e,ft(this))}function mt(e,t=!1,n=0){let r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(t)if(Array.isArray(r))for(let e=n;e<r.length;e++)ut(r[e],!1),dt(r[e]);else r!=null&&(ut(r,!1),dt(r));else ut(this,e)}var ht=e=>{e.type==Ze.CHILD&&(e._$AP??=mt,e._$AQ??=pt)},gt=class extends $e{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),ft(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(ut(this,e),dt(this))}setValue(e){if(nt(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};function _t(e){return e.classList&&(e.classList.contains(`_dialog_overlay`)||e.classList.contains(`backdrop`))?!0:typeof e.hasAttribute==`function`&&e.hasAttribute(`data-skip`)}function vt(e){return e.nodeName===`OPTION`||e.nodeName===`DATA`}function yt(e){return e.nodeType===Node.TEXT_NODE&&e.nodeValue?.trim()!==``}var bt=new WeakMap;function xt(e){let t=bt.get(e);return t||(t=new Et(e),bt.set(e,t)),t}var St=Symbol(`default`);function Ct(e){return e===void 0?St:e}function wt(e,t){if(e.nodeType===Node.COMMENT_NODE)return!1;if(e.nodeType===Node.TEXT_NODE)return yt(e)?(Tt(t,St,e),!0):!1;if(e.nodeType===Node.ELEMENT_NODE){let n=e;if(_t(n)||vt(n))return!1;if(n instanceof HTMLTemplateElement){let e=Array.from(n.content.childNodes),r=Ct(n.getAttribute(`slot`)??void 0);for(let n of e)Tt(t,r,n);return!0}let r=n.getAttribute(`slot`);return Tt(t,r===null?St:Ct(r),e),!0}return!1}function Tt(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}var Et=class e{static{this.PLACEHOLDER_PREFIX=`pkt-slot`}constructor(e){this.observer=null,this.nodesBySlot=new Map,this.directives=new Set,this.observing=!1,this.trackedNodes=new Set,this.generation=0,this.initialCollectionDone=!1,this.processingMutations=!1,this.placeholderToNode=new Map,this.nodeToPlaceholder=new Map,this.host=e}collectNodes(){if(this.initialCollectionDone)return;this.initialCollectionDone=!0,this.generation++;let e=Array.from(this.host.childNodes);for(let t of e)wt(t,this.nodesBySlot)&&this.trackedNodes.add(t)}addDirective(e){this.directives.add(e),this.startObserving()}removeDirective(e){this.directives.delete(e),this.directives.size===0&&this.stopObserving()}getNodes(e){return this.nodesBySlot.get(Ct(e))??[]}hasContent(e){return this.getNodes(e).length>0}ensurePlaceholder(t){if(this.nodeToPlaceholder.has(t)||t.parentNode!==this.host)return;let n=document.createComment(e.PLACEHOLDER_PREFIX);this.host.insertBefore(n,t),this.placeholderToNode.set(n,t),this.nodeToPlaceholder.set(t,n)}startObserving(){this.observing||(this.observing=!0,setTimeout(()=>{this.observing&&(this.observer=new MutationObserver(e=>{this.handleMutations(e)}),this.observer.observe(this.host,{childList:!0}))},0))}stopObserving(){this.observing&&(this.observing=!1,this.observer?.disconnect(),this.observer=null)}handleMutations(e){if(this.processingMutations)return;this.processingMutations=!0;let t=!1;for(let n of e)if(n.target===this.host){for(let e of n.removedNodes){let n=this.placeholderToNode.get(e);if(n){n.parentNode?.removeChild(n),this.trackedNodes.delete(n),this.removeFromSlots(n),this.placeholderToNode.delete(e),this.nodeToPlaceholder.delete(n),t=!0;continue}if(this.trackedNodes.has(e)){this.trackedNodes.delete(e),this.removeFromSlots(e);let n=this.nodeToPlaceholder.get(e);n&&(n.parentNode?.removeChild(n),this.placeholderToNode.delete(n),this.nodeToPlaceholder.delete(e)),t=!0}}for(let e of n.addedNodes)this.placeholderToNode.has(e)||!this.trackedNodes.has(e)&&this.isUserContent(e)&&wt(e,this.nodesBySlot)&&(this.trackedNodes.add(e),t=!0)}t&&(this.generation++,this.notifyDirectives()),this.observer?.takeRecords(),this.processingMutations=!1}isUserContent(e){if(e.nodeType===Node.COMMENT_NODE)return!1;if(e.nodeType===Node.TEXT_NODE)return yt(e);if(e.nodeType===Node.ELEMENT_NODE){let t=e;return!(_t(t)||vt(t))}return!1}removeFromSlots(e){for(let[t,n]of this.nodesBySlot){let r=n.indexOf(e);if(r!==-1){n.splice(r,1),n.length===0&&this.nodesBySlot.delete(t);return}}}notifyDirectives(){for(let e of this.directives)e.handleNodesChanged()}},Dt=Qe(class extends gt{constructor(e){if(super(e),this.manager=null,this.lastGeneration=-1,e.type!==Ze.CHILD)throw Error(`slotContent() can only be used in child expressions`)}render(e,t){return M}update(e,[t,n]){return this.slotName=n,this.manager||(this.manager=xt(t),this.manager.collectNodes(),this.manager.addDirective(this)),this.ensurePlaceholders(),this.getNodesOrNoChange()}handleNodesChanged(){if(!this.isConnected||!this.manager)return;this.ensurePlaceholders();let e=this.getNodesOrNoChange();e!==M&&this.setValue(e)}ensurePlaceholders(){if(!this.manager)return;let e=this.manager.getNodes(this.slotName);for(let t of e)this.manager.ensurePlaceholder(t)}disconnected(){this.manager?.removeDirective(this),this.manager=null,this.lastGeneration=-1}reconnected(){}getNodesOrNoChange(){if(!this.manager)return M;let e=this.manager.generation;return e===this.lastGeneration?M:(this.lastGeneration=e,this.manager.getNodes(this.slotName))}}),Ot=class extends Xe{connectedCallback(){xt(this).collectNodes(),super.connectedCallback()}hasSlotContent(e){return xt(this).hasContent(e)}};function kt(e,t,n){let r=e.getAttribute(`class`)||``,i=new Set(r.split(/\s+/).filter(Boolean));n?i.add(t):i.delete(t),e.setAttribute(`class`,Array.from(i).join(` `))}var At=class extends $e{constructor(e){if(super(e),this.it=N,e.type!==Ze.CHILD)throw Error(this.constructor.directiveName+`() can only be used in child bindings`)}render(e){if(e===N||e==null)return this._t=void 0,this.it=e;if(e===M)return e;if(typeof e!=`string`)throw Error(this.constructor.directiveName+`() called with a non-string value`);if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};At.directiveName=`unsafeHTML`,At.resultType=1;var jt=Qe(At),Mt=class extends At{};Mt.directiveName=`unsafeSVG`,Mt.resultType=2;var Nt=Qe(Mt),Pt=`https://punkt-cdn.oslo.kommune.no/16.11/icons/`;typeof window<`u`&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||Pt);var Ft=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>`,It={},Lt=2,Rt=1500,zt=typeof Storage<`u`&&typeof sessionStorage<`u`,Bt=e=>window.pktFetch(e).then(t=>{if(!t.ok)throw Error(`Missing icon: `+e);return t.text()}),Vt=async(e,t=Lt)=>{try{return await Bt(e)}catch{return t>0?(await new Promise(e=>setTimeout(e,Rt)),Vt(e,t-1)):(console.error(`Failed to fetch icon: `+e),Ft)}},Ht=async(e,t)=>{let n=t+e+`.svg`;return zt&&sessionStorage.getItem(n)?sessionStorage.getItem(n):n in It?It[n]:typeof window<`u`&&typeof window.pktFetch==`function`?(It[n]=Vt(n).then(e=>(e!==Ft&&zt&&sessionStorage.setItem(n,e),delete It[n],e)),It[n]):Ft},Ut=class extends Xe{constructor(...e){super(...e),this.path=typeof window<`u`?window.pktIconPath:Pt,this.name=``,this.icon=Nt(Ft),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add(`pkt-icon`)}async attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),(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||=typeof window<`u`?window.pktIconPath:Pt;try{this.icon=Nt(await Ht(this.name||``,this.path))}catch{this.icon=Nt(Ft)}this._updatedProps=[]}else this._updatedProps.includes(e)||this._updatedProps.push(e)}render(){return j`${this.name&&this.icon}`}};G([U({type:String,reflect:!1})],Ut.prototype,`path`,void 0),G([U({type:String,reflect:!0})],Ut.prototype,`name`,void 0),G([U({type:SVGElement})],Ut.prototype,`icon`,void 0),G([U({type:Array,noAccessor:!0})],Ut.prototype,`_updatedProps`,void 0);try{H(`pkt-icon`)(Ut)}catch{console.warn(`Forsøker å definere <pkt-icon>, men den er allerede definert`)}var q=e=>e??N;window.pktAnimationPath=window.pktAnimationPath||`https://punkt-cdn.oslo.kommune.no/16.11/animations/`;var Wt=class extends Ot{constructor(...e){super(...e),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}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,n){super.attributeChangedCallback(e,t,n),e===`disabled`&&n===`false`&&(this.disabled=!1),(e===`isloading`||e===`isLoading`)&&n===`false`&&(this.isLoading=!1)}firstUpdated(e){super.firstUpdated(e),this.disabled===`false`&&(this.disabled=!1),this.isLoading===`false`&&(this.isLoading=!1)}render(){let e=this.form??this.getAttribute(`form`)??void 0;return j`
38
38
  <button
39
- class=${q({"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})}
39
+ class=${K({"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})}
40
40
  type=${this.type}
41
41
  ?disabled=${!!this.disabled}
42
- aria-busy=${J(this.isLoading?`true`:void 0)}
43
- aria-disabled=${J(this.disabled||this.isLoading?`true`:void 0)}
44
- form=${J(e)}
42
+ aria-busy=${q(this.isLoading?`true`:void 0)}
43
+ aria-disabled=${q(this.disabled||this.isLoading?`true`:void 0)}
44
+ form=${q(e)}
45
45
  >
46
46
  ${this.isLoading?j`<pkt-icon
47
47
  class="pkt-btn__icon pkt-btn__spinner"
48
48
  name="spinner-blue"
49
- path=${J(this.loadingAnimationPath)}
49
+ path=${q(this.loadingAnimationPath)}
50
50
  ></pkt-icon>`:N}
51
51
  ${this.variant===`label-only`?N:j`<pkt-icon
52
52
  class="pkt-btn__icon pkt-icon"
53
53
  name=${this.iconName}
54
- path=${J(this.iconPath)}
54
+ path=${q(this.iconPath)}
55
55
  ></pkt-icon>`}
56
- <span class="pkt-btn__text">${Et(this)}</span>
56
+ <span class="pkt-btn__text">${Dt(this)}</span>
57
57
  ${this.variant===`icons-right-and-left`?j`<pkt-icon
58
58
  class="pkt-btn__icon"
59
59
  name=${this.secondIconName}
60
- path=${J(this.secondIconPath)}
60
+ path=${q(this.secondIconPath)}
61
61
  ></pkt-icon>`:N}
62
62
  </button>
63
- `}};K([W({type:String})],Ut.prototype,`iconName`,void 0),K([W({type:String})],Ut.prototype,`secondIconName`,void 0),K([W({type:String})],Ut.prototype,`iconPath`,void 0),K([W({type:String})],Ut.prototype,`secondIconPath`,void 0),K([W({type:String})],Ut.prototype,`mode`,void 0),K([W({type:String})],Ut.prototype,`size`,void 0),K([W({type:Boolean,attribute:`full-width`})],Ut.prototype,`fullWidth`,void 0),K([W({type:Boolean,attribute:`full-width-on-mobile`})],Ut.prototype,`fullWidthOnMobile`,void 0),K([W({type:String})],Ut.prototype,`color`,void 0),K([W({type:String})],Ut.prototype,`skin`,void 0),K([W({type:String})],Ut.prototype,`variant`,void 0),K([W({type:String,reflect:!0})],Ut.prototype,`state`,void 0),K([W({type:String,reflect:!0})],Ut.prototype,`type`,void 0),K([W({type:String})],Ut.prototype,`form`,void 0),K([W({type:Boolean,reflect:!0})],Ut.prototype,`isLoading`,void 0),K([W({type:Boolean,reflect:!0})],Ut.prototype,`disabled`,void 0),K([W({type:String})],Ut.prototype,`loadingAnimationPath`,void 0);try{U(`pkt-button`)(Ut)}catch{console.warn(`Forsøker å definere <pkt-button>, men den er allerede definert`)}var Wt={name:`pkt-alert`,react:`PktAlert`,"css-class":`pkt-alert`,"dark-mode":!0,isElement:!0,isPureReact:!0,events:{onClose:{description:`React: Klikk-event for 'Lukk'-knappen`},close:{description:`Vue: Klikk-event for 'Lukk'-knappen`}},props:{title:{name:`Tittel`,description:`Tittelen som vises øverst i på meldingen`,type:`string`,category:`contents`},skin:{name:`Utseende`,description:`Hvordan type melding er dette?`,type:[`info`,`success`,`warning`,`error`],default:`info`,category:`ui`},date:{name:`Sist oppdatert`,description:`Dato som vises nederst i på meldingen`,type:`string`,category:`contents`},ariaLive:{name:`aria-live`,description:`Hvordan skal skjermleseren lese opp meldingen?`,type:[`off`,`polite`,`assertive`],default:`polite`,category:`accessibility`},compact:{name:`Kompakt`,description:`Gjør meldingen mindre`,type:`boolean`,category:`ui`,default:!1},closeAlert:{name:`Vis 'Lukk'-knapp`,description:`Viser 'Lukk'-knappen`,type:`boolean`,default:!1,category:`ui`}},slots:{default:{description:`Innholdet i meldingen`}}},Gt=class extends Dt{constructor(){super(),this.compact=Wt.props.compact.default,this.title=``,this.skin=Wt.props.skin.default,this.ariaLive=Wt.props.ariaLive.default,this.ariaLiveAttr=null,this.closeAlert=Wt.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._isClosed=!1}connectedCallback(){super.connectedCallback(),this.ariaLiveAttr=this.getAttribute(`aria-live`)||this.ariaLive}attributeChangedCallback(e,t,n){e===`ariaLive`&&(this.ariaLiveAttr=n),super.attributeChangedCallback(e,t,n)}updated(e){super.updated(e),e.has(`ariaLive`)&&(this.ariaLiveAttr=this.ariaLive),e.has(`_isClosed`)&&Ot(this,`pkt-hide`,this._isClosed)}render(){let 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 j`
64
- <div class=${q(e)} aria-live=${this.ariaLiveAttr}>
65
- <div class=${q(t)}>
63
+ `}};G([U({type:String})],Wt.prototype,`iconName`,void 0),G([U({type:String})],Wt.prototype,`secondIconName`,void 0),G([U({type:String})],Wt.prototype,`iconPath`,void 0),G([U({type:String})],Wt.prototype,`secondIconPath`,void 0),G([U({type:String})],Wt.prototype,`mode`,void 0),G([U({type:String})],Wt.prototype,`size`,void 0),G([U({type:Boolean,attribute:`full-width`})],Wt.prototype,`fullWidth`,void 0),G([U({type:Boolean,attribute:`full-width-on-mobile`})],Wt.prototype,`fullWidthOnMobile`,void 0),G([U({type:String})],Wt.prototype,`color`,void 0),G([U({type:String})],Wt.prototype,`skin`,void 0),G([U({type:String})],Wt.prototype,`variant`,void 0),G([U({type:String,reflect:!0})],Wt.prototype,`state`,void 0),G([U({type:String,reflect:!0})],Wt.prototype,`type`,void 0),G([U({type:String})],Wt.prototype,`form`,void 0),G([U({type:Boolean,reflect:!0})],Wt.prototype,`isLoading`,void 0),G([U({type:Boolean,reflect:!0})],Wt.prototype,`disabled`,void 0),G([U({type:String})],Wt.prototype,`loadingAnimationPath`,void 0);try{H(`pkt-button`)(Wt)}catch{console.warn(`Forsøker å definere <pkt-button>, men den er allerede definert`)}var Gt={name:`pkt-alert`,react:`PktAlert`,"css-class":`pkt-alert`,"dark-mode":!0,isElement:!0,isPureReact:!0,events:{onClose:{description:`React: Klikk-event for 'Lukk'-knappen`},close:{description:`Vue: Klikk-event for 'Lukk'-knappen`}},props:{title:{name:`Tittel`,description:`Tittelen som vises øverst i på meldingen`,type:`string`,category:`contents`},skin:{name:`Utseende`,description:`Hvordan type melding er dette?`,type:[`info`,`success`,`warning`,`error`],default:`info`,category:`ui`},date:{name:`Sist oppdatert`,description:`Dato som vises nederst i på meldingen`,type:`string`,category:`contents`},ariaLive:{name:`aria-live`,description:`Hvordan skal skjermleseren lese opp meldingen?`,type:[`off`,`polite`,`assertive`],default:`polite`,category:`accessibility`},compact:{name:`Kompakt`,description:`Gjør meldingen mindre`,type:`boolean`,category:`ui`,default:!1},closeAlert:{name:`Vis 'Lukk'-knapp`,description:`Viser 'Lukk'-knappen`,type:`boolean`,default:!1,category:`ui`}},slots:{default:{description:`Innholdet i meldingen`}}},Kt=class extends Ot{constructor(){super(),this.compact=Gt.props.compact.default,this.title=``,this.skin=Gt.props.skin.default,this.ariaLive=Gt.props.ariaLive.default,this.ariaLiveAttr=null,this.closeAlert=Gt.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._isClosed=!1}connectedCallback(){super.connectedCallback(),this.ariaLiveAttr=this.getAttribute(`aria-live`)||this.ariaLive}attributeChangedCallback(e,t,n){e===`ariaLive`&&(this.ariaLiveAttr=n),super.attributeChangedCallback(e,t,n)}updated(e){super.updated(e),e.has(`ariaLive`)&&(this.ariaLiveAttr=this.ariaLive),e.has(`_isClosed`)&&kt(this,`pkt-hide`,this._isClosed)}render(){let 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 j`
64
+ <div class=${K(e)} aria-live=${this.ariaLiveAttr}>
65
+ <div class=${K(t)}>
66
66
  <pkt-icon
67
67
  class="pkt-alert__icon"
68
68
  aria-hidden="true"
@@ -87,27 +87,27 @@
87
87
  `:N}
88
88
  ${this.title?j`<div class="pkt-alert__title">${this.title}</div>`:N}
89
89
 
90
- <div class="pkt-alert__text">${Et(this)}</div>
90
+ <div class="pkt-alert__text">${Dt(this)}</div>
91
91
 
92
92
  ${this.date?j`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>`:N}
93
93
  </div>
94
94
  </div>
95
- `}};K([W({type:Boolean,reflect:!1})],Gt.prototype,`compact`,void 0),K([W({type:String,reflect:!0})],Gt.prototype,`title`,void 0),K([W({type:String,reflect:!0})],Gt.prototype,`skin`,void 0),K([W({type:String})],Gt.prototype,`ariaLive`,void 0),K([W({type:String,reflect:!0,attribute:`aria-live`})],Gt.prototype,`ariaLiveAttr`,void 0),K([W({type:Boolean,reflect:!0})],Gt.prototype,`closeAlert`,void 0),K([W({type:String,reflect:!0})],Gt.prototype,`date`,void 0),K([W({type:String,reflect:!0})],Gt.prototype,`role`,void 0),K([G()],Gt.prototype,`_isClosed`,void 0);try{U(`pkt-alert`)(Gt)}catch{console.warn(`Forsøker å definere <pkt-alert>, men den er allerede definert`)}var Y=()=>new Kt,Kt=class{},qt=new WeakMap,X=Ze(class extends ht{render(e){return N}update(e,[t]){let n=t!==this.G;return n&&this.G!==void 0&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.G=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),N}rt(e){if(this.isConnected||(e=void 0),typeof this.G==`function`){let t=this.ht??globalThis,n=qt.get(t);n===void 0&&(n=new WeakMap,qt.set(t,n)),n.get(this.G)!==void 0&&this.G.call(this.ht,void 0),n.set(this.G,e),e!==void 0&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return typeof this.G==`function`?qt.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),Jt=class extends Ge{constructor(...e){super(...e),this.ariaLabelledBy=``,this.compact=!1,this.skin=`borderless`,this.name=``}updated(e){e.has(`skin`)&&this.requestUpdate(),e.has(`name`)&&this.updateAccordionItemNames()}updateAccordionItemNames(){if(this.name){let e=this.renderRoot?.querySelector(`slot`);e&&e.assignedElements().forEach(e=>{e.tagName.toLowerCase()===`pkt-accordion-item`&&(e.hasAttribute(`name`)||e.setAttribute(`name`,this.name))})}}firstUpdated(){let e=this.renderRoot?.querySelector(`slot`);e&&e.addEventListener(`slotchange`,()=>{this.updateAccordionItemNames()})}render(){return j`
95
+ `}};G([U({type:Boolean,reflect:!1})],Kt.prototype,`compact`,void 0),G([U({type:String,reflect:!0})],Kt.prototype,`title`,void 0),G([U({type:String,reflect:!0})],Kt.prototype,`skin`,void 0),G([U({type:String})],Kt.prototype,`ariaLive`,void 0),G([U({type:String,reflect:!0,attribute:`aria-live`})],Kt.prototype,`ariaLiveAttr`,void 0),G([U({type:Boolean,reflect:!0})],Kt.prototype,`closeAlert`,void 0),G([U({type:String,reflect:!0})],Kt.prototype,`date`,void 0),G([U({type:String,reflect:!0})],Kt.prototype,`role`,void 0),G([W()],Kt.prototype,`_isClosed`,void 0);try{H(`pkt-alert`)(Kt)}catch{console.warn(`Forsøker å definere <pkt-alert>, men den er allerede definert`)}var J=()=>new qt,qt=class{},Jt=new WeakMap,Y=Qe(class extends gt{render(e){return N}update(e,[t]){let n=t!==this.G;return n&&this.G!==void 0&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.G=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),N}rt(e){if(this.isConnected||(e=void 0),typeof this.G==`function`){let t=this.ht??globalThis,n=Jt.get(t);n===void 0&&(n=new WeakMap,Jt.set(t,n)),n.get(this.G)!==void 0&&this.G.call(this.ht,void 0),n.set(this.G,e),e!==void 0&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return typeof this.G==`function`?Jt.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),Yt=class extends Ke{constructor(...e){super(...e),this.ariaLabelledBy=``,this.compact=!1,this.skin=`borderless`,this.name=``}updated(e){e.has(`skin`)&&this.requestUpdate(),e.has(`name`)&&this.updateAccordionItemNames()}updateAccordionItemNames(){if(this.name){let e=this.renderRoot?.querySelector(`slot`);e&&e.assignedElements().forEach(e=>{e.tagName.toLowerCase()===`pkt-accordion-item`&&(e.hasAttribute(`name`)||e.setAttribute(`name`,this.name))})}}firstUpdated(){let e=this.renderRoot?.querySelector(`slot`);e&&e.addEventListener(`slotchange`,()=>{this.updateAccordionItemNames()})}render(){return j`
96
96
  <div
97
97
  part="container"
98
- class=${q({"pkt-accordion":!0,"pkt-accordion--compact":this.compact,[`pkt-accordion--${this.skin}`]:this.skin})}
98
+ class=${K({"pkt-accordion":!0,"pkt-accordion--compact":this.compact,[`pkt-accordion--${this.skin}`]:this.skin})}
99
99
  data-testid="pkt-accordion"
100
100
  aria-labelledby=${this.ariaLabelledBy}
101
101
  >
102
102
  <slot></slot>
103
103
  </div>
104
- `}};K([W({type:String,reflect:!0,attribute:`aria-labelledby`})],Jt.prototype,`ariaLabelledBy`,void 0),K([W({type:Boolean,reflect:!0,attribute:`compact`})],Jt.prototype,`compact`,void 0),K([W({type:String,reflect:!0,attribute:`skin`})],Jt.prototype,`skin`,void 0),K([W({type:String,reflect:!0,attribute:`name`})],Jt.prototype,`name`,void 0);try{U(`pkt-accordion`)(Jt)}catch{console.warn(`Forsøker å definere <pkt-accordion>, men den er allerede definert`)}var Yt=class extends Dt{constructor(){super(),this.defaultOpen=!1,this.title=``,this.skin=void 0,this.compact=!1,this.isOpen=!1,this.name=void 0,this.accordionItemRef=Y()}firstUpdated(e){this.defaultOpen&&(this.isOpen=!0)}render(){return j`
104
+ `}};G([U({type:String,reflect:!0,attribute:`aria-labelledby`})],Yt.prototype,`ariaLabelledBy`,void 0),G([U({type:Boolean,reflect:!0,attribute:`compact`})],Yt.prototype,`compact`,void 0),G([U({type:String,reflect:!0,attribute:`skin`})],Yt.prototype,`skin`,void 0),G([U({type:String,reflect:!0,attribute:`name`})],Yt.prototype,`name`,void 0);try{H(`pkt-accordion`)(Yt)}catch{console.warn(`Forsøker å definere <pkt-accordion>, men den er allerede definert`)}var Xt=class extends Ot{constructor(){super(),this.defaultOpen=!1,this.title=``,this.skin=void 0,this.compact=!1,this.isOpen=!1,this.name=void 0,this.accordionItemRef=J()}firstUpdated(e){this.defaultOpen&&(this.isOpen=!0)}render(){return j`
105
105
  <details
106
- class=${q({"pkt-accordion-item":!0,"pkt-accordion-item--compact":this.compact,[`pkt-accordion-item--${this.skin}`]:!!this.skin})}
106
+ class=${K({"pkt-accordion-item":!0,"pkt-accordion-item--compact":this.compact,[`pkt-accordion-item--${this.skin}`]:!!this.skin})}
107
107
  id=${this.id}
108
108
  ?open=${this.isOpen}
109
- ${X(this.accordionItemRef)}
110
- name=${J(this.name)}
109
+ ${Y(this.accordionItemRef)}
110
+ name=${q(this.name)}
111
111
  >
112
112
  <summary class="pkt-accordion-item__title" id=${`pkt-accordion-item-summary-${this.id}`}>
113
113
  ${this.title}
@@ -122,14 +122,14 @@
122
122
  id="pkt-accordion-item__content-${this.id}"
123
123
  role="region"
124
124
  >
125
- <div class="pkt-accordion-item__content-inner">${Et(this)}</div>
125
+ <div class="pkt-accordion-item__content-inner">${Dt(this)}</div>
126
126
  </div>
127
127
  </details>
128
- `}};K([W({type:Boolean})],Yt.prototype,`defaultOpen`,void 0),K([W({type:String})],Yt.prototype,`title`,void 0),K([W({type:String,reflect:!0})],Yt.prototype,`skin`,void 0),K([W({type:Boolean,reflect:!0})],Yt.prototype,`compact`,void 0),K([W({type:Boolean,reflect:!0})],Yt.prototype,`isOpen`,void 0),K([W({type:String,reflect:!0})],Yt.prototype,`name`,void 0);try{U(`pkt-accordion-item`)(Yt)}catch{console.warn(`Forsøker å definere <pkt-accordion-item>, men den er allerede definert`)}var Xt=class extends Ye{constructor(...e){super(...e),this.href=``,this.text=`Forsiden`,this.ariaLabel=``}attributeChangedCallback(e,t,n){e===`arialabel`&&this.removeAttribute(`arialabel`),e===`href`&&this.removeAttribute(`href`),e===`text`&&this.removeAttribute(`text`),super.attributeChangedCallback(e,t,n)}render(){return j`<nav
128
+ `}};G([U({type:Boolean})],Xt.prototype,`defaultOpen`,void 0),G([U({type:String})],Xt.prototype,`title`,void 0),G([U({type:String,reflect:!0})],Xt.prototype,`skin`,void 0),G([U({type:Boolean,reflect:!0})],Xt.prototype,`compact`,void 0),G([U({type:Boolean,reflect:!0})],Xt.prototype,`isOpen`,void 0),G([U({type:String,reflect:!0})],Xt.prototype,`name`,void 0);try{H(`pkt-accordion-item`)(Xt)}catch{console.warn(`Forsøker å definere <pkt-accordion-item>, men den er allerede definert`)}var Zt=class extends Xe{constructor(...e){super(...e),this.href=``,this.text=`Forsiden`,this.ariaLabel=``}attributeChangedCallback(e,t,n){e===`arialabel`&&this.removeAttribute(`arialabel`),e===`href`&&this.removeAttribute(`href`),e===`text`&&this.removeAttribute(`text`),super.attributeChangedCallback(e,t,n)}render(){return j`<nav
129
129
  class="pkt-back-link"
130
130
  aria-label=${this.ariaLabel||`Gå tilbake til forrige side`}
131
131
  >
132
- <a href=${J(this.href||`/`)} class="pkt-link pkt-link--icon-left"
132
+ <a href=${q(this.href||`/`)} class="pkt-link pkt-link--icon-left"
133
133
  ><pkt-icon
134
134
  class="pkt-back-link__icon pkt-icon pkt-link__icon"
135
135
  name="chevron-thin-left"
@@ -137,7 +137,7 @@
137
137
  ></pkt-icon
138
138
  ><span class="pkt-back-link__text">${this.text}</span></a
139
139
  >
140
- </nav>`}};K([W({type:String})],Xt.prototype,`href`,void 0),K([W({type:String})],Xt.prototype,`text`,void 0),K([W({type:String})],Xt.prototype,`ariaLabel`,void 0);try{U(`pkt-backlink`)(Xt)}catch{console.warn(`Forsøker å definere <pkt-backlink>, men den er allerede definert`)}var Zt=class extends Ye{constructor(...e){super(...e),this.breadcrumbs=[]}handleLinkClick(e,t,n){let r=new CustomEvent(`navigate`,{detail:{item:t,index:n,originalEvent:e},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(r)||e.preventDefault()}render(){if(!this.breadcrumbs||this.breadcrumbs.length===0)return N;let e=this.breadcrumbs[this.breadcrumbs.length-2];return j`
140
+ </nav>`}};G([U({type:String})],Zt.prototype,`href`,void 0),G([U({type:String})],Zt.prototype,`text`,void 0),G([U({type:String})],Zt.prototype,`ariaLabel`,void 0);try{H(`pkt-backlink`)(Zt)}catch{console.warn(`Forsøker å definere <pkt-backlink>, men den er allerede definert`)}var Qt=class extends Xe{constructor(...e){super(...e),this.breadcrumbs=[]}handleLinkClick(e,t,n){let r=new CustomEvent(`navigate`,{detail:{item:t,index:n,originalEvent:e},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(r)||e.preventDefault()}render(){if(!this.breadcrumbs||this.breadcrumbs.length===0)return N;let e=this.breadcrumbs[this.breadcrumbs.length-2];return j`
141
141
  <nav class="pkt-breadcrumbs" aria-label="brødsmulemeny">
142
142
  <ol class="pkt-breadcrumbs__list pkt-breadcrumbs--desktop">
143
143
  ${this.breadcrumbs.map((e,t)=>t===this.breadcrumbs.length-1?j`
@@ -179,7 +179,7 @@
179
179
  </a>
180
180
  `:N}
181
181
  </nav>
182
- `}};K([W({type:Array})],Zt.prototype,`breadcrumbs`,void 0);try{U(`pkt-breadcrumbs`)(Zt)}catch{console.warn(`Forsøker å definere <pkt-breadcrumbs>, men den er allerede definert`)}var Qt=365.2425,$t=6048e5,en=864e5,tn=3600*24;tn*7,tn*Qt/12*3;var nn=Symbol.for(`constructDateFrom`);function rn(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&nn in e?e[nn](t):e instanceof Date?new e.constructor(t):new Date(t)}function an(e,t){return rn(t||e,e)}function on(e,t,n){let r=an(e,n?.in);return isNaN(t)?rn(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}var sn={};function cn(){return sn}function ln(e,t){let n=cn(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=an(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function un(e,t){return ln(e,{...t,weekStartsOn:1})}function dn(e,t){let n=an(e,t?.in),r=n.getFullYear(),i=rn(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let a=un(i),o=rn(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);let s=un(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function fn(e){let t=an(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function pn(e,...t){let n=rn.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function mn(e,t){let n=an(e,t?.in);return n.setHours(0,0,0,0),n}function hn(e,t,n){let[r,i]=pn(n?.in,e,t),a=mn(r),o=mn(i),s=+a-fn(a),c=+o-fn(o);return Math.round((s-c)/en)}function gn(e,t){let n=dn(e,t),r=rn(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),un(r)}function _n(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function vn(e){return!(!_n(e)&&typeof e!=`number`||isNaN(+an(e)))}function yn(e,t){let n=an(e,t?.in);return n.setHours(23,59,59,999),n}function bn(e,t){let[n,r]=pn(e,t.start,t.end);return{start:n,end:r}}function xn(e,t){let{start:n,end:r}=bn(t?.in,e),i=+n>+r,a=i?+n:+r,o=i?r:n;o.setHours(0,0,0,0);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,i=!i);let c=[];for(;+o<=a;)c.push(rn(n,o)),o.setDate(o.getDate()+s),o.setHours(0,0,0,0);return i?c.reverse():c}function Sn(e,t){let n=an(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}var Cn={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`}},wn=(e,t,n)=>{let r,i=Cn[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function Tn(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var En={date:Tn({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:Tn({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:Tn({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},Dn={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},On=(e,t,n,r)=>Dn[e];function kn(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var An={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:kn({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:kn({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:kn({values:{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`]},defaultWidth:`wide`}),day:kn({values:{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`]},defaultWidth:`wide`}),dayPeriod:kn({values:{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`}},defaultWidth:`wide`,formattingValues:{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`}},defaultFormattingWidth:`wide`})};function jn(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?Nn(s,e=>e.test(o)):Mn(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function Mn(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Nn(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Pn(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var Fn={code:`en-US`,formatDistance:wn,formatLong:En,formatRelative:On,localize:An,match:{ordinalNumber:Pn({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:jn({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:jn({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:jn({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{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]},defaultParseWidth:`any`}),day:jn({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{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]},defaultParseWidth:`any`}),dayPeriod:jn({matchPatterns:{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},defaultMatchWidth:`any`,parsePatterns:{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}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function In(e,t){let n=an(e,t?.in);return hn(n,Sn(n))+1}function Ln(e,t){let n=an(e,t?.in),r=un(n)-+gn(n);return Math.round(r/$t)+1}function Rn(e,t){let n=an(e,t?.in),r=n.getFullYear(),i=cn(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=rn(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=ln(o,t),c=rn(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=ln(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function zn(e,t){let n=cn(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=Rn(e,t),a=rn(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),ln(a,t)}function Bn(e,t){let n=an(e,t?.in),r=ln(n,t)-+zn(n,t);return Math.round(r/$t)+1}function Vn(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var Hn={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return Vn(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):Vn(n+1,2)},d(e,t){return Vn(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return Vn(e.getHours()%12||12,t.length)},H(e,t){return Vn(e.getHours(),t.length)},m(e,t){return Vn(e.getMinutes(),t.length)},s(e,t){return Vn(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return Vn(Math.trunc(r*10**(n-3)),t.length)}},Un={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},Wn={G:function(e,t,n){let r=+(e.getFullYear()>0);switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return Hn.y(e,t)},Y:function(e,t,n,r){let i=Rn(e,r),a=i>0?i:1-i;return t===`YY`?Vn(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):Vn(a,t.length)},R:function(e,t){return Vn(dn(e),t.length)},u:function(e,t){return Vn(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return Vn(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return Vn(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return Hn.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return Vn(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=Bn(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):Vn(i,t.length)},I:function(e,t,n){let r=Ln(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):Vn(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):Hn.d(e,t)},D:function(e,t,n){let r=In(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):Vn(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return Vn(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return Vn(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return Vn(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?Un.noon:r===0?Un.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?Un.evening:r>=12?Un.afternoon:r>=4?Un.morning:Un.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return Hn.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):Hn.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):Vn(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):Vn(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):Hn.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):Hn.s(e,t)},S:function(e,t){return Hn.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return Kn(r);case`XXXX`:case`XX`:return qn(r);default:return qn(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return Kn(r);case`xxxx`:case`xx`:return qn(r);default:return qn(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+Gn(r,`:`);default:return`GMT`+qn(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+Gn(r,`:`);default:return`GMT`+qn(r,`:`)}},t:function(e,t,n){return Vn(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return Vn(+e,t.length)}};function Gn(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+Vn(a,2)}function Kn(e,t){return e%60==0?(e>0?`-`:`+`)+Vn(Math.abs(e)/60,2):qn(e,t)}function qn(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Vn(Math.trunc(r/60),2),a=Vn(r%60,2);return n+i+t+a}var Jn=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});default:return t.date({width:`full`})}},Yn=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});default:return t.time({width:`full`})}},Xn={p:Yn,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Jn(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,Jn(r,t)).replace(`{{time}}`,Yn(i,t))}},Zn=/^D+$/,Qn=/^Y+$/,$n=[`D`,`DD`,`YY`,`YYYY`];function er(e){return Zn.test(e)}function tr(e){return Qn.test(e)}function nr(e,t,n){let r=rr(e,t,n);if(console.warn(r),$n.includes(e))throw RangeError(r)}function rr(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var ir=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ar=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,or=/^'([^]*?)'?$/,sr=/''/g,cr=/[a-zA-Z]/;function lr(e,t,n){let r=cn(),i=n?.locale??r.locale??Fn,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=an(e,n?.in);if(!vn(s))throw RangeError(`Invalid time value`);let c=t.match(ar).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=Xn[t];return n(e,i.formatLong)}return e}).join(``).match(ir).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:ur(e)};if(Wn[t])return{isToken:!0,value:e};if(t.match(cr))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&tr(a)||!n?.useAdditionalDayOfYearTokens&&er(a))&&nr(a,t,String(e));let o=Wn[a[0]];return o(s,a,i.localize,l)}).join(``)}function ur(e){let t=e.match(or);return t?t[1].replace(sr,`'`):e}function dr(e,t){let n=an(e,t?.in).getDay();return n===0?7:n}function fr(e,t,n=`long`){return new Intl.DateTimeFormat(`en-US`,{hour:`numeric`,timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(` `)}var pr={},mr={};function hr(e,t){try{let n=(pr[e]||=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`longOffset`}).format)(t).split(`GMT`)[1];return n in mr?mr[n]:_r(n,n.split(`:`))}catch{if(e in mr)return mr[e];let t=e?.match(gr);return t?_r(e,t.slice(1)):NaN}}var gr=/([+-]\d\d):?(\d\d)?/;function _r(e,t){let n=+(t[0]||0),r=+(t[1]||0),i=(t[2]||0)/60;return mr[e]=n*60+r>0?n*60+r+i:n*60-r-i}var vr=class e extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]==`string`&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(hr(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)),Sr(this,NaN),br(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}withTimeZone(t){return new e(+this,t)}getTimezoneOffset(){let e=-hr(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),br(this),+this}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}},yr=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!yr.test(e))return;let t=e.replace(yr,`$1UTC`);vr.prototype[t]&&(e.startsWith(`get`)?vr.prototype[e]=function(){return this.internal[t]()}:(vr.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),xr(this),+this},vr.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),br(this),+this}))});function br(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-hr(e.timeZone,e)*60))}function xr(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),Sr(e)}function Sr(e){let t=hr(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);let i=-new Date(+e).getTimezoneOffset(),a=i- -new Date(+r).getTimezoneOffset(),o=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&o&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);let s=i-n;s&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);let c=new Date(+e);c.setUTCSeconds(0);let l=i>0?c.getSeconds():(c.getSeconds()-60)%60,u=Math.round(-(hr(e.timeZone,e)*60))%60;(u||l)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+u),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+u+l));let d=hr(e.timeZone,e),f=d>0?Math.floor(d):Math.ceil(d),p=-new Date(+e).getTimezoneOffset()-f,m=f!==n,h=p-s;if(m&&h){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+h);let t=hr(e.timeZone,e),n=f-(t>0?Math.floor(t):Math.ceil(t));n&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+n),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n))}}var Cr=class e extends vr{static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}toISOString(){let[e,t,n]=this.tzComponents(),r=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){let[e,t,n,r]=this.internal.toUTCString().split(` `);return`${e?.slice(0,-1)} ${n} ${t} ${r}`}toTimeString(){let e=this.internal.toUTCString().split(` `)[4],[t,n,r]=this.tzComponents();return`${e} GMT${t}${n}${r} (${fr(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){let e=this.getTimezoneOffset();return[e>0?`-`:`+`,String(Math.floor(Math.abs(e)/60)).padStart(2,`0`),String(Math.abs(e)%60).padStart(2,`0`)]}withTimeZone(t){return new e(+this,t)}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}};window.pktTz=window.pktTz===void 0?`Europe/Oslo`:window.pktTz;var wr=(e=window.pktTz)=>{let t=new Cr(new Date().toISOString(),e);return t.setHours(0,0,0,0),isNaN(t.getTime())?new Date:new Date(t.getFullYear(),t.getMonth(),t.getDate())};function Tr(e){if(!e||e===``)return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){let[t,n,r]=e.split(`-`).map(Number);return new Date(t,n-1,r)}if(/^\d{4}-\d{2}$/.test(e)){let[t,n]=e.split(`-`).map(Number);return new Date(t,n-1,1)}return/^\d{4}$/.test(e)?new Date(Number(e),0,1):new Date(e)}var Er=e=>!e||isNaN(e.getTime())?``:`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`,Dr=e=>{if(!e)return null;let t=Tr(e);return isNaN(t.getTime())?null:t},Or=(e,t)=>{let n=kr(e);return isNaN(n.getTime())?``:lr(n,t)},kr=(e=``,t)=>{let n=typeof e==`string`?Tr(e):e;return!n||isNaN(n.getTime())?new Date:t?t===`end`?yn(n):mn(n):n},Ar=(e,t,n=1)=>{if(typeof e!=`number`||typeof t!=`number`||typeof n!=`number`||isNaN(e)||isNaN(t)||isNaN(n))return new Date;let r=new Date(e,t,n);return isNaN(r.getTime())?new Date:r},jr=e=>{let t;return t=new Cr(e,window.pktTz),t.setHours(12,0,0,0),t},Mr=null,Nr=void 0,Pr=e=>{if(!e||isNaN(e.getTime()))return``;let t=typeof window<`u`?window.pktTz:void 0;return(!Mr||Nr!==t)&&(Mr=new Intl.DateTimeFormat(`no`,{dateStyle:`full`,timeZone:t}),Nr=t),Mr.format(e)},Fr=(e,t,n)=>{if(!e||isNaN(e.getTime()))return!1;let r=t?kr(t):null,i=n?kr(n):null;return!(r&&e<r||i&&e>i)},Ir=(e,t)=>{if(!e||isNaN(e.getTime())||!Array.isArray(t))return!1;let n=Er(e);return t.includes(n)},Lr=(e,t)=>{if(!e||isNaN(e.getTime())||!Array.isArray(t))return!1;let n=e.getDay().toString();return t.includes(n)},Rr=(e,t,n,r,i)=>!(!e||isNaN(e.getTime())||!Fr(e,t,n)||r&&Ir(e,r)||i&&Lr(e,i)),zr=(e,t,n,r,i)=>e.filter(e=>{let a=Dr(e);return a&&Rr(a,t,n,r,i)}),Br=e=>e.slice().sort((e,t)=>{let n=Dr(e),r=Dr(t);return!n||!r?0:n.getTime()-r.getTime()}),Vr=(e,t)=>{let n=Dr(e),r=Dr(t);return!n||!r?!1:n<=r},Hr=e=>{if(!e)return[];if(Array.isArray(e))return e.filter(Boolean);if(typeof e==`string`&&e.trimStart().startsWith(`[`))try{let t=JSON.parse(e);if(Array.isArray(t))return t.filter(Boolean)}catch{}return String(e).split(`,`).map(e=>e.trim()).filter(Boolean)},Ur=e=>e.join(`,`),Wr={csvToArray:e=>Hr(e),stringToDate:e=>e?Tr(e):null,stringsToDate:e=>{if(typeof e==`string`)return e.split(`,`).map(e=>Tr(e));if(Array.isArray(e))return e.map(e=>Tr(e))}},Gr={name:`pkt-calendar`,react:`PktCalendar`,"css-class":`pkt-calendar`,isElement:!0,isPureReact:!0,props:{id:{type:`string`,name:`ID`,description:`Unik identifikasjon for kalenderen`},currentmonth:{type:`date`,name:`Gjeldende måned`,converter:`stringToDate`,description:`Måneden som vises i kalenderen`},selected:{type:`array`,name:`Valgte datoer`,converter:`csvToArray`,reflect:!0,items:{type:`date`},description:`Liste over valgte datoer`},excludeweekdays:{type:`array`,name:`Utelat ukedager`,converter:`csvToArray`,items:{type:`string`},description:`Liste over ukedager (1-7) som skal ekskluderes`},excludedates:{type:`array`,name:`Utelat datoer`,converter:`stringsToDate`,items:{type:`date`},description:`Liste over spesifikke datoer som skal ekskluderes`},earliest:{type:`date`,name:`Tidligst tillatte dato`,converter:`stringToDate`,default:null,description:`Tidligste dato som kan velges`},latest:{type:`date`,name:`Senest tillatte dato`,converter:`stringToDate`,default:null,description:`Seneste dato som kan velges`},weeknumbers:{type:`boolean`,name:`Vis ukenummer`,reflect:!0,default:!1,description:`Vis ukenummer i kalenderen`},withcontrols:{type:`boolean`,name:`Med velgere for måned/år`,reflect:!0,default:!1,description:`Vis navigasjonskontroller for måned og år`},multiple:{type:`boolean`,name:`Flervalg`,reflect:!0,default:!1,description:`Tillat valg av flere datoer`},maxMultiple:{attribute:`max-multiple`,type:`number`,name:`Maks antall i flervalg`,default:4,description:`Maksimalt antall datoer som kan velges`},today:{type:`string`,name:`Dagens dato (overstyring)`,description:`ISO-datostreng som overstyrer dagens dato. Nyttig for snapshot-tester.`},range:{type:`boolean`,name:`Datotidsrom (fra og til)`,reflect:!0,default:!1,description:`Tillat valg av datotidsrom`},dayStrings:{attribute:`day-strings`,type:`array`,name:`Korte dagsnavn`,items:{type:`string`},description:`Korte dagsnavn for kalenderoverskriften`},dayStringsLong:{attribute:`day-strings-long`,type:`array`,name:`Fulle dagsnavn`,items:{type:`string`},description:`Fulle dagsnavn for tilgjengelighetsetiketter`},monthStrings:{attribute:`month-strings`,type:`array`,name:`Månedsnavn`,items:{type:`string`},description:`Månedsnavn for kalendernavigasjonen`},weekString:{attribute:`week-string`,type:`string`,name:`Ukenummer-etikett`,description:`Etikett for ukenummerkolonnen`},prevMonthString:{attribute:`prev-month-string`,type:`string`,name:`Forrige måned-etikett`,description:`Tilgjengelighetsetikett for forrige måned-knappen`},nextMonthString:{attribute:`next-month-string`,type:`string`,name:`Neste måned-etikett`,description:`Tilgjengelighetsetikett for neste måned-knappen`}},events:{"date-selected":{description:`Returnerer en liste med valgte datoer i ISO-format`},close:{description:`Utløses når kalenderen ber om å lukkes (Escape-tast eller fokus forlater)`}}};function Kr(e,t){let n=(t.excludedates??[]).map(e=>typeof e==`string`?e:Er(e));return!Rr(e,t.earliest,t.latest,n,t.excludeweekdays??[])}function qr(e,t,n,r){return!!(Kr(e,n)||!t&&r.multiple&&r.maxMultiple>0&&r.selectedCount>=r.maxMultiple)}function Jr(e,t,n){let r=Ar(e,t,0);return!(n&&kr(n)>r)}function Yr(e,t,n){let r=Ar(t===11?e+1:e,t===11?0:t+1,1);return!(n&&kr(n)<r)}function Xr(e,t){let n=Ar(e,t,1),r=Ar(e,t+1,0),i=(n.getDay()+6)%7,a=r.getDate();return{firstDayOfMonth:n,lastDayOfMonth:r,startingDay:i,numDays:a,numRows:Math.ceil((a+i)/7),numDaysPrevMonth:Ar(e,t,0).getDate(),initialWeek:Bn(n)}}function Zr(e,t,n,r){let{startingDay:i,numDays:a}=r;return e===0&&t<i?`prev-month`:n>a?`next-month`:`current-month`}function Qr(e,t,n,r){let{startingDay:i,numDaysPrevMonth:a,numDays:o}=r;return e===`prev-month`?a-(i-t-1):e===`next-month`?n-o:n}function $r(e){return typeof e==`string`&&(e=e.split(`,`)),e.length===1&&e[0]===``?[]:e.map(e=>Tr(e))}function ei(e,t){let n=xn({start:e,end:t}),r={};if(Array.isArray(n)&&n.length)for(let i=0;i<n.length;i++){let a=n[i],o=a>e&&a<t;r[Er(a)]=o}return r}function ti(e,t,n,r){if(t.length!==1)return!0;let i=xn({start:t[0],end:e});if(!Array.isArray(i)||!i.length)return!0;for(let a=0;a<i.length;a++){for(let r of n??[])if(r>t[0]&&r<e)return!1;if((r??[]).includes(dr(i[a]).toString()))return!1}return!0}function ni(e,t){let n=Er(e);return t.includes(n)?t:[...t,n]}function ri(e,t){let n=Er(e),r=t.indexOf(n);if(r===-1)return t;if(t.length===1)return[];let i=[...t];return i.splice(r,1),i}function ii(e,t,n){let r=Er(e);return t.includes(r)?ri(e,t):n>0&&t.length>=n?t:ni(e,t)}function ai(e,t,n){let r=Er(e),i=$r(t);return t.includes(r)?t.indexOf(r)===0?[]:ri(e,t):t.length>1||t.length===1&&(!ti(e,i,n.excludedates,n.excludeweekdays)||i[0]>e)?[r]:ni(e,t)}var oi={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7};function si(e){let t=e.nodeName;return t===`INPUT`||t===`SELECT`||t===`BUTTON`&&!e.dataset?.date}function ci(e,t,n){let r=on(e,t);if(!r)return null;let i=n(`button[data-date="${Er(r)}"]`);for(;i instanceof HTMLButtonElement&&i.dataset.disabled;)if(r=on(r,t),i=n(`button[data-date="${Er(r)}"]`),!i)return null;return r}function li(e){return oi[e]??null}var ui=class extends Ye{constructor(...e){super(...e),this.selected=[],this.multiple=Gr.props.multiple.default,this.maxMultiple=Gr.props.maxMultiple.default,this.range=Gr.props.range.default,this.earliest=Gr.props.earliest.default,this.latest=Gr.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.weeknumbers=Gr.props.weeknumbers.default,this.withcontrols=Gr.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?Tr(this.today):wr()}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=$r(this.selected),this.range&&this.selected.length===2&&(this.inRange=ei(this._selected[0],this._selected[1])),this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==``){let e=Tr(this.selected[this.selected.length-1]);this.currentmonth=isNaN(e.getTime())?jr(this.todayDate):e}else this.currentmonth===null&&(this.currentmonth=jr(this.todayDate));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=jr(this.todayDate)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(e){let t=li(e.key);t!==null&&this.handleArrowKey(e,t)}handleArrowKey(e,t){let n=e.target;if(si(n))return;if(e.preventDefault(),!this.focusedDate){this.focusOnCurrentDate();return}let r=ci(this.focusedDate?kr(this.focusedDate):Ar(this.year,this.month,1),t,this.querySelector.bind(this));if(r){let e=this.querySelector(`button[data-date="${Er(r)}"]`);e instanceof HTMLButtonElement&&!e.dataset.disabled&&(this.focusedDate=Er(r),e.focus())}}render(){return j`
182
+ `}};G([U({type:Array})],Qt.prototype,`breadcrumbs`,void 0);try{H(`pkt-breadcrumbs`)(Qt)}catch{console.warn(`Forsøker å definere <pkt-breadcrumbs>, men den er allerede definert`)}var $t=365.2425,en=6048e5,tn=864e5,nn=3600*24;nn*7,nn*$t/12*3;var rn=Symbol.for(`constructDateFrom`);function an(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&rn in e?e[rn](t):e instanceof Date?new e.constructor(t):new Date(t)}function on(e,t){return an(t||e,e)}function sn(e,t,n){let r=on(e,n?.in);return isNaN(t)?an(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}var cn={};function ln(){return cn}function un(e,t){let n=ln(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=on(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function dn(e,t){return un(e,{...t,weekStartsOn:1})}function fn(e,t){let n=on(e,t?.in),r=n.getFullYear(),i=an(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let a=dn(i),o=an(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);let s=dn(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function pn(e){let t=on(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function mn(e,...t){let n=an.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function hn(e,t){let n=on(e,t?.in);return n.setHours(0,0,0,0),n}function gn(e,t,n){let[r,i]=mn(n?.in,e,t),a=hn(r),o=hn(i),s=+a-pn(a),c=+o-pn(o);return Math.round((s-c)/tn)}function _n(e,t){let n=fn(e,t),r=an(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),dn(r)}function vn(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function yn(e){return!(!vn(e)&&typeof e!=`number`||isNaN(+on(e)))}function bn(e,t){let n=on(e,t?.in);return n.setHours(23,59,59,999),n}function xn(e,t){let[n,r]=mn(e,t.start,t.end);return{start:n,end:r}}function Sn(e,t){let{start:n,end:r}=xn(t?.in,e),i=+n>+r,a=i?+n:+r,o=i?r:n;o.setHours(0,0,0,0);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,i=!i);let c=[];for(;+o<=a;)c.push(an(n,o)),o.setDate(o.getDate()+s),o.setHours(0,0,0,0);return i?c.reverse():c}function Cn(e,t){let n=on(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}var wn={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`}},Tn=(e,t,n)=>{let r,i=wn[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function En(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var Dn={date:En({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:En({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:En({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},On={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},kn=(e,t,n,r)=>On[e];function An(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var jn={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:An({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:An({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:An({values:{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`]},defaultWidth:`wide`}),day:An({values:{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`]},defaultWidth:`wide`}),dayPeriod:An({values:{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`}},defaultWidth:`wide`,formattingValues:{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`}},defaultFormattingWidth:`wide`})};function Mn(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?Pn(s,e=>e.test(o)):Nn(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function Nn(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Pn(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Fn(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var In={code:`en-US`,formatDistance:Tn,formatLong:Dn,formatRelative:kn,localize:jn,match:{ordinalNumber:Fn({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:Mn({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:Mn({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:Mn({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{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]},defaultParseWidth:`any`}),day:Mn({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{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]},defaultParseWidth:`any`}),dayPeriod:Mn({matchPatterns:{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},defaultMatchWidth:`any`,parsePatterns:{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}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function Ln(e,t){let n=on(e,t?.in);return gn(n,Cn(n))+1}function Rn(e,t){let n=on(e,t?.in),r=dn(n)-+_n(n);return Math.round(r/en)+1}function zn(e,t){let n=on(e,t?.in),r=n.getFullYear(),i=ln(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=an(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=un(o,t),c=an(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=un(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function Bn(e,t){let n=ln(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=zn(e,t),a=an(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),un(a,t)}function Vn(e,t){let n=on(e,t?.in),r=un(n,t)-+Bn(n,t);return Math.round(r/en)+1}function Hn(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var Un={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return Hn(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):Hn(n+1,2)},d(e,t){return Hn(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return Hn(e.getHours()%12||12,t.length)},H(e,t){return Hn(e.getHours(),t.length)},m(e,t){return Hn(e.getMinutes(),t.length)},s(e,t){return Hn(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return Hn(Math.trunc(r*10**(n-3)),t.length)}},Wn={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},Gn={G:function(e,t,n){let r=+(e.getFullYear()>0);switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return Un.y(e,t)},Y:function(e,t,n,r){let i=zn(e,r),a=i>0?i:1-i;return t===`YY`?Hn(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):Hn(a,t.length)},R:function(e,t){return Hn(fn(e),t.length)},u:function(e,t){return Hn(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return Hn(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return Hn(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return Un.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return Hn(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=Vn(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):Hn(i,t.length)},I:function(e,t,n){let r=Rn(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):Hn(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):Un.d(e,t)},D:function(e,t,n){let r=Ln(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):Hn(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return Hn(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return Hn(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return Hn(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?Wn.noon:r===0?Wn.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?Wn.evening:r>=12?Wn.afternoon:r>=4?Wn.morning:Wn.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return Un.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):Un.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):Hn(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):Hn(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):Un.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):Un.s(e,t)},S:function(e,t){return Un.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return qn(r);case`XXXX`:case`XX`:return Jn(r);default:return Jn(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return qn(r);case`xxxx`:case`xx`:return Jn(r);default:return Jn(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+Kn(r,`:`);default:return`GMT`+Jn(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+Kn(r,`:`);default:return`GMT`+Jn(r,`:`)}},t:function(e,t,n){return Hn(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return Hn(+e,t.length)}};function Kn(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+Hn(a,2)}function qn(e,t){return e%60==0?(e>0?`-`:`+`)+Hn(Math.abs(e)/60,2):Jn(e,t)}function Jn(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Hn(Math.trunc(r/60),2),a=Hn(r%60,2);return n+i+t+a}var Yn=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});default:return t.date({width:`full`})}},Xn=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});default:return t.time({width:`full`})}},Zn={p:Xn,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Yn(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,Yn(r,t)).replace(`{{time}}`,Xn(i,t))}},Qn=/^D+$/,$n=/^Y+$/,er=[`D`,`DD`,`YY`,`YYYY`];function tr(e){return Qn.test(e)}function nr(e){return $n.test(e)}function rr(e,t,n){let r=ir(e,t,n);if(console.warn(r),er.includes(e))throw RangeError(r)}function ir(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var ar=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,or=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,sr=/^'([^]*?)'?$/,cr=/''/g,lr=/[a-zA-Z]/;function ur(e,t,n){let r=ln(),i=n?.locale??r.locale??In,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=on(e,n?.in);if(!yn(s))throw RangeError(`Invalid time value`);let c=t.match(or).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=Zn[t];return n(e,i.formatLong)}return e}).join(``).match(ar).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:dr(e)};if(Gn[t])return{isToken:!0,value:e};if(t.match(lr))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&nr(a)||!n?.useAdditionalDayOfYearTokens&&tr(a))&&rr(a,t,String(e));let o=Gn[a[0]];return o(s,a,i.localize,l)}).join(``)}function dr(e){let t=e.match(sr);return t?t[1].replace(cr,`'`):e}function fr(e,t){let n=on(e,t?.in).getDay();return n===0?7:n}function pr(e,t,n=`long`){return new Intl.DateTimeFormat(`en-US`,{hour:`numeric`,timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(` `)}var mr={},hr={};function gr(e,t){try{let n=(mr[e]||=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`longOffset`}).format)(t).split(`GMT`)[1];return n in hr?hr[n]:vr(n,n.split(`:`))}catch{if(e in hr)return hr[e];let t=e?.match(_r);return t?vr(e,t.slice(1)):NaN}}var _r=/([+-]\d\d):?(\d\d)?/;function vr(e,t){let n=+(t[0]||0),r=+(t[1]||0),i=(t[2]||0)/60;return hr[e]=n*60+r>0?n*60+r+i:n*60-r-i}var yr=class e extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]==`string`&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(gr(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)),Cr(this,NaN),xr(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}withTimeZone(t){return new e(+this,t)}getTimezoneOffset(){let e=-gr(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),xr(this),+this}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}},br=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!br.test(e))return;let t=e.replace(br,`$1UTC`);yr.prototype[t]&&(e.startsWith(`get`)?yr.prototype[e]=function(){return this.internal[t]()}:(yr.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),Sr(this),+this},yr.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),xr(this),+this}))});function xr(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-gr(e.timeZone,e)*60))}function Sr(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),Cr(e)}function Cr(e){let t=gr(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);let i=-new Date(+e).getTimezoneOffset(),a=i- -new Date(+r).getTimezoneOffset(),o=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&o&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);let s=i-n;s&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);let c=new Date(+e);c.setUTCSeconds(0);let l=i>0?c.getSeconds():(c.getSeconds()-60)%60,u=Math.round(-(gr(e.timeZone,e)*60))%60;(u||l)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+u),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+u+l));let d=gr(e.timeZone,e),f=d>0?Math.floor(d):Math.ceil(d),p=-new Date(+e).getTimezoneOffset()-f,m=f!==n,h=p-s;if(m&&h){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+h);let t=gr(e.timeZone,e),n=f-(t>0?Math.floor(t):Math.ceil(t));n&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+n),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n))}}var wr=class e extends yr{static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}toISOString(){let[e,t,n]=this.tzComponents(),r=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){let[e,t,n,r]=this.internal.toUTCString().split(` `);return`${e?.slice(0,-1)} ${n} ${t} ${r}`}toTimeString(){let e=this.internal.toUTCString().split(` `)[4],[t,n,r]=this.tzComponents();return`${e} GMT${t}${n}${r} (${pr(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){let e=this.getTimezoneOffset();return[e>0?`-`:`+`,String(Math.floor(Math.abs(e)/60)).padStart(2,`0`),String(Math.abs(e)%60).padStart(2,`0`)]}withTimeZone(t){return new e(+this,t)}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}};window.pktTz=window.pktTz===void 0?`Europe/Oslo`:window.pktTz;var Tr=(e=window.pktTz)=>{let t=new wr(new Date().toISOString(),e);return t.setHours(0,0,0,0),isNaN(t.getTime())?new Date:new Date(t.getFullYear(),t.getMonth(),t.getDate())};function Er(e){if(!e||e===``)return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){let[t,n,r]=e.split(`-`).map(Number);return new Date(t,n-1,r)}if(/^\d{4}-\d{2}$/.test(e)){let[t,n]=e.split(`-`).map(Number);return new Date(t,n-1,1)}return/^\d{4}$/.test(e)?new Date(Number(e),0,1):new Date(e)}var Dr=e=>!e||isNaN(e.getTime())?``:`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`,Or=e=>{if(!e)return null;let t=Er(e);return isNaN(t.getTime())?null:t},kr=(e,t)=>{let n=Ar(e);return isNaN(n.getTime())?``:ur(n,t)},Ar=(e=``,t)=>{let n=typeof e==`string`?Er(e):e;return!n||isNaN(n.getTime())?new Date:t?t===`end`?bn(n):hn(n):n},jr=(e,t,n=1)=>{if(typeof e!=`number`||typeof t!=`number`||typeof n!=`number`||isNaN(e)||isNaN(t)||isNaN(n))return new Date;let r=new Date(e,t,n);return isNaN(r.getTime())?new Date:r},Mr=e=>{let t;return t=new wr(e,window.pktTz),t.setHours(12,0,0,0),t},Nr=null,Pr=void 0,Fr=e=>{if(!e||isNaN(e.getTime()))return``;let t=typeof window<`u`?window.pktTz:void 0;return(!Nr||Pr!==t)&&(Nr=new Intl.DateTimeFormat(`no`,{dateStyle:`full`,timeZone:t}),Pr=t),Nr.format(e)},Ir=(e,t,n)=>{if(!e||isNaN(e.getTime()))return!1;let r=t?Ar(t):null,i=n?Ar(n):null;return!(r&&e<r||i&&e>i)},Lr=(e,t)=>{if(!e||isNaN(e.getTime())||!Array.isArray(t))return!1;let n=Dr(e);return t.includes(n)},Rr=(e,t)=>{if(!e||isNaN(e.getTime())||!Array.isArray(t))return!1;let n=e.getDay().toString();return t.includes(n)},zr=(e,t,n,r,i)=>!(!e||isNaN(e.getTime())||!Ir(e,t,n)||r&&Lr(e,r)||i&&Rr(e,i)),Br=(e,t,n,r,i)=>e.filter(e=>{let a=Or(e);return a&&zr(a,t,n,r,i)}),Vr=e=>e.slice().sort((e,t)=>{let n=Or(e),r=Or(t);return!n||!r?0:n.getTime()-r.getTime()}),Hr=(e,t)=>{let n=Or(e),r=Or(t);return!n||!r?!1:n<=r},Ur=e=>{if(!e)return[];if(Array.isArray(e))return e.filter(Boolean);if(typeof e==`string`&&e.trimStart().startsWith(`[`))try{let t=JSON.parse(e);if(Array.isArray(t))return t.filter(Boolean)}catch{}return String(e).split(`,`).map(e=>e.trim()).filter(Boolean)},Wr=e=>e.join(`,`),Gr={csvToArray:e=>Ur(e),stringToDate:e=>e?Er(e):null,stringsToDate:e=>{if(typeof e==`string`)return e.split(`,`).map(e=>Er(e));if(Array.isArray(e))return e.map(e=>Er(e))}},Kr={name:`pkt-calendar`,react:`PktCalendar`,"css-class":`pkt-calendar`,isElement:!0,isPureReact:!0,props:{id:{type:`string`,name:`ID`,description:`Unik identifikasjon for kalenderen`},currentmonth:{type:`date`,name:`Gjeldende måned`,converter:`stringToDate`,description:`Måneden som vises i kalenderen`},selected:{type:`array`,name:`Valgte datoer`,converter:`csvToArray`,reflect:!0,items:{type:`date`},description:`Liste over valgte datoer`},excludeweekdays:{type:`array`,name:`Utelat ukedager`,converter:`csvToArray`,items:{type:`string`},description:`Liste over ukedager (1-7) som skal ekskluderes`},excludedates:{type:`array`,name:`Utelat datoer`,converter:`stringsToDate`,items:{type:`date`},description:`Liste over spesifikke datoer som skal ekskluderes`},earliest:{type:`date`,name:`Tidligst tillatte dato`,converter:`stringToDate`,default:null,description:`Tidligste dato som kan velges`},latest:{type:`date`,name:`Senest tillatte dato`,converter:`stringToDate`,default:null,description:`Seneste dato som kan velges`},weeknumbers:{type:`boolean`,name:`Vis ukenummer`,reflect:!0,default:!1,description:`Vis ukenummer i kalenderen`},withcontrols:{type:`boolean`,name:`Med velgere for måned/år`,reflect:!0,default:!1,description:`Vis navigasjonskontroller for måned og år`},multiple:{type:`boolean`,name:`Flervalg`,reflect:!0,default:!1,description:`Tillat valg av flere datoer`},maxMultiple:{attribute:`max-multiple`,type:`number`,name:`Maks antall i flervalg`,default:4,description:`Maksimalt antall datoer som kan velges`},today:{type:`string`,name:`Dagens dato (overstyring)`,description:`ISO-datostreng som overstyrer dagens dato. Nyttig for snapshot-tester.`},range:{type:`boolean`,name:`Datotidsrom (fra og til)`,reflect:!0,default:!1,description:`Tillat valg av datotidsrom`},dayStrings:{attribute:`day-strings`,type:`array`,name:`Korte dagsnavn`,items:{type:`string`},description:`Korte dagsnavn for kalenderoverskriften`},dayStringsLong:{attribute:`day-strings-long`,type:`array`,name:`Fulle dagsnavn`,items:{type:`string`},description:`Fulle dagsnavn for tilgjengelighetsetiketter`},monthStrings:{attribute:`month-strings`,type:`array`,name:`Månedsnavn`,items:{type:`string`},description:`Månedsnavn for kalendernavigasjonen`},weekString:{attribute:`week-string`,type:`string`,name:`Ukenummer-etikett`,description:`Etikett for ukenummerkolonnen`},prevMonthString:{attribute:`prev-month-string`,type:`string`,name:`Forrige måned-etikett`,description:`Tilgjengelighetsetikett for forrige måned-knappen`},nextMonthString:{attribute:`next-month-string`,type:`string`,name:`Neste måned-etikett`,description:`Tilgjengelighetsetikett for neste måned-knappen`}},events:{"date-selected":{description:`Returnerer en liste med valgte datoer i ISO-format`},close:{description:`Utløses når kalenderen ber om å lukkes (Escape-tast eller fokus forlater)`}}};function qr(e,t){let n=(t.excludedates??[]).map(e=>typeof e==`string`?e:Dr(e));return!zr(e,t.earliest,t.latest,n,t.excludeweekdays??[])}function Jr(e,t,n,r){return!!(qr(e,n)||!t&&r.multiple&&r.maxMultiple>0&&r.selectedCount>=r.maxMultiple)}function Yr(e,t,n){let r=jr(e,t,0);return!(n&&Ar(n)>r)}function Xr(e,t,n){let r=jr(t===11?e+1:e,t===11?0:t+1,1);return!(n&&Ar(n)<r)}function Zr(e,t){let n=jr(e,t,1),r=jr(e,t+1,0),i=(n.getDay()+6)%7,a=r.getDate();return{firstDayOfMonth:n,lastDayOfMonth:r,startingDay:i,numDays:a,numRows:Math.ceil((a+i)/7),numDaysPrevMonth:jr(e,t,0).getDate(),initialWeek:Vn(n)}}function Qr(e,t,n,r){let{startingDay:i,numDays:a}=r;return e===0&&t<i?`prev-month`:n>a?`next-month`:`current-month`}function $r(e,t,n,r){let{startingDay:i,numDaysPrevMonth:a,numDays:o}=r;return e===`prev-month`?a-(i-t-1):e===`next-month`?n-o:n}function ei(e){return typeof e==`string`&&(e=e.split(`,`)),e.length===1&&e[0]===``?[]:e.map(e=>Er(e))}function ti(e,t){let n=Sn({start:e,end:t}),r={};if(Array.isArray(n)&&n.length)for(let i=0;i<n.length;i++){let a=n[i],o=a>e&&a<t;r[Dr(a)]=o}return r}function ni(e,t,n,r){if(t.length!==1)return!0;let i=Sn({start:t[0],end:e});if(!Array.isArray(i)||!i.length)return!0;for(let a=0;a<i.length;a++){for(let r of n??[])if(r>t[0]&&r<e)return!1;if((r??[]).includes(fr(i[a]).toString()))return!1}return!0}function ri(e,t){let n=Dr(e);return t.includes(n)?t:[...t,n]}function ii(e,t){let n=Dr(e),r=t.indexOf(n);if(r===-1)return t;if(t.length===1)return[];let i=[...t];return i.splice(r,1),i}function ai(e,t,n){let r=Dr(e);return t.includes(r)?ii(e,t):n>0&&t.length>=n?t:ri(e,t)}function oi(e,t,n){let r=Dr(e),i=ei(t);return t.includes(r)?t.indexOf(r)===0?[]:ii(e,t):t.length>1||t.length===1&&(!ni(e,i,n.excludedates,n.excludeweekdays)||i[0]>e)?[r]:ri(e,t)}var si={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7};function ci(e){let t=e.nodeName;return t===`INPUT`||t===`SELECT`||t===`BUTTON`&&!e.dataset?.date}function li(e,t,n){let r=sn(e,t);if(!r)return null;let i=n(`button[data-date="${Dr(r)}"]`);for(;i instanceof HTMLButtonElement&&i.dataset.disabled;)if(r=sn(r,t),i=n(`button[data-date="${Dr(r)}"]`),!i)return null;return r}function ui(e){return si[e]??null}var di=class extends Xe{constructor(...e){super(...e),this.selected=[],this.multiple=Kr.props.multiple.default,this.maxMultiple=Kr.props.maxMultiple.default,this.range=Kr.props.range.default,this.earliest=Kr.props.earliest.default,this.latest=Kr.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.weeknumbers=Kr.props.weeknumbers.default,this.withcontrols=Kr.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?Er(this.today):Tr()}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=ei(this.selected),this.range&&this.selected.length===2&&(this.inRange=ti(this._selected[0],this._selected[1])),this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==``){let e=Er(this.selected[this.selected.length-1]);this.currentmonth=isNaN(e.getTime())?Mr(this.todayDate):e}else this.currentmonth===null&&(this.currentmonth=Mr(this.todayDate));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=Mr(this.todayDate)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(e){let t=ui(e.key);t!==null&&this.handleArrowKey(e,t)}handleArrowKey(e,t){let n=e.target;if(ci(n))return;if(e.preventDefault(),!this.focusedDate){this.focusOnCurrentDate();return}let r=li(this.focusedDate?Ar(this.focusedDate):jr(this.year,this.month,1),t,this.querySelector.bind(this));if(r){let e=this.querySelector(`button[data-date="${Dr(r)}"]`);e instanceof HTMLButtonElement&&!e.dataset.disabled&&(this.focusedDate=Dr(r),e.focus())}}render(){return j`
183
183
  <div
184
184
  class="pkt-calendar ${this.weeknumbers?`pkt-cal-weeknumbers`:``}"
185
185
  @focusout=${this.closeEvent}
@@ -244,12 +244,12 @@
244
244
  />
245
245
  </div>`:j`<div class="pkt-txt-16-medium pkt-calendar__month-title" aria-live="polite">
246
246
  ${this.monthStrings[this.month]} ${this.year}
247
- </div>`}getDayViewData(e,t){let n=Ar(this.year,this.month,e),r=Er(n),i=r===Er(t),a=this.selected.includes(r),o=this.isDayDisabled(n,a),s=this.calculateTabIndex(r,o,e);return{currentDate:n,currentDateISO:r,isToday:i,isSelected:a,isDisabled:o,ariaLabel:Pr(n),tabindex:s}}getDateConstraints(){return{earliest:this.earliest,latest:this.latest,excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}}isDayDisabled(e,t){return qr(e,t,this.getDateConstraints(),{multiple:this.multiple,maxMultiple:this.maxMultiple,selectedCount:this.selected.length})}calculateTabIndex(e,t,n){return this.focusedDate?this.focusedDate===e&&!t?`0`:`-1`:!t&&this.tabIndexSet===0?(this.tabIndexSet=n,`0`):this.tabIndexSet===n?`0`:`-1`}getDayCellClasses(e){let{currentDateISO:t,isToday:n,isSelected:r}=e,i=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":n,"pkt-cal-selected":r,"pkt-cal-in-range":this.inRange[t],"pkt-cal-excluded":this.isExcluded(e.currentDate),"pkt-cal-in-range-first":i,"pkt-cal-in-range-last":a,"pkt-cal-range-hover":this.rangeHovered!==null&&t===Er(this.rangeHovered)}}getDayButtonClasses(e){let{currentDateISO:t,isToday:n,isSelected:r,isDisabled:i}=e,a=this.range&&(this.selected.length===2||this.rangeHovered!==null)&&t===this.selected[0],o=this.range&&this.selected.length===2&&t===this.selected[1];return{"pkt-calendar__date":!0,"pkt-calendar__date--today":n,"pkt-calendar__date--selected":r,"pkt-calendar__date--disabled":i,"pkt-calendar__date--in-range":this.inRange[t],"pkt-calendar__date--in-range-hover":this.rangeHovered!==null&&t===Er(this.rangeHovered),"pkt-calendar__date--range-start":a,"pkt-calendar__date--range-end":o}}handleDayFocus(e,t){this.range&&!this.isExcluded(e)&&this.handleRangeHover(e),this.focusedDate=t}renderDayView(e,t){let n=this.getDayViewData(e,t),{currentDate:r,currentDateISO:i,isSelected:a,isDisabled:o,ariaLabel:s,tabindex:c}=n;this.selectableDates.push({currentDateISO:i,isDisabled:o,tabindex:c});let l=this.getDayCellClasses(n),u=this.getDayButtonClasses(n);return j`<td class=${q(l)}>
247
+ </div>`}getDayViewData(e,t){let n=jr(this.year,this.month,e),r=Dr(n),i=r===Dr(t),a=this.selected.includes(r),o=this.isDayDisabled(n,a),s=this.calculateTabIndex(r,o,e);return{currentDate:n,currentDateISO:r,isToday:i,isSelected:a,isDisabled:o,ariaLabel:Fr(n),tabindex:s}}getDateConstraints(){return{earliest:this.earliest,latest:this.latest,excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}}isDayDisabled(e,t){return Jr(e,t,this.getDateConstraints(),{multiple:this.multiple,maxMultiple:this.maxMultiple,selectedCount:this.selected.length})}calculateTabIndex(e,t,n){return this.focusedDate?this.focusedDate===e&&!t?`0`:`-1`:!t&&this.tabIndexSet===0?(this.tabIndexSet=n,`0`):this.tabIndexSet===n?`0`:`-1`}getDayCellClasses(e){let{currentDateISO:t,isToday:n,isSelected:r}=e,i=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":n,"pkt-cal-selected":r,"pkt-cal-in-range":this.inRange[t],"pkt-cal-excluded":this.isExcluded(e.currentDate),"pkt-cal-in-range-first":i,"pkt-cal-in-range-last":a,"pkt-cal-range-hover":this.rangeHovered!==null&&t===Dr(this.rangeHovered)}}getDayButtonClasses(e){let{currentDateISO:t,isToday:n,isSelected:r,isDisabled:i}=e,a=this.range&&(this.selected.length===2||this.rangeHovered!==null)&&t===this.selected[0],o=this.range&&this.selected.length===2&&t===this.selected[1];return{"pkt-calendar__date":!0,"pkt-calendar__date--today":n,"pkt-calendar__date--selected":r,"pkt-calendar__date--disabled":i,"pkt-calendar__date--in-range":this.inRange[t],"pkt-calendar__date--in-range-hover":this.rangeHovered!==null&&t===Dr(this.rangeHovered),"pkt-calendar__date--range-start":a,"pkt-calendar__date--range-end":o}}handleDayFocus(e,t){this.range&&!this.isExcluded(e)&&this.handleRangeHover(e),this.focusedDate=t}renderDayView(e,t){let n=this.getDayViewData(e,t),{currentDate:r,currentDateISO:i,isSelected:a,isDisabled:o,ariaLabel:s,tabindex:c}=n;this.selectableDates.push({currentDateISO:i,isDisabled:o,tabindex:c});let l=this.getDayCellClasses(n),u=this.getDayButtonClasses(n);return j`<td class=${K(l)}>
248
248
  <button
249
249
  type="button"
250
250
  aria-pressed=${a?`true`:`false`}
251
251
  ?disabled=${o}
252
- class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${q(u)}"
252
+ class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${K(u)}"
253
253
  @mouseover=${()=>this.range&&!this.isExcluded(r)&&this.handleRangeHover(r)}
254
254
  @focus=${()=>this.handleDayFocus(r,i)}
255
255
  aria-label="${s}"
@@ -268,36 +268,36 @@
268
268
  >
269
269
  <span class="pkt-btn__text pkt-txt-14-light">${e}</span>
270
270
  </div>
271
- </td>`}renderWeekRow(e){return j`<tr class="pkt-cal-week-row" role="row">${e}</tr>`}renderCalendarBody(){let e=this.todayDate,t=Xr(this.year,this.month);this.selectableDates=[],this.tabIndexSet=0;let n=1;this.week=t.initialWeek;let r=[];for(let i=0;i<t.numRows;i++){let a=[];this.weeknumbers&&a.push(j`<td class="pkt-cal-week">${this.week}</td>`),this.week++;for(let r=0;r<7;r++){let o=Zr(i,r,n,t);if(o===`current-month`)a.push(this.renderDayView(n,e)),n++;else{let e=Qr(o,r,n,t);a.push(this.renderEmptyDayCell(e)),o===`next-month`&&n++}}r.push(this.renderWeekRow(a))}return r}isExcluded(e){return Kr(e,this.getDateConstraints())}isPrevMonthAllowed(){return Jr(this.year,this.month,this.earliest)}prevMonth(){let e=this.month===0?11:this.month-1,t=this.month===0?this.year-1:this.year;this.changeMonth(t,e)}isNextMonthAllowed(){return Yr(this.year,this.month,this.latest)}nextMonth(){let 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=jr(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=ni(e,this.normalizeSelected()),this._selected=$r(this.selected),this.range&&this.selected.length===2&&(this.convertSelected(),this.close())}removeFromSelected(e){this.selected=ri(e,this.normalizeSelected()),this._selected=$r(this.selected)}toggleSelected(e){this.selected=ii(e,this.normalizeSelected(),this.maxMultiple),this._selected=$r(this.selected)}isRangeAllowed(e){return ti(e,this._selected,this.excludedates,this.excludeweekdays)}handleRangeSelect(e){return this.selected=ai(e,this.normalizeSelected(),{excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}),this._selected=$r(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=ei(this._selected[0],e)}handleDateSelect(e){return e?(this.range?this.handleRangeSelect(e):this.multiple?this.toggleSelected(e):(this.selected.includes(Er(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()):Promise.resolve()}focusOnCurrentDate(){let e=Er(jr(this.todayDate)),t=this.querySelector(`button[data-date="${e}"]`);if(t instanceof HTMLButtonElement){this.focusedDate=e,t.focus();return}let n=this.selectableDates.find(e=>!e.isDisabled);if(n){let e=this.querySelector(`button[data-date="${n.currentDateISO}"]`);e instanceof HTMLButtonElement&&(this.focusedDate=n.currentDateISO,e.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}))}};K([W({converter:Wr.csvToArray})],ui.prototype,`selected`,void 0),K([W({type:Boolean})],ui.prototype,`multiple`,void 0),K([W({type:Number,attribute:`max-multiple`})],ui.prototype,`maxMultiple`,void 0),K([W({type:Boolean})],ui.prototype,`range`,void 0),K([W({type:String})],ui.prototype,`earliest`,void 0),K([W({type:String})],ui.prototype,`latest`,void 0),K([W({converter:Wr.stringsToDate})],ui.prototype,`excludedates`,void 0),K([W({converter:Wr.csvToArray})],ui.prototype,`excludeweekdays`,void 0),K([W({type:Boolean})],ui.prototype,`weeknumbers`,void 0),K([W({type:Boolean})],ui.prototype,`withcontrols`,void 0),K([W({converter:Wr.stringToDate})],ui.prototype,`currentmonth`,void 0),K([W({type:String})],ui.prototype,`today`,void 0),K([W({type:Array,attribute:`day-strings`})],ui.prototype,`dayStrings`,void 0),K([W({type:Array,attribute:`day-strings-long`})],ui.prototype,`dayStringsLong`,void 0),K([W({type:Array,attribute:`month-strings`})],ui.prototype,`monthStrings`,void 0),K([W({type:String,attribute:`week-string`})],ui.prototype,`weekString`,void 0),K([W({type:String,attribute:`prev-month-string`})],ui.prototype,`prevMonthString`,void 0),K([W({type:String,attribute:`next-month-string`})],ui.prototype,`nextMonthString`,void 0),K([W({type:Array})],ui.prototype,`_selected`,void 0),K([G()],ui.prototype,`inRange`,void 0),K([W({type:Date})],ui.prototype,`rangeHovered`,void 0),K([W({type:Number})],ui.prototype,`year`,void 0),K([W({type:Number})],ui.prototype,`month`,void 0),K([W({type:Number})],ui.prototype,`week`,void 0),K([G()],ui.prototype,`currentmonthtouched`,void 0),K([G()],ui.prototype,`focusedDate`,void 0);try{U(`pkt-calendar`)(ui)}catch{console.warn(`Forsøker å definere <pkt-calendar>, men den er allerede definert`)}var di={name:`pkt-tag`,react:`PktTag`,"css-class":`pkt-tag`,isElement:!0,"dark-mode":!0,props:{size:{name:`Størrelse`,description:`Størrelsen på taggen`,required:!1,default:`medium`,type:[`small`,`medium`,`large`],category:`ui`},iconName:{name:`Ikon`,description:`Navnet på ikonet som skal vises i taggen`,type:`icon`,required:!1,category:`ui`},skin:{name:`Utseende`,description:`Utseendet til taggen`,required:!1,default:`blue`,type:[`blue`,`blue-light`,`blue-dark`,`green`,`red`,`beige`,`yellow`,`gray`],category:`ui`},closeTag:{name:`Lukk tag`,description:`Skal taggen ha en lukkeknapp?`,type:`boolean`,required:!1,default:!1,category:`ui`},textStyle:{name:`Tekststil`,description:`Stilen på teksten i taggen`,required:!1,default:`normal-text`,type:[`thin-text`,`normal-text`],category:`ui`},type:{name:`Type, dersom lukkeknapp`,description:`Type tag, brukes for å spesifisere om det er en knapp, submit eller reset`,required:!1,default:`button`,type:[`button`,`submit`,`reset`],category:`tech`},ariaLabel:{name:`aria-label`,description:`aria-label for taggen, brukes for tilgjengelighet`,type:`string`,required:!1,category:`accessibility`}},slots:{default:{description:`Teksten til tag`}}},fi=class extends Dt{constructor(){super(),this.closeTag=di.props.closeTag.default,this.size=di.props.size.default,this.skin=di.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=di.props.type.default,this.ariaLabel=null,this.buttonTabindex=void 0,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._isClosed=!1}firstUpdated(e){if(super.firstUpdated(e),this.closeTag&&!this.ariaLabel){let e=this.querySelector(`button span, .pkt-tag > span`)?.textContent?.trim();e&&(this._ariaDescription=`Klikk for å fjerne ${e}`)}}render(){let 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?j`
271
+ </td>`}renderWeekRow(e){return j`<tr class="pkt-cal-week-row" role="row">${e}</tr>`}renderCalendarBody(){let e=this.todayDate,t=Zr(this.year,this.month);this.selectableDates=[],this.tabIndexSet=0;let n=1;this.week=t.initialWeek;let r=[];for(let i=0;i<t.numRows;i++){let a=[];this.weeknumbers&&a.push(j`<td class="pkt-cal-week">${this.week}</td>`),this.week++;for(let r=0;r<7;r++){let o=Qr(i,r,n,t);if(o===`current-month`)a.push(this.renderDayView(n,e)),n++;else{let e=$r(o,r,n,t);a.push(this.renderEmptyDayCell(e)),o===`next-month`&&n++}}r.push(this.renderWeekRow(a))}return r}isExcluded(e){return qr(e,this.getDateConstraints())}isPrevMonthAllowed(){return Yr(this.year,this.month,this.earliest)}prevMonth(){let e=this.month===0?11:this.month-1,t=this.month===0?this.year-1:this.year;this.changeMonth(t,e)}isNextMonthAllowed(){return Xr(this.year,this.month,this.latest)}nextMonth(){let 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=Mr(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=ri(e,this.normalizeSelected()),this._selected=ei(this.selected),this.range&&this.selected.length===2&&(this.convertSelected(),this.close())}removeFromSelected(e){this.selected=ii(e,this.normalizeSelected()),this._selected=ei(this.selected)}toggleSelected(e){this.selected=ai(e,this.normalizeSelected(),this.maxMultiple),this._selected=ei(this.selected)}isRangeAllowed(e){return ni(e,this._selected,this.excludedates,this.excludeweekdays)}handleRangeSelect(e){return this.selected=oi(e,this.normalizeSelected(),{excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}),this._selected=ei(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=ti(this._selected[0],e)}handleDateSelect(e){return e?(this.range?this.handleRangeSelect(e):this.multiple?this.toggleSelected(e):(this.selected.includes(Dr(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()):Promise.resolve()}focusOnCurrentDate(){let e=Dr(Mr(this.todayDate)),t=this.querySelector(`button[data-date="${e}"]`);if(t instanceof HTMLButtonElement){this.focusedDate=e,t.focus();return}let n=this.selectableDates.find(e=>!e.isDisabled);if(n){let e=this.querySelector(`button[data-date="${n.currentDateISO}"]`);e instanceof HTMLButtonElement&&(this.focusedDate=n.currentDateISO,e.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}))}};G([U({converter:Gr.csvToArray})],di.prototype,`selected`,void 0),G([U({type:Boolean})],di.prototype,`multiple`,void 0),G([U({type:Number,attribute:`max-multiple`})],di.prototype,`maxMultiple`,void 0),G([U({type:Boolean})],di.prototype,`range`,void 0),G([U({type:String})],di.prototype,`earliest`,void 0),G([U({type:String})],di.prototype,`latest`,void 0),G([U({converter:Gr.stringsToDate})],di.prototype,`excludedates`,void 0),G([U({converter:Gr.csvToArray})],di.prototype,`excludeweekdays`,void 0),G([U({type:Boolean})],di.prototype,`weeknumbers`,void 0),G([U({type:Boolean})],di.prototype,`withcontrols`,void 0),G([U({converter:Gr.stringToDate})],di.prototype,`currentmonth`,void 0),G([U({type:String})],di.prototype,`today`,void 0),G([U({type:Array,attribute:`day-strings`})],di.prototype,`dayStrings`,void 0),G([U({type:Array,attribute:`day-strings-long`})],di.prototype,`dayStringsLong`,void 0),G([U({type:Array,attribute:`month-strings`})],di.prototype,`monthStrings`,void 0),G([U({type:String,attribute:`week-string`})],di.prototype,`weekString`,void 0),G([U({type:String,attribute:`prev-month-string`})],di.prototype,`prevMonthString`,void 0),G([U({type:String,attribute:`next-month-string`})],di.prototype,`nextMonthString`,void 0),G([U({type:Array})],di.prototype,`_selected`,void 0),G([W()],di.prototype,`inRange`,void 0),G([U({type:Date})],di.prototype,`rangeHovered`,void 0),G([U({type:Number})],di.prototype,`year`,void 0),G([U({type:Number})],di.prototype,`month`,void 0),G([U({type:Number})],di.prototype,`week`,void 0),G([W()],di.prototype,`currentmonthtouched`,void 0),G([W()],di.prototype,`focusedDate`,void 0);try{H(`pkt-calendar`)(di)}catch{console.warn(`Forsøker å definere <pkt-calendar>, men den er allerede definert`)}var fi={name:`pkt-tag`,react:`PktTag`,"css-class":`pkt-tag`,isElement:!0,"dark-mode":!0,props:{size:{name:`Størrelse`,description:`Størrelsen på taggen`,required:!1,default:`medium`,type:[`small`,`medium`,`large`],category:`ui`},iconName:{name:`Ikon`,description:`Navnet på ikonet som skal vises i taggen`,type:`icon`,required:!1,category:`ui`},skin:{name:`Utseende`,description:`Utseendet til taggen`,required:!1,default:`blue`,type:[`blue`,`blue-light`,`blue-dark`,`green`,`red`,`beige`,`yellow`,`gray`],category:`ui`},closeTag:{name:`Lukk tag`,description:`Skal taggen ha en lukkeknapp?`,type:`boolean`,required:!1,default:!1,category:`ui`},textStyle:{name:`Tekststil`,description:`Stilen på teksten i taggen`,required:!1,default:`normal-text`,type:[`thin-text`,`normal-text`],category:`ui`},type:{name:`Type, dersom lukkeknapp`,description:`Type tag, brukes for å spesifisere om det er en knapp, submit eller reset`,required:!1,default:`button`,type:[`button`,`submit`,`reset`],category:`tech`},ariaLabel:{name:`aria-label`,description:`aria-label for taggen, brukes for tilgjengelighet`,type:`string`,required:!1,category:`accessibility`}},slots:{default:{description:`Teksten til tag`}}},pi=class extends Ot{constructor(){super(),this.closeTag=fi.props.closeTag.default,this.size=fi.props.size.default,this.skin=fi.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=fi.props.type.default,this.ariaLabel=null,this.buttonTabindex=void 0,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._isClosed=!1}firstUpdated(e){if(super.firstUpdated(e),this.closeTag&&!this.ariaLabel){let e=this.querySelector(`button span, .pkt-tag > span`)?.textContent?.trim();e&&(this._ariaDescription=`Klikk for å fjerne ${e}`)}}render(){let 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?j`
272
272
  <button
273
- class=${q(t)}
273
+ class=${K(t)}
274
274
  type=${this.type}
275
- tabindex=${J(this.buttonTabindex)}
275
+ tabindex=${q(this.buttonTabindex)}
276
276
  @click=${this.close}
277
- aria-label=${J(this.ariaLabel||void 0)}
278
- aria-description=${J(this._ariaDescription||void 0)}
277
+ aria-label=${q(this.ariaLabel||void 0)}
278
+ aria-description=${q(this._ariaDescription||void 0)}
279
279
  >
280
280
  ${this.iconName&&j`<pkt-icon
281
281
  class="pkt-tag__icon"
282
282
  name=${this.iconName}
283
283
  aria-hidden="true"
284
284
  ></pkt-icon>`}
285
- <span>${Et(this)}</span>
285
+ <span>${Dt(this)}</span>
286
286
  <pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
287
287
  </button>
288
288
  `:j`
289
- <span class=${q(e)}>
289
+ <span class=${K(e)}>
290
290
  ${this.iconName&&j`<pkt-icon
291
291
  class="pkt-tag__icon"
292
292
  name=${this.iconName}
293
293
  aria-hidden="true"
294
294
  ></pkt-icon>`}
295
- <span>${Et(this)}</span>
295
+ <span>${Dt(this)}</span>
296
296
  </span>
297
- `}};K([W({type:Boolean,reflect:!0})],fi.prototype,`closeTag`,void 0),K([W({type:String,reflect:!0})],fi.prototype,`size`,void 0),K([W({type:String,reflect:!0})],fi.prototype,`skin`,void 0),K([W({type:String,reflect:!0})],fi.prototype,`textStyle`,void 0),K([W({type:String,reflect:!0})],fi.prototype,`iconName`,void 0),K([W({type:String})],fi.prototype,`type`,void 0),K([W({type:String})],fi.prototype,`ariaLabel`,void 0),K([W({type:Number,attribute:`button-tabindex`})],fi.prototype,`buttonTabindex`,void 0),K([G()],fi.prototype,`_isClosed`,void 0),K([G()],fi.prototype,`_ariaDescription`,void 0);try{U(`pkt-tag`)(fi)}catch{console.warn(`Forsøker å definere <pkt-tag>, men den er allerede definert`)}var pi=class extends Je{constructor(...e){super(...e),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,n){super.attributeChangedCallback(e,t,n),e===`level`&&n&&this.setLevel(Number(n)),e===`visuallyHidden`&&(this.visuallyHidden=n!==null&&n!==`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 j`<slot></slot>`}};K([W({type:String,reflect:!0})],pi.prototype,`size`,void 0),K([W({type:Number,reflect:!0})],pi.prototype,`level`,void 0),K([W({type:String,reflect:!0})],pi.prototype,`weight`,void 0),K([W({type:Boolean,reflect:!0})],pi.prototype,`visuallyHidden`,void 0),K([W({type:String,reflect:!0})],pi.prototype,`align`,void 0);try{U(`pkt-heading`)(pi)}catch{console.warn(`Forsøker å definere <pkt-heading>, men den er allerede definert`)}var mi={name:`pkt-card`,react:`PktCard`,"css-class":`pkt-card`,isElement:!0,isPureReact:!0,"dark-mode":!0,props:{heading:{type:`string`,name:`Overskrift`,description:`Tittel på card`,category:`contents`},headingLevel:{type:[1,2,3,4,5,6],name:`Overskriftsnivå`,description:`Nivået på headingen. Brukes for tilgjengelighet.`,default:3,category:`accessibility`},subheading:{type:`string`,name:`Undertittel`,description:`Undertittel på card`,category:`contents`},layout:{type:[`vertical`,`horizontal`],name:`Layout`,description:`Horisontal eller vertikal layout. Ved horisontal layout vil bildet være plassert til venstre for teksten på desktop, og over teksten på mobil.`,default:`vertical`,category:`ui`},skin:{type:[`outlined`,`outlined-beige`,`gray`,`blue`,`beige`,`green`],name:`Utseende`,description:`Fargen på card. Velg mellom outlined, outlined-beige, gray, blue, beige og green. Ved padding=none er det ikke mulighet for outlined-skin. Card med kombinasjonen av propsene padding=none + layout=vertical vil alltid være transparante.`,default:`outlined`,category:`ui`},padding:{type:[`none`,`default`],name:`Padding`,description:`Padding rundt card. Ved "none" strekker innholdet i card seg ut til kantene, og dette er derfor ikke mulig å kombinere med outlined skin.`,default:`default`,category:`ui`},metaLead:{type:`string`,name:`Forfatter eller annen metadata`,description:`Undertekst med fet skriftvekt`,default:!1,category:`contents`},metaTrail:{type:`string`,name:`Dato eller annen metadata`,description:`Undertekst med normal skriftvekt`,default:!1,category:`contents`},tagPosition:{type:[`top`,`bottom`],name:`Tagplassering`,description:`Plassering av tags i card`,default:`top`,category:`ui`},clickCardlink:{type:`string`,name:`Lenke for klikkbart card`,description:`Href sendes inn som streng for å gjøre card klikkbart. Ved bruk MÅ heading sendes inn da denne vil brukes som lenketekst i klikkbart card.`,category:`contents`},openLinkInNewTab:{type:`boolean`,name:`Åpne i ny fane`,description:`Velg denne dersom du ønsker at lenken i card skal åpnes i ny fane.`,default:!1,category:`tech`},borderOnHover:{type:`boolean`,name:`Hover border for klikkbart card`,description:`Vi anbefaler hoverborder på klikkbart card. Kan slås av ved behov.`,default:!0,category:`ui`},image:{type:`object`,name:`Bilde`,description:`Bildet på card. Tar inn et objekt av typen {src: string, alt: string}.`,properties:{src:{type:`string`,description:`Stien til bildet`,required:!0},alt:{type:`string`,description:`Tekst til skjermleser. Skal kun sendes inn for bilder som ikke er dekorative`,required:!1}},category:`contents`},imageShape:{type:[`square`,`round`],name:`Bildeform`,description:`Valg for om bildet skal ha rektangulær eller rund form.`,default:`square`,category:`contents`},tags:{type:`array`,description:`Liste av tags på card. Tar inn et array med objekter med følgende stringproperties: skin, iconName, ariaLabel, text`,name:`Tags`,items:{type:`object`,name:`Tag`,properties:{skin:{type:[`blue`,`green`,`red`,`yellow`],description:`Farge på tag`},iconName:{type:`icon`,description:`Id på ikonet du ønsker å bruke til tag`},ariaLabel:{type:`string`,description:`Tekst for aria-label`},text:{type:`string`,description:`Tekst på tag`,required:!0}}},category:`contents`},ariaLabel:{type:`string`,name:`Aria-label for card`,description:`Tekst til skjermleser for aria-label på card. Settes automatisk til headingen, eller subheadingen der heading ikke eksisterer. Ved bruk av klikkbart card må heading alltid sendes inn da denne brukes som lenketekst.`,category:`accessibility`}},slots:{default:{description:`Innholdet i card`}}},hi=class extends Dt{constructor(...e){super(...e),this.ariaLabel=``,this.metaLead=null,this.borderOnHover=!0,this.clickCardLink=null,this.metaTrail=null,this.layout=mi.props.layout.default,this.heading=``,this.headinglevel=3,this.image={src:``,alt:``},this.imageShape=`square`,this.openLinkInNewTab=!1,this.padding=mi.props.padding.default,this.skin=mi.props.skin.default,this.subheading=``,this.tagPosition=`top`,this.tags=[]}connectedCallback(){super.connectedCallback()}render(){let e={"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},t=this.ariaLabel?.trim()||(this.heading?`${this.heading} lenkekort`:`lenkekort`),n=this.ariaLabel?.trim()||(this.heading?this.heading:`kort`);return j`
297
+ `}};G([U({type:Boolean,reflect:!0})],pi.prototype,`closeTag`,void 0),G([U({type:String,reflect:!0})],pi.prototype,`size`,void 0),G([U({type:String,reflect:!0})],pi.prototype,`skin`,void 0),G([U({type:String,reflect:!0})],pi.prototype,`textStyle`,void 0),G([U({type:String,reflect:!0})],pi.prototype,`iconName`,void 0),G([U({type:String})],pi.prototype,`type`,void 0),G([U({type:String})],pi.prototype,`ariaLabel`,void 0),G([U({type:Number,attribute:`button-tabindex`})],pi.prototype,`buttonTabindex`,void 0),G([W()],pi.prototype,`_isClosed`,void 0),G([W()],pi.prototype,`_ariaDescription`,void 0);try{H(`pkt-tag`)(pi)}catch{console.warn(`Forsøker å definere <pkt-tag>, men den er allerede definert`)}var mi=class extends Ye{constructor(...e){super(...e),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,n){super.attributeChangedCallback(e,t,n),e===`level`&&n&&this.setLevel(Number(n)),e===`visuallyHidden`&&(this.visuallyHidden=n!==null&&n!==`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 j`<slot></slot>`}};G([U({type:String,reflect:!0})],mi.prototype,`size`,void 0),G([U({type:Number,reflect:!0})],mi.prototype,`level`,void 0),G([U({type:String,reflect:!0})],mi.prototype,`weight`,void 0),G([U({type:Boolean,reflect:!0})],mi.prototype,`visuallyHidden`,void 0),G([U({type:String,reflect:!0})],mi.prototype,`align`,void 0);try{H(`pkt-heading`)(mi)}catch{console.warn(`Forsøker å definere <pkt-heading>, men den er allerede definert`)}var hi={name:`pkt-card`,react:`PktCard`,"css-class":`pkt-card`,isElement:!0,isPureReact:!0,"dark-mode":!0,props:{heading:{type:`string`,name:`Overskrift`,description:`Tittel på card`,category:`contents`},headingLevel:{type:[1,2,3,4,5,6],name:`Overskriftsnivå`,description:`Nivået på headingen. Brukes for tilgjengelighet.`,default:3,category:`accessibility`},subheading:{type:`string`,name:`Undertittel`,description:`Undertittel på card`,category:`contents`},layout:{type:[`vertical`,`horizontal`],name:`Layout`,description:`Horisontal eller vertikal layout. Ved horisontal layout vil bildet være plassert til venstre for teksten på desktop, og over teksten på mobil.`,default:`vertical`,category:`ui`},skin:{type:[`outlined`,`outlined-beige`,`gray`,`blue`,`beige`,`green`],name:`Utseende`,description:`Fargen på card. Velg mellom outlined, outlined-beige, gray, blue, beige og green. Ved padding=none er det ikke mulighet for outlined-skin. Card med kombinasjonen av propsene padding=none + layout=vertical vil alltid være transparante.`,default:`outlined`,category:`ui`},padding:{type:[`none`,`default`],name:`Padding`,description:`Padding rundt card. Ved "none" strekker innholdet i card seg ut til kantene, og dette er derfor ikke mulig å kombinere med outlined skin.`,default:`default`,category:`ui`},metaLead:{type:`string`,name:`Forfatter eller annen metadata`,description:`Undertekst med fet skriftvekt`,default:!1,category:`contents`},metaTrail:{type:`string`,name:`Dato eller annen metadata`,description:`Undertekst med normal skriftvekt`,default:!1,category:`contents`},tagPosition:{type:[`top`,`bottom`],name:`Tagplassering`,description:`Plassering av tags i card`,default:`top`,category:`ui`},clickCardlink:{type:`string`,name:`Lenke for klikkbart card`,description:`Href sendes inn som streng for å gjøre card klikkbart. Ved bruk MÅ heading sendes inn da denne vil brukes som lenketekst i klikkbart card.`,category:`contents`},openLinkInNewTab:{type:`boolean`,name:`Åpne i ny fane`,description:`Velg denne dersom du ønsker at lenken i card skal åpnes i ny fane.`,default:!1,category:`tech`},borderOnHover:{type:`boolean`,name:`Hover border for klikkbart card`,description:`Vi anbefaler hoverborder på klikkbart card. Kan slås av ved behov.`,default:!0,category:`ui`},image:{type:`object`,name:`Bilde`,description:`Bildet på card. Tar inn et objekt av typen {src: string, alt: string}.`,properties:{src:{type:`string`,description:`Stien til bildet`,required:!0},alt:{type:`string`,description:`Tekst til skjermleser. Skal kun sendes inn for bilder som ikke er dekorative`,required:!1}},category:`contents`},imageShape:{type:[`square`,`round`],name:`Bildeform`,description:`Valg for om bildet skal ha rektangulær eller rund form.`,default:`square`,category:`contents`},tags:{type:`array`,description:`Liste av tags på card. Tar inn et array med objekter med følgende stringproperties: skin, iconName, ariaLabel, text`,name:`Tags`,items:{type:`object`,name:`Tag`,properties:{skin:{type:[`blue`,`green`,`red`,`yellow`],description:`Farge på tag`},iconName:{type:`icon`,description:`Id på ikonet du ønsker å bruke til tag`},ariaLabel:{type:`string`,description:`Tekst for aria-label`},text:{type:`string`,description:`Tekst på tag`,required:!0}}},category:`contents`},ariaLabel:{type:`string`,name:`Aria-label for card`,description:`Tekst til skjermleser for aria-label på card. Settes automatisk til headingen, eller subheadingen der heading ikke eksisterer. Ved bruk av klikkbart card må heading alltid sendes inn da denne brukes som lenketekst.`,category:`accessibility`}},slots:{default:{description:`Innholdet i card`}}},gi=class extends Ot{constructor(...e){super(...e),this.ariaLabel=``,this.metaLead=null,this.borderOnHover=!0,this.clickCardLink=null,this.metaTrail=null,this.layout=hi.props.layout.default,this.heading=``,this.headinglevel=3,this.image={src:``,alt:``},this.imageShape=`square`,this.openLinkInNewTab=!1,this.padding=hi.props.padding.default,this.skin=hi.props.skin.default,this.subheading=``,this.tagPosition=`top`,this.tags=[]}connectedCallback(){super.connectedCallback()}render(){let e={"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},t=this.ariaLabel?.trim()||(this.heading?`${this.heading} lenkekort`:`lenkekort`),n=this.ariaLabel?.trim()||(this.heading?this.heading:`kort`);return j`
298
298
  <article
299
- class=${q(e)}
300
- aria-label=${J(this.clickCardLink?t:n)}
299
+ class=${K(e)}
300
+ aria-label=${q(this.clickCardLink?t:n)}
301
301
  >
302
302
  ${this.renderImage()}
303
303
  <div class="pkt-card__wrapper">
@@ -310,7 +310,7 @@
310
310
  </article>
311
311
  `}renderImage(){let e={"pkt-card__image":!0,[`pkt-card__image-${this.imageShape}`]:this.imageShape};return j`
312
312
  ${this.image.src&&j`
313
- <div class=${q(e)}>
313
+ <div class=${K(e)}>
314
314
  <img src=${this.image.src} alt=${this.image.alt||``} />
315
315
  </div>
316
316
  `}
@@ -356,7 +356,7 @@
356
356
  `}renderTags(){let e={"pkt-card__tags":!0,[`pkt-card__tags-${this.tagPosition}`]:this.tagPosition};return j`
357
357
  ${this.tags.length>0?j`
358
358
  <div
359
- class=${q(e)}
359
+ class=${K(e)}
360
360
  role="list"
361
361
  aria-label=${this.tags.length>1?`merkelapper`:`merkelapp`}
362
362
  >
@@ -365,27 +365,27 @@
365
365
  role="listitem"
366
366
  textStyle="normal-text"
367
367
  size="medium"
368
- skin=${J(e.skin)}
369
- iconName=${J(e.iconName)}
368
+ skin=${q(e.skin)}
369
+ iconName=${q(e.iconName)}
370
370
  >
371
371
  <span>${e.text}</span>
372
372
  </pkt-tag>
373
373
  `)}
374
374
  </div>
375
375
  `:N}
376
- `}renderSlot(){return j`<section class="pkt-card__content">${Et(this)}</section>`}renderMetadata(){return j`
376
+ `}renderSlot(){return j`<section class="pkt-card__content">${Dt(this)}</section>`}renderMetadata(){return j`
377
377
  ${this.metaLead||this.metaTrail?j`
378
378
  <footer class="pkt-card__metadata">
379
379
  ${this.metaLead?j`<span class="pkt-card__metadata-lead">${this.metaLead}</span>`:N}
380
380
  ${this.metaTrail?j`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>`:N}
381
381
  </footer>
382
382
  `:N}
383
- `}};K([W({type:String})],hi.prototype,`ariaLabel`,void 0),K([W({type:String})],hi.prototype,`metaLead`,void 0),K([W({type:Boolean})],hi.prototype,`borderOnHover`,void 0),K([W({type:String,reflect:!0})],hi.prototype,`clickCardLink`,void 0),K([W({type:String})],hi.prototype,`metaTrail`,void 0),K([W({type:String})],hi.prototype,`layout`,void 0),K([W({type:String})],hi.prototype,`heading`,void 0),K([W({type:Number})],hi.prototype,`headinglevel`,void 0),K([W({type:Object})],hi.prototype,`image`,void 0),K([W({type:String})],hi.prototype,`imageShape`,void 0),K([W({type:Boolean})],hi.prototype,`openLinkInNewTab`,void 0),K([W({type:String})],hi.prototype,`padding`,void 0),K([W({type:String,converter:{fromAttribute:e=>{let t=mi.props.skin.type;return e&&t.includes(e)?e:(e&&!t.includes(e)&&console.warn(`Invalid skin value "${e}". Using default skin "${mi.props.skin.default}".`),mi.props.skin.default)},toAttribute:e=>e}})],hi.prototype,`skin`,void 0),K([W({type:String})],hi.prototype,`subheading`,void 0),K([W({type:String})],hi.prototype,`tagPosition`,void 0),K([W({type:Array})],hi.prototype,`tags`,void 0);try{U(`pkt-card`)(hi)}catch{console.warn(`Forsøker å definere <pkt-card>, men den er allerede definert`)}var gi=(e,t,n)=>{let r=new Map;for(let i=t;i<=n;i++)r.set(e[i],i);return r},_i=Ze(class extends Qe{constructor(e){if(super(e),e.type!==Xe.CHILD)throw Error(`repeat() can only be used in text expressions`)}dt(e,t,n){let r;n===void 0?n=t:t!==void 0&&(r=t);let i=[],a=[],o=0;for(let t of e)i[o]=r?r(t,o):o,a[o]=n(t,o),o++;return{values:a,keys:i}}render(e,t,n){return this.dt(e,t,n).values}update(e,[t,n,r]){let i=st(e),{values:a,keys:o}=this.dt(t,n,r);if(!Array.isArray(i))return this.ut=o,a;let s=this.ut??=[],c=[],l,u,d=0,f=i.length-1,p=0,m=a.length-1;for(;d<=f&&p<=m;)if(i[d]===null)d++;else if(i[f]===null)f--;else if(s[d]===o[p])c[p]=it(i[d],a[p]),d++,p++;else if(s[f]===o[m])c[m]=it(i[f],a[m]),f--,m--;else if(s[d]===o[m])c[m]=it(i[d],a[m]),rt(e,c[m+1],i[d]),d++,m--;else if(s[f]===o[p])c[p]=it(i[f],a[p]),rt(e,i[d],i[f]),f--,p++;else if(l===void 0&&(l=gi(o,p,m),u=gi(s,d,f)),l.has(s[d]))if(l.has(s[f])){let t=u.get(o[p]),n=t===void 0?null:i[t];if(n===null){let t=rt(e,i[d]);it(t,a[p]),c[p]=t}else c[p]=it(n,a[p]),rt(e,i[d],n),i[t]=null;p++}else ct(i[f]),f--;else ct(i[d]),d++;for(;p<=m;){let t=rt(e,c[m+1]);it(t,a[p]),c[p++]=t}for(;d<=f;){let e=i[d++];e!==null&&ct(e)}return this.ut=o,ot(e,c),M}}),vi=()=>(`00000000000000000`+(Math.random()*0x10000000000000000).toString(16)).slice(-16),yi=e=>new Promise(t=>setTimeout(t,e)),bi=()=>{let e=vi(),t=vi();return e.slice(0,8)+`-`+e.slice(8,12)+`-4`+e.slice(13)+`-a`+t.slice(1,4)+`-`+t.slice(4)},xi=(e,t)=>t&&(e.find(e=>e.value===t)||e.find(e=>e.label===t))||null,Si=(e,t)=>{if(!t)return-1;let n=e.findIndex(e=>e.value===t);return n>=0?n:e.findIndex(e=>e.label===t)},Ci=(e,t)=>{if(!t)return[...e];let n=t.toLowerCase();return e.filter(e=>(e.fulltext||e.value+(e.label||``)+(e.prefix||``)).toLowerCase().includes(n))},wi=e=>e.value+(e.label||``)+(e.prefix||``),Ti=(e,t)=>t!==null&&e>=t,Ei=(e,t)=>{if(!t)return{filtered:[...e],suggestion:null};let n=t.toLowerCase(),r=e.filter(e=>e.fulltext?.toLowerCase().includes(n));return{filtered:r,suggestion:r.find(e=>!e.selected&&e.label?.toLowerCase().startsWith(n))||null}},Di=(e,t,n,r)=>{if(!e.trim())return{addValueText:null,userInfoMessage:``};let i=e.trim().toLowerCase(),a=t.find(e=>e.toLowerCase()===i),o=n.filter(e=>e.label?.toLowerCase().includes(i)||e.value.toLowerCase().includes(i)),s=o.find(e=>e.label?.toLowerCase()===i||e.value.toLowerCase()===i);return(o.length===0||!s)&&r?{addValueText:e,userInfoMessage:``}:o.length===0&&!r?{addValueText:null,userInfoMessage:`Ingen treff i søket`}:a?{addValueText:null,userInfoMessage:`Verdien er allerede valgt`}:{addValueText:null,userInfoMessage:``}},Oi=e=>/^[\p{L} ]$/u.test(e),ki=(e=500)=>{let t=``,n;return{append:r=>(t+=r.toLowerCase(),n!==void 0&&clearTimeout(n),n=setTimeout(()=>{t=``},e),t),reset:()=>{t=``,n!==void 0&&(clearTimeout(n),n=void 0)},getBuffer:()=>t}},Ai=(e,t)=>{let n=t.toLowerCase();return e.findIndex(e=>e.textContent?.trim().toLowerCase().startsWith(n))},ji=e=>{e.scrollIntoView({block:`nearest`}),window.setTimeout(()=>e.focus(),0)},Mi=e=>Array.from(e.querySelectorAll(`[role="option"]:not([data-disabled])`)||[]),Ni=e=>{let t=e.nextElementSibling;t&&ji(t)},Pi=(e,t,n)=>{let r=e.previousElementSibling;if(e.dataset.index===`0`&&n){let e=t.querySelector(`[role="searchbox"]`);e&&ji(e)}else r&&ji(r)},Fi=e=>{let t=Mi(e);t[0]&&ji(t[0])},Ii=e=>{let t=Mi(e),n=t[t.length-1];n&&ji(n)},Li=(e,t)=>{if(t.disabled)return;let n=Mi(e);if(t.allowUserInput&&t.customUserInput){let t=e.querySelector(`[data-type="new-option"]`);if(t){ji(t);return}}let r=n.find(e=>e.dataset.selected===`true`);if(r){ji(r);return}if(t.includeSearch&&!(document.activeElement instanceof HTMLInputElement)){let t=e.querySelector(`[role="searchbox"]`);if(t){window.setTimeout(()=>t.focus(),0);return}}n[0]&&ji(n[0])},Ri=class extends Ye{constructor(...e){super(...e),this.id=bi(),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.typeahead=ki(),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)}disconnectedCallback(){super.disconnectedCallback(),this.typeahead.reset()}updated(e){(e.has(`options`)||e.has(`searchValue`))&&this.filterOptions(),super.updated(e)}attributeChangedCallback(e,t,n){(e===`options`||e===`search-value`)&&this.filterOptions(),super.attributeChangedCallback(e,t,n)}get _hasOptions(){return this._filteredOptions.length>0||this.options.length>0}render(){return j`
383
+ `}};G([U({type:String})],gi.prototype,`ariaLabel`,void 0),G([U({type:String})],gi.prototype,`metaLead`,void 0),G([U({type:Boolean})],gi.prototype,`borderOnHover`,void 0),G([U({type:String,reflect:!0})],gi.prototype,`clickCardLink`,void 0),G([U({type:String})],gi.prototype,`metaTrail`,void 0),G([U({type:String})],gi.prototype,`layout`,void 0),G([U({type:String})],gi.prototype,`heading`,void 0),G([U({type:Number})],gi.prototype,`headinglevel`,void 0),G([U({type:Object})],gi.prototype,`image`,void 0),G([U({type:String})],gi.prototype,`imageShape`,void 0),G([U({type:Boolean})],gi.prototype,`openLinkInNewTab`,void 0),G([U({type:String})],gi.prototype,`padding`,void 0),G([U({type:String,converter:{fromAttribute:e=>{let t=hi.props.skin.type;return e&&t.includes(e)?e:(e&&!t.includes(e)&&console.warn(`Invalid skin value "${e}". Using default skin "${hi.props.skin.default}".`),hi.props.skin.default)},toAttribute:e=>e}})],gi.prototype,`skin`,void 0),G([U({type:String})],gi.prototype,`subheading`,void 0),G([U({type:String})],gi.prototype,`tagPosition`,void 0),G([U({type:Array})],gi.prototype,`tags`,void 0);try{H(`pkt-card`)(gi)}catch{console.warn(`Forsøker å definere <pkt-card>, men den er allerede definert`)}var _i=(e,t,n)=>{let r=new Map;for(let i=t;i<=n;i++)r.set(e[i],i);return r},vi=Qe(class extends $e{constructor(e){if(super(e),e.type!==Ze.CHILD)throw Error(`repeat() can only be used in text expressions`)}dt(e,t,n){let r;n===void 0?n=t:t!==void 0&&(r=t);let i=[],a=[],o=0;for(let t of e)i[o]=r?r(t,o):o,a[o]=n(t,o),o++;return{values:a,keys:i}}render(e,t,n){return this.dt(e,t,n).values}update(e,[t,n,r]){let i=ct(e),{values:a,keys:o}=this.dt(t,n,r);if(!Array.isArray(i))return this.ut=o,a;let s=this.ut??=[],c=[],l,u,d=0,f=i.length-1,p=0,m=a.length-1;for(;d<=f&&p<=m;)if(i[d]===null)d++;else if(i[f]===null)f--;else if(s[d]===o[p])c[p]=at(i[d],a[p]),d++,p++;else if(s[f]===o[m])c[m]=at(i[f],a[m]),f--,m--;else if(s[d]===o[m])c[m]=at(i[d],a[m]),it(e,c[m+1],i[d]),d++,m--;else if(s[f]===o[p])c[p]=at(i[f],a[p]),it(e,i[d],i[f]),f--,p++;else if(l===void 0&&(l=_i(o,p,m),u=_i(s,d,f)),l.has(s[d]))if(l.has(s[f])){let t=u.get(o[p]),n=t===void 0?null:i[t];if(n===null){let t=it(e,i[d]);at(t,a[p]),c[p]=t}else c[p]=at(n,a[p]),it(e,i[d],n),i[t]=null;p++}else lt(i[f]),f--;else lt(i[d]),d++;for(;p<=m;){let t=it(e,c[m+1]);at(t,a[p]),c[p++]=t}for(;d<=f;){let e=i[d++];e!==null&&lt(e)}return this.ut=o,st(e,c),M}}),yi=()=>(`00000000000000000`+(Math.random()*0x10000000000000000).toString(16)).slice(-16),bi=e=>new Promise(t=>setTimeout(t,e)),xi=()=>{let e=yi(),t=yi();return e.slice(0,8)+`-`+e.slice(8,12)+`-4`+e.slice(13)+`-a`+t.slice(1,4)+`-`+t.slice(4)},Si=(e,t)=>t&&(e.find(e=>e.value===t)||e.find(e=>e.label===t))||null,Ci=(e,t)=>{if(!t)return-1;let n=e.findIndex(e=>e.value===t);return n>=0?n:e.findIndex(e=>e.label===t)},wi=(e,t)=>{if(!t)return[...e];let n=t.toLowerCase();return e.filter(e=>(e.fulltext||e.value+(e.label||``)+(e.prefix||``)).toLowerCase().includes(n))},Ti=e=>e.value+(e.label||``)+(e.prefix||``),Ei=(e,t)=>t!==null&&e>=t,Di=(e,t)=>{if(!t)return{filtered:[...e],suggestion:null};let n=t.toLowerCase(),r=e.filter(e=>e.fulltext?.toLowerCase().includes(n));return{filtered:r,suggestion:r.find(e=>!e.selected&&e.label?.toLowerCase().startsWith(n))||null}},Oi=(e,t,n,r)=>{if(!e.trim())return{addValueText:null,userInfoMessage:``};let i=e.trim().toLowerCase(),a=t.find(e=>e.toLowerCase()===i),o=n.filter(e=>e.label?.toLowerCase().includes(i)||e.value.toLowerCase().includes(i)),s=o.find(e=>e.label?.toLowerCase()===i||e.value.toLowerCase()===i);return(o.length===0||!s)&&r?{addValueText:e,userInfoMessage:``}:o.length===0&&!r?{addValueText:null,userInfoMessage:`Ingen treff i søket`}:a?{addValueText:null,userInfoMessage:`Verdien er allerede valgt`}:{addValueText:null,userInfoMessage:``}},ki=e=>/^[\p{L} ]$/u.test(e),Ai=(e=500)=>{let t=``,n;return{append:r=>(t+=r.toLowerCase(),n!==void 0&&clearTimeout(n),n=setTimeout(()=>{t=``},e),t),reset:()=>{t=``,n!==void 0&&(clearTimeout(n),n=void 0)},getBuffer:()=>t}},ji=(e,t)=>{let n=t.toLowerCase();return e.findIndex(e=>e.textContent?.trim().toLowerCase().startsWith(n))},Mi=e=>{e.scrollIntoView({block:`nearest`}),window.setTimeout(()=>e.focus(),0)},Ni=e=>Array.from(e.querySelectorAll(`[role="option"]:not([data-disabled])`)||[]),Pi=e=>{let t=e.nextElementSibling;t&&Mi(t)},Fi=(e,t,n)=>{let r=e.previousElementSibling;if(e.dataset.index===`0`&&n){let e=t.querySelector(`[role="searchbox"]`);e&&Mi(e)}else r&&Mi(r)},Ii=e=>{let t=Ni(e);t[0]&&Mi(t[0])},Li=e=>{let t=Ni(e),n=t[t.length-1];n&&Mi(n)},Ri=(e,t)=>{if(t.disabled)return;let n=Ni(e);if(t.allowUserInput&&t.customUserInput){let t=e.querySelector(`[data-type="new-option"]`);if(t){Mi(t);return}}let r=n.find(e=>e.dataset.selected===`true`);if(r){Mi(r);return}if(t.includeSearch&&!(document.activeElement instanceof HTMLInputElement)){let t=e.querySelector(`[role="searchbox"]`);if(t){window.setTimeout(()=>t.focus(),0);return}}n[0]&&Mi(n[0])},zi=class extends Xe{constructor(...e){super(...e),this.id=xi(),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.typeahead=Ai(),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)}disconnectedCallback(){super.disconnectedCallback(),this.typeahead.reset()}updated(e){(e.has(`options`)||e.has(`searchValue`))&&this.filterOptions(),super.updated(e)}attributeChangedCallback(e,t,n){(e===`options`||e===`search-value`)&&this.filterOptions(),super.attributeChangedCallback(e,t,n)}get _hasOptions(){return this._filteredOptions.length>0||this.options.length>0}render(){return j`
384
384
  <div
385
- class=${q({"pkt-listbox":!0,"pkt-listbox__open":this.isOpen,"pkt-txt-16-light":!0})}
386
- role=${J(this._hasOptions?`listbox`:void 0)}
387
- aria-multiselectable=${J(this._hasOptions&&this.isMultiSelect?`true`:void 0)}
388
- aria-label=${J(this._hasOptions?this.label??void 0:void 0)}
385
+ class=${K({"pkt-listbox":!0,"pkt-listbox__open":this.isOpen,"pkt-txt-16-light":!0})}
386
+ role=${q(this._hasOptions?`listbox`:void 0)}
387
+ aria-multiselectable=${q(this._hasOptions&&this.isMultiSelect?`true`:void 0)}
388
+ aria-label=${q(this._hasOptions?this.label??void 0:void 0)}
389
389
  >
390
390
  <div class="pkt-listbox__banners">
391
391
  ${this.renderSearch()} ${this.renderMaximumReachedBanner()} ${this.renderUserMessage()}
@@ -416,12 +416,12 @@
416
416
  ></pkt-icon>
417
417
  Tom liste
418
418
  </div>`}renderList(){return j`
419
- ${_i(this._filteredOptions,e=>e.value,(e,t)=>j`
419
+ ${vi(this._filteredOptions,e=>e.value,(e,t)=>j`
420
420
  <li
421
421
  @click=${()=>{this.toggleOption(e)}}
422
422
  aria-selected=${e.selected?`true`:`false`}
423
423
  @keydown=${this.handleOptionKeydown}
424
- class=${q({"pkt-listbox__option":!0,"pkt-listbox__option--selected":!!(!this.isMultiSelect&&e.selected),"pkt-listbox__option--checkBox":this.isMultiSelect})}
424
+ class=${K({"pkt-listbox__option":!0,"pkt-listbox__option--selected":!!(!this.isMultiSelect&&e.selected),"pkt-listbox__option--checkBox":this.isMultiSelect})}
425
425
  tabindex="${this.disabled||e.disabled?`-1`:`0`}"
426
426
  data-index=${t}
427
427
  data-value=${e.value}
@@ -475,7 +475,7 @@
475
475
  type="text"
476
476
  aria-label="Søk i listen"
477
477
  form=""
478
- placeholder=${this.searchPlaceholder||qe.forms.search.placeholder}
478
+ placeholder=${this.searchPlaceholder||Je.forms.search.placeholder}
479
479
  @input=${this.handleSearchInput}
480
480
  @keydown=${this.handleSearchKeydown}
481
481
  .value=${this.searchValue}
@@ -485,10 +485,10 @@
485
485
  role="searchbox"
486
486
  />
487
487
  </div>
488
- `:N}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`:this.focusFirstOrSelectedOption();break;case`Tab`:this.tabClose();break}}handleOptionKeydown(e){let t=e.currentTarget,n=t.dataset.value,r=t.dataset.type,i=t.dataset.selected===`true`;if(!(!Mi(this).length&&(!this.customUserInput||!this.allowUserInput&&this.customUserInput)&&r!==`new-option`&&r!==`searchbox`))switch(e.key){case` `:case`Enter`:this.toggleOption(t),e.preventDefault();break;case`Backspace`:n&&(i?this.toggleOption(t):this.closeOptions()),e.preventDefault();break;case`Escape`:this.closeOptions(),e.preventDefault();break;case`Tab`:this.tabClose();break;case`ArrowDown`:e.altKey?Ii(this):r===`searchbox`||r===`new-option`?Fi(this):Ni(t),e.preventDefault();break;case`ArrowUp`:if(e.altKey)Fi(this);else if(t.dataset.index===`0`&&this.includeSearch){let e=this.querySelector(`[role="searchbox"]`);e&&e.focus()}else if(t.dataset.index===`0`&&this.customUserInput){let e=this.querySelector(`[data-type="new-option"]`);e&&e.focus()}else Pi(t,this,this.includeSearch);e.preventDefault();break;case`Home`:Fi(this),e.preventDefault();break;case`End`:Ii(this),e.preventDefault();break;default:(e.metaKey||e.ctrlKey)&&e.key===`a`&&(this.selectAll(),e.preventDefault()),Oi(e.key)&&(this.handleTypeAhead(e.key),e.preventDefault());break}}focusFirstOrSelectedOption(){Li(this,{disabled:this.disabled,allowUserInput:this.allowUserInput,customUserInput:this.customUserInput,includeSearch:this.includeSearch})}toggleOption(e){let t=e instanceof HTMLElement?e.dataset.disabled:e.disabled;if(this.disabled||t)return;let n=e instanceof HTMLElement?e.dataset.value:e.value;this.dispatchEvent(new CustomEvent(`option-toggle`,{detail:n,bubbles:!1}))}selectAll(){this.dispatchEvent(new CustomEvent(`select-all`,{bubbles:!1}))}closeOptions(){this.dispatchEvent(new CustomEvent(`close-options`,{bubbles:!1}))}tabClose(){this.dispatchEvent(new CustomEvent(`tab-close`,{bubbles:!1}))}filterOptions(){this._filteredOptions=Ci(this.options,this.searchValue)}handleTypeAhead(e){let t=this.typeahead.append(e),n=Mi(this),r=Ai(n,t);r>=0&&ji(n[r])}};K([W({type:String})],Ri.prototype,`id`,void 0),K([W({type:String})],Ri.prototype,`label`,void 0),K([W({type:Array})],Ri.prototype,`options`,void 0),K([W({type:Boolean,reflect:!0,attribute:`is-open`})],Ri.prototype,`isOpen`,void 0),K([W({type:Boolean})],Ri.prototype,`disabled`,void 0),K([W({type:Boolean,attribute:`include-search`})],Ri.prototype,`includeSearch`,void 0),K([W({type:Boolean,attribute:`is-multi-select`})],Ri.prototype,`isMultiSelect`,void 0),K([W({type:Boolean,attribute:`allow-user-input`})],Ri.prototype,`allowUserInput`,void 0),K([W({type:Boolean,attribute:`max-is-reached`})],Ri.prototype,`maxIsReached`,void 0),K([W({type:String,attribute:`custom-user-input`})],Ri.prototype,`customUserInput`,void 0),K([W({type:String,attribute:`search-placeholder`})],Ri.prototype,`searchPlaceholder`,void 0),K([W({type:String,attribute:`search-value`})],Ri.prototype,`searchValue`,void 0),K([W({type:Number,attribute:`max-length`})],Ri.prototype,`maxLength`,void 0),K([W({type:String,attribute:`user-message`})],Ri.prototype,`userMessage`,void 0),K([G()],Ri.prototype,`_filteredOptions`,void 0);try{U(`pkt-listbox`)(Ri)}catch{console.warn(`Forsøker å definere <pkt-listbox>, men den er allerede definert`)}var zi={fromAttribute(e){return e==null?!1:e===``||e===`true`||e===!0?!0:e===`false`||e===!1?!1:!!e},toAttribute(e){return e?`true`:`false`}},Bi={name:`pkt-input-wrapper`,react:`PktInputWrapper`,"css-class":`pkt-inputwrapper`,isElement:!0,isPureReact:!0,events:{toggleHelpText:{description:`Event for å vise eller skjule hjelpetekst i dropdown`}},slots:{default:{description:`Innholdet i input-wrapperen, som kan være et skjemaelement eller en annen komponent`}},props:{forId:{name:`For ID`,description:`Id-en til skjemaelementet som dette wrapper rundt`,type:`string`,required:!0,category:`tech`},label:{name:`Merkelapp`,description:`Merkelapp for skjemaelementet`,type:`string`,required:!0,category:`contents`},helptext:{name:`Hjelpetekst`,description:`Hjelpetekst for skjemaelementet`,type:`string`,category:`contents`},helptextDropdown:{name:`Hjelpetekst i dropdown`,description:`Hjelpetekst som vises i ekspanderende felt`,type:`string`,category:`contents`},helptextDropdownButton:{name:`Tekst i hjelpetekst-knapp`,description:`Tekst som vises i knappen for å vise hjelpetekst i dropdown`,default:`Les mer <span class='pkt-sr-only'>om feltet</span>`,type:`string`,category:`contents`},ariaDescribedby:{name:`aria-describedby`,description:`Id-en til elementet som beskriver skjemaelementet`,type:`string`,category:`accessibility`},counter:{name:`Teller`,description:`Teller for antall tegn i skjemaelementet`,type:`boolean`,default:!1,category:`ui`},counterCurrent:{name:`Tellerverdi`,description:`Tellerens nåværende verdi`,type:`number`,category:`ui`,showIf:{counter:!0}},counterMaxLength:{name:`Maks tegn i teller`,description:`Maks antall tegn som kan skrives i skjemaelementet`,type:`number`,category:`ui`,showIf:{counter:!0}},counterPosition:{name:`Tellerplassering`,description:`Telleren sin plassering i forhold til elementet`,type:[`top`,`bottom`],default:`bottom`,category:`ui`,showIf:{counter:!0}},optionalTag:{name:`Vise valgfritt-merking`,description:`Viser en merking som indikerer at feltet er valgfritt`,type:`boolean`,default:!1,category:`ui`},optionalText:{name:`Valgfritt-tekst`,description:`Tekst som vises i valgfritt-merkingen`,type:`string`,default:`Valgfritt`,category:`contents`},requiredTag:{name:`Vise påkrevd-merking`,description:`Viser en merking som indikerer at feltet er påkrevd`,type:`boolean`,default:!1,category:`ui`},requiredText:{name:`Påkrevd-tekst`,description:`Tekst som vises i påkrevd-merkingen`,type:`string`,default:`Må fylles ut`,category:`contents`},tagText:{type:`string`,name:`Tag-tekst`,description:`Tekst som vises i en tag ved siden av label`,category:`ui`},hasError:{name:`Feil`,description:`Indikerer at skjemaelementet har en feil`,type:`boolean`,default:!1,category:`ui`},errorMessage:{name:`Feilmelding`,description:`Feilmelding som vises når skjemaelementet har en feil`,type:`string`,category:`contents`},disabled:{name:`Deaktivert`,description:`Indikerer at skjemaelementet er deaktivert`,type:`boolean`,default:!1,category:`tech`},inline:{name:`Inline`,description:`Indikerer at skjemaelementet skal flyte sammen med sidens innhold`,type:`boolean`,default:!1,category:`ui`},hasFieldset:{name:`Er fieldset`,description:`Indikerer at innholdet er et fieldset`,type:`boolean`,default:!1,category:`ui`},useWrapper:{name:`Bruk wrapper`,description:`Indikerer om skjemaelementet skal bruke en wrapper`,type:`boolean`,displayAsFalse:!0,default:!0,category:`ui`},role:{name:`Rolle`,description:`Rollen til elementet`,type:`string`,default:`group`,category:`accessibility`}}};(function(e){let t=new WeakMap,n=new WeakMap,r=new WeakMap,i=new WeakMap,a=new WeakMap,o=new WeakMap,s=new WeakMap,c=new WeakMap,l=new WeakMap,u=new WeakMap,d=new WeakMap,f=new WeakMap,p=new WeakMap,m=new WeakMap,h=new WeakMap,g={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`},_=(e,t)=>{for(let n in g){t[n]=null;let r=null,i=g[n];Object.defineProperty(t,n,{get(){return r},set(n){r=n,e.isConnected?T(e,i,n):u.set(e,t)}})}};function v(e){let t=i.get(e),{form:n}=t;O(e,n,t),D(e,t.labels)}let y=(e,t=!1)=>{let n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return i.has(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),r=n.nextNode(),a=!t||e.disabled;for(;r;)r.formDisabledCallback&&a&&E(r,e.disabled),r=n.nextNode()},b={attributes:!0,attributeFilter:[`disabled`,`name`]},x=de()?new MutationObserver(e=>{for(let t of e){let e=t.target;if(t.attributeName===`disabled`&&(e.constructor.formAssociated?E(e,e.hasAttribute(`disabled`)):e.localName===`fieldset`&&y(e)),t.attributeName===`name`&&e.constructor.formAssociated){let t=i.get(e),n=l.get(e);t.setFormValue(n)}}}):{};function S(e){e.forEach(e=>{let{addedNodes:t,removedNodes:n}=e,a=Array.from(t),o=Array.from(n);a.forEach(e=>{var t;if(i.has(e)&&e.constructor.formAssociated&&v(e),u.has(e)){let t=u.get(e);Object.keys(g).filter(e=>t[e]!==null).forEach(n=>{T(e,g[n],t[n])}),u.delete(e)}if(h.has(e)){let t=h.get(e);T(e,`internals-valid`,t.validity.valid.toString()),T(e,`internals-invalid`,(!t.validity.valid).toString()),T(e,`aria-invalid`,(!t.validity.valid).toString()),h.delete(e)}if(e.localName===`form`){let t=c.get(e),n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return i.has(e)&&e.constructor.formAssociated&&!(t&&t.has(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),r=n.nextNode();for(;r;)v(r),r=n.nextNode()}e.localName===`fieldset`&&((t=x.observe)==null||t.call(x,e,b),y(e,!0))}),o.forEach(e=>{let t=i.get(e);t&&r.get(t)&&te(t),s.has(e)&&s.get(e).disconnect()})})}function C(e){e.forEach(e=>{let{removedNodes:t}=e;t.forEach(t=>{let n=p.get(e.target);i.has(t)&&ue(t),n.disconnect()})})}let w=e=>{var t;let n=new MutationObserver(C);(window==null?void 0:window.ShadyDOM)?.inUse&&e.mode&&e.host&&(e=e.host),(t=n.observe)==null||t.call(n,e,{childList:!0}),p.set(e,n)};de()&&new MutationObserver(S);let ee={childList:!0,subtree:!0},T=(e,t,n)=>{e.getAttribute(t)!==n&&e.setAttribute(t,n)},E=(e,t)=>{e.toggleAttribute(`internals-disabled`,t),t?T(e,`aria-disabled`,`true`):e.removeAttribute(`aria-disabled`),e.formDisabledCallback&&e.formDisabledCallback.apply(e,[t])},te=e=>{r.get(e).forEach(e=>{e.remove()}),r.set(e,[])},ne=(e,t)=>{let n=document.createElement(`input`);return n.type=`hidden`,n.name=e.getAttribute(`name`),e.after(n),r.get(t).push(n),n},re=(e,t)=>{var n;r.set(t,[]),(n=x.observe)==null||n.call(x,e,b)},D=(e,t)=>{if(t.length){Array.from(t).forEach(t=>t.addEventListener(`click`,e.click.bind(e)));let n=t[0].id;t[0].id||(n=`${t[0].htmlFor}_Label`,t[0].id=n),T(e,`aria-labelledby`,n)}},ie=e=>{let t=Array.from(e.elements).filter(e=>!e.tagName.includes(`-`)&&e.validity).map(e=>e.validity.valid),n=c.get(e)||[],r=Array.from(n).filter(e=>e.isConnected).map(e=>i.get(e).validity.valid),a=[...t,...r].includes(!1);e.toggleAttribute(`internals-invalid`,a),e.toggleAttribute(`internals-valid`,!a)},ae=e=>{ie(le(e.target))},oe=e=>{ie(le(e.target))},se=e=>{let t=[`button[type=submit]`,`input[type=submit]`,`button:not([type])`].map(e=>`${e}:not([disabled])`).map(t=>`${t}:not([form])${e.id?`,${t}[form='${e.id}']`:``}`).join(`,`);e.addEventListener(`click`,n=>{if(n.target.closest(t)){let t=c.get(e);if(e.noValidate)return;t.size&&Array.from(t).reverse().map(e=>i.get(e).reportValidity()).includes(!1)&&n.preventDefault()}})},ce=e=>{let t=c.get(e.target);t&&t.size&&t.forEach(e=>{e.constructor.formAssociated&&e.formResetCallback&&e.formResetCallback.apply(e)})},O=(e,t,n)=>{if(t){let r=c.get(t);if(r)r.add(e);else{let n=new Set;n.add(e),c.set(t,n),se(t),t.addEventListener(`reset`,ce),t.addEventListener(`input`,ae),t.addEventListener(`change`,oe)}o.set(t,{ref:e,internals:n}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout(()=>{e.formAssociatedCallback.apply(e,[t])},0),ie(t)}},le=e=>{let t=e.parentNode;return t&&t.tagName!==`FORM`&&(t=le(t)),t},k=(e,t,n=DOMException)=>{if(!e.constructor.formAssociated)throw new n(t)},A=(e,t,n)=>{let r=c.get(e);return r&&r.size&&r.forEach(e=>{i.get(e)[n]()||(t=!1)}),t},ue=e=>{if(e.constructor.formAssociated){let t=i.get(e),{labels:n,form:r}=t;D(e,n),O(e,r,t)}};function de(){return typeof MutationObserver<`u`}class j{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)}}let M=e=>(e.badInput=!1,e.customError=!1,e.patternMismatch=!1,e.rangeOverflow=!1,e.rangeUnderflow=!1,e.stepMismatch=!1,e.tooLong=!1,e.tooShort=!1,e.typeMismatch=!1,e.valid=!0,e.valueMissing=!1,e),N=(e,t,n)=>(e.valid=P(t),Object.keys(t).forEach(n=>e[n]=t[n]),n&&ie(n),e),P=e=>{let t=!0;for(let n in e)n!==`valid`&&e[n]!==!1&&(t=!1);return t},F=new WeakMap;function I(e,t){e.toggleAttribute(t,!0),e.part&&e.part.add(t)}class fe extends Set{static get isPolyfilled(){return!0}constructor(e){if(super(),!e||!e.tagName||e.tagName.indexOf(`-`)===-1)throw TypeError(`Illegal constructor`);F.set(this,e)}add(e){if(!/^--/.test(e)||typeof e!=`string`)throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${e} must start with '--'.`);let t=super.add(e),n=F.get(this),r=`state${e}`;return n.isConnected?I(n,r):setTimeout(()=>{I(n,r)}),t}clear(){for(let[e]of this.entries())this.delete(e);super.clear()}delete(e){let t=super.delete(e),n=F.get(this);return n.isConnected?(n.toggleAttribute(`state${e}`,!1),n.part&&n.part.remove(`state${e}`)):setTimeout(()=>{n.toggleAttribute(`state${e}`,!1),n.part&&n.part.remove(`state${e}`)}),t}}function pe(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)}function L(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n}var R;class me{constructor(e){R.set(this,void 0),L(this,R,e,`f`);for(let t=0;t<e.length;t++){let n=e[t];this[t]=n,n.hasAttribute(`name`)&&(this[n.getAttribute(`name`)]=n)}Object.freeze(this)}get length(){return pe(this,R,`f`).length}[(R=new WeakMap,Symbol.iterator)](){return pe(this,R,`f`)[Symbol.iterator]()}item(e){return this[e]==null?null:this[e]}namedItem(e){return this[e]==null?null:this[e]}}function he(){let e=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=n;let t=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=r;function n(...t){let n=e.apply(this,t);return A(this,n,`checkValidity`)}function r(...e){let n=t.apply(this,e);return A(this,n,`reportValidity`)}let{get:i}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,`elements`);Object.defineProperty(HTMLFormElement.prototype,`elements`,{get(...e){let t=i.call(this,...e),n=Array.from(c.get(this)||[]);return n.length===0?t:new me(Array.from(t).concat(n).sort((e,t)=>e.compareDocumentPosition?e.compareDocumentPosition(t)&2?1:-1:0))}})}class z{static get isPolyfilled(){return!0}constructor(e){if(!e||!e.tagName||e.tagName.indexOf(`-`)===-1)throw TypeError(`Illegal constructor`);let r=e.getRootNode(),a=new j;this.states=new fe(e),t.set(this,e),n.set(this,a),i.set(e,this),_(e,this),re(e,this),Object.seal(this),r instanceof DocumentFragment&&w(r)}checkValidity(){let e=t.get(this);if(k(e,`Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element.`),!this.willValidate)return!0;let r=n.get(this);if(!r.valid){let t=new Event(`invalid`,{bubbles:!1,cancelable:!0,composed:!1});e.dispatchEvent(t)}return r.valid}get form(){let e=t.get(this);k(e,`Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.`);let n;return e.constructor.formAssociated===!0&&(n=le(e)),n}get labels(){let e=t.get(this);k(e,`Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.`);let n=e.getAttribute(`id`),r=e.getRootNode();return r&&n?r.querySelectorAll(`[for="${n}"]`):[]}reportValidity(){let e=t.get(this);if(k(e,`Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.`),!this.willValidate)return!0;let n=this.checkValidity(),r=f.get(this);if(r&&!e.constructor.formAssociated)throw new DOMException(`Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.`);return!n&&r&&(e.focus(),r.focus()),n}setFormValue(e){let n=t.get(this);if(k(n,`Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element.`),te(this),e!=null&&!(e instanceof FormData)){if(n.getAttribute(`name`)){let t=ne(n,this);t.value=e}}else e!=null&&e instanceof FormData&&Array.from(e).reverse().forEach(([e,t])=>{if(typeof t==`string`){let r=ne(n,this);r.name=e,r.value=t}});l.set(n,e)}setValidity(e,r,i){let o=t.get(this);if(k(o,`Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element.`),!e)throw TypeError(`Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.`);f.set(this,i);let s=n.get(this),c={};for(let t in e)c[t]=e[t];Object.keys(c).length===0&&M(s);let l=Object.assign(Object.assign({},s),c);delete l.valid;let{valid:u}=N(s,l,this.form);if(!u&&!r)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.`);a.set(this,u?``:r),o.isConnected?(o.toggleAttribute(`internals-invalid`,!u),o.toggleAttribute(`internals-valid`,u),T(o,`aria-invalid`,`${!u}`)):h.set(o,this)}get shadowRoot(){let e=t.get(this);return d.get(e)||null}get validationMessage(){return k(t.get(this),`Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element.`),a.get(this)}get validity(){return k(t.get(this),`Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element.`),n.get(this)}get willValidate(){let e=t.get(this);return k(e,`Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element.`),!(e.disabled||e.hasAttribute(`disabled`)||e.hasAttribute(`readonly`))}}function B(){if(typeof window>`u`||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class e extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}let t=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,``)}`;customElements.define(t,e);let n=new e;return[`shadowRoot`,`form`,`willValidate`,`validity`,`validationMessage`,`labels`,`setFormValue`,`setValidity`,`checkValidity`,`reportValidity`].every(e=>e in n.internals)}let V=!1,ge=!1;function H(e){ge||(ge=!0,window.CustomStateSet=fe,e&&(HTMLElement.prototype.attachInternals=function(...t){let n=e.call(this,t);return n.states=new fe(this),n}))}function _e(e=!0){if(!V){if(V=!0,typeof window<`u`&&(window.ElementInternals=z),typeof CustomElementRegistry<`u`){let e=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(t,n,r){if(n.formAssociated){let e=n.prototype.connectedCallback;n.prototype.connectedCallback=function(){m.has(this)||(m.set(this,!0),this.hasAttribute(`disabled`)&&E(this,!0)),e?.apply(this),ue(this)}}e.call(this,t,n,r)}}if(typeof HTMLElement<`u`&&(HTMLElement.prototype.attachInternals=function(){if(!this.tagName)return{};if(this.tagName.indexOf(`-`)===-1)throw Error(`Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.`);if(i.has(this))throw new DOMException(`DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.`);return new z(this)}),typeof Element<`u`){function e(...e){let n=t.apply(this,e);if(d.set(this,n),de()){let e=new MutationObserver(S);window.ShadyDOM?e.observe(this,ee):e.observe(n,ee),s.set(this,e)}return n}let t=Element.prototype.attachShadow;Element.prototype.attachShadow=e}de()&&typeof document<`u`&&new MutationObserver(S).observe(document.documentElement,ee),typeof HTMLFormElement<`u`&&he(),(e||typeof window<`u`&&!window.CustomStateSet)&&H()}}return customElements.polyfillWrapFlushCallback||(B()?typeof window<`u`&&!window.CustomStateSet&&H(HTMLElement.prototype.attachInternals):_e(!1)),e.forceCustomStateSetPolyfill=H,e.forceElementInternalsPolyfill=_e,Object.defineProperty(e,`__esModule`,{value:!0}),e})({});var Vi=`on`,Hi=`--checked`,Ui=`,`,Z=class extends Dt{static get formAssociated(){return!0}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=bi(),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=Bi.props.helptextDropdownButton.default,this.label=null,this.optionalText=qe.forms.labels.optional,this.requiredText=qe.forms.labels.required,this.tagText=null,this.dataTestid=``,this.touched=!1,this.internals=this.attachInternals()}manageValidity(e){if(!e){console.warn(`manageValidity called without valid input element`);return}this.required&&!this.value?this.internals.setValidity({valueMissing:!0},qe.forms.messages.required,e):e.validity?.typeMismatch||e.validity?.badInput?this.internals.setValidity({typeMismatch:!0},qe.forms.messages.invalid,e):e.validity?.patternMismatch?this.internals.setValidity({patternMismatch:!0},qe.forms.messages.invalidPattern,e):e.validity?.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},qe.forms.messages.tooShort,e):e.validity?.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},qe.forms.messages.tooLong,e):e.validity?.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?qe.forms.messages.rangeUnderflowMin.replace(`{min}`,this.min?.toString()):qe.forms.messages.rangeUnderflow,e):e.validity?.stepMismatch?this.internals.setValidity({stepMismatch:!0},qe.forms.messages.invalid,e):e.validity?.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?qe.forms.messages.rangeOverflowMax.replace(`{max}`,this.max?.toString()):qe.forms.messages.rangeOverflow,e):e.validity?.customError?this.internals.setValidity({customError:!0},e.validationMessage,e):this.internals.setValidity({})}setFormValue(e){if(this.internals)if(Array.isArray(e)){let t=new FormData;e.forEach(e=>{t.append(this.name,e)}),this.internals.setFormValue(t)}else this.internals.setFormValue(e)}coordinateRadioGroup(){if(!this.form||!this.name||this.type!==`radio`)return;let e=`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`;this.form.querySelectorAll(e).forEach(e=>{if(e!==this&&e.getAttribute(`name`)===this.name&&e.getAttribute(`value`)!==this.value){let t=e;t.checked&&(t.checked=!1,t.internals&&(t.internals.setFormValue(null),t.internals.states?.delete(Hi)))}})}valueChecked(e){if(!this.touched)return;let t=this.internals.form||this.closest(`form`),n=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){let e=(typeof this.value==`string`?this.value:``)||Vi;this.internals.setFormValue(e),n&&n.append(this.name,e),this.internals.states.add(Hi)}else this.internals.setFormValue(null),n&&n.delete(this.name),this.internals.states.delete(Hi);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(Ui)&&(e=e.split(Ui)),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?.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(){let 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(Ui)?e.split(Ui):!this.multiple&&!this.range&&Array.isArray(e)?e[0]||``:e}validate(){this.inputRef?.value&&this.manageValidity(this.inputRef.value),this.inputRefTo?.value&&this.manageValidity(this.inputRefTo.value)}onChange(e){if(!this.touched){this.touched=!0,e&&this.setFormValue(e),this.validate();return}if(typeof e!=`string`&&!Array.isArray(e))return;let t=this.normalizeValue(e);this.setFormValue(t),this.validate(),this.dispatchChangeEvents(t)}formResetCallback(){if(this.touched=!1,this._options&&this._options.length&&this._options.forEach(e=>{`selected`in e&&(e.selected=!1)}),this.checked!==void 0)this.checked=!1,this.internals.ariaChecked=`false`,this.internals.setFormValue(``),this.inputRef?.value&&`checked`in this.inputRef.value&&(this.inputRef.value.checked=!1),this.valueChecked(this.checked);else{this.internals.setFormValue(``);let e=this.defaultValue||(this.multiple||this.range?[]:``);this.value=e,this._value=Array.isArray(e)?e:[e],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||=this.internals.form||this.closest(`form`),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){let e=this.checked===``||this.checked===`true`||this.checked===!0;this.internals.ariaChecked=String(e);let t=e?(typeof this.value==`string`?this.value:``)||Vi:null;this.internals.setFormValue(t)}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))}};K([W({type:Boolean,reflect:!0})],Z.prototype,`checked`,void 0),K([W({type:Boolean})],Z.prototype,`defaultChecked`,void 0),K([W({type:Boolean})],Z.prototype,`multiple`,void 0),K([W({type:Boolean})],Z.prototype,`range`,void 0),K([W({type:String,reflect:!0})],Z.prototype,`type`,void 0),K([W()],Z.prototype,`defaultValue`,void 0),K([W({type:Boolean,reflect:!0})],Z.prototype,`disabled`,void 0),K([W({type:Boolean,reflect:!0})],Z.prototype,`readonly`,void 0),K([W({type:Boolean,reflect:!0})],Z.prototype,`required`,void 0),K([W({reflect:!0,converter:{fromAttribute:e=>e,toAttribute:e=>e?.toString()??null}})],Z.prototype,`max`,void 0),K([W({type:Number,reflect:!0})],Z.prototype,`maxlength`,void 0),K([W({reflect:!0,converter:{fromAttribute:e=>e,toAttribute:e=>e?.toString()??null}})],Z.prototype,`min`,void 0),K([W({type:Number,reflect:!0})],Z.prototype,`minlength`,void 0),K([W({type:Number,reflect:!0})],Z.prototype,`step`,void 0),K([W({type:String})],Z.prototype,`ariaDescribedBy`,void 0),K([W({type:String})],Z.prototype,`ariaLabelledby`,void 0),K([W({type:String,reflect:!0})],Z.prototype,`name`,void 0),K([W({type:String,reflect:!0})],Z.prototype,`pattern`,void 0),K([W({type:String,reflect:!0})],Z.prototype,`placeholder`,void 0),K([W({type:String,reflect:!0})],Z.prototype,`id`,void 0),K([W({type:Boolean})],Z.prototype,`counter`,void 0),K([W({type:Boolean})],Z.prototype,`hasError`,void 0),K([W({type:Boolean})],Z.prototype,`inline`,void 0),K([W({type:Boolean})],Z.prototype,`hasFieldset`,void 0),K([W({type:Boolean})],Z.prototype,`optionalTag`,void 0),K([W({type:Boolean})],Z.prototype,`requiredTag`,void 0),K([W({type:Boolean})],Z.prototype,`skipForwardTestid`,void 0),K([W({type:Boolean,reflect:!0,converter:zi})],Z.prototype,`useWrapper`,void 0),K([W({type:Boolean,reflect:!0})],Z.prototype,`fullwidth`,void 0),K([W({type:Number})],Z.prototype,`counterMaxLength`,void 0),K([W({type:String})],Z.prototype,`errorMessage`,void 0),K([W({type:String})],Z.prototype,`helptext`,void 0),K([W({type:String})],Z.prototype,`helptextDropdown`,void 0),K([W({type:String,reflect:!1})],Z.prototype,`helptextDropdownButton`,void 0),K([W({type:String})],Z.prototype,`label`,void 0),K([W({type:String,reflect:!1})],Z.prototype,`optionalText`,void 0),K([W({type:String,reflect:!1})],Z.prototype,`requiredText`,void 0),K([W({type:String,reflect:!1})],Z.prototype,`tagText`,void 0),K([W({type:String,attribute:`data-testid`})],Z.prototype,`dataTestid`,void 0);var Wi=class{constructor(e){this.nodes=[],this.options=[],this.generation=0,this.host=e,this.host.addController(this),this.nodes=[],this.options=[],this.observer=new MutationObserver(e=>this.handleMutations(e))}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.generation++,this.host.requestUpdate()}handleMutations(e){let t=!1;e.forEach(e=>{e.type===`childList`&&(e.addedNodes.forEach(e=>{_t(e)&&(this.addNode(e),t=!0)}),e.removedNodes.forEach(e=>{_t(e)&&(this.nodes=this.nodes.filter(t=>t!==e),t=!0)})),e.type===`attributes`&&_t(e.target)&&(this.addNode(e.target),t=!0)}),t&&this.createOptions()}},Gi=class extends Dt{constructor(...e){super(...e),this.forId=bi(),this.helptext=``,this.helptextDropdown=``,this.helptextDropdownButton=Bi.props.helptextDropdownButton.default,this.isHelpTextOpen=!1}render(){return j`${j`<div class="${q({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.hasSlotContent()})}">
488
+ `:N}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`:this.focusFirstOrSelectedOption();break;case`Tab`:this.tabClose();break}}handleOptionKeydown(e){let t=e.currentTarget,n=t.dataset.value,r=t.dataset.type,i=t.dataset.selected===`true`;if(!(!Ni(this).length&&(!this.customUserInput||!this.allowUserInput&&this.customUserInput)&&r!==`new-option`&&r!==`searchbox`))switch(e.key){case` `:case`Enter`:this.toggleOption(t),e.preventDefault();break;case`Backspace`:n&&(i?this.toggleOption(t):this.closeOptions()),e.preventDefault();break;case`Escape`:this.closeOptions(),e.preventDefault();break;case`Tab`:this.tabClose();break;case`ArrowDown`:e.altKey?Li(this):r===`searchbox`||r===`new-option`?Ii(this):Pi(t),e.preventDefault();break;case`ArrowUp`:if(e.altKey)Ii(this);else if(t.dataset.index===`0`&&this.includeSearch){let e=this.querySelector(`[role="searchbox"]`);e&&e.focus()}else if(t.dataset.index===`0`&&this.customUserInput){let e=this.querySelector(`[data-type="new-option"]`);e&&e.focus()}else Fi(t,this,this.includeSearch);e.preventDefault();break;case`Home`:Ii(this),e.preventDefault();break;case`End`:Li(this),e.preventDefault();break;default:(e.metaKey||e.ctrlKey)&&e.key===`a`&&(this.selectAll(),e.preventDefault()),ki(e.key)&&(this.handleTypeAhead(e.key),e.preventDefault());break}}focusFirstOrSelectedOption(){Ri(this,{disabled:this.disabled,allowUserInput:this.allowUserInput,customUserInput:this.customUserInput,includeSearch:this.includeSearch})}toggleOption(e){let t=e instanceof HTMLElement?e.dataset.disabled:e.disabled;if(this.disabled||t)return;let n=e instanceof HTMLElement?e.dataset.value:e.value;this.dispatchEvent(new CustomEvent(`option-toggle`,{detail:n,bubbles:!1}))}selectAll(){this.dispatchEvent(new CustomEvent(`select-all`,{bubbles:!1}))}closeOptions(){this.dispatchEvent(new CustomEvent(`close-options`,{bubbles:!1}))}tabClose(){this.dispatchEvent(new CustomEvent(`tab-close`,{bubbles:!1}))}filterOptions(){this._filteredOptions=wi(this.options,this.searchValue)}handleTypeAhead(e){let t=this.typeahead.append(e),n=Ni(this),r=ji(n,t);r>=0&&Mi(n[r])}};G([U({type:String})],zi.prototype,`id`,void 0),G([U({type:String})],zi.prototype,`label`,void 0),G([U({type:Array})],zi.prototype,`options`,void 0),G([U({type:Boolean,reflect:!0,attribute:`is-open`})],zi.prototype,`isOpen`,void 0),G([U({type:Boolean})],zi.prototype,`disabled`,void 0),G([U({type:Boolean,attribute:`include-search`})],zi.prototype,`includeSearch`,void 0),G([U({type:Boolean,attribute:`is-multi-select`})],zi.prototype,`isMultiSelect`,void 0),G([U({type:Boolean,attribute:`allow-user-input`})],zi.prototype,`allowUserInput`,void 0),G([U({type:Boolean,attribute:`max-is-reached`})],zi.prototype,`maxIsReached`,void 0),G([U({type:String,attribute:`custom-user-input`})],zi.prototype,`customUserInput`,void 0),G([U({type:String,attribute:`search-placeholder`})],zi.prototype,`searchPlaceholder`,void 0),G([U({type:String,attribute:`search-value`})],zi.prototype,`searchValue`,void 0),G([U({type:Number,attribute:`max-length`})],zi.prototype,`maxLength`,void 0),G([U({type:String,attribute:`user-message`})],zi.prototype,`userMessage`,void 0),G([W()],zi.prototype,`_filteredOptions`,void 0);try{H(`pkt-listbox`)(zi)}catch{console.warn(`Forsøker å definere <pkt-listbox>, men den er allerede definert`)}var Bi={fromAttribute(e){return e==null?!1:e===``||e===`true`||e===!0?!0:e===`false`||e===!1?!1:!!e},toAttribute(e){return e?`true`:`false`}},Vi={name:`pkt-input-wrapper`,react:`PktInputWrapper`,"css-class":`pkt-inputwrapper`,isElement:!0,isPureReact:!0,events:{toggleHelpText:{description:`Event for å vise eller skjule hjelpetekst i dropdown`}},slots:{default:{description:`Innholdet i input-wrapperen, som kan være et skjemaelement eller en annen komponent`}},props:{forId:{name:`For ID`,description:`Id-en til skjemaelementet som dette wrapper rundt`,type:`string`,required:!0,category:`tech`},label:{name:`Merkelapp`,description:`Merkelapp for skjemaelementet`,type:`string`,required:!0,category:`contents`},helptext:{name:`Hjelpetekst`,description:`Hjelpetekst for skjemaelementet`,type:`string`,category:`contents`},helptextDropdown:{name:`Hjelpetekst i dropdown`,description:`Hjelpetekst som vises i ekspanderende felt`,type:`string`,category:`contents`},helptextDropdownButton:{name:`Tekst i hjelpetekst-knapp`,description:`Tekst som vises i knappen for å vise hjelpetekst i dropdown`,default:`Les mer <span class='pkt-sr-only'>om feltet</span>`,type:`string`,category:`contents`},ariaDescribedby:{name:`aria-describedby`,description:`Id-en til elementet som beskriver skjemaelementet`,type:`string`,category:`accessibility`},counter:{name:`Teller`,description:`Teller for antall tegn i skjemaelementet`,type:`boolean`,default:!1,category:`ui`},counterCurrent:{name:`Tellerverdi`,description:`Tellerens nåværende verdi`,type:`number`,category:`ui`,showIf:{counter:!0}},counterMaxLength:{name:`Maks tegn i teller`,description:`Maks antall tegn som kan skrives i skjemaelementet`,type:`number`,category:`ui`,showIf:{counter:!0}},counterPosition:{name:`Tellerplassering`,description:`Telleren sin plassering i forhold til elementet`,type:[`top`,`bottom`],default:`bottom`,category:`ui`,showIf:{counter:!0}},optionalTag:{name:`Vise valgfritt-merking`,description:`Viser en merking som indikerer at feltet er valgfritt`,type:`boolean`,default:!1,category:`ui`},optionalText:{name:`Valgfritt-tekst`,description:`Tekst som vises i valgfritt-merkingen`,type:`string`,default:`Valgfritt`,category:`contents`},requiredTag:{name:`Vise påkrevd-merking`,description:`Viser en merking som indikerer at feltet er påkrevd`,type:`boolean`,default:!1,category:`ui`},requiredText:{name:`Påkrevd-tekst`,description:`Tekst som vises i påkrevd-merkingen`,type:`string`,default:`Må fylles ut`,category:`contents`},tagText:{type:`string`,name:`Tag-tekst`,description:`Tekst som vises i en tag ved siden av label`,category:`ui`},hasError:{name:`Feil`,description:`Indikerer at skjemaelementet har en feil`,type:`boolean`,default:!1,category:`ui`},errorMessage:{name:`Feilmelding`,description:`Feilmelding som vises når skjemaelementet har en feil`,type:`string`,category:`contents`},disabled:{name:`Deaktivert`,description:`Indikerer at skjemaelementet er deaktivert`,type:`boolean`,default:!1,category:`tech`},inline:{name:`Inline`,description:`Indikerer at skjemaelementet skal flyte sammen med sidens innhold`,type:`boolean`,default:!1,category:`ui`},hasFieldset:{name:`Er fieldset`,description:`Indikerer at innholdet er et fieldset`,type:`boolean`,default:!1,category:`ui`},useWrapper:{name:`Bruk wrapper`,description:`Indikerer om skjemaelementet skal bruke en wrapper`,type:`boolean`,displayAsFalse:!0,default:!0,category:`ui`},role:{name:`Rolle`,description:`Rollen til elementet`,type:`string`,default:`group`,category:`accessibility`}}};(function(e){let t=new WeakMap,n=new WeakMap,r=new WeakMap,i=new WeakMap,a=new WeakMap,o=new WeakMap,s=new WeakMap,c=new WeakMap,l=new WeakMap,u=new WeakMap,d=new WeakMap,f=new WeakMap,p=new WeakMap,m=new WeakMap,h=new WeakMap,g={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`},_=(e,t)=>{for(let n in g){t[n]=null;let r=null,i=g[n];Object.defineProperty(t,n,{get(){return r},set(n){r=n,e.isConnected?T(e,i,n):u.set(e,t)}})}};function v(e){let t=i.get(e),{form:n}=t;O(e,n,t),D(e,t.labels)}let y=(e,t=!1)=>{let n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return i.has(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),r=n.nextNode(),a=!t||e.disabled;for(;r;)r.formDisabledCallback&&a&&E(r,e.disabled),r=n.nextNode()},b={attributes:!0,attributeFilter:[`disabled`,`name`]},x=de()?new MutationObserver(e=>{for(let t of e){let e=t.target;if(t.attributeName===`disabled`&&(e.constructor.formAssociated?E(e,e.hasAttribute(`disabled`)):e.localName===`fieldset`&&y(e)),t.attributeName===`name`&&e.constructor.formAssociated){let t=i.get(e),n=l.get(e);t.setFormValue(n)}}}):{};function S(e){e.forEach(e=>{let{addedNodes:t,removedNodes:n}=e,a=Array.from(t),o=Array.from(n);a.forEach(e=>{var t;if(i.has(e)&&e.constructor.formAssociated&&v(e),u.has(e)){let t=u.get(e);Object.keys(g).filter(e=>t[e]!==null).forEach(n=>{T(e,g[n],t[n])}),u.delete(e)}if(h.has(e)){let t=h.get(e);T(e,`internals-valid`,t.validity.valid.toString()),T(e,`internals-invalid`,(!t.validity.valid).toString()),T(e,`aria-invalid`,(!t.validity.valid).toString()),h.delete(e)}if(e.localName===`form`){let t=c.get(e),n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return i.has(e)&&e.constructor.formAssociated&&!(t&&t.has(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),r=n.nextNode();for(;r;)v(r),r=n.nextNode()}e.localName===`fieldset`&&((t=x.observe)==null||t.call(x,e,b),y(e,!0))}),o.forEach(e=>{let t=i.get(e);t&&r.get(t)&&te(t),s.has(e)&&s.get(e).disconnect()})})}function C(e){e.forEach(e=>{let{removedNodes:t}=e;t.forEach(t=>{let n=p.get(e.target);i.has(t)&&ue(t),n.disconnect()})})}let w=e=>{var t;let n=new MutationObserver(C);(window==null?void 0:window.ShadyDOM)?.inUse&&e.mode&&e.host&&(e=e.host),(t=n.observe)==null||t.call(n,e,{childList:!0}),p.set(e,n)};de()&&new MutationObserver(S);let ee={childList:!0,subtree:!0},T=(e,t,n)=>{e.getAttribute(t)!==n&&e.setAttribute(t,n)},E=(e,t)=>{e.toggleAttribute(`internals-disabled`,t),t?T(e,`aria-disabled`,`true`):e.removeAttribute(`aria-disabled`),e.formDisabledCallback&&e.formDisabledCallback.apply(e,[t])},te=e=>{r.get(e).forEach(e=>{e.remove()}),r.set(e,[])},ne=(e,t)=>{let n=document.createElement(`input`);return n.type=`hidden`,n.name=e.getAttribute(`name`),e.after(n),r.get(t).push(n),n},re=(e,t)=>{var n;r.set(t,[]),(n=x.observe)==null||n.call(x,e,b)},D=(e,t)=>{if(t.length){Array.from(t).forEach(t=>t.addEventListener(`click`,e.click.bind(e)));let n=t[0].id;t[0].id||(n=`${t[0].htmlFor}_Label`,t[0].id=n),T(e,`aria-labelledby`,n)}},ie=e=>{let t=Array.from(e.elements).filter(e=>!e.tagName.includes(`-`)&&e.validity).map(e=>e.validity.valid),n=c.get(e)||[],r=Array.from(n).filter(e=>e.isConnected).map(e=>i.get(e).validity.valid),a=[...t,...r].includes(!1);e.toggleAttribute(`internals-invalid`,a),e.toggleAttribute(`internals-valid`,!a)},ae=e=>{ie(le(e.target))},oe=e=>{ie(le(e.target))},se=e=>{let t=[`button[type=submit]`,`input[type=submit]`,`button:not([type])`].map(e=>`${e}:not([disabled])`).map(t=>`${t}:not([form])${e.id?`,${t}[form='${e.id}']`:``}`).join(`,`);e.addEventListener(`click`,n=>{if(n.target.closest(t)){let t=c.get(e);if(e.noValidate)return;t.size&&Array.from(t).reverse().map(e=>i.get(e).reportValidity()).includes(!1)&&n.preventDefault()}})},ce=e=>{let t=c.get(e.target);t&&t.size&&t.forEach(e=>{e.constructor.formAssociated&&e.formResetCallback&&e.formResetCallback.apply(e)})},O=(e,t,n)=>{if(t){let r=c.get(t);if(r)r.add(e);else{let n=new Set;n.add(e),c.set(t,n),se(t),t.addEventListener(`reset`,ce),t.addEventListener(`input`,ae),t.addEventListener(`change`,oe)}o.set(t,{ref:e,internals:n}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout(()=>{e.formAssociatedCallback.apply(e,[t])},0),ie(t)}},le=e=>{let t=e.parentNode;return t&&t.tagName!==`FORM`&&(t=le(t)),t},k=(e,t,n=DOMException)=>{if(!e.constructor.formAssociated)throw new n(t)},A=(e,t,n)=>{let r=c.get(e);return r&&r.size&&r.forEach(e=>{i.get(e)[n]()||(t=!1)}),t},ue=e=>{if(e.constructor.formAssociated){let t=i.get(e),{labels:n,form:r}=t;D(e,n),O(e,r,t)}};function de(){return typeof MutationObserver<`u`}class j{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)}}let M=e=>(e.badInput=!1,e.customError=!1,e.patternMismatch=!1,e.rangeOverflow=!1,e.rangeUnderflow=!1,e.stepMismatch=!1,e.tooLong=!1,e.tooShort=!1,e.typeMismatch=!1,e.valid=!0,e.valueMissing=!1,e),N=(e,t,n)=>(e.valid=P(t),Object.keys(t).forEach(n=>e[n]=t[n]),n&&ie(n),e),P=e=>{let t=!0;for(let n in e)n!==`valid`&&e[n]!==!1&&(t=!1);return t},F=new WeakMap;function I(e,t){e.toggleAttribute(t,!0),e.part&&e.part.add(t)}class fe extends Set{static get isPolyfilled(){return!0}constructor(e){if(super(),!e||!e.tagName||e.tagName.indexOf(`-`)===-1)throw TypeError(`Illegal constructor`);F.set(this,e)}add(e){if(!/^--/.test(e)||typeof e!=`string`)throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${e} must start with '--'.`);let t=super.add(e),n=F.get(this),r=`state${e}`;return n.isConnected?I(n,r):setTimeout(()=>{I(n,r)}),t}clear(){for(let[e]of this.entries())this.delete(e);super.clear()}delete(e){let t=super.delete(e),n=F.get(this);return n.isConnected?(n.toggleAttribute(`state${e}`,!1),n.part&&n.part.remove(`state${e}`)):setTimeout(()=>{n.toggleAttribute(`state${e}`,!1),n.part&&n.part.remove(`state${e}`)}),t}}function pe(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)}function me(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n}var L;class he{constructor(e){L.set(this,void 0),me(this,L,e,`f`);for(let t=0;t<e.length;t++){let n=e[t];this[t]=n,n.hasAttribute(`name`)&&(this[n.getAttribute(`name`)]=n)}Object.freeze(this)}get length(){return pe(this,L,`f`).length}[(L=new WeakMap,Symbol.iterator)](){return pe(this,L,`f`)[Symbol.iterator]()}item(e){return this[e]==null?null:this[e]}namedItem(e){return this[e]==null?null:this[e]}}function ge(){let e=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=n;let t=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=r;function n(...t){let n=e.apply(this,t);return A(this,n,`checkValidity`)}function r(...e){let n=t.apply(this,e);return A(this,n,`reportValidity`)}let{get:i}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,`elements`);Object.defineProperty(HTMLFormElement.prototype,`elements`,{get(...e){let t=i.call(this,...e),n=Array.from(c.get(this)||[]);return n.length===0?t:new he(Array.from(t).concat(n).sort((e,t)=>e.compareDocumentPosition?e.compareDocumentPosition(t)&2?1:-1:0))}})}class R{static get isPolyfilled(){return!0}constructor(e){if(!e||!e.tagName||e.tagName.indexOf(`-`)===-1)throw TypeError(`Illegal constructor`);let r=e.getRootNode(),a=new j;this.states=new fe(e),t.set(this,e),n.set(this,a),i.set(e,this),_(e,this),re(e,this),Object.seal(this),r instanceof DocumentFragment&&w(r)}checkValidity(){let e=t.get(this);if(k(e,`Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element.`),!this.willValidate)return!0;let r=n.get(this);if(!r.valid){let t=new Event(`invalid`,{bubbles:!1,cancelable:!0,composed:!1});e.dispatchEvent(t)}return r.valid}get form(){let e=t.get(this);k(e,`Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.`);let n;return e.constructor.formAssociated===!0&&(n=le(e)),n}get labels(){let e=t.get(this);k(e,`Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.`);let n=e.getAttribute(`id`),r=e.getRootNode();return r&&n?r.querySelectorAll(`[for="${n}"]`):[]}reportValidity(){let e=t.get(this);if(k(e,`Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.`),!this.willValidate)return!0;let n=this.checkValidity(),r=f.get(this);if(r&&!e.constructor.formAssociated)throw new DOMException(`Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.`);return!n&&r&&(e.focus(),r.focus()),n}setFormValue(e){let n=t.get(this);if(k(n,`Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element.`),te(this),e!=null&&!(e instanceof FormData)){if(n.getAttribute(`name`)){let t=ne(n,this);t.value=e}}else e!=null&&e instanceof FormData&&Array.from(e).reverse().forEach(([e,t])=>{if(typeof t==`string`){let r=ne(n,this);r.name=e,r.value=t}});l.set(n,e)}setValidity(e,r,i){let o=t.get(this);if(k(o,`Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element.`),!e)throw TypeError(`Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.`);f.set(this,i);let s=n.get(this),c={};for(let t in e)c[t]=e[t];Object.keys(c).length===0&&M(s);let l=Object.assign(Object.assign({},s),c);delete l.valid;let{valid:u}=N(s,l,this.form);if(!u&&!r)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.`);a.set(this,u?``:r),o.isConnected?(o.toggleAttribute(`internals-invalid`,!u),o.toggleAttribute(`internals-valid`,u),T(o,`aria-invalid`,`${!u}`)):h.set(o,this)}get shadowRoot(){let e=t.get(this);return d.get(e)||null}get validationMessage(){return k(t.get(this),`Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element.`),a.get(this)}get validity(){return k(t.get(this),`Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element.`),n.get(this)}get willValidate(){let e=t.get(this);return k(e,`Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element.`),!(e.disabled||e.hasAttribute(`disabled`)||e.hasAttribute(`readonly`))}}function z(){if(typeof window>`u`||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class e extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}let t=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,``)}`;customElements.define(t,e);let n=new e;return[`shadowRoot`,`form`,`willValidate`,`validity`,`validationMessage`,`labels`,`setFormValue`,`setValidity`,`checkValidity`,`reportValidity`].every(e=>e in n.internals)}let B=!1,_e=!1;function V(e){_e||(_e=!0,window.CustomStateSet=fe,e&&(HTMLElement.prototype.attachInternals=function(...t){let n=e.call(this,t);return n.states=new fe(this),n}))}function ve(e=!0){if(!B){if(B=!0,typeof window<`u`&&(window.ElementInternals=R),typeof CustomElementRegistry<`u`){let e=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(t,n,r){if(n.formAssociated){let e=n.prototype.connectedCallback;n.prototype.connectedCallback=function(){m.has(this)||(m.set(this,!0),this.hasAttribute(`disabled`)&&E(this,!0)),e?.apply(this),ue(this)}}e.call(this,t,n,r)}}if(typeof HTMLElement<`u`&&(HTMLElement.prototype.attachInternals=function(){if(!this.tagName)return{};if(this.tagName.indexOf(`-`)===-1)throw Error(`Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.`);if(i.has(this))throw new DOMException(`DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.`);return new R(this)}),typeof Element<`u`){function e(...e){let n=t.apply(this,e);if(d.set(this,n),de()){let e=new MutationObserver(S);window.ShadyDOM?e.observe(this,ee):e.observe(n,ee),s.set(this,e)}return n}let t=Element.prototype.attachShadow;Element.prototype.attachShadow=e}de()&&typeof document<`u`&&new MutationObserver(S).observe(document.documentElement,ee),typeof HTMLFormElement<`u`&&ge(),(e||typeof window<`u`&&!window.CustomStateSet)&&V()}}return customElements.polyfillWrapFlushCallback||(z()?typeof window<`u`&&!window.CustomStateSet&&V(HTMLElement.prototype.attachInternals):ve(!1)),e.forceCustomStateSetPolyfill=V,e.forceElementInternalsPolyfill=ve,Object.defineProperty(e,`__esModule`,{value:!0}),e})({});var Hi=`on`,Ui=`--checked`,Wi=`,`,X=class extends Ot{static get formAssociated(){return!0}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=xi(),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=Vi.props.helptextDropdownButton.default,this.label=null,this.optionalText=Je.forms.labels.optional,this.requiredText=Je.forms.labels.required,this.tagText=null,this.dataTestid=``,this.touched=!1,this.internals=this.attachInternals()}manageValidity(e){if(!e){console.warn(`manageValidity called without valid input element`);return}this.required&&!this.value?this.internals.setValidity({valueMissing:!0},Je.forms.messages.required,e):e.validity?.typeMismatch||e.validity?.badInput?this.internals.setValidity({typeMismatch:!0},Je.forms.messages.invalid,e):e.validity?.patternMismatch?this.internals.setValidity({patternMismatch:!0},Je.forms.messages.invalidPattern,e):e.validity?.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},Je.forms.messages.tooShort,e):e.validity?.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},Je.forms.messages.tooLong,e):e.validity?.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?Je.forms.messages.rangeUnderflowMin.replace(`{min}`,this.min?.toString()):Je.forms.messages.rangeUnderflow,e):e.validity?.stepMismatch?this.internals.setValidity({stepMismatch:!0},Je.forms.messages.invalid,e):e.validity?.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?Je.forms.messages.rangeOverflowMax.replace(`{max}`,this.max?.toString()):Je.forms.messages.rangeOverflow,e):e.validity?.customError?this.internals.setValidity({customError:!0},e.validationMessage,e):this.internals.setValidity({})}setFormValue(e){if(this.internals)if(Array.isArray(e)){let t=new FormData;e.forEach(e=>{t.append(this.name,e)}),this.internals.setFormValue(t)}else this.internals.setFormValue(e)}coordinateRadioGroup(){if(!this.form||!this.name||this.type!==`radio`)return;let e=`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`;this.form.querySelectorAll(e).forEach(e=>{if(e!==this&&e.getAttribute(`name`)===this.name&&e.getAttribute(`value`)!==this.value){let t=e;t.checked&&(t.checked=!1,t.internals&&(t.internals.setFormValue(null),t.internals.states?.delete(Ui)))}})}valueChecked(e){if(!this.touched)return;let t=this.internals.form||this.closest(`form`),n=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){let e=(typeof this.value==`string`?this.value:``)||Hi;this.internals.setFormValue(e),n&&n.append(this.name,e),this.internals.states.add(Ui)}else this.internals.setFormValue(null),n&&n.delete(this.name),this.internals.states.delete(Ui);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(Wi)&&(e=e.split(Wi)),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?.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(){let 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(Wi)?e.split(Wi):!this.multiple&&!this.range&&Array.isArray(e)?e[0]||``:e}validate(){this.inputRef?.value&&this.manageValidity(this.inputRef.value),this.inputRefTo?.value&&this.manageValidity(this.inputRefTo.value)}onChange(e){if(!this.touched){this.touched=!0,e&&this.setFormValue(e),this.validate();return}if(typeof e!=`string`&&!Array.isArray(e))return;let t=this.normalizeValue(e);this.setFormValue(t),this.validate(),this.dispatchChangeEvents(t)}formResetCallback(){if(this.touched=!1,this._options&&this._options.length&&this._options.forEach(e=>{`selected`in e&&(e.selected=!1)}),this.checked!==void 0)this.checked=!1,this.internals.ariaChecked=`false`,this.internals.setFormValue(``),this.inputRef?.value&&`checked`in this.inputRef.value&&(this.inputRef.value.checked=!1),this.valueChecked(this.checked);else{this.internals.setFormValue(``);let e=this.defaultValue||(this.multiple||this.range?[]:``);this.value=e,this._value=Array.isArray(e)?e:[e],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||=this.internals.form||this.closest(`form`),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){let e=this.checked===``||this.checked===`true`||this.checked===!0;this.internals.ariaChecked=String(e);let t=e?(typeof this.value==`string`?this.value:``)||Hi:null;this.internals.setFormValue(t)}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))}};G([U({type:Boolean,reflect:!0})],X.prototype,`checked`,void 0),G([U({type:Boolean})],X.prototype,`defaultChecked`,void 0),G([U({type:Boolean})],X.prototype,`multiple`,void 0),G([U({type:Boolean})],X.prototype,`range`,void 0),G([U({type:String,reflect:!0})],X.prototype,`type`,void 0),G([U()],X.prototype,`defaultValue`,void 0),G([U({type:Boolean,reflect:!0})],X.prototype,`disabled`,void 0),G([U({type:Boolean,reflect:!0})],X.prototype,`readonly`,void 0),G([U({type:Boolean,reflect:!0})],X.prototype,`required`,void 0),G([U({reflect:!0,converter:{fromAttribute:e=>e,toAttribute:e=>e?.toString()??null}})],X.prototype,`max`,void 0),G([U({type:Number,reflect:!0})],X.prototype,`maxlength`,void 0),G([U({reflect:!0,converter:{fromAttribute:e=>e,toAttribute:e=>e?.toString()??null}})],X.prototype,`min`,void 0),G([U({type:Number,reflect:!0})],X.prototype,`minlength`,void 0),G([U({type:Number,reflect:!0})],X.prototype,`step`,void 0),G([U({type:String})],X.prototype,`ariaDescribedBy`,void 0),G([U({type:String})],X.prototype,`ariaLabelledby`,void 0),G([U({type:String,reflect:!0})],X.prototype,`name`,void 0),G([U({type:String,reflect:!0})],X.prototype,`pattern`,void 0),G([U({type:String,reflect:!0})],X.prototype,`placeholder`,void 0),G([U({type:String,reflect:!0})],X.prototype,`id`,void 0),G([U({type:Boolean})],X.prototype,`counter`,void 0),G([U({type:Boolean})],X.prototype,`hasError`,void 0),G([U({type:Boolean})],X.prototype,`inline`,void 0),G([U({type:Boolean})],X.prototype,`hasFieldset`,void 0),G([U({type:Boolean})],X.prototype,`optionalTag`,void 0),G([U({type:Boolean})],X.prototype,`requiredTag`,void 0),G([U({type:Boolean})],X.prototype,`skipForwardTestid`,void 0),G([U({type:Boolean,reflect:!0,converter:Bi})],X.prototype,`useWrapper`,void 0),G([U({type:Boolean,reflect:!0})],X.prototype,`fullwidth`,void 0),G([U({type:Number})],X.prototype,`counterMaxLength`,void 0),G([U({type:String})],X.prototype,`errorMessage`,void 0),G([U({type:String})],X.prototype,`helptext`,void 0),G([U({type:String})],X.prototype,`helptextDropdown`,void 0),G([U({type:String,reflect:!1})],X.prototype,`helptextDropdownButton`,void 0),G([U({type:String})],X.prototype,`label`,void 0),G([U({type:String,reflect:!1})],X.prototype,`optionalText`,void 0),G([U({type:String,reflect:!1})],X.prototype,`requiredText`,void 0),G([U({type:String,reflect:!1})],X.prototype,`tagText`,void 0),G([U({type:String,attribute:`data-testid`})],X.prototype,`dataTestid`,void 0);var Gi=class{constructor(e){this.nodes=[],this.options=[],this.generation=0,this.host=e,this.host.addController(this),this.nodes=[],this.options=[],this.observer=new MutationObserver(e=>this.handleMutations(e))}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.generation++,this.host.requestUpdate()}handleMutations(e){let t=!1;e.forEach(e=>{e.type===`childList`&&(e.addedNodes.forEach(e=>{vt(e)&&(this.addNode(e),t=!0)}),e.removedNodes.forEach(e=>{vt(e)&&(this.nodes=this.nodes.filter(t=>t!==e),t=!0)})),e.type===`attributes`&&vt(e.target)&&(this.addNode(e.target),t=!0)}),t&&this.createOptions()}},Ki=class extends Ot{constructor(...e){super(...e),this.forId=xi(),this.helptext=``,this.helptextDropdown=``,this.helptextDropdownButton=Vi.props.helptextDropdownButton.default,this.isHelpTextOpen=!1}render(){return j`${j`<div class="${K({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.hasSlotContent()})}">
489
489
  <div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
490
- <div class="pkt-contents" name="helptext">${Et(this)}</div>
491
- ${this.helptext&&At(this.helptext)}
490
+ <div class="pkt-contents" name="helptext">${Dt(this)}</div>
491
+ ${this.helptext&&jt(this.helptext)}
492
492
  </div>
493
493
  ${this.helptextDropdown?j`<div class="pkt-inputwrapper__helptext-expandable">
494
494
  <button
@@ -500,15 +500,15 @@
500
500
  class="pkt-btn__icon"
501
501
  name="${this.isHelpTextOpen?`chevron-thin-up`:`chevron-thin-down`}"
502
502
  ></pkt-icon>
503
- <span class="pkt-btn__text">${At(this.helptextDropdownButton)}</span>
503
+ <span class="pkt-btn__text">${jt(this.helptextDropdownButton)}</span>
504
504
  </button>
505
505
  <div
506
- class="${q({"pkt-inputwrapper__helptext":!0,"pkt-inputwrapper__helptext-expandable-open":this.isHelpTextOpen,"pkt-inputwrapper__helptext-expandable-closed":!this.isHelpTextOpen})}"
506
+ class="${K({"pkt-inputwrapper__helptext":!0,"pkt-inputwrapper__helptext-expandable-open":this.isHelpTextOpen,"pkt-inputwrapper__helptext-expandable-closed":!this.isHelpTextOpen})}"
507
507
  >
508
- ${At(this.helptextDropdown)}
508
+ ${jt(this.helptextDropdown)}
509
509
  </div>
510
510
  </div>`:N}
511
- </div>`}`}};K([W({type:String,reflect:!0})],Gi.prototype,`forId`,void 0),K([W({type:String})],Gi.prototype,`helptext`,void 0),K([W({type:String})],Gi.prototype,`helptextDropdown`,void 0),K([W({type:String})],Gi.prototype,`helptextDropdownButton`,void 0),K([G()],Gi.prototype,`isHelpTextOpen`,void 0);try{U(`pkt-helptext`)(Gi)}catch{console.warn(`Forsøker å definere <pkt-helptext>, men den er allerede definert`)}var Ki=class extends Dt{constructor(...e){super(...e),this.forId=bi(),this.label=``,this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=Bi.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.counterError=null,this.counterPosition=`bottom`,this.optionalTag=Bi.props.optionalTag.default,this.optionalText=Bi.props.optionalText.default,this.requiredTag=Bi.props.requiredTag.default,this.requiredText=Bi.props.requiredText.default,this.tagText=null,this.hasError=Bi.props.hasError.default,this.errorMessage=``,this.disabled=Bi.props.disabled.default,this.inline=Bi.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=Bi.props.hasFieldset.default,this.role=`group`,this.useWrapper=Bi.props.useWrapper.default}updated(e){super.updated(e)}render(){let 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`,n=this.ariaDescribedby?this.ariaDescribedby:this.helptext?`${this.forId}-helptext`:N,r=()=>j`
511
+ </div>`}`}};G([U({type:String,reflect:!0})],Ki.prototype,`forId`,void 0),G([U({type:String})],Ki.prototype,`helptext`,void 0),G([U({type:String})],Ki.prototype,`helptextDropdown`,void 0),G([U({type:String})],Ki.prototype,`helptextDropdownButton`,void 0),G([W()],Ki.prototype,`isHelpTextOpen`,void 0);try{H(`pkt-helptext`)(Ki)}catch{console.warn(`Forsøker å definere <pkt-helptext>, men den er allerede definert`)}var qi=class extends Ot{constructor(...e){super(...e),this.forId=xi(),this.label=``,this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=Vi.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.counterError=null,this.counterPosition=`bottom`,this.optionalTag=Vi.props.optionalTag.default,this.optionalText=Vi.props.optionalText.default,this.requiredTag=Vi.props.requiredTag.default,this.requiredText=Vi.props.requiredText.default,this.tagText=null,this.hasError=Vi.props.hasError.default,this.errorMessage=``,this.disabled=Vi.props.disabled.default,this.inline=Vi.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=Vi.props.hasFieldset.default,this.role=`group`,this.useWrapper=Vi.props.useWrapper.default}updated(e){super.updated(e)}render(){let 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`,n=this.ariaDescribedby?this.ariaDescribedby:this.helptext?`${this.forId}-helptext`:N,r=()=>j`
512
512
  ${this.tagText?j`<span class=${t+` pkt-tag--gray`}>${this.tagText}</span>`:N}
513
513
  ${this.optionalTag?j`<span class=${t+` pkt-tag--blue-light`}>${this.optionalText}</span>`:N}
514
514
  ${this.requiredTag?j`<span class=${t+` pkt-tag--beige`}>${this.requiredText}</span>`:N}
@@ -534,13 +534,13 @@
534
534
  ${this.label}
535
535
  </label>`,a=()=>j`
536
536
  <pkt-helptext
537
- class="${J(this.useWrapper?void 0:`pkt-hide`)}"
537
+ class="${q(this.useWrapper?void 0:`pkt-hide`)}"
538
538
  .forId=${this.forId}
539
539
  .helptext=${this.helptext}
540
540
  .helptextDropdown=${this.helptextDropdown}
541
- .helptextDropdownButton=${this.helptextDropdownButton||Bi.props.helptextDropdownButton.default}
541
+ .helptextDropdownButton=${this.helptextDropdownButton||Vi.props.helptextDropdownButton.default}
542
542
  @toggleHelpText=${e=>{this.toggleDropdown(e)}}
543
- >${Et(this,`helptext`)}</pkt-helptext>
543
+ >${Dt(this,`helptext`)}</pkt-helptext>
544
544
  `,o=()=>this.counter?j`<div class="pkt-input__counter" aria-live="polite" aria-atomic="true">
545
545
  ${this.counterError?this.counterError:N} ${this.counterCurrent||0}
546
546
  ${this.counterMaxLength?`/${this.counterMaxLength}`:N}
@@ -551,22 +551,22 @@
551
551
  aria-live="assertive"
552
552
  aria-atomic="true"
553
553
  >
554
- ${At(this.errorMessage)}
554
+ ${jt(this.errorMessage)}
555
555
  </pkt-alert>`:N,c=()=>j`
556
556
  ${i()}
557
557
  ${a()}
558
558
  ${this.counterPosition===`top`?o():N}
559
- <div class="pkt-contents">${Et(this)}</div>
559
+ <div class="pkt-contents">${Dt(this)}</div>
560
560
  ${this.counterPosition===`bottom`?o():N}
561
561
  ${s()}
562
- `;return j`<div class=${q(e)}>${this.hasFieldset?j`<fieldset class="pkt-inputwrapper__fieldset" aria-describedby="${n}">
562
+ `;return j`<div class=${K(e)}>${this.hasFieldset?j`<fieldset class="pkt-inputwrapper__fieldset" aria-describedby="${n}">
563
563
  ${c()}
564
- </fieldset>`:j`<div class="pkt-inputwrapper__fieldset">${c()}</div>`}</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`}))}};K([W({type:String})],Ki.prototype,`forId`,void 0),K([W({type:String})],Ki.prototype,`label`,void 0),K([W({type:String})],Ki.prototype,`helptext`,void 0),K([W({type:String})],Ki.prototype,`helptextDropdown`,void 0),K([W({type:String})],Ki.prototype,`helptextDropdownButton`,void 0),K([W({type:Boolean})],Ki.prototype,`counter`,void 0),K([W({type:Number})],Ki.prototype,`counterCurrent`,void 0),K([W({type:Number})],Ki.prototype,`counterMaxLength`,void 0),K([W({type:String})],Ki.prototype,`counterError`,void 0),K([W({type:String,reflect:!1})],Ki.prototype,`counterPosition`,void 0),K([W({type:Boolean})],Ki.prototype,`optionalTag`,void 0),K([W({type:String})],Ki.prototype,`optionalText`,void 0),K([W({type:Boolean})],Ki.prototype,`requiredTag`,void 0),K([W({type:String})],Ki.prototype,`requiredText`,void 0),K([W({type:String})],Ki.prototype,`tagText`,void 0),K([W({type:Boolean})],Ki.prototype,`hasError`,void 0),K([W({type:String})],Ki.prototype,`errorMessage`,void 0),K([W({type:Boolean})],Ki.prototype,`disabled`,void 0),K([W({type:Boolean})],Ki.prototype,`inline`,void 0),K([W({type:String})],Ki.prototype,`ariaDescribedby`,void 0),K([W({type:Boolean})],Ki.prototype,`hasFieldset`,void 0),K([W({type:String,reflect:!0})],Ki.prototype,`role`,void 0),K([W({type:Boolean,reflect:!0,converter:zi})],Ki.prototype,`useWrapper`,void 0);try{U(`pkt-input-wrapper`)(Ki)}catch{console.warn(`Forsøker å definere <pkt-input-wrapper>, men den er allerede definert`)}var qi=(e,t,n)=>{switch(e){case`,`:return n?`addValue`:null;case`Enter`:return`addValue`;case`Tab`:case`ArrowDown`:return t?null:`focusListbox`;case`Escape`:return`closeOptions`;default:return null}},Ji=(e,t,n,r,i)=>{if(!e)return{action:`none`,value:null};let a=xi(n,e);return!t.includes(e)&&!a?r?{action:`addUserValue`,value:e}:i?{action:`none`,value:null}:{action:`removeValue`,value:t[0]}:a&&!t.includes(a.value)?{action:`selectOption`,value:a.value}:{action:`none`,value:null}},Yi=(e,t,n,r,i)=>e.trim().toLowerCase()?{...Di(e,t,n,r),shouldRemoveValue:!1,shouldResetInput:!1}:{addValueText:null,userInfoMessage:``,shouldRemoveValue:!i&&!!t[0],shouldResetInput:!0},Xi=(e,t,n)=>{let r=xi(t,e);return n===`label`&&r?.label?r.label:e},Zi={markOptionSelected(e,t){if(t){for(let n of e)if(n.value===t){n.selected=!0;break}}},markOptionDeselected(e,t){if(t){for(let n of e)if(n.value===t){n.selected=!1;break}}},markAllSelected(e){for(let t of e)t.selected=!0},markAllDeselected(e){for(let t of e)t.selected=!1},removeUserAddedOptions(e){return e.filter(e=>!e.userAdded)}},Qi={parseOptionsFromSlot(e){let t=[];return e.forEach(e=>{if(!e.textContent&&!e.getAttribute(`value`))return;let n={value:e.getAttribute(`value`)||e.textContent||``,label:e.textContent||e.getAttribute(`value`)||``};e.getAttribute(`data-prefix`)&&(n.prefix=e.getAttribute(`data-prefix`)||void 0),e.getAttribute(`tagskincolor`)&&(n.tagSkinColor=e.getAttribute(`tagskincolor`)),e.getAttribute(`description`)&&(n.description=e.getAttribute(`description`)||void 0),n.fulltext=wi(n),t.push(n)}),t}},$i={syncOptionsWithValues(e,t){let n=[...t];return e.forEach(e=>{e.value&&!e.label&&(e.label=e.value),e.selected&&!n.includes(e.value)&&n.push(e.value),e.fulltext=wi(e),e.selected=e.selected||n.includes(e.value)}),{options:e,newValues:n}},mergeWithUserAdded(e,t){return[...t.filter(e=>e?.userAdded&&e.selected).filter(t=>!(Array.isArray(e)?e:[]).some(e=>e.value===t.value)),...e]}},ea={name:`pkt-combobox`,react:`PktCombobox`,"css-class":`pkt-combobox`,isElement:!0,isPureReact:!0,props:{name:{type:`string`,name:`Navn`,description:`Navn som brukes i skjema ved innsending`,category:`tech`},id:{type:`string`,name:`ID`,description:`Unik ID for feltet`,category:`tech`},label:{type:`string`,name:`Etikett/label`,description:`Tekst som vises over feltet`,category:`contents`},placeholder:{name:`Hint`,description:`Spesifiserer en kort hint som beskriver forventet verdi av feltet.`,type:`string`,category:`contents`,required:!1},multiple:{type:`boolean`,name:`Flervalg`,default:!1,description:`Mulighet for å velge flere valg`,category:`functionality`},tagPlacement:{attribute:`tag-placement`,type:[`inside`,`outside`],name:`Plassering av tags i flervalg`,description:`Plassering av valgte verdier i feltet ved flervalg`,category:`functionality`,showIf:{multiple:!0}},maxlength:{type:`number`,name:`Maks antall i flervalg`,description:`Maks antall valg dersom flervalg er aktivert`,category:`functionality`,showIf:{multiple:!0}},typeahead:{type:`boolean`,name:`Typeahead`,default:!1,description:`Mulighet for automatisk utfylling av feltet fra listen over valg`,category:`functionality`},includeSearch:{attribute:`include-search`,type:`boolean`,name:`Inkluder søk`,description:`Mulighet for å søke etter valg inni dropdown`,category:`functionality`},allowUserInput:{attribute:`allow-user-input`,type:`boolean`,name:`Brukervalgte verdier`,description:`Mulighet for å skrive inn egne verdier`,category:`functionality`},searchPlaceholder:{attribute:`search-placeholder`,type:`string`,name:`Søke-plassholder`,description:`Plassholdertekst for søkefeltet i dropdown`,category:`contents`,showIf:{includeSearch:!0}},displayValueAs:{attribute:`display-value-as`,type:[`label`,`value`,`prefixAndValue`],name:`Visning av valgt verdi`,description:`Hvordan valgt verdi vises i feltet`,default:`label`,category:`ui`},value:{name:`Verdi`,type:`string`,description:`Valgt verdi. Streng ved enkelt valg, array av strenger ved flervalg.`,category:`tech`},helptext:{type:`string`,name:`Hjelpetekst`,description:`Hjelpetekst som vises over feltet`,category:`contents`},helptextDropdown:{type:`string`,name:`Utvidet hjelpetekst`,description:`Hjelpetekst som vises i en lukket boks man kan åpne`,category:`contents`},helptextDropdownButton:{type:`string`,name:`Knappetekst for hjelpetekst`,description:`Tekst som vises på knappen for å åpne/lukke utvidet hjelpetekst`,category:`contents`,default:`Les mer`},disabled:{type:`boolean`,name:`Deaktivert`,description:`Feltet er deaktivert`,category:`tech`},hasError:{type:`boolean`,name:`Feil`,description:`Feltet har en feil`,category:`ui`},errorMessage:{type:`string`,name:`Feilmelding`,description:`Tekst som vises under feltet ved feil`,category:`contents`},required:{type:`boolean`,name:`Påkrevd`,description:`Feltet må fylles ut`,category:`tech`},requiredTag:{type:`boolean`,name:`Påkrevd-merking`,description:`Viser en merking som indikerer at feltet er påkrevd`,category:`ui`},requiredText:{type:`string`,name:`Påkrevd-tekst`,description:`Tekst som vises i påkrevd-merkingen`,category:`contents`},optionalTag:{type:`boolean`,name:`Valgfritt-merking`,description:`Viser en merking som indikerer at feltet er valgfritt`,category:`ui`},optionalText:{type:`string`,name:`Valgfritt-tekst`,description:`Tekst som vises i valgfritt-merkingen`,category:`contents`},tagText:{type:`string`,name:`Tag-tekst`,description:`Tekst som vises i en tag ved siden av label`,category:`ui`},fullwidth:{type:`boolean`,name:`Full bredde`,description:`Skal feltet ta opp hele bredden?`,category:`ui`},defaultOptions:{attribute:`default-options`,name:`Initielle valg (default options)`,description:`Liste over valg som kan velges, om options sendes inn som array med objekter (denne vil ikke modifiseres ved endring innad i komponenten)`,type:`array`,default:[],previewDefault:[{value:`bfr`,label:`Frogner`},{value:`bgo`,label:`Gamle Oslo`},{value:`bgr`,label:`Grorud`},{value:`bxx`,label:`Andre bydeler`}],items:{type:`object`,properties:{value:{type:`string`,description:`Verdi som sendes ved valg`},label:{type:`string`,description:`Tekst som vises for valget`},prefix:{type:`string`,description:`Tekst som vises før valget`},description:{type:`string`,description:`Beskrivelse av valget`},disabled:{type:`boolean`,description:`Valget er deaktivert`},selected:{type:`boolean`,description:`Valget er valgt`},tagSkinColor:{type:[`blue`,`blue-dark`,`blue-light`,`green`,`red`,`yellow`,`beige`,`gray`,`grey`],description:`Farge på tag`}},required:[`value`]},category:`contents`},options:{name:`Valg`,type:`array`,description:`Liste over valg som kan velges, om options sendes inn som array med objekter`,default:[],items:{type:`object`,properties:{value:{type:`string`,description:`Verdi som sendes ved valg`},label:{type:`string`,description:`Tekst som vises for valget`},prefix:{type:`string`,description:`Tekst som vises før valget`},description:{type:`string`,description:`Beskrivelse av valget`},disabled:{type:`boolean`,description:`Valget er deaktivert`},selected:{type:`boolean`,description:`Valget er valgt`},tagSkinColor:{type:[`blue`,`blue-dark`,`blue-light`,`green`,`red`,`yellow`,`beige`,`gray`,`grey`],description:`Farge på tag`}},required:[`value`]},category:`contents`}},events:{change:{type:`Event`,description:`Returnerer valgt verdi som streng. Ved flervalg returneres kommaseparerte verdier.`},"value-change":{type:`CustomEvent`,description:`Returnerer valgt verdi. Ved enkeltvalg en streng, ved flervalg en <code>string[]</code>.`},search:{type:`CustomEvent`,description:`Returnerer søketeksten som streng i <code>event.detail</code> når brukeren skriver i søkefeltet`},toggleHelpText:{type:`CustomEvent`,description:`Returnerer <code>event.detail { isOpen: true }</code> eller <code>event.detail { isOpen: false }</code> når hjelpeteksten åpnes eller lukkes`}}},ta=class extends Z{constructor(){super(),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=ea.props.displayValueAs.default,this.tagPlacement=null,this.isOpen=!1,this._options=[],this._value=[],this._isOptionsOpen=!1,this._userInfoMessage=``,this._addValueText=null,this._maxIsReached=!1,this._search=``,this._inputFocus=!1,this._internalValueSync=!1,this._optionsFromSlot=!1,this._lastSlotGeneration=0,this._suppressNextOpen=!1,this.inputRef=Y(),this.triggerRef=Y(),this.listboxRef=Y(),this.optionsController=new Wi(this)}get _hasTextInput(){return this.typeahead||this.allowUserInput}get _selectionDescription(){if(!(!this.multiple||this._value.length===0))return`${this._value.length} valgt`}focusTrigger(){this._hasTextInput?this.inputRef.value?.focus():this.triggerRef.value?.focus()}parseValue(){return Array.isArray(this.value)?this.multiple?this.value:this.value.length>0?[this.value[0]]:[]:this.value&&this.multiple?this.value.split(`,`):this.value?[this.value]:[]}updateMaxReached(){this._maxIsReached=Ti(this._value.length,this.maxlength)}syncValueAndDispatch(e){let t=this._value,n=this.multiple?t.join(`,`):t[0]||``;if(n!==(Array.isArray(this.value)?this.value.join(`,`):String(this.value||``))&&(this._internalValueSync=!0,this.value=n),e?.join(`,`)!==t.join(`,`)){let e=this.multiple?[...t]:t[0]||``;this.onChange(e)}else t.length===0&&e&&e.length>0&&this.clearInputValue()}onChange(e){this.touched=!0,super.onChange(e)}valueChanged(){}};K([W({type:String,reflect:!0})],ta.prototype,`value`,void 0),K([W({type:Array})],ta.prototype,`options`,void 0),K([W({type:Array,attribute:`default-options`})],ta.prototype,`defaultOptions`,void 0),K([W({type:Boolean,attribute:`allow-user-input`})],ta.prototype,`allowUserInput`,void 0),K([W({type:Boolean})],ta.prototype,`typeahead`,void 0),K([W({type:Boolean,attribute:`include-search`})],ta.prototype,`includeSearch`,void 0),K([W({type:String,attribute:`search-placeholder`})],ta.prototype,`searchPlaceholder`,void 0),K([W({type:Boolean})],ta.prototype,`multiple`,void 0),K([W({type:Number})],ta.prototype,`maxlength`,void 0),K([W({type:String,attribute:`display-value-as`})],ta.prototype,`displayValueAs`,void 0),K([W({type:String,attribute:`tag-placement`})],ta.prototype,`tagPlacement`,void 0),K([W({type:Boolean,attribute:`open`})],ta.prototype,`isOpen`,void 0),K([G()],ta.prototype,`_options`,void 0),K([G()],ta.prototype,`_value`,void 0),K([G()],ta.prototype,`_isOptionsOpen`,void 0),K([G()],ta.prototype,`_userInfoMessage`,void 0),K([G()],ta.prototype,`_addValueText`,void 0),K([G()],ta.prototype,`_maxIsReached`,void 0),K([G()],ta.prototype,`_search`,void 0),K([G()],ta.prototype,`_inputFocus`,void 0);var na=class extends ta{toggleValue(e){if(this.disabled)return;this.touched=!0,this._userInfoMessage=``,this._addValueText=null;let t=xi(this.options,e)?.value||null,n=this._value.includes(e||t||``),r=!!t,i=this._options.find(t=>t.value===e)?.disabled||!1,a=!e?.trim(),o=!this.multiple,s=this.multiple,c=Ti(this._value.length,this.maxlength),l=!1,u=!0,d=``,f=``;i||(!r&&this.allowUserInput&&!a?(this.addNewUserValue(e),d=`Ny verdi lagt til`,l=s):!r&&!this.allowUserInput?(o&&this._value[0]&&this.removeValue(this._value[0]),u=!1,l=!0,d=`Ingen treff i søket`):n?(this.removeValue(t),l=!0,o&&this._hasTextInput&&this.inputRef.value&&this.inputRef.value.type!==`hidden`&&(this.inputRef.value.value=``)):a&&o?(this.removeAllSelected(),l=!0):o?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(t),l=!1):s&&!c?(this.setSelected(t),l=!0):s&&c?(d=`Maks antall valg nådd`,u=!1,f=e):(o&&this.removeAllSelected(),d=`Ingen gyldig verdi valgt`,u=!1,l=!0,f=e),this._isOptionsOpen=l,l||(o&&this._hasTextInput&&(this._suppressNextOpen=!0),window.setTimeout(()=>{this.focusTrigger()},0)),this._userInfoMessage=d,this._search=f||``,this.resetComboboxInput(u),s&&this.updateMaxReached())}setSelected(e){if(!this._value.includes(e)){if(this.multiple&&Ti(this._value.length,this.maxlength)){this._userInfoMessage=`Maks antall valg nådd`;return}!this.multiple&&this.removeAllSelected(),this._value=e?[...this._value,e]:this._value,Zi.markOptionSelected(this._options,e),this.resetComboboxInput(!0)}}removeSelected(e){if(!e)return;this._value=this._value.filter(t=>t!==e);let t=xi(this.options,e);t&&(Zi.markOptionDeselected(this.options,e),t.userAdded?(this._options=[...this._options.filter(t=>t.value!==e)],this.options=[...this.options.filter(t=>t.value!==e)]):this._options.some(t=>t.value===e)||(this._options=[...this._options,t]))}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),Zi.markAllSelected(this._options),this.requestUpdate()}}removeAllSelected(){this._value=[],Zi.markAllDeselected(this._options),this._options=Zi.removeUserAddedOptions(this._options),this.requestUpdate()}addValue(){let e=this.inputRef.value?.value.trim()||``;if(this._search=e,e&&this._value.includes(e)){this.resetComboboxInput(!0),this._userInfoMessage=`Verdien er allerede valgt`;return}this.toggleValue(e)}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];else if(!xi(this.options,e)){if(Ti(this._value.length,this.maxlength))return;this._value=[...this._value,e]}let t={value:e,label:e,userAdded:!0,selected:!0};this.options=[t,...this.options],this._options=[t,...this._options],this.resetComboboxInput(!0),this.multiple||(this._isOptionsOpen=!1,this._hasTextInput&&(this._suppressNextOpen=!0),window.setTimeout(()=>{this.focusTrigger()},0)),this.requestUpdate()}resetComboboxInput(e=!0){this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!==`hidden`&&e&&(this._search=``,this.multiple?this.inputRef.value.value=``:(this.inputRef.value.value=this._value[0]?Xi(this._value[0],this.options,this.displayValueAs):``,this._userInfoMessage=``)),this._options=[...this.options]}removeLastValue(e){if(this._value.length===0)return;e.preventDefault();let t=this._value[this._value.length-1];t&&this.removeSelected(t),this.updateMaxReached()}},ra=class extends na{handleInput(e){if(e.stopPropagation(),e.stopImmediatePropagation(),this.disabled)return;this.touched=!0;let t=e.target;if(this._search=t.value,this.checkForMatches(),this.typeahead)if(this._search){let{filtered:n,suggestion:r}=Ei(this.options,this._search);this._options=n,e.inputType!==`deleteContentBackward`&&r?.label&&this.inputRef.value&&this.inputRef.value.type!==`hidden`&&(t.value=r.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._suppressNextOpen){this._suppressNextOpen=!1,this._inputFocus=!0,this.requestUpdate();return}!this.multiple&&this._value[0]&&this.inputRef.value&&this.inputRef.value.type!==`hidden`&&(this.inputRef.value.value=Xi(this._value[0],this.options,this.displayValueAs)),this._inputFocus=!0,this._search=``,this._options=[...this.options],this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()}}handleFocusOut(e){if(this.disabled||!this._isOptionsOpen)return;let t=e.relatedTarget;t?.closest(`pkt-combobox`)?.id===this.id||e.target?.getAttribute(`data-focusfix`)===this.id||t===this.inputRef.value||t===this.triggerRef.value||this.closeAndProcessInput()}closeAndProcessInput(){if(this._inputFocus=!1,this._addValueText=null,this._userInfoMessage=``,this._search=``,this.inputRef.value&&this.inputRef.value.type!==`hidden`){let e=this.inputRef.value.value;if(!this.multiple)if(!e)this._value[0]&&this.removeSelected(this._value[0]);else{let t=xi(this.options,e);t&&t.value!==this._value[0]?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(t.value)):!t&&this.allowUserInput&&(this._value[0]&&this.removeSelected(this._value[0]),this.addNewUserValue(e))}else if(e!==``){let{action:t,value:n}=Ji(e,this._value,this.options,this.allowUserInput,this.multiple);switch(t){case`addUserValue`:this.addNewUserValue(n);break;case`selectOption`:this.setSelected(n);break;case`removeValue`:this.removeValue(n);break}}!this.multiple&&this._value[0]?this.inputRef.value.value=Xi(this._value[0],this.options,this.displayValueAs):this.inputRef.value.value=``}this._isOptionsOpen=!1,this.onBlur()}handleBlur(){this._inputFocus=!1,this.onBlur()}handleInputClick(e){if(this.disabled){e.preventDefault(),e.stopImmediatePropagation();return}this._hasTextInput?(this.inputRef.value?.focus(),this.requestUpdate()):(e.stopImmediatePropagation(),e.preventDefault(),this._isOptionsOpen=!this._isOptionsOpen,this._isOptionsOpen&&this.listboxRef.value?.focusFirstOrSelectedOption())}handlePlaceholderClick(e){this.disabled||(e.stopPropagation(),this._hasTextInput&&this.inputRef.value?(this.inputRef.value.focus(),this._inputFocus=!0,this.requestUpdate()):(this._isOptionsOpen=!this._isOptionsOpen,this.requestUpdate()))}handleSelectOnlyKeydown(e){if(!this.disabled)switch(e.key){case`Enter`:case` `:case`ArrowDown`:case`ArrowUp`:e.preventDefault(),this._isOptionsOpen?this._isOptionsOpen=!1:(this._isOptionsOpen=!0,this.listboxRef.value?.focusFirstOrSelectedOption());break;case`Escape`:this._isOptionsOpen&&=(e.preventDefault(),!1);break;case`Home`:case`End`:e.preventDefault(),this._isOptionsOpen||=!0,this.listboxRef.value?.focusFirstOrSelectedOption();break;case`ArrowLeft`:this.multiple&&this._value.length>0&&(e.preventDefault(),this.focusTag(this._value.length-1));break;case`Backspace`:case`Delete`:this.multiple&&this._value.length>0&&(e.preventDefault(),this.removeSelected(this._value[this._value.length-1]));break}}handleOptionToggled(e){this.toggleValue(e.detail)}handleSearch(e){e.stopPropagation(),this._search=e.detail.toLowerCase(),this.checkForMatches()}handleInputKeydown(e){if(e.key===`Backspace`){let t=!this.inputRef.value?.value;!this._search&&t&&this.multiple&&this._value.length>0&&this.removeLastValue(e);return}if(e.key===`ArrowLeft`&&this.multiple&&this._value.length>0){let t=this.inputRef.value;if(t&&t.selectionStart===0&&!t.value){e.preventDefault(),this.focusTag(this._value.length-1);return}}let t=qi(e.key,e.shiftKey,this.multiple);if(t&&!(e.key===`Tab`&&!this._isOptionsOpen)){if(t===`focusListbox`&&e.key===`Tab`&&!this.listboxRef.value?.querySelector(`[role="option"]:not([data-disabled]), [data-type="new-option"]`)){this.closeAndProcessInput();return}switch(e.preventDefault(),t){case`addValue`:this.addValue();break;case`focusListbox`:this.listboxRef.value?.focusFirstOrSelectedOption();break;case`closeOptions`:this._isOptionsOpen=!1;break}}}handleTagRemove(e){this.removeSelected(e),this._hasTextInput&&this.inputRef.value&&(this._inputFocus=!0,this.inputRef.value.focus(),this.requestUpdate())}getInsideTags(){return Array.from(this.querySelectorAll(`.pkt-combobox__input .pkt-combobox__tag-list pkt-tag`))}focusTag(e){let t=this.getInsideTags();t.forEach((t,n)=>{t.buttonTabindex=n===e?0:-1}),(t[e]?.querySelector(`button`))?.focus()}resetTagTabindices(){this.getInsideTags().forEach(e=>{e.buttonTabindex=-1})}handleTagKeydown(e,t){e.stopPropagation();let n=()=>{this.resetTagTabindices(),this._hasTextInput&&this.inputRef.value?this.inputRef.value.focus():this.triggerRef.value?.focus()};switch(e.key){case`ArrowLeft`:e.preventDefault(),t>0&&this.focusTag(t-1);break;case`ArrowRight`:e.preventDefault(),t<this._value.length-1?this.focusTag(t+1):n();break;case`Backspace`:case`Delete`:e.preventDefault();{let e=this._value[t],r=t>=this._value.length-1?t-1:t;this.removeSelected(e),r>=0?(this.requestUpdate(),this.updateComplete.then(()=>this.focusTag(r))):n()}break;case`Tab`:this.resetTagTabindices();break;case`Escape`:e.preventDefault(),n();break}}checkForMatches(){let e=Yi(this.inputRef.value?.value||this._search||``,this._value,this.options,this.allowUserInput,this.multiple);if(e.shouldRemoveValue&&this.removeValue(this._value[0]),e.shouldResetInput){this.resetComboboxInput(!1);return}this._addValueText=e.addValueText,this._userInfoMessage=e.userInfoMessage}},ia=class extends ra{constructor(...e){super(...e),this.handleBodyClick=e=>{this._isOptionsOpen&&!this.contains(e.target)&&this.closeAndProcessInput()}}connectedCallback(){if(super.connectedCallback(),document?.body.addEventListener(`click`,this.handleBodyClick),this._options=[],this.defaultOptions&&this.defaultOptions.length&&(this.options=[...this.options?.filter(e=>e.userAdded)||[],...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]),this.optionsController?.nodes&&this.optionsController.nodes.length){let e=Qi.parseOptionsFromSlot(this.optionsController.nodes);e.length&&(this.options=[...e],this._options=[...e],this._optionsFromSlot=!0,this._lastSlotGeneration=this.optionsController.generation)}}willUpdate(e){if(this._optionsFromSlot&&this.optionsController){let e=this.optionsController.generation;if(e!==this._lastSlotGeneration){this._lastSlotGeneration=e;let t=Qi.parseOptionsFromSlot(this.optionsController.nodes);this.options=[...this._options.filter(e=>e.userAdded),...t]}}super.willUpdate(e)}disconnectedCallback(){super.disconnectedCallback(),document?.body.removeEventListener(`click`,this.handleBodyClick)}firstUpdated(e){this.defaultValue!==null&&!this.value&&(this.value=this.defaultValue),super.firstUpdated(e)}updated(e){e.has(`isOpen`)&&(this._isOptionsOpen=this.isOpen);let t=e.has(`value`),n=e.has(`_value`);if(t&&this._internalValueSync)this._internalValueSync=!1,n&&this.syncValueAndDispatch(e.get(`_value`));else if(t){let e=[...this._value],t=this.parseValue();t.join(`,`)!==this._value.join(`,`)&&(this._value=t),this.updateMaxReached(),this.syncValueAndDispatch(e)}else n&&this.syncValueAndDispatch(e.get(`_value`));if(e.has(`defaultOptions`)&&this.defaultOptions.length&&(this.options=[...(Array.isArray(this.options)?this.options:[]).filter(e=>e.userAdded)||[],...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]),e.has(`options`)){let t=e.get(`options`)||this._options||[],n=$i.mergeWithUserAdded(this.options,t);this._options=n,n.length>this.options.length&&(this.options=n);let r=$i.syncOptionsWithValues(this._options,this._value);if(this._options=r.options,r.newValues.length>this._value.length){let e=[...this._value];this._value=r.newValues,this.syncValueAndDispatch(e)}}if(e.has(`_search`)&&this.dispatchEvent(new CustomEvent(`search`,{detail:this._search,bubbles:!1})),!this._isOptionsOpen&&!this.multiple&&this._hasTextInput&&this.inputRef.value&&this.inputRef.value.type!==`hidden`){let e=this._value[0]?Xi(this._value[0],this.options,this.displayValueAs):``;this.inputRef.value.value!==e&&(this.inputRef.value.value=e)}super.updated(e)}formResetCallback(){this.touched=!1,this.value=this.defaultValue||(this.multiple,``),this._value=this.parseValue(),this._options=this._options.filter(e=>!e.userAdded).map(e=>({...e,selected:this._value.includes(e.value)})),this.options=this.options.filter(e=>!e.userAdded).map(e=>({...e,selected:this._value.includes(e.value)})),this._search=``,this._isOptionsOpen=!1,this._userInfoMessage=``,this._addValueText=null,this._inputFocus=!1,this.updateMaxReached(),this.inputRef.value&&this.inputRef.value.type!==`hidden`&&(this.inputRef.value.value=``),this.internals.setFormValue(``),this.internals.ariaInvalid=`false`,this.requestUpdate()}attributeChangedCallback(e,t,n){if(e===`options`){this._options=Array.isArray(this.options)?[...this.options]:[];let e=$i.syncOptionsWithValues(this._options,this._value);this._options=e.options,e.newValues.length>this._value.length&&(this._value=e.newValues),this._search=``}super.attributeChangedCallback(e,t,n)}render(){return j`
564
+ </fieldset>`:j`<div class="pkt-inputwrapper__fieldset">${c()}</div>`}</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`}))}};G([U({type:String})],qi.prototype,`forId`,void 0),G([U({type:String})],qi.prototype,`label`,void 0),G([U({type:String})],qi.prototype,`helptext`,void 0),G([U({type:String})],qi.prototype,`helptextDropdown`,void 0),G([U({type:String})],qi.prototype,`helptextDropdownButton`,void 0),G([U({type:Boolean})],qi.prototype,`counter`,void 0),G([U({type:Number})],qi.prototype,`counterCurrent`,void 0),G([U({type:Number})],qi.prototype,`counterMaxLength`,void 0),G([U({type:String})],qi.prototype,`counterError`,void 0),G([U({type:String,reflect:!1})],qi.prototype,`counterPosition`,void 0),G([U({type:Boolean})],qi.prototype,`optionalTag`,void 0),G([U({type:String})],qi.prototype,`optionalText`,void 0),G([U({type:Boolean})],qi.prototype,`requiredTag`,void 0),G([U({type:String})],qi.prototype,`requiredText`,void 0),G([U({type:String})],qi.prototype,`tagText`,void 0),G([U({type:Boolean})],qi.prototype,`hasError`,void 0),G([U({type:String})],qi.prototype,`errorMessage`,void 0),G([U({type:Boolean})],qi.prototype,`disabled`,void 0),G([U({type:Boolean})],qi.prototype,`inline`,void 0),G([U({type:String})],qi.prototype,`ariaDescribedby`,void 0),G([U({type:Boolean})],qi.prototype,`hasFieldset`,void 0),G([U({type:String,reflect:!0})],qi.prototype,`role`,void 0),G([U({type:Boolean,reflect:!0,converter:Bi})],qi.prototype,`useWrapper`,void 0);try{H(`pkt-input-wrapper`)(qi)}catch{console.warn(`Forsøker å definere <pkt-input-wrapper>, men den er allerede definert`)}var Ji=(e,t,n)=>{switch(e){case`,`:return n?`addValue`:null;case`Enter`:return`addValue`;case`Tab`:case`ArrowDown`:return t?null:`focusListbox`;case`Escape`:return`closeOptions`;default:return null}},Yi=(e,t,n,r,i)=>{if(!e)return{action:`none`,value:null};let a=Si(n,e);return!t.includes(e)&&!a?r?{action:`addUserValue`,value:e}:i?{action:`none`,value:null}:{action:`removeValue`,value:t[0]}:a&&!t.includes(a.value)?{action:`selectOption`,value:a.value}:{action:`none`,value:null}},Xi=(e,t,n,r,i)=>e.trim().toLowerCase()?{...Oi(e,t,n,r),shouldRemoveValue:!1,shouldResetInput:!1}:{addValueText:null,userInfoMessage:``,shouldRemoveValue:!i&&!!t[0],shouldResetInput:!0},Zi=(e,t,n)=>{let r=Si(t,e);return n===`label`&&r?.label?r.label:e},Qi={markOptionSelected(e,t){if(t){for(let n of e)if(n.value===t){n.selected=!0;break}}},markOptionDeselected(e,t){if(t){for(let n of e)if(n.value===t){n.selected=!1;break}}},markAllSelected(e){for(let t of e)t.selected=!0},markAllDeselected(e){for(let t of e)t.selected=!1},removeUserAddedOptions(e){return e.filter(e=>!e.userAdded)}},$i={parseOptionsFromSlot(e){let t=[];return e.forEach(e=>{if(!e.textContent&&!e.getAttribute(`value`))return;let n={value:e.getAttribute(`value`)||e.textContent||``,label:e.textContent||e.getAttribute(`value`)||``};e.getAttribute(`data-prefix`)&&(n.prefix=e.getAttribute(`data-prefix`)||void 0),e.getAttribute(`tagskincolor`)&&(n.tagSkinColor=e.getAttribute(`tagskincolor`)),e.getAttribute(`description`)&&(n.description=e.getAttribute(`description`)||void 0),n.fulltext=Ti(n),t.push(n)}),t}},ea={syncOptionsWithValues(e,t){let n=[...t];return e.forEach(e=>{e.value&&!e.label&&(e.label=e.value),e.selected&&!n.includes(e.value)&&n.push(e.value),e.fulltext=Ti(e),e.selected=e.selected||n.includes(e.value)}),{options:e,newValues:n}},mergeWithUserAdded(e,t){return[...t.filter(e=>e?.userAdded&&e.selected).filter(t=>!(Array.isArray(e)?e:[]).some(e=>e.value===t.value)),...e]}},ta={name:`pkt-combobox`,react:`PktCombobox`,"css-class":`pkt-combobox`,isElement:!0,isPureReact:!0,props:{name:{type:`string`,name:`Navn`,description:`Navn som brukes i skjema ved innsending`,category:`tech`},id:{type:`string`,name:`ID`,description:`Unik ID for feltet`,category:`tech`},label:{type:`string`,name:`Etikett/label`,description:`Tekst som vises over feltet`,category:`contents`},placeholder:{name:`Hint`,description:`Spesifiserer en kort hint som beskriver forventet verdi av feltet.`,type:`string`,category:`contents`,required:!1},multiple:{type:`boolean`,name:`Flervalg`,default:!1,description:`Mulighet for å velge flere valg`,category:`functionality`},tagPlacement:{attribute:`tag-placement`,type:[`inside`,`outside`],name:`Plassering av tags i flervalg`,description:`Plassering av valgte verdier i feltet ved flervalg`,category:`functionality`,showIf:{multiple:!0}},maxlength:{type:`number`,name:`Maks antall i flervalg`,description:`Maks antall valg dersom flervalg er aktivert`,category:`functionality`,showIf:{multiple:!0}},typeahead:{type:`boolean`,name:`Typeahead`,default:!1,description:`Mulighet for automatisk utfylling av feltet fra listen over valg`,category:`functionality`},includeSearch:{attribute:`include-search`,type:`boolean`,name:`Inkluder søk`,description:`Mulighet for å søke etter valg inni dropdown`,category:`functionality`},allowUserInput:{attribute:`allow-user-input`,type:`boolean`,name:`Brukervalgte verdier`,description:`Mulighet for å skrive inn egne verdier`,category:`functionality`},searchPlaceholder:{attribute:`search-placeholder`,type:`string`,name:`Søke-plassholder`,description:`Plassholdertekst for søkefeltet i dropdown`,category:`contents`,showIf:{includeSearch:!0}},displayValueAs:{attribute:`display-value-as`,type:[`label`,`value`,`prefixAndValue`],name:`Visning av valgt verdi`,description:`Hvordan valgt verdi vises i feltet`,default:`label`,category:`ui`},value:{name:`Verdi`,type:`string`,description:`Valgt verdi. Streng ved enkelt valg, array av strenger ved flervalg.`,category:`tech`},helptext:{type:`string`,name:`Hjelpetekst`,description:`Hjelpetekst som vises over feltet`,category:`contents`},helptextDropdown:{type:`string`,name:`Utvidet hjelpetekst`,description:`Hjelpetekst som vises i en lukket boks man kan åpne`,category:`contents`},helptextDropdownButton:{type:`string`,name:`Knappetekst for hjelpetekst`,description:`Tekst som vises på knappen for å åpne/lukke utvidet hjelpetekst`,category:`contents`,default:`Les mer`},disabled:{type:`boolean`,name:`Deaktivert`,description:`Feltet er deaktivert`,category:`tech`},hasError:{type:`boolean`,name:`Feil`,description:`Feltet har en feil`,category:`ui`},errorMessage:{type:`string`,name:`Feilmelding`,description:`Tekst som vises under feltet ved feil`,category:`contents`},required:{type:`boolean`,name:`Påkrevd`,description:`Feltet må fylles ut`,category:`tech`},requiredTag:{type:`boolean`,name:`Påkrevd-merking`,description:`Viser en merking som indikerer at feltet er påkrevd`,category:`ui`},requiredText:{type:`string`,name:`Påkrevd-tekst`,description:`Tekst som vises i påkrevd-merkingen`,category:`contents`},optionalTag:{type:`boolean`,name:`Valgfritt-merking`,description:`Viser en merking som indikerer at feltet er valgfritt`,category:`ui`},optionalText:{type:`string`,name:`Valgfritt-tekst`,description:`Tekst som vises i valgfritt-merkingen`,category:`contents`},tagText:{type:`string`,name:`Tag-tekst`,description:`Tekst som vises i en tag ved siden av label`,category:`ui`},fullwidth:{type:`boolean`,name:`Full bredde`,description:`Skal feltet ta opp hele bredden?`,category:`ui`},defaultOptions:{attribute:`default-options`,name:`Initielle valg (default options)`,description:`Liste over valg som kan velges, om options sendes inn som array med objekter (denne vil ikke modifiseres ved endring innad i komponenten)`,type:`array`,default:[],previewDefault:[{value:`bfr`,label:`Frogner`},{value:`bgo`,label:`Gamle Oslo`},{value:`bgr`,label:`Grorud`},{value:`bxx`,label:`Andre bydeler`}],items:{type:`object`,properties:{value:{type:`string`,description:`Verdi som sendes ved valg`},label:{type:`string`,description:`Tekst som vises for valget`},prefix:{type:`string`,description:`Tekst som vises før valget`},description:{type:`string`,description:`Beskrivelse av valget`},disabled:{type:`boolean`,description:`Valget er deaktivert`},selected:{type:`boolean`,description:`Valget er valgt`},tagSkinColor:{type:[`blue`,`blue-dark`,`blue-light`,`green`,`red`,`yellow`,`beige`,`gray`,`grey`],description:`Farge på tag`}},required:[`value`]},category:`contents`},options:{name:`Valg`,type:`array`,description:`Liste over valg som kan velges, om options sendes inn som array med objekter`,default:[],items:{type:`object`,properties:{value:{type:`string`,description:`Verdi som sendes ved valg`},label:{type:`string`,description:`Tekst som vises for valget`},prefix:{type:`string`,description:`Tekst som vises før valget`},description:{type:`string`,description:`Beskrivelse av valget`},disabled:{type:`boolean`,description:`Valget er deaktivert`},selected:{type:`boolean`,description:`Valget er valgt`},tagSkinColor:{type:[`blue`,`blue-dark`,`blue-light`,`green`,`red`,`yellow`,`beige`,`gray`,`grey`],description:`Farge på tag`}},required:[`value`]},category:`contents`}},events:{change:{type:`Event`,description:`Returnerer valgt verdi som streng. Ved flervalg returneres kommaseparerte verdier.`},"value-change":{type:`CustomEvent`,description:`Returnerer valgt verdi. Ved enkeltvalg en streng, ved flervalg en <code>string[]</code>.`},search:{type:`CustomEvent`,description:`Returnerer søketeksten som streng i <code>event.detail</code> når brukeren skriver i søkefeltet`},toggleHelpText:{type:`CustomEvent`,description:`Returnerer <code>event.detail { isOpen: true }</code> eller <code>event.detail { isOpen: false }</code> når hjelpeteksten åpnes eller lukkes`}}},na=class extends X{constructor(){super(),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=ta.props.displayValueAs.default,this.tagPlacement=null,this.isOpen=!1,this._options=[],this._value=[],this._isOptionsOpen=!1,this._userInfoMessage=``,this._addValueText=null,this._maxIsReached=!1,this._search=``,this._inputFocus=!1,this._internalValueSync=!1,this._optionsFromSlot=!1,this._lastSlotGeneration=0,this._suppressNextOpen=!1,this.inputRef=J(),this.triggerRef=J(),this.listboxRef=J(),this.optionsController=new Gi(this)}get _hasTextInput(){return this.typeahead||this.allowUserInput}get _selectionDescription(){if(!(!this.multiple||this._value.length===0))return`${this._value.length} valgt`}focusTrigger(){this._hasTextInput?this.inputRef.value?.focus():this.triggerRef.value?.focus()}parseValue(){return Array.isArray(this.value)?this.multiple?this.value:this.value.length>0?[this.value[0]]:[]:this.value&&this.multiple?this.value.split(`,`):this.value?[this.value]:[]}updateMaxReached(){this._maxIsReached=Ei(this._value.length,this.maxlength)}syncValueAndDispatch(e){let t=this._value,n=this.multiple?t.join(`,`):t[0]||``;if(n!==(Array.isArray(this.value)?this.value.join(`,`):String(this.value||``))&&(this._internalValueSync=!0,this.value=n),e?.join(`,`)!==t.join(`,`)){let e=this.multiple?[...t]:t[0]||``;this.onChange(e)}else t.length===0&&e&&e.length>0&&this.clearInputValue()}onChange(e){this.touched=!0,super.onChange(e)}valueChanged(){}};G([U({type:String,reflect:!0})],na.prototype,`value`,void 0),G([U({type:Array})],na.prototype,`options`,void 0),G([U({type:Array,attribute:`default-options`})],na.prototype,`defaultOptions`,void 0),G([U({type:Boolean,attribute:`allow-user-input`})],na.prototype,`allowUserInput`,void 0),G([U({type:Boolean})],na.prototype,`typeahead`,void 0),G([U({type:Boolean,attribute:`include-search`})],na.prototype,`includeSearch`,void 0),G([U({type:String,attribute:`search-placeholder`})],na.prototype,`searchPlaceholder`,void 0),G([U({type:Boolean})],na.prototype,`multiple`,void 0),G([U({type:Number})],na.prototype,`maxlength`,void 0),G([U({type:String,attribute:`display-value-as`})],na.prototype,`displayValueAs`,void 0),G([U({type:String,attribute:`tag-placement`})],na.prototype,`tagPlacement`,void 0),G([U({type:Boolean,attribute:`open`})],na.prototype,`isOpen`,void 0),G([W()],na.prototype,`_options`,void 0),G([W()],na.prototype,`_value`,void 0),G([W()],na.prototype,`_isOptionsOpen`,void 0),G([W()],na.prototype,`_userInfoMessage`,void 0),G([W()],na.prototype,`_addValueText`,void 0),G([W()],na.prototype,`_maxIsReached`,void 0),G([W()],na.prototype,`_search`,void 0),G([W()],na.prototype,`_inputFocus`,void 0);var ra=class extends na{toggleValue(e){if(this.disabled)return;this.touched=!0,this._userInfoMessage=``,this._addValueText=null;let t=Si(this.options,e)?.value||null,n=this._value.includes(e||t||``),r=!!t,i=this._options.find(t=>t.value===e)?.disabled||!1,a=!e?.trim(),o=!this.multiple,s=this.multiple,c=Ei(this._value.length,this.maxlength),l=!1,u=!0,d=``,f=``;i||(!r&&this.allowUserInput&&!a?(this.addNewUserValue(e),d=`Ny verdi lagt til`,l=s):!r&&!this.allowUserInput?(o&&this._value[0]&&this.removeValue(this._value[0]),u=!1,l=!0,d=`Ingen treff i søket`):n?(this.removeValue(t),l=!0,o&&this._hasTextInput&&this.inputRef.value&&this.inputRef.value.type!==`hidden`&&(this.inputRef.value.value=``)):a&&o?(this.removeAllSelected(),l=!0):o?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(t),l=!1):s&&!c?(this.setSelected(t),l=!0):s&&c?(d=`Maks antall valg nådd`,u=!1,f=e):(o&&this.removeAllSelected(),d=`Ingen gyldig verdi valgt`,u=!1,l=!0,f=e),this._isOptionsOpen=l,l||(o&&this._hasTextInput&&(this._suppressNextOpen=!0),window.setTimeout(()=>{this.focusTrigger()},0)),this._userInfoMessage=d,this._search=f||``,this.resetComboboxInput(u),s&&this.updateMaxReached())}setSelected(e){if(!this._value.includes(e)){if(this.multiple&&Ei(this._value.length,this.maxlength)){this._userInfoMessage=`Maks antall valg nådd`;return}!this.multiple&&this.removeAllSelected(),this._value=e?[...this._value,e]:this._value,Qi.markOptionSelected(this._options,e),this.resetComboboxInput(!0)}}removeSelected(e){if(!e)return;this._value=this._value.filter(t=>t!==e);let t=Si(this.options,e);t&&(Qi.markOptionDeselected(this.options,e),t.userAdded?(this._options=[...this._options.filter(t=>t.value!==e)],this.options=[...this.options.filter(t=>t.value!==e)]):this._options.some(t=>t.value===e)||(this._options=[...this._options,t]))}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),Qi.markAllSelected(this._options),this.requestUpdate()}}removeAllSelected(){this._value=[],Qi.markAllDeselected(this._options),this._options=Qi.removeUserAddedOptions(this._options),this.requestUpdate()}addValue(){let e=this.inputRef.value?.value.trim()||``;if(this._search=e,e&&this._value.includes(e)){this.resetComboboxInput(!0),this._userInfoMessage=`Verdien er allerede valgt`;return}this.toggleValue(e)}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];else if(!Si(this.options,e)){if(Ei(this._value.length,this.maxlength))return;this._value=[...this._value,e]}let t={value:e,label:e,userAdded:!0,selected:!0};this.options=[t,...this.options],this._options=[t,...this._options],this.resetComboboxInput(!0),this.multiple||(this._isOptionsOpen=!1,this._hasTextInput&&(this._suppressNextOpen=!0),window.setTimeout(()=>{this.focusTrigger()},0)),this.requestUpdate()}resetComboboxInput(e=!0){this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!==`hidden`&&e&&(this._search=``,this.multiple?this.inputRef.value.value=``:(this.inputRef.value.value=this._value[0]?Zi(this._value[0],this.options,this.displayValueAs):``,this._userInfoMessage=``)),this._options=[...this.options]}removeLastValue(e){if(this._value.length===0)return;e.preventDefault();let t=this._value[this._value.length-1];t&&this.removeSelected(t),this.updateMaxReached()}},ia=class extends ra{handleInput(e){if(e.stopPropagation(),e.stopImmediatePropagation(),this.disabled)return;this.touched=!0;let t=e.target;if(this._search=t.value,this.checkForMatches(),this.typeahead)if(this._search){let{filtered:n,suggestion:r}=Di(this.options,this._search);this._options=n,e.inputType!==`deleteContentBackward`&&r?.label&&this.inputRef.value&&this.inputRef.value.type!==`hidden`&&(t.value=r.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._suppressNextOpen){this._suppressNextOpen=!1,this._inputFocus=!0,this.requestUpdate();return}!this.multiple&&this._value[0]&&this.inputRef.value&&this.inputRef.value.type!==`hidden`&&(this.inputRef.value.value=Zi(this._value[0],this.options,this.displayValueAs)),this._inputFocus=!0,this._search=``,this._options=[...this.options],this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()}}handleFocusOut(e){if(this.disabled||!this._isOptionsOpen)return;let t=e.relatedTarget;t?.closest(`pkt-combobox`)?.id===this.id||e.target?.getAttribute(`data-focusfix`)===this.id||t===this.inputRef.value||t===this.triggerRef.value||this.closeAndProcessInput()}closeAndProcessInput(){if(this._inputFocus=!1,this._addValueText=null,this._userInfoMessage=``,this._search=``,this.inputRef.value&&this.inputRef.value.type!==`hidden`){let e=this.inputRef.value.value;if(!this.multiple)if(!e)this._value[0]&&this.removeSelected(this._value[0]);else{let t=Si(this.options,e);t&&t.value!==this._value[0]?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(t.value)):!t&&this.allowUserInput&&(this._value[0]&&this.removeSelected(this._value[0]),this.addNewUserValue(e))}else if(e!==``){let{action:t,value:n}=Yi(e,this._value,this.options,this.allowUserInput,this.multiple);switch(t){case`addUserValue`:this.addNewUserValue(n);break;case`selectOption`:this.setSelected(n);break;case`removeValue`:this.removeValue(n);break}}!this.multiple&&this._value[0]?this.inputRef.value.value=Zi(this._value[0],this.options,this.displayValueAs):this.inputRef.value.value=``}this._isOptionsOpen=!1,this.onBlur()}handleBlur(){this._inputFocus=!1,this.onBlur()}handleInputClick(e){if(this.disabled){e.preventDefault(),e.stopImmediatePropagation();return}this._hasTextInput?(this.inputRef.value?.focus(),this.requestUpdate()):(e.stopImmediatePropagation(),e.preventDefault(),this._isOptionsOpen=!this._isOptionsOpen,this._isOptionsOpen&&this.listboxRef.value?.focusFirstOrSelectedOption())}handlePlaceholderClick(e){this.disabled||(e.stopPropagation(),this._hasTextInput&&this.inputRef.value?(this.inputRef.value.focus(),this._inputFocus=!0,this.requestUpdate()):(this._isOptionsOpen=!this._isOptionsOpen,this.requestUpdate()))}handleSelectOnlyKeydown(e){if(!this.disabled)switch(e.key){case`Enter`:case` `:case`ArrowDown`:case`ArrowUp`:e.preventDefault(),this._isOptionsOpen?this._isOptionsOpen=!1:(this._isOptionsOpen=!0,this.listboxRef.value?.focusFirstOrSelectedOption());break;case`Escape`:this._isOptionsOpen&&=(e.preventDefault(),!1);break;case`Home`:case`End`:e.preventDefault(),this._isOptionsOpen||=!0,this.listboxRef.value?.focusFirstOrSelectedOption();break;case`ArrowLeft`:this.multiple&&this._value.length>0&&(e.preventDefault(),this.focusTag(this._value.length-1));break;case`Backspace`:case`Delete`:this.multiple&&this._value.length>0&&(e.preventDefault(),this.removeSelected(this._value[this._value.length-1]));break}}handleOptionToggled(e){this.toggleValue(e.detail)}handleSearch(e){e.stopPropagation(),this._search=e.detail.toLowerCase(),this.checkForMatches()}handleInputKeydown(e){if(e.key===`Backspace`){let t=!this.inputRef.value?.value;!this._search&&t&&this.multiple&&this._value.length>0&&this.removeLastValue(e);return}if(e.key===`ArrowLeft`&&this.multiple&&this._value.length>0){let t=this.inputRef.value;if(t&&t.selectionStart===0&&!t.value){e.preventDefault(),this.focusTag(this._value.length-1);return}}let t=Ji(e.key,e.shiftKey,this.multiple);if(t&&!(e.key===`Tab`&&!this._isOptionsOpen)){if(t===`focusListbox`&&e.key===`Tab`&&!this.listboxRef.value?.querySelector(`[role="option"]:not([data-disabled]), [data-type="new-option"]`)){this.closeAndProcessInput();return}switch(e.preventDefault(),t){case`addValue`:this.addValue();break;case`focusListbox`:this.listboxRef.value?.focusFirstOrSelectedOption();break;case`closeOptions`:this._isOptionsOpen=!1;break}}}handleTagRemove(e){this.removeSelected(e),this._hasTextInput&&this.inputRef.value&&(this._inputFocus=!0,this.inputRef.value.focus(),this.requestUpdate())}getInsideTags(){return Array.from(this.querySelectorAll(`.pkt-combobox__input .pkt-combobox__tag-list pkt-tag`))}focusTag(e){let t=this.getInsideTags();t.forEach((t,n)=>{t.buttonTabindex=n===e?0:-1}),(t[e]?.querySelector(`button`))?.focus()}resetTagTabindices(){this.getInsideTags().forEach(e=>{e.buttonTabindex=-1})}handleTagKeydown(e,t){e.stopPropagation();let n=()=>{this.resetTagTabindices(),this._hasTextInput&&this.inputRef.value?this.inputRef.value.focus():this.triggerRef.value?.focus()};switch(e.key){case`ArrowLeft`:e.preventDefault(),t>0&&this.focusTag(t-1);break;case`ArrowRight`:e.preventDefault(),t<this._value.length-1?this.focusTag(t+1):n();break;case`Backspace`:case`Delete`:e.preventDefault();{let e=this._value[t],r=t>=this._value.length-1?t-1:t;this.removeSelected(e),r>=0?(this.requestUpdate(),this.updateComplete.then(()=>this.focusTag(r))):n()}break;case`Tab`:this.resetTagTabindices();break;case`Escape`:e.preventDefault(),n();break}}checkForMatches(){let e=Xi(this.inputRef.value?.value||this._search||``,this._value,this.options,this.allowUserInput,this.multiple);if(e.shouldRemoveValue&&this.removeValue(this._value[0]),e.shouldResetInput){this.resetComboboxInput(!1);return}this._addValueText=e.addValueText,this._userInfoMessage=e.userInfoMessage}},aa=class extends ia{constructor(...e){super(...e),this.handleBodyClick=e=>{this._isOptionsOpen&&!this.contains(e.target)&&this.closeAndProcessInput()}}connectedCallback(){if(super.connectedCallback(),document?.body.addEventListener(`click`,this.handleBodyClick),this._options=[],this.defaultOptions&&this.defaultOptions.length&&(this.options=[...this.options?.filter(e=>e.userAdded)||[],...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]),this.optionsController?.nodes&&this.optionsController.nodes.length){let e=$i.parseOptionsFromSlot(this.optionsController.nodes);e.length&&(this.options=[...e],this._options=[...e],this._optionsFromSlot=!0,this._lastSlotGeneration=this.optionsController.generation)}}willUpdate(e){if(this._optionsFromSlot&&this.optionsController){let e=this.optionsController.generation;if(e!==this._lastSlotGeneration){this._lastSlotGeneration=e;let t=$i.parseOptionsFromSlot(this.optionsController.nodes);this.options=[...this._options.filter(e=>e.userAdded),...t]}}super.willUpdate(e)}disconnectedCallback(){super.disconnectedCallback(),document?.body.removeEventListener(`click`,this.handleBodyClick)}firstUpdated(e){this.defaultValue!==null&&!this.value&&(this.value=this.defaultValue),super.firstUpdated(e)}updated(e){e.has(`isOpen`)&&(this._isOptionsOpen=this.isOpen);let t=e.has(`value`),n=e.has(`_value`);if(t&&this._internalValueSync)this._internalValueSync=!1,n&&this.syncValueAndDispatch(e.get(`_value`));else if(t){let e=[...this._value],t=this.parseValue();t.join(`,`)!==this._value.join(`,`)&&(this._value=t),this.updateMaxReached(),this.syncValueAndDispatch(e)}else n&&this.syncValueAndDispatch(e.get(`_value`));if(e.has(`defaultOptions`)&&this.defaultOptions.length&&(this.options=[...(Array.isArray(this.options)?this.options:[]).filter(e=>e.userAdded)||[],...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]),e.has(`options`)){let t=e.get(`options`)||this._options||[],n=ea.mergeWithUserAdded(this.options,t);this._options=n,n.length>this.options.length&&(this.options=n);let r=ea.syncOptionsWithValues(this._options,this._value);if(this._options=r.options,r.newValues.length>this._value.length){let e=[...this._value];this._value=r.newValues,this.syncValueAndDispatch(e)}}if(e.has(`_search`)&&this.dispatchEvent(new CustomEvent(`search`,{detail:this._search,bubbles:!1})),!this._isOptionsOpen&&!this.multiple&&this._hasTextInput&&this.inputRef.value&&this.inputRef.value.type!==`hidden`){let e=this._value[0]?Zi(this._value[0],this.options,this.displayValueAs):``;this.inputRef.value.value!==e&&(this.inputRef.value.value=e)}super.updated(e)}formResetCallback(){this.touched=!1,this.value=this.defaultValue||(this.multiple,``),this._value=this.parseValue(),this._options=this._options.filter(e=>!e.userAdded).map(e=>({...e,selected:this._value.includes(e.value)})),this.options=this.options.filter(e=>!e.userAdded).map(e=>({...e,selected:this._value.includes(e.value)})),this._search=``,this._isOptionsOpen=!1,this._userInfoMessage=``,this._addValueText=null,this._inputFocus=!1,this.updateMaxReached(),this.inputRef.value&&this.inputRef.value.type!==`hidden`&&(this.inputRef.value.value=``),this.internals.setFormValue(``),this.internals.ariaInvalid=`false`,this.requestUpdate()}attributeChangedCallback(e,t,n){if(e===`options`){this._options=Array.isArray(this.options)?[...this.options]:[];let e=ea.syncOptionsWithValues(this._options,this._value);this._options=e.options,e.newValues.length>this._value.length&&(this._value=e.newValues),this._search=``}super.attributeChangedCallback(e,t,n)}render(){return j`
565
565
  <pkt-input-wrapper
566
566
  .label=${this.label}
567
567
  .helptext=${this.helptext}
568
- .helptextDropdown=${J(this.helptextDropdown)}
569
- .helptextDropdownButton=${J(this.helptextDropdownButton)}
568
+ .helptextDropdown=${q(this.helptextDropdown)}
569
+ .helptextDropdownButton=${q(this.helptextDropdownButton)}
570
570
  ?fullwidth=${this.fullwidth}
571
571
  ?hasError=${this.hasError}
572
572
  ?inline=${this.inline}
@@ -583,29 +583,29 @@
583
583
  class="pkt-combobox__wrapper"
584
584
  @labelClick=${this.handleInputClick}
585
585
  >
586
- <div class="pkt-contents" slot="helptext">${Et(this,`helptext`)}</div>
586
+ <div class="pkt-contents" slot="helptext">${Dt(this,`helptext`)}</div>
587
587
  <div class="pkt-combobox" @focusout=${this.handleFocusOut}>
588
588
  <div
589
- class=${q({"pkt-combobox__input":!0,"pkt-combobox__input--fullwidth":this.fullwidth,"pkt-combobox__input--open":this._isOptionsOpen,"pkt-combobox__input--error":this.hasError,"pkt-combobox__input--disabled":this.disabled})}
590
- id=${J(this._hasTextInput?void 0:`${this.id}-combobox`)}
591
- role=${J(this._hasTextInput?void 0:`combobox`)}
592
- aria-expanded=${J(this._hasTextInput?void 0:this._isOptionsOpen?`true`:`false`)}
593
- aria-controls=${J(this._hasTextInput?void 0:`${this.id}-listbox`)}
594
- aria-haspopup=${J(this._hasTextInput?void 0:`listbox`)}
595
- aria-labelledby=${J(this._hasTextInput?void 0:`${this.id}-combobox-label`)}
596
- aria-activedescendant=${J(!this._hasTextInput&&this._value[0]&&xi(this.options,this._value[0])?`${this.id}-listbox-${Si(this._options,this._value[0])}`:void 0)}
597
- aria-description=${J(this._selectionDescription||void 0)}
589
+ class=${K({"pkt-combobox__input":!0,"pkt-combobox__input--fullwidth":this.fullwidth,"pkt-combobox__input--open":this._isOptionsOpen,"pkt-combobox__input--error":this.hasError,"pkt-combobox__input--disabled":this.disabled})}
590
+ id=${q(this._hasTextInput?void 0:`${this.id}-combobox`)}
591
+ role=${q(this._hasTextInput?void 0:`combobox`)}
592
+ aria-expanded=${q(this._hasTextInput?void 0:this._isOptionsOpen?`true`:`false`)}
593
+ aria-controls=${q(this._hasTextInput?void 0:`${this.id}-listbox`)}
594
+ aria-haspopup=${q(this._hasTextInput?void 0:`listbox`)}
595
+ aria-labelledby=${q(this._hasTextInput?void 0:`${this.id}-combobox-label`)}
596
+ aria-activedescendant=${q(!this._hasTextInput&&this._value[0]&&Si(this.options,this._value[0])?`${this.id}-listbox-${Ci(this._options,this._value[0])}`:void 0)}
597
+ aria-description=${q(this._selectionDescription||void 0)}
598
598
  tabindex=${this._hasTextInput||this.disabled?`-1`:`0`}
599
599
  @click=${this.handleInputClick}
600
600
  @keydown=${this._hasTextInput?N:this.handleSelectOnlyKeydown}
601
- ${X(this.triggerRef)}
601
+ ${Y(this.triggerRef)}
602
602
  >
603
603
  ${!this._hasTextInput&&this.placeholder&&(!this._value.length||this.multiple&&this.tagPlacement==`outside`)&&!this._inputFocus?j`<span class="pkt-combobox__placeholder" @click=${this.handlePlaceholderClick}
604
604
  >${this.placeholder}</span
605
605
  >`:this.tagPlacement===`outside`?N:this.renderSingleOrMultipleValues()}
606
606
  ${this.renderInputField()}
607
607
  <pkt-icon
608
- class=${q({"pkt-combobox__arrow-icon":!0,"pkt-combobox__arrow-icon--open":this._isOptionsOpen})}
608
+ class=${K({"pkt-combobox__arrow-icon":!0,"pkt-combobox__arrow-icon--open":this._isOptionsOpen})}
609
609
  name="chevron-thin-down"
610
610
  aria-hidden="true"
611
611
  ></pkt-icon>
@@ -621,7 +621,7 @@
621
621
  ?is-multi-select=${this.multiple}
622
622
  ?allow-user-input=${this.allowUserInput&&!this._maxIsReached}
623
623
  ?max-is-reached=${this._maxIsReached}
624
- .customUserInput=${J(this._addValueText)}
624
+ .customUserInput=${q(this._addValueText)}
625
625
  .userMessage=${this._userInfoMessage}
626
626
  @search=${this.handleSearch}
627
627
  @option-toggle=${this.handleOptionToggled}
@@ -630,7 +630,7 @@
630
630
  @tab-close=${()=>this.closeAndProcessInput()}
631
631
  .searchValue=${this._search||null}
632
632
  .maxLength=${this.maxlength||0}
633
- ${X(this.listboxRef)}
633
+ ${Y(this.listboxRef)}
634
634
  ></pkt-listbox>
635
635
  </div>
636
636
 
@@ -644,7 +644,7 @@
644
644
  type="text"
645
645
  id="${this.id}-input"
646
646
  name=${(this.name||this.id)+`-input`}
647
- placeholder=${J(!this._value.length||this.multiple&&this.tagPlacement===`outside`?this.placeholder:void 0)}
647
+ placeholder=${q(!this._value.length||this.multiple&&this.tagPlacement===`outside`?this.placeholder:void 0)}
648
648
  @input=${this.handleInput}
649
649
  @change=${e=>{e.stopPropagation(),e.stopImmediatePropagation()}}
650
650
  @keydown=${this.handleInputKeydown}
@@ -653,12 +653,12 @@
653
653
  autocomplete="off"
654
654
  role="combobox"
655
655
  aria-expanded=${this._isOptionsOpen?`true`:`false`}
656
- aria-label=${J(this.label)}
656
+ aria-label=${q(this.label)}
657
657
  aria-autocomplete=${this.typeahead?`both`:this.allowUserInput?`list`:`none`}
658
658
  aria-controls="${this.id}-listbox"
659
- aria-activedescendant=${J(this._value[0]&&xi(this.options,this._value[0])?`${this.id}-listbox-${Si(this._options,this._value[0])}`:void 0)}
660
- aria-description=${J(this._selectionDescription||void 0)}
661
- ${X(this.inputRef)}
659
+ aria-activedescendant=${q(this._value[0]&&Si(this.options,this._value[0])?`${this.id}-listbox-${Ci(this._options,this._value[0])}`:void 0)}
660
+ aria-description=${q(this._selectionDescription||void 0)}
661
+ ${Y(this.inputRef)}
662
662
  />
663
663
  </div>
664
664
  `:j`
@@ -667,11 +667,11 @@
667
667
  id="${this.id}-input"
668
668
  name=${(this.name||this.id)+`-input`}
669
669
  .value=${this._value.join(`,`)}
670
- ${X(this.inputRef)}
670
+ ${Y(this.inputRef)}
671
671
  />
672
- `}renderSingleOrMultipleValues(){if(!this.multiple&&this._hasTextInput)return N;let e=!this.multiple,t=this.renderValueTag(xi(this.options,this._value[0])),n=this.tagPlacement===`outside`,r=j`
672
+ `}renderSingleOrMultipleValues(){if(!this.multiple&&this._hasTextInput)return N;let e=!this.multiple,t=this.renderValueTag(Si(this.options,this._value[0])),n=this.tagPlacement===`outside`,r=j`
673
673
  <ul role="list" class="pkt-combobox__tag-list">
674
- ${_i(this._value,e=>e,(e,t)=>{let r=xi(this.options,e),i=r?.tagSkinColor;return j`
674
+ ${vi(this._value,e=>e,(e,t)=>{let r=Si(this.options,e),i=r?.tagSkinColor;return j`
675
675
  <li
676
676
  role="listitem"
677
677
  @click=${n?N:e=>e.stopPropagation()}
@@ -695,13 +695,13 @@
695
695
  >${e.value}</span
696
696
  >`;default:return j`<span class="pkt-combobox__value" data-focusfix=${this.id}
697
697
  >${e.label||e.value}</span
698
- >`}}};try{U(`pkt-combobox`)(ia)}catch{console.warn(`Forsøker å definere <pkt-combobox>, men den er allerede definert`)}var aa={name:`pkt-link`,react:`PktLink`,"css-class":`pkt-link`,"dark-mode":!0,isElement:!0,props:{href:{name:`URL`,description:`URL til lenken`,type:`string`,default:`#`,category:`contents`},target:{name:`Mål`,description:`Mål for lenken`,type:[`_blank`,`_self`,`_parent`,`_top`],default:`_self`,category:`tech`},iconName:{name:`Ikon`,description:`Ikon som skal vises ved siden av lenketeksten`,type:`icon`,category:`ui`},iconPosition:{name:`Ikonposisjon`,description:`Posisjonen til ikonet i forhold til lenketeksten`,type:[`left`,`right`],category:`ui`}},slots:{default:{description:`Innholdet i lenken`}}},oa=class extends Dt{constructor(...e){super(...e),this.href=aa.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=!1,this.target=aa.props.target.default}render(){return j`<a
699
- class=${q({"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})}
698
+ >`}}};try{H(`pkt-combobox`)(aa)}catch{console.warn(`Forsøker å definere <pkt-combobox>, men den er allerede definert`)}var oa={name:`pkt-link`,react:`PktLink`,"css-class":`pkt-link`,"dark-mode":!0,isElement:!0,props:{href:{name:`URL`,description:`URL til lenken`,type:`string`,default:`#`,category:`contents`},target:{name:`Mål`,description:`Mål for lenken`,type:[`_blank`,`_self`,`_parent`,`_top`],default:`_self`,category:`tech`},iconName:{name:`Ikon`,description:`Ikon som skal vises ved siden av lenketeksten`,type:`icon`,category:`ui`},iconPosition:{name:`Ikonposisjon`,description:`Posisjonen til ikonet i forhold til lenketeksten`,type:[`left`,`right`],category:`ui`}},slots:{default:{description:`Innholdet i lenken`}}},sa=class extends Ot{constructor(...e){super(...e),this.href=oa.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=!1,this.target=oa.props.target.default}render(){return j`<a
699
+ class=${K({"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})}
700
700
  href=${this.href}
701
701
  .target=${this.target}
702
702
  .rel=${this.external?`noopener noreferrer`:N}
703
- >${this.iconName?j`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:``} <span>${Et(this)}</span></a
704
- >`}};K([W({type:String,reflect:!0})],oa.prototype,`href`,void 0),K([W({type:String,reflect:!0})],oa.prototype,`iconName`,void 0),K([W({type:String,reflect:!0})],oa.prototype,`iconPosition`,void 0),K([W({type:Boolean,reflect:!0})],oa.prototype,`external`,void 0),K([W({type:String,reflect:!0})],oa.prototype,`target`,void 0);try{U(`pkt-link`)(oa)}catch{console.warn(`Forsøker å definere <pkt-link>, men den er allerede definert`)}var sa=class extends Z{constructor(...e){super(...e),this.inputRef=Y(),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}attributeChangedCallback(e,t,n){e===`value`&&this.value!==t&&(this.counterCurrent=n?n.length:0,this.valueChanged(n,t)),super.attributeChangedCallback(e,t,n)}updated(e){super.updated(e),e.has(`value`)&&(this.counterCurrent=this.value?.length||0,this.valueChanged(this.value,e.get(`value`))),e.has(`id`)&&!this.name&&this.id&&(this.name=this.id)}render(){let e=this.type===`search`&&!this.iconNameRight&&!this.omitSearchIcon,t=q({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),n=this.ariaLabelledby||`${this.id}-input-label`;return j`
703
+ >${this.iconName?j`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:``} <span>${Dt(this)}</span></a
704
+ >`}};G([U({type:String,reflect:!0})],sa.prototype,`href`,void 0),G([U({type:String,reflect:!0})],sa.prototype,`iconName`,void 0),G([U({type:String,reflect:!0})],sa.prototype,`iconPosition`,void 0),G([U({type:Boolean,reflect:!0})],sa.prototype,`external`,void 0),G([U({type:String,reflect:!0})],sa.prototype,`target`,void 0);try{H(`pkt-link`)(sa)}catch{console.warn(`Forsøker å definere <pkt-link>, men den er allerede definert`)}var ca=class extends X{constructor(...e){super(...e),this.inputRef=J(),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}attributeChangedCallback(e,t,n){e===`value`&&this.value!==t&&(this.counterCurrent=n?n.length:0,this.valueChanged(n,t)),super.attributeChangedCallback(e,t,n)}updated(e){super.updated(e),e.has(`value`)&&(this.counterCurrent=this.value?.length||0,this.valueChanged(this.value,e.get(`value`))),e.has(`id`)&&!this.name&&this.id&&(this.name=this.id)}render(){let e=this.type===`search`&&!this.iconNameRight&&!this.omitSearchIcon,t=K({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),n=this.ariaLabelledby||`${this.id}-input-label`;return j`
705
705
  <pkt-input-wrapper
706
706
  label="${this.label}"
707
707
  ?counter=${this.counter}
@@ -726,23 +726,23 @@
726
726
  .tagText=${this.tagText}
727
727
  class="pkt-textinput"
728
728
  >
729
- <div class="pkt-contents" slot="helptext">${Et(this,`helptext`)}</div>
729
+ <div class="pkt-contents" slot="helptext">${Dt(this,`helptext`)}</div>
730
730
  <div class="pkt-input__container">
731
731
  ${this.prefix?j`<div class="pkt-input-prefix">${this.prefix}</div>`:N}
732
732
  <input
733
- ${X(this.inputRef)}
733
+ ${Y(this.inputRef)}
734
734
  class=${t}
735
735
  type=${this.type}
736
736
  name=${(this.name||this.id)+`-input`}
737
737
  id=${this.id+`-input`}
738
- placeholder=${J(this.placeholder)}
738
+ placeholder=${q(this.placeholder)}
739
739
  aria-labelledby=${n}
740
740
  autocomplete=${this.autocomplete||`off`}
741
- minlength=${J(this.minlength||void 0)}
742
- maxlength=${J(this.maxlength||void 0)}
743
- min=${J(this.min||void 0)}
744
- max=${J(this.max||void 0)}
745
- step=${J(this.step||void 0)}
741
+ minlength=${q(this.minlength||void 0)}
742
+ maxlength=${q(this.maxlength||void 0)}
743
+ min=${q(this.min||void 0)}
744
+ max=${q(this.max||void 0)}
745
+ step=${q(this.step||void 0)}
746
746
  ?readonly=${this.readonly}
747
747
  size=${this.size||N}
748
748
  .value=${this.value}
@@ -770,7 +770,7 @@
770
770
  ${!this.suffix&&e?j`<pkt-icon class="pkt-input-icon" name="magnifying-glass-big"></pkt-icon>`:N}
771
771
  </div>
772
772
  </pkt-input-wrapper>
773
- `}};K([W({type:String,reflect:!0})],sa.prototype,`value`,void 0),K([W({type:String})],sa.prototype,`type`,void 0),K([W({type:Number})],sa.prototype,`size`,void 0),K([W({type:String})],sa.prototype,`autocomplete`,void 0),K([W({type:String})],sa.prototype,`iconNameRight`,void 0),K([W({type:String})],sa.prototype,`prefix`,void 0),K([W({type:String})],sa.prototype,`suffix`,void 0),K([W({type:Boolean})],sa.prototype,`omitSearchIcon`,void 0),K([G()],sa.prototype,`counterCurrent`,void 0);try{U(`pkt-textinput`)(sa)}catch{console.warn(`Forsøker å definere <pkt-textinput>, men den er allerede definert`)}var ca=e=>typeof e.target==`string`?{title:e.title,iconName:e.iconName,href:e.target}:{title:e.title,iconName:e.iconName,onClick:e.target},la=e=>ca(e),ua=e=>{if(!e)return;let t=typeof e==`string`?new Date(e):e;if(!isNaN(t.getTime()))return t.toLocaleDateString(`nb-NO`,{day:`numeric`,month:`long`,year:`numeric`,hour:`2-digit`,minute:`2-digit`})},da=class extends Ye{constructor(...e){super(...e),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){let n=`href`in e,r=q({"pkt-user-menu__link":!0,"pkt-link-button":!n,"pkt-link":!n,"pkt-link--icon-left":!n,[t||``]:!!t});return n?j`
773
+ `}};G([U({type:String,reflect:!0})],ca.prototype,`value`,void 0),G([U({type:String})],ca.prototype,`type`,void 0),G([U({type:Number})],ca.prototype,`size`,void 0),G([U({type:String})],ca.prototype,`autocomplete`,void 0),G([U({type:String})],ca.prototype,`iconNameRight`,void 0),G([U({type:String})],ca.prototype,`prefix`,void 0),G([U({type:String})],ca.prototype,`suffix`,void 0),G([U({type:Boolean})],ca.prototype,`omitSearchIcon`,void 0),G([W()],ca.prototype,`counterCurrent`,void 0);try{H(`pkt-textinput`)(ca)}catch{console.warn(`Forsøker å definere <pkt-textinput>, men den er allerede definert`)}var la=e=>typeof e.target==`string`?{title:e.title,iconName:e.iconName,href:e.target}:{title:e.title,iconName:e.iconName,onClick:e.target},ua=e=>la(e),da=e=>{if(!e)return;let t=typeof e==`string`?new Date(e):e;if(!isNaN(t.getTime()))return t.toLocaleDateString(`nb-NO`,{day:`numeric`,month:`long`,year:`numeric`,hour:`2-digit`,minute:`2-digit`})},fa=class extends Xe{constructor(...e){super(...e),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){let n=`href`in e,r=K({"pkt-user-menu__link":!0,"pkt-link-button":!n,"pkt-link":!n,"pkt-link--icon-left":!n,[t||``]:!!t});return n?j`
774
774
  <pkt-link
775
775
  icon-name=${e.iconName||N}
776
776
  href=${e.href}
@@ -794,7 +794,7 @@
794
794
  <li class="pkt-user-menu__subitem">${this.renderLinkOrButton(e)}</li>
795
795
  `)}
796
796
  </ul>
797
- `}render(){let e=this.userMenu?.map(la);return j`
797
+ `}render(){let e=this.userMenu?.map(ua);return j`
798
798
  <nav class="pkt-user-menu" aria-label="Meny for innlogget bruker">
799
799
  <ul class="pkt-user-menu__list">
800
800
  <!-- User section -->
@@ -852,8 +852,8 @@
852
852
  `:N}
853
853
  </ul>
854
854
  </nav>
855
- `}};K([W({type:Object})],da.prototype,`user`,void 0),K([W({type:String,attribute:`formatted-last-logged-in`})],da.prototype,`formattedLastLoggedIn`,void 0),K([W({type:Object})],da.prototype,`representing`,void 0),K([W({type:Array,attribute:`user-menu`})],da.prototype,`userMenu`,void 0),K([W({type:Boolean,attribute:`can-change-representation`,converter:zi})],da.prototype,`canChangeRepresentation`,void 0),K([W({type:Boolean,attribute:`logout-on-click`,converter:zi})],da.prototype,`logoutOnClick`,void 0);try{U(`pkt-header-user-menu`)(da)}catch{console.warn(`Forsøker å definere <pkt-header-user-menu>, men den er allerede definert`)}var fa=`https://punkt-cdn.oslo.kommune.no/16.10/logos/`,pa=class extends Dt{constructor(...e){super(...e),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.alignSlotRight=!1,this.alignSearchRight=!1,this.headerRef=Y(),this.userContainerRef=Y(),this.slotContainerRef=Y(),this.searchContainerRef=Y(),this.slotContentRef=Y(),this.searchMenuRef=Y(),this.lastScrollPosition=0,this.savedScrollY=0,this.lastFocusedElement=null,this.shouldRestoreFocus=!1,this.handleScroll=()=>{if(!this.shouldHideOnScroll)return;let 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=>{let 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)=>{let n=e.relatedTarget,r;switch(t){case`user`:r=this.userContainerRef;break;case`slot`:r=this.slotContainerRef;break;case`search`:r=this.searchContainerRef;break;default:return}let i=r.value;i&&(!n||!i.contains(n))&&(this.openMenu=`none`)},this.handleEscapeKey=e=>{e.key===`Escape`&&this.openMenu!==`none`&&(e.preventDefault(),this.shouldRestoreFocus=!0,this.openMenu=`none`)}}connectedCallback(){super.connectedCallback(),this.setupScrollListener()}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.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`)){let 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(){let e=this.headerRef.value;e&&(this.componentWidth=e.offsetWidth,this.updateIsMobile(),this.updateIsTablet(),this.resizeObserver=new ResizeObserver(e=>{for(let t of e)t.borderBoxSize&&t.borderBoxSize.length>0?this.componentWidth=t.borderBoxSize[0].inlineSize:this.componentWidth=t.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(){let e=document.body,t=document.documentElement;this.savedScrollY=window.scrollY||window.pageYOffset;let n=window.innerWidth-t.clientWidth;n>0&&(e.style.paddingRight=`${n}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(){let 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){let t=e===`slot`?this.slotContainerRef:this.searchContainerRef,n=e===`slot`?this.slotContentRef:this.searchMenuRef;if(!t.value||!n.value||!this.isTablet||this.isMobile)return;let r=t.value.getBoundingClientRect(),i=n.value.offsetWidth,a=r.left+i>window.innerWidth;e===`slot`?this.alignSlotRight=a:this.alignSearchRight=a}handleMenuToggle(e){this.openMenu===`none`?(this.lastFocusedElement=document.activeElement,this.openMenu=e):this.openMenu=`none`}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){let t=e.target.value;this.handleSearchChange(t)}handleSearchKeyDown(e){e.key===`Enter`&&this.handleSearch(e.target.value)}get formattedLastLoggedIn(){return ua(this.user?.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 N;let e=j`
856
- <pkt-icon name="oslologo" aria-hidden="true" path=${fa}></pkt-icon>
855
+ `}};G([U({type:Object})],fa.prototype,`user`,void 0),G([U({type:String,attribute:`formatted-last-logged-in`})],fa.prototype,`formattedLastLoggedIn`,void 0),G([U({type:Object})],fa.prototype,`representing`,void 0),G([U({type:Array,attribute:`user-menu`})],fa.prototype,`userMenu`,void 0),G([U({type:Boolean,attribute:`can-change-representation`,converter:Bi})],fa.prototype,`canChangeRepresentation`,void 0),G([U({type:Boolean,attribute:`logout-on-click`,converter:Bi})],fa.prototype,`logoutOnClick`,void 0);try{H(`pkt-header-user-menu`)(fa)}catch{console.warn(`Forsøker å definere <pkt-header-user-menu>, men den er allerede definert`)}var pa=`https://punkt-cdn.oslo.kommune.no/16.11/logos/`,ma=class extends Ot{constructor(...e){super(...e),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.alignSlotRight=!1,this.alignSearchRight=!1,this.headerRef=J(),this.userContainerRef=J(),this.slotContainerRef=J(),this.searchContainerRef=J(),this.slotContentRef=J(),this.searchMenuRef=J(),this.lastScrollPosition=0,this.savedScrollY=0,this.lastFocusedElement=null,this.shouldRestoreFocus=!1,this.handleScroll=()=>{if(!this.shouldHideOnScroll)return;let 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=>{let 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)=>{let n=e.relatedTarget,r;switch(t){case`user`:r=this.userContainerRef;break;case`slot`:r=this.slotContainerRef;break;case`search`:r=this.searchContainerRef;break;default:return}let i=r.value;i&&(!n||!i.contains(n))&&(this.openMenu=`none`)},this.handleEscapeKey=e=>{e.key===`Escape`&&this.openMenu!==`none`&&(e.preventDefault(),this.shouldRestoreFocus=!0,this.openMenu=`none`)}}connectedCallback(){super.connectedCallback(),this.setupScrollListener()}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.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`)){let 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(){let e=this.headerRef.value;e&&(this.componentWidth=e.offsetWidth,this.updateIsMobile(),this.updateIsTablet(),this.resizeObserver=new ResizeObserver(e=>{for(let t of e)t.borderBoxSize&&t.borderBoxSize.length>0?this.componentWidth=t.borderBoxSize[0].inlineSize:this.componentWidth=t.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(){let e=document.body,t=document.documentElement;this.savedScrollY=window.scrollY||window.pageYOffset;let n=window.innerWidth-t.clientWidth;n>0&&(e.style.paddingRight=`${n}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(){let 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){let t=e===`slot`?this.slotContainerRef:this.searchContainerRef,n=e===`slot`?this.slotContentRef:this.searchMenuRef;if(!t.value||!n.value||!this.isTablet||this.isMobile)return;let r=t.value.getBoundingClientRect(),i=n.value.offsetWidth,a=r.left+i>window.innerWidth;e===`slot`?this.alignSlotRight=a:this.alignSearchRight=a}handleMenuToggle(e){this.openMenu===`none`?(this.lastFocusedElement=document.activeElement,this.openMenu=e):this.openMenu=`none`}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){let t=e.target.value;this.handleSearchChange(t)}handleSearchKeyDown(e){e.key===`Enter`&&this.handleSearch(e.target.value)}get formattedLastLoggedIn(){return da(this.user?.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 N;let e=j`
856
+ <pkt-icon name="oslologo" aria-hidden="true" path=${pa}></pkt-icon>
857
857
  `;return this.logoLink&&typeof this.logoLink==`string`?j`
858
858
  <span class="pkt-header-service__logo">
859
859
  <a href=${this.logoLink} aria-label="Tilbake til forside" @click=${this.handleLogoClick}>
@@ -895,11 +895,11 @@
895
895
  <span class="pkt-header-service__service-name" @click=${this.handleServiceClick}>
896
896
  <span class="pkt-header-service__service-link">${this.serviceName}</span>
897
897
  </span>
898
- `:N}renderSlotContainer(){if(!this.hasSlotContent())return N;let e=q({"pkt-header-service__slot-container":!0,"is-open":this.openMenu===`slot`}),t=q({"pkt-header-service__slot-content":!0,"align-right":this.alignSlotRight});return j`
898
+ `:N}renderSlotContainer(){if(!this.hasSlotContent())return N;let e=K({"pkt-header-service__slot-container":!0,"is-open":this.openMenu===`slot`}),t=K({"pkt-header-service__slot-content":!0,"align-right":this.alignSlotRight});return j`
899
899
  <div
900
900
  class=${e}
901
901
  @focusout=${e=>this.handleFocusOut(e,`slot`)}
902
- ${X(this.slotContainerRef)}
902
+ ${Y(this.slotContainerRef)}
903
903
  >
904
904
  ${this.isTablet&&this.hasSlotContent()?j`
905
905
  <pkt-button
@@ -921,16 +921,16 @@
921
921
  id="mobile-slot-menu"
922
922
  role=${this.isTablet?`menu`:N}
923
923
  aria-label=${this.isTablet?`Meny`:N}
924
- ${X(this.slotContentRef)}
924
+ ${Y(this.slotContentRef)}
925
925
  >
926
- ${Et(this)}
926
+ ${Dt(this)}
927
927
  </div>
928
928
  </div>
929
- `}renderSearch(){if(!this.showSearch)return N;if(this.isTablet){let e=q({"pkt-header-service__search-container":!0,"is-open":this.openMenu===`search`}),t=q({"pkt-header-service__mobile-menu":!0,"is-open":this.openMenu===`search`,"align-right":this.alignSearchRight});return j`
929
+ `}renderSearch(){if(!this.showSearch)return N;if(this.isTablet){let e=K({"pkt-header-service__search-container":!0,"is-open":this.openMenu===`search`}),t=K({"pkt-header-service__mobile-menu":!0,"is-open":this.openMenu===`search`,"align-right":this.alignSearchRight});return j`
930
930
  <div
931
931
  class=${e}
932
932
  @focusout=${e=>this.handleFocusOut(e,`search`)}
933
- ${X(this.searchContainerRef)}
933
+ ${Y(this.searchContainerRef)}
934
934
  >
935
935
  <pkt-button
936
936
  skin="secondary"
@@ -945,7 +945,7 @@
945
945
  >
946
946
  Søk
947
947
  </pkt-button>
948
- <div class=${t} ${X(this.searchMenuRef)}>
948
+ <div class=${t} ${Y(this.searchMenuRef)}>
949
949
  ${this.openMenu===`search`?j`
950
950
  <pkt-textinput
951
951
  id="mobile-search-menu"
@@ -975,14 +975,14 @@
975
975
  @input=${this.handleSearchInputChange}
976
976
  @keydown=${this.handleSearchKeyDown}
977
977
  ></pkt-textinput>
978
- `}renderUserButton(){if(!this.user)return N;let e=q({"pkt-header-service__user-menu":this.isMobile===!1,"pkt-header-service__mobile-menu":this.isMobile===!0,"is-open":this.openMenu===`user`});return j`
978
+ `}renderUserButton(){if(!this.user)return N;let e=K({"pkt-header-service__user-menu":this.isMobile===!1,"pkt-header-service__mobile-menu":this.isMobile===!0,"is-open":this.openMenu===`user`});return j`
979
979
  <div
980
980
  class="pkt-header-service__user-container"
981
981
  @focusout=${e=>this.handleFocusOut(e,`user`)}
982
- ${X(this.userContainerRef)}
982
+ ${Y(this.userContainerRef)}
983
983
  >
984
984
  <pkt-button
985
- class=${q({"pkt-header-service__user-button":!0,"pkt-header-service__user-button--mobile":this.isMobile})}
985
+ class=${K({"pkt-header-service__user-button":!0,"pkt-header-service__user-button--mobile":this.isMobile})}
986
986
  skin="secondary"
987
987
  size=${this.isMobile?`small`:`medium`}
988
988
  state=${this.openMenu===`user`?`active`:`normal`}
@@ -1009,8 +1009,8 @@
1009
1009
  </div>
1010
1010
  `:N}
1011
1011
  </div>
1012
- `}renderHeader(){let e=q({"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=q({"pkt-header-service__logo-area":!0,"pkt-header-service__logo-area--without-service":!this.serviceName});return j`
1013
- <header class=${e} ${X(this.headerRef)}>
1012
+ `}renderHeader(){let e=K({"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=K({"pkt-header-service__logo-area":!0,"pkt-header-service__logo-area--without-service":!this.serviceName});return j`
1013
+ <header class=${e} ${Y(this.headerRef)}>
1014
1014
  <div class=${t}>${this.renderLogo()} ${this.renderServiceName()}</div>
1015
1015
 
1016
1016
  ${this.hasSlotContent()||this.showSearch||this.showLogoutInHeader?j`<div class="pkt-header-service__content">
@@ -1045,13 +1045,13 @@
1045
1045
  `}render(){let e=this.renderHeader();return this.isFixed?j`
1046
1046
  <div class="pkt-header-service-wrapper">
1047
1047
  ${e}
1048
- <div class=${q({"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})}></div>
1048
+ <div class=${K({"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})}></div>
1049
1049
  </div>
1050
- `:e}};K([W({type:String,attribute:`service-name`})],pa.prototype,`serviceName`,void 0),K([W({type:String,attribute:`service-link`})],pa.prototype,`serviceLink`,void 0),K([W({type:String,attribute:`logo-link`})],pa.prototype,`logoLink`,void 0),K([W({type:String,attribute:`search-placeholder`})],pa.prototype,`searchPlaceholder`,void 0),K([W({type:String,attribute:`search-value`})],pa.prototype,`searchValue`,void 0),K([W({type:Number,attribute:`mobile-breakpoint`})],pa.prototype,`mobileBreakpoint`,void 0),K([W({type:Number,attribute:`tablet-breakpoint`})],pa.prototype,`tabletBreakpoint`,void 0),K([W({type:String,attribute:`opened-menu`})],pa.prototype,`openedMenu`,void 0),K([W({type:String,attribute:`log-out-button-placement`})],pa.prototype,`logOutButtonPlacement`,void 0),K([W({type:String})],pa.prototype,`position`,void 0),K([W({type:String,attribute:`scroll-behavior`})],pa.prototype,`scrollBehavior`,void 0),K([W({type:String,attribute:`slot-menu-variant`})],pa.prototype,`slotMenuVariant`,void 0),K([W({type:String,attribute:`slot-menu-text`})],pa.prototype,`slotMenuText`,void 0),K([W({type:Boolean,attribute:`hide-logo`,converter:zi})],pa.prototype,`hideLogo`,void 0),K([W({type:Boolean,converter:zi})],pa.prototype,`compact`,void 0),K([W({type:Boolean,attribute:`show-search`,converter:zi})],pa.prototype,`showSearch`,void 0),K([W({type:Boolean,attribute:`can-change-representation`,converter:zi})],pa.prototype,`canChangeRepresentation`,void 0),K([W({type:Boolean,attribute:`has-log-out`,converter:zi})],pa.prototype,`hasLogOut`,void 0),K([W({type:Object})],pa.prototype,`user`,void 0),K([W({type:Array,attribute:`user-menu`})],pa.prototype,`userMenu`,void 0),K([W({type:Object})],pa.prototype,`representing`,void 0),K([G()],pa.prototype,`isMobile`,void 0),K([G()],pa.prototype,`isTablet`,void 0),K([G()],pa.prototype,`openMenu`,void 0),K([G()],pa.prototype,`isHidden`,void 0),K([G()],pa.prototype,`componentWidth`,void 0),K([G()],pa.prototype,`alignSlotRight`,void 0),K([G()],pa.prototype,`alignSearchRight`,void 0);try{U(`pkt-header-service`)(pa)}catch{console.warn(`Forsøker å definere <pkt-header-service>, men den er allerede definert`)}var ma=class extends Dt{constructor(...e){super(...e),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}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(){let e=this.userMenu||[],t=this.userMenuFooter||[],n=this.userOptions||[];return t.length||n.length?[...e,...n,...t]:this.userMenu}render(){return j`
1050
+ `:e}};G([U({type:String,attribute:`service-name`})],ma.prototype,`serviceName`,void 0),G([U({type:String,attribute:`service-link`})],ma.prototype,`serviceLink`,void 0),G([U({type:String,attribute:`logo-link`})],ma.prototype,`logoLink`,void 0),G([U({type:String,attribute:`search-placeholder`})],ma.prototype,`searchPlaceholder`,void 0),G([U({type:String,attribute:`search-value`})],ma.prototype,`searchValue`,void 0),G([U({type:Number,attribute:`mobile-breakpoint`})],ma.prototype,`mobileBreakpoint`,void 0),G([U({type:Number,attribute:`tablet-breakpoint`})],ma.prototype,`tabletBreakpoint`,void 0),G([U({type:String,attribute:`opened-menu`})],ma.prototype,`openedMenu`,void 0),G([U({type:String,attribute:`log-out-button-placement`})],ma.prototype,`logOutButtonPlacement`,void 0),G([U({type:String})],ma.prototype,`position`,void 0),G([U({type:String,attribute:`scroll-behavior`})],ma.prototype,`scrollBehavior`,void 0),G([U({type:String,attribute:`slot-menu-variant`})],ma.prototype,`slotMenuVariant`,void 0),G([U({type:String,attribute:`slot-menu-text`})],ma.prototype,`slotMenuText`,void 0),G([U({type:Boolean,attribute:`hide-logo`,converter:Bi})],ma.prototype,`hideLogo`,void 0),G([U({type:Boolean,converter:Bi})],ma.prototype,`compact`,void 0),G([U({type:Boolean,attribute:`show-search`,converter:Bi})],ma.prototype,`showSearch`,void 0),G([U({type:Boolean,attribute:`can-change-representation`,converter:Bi})],ma.prototype,`canChangeRepresentation`,void 0),G([U({type:Boolean,attribute:`has-log-out`,converter:Bi})],ma.prototype,`hasLogOut`,void 0),G([U({type:Object})],ma.prototype,`user`,void 0),G([U({type:Array,attribute:`user-menu`})],ma.prototype,`userMenu`,void 0),G([U({type:Object})],ma.prototype,`representing`,void 0),G([W()],ma.prototype,`isMobile`,void 0),G([W()],ma.prototype,`isTablet`,void 0),G([W()],ma.prototype,`openMenu`,void 0),G([W()],ma.prototype,`isHidden`,void 0),G([W()],ma.prototype,`componentWidth`,void 0),G([W()],ma.prototype,`alignSlotRight`,void 0),G([W()],ma.prototype,`alignSearchRight`,void 0);try{H(`pkt-header-service`)(ma)}catch{console.warn(`Forsøker å definere <pkt-header-service>, men den er allerede definert`)}var ha=class extends Ot{constructor(...e){super(...e),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}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(){let e=this.userMenu||[],t=this.userMenuFooter||[],n=this.userOptions||[];return t.length||n.length?[...e,...n,...t]:this.userMenu}render(){return j`
1051
1051
  <pkt-header-service
1052
- service-name=${J(this.serviceName)}
1053
- service-link=${J(this.serviceLink)}
1054
- logo-link=${J(this.logoLink)}
1052
+ service-name=${q(this.serviceName)}
1053
+ service-link=${q(this.serviceLink)}
1054
+ logo-link=${q(this.logoLink)}
1055
1055
  search-placeholder=${this.searchPlaceholder}
1056
1056
  search-value=${this.searchValue}
1057
1057
  mobile-breakpoint=${this.mobileBreakpoint}
@@ -1071,29 +1071,29 @@
1071
1071
  .userMenu=${this.effectiveUserMenu}
1072
1072
  .representing=${this.representing}
1073
1073
  >
1074
- ${this.hasSlotContent()?j`<div class="pkt-contents">${Et(this)}</div>`:N}
1074
+ ${this.hasSlotContent()?j`<div class="pkt-contents">${Dt(this)}</div>`:N}
1075
1075
  </pkt-header-service>
1076
- `}};K([W({type:String,attribute:`service-name`})],ma.prototype,`serviceName`,void 0),K([W({type:String,attribute:`service-link`})],ma.prototype,`serviceLink`,void 0),K([W({type:String,attribute:`logo-link`})],ma.prototype,`logoLink`,void 0),K([W({type:String,attribute:`search-placeholder`})],ma.prototype,`searchPlaceholder`,void 0),K([W({type:String,attribute:`search-value`})],ma.prototype,`searchValue`,void 0),K([W({type:Number,attribute:`mobile-breakpoint`})],ma.prototype,`mobileBreakpoint`,void 0),K([W({type:Number,attribute:`tablet-breakpoint`})],ma.prototype,`tabletBreakpoint`,void 0),K([W({type:String,attribute:`opened-menu`})],ma.prototype,`openedMenu`,void 0),K([W({type:String,attribute:`log-out-button-placement`})],ma.prototype,`logOutButtonPlacement`,void 0),K([W({type:String})],ma.prototype,`position`,void 0),K([W({type:String,attribute:`scroll-behavior`})],ma.prototype,`scrollBehavior`,void 0),K([W({type:String,attribute:`slot-menu-variant`})],ma.prototype,`slotMenuVariant`,void 0),K([W({type:String,attribute:`slot-menu-text`})],ma.prototype,`slotMenuText`,void 0),K([W({type:Boolean,attribute:`hide-logo`,converter:zi})],ma.prototype,`hideLogo`,void 0),K([W({type:Boolean,converter:zi})],ma.prototype,`compact`,void 0),K([W({type:Boolean,attribute:`show-search`,converter:zi})],ma.prototype,`showSearch`,void 0),K([W({type:Boolean,attribute:`can-change-representation`,converter:zi})],ma.prototype,`canChangeRepresentation`,void 0),K([W({type:Boolean,attribute:`has-log-out`,converter:zi})],ma.prototype,`hasLogOut`,void 0),K([W({type:Object})],ma.prototype,`user`,void 0),K([W({type:Array,attribute:`user-menu`})],ma.prototype,`userMenu`,void 0),K([W({type:Object})],ma.prototype,`representing`,void 0),K([W({type:Array,attribute:`user-menu-footer`})],ma.prototype,`userMenuFooter`,void 0),K([W({type:Array,attribute:`user-options`})],ma.prototype,`userOptions`,void 0);try{U(`pkt-header`)(ma)}catch{console.warn(`Forsøker å definere <pkt-header>, men den er allerede definert`)}var ha={calendar:{buttonAltText:`Åpne kalender`}},ga={calendar:{buttonAltText:`Åpne kalender`},generic:{from:`Fra`,to:`Til`}},_a=class extends Ye{constructor(...e){super(...e),this.dates=[],this.dateformat=`dd.MM.yyyy`,this.className=`pkt-datepicker__tags`,this.idBase=bi()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},j`
1077
- <div class=${q(this.classes)} aria-live="polite">
1078
- ${Array.isArray(this.dates)&&this.dates[0]?_i(Br((this.dates??[]).filter(Boolean)),e=>e,e=>j` <pkt-tag
1076
+ `}};G([U({type:String,attribute:`service-name`})],ha.prototype,`serviceName`,void 0),G([U({type:String,attribute:`service-link`})],ha.prototype,`serviceLink`,void 0),G([U({type:String,attribute:`logo-link`})],ha.prototype,`logoLink`,void 0),G([U({type:String,attribute:`search-placeholder`})],ha.prototype,`searchPlaceholder`,void 0),G([U({type:String,attribute:`search-value`})],ha.prototype,`searchValue`,void 0),G([U({type:Number,attribute:`mobile-breakpoint`})],ha.prototype,`mobileBreakpoint`,void 0),G([U({type:Number,attribute:`tablet-breakpoint`})],ha.prototype,`tabletBreakpoint`,void 0),G([U({type:String,attribute:`opened-menu`})],ha.prototype,`openedMenu`,void 0),G([U({type:String,attribute:`log-out-button-placement`})],ha.prototype,`logOutButtonPlacement`,void 0),G([U({type:String})],ha.prototype,`position`,void 0),G([U({type:String,attribute:`scroll-behavior`})],ha.prototype,`scrollBehavior`,void 0),G([U({type:String,attribute:`slot-menu-variant`})],ha.prototype,`slotMenuVariant`,void 0),G([U({type:String,attribute:`slot-menu-text`})],ha.prototype,`slotMenuText`,void 0),G([U({type:Boolean,attribute:`hide-logo`,converter:Bi})],ha.prototype,`hideLogo`,void 0),G([U({type:Boolean,converter:Bi})],ha.prototype,`compact`,void 0),G([U({type:Boolean,attribute:`show-search`,converter:Bi})],ha.prototype,`showSearch`,void 0),G([U({type:Boolean,attribute:`can-change-representation`,converter:Bi})],ha.prototype,`canChangeRepresentation`,void 0),G([U({type:Boolean,attribute:`has-log-out`,converter:Bi})],ha.prototype,`hasLogOut`,void 0),G([U({type:Object})],ha.prototype,`user`,void 0),G([U({type:Array,attribute:`user-menu`})],ha.prototype,`userMenu`,void 0),G([U({type:Object})],ha.prototype,`representing`,void 0),G([U({type:Array,attribute:`user-menu-footer`})],ha.prototype,`userMenuFooter`,void 0),G([U({type:Array,attribute:`user-options`})],ha.prototype,`userOptions`,void 0);try{H(`pkt-header`)(ha)}catch{console.warn(`Forsøker å definere <pkt-header>, men den er allerede definert`)}var ga={calendar:{buttonAltText:`Åpne kalender`}},_a={calendar:{buttonAltText:`Åpne kalender`},generic:{from:`Fra`,to:`Til`}},va=class extends Xe{constructor(...e){super(...e),this.dates=[],this.dateformat=`dd.MM.yyyy`,this.className=`pkt-datepicker__tags`,this.idBase=xi()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},j`
1077
+ <div class=${K(this.classes)} aria-live="polite">
1078
+ ${Array.isArray(this.dates)&&this.dates[0]?vi(Vr((this.dates??[]).filter(Boolean)),e=>e,e=>j` <pkt-tag
1079
1079
  id=${this.idBase+e+`-tag`}
1080
1080
  closeTag
1081
1081
  @close=${()=>{this.dispatchEvent(new CustomEvent(`date-tag-removed`,{detail:e}))}}
1082
- .ariaLabel=${`${this.strings?.calendar.deleteDate} ${Or(e,this.dateformat)}`}
1082
+ .ariaLabel=${`${this.strings?.calendar.deleteDate} ${kr(e,this.dateformat)}`}
1083
1083
  >
1084
- <time datetime=${e}>${Or(e,this.dateformat)}</time>
1084
+ <time datetime=${e}>${kr(e,this.dateformat)}</time>
1085
1085
  </pkt-tag>`):N}
1086
1086
  </div>
1087
- `}};K([W({type:Array})],_a.prototype,`dates`,void 0),K([W({type:String})],_a.prototype,`dateformat`,void 0),K([W({type:String,attribute:`class`})],_a.prototype,`className`,void 0),K([W({type:String,attribute:`id-base`})],_a.prototype,`idBase`,void 0);try{U(`pkt-date-tags`)(_a)}catch{console.warn(`Forsøker å definere <pkt-date-tags>, men den er allerede definert`)}var va={name:`pkt-datepicker`,react:`PktDatepicker`,"css-class":`pkt-datepicker`,isElement:!0,isPureReact:!0,"dark-mode":!0,props:{name:{type:`string`,name:`Navn for innsending`,category:`tech`},label:{type:`string`,name:`Tekst/label`,category:`contents`},helptext:{type:`string`,name:`Hjelpetekst`,category:`contents`},helptextDropdown:{type:`string`,name:`Utvidet hjelpetekst`,description:`Hjelpetekst som vises i en lukket boks man kan åpne`,category:`contents`},helptextDropdownButton:{type:`string`,name:`Knappetekst for utvidet hjelpetekst`,default:`Les mer`,category:`contents`},dateformat:{name:`Datoformat for tags i flervalg`,type:`string`,default:`dd.MM.yyyy`,category:`tech`},currentmonth:{name:`Måned som vises i datovelgeren`,type:`ISOdatestring`,category:`tech`},value:{name:`Verdi (kommaseparert ved flervalg)`,type:`ISOdatestring`,variant:`multiple`,category:`tech`},excludeweekdays:{name:`Utelat ukedager`,type:`string`,description:`Kommaseparert liste over ukedager (1-7) som skal ekskluderes`,category:`functionality`},excludedates:{name:`Utelat datoer (Kommaseparerte ISO-datoer)`,type:`ISOdatestring`,variant:`multiple`,category:`functionality`},min:{name:`Tidligst tillatte dato`,type:`ISOdatestring`,default:null,category:`functionality`},max:{name:`Senest tillatte dato`,type:`ISOdatestring`,default:null,category:`functionality`},weeknumbers:{name:`Vis ukenummer`,type:`boolean`,reflect:!0,default:!1,category:`ui`},withcontrols:{name:`Med velgere for måned/år`,type:`boolean`,reflect:!0,default:!1,category:`ui`},multiple:{name:`Flervalg`,type:`boolean`,reflect:!0,default:!1,category:`functionality`},maxlength:{name:`Maks antall datoer i flervalg`,type:`number`,category:`functionality`,showIf:{multiple:!0}},range:{name:`Datotidsrom (fra og til)`,type:`boolean`,reflect:!0,default:!1,category:`functionality`},showRangeLabels:{attribute:`show-range-labels`,name:`Vis fra/til-etiketter`,type:`boolean`,default:!1,category:`ui`,showIf:{range:!0}},today:{name:`Dagens dato (overstyring)`,type:`ISOdatestring`,description:`ISO-datostreng som overstyrer dagens dato i kalenderen. Nyttig for snapshot-tester.`,category:`tech`},calendarOpen:{attribute:`calendar-open`,name:`Kalender åpen`,type:`boolean`,reflect:!0,default:!1,category:`ui`},hasError:{type:`boolean`,name:`Feil`,default:!1,category:`ui`},errorMessage:{type:`string`,name:`Feilmelding ved feil`,category:`contents`},disabled:{type:`boolean`,name:`Deaktivert`,default:!1,reflect:!0,category:`tech`},fullwidth:{type:`boolean`,name:`Full bredde`,default:!1,reflect:!0,category:`ui`},required:{type:`boolean`,name:`Påkrevd`,default:!1,reflect:!0,category:`tech`},requiredTag:{type:`boolean`,name:`Vise påkrevd-merking`,default:!1,category:`ui`},requiredText:{type:`string`,name:`Påkrevd-tekst`,default:`Må fylles ut`,category:`contents`},optionalTag:{type:`boolean`,name:`Vise valgfritt-merking`,default:!1,category:`ui`},optionalText:{type:`string`,name:`Valgfritt-tekst`,default:`Valgfritt`,category:`contents`},tagText:{type:`string`,name:`Tag-tekst`,description:`Tekst som vises i en tag ved siden av label`,category:`ui`},useWrapper:{type:`boolean`,name:`Bruk wrapper`,description:`Indikerer at feltet skal ha synlig label og hjelpetekst`,displayAsFalse:!0,default:!0,category:`ui`},id:{type:`string`,name:`ID`,description:`Unik identifikasjon for datovelgeren`,category:`tech`},ariaDescribedby:{attribute:`aria-describedby`,name:`aria-describedby`,description:`Spesifiserer ID-en til elementet som beskriver feltet.`,type:`string`,category:`accessibility`}},events:{change:{type:`Event`,name:`change (Elements)`,description:`Returnerer valgt dato som streng i ISO-format. I range-modus utløses kun når begge datoer er valgt.`},"value-change":{type:`CustomEvent`,name:`value-change (Elements)`,description:`Returnerer en <code>array</code> med valgte datoer i ISO-format. I range-modus utløses kun når begge datoer er valgt.`},toggleHelpText:{type:`CustomEvent`,description:`Returnerer <code>event.detail { isOpen: true }</code> eller <code>event.detail { isOpen: false }</code> når hjelpeteksten åpnes eller lukkes`},onChange:{type:`Event`,name:`onChange (React)`,reactOnly:!0,description:`Utløses når en dato velges. <code>e.target.value</code> inneholder kommaseparerte ISO-datoer. I range-modus utløses kun når begge datoer er valgt.`},onValueChange:{type:`string[]`,name:`onValueChange (React)`,reactOnly:!0,description:`Returnerer en <code>string[]</code> med valgte datoer i ISO-format. I range-modus utløses kun når begge datoer er valgt.`}}},ya=()=>{let e=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(e)||/Macintosh/.test(e)&&`ontouchend`in document)},ba=()=>ya()?`text`:`date`,xa=e=>!e||e.length!==2?!0:Vr(e[0],e[1]),Sa=e=>Br(e),Ca=(e,t,n,r,i)=>zr(e,t,n,r,i),wa=(e,t,n,r,i,a)=>({"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":e,"pkt-datepicker--hasrangelabels":t,"pkt-datepicker--multiple":n,"pkt-datepicker--range":r,"ios-readonly-hack":i===!1&&a===`text`}),Ta=()=>({"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}),Ea=e=>({"pkt-input-prefix":e,"pkt-hide":!e}),Da=(e,t,n)=>!t&&!n?Array.isArray(e)?e[0]||``:e:Array.isArray(e)?e.join(`,`):e,Oa=(e,t,n=!1)=>{if(!e||!t)return;let r=t.parentElement?.getBoundingClientRect()||t.getBoundingClientRect(),i=n?r.height+30:r.height,a=e.getBoundingClientRect().height,o=n?`calc(100% - 30px)`:`100%`;r&&r.top+a>window.innerHeight&&r.top-a>0&&(o=`calc(100% - ${i}px - ${a}px)`),e.style.top=o},ka=(e,t,n,r,i,a)=>{let{key:o}=e;o===`,`&&(e.preventDefault(),a?a(e):i&&i()),(o===`Space`||o===` `)&&(e.preventDefault(),t(e)),o===`Enter`&&(e.preventDefault(),n?n():r?r():i&&i())},Aa=(e,t)=>{let{key:n}=e;(n===`Enter`||n===` `||n===`Space`)&&(e.preventDefault(),t(e))},ja={validateRangeOrder:xa,sortDates:Sa,filterSelectableDates:Ca},Ma={getInputType:ba},Na={submitForm(e){let t=e.internals?.form;t&&t.requestSubmit()},submitFormOrFallback(e,t){let n=e?.form;n?n.requestSubmit():t()},validateDateInput(e,t,n,r,i){let a=e.value;a&&(n&&n>a?t.setValidity({rangeUnderflow:!0},i?.forms?.messages?.rangeUnderflow||`Value is below minimum`,e):r&&r<a&&t.setValidity({rangeOverflow:!0},i?.forms?.messages?.rangeOverflow||`Value is above maximum`,e))}},Pa={addToSelected(e,t,n,r){let i=e.target;if(!i.value)return;let a=n?kr(n):null,o=r?kr(r):null,s=kr(i.value.split(`,`)[0]);s&&!isNaN(s.getTime())&&(!a||s>=a)&&(!o||s<=o)&&t.value&&t.value.handleDateSelect(s),i.value=``},handleCalendarPosition(e,t,n=!1){Oa(e.value??null,t.value??null,n)}},Fa={getInputClasses:wa,getButtonClasses:Ta,getRangeLabelClasses:Ea},Ia={processDateSelection:Da,updateInputValues(e,t,n,r,i,a){e.value&&(r&&t?.value?(e.value.value=n[0]??``,t.value.value=n[1]??``,a(e.value),a(t.value)):i||(e.value.value=n.length?n[0]:``,a(e.value)))},processRangeBlur(e,t,n,r,i){let a=e.target;if(a.value){i(a);let e=Dr(a.value);e&&n?.value?.handleDateSelect(e)}else t[0]&&r()}},La={handleInputKeydown:ka,handleButtonKeydown:Aa},Ra=class extends Ye{constructor(...e){super(...e),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=Y(),this.calendarRef=Y(),this.handleDocumentClick=e=>{if(!this.open)return;let t=e.composedPath(),n=this.parentElement,r=this.popupRef.value;!t.includes(this)&&!t.includes(r)&&!(n&&t.includes(n))&&(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(){this.open=!0,this.calendarRef.value?.focus()}hide(){this.open=!1}toggle(){this.open?this.hide():this.show()}contains(e){return!!e&&!!this.popupRef.value?.contains(e)}focusOnCurrentDate(){let e=this.calendarRef.value;e&&typeof e.focusOnCurrentDate==`function`&&e.focusOnCurrentDate()}addToSelected(e,t,n){if(this.calendarRef.value&&typeof Pa.addToSelected==`function`)return Pa.addToSelected(e,this.calendarRef,t,n);let r=e.target;if(!r.value)return;let i=t?kr(t):null,a=n?kr(n):null,o=kr(r.value.split(`,`)[0]);o&&!isNaN(o.getTime())&&(!i||o>=i)&&(!a||o<=a)&&this.handleDateSelect(o),r.value=``}handleDateSelect(e){let t=this.calendarRef.value;if(t&&typeof t.handleDateSelect==`function`)return t.handleDateSelect(e);let n=Er(e),r=this.selected.indexOf(n)>=0?this.selected.filter(e=>e!==n):[...this.selected,n];this.selected=r,this.dispatchEvent(new CustomEvent(`date-selected`,{detail:r,bubbles:!0,composed:!0}))}render(){return j`
1087
+ `}};G([U({type:Array})],va.prototype,`dates`,void 0),G([U({type:String})],va.prototype,`dateformat`,void 0),G([U({type:String,attribute:`class`})],va.prototype,`className`,void 0),G([U({type:String,attribute:`id-base`})],va.prototype,`idBase`,void 0);try{H(`pkt-date-tags`)(va)}catch{console.warn(`Forsøker å definere <pkt-date-tags>, men den er allerede definert`)}var ya={name:`pkt-datepicker`,react:`PktDatepicker`,"css-class":`pkt-datepicker`,isElement:!0,isPureReact:!0,"dark-mode":!0,props:{name:{type:`string`,name:`Navn for innsending`,category:`tech`},label:{type:`string`,name:`Tekst/label`,category:`contents`},helptext:{type:`string`,name:`Hjelpetekst`,category:`contents`},helptextDropdown:{type:`string`,name:`Utvidet hjelpetekst`,description:`Hjelpetekst som vises i en lukket boks man kan åpne`,category:`contents`},helptextDropdownButton:{type:`string`,name:`Knappetekst for utvidet hjelpetekst`,default:`Les mer`,category:`contents`},dateformat:{name:`Datoformat for tags i flervalg`,type:`string`,default:`dd.MM.yyyy`,category:`tech`},currentmonth:{name:`Måned som vises i datovelgeren`,type:`ISOdatestring`,category:`tech`},value:{name:`Verdi (kommaseparert ved flervalg)`,type:`ISOdatestring`,variant:`multiple`,category:`tech`},excludeweekdays:{name:`Utelat ukedager`,type:`string`,description:`Kommaseparert liste over ukedager (1-7) som skal ekskluderes`,category:`functionality`},excludedates:{name:`Utelat datoer (Kommaseparerte ISO-datoer)`,type:`ISOdatestring`,variant:`multiple`,category:`functionality`},min:{name:`Tidligst tillatte dato`,type:`ISOdatestring`,default:null,category:`functionality`},max:{name:`Senest tillatte dato`,type:`ISOdatestring`,default:null,category:`functionality`},weeknumbers:{name:`Vis ukenummer`,type:`boolean`,reflect:!0,default:!1,category:`ui`},withcontrols:{name:`Med velgere for måned/år`,type:`boolean`,reflect:!0,default:!1,category:`ui`},multiple:{name:`Flervalg`,type:`boolean`,reflect:!0,default:!1,category:`functionality`},maxlength:{name:`Maks antall datoer i flervalg`,type:`number`,category:`functionality`,showIf:{multiple:!0}},range:{name:`Datotidsrom (fra og til)`,type:`boolean`,reflect:!0,default:!1,category:`functionality`},showRangeLabels:{attribute:`show-range-labels`,name:`Vis fra/til-etiketter`,type:`boolean`,default:!1,category:`ui`,showIf:{range:!0}},today:{name:`Dagens dato (overstyring)`,type:`ISOdatestring`,description:`ISO-datostreng som overstyrer dagens dato i kalenderen. Nyttig for snapshot-tester.`,category:`tech`},calendarOpen:{attribute:`calendar-open`,name:`Kalender åpen`,type:`boolean`,reflect:!0,default:!1,category:`ui`},hasError:{type:`boolean`,name:`Feil`,default:!1,category:`ui`},errorMessage:{type:`string`,name:`Feilmelding ved feil`,category:`contents`},disabled:{type:`boolean`,name:`Deaktivert`,default:!1,reflect:!0,category:`tech`},fullwidth:{type:`boolean`,name:`Full bredde`,default:!1,reflect:!0,category:`ui`},required:{type:`boolean`,name:`Påkrevd`,default:!1,reflect:!0,category:`tech`},requiredTag:{type:`boolean`,name:`Vise påkrevd-merking`,default:!1,category:`ui`},requiredText:{type:`string`,name:`Påkrevd-tekst`,default:`Må fylles ut`,category:`contents`},optionalTag:{type:`boolean`,name:`Vise valgfritt-merking`,default:!1,category:`ui`},optionalText:{type:`string`,name:`Valgfritt-tekst`,default:`Valgfritt`,category:`contents`},tagText:{type:`string`,name:`Tag-tekst`,description:`Tekst som vises i en tag ved siden av label`,category:`ui`},useWrapper:{type:`boolean`,name:`Bruk wrapper`,description:`Indikerer at feltet skal ha synlig label og hjelpetekst`,displayAsFalse:!0,default:!0,category:`ui`},id:{type:`string`,name:`ID`,description:`Unik identifikasjon for datovelgeren`,category:`tech`},ariaDescribedby:{attribute:`aria-describedby`,name:`aria-describedby`,description:`Spesifiserer ID-en til elementet som beskriver feltet.`,type:`string`,category:`accessibility`}},events:{change:{type:`Event`,name:`change (Elements)`,description:`Returnerer valgt dato som streng i ISO-format. I range-modus utløses kun når begge datoer er valgt.`},"value-change":{type:`CustomEvent`,name:`value-change (Elements)`,description:`Returnerer en <code>array</code> med valgte datoer i ISO-format. I range-modus utløses kun når begge datoer er valgt.`},toggleHelpText:{type:`CustomEvent`,description:`Returnerer <code>event.detail { isOpen: true }</code> eller <code>event.detail { isOpen: false }</code> når hjelpeteksten åpnes eller lukkes`},onChange:{type:`Event`,name:`onChange (React)`,reactOnly:!0,description:`Utløses når en dato velges. <code>e.target.value</code> inneholder kommaseparerte ISO-datoer. I range-modus utløses kun når begge datoer er valgt.`},onValueChange:{type:`string[]`,name:`onValueChange (React)`,reactOnly:!0,description:`Returnerer en <code>string[]</code> med valgte datoer i ISO-format. I range-modus utløses kun når begge datoer er valgt.`}}},ba=()=>{let e=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(e)||/Macintosh/.test(e)&&`ontouchend`in document)},xa=()=>ba()?`text`:`date`,Sa=e=>!e||e.length!==2?!0:Hr(e[0],e[1]),Ca=e=>Vr(e),wa=(e,t,n,r,i)=>Br(e,t,n,r,i),Ta=(e,t,n,r,i,a)=>({"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":e,"pkt-datepicker--hasrangelabels":t,"pkt-datepicker--multiple":n,"pkt-datepicker--range":r,"ios-readonly-hack":i===!1&&a===`text`}),Ea=()=>({"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}),Da=e=>({"pkt-input-prefix":e,"pkt-hide":!e}),Oa=(e,t,n)=>!t&&!n?Array.isArray(e)?e[0]||``:e:Array.isArray(e)?e.join(`,`):e,ka=(e,t,n=!1)=>{if(!e||!t)return;let r=t.parentElement?.getBoundingClientRect()||t.getBoundingClientRect(),i=n?r.height+30:r.height,a=e.getBoundingClientRect().height,o=n?`calc(100% - 30px)`:`100%`;r&&r.top+a>window.innerHeight&&r.top-a>0&&(o=`calc(100% - ${i}px - ${a}px)`),e.style.top=o},Aa=(e,t,n,r,i,a)=>{let{key:o}=e;o===`,`&&(e.preventDefault(),a?a(e):i&&i()),(o===`Space`||o===` `)&&(e.preventDefault(),t(e)),o===`Enter`&&(e.preventDefault(),n?n():r?r():i&&i())},ja=(e,t)=>{let{key:n}=e;(n===`Enter`||n===` `||n===`Space`)&&(e.preventDefault(),t(e))},Ma={validateRangeOrder:Sa,sortDates:Ca,filterSelectableDates:wa},Na={getInputType:xa},Pa={submitForm(e){let t=e.internals?.form;t&&t.requestSubmit()},submitFormOrFallback(e,t){let n=e?.form;n?n.requestSubmit():t()},validateDateInput(e,t,n,r,i){let a=e.value;a&&(n&&n>a?t.setValidity({rangeUnderflow:!0},i?.forms?.messages?.rangeUnderflow||`Value is below minimum`,e):r&&r<a&&t.setValidity({rangeOverflow:!0},i?.forms?.messages?.rangeOverflow||`Value is above maximum`,e))}},Fa={addToSelected(e,t,n,r){let i=e.target;if(!i.value)return;let a=n?Ar(n):null,o=r?Ar(r):null,s=Ar(i.value.split(`,`)[0]);s&&!isNaN(s.getTime())&&(!a||s>=a)&&(!o||s<=o)&&t.value&&t.value.handleDateSelect(s),i.value=``},handleCalendarPosition(e,t,n=!1){ka(e.value??null,t.value??null,n)}},Ia={getInputClasses:Ta,getButtonClasses:Ea,getRangeLabelClasses:Da},La={processDateSelection:Oa,updateInputValues(e,t,n,r,i,a){e.value&&(r&&t?.value?(e.value.value=n[0]??``,t.value.value=n[1]??``,a(e.value),a(t.value)):i||(e.value.value=n.length?n[0]:``,a(e.value)))},processRangeBlur(e,t,n,r,i){let a=e.target;if(a.value){i(a);let e=Or(a.value);e&&n?.value?.handleDateSelect(e)}else t[0]&&r()}},Ra={handleInputKeydown:Aa,handleButtonKeydown:ja},za=class extends Xe{constructor(...e){super(...e),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=J(),this.calendarRef=J(),this.handleDocumentClick=e=>{if(!this.open)return;let t=e.composedPath(),n=this.parentElement,r=this.popupRef.value;!t.includes(this)&&!t.includes(r)&&!(n&&t.includes(n))&&(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(){this.open=!0,this.calendarRef.value?.focus()}hide(){this.open=!1}toggle(){this.open?this.hide():this.show()}contains(e){return!!e&&!!this.popupRef.value?.contains(e)}focusOnCurrentDate(){let e=this.calendarRef.value;e&&typeof e.focusOnCurrentDate==`function`&&e.focusOnCurrentDate()}addToSelected(e,t,n){if(this.calendarRef.value&&typeof Fa.addToSelected==`function`)return Fa.addToSelected(e,this.calendarRef,t,n);let r=e.target;if(!r.value)return;let i=t?Ar(t):null,a=n?Ar(n):null,o=Ar(r.value.split(`,`)[0]);o&&!isNaN(o.getTime())&&(!i||o>=i)&&(!a||o<=a)&&this.handleDateSelect(o),r.value=``}handleDateSelect(e){let t=this.calendarRef.value;if(t&&typeof t.handleDateSelect==`function`)return t.handleDateSelect(e);let n=Dr(e),r=this.selected.indexOf(n)>=0?this.selected.filter(e=>e!==n):[...this.selected,n];this.selected=r,this.dispatchEvent(new CustomEvent(`date-selected`,{detail:r,bubbles:!0,composed:!0}))}render(){return j`
1088
1088
  <div
1089
- class="${q({"pkt-calendar-popup":!0,show:this.open,hide:!this.open})}"
1090
- ${X(this.popupRef)}
1089
+ class="${K({"pkt-calendar-popup":!0,show:this.open,hide:!this.open})}"
1090
+ ${Y(this.popupRef)}
1091
1091
  id="date-popup"
1092
1092
  ?hidden=${!this.open}
1093
1093
  aria-hidden="${!this.open}"
1094
1094
  >
1095
1095
  ${this.open||this._hasBeenOpened?j`<pkt-calendar
1096
- ${X(this.calendarRef)}
1096
+ ${Y(this.calendarRef)}
1097
1097
  ?multiple=${this.multiple}
1098
1098
  ?range=${this.range}
1099
1099
  ?weeknumbers=${this.weeknumbers}
@@ -1110,9 +1110,9 @@
1110
1110
  @close=${()=>{this.hide(),this.dispatchEvent(new CustomEvent(`close`,{bubbles:!0,composed:!0}))}}
1111
1111
  ></pkt-calendar>`:N}
1112
1112
  </div>
1113
- `}};K([W({type:Boolean,reflect:!0})],Ra.prototype,`open`,void 0),K([W({type:Boolean})],Ra.prototype,`multiple`,void 0),K([W({type:Boolean})],Ra.prototype,`range`,void 0),K([W({type:Boolean})],Ra.prototype,`weeknumbers`,void 0),K([W({type:Boolean})],Ra.prototype,`withcontrols`,void 0),K([W({type:Number})],Ra.prototype,`maxMultiple`,void 0),K([W({type:Array})],Ra.prototype,`selected`,void 0),K([W({type:String})],Ra.prototype,`earliest`,void 0),K([W({type:String})],Ra.prototype,`latest`,void 0),K([W({type:Array})],Ra.prototype,`excludedates`,void 0),K([W({type:Array})],Ra.prototype,`excludeweekdays`,void 0),K([W({type:String})],Ra.prototype,`currentmonth`,void 0),K([W({type:String})],Ra.prototype,`today`,void 0),K([G()],Ra.prototype,`_hasBeenOpened`,void 0);try{U(`pkt-datepicker-popup`)(Ra)}catch{console.warn(`Forsøker å definere <pkt-datepicker-popup>, men den er allerede definert`)}var za=class extends Ye{constructor(...e){super(...e),this.inputType=`date`,this.id=``,this.readonly=!1,this.disabled=!1,this.inputClasses={},this.inputRef=Y(),this.btnRef=Y()}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(){return j`
1113
+ `}};G([U({type:Boolean,reflect:!0})],za.prototype,`open`,void 0),G([U({type:Boolean})],za.prototype,`multiple`,void 0),G([U({type:Boolean})],za.prototype,`range`,void 0),G([U({type:Boolean})],za.prototype,`weeknumbers`,void 0),G([U({type:Boolean})],za.prototype,`withcontrols`,void 0),G([U({type:Number})],za.prototype,`maxMultiple`,void 0),G([U({type:Array})],za.prototype,`selected`,void 0),G([U({type:String})],za.prototype,`earliest`,void 0),G([U({type:String})],za.prototype,`latest`,void 0),G([U({type:Array})],za.prototype,`excludedates`,void 0),G([U({type:Array})],za.prototype,`excludeweekdays`,void 0),G([U({type:String})],za.prototype,`currentmonth`,void 0),G([U({type:String})],za.prototype,`today`,void 0),G([W()],za.prototype,`_hasBeenOpened`,void 0);try{H(`pkt-datepicker-popup`)(za)}catch{console.warn(`Forsøker å definere <pkt-datepicker-popup>, men den er allerede definert`)}var Ba=class extends Xe{constructor(...e){super(...e),this.inputType=`date`,this.id=``,this.readonly=!1,this.disabled=!1,this.inputClasses={},this.inputRef=J(),this.btnRef=J()}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(){return j`
1114
1114
  <button
1115
- class="${q(Fa.getButtonClasses())}"
1115
+ class="${K(Ia.getButtonClasses())}"
1116
1116
  type="button"
1117
1117
  @click=${e=>this.dispatchToggleCalendar(e)}
1118
1118
  @keydown=${e=>{let{key:t}=e;(t===`Enter`||t===` `||t===`Space`)&&(e.preventDefault(),this.dispatchToggleCalendar(e))}}
@@ -1122,102 +1122,102 @@
1122
1122
  <pkt-icon name="calendar"></pkt-icon>
1123
1123
  <span class="pkt-btn__text">${this.strings.calendar?.buttonAltText||`Åpne kalender`}</span>
1124
1124
  </button>
1125
- `}createRenderRoot(){return this}};K([W({type:String})],za.prototype,`inputType`,void 0),K([W({type:String})],za.prototype,`id`,void 0),K([W({type:String})],za.prototype,`min`,void 0),K([W({type:String})],za.prototype,`max`,void 0),K([W({type:String})],za.prototype,`placeholder`,void 0),K([W({type:Boolean})],za.prototype,`readonly`,void 0),K([W({type:Boolean})],za.prototype,`disabled`,void 0),K([W({type:Object})],za.prototype,`inputClasses`,void 0),K([W({type:Object})],za.prototype,`internals`,void 0);var Ba=class extends za{constructor(...e){super(...e),this.value=``,this.strings=ha}dispatchManageValidity(e){this.dispatchEvent(new CustomEvent(`manage-validity`,{detail:e,bubbles:!0,composed:!0}))}render(){return j`
1125
+ `}createRenderRoot(){return this}};G([U({type:String})],Ba.prototype,`inputType`,void 0),G([U({type:String})],Ba.prototype,`id`,void 0),G([U({type:String})],Ba.prototype,`min`,void 0),G([U({type:String})],Ba.prototype,`max`,void 0),G([U({type:String})],Ba.prototype,`placeholder`,void 0),G([U({type:Boolean})],Ba.prototype,`readonly`,void 0),G([U({type:Boolean})],Ba.prototype,`disabled`,void 0),G([U({type:Object})],Ba.prototype,`inputClasses`,void 0),G([U({type:Object})],Ba.prototype,`internals`,void 0);var Va=class extends Ba{constructor(...e){super(...e),this.value=``,this.strings=ga}dispatchManageValidity(e){this.dispatchEvent(new CustomEvent(`manage-validity`,{detail:e,bubbles:!0,composed:!0}))}render(){return j`
1126
1126
  <div class="pkt-input__container">
1127
1127
  <input
1128
- class="${q(this.inputClasses)}"
1128
+ class="${K(this.inputClasses)}"
1129
1129
  .type=${this.inputType}
1130
1130
  id="${this.id}-input"
1131
1131
  .value=${this.value}
1132
- min=${J(this.min)}
1133
- max=${J(this.max)}
1134
- placeholder=${J(this.placeholder)}
1132
+ min=${q(this.min)}
1133
+ max=${q(this.max)}
1134
+ placeholder=${q(this.placeholder)}
1135
1135
  ?readonly=${this.isInputReadonly}
1136
1136
  aria-describedby="${this.id}-helptext"
1137
1137
  @click=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
1138
1138
  @touchend=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
1139
1139
  ?disabled=${this.disabled}
1140
- @keydown=${e=>La.handleInputKeydown(e,e=>this.dispatchToggleCalendar(e),()=>Na.submitFormOrFallback(this.internals,()=>this.inputRef.value?.blur()),void 0,()=>this.inputRef.value?.blur())}
1140
+ @keydown=${e=>Ra.handleInputKeydown(e,e=>this.dispatchToggleCalendar(e),()=>Pa.submitFormOrFallback(this.internals,()=>this.inputRef.value?.blur()),void 0,()=>this.inputRef.value?.blur())}
1141
1141
  @input=${e=>{this.dispatchInput(e),e.stopImmediatePropagation()}}
1142
- @focus=${()=>{this.dispatchFocus(),ya()&&this.dispatchToggleCalendar(new Event(`focus`))}}
1142
+ @focus=${()=>{this.dispatchFocus(),ba()&&this.dispatchToggleCalendar(new Event(`focus`))}}
1143
1143
  @blur=${e=>{this.dispatchBlur(e),this.dispatchManageValidity(e.target),this.dispatchEvent(new CustomEvent(`value-change`,{detail:e.target.value,bubbles:!0,composed:!0}))}}
1144
1144
  @change=${e=>{this.dispatchChange(e),e.stopImmediatePropagation()}}
1145
- ${X(this.inputRef)}
1145
+ ${Y(this.inputRef)}
1146
1146
  />
1147
1147
  ${this.renderCalendarButton()}
1148
1148
  </div>
1149
- `}};K([W({type:String})],Ba.prototype,`value`,void 0),K([W({type:Object})],Ba.prototype,`strings`,void 0);try{U(`pkt-datepicker-single`)(Ba)}catch{console.warn(`Forsøker å definere <pkt-datepicker-single>, men den er allerede definert`)}var Va=class extends za{constructor(...e){super(...e),this.value=[],this.label=``,this.showRangeLabels=!1,this.strings=ga,this.inputRefTo=Y()}get inputElementTo(){return this.inputRefTo.value}render(){let e=Fa.getRangeLabelClasses(this.showRangeLabels);return j`
1149
+ `}};G([U({type:String})],Va.prototype,`value`,void 0),G([U({type:Object})],Va.prototype,`strings`,void 0);try{H(`pkt-datepicker-single`)(Va)}catch{console.warn(`Forsøker å definere <pkt-datepicker-single>, men den er allerede definert`)}var Ha=class extends Ba{constructor(...e){super(...e),this.value=[],this.label=``,this.showRangeLabels=!1,this.strings=_a,this.inputRefTo=J()}get inputElementTo(){return this.inputRefTo.value}render(){let e=Ia.getRangeLabelClasses(this.showRangeLabels);return j`
1150
1150
  <div class="pkt-input__container">
1151
1151
  ${this.showRangeLabels?j` <div class="pkt-input-prefix">${this.strings.generic?.from}</div> `:N}
1152
1152
  <input
1153
- class=${q(this.inputClasses)}
1153
+ class=${K(this.inputClasses)}
1154
1154
  .type=${this.inputType}
1155
1155
  id="${this.id}-input"
1156
1156
  aria-label="${this.label} ${this.strings.generic?.from??`Fra`}"
1157
1157
  .value=${this.value[0]??``}
1158
- min=${J(this.min)}
1159
- max=${J(this.max)}
1160
- placeholder=${J(this.placeholder)}
1158
+ min=${q(this.min)}
1159
+ max=${q(this.max)}
1160
+ placeholder=${q(this.placeholder)}
1161
1161
  ?readonly=${this.isInputReadonly}
1162
1162
  ?disabled=${this.disabled}
1163
1163
  @click=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
1164
1164
  @touchend=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
1165
- @keydown=${e=>La.handleInputKeydown(e,e=>this.dispatchToggleCalendar(e),()=>Na.submitFormOrFallback(this.internals,()=>this.inputRefTo.value?.focus()),()=>this.inputRefTo.value?.focus(),()=>this.inputRef.value?.blur())}
1165
+ @keydown=${e=>Ra.handleInputKeydown(e,e=>this.dispatchToggleCalendar(e),()=>Pa.submitFormOrFallback(this.internals,()=>this.inputRefTo.value?.focus()),()=>this.inputRefTo.value?.focus(),()=>this.inputRef.value?.blur())}
1166
1166
  @input=${e=>{this.dispatchInput(e),e.stopImmediatePropagation()}}
1167
- @focus=${()=>{this.dispatchFocus(),ya()&&this.dispatchToggleCalendar(new Event(`focus`))}}
1167
+ @focus=${()=>{this.dispatchFocus(),ba()&&this.dispatchToggleCalendar(new Event(`focus`))}}
1168
1168
  @blur=${e=>{this.dispatchBlur(e),this.dispatchEvent(new CustomEvent(`range-blur`,{detail:{event:e,values:this.value,inputType:`from`},bubbles:!0,composed:!0}))}}
1169
1169
  @change=${e=>{this.dispatchChange(e),e.stopImmediatePropagation()}}
1170
- ${X(this.inputRef)}
1170
+ ${Y(this.inputRef)}
1171
1171
  />
1172
- <div class="${q(e)}" id="${this.id}-to-label">
1172
+ <div class="${K(e)}" id="${this.id}-to-label">
1173
1173
  ${this.strings.generic?.to}
1174
1174
  </div>
1175
1175
  ${this.showRangeLabels?N:j` <div class="pkt-input-separator">–</div> `}
1176
1176
  <input
1177
- class=${q(this.inputClasses)}
1177
+ class=${K(this.inputClasses)}
1178
1178
  .type=${this.inputType}
1179
1179
  id="${this.id}-to"
1180
1180
  aria-label="${this.label} ${this.strings.generic?.to??`Til`}"
1181
1181
  .value=${this.value[1]??``}
1182
- min=${J(this.min)}
1183
- max=${J(this.max)}
1184
- placeholder=${J(this.placeholder)}
1182
+ min=${q(this.min)}
1183
+ max=${q(this.max)}
1184
+ placeholder=${q(this.placeholder)}
1185
1185
  ?readonly=${this.isInputReadonly}
1186
1186
  ?disabled=${this.disabled}
1187
1187
  @click=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
1188
1188
  @touchend=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
1189
- @keydown=${e=>La.handleInputKeydown(e,e=>this.dispatchToggleCalendar(e),()=>Na.submitFormOrFallback(this.internals,()=>this.inputRefTo.value?.blur()),void 0,()=>this.inputRefTo.value?.blur())}
1189
+ @keydown=${e=>Ra.handleInputKeydown(e,e=>this.dispatchToggleCalendar(e),()=>Pa.submitFormOrFallback(this.internals,()=>this.inputRefTo.value?.blur()),void 0,()=>this.inputRefTo.value?.blur())}
1190
1190
  @input=${e=>{this.dispatchInput(e),e.stopImmediatePropagation()}}
1191
- @focus=${()=>{this.dispatchFocus(),ya()&&this.dispatchToggleCalendar(new Event(`focus`))}}
1191
+ @focus=${()=>{this.dispatchFocus(),ba()&&this.dispatchToggleCalendar(new Event(`focus`))}}
1192
1192
  @blur=${e=>{this.dispatchBlur(e),this.dispatchEvent(new CustomEvent(`range-blur`,{detail:{event:e,values:this.value,inputType:`to`},bubbles:!0,composed:!0}))}}
1193
1193
  @change=${e=>{this.dispatchChange(e),e.stopImmediatePropagation()}}
1194
- ${X(this.inputRefTo)}
1194
+ ${Y(this.inputRefTo)}
1195
1195
  />
1196
1196
  ${this.renderCalendarButton()}
1197
1197
  </div>
1198
- `}};K([W({type:Array})],Va.prototype,`value`,void 0),K([W({type:String})],Va.prototype,`label`,void 0),K([W({type:Boolean})],Va.prototype,`showRangeLabels`,void 0),K([W({type:Object})],Va.prototype,`strings`,void 0);try{U(`pkt-datepicker-range`)(Va)}catch{console.warn(`Forsøker å definere <pkt-datepicker-range>, men den er allerede definert`)}var Ha=class extends za{constructor(...e){super(...e),this.value=[],this.strings=ha}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 j`
1198
+ `}};G([U({type:Array})],Ha.prototype,`value`,void 0),G([U({type:String})],Ha.prototype,`label`,void 0),G([U({type:Boolean})],Ha.prototype,`showRangeLabels`,void 0),G([U({type:Object})],Ha.prototype,`strings`,void 0);try{H(`pkt-datepicker-range`)(Ha)}catch{console.warn(`Forsøker å definere <pkt-datepicker-range>, men den er allerede definert`)}var Ua=class extends Ba{constructor(...e){super(...e),this.value=[],this.strings=ga}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 j`
1199
1199
  <div class="pkt-input__container">
1200
1200
  <input
1201
- class=${q(this.inputClasses)}
1201
+ class=${K(this.inputClasses)}
1202
1202
  .type=${this.inputType}
1203
1203
  id="${this.id}-input"
1204
- min=${J(this.min)}
1205
- max=${J(this.max)}
1206
- placeholder=${J(this.placeholder)}
1204
+ min=${q(this.min)}
1205
+ max=${q(this.max)}
1206
+ placeholder=${q(this.placeholder)}
1207
1207
  ?readonly=${this.isInputReadonly}
1208
1208
  ?disabled=${this.isInputDisabled}
1209
1209
  @click=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
1210
1210
  @touchend=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
1211
1211
  @blur=${e=>{this.dispatchBlur(e),this.dispatchAddToSelected(e)}}
1212
1212
  @input=${e=>{this.dispatchInput(e),e.stopImmediatePropagation()}}
1213
- @focus=${()=>{this.dispatchFocus(),ya()&&this.dispatchToggleCalendar(new Event(`focus`))}}
1214
- @keydown=${e=>La.handleInputKeydown(e,e=>this.dispatchToggleCalendar(e),()=>Na.submitFormOrFallback(this.internals,()=>this.inputRef.value?.blur()),void 0,void 0,e=>this.dispatchAddToSelected(e))}
1213
+ @focus=${()=>{this.dispatchFocus(),ba()&&this.dispatchToggleCalendar(new Event(`focus`))}}
1214
+ @keydown=${e=>Ra.handleInputKeydown(e,e=>this.dispatchToggleCalendar(e),()=>Pa.submitFormOrFallback(this.internals,()=>this.inputRef.value?.blur()),void 0,void 0,e=>this.dispatchAddToSelected(e))}
1215
1215
  @change=${e=>{this.dispatchChange(e),e.stopImmediatePropagation()}}
1216
- ${X(this.inputRef)}
1216
+ ${Y(this.inputRef)}
1217
1217
  />
1218
1218
  ${this.renderCalendarButton()}
1219
1219
  </div>
1220
- `}};K([W({type:Array})],Ha.prototype,`value`,void 0),K([W({type:Number})],Ha.prototype,`maxlength`,void 0),K([W({type:Object})],Ha.prototype,`strings`,void 0);try{U(`pkt-datepicker-multiple`)(Ha)}catch{console.warn(`Forsøker å definere <pkt-datepicker-multiple>, men den er allerede definert`)}var Ua=class extends Z{constructor(...e){super(...e),this._valueProperty=``,this._valueProcessing=!1,this.datepickerPopupRef=Y(),this._value=[],this.label=`Datovelger`,this.dateformat=va.props.dateformat.default,this.multiple=va.props.multiple.default,this.maxlength=null,this.range=va.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=va.props.weeknumbers.default,this.withcontrols=va.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.today=null,this.calendarOpen=!1,this.timezone=`Europe/Oslo`,this.inputClasses={},this.calRef=Y(),this.popupRef=Y(),this.singleInputRef=Y(),this.rangeInputRef=Y(),this.multipleInputRef=Y(),this.addToSelected=e=>{let t=this.datepickerPopupRef.value;return t&&typeof t.addToSelected==`function`?t.addToSelected(e,this.min,this.max):Pa.addToSelected(e,this.calRef,this.min,this.max)}}get value(){return this._valueProperty}set value(e){let t=this._valueProperty;this._valueProperty=Array.isArray(e)?e.join(`,`):e||``,this.valueChanged(this._valueProperty,t),this.requestUpdate(`value`,t)}get inputType(){return Ma.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{let n=Hr(e),r=this.multiple&&n.length>1?ja.filterSelectableDates(n,this.min,this.max,this.excludedates,this.excludeweekdays):n;if(this.range&&!ja.validateRangeOrder(r)){this._value=[],this._valueProperty=``,super.valueChanged(``,t);return}this._value=r;let i=Ur(r);if(this._valueProperty!==i&&(this._valueProperty=i),this.range&&r.length<2)return;super.valueChanged(i,t)}finally{this._valueProcessing=!1}}}attributeChangedCallback(e,t,n){e===`value`&&this.value!==t&&this.valueChanged(n,t),e===`excludedates`&&typeof this.excludedates==`string`&&(this.excludedates=Hr(n||``)),e===`excludeweekdays`&&typeof this.excludeweekdays==`string`&&(this.excludeweekdays=Hr(n||``)),super.attributeChangedCallback(e,t,n)}updated(e){if(e.has(`value`)&&(e.has(`multiple`)||e.has(`range`))){let t=Array.isArray(this.value)?this.value.join(`,`):this.value,n=e.get(`value`),r=Array.isArray(n)?n.join(`,`):n;this.valueChanged(t,r)}e.has(`multiple`)&&(this.multiple&&!Array.isArray(this._value)?this._value=Hr(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(){return this.multiple?this.multipleInputRef.value?.inputElement:this.range?this.rangeInputRef.value?.inputElement:this.singleInputRef.value?.inputElement}get currentInputElementTo(){if(this.range)return this.rangeInputRef.value?.inputElementTo}get currentButtonElement(){return this.multiple?this.multipleInputRef.value?.buttonElement:this.range?this.rangeInputRef.value?.buttonElement:this.singleInputRef.value?.buttonElement}get btnRef(){return{value:this.currentButtonElement}}renderInput(){return j`
1220
+ `}};G([U({type:Array})],Ua.prototype,`value`,void 0),G([U({type:Number})],Ua.prototype,`maxlength`,void 0),G([U({type:Object})],Ua.prototype,`strings`,void 0);try{H(`pkt-datepicker-multiple`)(Ua)}catch{console.warn(`Forsøker å definere <pkt-datepicker-multiple>, men den er allerede definert`)}var Wa=class extends X{constructor(...e){super(...e),this._valueProperty=``,this._valueProcessing=!1,this.datepickerPopupRef=J(),this._value=[],this.label=`Datovelger`,this.dateformat=ya.props.dateformat.default,this.multiple=ya.props.multiple.default,this.maxlength=null,this.range=ya.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=ya.props.weeknumbers.default,this.withcontrols=ya.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.today=null,this.calendarOpen=!1,this.timezone=`Europe/Oslo`,this.inputClasses={},this.calRef=J(),this.popupRef=J(),this.singleInputRef=J(),this.rangeInputRef=J(),this.multipleInputRef=J(),this.addToSelected=e=>{let t=this.datepickerPopupRef.value;return t&&typeof t.addToSelected==`function`?t.addToSelected(e,this.min,this.max):Fa.addToSelected(e,this.calRef,this.min,this.max)}}get value(){return this._valueProperty}set value(e){let t=this._valueProperty;this._valueProperty=Array.isArray(e)?e.join(`,`):e||``,this.valueChanged(this._valueProperty,t),this.requestUpdate(`value`,t)}get inputType(){return Na.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{let n=Ur(e),r=this.multiple&&n.length>1?Ma.filterSelectableDates(n,this.min,this.max,this.excludedates,this.excludeweekdays):n;if(this.range&&!Ma.validateRangeOrder(r)){this._value=[],this._valueProperty=``,super.valueChanged(``,t);return}this._value=r;let i=Wr(r);if(this._valueProperty!==i&&(this._valueProperty=i),this.range&&r.length<2)return;super.valueChanged(i,t)}finally{this._valueProcessing=!1}}}attributeChangedCallback(e,t,n){e===`value`&&this.value!==t&&this.valueChanged(n,t),e===`excludedates`&&typeof this.excludedates==`string`&&(this.excludedates=Ur(n||``)),e===`excludeweekdays`&&typeof this.excludeweekdays==`string`&&(this.excludeweekdays=Ur(n||``)),super.attributeChangedCallback(e,t,n)}updated(e){if(e.has(`value`)&&(e.has(`multiple`)||e.has(`range`))){let t=Array.isArray(this.value)?this.value.join(`,`):this.value,n=e.get(`value`),r=Array.isArray(n)?n.join(`,`):n;this.valueChanged(t,r)}e.has(`multiple`)&&(this.multiple&&!Array.isArray(this._value)?this._value=Ur(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(){return this.multiple?this.multipleInputRef.value?.inputElement:this.range?this.rangeInputRef.value?.inputElement:this.singleInputRef.value?.inputElement}get currentInputElementTo(){if(this.range)return this.rangeInputRef.value?.inputElementTo}get currentButtonElement(){return this.multiple?this.multipleInputRef.value?.buttonElement:this.range?this.rangeInputRef.value?.buttonElement:this.singleInputRef.value?.buttonElement}get btnRef(){return{value:this.currentButtonElement}}renderInput(){return j`
1221
1221
  <pkt-datepicker-single
1222
1222
  .value=${this._value[0]??``}
1223
1223
  .inputType=${this.inputType}
@@ -1237,7 +1237,7 @@
1237
1237
  @manage-validity=${e=>this.manageValidity(e.detail)}
1238
1238
  @value-change=${e=>{this.value=e.detail}}
1239
1239
  @input-changed=${()=>{this.touched=!0}}
1240
- ${X(this.singleInputRef)}
1240
+ ${Y(this.singleInputRef)}
1241
1241
  ></pkt-datepicker-single>
1242
1242
  `}renderRangeInput(){return j`
1243
1243
  <pkt-datepicker-range
@@ -1258,12 +1258,12 @@
1258
1258
  @input-change=${()=>this.onInput()}
1259
1259
  @input-focus=${()=>this.onFocus()}
1260
1260
  @input-blur=${e=>{this.calRef.value?.contains(e.detail.relatedTarget)||this.onBlur()}}
1261
- @range-blur=${e=>{let t=this.currentInputElement,n=this.currentInputElementTo;if(t&&n){let e=t.value,r=n.value;if(e&&r&&e>r)n.value=``,this._value=[e],this.value=e;else{let t=[e,r].filter(Boolean);t.length>0&&(t[0]!==this._value[0]||t[1]!==this._value[1])&&(this._value=t,this.value=t.join(`,`))}}Ia.processRangeBlur(e.detail.event,e.detail.values,this.calRef,()=>this.clearInputValue(),e=>this.manageValidity(e))}}
1261
+ @range-blur=${e=>{let t=this.currentInputElement,n=this.currentInputElementTo;if(t&&n){let e=t.value,r=n.value;if(e&&r&&e>r)n.value=``,this._value=[e],this.value=e;else{let t=[e,r].filter(Boolean);t.length>0&&(t[0]!==this._value[0]||t[1]!==this._value[1])&&(this._value=t,this.value=t.join(`,`))}}La.processRangeBlur(e.detail.event,e.detail.values,this.calRef,()=>this.clearInputValue(),e=>this.manageValidity(e))}}
1262
1262
  @manage-validity=${e=>this.manageValidity(e.detail)}
1263
- @validate-date-input=${e=>{Na.validateDateInput(e.detail,this.internals,this.min,this.max,this.strings)}}
1264
- @handle-date-select=${e=>{let t=Dr(e.detail);if(t){let e=Er(t);this._value[0]!==e&&this._value[1]!==e&&this.calRef?.value?.handleDateSelect(t)}}}
1263
+ @validate-date-input=${e=>{Pa.validateDateInput(e.detail,this.internals,this.min,this.max,this.strings)}}
1264
+ @handle-date-select=${e=>{let t=Or(e.detail);if(t){let e=Dr(t);this._value[0]!==e&&this._value[1]!==e&&this.calRef?.value?.handleDateSelect(t)}}}
1265
1265
  @input-changed=${()=>{this.touched=!0}}
1266
- ${X(this.rangeInputRef)}
1266
+ ${Y(this.rangeInputRef)}
1267
1267
  ></pkt-datepicker-range>
1268
1268
  `}renderMultipleInput(){return j`
1269
1269
  <pkt-datepicker-multiple
@@ -1285,7 +1285,7 @@
1285
1285
  @input-blur=${e=>{this.calRef.value?.contains(e.detail.relatedTarget)||this.onBlur()}}
1286
1286
  @add-to-selected=${e=>this.addToSelected(e.detail)}
1287
1287
  @input-changed=${()=>{this.touched=!0}}
1288
- ${X(this.multipleInputRef)}
1288
+ ${Y(this.multipleInputRef)}
1289
1289
  ></pkt-datepicker-multiple>
1290
1290
  `}renderCalendar(){return j`
1291
1291
  <pkt-datepicker-popup
@@ -1301,13 +1301,13 @@
1301
1301
  .latest=${this.max}
1302
1302
  .excludedates=${Array.isArray(this.excludedates)?this.excludedates:this.excludedates.split(`,`)}
1303
1303
  .excludeweekdays=${this.excludeweekdays}
1304
- .currentmonth=${this.currentmonth?Tr(this.currentmonth):null}
1304
+ .currentmonth=${this.currentmonth?Er(this.currentmonth):null}
1305
1305
  .today=${this.today}
1306
- @date-selected=${e=>{this.value=Ia.processDateSelection(e.detail,this.multiple,this.range),this._value=e.detail,Ia.updateInputValues(this.inputRef,this.inputRefTo,this._value,this.range,this.multiple,e=>this.manageValidity(e))}}
1306
+ @date-selected=${e=>{this.value=La.processDateSelection(e.detail,this.multiple,this.range),this._value=e.detail,La.updateInputValues(this.inputRef,this.inputRefTo,this._value,this.range,this.multiple,e=>this.manageValidity(e))}}
1307
1307
  @close=${()=>{this.onBlur(),this.hideCalendar()}}
1308
- ${X(this.datepickerPopupRef)}
1308
+ ${Y(this.datepickerPopupRef)}
1309
1309
  ></pkt-datepicker-popup>
1310
- `}render(){return this.inputClasses=Fa.getInputClasses(this.fullwidth,this.showRangeLabels,this.multiple,this.range,this.readonly,this.inputType),j`
1310
+ `}render(){return this.inputClasses=Ia.getInputClasses(this.fullwidth,this.showRangeLabels,this.multiple,this.range,this.readonly,this.inputType),j`
1311
1311
  <pkt-input-wrapper
1312
1312
  label="${this.label}"
1313
1313
  forId="${this.id}-input"
@@ -1332,20 +1332,20 @@
1332
1332
  .ariaDescribedBy=${this.ariaDescribedBy}
1333
1333
  class="pkt-datepicker"
1334
1334
  >
1335
- <div class="pkt-contents" slot="helptext">${Et(this,`helptext`)}</div>
1335
+ <div class="pkt-contents" slot="helptext">${Dt(this,`helptext`)}</div>
1336
1336
  ${this.multiple?j`<pkt-date-tags
1337
1337
  .dates=${this._value}
1338
1338
  dateformat=${this.dateformat}
1339
1339
  strings=${this.strings}
1340
1340
  id-base=${this.id}
1341
- @date-tag-removed=${e=>{let t=this.datepickerPopupRef.value,n=Dr(e.detail);t&&n&&typeof t.handleDateSelect==`function`?t.handleDateSelect(n):this.calRef.value?.handleDateSelect(n)}}
1341
+ @date-tag-removed=${e=>{let t=this.datepickerPopupRef.value,n=Or(e.detail);t&&n&&typeof t.handleDateSelect==`function`?t.handleDateSelect(n):this.calRef.value?.handleDateSelect(n)}}
1342
1342
  ></pkt-date-tags>`:N}
1343
1343
  <div class="pkt-datepicker__inputs ${this.range?`pkt-input__range-inputs`:``}">
1344
1344
  ${this.range?this.renderRangeInput():this.multiple?this.renderMultipleInput():this.renderInput()}
1345
1345
  </div>
1346
1346
  </pkt-input-wrapper>
1347
1347
  ${this.renderCalendar()}
1348
- `}handleCalendarPosition(){let e=this.multiple&&!!this.maxlength;Pa.handleCalendarPosition(this.popupRef,this.inputRef,e)}async showCalendar(){let e=this.datepickerPopupRef.value;if(this.calendarOpen=!0,e&&typeof e.show==`function`){e.show(),ya()&&e.focusOnCurrentDate();return}await yi(20),this.handleCalendarPosition(),ya()&&this.calRef.value?.focusOnCurrentDate()}hideCalendar(){let e=this.datepickerPopupRef.value;if(this.calendarOpen=!1,e&&typeof e.hide==`function`)return e.hide()}async toggleCalendar(e){e.preventDefault();let t=this.datepickerPopupRef.value;if(t&&typeof t.toggle==`function`){let e=!!t.open;t.toggle(),this.calendarOpen=!e;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}))}};K([W({type:String,reflect:!0})],Ua.prototype,`value`,null),K([W({type:String,reflect:!0})],Ua.prototype,`label`,void 0),K([W({type:String})],Ua.prototype,`dateformat`,void 0),K([W({type:Boolean,reflect:!0})],Ua.prototype,`multiple`,void 0),K([W({type:Number,reflect:!0})],Ua.prototype,`maxlength`,void 0),K([W({type:Boolean,reflect:!0})],Ua.prototype,`range`,void 0),K([W({type:Boolean,attribute:`show-range-labels`})],Ua.prototype,`showRangeLabels`,void 0),K([W({type:String,reflect:!0})],Ua.prototype,`min`,void 0),K([W({type:String,reflect:!0})],Ua.prototype,`max`,void 0),K([W({type:Boolean})],Ua.prototype,`weeknumbers`,void 0),K([W({type:Boolean,reflect:!0})],Ua.prototype,`withcontrols`,void 0),K([W({converter:Wr.csvToArray})],Ua.prototype,`excludedates`,void 0),K([W({converter:Wr.csvToArray})],Ua.prototype,`excludeweekdays`,void 0),K([W({type:String})],Ua.prototype,`currentmonth`,void 0),K([W({type:String})],Ua.prototype,`today`,void 0),K([W({type:Boolean,reflect:!0,attribute:`calendar-open`})],Ua.prototype,`calendarOpen`,void 0),K([W({type:String})],Ua.prototype,`timezone`,void 0),K([G()],Ua.prototype,`inputClasses`,void 0);try{U(`pkt-datepicker`)(Ua)}catch{console.warn(`Forsøker å definere <pkt-datepicker>, men den er allerede definert`)}var Wa={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`}}}},cookies:[{name:`statistics`,defaultValue:null,i18n:{nb:{title:`Statistikk og analyse`,description:`Jeg godtar at Oslo kommune bruker informasjonskapsler til å innhente data om statistikk og brukeradferd.`,buttons:{yes:`Ja`,no:`Nei`}},en:{title:`Statistics and analytics`,description:`Select your preference for statistics and analytics`,buttons:{yes:`Yes`,no:`No`}}}},{name:`survey`,defaultValue:null,i18n:{nb:{title:`Skriftlige tilbakemeldinger`,description:`Jeg godtar at Oslo kommune bruker informasjonskapsler til å vise responsfelt og registrere tilbakemeldinger.`,buttons:{yes:`Ja`,no:`Nei`}},en:{title:`Survey`,description:`Select your preference for survey`,buttons:{yes:`Yes`,no:`No`}}}},{name:`functional`,defaultValue:!0,i18n:{nb:{title:`Funksjonelle informasjonskapsler`,description:`Jeg godtar at Oslo kommune bruker informasjonskapsler for å gjøre ulike funksjoner på nettstedet mulige (for eksempel skjemaer og barnehagevelger).`,buttons:{yes:`Ja`,no:`Nei`}},en:{title:`Functional cookies`,description:`For the website to function optimally, we recommend that you accept these cookies`,buttons:{yes:`Yes`,no:`No`}}}}]},Ga=null;function Ka(){return Ga||(Ga=new Promise((e,t)=>{if(document.querySelector(`#oslo-consent-script`)){e();return}let n=document.createElement(`script`);n.src=`https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.js`,n.id=`oslo-consent-script`,n.onload=()=>e(),n.onerror=t,document.head.appendChild(n);let r=document.createElement(`link`);r.href=`https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.css`,r.type=`text/css`,r.rel=`stylesheet`,r.id=`oslo-consent-styles`,document.head.appendChild(r)}),Ga)}var qa=class extends Ye{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||Wa.i18n[this.i18nLanguage].contentPresentation.buttons.settings}disconnectedCallback(){super.disconnectedCallback(),this._cookieEventHandler&&window.__cookieEvents?.off(`CookieManager.setCookie`,this._cookieEventHandler)}returnJsonOrObject(e){let t;try{t=JSON.parse(e)}catch{t=e}return t}emitCookieConsents(e){let t=this.returnJsonOrObject(e.value).items.reduce((e,t)=>(e[t.name]=t.consent,e),{});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 Ka(),this.triggerInit()}triggerInit(){window.document.dispatchEvent(new Event(`CookieBannerReady`,{bubbles:!0,cancelable:!0})),window.cookieBanner.cookieConsent.validateConsentCookie().then(e=>{if(e){let e={value:window.cookieBanner.cookieConsent.getConsentCookie()};window.setTimeout(()=>this.emitCookieConsents(e),0),this._cookieEventHandler&&window.__cookieEvents.off(`CookieManager.setCookie`,this._cookieEventHandler),this._cookieEventHandler=e=>{this.emitCookieConsents(e)},window.__cookieEvents.on(`CookieManager.setCookie`,this._cookieEventHandler)}})}openModal(e){e.preventDefault(),window.cookieBanner?.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner.openCookieModal())}render(){return this.triggerType===`link`?j`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType===`footerlink`?j`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
1348
+ `}handleCalendarPosition(){let e=this.multiple&&!!this.maxlength;Fa.handleCalendarPosition(this.popupRef,this.inputRef,e)}async showCalendar(){let e=this.datepickerPopupRef.value;if(this.calendarOpen=!0,e&&typeof e.show==`function`){e.show(),ba()&&e.focusOnCurrentDate();return}await bi(20),this.handleCalendarPosition(),ba()&&this.calRef.value?.focusOnCurrentDate()}hideCalendar(){let e=this.datepickerPopupRef.value;if(this.calendarOpen=!1,e&&typeof e.hide==`function`)return e.hide()}async toggleCalendar(e){e.preventDefault();let t=this.datepickerPopupRef.value;if(t&&typeof t.toggle==`function`){let e=!!t.open;t.toggle(),this.calendarOpen=!e;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}))}};G([U({type:String,reflect:!0})],Wa.prototype,`value`,null),G([U({type:String,reflect:!0})],Wa.prototype,`label`,void 0),G([U({type:String})],Wa.prototype,`dateformat`,void 0),G([U({type:Boolean,reflect:!0})],Wa.prototype,`multiple`,void 0),G([U({type:Number,reflect:!0})],Wa.prototype,`maxlength`,void 0),G([U({type:Boolean,reflect:!0})],Wa.prototype,`range`,void 0),G([U({type:Boolean,attribute:`show-range-labels`})],Wa.prototype,`showRangeLabels`,void 0),G([U({type:String,reflect:!0})],Wa.prototype,`min`,void 0),G([U({type:String,reflect:!0})],Wa.prototype,`max`,void 0),G([U({type:Boolean})],Wa.prototype,`weeknumbers`,void 0),G([U({type:Boolean,reflect:!0})],Wa.prototype,`withcontrols`,void 0),G([U({converter:Gr.csvToArray})],Wa.prototype,`excludedates`,void 0),G([U({converter:Gr.csvToArray})],Wa.prototype,`excludeweekdays`,void 0),G([U({type:String})],Wa.prototype,`currentmonth`,void 0),G([U({type:String})],Wa.prototype,`today`,void 0),G([U({type:Boolean,reflect:!0,attribute:`calendar-open`})],Wa.prototype,`calendarOpen`,void 0),G([U({type:String})],Wa.prototype,`timezone`,void 0),G([W()],Wa.prototype,`inputClasses`,void 0);try{H(`pkt-datepicker`)(Wa)}catch{console.warn(`Forsøker å definere <pkt-datepicker>, men den er allerede definert`)}var Ga={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`}}}},cookies:[{name:`statistics`,defaultValue:null,i18n:{nb:{title:`Statistikk og analyse`,description:`Jeg godtar at Oslo kommune bruker informasjonskapsler til å innhente data om statistikk og brukeradferd.`,buttons:{yes:`Ja`,no:`Nei`}},en:{title:`Statistics and analytics`,description:`Select your preference for statistics and analytics`,buttons:{yes:`Yes`,no:`No`}}}},{name:`survey`,defaultValue:null,i18n:{nb:{title:`Skriftlige tilbakemeldinger`,description:`Jeg godtar at Oslo kommune bruker informasjonskapsler til å vise responsfelt og registrere tilbakemeldinger.`,buttons:{yes:`Ja`,no:`Nei`}},en:{title:`Survey`,description:`Select your preference for survey`,buttons:{yes:`Yes`,no:`No`}}}},{name:`functional`,defaultValue:!0,i18n:{nb:{title:`Funksjonelle informasjonskapsler`,description:`Jeg godtar at Oslo kommune bruker informasjonskapsler for å gjøre ulike funksjoner på nettstedet mulige (for eksempel skjemaer og barnehagevelger).`,buttons:{yes:`Ja`,no:`Nei`}},en:{title:`Functional cookies`,description:`For the website to function optimally, we recommend that you accept these cookies`,buttons:{yes:`Yes`,no:`No`}}}}]},Ka=null;function qa(){return Ka||(Ka=new Promise((e,t)=>{if(document.querySelector(`#oslo-consent-script`)){e();return}let n=document.createElement(`script`);n.src=`https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.js`,n.id=`oslo-consent-script`,n.onload=()=>e(),n.onerror=t,document.head.appendChild(n);let r=document.createElement(`link`);r.href=`https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.css`,r.type=`text/css`,r.rel=`stylesheet`,r.id=`oslo-consent-styles`,document.head.appendChild(r)}),Ka)}var Ja=class extends Xe{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||Ga.i18n[this.i18nLanguage].contentPresentation.buttons.settings}disconnectedCallback(){super.disconnectedCallback(),this._cookieEventHandler&&window.__cookieEvents?.off(`CookieManager.setCookie`,this._cookieEventHandler)}returnJsonOrObject(e){let t;try{t=JSON.parse(e)}catch{t=e}return t}emitCookieConsents(e){let t=this.returnJsonOrObject(e.value).items.reduce((e,t)=>(e[t.name]=t.consent,e),{});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 qa(),this.triggerInit()}triggerInit(){window.document.dispatchEvent(new Event(`CookieBannerReady`,{bubbles:!0,cancelable:!0})),window.cookieBanner.cookieConsent.validateConsentCookie().then(e=>{if(e){let e={value:window.cookieBanner.cookieConsent.getConsentCookie()};window.setTimeout(()=>this.emitCookieConsents(e),0),this._cookieEventHandler&&window.__cookieEvents.off(`CookieManager.setCookie`,this._cookieEventHandler),this._cookieEventHandler=e=>{this.emitCookieConsents(e)},window.__cookieEvents.on(`CookieManager.setCookie`,this._cookieEventHandler)}})}openModal(e){e.preventDefault(),window.cookieBanner?.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner.openCookieModal())}render(){return this.triggerType===`link`?j`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType===`footerlink`?j`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
1349
1349
  <pkt-icon name="chevron-right" class="pkt-footer__link-icon"></pkt-icon>
1350
1350
  ${this.triggerText}
1351
1351
  </a>`:this.triggerType===`icon`?j`<pkt-button
@@ -1355,7 +1355,7 @@
1355
1355
  @click=${this.openModal}
1356
1356
  >
1357
1357
  >${this.triggerText}</pkt-button
1358
- >`:j`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`}};K([W({type:Boolean})],qa.prototype,`devMode`,void 0),K([W({type:String})],qa.prototype,`hotjarId`,void 0),K([W({type:String})],qa.prototype,`googleAnalyticsId`,void 0),K([W({type:String})],qa.prototype,`cookieDomain`,void 0),K([W({type:String})],qa.prototype,`cookieSecure`,void 0),K([W({type:String})],qa.prototype,`cookieExpiryDays`,void 0),K([W({type:String})],qa.prototype,`triggerType`,void 0),K([W({type:String})],qa.prototype,`triggerText`,void 0),K([W({type:String})],qa.prototype,`i18nLanguage`,void 0);try{U(`pkt-consent`)(qa)}catch{console.warn(`Forsøker å definere <pkt-consent>, men den er allerede definert`)}var Ja=class extends Z{constructor(...e){super(...e),this.inputRef=Y(),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,n){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,n)}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(){let e=q({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),t=q({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),n=q({"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}),r=`pkt-tag pkt-tag--small pkt-tag--thin-text`,i=()=>j`
1358
+ >`:j`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`}};G([U({type:Boolean})],Ja.prototype,`devMode`,void 0),G([U({type:String})],Ja.prototype,`hotjarId`,void 0),G([U({type:String})],Ja.prototype,`googleAnalyticsId`,void 0),G([U({type:String})],Ja.prototype,`cookieDomain`,void 0),G([U({type:String})],Ja.prototype,`cookieSecure`,void 0),G([U({type:String})],Ja.prototype,`cookieExpiryDays`,void 0),G([U({type:String})],Ja.prototype,`triggerType`,void 0),G([U({type:String})],Ja.prototype,`triggerText`,void 0),G([U({type:String})],Ja.prototype,`i18nLanguage`,void 0);try{H(`pkt-consent`)(Ja)}catch{console.warn(`Forsøker å definere <pkt-consent>, men den er allerede definert`)}var Ya=class extends X{constructor(...e){super(...e),this.inputRef=J(),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,n){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,n)}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(){let e=K({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),t=K({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),n=K({"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}),r=`pkt-tag pkt-tag--small pkt-tag--thin-text`,i=()=>j`
1359
1359
  ${this.tagText?j`<span class=${r+` pkt-tag--gray`}>${this.tagText}</span>`:N}
1360
1360
  ${this.optionalTag?j`<span class=${r+` pkt-tag--blue-light`}>${this.optionalText}</span>`:N}
1361
1361
  ${this.requiredTag?j`<span class=${r+` pkt-tag--beige`}>${this.requiredText}</span>`:N}
@@ -1374,7 +1374,7 @@
1374
1374
  type="checkbox"
1375
1375
  ?disabled=${this.disabled}
1376
1376
  name=${this.name+`-internal`}
1377
- ${X(this.inputRef)}
1377
+ ${Y(this.inputRef)}
1378
1378
  @change=${this.handleChange}
1379
1379
  @click=${this.handleClick}
1380
1380
  @blur=${this.onBlur}
@@ -1385,19 +1385,19 @@
1385
1385
  ${this.labelPosition===`right`?a():N}
1386
1386
  </div>
1387
1387
  </div>
1388
- `}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}let 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))}};K([W({type:String,reflect:!0})],Ja.prototype,`value`,void 0),K([W({type:String})],Ja.prototype,`checkHelptext`,void 0),K([W({type:Boolean})],Ja.prototype,`defaultChecked`,void 0),K([W({type:Boolean})],Ja.prototype,`hasTile`,void 0),K([W({type:Boolean})],Ja.prototype,`isSwitch`,void 0),K([W({type:String})],Ja.prototype,`labelPosition`,void 0),K([W({type:Boolean})],Ja.prototype,`hideLabel`,void 0),K([W({type:Boolean,reflect:!0})],Ja.prototype,`checked`,void 0),K([W({type:Boolean,reflect:!0})],Ja.prototype,`indeterminate`,void 0),K([W({type:String,reflect:!0})],Ja.prototype,`type`,void 0),K([W({type:String})],Ja.prototype,`tagText`,void 0),K([W({type:Boolean})],Ja.prototype,`optionalTag`,void 0),K([W({type:String})],Ja.prototype,`optionalText`,void 0),K([W({type:Boolean})],Ja.prototype,`requiredTag`,void 0),K([W({type:String})],Ja.prototype,`requiredText`,void 0);try{U(`pkt-checkbox`)(Ja)}catch{console.warn(`Forsøker å definere <pkt-checkbox>, men den er allerede definert`)}var Ya=class extends Dt{constructor(...e){super(...e),this.title=``,this.href=`#`,this.iconName=``,this.external=!1,this.openInNewTab=!1,this.skin=`normal`}render(){let 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 j`
1388
+ `}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}let 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))}};G([U({type:String,reflect:!0})],Ya.prototype,`value`,void 0),G([U({type:String})],Ya.prototype,`checkHelptext`,void 0),G([U({type:Boolean})],Ya.prototype,`defaultChecked`,void 0),G([U({type:Boolean})],Ya.prototype,`hasTile`,void 0),G([U({type:Boolean})],Ya.prototype,`isSwitch`,void 0),G([U({type:String})],Ya.prototype,`labelPosition`,void 0),G([U({type:Boolean})],Ya.prototype,`hideLabel`,void 0),G([U({type:Boolean,reflect:!0})],Ya.prototype,`checked`,void 0),G([U({type:Boolean,reflect:!0})],Ya.prototype,`indeterminate`,void 0),G([U({type:String,reflect:!0})],Ya.prototype,`type`,void 0),G([U({type:String})],Ya.prototype,`tagText`,void 0),G([U({type:Boolean})],Ya.prototype,`optionalTag`,void 0),G([U({type:String})],Ya.prototype,`optionalText`,void 0),G([U({type:Boolean})],Ya.prototype,`requiredTag`,void 0),G([U({type:String})],Ya.prototype,`requiredText`,void 0);try{H(`pkt-checkbox`)(Ya)}catch{console.warn(`Forsøker å definere <pkt-checkbox>, men den er allerede definert`)}var Xa=class extends Ot{constructor(...e){super(...e),this.title=``,this.href=`#`,this.iconName=``,this.external=!1,this.openInNewTab=!1,this.skin=`normal`}render(){let 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 j`
1389
1389
  <a
1390
1390
  href=${this.href}
1391
1391
  class=${e}
1392
1392
  target=${this.openInNewTab?`_blank`:`_self`}
1393
- rel=${J(this.openInNewTab?`noopener noreferrer`:void 0)}
1393
+ rel=${q(this.openInNewTab?`noopener noreferrer`:void 0)}
1394
1394
  >
1395
1395
  ${this.iconName&&j`<pkt-icon class="pkt-link__icon" name="${this.iconName}" />`}
1396
1396
  ${this.title&&j`<div class=${t}>${this.title}</div>`}
1397
1397
 
1398
- <div class="pkt-linkcard__text">${Et(this)}</div>
1398
+ <div class="pkt-linkcard__text">${Dt(this)}</div>
1399
1399
  </a>
1400
- `}};K([W({type:String,reflect:!0})],Ya.prototype,`title`,void 0),K([W({type:String,reflect:!0})],Ya.prototype,`href`,void 0),K([W({type:String,reflect:!0})],Ya.prototype,`iconName`,void 0),K([W({type:Boolean,reflect:!0})],Ya.prototype,`external`,void 0),K([W({type:Boolean,reflect:!0})],Ya.prototype,`openInNewTab`,void 0),K([W({type:String,reflect:!0})],Ya.prototype,`skin`,void 0);try{U(`pkt-linkcard`)(Ya)}catch{console.warn(`Forsøker å definere <pkt-linkcard>, men den er allerede definert`)}window.pktAnimationPath=window.pktAnimationPath||`https://punkt-cdn.oslo.kommune.no/16.10/animations/`;var Xa=class extends Dt{constructor(...e){super(...e),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}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(e){e.has(`delay`)&&this.setupLoader()}render(){let e=q({"pkt-loader":!0,[`pkt-loader--${this.inline?`inline`:`box`}`]:!0,[`pkt-loader--${this.size}`]:!0}),t=q({"pkt-contents":!0,"pkt-hide":this.isLoading});return j`<div
1400
+ `}};G([U({type:String,reflect:!0})],Xa.prototype,`title`,void 0),G([U({type:String,reflect:!0})],Xa.prototype,`href`,void 0),G([U({type:String,reflect:!0})],Xa.prototype,`iconName`,void 0),G([U({type:Boolean,reflect:!0})],Xa.prototype,`external`,void 0),G([U({type:Boolean,reflect:!0})],Xa.prototype,`openInNewTab`,void 0),G([U({type:String,reflect:!0})],Xa.prototype,`skin`,void 0);try{H(`pkt-linkcard`)(Xa)}catch{console.warn(`Forsøker å definere <pkt-linkcard>, men den er allerede definert`)}window.pktAnimationPath=window.pktAnimationPath||`https://punkt-cdn.oslo.kommune.no/16.11/animations/`;var Za=class extends Ot{constructor(...e){super(...e),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}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(e){e.has(`delay`)&&this.setupLoader()}render(){let e=K({"pkt-loader":!0,[`pkt-loader--${this.inline?`inline`:`box`}`]:!0,[`pkt-loader--${this.size}`]:!0}),t=K({"pkt-contents":!0,"pkt-hide":this.isLoading});return j`<div
1401
1401
  role="status"
1402
1402
  aria-live="polite"
1403
1403
  aria-busy=${this.isLoading?`true`:`false`}
@@ -1411,8 +1411,8 @@
1411
1411
  ></pkt-icon>
1412
1412
  ${this.message&&j`<p>${this.message}</p>`}
1413
1413
  </div>`:N}
1414
- <div class=${t}>${Et(this)}</div>
1415
- </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))}};K([W({type:Number})],Xa.prototype,`delay`,void 0),K([W({type:Boolean})],Xa.prototype,`inline`,void 0),K([W({type:Boolean})],Xa.prototype,`isLoading`,void 0),K([W({type:String})],Xa.prototype,`message`,void 0),K([W({type:String})],Xa.prototype,`size`,void 0),K([W({type:String})],Xa.prototype,`variant`,void 0),K([W({type:String})],Xa.prototype,`loadingAnimationPath`,void 0),K([G()],Xa.prototype,`_shouldDisplayLoader`,void 0);try{U(`pkt-loader`)(Xa)}catch{console.warn(`Forsøker å definere <pkt-loader>, men den er allerede definert`)}var Za={name:`pkt-messagebox`,react:`PktMessagebox`,"css-class":`pkt-messagebox`,isElement:!0,isPureReact:!0,events:{onClose:{description:`React: Event som trigges når meldingsboksen lukkes`},"on-close":{description:`Vue: Event som trigges når meldingsboksen lukkes`}},props:{title:{name:`Tittel`,description:`Tittelen på meldingsboksen`,type:`string`,category:`contents`},skin:{name:`Utseende`,description:`Velg farge på meldingsboksen`,type:[`beige`,`blue`,`red`,`green`],category:`ui`,default:`beige`},compact:{name:`Kompakt`,description:`Gjør meldingsboksen mindre`,type:`boolean`,category:`ui`,default:!1},closable:{name:`Kan lukkes`,description:`Viser lukkeknapp`,type:`boolean`,category:`ui`,default:!1}},slots:{default:{description:`Innholdet i meldingsboksen`}}},Qa=class extends Dt{constructor(){super(),this.closable=Za.props.closable.default,this.compact=Za.props.compact.default,this.title=``,this.skin=Za.props.skin.default,this._isClosed=!1,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent(`close`,{detail:{origin:e},bubbles:!0})),this.dispatchEvent(new CustomEvent(`on-close`,{detail:{origin:e},bubbles:!0}))},this._isClosed=!1}updated(e){super.updated(e),e.has(`_isClosed`)&&Ot(this,`pkt-hide`,this._isClosed)}render(){return j`<div class=${q({"pkt-messagebox":!0,"pkt-messagebox--compact":this.compact,[`pkt-messagebox--${this.skin}`]:this.skin,"pkt-messagebox--closable":this.closable,"pkt-hide":this._isClosed})}>
1414
+ <div class=${t}>${Dt(this)}</div>
1415
+ </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))}};G([U({type:Number})],Za.prototype,`delay`,void 0),G([U({type:Boolean})],Za.prototype,`inline`,void 0),G([U({type:Boolean})],Za.prototype,`isLoading`,void 0),G([U({type:String})],Za.prototype,`message`,void 0),G([U({type:String})],Za.prototype,`size`,void 0),G([U({type:String})],Za.prototype,`variant`,void 0),G([U({type:String})],Za.prototype,`loadingAnimationPath`,void 0),G([W()],Za.prototype,`_shouldDisplayLoader`,void 0);try{H(`pkt-loader`)(Za)}catch{console.warn(`Forsøker å definere <pkt-loader>, men den er allerede definert`)}var Qa={name:`pkt-messagebox`,react:`PktMessagebox`,"css-class":`pkt-messagebox`,isElement:!0,isPureReact:!0,events:{onClose:{description:`React: Event som trigges når meldingsboksen lukkes`},"on-close":{description:`Vue: Event som trigges når meldingsboksen lukkes`}},props:{title:{name:`Tittel`,description:`Tittelen på meldingsboksen`,type:`string`,category:`contents`},skin:{name:`Utseende`,description:`Velg farge på meldingsboksen`,type:[`beige`,`blue`,`red`,`green`],category:`ui`,default:`beige`},compact:{name:`Kompakt`,description:`Gjør meldingsboksen mindre`,type:`boolean`,category:`ui`,default:!1},closable:{name:`Kan lukkes`,description:`Viser lukkeknapp`,type:`boolean`,category:`ui`,default:!1}},slots:{default:{description:`Innholdet i meldingsboksen`}}},$a=class extends Ot{constructor(){super(),this.closable=Qa.props.closable.default,this.compact=Qa.props.compact.default,this.title=``,this.skin=Qa.props.skin.default,this._isClosed=!1,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent(`close`,{detail:{origin:e},bubbles:!0})),this.dispatchEvent(new CustomEvent(`on-close`,{detail:{origin:e},bubbles:!0}))},this._isClosed=!1}updated(e){super.updated(e),e.has(`_isClosed`)&&kt(this,`pkt-hide`,this._isClosed)}render(){return j`<div class=${K({"pkt-messagebox":!0,"pkt-messagebox--compact":this.compact,[`pkt-messagebox--${this.skin}`]:this.skin,"pkt-messagebox--closable":this.closable,"pkt-hide":this._isClosed})}>
1416
1416
  ${this.closable?j`<div class="pkt-messagebox__close">
1417
1417
  <button
1418
1418
  @click=${this.close}
@@ -1423,11 +1423,11 @@
1423
1423
  </button>
1424
1424
  </div>`:N}
1425
1425
  ${this.title?j`<div class="pkt-messagebox__title">${this.title}</div>`:N}
1426
- <div class="pkt-messagebox__text">${Et(this)}</div>
1427
- </div>`}};K([W({type:Boolean,reflect:!0})],Qa.prototype,`closable`,void 0),K([W({type:Boolean,reflect:!0})],Qa.prototype,`compact`,void 0),K([W({type:String,reflect:!0})],Qa.prototype,`title`,void 0),K([W({type:String,reflect:!0})],Qa.prototype,`skin`,void 0),K([G()],Qa.prototype,`_isClosed`,void 0);try{U(`pkt-messagebox`)(Qa)}catch{console.warn(`Forsøker å definere <pkt-messagebox>, men den er allerede definert`)}var $a=f({default:()=>po});function eo(e,t){var n=`on`+t.type.toLowerCase();return typeof e[n]==`function`&&e[n](t),e.dispatchEvent(t)}function to(e){for(;e&&e!==document.body;){var t=window.getComputedStyle(e),n=function(e,n){return!(t[e]===void 0||t[e]===n)};if(t.opacity<1||n(`zIndex`,`auto`)||n(`transform`,`none`)||n(`mixBlendMode`,`normal`)||n(`filter`,`none`)||n(`perspective`,`none`)||t.isolation===`isolate`||t.position===`fixed`||t.webkitOverflowScrolling===`touch`)return!0;e=e.parentElement}return!1}function no(e){for(;e;){if(e.localName===`dialog`)return e;e=e.parentElement?e.parentElement:e.parentNode?e.parentNode.host:null}return null}function ro(e){for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;e&&e.blur&&e!==document.body&&e.blur()}function io(e,t){for(var n=0;n<e.length;++n)if(e[n]===t)return!0;return!1}function ao(e){return!e||!e.hasAttribute(`method`)?!1:e.getAttribute(`method`).toLowerCase()===`dialog`}function oo(e){var t=[`button`,`input`,`keygen`,`select`,`textarea`].map(function(e){return e+`:not([disabled])`});t.push(`[tabindex]:not([disabled]):not([tabindex=""])`);var n=e.querySelector(t.join(`, `));if(!n&&`attachShadow`in Element.prototype)for(var r=e.querySelectorAll(`*`),i=0;i<r.length&&!(r[i].tagName&&r[i].shadowRoot&&(n=oo(r[i].shadowRoot),n));i++);return n}function so(e){return e.isConnected||document.body.contains(e)}function co(e){if(e.submitter)return e.submitter;var t=e.target;if(!(t instanceof HTMLFormElement))return null;var n=po.formSubmitter;if(!n){var r=e.target;n=(`getRootNode`in r&&r.getRootNode()||document).activeElement}return!n||n.form!==t?null:n}function lo(e){if(!e.defaultPrevented){var t=e.target,n=po.imagemapUseValue,r=co(e);n===null&&r&&(n=r.value);var i=no(t);i&&(r&&r.getAttribute(`formmethod`)||t.getAttribute(`method`))===`dialog`&&(e.preventDefault(),n==null?i.close():i.close(n))}}function uo(e){if(this.dialog_=e,this.replacedStyleTop_=!1,this.openAsModal_=!1,e.hasAttribute(`role`)||e.setAttribute(`role`,`dialog`),e.show=this.show.bind(this),e.showModal=this.showModal.bind(this),e.close=this.close.bind(this),e.addEventListener(`submit`,lo,!1),`returnValue`in e||(e.returnValue=``),`MutationObserver`in window)new MutationObserver(this.maybeHideModal.bind(this)).observe(e,{attributes:!0,attributeFilter:[`open`]});else{var t=!1,n=function(){t?this.downgradeModal():this.maybeHideModal(),t=!1}.bind(this),r,i=function(i){if(i.target===e){var a=`DOMNodeRemoved`;t|=i.type.substr(0,a.length)===a,window.clearTimeout(r),r=window.setTimeout(n,0)}};[`DOMAttrModified`,`DOMNodeRemoved`,`DOMNodeRemovedFromDocument`].forEach(function(t){e.addEventListener(t,i)})}Object.defineProperty(e,`open`,{set:this.setOpen.bind(this),get:e.hasAttribute.bind(e,`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))}var fo,po,mo,ho,go,_o,vo,yo,bo=u((()=>{fo=window.CustomEvent,(!fo||typeof fo==`object`)&&(fo=function(e,t){t||={};var n=document.createEvent(`CustomEvent`);return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail||null),n},fo.prototype=window.Event.prototype),uo.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute(`open`)&&so(this.dialog_)||this.downgradeModal()},downgradeModal:function(){this.openAsModal_&&(this.openAsModal_=!1,this.dialog_.style.zIndex=``,this.replacedStyleTop_&&=(this.dialog_.style.top=``,!1),this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_),po.dm.removeDialog(this))},setOpen:function(e){e?this.dialog_.hasAttribute(`open`)||this.dialog_.setAttribute(`open`,``):(this.dialog_.removeAttribute(`open`),this.maybeHideModal())},backdropMouseEvent_:function(e){if(this.dialog_.hasAttribute(`tabindex`))this.dialog_.focus();else{var t=document.createElement(`div`);this.dialog_.insertBefore(t,this.dialog_.firstChild),t.tabIndex=-1,t.focus(),this.dialog_.removeChild(t)}var n=document.createEvent(`MouseEvents`);n.initMouseEvent(e.type,e.bubbles,e.cancelable,window,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget),this.dialog_.dispatchEvent(n),e.stopPropagation()},focus_:function(){var e=this.dialog_.querySelector(`[autofocus]:not([disabled])`);!e&&this.dialog_.tabIndex>=0&&(e=this.dialog_),e||=oo(this.dialog_),ro(document.activeElement),e&&e.focus()},updateZIndex:function(e,t){if(e<t)throw Error(`dialogZ should never be < backdropZ`);this.dialog_.style.zIndex=e,this.backdrop_.style.zIndex=t},show:function(){this.dialog_.open||(this.setOpen(!0),this.focus_())},showModal:function(){if(this.dialog_.hasAttribute(`open`))throw Error(`Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.`);if(!so(this.dialog_))throw Error(`Failed to execute 'showModal' on dialog: The element is not in a Document.`);if(!po.dm.pushDialog(this))throw Error(`Failed to execute 'showModal' on dialog: There are too many open modal dialogs.`);to(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,po.needsCentering(this.dialog_)?(po.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(e){if(!this.dialog_.hasAttribute(`open`))throw Error(`Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.`);this.setOpen(!1),e!==void 0&&(this.dialog_.returnValue=e);var t=new fo(`close`,{bubbles:!1,cancelable:!1});eo(this.dialog_,t)}},po={},po.reposition=function(e){var t=document.body.scrollTop||document.documentElement.scrollTop,n=t+(window.innerHeight-e.offsetHeight)/2;e.style.top=Math.max(t,n)+`px`},po.isInlinePositionSetByStylesheet=function(e){for(var t=0;t<document.styleSheets.length;++t){var n=document.styleSheets[t],r=null;try{r=n.cssRules}catch{}if(r)for(var i=0;i<r.length;++i){var a=r[i],o=null;try{o=document.querySelectorAll(a.selectorText)}catch{}if(!(!o||!io(o,e))){var s=a.style.getPropertyValue(`top`),c=a.style.getPropertyValue(`bottom`);if(s&&s!==`auto`||c&&c!==`auto`)return!0}}}return!1},po.needsCentering=function(e){return window.getComputedStyle(e).position!==`absolute`||e.style.top!==`auto`&&e.style.top!==``||e.style.bottom!==`auto`&&e.style.bottom!==``?!1:!po.isInlinePositionSetByStylesheet(e)},po.forceRegisterDialog=function(e){if((window.HTMLDialogElement||e.showModal)&&console.warn(`This browser already supports <dialog>, the polyfill may not work correctly`,e),e.localName!==`dialog`)throw Error(`Failed to register dialog: The element is not a dialog.`);new uo(e)},po.registerDialog=function(e){e.showModal||po.forceRegisterDialog(e)},po.DialogManager=function(){this.pendingDialogStack=[];var e=this.checkDOM_.bind(this);this.overlay=document.createElement(`div`),this.overlay.className=`_dialog_overlay`,this.overlay.addEventListener(`click`,function(t){this.forwardTab_=void 0,t.stopPropagation(),e([])}.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(t){var n=[];t.forEach(function(e){for(var t=0,r;r=e.removedNodes[t];++t){if(r instanceof Element)r.localName===`dialog`&&n.push(r);else continue;n=n.concat(r.querySelectorAll(`dialog`))}}),n.length&&e(n)}))},po.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})},po.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener(`focus`,this.handleFocus_,!0),document.removeEventListener(`keydown`,this.handleKey_),this.mo_&&this.mo_.disconnect()},po.DialogManager.prototype.updateStacking=function(){for(var e=this.zIndexHigh_,t=0,n;n=this.pendingDialogStack[t];++t)n.updateZIndex(--e,--e),t===0&&(this.overlay.style.zIndex=--e);var r=this.pendingDialogStack[0];r?(r.dialog.parentNode||document.body).appendChild(this.overlay):this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},po.DialogManager.prototype.containedByTopDialog_=function(e){for(;e=no(e);){for(var t=0,n;n=this.pendingDialogStack[t];++t)if(n.dialog===e)return t===0;e=e.parentElement}return!1},po.DialogManager.prototype.handleFocus_=function(e){var t=e.composedPath?e.composedPath()[0]:e.target;if(!this.containedByTopDialog_(t)&&document.activeElement!==document.documentElement&&(e.preventDefault(),e.stopPropagation(),ro(t),this.forwardTab_!==void 0)){var n=this.pendingDialogStack[0];return n.dialog.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?n.focus_():t!==document.documentElement&&document.documentElement.focus()),!1}},po.DialogManager.prototype.handleKey_=function(e){if(this.forwardTab_=void 0,e.keyCode===27){e.preventDefault(),e.stopPropagation();var t=new fo(`cancel`,{bubbles:!1,cancelable:!0}),n=this.pendingDialogStack[0];n&&eo(n.dialog,t)&&n.dialog.close()}else e.keyCode===9&&(this.forwardTab_=!e.shiftKey)},po.DialogManager.prototype.checkDOM_=function(e){this.pendingDialogStack.slice().forEach(function(t){e.indexOf(t.dialog)===-1?t.maybeHideModal():t.downgradeModal()})},po.DialogManager.prototype.pushDialog=function(e){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=t?!1:(this.pendingDialogStack.unshift(e)===1&&this.blockDocument(),this.updateStacking(),!0)},po.DialogManager.prototype.removeDialog=function(e){var t=this.pendingDialogStack.indexOf(e);t!==-1&&(this.pendingDialogStack.splice(t,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())},po.dm=new po.DialogManager,po.formSubmitter=null,po.imagemapUseValue=null,window.HTMLDialogElement===void 0&&(mo=document.createElement(`form`),mo.setAttribute(`method`,`dialog`),mo.method!==`dialog`&&(ho=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,`method`),ho&&(go=ho.get,ho.get=function(){return ao(this)?`dialog`:go.call(this)},_o=ho.set,ho.set=function(e){return typeof e==`string`&&e.toLowerCase()===`dialog`?this.setAttribute(`method`,e):_o.call(this,e)},Object.defineProperty(HTMLFormElement.prototype,`method`,ho))),document.addEventListener(`click`,function(e){if(po.formSubmitter=null,po.imagemapUseValue=null,!e.defaultPrevented){var t=e.target;if(`composedPath`in e&&(t=e.composedPath().shift()||t),!(!t||!ao(t.form))){if(!(t.type===`submit`&&[`button`,`input`].indexOf(t.localName)>-1)){if(!(t.localName===`input`&&t.type===`image`))return;po.imagemapUseValue=e.offsetX+`,`+e.offsetY}no(t)&&(po.formSubmitter=t)}}},!1),document.addEventListener(`submit`,function(e){var t=e.target;if(!no(t)){var n=co(e);(n&&n.getAttribute(`formmethod`)||t.getAttribute(`method`))===`dialog`&&e.preventDefault()}}),vo=HTMLFormElement.prototype.submit,yo=function(){if(!ao(this))return vo.call(this);var e=no(this);e&&e.close()},HTMLFormElement.prototype.submit=yo)})),xo={name:`pkt-modal`,react:`PktModal`,"css-class":`pkt-modal`,isElement:!0,isPureReact:!0,events:{"background-click":{description:`Event som trigges når bakgrunnen trykkes på`},close:{description:`Event som trigges når meldingsboksen lukkes`}},props:{open:{name:`Åpen`,description:`Deklarativ styring av modalens åpen/lukket-tilstand. Kan brukes i stedet for showModal()/close()-metodene.`,type:`boolean`,category:`tech`,default:!1},headingText:{name:`Heading text`,description:`Heading tekst på modalen`,type:`string`,category:`contents`},hideCloseButton:{name:`Gjem 'Lukk'-knapp`,description:`Gjemmer lukkeknappen. Dersom denne er satt til true, vil ikke lukkeknappen vises, og dermed er det viktig at man tilbyr en annen måte som f.eks. en knapp for å lukke modalen på.`,type:`boolean`,category:`ui`,default:!1},closeOnBackdropClick:{name:`Lukk modalen når bakgrunnen trykkes på`,description:`Lukk modalen når bakgrunnen trykkes på`,type:`boolean`,category:`tech`,default:!1},closeButtonSkin:{name:`Stil på lukkeknappen`,description:`Stil på lukkeknappen`,type:[`blue`,`yellow-filled`],category:`ui`,default:`blue`},size:{name:`Størrelse`,description:`Størrelsen på modalen`,type:[`small`,`medium`,`large`,`fit-content`],category:`ui`,default:`medium`},variant:{name:`Variant`,description:`Standard dialog eller skuff`,type:[`dialog`,`drawer`],category:`ui`,default:`dialog`},drawerPosition:{name:`Skuffposisjon`,description:`Posisjonen til skuffen`,type:[`left`,`right`],category:`ui`,default:`right`},transparentBackdrop:{name:`Gjennomsiktig bakgrunn`,description:`Bakgrunnen er gjennomsiktig`,type:`boolean`,category:`ui`,default:!1},removePadding:{name:`Fjern padding`,description:`Fjerner paddingen rundt innholdet i modalen`,type:`boolean`,category:`ui`,default:!1}},slots:{default:{description:`Innholdet i meldingen. Her tilbyr vi støtteklasser for å style 1-3 knapper i modalen.`}}},So=class extends Dt{constructor(){super(),this.open=!1,this.headingText=``,this.removePadding=!1,this.hideCloseButton=xo.props.hideCloseButton.default,this.closeOnBackdropClick=xo.props.closeOnBackdropClick.default,this.closeButtonSkin=`blue`,this.size=xo.props.size.default,this.variant=`dialog`,this.drawerPosition=`right`,this.transparentBackdrop=!1,this.dialogRef=Y(),this._isOpen=!1,this.close=(e,t=!1)=>{if(!this._isOpen)return;this._isOpen=!1,this.open=!1,document.body.classList.remove(`pkt-modal--open`);let n=document.activeElement;n&&!this.isElementInViewport(n)&&n.scrollIntoView({behavior:`smooth`,block:`nearest`}),this.dispatchEvent(new CustomEvent(`close`,{detail:{origin:e},bubbles:!0,composed:!0})),t||this.dialogRef.value?.close(),this.requestUpdate()},this.showModal=(e=null)=>{this._isOpen=!0,this.open=!0,this.dialogRef.value?.showModal(),document.body.classList.add(`pkt-modal--open`),this.dispatchEvent(new CustomEvent(`showModal`,{detail:{origin:e},bubbles:!0,composed:!0})),this.requestUpdate()},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)}updated(e){super.updated(e),e.has(`open`)&&(this.open&&!this._isOpen?this.showModal():!this.open&&this._isOpen&&this.close(new Event(`close`),!1))}async firstUpdated(e){super.firstUpdated(e),this.dialogRef.value&&!window.HTMLDialogElement&&!this.dialogRef.value.showModal&&(`document`in window&&`createElement`in document&&(await Promise.resolve().then(()=>(bo(),$a)).then(e=>e.default)).registerDialog(this.dialogRef.value),this.dialogRef.value.addEventListener(`close`,()=>{this.close(new Event(`close`),!0)}))}handleKeyDown(e){e.key===`Escape`&&this.close(e)}handleBackdropClick(e){this.closeOnBackdropClick&&e.target===this.dialogRef?.value&&this.close(e)}isElementInViewport(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}render(){let e={"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`},t={"pkt-modal__headingText":!0,"pkt-txt-24":!0},n={"pkt-modal__content":!0,"pkt-txt-18-light":!0},r=this.closeButtonSkin===`blue`,i={"pkt-modal__closeButton":!0,[`pkt-modal__closeButton--${this.closeButtonSkin}`]:!0};return j`
1426
+ <div class="pkt-messagebox__text">${Dt(this)}</div>
1427
+ </div>`}};G([U({type:Boolean,reflect:!0})],$a.prototype,`closable`,void 0),G([U({type:Boolean,reflect:!0})],$a.prototype,`compact`,void 0),G([U({type:String,reflect:!0})],$a.prototype,`title`,void 0),G([U({type:String,reflect:!0})],$a.prototype,`skin`,void 0),G([W()],$a.prototype,`_isClosed`,void 0);try{H(`pkt-messagebox`)($a)}catch{console.warn(`Forsøker å definere <pkt-messagebox>, men den er allerede definert`)}var eo=f({default:()=>Z});function to(e,t){var n=`on`+t.type.toLowerCase();return typeof e[n]==`function`&&e[n](t),e.dispatchEvent(t)}function no(e){for(;e&&e!==document.body;){var t=window.getComputedStyle(e),n=function(e,n){return!(t[e]===void 0||t[e]===n)};if(t.opacity<1||n(`zIndex`,`auto`)||n(`transform`,`none`)||n(`mixBlendMode`,`normal`)||n(`filter`,`none`)||n(`perspective`,`none`)||t.isolation===`isolate`||t.position===`fixed`||t.webkitOverflowScrolling===`touch`)return!0;e=e.parentElement}return!1}function ro(e){for(;e;){if(e.localName===`dialog`)return e;e=e.parentElement?e.parentElement:e.parentNode?e.parentNode.host:null}return null}function io(e){for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;e&&e.blur&&e!==document.body&&e.blur()}function ao(e,t){for(var n=0;n<e.length;++n)if(e[n]===t)return!0;return!1}function oo(e){return!e||!e.hasAttribute(`method`)?!1:e.getAttribute(`method`).toLowerCase()===`dialog`}function so(e){var t=[`button`,`input`,`keygen`,`select`,`textarea`].map(function(e){return e+`:not([disabled])`});t.push(`[tabindex]:not([disabled]):not([tabindex=""])`);var n=e.querySelector(t.join(`, `));if(!n&&`attachShadow`in Element.prototype)for(var r=e.querySelectorAll(`*`),i=0;i<r.length&&!(r[i].tagName&&r[i].shadowRoot&&(n=so(r[i].shadowRoot),n));i++);return n}function co(e){return e.isConnected||document.body.contains(e)}function lo(e){if(e.submitter)return e.submitter;var t=e.target;if(!(t instanceof HTMLFormElement))return null;var n=Z.formSubmitter;if(!n){var r=e.target;n=(`getRootNode`in r&&r.getRootNode()||document).activeElement}return!n||n.form!==t?null:n}function uo(e){if(!e.defaultPrevented){var t=e.target,n=Z.imagemapUseValue,r=lo(e);n===null&&r&&(n=r.value);var i=ro(t);i&&(r&&r.getAttribute(`formmethod`)||t.getAttribute(`method`))===`dialog`&&(e.preventDefault(),n==null?i.close():i.close(n))}}function fo(e){if(this.dialog_=e,this.replacedStyleTop_=!1,this.openAsModal_=!1,e.hasAttribute(`role`)||e.setAttribute(`role`,`dialog`),e.show=this.show.bind(this),e.showModal=this.showModal.bind(this),e.close=this.close.bind(this),e.addEventListener(`submit`,uo,!1),`returnValue`in e||(e.returnValue=``),`MutationObserver`in window)new MutationObserver(this.maybeHideModal.bind(this)).observe(e,{attributes:!0,attributeFilter:[`open`]});else{var t=!1,n=function(){t?this.downgradeModal():this.maybeHideModal(),t=!1}.bind(this),r,i=function(i){if(i.target===e){var a=`DOMNodeRemoved`;t|=i.type.substr(0,a.length)===a,window.clearTimeout(r),r=window.setTimeout(n,0)}};[`DOMAttrModified`,`DOMNodeRemoved`,`DOMNodeRemovedFromDocument`].forEach(function(t){e.addEventListener(t,i)})}Object.defineProperty(e,`open`,{set:this.setOpen.bind(this),get:e.hasAttribute.bind(e,`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))}var po,Z,mo,ho,go,_o,vo,yo,bo=u((()=>{po=window.CustomEvent,(!po||typeof po==`object`)&&(po=function(e,t){t||={};var n=document.createEvent(`CustomEvent`);return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail||null),n},po.prototype=window.Event.prototype),fo.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute(`open`)&&co(this.dialog_)||this.downgradeModal()},downgradeModal:function(){this.openAsModal_&&(this.openAsModal_=!1,this.dialog_.style.zIndex=``,this.replacedStyleTop_&&=(this.dialog_.style.top=``,!1),this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_),Z.dm.removeDialog(this))},setOpen:function(e){e?this.dialog_.hasAttribute(`open`)||this.dialog_.setAttribute(`open`,``):(this.dialog_.removeAttribute(`open`),this.maybeHideModal())},backdropMouseEvent_:function(e){if(this.dialog_.hasAttribute(`tabindex`))this.dialog_.focus();else{var t=document.createElement(`div`);this.dialog_.insertBefore(t,this.dialog_.firstChild),t.tabIndex=-1,t.focus(),this.dialog_.removeChild(t)}var n=document.createEvent(`MouseEvents`);n.initMouseEvent(e.type,e.bubbles,e.cancelable,window,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget),this.dialog_.dispatchEvent(n),e.stopPropagation()},focus_:function(){var e=this.dialog_.querySelector(`[autofocus]:not([disabled])`);!e&&this.dialog_.tabIndex>=0&&(e=this.dialog_),e||=so(this.dialog_),io(document.activeElement),e&&e.focus()},updateZIndex:function(e,t){if(e<t)throw Error(`dialogZ should never be < backdropZ`);this.dialog_.style.zIndex=e,this.backdrop_.style.zIndex=t},show:function(){this.dialog_.open||(this.setOpen(!0),this.focus_())},showModal:function(){if(this.dialog_.hasAttribute(`open`))throw Error(`Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.`);if(!co(this.dialog_))throw Error(`Failed to execute 'showModal' on dialog: The element is not in a Document.`);if(!Z.dm.pushDialog(this))throw Error(`Failed to execute 'showModal' on dialog: There are too many open modal dialogs.`);no(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,Z.needsCentering(this.dialog_)?(Z.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(e){if(!this.dialog_.hasAttribute(`open`))throw Error(`Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.`);this.setOpen(!1),e!==void 0&&(this.dialog_.returnValue=e);var t=new po(`close`,{bubbles:!1,cancelable:!1});to(this.dialog_,t)}},Z={},Z.reposition=function(e){var t=document.body.scrollTop||document.documentElement.scrollTop,n=t+(window.innerHeight-e.offsetHeight)/2;e.style.top=Math.max(t,n)+`px`},Z.isInlinePositionSetByStylesheet=function(e){for(var t=0;t<document.styleSheets.length;++t){var n=document.styleSheets[t],r=null;try{r=n.cssRules}catch{}if(r)for(var i=0;i<r.length;++i){var a=r[i],o=null;try{o=document.querySelectorAll(a.selectorText)}catch{}if(!(!o||!ao(o,e))){var s=a.style.getPropertyValue(`top`),c=a.style.getPropertyValue(`bottom`);if(s&&s!==`auto`||c&&c!==`auto`)return!0}}}return!1},Z.needsCentering=function(e){return window.getComputedStyle(e).position!==`absolute`||e.style.top!==`auto`&&e.style.top!==``||e.style.bottom!==`auto`&&e.style.bottom!==``?!1:!Z.isInlinePositionSetByStylesheet(e)},Z.forceRegisterDialog=function(e){if((window.HTMLDialogElement||e.showModal)&&console.warn(`This browser already supports <dialog>, the polyfill may not work correctly`,e),e.localName!==`dialog`)throw Error(`Failed to register dialog: The element is not a dialog.`);new fo(e)},Z.registerDialog=function(e){e.showModal||Z.forceRegisterDialog(e)},Z.DialogManager=function(){this.pendingDialogStack=[];var e=this.checkDOM_.bind(this);this.overlay=document.createElement(`div`),this.overlay.className=`_dialog_overlay`,this.overlay.addEventListener(`click`,function(t){this.forwardTab_=void 0,t.stopPropagation(),e([])}.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(t){var n=[];t.forEach(function(e){for(var t=0,r;r=e.removedNodes[t];++t){if(r instanceof Element)r.localName===`dialog`&&n.push(r);else continue;n=n.concat(r.querySelectorAll(`dialog`))}}),n.length&&e(n)}))},Z.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})},Z.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener(`focus`,this.handleFocus_,!0),document.removeEventListener(`keydown`,this.handleKey_),this.mo_&&this.mo_.disconnect()},Z.DialogManager.prototype.updateStacking=function(){for(var e=this.zIndexHigh_,t=0,n;n=this.pendingDialogStack[t];++t)n.updateZIndex(--e,--e),t===0&&(this.overlay.style.zIndex=--e);var r=this.pendingDialogStack[0];r?(r.dialog.parentNode||document.body).appendChild(this.overlay):this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},Z.DialogManager.prototype.containedByTopDialog_=function(e){for(;e=ro(e);){for(var t=0,n;n=this.pendingDialogStack[t];++t)if(n.dialog===e)return t===0;e=e.parentElement}return!1},Z.DialogManager.prototype.handleFocus_=function(e){var t=e.composedPath?e.composedPath()[0]:e.target;if(!this.containedByTopDialog_(t)&&document.activeElement!==document.documentElement&&(e.preventDefault(),e.stopPropagation(),io(t),this.forwardTab_!==void 0)){var n=this.pendingDialogStack[0];return n.dialog.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?n.focus_():t!==document.documentElement&&document.documentElement.focus()),!1}},Z.DialogManager.prototype.handleKey_=function(e){if(this.forwardTab_=void 0,e.keyCode===27){e.preventDefault(),e.stopPropagation();var t=new po(`cancel`,{bubbles:!1,cancelable:!0}),n=this.pendingDialogStack[0];n&&to(n.dialog,t)&&n.dialog.close()}else e.keyCode===9&&(this.forwardTab_=!e.shiftKey)},Z.DialogManager.prototype.checkDOM_=function(e){this.pendingDialogStack.slice().forEach(function(t){e.indexOf(t.dialog)===-1?t.maybeHideModal():t.downgradeModal()})},Z.DialogManager.prototype.pushDialog=function(e){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=t?!1:(this.pendingDialogStack.unshift(e)===1&&this.blockDocument(),this.updateStacking(),!0)},Z.DialogManager.prototype.removeDialog=function(e){var t=this.pendingDialogStack.indexOf(e);t!==-1&&(this.pendingDialogStack.splice(t,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())},Z.dm=new Z.DialogManager,Z.formSubmitter=null,Z.imagemapUseValue=null,window.HTMLDialogElement===void 0&&(mo=document.createElement(`form`),mo.setAttribute(`method`,`dialog`),mo.method!==`dialog`&&(ho=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,`method`),ho&&(go=ho.get,ho.get=function(){return oo(this)?`dialog`:go.call(this)},_o=ho.set,ho.set=function(e){return typeof e==`string`&&e.toLowerCase()===`dialog`?this.setAttribute(`method`,e):_o.call(this,e)},Object.defineProperty(HTMLFormElement.prototype,`method`,ho))),document.addEventListener(`click`,function(e){if(Z.formSubmitter=null,Z.imagemapUseValue=null,!e.defaultPrevented){var t=e.target;if(`composedPath`in e&&(t=e.composedPath().shift()||t),!(!t||!oo(t.form))){if(!(t.type===`submit`&&[`button`,`input`].indexOf(t.localName)>-1)){if(!(t.localName===`input`&&t.type===`image`))return;Z.imagemapUseValue=e.offsetX+`,`+e.offsetY}ro(t)&&(Z.formSubmitter=t)}}},!1),document.addEventListener(`submit`,function(e){var t=e.target;if(!ro(t)){var n=lo(e);(n&&n.getAttribute(`formmethod`)||t.getAttribute(`method`))===`dialog`&&e.preventDefault()}}),vo=HTMLFormElement.prototype.submit,yo=function(){if(!oo(this))return vo.call(this);var e=ro(this);e&&e.close()},HTMLFormElement.prototype.submit=yo)})),xo={name:`pkt-modal`,react:`PktModal`,"css-class":`pkt-modal`,isElement:!0,isPureReact:!0,events:{"background-click":{description:`Event som trigges når bakgrunnen trykkes på`},close:{description:`Event som trigges når meldingsboksen lukkes`}},props:{open:{name:`Åpen`,description:`Deklarativ styring av modalens åpen/lukket-tilstand. Kan brukes i stedet for showModal()/close()-metodene.`,type:`boolean`,category:`tech`,default:!1},headingText:{name:`Heading text`,description:`Heading tekst på modalen`,type:`string`,category:`contents`},hideCloseButton:{name:`Gjem 'Lukk'-knapp`,description:`Gjemmer lukkeknappen. Dersom denne er satt til true, vil ikke lukkeknappen vises, og dermed er det viktig at man tilbyr en annen måte som f.eks. en knapp for å lukke modalen på.`,type:`boolean`,category:`ui`,default:!1},closeOnBackdropClick:{name:`Lukk modalen når bakgrunnen trykkes på`,description:`Lukk modalen når bakgrunnen trykkes på`,type:`boolean`,category:`tech`,default:!1},closeButtonSkin:{name:`Stil på lukkeknappen`,description:`Stil på lukkeknappen`,type:[`blue`,`yellow-filled`],category:`ui`,default:`blue`},size:{name:`Størrelse`,description:`Størrelsen på modalen`,type:[`small`,`medium`,`large`,`fit-content`],category:`ui`,default:`medium`},variant:{name:`Variant`,description:`Standard dialog eller skuff`,type:[`dialog`,`drawer`],category:`ui`,default:`dialog`},drawerPosition:{name:`Skuffposisjon`,description:`Posisjonen til skuffen`,type:[`left`,`right`],category:`ui`,default:`right`},transparentBackdrop:{name:`Gjennomsiktig bakgrunn`,description:`Bakgrunnen er gjennomsiktig`,type:`boolean`,category:`ui`,default:!1},removePadding:{name:`Fjern padding`,description:`Fjerner paddingen rundt innholdet i modalen`,type:`boolean`,category:`ui`,default:!1}},slots:{default:{description:`Innholdet i meldingen. Her tilbyr vi støtteklasser for å style 1-3 knapper i modalen.`}}},So=class extends Ot{constructor(){super(),this.open=!1,this.headingText=``,this.removePadding=!1,this.hideCloseButton=xo.props.hideCloseButton.default,this.closeOnBackdropClick=xo.props.closeOnBackdropClick.default,this.closeButtonSkin=`blue`,this.size=xo.props.size.default,this.variant=`dialog`,this.drawerPosition=`right`,this.transparentBackdrop=!1,this.dialogRef=J(),this._isOpen=!1,this.close=(e,t=!1)=>{if(!this._isOpen)return;this._isOpen=!1,this.open=!1,document.body.classList.remove(`pkt-modal--open`);let n=document.activeElement;n&&!this.isElementInViewport(n)&&n.scrollIntoView({behavior:`smooth`,block:`nearest`}),this.dispatchEvent(new CustomEvent(`close`,{detail:{origin:e},bubbles:!0,composed:!0})),t||this.dialogRef.value?.close(),this.requestUpdate()},this.showModal=(e=null)=>{this._isOpen=!0,this.open=!0,this.dialogRef.value?.showModal(),document.body.classList.add(`pkt-modal--open`),this.dispatchEvent(new CustomEvent(`showModal`,{detail:{origin:e},bubbles:!0,composed:!0})),this.requestUpdate()},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)}updated(e){super.updated(e),e.has(`open`)&&(this.open&&!this._isOpen?this.showModal():!this.open&&this._isOpen&&this.close(new Event(`close`),!1))}async firstUpdated(e){super.firstUpdated(e),this.dialogRef.value&&!window.HTMLDialogElement&&!this.dialogRef.value.showModal&&(`document`in window&&`createElement`in document&&(await Promise.resolve().then(()=>(bo(),eo)).then(e=>e.default)).registerDialog(this.dialogRef.value),this.dialogRef.value.addEventListener(`close`,()=>{this.close(new Event(`close`),!0)}))}handleKeyDown(e){e.key===`Escape`&&this.close(e)}handleBackdropClick(e){this.closeOnBackdropClick&&e.target===this.dialogRef?.value&&this.close(e)}isElementInViewport(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}render(){let e={"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`},t={"pkt-modal__headingText":!0,"pkt-txt-24":!0},n={"pkt-modal__content":!0,"pkt-txt-18-light":!0},r=this.closeButtonSkin===`blue`,i={"pkt-modal__closeButton":!0,[`pkt-modal__closeButton--${this.closeButtonSkin}`]:!0};return j`
1428
1428
  <dialog
1429
- class=${q(e)}
1430
- ${X(this.dialogRef)}
1429
+ class=${K(e)}
1430
+ ${Y(this.dialogRef)}
1431
1431
  aria-labelledby=${this.headingText?`pkt-modal__headingText`:N}
1432
1432
  aria-describedby="pkt-modal__content"
1433
1433
  @close=${e=>this.close(e,!0)}
@@ -1435,10 +1435,10 @@
1435
1435
  <div class="pkt-modal__wrapper">
1436
1436
  ${this.headingText||!this.hideCloseButton?j`<div class="pkt-modal__header">
1437
1437
  <div class="pkt-modal__header-background"></div>
1438
- ${this.headingText?j`<h1 id="pkt-modal__headingText" class=${q(t)}>
1438
+ ${this.headingText?j`<h1 id="pkt-modal__headingText" class=${K(t)}>
1439
1439
  ${this.headingText}
1440
1440
  </h1>`:j`<div class="pkt-modal__headingText"></div>`}
1441
- ${this.hideCloseButton?j`<div class="pkt-modal__noCloseButton"></div>`:j`<div class="${q(i)}">
1441
+ ${this.hideCloseButton?j`<div class="pkt-modal__noCloseButton"></div>`:j`<div class="${K(i)}">
1442
1442
  <pkt-button
1443
1443
  @click=${e=>this.close(e)}
1444
1444
  aria-label="close"
@@ -1452,13 +1452,13 @@
1452
1452
  </div>`}
1453
1453
  </div>`:N}
1454
1454
  <div class="pkt-modal__container">
1455
- <div id="pkt-modal__content" class=${q(n)}>
1456
- ${Et(this)}
1455
+ <div id="pkt-modal__content" class=${K(n)}>
1456
+ ${Dt(this)}
1457
1457
  </div>
1458
1458
  </div>
1459
1459
  </div>
1460
1460
  </dialog>
1461
- `}};K([W({type:Boolean,reflect:!0})],So.prototype,`open`,void 0),K([W({type:String})],So.prototype,`headingText`,void 0),K([W({type:Boolean})],So.prototype,`removePadding`,void 0),K([W({type:Boolean})],So.prototype,`hideCloseButton`,void 0),K([W({type:Boolean})],So.prototype,`closeOnBackdropClick`,void 0),K([W({type:String})],So.prototype,`closeButtonSkin`,void 0),K([W({type:String})],So.prototype,`size`,void 0),K([W({type:String})],So.prototype,`variant`,void 0),K([W({type:String})],So.prototype,`drawerPosition`,void 0),K([W({type:Boolean})],So.prototype,`transparentBackdrop`,void 0),K([G()],So.prototype,`_isOpen`,void 0);try{U(`pkt-modal`)(So)}catch{console.warn(`Forsøker å definere <pkt-modal>, men den er allerede definert`)}var Co=`important`,wo=` !`+Co,To=Ze(class extends Qe{constructor(e){if(super(e),e.type!==Xe.ATTRIBUTE||e.name!==`style`||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce((t,n)=>{let r=e[n];return r==null?t:t+`${n=n.includes(`-`)?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,`-$&`).toLowerCase()}:${r};`},``)}update(e,[t]){let{style:n}=e.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let e of this.ft)t[e]??(this.ft.delete(e),e.includes(`-`)?n.removeProperty(e):n[e]=null);for(let e in t){let r=t[e];if(r!=null){this.ft.add(e);let t=typeof r==`string`&&r.endsWith(wo);e.includes(`-`)||t?n.setProperty(e,t?r.slice(0,-11):r,t?Co:``):n[e]=r}}return M}}),Eo=class extends Ye{constructor(){super(),this.ariaLabel=null,this.ariaLabelledby=null,this.ariaValueText=null,this.ariaLive=`polite`,this.id=bi(),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=Y(),this.progressBarRef=Y()}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||bi(),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(){let e=this.statusType!==`none`,t=this.valueMax-this.valueMin,n=this.valueCurrent/t*100,r=this.statusType===`fraction`?Math.round(n):Math.round((this.valueCurrent-this.valueMin)/(this.valueMax-this.valueMin)*100),i=`${this.valueCurrent} av ${t}`,a=q({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),o=q({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition===`center`}),s=q({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement===`center`}),c=q({"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 j` <div
1461
+ `}};G([U({type:Boolean,reflect:!0})],So.prototype,`open`,void 0),G([U({type:String})],So.prototype,`headingText`,void 0),G([U({type:Boolean})],So.prototype,`removePadding`,void 0),G([U({type:Boolean})],So.prototype,`hideCloseButton`,void 0),G([U({type:Boolean})],So.prototype,`closeOnBackdropClick`,void 0),G([U({type:String})],So.prototype,`closeButtonSkin`,void 0),G([U({type:String})],So.prototype,`size`,void 0),G([U({type:String})],So.prototype,`variant`,void 0),G([U({type:String})],So.prototype,`drawerPosition`,void 0),G([U({type:Boolean})],So.prototype,`transparentBackdrop`,void 0),G([W()],So.prototype,`_isOpen`,void 0);try{H(`pkt-modal`)(So)}catch{console.warn(`Forsøker å definere <pkt-modal>, men den er allerede definert`)}var Co=`important`,wo=` !`+Co,To=Qe(class extends $e{constructor(e){if(super(e),e.type!==Ze.ATTRIBUTE||e.name!==`style`||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce((t,n)=>{let r=e[n];return r==null?t:t+`${n=n.includes(`-`)?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,`-$&`).toLowerCase()}:${r};`},``)}update(e,[t]){let{style:n}=e.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let e of this.ft)t[e]??(this.ft.delete(e),e.includes(`-`)?n.removeProperty(e):n[e]=null);for(let e in t){let r=t[e];if(r!=null){this.ft.add(e);let t=typeof r==`string`&&r.endsWith(wo);e.includes(`-`)||t?n.setProperty(e,t?r.slice(0,-11):r,t?Co:``):n[e]=r}}return M}}),Eo=class extends Xe{constructor(){super(),this.ariaLabel=null,this.ariaLabelledby=null,this.ariaValueText=null,this.ariaLive=`polite`,this.id=xi(),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=J(),this.progressBarRef=J()}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||xi(),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(){let e=this.statusType!==`none`,t=this.valueMax-this.valueMin,n=this.valueCurrent/t*100,r=this.statusType===`fraction`?Math.round(n):Math.round((this.valueCurrent-this.valueMin)/(this.valueMax-this.valueMin)*100),i=`${this.valueCurrent} av ${t}`,a=K({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),o=K({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition===`center`}),s=K({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement===`center`}),c=K({"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 j` <div
1462
1462
  class="pkt-progressbar__container"
1463
1463
  .ref=${this.progressBarRef}
1464
1464
  style=${To({"--pkt-progress-label-width":`${this.labelWidth}px`,"--pkt-progress-width":`${r}%`})}
@@ -1470,11 +1470,11 @@
1470
1470
  </div>
1471
1471
 
1472
1472
  ${e?j`<div class=${s}>
1473
- <span class=${c} ${X(this.labelRef)}>
1473
+ <span class=${c} ${Y(this.labelRef)}>
1474
1474
  ${this.statusType===`percentage`?`${r}%`:i}
1475
1475
  </span>
1476
1476
  </div>`:N}
1477
- </div>`}setComputedValues(){this.progressbarId=this.id||bi(),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))}};K([W({type:String})],Eo.prototype,`ariaLabel`,void 0),K([W({type:String,reflect:!0})],Eo.prototype,`ariaLabelledby`,void 0),K([W({type:String,reflect:!0})],Eo.prototype,`ariaValueText`,void 0),K([W({type:String})],Eo.prototype,`ariaLive`,void 0),K([W({type:String,reflect:!0})],Eo.prototype,`id`,void 0),K([W({type:String})],Eo.prototype,`role`,void 0),K([W({type:String})],Eo.prototype,`skin`,void 0),K([W({type:String})],Eo.prototype,`statusPlacement`,void 0),K([W({type:String})],Eo.prototype,`statusType`,void 0),K([W({type:String,reflect:!0})],Eo.prototype,`title`,void 0),K([W({type:String})],Eo.prototype,`titlePosition`,void 0),K([W({type:Number,reflect:!0})],Eo.prototype,`valueCurrent`,void 0),K([W({type:Number})],Eo.prototype,`valueMax`,void 0),K([W({type:Number})],Eo.prototype,`valueMin`,void 0),K([G()],Eo.prototype,`labelWidth`,void 0),K([G()],Eo.prototype,`progressbarId`,void 0),K([G()],Eo.prototype,`computedAriaLabelledby`,void 0),K([G()],Eo.prototype,`computedAriaValueText`,void 0);try{U(`pkt-progressbar`)(Eo)}catch{console.warn(`Forsøker å definere <pkt-progressbar>, men den er allerede definert`)}var Do=class extends Z{constructor(...e){super(...e),this.inputRef=Y(),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(e,t,n){e===`defaultChecked`&&(this._checked=this.defaultChecked),e===`checked`&&(this._checked=this.checked===``||this.checked===`true`||this.checked===!0),super.attributeChangedCallback(e,t,n)}render(){let e=q({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),t=q({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),n=q({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-sr-only":this.hideLabel}),r=`pkt-tag pkt-tag--small pkt-tag--thin-text`;return j`
1477
+ </div>`}setComputedValues(){this.progressbarId=this.id||xi(),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))}};G([U({type:String})],Eo.prototype,`ariaLabel`,void 0),G([U({type:String,reflect:!0})],Eo.prototype,`ariaLabelledby`,void 0),G([U({type:String,reflect:!0})],Eo.prototype,`ariaValueText`,void 0),G([U({type:String})],Eo.prototype,`ariaLive`,void 0),G([U({type:String,reflect:!0})],Eo.prototype,`id`,void 0),G([U({type:String})],Eo.prototype,`role`,void 0),G([U({type:String})],Eo.prototype,`skin`,void 0),G([U({type:String})],Eo.prototype,`statusPlacement`,void 0),G([U({type:String})],Eo.prototype,`statusType`,void 0),G([U({type:String,reflect:!0})],Eo.prototype,`title`,void 0),G([U({type:String})],Eo.prototype,`titlePosition`,void 0),G([U({type:Number,reflect:!0})],Eo.prototype,`valueCurrent`,void 0),G([U({type:Number})],Eo.prototype,`valueMax`,void 0),G([U({type:Number})],Eo.prototype,`valueMin`,void 0),G([W()],Eo.prototype,`labelWidth`,void 0),G([W()],Eo.prototype,`progressbarId`,void 0),G([W()],Eo.prototype,`computedAriaLabelledby`,void 0),G([W()],Eo.prototype,`computedAriaValueText`,void 0);try{H(`pkt-progressbar`)(Eo)}catch{console.warn(`Forsøker å definere <pkt-progressbar>, men den er allerede definert`)}var Do=class extends X{constructor(...e){super(...e),this.inputRef=J(),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(e,t,n){e===`defaultChecked`&&(this._checked=this.defaultChecked),e===`checked`&&(this._checked=this.checked===``||this.checked===`true`||this.checked===!0),super.attributeChangedCallback(e,t,n)}render(){let e=K({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),t=K({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),n=K({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-sr-only":this.hideLabel}),r=`pkt-tag pkt-tag--small pkt-tag--thin-text`;return j`
1478
1478
  <div class="pkt-input-check">
1479
1479
  <div class=${e}>
1480
1480
  <input
@@ -1485,7 +1485,7 @@
1485
1485
  ?disabled=${this.disabled}
1486
1486
  form=""
1487
1487
  name=${this.name+`-internal`}
1488
- ${X(this.inputRef)}
1488
+ ${Y(this.inputRef)}
1489
1489
  @change=${this.toggleChecked}
1490
1490
  @input=${this.onInput}
1491
1491
  @blur=${this.onBlur}
@@ -1504,46 +1504,46 @@
1504
1504
  `}
1505
1505
  </div>
1506
1506
  </div>
1507
- `}toggleChecked(e=null){e&&e.preventDefault(),e&&e.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this._checked=this.inputRef.value.matches(`:checked`),this.valueChecked(this._checked))}};K([W({type:String,reflect:!0})],Do.prototype,`value`,void 0),K([W({type:String})],Do.prototype,`checkHelptext`,void 0),K([W({type:Boolean})],Do.prototype,`defaultChecked`,void 0),K([W({type:Boolean})],Do.prototype,`hasTile`,void 0),K([W({type:Boolean,reflect:!0})],Do.prototype,`checked`,void 0),K([W({type:String,reflect:!0})],Do.prototype,`type`,void 0),K([W({type:String})],Do.prototype,`tagText`,void 0),K([W({type:Boolean})],Do.prototype,`optionalTag`,void 0),K([W({type:String})],Do.prototype,`optionalText`,void 0),K([W({type:Boolean})],Do.prototype,`requiredTag`,void 0),K([W({type:String})],Do.prototype,`requiredText`,void 0),K([G()],Do.prototype,`_checked`,void 0);try{U(`pkt-radiobutton`)(Do)}catch{console.warn(`Forsøker å definere <pkt-radiobutton>, men den er allerede definert`)}var Oo=class extends Event{constructor(e,t,n,r){super(`context-request`,{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t,this.callback=n,this.subscribe=r??!1}};function ko(e){return e}var Ao=class{constructor(e,t,n,r){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(e,t)=>{this.unsubscribe&&(this.unsubscribe!==t&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=e,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(e,t)),this.unsubscribe=t},this.host=e,t.context!==void 0){let e=t;this.context=e.context,this.callback=e.callback,this.subscribe=e.subscribe??!1}else this.context=t,this.callback=n,this.subscribe=r??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&=(this.unsubscribe(),void 0)}dispatchRequest(){this.host.dispatchEvent(new Oo(this.context,this.host,this.t,this.subscribe))}},jo=class{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,t=!1){let n=t||!Object.is(e,this.o);this.o=e,n&&this.updateObservers()}constructor(e){this.subscriptions=new Map,this.updateObservers=()=>{for(let[e,{disposer:t}]of this.subscriptions)e(this.o,t)},e!==void 0&&(this.value=e)}addCallback(e,t,n){if(!n)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:t});let{disposer:r}=this.subscriptions.get(e);e(this.value,r)}clearCallbacks(){this.subscriptions.clear()}},Mo=class extends Event{constructor(e,t){super(`context-provider`,{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t}},No=class extends jo{constructor(e,t,n){super(t.context===void 0?n:t.initialValue),this.onContextRequest=e=>{if(e.context!==this.context)return;let t=e.contextTarget??e.composedPath()[0];t!==this.host&&(e.stopPropagation(),this.addCallback(e.callback,t,e.subscribe))},this.onProviderRequest=e=>{if(e.context!==this.context||(e.contextTarget??e.composedPath()[0])===this.host)return;let t=new Set;for(let[e,{consumerHost:n}]of this.subscriptions)t.has(e)||(t.add(e),n.dispatchEvent(new Oo(this.context,n,e,!0)));e.stopPropagation()},this.host=e,t.context===void 0?this.context=t:this.context=t.context,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener(`context-request`,this.onContextRequest),this.host.addEventListener(`context-provider`,this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new Mo(this.context,this.host))}};function Po({context:e}){return(t,n)=>{let r=new WeakMap;if(typeof n==`object`)return{get(){return t.get.call(this)},set(e){return r.get(this).setValue(e),t.set.call(this,e)},init(t){return r.set(this,new No(this,{context:e,initialValue:t})),t}};{t.constructor.addInitializer((t=>{r.set(t,new No(t,{context:e}))}));let i=Object.getOwnPropertyDescriptor(t,n),a;if(i===void 0){let e=new WeakMap;a={get(){return e.get(this)},set(t){r.get(this).setValue(t),e.set(this,t)},configurable:!0,enumerable:!0}}else{let e=i.set;a={...i,set(t){r.get(this).setValue(t),e?.call(this,t)}}}Object.defineProperty(t,n,a);return}}}function Fo({context:e,subscribe:t}){return(n,r)=>{typeof r==`object`?r.addInitializer((function(){new Ao(this,{context:e,callback:e=>{n.set.call(this,e)},subscribe:t})})):n.constructor.addInitializer((n=>{new Ao(n,{context:e,callback:e=>{n[r]=e},subscribe:t})}))}}var Io=ko(Symbol(`pkt-tabs-context`)),Lo=class extends Dt{constructor(...e){super(...e),this.arrowNav=!0,this.disableArrowNav=!1,this.tabRefs=[],this.disabledMap={},this.tabCount=0,this.context={useArrowNav:this.useArrowNav,registerTab:this.registerTab.bind(this),handleClick:this.handleClick.bind(this),handleKeyUp:this.handleKeyUp.bind(this)}}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,n=!1){this.tabRefs[t]=e,this.disabledMap[t]=n,this.tabCount=Math.max(this.tabCount,t+1)}isTabDisabled(e){return!!this.disabledMap[e]}findEnabledIndex(e,t){let n=e+t;for(;n>=0&&n<this.tabCount;){if(!this.isTabDisabled(n))return n;n+=t}return null}handleClick(e){this.isTabDisabled(e)||this.dispatchEvent(new CustomEvent(`tab-selected`,{detail:{index:e},bubbles:!0,composed:!0}))}handleKeyUp(e,t){if(this.useArrowNav){if(e.key===`ArrowLeft`){e.preventDefault();let n=this.findEnabledIndex(t,-1);n!==null&&this.tabRefs[n]?.focus()}if(e.key===`ArrowRight`){e.preventDefault();let n=this.findEnabledIndex(t,1);n!==null&&this.tabRefs[n]?.focus()}(e.key===`Enter`||e.key===` `||e.key===`Spacebar`||e.key===`ArrowDown`)&&(e.preventDefault(),this.handleClick(t))}}render(){return j`
1508
- <div class="pkt-tabs">
1509
- <div class="pkt-tabs__list" role=${this.useArrowNav?`tablist`:`navigation`}>${Et(this)}</div>
1507
+ `}toggleChecked(e=null){e&&e.preventDefault(),e&&e.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this._checked=this.inputRef.value.matches(`:checked`),this.valueChecked(this._checked))}};G([U({type:String,reflect:!0})],Do.prototype,`value`,void 0),G([U({type:String})],Do.prototype,`checkHelptext`,void 0),G([U({type:Boolean})],Do.prototype,`defaultChecked`,void 0),G([U({type:Boolean})],Do.prototype,`hasTile`,void 0),G([U({type:Boolean,reflect:!0})],Do.prototype,`checked`,void 0),G([U({type:String,reflect:!0})],Do.prototype,`type`,void 0),G([U({type:String})],Do.prototype,`tagText`,void 0),G([U({type:Boolean})],Do.prototype,`optionalTag`,void 0),G([U({type:String})],Do.prototype,`optionalText`,void 0),G([U({type:Boolean})],Do.prototype,`requiredTag`,void 0),G([U({type:String})],Do.prototype,`requiredText`,void 0),G([W()],Do.prototype,`_checked`,void 0);try{H(`pkt-radiobutton`)(Do)}catch{console.warn(`Forsøker å definere <pkt-radiobutton>, men den er allerede definert`)}var Oo=class extends Event{constructor(e,t,n,r){super(`context-request`,{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t,this.callback=n,this.subscribe=r??!1}};function ko(e){return e}var Ao=class{constructor(e,t,n,r){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(e,t)=>{this.unsubscribe&&(this.unsubscribe!==t&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=e,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(e,t)),this.unsubscribe=t},this.host=e,t.context!==void 0){let e=t;this.context=e.context,this.callback=e.callback,this.subscribe=e.subscribe??!1}else this.context=t,this.callback=n,this.subscribe=r??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&=(this.unsubscribe(),void 0)}dispatchRequest(){this.host.dispatchEvent(new Oo(this.context,this.host,this.t,this.subscribe))}},jo=class{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,t=!1){let n=t||!Object.is(e,this.o);this.o=e,n&&this.updateObservers()}constructor(e){this.subscriptions=new Map,this.updateObservers=()=>{for(let[e,{disposer:t}]of this.subscriptions)e(this.o,t)},e!==void 0&&(this.value=e)}addCallback(e,t,n){if(!n)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:t});let{disposer:r}=this.subscriptions.get(e);e(this.value,r)}clearCallbacks(){this.subscriptions.clear()}},Mo=class extends Event{constructor(e,t){super(`context-provider`,{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t}},No=class extends jo{constructor(e,t,n){super(t.context===void 0?n:t.initialValue),this.onContextRequest=e=>{if(e.context!==this.context)return;let t=e.contextTarget??e.composedPath()[0];t!==this.host&&(e.stopPropagation(),this.addCallback(e.callback,t,e.subscribe))},this.onProviderRequest=e=>{if(e.context!==this.context||(e.contextTarget??e.composedPath()[0])===this.host)return;let t=new Set;for(let[e,{consumerHost:n}]of this.subscriptions)t.has(e)||(t.add(e),n.dispatchEvent(new Oo(this.context,n,e,!0)));e.stopPropagation()},this.host=e,t.context===void 0?this.context=t:this.context=t.context,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener(`context-request`,this.onContextRequest),this.host.addEventListener(`context-provider`,this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new Mo(this.context,this.host))}};function Po({context:e}){return(t,n)=>{let r=new WeakMap;if(typeof n==`object`)return{get(){return t.get.call(this)},set(e){return r.get(this).setValue(e),t.set.call(this,e)},init(t){return r.set(this,new No(this,{context:e,initialValue:t})),t}};{t.constructor.addInitializer((t=>{r.set(t,new No(t,{context:e}))}));let i=Object.getOwnPropertyDescriptor(t,n),a;if(i===void 0){let e=new WeakMap;a={get(){return e.get(this)},set(t){r.get(this).setValue(t),e.set(this,t)},configurable:!0,enumerable:!0}}else{let e=i.set;a={...i,set(t){r.get(this).setValue(t),e?.call(this,t)}}}Object.defineProperty(t,n,a);return}}}function Fo({context:e,subscribe:t}){return(n,r)=>{typeof r==`object`?r.addInitializer((function(){new Ao(this,{context:e,callback:e=>{n.set.call(this,e)},subscribe:t})})):n.constructor.addInitializer((n=>{new Ao(n,{context:e,callback:e=>{n[r]=e},subscribe:t})}))}}var Io=ko(Symbol(`pkt-tabs-context`)),Lo=class extends Ot{constructor(...e){super(...e),this.arrowNav=!0,this.disableArrowNav=!1,this.separatorIconName=``,this.separatorIconPath=``,this.tabRefs=[],this.disabledMap={},this.tabCount=0,this.context={useArrowNav:this.useArrowNav,registerTab:this.registerTab.bind(this),handleClick:this.handleClick.bind(this),handleKeyUp:this.handleKeyUp.bind(this)}}get useArrowNav(){return this.arrowNav&&!this.disableArrowNav}updated(e){(e.has(`arrowNav`)||e.has(`disableArrowNav`))&&(this.context={...this.context,useArrowNav:this.useArrowNav}),this.updateComplete.then(()=>this.syncSeparators())}syncSeparators(){let e=this.querySelector(`.pkt-tabs__list`);if(!e||(e.querySelectorAll(`.pkt-tabs__separator`).forEach(e=>e.remove()),!(this.separatorIconName||this.separatorIconPath)))return;let t=Array.from(e.children).filter(e=>!e.classList.contains(`pkt-tabs__separator`));for(let e=0;e<t.length-1;e++){let n=document.createElement(`span`);if(n.className=`pkt-tabs__separator`,n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`role`,`presentation`),this.separatorIconPath){let e=document.createElement(`img`);e.setAttribute(`src`,this.separatorIconPath),e.setAttribute(`alt`,``),e.setAttribute(`aria-hidden`,`true`),n.appendChild(e)}else if(this.separatorIconName){let e=document.createElement(`pkt-icon`);e.setAttribute(`name`,this.separatorIconName),e.classList.add(`pkt-tabs__separator-icon`),n.appendChild(e)}t[e].after(n)}}registerTab(e,t,n=!1){this.tabRefs[t]=e,this.disabledMap[t]=n,this.tabCount=Math.max(this.tabCount,t+1)}isTabDisabled(e){return!!this.disabledMap[e]}findEnabledIndex(e,t){let n=e+t;for(;n>=0&&n<this.tabCount;){if(!this.isTabDisabled(n))return n;n+=t}return null}handleClick(e){this.isTabDisabled(e)||this.dispatchEvent(new CustomEvent(`tab-selected`,{detail:{index:e},bubbles:!0,composed:!0}))}handleKeyUp(e,t){if(this.useArrowNav){if(e.key===`ArrowLeft`){e.preventDefault();let n=this.findEnabledIndex(t,-1);n!==null&&this.tabRefs[n]?.focus()}if(e.key===`ArrowRight`){e.preventDefault();let n=this.findEnabledIndex(t,1);n!==null&&this.tabRefs[n]?.focus()}(e.key===`Enter`||e.key===` `||e.key===`Spacebar`||e.key===`ArrowDown`)&&(e.preventDefault(),this.handleClick(t))}}render(){let e=this.useArrowNav?`tablist`:`navigation`;return j`
1508
+ <div class=${this.separatorIconName||this.separatorIconPath?`pkt-tabs pkt-tabs--with-separator`:`pkt-tabs`}>
1509
+ <div class="pkt-tabs__list" role=${e}>${Dt(this)}</div>
1510
1510
  </div>
1511
- `}};K([W({type:Boolean,reflect:!0,attribute:`arrow-nav`})],Lo.prototype,`arrowNav`,void 0),K([W({type:Boolean,reflect:!0,attribute:`disable-arrow-nav`})],Lo.prototype,`disableArrowNav`,void 0),K([G()],Lo.prototype,`tabRefs`,void 0),K([G()],Lo.prototype,`disabledMap`,void 0),K([G()],Lo.prototype,`tabCount`,void 0),K([Po({context:Io}),G()],Lo.prototype,`context`,void 0);try{U(`pkt-tabs`)(Lo)}catch{console.warn(`Forsøker å definere <pkt-tabs>, men den er allerede definert`)}var Ro=class extends Dt{constructor(){super(),this.active=!1,this.disabled=!1,this.href=``,this.icon=``,this.controls=``,this.tag=``,this.tagSkin=`blue`,this.index=0,this.elementRef=Y()}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index,this.disabled)})}updated(){this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index,this.disabled)}handleClick(e){if(this.disabled){e.preventDefault(),e.stopPropagation();return}this.context&&this.context.handleClick(this.index)}handleKeyDown(e){if(this.disabled&&(e.key===`Enter`||e.key===` `||e.key===`Spacebar`)){e.preventDefault(),e.stopPropagation();return}this.context&&this.context.handleKeyUp(e,this.index)}render(){let e=this.context?.useArrowNav??!0,t=this.active&&!this.disabled,n=[t?`active`:``,this.disabled?`pkt-tabs__item--disabled`:``].filter(Boolean).join(` `),r=e?`tab`:void 0,i=e?t:void 0,a=this.disabled?-1:t||!e?void 0:-1,o=j`
1512
- ${this.icon?j`<pkt-icon name=${this.icon} class="pkt-icon--small"></pkt-icon>`:``}
1513
- <span>${Et(this)}</span>
1511
+ `}};G([U({type:Boolean,reflect:!0,attribute:`arrow-nav`})],Lo.prototype,`arrowNav`,void 0),G([U({type:Boolean,reflect:!0,attribute:`disable-arrow-nav`})],Lo.prototype,`disableArrowNav`,void 0),G([U({type:String,reflect:!0,attribute:`separator-icon-name`})],Lo.prototype,`separatorIconName`,void 0),G([U({type:String,reflect:!0,attribute:`separator-icon-path`})],Lo.prototype,`separatorIconPath`,void 0),G([W()],Lo.prototype,`tabRefs`,void 0),G([W()],Lo.prototype,`disabledMap`,void 0),G([W()],Lo.prototype,`tabCount`,void 0),G([Po({context:Io}),W()],Lo.prototype,`context`,void 0);try{H(`pkt-tabs`)(Lo)}catch{console.warn(`Forsøker å definere <pkt-tabs>, men den er allerede definert`)}var Ro=class extends Ot{constructor(){super(),this.active=!1,this.disabled=!1,this.href=``,this.icon=``,this.controls=``,this.tag=``,this.tagSkin=`blue`,this.index=0,this.elementRef=J()}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index,this.disabled)})}updated(){this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index,this.disabled)}handleClick(e){if(this.disabled){e.preventDefault(),e.stopPropagation();return}this.context&&this.context.handleClick(this.index)}handleKeyDown(e){if(this.disabled&&(e.key===`Enter`||e.key===` `||e.key===`Spacebar`)){e.preventDefault(),e.stopPropagation();return}this.context&&this.context.handleKeyUp(e,this.index)}render(){let e=this.context?.useArrowNav??!0,t=this.active&&!this.disabled,n=[t?`active`:``,this.disabled?`pkt-tabs__item--disabled`:``].filter(Boolean).join(` `),r=e?`tab`:void 0,i=e?t:void 0,a=this.disabled?-1:t||!e?void 0:-1,o=`pkt-icon--small ${this.icon===`check`?`pkt-tabs__status-icon`:``}`,s=j`
1512
+ ${this.icon?j`<pkt-icon name=${this.icon} class=${o}></pkt-icon>`:``}
1513
+ <span>${Dt(this)}</span>
1514
1514
  ${this.tag?j`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>`:``}
1515
1515
  `;return this.href?j`
1516
1516
  <a
1517
- ${X(this.elementRef)}
1518
- href=${J(this.disabled?void 0:this.href)}
1517
+ ${Y(this.elementRef)}
1518
+ href=${q(this.disabled?void 0:this.href)}
1519
1519
  class="pkt-tabs__link ${n}"
1520
- role=${J(r)}
1521
- aria-selected=${J(i)}
1522
- aria-disabled=${J(this.disabled?`true`:void 0)}
1523
- aria-controls=${J(this.controls||void 0)}
1524
- tabindex=${J(a)}
1520
+ role=${q(r)}
1521
+ aria-selected=${q(i)}
1522
+ aria-disabled=${q(this.disabled?`true`:void 0)}
1523
+ aria-controls=${q(this.controls||void 0)}
1524
+ tabindex=${q(a)}
1525
1525
  @click=${this.handleClick}
1526
1526
  @keydown=${this.handleKeyDown}
1527
1527
  >
1528
- ${o}
1528
+ ${s}
1529
1529
  </a>
1530
1530
  `:j`
1531
1531
  <button
1532
- ${X(this.elementRef)}
1532
+ ${Y(this.elementRef)}
1533
1533
  type="button"
1534
1534
  class="pkt-tabs__button pkt-link-button ${n}"
1535
1535
  ?disabled=${this.disabled}
1536
- aria-disabled=${J(this.disabled?`true`:void 0)}
1537
- role=${J(r)}
1538
- aria-selected=${J(i)}
1539
- aria-controls=${J(this.controls||void 0)}
1540
- tabindex=${J(a)}
1536
+ aria-disabled=${q(this.disabled?`true`:void 0)}
1537
+ role=${q(r)}
1538
+ aria-selected=${q(i)}
1539
+ aria-controls=${q(this.controls||void 0)}
1540
+ tabindex=${q(a)}
1541
1541
  @click=${this.handleClick}
1542
1542
  @keydown=${this.handleKeyDown}
1543
1543
  >
1544
- ${o}
1544
+ ${s}
1545
1545
  </button>
1546
- `}};K([W({type:Boolean,reflect:!0})],Ro.prototype,`active`,void 0),K([W({type:Boolean,reflect:!0})],Ro.prototype,`disabled`,void 0),K([W({type:String,reflect:!0})],Ro.prototype,`href`,void 0),K([W({type:String,reflect:!0})],Ro.prototype,`icon`,void 0),K([W({type:String,reflect:!0})],Ro.prototype,`controls`,void 0),K([W({type:String,reflect:!0})],Ro.prototype,`tag`,void 0),K([W({type:String,reflect:!0,attribute:`tag-skin`})],Ro.prototype,`tagSkin`,void 0),K([W({type:Number,reflect:!0})],Ro.prototype,`index`,void 0),K([Fo({context:Io,subscribe:!0}),W({attribute:!1})],Ro.prototype,`context`,void 0);try{U(`pkt-tab-item`)(Ro)}catch{console.warn(`Forsøker å definere <pkt-tab-item>, men den er allerede definert`)}var zo=Ze(class extends Qe{constructor(e){if(super(e),e.type!==Xe.PROPERTY&&e.type!==Xe.ATTRIBUTE&&e.type!==Xe.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!tt(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===M||t===N)return t;let n=e.element,r=e.name;if(e.type===Xe.PROPERTY){if(t===n[r])return M}else if(e.type===Xe.BOOLEAN_ATTRIBUTE){if(!!t===n.hasAttribute(r))return M}else if(e.type===Xe.ATTRIBUTE&&n.getAttribute(r)===t+``)return M;return ot(e),t}}),Bo=class extends Z{constructor(...e){super(...e),this.inputRef=Y(),this.value=``,this.autocomplete=`off`,this.rows=null,this.counterCurrent=0}attributeChangedCallback(e,t,n){e===`value`&&this.value!==t&&(this.counterCurrent=n?n.length:0,this.valueChanged(n,t)),super.attributeChangedCallback(e,t,n)}updated(e){super.updated(e),e.has(`value`)&&(this.counterCurrent=this.value?.length||0,this.valueChanged(this.value,e.get(`value`))),e.has(`id`)&&!this.name&&this.id&&(this.name=this.id)}render(){let e=q({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),t=this.ariaLabelledby||`${this.id}-input-label`;return j`<pkt-input-wrapper
1546
+ `}};G([U({type:Boolean,reflect:!0})],Ro.prototype,`active`,void 0),G([U({type:Boolean,reflect:!0})],Ro.prototype,`disabled`,void 0),G([U({type:String,reflect:!0})],Ro.prototype,`href`,void 0),G([U({type:String,reflect:!0})],Ro.prototype,`icon`,void 0),G([U({type:String,reflect:!0})],Ro.prototype,`controls`,void 0),G([U({type:String,reflect:!0})],Ro.prototype,`tag`,void 0),G([U({type:String,reflect:!0,attribute:`tag-skin`})],Ro.prototype,`tagSkin`,void 0),G([U({type:Number,reflect:!0})],Ro.prototype,`index`,void 0),G([Fo({context:Io,subscribe:!0}),U({attribute:!1})],Ro.prototype,`context`,void 0);try{H(`pkt-tab-item`)(Ro)}catch{console.warn(`Forsøker å definere <pkt-tab-item>, men den er allerede definert`)}var zo=Qe(class extends $e{constructor(e){if(super(e),e.type!==Ze.PROPERTY&&e.type!==Ze.ATTRIBUTE&&e.type!==Ze.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!nt(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===M||t===N)return t;let n=e.element,r=e.name;if(e.type===Ze.PROPERTY){if(t===n[r])return M}else if(e.type===Ze.BOOLEAN_ATTRIBUTE){if(!!t===n.hasAttribute(r))return M}else if(e.type===Ze.ATTRIBUTE&&n.getAttribute(r)===t+``)return M;return st(e),t}}),Bo=class extends X{constructor(...e){super(...e),this.inputRef=J(),this.value=``,this.autocomplete=`off`,this.rows=null,this.counterCurrent=0}attributeChangedCallback(e,t,n){e===`value`&&this.value!==t&&(this.counterCurrent=n?n.length:0,this.valueChanged(n,t)),super.attributeChangedCallback(e,t,n)}updated(e){super.updated(e),e.has(`value`)&&(this.counterCurrent=this.value?.length||0,this.valueChanged(this.value,e.get(`value`))),e.has(`id`)&&!this.name&&this.id&&(this.name=this.id)}render(){let e=K({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),t=this.ariaLabelledby||`${this.id}-input-label`;return j`<pkt-input-wrapper
1547
1547
  label=${this.label}
1548
1548
  ?counter=${this.counter}
1549
1549
  ?disabled=${this.disabled}
@@ -1566,16 +1566,16 @@
1566
1566
  .tagText=${this.tagText}
1567
1567
  class="pkt-textarea"
1568
1568
  >
1569
- <div class="pkt-contents" slot="helptext">${Et(this,`helptext`)}</div>
1569
+ <div class="pkt-contents" slot="helptext">${Dt(this,`helptext`)}</div>
1570
1570
  <textarea
1571
- ${X(this.inputRef)}
1571
+ ${Y(this.inputRef)}
1572
1572
  class=${e}
1573
1573
  id=${this.id+`-input`}
1574
1574
  name=${(this.name||this.id)+`-input`}
1575
- placeholder=${J(this.placeholder)}
1575
+ placeholder=${q(this.placeholder)}
1576
1576
  .value=${zo(this.value)}
1577
- minlength=${J(this.minlength)}
1578
- maxlength=${J(this.maxlength)}
1577
+ minlength=${q(this.minlength)}
1578
+ maxlength=${q(this.maxlength)}
1579
1579
  ?readonly=${this.readonly}
1580
1580
  autocomplete=${this.autocomplete}
1581
1581
  aria-labelledby=${t}
@@ -1588,7 +1588,7 @@
1588
1588
  @focus=${e=>{this.onFocus(),e.stopImmediatePropagation()}}
1589
1589
  @blur=${e=>{this.value=e.target.value,this.onBlur(),e.stopImmediatePropagation()}}
1590
1590
  ></textarea>
1591
- </pkt-input-wrapper>`}};K([W({type:String,reflect:!0})],Bo.prototype,`value`,void 0),K([W({type:String})],Bo.prototype,`autocomplete`,void 0),K([W({type:Number})],Bo.prototype,`rows`,void 0),K([G()],Bo.prototype,`counterCurrent`,void 0);try{U(`pkt-textarea`)(Bo)}catch{console.warn(`Forsøker å definere <pkt-textarea>, men den er allerede definert`)}var Vo=class extends Z{constructor(...e){super(...e),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(){let e=this._optionsProp.length>0,t=this.optionsController?.nodes?.length&&this.optionsController.nodes.length>0;e?this._options=this._optionsProp:t&&(this._options=this.optionsController.options)}willUpdate(e){super.willUpdate(e),this.parseOptions()}};K([W({type:Array,attribute:`options`})],Vo.prototype,`_optionsProp`,void 0),K([G()],Vo.prototype,`_options`,void 0);var Ho=class extends Vo{constructor(){super(),this.inputRef=Y(),this.value=``,this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new Wi(this)}connectedCallback(){super.connectedCallback(),this.parseOptions(),this._options.forEach(e=>{e.selected&&!this.value&&(this.value=e.value)})}add(e,t){let n={value:e.value||e.text,label:e.text||e.value,selected:e.selected,disabled:e.disabled};if(t===void 0)this._options.push(n);else if(typeof t==`number`)this._options.splice(t,0,n);else{let e=t.value||t.text,r=this._options.findIndex(t=>t.value===e);r>=0?this._options.splice(r,0,n):this._options.push(n)}e.selected&&(this.value=e.value||e.text,this.selectedIndex=this._options.findIndex(e=>e.value===this.value)),this.requestUpdate()}remove(e){typeof e==`number`&&(this.selectedIndex===e&&(this.value=this._options[0]?.value||``),this._options.splice(e,1),this.requestUpdate())}item(e){return this.inputRef.value?.item(e)}namedItem(e){return this.inputRef.value?.namedItem(e)}showPicker(){this.inputRef.value&&`showPicker`in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(e,t,n){e===`options`&&(this._options=n?JSON.parse(n):[]),e===`value`&&this.value!==t&&(this.selectedIndex=this.touched?this.returnNumberOrNull(this.inputRef.value?.selectedIndex):this._options.findIndex(e=>e.value===n),this.selectedOptions=this.inputRef.value?.selectedOptions,this.valueChanged(n,t)),super.attributeChangedCallback(e,t,n)}update(e){super.update(e),e.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)),e.has(`value`)&&this.value!==e.get(`value`)&&(this.selectedIndex=this.touched?this.returnNumberOrNull(this.inputRef.value?.selectedIndex):this._options.findIndex(e=>e.value===this.value),this.selectedOptions=this.inputRef.value?.selectedOptions,this.valueChanged(this.value,e.get(`value`))),e.has(`id`)&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(e){super.firstUpdated(e),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(e=>e.value===this.value),this.selectedOptions=this.inputRef.value?.selectedOptions}render(){let e=`pkt-input ${this.fullwidth?`pkt-input--fullwidth`:``}`;return j`
1591
+ </pkt-input-wrapper>`}};G([U({type:String,reflect:!0})],Bo.prototype,`value`,void 0),G([U({type:String})],Bo.prototype,`autocomplete`,void 0),G([U({type:Number})],Bo.prototype,`rows`,void 0),G([W()],Bo.prototype,`counterCurrent`,void 0);try{H(`pkt-textarea`)(Bo)}catch{console.warn(`Forsøker å definere <pkt-textarea>, men den er allerede definert`)}var Vo=class extends X{constructor(...e){super(...e),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(){let e=this._optionsProp.length>0,t=this.optionsController?.nodes?.length&&this.optionsController.nodes.length>0;e?this._options=this._optionsProp:t&&(this._options=this.optionsController.options)}willUpdate(e){super.willUpdate(e),this.parseOptions()}};G([U({type:Array,attribute:`options`})],Vo.prototype,`_optionsProp`,void 0),G([W()],Vo.prototype,`_options`,void 0);var Ho=class extends Vo{constructor(){super(),this.inputRef=J(),this.value=``,this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new Gi(this)}connectedCallback(){super.connectedCallback(),this.parseOptions(),this._options.forEach(e=>{e.selected&&!this.value&&(this.value=e.value)})}add(e,t){let n={value:e.value||e.text,label:e.text||e.value,selected:e.selected,disabled:e.disabled};if(t===void 0)this._options.push(n);else if(typeof t==`number`)this._options.splice(t,0,n);else{let e=t.value||t.text,r=this._options.findIndex(t=>t.value===e);r>=0?this._options.splice(r,0,n):this._options.push(n)}e.selected&&(this.value=e.value||e.text,this.selectedIndex=this._options.findIndex(e=>e.value===this.value)),this.requestUpdate()}remove(e){typeof e==`number`&&(this.selectedIndex===e&&(this.value=this._options[0]?.value||``),this._options.splice(e,1),this.requestUpdate())}item(e){return this.inputRef.value?.item(e)}namedItem(e){return this.inputRef.value?.namedItem(e)}showPicker(){this.inputRef.value&&`showPicker`in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(e,t,n){e===`options`&&(this._options=n?JSON.parse(n):[]),e===`value`&&this.value!==t&&(this.selectedIndex=this.touched?this.returnNumberOrNull(this.inputRef.value?.selectedIndex):this._options.findIndex(e=>e.value===n),this.selectedOptions=this.inputRef.value?.selectedOptions,this.valueChanged(n,t)),super.attributeChangedCallback(e,t,n)}update(e){super.update(e),e.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)),e.has(`value`)&&this.value!==e.get(`value`)&&(this.selectedIndex=this.touched?this.returnNumberOrNull(this.inputRef.value?.selectedIndex):this._options.findIndex(e=>e.value===this.value),this.selectedOptions=this.inputRef.value?.selectedOptions,this.valueChanged(this.value,e.get(`value`))),e.has(`id`)&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(e){super.firstUpdated(e),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(e=>e.value===this.value),this.selectedOptions=this.inputRef.value?.selectedOptions}render(){let e=`pkt-input ${this.fullwidth?`pkt-input--fullwidth`:``}`;return j`
1592
1592
  <pkt-input-wrapper
1593
1593
  ?counter=${this.counter}
1594
1594
  ?disabled=${this.disabled}
@@ -1598,23 +1598,23 @@
1598
1598
  ?optionalTag=${this.optionalTag}
1599
1599
  ?requiredTag=${this.requiredTag}
1600
1600
  useWrapper=${this.useWrapper}
1601
- ariaDescribedBy=${J(this.ariaDescribedBy)}
1601
+ ariaDescribedBy=${q(this.ariaDescribedBy)}
1602
1602
  class="pkt-select"
1603
- errorMessage=${J(this.errorMessage)}
1603
+ errorMessage=${q(this.errorMessage)}
1604
1604
  forId=${this.id+`-input`}
1605
- helptext=${J(this.helptext)}
1606
- helptextDropdown=${J(this.helptextDropdown)}
1607
- helptextDropdownButton=${J(this.helptextDropdownButton)}
1608
- label=${J(this.label)}
1609
- optionalText=${J(this.optionalText)}
1610
- requiredText=${J(this.requiredText)}
1611
- tagText=${J(this.tagText)}
1605
+ helptext=${q(this.helptext)}
1606
+ helptextDropdown=${q(this.helptextDropdown)}
1607
+ helptextDropdownButton=${q(this.helptextDropdownButton)}
1608
+ label=${q(this.label)}
1609
+ optionalText=${q(this.optionalText)}
1610
+ requiredText=${q(this.requiredText)}
1611
+ tagText=${q(this.tagText)}
1612
1612
  >
1613
1613
  <select
1614
1614
  class=${e}
1615
1615
  aria-invalid=${this.hasError}
1616
1616
  aria-errormessage=${`${this.id}-error`}
1617
- aria-labelledby=${J(this.ariaLabelledby)}
1617
+ aria-labelledby=${q(this.ariaLabelledby)}
1618
1618
  ?disabled=${this.disabled}
1619
1619
  id=${this.id+`-input`}
1620
1620
  name=${(this.name||this.id)+`-input`}
@@ -1623,7 +1623,7 @@
1623
1623
  @input=${e=>{this.onInput(),e.stopImmediatePropagation()}}
1624
1624
  @focus=${e=>{this.onFocus(),e.stopImmediatePropagation()}}
1625
1625
  @blur=${e=>{this.onBlur(),e.stopImmediatePropagation()}}
1626
- ${X(this.inputRef)}
1626
+ ${Y(this.inputRef)}
1627
1627
  >
1628
1628
  ${this._options.length>0?this._options.map(e=>j`<option
1629
1629
  value=${e.value}
@@ -1634,11 +1634,11 @@
1634
1634
  ${e.label}
1635
1635
  </option>`):``}
1636
1636
  </select>
1637
- <div class="pkt-contents" slot="helptext">${Et(this,`helptext`)}</div>
1637
+ <div class="pkt-contents" slot="helptext">${Dt(this,`helptext`)}</div>
1638
1638
  </pkt-input-wrapper>
1639
- `}returnNumberOrNull(e){return e==null||isNaN(e)?null:e}};K([W({type:String})],Ho.prototype,`value`,void 0);try{U(`pkt-select`)(Ho)}catch{console.warn(`Forsøker å definere <pkt-select>, men den er allerede definert`)}var Uo=e=>/^\d{2}:\d{2}$/.test(e)&&parseInt(e.slice(0,2),10)<=23&&parseInt(e.slice(3),10)<=59,Wo=e=>{let[t,n]=e.split(`:`).map(Number);return t*60+n},Go=e=>e?Math.max(1,Math.round(e/60)):1,Ko=(e,t)=>{let n=e?parseInt(String(e).split(`:`)[0],10):0,r=t?parseInt(String(t).split(`:`)[0],10):23;return Array.from({length:r-n+1},(e,t)=>t+n)},qo=e=>{let t=Go(e);return Array.from({length:Math.floor(60/t)},(e,n)=>n*t)},Jo=(e,t,n,r)=>{let i=e===``?n===1?0:23:parseInt(e,10),a=t===``?n===1?0:Math.floor(59/r)*r:parseInt(t,10);return a+=n*r,a>59?(a=0,i=(i+1)%24):a<0&&(a=Math.floor(59/r)*r,i=(i-1+24)%24),{hours:String(i).padStart(2,`0`),minutes:String(a).padStart(2,`0`)}},Yo=class extends Z{constructor(...e){super(...e),this.hiddenInputRef=Y(),this.hoursInputRef=Y(),this.minutesInputRef=Y(),this.buttonRef=Y(),this.value=``,this.hidePicker=!1,this.stepArrows=!1,this._hours=``,this._minutes=``,this._isOpen=!1,this._hoursDigitCount=0,this._hoursFirstDigit=-1,this._minutesDigitCount=0,this._minutesFirstDigit=-1,this._hasFocus=!1,this._outsideClickHandler=e=>{this.contains(e.target)||this._closePopup()},this._handleComponentFocusIn=()=>{this._hasFocus||(this._hasFocus=!0,this.onFocus())},this._handleComponentFocusOut=e=>{this.contains(e.relatedTarget)||(this._hasFocus=!1,this.onBlur())},this._handleHoursKeydown=e=>{let t=e.target;switch(e.key){case`ArrowUp`:{e.preventDefault();let t=this._hours===``?0:parseInt(this._hours,10);this._hours=String((t+1)%24).padStart(2,`0`),this._syncValueFromDisplay(),this.onInput();break}case`ArrowDown`:{e.preventDefault();let t=this._hours===``?0:parseInt(this._hours,10);this._hours=String((t-1+24)%24).padStart(2,`0`),this._syncValueFromDisplay(),this.onInput();break}case`ArrowRight`:e.preventDefault(),this.minutesInputRef.value?.focus();break;case`Backspace`:case`Delete`:this._hoursDigitCount=0,this._hoursFirstDigit=-1;break;case`Tab`:break;case`Enter`:{e.preventDefault();let n=this.internals.form;n?n.requestSubmit():t.blur();break}default:if(/^\d$/.test(e.key)){e.preventDefault();let t=parseInt(e.key,10);if(this._hoursDigitCount===0)this._hoursFirstDigit=t,this._hours=String(t).padStart(2,`0`),this._hoursDigitCount=1,this.onInput(),t>=3&&(this._hoursFirstDigit=-1,this._hoursDigitCount=0,this._syncValueFromDisplay(),this.minutesInputRef.value?.focus());else{let e=this._hoursFirstDigit*10+t;this._hours=e<=23?String(e).padStart(2,`0`):String(t).padStart(2,`0`),this._hoursFirstDigit=-1,this._hoursDigitCount=0,this._syncValueFromDisplay(),this.onInput(),this.minutesInputRef.value?.focus()}}else e.preventDefault()}},this._handleHoursBlur=()=>{this._hours!==``&&(this._hours=String(parseInt(this._hours,10)).padStart(2,`0`)),this._hoursDigitCount=0,this._hoursFirstDigit=-1,this._syncValueFromDisplay()},this._handleMinutesKeydown=e=>{let t=e.target;switch(e.key){case`ArrowUp`:{e.preventDefault();let t=this._minutes===``?0:parseInt(this._minutes,10);this._minutes=String((t+this._minuteStep)%60).padStart(2,`0`),this._syncValueFromDisplay(),this.onInput();break}case`ArrowDown`:{e.preventDefault();let t=this._minutes===``?0:parseInt(this._minutes,10);this._minutes=String((t-this._minuteStep+60)%60).padStart(2,`0`),this._syncValueFromDisplay(),this.onInput();break}case`ArrowLeft`:e.preventDefault(),this.hoursInputRef.value?.focus();break;case`Backspace`:case`Delete`:this._minutesDigitCount=0,this._minutesFirstDigit=-1;break;case`Tab`:break;case`Enter`:{e.preventDefault();let n=this.internals.form;n?n.requestSubmit():t.blur();break}default:if(/^\d$/.test(e.key)){e.preventDefault();let t=parseInt(e.key,10);if(this._minutesDigitCount===0)this._minutesFirstDigit=t,this._minutes=String(t).padStart(2,`0`),this._minutesDigitCount=1,this.onInput(),t>=6&&(this._minutesFirstDigit=-1,this._minutesDigitCount=0,this._syncValueFromDisplay());else{let e=this._minutesFirstDigit*10+t;this._minutes=e<=59?String(e).padStart(2,`0`):String(t).padStart(2,`0`),this._minutesFirstDigit=-1,this._minutesDigitCount=0,this._syncValueFromDisplay(),this.onInput()}}else e.preventDefault()}},this._handleMinutesBlur=()=>{this._minutes!==``&&(this._minutes=String(parseInt(this._minutes,10)).padStart(2,`0`)),this._minutesDigitCount=0,this._minutesFirstDigit=-1,this._syncValueFromDisplay()},this._handlePopupKeydown=e=>{let t=document.activeElement,n=t.closest(`.pkt-timepicker-popup__col`);if(!n)return;let r=Array.from(n.querySelectorAll(`.pkt-timepicker-popup__option`)),i=r.indexOf(t),a=t.dataset.type??``;switch(e.key){case`ArrowDown`:e.preventDefault(),this._focusOptionAndSync(r[Math.min(i+1,r.length-1)],a);break;case`ArrowUp`:e.preventDefault(),this._focusOptionAndSync(r[Math.max(i-1,0)],a);break;case`Home`:e.preventDefault(),this._focusOptionAndSync(r[0],a);break;case`End`:e.preventDefault(),this._focusOptionAndSync(r[r.length-1],a);break;case`ArrowRight`:e.preventDefault(),a===`hour`&&(this._focusOptionAndSync(t,a),this.updateComplete.then(()=>{this._scrollToSelected(),this._focusSelectedOrFirst(`minute`)}));break;case`ArrowLeft`:e.preventDefault(),a===`minute`&&(this._focusOptionAndSync(t,a),this.updateComplete.then(()=>{this._scrollToSelected(),this._focusSelectedOrFirst(`hour`)}));break;case`Enter`:case` `:e.preventDefault(),t.click();break;case`Escape`:e.preventDefault(),this._closePopup(),this.buttonRef.value?.focus();break}}}get inputRef(){return this.hiddenInputRef}manageValidity(e){let t=this.hoursInputRef.value;if(!t)return;if(this.required&&!this.value){this.internals.setValidity({valueMissing:!0},qe.forms.messages.required,t),this._setAriaInvalid(!0);return}if(!this.value){this.internals.setValidity({}),this._setAriaInvalid(!1);return}let n=Wo(this.value),r=Go(this.step);if(this.min&&n<Wo(String(this.min))){this.internals.setValidity({rangeUnderflow:!0},qe.forms.messages.rangeUnderflowMin.replace(`{min}`,String(this.min)),t),this._setAriaInvalid(!0);return}if(this.max&&n>Wo(String(this.max))){this.internals.setValidity({rangeOverflow:!0},qe.forms.messages.rangeOverflowMax.replace(`{max}`,String(this.max)),t),this._setAriaInvalid(!0);return}if(this.step&&n%r!==0){let e=r===60?qe.forms.messages.timeStepMismatchHour:r===30?qe.forms.messages.timeStepMismatchHalfHour:qe.forms.messages.timeStepMismatch.replace(`{step}`,`${r}, ${r*2}, ${r*3}`);this.internals.setValidity({stepMismatch:!0},e,t),this._setAriaInvalid(!0);return}this.internals.setValidity({}),this._setAriaInvalid(!1)}_setAriaInvalid(e){if(!this.touched&&e)return;let t=this.hoursInputRef.value,n=this.minutesInputRef.value;e?(t?.setAttribute(`aria-invalid`,`true`),n?.setAttribute(`aria-invalid`,`true`)):(t?.removeAttribute(`aria-invalid`),n?.removeAttribute(`aria-invalid`))}connectedCallback(){super.connectedCallback(),this.addEventListener(`focusin`,this._handleComponentFocusIn),this.addEventListener(`focusout`,this._handleComponentFocusOut),document.addEventListener(`click`,this._outsideClickHandler)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`focusin`,this._handleComponentFocusIn),this.removeEventListener(`focusout`,this._handleComponentFocusOut),document.removeEventListener(`click`,this._outsideClickHandler)}willUpdate(e){super.willUpdate(e),e.has(`value`)&&this._syncDisplayFromValue()}updated(e){super.updated(e),this.classList.toggle(`pkt-timepicker--stepper`,this.stepArrows),this.classList.toggle(`pkt-timepicker--fullwidth`,this.fullwidth),e.has(`step`)&&this.step!==null&&!this._isValidStep(this.step)&&console.warn(`pkt-timepicker: step="${this.step}" er ikke en gyldig verdi. Step må være et multiplum av 60 (hele minutter) eller nøyaktig 3600 (hel time).`)}formResetCallback(){super.formResetCallback(),this._hours=``,this._minutes=``,this._isOpen=!1}_isValidStep(e){return e===3600||e<3600&&3600%e==0&&e%60==0}_syncDisplayFromValue(){let e=Uo(this.value)?this.value.split(`:`):null;e?(this._hours=e[0],this._minutes=e[1]):(this._hours=``,this._minutes=``)}_syncValueFromDisplay(){if(this._hours!==``&&this._minutes!==``){let e=`${this._hours}:${this._minutes}`;e!==this.value&&(this.value=e,this.onChange(e))}else this.value!==``&&(this.value=``,this.onChange(``))}get _minuteStep(){return Go(this.step)}get _hourOptions(){return Ko(this.min,this.max)}get _minuteOptions(){return qo(this.step)}_openPopup(){this._isOpen=!0,this.updateComplete.then(()=>{this._scrollToSelected(),this._focusSelectedOrFirst(`hour`)})}_closePopup(){this._isOpen=!1,this._syncValueFromDisplay()}_togglePopup(){this._isOpen?this._closePopup():this._openPopup()}_scrollToSelected(){let e=this.querySelector(`.pkt-timepicker-popup`);e&&e.querySelectorAll(`.pkt-timepicker-popup__col`).forEach(e=>{let t=e.querySelector(`.pkt-timepicker-popup__option--selected`);t&&t.scrollIntoView({block:`center`})})}_focusSelectedOrFirst(e){let t=this.querySelector(`.pkt-timepicker-popup`);if(!t)return;let n=t.querySelectorAll(`.pkt-timepicker-popup__col`),r=e===`hour`?n[0]:n[1];if(!r)return;let i=r.querySelector(`.pkt-timepicker-popup__option--selected`),a=r.querySelector(`.pkt-timepicker-popup__option`);(i||a)?.focus()}_handleOptionClick(e,t){let n=String(e).padStart(2,`0`);t===`hour`?(this._hours=n,this.updateComplete.then(()=>this._focusSelectedOrFirst(`minute`))):(this._minutes=n,this._closePopup(),this.buttonRef.value?.focus())}_focusOptionAndSync(e,t){if(!e)return;let n=parseInt(e.dataset.value??`0`,10);t===`hour`?this._hours=String(n).padStart(2,`0`):this._minutes=String(n).padStart(2,`0`),e.focus()}_stepTime(e){let t=Jo(this._hours,this._minutes,e,this._minuteStep);this._hours=t.hours,this._minutes=t.minutes,this._syncValueFromDisplay()}_renderOption(e,t){let n=String(e).padStart(2,`0`),r=e===(t===`hour`?this._hours===``?NaN:parseInt(this._hours,10):this._minutes===``?NaN:parseInt(this._minutes,10));return j`
1639
+ `}returnNumberOrNull(e){return e==null||isNaN(e)?null:e}};G([U({type:String})],Ho.prototype,`value`,void 0);try{H(`pkt-select`)(Ho)}catch{console.warn(`Forsøker å definere <pkt-select>, men den er allerede definert`)}var Uo=e=>/^\d{2}:\d{2}$/.test(e)&&parseInt(e.slice(0,2),10)<=23&&parseInt(e.slice(3),10)<=59,Wo=e=>{let[t,n]=e.split(`:`).map(Number);return t*60+n},Go=e=>e?Math.max(1,Math.round(e/60)):1,Ko=(e,t)=>{let n=e?parseInt(String(e).split(`:`)[0],10):0,r=t?parseInt(String(t).split(`:`)[0],10):23;return Array.from({length:r-n+1},(e,t)=>t+n)},qo=e=>{let t=Go(e);return Array.from({length:Math.floor(60/t)},(e,n)=>n*t)},Jo=(e,t,n,r)=>{let i=e===``?n===1?0:23:parseInt(e,10),a=t===``?n===1?0:Math.floor(59/r)*r:parseInt(t,10);return a+=n*r,a>59?(a=0,i=(i+1)%24):a<0&&(a=Math.floor(59/r)*r,i=(i-1+24)%24),{hours:String(i).padStart(2,`0`),minutes:String(a).padStart(2,`0`)}},Yo=class extends X{constructor(...e){super(...e),this.hiddenInputRef=J(),this.hoursInputRef=J(),this.minutesInputRef=J(),this.buttonRef=J(),this.value=``,this.hidePicker=!1,this.stepArrows=!1,this._hours=``,this._minutes=``,this._isOpen=!1,this._hoursDigitCount=0,this._hoursFirstDigit=-1,this._minutesDigitCount=0,this._minutesFirstDigit=-1,this._hasFocus=!1,this._outsideClickHandler=e=>{this.contains(e.target)||this._closePopup()},this._handleComponentFocusIn=()=>{this._hasFocus||(this._hasFocus=!0,this.onFocus())},this._handleComponentFocusOut=e=>{this.contains(e.relatedTarget)||(this._hasFocus=!1,this.onBlur())},this._handleHoursKeydown=e=>{let t=e.target;switch(e.key){case`ArrowUp`:{e.preventDefault();let t=this._hours===``?0:parseInt(this._hours,10);this._hours=String((t+1)%24).padStart(2,`0`),this._syncValueFromDisplay(),this.onInput();break}case`ArrowDown`:{e.preventDefault();let t=this._hours===``?0:parseInt(this._hours,10);this._hours=String((t-1+24)%24).padStart(2,`0`),this._syncValueFromDisplay(),this.onInput();break}case`ArrowRight`:e.preventDefault(),this.minutesInputRef.value?.focus();break;case`Backspace`:case`Delete`:this._hoursDigitCount=0,this._hoursFirstDigit=-1;break;case`Tab`:break;case`Enter`:{e.preventDefault();let n=this.internals.form;n?n.requestSubmit():t.blur();break}default:if(/^\d$/.test(e.key)){e.preventDefault();let t=parseInt(e.key,10);if(this._hoursDigitCount===0)this._hoursFirstDigit=t,this._hours=String(t).padStart(2,`0`),this._hoursDigitCount=1,this.onInput(),t>=3&&(this._hoursFirstDigit=-1,this._hoursDigitCount=0,this._syncValueFromDisplay(),this.minutesInputRef.value?.focus());else{let e=this._hoursFirstDigit*10+t;this._hours=e<=23?String(e).padStart(2,`0`):String(t).padStart(2,`0`),this._hoursFirstDigit=-1,this._hoursDigitCount=0,this._syncValueFromDisplay(),this.onInput(),this.minutesInputRef.value?.focus()}}else e.preventDefault()}},this._handleHoursBlur=()=>{this._hours!==``&&(this._hours=String(parseInt(this._hours,10)).padStart(2,`0`)),this._hoursDigitCount=0,this._hoursFirstDigit=-1,this._syncValueFromDisplay()},this._handleMinutesKeydown=e=>{let t=e.target;switch(e.key){case`ArrowUp`:{e.preventDefault();let t=this._minutes===``?0:parseInt(this._minutes,10);this._minutes=String((t+this._minuteStep)%60).padStart(2,`0`),this._syncValueFromDisplay(),this.onInput();break}case`ArrowDown`:{e.preventDefault();let t=this._minutes===``?0:parseInt(this._minutes,10);this._minutes=String((t-this._minuteStep+60)%60).padStart(2,`0`),this._syncValueFromDisplay(),this.onInput();break}case`ArrowLeft`:e.preventDefault(),this.hoursInputRef.value?.focus();break;case`Backspace`:case`Delete`:this._minutesDigitCount=0,this._minutesFirstDigit=-1;break;case`Tab`:break;case`Enter`:{e.preventDefault();let n=this.internals.form;n?n.requestSubmit():t.blur();break}default:if(/^\d$/.test(e.key)){e.preventDefault();let t=parseInt(e.key,10);if(this._minutesDigitCount===0)this._minutesFirstDigit=t,this._minutes=String(t).padStart(2,`0`),this._minutesDigitCount=1,this.onInput(),t>=6&&(this._minutesFirstDigit=-1,this._minutesDigitCount=0,this._syncValueFromDisplay());else{let e=this._minutesFirstDigit*10+t;this._minutes=e<=59?String(e).padStart(2,`0`):String(t).padStart(2,`0`),this._minutesFirstDigit=-1,this._minutesDigitCount=0,this._syncValueFromDisplay(),this.onInput()}}else e.preventDefault()}},this._handleMinutesBlur=()=>{this._minutes!==``&&(this._minutes=String(parseInt(this._minutes,10)).padStart(2,`0`)),this._minutesDigitCount=0,this._minutesFirstDigit=-1,this._syncValueFromDisplay()},this._handlePopupKeydown=e=>{let t=document.activeElement,n=t.closest(`.pkt-timepicker-popup__col`);if(!n)return;let r=Array.from(n.querySelectorAll(`.pkt-timepicker-popup__option`)),i=r.indexOf(t),a=t.dataset.type??``;switch(e.key){case`ArrowDown`:e.preventDefault(),this._focusOptionAndSync(r[Math.min(i+1,r.length-1)],a);break;case`ArrowUp`:e.preventDefault(),this._focusOptionAndSync(r[Math.max(i-1,0)],a);break;case`Home`:e.preventDefault(),this._focusOptionAndSync(r[0],a);break;case`End`:e.preventDefault(),this._focusOptionAndSync(r[r.length-1],a);break;case`ArrowRight`:e.preventDefault(),a===`hour`&&(this._focusOptionAndSync(t,a),this.updateComplete.then(()=>{this._scrollToSelected(),this._focusSelectedOrFirst(`minute`)}));break;case`ArrowLeft`:e.preventDefault(),a===`minute`&&(this._focusOptionAndSync(t,a),this.updateComplete.then(()=>{this._scrollToSelected(),this._focusSelectedOrFirst(`hour`)}));break;case`Enter`:case` `:e.preventDefault(),t.click();break;case`Escape`:e.preventDefault(),this._closePopup(),this.buttonRef.value?.focus();break}}}get inputRef(){return this.hiddenInputRef}manageValidity(e){let t=this.hoursInputRef.value;if(!t)return;if(this.required&&!this.value){this.internals.setValidity({valueMissing:!0},Je.forms.messages.required,t),this._setAriaInvalid(!0);return}if(!this.value){this.internals.setValidity({}),this._setAriaInvalid(!1);return}let n=Wo(this.value),r=Go(this.step);if(this.min&&n<Wo(String(this.min))){this.internals.setValidity({rangeUnderflow:!0},Je.forms.messages.rangeUnderflowMin.replace(`{min}`,String(this.min)),t),this._setAriaInvalid(!0);return}if(this.max&&n>Wo(String(this.max))){this.internals.setValidity({rangeOverflow:!0},Je.forms.messages.rangeOverflowMax.replace(`{max}`,String(this.max)),t),this._setAriaInvalid(!0);return}if(this.step&&n%r!==0){let e=r===60?Je.forms.messages.timeStepMismatchHour:r===30?Je.forms.messages.timeStepMismatchHalfHour:Je.forms.messages.timeStepMismatch.replace(`{step}`,`${r}, ${r*2}, ${r*3}`);this.internals.setValidity({stepMismatch:!0},e,t),this._setAriaInvalid(!0);return}this.internals.setValidity({}),this._setAriaInvalid(!1)}_setAriaInvalid(e){if(!this.touched&&e)return;let t=this.hoursInputRef.value,n=this.minutesInputRef.value;e?(t?.setAttribute(`aria-invalid`,`true`),n?.setAttribute(`aria-invalid`,`true`)):(t?.removeAttribute(`aria-invalid`),n?.removeAttribute(`aria-invalid`))}connectedCallback(){super.connectedCallback(),this.addEventListener(`focusin`,this._handleComponentFocusIn),this.addEventListener(`focusout`,this._handleComponentFocusOut),document.addEventListener(`click`,this._outsideClickHandler)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`focusin`,this._handleComponentFocusIn),this.removeEventListener(`focusout`,this._handleComponentFocusOut),document.removeEventListener(`click`,this._outsideClickHandler)}willUpdate(e){super.willUpdate(e),e.has(`value`)&&this._syncDisplayFromValue()}updated(e){super.updated(e),this.classList.toggle(`pkt-timepicker--stepper`,this.stepArrows),this.classList.toggle(`pkt-timepicker--fullwidth`,this.fullwidth),e.has(`step`)&&this.step!==null&&!this._isValidStep(this.step)&&console.warn(`pkt-timepicker: step="${this.step}" er ikke en gyldig verdi. Step må være et multiplum av 60 (hele minutter) eller nøyaktig 3600 (hel time).`)}formResetCallback(){super.formResetCallback(),this._hours=``,this._minutes=``,this._isOpen=!1}_isValidStep(e){return e===3600||e<3600&&3600%e==0&&e%60==0}_syncDisplayFromValue(){let e=Uo(this.value)?this.value.split(`:`):null;e?(this._hours=e[0],this._minutes=e[1]):(this._hours=``,this._minutes=``)}_syncValueFromDisplay(){if(this._hours!==``&&this._minutes!==``){let e=`${this._hours}:${this._minutes}`;e!==this.value&&(this.value=e,this.onChange(e))}else this.value!==``&&(this.value=``,this.onChange(``))}get _minuteStep(){return Go(this.step)}get _hourOptions(){return Ko(this.min,this.max)}get _minuteOptions(){return qo(this.step)}_openPopup(){this._isOpen=!0,this.updateComplete.then(()=>{this._scrollToSelected(),this._focusSelectedOrFirst(`hour`)})}_closePopup(){this._isOpen=!1,this._syncValueFromDisplay()}_togglePopup(){this._isOpen?this._closePopup():this._openPopup()}_scrollToSelected(){let e=this.querySelector(`.pkt-timepicker-popup`);e&&e.querySelectorAll(`.pkt-timepicker-popup__col`).forEach(e=>{let t=e.querySelector(`.pkt-timepicker-popup__option--selected`);t&&t.scrollIntoView({block:`center`})})}_focusSelectedOrFirst(e){let t=this.querySelector(`.pkt-timepicker-popup`);if(!t)return;let n=t.querySelectorAll(`.pkt-timepicker-popup__col`),r=e===`hour`?n[0]:n[1];if(!r)return;let i=r.querySelector(`.pkt-timepicker-popup__option--selected`),a=r.querySelector(`.pkt-timepicker-popup__option`);(i||a)?.focus()}_handleOptionClick(e,t){let n=String(e).padStart(2,`0`);t===`hour`?(this._hours=n,this.updateComplete.then(()=>this._focusSelectedOrFirst(`minute`))):(this._minutes=n,this._closePopup(),this.buttonRef.value?.focus())}_focusOptionAndSync(e,t){if(!e)return;let n=parseInt(e.dataset.value??`0`,10);t===`hour`?this._hours=String(n).padStart(2,`0`):this._minutes=String(n).padStart(2,`0`),e.focus()}_stepTime(e){let t=Jo(this._hours,this._minutes,e,this._minuteStep);this._hours=t.hours,this._minutes=t.minutes,this._syncValueFromDisplay()}_renderOption(e,t){let n=String(e).padStart(2,`0`),r=e===(t===`hour`?this._hours===``?NaN:parseInt(this._hours,10):this._minutes===``?NaN:parseInt(this._minutes,10));return j`
1640
1640
  <button
1641
- class=${q({"pkt-btn":!0,"pkt-btn--tertiary":!0,"pkt-btn--small":!0,"pkt-btn--label-only":!0,"pkt-timepicker-popup__option":!0,"pkt-timepicker-popup__option--selected":r})}
1641
+ class=${K({"pkt-btn":!0,"pkt-btn--tertiary":!0,"pkt-btn--small":!0,"pkt-btn--label-only":!0,"pkt-timepicker-popup__option":!0,"pkt-timepicker-popup__option--selected":r})}
1642
1642
  type="button"
1643
1643
  role="option"
1644
1644
  aria-selected=${r?`true`:`false`}
@@ -1696,7 +1696,7 @@
1696
1696
  </button>
1697
1697
  `:N}
1698
1698
  <input
1699
- ${X(this.hoursInputRef)}
1699
+ ${Y(this.hoursInputRef)}
1700
1700
  type="text"
1701
1701
  inputmode="numeric"
1702
1702
  maxlength="2"
@@ -1722,7 +1722,7 @@
1722
1722
  />
1723
1723
  <span class="pkt-timepicker__separator">:</span>
1724
1724
  <input
1725
- ${X(this.minutesInputRef)}
1725
+ ${Y(this.minutesInputRef)}
1726
1726
  type="text"
1727
1727
  inputmode="numeric"
1728
1728
  maxlength="2"
@@ -1753,7 +1753,7 @@
1753
1753
  ></pkt-icon>`:N}
1754
1754
  ${!this.hidePicker&&!this.stepArrows?j`
1755
1755
  <button
1756
- ${X(this.buttonRef)}
1756
+ ${Y(this.buttonRef)}
1757
1757
  class="pkt-input-icon pkt-btn pkt-btn--icon-only pkt-btn--tertiary pkt-timepicker__button"
1758
1758
  type="button"
1759
1759
  aria-label=${this.strings.timepicker?.openPicker??`Åpne tidspunkt-velger`}
@@ -1784,15 +1784,15 @@
1784
1784
  </button>
1785
1785
  `:N}
1786
1786
  <input
1787
- ${X(this.hiddenInputRef)}
1787
+ ${Y(this.hiddenInputRef)}
1788
1788
  type="time"
1789
1789
  hidden
1790
1790
  name=${this.name||this.id}
1791
1791
  id=${this.id+`-input`}
1792
1792
  .value=${this.value}
1793
- min=${J(this.min??void 0)}
1794
- max=${J(this.max??void 0)}
1795
- step=${J(this.step??void 0)}
1793
+ min=${q(this.min??void 0)}
1794
+ max=${q(this.max??void 0)}
1795
+ step=${q(this.step??void 0)}
1796
1796
  ?required=${this.required}
1797
1797
  ?disabled=${this.disabled}
1798
1798
  tabindex="-1"
@@ -1819,11 +1819,11 @@
1819
1819
  .requiredText=${this.requiredText}
1820
1820
  .tagText=${this.tagText}
1821
1821
  >
1822
- <div class="pkt-contents" slot="helptext">${Et(this,`helptext`)}</div>
1822
+ <div class="pkt-contents" slot="helptext">${Dt(this,`helptext`)}</div>
1823
1823
  ${!this.hidePicker&&!this.stepArrows?j`
1824
1824
  <div class="pkt-timepicker__anchor">
1825
1825
  ${this._renderContainer()} ${this._renderPopup()}
1826
1826
  </div>
1827
1827
  `:this._renderContainer()}
1828
1828
  </pkt-input-wrapper>
1829
- `}};K([W({type:String,reflect:!0})],Yo.prototype,`value`,void 0),K([W({type:Boolean,reflect:!0,attribute:`hide-picker`})],Yo.prototype,`hidePicker`,void 0),K([W({type:Boolean,reflect:!0,attribute:`step-arrows`})],Yo.prototype,`stepArrows`,void 0),K([G()],Yo.prototype,`_hours`,void 0),K([G()],Yo.prototype,`_minutes`,void 0),K([G()],Yo.prototype,`_isOpen`,void 0);try{U(`pkt-timepicker`)(Yo)}catch{console.warn(`Forsøker å definere <pkt-timepicker>, men den er allerede definert`)}var Q=x({tagName:`pkt-icon`,elementClass:Ht,react:t.default,displayName:`PktIcon`,events:{}}),Xo=(0,t.forwardRef)(({defaultOpen:e=!1,id:r,title:i,skin:a,compact:o=!1,isOpen:s,children:c,name:l,className:u,onClick:d,onToggle:f},p)=>{let[m,h]=(0,t.useState)(e),{name:_}=g(),v=l||_,y=s===void 0?m:s;return(0,t.useEffect)(()=>{s===void 0&&h(e)},[e,s]),(0,n.jsxs)(`details`,{ref:p,className:[`pkt-accordion-item`,o&&`pkt-accordion-item--compact`,a&&`pkt-accordion-item--${a}`,u].filter(Boolean).join(` `),id:r,open:y,onClick:e=>{setTimeout(()=>{d?.(e)},0)},name:v,onToggle:e=>{let t=e.currentTarget.open;t!==y&&(s===void 0&&h(t),f?.(e))},children:[(0,n.jsxs)(`summary`,{className:`pkt-accordion-item__title`,id:`pkt-accordion-item-summary-${r}`,children:[i,(0,n.jsx)(Q,{name:`chevron-thin-down`,className:`pkt-accordion-item__icon`,"aria-hidden":`true`})]}),(0,n.jsx)(`div`,{className:`pkt-accordion-item__content`,id:`pkt-accordion-item__content-${r}`,role:`region`,children:(0,n.jsx)(`div`,{className:`pkt-accordion-item__content-inner`,children:c})})]})});Xo.displayName=`PktAccordionItem`;var $=m(d(((e,t)=>{(function(){"use strict";var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()}))(),1),Zo=({children:e,closeAlert:r,compact:i,title:a,date:o,ariaLive:s,"aria-live":c=`polite`,role:l=`status`,skin:u=`info`,className:d,...f})=>{let[p,m]=(0,t.useState)(!1),h={"pkt-alert":!0,"pkt-alert--compact":i,[`pkt-alert--${u}`]:u,"pkt-hide":p},g={"pkt-alert__grid":!0,"pkt-alert__noTitle":!a,"pkt-alert__noDate":!o},_=(0,t.useCallback)(()=>{m(!0),f.onClose&&f.onClose(new CustomEvent(`close`,{detail:{origin:event},bubbles:!0,composed:!0}))},[f.onClose,m]),v=s||c;return(0,n.jsx)(`div`,{...f,"aria-live":v,role:l,className:(0,$.default)(h,d),children:(0,n.jsxs)(`div`,{className:(0,$.default)(g),children:[(0,n.jsx)(Q,{className:`pkt-alert__icon`,"aria-hidden":`true`,name:u===`info`?`alert-information`:`alert-${u}`}),r&&(0,n.jsx)(`div`,{className:`pkt-alert__close`,children:(0,n.jsx)(es,{tabIndex:0,"aria-label":`close`,size:i?`small`:`medium`,type:`button`,skin:`tertiary`,iconName:`close`,variant:`icon-only`,onClick:_,children:(0,n.jsx)(`span`,{className:`sr-only`,children:`Lukk`})})}),a&&(0,n.jsx)(`div`,{className:`pkt-alert__title`,children:a}),(0,n.jsx)(`div`,{className:`pkt-alert__text`,children:e}),o&&(0,n.jsxs)(`div`,{className:`pkt-alert__date`,children:[`Sist oppdatert: `,o]})]})})};Zo.displayName=`PktAlert`;var Qo=(0,t.forwardRef)(({href:e=`/`,text:t=`Forsiden`,ariaLabel:r,renderLink:i,className:a,...o},s)=>{let c=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Q,{className:`pkt-back-link__icon pkt-icon pkt-link__icon`,name:`chevron-thin-left`,"aria-hidden":`true`}),(0,n.jsx)(`span`,{className:`pkt-back-link__text`,children:t})]}),l=i||(({href:e,className:t,children:r,props:i})=>(0,n.jsx)(`a`,{href:e,className:t,...i,children:r}));return(0,n.jsx)(`nav`,{className:[`pkt-back-link`,a].filter(Boolean).join(` `),"aria-label":r||`Gå tilbake til forrige side`,ref:s,children:l({href:e,className:`pkt-link pkt-link--icon-left`,children:c,props:o})})});Qo.displayName=`PktBackLink`;var $o=(0,t.forwardRef)(({breadcrumbs:e,navigationType:t,renderLink:i,className:a,...o},s)=>{let c=e,l=c[c.length-2],u=[a,`pkt-breadcrumbs`].filter(Boolean).join(` `),d=i||(t===`router`?({href:e,className:t,children:i,props:a})=>(0,n.jsx)(r.Link,{to:e,className:t,...a,children:i}):({href:e,className:t,children:r,props:i})=>(0,n.jsx)(`a`,{href:e,className:t,...i,children:r}));return(0,n.jsxs)(`nav`,{ref:s,"aria-label":`brødsmulemeny`,className:u,children:[(0,n.jsx)(`ol`,{className:`pkt-breadcrumbs__list pkt-breadcrumbs--desktop`,children:c.map((e,t)=>(0,n.jsx)(`li`,{className:`pkt-breadcrumbs__item`,children:t===c.length-1?(0,n.jsx)(`span`,{className:`pkt-breadcrumbs__label`,"aria-current":`true`,children:(0,n.jsx)(`span`,{className:`pkt-breadcrumbs__text`,children:e.text})}):d({href:e.href,className:`pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link`,children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Q,{className:`pkt-icon pkt-breadcrumbs__icon pkt-link__icon`,name:`chevron-thin-right`}),(0,n.jsx)(`span`,{className:`pkt-breadcrumbs__text`,children:e.text})]}),props:o})},`breadcrumb-${t}`))}),d({href:l.href,className:`pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile`,children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Q,{className:`pkt-back-link__icon pkt-icon pkt-link__icon`,name:`chevron-thin-left`}),(0,n.jsx)(`span`,{className:`pkt-breadcrumbs__text`,children:l.text})]}),props:o})]})});$o.displayName=`PktBreadcrumbs`,window.pktAnimationPath=window.pktAnimationPath||`https://punkt-cdn.oslo.kommune.no/16.10/animations/`;var es=(0,t.forwardRef)(({children:e,className:t,iconName:r=`user`,secondIconName:i=`user`,iconPath:a,secondIconPath:o,size:s=`medium`,fullWidth:c=!1,fullWidthOnMobile:l=!1,skin:u=`primary`,type:d=`button`,variant:f=`label-only`,state:p,color:m,isLoading:h=void 0,disabled:g=void 0,loadingAnimationPath:_=window.pktAnimationPath,...v},y)=>{let b=[t,`pkt-btn`,s&&`pkt-btn--${s}`,c&&`pkt-btn--full`,l&&`pkt-btn--full-small`,u&&`pkt-btn--${u}`,f&&`pkt-btn--${f}`,m&&`pkt-btn--${m}`,p&&`pkt-btn--${p}`,h&&`pkt-btn--isLoading`].filter(Boolean).join(` `);return(0,n.jsxs)(`button`,{...v,"aria-busy":h||void 0,"aria-disabled":g||void 0,disabled:g,className:b,type:d,ref:y,children:[h&&(0,n.jsx)(Q,{className:`pkt-btn__icon pkt-btn__spinner`,name:`spinner-blue`,path:_}),f!==`label-only`&&(0,n.jsx)(Q,{className:`pkt-btn__icon`,name:r,...a&&{path:a}}),(0,n.jsx)(`span`,{className:`pkt-btn__text`,children:e}),f===`icons-right-and-left`&&(0,n.jsx)(Q,{className:`pkt-btn__icon`,name:i,...o&&{path:o}})]})});es.displayName=`PktButton`;var ts=365.2425,ns=6048e5,rs=864e5,is=3600*24;is*7,is*ts/12*3;var as=Symbol.for(`constructDateFrom`);function os(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&as in e?e[as](t):e instanceof Date?new e.constructor(t):new Date(t)}function ss(e,t){return os(t||e,e)}function cs(e,t,n){let r=ss(e,n?.in);return isNaN(t)?os(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}var ls={};function us(){return ls}function ds(e,t){let n=us(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=ss(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function fs(e,t){return ds(e,{...t,weekStartsOn:1})}function ps(e,t){let n=ss(e,t?.in),r=n.getFullYear(),i=os(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let a=fs(i),o=os(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);let s=fs(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function ms(e){let t=ss(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function hs(e,...t){let n=os.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function gs(e,t){let n=ss(e,t?.in);return n.setHours(0,0,0,0),n}function _s(e,t,n){let[r,i]=hs(n?.in,e,t),a=gs(r),o=gs(i),s=+a-ms(a),c=+o-ms(o);return Math.round((s-c)/rs)}function vs(e,t){let n=ps(e,t),r=os(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),fs(r)}function ys(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function bs(e){return!(!ys(e)&&typeof e!=`number`||isNaN(+ss(e)))}function xs(e,t){let n=ss(e,t?.in);return n.setHours(23,59,59,999),n}function Ss(e,t){let[n,r]=hs(e,t.start,t.end);return{start:n,end:r}}function Cs(e,t){let{start:n,end:r}=Ss(t?.in,e),i=+n>+r,a=i?+n:+r,o=i?r:n;o.setHours(0,0,0,0);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,i=!i);let c=[];for(;+o<=a;)c.push(os(n,o)),o.setDate(o.getDate()+s),o.setHours(0,0,0,0);return i?c.reverse():c}function ws(e,t){let n=ss(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}var Ts={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`}},Es=(e,t,n)=>{let r,i=Ts[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function Ds(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var Os={date:Ds({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:Ds({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:Ds({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},ks={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},As=(e,t,n,r)=>ks[e];function js(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var Ms={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:js({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:js({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:js({values:{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`]},defaultWidth:`wide`}),day:js({values:{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`]},defaultWidth:`wide`}),dayPeriod:js({values:{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`}},defaultWidth:`wide`,formattingValues:{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`}},defaultFormattingWidth:`wide`})};function Ns(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?Fs(s,e=>e.test(o)):Ps(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function Ps(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Fs(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Is(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var Ls={code:`en-US`,formatDistance:Es,formatLong:Os,formatRelative:As,localize:Ms,match:{ordinalNumber:Is({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:Ns({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:Ns({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:Ns({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{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]},defaultParseWidth:`any`}),day:Ns({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{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]},defaultParseWidth:`any`}),dayPeriod:Ns({matchPatterns:{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},defaultMatchWidth:`any`,parsePatterns:{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}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function Rs(e,t){let n=ss(e,t?.in);return _s(n,ws(n))+1}function zs(e,t){let n=ss(e,t?.in),r=fs(n)-+vs(n);return Math.round(r/ns)+1}function Bs(e,t){let n=ss(e,t?.in),r=n.getFullYear(),i=us(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=os(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=ds(o,t),c=os(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=ds(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function Vs(e,t){let n=us(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=Bs(e,t),a=os(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),ds(a,t)}function Hs(e,t){let n=ss(e,t?.in),r=ds(n,t)-+Vs(n,t);return Math.round(r/ns)+1}function Us(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var Ws={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return Us(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):Us(n+1,2)},d(e,t){return Us(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return Us(e.getHours()%12||12,t.length)},H(e,t){return Us(e.getHours(),t.length)},m(e,t){return Us(e.getMinutes(),t.length)},s(e,t){return Us(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return Us(Math.trunc(r*10**(n-3)),t.length)}},Gs={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},Ks={G:function(e,t,n){let r=+(e.getFullYear()>0);switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return Ws.y(e,t)},Y:function(e,t,n,r){let i=Bs(e,r),a=i>0?i:1-i;return t===`YY`?Us(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):Us(a,t.length)},R:function(e,t){return Us(ps(e),t.length)},u:function(e,t){return Us(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return Us(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return Us(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return Ws.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return Us(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=Hs(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):Us(i,t.length)},I:function(e,t,n){let r=zs(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):Us(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):Ws.d(e,t)},D:function(e,t,n){let r=Rs(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):Us(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return Us(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return Us(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return Us(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?Gs.noon:r===0?Gs.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?Gs.evening:r>=12?Gs.afternoon:r>=4?Gs.morning:Gs.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return Ws.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):Ws.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):Us(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):Us(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):Ws.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):Ws.s(e,t)},S:function(e,t){return Ws.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return Js(r);case`XXXX`:case`XX`:return Ys(r);default:return Ys(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return Js(r);case`xxxx`:case`xx`:return Ys(r);default:return Ys(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+qs(r,`:`);default:return`GMT`+Ys(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+qs(r,`:`);default:return`GMT`+Ys(r,`:`)}},t:function(e,t,n){return Us(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return Us(+e,t.length)}};function qs(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+Us(a,2)}function Js(e,t){return e%60==0?(e>0?`-`:`+`)+Us(Math.abs(e)/60,2):Ys(e,t)}function Ys(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Us(Math.trunc(r/60),2),a=Us(r%60,2);return n+i+t+a}var Xs=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});default:return t.date({width:`full`})}},Zs=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});default:return t.time({width:`full`})}},Qs={p:Zs,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Xs(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,Xs(r,t)).replace(`{{time}}`,Zs(i,t))}},$s=/^D+$/,ec=/^Y+$/,tc=[`D`,`DD`,`YY`,`YYYY`];function nc(e){return $s.test(e)}function rc(e){return ec.test(e)}function ic(e,t,n){let r=ac(e,t,n);if(console.warn(r),tc.includes(e))throw RangeError(r)}function ac(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var oc=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,sc=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,cc=/^'([^]*?)'?$/,lc=/''/g,uc=/[a-zA-Z]/;function dc(e,t,n){let r=us(),i=n?.locale??r.locale??Ls,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=ss(e,n?.in);if(!bs(s))throw RangeError(`Invalid time value`);let c=t.match(sc).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=Qs[t];return n(e,i.formatLong)}return e}).join(``).match(oc).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:fc(e)};if(Ks[t])return{isToken:!0,value:e};if(t.match(uc))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&rc(a)||!n?.useAdditionalDayOfYearTokens&&nc(a))&&ic(a,t,String(e));let o=Ks[a[0]];return o(s,a,i.localize,l)}).join(``)}function fc(e){let t=e.match(cc);return t?t[1].replace(lc,`'`):e}function pc(e,t){let n=ss(e,t?.in).getDay();return n===0?7:n}function mc(e,t,n=`long`){return new Intl.DateTimeFormat(`en-US`,{hour:`numeric`,timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(` `)}var hc={},gc={};function _c(e,t){try{let n=(hc[e]||=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`longOffset`}).format)(t).split(`GMT`)[1];return n in gc?gc[n]:yc(n,n.split(`:`))}catch{if(e in gc)return gc[e];let t=e?.match(vc);return t?yc(e,t.slice(1)):NaN}}var vc=/([+-]\d\d):?(\d\d)?/;function yc(e,t){let n=+(t[0]||0),r=+(t[1]||0),i=(t[2]||0)/60;return gc[e]=n*60+r>0?n*60+r+i:n*60-r-i}var bc=class e extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]==`string`&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(_c(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)),wc(this,NaN),Sc(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}withTimeZone(t){return new e(+this,t)}getTimezoneOffset(){let e=-_c(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Sc(this),+this}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}},xc=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!xc.test(e))return;let t=e.replace(xc,`$1UTC`);bc.prototype[t]&&(e.startsWith(`get`)?bc.prototype[e]=function(){return this.internal[t]()}:(bc.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),Cc(this),+this},bc.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Sc(this),+this}))});function Sc(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-_c(e.timeZone,e)*60))}function Cc(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),wc(e)}function wc(e){let t=_c(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);let i=-new Date(+e).getTimezoneOffset(),a=i- -new Date(+r).getTimezoneOffset(),o=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&o&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);let s=i-n;s&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);let c=new Date(+e);c.setUTCSeconds(0);let l=i>0?c.getSeconds():(c.getSeconds()-60)%60,u=Math.round(-(_c(e.timeZone,e)*60))%60;(u||l)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+u),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+u+l));let d=_c(e.timeZone,e),f=d>0?Math.floor(d):Math.ceil(d),p=-new Date(+e).getTimezoneOffset()-f,m=f!==n,h=p-s;if(m&&h){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+h);let t=_c(e.timeZone,e),n=f-(t>0?Math.floor(t):Math.ceil(t));n&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+n),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n))}}var Tc=class e extends bc{static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}toISOString(){let[e,t,n]=this.tzComponents(),r=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){let[e,t,n,r]=this.internal.toUTCString().split(` `);return`${e?.slice(0,-1)} ${n} ${t} ${r}`}toTimeString(){let e=this.internal.toUTCString().split(` `)[4],[t,n,r]=this.tzComponents();return`${e} GMT${t}${n}${r} (${mc(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){let e=this.getTimezoneOffset();return[e>0?`-`:`+`,String(Math.floor(Math.abs(e)/60)).padStart(2,`0`),String(Math.abs(e)%60).padStart(2,`0`)]}withTimeZone(t){return new e(+this,t)}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}};window.pktTz=window.pktTz===void 0?`Europe/Oslo`:window.pktTz;var Ec=(e=window.pktTz)=>{let t=new Tc(new Date().toISOString(),e);return t.setHours(0,0,0,0),isNaN(t.getTime())?new Date:new Date(t.getFullYear(),t.getMonth(),t.getDate())};function Dc(e){if(!e||e===``)return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){let[t,n,r]=e.split(`-`).map(Number);return new Date(t,n-1,r)}if(/^\d{4}-\d{2}$/.test(e)){let[t,n]=e.split(`-`).map(Number);return new Date(t,n-1,1)}return/^\d{4}$/.test(e)?new Date(Number(e),0,1):new Date(e)}var Oc=e=>!e||isNaN(e.getTime())?``:`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`,kc=e=>{if(!e)return null;let t=Dc(e);return isNaN(t.getTime())?null:t},Ac=(e,t)=>{let n=jc(e);return isNaN(n.getTime())?``:dc(n,t)},jc=(e=``,t)=>{let n=typeof e==`string`?Dc(e):e;return!n||isNaN(n.getTime())?new Date:t?t===`end`?xs(n):gs(n):n},Mc=(e,t,n=1)=>{if(typeof e!=`number`||typeof t!=`number`||typeof n!=`number`||isNaN(e)||isNaN(t)||isNaN(n))return new Date;let r=new Date(e,t,n);return isNaN(r.getTime())?new Date:r},Nc=e=>{let t;return t=new Tc(e,window.pktTz),t.setHours(12,0,0,0),t},Pc=null,Fc=void 0,Ic=e=>{if(!e||isNaN(e.getTime()))return``;let t=typeof window<`u`?window.pktTz:void 0;return(!Pc||Fc!==t)&&(Pc=new Intl.DateTimeFormat(`no`,{dateStyle:`full`,timeZone:t}),Fc=t),Pc.format(e)},Lc=(e,t,n)=>{if(!e||isNaN(e.getTime()))return!1;let r=t?jc(t):null,i=n?jc(n):null;return!(r&&e<r||i&&e>i)},Rc=(e,t)=>{if(!e||isNaN(e.getTime())||!Array.isArray(t))return!1;let n=Oc(e);return t.includes(n)},zc=(e,t)=>{if(!e||isNaN(e.getTime())||!Array.isArray(t))return!1;let n=e.getDay().toString();return t.includes(n)},Bc=(e,t,n,r,i)=>!(!e||isNaN(e.getTime())||!Lc(e,t,n)||r&&Rc(e,r)||i&&zc(e,i)),Vc=(e,t,n,r,i)=>e.filter(e=>{let a=kc(e);return a&&Bc(a,t,n,r,i)}),Hc=e=>e.slice().sort((e,t)=>{let n=kc(e),r=kc(t);return!n||!r?0:n.getTime()-r.getTime()}),Uc=(e,t)=>{let n=kc(e),r=kc(t);return!n||!r?!1:n<=r};function Wc(e,t){let n=(t.excludedates??[]).map(e=>typeof e==`string`?e:Oc(e));return!Bc(e,t.earliest,t.latest,n,t.excludeweekdays??[])}function Gc(e,t,n,r){return!!(Wc(e,n)||!t&&r.multiple&&r.maxMultiple>0&&r.selectedCount>=r.maxMultiple)}function Kc(e,t,n){let r=Mc(e,t,0);return!(n&&jc(n)>r)}function qc(e,t,n){let r=Mc(t===11?e+1:e,t===11?0:t+1,1);return!(n&&jc(n)<r)}function Jc(e){return typeof e==`string`&&(e=e.split(`,`)),e.length===1&&e[0]===``?[]:e.map(e=>Dc(e))}function Yc(e,t){let n=Cs({start:e,end:t}),r={};if(Array.isArray(n)&&n.length)for(let i=0;i<n.length;i++){let a=n[i],o=a>e&&a<t;r[Oc(a)]=o}return r}function Xc(e,t,n,r){if(t.length!==1)return!0;let i=Cs({start:t[0],end:e});if(!Array.isArray(i)||!i.length)return!0;for(let a=0;a<i.length;a++){for(let r of n??[])if(r>t[0]&&r<e)return!1;if((r??[]).includes(pc(i[a]).toString()))return!1}return!0}function Zc(e,t){let n=Oc(e);return t.includes(n)?t:[...t,n]}function Qc(e,t){let n=Oc(e),r=t.indexOf(n);if(r===-1)return t;if(t.length===1)return[];let i=[...t];return i.splice(r,1),i}function $c(e,t,n){let r=Oc(e);return t.includes(r)?Qc(e,t):n>0&&t.length>=n?t:Zc(e,t)}function el(e,t,n){let r=Oc(e),i=Jc(t);return t.includes(r)?t.indexOf(r)===0?[]:Qc(e,t):t.length>1||t.length===1&&(!Xc(e,i,n.excludedates,n.excludeweekdays)||i[0]>e)?[r]:Zc(e,t)}function tl(e,t){let n=Mc(e,t,1),r=Mc(e,t+1,0),i=(n.getDay()+6)%7,a=r.getDate();return{firstDayOfMonth:n,lastDayOfMonth:r,startingDay:i,numDays:a,numRows:Math.ceil((a+i)/7),numDaysPrevMonth:Mc(e,t,0).getDate(),initialWeek:Hs(n)}}function nl(e,t,n,r){let{startingDay:i,numDays:a}=r;return e===0&&t<i?`prev-month`:n>a?`next-month`:`current-month`}function rl(e,t,n,r){let{startingDay:i,numDaysPrevMonth:a,numDays:o}=r;return e===`prev-month`?a-(i-t-1):e===`next-month`?n-o:n}var il={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7};function al(e){let t=e.nodeName;return t===`INPUT`||t===`SELECT`||t===`BUTTON`&&!e.dataset?.date}function ol(e,t,n){let r=cs(e,t);if(!r)return null;let i=n(`button[data-date="${Oc(r)}"]`);for(;i instanceof HTMLButtonElement&&i.dataset.disabled;)if(r=cs(r,t),i=n(`button[data-date="${Oc(r)}"]`),!i)return null;return r}function sl(e){return il[e]??null}var cl={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 ll(e){let{selected:n,multiple:r=!1,maxMultiple:i=0,range:a=!1,earliest:o=null,latest:s=null,excludedates:c,excludeweekdays:l=[],weeknumbers:u=!1,withcontrols:d=!1,currentmonth:f,today:p,strings:m,onDateSelected:h,onClose:g,id:_,className:v}=e,y=(0,t.useId)(),b=_??y,x=(0,t.useMemo)(()=>({...cl,...m}),[m]),S=(0,t.useMemo)(()=>p?Dc(p):Ec(),[p]),C=(0,t.useMemo)(()=>c?c.map(e=>typeof e==`string`?Dc(e):e):[],[c]),w=n!==void 0,[ee,T]=(0,t.useState)([]),E=w?n:ee,te=(0,t.useMemo)(()=>Jc(E),[E]),[ne,re]=(0,t.useState)(0),[D,ie]=(0,t.useState)(0),[ae,oe]=(0,t.useState)({}),[se,ce]=(0,t.useState)(null),[O,le]=(0,t.useState)(null),k=(0,t.useRef)(null),A=(0,t.useRef)([]),ue=(0,t.useRef)(0),de=(0,t.useRef)(!1),j=(0,t.useRef)(!1),M=(0,t.useMemo)(()=>({earliest:o,latest:s,excludedates:C,excludeweekdays:l}),[o,s,C,l]);(0,t.useEffect)(()=>{let e=null;if(f!=null&&(f instanceof Date?e=Nc(f):typeof f==`string`&&(e=Dc(f))),!e||isNaN(e.getTime()))if(E.length>0&&E[0]!==``){let t=Dc(E[E.length-1]);e=isNaN(t.getTime())?Nc(S):t}else e=Nc(S);if((!e||isNaN(e.getTime()))&&(e=Nc(S)),s){let t=typeof s==`string`?Dc(s):s;!isNaN(t.getTime())&&e>t&&(e=t)}if(o){let t=typeof o==`string`?Dc(o):o;!isNaN(t.getTime())&&e<t&&(e=t)}re(e.getFullYear()),ie(e.getMonth()),j.current=!0},[]),(0,t.useEffect)(()=>{if(j.current&&!de.current&&E.length>0&&E[0]!==``){let e=Dc(E[E.length-1]);isNaN(e.getTime())||(re(e.getFullYear()),ie(e.getMonth()))}},[E]),(0,t.useEffect)(()=>{a&&te.length===2?oe(Yc(te[0],te[1])):(!a||te.length<2)&&oe({})},[a,te]);let N=(0,t.useCallback)(e=>{w||T(e),h?.(e)},[w,h]),P=(0,t.useCallback)(()=>{g?.()},[g]),F=(0,t.useCallback)((e,t)=>{re(typeof e==`string`?parseInt(e):e),ie(typeof t==`string`?parseInt(t):t),ue.current=0,le(null),A.current=[],de.current=!0},[]),I=(0,t.useCallback)(()=>{let e=D===0?11:D-1;F(D===0?ne-1:ne,e)},[ne,D,F]),fe=(0,t.useCallback)(()=>{let e=D===11?0:D+1;F(D===11?ne+1:ne,e)},[ne,D,F]),pe=(0,t.useCallback)(e=>Wc(e,M),[M]),L=(0,t.useCallback)((e,t)=>Gc(e,t,M,{multiple:r,maxMultiple:i,selectedCount:E.length}),[M,r,i,E.length]),R=(0,t.useCallback)(()=>typeof E==`string`?E.split(`,`):E,[E]),me=(0,t.useCallback)(e=>{if(!a||te.length!==1||!Xc(e,te,C,l)||te[0]>=e){ce(null);return}ce(e),oe(Yc(te[0],e))},[a,te,C,l]),he=(0,t.useCallback)(e=>{if(!e)return;let t;if(a)t=el(e,R(),{excludedates:C,excludeweekdays:l}),w||T(t),t.length===2?(h?.(t),P()):(t.length===1&&oe({}),h?.(t));else if(r)t=$c(e,R(),i),N(t);else{let n=Oc(e);t=E.includes(n)?[]:[n],N(t),P()}},[a,r,i,R,E,C,l,w,N,P,h]),z=(0,t.useCallback)(e=>{let t=Zc(e,R());w||T(t),a&&t.length===2&&(h?.(t),P())},[R,w,a,h,P]),B=(0,t.useCallback)(e=>{let t=Qc(e,R());w||T(t)},[R,w]),V=(0,t.useCallback)(e=>{let t=$c(e,R(),i);w||T(t)},[R,i,w]),ge=(0,t.useCallback)(()=>{let e=Oc(Nc(S)),t=k.current?.querySelector(`button[data-date="${e}"]`);if(t instanceof HTMLButtonElement){le(e),t.focus();return}let n=A.current.find(e=>!e.isDisabled);if(n){let e=k.current?.querySelector(`button[data-date="${n.currentDateISO}"]`);e instanceof HTMLButtonElement&&(le(n.currentDateISO),e.focus())}},[]),H=(0,t.useCallback)((e,t)=>{let n=e.target;if(al(n))return;if(e.preventDefault(),!O){ge();return}let r=ol(jc(O),t,k.current.querySelector.bind(k.current));if(r){let e=k.current.querySelector(`button[data-date="${Oc(r)}"]`);e instanceof HTMLButtonElement&&!e.dataset.disabled&&(le(Oc(r)),e.focus())}},[O,ge]);return{componentId:b,strings:x,todayDate:S,year:ne,month:D,activeSelected:E,_selected:te,inRange:ae,rangeHovered:se,focusedDate:O,range:a,multiple:r,weeknumbers:u,withcontrols:d,earliest:o,latest:s,excludedates:C,excludeweekdays:l,className:v,dateConstraints:M,calendarRef:k,selectableDatesRef:A,tabIndexSetRef:ue,prevMonth:I,nextMonth:fe,changeMonth:F,handleDateSelect:he,addToSelected:z,removeFromSelected:B,toggleSelectedDate:V,handleRangeHover:me,isExcluded:pe,isDayDisabled:L,focusOnCurrentDate:ge,handleKeydown:(0,t.useCallback)(e=>{if(e.key===`Escape`){e.preventDefault(),P();return}let t=sl(e.key);t!==null&&H(e.nativeEvent,t)},[P,H]),handleFocusOut:(0,t.useCallback)(e=>{k.current&&!k.current.contains(e.relatedTarget)&&!e.target.classList.contains(`pkt-hide`)&&P()},[P]),close:P,setFocusedDate:le}}var ul=({componentId:e,strings:t,year:r,month:i,earliest:a,latest:o,withcontrols:s,prevMonth:c,nextMonth:l,changeMonth:u})=>{let d=e=>{let s=e===`prev`,u=s?Kc(r,i,a):qc(r,i,o),d=s?t.prevMonth:t.nextMonth,f=s?`chevron-thin-left`:`chevron-thin-right`,p=s?`pkt-calendar__prev-month`:`pkt-calendar__next-month`,m=s?c:l;return(0,n.jsx)(`div`,{children:(0,n.jsxs)(`button`,{type:`button`,"aria-label":d,onClick:()=>u&&m(),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),u&&m())},className:[`pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only`,p,!u&&`pkt-invisible`].filter(Boolean).join(` `),"data-disabled":u?void 0:`disabled`,"aria-disabled":!u||void 0,tabIndex:u?0:-1,children:[(0,n.jsx)(Q,{className:`pkt-btn__icon`,name:f}),(0,n.jsx)(`span`,{className:`pkt-btn__text`,children:d})]})})};return(0,n.jsxs)(`nav`,{className:`pkt-cal-month-nav`,children:[d(`prev`),s?(0,n.jsxs)(`div`,{className:`pkt-cal-month-picker`,children:[(0,n.jsx)(`label`,{htmlFor:`${e}-monthnav`,className:`pkt-hide`,children:t.month}),(0,n.jsx)(`select`,{"aria-label":t.month,className:`pkt-input pkt-input-compact`,id:`${e}-monthnav`,value:i,onChange:e=>{e.stopPropagation(),u(r,parseInt(e.target.value))},children:t.months.map((e,t)=>(0,n.jsx)(`option`,{value:t,children:e},t))}),(0,n.jsx)(`label`,{htmlFor:`${e}-yearnav`,className:`pkt-hide`,children:t.year}),(0,n.jsx)(`input`,{"aria-label":t.year,className:`pkt-input pkt-cal-input-year pkt-input-compact`,id:`${e}-yearnav`,type:`number`,size:4,placeholder:`0000`,value:r,onChange:e=>{e.stopPropagation(),u(parseInt(e.target.value),i)}})]}):(0,n.jsxs)(`div`,{className:`pkt-txt-16-medium pkt-calendar__month-title`,"aria-live":`polite`,children:[t.months[i],` `,r]}),d(`next`)]})};function dl(e,t,n){let r=Mc(n.year,n.month,e),i=Oc(r),a=i===Oc(t),o=n.activeSelected.includes(i),s=n.isDayDisabled(r,o),c;return n.focusedDate?c=n.focusedDate===i&&!s?`0`:`-1`:!s&&n.tabIndexSetRef.current===0?(n.tabIndexSetRef.current=e,c=`0`):c=n.tabIndexSetRef.current===e?`0`:`-1`,{currentDate:r,currentDateISO:i,isToday:a,isSelected:o,isDisabled:s,ariaLabel:Ic(r),tabindex:c}}function fl(e,t){let{currentDateISO:n,isToday:r,isSelected:i}=e,a=t.range&&(t.activeSelected.length===2||t.rangeHovered!==null)&&n===t.activeSelected[0],o=t.range&&t.activeSelected.length===2&&n===t.activeSelected[1];return(0,$.default)({"pkt-cal-today":r,"pkt-cal-selected":i,"pkt-cal-in-range":t.inRange[n],"pkt-cal-excluded":t.isExcluded(e.currentDate),"pkt-cal-in-range-first":a,"pkt-cal-in-range-last":o,"pkt-cal-range-hover":t.rangeHovered!==null&&n===Oc(t.rangeHovered)})}function pl(e,t){let{currentDateISO:n,isToday:r,isSelected:i,isDisabled:a}=e,o=t.range&&(t.activeSelected.length===2||t.rangeHovered!==null)&&n===t.activeSelected[0],s=t.range&&t.activeSelected.length===2&&n===t.activeSelected[1];return(0,$.default)({"pkt-calendar__date":!0,"pkt-calendar__date--today":r,"pkt-calendar__date--selected":i,"pkt-calendar__date--disabled":a,"pkt-calendar__date--in-range":t.inRange[n],"pkt-calendar__date--in-range-hover":t.rangeHovered!==null&&n===Oc(t.rangeHovered),"pkt-calendar__date--range-start":o,"pkt-calendar__date--range-end":s})}var ml=({state:e})=>{let{strings:t,year:r,month:i,activeSelected:a,focusedDate:o,inRange:s,rangeHovered:c,range:l,multiple:u,weeknumbers:d,selectableDatesRef:f,tabIndexSetRef:p,handleDateSelect:m,handleRangeHover:h,isExcluded:g,isDayDisabled:_,setFocusedDate:v,todayDate:y}=e,b={year:r,month:i,activeSelected:a,focusedDate:o,tabIndexSetRef:p,isDayDisabled:_},x={range:l,activeSelected:a,rangeHovered:c,inRange:s,isExcluded:g},S=()=>{let e=[];d&&e.push((0,n.jsx)(`th`,{children:(0,n.jsx)(`div`,{className:`pkt-calendar__week-number`,children:t.week})},`week-header`));for(let r=0;r<t.daysShort.length;r++)e.push((0,n.jsx)(`th`,{children:(0,n.jsx)(`div`,{className:`pkt-calendar__day-name`,"aria-label":t.days[r],children:t.daysShort[r]})},`day-${r}`));return(0,n.jsx)(`tr`,{className:`pkt-cal-week-row`,children:e})},C=(e,t)=>{let r=dl(e,t,b),{currentDate:i,currentDateISO:a,isSelected:o,isDisabled:s,ariaLabel:c,tabindex:u}=r;f.current.push({currentDateISO:a,isDisabled:s,tabindex:u});let d=fl(r,x),p=pl(r,x);return(0,n.jsx)(`td`,{className:d,children:(0,n.jsx)(`button`,{type:`button`,"aria-pressed":o?`true`:`false`,disabled:s,className:`pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${p}`,onMouseOver:()=>l&&!g(i)&&h(i),onFocus:()=>{l&&!g(i)&&h(i),v(a)},"aria-label":c,tabIndex:parseInt(u),"data-disabled":s?`disabled`:void 0,"data-date":a,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),m(i))},onClick:e=>{s||(e.preventDefault(),m(i))},children:(0,n.jsx)(`span`,{className:`pkt-btn__text pkt-txt-14-light`,children:e})})},a)},w=(e,t)=>(0,n.jsx)(`td`,{className:`pkt-cal-other`,children:(0,n.jsx)(`div`,{className:`pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only`,"data-disabled":`disabled`,children:(0,n.jsx)(`span`,{className:`pkt-btn__text pkt-txt-14-light`,children:e})})},t);return(0,n.jsxs)(`table`,{className:`pkt-cal-days pkt-txt-12-medium pkt-calendar__body`,role:`grid`,"aria-multiselectable":l||u||void 0,children:[(0,n.jsx)(`thead`,{children:S()}),(0,n.jsx)(`tbody`,{children:(()=>{let e=y,t=tl(r,i);f.current=[],p.current=0;let a=1,o=t.initialWeek,s=[];for(let r=0;r<t.numRows;r++){let i=[];d&&i.push((0,n.jsx)(`td`,{className:`pkt-cal-week`,children:o},`week-${o}`)),o++;for(let n=0;n<7;n++){let o=nl(r,n,a,t);if(o===`current-month`)i.push(C(a,e)),a++;else{let e=rl(o,n,a,t);i.push(w(e,`${o}-${r}-${n}`)),o===`next-month`&&a++}}s.push((0,n.jsx)(`tr`,{className:`pkt-cal-week-row`,role:`row`,children:i},`row-${r}`))}return s})()})]})},hl=(0,t.forwardRef)((e,r)=>{let i=ll(e);return(0,t.useImperativeHandle)(r,()=>({handleDateSelect:i.handleDateSelect,addToSelected:i.addToSelected,removeFromSelected:i.removeFromSelected,toggleSelected:i.toggleSelectedDate,focusOnCurrentDate:i.focusOnCurrentDate,close:i.close}),[i.handleDateSelect,i.addToSelected,i.removeFromSelected,i.toggleSelectedDate,i.focusOnCurrentDate,i.close]),(0,n.jsxs)(`div`,{ref:i.calendarRef,className:[`pkt-calendar`,i.weeknumbers&&`pkt-cal-weeknumbers`,i.className].filter(Boolean).join(` `),onBlur:i.handleFocusOut,onKeyDown:i.handleKeydown,children:[(0,n.jsx)(ul,{componentId:i.componentId,strings:i.strings,year:i.year,month:i.month,earliest:i.earliest,latest:i.latest,withcontrols:i.withcontrols,prevMonth:i.prevMonth,nextMonth:i.nextMonth,changeMonth:i.changeMonth}),(0,n.jsx)(ml,{state:i})]})});hl.displayName=`PktCalendar`;var gl=(0,t.forwardRef)(({children:e,skin:r,textStyle:i,size:a,closeTag:o,className:s,iconName:c,ariaLabel:l,onClose:u,type:d,"aria-description":f,...p},m)=>{let[h,g]=(0,t.useState)(!1),_=(0,t.useCallback)(()=>{g(!0),u&&u()},[u]),v=(0,t.useRef)(null),[y,b]=(0,t.useState)(``);(0,t.useEffect)(()=>{b(v.current?.textContent?.trim()??``)},[e]);let x=(0,t.useMemo)(()=>{if(o&&!l)return y&&`Klikk for å fjerne ${y}`||f},[o,l,y,f]),S={"pkt-tag":!0,[`pkt-tag--${a}`]:!!a,[`pkt-tag--${r}`]:!!r,[`pkt-tag--${i}`]:!!i},C={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${a}`]:!!a,[`pkt-tag--${r}`]:!!r,"pkt-btn--icons-right-and-left":o&&!!c,"pkt-hide":h};return o?(0,n.jsxs)(`button`,{...p,className:(0,$.default)(C,s),type:d,onClick:_,"aria-label":l,"aria-description":x,ref:m,children:[c&&(0,n.jsx)(Q,{className:`pkt-tag__icon`,name:c}),(0,n.jsx)(`span`,{ref:v,children:e}),(0,n.jsx)(Q,{className:`pkt-tag__close-btn`,name:`close`})]}):(0,n.jsxs)(`span`,{...p,className:(0,$.default)(S,s),ref:m,children:[c&&(0,n.jsx)(Q,{className:`pkt-tag__icon`,name:c,"aria-hidden":`true`}),(0,n.jsx)(`span`,{ref:v,children:e})]})});gl.displayName=`PktTag`;var _l=(0,t.forwardRef)(({children:e,className:t,ariaLabel:r,metaLead:i,borderOnHover:a=!0,metaTrail:o,layout:s=`vertical`,heading:c=``,headingLevel:l=3,image:u,imageShape:d=`square`,clickCardLink:f,padding:p=`default`,openLinkInNewTab:m=!1,skin:h=`outlined`,subheading:g=``,tagPosition:_=`top`,tags:v=[],...y},b)=>{let x=(0,$.default)({"pkt-card":!0,[`pkt-card--${h}`]:h,[`pkt-card--${s}`]:s,[`pkt-card--padding-${p}`]:p,"pkt-card--border-on-hover":a}),S=r?.trim()||(c?`${c} lenkekort`:`lenkekort`),C=r?.trim()||c||`kort`,w=`h${l}`,ee=()=>u?.src?(0,n.jsx)(`div`,{className:(0,$.default)(`pkt-card__image`,`pkt-card__image-${d}`),children:(0,n.jsx)(`img`,{src:u.src,alt:u.alt||``})}):null,T=()=>v.length===0?null:(0,n.jsx)(`div`,{className:(0,$.default)(`pkt-card__tags`,`pkt-card__tags-${_}`),role:`list`,"aria-label":v.length>1?`merkelapper`:`merkelapp`,children:v.map((e,t)=>(0,n.jsx)(gl,{role:`listitem`,textStyle:`normal-text`,size:`medium`,skin:e.skin,iconName:e.iconName,children:(0,n.jsx)(`span`,{children:e.text})},t))}),E=()=>!c||f?null:(0,n.jsx)(w,{className:`pkt-heading pkt-heading--medium pkt-heading--fw-regular pkt-card__heading`,children:c}),te=()=>f?(0,n.jsx)(w,{className:`pkt-heading pkt-heading--medium pkt-heading--fw-regular pkt-card__link-heading pkt-card__heading`,children:(0,n.jsx)(`a`,{className:`pkt-card__link`,href:f,target:m?`_blank`:`_self`,rel:m?`noopener noreferrer`:void 0,children:c})}):null,ne=()=>g?(0,n.jsx)(`p`,{className:`pkt-card__subheading`,children:g}):null,re=()=>!c&&!g?null:(0,n.jsxs)(`header`,{className:`pkt-card__header`,children:[E(),te(),ne()]}),D=()=>!i&&!o?null:(0,n.jsxs)(`footer`,{className:`pkt-card__metadata`,children:[i&&(0,n.jsx)(`span`,{className:`pkt-card__metadata-lead`,children:i}),o&&(0,n.jsx)(`span`,{className:`pkt-card__metadata-trail`,children:o})]});return(0,n.jsx)(`div`,{ref:b,className:(0,$.default)(`pkt-card-root`,t),style:{display:`block`,width:`100%`},children:(0,n.jsxs)(`article`,{...y,className:x,"aria-label":f?S:C,children:[ee(),(0,n.jsxs)(`div`,{className:`pkt-card__wrapper`,children:[_===`top`&&T(),re(),(0,n.jsx)(`section`,{className:`pkt-card__content`,children:e}),_===`bottom`&&T(),D()]})]})})});_l.displayName=`PktCard`;var vl=(0,t.forwardRef)(({id:e,hasTile:r=!1,disabled:i=!1,label:a,checkHelptext:o,hasError:s=!1,className:c,isSwitch:l=!1,hideLabel:u=!1,labelPosition:d=`right`,defaultChecked:f,checked:p,indeterminate:m,optionalTag:h,optionalText:g=`Valgfritt`,requiredTag:_,requiredText:v=`Må fylles ut`,tagText:y,...b},x)=>{let S=(0,t.useRef)(null);(0,t.useEffect)(()=>{S.current&&m!==void 0&&(S.current.indeterminate=m)},[m]),(0,t.useEffect)(()=>{typeof x==`function`?x(S.current):x&&(x.current=S.current)},[x]);let C=[c,`pkt-input-check`].filter(Boolean).join(` `),w=[`pkt-input-check__input-label`,i?`pkt-input-check__input-label--disabled`:``,`pkt-input-check__input-label--${d}`,u?`pkt-sr-only`:``].filter(Boolean).join(` `),ee=[`pkt-input-check__input`,r?`pkt-input-check__input--tile`:``,i&&r?`pkt-input-check__input--tile-disabled`:``].filter(Boolean).join(` `),T=[`pkt-tag`,`pkt-tag--small`,`pkt-tag--thin-text`].join(` `),E=()=>(0,n.jsxs)(n.Fragment,{children:[y&&(0,n.jsx)(`span`,{className:T+` pkt-tag--gray`,children:y}),h&&(0,n.jsx)(`span`,{className:T+` pkt-tag--blue-light`,children:g}),_&&(0,n.jsx)(`span`,{className:T+` pkt-tag--beige`,children:v})]});return(0,n.jsx)(`div`,{className:C,children:(0,n.jsxs)(`div`,{className:ee,children:[d===`left`&&(0,n.jsxs)(`label`,{className:w,htmlFor:e,children:[a,` `,E(),o&&(0,n.jsx)(`div`,{className:`pkt-input-check__input-helptext`,children:o})]}),(0,n.jsx)(`input`,{role:l?`switch`:`checkbox`,ref:S,className:`pkt-input-check__input-checkbox ${s?`pkt-input-check__input-checkbox--error`:``}`,type:`checkbox`,id:e,disabled:i,...p===void 0?{defaultChecked:f}:{checked:p},...b}),d===`right`&&(0,n.jsxs)(`label`,{className:w,htmlFor:e,children:[a,` `,E(),o&&(0,n.jsx)(`div`,{className:`pkt-input-check__input-helptext`,children:o})]})]})})});vl.displayName=`PktCheckbox`;var yl=(0,t.forwardRef)(({forId:e,label:r,helptext:i,helptextDropdown:a,helptextDropdownButton:o,counter:s,counterCurrent:c=0,counterMaxLength:l,optionalTag:u=!1,optionalText:d=`Valgfritt`,requiredTag:f=!1,requiredText:p=`Må fylles ut`,tagText:m=null,hasError:h=!1,errorMessage:g,disabled:_=!1,inline:v=!1,ariaDescribedby:y,useWrapper:b=!0,children:x,className:S=``,hasFieldset:C=!1,role:w=`group`,counterPosition:ee=`bottom`},T)=>{let[E,te]=(0,t.useState)(!1),ne=y||(i?`${e}-helptext`:void 0),re=!!s,D=re&&ee===`top`,ie=re&&ee===`bottom`,ae=()=>te(e=>!e),oe=[`pkt-inputwrapper`,S,h?`pkt-inputwrapper--error`:``,_?`pkt-inputwrapper--disabled`:``,v?`pkt-inputwrapper--inline`:``].filter(Boolean).join(` `),se=[`pkt-tag`,`pkt-tag--small`,`pkt-tag--thin-text`].join(` `),ce=()=>re?(0,n.jsxs)(`div`,{className:`pkt-input__counter`,"aria-live":`polite`,"aria-atomic":`true`,children:[c,l?`/${l}`:``]}):null,O=()=>(0,n.jsxs)(n.Fragment,{children:[m&&(0,n.jsx)(`span`,{className:se+` pkt-tag--gray`,children:m}),u&&(0,n.jsx)(`span`,{className:se+` pkt-tag--blue-light`,children:d}),f&&(0,n.jsx)(`span`,{className:se+` pkt-tag--beige`,children:p})]}),le=(0,n.jsxs)(n.Fragment,{children:[(()=>{let t=(0,n.jsxs)(n.Fragment,{children:[r,` `,O()]});return b?C?(0,n.jsx)(`legend`,{className:`pkt-inputwrapper__legend`,id:`${e}-label`,children:t}):(0,n.jsx)(`label`,{className:`pkt-inputwrapper__label`,htmlFor:e,"aria-describedby":ne,id:`${e}-label`,children:t}):(0,n.jsx)(`label`,{htmlFor:e,className:`pkt-sr-only`,"aria-describedby":ne,id:`${e}-label`,children:r})})(),!i&&!a?null:(0,n.jsxs)(n.Fragment,{children:[i&&b&&(0,n.jsx)(`div`,{className:`pkt-inputwrapper__helptext`,id:`${e}-helptext`,children:i}),a&&(0,n.jsxs)(`div`,{className:`pkt-inputwrapper__helptext-expandable`,children:[(0,n.jsx)(es,{skin:`tertiary`,size:`small`,variant:`icon-right`,iconName:E?`chevron-thin-up`:`chevron-thin-down`,className:`pkt-link pkt-link--icon-right`,onClick:ae,children:(0,n.jsx)(`span`,{dangerouslySetInnerHTML:{__html:o??`Les mer <span class="pkt-sr-only">om inputfeltet</span>`}})}),(0,n.jsx)(`div`,{className:`pkt-inputwrapper__helptext ${E?`pkt-inputwrapper__helptext-expandable-open`:`pkt-inputwrapper__helptext-expandable-closed`}`,children:a})]})]}),D&&(0,n.jsx)(ce,{}),x,ie&&(0,n.jsx)(ce,{}),h&&g&&(0,n.jsx)(`div`,{className:`pkt-inputwrapper__alert-wrapper`,children:(0,n.jsx)(Zo,{skin:`error`,"aria-live":`assertive`,role:`alert`,id:`${e}-error`,compact:!0,children:g})})]});return(0,n.jsx)(`div`,{className:oe,ref:T,role:w,children:C?(0,n.jsx)(`fieldset`,{className:`pkt-inputwrapper__fieldset`,"aria-describedby":ne,children:le}):(0,n.jsx)(`div`,{className:`pkt-inputwrapper__fieldset`,children:le})})});yl.displayName=`PktInputWrapper`;var bl=(e,t)=>t&&(e.find(e=>e.value===t)||e.find(e=>e.label===t))||null,xl=(e,t)=>{if(!t)return-1;let n=e.findIndex(e=>e.value===t);return n>=0?n:e.findIndex(e=>e.label===t)},Sl=(e,t)=>{if(!t)return[...e];let n=t.toLowerCase();return e.filter(e=>(e.fulltext||e.value+(e.label||``)+(e.prefix||``)).toLowerCase().includes(n))},Cl=e=>e.value+(e.label||``)+(e.prefix||``),wl=(e,t)=>t!==null&&e>=t,Tl=(e,t)=>{if(!e)return``;switch(t){case`prefixAndValue`:return`${e.prefix||``} ${e.value}`.trim();case`value`:return e.value;default:return e.label||e.value}},El=(e,t)=>e?Array.isArray(e)?t?e:e.length>0?[e[0]]:[]:t?e.split(`,`).filter(Boolean):[e]:[],Dl=(e,t)=>{if(!t)return{filtered:[...e],suggestion:null};let n=t.toLowerCase(),r=e.filter(e=>e.fulltext?.toLowerCase().includes(n));return{filtered:r,suggestion:r.find(e=>!e.selected&&e.label?.toLowerCase().startsWith(n))||null}},Ol=(e,t,n,r)=>{if(!e.trim())return{addValueText:null,userInfoMessage:``};let i=e.trim().toLowerCase(),a=t.find(e=>e.toLowerCase()===i),o=n.filter(e=>e.label?.toLowerCase().includes(i)||e.value.toLowerCase().includes(i)),s=o.find(e=>e.label?.toLowerCase()===i||e.value.toLowerCase()===i);return(o.length===0||!s)&&r?{addValueText:e,userInfoMessage:``}:o.length===0&&!r?{addValueText:null,userInfoMessage:`Ingen treff i søket`}:a?{addValueText:null,userInfoMessage:`Verdien er allerede valgt`}:{addValueText:null,userInfoMessage:``}},kl=(e,t,n)=>{switch(e){case`,`:return n?`addValue`:null;case`Enter`:return`addValue`;case`Tab`:case`ArrowDown`:return t?null:`focusListbox`;case`Escape`:return`closeOptions`;default:return null}},Al=(e,t,n,r,i)=>{if(!e)return{action:`none`,value:null};let a=bl(n,e);return!t.includes(e)&&!a?r?{action:`addUserValue`,value:e}:i?{action:`none`,value:null}:{action:`removeValue`,value:t[0]}:a&&!t.includes(a.value)?{action:`selectOption`,value:a.value}:{action:`none`,value:null}},jl=(e,t,n)=>{let r=bl(t,e);return n===`label`&&r?.label?r.label:e},Ml=e=>{e.scrollIntoView({block:`nearest`}),window.setTimeout(()=>e.focus(),0)},Nl=e=>Array.from(e.querySelectorAll(`[role="option"]:not([data-disabled])`)||[]),Pl=e=>{let t=e.nextElementSibling;t&&Ml(t)},Fl=(e,t,n)=>{let r=e.previousElementSibling;if(e.dataset.index===`0`&&n){let e=t.querySelector(`[role="searchbox"]`);e&&Ml(e)}else r&&Ml(r)},Il=e=>{let t=Nl(e);t[0]&&Ml(t[0])},Ll=(e,t)=>{if(t.disabled)return;let n=Nl(e);if(t.allowUserInput&&t.customUserInput){let t=e.querySelector(`[data-type="new-option"]`);if(t){Ml(t);return}}let r=n.find(e=>e.dataset.selected===`true`);if(r){Ml(r);return}if(t.includeSearch&&!(document.activeElement instanceof HTMLInputElement)){let t=e.querySelector(`[role="searchbox"]`);if(t){window.setTimeout(()=>t.focus(),0);return}}n[0]&&Ml(n[0])},Rl=({state:e,outside:r=!1})=>{let{values:i,options:a,disabled:o,displayValueAs:s,handleTagRemove:c,handleTagKeydown:l,focusedTagIndex:u}=e,d=(0,t.useRef)([]);if((0,t.useEffect)(()=>{!r&&u>=0&&u<i.length&&d.current[u]?.focus()},[r,u,i.length]),i.length===0)return null;let f=i.map((e,t)=>{let i=bl(a,e),f=i?.tagSkinColor,p=i?Tl(i,s):e;return o?(0,n.jsx)(`li`,{role:`listitem`,children:(0,n.jsx)(gl,{skin:f||`blue-dark`,children:(0,n.jsx)(`span`,{className:`pkt-combobox__value`,children:p})})},e):r?(0,n.jsx)(`li`,{role:`listitem`,children:(0,n.jsx)(gl,{skin:f||`blue-dark`,closeTag:!0,onClose:()=>c(e),children:(0,n.jsx)(`span`,{className:`pkt-combobox__value`,children:p})})},e):(0,n.jsx)(`li`,{role:`listitem`,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.preventDefault(),children:(0,n.jsx)(gl,{ref:e=>{d.current[t]=e},skin:f||`blue-dark`,closeTag:!0,tabIndex:u===t?0:-1,onClose:()=>c(e),onKeyDown:e=>l(e,t),children:(0,n.jsx)(`span`,{className:`pkt-combobox__value`,children:p})})},e)});return r?(0,n.jsx)(`div`,{className:`pkt-combobox__tags-outside`,children:(0,n.jsx)(`ul`,{role:`list`,className:`pkt-combobox__tag-list`,children:f})}):(0,n.jsx)(`ul`,{role:`list`,className:`pkt-combobox__tag-list`,children:f})},zl=({state:e})=>{let{values:t,options:r,editingSingleValue:i,displayValueAs:a}=e;if(i||t.length===0)return null;let o=bl(r,t[0]);return o?(0,n.jsx)(`span`,{className:`pkt-combobox__value`,children:Tl(o,a)}):null},Bl=({state:e})=>{let{id:t,inputId:r,listboxId:i,values:a,options:o,isOpen:s,multiple:c,typeahead:l,allowUserInput:u,tagPlacement:d,placeholder:f,disabled:p,fullwidth:m,hasError:h,label:g,inputFocus:_,inputRef:v,triggerRef:y,handleInputChange:b,handleInputKeydown:x,handleInputFocus:S,handleInputBlur:C,handleInputClick:w,handlePlaceholderClick:ee,handleSelectOnlyKeydown:T,name:E}=e,te=[`pkt-combobox__input`,m&&`pkt-combobox__input--fullwidth`,s&&`pkt-combobox__input--open`,h&&`pkt-combobox__input--error`,p&&`pkt-combobox__input--disabled`].filter(Boolean).join(` `),ne=[`pkt-combobox__arrow-icon`,s&&`pkt-combobox__arrow-icon--open`].filter(Boolean).join(` `),re=l||u,D=!re&&f&&(!a.length||c&&d===`outside`)&&!_,ie=d!==`outside`,ae=a[0]&&bl(o,a[0])?`${i}-${xl(o,a[0])}`:void 0,oe=c&&a.length>0?`${a.length} valgt`:void 0;return(0,n.jsxs)(`div`,{ref:y,className:te,onClick:w,...re?{tabIndex:-1}:{id:`${t}-combobox`,role:`combobox`,"aria-expanded":s?`true`:`false`,"aria-controls":i,"aria-haspopup":`listbox`,"aria-labelledby":`${t}-combobox-label`,"aria-activedescendant":ae,"aria-description":oe,tabIndex:p?-1:0,onKeyDown:T},children:[D?(0,n.jsx)(`span`,{className:`pkt-combobox__placeholder`,onClick:ee,children:f}):ie?c?(0,n.jsx)(Rl,{state:e}):re?null:(0,n.jsx)(zl,{state:e}):null,re?(0,n.jsx)(`div`,{className:`pkt-combobox__input-div combobox__input`,children:(0,n.jsx)(`input`,{ref:v,type:`text`,id:r,name:`${E||t}-input`,onChange:b,onKeyDown:x,onFocus:S,onBlur:C,placeholder:!a.length||c&&d===`outside`?f:void 0,autoComplete:`off`,role:`combobox`,"aria-expanded":s?`true`:`false`,"aria-label":g,"aria-autocomplete":l?`both`:u?`list`:`none`,"aria-controls":i,"aria-activedescendant":ae,"aria-description":oe,disabled:p})}):(0,n.jsx)(`input`,{ref:v,type:`hidden`,id:r,name:`${E||t}-input`,value:a.join(`,`),readOnly:!0}),(0,n.jsx)(Q,{className:ne,name:`chevron-thin-down`,"aria-hidden":`true`})]})},Vl=({state:e})=>{let{listboxId:t,label:r,isOpen:i,options:a,filteredOptions:o,multiple:s,disabled:c,maxIsReached:l,maxlength:u,includeSearch:d,allowUserInput:f,addValueText:p,userInfoMessage:m,searchPlaceholder:h,searchValue:g,handleOptionClick:_,handleOptionKeydown:v,handleSearchInput:y,handleSearchKeydown:b,handleNewOptionClick:x,handleNewOptionKeydown:S,listboxRef:C}=e,w=o.filter(e=>e.selected).length,ee=s&&w>0&&u!=null&&u>0,T=f&&p&&!l,E=!!m;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(`div`,{ref:C,id:t,className:[`pkt-listbox`,i&&`pkt-listbox__open`,`pkt-txt-16-light`].filter(Boolean).join(` `),role:o.length>0?`listbox`:void 0,"aria-label":o.length>0?`Liste: ${r||``}`:void 0,"aria-multiselectable":o.length>0&&s?`true`:void 0,children:[(0,n.jsxs)(`div`,{className:`pkt-listbox__banners`,children:[d&&(0,n.jsxs)(`div`,{className:`pkt-listbox__search`,children:[(0,n.jsx)(`span`,{className:`pkt-listbox__search-icon`,children:(0,n.jsx)(Q,{name:`magnifying-glass-small`})}),(0,n.jsx)(`input`,{className:`pkt-txt-16-light`,type:`text`,"aria-label":`Søk i listen`,form:``,placeholder:h||`Søk...`,onChange:y,onKeyDown:b,value:g,"data-type":`searchbox`,disabled:c,readOnly:c,role:`searchbox`})]}),ee&&(0,n.jsxs)(`div`,{className:`pkt-listbox__banner pkt-listbox__banner--maximum-reached`,children:[w,` av maks `,u,` mulige er valgt.`]}),E&&(0,n.jsxs)(`div`,{className:`pkt-listbox__banner pkt-listbox__banner--user-message`,children:[(0,n.jsx)(Q,{className:`pkt-listbox__banner-icon`,name:`exclamation-mark-circle`}),m]}),T&&(0,n.jsxs)(`div`,{className:`pkt-listbox__banner pkt-listbox__banner--new-option pkt-listbox__option`,"data-type":`new-option`,"data-value":p,"data-selected":`false`,tabIndex:0,onClick:()=>x(p),onKeyDown:S,children:[(0,n.jsx)(Q,{className:`pkt-listbox__banner-icon`,name:`plus-sign`}),`Legg til "`,p,`"`]}),a.length===0&&o.length===0&&!E&&(0,n.jsxs)(`div`,{className:`pkt-listbox__banner pkt-listbox__banner--empty`,children:[(0,n.jsx)(Q,{className:`pkt-listbox__banner-icon`,name:`exclamation-mark-circle`}),`Tom liste`]})]}),(0,n.jsx)(`ul`,{className:`pkt-listbox__options`,role:`presentation`,children:o.map((e,r)=>{let i=[`pkt-listbox__option`,!s&&e.selected&&`pkt-listbox__option--selected`,s&&`pkt-listbox__option--checkBox`].filter(Boolean).join(` `),a=c||e.disabled||l&&!e.selected;return(0,n.jsxs)(`li`,{className:i,onClick:()=>_(e.value),onKeyDown:t=>v(t,e.value),"aria-selected":e.selected?`true`:`false`,tabIndex:a?-1:0,"data-index":r,"data-value":e.value,"data-selected":e.selected?`true`:`false`,"data-disabled":a||void 0,"aria-disabled":a?`true`:`false`,role:`option`,id:`${t}-${r}`,children:[s?(0,n.jsx)(`input`,{className:`pkt-input-check__input-checkbox`,type:`checkbox`,tabIndex:-1,value:e.value,checked:e.selected||!1,readOnly:!0,"aria-hidden":`true`,disabled:a}):e.selected?(0,n.jsx)(Q,{name:`check-big`}):null,(0,n.jsxs)(`span`,{className:`pkt-listbox__option-label`,id:`${t}-option-label-${r}`,children:[e.prefix&&(0,n.jsx)(`span`,{className:`pkt-listbox__option-prefix`,children:e.prefix}),e.label||e.value]}),e.description&&(0,n.jsx)(`span`,{className:`pkt-listbox__option-description pkt-txt-14-light`,children:e.description})]},`${e.value}-${r}`)})})]}),(0,n.jsx)(`div`,{"aria-live":`polite`,className:`pkt-visually-hidden`,children:m})]})};function Hl(e,t){return e.map(e=>({...e,label:e.label||e.value,fulltext:Cl(e),selected:t.includes(e.value)}))}function Ul(e,n){let{id:r=``,label:i,value:a,defaultValue:o,options:s,defaultOptions:c,multiple:l=!1,maxlength:u,typeahead:d=!1,includeSearch:f=!1,allowUserInput:p=!1,displayValueAs:m=`label`,tagPlacement:h,searchPlaceholder:g,placeholder:_,disabled:v=!1,required:y=!1,fullwidth:b=!1,hasError:x=!1,errorMessage:S,helptext:C,helptextDropdown:w,helptextDropdownButton:ee,optionalTag:T=!1,optionalText:E,requiredTag:te=!1,requiredText:ne,tagText:re,useWrapper:D=!0,name:ie,className:ae,onChange:oe,onValueChange:se,children:ce}=e,O=`${r}-input`,le=`${r}-listbox`,k=d||p,A=(0,t.useRef)(null),ue=(0,t.useRef)(null),de=(0,t.useRef)(null),j=(0,t.useRef)(null),M=(0,t.useRef)(null),N=(0,t.useCallback)(()=>{k?A.current?.focus():de.current?.focus()},[k]),P=(0,t.useMemo)(()=>{let e=[];return t.Children.forEach(ce,n=>{if((0,t.isValidElement)(n)&&n.type===`option`){let t=n.props;e.push({value:t.value??t.children??``,label:t.children??t.value??``,selected:t.selected,disabled:t.disabled})}}),e},[ce]),F=(0,t.useMemo)(()=>c&&c.length>0?c.map(e=>({...e,fulltext:Cl(e)})):s&&s.length>0?s.map(e=>({...e,fulltext:Cl(e)})):P.length>0?P.map(e=>({...e,fulltext:Cl(e)})):[],[c,s,P]),I=a!==void 0,[fe,pe]=(0,t.useState)(()=>El(a??o,l)),L=(0,t.useRef)(fe);(0,t.useEffect)(()=>{I&&pe(El(a,l))},[a,I,l]);let R=I?El(a,l):fe,[me,he]=(0,t.useState)([]),z=(0,t.useMemo)(()=>Hl([...me.filter(e=>!F.some(t=>t.value===e.value)),...F],R),[F,me,R]),[B,V]=(0,t.useState)(!1),[ge,H]=(0,t.useState)(``),[_e,ve]=(0,t.useState)(``),[U,ye]=(0,t.useState)(``),[be,xe]=(0,t.useState)(null),[Se,Ce]=(0,t.useState)(!1),[we,Te]=(0,t.useState)(!1),[Ee,De]=(0,t.useState)(-1),Oe=(0,t.useRef)(!1),ke=wl(R.length,u??null),Ae=l&&u!=null,je=(0,t.useMemo)(()=>ge?d?Dl(z,ge).filtered:Sl(z,ge):z,[z,ge,d]),Me=(0,t.useMemo)(()=>Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`)?.set,[]),Ne=(0,t.useCallback)(e=>{let t=ue.current;if(!t||!Me)return;let n=l?e.join(`,`):e[0]||``;Me.call(t,n),t.dispatchEvent(new Event(`input`,{bubbles:!0}))},[Me,l]),Pe=l?R.join(`,`):R[0]||``;(0,t.useEffect)(()=>{ue.current&&(ue.current.value=Pe)},[Pe]),(0,t.useEffect)(()=>{if(B||l||!A.current)return;let e=R[0]?jl(R[0],z,m):``;A.current.value!==e&&(A.current.value=e)},[R,z,m,l,B]);let Fe=(0,t.useCallback)((e,t=!0)=>{I||pe(e),t&&(se?.(e),Ne(e))},[I,se,Ne]),Ie=(0,t.useCallback)(e=>{if(e&&!R.includes(e)){if(l&&wl(R.length,u??null)){ye(`Maks antall valg nådd`);return}Fe(l?[...R,e]:[e])}},[R,l,u,Fe]),Le=(0,t.useCallback)(e=>{if(!e)return;let t=R.filter(t=>t!==e);bl(z,e)?.userAdded&&he(t=>t.filter(t=>t.value!==e)),Fe(t)},[R,z,Fe]),Re=(0,t.useCallback)(()=>{he([]),Fe([])},[Fe]),ze=(0,t.useCallback)(e=>{if(!e||e.trim()===``)return;let t;if(!l)t=[e];else{if(bl(z,e)||wl(R.length,u??null))return;t=[...R,e]}let n={value:e,label:e,userAdded:!0,selected:!0};he(t=>[n,...t.filter(t=>t.value!==e)]),Fe(t)},[l,z,R,u,Fe]),Be=(0,t.useCallback)((e=!0,t)=>{if(xe(null),e&&A.current&&A.current.type!==`hidden`){H(``),ve(``);let e=t===void 0?R[0]:t;!l&&e?A.current.value=jl(e,z,m):A.current.value=``,l||(Te(!1),ye(``))}},[l,R,z,m]),Ve=(0,t.useCallback)(e=>{if(v)return;ye(``),xe(null);let t=bl(z,e)?.value||null,n=R.includes(e||t||``),r=!!t,i=z.find(t=>t.value===e)?.disabled||!1,a=!e?.trim(),o=!l,s=l,c=wl(R.length,u??null),d=!1,f=!0,m=``,h=``,g;i||(!r&&p&&!a?(ze(e),m=`Ny verdi lagt til`,d=s,o&&(g=e||``)):!r&&!p?(o&&R[0]&&Le(R[0]),f=!1,d=!0,m=`Ingen treff i søket`):n?(Le(t),d=!0,g=``,o&&k&&A.current&&A.current.type!==`hidden`&&(A.current.value=``)):a&&o?(Re(),d=!0,g=``):o?(R[0]&&Le(R[0]),Ie(t),d=!1,g=t||``):s&&!c?(Ie(t),d=!0):s&&c?(m=`Maks antall valg nådd`,f=!1,h=e||``):(o&&Re(),m=`Ingen gyldig verdi valgt`,f=!1,d=!0,h=e||``,g=``),V(d),ye(m),H(h),Be(f,g),d||(o&&k&&(Oe.current=!0),window.setTimeout(()=>{N()},0)))},[v,z,R,l,u,p,ze,Le,Re,Ie,Be,N]),He=(0,t.useCallback)(()=>{if(Ce(!1),xe(null),ye(``),H(``),A.current&&A.current.type!==`hidden`){let e=A.current.value,t=R[0];if(!l)if(!e)R[0]&&Le(R[0]),t=void 0;else{let n=bl(z,e);n&&n.value!==R[0]?(R[0]&&Le(R[0]),Ie(n.value),t=n.value):!n&&p&&(R[0]&&Le(R[0]),ze(e),t=e)}else if(e!==``){let{action:t,value:n}=Al(e,R,z,p,l);switch(t){case`addUserValue`:ze(n);break;case`selectOption`:Ie(n);break;case`removeValue`:Le(n);break}}!l&&t?A.current.value=jl(t,z,m):A.current.value=``}V(!1),Te(!1)},[R,z,p,l,m,ze,Ie,Le]),Ue=(0,t.useCallback)(e=>{if(!e.trim().toLowerCase()){xe(null),ye(``),!l&&R[0]&&Le(R[0]);return}let t=Ol(e,R,z,p);xe(t.addValueText),ye(t.userInfoMessage)},[R,z,p,l,Le]),W=(0,t.useCallback)(e=>{if(v)return;let t=e.target.value;if(ve(t),H(t),Ue(t),d&&t){let{suggestion:n}=Dl(z,t);n?.label&&A.current&&!e.nativeEvent.inputType?.includes(`deleteContent`)&&(A.current.value=n.label,window.setTimeout(()=>A.current?.setSelectionRange(t.length,n.label.length),0))}},[v,d,z,Ue]),G=(0,t.useCallback)(e=>{if(e.key===`Backspace`){let t=!A.current?.value;if(!ge&&t&&l&&R.length>0){e.preventDefault();let t=R[R.length-1];Le(t)}return}if(e.key===`ArrowLeft`&&l&&R.length>0&&(A.current?.selectionStart??0)===0&&!A.current?.value){e.preventDefault(),De(R.length-1);return}let t=kl(e.key,e.shiftKey,l);if(t&&!(e.key===`Tab`&&!B)){if(t===`focusListbox`&&e.key===`Tab`&&!j.current?.querySelector(`[role="option"]:not([data-disabled]), [data-type="new-option"]`)){He();return}switch(e.preventDefault(),t){case`addValue`:{let e=A.current?.value.trim()||``;if(H(e),e&&R.includes(e)){Be(!0),ye(`Verdien er allerede valgt`);break}Ve(e);break}case`focusListbox`:j.current&&(B||V(!0),Ll(j.current,{disabled:v,allowUserInput:p,customUserInput:be,includeSearch:f}));break;case`closeOptions`:V(!1);break}}},[ge,R,l,v,p,be,f,B,Le,Ve,N]),We=(0,t.useCallback)(()=>{if(!v){if(Oe.current){Oe.current=!1,Ce(!0);return}!l&&R[0]&&A.current&&A.current.type!==`hidden`&&(Te(!0),A.current.value=jl(R[0],z,m)),Ce(!0),H(``),V(!0)}},[v,l,R,z,m]),Ge=(0,t.useCallback)(()=>{Ce(!1),Te(!1)},[]),Ke=(0,t.useCallback)(e=>{if(v||!B)return;let t=e.relatedTarget,n=M.current;n&&t&&n.contains(t)||He()},[v,B,He]),qe=(0,t.useCallback)(e=>{if(v){e.preventDefault(),e.stopPropagation();return}if(k)A.current?.focus();else{e.stopPropagation(),e.preventDefault();let t=!B;V(t),t&&j.current&&Ll(j.current,{disabled:v,allowUserInput:p,customUserInput:be,includeSearch:f})}},[v,k,B,p,be,f]),K=(0,t.useCallback)(e=>{v||(e.stopPropagation(),k&&A.current?(A.current.focus(),Ce(!0)):V(e=>!e))},[v,k]),Je=(0,t.useCallback)(e=>{if(!v)switch(e.key){case`Enter`:case` `:case`ArrowDown`:case`ArrowUp`:e.preventDefault(),B?V(!1):(V(!0),j.current&&window.setTimeout(()=>{j.current&&Ll(j.current,{disabled:v,allowUserInput:p&&!ke,customUserInput:be,includeSearch:f})},0));break;case`Escape`:B&&(e.preventDefault(),V(!1));break;case`Home`:case`End`:e.preventDefault(),B||V(!0),j.current&&window.setTimeout(()=>{j.current&&Ll(j.current,{disabled:v,allowUserInput:p&&!ke,customUserInput:be,includeSearch:f})},0);break;case`ArrowLeft`:l&&R.length>0&&(e.preventDefault(),De(R.length-1));break;case`Backspace`:case`Delete`:if(l&&R.length>0){e.preventDefault();let t=R[R.length-1];Le(t)}break}},[v,B,p,ke,be,f,l,R,Le]),Ye=(0,t.useCallback)(e=>{Ve(e)},[Ve]),Xe=(0,t.useCallback)((e,t)=>{switch(e.key){case`Enter`:case` `:e.preventDefault(),Ve(t);break;case`ArrowDown`:e.preventDefault(),Pl(e.currentTarget);break;case`ArrowUp`:e.preventDefault(),j.current&&Fl(e.currentTarget,j.current,f);break;case`Escape`:e.preventDefault(),V(!1),N();break;case`Tab`:He();break}},[Ve,f,N,He]),Ze=(0,t.useCallback)(e=>{Le(e),De(-1),k&&A.current&&(Ce(!0),A.current.focus())},[Le,k]),Qe=(0,t.useCallback)((e,t)=>{switch(e.stopPropagation(),e.key){case`ArrowLeft`:e.preventDefault(),t>0&&De(t-1);break;case`ArrowRight`:e.preventDefault(),t<R.length-1?De(t+1):(De(-1),k&&A.current?A.current.focus():de.current?.focus());break;case`Backspace`:case`Delete`:e.preventDefault();{let e=R[t],n=t>=R.length-1?t-1:t;Le(e),n>=0?De(n):(De(-1),k&&A.current?A.current.focus():de.current?.focus())}break;case`Tab`:De(-1);break;case`Escape`:e.preventDefault(),De(-1),k&&A.current?A.current.focus():de.current?.focus();break}},[R,k,Le]),q=(0,t.useCallback)(e=>{H(e.target.value),Ue(e.target.value)},[Ue]),$e=(0,t.useCallback)(e=>{switch(e.key){case`ArrowDown`:e.preventDefault(),j.current&&j.current.querySelector(`[role="option"]:not([data-disabled]), [data-type="new-option"]`)?.focus();break;case`Tab`:He();break;case`Escape`:e.preventDefault(),V(!1),N();break}},[N,He]),et=(0,t.useCallback)(e=>{Ve(e)},[Ve]),tt=(0,t.useCallback)(e=>{switch(e.key){case`Enter`:case` `:e.preventDefault(),Ve(e.currentTarget.dataset.value||``);break;case`ArrowDown`:e.preventDefault(),j.current&&Il(j.current);break;case`ArrowUp`:e.preventDefault(),j.current&&Fl(e.currentTarget,j.current,f);break;case`Escape`:e.preventDefault(),V(!1),N();break}},[Ve,f,N]);return(0,t.useEffect)(()=>{if(!B)return;let e=e=>{let t=e.target;M.current&&!M.current.contains(t)&&He()};return document.addEventListener(`click`,e,!0),()=>{document.removeEventListener(`click`,e,!0)}},[B,He]),(0,t.useEffect)(()=>{let e=M.current?.closest(`form`);if(!e)return;let t=()=>{window.setTimeout(()=>{if(pe(L.current),he([]),ve(``),H(``),xe(null),ye(``),ue.current){let e=l?L.current.join(`,`):L.current[0]||``;ue.current.value=e}},0)};return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)},[l]),(0,t.useImperativeHandle)(n,()=>({get value(){return ue.current?.value??``},set value(e){let t=Array.isArray(e)?e:e?String(e).split(`,`).filter(Boolean):[];I||pe(t),ue.current&&(ue.current.value=t.join(`,`))},focus(){k?A.current?.focus():de.current?.focus()},blur(){k?A.current?.blur():de.current?.blur()}}),[I]),{id:r,inputId:O,listboxId:le,values:R,inputValue:_e,searchValue:ge,options:z,filteredOptions:je,isOpen:B,userInfoMessage:U,addValueText:be,maxIsReached:ke,editingSingleValue:we,inputFocus:Se,focusedTagIndex:Ee,label:i,multiple:l,maxlength:u,typeahead:d,includeSearch:f,allowUserInput:p,displayValueAs:m,tagPlacement:h,searchPlaceholder:g,placeholder:_,disabled:v,required:y,fullwidth:b,hasError:x,errorMessage:S,helptext:C,helptextDropdown:w,helptextDropdownButton:ee,optionalTag:T,optionalText:E,requiredTag:te,requiredText:ne,tagText:re,useWrapper:D,name:ie,className:ae,hasCounter:Ae,inputRef:A,changeInputRef:ue,triggerRef:de,listboxRef:j,wrapperRef:M,handleInputChange:W,handleInputKeydown:G,handleInputFocus:We,handleInputBlur:Ge,handleFocusOut:Ke,handleInputClick:qe,handlePlaceholderClick:K,handleSelectOnlyKeydown:Je,handleOptionClick:Ye,handleOptionKeydown:Xe,handleTagRemove:Ze,handleTagKeydown:Qe,handleSearchInput:q,handleSearchKeydown:$e,handleNewOptionClick:et,handleNewOptionKeydown:tt,onChange:oe}}var Wl=(0,t.forwardRef)((e,t)=>{let r=Ul(e,t),i=[`pkt-combobox-component`,r.fullwidth&&`pkt-combobox-component--fullwidth`,r.className].filter(Boolean).join(` `),a=r.allowUserInput||r.typeahead,o=a?r.inputId:`${r.id}-combobox`;return(0,n.jsxs)(`div`,{className:i,ref:r.wrapperRef,id:r.id||void 0,children:[(0,n.jsxs)(yl,{forId:o,hasFieldset:!a,label:r.label||``,helptext:r.helptext,helptextDropdown:r.helptextDropdown,helptextDropdownButton:r.helptextDropdownButton,hasError:r.hasError,errorMessage:r.errorMessage,disabled:r.disabled,optionalTag:r.optionalTag,optionalText:r.optionalText,requiredTag:r.requiredTag,requiredText:r.requiredText,tagText:r.tagText,useWrapper:r.useWrapper,counter:r.hasCounter,counterCurrent:r.values.length,counterMaxLength:r.maxlength,className:`pkt-combobox__wrapper`,children:[(0,n.jsxs)(`div`,{className:`pkt-combobox`,onBlur:r.handleFocusOut,children:[(0,n.jsx)(Bl,{state:r}),(0,n.jsx)(Vl,{state:r})]}),r.tagPlacement===`outside`&&r.multiple&&(0,n.jsx)(Rl,{state:r,outside:!0})]}),(0,n.jsx)(`input`,{ref:r.changeInputRef,type:`text`,name:r.name||r.id,onChange:r.onChange,tabIndex:-1,"aria-hidden":`true`,className:`pkt-visually-hidden`})]})});Wl.displayName=`PktCombobox`;var Gl=x({tagName:`pkt-consent`,elementClass:qa,react:t.default,displayName:`PktConsent`,events:{onToggleConsent:`toggle-consent`}});Gl.displayName=`PktConsent`;var Kl=()=>{let e=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(e)||/Macintosh/.test(e)&&`ontouchend`in document)},ql=()=>Kl()?`text`:`date`,Jl=e=>!e||e.length!==2?!0:Uc(e[0],e[1]),Yl=(e,t,n,r,i,a)=>({"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":e,"pkt-datepicker--hasrangelabels":t,"pkt-datepicker--multiple":n,"pkt-datepicker--range":r,"ios-readonly-hack":i===!1&&a===`text`}),Xl=()=>({"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}),Zl=e=>({"pkt-input-prefix":e,"pkt-hide":!e}),Ql=(e,t,n)=>!t&&!n?Array.isArray(e)?e[0]||``:e:Array.isArray(e)?e.join(`,`):e,$l=(e,t,n=!1)=>{if(!e||!t)return;let r=t.parentElement?.getBoundingClientRect()||t.getBoundingClientRect(),i=n?r.height+30:r.height,a=e.getBoundingClientRect().height,o=n?`calc(100% - 30px)`:`100%`;r&&r.top+a>window.innerHeight&&r.top-a>0&&(o=`calc(100% - ${i}px - ${a}px)`),e.style.top=o},eu=(e,t,n,r,i,a)=>{let{key:o}=e;o===`,`&&(e.preventDefault(),a?a(e):i&&i()),(o===`Space`||o===` `)&&(e.preventDefault(),t(e)),o===`Enter`&&(e.preventDefault(),n?n():r?r():i&&i())},tu=({open:e,multiple:r=!1,range:i=!1,weeknumbers:a=!1,withcontrols:o=!1,selected:s=[],earliest:c,latest:l,excludedates:u,excludeweekdays:d,maxMultiple:f,currentmonth:p,today:m,inputRef:h,hasCounter:g=!1,onDateSelected:_,onClose:v})=>{let y=(0,t.useRef)(null),b=(0,t.useRef)(!1);e&&(b.current=!0),(0,t.useEffect)(()=>{e&&$l(y.current,h?.current??null,g)},[e,h,g]);let x=[`pkt-calendar-popup`,e?`show`:`hide`].join(` `),S=e||b.current;return(0,n.jsx)(`div`,{ref:y,className:x,hidden:!e,"aria-hidden":!e,children:S&&(0,n.jsx)(hl,{multiple:r,range:i,weeknumbers:a,withcontrols:o,selected:s,earliest:c,latest:l,excludedates:u,excludeweekdays:d,maxMultiple:f,currentmonth:p,today:m,onDateSelected:_,onClose:v})})},nu=({dates:e,dateformat:t,idBase:r,strings:i,onDateRemoved:a})=>{let o=Hc(e),s=i?.calendar?.buttonAltText??`Slett dato`;return(0,n.jsx)(`div`,{className:`pkt-date-tags pkt-datepicker__tags`,"aria-live":`polite`,children:o.map(e=>{let i=Ac(e,t);return(0,n.jsx)(gl,{id:`${r}${e}-tag`,closeTag:!0,ariaLabel:`${s} ${i}`,onClose:()=>a(e),children:(0,n.jsx)(`time`,{dateTime:e,children:i})},e)})})},ru=({state:e})=>{let{id:t,inputId:r,values:i,dateformat:a,multiple:o,range:s,showRangeLabels:c,disabled:l,readOnly:u,required:d,label:f,name:p,placeholder:m,hasError:h,helptext:g,minStr:_,maxStr:v,inputType:y,isIOSDevice:b,strings:x,inputClasses:S,buttonClasses:C,rangeLabelClasses:w,datepickerInputsClasses:ee,isInputDisabled:T,inputRef:E,inputRefTo:te,btnRef:ne,toggleCalendar:re,handleFocus:D,handleSingleInputChange:ie,handleRangeFromChange:ae,handleRangeToChange:oe,handleRangeBlur:se,handleMultipleBlur:ce,handleTagRemoved:O,handleSingleKeydown:le,handleRangeFromKeydown:k,handleRangeToKeydown:A,handleMultipleKeydown:ue,restProps:de}=e,j=e=>{e.preventDefault(),re()},M=()=>(0,n.jsxs)(`button`,{ref:ne,className:C,type:`button`,onClick:re,disabled:l,"aria-label":x.calendar?.buttonAltText??`Åpne kalender`,children:[(0,n.jsx)(Q,{name:`calendar`}),(0,n.jsx)(`span`,{className:`pkt-btn__text`,children:x.calendar?.buttonAltText??`Åpne kalender`})]});return o?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(nu,{dates:i,dateformat:a,idBase:t,strings:x,onDateRemoved:O}),(0,n.jsx)(`div`,{className:`pkt-datepicker__inputs`,children:(0,n.jsxs)(`div`,{className:`pkt-input__container`,children:[(0,n.jsx)(`input`,{...de,ref:E,className:S,type:y,id:r,name:p??t,placeholder:m,readOnly:u||b&&!u,disabled:T,"aria-describedby":g?`${t}-helptext`:void 0,"aria-invalid":h,"aria-errormessage":h?`${t}-error`:void 0,onClick:j,onKeyDown:ue,onFocus:D,onBlur:ce}),M()]})})]}):s?(0,n.jsx)(`div`,{className:ee,children:(0,n.jsxs)(`div`,{className:`pkt-input__container`,children:[c&&(0,n.jsx)(`div`,{className:`pkt-input-prefix`,children:x.generic?.from??`Fra`}),(0,n.jsx)(`input`,{...de,ref:E,className:S,type:y,id:r,name:p?`${p}-from`:`${t}-from`,value:i[0]??``,min:_,max:v,placeholder:m,readOnly:u||b&&!u,disabled:l,required:d,"aria-label":`${f} ${x.generic?.from??`Fra`}`,"aria-describedby":g?`${t}-helptext`:void 0,"aria-invalid":h,"aria-errormessage":h?`${t}-error`:void 0,onClick:j,onKeyDown:k,onFocus:D,onBlur:se,onChange:ae}),(0,n.jsx)(`div`,{className:w,id:`${t}-to-label`,children:x.generic?.to??`Til`}),!c&&(0,n.jsx)(`div`,{className:`pkt-input-separator`,children:`–`}),(0,n.jsx)(`input`,{ref:te,className:S,type:y,id:`${t}-to`,name:p?`${p}-to`:`${t}-to`,value:i[1]??``,min:_,max:v,readOnly:u||b&&!u,disabled:l,"aria-label":`${f} ${x.generic?.to??`Til`}`,"aria-invalid":h,onClick:j,onKeyDown:A,onFocus:D,onBlur:se,onChange:oe}),M()]})}):(0,n.jsx)(`div`,{className:`pkt-datepicker__inputs`,children:(0,n.jsxs)(`div`,{className:`pkt-input__container`,children:[(0,n.jsx)(`input`,{...de,ref:E,className:S,type:y,id:r,name:p??t,value:i[0]??``,min:_,max:v,placeholder:m,readOnly:u||b&&!u,disabled:l,required:d,"aria-describedby":g?`${t}-helptext`:void 0,"aria-invalid":h,"aria-errormessage":h?`${t}-error`:void 0,onClick:j,onKeyDown:le,onFocus:D,onBlur:void 0,onChange:ie}),M()]})})},iu={calendar:{buttonAltText:`Åpne kalender`}},au={calendar:{buttonAltText:`Åpne kalender`},generic:{from:`Fra`,to:`Til`}},ou=e=>{if(!e)return[];if(Array.isArray(e))return e.filter(Boolean);if(typeof e==`string`&&e.trimStart().startsWith(`[`))try{let t=JSON.parse(e);if(Array.isArray(t))return t.filter(Boolean)}catch{}return String(e).split(`,`).map(e=>e.trim()).filter(Boolean)};function su(e,n){let{id:r,label:i,value:a,defaultValue:o,dateformat:s=`dd.MM.yyyy`,multiple:c=!1,maxlength:l,range:u=!1,showRangeLabels:d=!1,weeknumbers:f=!1,withcontrols:p=!1,excludedates:m,excludeweekdays:h,currentmonth:g,today:_,calendarOpen:v,timezone:y,fullwidth:b=!1,hasFieldset:x=!1,inline:S=!1,helptext:C,helptextDropdown:w,helptextDropdownButton:ee,hasError:T=!1,errorMessage:E,optionalTag:te=!1,optionalText:ne,requiredTag:re=!1,requiredText:D,tagText:ie,useWrapper:ae=!0,strings:oe,disabled:se=!1,readOnly:ce=!1,required:O=!1,name:le,min:k,max:A,placeholder:ue,onChange:de,onValueChange:j,className:M,...N}=e,P=(0,t.useCallback)(e=>e===void 0?[]:ou(e),[]),F=a!==void 0,I=typeof o==`number`?void 0:o,[fe,pe]=(0,t.useState)(()=>P(a??I)),L=F?P(a):fe,R=(0,t.useRef)(fe);(0,t.useEffect)(()=>{F&&pe(P(a))},[a,F,P]);let[me,he]=(0,t.useState)(v??!1);(0,t.useEffect)(()=>{v!==void 0&&he(v)},[v]);let z=(0,t.useRef)(null),B=(0,t.useRef)(null),V=(0,t.useRef)(null),ge=(0,t.useRef)(null),H=(0,t.useRef)(null),_e=(0,t.useMemo)(()=>ql(),[]),ve=(0,t.useMemo)(()=>Kl(),[]),U=(0,t.useMemo)(()=>oe??(u?au:iu),[oe,u]),ye=typeof k==`string`?k:k===void 0?void 0:String(k),be=typeof A==`string`?A:A===void 0?void 0:String(A),xe=(0,t.useMemo)(()=>{let e=Yl(b,d,c,u,ce,_e);return Object.entries(e).filter(([,e])=>e).map(([e])=>e).join(` `)},[b,d,c,u,ce,_e]),Se=(0,t.useMemo)(()=>{let e=Xl();return Object.entries(e).filter(([,e])=>e).map(([e])=>e).join(` `)},[]),Ce=(0,t.useMemo)(()=>{let e=Zl(d);return Object.entries(e).filter(([,e])=>e).map(([e])=>e).join(` `)},[d]),we=(0,t.useMemo)(()=>[`pkt-datepicker__inputs`,u&&`pkt-input__range-inputs`].filter(Boolean).join(` `),[u,d]),Te=(0,t.useMemo)(()=>{if(g)return g;if(be)return be.slice(0,7)},[g,be]),Ee=se||c&&l!=null&&L.length>=l,De=c&&l!=null,Oe=`${r}-input`,ke=L.join(`,`);(0,t.useEffect)(()=>{V.current&&(V.current.value=ke)},[ke]),(0,t.useEffect)(()=>{y&&typeof window<`u`&&y!==window.pktTz&&(window.pktTz=y)},[y]);let Ae=(0,t.useCallback)((e,t=!0)=>{F||pe(e),t&&j?.(e)},[F,j]),je=(0,t.useMemo)(()=>Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`)?.set,[]),Me=(0,t.useCallback)(e=>{let t=V.current;!t||!je||(je.call(t,e.join(`,`)),t.dispatchEvent(new Event(`input`,{bubbles:!0})))},[je]),Ne=(0,t.useCallback)(()=>{se||he(e=>!e)},[se]),Pe=(0,t.useCallback)(()=>{he(!1)},[]);(0,t.useEffect)(()=>{if(!me)return;let e=e=>{let t=e.target;H.current&&!H.current.contains(t)&&!t.closest?.(`.pkt-calendar-popup`)&&Pe()},t=e=>{e.key===`Escape`&&(Pe(),z.current?.focus())};return document.addEventListener(`click`,e,!0),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`click`,e,!0),document.removeEventListener(`keydown`,t)}},[me,Pe]);let Fe=(0,t.useCallback)(()=>{ve&&!me&&he(!0)},[ve,me]),Ie=(0,t.useCallback)(e=>{let t=ou(Ql(e,c,u));Ae(t),Me(t),!c&&!u&&(Pe(),z.current?.focus())},[c,u,Ae,Me,Pe]),Le=(0,t.useCallback)(()=>{Pe(),z.current?.focus()},[Pe]),Re=(0,t.useCallback)(e=>{let t=e.target.value,n=t?[t]:[];Ae(n),Me(n)},[Ae,Me]),ze=(0,t.useCallback)(e=>{let t=[e.target.value,L[1]??``].filter(Boolean);Ae(t),Me(t)},[L,Ae,Me]),Be=(0,t.useCallback)(e=>{let t=[L[0]??``,e.target.value].filter(Boolean);Ae(t),Me(t)},[L,Ae,Me]),Ve=(0,t.useCallback)(()=>{L.length===2&&!Jl(L)&&(Ae([L[0]]),Me([L[0]]))},[L,Ae,Me]),He=(0,t.useCallback)(e=>{let t=jc(e),n=ye?jc(ye):null,r=be?jc(be):null;if(t&&!isNaN(t.getTime())&&(!n||t>=n)&&(!r||t<=r)){let t=Vc([...L,e],ye,be,m,h),n=[...new Set(t)];Ae(n),Me(n)}},[L,ye,be,m,h,Ae,Me]),Ue=(0,t.useCallback)(e=>{let t=e.target;t.value&&=(He(t.value.split(`,`)[0]),``)},[He]),W=(0,t.useCallback)(e=>{let t=e.target;t.value&&=(He(t.value.split(`,`)[0]),``)},[He]),G=(0,t.useCallback)(e=>{let t=L.filter(t=>t!==e);Ae(t),Me(t)},[L,Ae,Me]),We=(0,t.useCallback)(e=>{let t=e?.closest(`form`);t?t.requestSubmit():e?.blur()},[]),Ge=(0,t.useCallback)(e=>{eu(e.nativeEvent,()=>Ne(),()=>We(z.current),void 0,()=>z.current?.blur())},[Ne,We]),Ke=(0,t.useCallback)(e=>{eu(e.nativeEvent,()=>Ne(),()=>We(z.current),()=>B.current?.focus(),()=>z.current?.blur())},[Ne,We]),qe=(0,t.useCallback)(e=>{eu(e.nativeEvent,()=>Ne(),()=>We(B.current),void 0,()=>B.current?.blur())},[Ne,We]),K=(0,t.useCallback)(e=>{eu(e.nativeEvent,()=>Ne(),()=>We(z.current),void 0,()=>z.current?.blur(),W)},[Ne,We,W]);return(0,t.useEffect)(()=>{let e=H.current?.closest(`form`);if(!e)return;let t=()=>{window.setTimeout(()=>{pe(R.current),he(!1),V.current&&(V.current.value=R.current.join(`,`))},0)};return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)},[]),(0,t.useImperativeHandle)(n,()=>({get value(){return V.current?.value??``},set value(e){pe(e?e.split(`,`).filter(Boolean):[]),V.current&&(V.current.value=e??``)},focus(){z.current?.focus()},blur(){z.current?.blur()}}),[]),{id:r,inputId:Oe,label:i,values:L,calendarOpen:me,dateformat:s,multiple:c,maxlength:l,range:u,showRangeLabels:d,weeknumbers:f,withcontrols:p,excludedates:m,excludeweekdays:h,disabled:se,readOnly:ce,required:O,name:le,placeholder:ue,fullwidth:b,hasFieldset:x,inline:S,helptext:C,helptextDropdown:w,helptextDropdownButton:ee,hasError:T,errorMessage:E,optionalTag:te,optionalText:ne,requiredTag:re,requiredText:D,tagText:ie,useWrapper:ae,className:M,minStr:ye,maxStr:be,effectiveCurrentMonth:Te,today:_,inputType:_e,isIOSDevice:ve,strings:U,inputClasses:xe,buttonClasses:Se,rangeLabelClasses:Ce,datepickerInputsClasses:we,isInputDisabled:Ee,hasCounter:De,inputRef:z,inputRefTo:B,changeInputRef:V,btnRef:ge,wrapperRef:H,onChange:de,toggleCalendar:Ne,hideCalendar:Pe,handleDateSelected:Ie,handleCalendarClose:Le,handleFocus:Fe,handleSingleInputChange:Re,handleRangeFromChange:ze,handleRangeToChange:Be,handleRangeBlur:Ve,handleMultipleBlur:Ue,handleTagRemoved:G,handleSingleKeydown:Ge,handleRangeFromKeydown:Ke,handleRangeToKeydown:qe,handleMultipleKeydown:K,restProps:N}}var cu=(0,t.forwardRef)((e,t)=>{let r=su(e,t);return(0,n.jsxs)(`div`,{className:[`pkt-datepicker`,r.className].filter(Boolean).join(` `),id:r.id||void 0,children:[(0,n.jsx)(yl,{ref:r.wrapperRef,forId:r.inputId,label:r.label,hasFieldset:r.hasFieldset,inline:r.inline,helptext:r.helptext,helptextDropdown:r.helptextDropdown,helptextDropdownButton:r.helptextDropdownButton,hasError:r.hasError,errorMessage:r.errorMessage,disabled:r.disabled,optionalTag:r.optionalTag,optionalText:r.optionalText,requiredTag:r.requiredTag,requiredText:r.requiredText,tagText:r.tagText,useWrapper:r.useWrapper,counter:r.hasCounter,counterCurrent:r.values.length,counterMaxLength:r.maxlength,children:(0,n.jsx)(ru,{state:r})}),(0,n.jsx)(tu,{open:r.calendarOpen,multiple:r.multiple,range:r.range,weeknumbers:r.weeknumbers,withcontrols:r.withcontrols,selected:r.values,earliest:r.minStr,latest:r.maxStr,excludedates:r.excludedates,excludeweekdays:r.excludeweekdays,maxMultiple:r.maxlength,currentmonth:r.effectiveCurrentMonth,today:r.today,inputRef:r.inputRef,hasCounter:r.hasCounter,onDateSelected:r.handleDateSelected,onClose:r.handleCalendarClose}),(0,n.jsx)(`input`,{ref:r.changeInputRef,type:`text`,name:r.name,onChange:r.onChange,tabIndex:-1,"aria-hidden":`true`,className:`pkt-visually-hidden`})]})});cu.displayName=`PktDatepicker`;var lu={dropFilesHere:`Slipp filene her ...`,selectOrDragFiles:`Dra filer hit for å laste dem opp eller `,chooseFiles:`velg filer`},uu={dropFilesHere:`Slipp filen her ...`,selectOrDragFiles:`Dra en fil for å laste den opp eller `,chooseFiles:`velg en fil`},du={dropFilesHere:`Slipp bildene her ...`,selectOrDragFiles:`Dra bilder hit for å laste dem opp eller `,chooseFiles:`velg fra kamerarull`},fu={dropFilesHere:`Slipp bildet her ...`,selectOrDragFiles:`Dra et bilde for å laste det opp eller `,chooseFiles:`velg fra kamerarull`},pu=()=>(`00000000000000000`+(Math.random()*0x10000000000000000).toString(16)).slice(-16),mu=()=>{let e=pu(),t=pu();return e.slice(0,8)+`-`+e.slice(8,12)+`-4`+e.slice(13)+`-a`+t.slice(1,4)+`-`+t.slice(4)},hu=class{fileId;file;attributes={};constructor(e,t){this.fileId=t||mu(),this.file=e,this.attributes={targetFilename:e.name}}},gu=(0,t.createContext)({}),_u=`.PDF, .JPEG, .JPG, .PNG, .HEIC, .DOC, .DOCX, .ODT`,vu=(0,t.forwardRef)(({id:e,multiple:r,value:i,onFilesAdded:a=()=>{},name:o,uploadStrategy:s,accept:c,isThumbnailView:l=!1,disabled:u=!1,srAnnouncementIds:d,hasVisibleLabel:f=!1,...p},m)=>{let h=(0,t.useRef)(null),g=typeof c==`string`&&c.trim().length>0?c:void 0,_=(0,t.useMemo)(()=>g?g.split(/\s*,\s*/).map(e=>e.trim()).filter(Boolean).join(`, `).toUpperCase():_u,[g]);(0,t.useImperativeHandle)(m,()=>h.current);let[v,y]=(0,t.useState)(!1),b=(0,t.useMemo)(()=>l?r?du:fu:r?lu:uu,[r,l]),x=(0,t.useCallback)(e=>{if(h.current)try{h.current.files=yu(e)}catch{}},[h.current,i]);(0,t.useEffect)(()=>{x(i)},[h,i]);let S=(0,t.useCallback)(e=>{a(e.map(e=>new hu(e))),h.current&&(h.current.value=``)},[a]),C=e=>{let t=e.target.files;if(t.length===0){r&&x(i);return}S(Array.from(t))},w=e=>{S(e)};return(0,n.jsxs)(`div`,{onDrop:e=>{if(e.preventDefault(),y(!1),u)return;let t=e.dataTransfer.files;w(Array.from(t))},onDragOver:e=>{e.preventDefault(),!u&&y(!0)},onDragLeave:()=>{y(!1)},onClick:(0,t.useCallback)(e=>{u||e.target.closest(`.pkt-fileupload__drop-zone__placeholder__title__open-file-dialog`)||h.current?.click()},[u]),className:(0,$.default)(`pkt-fileupload__drop-zone`,{"pkt-fileupload__drop-zone--drag-active":v,"pkt-fileupload__drop-zone--disabled":u}),children:[(0,n.jsx)(`input`,{...p,id:e,type:`file`,ref:h,multiple:r,onChange:C,accept:g,disabled:u,name:s===`form`&&o||void 0,"aria-label":f?void 0:r?`Velg filer`:`Velg fil`}),s===`custom`&&(0,n.jsx)(n.Fragment,{children:i?.map(e=>(0,n.jsx)(`input`,{type:`hidden`,name:o,value:e.fileId},e.fileId))}),(0,n.jsxs)(`div`,{className:`pkt-fileupload__drop-zone__placeholder`,children:[(0,n.jsx)(Q,{name:`attachment`,className:`pkt-fileupload__drop-zone__placeholder__icon`,"aria-hidden":`true`}),(0,n.jsx)(`p`,{className:`pkt-fileupload__drop-zone__placeholder__title`,children:v?`${b.dropFilesHere} ...`:(0,n.jsxs)(n.Fragment,{children:[b.selectOrDragFiles,` `,(0,n.jsx)(`button`,{className:`pkt-fileupload__drop-zone__placeholder__title__open-file-dialog`,onClick:e=>{e.preventDefault(),e.stopPropagation(),h.current?.click()},type:`button`,children:b.chooseFiles})]})}),(0,n.jsxs)(`p`,{className:`pkt-fileupload__drop-zone__placeholder__formats`,children:[`Format: `,_]})]})]})}),yu=e=>{let t=new DataTransfer;for(let n of e)t.items.add(n.file);return t.files},bu=(0,t.forwardRef)(({id:e,ariaDescribedby:r,ariaLabelledby:i,counter:a,counterMaxLength:o,className:s,disabled:c,errorMessage:l,hasError:u,helptext:d,helptextDropdown:f,helptextDropdownButton:p,inline:m,fullwidth:h=!1,label:g,name:_,optionalTag:v=!1,optionalText:y,requiredTag:b=!1,requiredText:x,tagText:S=null,placeholder:C,rows:w,useWrapper:ee=!0,onChange:T,value:E,autoComplete:te=`off`,minLength:ne,maxLength:re,readOnly:D,skipForwardTestid:ie=!1,...ae},oe)=>{let se=[s,`pkt-textinput`,`pkt-textarea`].join(` `),ce=`${e}-input`,O=`${ce}-label`,le=i||O,[k,A]=(0,t.useState)(0),ue=e=>{a&&A(e.currentTarget?.value?.length||0),T&&T(e)};return(0,t.useEffect)(()=>{E!==void 0&&A(E?.length||0)},[E]),(0,n.jsx)(yl,{ariaDescribedby:r,className:se,disabled:c,errorMessage:l,forId:ce,hasError:u,helptext:d,helptextDropdown:f,helptextDropdownButton:p,inline:m,label:g,optionalTag:v,optionalText:y,requiredTag:b,requiredText:x,tagText:S,useWrapper:ee,counter:a,counterCurrent:k,counterMaxLength:o,children:(0,n.jsx)(`textarea`,{ref:oe,className:`pkt-input ${h?`pkt-input--fullwidth`:``} ${o&&k>o?`pkt-input--counter-error`:``}`,name:`${_||e}`,id:ce,placeholder:C,disabled:c,rows:w,"aria-labelledby":le,"aria-invalid":u,"aria-errormessage":`${e}-error`,...ae,onChange:ue,value:E,autoComplete:te,minLength:ne,maxLength:re,readOnly:D,"data-skip-forward-testid":ie?`true`:void 0})})});bu.displayName=`PktTextarea`;var xu=Symbol(`comment`),Su=e=>`${String(e.getDate()).padStart(2,`0`)}.${String(e.getMonth()+1).padStart(2,`0`)}.${e.getFullYear()} kl. ${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}`,Cu=({fileItem:e,closeOperationUi:r,onAddComment:i,existingComment:a})=>{let o=(0,t.useRef)(null),s=!!a;return(0,t.useLayoutEffect)(()=>{let e=setTimeout(()=>o.current?.focus({preventScroll:!0}),0);return()=>clearTimeout(e)},[e.fileId]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(bu,{autoFocus:!0,label:s?`Rediger kommentar`:`Legg til kommentar`,name:`comment-${e.fileId}`,className:`pkt-fileupload__queue-display__item__comment-input`,placeholder:`Skriv inn kommentar`,rows:2,id:`comment-${e.fileId}`,ref:o,defaultValue:a?.text}),(0,n.jsx)(es,{skin:`secondary`,size:`small`,onClick:()=>{let e=o.current?.value?.trim();e&&i({text:e,timestamp:new Date}),r()},children:s?`Lagre kommentar`:`Legg til kommentar`}),(0,n.jsx)(es,{skin:`tertiary`,size:`small`,onClick:r,children:`Avbryt`})]})},wu=({comments:e,onDeleteComment:t,onEditComment:r})=>e&&e.length>0?(0,n.jsx)(`div`,{className:`pkt-fileupload__queue-display__item__comments`,children:e.map((e,i)=>(0,n.jsxs)(`div`,{className:`pkt-fileupload__queue-display__item__comment`,children:[(0,n.jsxs)(`div`,{className:`pkt-fileupload__queue-display__item__comment__content`,children:[(0,n.jsx)(`span`,{className:`pkt-fileupload__queue-display__item__comment__text`,"aria-label":`Kommentar tekst`,children:e.text}),(0,n.jsx)(`time`,{className:`pkt-fileupload__queue-display__item__comment__time`,children:Su(e.timestamp)})]}),(0,n.jsxs)(`div`,{className:`pkt-fileupload__queue-display__item__comment__actions`,children:[t&&(0,n.jsx)(`button`,{type:`button`,className:`pkt-fileupload__queue-display__item__comment__action`,onClick:()=>t(i),"aria-label":`Slett kommentar`,children:(0,n.jsx)(Q,{name:`trash-can`})}),r&&(0,n.jsx)(`button`,{type:`button`,className:`pkt-fileupload__queue-display__item__comment__action`,onClick:()=>r(i),"aria-label":`Rediger kommentar`,children:(0,n.jsx)(Q,{name:`edit`})})]})]},i))}):null,Tu=e=>(0,n.jsx)(`input`,{type:`hidden`,name:`${(0,t.useContext)(gu).name}-comments`,value:e.comments?JSON.stringify(e.comments):``}),Eu=e=>{let t=e(`comments`),r=(e,n)=>{t.set(e,[n])},i=(e,n)=>{let r=(t.get(e)||[]).filter((e,t)=>t!==n);t.set(e,r.length>0?r:void 0)};return{title:e=>{let n=t.get(e.fileId);return n&&n.length>0?``:`Legg til kommentar`},renderExtendedUI:(e,i)=>{let a=t.get(e.fileId)?.[0];return(0,n.jsx)(Cu,{fileItem:e,closeOperationUi:i,onAddComment:t=>r(e.fileId,t),existingComment:a})},renderContent:(e,r,a)=>a?null:(0,n.jsx)(wu,{comments:t.get(e.fileId),onDeleteComment:t=>i(e.fileId,t),onEditComment:r?()=>r():void 0}),renderHidden:e=>(0,n.jsx)(Tu,{comments:t.get(e.fileId)},`comments${e.fileId}`),symbol:xu}},Du=Symbol(`deleteFile`),Ou=e=>({title:`Slett`,ariaLabel:`Slett fil`,onClick:t=>e(t.fileId),symbol:Du}),ku=Symbol(`renameFile`),Au=e=>{let r=(0,t.useRef)(null),i=(0,t.useId)(),a=()=>{e.onSave(r.current?.value??``)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`label`,{htmlFor:i,className:`pkt-sr-only`,children:`Endre filnavn`}),(0,n.jsx)(`input`,{id:i,ref:r,type:`text`,autoFocus:!0,defaultValue:e.value,className:`pkt-fileupload__queue-display__item__rename-input`,onKeyDown:t=>{t.key===`Enter`&&(t.preventDefault(),t.stopPropagation(),a()),t.key===`Escape`&&(t.preventDefault(),t.stopPropagation(),e.onCancel())}}),(0,n.jsx)(es,{skin:`secondary`,size:`small`,onClick:()=>e.onSave(r.current.value),children:`Lagre`}),(0,n.jsx)(es,{skin:`tertiary`,size:`small`,onClick:e.onCancel,children:`Avbryt`})]})},ju=e=>(0,n.jsx)(`input`,{type:`hidden`,name:`${(0,t.useContext)(gu).name}-targetFilename`,value:e.targetFilename}),Mu=e=>{let t=e(`targetFilename`);return{title:`Rediger`,ariaLabel:`Rediger filnavn`,renderInlineUI:(e,r)=>(0,n.jsx)(Au,{value:t.get(e.fileId)||void 0,onSave:n=>{t.set(e.fileId,n),r()},onCancel:r}),renderHidden:e=>(0,n.jsx)(ju,{targetFilename:t.get(e.fileId)||e.file.name},`rename${e.fileId}`),symbol:ku}},Nu=(e,n)=>{let r=(0,t.useCallback)((t,r,i)=>{let a=e.find(e=>e.fileId===t);a.attributes={...a.attributes||{},[r]:i},n(t,{attributes:a.attributes})},[n,e]),i=(0,t.useCallback)((t,n)=>(e.find(e=>e.fileId===t).attributes||{})[n],[e]);return{fileAttributes:(0,t.useCallback)(e=>({get:t=>i(t,e),set:(t,n)=>{r(t,e,n)}}),[i,r])}},Pu=e=>{let[n,r]=(0,t.useState)(!1),[i,a]=(0,t.useState)(0),o=(0,t.useRef)(null);return{isOpen:n,currentIndex:i,modalRef:o,open:(0,t.useCallback)(t=>{let n=e.findIndex(e=>e.fileId===t);n>=0&&(a(n),r(!0),o.current?.showModal())},[e]),close:(0,t.useCallback)(()=>{r(!1),o.current?.close()},[]),navigate:(0,t.useCallback)(t=>{e.length!==0&&a(n=>t===`prev`?n<=0?e.length-1:n-1:n>=e.length-1?0:n+1)},[e.length])}},Fu=e=>{let[n,r]=(0,t.useState)({});return{getActivated:(0,t.useCallback)(t=>{let r=n[t];if(r)return e.find(e=>e.symbol===r)},[n,e]),activate:(0,t.useCallback)((e,t)=>{r(n=>({...n,[e]:t.symbol}))},[]),close:(0,t.useCallback)(e=>{r(t=>{let n={...t};return delete n[e],n})},[])}},Iu=(0,t.forwardRef)(({children:e,className:r,open:i=!1,headingText:a=``,hideCloseButton:o=!1,closeOnBackdropClick:s=!1,size:c=`medium`,removePadding:l=!1,closeButtonSkin:u=`blue`,variant:d=`dialog`,drawerPosition:f=`right`,transparentBackdrop:p=!1,onClose:m,...h},g)=>{let _=(0,t.useRef)(null),v=g||_,y=(0,t.useCallback)(()=>{v.current?.open&&(v.current?.close(),m?.())},[v,m]);(0,t.useEffect)(()=>{let e=v.current;if(!e)return;let t=new MutationObserver(()=>{e.open?document.body.classList.add(`pkt-modal--open`):document.body.classList.remove(`pkt-modal--open`)});return t.observe(e,{attributes:!0,attributeFilter:[`open`]}),()=>t.disconnect()},[v]),(0,t.useEffect)(()=>{i?v.current?.open||v.current?.showModal():v.current?.open&&v.current?.close()},[i,v]);let b=(0,t.useCallback)(e=>{s&&e.target===v.current&&y()},[s,v,y]),x=(0,t.useCallback)(()=>{m?.()},[m]),S=u===`blue`,C=(0,$.default)({"pkt-modal":!0,"pkt-modal--removePadding":l,"pkt-modal--noHeadingText":!a,"pkt-modal--noShadow":u===`yellow-filled`,"pkt-modal--transparentBackdrop":p,[`pkt-modal--${c}`]:c,[`pkt-modal__${d}`]:d,[`pkt-modal__drawer--${f}`]:d===`drawer`},r);return(0,n.jsx)(`dialog`,{...h,className:C,ref:v,"aria-labelledby":a?`pkt-modal__headingText`:void 0,"aria-describedby":`pkt-modal__content`,onClick:b,onClose:x,children:(0,n.jsxs)(`div`,{className:`pkt-modal__wrapper`,children:[(a||!o)&&(0,n.jsxs)(`div`,{className:`pkt-modal__header`,children:[(0,n.jsx)(`div`,{className:`pkt-modal__header-background`}),a?(0,n.jsx)(`h1`,{id:`pkt-modal__headingText`,className:`pkt-modal__headingText pkt-txt-24`,children:a}):(0,n.jsx)(`div`,{className:`pkt-modal__headingText`}),o?(0,n.jsx)(`div`,{className:`pkt-modal__noCloseButton`}):(0,n.jsx)(`div`,{className:(0,$.default)(`pkt-modal__closeButton`,{[`pkt-modal__closeButton--${u}`]:!0}),children:(0,n.jsx)(es,{onClick:y,"aria-label":`close`,iconName:`close`,variant:`icon-only`,size:`medium`,skin:S?`tertiary`:`primary`,children:`Lukk`})})]}),(0,n.jsx)(`div`,{className:`pkt-modal__container`,children:(0,n.jsx)(`div`,{id:`pkt-modal__content`,className:`pkt-modal__content pkt-txt-18-light`,children:e})})]})})});Iu.displayName=`PktModal`;var Lu=2,Ru=e=>{let t=window.getComputedStyle(e),n=parseFloat(t.lineHeight);if(!Number.isNaN(n)&&n>0)return n;let r=parseFloat(t.fontSize);return(!Number.isNaN(r)&&r>0?r:16)*1.2},zu=(e,t,n)=>{let r=t*n;return e.getBoundingClientRect().height>r+.5},Bu=(0,t.createContext)({tail:5}),Vu=({children:e,tail:r,...i})=>{let a=e,o=(0,t.useContext)(Bu),s=r===void 0?o.tail||0:r,c=e.length<=s+3?null:e.slice(-s),l=(0,t.useRef)(null),u=(0,t.useRef)(null),[d,f]=(0,t.useState)(!1),p=(0,t.useCallback)(()=>{let e=l.current,t=u.current;!e||!t||f(zu(t,Ru(e),Lu))},[]),m=(0,t.useMemo)(()=>new ResizeObserver(e=>{e.some(e=>e.target===l.current)&&p()}),[p]);return(0,t.useLayoutEffect)(()=>(l.current&&m.observe(l.current),p(),()=>m.disconnect()),[e,m,p]),(0,n.jsxs)(`span`,{ref:l,...i,"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`,...i.style},children:[(0,n.jsx)(`span`,{"data-pkt-truncate-part":`first`,style:{minWidth:0,display:`-webkit-box`,WebkitBoxOrient:`vertical`,WebkitLineClamp:Lu,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`normal`,overflowWrap:`anywhere`},children:a}),s!==0&&(0,n.jsx)(`span`,{"data-pkt-truncate-part":`tail`,style:{whiteSpace:`nowrap`,display:d?`inline`:`none`,paddingRight:`0.5rem`},"aria-hidden":!0,children:c}),(0,n.jsx)(`span`,{ref:u,"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:e})]})},Hu=e=>{if(typeof e==`number`)return e;let t=e.trim().match(/^(\d+(?:\.\d+)?)\s*(B|KB|MB|GB)$/i);if(!t)return console.warn(`PktFileUpload: Invalid maxFileSize format "${e}". Use format like "5MB", "500KB", or a number in bytes.`),0;let n=parseFloat(t[1]);switch(t[2].toUpperCase()){case`B`:return n;case`KB`:return n*1024;case`MB`:return n*1024*1024;case`GB`:return n*1024*1024*1024;default:return n}},Uu=e=>e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:e<1024*1024*1024?`${Math.round(e/(1024*1024))} MB`:`${Math.round(e/(1024*1024*1024))} GB`,Wu=e=>(0,n.jsx)(`button`,{onClick:e.onClick,className:`pkt-fileupload__queue-display__item__cancel-button`,"aria-label":e.ariaLabel||`Avbryt opplasting`,children:e.label||`Avbryt`}),Gu=()=>{let[e,r]=(0,t.useState)(1);return(0,t.useEffect)(()=>{let e=setInterval(()=>{r(e=>e>=3?1:e+1)},400);return()=>clearInterval(e)},[]),(0,n.jsxs)(`span`,{className:`pkt-fileupload__queue-display__item__loading-text`,"aria-label":`Laster opp fil`,children:[`Laster opp`,`.`.repeat(e)]})},Ku=({cancelTransfer:e,transferItem:t})=>{let r=t.showProgress??t.progress!==0;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Q,{name:`document-text`,className:`pkt-fileupload__queue-display__item__icon pkt-icon--medium`,"aria-hidden":`true`}),(0,n.jsx)(`p`,{className:`pkt-fileupload__queue-display__item__title`,"aria-label":`Filnavn`,children:(0,n.jsx)(Vu,{children:t.attributes.targetFilename})}),(0,n.jsx)(Wu,{onClick:e}),r?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Fd,{valueCurrent:t.progress*100,statusType:`none`,valueMax:100,statusPlacement:`following`,className:`pkt-fileupload__queue-display__item__progress`}),(0,n.jsx)(`span`,{className:`pkt-fileupload__queue-display__item__filesize`,children:Uu(t.file.size)}),(0,n.jsx)(`span`,{className:`pkt-fileupload__queue-display__item__percentage`,"aria-hidden":`true`,children:`${Math.round(t.progress*100)}%`})]}):(0,n.jsx)(Gu,{})]})},qu=({transferItem:e,onRemove:t})=>{let r=(e.lastProgress??1)*100;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Q,{className:`pkt-fileupload__queue-display__item__icon pkt-icon--medium`,name:`alert-error`,"aria-hidden":`true`}),(0,n.jsx)(`p`,{className:`pkt-fileupload__queue-display__item__title`,children:(0,n.jsx)(Vu,{children:e.attributes.targetFilename})}),(0,n.jsx)(Wu,{onClick:t,label:`Fjern`,ariaLabel:`Fjern fil som feilet under opplasting`}),(0,n.jsx)(Fd,{valueCurrent:r,statusType:`none`,valueMax:100,statusPlacement:`following`,className:`pkt-fileupload__queue-display__item__progress pkt-fileupload__queue-display__item__progress--error`}),(0,n.jsx)(`span`,{className:`pkt-fileupload__queue-display__item__filesize`,children:Uu(e.file.size)}),e.errorMessage&&(0,n.jsx)(`span`,{className:`pkt-fileupload__queue-display__item__error-message`,children:e.errorMessage})]})},Ju=({transferItem:e,onRemove:t})=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Q,{className:`pkt-fileupload__queue-display__item__icon pkt-icon--medium`,name:`alert-error`,"aria-hidden":`true`}),(0,n.jsx)(`p`,{className:`pkt-fileupload__queue-display__item__title`,children:(0,n.jsx)(Vu,{children:e.attributes.targetFilename})}),(0,n.jsx)(Wu,{onClick:t,label:`Fjern`,ariaLabel:`Fjern fil som feilet under opplasting`}),e.errorMessage&&(0,n.jsx)(`span`,{className:`pkt-fileupload__queue-display__item__error-message`,children:e.errorMessage})]}),Yu=({transferItem:e,onRemove:t})=>e.showProgress?(0,n.jsx)(qu,{transferItem:e,onRemove:t}):(0,n.jsx)(Ju,{transferItem:e,onRemove:t}),Xu=({operation:e,onActivate:t,transferItem:r})=>{let i=typeof e.title==`function`?e.title(r):e.title;return i?(0,n.jsx)(`button`,{type:`button`,className:`pkt-fileupload__queue-display__item__operation`,onClick:()=>{(e.renderInlineUI||e.renderExtendedUI)&&t(r.fileId,e),e.onClick&&e.onClick(r)},"aria-label":typeof e.ariaLabel==`function`?e.ariaLabel(r):e.ariaLabel,children:i}):null},Zu=({transferItem:e})=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Q,{name:`document-text`,className:`pkt-fileupload__queue-display__item__icon pkt-icon--medium`,"aria-hidden":`true`}),(0,n.jsx)(`p`,{className:`pkt-fileupload__queue-display__item__title`,children:(0,n.jsx)(Vu,{children:e.attributes.targetFilename})}),(0,n.jsx)(`span`,{className:`pkt-fileupload__queue-display__item__filesize`,children:Uu(e.file.size)})]}),Qu=({transferItem:e,onPreviewClick:r})=>{let[i,a]=(0,t.useState)(null),[o,s]=(0,t.useState)(!1),c=e.file;(0,t.useEffect)(()=>{if(s(!1),c.type.startsWith(`image/`)){let e=URL.createObjectURL(c);return a(e),()=>{URL.revokeObjectURL(e)}}a(null)},[c]);let l=i&&!o&&(0,n.jsx)(`img`,{src:i,alt:e.attributes.targetFilename,onError:()=>s(!0)})||(0,n.jsx)(Q,{name:`document-text`,className:`pkt-fileupload__queue-display__item__icon pkt-icon--medium`}),u=!!r;return(0,n.jsxs)(`div`,{className:`pkt-fileupload__queue-display__item__thumbnail${i&&!o?``:` pkt-fileupload__queue-display__item__thumbnail--fallback`}`,children:[(0,n.jsxs)(es,{className:`pkt-fileupload__queue-display__item__thumbnail__image-wrapper`,"aria-label":`Forhåndsvis bilde ${e.attributes.targetFilename}`,type:`button`,skin:`secondary`,onClick:r,children:[u&&(0,n.jsx)(Q,{name:`expand`,className:`pkt-fileupload__queue-display__item__thumbnail__expand-icon`,"aria-hidden":`true`}),l]}),(0,n.jsx)(Vu,{className:`pkt-fileupload__queue-display__item__thumbnail__title`,children:e.attributes.targetFilename})]})},$u=(0,t.forwardRef)(({isOpen:e,images:r,currentIndex:i,onClose:a,onNavigate:o},s)=>{let[c,l]=(0,t.useState)(null),[u,d]=(0,t.useState)(!1),f=r[i],p=r.length>1;return(0,t.useEffect)(()=>{if(d(!1),f&&f.file.type.startsWith(`image/`)){let e=URL.createObjectURL(f.file);return l(e),()=>URL.revokeObjectURL(e)}l(null)},[f]),(0,t.useEffect)(()=>{if(!e)return;let t=e=>{switch(e.key){case`ArrowLeft`:e.preventDefault(),o(`prev`);break;case`ArrowRight`:e.preventDefault(),o(`next`);break;case`Escape`:e.preventDefault(),a();break}};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,o,a]),f?(0,n.jsx)(Iu,{ref:s,headingText:f.attributes.targetFilename,closeOnBackdropClick:!0,className:`pkt-fileupload__image-preview-modal`,children:(0,n.jsxs)(`div`,{className:`pkt-fileupload__image-preview`,children:[p&&(0,n.jsx)(es,{variant:`icon-only`,iconName:`chevron-thin-left`,skin:`secondary`,size:`small`,className:`pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--prev`,onClick:()=>o(`prev`),"aria-label":`Forrige bilde ${i} / ${r.length}`}),(0,n.jsx)(`div`,{className:`pkt-fileupload__image-preview__content`,children:c&&!u?(0,n.jsx)(`img`,{src:c,alt:`${f.attributes.targetFilename} - ${i+1} av ${r.length}`,className:`pkt-fileupload__image-preview__image`,onError:()=>d(!0)}):(0,n.jsx)(Q,{name:`picture`,className:`pkt-fileupload__queue-display__item__icon pkt-icon--medium`})}),p&&(0,n.jsxs)(`span`,{className:`pkt-fileupload__image-preview__counter`,children:[i+1,` / `,r.length]}),p&&(0,n.jsx)(es,{variant:`icon-only`,iconName:`chevron-thin-right`,skin:`secondary`,size:`small`,className:`pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--next`,onClick:()=>o(`next`),"aria-label":`Neste bilde ${i+2} / ${r.length}`})]})}):null});$u.displayName=`ImagePreviewModal`;var ed=e=>e.file.type?.startsWith(`image/`)?!0:/\.(jpe?g|png|gif|webp|heic|heif|bmp|svg)$/i.test(e.file.name||``),td=e=>typeof e==`number`?`in-progress`:e===`error`?`error`:`idle`,nd=({operations:e,activatedOperation:t,onActivate:r,transferItem:i})=>(0,n.jsx)(`div`,{className:`pkt-fileupload__queue-display__item__actions`,children:e.filter(e=>!t||e.symbol!==t.symbol).map(e=>(0,n.jsx)(Xu,{operation:e,onActivate:r,transferItem:i},e.symbol.toString()))}),rd=({operations:e,activatedOperation:t,onActivate:r,transferItem:i})=>(0,n.jsx)(n.Fragment,{children:e.filter(e=>e.renderContent).map(e=>(0,n.jsx)(`div`,{className:`pkt-fileupload__queue-display__item__operation-content`,children:e.renderContent(i,()=>r(i.fileId,e),t?.symbol===e.symbol)},e.symbol.toString()))}),id=({transferItem:e,activatedOperation:t,operations:r,ItemRenderer:i,onActivate:a,onClose:o,onPreviewClick:s})=>{let c=()=>o(e.fileId),l=t?.renderInlineUI||t?.renderExtendedUI?[]:r;return(0,n.jsxs)(n.Fragment,{children:[t?.renderInlineUI?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Q,{name:`document-text`,className:`pkt-fileupload__queue-display__item__icon`}),(0,n.jsx)(`div`,{className:`pkt-fileupload__queue-display__item__inline-ui`,children:t.renderInlineUI(e,c)})]}):(0,n.jsx)(i,{transferItem:e,queueItemOperations:r,onPreviewClick:s}),l.length>0&&(0,n.jsx)(nd,{operations:l,activatedOperation:t,onActivate:a,transferItem:e}),(0,n.jsx)(rd,{operations:r,activatedOperation:t,onActivate:a,transferItem:e}),t?.renderExtendedUI&&(0,n.jsx)(`div`,{className:`pkt-fileupload__queue-display__item__expanded-operation-ui`,children:t.renderExtendedUI(e,c)})]})},ad=({transferItem:e,activatedOperation:t,operations:r,ItemRenderer:i,enableImagePreview:a,onActivate:o,onClose:s,onCancelTransfer:c,onOpenPreview:l})=>{let u=td(e.progress),d=a&&e.progress===`done`&&ed(e);switch(u){case`in-progress`:return(0,n.jsx)(Ku,{"aria-live":`off`,transferItem:e,cancelTransfer:()=>c(e.fileId)});case`error`:return(0,n.jsx)(Yu,{transferItem:e,onRemove:()=>c(e.fileId)});case`idle`:return(0,n.jsx)(id,{transferItem:e,activatedOperation:t,operations:r,ItemRenderer:i,onActivate:o,onClose:s,onPreviewClick:d?()=>l(e.fileId):void 0})}},od=e=>e.file.type?.startsWith(`image/`)?!0:/\.(jpe?g|png|gif|webp|heic|heif|bmp|svg)$/i.test(e.file.name||``),sd=(e,n,r)=>(0,t.useMemo)(()=>{let t=e.map(e=>{let t=n.find(t=>t.fileId===e.fileId);return{...e,progress:t?.progress??(r===`form`?`done`:`queued`),errorMessage:t?.errorMessage,showProgress:t?.showProgress,lastProgress:t?.lastProgress}}),i={"in-progress":0,error:1,idle:2};return t.sort((e,t)=>i[td(e.progress)]-i[td(t.progress)])},[e,n,r]),cd=(e,n)=>(0,t.useMemo)(()=>n?e.filter(e=>e.progress===`done`&&od(e)):[],[e,n]),ld=({files:e,cancelTransfer:t,transfers:r=[],queueItemOperations:i=[],ItemRenderer:a=Zu,truncateTail:o,enableImagePreview:s=!1,uploadStrategy:c=`form`})=>{let l=sd(e,r,c),u=cd(l,s),d=Fu(i),f=Pu(u);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`ul`,{className:`pkt-fileupload__queue-display`,children:(0,n.jsx)(Bu.Provider,{value:{tail:o},children:l.map(e=>(0,n.jsxs)(`li`,{className:(0,$.default)(`pkt-fileupload__queue-display__item`,{"pkt-fileupload__queue-display__item--in-progress":typeof e.progress==`number`,[`pkt-fileupload__queue-display__item--${e.progress}`]:typeof e.progress==`string`}),children:[i.filter(e=>e.renderHidden).map(t=>t.renderHidden(e)),(0,n.jsx)(ad,{transferItem:e,activatedOperation:d.getActivated(e.fileId),operations:i,ItemRenderer:a,enableImagePreview:s,onActivate:d.activate,onClose:d.close,onCancelTransfer:t,onOpenPreview:f.open})]},e.fileId))})}),s&&u.length>0&&(0,n.jsx)($u,{ref:f.modalRef,isOpen:f.isOpen,images:u,currentIndex:f.currentIndex,onClose:f.close,onNavigate:f.navigate})]})},ud={filename:Zu,thumbnail:Qu},dd=(0,t.forwardRef)(({value:e,defaultValue:r,id:i,multiple:a=!1,uploadStrategy:o=`form`,addCommentsEnabled:s=!1,renameFilesEnabled:c=!1,truncateTail:l,onFilesChanged:u,onFileUploadRequested:d,extraOperations:f=[],itemRenderer:p=ud.filename,fullWidth:m=!1,allowedFormats:h,formatErrorMessage:g,maxFileSize:_,sizeErrorMessage:v,onFileValidation:y,errorMessage:b,hasError:x=!1,disabled:S=!1,label:C,helptext:w,optionalTag:ee,requiredTag:T,required:E=!1,enableImagePreview:te=!1,"aria-describedby":ne,"aria-invalid":re,...D},ie)=>{let ae=(0,t.useId)(),oe=i??`pkt-fileupload-${ae}`,se=(0,t.useRef)(null);(0,t.useImperativeHandle)(ie,()=>se.current,[]);let ce=`transfers`in D?D.transfers:void 0,[O,le]=(0,t.useState)(null),k=x||!!O,A=b||O,ue=A?`${oe}-error`:void 0,de=[ne,w?`${oe}-helptext`:void 0,ue].filter(Boolean).join(` `)||void 0,j=k||re===!0||re===`true`,M=_?Hu(_):void 0,N=(0,t.useCallback)(e=>{if(h&&h.length>0){let t=e.name.split(`.`).pop()?.toLowerCase()||``,n=e.type.toLowerCase();if(!h.some(e=>{let r=e.toLowerCase().replace(/^\./,``);if(r.includes(`/`)){if(r.endsWith(`/*`)){let e=r.replace(`/*`,``);return n.startsWith(e+`/`)}return n===r}return t===r})){let e=h.join(`, `),t=`Ugyldig filtype. Tillatte formater: ${e}`;return g?.replace(`{formats}`,e)||t}}if(M&&e.size>M){let e=Uu(M),t=`Filen er for stor. Maks størrelse er ${e}.`;return v?.replace(`{maxSize}`,e)||t}return y?y(e):null},[h,g,M,v,y]);e!==void 0&&r!==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`),e!==void 0&&u===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`);let P=e===void 0?r||[]:e;(0,t.useEffect)(()=>{if(o!==`custom`||!E)return;let e=se.current?.form;if(!e)return;let t=e=>{P.length>0||(e.preventDefault(),le(`Velg minst én fil før du sender inn skjemaet.`))};return e.addEventListener(`submit`,t),()=>{e.removeEventListener(`submit`,t)}},[E,o,P.length]);let F=typeof p==`string`?ud[p]:p,I=p===`thumbnail`,fe=typeof D.accept==`string`?D.accept.trim():void 0,pe=(0,t.useMemo)(()=>{if(!(!h||h.length===0))return h.map(e=>e.trim()).filter(Boolean).map(e=>{let t=e.toLowerCase();return t.includes(`/`)||t.startsWith(`.`)?t:`.${t}`}).join(`, `)},[h]),L=fe||pe,R=c&&!I,me=s&&!I,he=(0,t.useCallback)(e=>{for(let t of e){let e=N(t.file);if(e){le(e);return}}le(null);let t=a?[...P,...e]:[e[0]];u&&u(t),o===`custom`&&d&&e.forEach(e=>{d?.(e)})},[u,P,a,o,d,N]),z=(0,t.useCallback)((e,t)=>{let n=P.map(n=>n.fileId===e?{...n,...t}:n);u&&u(n)},[u,P]),B=(0,t.useCallback)(e=>{let t=P.filter(t=>t.fileId!==e);u&&u(t),`onTransferCancelled`in D&&D.onTransferCancelled&&D.onTransferCancelled?.(e)},[u,P,D]),{fileAttributes:V}=Nu(P,z),ge=(0,t.useMemo)(()=>[{op:Mu,enabled:R},{op:e=>Eu(e),enabled:me}].filter(({enabled:e})=>e).map(({op:e})=>e).concat(...f),[R,me]),H=(0,t.useMemo)(()=>({uploaded:`${oe}-uploaded`,errors:`${oe}-errors`}),[oe]),{totalCount:_e,uploadedCount:ve,failedCount:U}=(0,t.useMemo)(()=>{let e=P.length;if(!ce)return{totalCount:e,uploadedCount:0,failedCount:0};let t=0,n=0;for(let e of P){let r=ce.find(t=>t.fileId===e.fileId);r?.progress===`done`&&t++,r?.progress===`error`&&n++}return{totalCount:e,uploadedCount:t,failedCount:n}},[P,ce]),ye=_e===1?`fil`:`filer`,be=(0,n.jsx)(`div`,{className:(0,$.default)(`pkt-fileupload`,{"pkt-fileupload--full-width":m,"pkt-fileupload--error":k,"pkt-fileupload--disabled":S}),"aria-disabled":S,...S?{inert:``}:{},children:(0,n.jsxs)(gu.Provider,{value:{name:D.name||``,multiple:!!a,id:oe},children:[(0,n.jsx)(`div`,{id:H.uploaded,className:`pkt-sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:_e>0&&ve>0&&`${ve} av ${_e} ${ye} lastet opp`}),(0,n.jsx)(`div`,{id:H.errors,className:`pkt-sr-only`,"aria-live":`assertive`,"aria-atomic":`true`,children:_e>0&&U>0&&`Feil ved opplasting: ${U} av ${_e} ${ye} feilet`}),(0,n.jsx)(vu,{id:oe,name:D.name||``,value:P,onFilesAdded:he,multiple:a,uploadStrategy:o,ref:se,accept:I?`.jpeg, .jpg, .png, .gif, .webp, .heic`:L,isThumbnailView:I,disabled:S,srAnnouncementIds:H,required:E&&o===`form`,"aria-required":E?`true`:void 0,"aria-invalid":j?`true`:void 0,"aria-describedby":de,hasVisibleLabel:!!C}),k&&A&&(0,n.jsx)(Zo,{skin:`error`,"aria-live":`assertive`,role:`alert`,compact:!0,id:ue,className:`pkt-fileupload__error-alert`,children:A}),(0,n.jsx)(ld,{files:P,cancelTransfer:B,truncateTail:l,transfers:ce,uploadStrategy:o,ItemRenderer:F,enableImagePreview:I&&te,queueItemOperations:ge.map(e=>e(V)).concat(Ou(B))})]})});return C?(0,n.jsx)(yl,{forId:oe,label:C,helptext:w,disabled:S,hasError:k,optionalTag:ee,requiredTag:T,className:(0,$.default)(`pkt-fileupload-wrapper`,{"pkt-fileupload-wrapper--full-width":m}),children:be}):be});dd.displayName=`PktFileUpload`;var fd=({columnOne:e,columnTwo:r,socialLinks:i,className:a,openLinksInNewTab:o=!1,personvernOgInfoLink:s=`https://www.oslo.kommune.no/personvern-og-informasjonskapsler/`,tilgjengelighetLink:c=`https://www.oslo.kommune.no/tilgjengelighet/`,includeConsent:l=!1,hotjarId:u=null,googleAnalyticsId:d=null,devMode:f=!1,cookieDomain:p=null,cookieSecure:m=null,cookieExpiryDays:h=null,onToggleConsent:g=e=>{console.log(e.detail)}})=>(0,n.jsx)(`footer`,{className:[a,`pkt-footer`].filter(Boolean).join(` `),"data-mode":`dark`,children:(0,n.jsxs)(`div`,{className:`pkt-footer__container`,children:[(0,n.jsxs)(`div`,{className:`pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16`,children:[(0,n.jsxs)(`div`,{className:`pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up`,children:[(0,n.jsx)(`h2`,{className:`pkt-footer__title`,children:e.title}),(0,n.jsxs)(`ul`,{className:`pkt-footer__list`,children:[e.text&&(0,n.jsx)(`li`,{className:`pkt-footer__text`,children:e.text}),e.links?.map((e,t)=>(0,n.jsx)(`li`,{className:`pkt-footer__list-item`,children:(0,n.jsxs)(`a`,{className:`pkt-footer__link ${e.external?`pkt-link--external`:``}`,href:e.href,target:e.openInNewTab||o?`_blank`:`_self`,rel:e.openInNewTab||o?`noopener noreferrer`:void 0,children:[(0,n.jsx)(Q,{className:`pkt-footer__link-icon`,name:`chevron-right`}),e.text]})},`links-${t}`))]})]}),(0,n.jsxs)(`div`,{className:`pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up`,children:[(0,n.jsx)(`h2`,{className:`pkt-footer__title`,children:r.title}),(0,n.jsxs)(`ul`,{className:`pkt-footer__list`,children:[r.text&&(0,n.jsx)(`li`,{className:`pkt-footer__text`,children:r.text}),r.links?.map((e,t)=>(0,n.jsx)(`li`,{className:`pkt-footer__list-item`,children:(0,n.jsxs)(`a`,{className:`pkt-footer__link ${e.external?`pkt-link--external`:``}`,href:e.href,target:e.openInNewTab||o?`_blank`:`_self`,rel:e.openInNewTab||o?`noopener noreferrer`:void 0,children:[(0,n.jsx)(Q,{className:`pkt-footer__link-icon`,name:`chevron-right`}),e.text]})},`links-${t}`))]})]}),(0,n.jsxs)(`div`,{className:`pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up`,children:[(0,n.jsx)(`h2`,{className:`pkt-footer__title`,children:`Om nettstedet`}),(0,n.jsxs)(`ul`,{className:`pkt-footer__list`,children:[(0,n.jsx)(`li`,{className:`pkt-footer__list-item`,children:(0,n.jsxs)(`a`,{className:`pkt-footer__link`,href:s,target:o?`_blank`:`_self`,rel:o?`noopener noreferrer`:void 0,children:[(0,n.jsx)(Q,{className:`pkt-footer__link-icon`,name:`chevron-right`}),`Personvern og informasjonskapsler`]})}),(0,n.jsx)(`li`,{className:`pkt-footer__list-item`,children:(0,n.jsxs)(`a`,{className:`pkt-footer__link`,href:c,target:o?`_blank`:`_self`,rel:o?`noopener noreferrer`:void 0,children:[(0,n.jsx)(Q,{className:`pkt-footer__link-icon`,name:`chevron-right`}),`Tilgjengelighet`]})}),l&&(0,n.jsx)(`li`,{className:`pkt-footer__list-item`,children:(0,n.jsx)(Gl,{triggerType:`footerlink`,hotjarId:u,googleAnalyticsId:d,devMode:f,cookieDomain:p,cookieSecure:m,cookieExpiryDays:h,onToggleConsent:g})})]})]})]}),i&&(0,n.jsxs)(`div`,{className:`pkt-footer__social`,"aria-label":`standard lenker`,children:[(0,n.jsx)(`div`,{className:`pkt-footer__social-languages`,children:i.filter(e=>e.language).map((e,t)=>(0,n.jsx)(`div`,{className:`pkt-footer__social-language`,children:(0,n.jsx)(`a`,{href:e.href,"aria-label":`til ${e.language} versjon av nettsiden`,target:e.openInNewTab||o?`_blank`:`_self`,rel:e.openInNewTab||o?`noopener noreferrer`:void 0,children:e.language})},`sociallinks-language-${t}`))}),(0,n.jsx)(`div`,{className:`pkt-footer__social-icons`,children:i.filter(e=>e.iconName).map((e,r)=>(0,n.jsx)(t.Fragment,{children:(0,n.jsx)(`a`,{href:e.href,"aria-label":`til ${e.iconName}`,className:`pkt-footer__social-icon-link`,target:e.openInNewTab||o?`_blank`:`_self`,rel:e.openInNewTab||o?`noopener noreferrer`:void 0,children:(0,n.jsx)(Q,{className:`pkt-footer__social-icon`,name:e.iconName})})},`sociallinks-${r}`))})]})]})}),pd=({links:e=[],openLinksInNewTab:t=!1,personvernOgInfoLink:r=`https://www.oslo.kommune.no/personvern-og-informasjonskapsler/`,tilgjengelighetLink:i=`https://www.oslo.kommune.no/tilgjengelighet/`,includeConsent:a=!1,hotjarId:o=null,googleAnalyticsId:s=null,devMode:c=!1,cookieDomain:l=null,cookieSecure:u=null,cookieExpiryDays:d=null,onToggleConsent:f=e=>{console.log(e.detail)},className:p})=>(0,n.jsx)(`footer`,{className:[p,`pkt-footer-simple`].filter(Boolean).join(` `),"data-mode":`dark`,children:(0,n.jsx)(`div`,{className:`pkt-footer-simple__container`,children:(0,n.jsxs)(`ul`,{className:`pkt-footer-simple__list`,children:[e.map((e,r)=>(0,n.jsx)(`li`,{className:`pkt-footer-simple__list-item`,children:(0,n.jsxs)(`a`,{className:`pkt-footer-simple__link ${e.external?` pkt-link--external`:``}`,href:e.href,target:e.openInNewTab||t?`_blank`:`_self`,rel:e.openInNewTab||t?`noopener noreferrer`:void 0,children:[(0,n.jsx)(Q,{className:`pkt-footer-simple__link-icon`,name:`chevron-right`}),e.text]})},r)),(0,n.jsx)(`li`,{className:`pkt-footer-simple__list-item`,children:(0,n.jsxs)(`a`,{className:`pkt-footer-simple__link`,href:r,target:t?`_blank`:`_self`,rel:t?`noopener noreferrer`:void 0,children:[(0,n.jsx)(Q,{className:`pkt-footer-simple__link-icon`,name:`chevron-right`}),`Personvern og informasjonskapsler`]})}),(0,n.jsx)(`li`,{className:`pkt-footer-simple__list-item`,children:(0,n.jsxs)(`a`,{className:`pkt-footer-simple__link`,href:i,target:t?`_blank`:`_self`,rel:t?`noopener noreferrer`:void 0,children:[(0,n.jsx)(Q,{className:`pkt-footer-simple__link-icon`,name:`chevron-right`}),`Tilgjengelighet`]})}),a&&(0,n.jsx)(`li`,{className:`pkt-footer-simple__list-item`,children:(0,n.jsx)(Gl,{triggerType:`footerlink`,hotjarId:o,googleAnalyticsId:s,devMode:c,cookieDomain:l,cookieSecure:u,cookieExpiryDays:d,onToggleConsent:f})})]})})}),md=(e,n)=>{let[r,i]=(0,t.useState)(()=>typeof window>`u`?n??0:n??window.innerWidth);return(0,t.useEffect)(()=>{let t=e.current;if(!t)return;if(i(t.offsetWidth),typeof ResizeObserver>`u`){let e=()=>{t&&i(t.offsetWidth)};return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)}let n=new ResizeObserver(e=>{for(let t of e)t.borderBoxSize&&t.borderBoxSize.length>0?i(t.borderBoxSize[0].inlineSize):i(t.contentRect.width)});return n.observe(t),()=>{n.disconnect()}},[e]),r};function hd(e){let n=(0,t.useRef)(0);(0,t.useEffect)(()=>{let t=document.body,r=document.documentElement;if(e){n.current=window.scrollY||window.pageYOffset;let e=window.innerWidth-r.clientWidth;e>0&&(t.style.paddingRight=`${e}px`),t.style.position=`fixed`,t.style.top=`-${n.current}px`,t.style.left=`0`,t.style.right=`0`,t.style.width=`100%`,t.style.overflow=`hidden`,r.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:n.current});return()=>{e&&(t.style.cssText=``,document.documentElement.classList.remove(`is-scroll-locked`),window.scrollTo({top:n.current}))}},[e])}var gd=({href:e,iconName:t,className:r,iconPosition:i,external:a,target:o,children:s,...c})=>{let l={"pkt-link":!0,"pkt-link--icon-left":!!t&&i===`left`||!!(t&&!i),"pkt-link--icon-right":!!t&&i===`right`,"pkt-link--external":a};return(0,n.jsxs)(`a`,{...c,className:(0,$.default)(l,r),href:e,target:o,rel:a?`noopener noreferrer`:void 0,children:[t&&(0,n.jsx)(Q,{name:t,className:`pkt-link__icon`}),s]})};gd.displayName=`PktLink`;var _d=e=>typeof e.target==`string`?{title:e.title,iconName:e.iconName,href:e.target}:{title:e.title,iconName:e.iconName,onClick:e.target},vd=({item:e,className:t})=>`href`in e?(0,n.jsx)(gd,{iconName:e.iconName,href:e.href,"aria-hidden":`true`,className:(0,$.default)(`pkt-user-menu__link`,t),children:e.title}):(0,n.jsxs)(`button`,{className:(0,$.default)(`pkt-user-menu__link pkt-link-button pkt-link pkt-link--icon-left`,t),type:`button`,onClick:()=>{`onClick`in e&&typeof e.onClick==`function`?e.onClick():console.error(`UserMenuButton item is missing onClick handler or onClick is not a function:`,e)},children:[e.iconName&&(0,n.jsx)(Q,{name:e.iconName,className:`pkt-link__icon`,"aria-hidden":`true`}),e.title]}),yd=({links:e})=>(0,n.jsx)(`ul`,{className:`pkt-user-menu__sublist`,children:e.map((e,t)=>(0,n.jsx)(`li`,{className:`pkt-user-menu__subitem`,children:(0,n.jsx)(vd,{item:e})},t))}),bd=(0,t.forwardRef)(({user:e,formattedLastLoggedIn:t,representing:r,userMenu:i,canChangeRepresentation:a,changeRepresentation:o,logoutOnClick:s},c)=>{let l=i?.map(_d);return(0,n.jsx)(`nav`,{className:`pkt-user-menu`,ref:c,"aria-label":`Meny for innlogget bruker`,children:(0,n.jsxs)(`ul`,{className:`pkt-user-menu__list`,children:[e&&(0,n.jsxs)(`li`,{className:`pkt-user-menu__item`,children:[(0,n.jsx)(`div`,{className:`pkt-user-menu__label`,children:`Pålogget som`}),(0,n.jsx)(`div`,{className:`pkt-user-menu__name`,translate:`no`,children:e.name}),t&&(0,n.jsxs)(`div`,{className:`pkt-user-menu__last-logged-in`,children:[`Sist pålogget: `,(0,n.jsx)(`time`,{children:t})]})]}),l&&l.length>0&&(0,n.jsx)(`li`,{className:`pkt-user-menu__item`,children:(0,n.jsx)(yd,{links:l})}),r&&(0,n.jsxs)(`li`,{className:`pkt-user-menu__item`,children:[(0,n.jsx)(`div`,{className:`pkt-user-menu__label`,children:`Representerer`}),(0,n.jsx)(`div`,{className:`pkt-user-menu__name`,translate:`no`,children:r.name}),r.orgNumber&&(0,n.jsxs)(`div`,{className:`pkt-user-menu__org-number`,children:[`Org.nr. `,r.orgNumber]}),a&&o&&(0,n.jsx)(`ul`,{className:`pkt-user-menu__sublist mt-size-16`,children:(0,n.jsx)(`li`,{className:`pkt-user-menu__subitem`,children:(0,n.jsx)(vd,{item:{title:`Endre organisasjon`,iconName:`cogwheel`,onClick:o}})})})]}),!r&&a&&o&&(0,n.jsx)(`li`,{className:`pkt-user-menu__item`,children:(0,n.jsx)(`ul`,{className:`pkt-user-menu__sublist`,children:(0,n.jsx)(`li`,{className:`pkt-user-menu__subitem`,children:(0,n.jsx)(vd,{item:{title:`Endre organisasjon`,iconName:`cogwheel`,onClick:o}})})})}),s&&(0,n.jsx)(`li`,{className:`pkt-user-menu__item`,children:(0,n.jsx)(vd,{item:{title:`Logg ut`,iconName:`exit`,onClick:s}})})]})})});bd.displayName=`PktHeaderUserMenu`;var xd=(0,t.forwardRef)(({id:e,ariaDescribedby:r,ariaLabelledby:i,autocomplete:a=`off`,counter:o,counterMaxLength:s,className:c,disabled:l=!1,errorMessage:u,hasError:d=!1,helptext:f,helptextDropdown:p,helptextDropdownButton:m,iconNameRight:h,inline:g=!1,fullwidth:_=!1,label:v,name:y,optionalTag:b=!1,optionalText:x,requiredTag:S=!1,requiredText:C,tagText:w=null,placeholder:ee,prefix:T,suffix:E,type:te=`text`,useWrapper:ne=!0,omitSearchIcon:re=!1,value:D,minLength:ie,maxLength:ae,min:oe,max:se,step:ce,size:O,readonly:le,required:k,dataTestid:A,onChange:ue,skipForwardTestid:de=!1,...j},M)=>{let N=[c,`pkt-textinput`].join(` `),P=te===`search`&&!h&&!re,F=te===`date`&&D?D.slice(0,10):D,[I,fe]=(0,t.useState)(D?.length||0),pe=`${e}`,L=`${pe}-label`,R=i||L,me=e=>{o&&fe(e.currentTarget?.value?.length||0),ue&&ue(e)};return(0,t.useEffect)(()=>{D!==void 0&&fe(D?.length||0)},[D]),(0,n.jsx)(yl,{ariaDescribedby:r,className:N,disabled:l,errorMessage:u,forId:pe,hasError:d,helptext:f,helptextDropdown:p,helptextDropdownButton:m,inline:g,label:v,optionalTag:b,optionalText:x,requiredTag:S,requiredText:C,tagText:w,useWrapper:ne,counter:o,counterCurrent:I,counterMaxLength:s,children:(0,n.jsxs)(`div`,{className:`pkt-input__container`,"data-testid":A,"data-skip-forward-testid":de?`true`:void 0,children:[T&&(0,n.jsx)(`div`,{className:`pkt-input-prefix`,children:T}),(0,n.jsx)(`input`,{...j,ref:M,className:`pkt-input ${_?`pkt-input--fullwidth`:``} ${s&&I>s?`pkt-input--counter-error`:``}`,type:te,name:`${y||e}`,value:F,id:pe,placeholder:ee,autoComplete:a,disabled:l,"aria-invalid":d,"aria-errormessage":`${e}-error`,"aria-labelledby":R,min:oe,max:se,onChange:me,step:ce,minLength:ie,maxLength:ae,size:O,readOnly:le,required:k}),E&&(0,n.jsxs)(`p`,{className:`pkt-input-suffix`,children:[E,h&&(0,n.jsx)(Q,{className:`pkt-input-suffix-icon`,name:h}),P&&(0,n.jsx)(Q,{className:`pkt-input-suffix-icon`,name:`magnifying-glass-big`})]}),!E&&h&&(0,n.jsx)(Q,{className:`pkt-input-icon`,name:h}),!E&&P&&(0,n.jsx)(Q,{className:`pkt-input-icon`,name:`magnifying-glass-big`})]})})});xd.displayName=`PktTextinput`;var Sd=(0,t.forwardRef)(({mobileBreakpoint:e=768,tabletBreakpoint:r=1280,children:i,className:a,compact:o=!1,"data-mode":s,logOutButtonPlacement:c=`none`,logOut:l,openedMenu:u,showSearch:d=!1,onSearch:f,onSearchChange:p,searchValue:m,searchPlaceholder:h=`Søk`,representing:g,serviceLink:_,serviceClick:v,serviceName:y,user:b,userMenu:x,userMenuFooter:S,userOptions:C,canChangeRepresentation:w=!1,changeRepresentation:ee,hideLogo:T=!1,logoLink:E,logoClick:te,position:ne=`fixed`,scrollBehavior:re=`hide`,slotMenuVariant:D=`icon-only`,slotMenuText:ie=`Meny`},ae)=>{let oe=ne===`fixed`,se=re===`hide`;(0,t.useEffect)(()=>{S&&console.warn(`PktHeaderService: The "userMenuFooter" prop is deprecated and will be removed in a future version. Please use "userMenu" instead.`)},[S]),(0,t.useEffect)(()=>{C&&console.warn(`PktHeaderService: The "userOptions" prop is no longer available. Please use "userMenu" instead.`)},[C]),(0,t.useEffect)(()=>{b?.shortname&&console.warn(`PktHeaderService: The "shortname" property on the user object is deprecated and will be removed in a future version.`),g?.shortname&&console.warn(`PktHeaderService: The "shortname" property on the representing object is deprecated and will be removed in a future version.`)},[b?.shortname,g?.shortname]);let ce=(0,t.useMemo)(()=>{if(b?.lastLoggedIn)return typeof b.lastLoggedIn==`string`?b.lastLoggedIn:new Date(b.lastLoggedIn).toLocaleString(`nb-NO`,{year:`numeric`,month:`long`,day:`numeric`})},[b?.lastLoggedIn]),[O,le]=(0,t.useState)(u||`none`);(0,t.useEffect)(()=>{u!==void 0&&le(u)},[u]);let[k,A]=(0,t.useState)(!1),[ue,de]=(0,t.useState)(0),[j,M]=(0,t.useState)(!1),[N,P]=(0,t.useState)(!1),F=(0,t.useRef)(null),I=(0,t.useRef)(null),fe=(0,t.useRef)(null),pe=(0,t.useRef)(null),L=(0,t.useRef)(null),R=(0,t.useRef)(null),me=(0,t.useRef)(null),he=(0,t.useRef)(!1),z=md(F),B=z<e,V=z<r,ge=(0,t.useCallback)(e=>{F.current=e,typeof ae==`function`?ae(e):ae&&(ae.current=e)},[ae]);hd(oe&&B&&O!==`none`);let H=(0,t.useCallback)((e,t)=>{let n=e.relatedTarget,r;switch(t){case`user`:r=I;break;case`slot`:r=fe;break;case`search`:r=pe;break;default:return}let i=r.current;i&&(!n||!i.contains(n))&&le(`none`)},[]),_e=(0,t.useCallback)(()=>{he.current&&me.current&&document.contains(me.current)&&me.current.focus(),me.current=null,he.current=!1},[]);(0,t.useEffect)(()=>{let e=e=>{b&&O===`user`&&!e.target.closest(`.pkt-header-service__user-container`)&&le(`none`),O===`slot`&&!e.target.closest(`.pkt-header-service__slot-container`)&&le(`none`),O===`search`&&!e.target.closest(`.pkt-header-service__search-container`)&&!e.target.closest(`.pkt-header-service__search-input`)&&le(`none`)},t=e=>{e.key===`Escape`&&O!==`none`&&(e.preventDefault(),he.current=!0,le(`none`))};if(O!==`none`)return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)};_e()},[O,b,_e]),(0,t.useEffect)(()=>{let e=()=>{if(se){let e=window.pageYOffset||document.documentElement.scrollTop;if(e<0||Math.abs(e-ue)<60)return;A(e>ue),de(e)}};return document&&window.addEventListener(`scroll`,e),()=>{document&&window.removeEventListener(`scroll`,e)}},[se,ue]);let ve=(0,t.useCallback)(e=>{let t=e===`slot`?fe:pe,n=e===`slot`?L:R;if(!t.current||!n.current||!V||B)return;let r=t.current.getBoundingClientRect(),i=n.current.offsetWidth,a=r.left+i>window.innerWidth;e===`slot`?M(a):P(a)},[V,B]),U=(0,t.useCallback)(e=>{O===`none`?(me.current=document.activeElement,le(e)):le(`none`)},[O]);(0,t.useEffect)(()=>{(O===`slot`||O===`search`)&&requestAnimationFrame(()=>{ve(O)})},[O,ve]);let ye=(0,n.jsxs)(`header`,{className:(0,$.default)(`pkt-header-service`,o&&`pkt-header-service--compact`,B&&`pkt-header-service--mobile`,V&&`pkt-header-service--tablet`,oe&&`pkt-header-service--fixed`,se&&`pkt-header-service--scroll-to-hide`,k&&`pkt-header-service--hidden`,a),"data-mode":s,ref:ge,children:[(0,n.jsxs)(`div`,{className:(0,$.default)(`pkt-header-service__logo-area`,(!y||y===``)&&`pkt-header-service__logo-area--without-service`),children:[!T&&(0,n.jsx)(`span`,{className:`pkt-header-service__logo`,children:E?(0,n.jsx)(`a`,{href:E,"aria-label":`Tilbake til forside`,children:(0,n.jsx)(Q,{name:`oslologo`,"aria-hidden":`true`,path:`https://punkt-cdn.oslo.kommune.no/16.10/logos/`})}):te?(0,n.jsx)(`button`,{"aria-label":`Tilbake til forside`,className:`pkt-link-button pkt-link pkt-header-service__logo-link`,onClick:te,children:(0,n.jsx)(Q,{name:`oslologo`,"aria-hidden":`true`,path:`https://punkt-cdn.oslo.kommune.no/16.10/logos/`})}):(0,n.jsx)(Q,{name:`oslologo`,"aria-hidden":`true`,path:`https://punkt-cdn.oslo.kommune.no/16.10/logos/`})}),y&&(0,n.jsx)(`span`,{className:`pkt-header-service__service-name`,children:_?(0,n.jsx)(gd,{href:_,className:`pkt-header-service__service-link `,children:y}):v?(0,n.jsx)(`button`,{className:`pkt-link-button pkt-link pkt-header-service__service-link`,onClick:v,children:y}):(0,n.jsx)(`span`,{className:`pkt-header-service__service-link`,children:y})})]}),i||d||V&&l&&(c===`header`||c===`both`)?(0,n.jsxs)(`div`,{className:`pkt-header-service__content`,children:[(0,n.jsxs)(`div`,{className:(0,$.default)(`pkt-header-service__slot-container`,O===`slot`&&`is-open`),onBlur:e=>H(e,`slot`),ref:fe,children:[V&&i&&(0,n.jsx)(es,{skin:`secondary`,variant:D,iconName:`menu`,size:B?`small`:`medium`,state:O===`slot`?`active`:`normal`,onClick:()=>U(`slot`),"aria-expanded":O===`slot`,"aria-controls":`mobile-slot-menu`,"aria-label":`Åpne meny`,children:ie}),(0,n.jsx)(`div`,{className:(0,$.default)(`pkt-header-service__slot-content`,j&&`align-right`),id:`mobile-slot-menu`,role:V?`menu`:void 0,"aria-label":V?`Meny`:void 0,ref:L,children:(0,n.jsx)(`div`,{className:`pkt-contents`,children:i})})]}),d&&(0,n.jsx)(n.Fragment,{children:V?(0,n.jsxs)(`div`,{className:(0,$.default)(`pkt-header-service__search-container`,O===`search`&&`is-open`),onBlur:e=>H(e,`search`),ref:pe,children:[(0,n.jsx)(es,{skin:`secondary`,variant:`icon-only`,iconName:`magnifying-glass-big`,size:B?`small`:`medium`,onClick:()=>U(`search`),state:O===`search`?`active`:`normal`,"aria-expanded":O===`search`,"aria-controls":`mobile-search-menu`,"aria-label":`Åpne søkefelt`,children:`Søk`}),(0,n.jsx)(`div`,{className:(0,$.default)(`pkt-header-service__mobile-menu`,O===`search`&&`is-open`,N&&`align-right`),ref:R,children:O===`search`&&(0,n.jsx)(xd,{id:`mobile-search-menu`,className:`pkt-header-service__search-input`,type:`search`,label:`Søk`,useWrapper:!1,placeholder:h,value:m,autoFocus:!0,fullwidth:!0,onChange:e=>p?.(e.target.value),onKeyDown:e=>{e.key===`Enter`&&f?.(e.target.value)}})})]}):(0,n.jsx)(xd,{id:`header-service-search`,className:`pkt-header-service__search-input`,type:`search`,label:`Søk`,useWrapper:!1,placeholder:h,value:m,onChange:e=>p?.(e.target.value),onKeyDown:e=>{e.key===`Enter`&&f?.(e.target.value)}})}),B&&l&&(c===`header`||c===`both`)&&(0,n.jsx)(es,{skin:`secondary`,size:B?`small`:`medium`,variant:`icon-only`,iconName:`exit`,onClick:l,children:`Logg ut`})]}):null,(b||!B&&l&&(c===`header`||c===`both`))&&(0,n.jsxs)(`div`,{className:`pkt-header-service__user`,children:[b&&(0,n.jsxs)(`div`,{className:`pkt-header-service__user-container`,onBlur:e=>H(e,`user`),ref:I,children:[(0,n.jsxs)(es,{className:(0,$.default)(`pkt-header-service__user-button`,B&&`pkt-header-service__user-button--mobile`),skin:`secondary`,size:B?`small`:`medium`,state:O===`user`?`active`:`normal`,variant:`icons-right-and-left`,iconName:`user`,secondIconName:O===`user`?`chevron-thin-up`:`chevron-thin-down`,onClick:()=>U(`user`),children:[(0,n.jsx)(`span`,{className:`pkt-sr-only`,children:`Brukermeny: `}),g?.name||b.name]}),O===`user`&&b&&(0,n.jsx)(`div`,{className:(0,$.default)(B?`pkt-header-service__mobile-menu`:`pkt-header-service__user-menu`,`is-open`),children:(0,n.jsx)(bd,{user:b,formattedLastLoggedIn:ce,representing:g,userMenu:x,canChangeRepresentation:w,changeRepresentation:ee,logoutOnClick:c===`userMenu`||c===`both`?l:void 0})})]}),!B&&l&&(c===`header`||c===`both`)&&(0,n.jsx)(es,{skin:`tertiary`,size:`medium`,variant:`icon-right`,iconName:`exit`,onClick:l,children:`Logg ut`})]})]});return oe?(0,n.jsxs)(`div`,{className:`pkt-header-service-wrapper`,children:[ye,(0,n.jsx)(`div`,{className:(0,$.default)(`pkt-header-service-spacer`,o&&`pkt-header-service-spacer--compact`,b&&`pkt-header-service-spacer--has-user`,B&&`pkt-header-service-spacer--mobile`,V&&`pkt-header-service-spacer--tablet`)})]}):ye});Sd.displayName=`PktHeaderService`;var Cd=(0,t.forwardRef)((e,t)=>(0,n.jsx)(Sd,{...e,ref:t}));Cd.displayName=`PktHeader`;var wd=x({tagName:`pkt-heading`,elementClass:pi,react:t.default,displayName:`PktHeading`}),Td=(0,t.forwardRef)(({children:e,...t},r)=>(0,n.jsx)(wd,{"data-testid":`pkt-heading`,...t,ref:r,children:e}));Td.displayName=`PktHeading`;var Ed=x({tagName:`pkt-helptext`,elementClass:Gi,react:t.default,displayName:`PktHelptext`,events:{onToggleHelpText:`toggleHelpText`}}),Dd=(0,t.forwardRef)(({children:e,...t},r)=>(0,n.jsx)(Ed,{...t,ref:r,children:(0,n.jsx)(`div`,{className:`pkt-contents`,children:e})}));Dd.displayName=`PktHelptext`;var Od=(0,t.forwardRef)(({label:e,id:t,children:r,...i},a)=>(0,n.jsxs)(`div`,{className:`pkt-form-group`,children:[(0,n.jsx)(`label`,{htmlFor:t,className:`pkt-form-label`,children:e}),(0,n.jsx)(`input`,{className:`pkt-form-input`,id:t,...i,ref:a}),r]}));Od.displayName=`PktInput`;var kd=({children:e,skin:t,title:r,href:i,iconName:a,openInNewTab:o,external:s,className:c,...l})=>{let u=[`pkt-linkcard`,t&&`pkt-linkcard--${t}`].filter(Boolean).join(` `),d=[`pkt-linkcard__title`,s&&`pkt-link pkt-link--external`].filter(Boolean).join(` `);return(0,n.jsxs)(`a`,{...l,href:i,className:(0,$.default)(u,c),target:o?`_blank`:`_self`,rel:o?`noopener noreferrer`:void 0,children:[a&&(0,n.jsx)(Q,{className:`pkt-link__icon`,name:a}),r&&(0,n.jsx)(`div`,{className:(0,$.default)(d),children:r}),(0,n.jsx)(`div`,{className:`pkt-linkcard__text`,children:e})]})};kd.displayName=`PktLinkCard`;var Ad=x({tagName:`pkt-loader`,elementClass:Xa,react:t.default,displayName:`PktLoader`,events:{}}),jd=(0,t.forwardRef)(({children:e,...t},r)=>(0,n.jsx)(Ad,{...t,ref:r,children:(0,n.jsx)(`div`,{className:`pkt-contents`,children:e})}));jd.displayName=`PktLoader`;var Md=({children:e,className:r,skin:i,title:a,compact:o,closable:s,onClose:c,...l})=>{let[u,d]=(0,t.useState)(!1),f={"pkt-messagebox":!0,"pkt-messagebox--compact":o,[`pkt-messagebox--${i}`]:i,"pkt-messagebox--closable":s,"pkt-hide":u},p=(0,t.createRef)(),m=(0,t.useCallback)(()=>{d(!0),c&&c()},[d,c]);return(0,n.jsxs)(`div`,{...l,className:(0,$.default)(f,r),ref:p,children:[s&&(0,n.jsx)(`div`,{className:`pkt-messagebox__close`,children:(0,n.jsx)(`button`,{onClick:m,className:`pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only`,"aria-label":`Lukk`,children:(0,n.jsx)(Q,{name:`close`,className:`pkt-link__icon`})})}),a&&(0,n.jsx)(`div`,{className:`pkt-messagebox__title`,children:a}),(0,n.jsx)(`div`,{className:`pkt-messagebox__text`,children:e})]})};Md.displayName=`PktMessagebox`;var Nd=()=>(`00000000000000000`+(Math.random()*0x10000000000000000).toString(16)).slice(-16),Pd=()=>{let e=Nd(),t=Nd();return e.slice(0,8)+`-`+e.slice(8,12)+`-4`+e.slice(13)+`-a`+t.slice(1,4)+`-`+t.slice(4)},Fd=(0,t.forwardRef)(({ariaLabel:e,ariaLabelledby:r,ariaLive:i=`polite`,ariaValueText:a,id:o,role:s=`progressbar`,skin:c=`dark-blue`,statusPlacement:l=`following`,statusType:u=`none`,title:d,titlePosition:f=`left`,valueCurrent:p=0,valueMax:m=100,valueMin:h=0,className:g,..._},v)=>{let y=(0,t.useMemo)(()=>Pd(),[]),b=o||y,x=(0,t.useRef)(null),[S,C]=(0,t.useState)(0);(0,t.useEffect)(()=>{x.current&&C(x.current.getBoundingClientRect().width||0)},[p]);let w=m-h,ee=Math.round(u===`fraction`?p/w*100:(p-h)/w*100),T=`${p} av ${w}`,E=u===`fraction`&&!a?`${p} av ${m-h}`:a||void 0,te=e?void 0:r||`${b}-title`;return(0,n.jsx)(`div`,{ref:v,id:b,role:s,"aria-live":i,"aria-atomic":`true`,"aria-valuenow":p,"aria-valuemin":h,"aria-valuemax":m,"aria-valuetext":E,"aria-label":e||void 0,"aria-labelledby":te,className:(0,$.default)(`pkt-progressbar`,g),..._,children:(0,n.jsxs)(`div`,{className:`pkt-progressbar__container`,style:{"--pkt-progress-label-width":`${S}px`,"--pkt-progress-width":`${ee}%`},children:[d&&(0,n.jsx)(`p`,{id:`${b}-title`,className:(0,$.default)(`pkt-progressbar__title`,{"pkt-progressbar__title-center":f===`center`}),children:d}),(0,n.jsx)(`div`,{className:`pkt-progressbar__bar-wrapper`,children:(0,n.jsx)(`div`,{className:(0,$.default)(`pkt-progressbar__bar`,`pkt-progressbar__bar--${c}`)})}),u!==`none`&&(0,n.jsx)(`div`,{className:(0,$.default)(`pkt-progressbar__status`,{"pkt-progressbar__status--center":l===`center`}),children:(0,n.jsx)(`span`,{ref:x,className:(0,$.default)({"pkt-progressbar__status-placement--following":l===`following`,"pkt-progressbar__status-placement--center":l===`center`,"pkt-progressbar__status-placement--left":l===`left`}),children:u===`percentage`?`${ee}%`:T})})]})})});Fd.displayName=`PktProgressbar`;var Id=(0,t.forwardRef)(({id:e,name:t,label:r,className:i,hasTile:a=!1,disabled:o=!1,checkHelptext:s,hasError:c=!1,defaultChecked:l,checked:u,optionalTag:d,optionalText:f,requiredTag:p,requiredText:m,tagText:h,...g},_)=>{let v=[i,`pkt-input-check`].filter(Boolean).join(` `),y=[`pkt-input-check__input`,a?`pkt-input-check__input--tile`:``,o&&a?`pkt-input-check__input--tile-disabled`:``].filter(Boolean).join(` `),b=[`pkt-input-check__input-checkbox`,c?`pkt-input-check__input-checkbox--error`:``].filter(Boolean).join(` `),x=[`pkt-input-check__input-label`,o?`pkt-input-check__input-label--disabled`:``].filter(Boolean).join(` `),S=[`pkt-tag`,`pkt-tag--small`,`pkt-tag--thin-text`].join(` `),C=()=>(0,n.jsxs)(n.Fragment,{children:[h&&(0,n.jsx)(`span`,{className:S+` pkt-tag--gray`,children:h}),d&&(0,n.jsx)(`span`,{className:S+` pkt-tag--blue-light`,children:f}),p&&(0,n.jsx)(`span`,{className:S+` pkt-tag--beige`,children:m})]});return(0,n.jsx)(`div`,{className:v,children:(0,n.jsxs)(`div`,{className:y,children:[(0,n.jsx)(`input`,{ref:_,id:e,type:`radio`,name:t,disabled:o,className:b,...u===void 0?{defaultChecked:l}:{checked:u},...g}),(0,n.jsxs)(`label`,{className:x,htmlFor:e,children:[r,` `,C(),s&&(0,n.jsx)(`div`,{className:`pkt-input-check__input-helptext`,children:s})]})]})})});Id.displayName=`PktRadioButton`;var Ld=(0,t.forwardRef)(({appearance:e=`local`,disabled:r=!1,fullwidth:i=!1,id:a,label:o,name:s,placeholder:c=`Søk…`,suggestions:l,value:u=``,action:d,method:f,onChange:p,onSearch:m,onSuggestionClick:h,...g},_)=>{let v=(e,t)=>{e?e():h&&h(t)},y=e=>{u=e.target.value},b=`pkt-searchinput pkt-searchinput--${e} ${i?`pkt-searchinput--fullwidth`:``}`,x;return x=d?e=>(0,n.jsx)(`form`,{role:`search`,className:b,action:d,method:f,children:e}):e=>(0,n.jsx)(`div`,{role:`search`,className:b,children:e}),x((0,n.jsxs)(n.Fragment,{children:[o&&(0,n.jsx)(`label`,{htmlFor:o?a:void 0,className:o?`pkt-inputwrapper__label`:``,children:o}),(0,n.jsxs)(`div`,{className:e===`local`?`pkt-input__container`:`pkt-searchinput__field`,children:[(0,n.jsx)(`input`,{className:`pkt-input ${i?`pkt-input--fullwidth`:``}`,type:`search`,name:s||a,id:a,placeholder:c,defaultValue:u,disabled:r,autoComplete:`off`,"aria-autocomplete":`list`,ref:_,"aria-controls":`${a}-suggestions`,onChange:p||y,onKeyUp:m&&(e=>{e.key===`Enter`&&(e.preventDefault(),m(u))}),...g}),(0,n.jsx)(es,{className:`pkt-searchinput__button ${e===`local`?`pkt-input-icon`:``}`,variant:`icon-only`,iconName:`magnifying-glass-big`,skin:e===`local`?`tertiary`:`primary`,color:e===`global`?`yellow`:void 0,type:`submit`,disabled:r,onClick:m&&(e=>{e.preventDefault(),m(u)}),children:o||c})]}),l&&(0,n.jsx)(`ul`,{id:`${a}-suggestions`,className:`pkt-searchinput__suggestions`,"aria-live":`assertive`,children:l.map((e,r)=>(0,n.jsx)(`li`,{children:(0,t.createElement)(e.href?`a`:e.onClick?`button`:`div`,{href:e.href,className:`pkt-searchinput__suggestion ${e.onClick?`pkt-link-button`:``} ${e.href||e.onClick?`pkt-searchinput__suggestion--has-hover`:``}`,type:e.onClick?`button`:void 0,onClick:()=>v(e.onClick,r),onKeyUp:t=>t.key===`Enter`&&v(e.onClick,r)},(0,n.jsxs)(n.Fragment,{children:[e.title&&(0,n.jsx)(`h3`,{className:`pkt-searchinput__suggestion-title`,children:e.title}),e.text&&(0,n.jsx)(`p`,{className:`pkt-searchinput__suggestion-text`,children:e.text})]}))},`search-suggestion-${r}`))})]}))});Ld.displayName=`PktSearchInput`;var Rd=(0,t.forwardRef)(({ariaDescribedby:e,ariaLabelledby:t,children:r,className:i,disabled:a=!1,errorMessage:o,hasError:s,helptext:c,helptextDropdown:l,helptextDropdownButton:u,id:d,inline:f=!1,fullwidth:p=!1,label:m,name:h,optionalTag:g=!1,optionalText:_,requiredTag:v=!1,requiredText:y,tagText:b,...x},S)=>(0,n.jsx)(yl,{className:[i,`pkt-select`].join(` `),forId:`${d}-input`,label:m,helptext:c,helptextDropdown:l,helptextDropdownButton:u,optionalTag:g,optionalText:_,requiredTag:v,requiredText:y,tagText:b,hasError:s,errorMessage:o,disabled:a,inline:f,ariaDescribedby:e,children:(0,n.jsx)(`select`,{ref:S,className:`pkt-input ${p?`pkt-input--fullwidth`:``}`,"aria-invalid":s,"aria-errormessage":`${d}-error`,"aria-labelledby":t||void 0,disabled:a,id:`${d}-input`,name:h||d,...x,children:r})}));Rd.displayName=`PktSelect`;var zd=(0,n.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,fill:`none`,children:(0,n.jsx)(`circle`,{cx:`12`,cy:`12`,r:`7`,style:{fill:`var(--pkt-color-grays-grey-200, #CCC)`}})}),Bd=(0,n.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,fill:`none`,children:[(0,n.jsx)(`circle`,{opacity:`.15`,cx:`12`,cy:`12`,r:`12`,fill:`#2A2859`}),(0,n.jsx)(`circle`,{cx:`12`,cy:`12`,r:`6`,fill:`#2A2859`})]}),Vd=(0,n.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,fill:`none`,children:[(0,n.jsx)(`path`,{fill:`#2A2859`,d:`M3 3h18v18H3z`}),(0,n.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`})]}),Hd=({children:e,className:t,status:r=`incomplete`,title:i})=>(0,n.jsxs)(`li`,{className:(0,$.default)(`pkt-step`,t,`pkt-step--${r}`),"data-testid":`pkt-step`,children:[(0,n.jsx)(`span`,{className:`pkt-step__line pkt-step__line--1`,"aria-hidden":!0}),(0,n.jsx)(`span`,{className:`pkt-step__line pkt-step__line--2`,"aria-hidden":!0}),(0,n.jsx)(`span`,{className:(0,$.default)(`pkt-step__indicator`),children:r===`current`?Bd:r===`completed`?Vd:zd}),(0,n.jsx)(`span`,{className:`pkt-step__line pkt-step__line--3`,"aria-hidden":!0}),(0,n.jsxs)(`div`,{className:`pkt-step__wrapper`,children:[(0,n.jsx)(`div`,{className:`pkt-step__title`,children:i}),(0,n.jsx)(`div`,{className:`pkt-step__content`,children:e})]})]}),Ud=(0,t.forwardRef)(({activeStep:e,className:r,children:i,hideNonActiveSteps:a=!1,hideNonActiveStepsContent:o=!0,orientation:s=`vertical`,...c},l)=>{let u=(0,$.default)(r,`pkt-stepper`,s===`horizontal`?`pkt-stepper--horizontal`:`pkt-stepper--vertical`),d=t.Children.map(i,(n,r)=>(0,t.isValidElement)(n)?(0,t.cloneElement)(n,{className:(0,$.default)(n.props.className,{"pkt-step--hideStep":a&&r!==e,"pkt-step--hideContent":o&&r!==e})}):n);return(0,n.jsx)(`ol`,{"data-testid":`pkt-stepper`,className:u,ref:l,...c,children:d})});Ud.displayName=`PktStepper`;var Wd=({className:e,compact:t=!1,skin:r=`basic`,responsiveView:i=!0,children:a,...o})=>(0,n.jsx)(`table`,{"data-testid":`pkt-table`,className:(0,$.default)(e,`pkt-table`,{"pkt-table--responsive":i,"pkt-table--compact":t,"pkt-table--basic":r===`basic`,"pkt-table--zebra-blue":r===`zebra-blue`}),role:`table`,...o,children:a}),Gd=({id:e,children:t,className:r,...i})=>(0,n.jsx)(`tbody`,{id:e,className:(0,$.default)(r,`pkt-table__body`,{}),...i,role:`rowgroup`,children:t}),Kd=({children:e,className:t,dataLabel:r,...i})=>(0,n.jsx)(`td`,{className:(0,$.default)(t,`pkt-table__data-cell`,{}),"data-label":r,role:`cell`,"data-testid":`pkt-table__data-cell`,...i,children:e}),qd=({className:e,children:t,...r})=>(0,n.jsx)(`thead`,{className:(0,$.default)(e,`pkt-table__header`,{}),role:`rowgroup`,...r,children:t}),Jd=({className:e,children:t,...r})=>(0,n.jsx)(`th`,{className:(0,$.default)(e,`pkt-table__header-cell`,{}),role:`columnheader`,...r,children:t}),Yd=({className:e,children:t,...r})=>(0,n.jsx)(`tr`,{className:(0,$.default)(e,`pkt-table__row`,{}),role:`row`,...r,children:t}),Xd=(0,t.forwardRef)(({children:e,active:t,disabled:r=!1,href:i,onClick:a,icon:o,controls:s,tag:c,tagSkin:l,index:u=0},d)=>{let{arrowNav:f,registerTabRef:p,handleKeyPress:m,selectTab:h}=Qd(),g=!!t&&!r,_={"aria-selected":f?g:void 0,"aria-controls":s,role:f?`tab`:void 0,onKeyDown:e=>{if(r&&(e.key===`Enter`||e.key===` `||e.key===`Spacebar`)){e.preventDefault(),e.stopPropagation();return}m(u,e)},onClick:e=>{if(r){e.preventDefault(),e.stopPropagation();return}h(u),a?.(e)},tabIndex:r?-1:g||!f?void 0:-1,ref:e=>{p(u,e,r),typeof d==`function`?d(e):d&&(d.current=e)}},v=(0,n.jsxs)(n.Fragment,{children:[o&&(0,n.jsx)(Q,{name:o,className:`pkt-icon--small`}),e,c&&(0,n.jsx)(gl,{skin:l,size:`small`,children:c})]});return i?(0,n.jsx)(`a`,{..._,href:r?void 0:i,"aria-disabled":r||void 0,className:`pkt-tabs__link ${g?`active`:``} ${r?`pkt-tabs__item--disabled`:``}`,children:v}):(0,n.jsx)(`button`,{..._,type:`button`,disabled:r,"aria-disabled":r||void 0,className:`pkt-tabs__button pkt-link-button ${g?`active`:``} ${r?`pkt-tabs__item--disabled`:``}`,children:v})});Xd.displayName=`PktTabItem`;var Zd=(0,t.createContext)(null),Qd=()=>{let e=(0,t.useContext)(Zd);if(!e)throw Error(`TabItem must be used within a Tabs component`);return e},$d=(0,t.forwardRef)(({arrowNav:e=!0,disableArrowNav:r=!1,tabs:i,onTabSelected:a,children:o},s)=>{let c=(0,t.useRef)([]),l=(0,t.useRef)({}),u=e&&!r,d=o&&t.Children.count(o)>0?t.Children.count(o):i?.length||0;(0,t.useEffect)(()=>{c.current=c.current.slice(0,d),Object.keys(l.current).forEach(e=>{let t=Number(e);t>=d&&delete l.current[t]})},[d]);let f=e=>i?!!i[e]?.disabled:!!l.current[e],p=e=>{if(f(e))return;let t=i?.[e];t?.action&&t.action(e),a&&a(e)},m=(e,t)=>{let n=e+t;for(;n>=0&&n<d;){if(!f(n))return n;n+=t}return null},h=(e,t)=>{if(u){if(t.key===`ArrowLeft`){t.preventDefault();let n=m(e,-1);n!==null&&c.current[n]?.focus()}if(t.key===`ArrowRight`){t.preventDefault();let n=m(e,1);n!==null&&c.current[n]?.focus()}(t.key===`Enter`||t.key===` `||t.key===`Spacebar`||t.key===`ArrowDown`)&&(t.preventDefault(),f(e)||p(e))}},g=(e,t,n=!1)=>{c.current[e]=t,l.current[e]=n},_=i?.map((e,t)=>(0,n.jsx)(Xd,{active:e.disabled?!1:e.active,disabled:e.disabled,href:e.href,icon:e.icon,controls:e.controls,tag:e.tag?.text,tagSkin:e.tag?.skin,index:t,children:e.text},t));return(0,n.jsx)(Zd.Provider,{value:{arrowNav:u,registerTabRef:g,handleKeyPress:h,selectTab:p},children:(0,n.jsx)(`div`,{className:`pkt-tabs`,ref:s,children:(0,n.jsx)(`div`,{className:`pkt-tabs__list`,role:u?`tablist`:`navigation`,children:o||_})})})});$d.displayName=`PktTabs`;var ef={hours:`Timer`,minutes:`Minutter`,openPicker:`Åpne tidspunkt-velger`,prevTime:`Forrige tidspunkt`,nextTime:`Neste tidspunkt`,selectTime:`Velg tidspunkt`},tf=e=>e?Math.max(1,Math.round(e/60)):1,nf=(e,t)=>{let n=e?parseInt(String(e).split(`:`)[0],10):0,r=t?parseInt(String(t).split(`:`)[0],10):23;return Array.from({length:r-n+1},(e,t)=>t+n)},rf=e=>{let t=tf(e);return Array.from({length:Math.floor(60/t)},(e,n)=>n*t)},af=(e,t,n,r)=>{let i=e===``?n===1?0:23:parseInt(e,10),a=t===``?n===1?0:Math.floor(59/r)*r:parseInt(t,10);return a+=n*r,a>59?(a=0,i=(i+1)%24):a<0&&(a=Math.floor(59/r)*r,i=(i-1+24)%24),{hours:String(i).padStart(2,`0`),minutes:String(a).padStart(2,`0`)}},of=e=>/^\d{2}:\d{2}$/.test(e)&&parseInt(e.slice(0,2),10)<=23&&parseInt(e.slice(3),10)<=59,sf=e=>{let[t,n]=e.split(`:`).map(Number);return t*60+n},cf={required:`Dette feltet er påkrevd`,invalid:`Ugyldig verdi`,timeStepMismatch:`Må treffe på et steg, for eksempel 0, {step} minutter`,timeStepMismatchHour:`Må treffe på hver hele time`,timeStepMismatchHalfHour:`Må treffe på hver hele eller halve time`,rangeUnderflowMin:`Verdien må være større enn eller lik {min}.`,rangeOverflowMax:`Verdien må være mindre enn eller lik {max}.`};function lf(e){if(e&&of(e)){let[t,n]=e.split(`:`);return[t,n]}return[``,``]}function uf(e,t){return`${String(parseInt(e,10)).padStart(2,`0`)}:${String(parseInt(t,10)).padStart(2,`0`)}`}function df(e,t){let{required:n,min:r,max:i,step:a}=t;if(n&&!e)return{valid:!1,message:cf.required};if(!e)return{valid:!0};if(!of(e))return{valid:!1,message:cf.invalid};let o=sf(e),s=tf(a);return r&&o<sf(String(r))?{valid:!1,message:cf.rangeUnderflowMin.replace(`{min}`,String(r))}:i&&o>sf(String(i))?{valid:!1,message:cf.rangeOverflowMax.replace(`{max}`,String(i))}:a&&o%s!==0?{valid:!1,message:s===60?cf.timeStepMismatchHour:s===30?cf.timeStepMismatchHalfHour:cf.timeStepMismatch.replace(`{step}`,`${s}, ${s*2}, ${s*3}`)}:{valid:!0}}function ff(e){return e===3600||e<3600&&3600%e==0&&e%60==0}function pf(e,n){let{id:r,label:i,value:a,defaultValue:o,min:s,max:c,step:l=60,hidePicker:u=!1,stepArrows:d=!1,fullwidth:f=!1,name:p,disabled:m=!1,required:h=!1,helptext:g,helptextDropdown:_,helptextDropdownButton:v,hasError:y=!1,errorMessage:b,optionalTag:x=!1,optionalText:S,requiredTag:C=!1,requiredText:w,tagText:ee,inline:T=!1,useWrapper:E=!0,ariaDescribedby:te,strings:ne,className:re,onValueChange:D,onFocus:ie,onBlur:ae}=e,oe=(0,t.useMemo)(()=>ne??ef,[ne]),se=a!==void 0,ce=a===void 0?o??``:a??``,O=(0,t.useRef)(ce),[le,k]=(0,t.useState)(()=>ce),A=se?a??``:le,[ue,de]=(0,t.useState)(()=>lf(a===void 0?o:a)[0]),[j,M]=(0,t.useState)(()=>lf(a===void 0?o:a)[1]),N=(0,t.useRef)(ue),P=(0,t.useRef)(j),F=(0,t.useCallback)(e=>{N.current=e,de(e)},[]),I=(0,t.useCallback)(e=>{P.current=e,M(e)},[]),[fe,pe]=(0,t.useState)(!1),[L,R]=(0,t.useState)(!1),me=(0,t.useRef)(a);(0,t.useEffect)(()=>{if(!se||a===me.current)return;me.current=a;let[e,t]=lf(a);F(e),I(t)},[a,se,F,I]),(0,t.useEffect)(()=>{l!=null&&!ff(l)&&console.warn(`PktTimepicker: step="${l}" er ikke en gyldig verdi. Step må være et multiplum av 60 (hele minutter) eller nøyaktig 3600 (hel time).`)},[l]);let he=(0,t.useRef)(null),z=(0,t.useRef)(null),B=(0,t.useRef)(null),V=(0,t.useRef)(null),ge=(0,t.useRef)(null),H=(0,t.useRef)(null),_e=(0,t.useRef)(0),ve=(0,t.useRef)(-1),U=(0,t.useRef)(0),ye=(0,t.useRef)(-1),[be,xe]=(0,t.useState)(!1),Se=(0,t.useMemo)(()=>Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`)?.set,[]),Ce=(0,t.useMemo)(()=>tf(l),[l]),we=(0,t.useMemo)(()=>nf(s,c),[s,c]),Te=(0,t.useMemo)(()=>rf(l),[l]),Ee=`${r}-hours`,De=`${r}-minutes`,Oe=`${r}-popup`,ke=`${r}-input`;(0,t.useEffect)(()=>{let e=he.current;if(!e)return;let t=df(A,{required:h,min:s,max:c,step:l});e.setCustomValidity(t.valid?``:t.message??``),R(be&&!t.valid)},[A,h,s,c,l,be]);let Ae=(0,t.useCallback)(e=>{se||k(e);let t=H.current;!t||!Se||(Se.call(t,e),t.dispatchEvent(new Event(`input`,{bubbles:!0})),D?.(e))},[se,Se,D]),je=(0,t.useCallback)(()=>{let e=N.current,t=P.current;if(e!==``&&t!==``){let n=uf(e,t);n!==A&&Ae(n)}else A!==``&&Ae(``)},[A,Ae]),Me=(0,t.useCallback)(()=>{let e=N.current,t=P.current;if(e!==``&&t!==``){let n=uf(e,t);n===A?H.current?.dispatchEvent(new Event(`input`,{bubbles:!0})):Ae(n)}else A===``?H.current?.dispatchEvent(new Event(`input`,{bubbles:!0})):Ae(``)},[A,Ae]),Ne=(0,t.useCallback)(()=>{xe(!0),je();let e=he.current,t=H.current;if(!e)return;let n=df(t?.value??``,{required:h,min:s,max:c,step:l});e.setCustomValidity(n.valid?``:n.message??``)},[je,h,s,c,l]);(0,t.useEffect)(()=>{let e=ge.current?.closest(`form`);if(!e)return;let t=t=>{let n=t;if(!n||!e.contains(n))return!1;let r=n.closest(`button, input[type="submit"], input[type="image"]`);return!r||!e.contains(r)?!1:r instanceof HTMLButtonElement?r.type!==`button`&&r.type!==`reset`:r instanceof HTMLInputElement},n=e=>{t(e.target)&&Ne()};return e.addEventListener(`pointerdown`,n,!0),()=>e.removeEventListener(`pointerdown`,n,!0)},[Ne]),(0,t.useEffect)(()=>{H.current&&(H.current.value=A)},[A]);let Pe=(0,t.useCallback)(()=>{pe(!1),je()},[je]);(0,t.useLayoutEffect)(()=>{if(!fe)return;let e=V.current;if(!e)return;e.querySelectorAll(`.pkt-timepicker-popup__col`).forEach(e=>{let t=e.querySelector(`.pkt-timepicker-popup__option--selected`);t&&t.scrollIntoView({block:`center`})});let t=e.querySelectorAll(`.pkt-timepicker-popup__col`)[0];if(!t)return;let n=t.querySelector(`.pkt-timepicker-popup__option--selected`),r=t.querySelector(`.pkt-timepicker-popup__option`);(n||r)?.focus()},[fe]),(0,t.useEffect)(()=>{if(!fe)return;let e=e=>{let t=e.target;ge.current&&!ge.current.contains(t)&&Pe()};return document.addEventListener(`click`,e,!0),()=>document.removeEventListener(`click`,e,!0)},[fe,Pe]);let Fe=(0,t.useCallback)(e=>{let t=V.current;if(!t)return;let n=t.querySelectorAll(`.pkt-timepicker-popup__col`),r=e===`hour`?n[0]:n[1];if(!r)return;let i=r.querySelector(`.pkt-timepicker-popup__option--selected`),a=r.querySelector(`.pkt-timepicker-popup__option`);(i||a)?.focus()},[]),Ie=(0,t.useCallback)((e,t)=>{let n=String(e).padStart(2,`0`);if(t===`hour`)F(n),requestAnimationFrame(()=>Fe(`minute`));else{I(n),pe(!1);let e=N.current;e!==``&&Ae(`${e}:${n}`),requestAnimationFrame(()=>B.current?.focus())}},[Ae,Fe,F,I]),Le=(0,t.useCallback)(e=>{let t=af(N.current,P.current,e,Ce);F(t.hours),I(t.minutes),`${t.hours}:${t.minutes}`!==A&&Ae(`${t.hours}:${t.minutes}`)},[Ce,A,Ae,F,I]),Re=(0,t.useCallback)(e=>{he.current?.setCustomValidity(``);let t=e.currentTarget,n=P.current;switch(e.key){case`ArrowUp`:{e.preventDefault();let t=N.current===``?0:parseInt(N.current,10),r=String((t+1)%24).padStart(2,`0`);if(F(r),n!==``){let e=`${r}:${n}`;e===A?H.current?.dispatchEvent(new Event(`input`,{bubbles:!0})):Ae(e)}break}case`ArrowDown`:{e.preventDefault();let t=N.current===``?0:parseInt(N.current,10),r=String((t-1+24)%24).padStart(2,`0`);if(F(r),n!==``){let e=`${r}:${n}`;e===A?H.current?.dispatchEvent(new Event(`input`,{bubbles:!0})):Ae(e)}break}case`ArrowRight`:e.preventDefault(),z.current?.focus();break;case`Backspace`:case`Delete`:{e.preventDefault(),_e.current=0,ve.current=-1;let t=N.current;t.length>0&&F(t.slice(0,-1)),Me();break}case`Tab`:break;case`Enter`:{e.preventDefault(),Ne();let n=t.form;n?n.requestSubmit():t.blur();break}default:if(/^\d$/.test(e.key)){e.preventDefault();let t=parseInt(e.key,10);if(_e.current===0)ve.current=t,F(String(t).padStart(2,`0`)),_e.current=1,H.current?.dispatchEvent(new Event(`input`,{bubbles:!0})),t>=3&&(ve.current=-1,_e.current=0,Me(),z.current?.focus());else{let e=ve.current*10+t;F(e<=23?String(e).padStart(2,`0`):String(t).padStart(2,`0`)),ve.current=-1,_e.current=0,Me(),z.current?.focus()}}else e.preventDefault()}},[A,Ae,F,Me,Ne]),ze=(0,t.useCallback)(()=>{xe(!0),N.current!==``&&F(String(parseInt(N.current,10)).padStart(2,`0`)),_e.current=0,ve.current=-1,je()},[F,je]),Be=(0,t.useCallback)(e=>{he.current?.setCustomValidity(``);let t=e.currentTarget,n=N.current;switch(e.key){case`ArrowUp`:{e.preventDefault();let t=P.current===``?0:parseInt(P.current,10),r=String((t+Ce)%60).padStart(2,`0`);if(I(r),n!==``){let e=`${n}:${r}`;e===A?H.current?.dispatchEvent(new Event(`input`,{bubbles:!0})):Ae(e)}break}case`ArrowDown`:{e.preventDefault();let t=P.current===``?0:parseInt(P.current,10),r=String((t-Ce+60)%60).padStart(2,`0`);if(I(r),n!==``){let e=`${n}:${r}`;e===A?H.current?.dispatchEvent(new Event(`input`,{bubbles:!0})):Ae(e)}break}case`ArrowLeft`:e.preventDefault(),he.current?.focus();break;case`Backspace`:case`Delete`:{e.preventDefault(),U.current=0,ye.current=-1;let t=P.current;t.length>0&&I(t.slice(0,-1)),Me();break}case`Tab`:break;case`Enter`:{e.preventDefault(),Ne();let n=t.form;n?n.requestSubmit():t.blur();break}default:if(/^\d$/.test(e.key)){e.preventDefault();let t=parseInt(e.key,10);if(U.current===0)ye.current=t,I(String(t).padStart(2,`0`)),U.current=1,H.current?.dispatchEvent(new Event(`input`,{bubbles:!0})),t>=6&&(ye.current=-1,U.current=0,Me());else{let e=ye.current*10+t;I(e<=59?String(e).padStart(2,`0`):String(t).padStart(2,`0`)),ye.current=-1,U.current=0,Me()}}else e.preventDefault()}},[Ce,A,Ae,I,Me,Ne]),Ve=(0,t.useCallback)(()=>{xe(!0),P.current!==``&&I(String(parseInt(P.current,10)).padStart(2,`0`)),U.current=0,ye.current=-1,je()},[I,je]),He=(0,t.useCallback)(e=>{let t=document.activeElement,n=t.closest(`.pkt-timepicker-popup__col`);if(!n)return;let r=Array.from(n.querySelectorAll(`.pkt-timepicker-popup__option`)),i=r.indexOf(t),a=e=>{if(!e)return;let n=parseInt(e.dataset.value??`0`,10),r=String(n).padStart(2,`0`);t.dataset.type===`hour`?F(r):I(r),e.focus()};switch(e.key){case`ArrowDown`:e.preventDefault(),a(r[Math.min(i+1,r.length-1)]);break;case`ArrowUp`:e.preventDefault(),a(r[Math.max(i-1,0)]);break;case`Home`:e.preventDefault(),a(r[0]);break;case`End`:e.preventDefault(),a(r[r.length-1]);break;case`ArrowRight`:if(e.preventDefault(),t.dataset.type===`hour`){let e=parseInt(t.dataset.value??`0`,10);F(String(e).padStart(2,`0`)),requestAnimationFrame(()=>{V.current?.querySelectorAll(`.pkt-timepicker-popup__col`).forEach(e=>{e.querySelector(`.pkt-timepicker-popup__option--selected`)?.scrollIntoView({block:`center`})}),Fe(`minute`)})}break;case`ArrowLeft`:if(e.preventDefault(),t.dataset.type===`minute`){let e=parseInt(t.dataset.value??`0`,10);I(String(e).padStart(2,`0`)),requestAnimationFrame(()=>{V.current?.querySelectorAll(`.pkt-timepicker-popup__col`).forEach(e=>{e.querySelector(`.pkt-timepicker-popup__option--selected`)?.scrollIntoView({block:`center`})}),Fe(`hour`)})}break;case`Enter`:case` `:e.preventDefault(),t.click();break;case`Escape`:e.preventDefault(),Pe(),B.current?.focus();break;default:break}},[Pe,Fe,F,I]),Ue=(0,t.useCallback)(e=>{let t=V.current;if(!t)return;let n=e.relatedTarget;(!n||!t.contains(n))&&Pe()},[Pe]),W=(0,t.useCallback)(e=>{let t=ge.current;if(!t)return;let n=e.relatedTarget;n&&t.contains(n)||ie?.(e)},[ie]),G=(0,t.useCallback)(e=>{let t=ge.current;if(!t)return;let n=e.relatedTarget;n&&t.contains(n)||ae?.(e)},[ae]),We=(0,t.useCallback)(()=>{m||(fe?Pe():pe(!0))},[m,fe,Pe]);return(0,t.useImperativeHandle)(n,()=>({get value(){return H.current?.value??``},set value(e){let t=e??``;se||k(t);let[n,r]=lf(t);F(n),I(r),H.current&&(H.current.value=t)},focus(){he.current?.focus()},blur(){he.current?.blur()}}),[se,F,I]),(0,t.useEffect)(()=>{let e=ge.current?.closest(`form`);if(!e)return;let t=()=>{window.setTimeout(()=>{let e=O.current,[t,n]=lf(e);F(t),I(n),se||k(e),H.current&&(H.current.value=e),pe(!1),xe(!1)},0)};return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)},[se,F,I]),{id:r,containerRef:ge,outerClasses:[`pkt-timepicker`,f?`pkt-timepicker--fullwidth`:``,d?`pkt-timepicker--stepper`:``,re??``].filter(Boolean).join(` `),strings:oe,label:i,disabled:m,required:h,helptext:g,helptextDropdown:_,helptextDropdownButton:v,hasError:y,isInvalid:L,errorMessage:b,optionalTag:x,optionalText:S,requiredTag:C,requiredText:w,tagText:ee,inline:T,useWrapper:E,ariaDescribedby:te,hidePicker:u,stepArrows:d,min:s,max:c,step:l,hours:ue,minutes:j,hoursId:Ee,minutesId:De,popupId:Oe,hiddenInputId:ke,name:p??r,isOpen:fe,hourOptions:we,minuteOptions:Te,hoursInputRef:he,minutesInputRef:z,buttonRef:B,popupRef:V,changeInputRef:H,handleHoursKeydown:Re,handleHoursBlur:ze,handleMinutesKeydown:Be,handleMinutesBlur:Ve,handlePopupKeydown:He,handlePopupFocusOut:Ue,handleFocusIn:W,handleFocusOut:G,handleOptionClick:Ie,handleClockButtonClick:We,closePopup:Pe,stepTimeDelta:Le,effectiveValue:A}}var mf=(0,t.forwardRef)((e,t)=>{let{onChange:r,onInput:i}=e,a=pf(e,t),o=a.strings.hours,s=a.strings.minutes,c=a.label?`${o}, ${a.label}`:o,l=a.label?`${s}, ${a.label}`:s,u=(e,t)=>{let r=String(e).padStart(2,`0`),i=e===(t===`hour`?a.hours===``?NaN:parseInt(a.hours,10):a.minutes===``?NaN:parseInt(a.minutes,10));return(0,n.jsx)(`button`,{type:`button`,className:[`pkt-btn`,`pkt-btn--tertiary`,`pkt-btn--small`,`pkt-btn--label-only`,`pkt-timepicker-popup__option`,i?`pkt-timepicker-popup__option--selected`:``].filter(Boolean).join(` `),role:`option`,"aria-selected":i?`true`:`false`,tabIndex:i?0:-1,"data-type":t,"data-value":e,onClick:n=>{n.stopPropagation(),a.handleOptionClick(e,t)},children:(0,n.jsx)(`span`,{className:`pkt-btn__text pkt-txt-14-light`,children:r})},`${t}-${e}`)},d=()=>(0,n.jsxs)(`div`,{ref:a.popupRef,className:`pkt-timepicker-popup`,id:a.popupId,hidden:!a.isOpen,role:`group`,"aria-label":a.strings.selectTime,onKeyDown:a.handlePopupKeydown,onBlur:a.handlePopupFocusOut,children:[(0,n.jsx)(`div`,{className:`pkt-timepicker-popup__col`,role:`listbox`,"aria-label":o,"aria-orientation":`vertical`,children:a.hourOptions.map(e=>u(e,`hour`))}),(0,n.jsx)(`div`,{className:`pkt-timepicker-popup__col`,role:`listbox`,"aria-label":s,"aria-orientation":`vertical`,children:a.minuteOptions.map(e=>u(e,`minute`))})]}),f=()=>(0,n.jsxs)(`div`,{className:`pkt-input__container`,onClick:e=>{e.target.closest(`button, input`)||a.hoursInputRef.current?.focus()},children:[a.stepArrows&&(0,n.jsxs)(`button`,{type:`button`,className:`pkt-input-icon pkt-btn pkt-btn--icon-only pkt-btn--tertiary pkt-timepicker__button pkt-timepicker__button--prev`,"aria-label":a.strings.prevTime,disabled:a.disabled,onClick:()=>a.stepTimeDelta(-1),children:[(0,n.jsx)(Q,{name:`chevron-thin-left`}),(0,n.jsx)(`span`,{className:`pkt-btn__text`,children:a.strings.prevTime})]}),(0,n.jsx)(`input`,{ref:a.hoursInputRef,type:`text`,inputMode:`numeric`,maxLength:2,size:2,className:`pkt-input pkt-timepicker__input`,id:a.hoursId,"data-min":`0`,"data-max":`23`,value:a.hours,placeholder:`––`,"aria-label":c,role:`spinbutton`,"aria-invalid":a.hasError||a.isInvalid||void 0,"aria-valuemin":0,"aria-valuemax":23,"aria-valuenow":a.hours===``?void 0:parseInt(a.hours,10),"aria-valuetext":a.hours===``?void 0:`${a.hours} ${o.toLowerCase()}`,autoComplete:`off`,disabled:a.disabled,onKeyDown:a.handleHoursKeydown,onBlur:a.handleHoursBlur,onFocus:e=>{e.currentTarget.select()},onChange:()=>{},onPaste:e=>e.preventDefault()}),(0,n.jsx)(`span`,{className:`pkt-timepicker__separator`,children:`:`}),(0,n.jsx)(`input`,{ref:a.minutesInputRef,type:`text`,inputMode:`numeric`,maxLength:2,size:2,className:`pkt-input pkt-timepicker__input`,id:a.minutesId,"data-min":`0`,"data-max":`59`,value:a.minutes,placeholder:`––`,"aria-label":l,role:`spinbutton`,"aria-invalid":a.hasError||a.isInvalid||void 0,"aria-valuemin":0,"aria-valuemax":59,"aria-valuenow":a.minutes===``?void 0:parseInt(a.minutes,10),"aria-valuetext":a.minutes===``?void 0:`${a.minutes} ${s.toLowerCase()}`,autoComplete:`off`,disabled:a.disabled,onKeyDown:a.handleMinutesKeydown,onBlur:a.handleMinutesBlur,onFocus:e=>{e.currentTarget.select()},onChange:()=>{},onPaste:e=>e.preventDefault()}),a.hidePicker&&!a.stepArrows&&(0,n.jsx)(Q,{className:`pkt-input-icon pkt-timepicker__icon`,name:`clock`,"aria-hidden":!0}),!a.hidePicker&&!a.stepArrows&&(0,n.jsxs)(`button`,{ref:a.buttonRef,type:`button`,className:`pkt-input-icon pkt-btn pkt-btn--icon-only pkt-btn--tertiary pkt-timepicker__button`,"aria-label":a.strings.openPicker,"aria-haspopup":`listbox`,"aria-expanded":a.isOpen,"aria-controls":a.popupId,disabled:a.disabled,onClick:a.handleClockButtonClick,children:[(0,n.jsx)(Q,{name:`clock`}),(0,n.jsx)(`span`,{className:`pkt-btn__text`,children:a.strings.openPicker})]}),a.stepArrows&&(0,n.jsxs)(`button`,{type:`button`,className:`pkt-input-icon pkt-btn pkt-btn--icon-only pkt-btn--tertiary pkt-timepicker__button pkt-timepicker__button--next`,"aria-label":a.strings.nextTime,disabled:a.disabled,onClick:()=>a.stepTimeDelta(1),children:[(0,n.jsx)(Q,{name:`chevron-thin-right`}),(0,n.jsx)(`span`,{className:`pkt-btn__text`,children:a.strings.nextTime})]}),(0,n.jsx)(`input`,{ref:a.changeInputRef,type:`time`,hidden:!0,name:a.name,id:a.hiddenInputId,disabled:a.disabled,tabIndex:-1,"aria-hidden":!0,onChange:r,onInput:i})]});return(0,n.jsx)(`div`,{ref:a.containerRef,className:a.outerClasses,id:a.id||void 0,onFocus:a.handleFocusIn,onBlur:a.handleFocusOut,children:(0,n.jsx)(yl,{forId:a.hoursId,label:a.label,disabled:a.disabled,hasError:a.hasError,inline:a.inline,optionalTag:a.optionalTag,optionalText:a.optionalText,requiredTag:a.requiredTag,requiredText:a.requiredText,useWrapper:a.useWrapper,ariaDescribedby:a.ariaDescribedby,errorMessage:a.errorMessage,helptext:a.helptext,helptextDropdown:a.helptextDropdown,helptextDropdownButton:a.helptextDropdownButton,tagText:a.tagText,children:!a.hidePicker&&!a.stepArrows?(0,n.jsxs)(`div`,{className:`pkt-timepicker__anchor`,children:[f(),d()]}):f()})})});mf.displayName=`PktTimepicker`,e.FileItem=hu,e.ItemRenderers=ud,e.PktAccordion=_,e.PktAccordionItem=Xo,e.PktAlert=Zo,e.PktBackLink=Qo,e.PktBreadcrumbs=$o,e.PktButton=es,e.PktCalendar=hl,e.PktCard=_l,e.PktCheckbox=vl,e.PktCombobox=Wl,e.PktConsent=Gl,e.PktDatepicker=cu,e.PktFileUpload=dd,e.PktFooter=fd,e.PktFooterSimple=pd,e.PktHeader=Cd,e.PktHeaderService=Sd,e.PktHeading=Td,e.PktHelptext=Dd,e.PktIcon=Q,e.PktInput=Od,e.PktInputWrapper=yl,e.PktLink=gd,e.PktLinkCard=kd,e.PktLoader=jd,e.PktMessagebox=Md,e.PktModal=Iu,e.PktProgressbar=Fd,e.PktRadioButton=Id,e.PktSearchInput=Ld,e.PktSelect=Rd,e.PktStep=Hd,e.PktStepper=Ud,e.PktTabItem=Xd,e.PktTable=Wd,e.PktTableBody=Gd,e.PktTableDataCell=Kd,e.PktTableHeader=qd,e.PktTableHeaderCell=Jd,e.PktTableRow=Yd,e.PktTabs=$d,e.PktTag=gl,e.PktTextarea=bu,e.PktTextinput=xd,e.PktTimepicker=mf});
1829
+ `}};G([U({type:String,reflect:!0})],Yo.prototype,`value`,void 0),G([U({type:Boolean,reflect:!0,attribute:`hide-picker`})],Yo.prototype,`hidePicker`,void 0),G([U({type:Boolean,reflect:!0,attribute:`step-arrows`})],Yo.prototype,`stepArrows`,void 0),G([W()],Yo.prototype,`_hours`,void 0),G([W()],Yo.prototype,`_minutes`,void 0),G([W()],Yo.prototype,`_isOpen`,void 0);try{H(`pkt-timepicker`)(Yo)}catch{console.warn(`Forsøker å definere <pkt-timepicker>, men den er allerede definert`)}var Q=x({tagName:`pkt-icon`,elementClass:Ut,react:t.default,displayName:`PktIcon`,events:{}}),Xo=(0,t.forwardRef)(({defaultOpen:e=!1,id:r,title:i,skin:a,compact:o=!1,isOpen:s,children:c,name:l,className:u,onClick:d,onToggle:f},p)=>{let[m,h]=(0,t.useState)(e),{name:_}=g(),v=l||_,y=s===void 0?m:s;return(0,t.useEffect)(()=>{s===void 0&&h(e)},[e,s]),(0,n.jsxs)(`details`,{ref:p,className:[`pkt-accordion-item`,o&&`pkt-accordion-item--compact`,a&&`pkt-accordion-item--${a}`,u].filter(Boolean).join(` `),id:r,open:y,onClick:e=>{setTimeout(()=>{d?.(e)},0)},name:v,onToggle:e=>{let t=e.currentTarget.open;t!==y&&(s===void 0&&h(t),f?.(e))},children:[(0,n.jsxs)(`summary`,{className:`pkt-accordion-item__title`,id:`pkt-accordion-item-summary-${r}`,children:[i,(0,n.jsx)(Q,{name:`chevron-thin-down`,className:`pkt-accordion-item__icon`,"aria-hidden":`true`})]}),(0,n.jsx)(`div`,{className:`pkt-accordion-item__content`,id:`pkt-accordion-item__content-${r}`,role:`region`,children:(0,n.jsx)(`div`,{className:`pkt-accordion-item__content-inner`,children:c})})]})});Xo.displayName=`PktAccordionItem`;var $=m(d(((e,t)=>{(function(){"use strict";var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()}))(),1),Zo=({children:e,closeAlert:r,compact:i,title:a,date:o,ariaLive:s,"aria-live":c=`polite`,role:l=`status`,skin:u=`info`,className:d,...f})=>{let[p,m]=(0,t.useState)(!1),h={"pkt-alert":!0,"pkt-alert--compact":i,[`pkt-alert--${u}`]:u,"pkt-hide":p},g={"pkt-alert__grid":!0,"pkt-alert__noTitle":!a,"pkt-alert__noDate":!o},_=(0,t.useCallback)(()=>{m(!0),f.onClose&&f.onClose(new CustomEvent(`close`,{detail:{origin:event},bubbles:!0,composed:!0}))},[f.onClose,m]),v=s||c;return(0,n.jsx)(`div`,{...f,"aria-live":v,role:l,className:(0,$.default)(h,d),children:(0,n.jsxs)(`div`,{className:(0,$.default)(g),children:[(0,n.jsx)(Q,{className:`pkt-alert__icon`,"aria-hidden":`true`,name:u===`info`?`alert-information`:`alert-${u}`}),r&&(0,n.jsx)(`div`,{className:`pkt-alert__close`,children:(0,n.jsx)(es,{tabIndex:0,"aria-label":`close`,size:i?`small`:`medium`,type:`button`,skin:`tertiary`,iconName:`close`,variant:`icon-only`,onClick:_,children:(0,n.jsx)(`span`,{className:`sr-only`,children:`Lukk`})})}),a&&(0,n.jsx)(`div`,{className:`pkt-alert__title`,children:a}),(0,n.jsx)(`div`,{className:`pkt-alert__text`,children:e}),o&&(0,n.jsxs)(`div`,{className:`pkt-alert__date`,children:[`Sist oppdatert: `,o]})]})})};Zo.displayName=`PktAlert`;var Qo=(0,t.forwardRef)(({href:e=`/`,text:t=`Forsiden`,ariaLabel:r,renderLink:i,className:a,...o},s)=>{let c=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Q,{className:`pkt-back-link__icon pkt-icon pkt-link__icon`,name:`chevron-thin-left`,"aria-hidden":`true`}),(0,n.jsx)(`span`,{className:`pkt-back-link__text`,children:t})]}),l=i||(({href:e,className:t,children:r,props:i})=>(0,n.jsx)(`a`,{href:e,className:t,...i,children:r}));return(0,n.jsx)(`nav`,{className:[`pkt-back-link`,a].filter(Boolean).join(` `),"aria-label":r||`Gå tilbake til forrige side`,ref:s,children:l({href:e,className:`pkt-link pkt-link--icon-left`,children:c,props:o})})});Qo.displayName=`PktBackLink`;var $o=(0,t.forwardRef)(({breadcrumbs:e,navigationType:t,renderLink:i,className:a,...o},s)=>{let c=e,l=c[c.length-2],u=[a,`pkt-breadcrumbs`].filter(Boolean).join(` `),d=i||(t===`router`?({href:e,className:t,children:i,props:a})=>(0,n.jsx)(r.Link,{to:e,className:t,...a,children:i}):({href:e,className:t,children:r,props:i})=>(0,n.jsx)(`a`,{href:e,className:t,...i,children:r}));return(0,n.jsxs)(`nav`,{ref:s,"aria-label":`brødsmulemeny`,className:u,children:[(0,n.jsx)(`ol`,{className:`pkt-breadcrumbs__list pkt-breadcrumbs--desktop`,children:c.map((e,t)=>(0,n.jsx)(`li`,{className:`pkt-breadcrumbs__item`,children:t===c.length-1?(0,n.jsx)(`span`,{className:`pkt-breadcrumbs__label`,"aria-current":`true`,children:(0,n.jsx)(`span`,{className:`pkt-breadcrumbs__text`,children:e.text})}):d({href:e.href,className:`pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link`,children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Q,{className:`pkt-icon pkt-breadcrumbs__icon pkt-link__icon`,name:`chevron-thin-right`}),(0,n.jsx)(`span`,{className:`pkt-breadcrumbs__text`,children:e.text})]}),props:o})},`breadcrumb-${t}`))}),d({href:l.href,className:`pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile`,children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Q,{className:`pkt-back-link__icon pkt-icon pkt-link__icon`,name:`chevron-thin-left`}),(0,n.jsx)(`span`,{className:`pkt-breadcrumbs__text`,children:l.text})]}),props:o})]})});$o.displayName=`PktBreadcrumbs`,window.pktAnimationPath=window.pktAnimationPath||`https://punkt-cdn.oslo.kommune.no/16.11/animations/`;var es=(0,t.forwardRef)(({children:e,className:t,iconName:r=`user`,secondIconName:i=`user`,iconPath:a,secondIconPath:o,size:s=`medium`,fullWidth:c=!1,fullWidthOnMobile:l=!1,skin:u=`primary`,type:d=`button`,variant:f=`label-only`,state:p,color:m,isLoading:h=void 0,disabled:g=void 0,loadingAnimationPath:_=window.pktAnimationPath,...v},y)=>{let b=[t,`pkt-btn`,s&&`pkt-btn--${s}`,c&&`pkt-btn--full`,l&&`pkt-btn--full-small`,u&&`pkt-btn--${u}`,f&&`pkt-btn--${f}`,m&&`pkt-btn--${m}`,p&&`pkt-btn--${p}`,h&&`pkt-btn--isLoading`].filter(Boolean).join(` `);return(0,n.jsxs)(`button`,{...v,"aria-busy":h||void 0,"aria-disabled":g||void 0,disabled:g,className:b,type:d,ref:y,children:[h&&(0,n.jsx)(Q,{className:`pkt-btn__icon pkt-btn__spinner`,name:`spinner-blue`,path:_}),f!==`label-only`&&(0,n.jsx)(Q,{className:`pkt-btn__icon`,name:r,...a&&{path:a}}),(0,n.jsx)(`span`,{className:`pkt-btn__text`,children:e}),f===`icons-right-and-left`&&(0,n.jsx)(Q,{className:`pkt-btn__icon`,name:i,...o&&{path:o}})]})});es.displayName=`PktButton`;var ts=365.2425,ns=6048e5,rs=864e5,is=3600*24;is*7,is*ts/12*3;var as=Symbol.for(`constructDateFrom`);function os(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&as in e?e[as](t):e instanceof Date?new e.constructor(t):new Date(t)}function ss(e,t){return os(t||e,e)}function cs(e,t,n){let r=ss(e,n?.in);return isNaN(t)?os(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}var ls={};function us(){return ls}function ds(e,t){let n=us(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=ss(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function fs(e,t){return ds(e,{...t,weekStartsOn:1})}function ps(e,t){let n=ss(e,t?.in),r=n.getFullYear(),i=os(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let a=fs(i),o=os(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);let s=fs(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function ms(e){let t=ss(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function hs(e,...t){let n=os.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function gs(e,t){let n=ss(e,t?.in);return n.setHours(0,0,0,0),n}function _s(e,t,n){let[r,i]=hs(n?.in,e,t),a=gs(r),o=gs(i),s=+a-ms(a),c=+o-ms(o);return Math.round((s-c)/rs)}function vs(e,t){let n=ps(e,t),r=os(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),fs(r)}function ys(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function bs(e){return!(!ys(e)&&typeof e!=`number`||isNaN(+ss(e)))}function xs(e,t){let n=ss(e,t?.in);return n.setHours(23,59,59,999),n}function Ss(e,t){let[n,r]=hs(e,t.start,t.end);return{start:n,end:r}}function Cs(e,t){let{start:n,end:r}=Ss(t?.in,e),i=+n>+r,a=i?+n:+r,o=i?r:n;o.setHours(0,0,0,0);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,i=!i);let c=[];for(;+o<=a;)c.push(os(n,o)),o.setDate(o.getDate()+s),o.setHours(0,0,0,0);return i?c.reverse():c}function ws(e,t){let n=ss(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}var Ts={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`}},Es=(e,t,n)=>{let r,i=Ts[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function Ds(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var Os={date:Ds({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:Ds({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:Ds({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},ks={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},As=(e,t,n,r)=>ks[e];function js(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var Ms={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:js({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:js({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:js({values:{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`]},defaultWidth:`wide`}),day:js({values:{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`]},defaultWidth:`wide`}),dayPeriod:js({values:{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`}},defaultWidth:`wide`,formattingValues:{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`}},defaultFormattingWidth:`wide`})};function Ns(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?Fs(s,e=>e.test(o)):Ps(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function Ps(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Fs(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Is(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var Ls={code:`en-US`,formatDistance:Es,formatLong:Os,formatRelative:As,localize:Ms,match:{ordinalNumber:Is({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:Ns({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:Ns({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:Ns({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{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]},defaultParseWidth:`any`}),day:Ns({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{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]},defaultParseWidth:`any`}),dayPeriod:Ns({matchPatterns:{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},defaultMatchWidth:`any`,parsePatterns:{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}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function Rs(e,t){let n=ss(e,t?.in);return _s(n,ws(n))+1}function zs(e,t){let n=ss(e,t?.in),r=fs(n)-+vs(n);return Math.round(r/ns)+1}function Bs(e,t){let n=ss(e,t?.in),r=n.getFullYear(),i=us(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=os(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=ds(o,t),c=os(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=ds(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function Vs(e,t){let n=us(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=Bs(e,t),a=os(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),ds(a,t)}function Hs(e,t){let n=ss(e,t?.in),r=ds(n,t)-+Vs(n,t);return Math.round(r/ns)+1}function Us(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var Ws={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return Us(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):Us(n+1,2)},d(e,t){return Us(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return Us(e.getHours()%12||12,t.length)},H(e,t){return Us(e.getHours(),t.length)},m(e,t){return Us(e.getMinutes(),t.length)},s(e,t){return Us(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return Us(Math.trunc(r*10**(n-3)),t.length)}},Gs={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},Ks={G:function(e,t,n){let r=+(e.getFullYear()>0);switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return Ws.y(e,t)},Y:function(e,t,n,r){let i=Bs(e,r),a=i>0?i:1-i;return t===`YY`?Us(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):Us(a,t.length)},R:function(e,t){return Us(ps(e),t.length)},u:function(e,t){return Us(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return Us(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return Us(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return Ws.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return Us(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=Hs(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):Us(i,t.length)},I:function(e,t,n){let r=zs(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):Us(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):Ws.d(e,t)},D:function(e,t,n){let r=Rs(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):Us(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return Us(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return Us(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return Us(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?Gs.noon:r===0?Gs.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?Gs.evening:r>=12?Gs.afternoon:r>=4?Gs.morning:Gs.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return Ws.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):Ws.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):Us(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):Us(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):Ws.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):Ws.s(e,t)},S:function(e,t){return Ws.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return Js(r);case`XXXX`:case`XX`:return Ys(r);default:return Ys(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return Js(r);case`xxxx`:case`xx`:return Ys(r);default:return Ys(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+qs(r,`:`);default:return`GMT`+Ys(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+qs(r,`:`);default:return`GMT`+Ys(r,`:`)}},t:function(e,t,n){return Us(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return Us(+e,t.length)}};function qs(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+Us(a,2)}function Js(e,t){return e%60==0?(e>0?`-`:`+`)+Us(Math.abs(e)/60,2):Ys(e,t)}function Ys(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Us(Math.trunc(r/60),2),a=Us(r%60,2);return n+i+t+a}var Xs=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});default:return t.date({width:`full`})}},Zs=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});default:return t.time({width:`full`})}},Qs={p:Zs,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Xs(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,Xs(r,t)).replace(`{{time}}`,Zs(i,t))}},$s=/^D+$/,ec=/^Y+$/,tc=[`D`,`DD`,`YY`,`YYYY`];function nc(e){return $s.test(e)}function rc(e){return ec.test(e)}function ic(e,t,n){let r=ac(e,t,n);if(console.warn(r),tc.includes(e))throw RangeError(r)}function ac(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var oc=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,sc=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,cc=/^'([^]*?)'?$/,lc=/''/g,uc=/[a-zA-Z]/;function dc(e,t,n){let r=us(),i=n?.locale??r.locale??Ls,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=ss(e,n?.in);if(!bs(s))throw RangeError(`Invalid time value`);let c=t.match(sc).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=Qs[t];return n(e,i.formatLong)}return e}).join(``).match(oc).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:fc(e)};if(Ks[t])return{isToken:!0,value:e};if(t.match(uc))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&rc(a)||!n?.useAdditionalDayOfYearTokens&&nc(a))&&ic(a,t,String(e));let o=Ks[a[0]];return o(s,a,i.localize,l)}).join(``)}function fc(e){let t=e.match(cc);return t?t[1].replace(lc,`'`):e}function pc(e,t){let n=ss(e,t?.in).getDay();return n===0?7:n}function mc(e,t,n=`long`){return new Intl.DateTimeFormat(`en-US`,{hour:`numeric`,timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(` `)}var hc={},gc={};function _c(e,t){try{let n=(hc[e]||=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`longOffset`}).format)(t).split(`GMT`)[1];return n in gc?gc[n]:yc(n,n.split(`:`))}catch{if(e in gc)return gc[e];let t=e?.match(vc);return t?yc(e,t.slice(1)):NaN}}var vc=/([+-]\d\d):?(\d\d)?/;function yc(e,t){let n=+(t[0]||0),r=+(t[1]||0),i=(t[2]||0)/60;return gc[e]=n*60+r>0?n*60+r+i:n*60-r-i}var bc=class e extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]==`string`&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(_c(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)),wc(this,NaN),Sc(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}withTimeZone(t){return new e(+this,t)}getTimezoneOffset(){let e=-_c(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Sc(this),+this}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}},xc=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!xc.test(e))return;let t=e.replace(xc,`$1UTC`);bc.prototype[t]&&(e.startsWith(`get`)?bc.prototype[e]=function(){return this.internal[t]()}:(bc.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),Cc(this),+this},bc.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Sc(this),+this}))});function Sc(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-_c(e.timeZone,e)*60))}function Cc(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),wc(e)}function wc(e){let t=_c(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);let i=-new Date(+e).getTimezoneOffset(),a=i- -new Date(+r).getTimezoneOffset(),o=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&o&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);let s=i-n;s&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);let c=new Date(+e);c.setUTCSeconds(0);let l=i>0?c.getSeconds():(c.getSeconds()-60)%60,u=Math.round(-(_c(e.timeZone,e)*60))%60;(u||l)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+u),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+u+l));let d=_c(e.timeZone,e),f=d>0?Math.floor(d):Math.ceil(d),p=-new Date(+e).getTimezoneOffset()-f,m=f!==n,h=p-s;if(m&&h){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+h);let t=_c(e.timeZone,e),n=f-(t>0?Math.floor(t):Math.ceil(t));n&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+n),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n))}}var Tc=class e extends bc{static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}toISOString(){let[e,t,n]=this.tzComponents(),r=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){let[e,t,n,r]=this.internal.toUTCString().split(` `);return`${e?.slice(0,-1)} ${n} ${t} ${r}`}toTimeString(){let e=this.internal.toUTCString().split(` `)[4],[t,n,r]=this.tzComponents();return`${e} GMT${t}${n}${r} (${mc(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){let e=this.getTimezoneOffset();return[e>0?`-`:`+`,String(Math.floor(Math.abs(e)/60)).padStart(2,`0`),String(Math.abs(e)%60).padStart(2,`0`)]}withTimeZone(t){return new e(+this,t)}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}};window.pktTz=window.pktTz===void 0?`Europe/Oslo`:window.pktTz;var Ec=(e=window.pktTz)=>{let t=new Tc(new Date().toISOString(),e);return t.setHours(0,0,0,0),isNaN(t.getTime())?new Date:new Date(t.getFullYear(),t.getMonth(),t.getDate())};function Dc(e){if(!e||e===``)return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){let[t,n,r]=e.split(`-`).map(Number);return new Date(t,n-1,r)}if(/^\d{4}-\d{2}$/.test(e)){let[t,n]=e.split(`-`).map(Number);return new Date(t,n-1,1)}return/^\d{4}$/.test(e)?new Date(Number(e),0,1):new Date(e)}var Oc=e=>!e||isNaN(e.getTime())?``:`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`,kc=e=>{if(!e)return null;let t=Dc(e);return isNaN(t.getTime())?null:t},Ac=(e,t)=>{let n=jc(e);return isNaN(n.getTime())?``:dc(n,t)},jc=(e=``,t)=>{let n=typeof e==`string`?Dc(e):e;return!n||isNaN(n.getTime())?new Date:t?t===`end`?xs(n):gs(n):n},Mc=(e,t,n=1)=>{if(typeof e!=`number`||typeof t!=`number`||typeof n!=`number`||isNaN(e)||isNaN(t)||isNaN(n))return new Date;let r=new Date(e,t,n);return isNaN(r.getTime())?new Date:r},Nc=e=>{let t;return t=new Tc(e,window.pktTz),t.setHours(12,0,0,0),t},Pc=null,Fc=void 0,Ic=e=>{if(!e||isNaN(e.getTime()))return``;let t=typeof window<`u`?window.pktTz:void 0;return(!Pc||Fc!==t)&&(Pc=new Intl.DateTimeFormat(`no`,{dateStyle:`full`,timeZone:t}),Fc=t),Pc.format(e)},Lc=(e,t,n)=>{if(!e||isNaN(e.getTime()))return!1;let r=t?jc(t):null,i=n?jc(n):null;return!(r&&e<r||i&&e>i)},Rc=(e,t)=>{if(!e||isNaN(e.getTime())||!Array.isArray(t))return!1;let n=Oc(e);return t.includes(n)},zc=(e,t)=>{if(!e||isNaN(e.getTime())||!Array.isArray(t))return!1;let n=e.getDay().toString();return t.includes(n)},Bc=(e,t,n,r,i)=>!(!e||isNaN(e.getTime())||!Lc(e,t,n)||r&&Rc(e,r)||i&&zc(e,i)),Vc=(e,t,n,r,i)=>e.filter(e=>{let a=kc(e);return a&&Bc(a,t,n,r,i)}),Hc=e=>e.slice().sort((e,t)=>{let n=kc(e),r=kc(t);return!n||!r?0:n.getTime()-r.getTime()}),Uc=(e,t)=>{let n=kc(e),r=kc(t);return!n||!r?!1:n<=r};function Wc(e,t){let n=(t.excludedates??[]).map(e=>typeof e==`string`?e:Oc(e));return!Bc(e,t.earliest,t.latest,n,t.excludeweekdays??[])}function Gc(e,t,n,r){return!!(Wc(e,n)||!t&&r.multiple&&r.maxMultiple>0&&r.selectedCount>=r.maxMultiple)}function Kc(e,t,n){let r=Mc(e,t,0);return!(n&&jc(n)>r)}function qc(e,t,n){let r=Mc(t===11?e+1:e,t===11?0:t+1,1);return!(n&&jc(n)<r)}function Jc(e){return typeof e==`string`&&(e=e.split(`,`)),e.length===1&&e[0]===``?[]:e.map(e=>Dc(e))}function Yc(e,t){let n=Cs({start:e,end:t}),r={};if(Array.isArray(n)&&n.length)for(let i=0;i<n.length;i++){let a=n[i],o=a>e&&a<t;r[Oc(a)]=o}return r}function Xc(e,t,n,r){if(t.length!==1)return!0;let i=Cs({start:t[0],end:e});if(!Array.isArray(i)||!i.length)return!0;for(let a=0;a<i.length;a++){for(let r of n??[])if(r>t[0]&&r<e)return!1;if((r??[]).includes(pc(i[a]).toString()))return!1}return!0}function Zc(e,t){let n=Oc(e);return t.includes(n)?t:[...t,n]}function Qc(e,t){let n=Oc(e),r=t.indexOf(n);if(r===-1)return t;if(t.length===1)return[];let i=[...t];return i.splice(r,1),i}function $c(e,t,n){let r=Oc(e);return t.includes(r)?Qc(e,t):n>0&&t.length>=n?t:Zc(e,t)}function el(e,t,n){let r=Oc(e),i=Jc(t);return t.includes(r)?t.indexOf(r)===0?[]:Qc(e,t):t.length>1||t.length===1&&(!Xc(e,i,n.excludedates,n.excludeweekdays)||i[0]>e)?[r]:Zc(e,t)}function tl(e,t){let n=Mc(e,t,1),r=Mc(e,t+1,0),i=(n.getDay()+6)%7,a=r.getDate();return{firstDayOfMonth:n,lastDayOfMonth:r,startingDay:i,numDays:a,numRows:Math.ceil((a+i)/7),numDaysPrevMonth:Mc(e,t,0).getDate(),initialWeek:Hs(n)}}function nl(e,t,n,r){let{startingDay:i,numDays:a}=r;return e===0&&t<i?`prev-month`:n>a?`next-month`:`current-month`}function rl(e,t,n,r){let{startingDay:i,numDaysPrevMonth:a,numDays:o}=r;return e===`prev-month`?a-(i-t-1):e===`next-month`?n-o:n}var il={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7};function al(e){let t=e.nodeName;return t===`INPUT`||t===`SELECT`||t===`BUTTON`&&!e.dataset?.date}function ol(e,t,n){let r=cs(e,t);if(!r)return null;let i=n(`button[data-date="${Oc(r)}"]`);for(;i instanceof HTMLButtonElement&&i.dataset.disabled;)if(r=cs(r,t),i=n(`button[data-date="${Oc(r)}"]`),!i)return null;return r}function sl(e){return il[e]??null}var cl={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 ll(e){let{selected:n,multiple:r=!1,maxMultiple:i=0,range:a=!1,earliest:o=null,latest:s=null,excludedates:c,excludeweekdays:l=[],weeknumbers:u=!1,withcontrols:d=!1,currentmonth:f,today:p,strings:m,onDateSelected:h,onClose:g,id:_,className:v}=e,y=(0,t.useId)(),b=_??y,x=(0,t.useMemo)(()=>({...cl,...m}),[m]),S=(0,t.useMemo)(()=>p?Dc(p):Ec(),[p]),C=(0,t.useMemo)(()=>c?c.map(e=>typeof e==`string`?Dc(e):e):[],[c]),w=n!==void 0,[ee,T]=(0,t.useState)([]),E=w?n:ee,te=(0,t.useMemo)(()=>Jc(E),[E]),[ne,re]=(0,t.useState)(0),[D,ie]=(0,t.useState)(0),[ae,oe]=(0,t.useState)({}),[se,ce]=(0,t.useState)(null),[O,le]=(0,t.useState)(null),k=(0,t.useRef)(null),A=(0,t.useRef)([]),ue=(0,t.useRef)(0),de=(0,t.useRef)(!1),j=(0,t.useRef)(!1),M=(0,t.useMemo)(()=>({earliest:o,latest:s,excludedates:C,excludeweekdays:l}),[o,s,C,l]);(0,t.useEffect)(()=>{let e=null;if(f!=null&&(f instanceof Date?e=Nc(f):typeof f==`string`&&(e=Dc(f))),!e||isNaN(e.getTime()))if(E.length>0&&E[0]!==``){let t=Dc(E[E.length-1]);e=isNaN(t.getTime())?Nc(S):t}else e=Nc(S);if((!e||isNaN(e.getTime()))&&(e=Nc(S)),s){let t=typeof s==`string`?Dc(s):s;!isNaN(t.getTime())&&e>t&&(e=t)}if(o){let t=typeof o==`string`?Dc(o):o;!isNaN(t.getTime())&&e<t&&(e=t)}re(e.getFullYear()),ie(e.getMonth()),j.current=!0},[]),(0,t.useEffect)(()=>{if(j.current&&!de.current&&E.length>0&&E[0]!==``){let e=Dc(E[E.length-1]);isNaN(e.getTime())||(re(e.getFullYear()),ie(e.getMonth()))}},[E]),(0,t.useEffect)(()=>{a&&te.length===2?oe(Yc(te[0],te[1])):(!a||te.length<2)&&oe({})},[a,te]);let N=(0,t.useCallback)(e=>{w||T(e),h?.(e)},[w,h]),P=(0,t.useCallback)(()=>{g?.()},[g]),F=(0,t.useCallback)((e,t)=>{re(typeof e==`string`?parseInt(e):e),ie(typeof t==`string`?parseInt(t):t),ue.current=0,le(null),A.current=[],de.current=!0},[]),I=(0,t.useCallback)(()=>{let e=D===0?11:D-1;F(D===0?ne-1:ne,e)},[ne,D,F]),fe=(0,t.useCallback)(()=>{let e=D===11?0:D+1;F(D===11?ne+1:ne,e)},[ne,D,F]),pe=(0,t.useCallback)(e=>Wc(e,M),[M]),me=(0,t.useCallback)((e,t)=>Gc(e,t,M,{multiple:r,maxMultiple:i,selectedCount:E.length}),[M,r,i,E.length]),L=(0,t.useCallback)(()=>typeof E==`string`?E.split(`,`):E,[E]),he=(0,t.useCallback)(e=>{if(!a||te.length!==1||!Xc(e,te,C,l)||te[0]>=e){ce(null);return}ce(e),oe(Yc(te[0],e))},[a,te,C,l]),ge=(0,t.useCallback)(e=>{if(!e)return;let t;if(a)t=el(e,L(),{excludedates:C,excludeweekdays:l}),w||T(t),t.length===2?(h?.(t),P()):(t.length===1&&oe({}),h?.(t));else if(r)t=$c(e,L(),i),N(t);else{let n=Oc(e);t=E.includes(n)?[]:[n],N(t),P()}},[a,r,i,L,E,C,l,w,N,P,h]),R=(0,t.useCallback)(e=>{let t=Zc(e,L());w||T(t),a&&t.length===2&&(h?.(t),P())},[L,w,a,h,P]),z=(0,t.useCallback)(e=>{let t=Qc(e,L());w||T(t)},[L,w]),B=(0,t.useCallback)(e=>{let t=$c(e,L(),i);w||T(t)},[L,i,w]),_e=(0,t.useCallback)(()=>{let e=Oc(Nc(S)),t=k.current?.querySelector(`button[data-date="${e}"]`);if(t instanceof HTMLButtonElement){le(e),t.focus();return}let n=A.current.find(e=>!e.isDisabled);if(n){let e=k.current?.querySelector(`button[data-date="${n.currentDateISO}"]`);e instanceof HTMLButtonElement&&(le(n.currentDateISO),e.focus())}},[]),V=(0,t.useCallback)((e,t)=>{let n=e.target;if(al(n))return;if(e.preventDefault(),!O){_e();return}let r=ol(jc(O),t,k.current.querySelector.bind(k.current));if(r){let e=k.current.querySelector(`button[data-date="${Oc(r)}"]`);e instanceof HTMLButtonElement&&!e.dataset.disabled&&(le(Oc(r)),e.focus())}},[O,_e]);return{componentId:b,strings:x,todayDate:S,year:ne,month:D,activeSelected:E,_selected:te,inRange:ae,rangeHovered:se,focusedDate:O,range:a,multiple:r,weeknumbers:u,withcontrols:d,earliest:o,latest:s,excludedates:C,excludeweekdays:l,className:v,dateConstraints:M,calendarRef:k,selectableDatesRef:A,tabIndexSetRef:ue,prevMonth:I,nextMonth:fe,changeMonth:F,handleDateSelect:ge,addToSelected:R,removeFromSelected:z,toggleSelectedDate:B,handleRangeHover:he,isExcluded:pe,isDayDisabled:me,focusOnCurrentDate:_e,handleKeydown:(0,t.useCallback)(e=>{if(e.key===`Escape`){e.preventDefault(),P();return}let t=sl(e.key);t!==null&&V(e.nativeEvent,t)},[P,V]),handleFocusOut:(0,t.useCallback)(e=>{k.current&&!k.current.contains(e.relatedTarget)&&!e.target.classList.contains(`pkt-hide`)&&P()},[P]),close:P,setFocusedDate:le}}var ul=({componentId:e,strings:t,year:r,month:i,earliest:a,latest:o,withcontrols:s,prevMonth:c,nextMonth:l,changeMonth:u})=>{let d=e=>{let s=e===`prev`,u=s?Kc(r,i,a):qc(r,i,o),d=s?t.prevMonth:t.nextMonth,f=s?`chevron-thin-left`:`chevron-thin-right`,p=s?`pkt-calendar__prev-month`:`pkt-calendar__next-month`,m=s?c:l;return(0,n.jsx)(`div`,{children:(0,n.jsxs)(`button`,{type:`button`,"aria-label":d,onClick:()=>u&&m(),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),u&&m())},className:[`pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only`,p,!u&&`pkt-invisible`].filter(Boolean).join(` `),"data-disabled":u?void 0:`disabled`,"aria-disabled":!u||void 0,tabIndex:u?0:-1,children:[(0,n.jsx)(Q,{className:`pkt-btn__icon`,name:f}),(0,n.jsx)(`span`,{className:`pkt-btn__text`,children:d})]})})};return(0,n.jsxs)(`nav`,{className:`pkt-cal-month-nav`,children:[d(`prev`),s?(0,n.jsxs)(`div`,{className:`pkt-cal-month-picker`,children:[(0,n.jsx)(`label`,{htmlFor:`${e}-monthnav`,className:`pkt-hide`,children:t.month}),(0,n.jsx)(`select`,{"aria-label":t.month,className:`pkt-input pkt-input-compact`,id:`${e}-monthnav`,value:i,onChange:e=>{e.stopPropagation(),u(r,parseInt(e.target.value))},children:t.months.map((e,t)=>(0,n.jsx)(`option`,{value:t,children:e},t))}),(0,n.jsx)(`label`,{htmlFor:`${e}-yearnav`,className:`pkt-hide`,children:t.year}),(0,n.jsx)(`input`,{"aria-label":t.year,className:`pkt-input pkt-cal-input-year pkt-input-compact`,id:`${e}-yearnav`,type:`number`,size:4,placeholder:`0000`,value:r,onChange:e=>{e.stopPropagation(),u(parseInt(e.target.value),i)}})]}):(0,n.jsxs)(`div`,{className:`pkt-txt-16-medium pkt-calendar__month-title`,"aria-live":`polite`,children:[t.months[i],` `,r]}),d(`next`)]})};function dl(e,t,n){let r=Mc(n.year,n.month,e),i=Oc(r),a=i===Oc(t),o=n.activeSelected.includes(i),s=n.isDayDisabled(r,o),c;return n.focusedDate?c=n.focusedDate===i&&!s?`0`:`-1`:!s&&n.tabIndexSetRef.current===0?(n.tabIndexSetRef.current=e,c=`0`):c=n.tabIndexSetRef.current===e?`0`:`-1`,{currentDate:r,currentDateISO:i,isToday:a,isSelected:o,isDisabled:s,ariaLabel:Ic(r),tabindex:c}}function fl(e,t){let{currentDateISO:n,isToday:r,isSelected:i}=e,a=t.range&&(t.activeSelected.length===2||t.rangeHovered!==null)&&n===t.activeSelected[0],o=t.range&&t.activeSelected.length===2&&n===t.activeSelected[1];return(0,$.default)({"pkt-cal-today":r,"pkt-cal-selected":i,"pkt-cal-in-range":t.inRange[n],"pkt-cal-excluded":t.isExcluded(e.currentDate),"pkt-cal-in-range-first":a,"pkt-cal-in-range-last":o,"pkt-cal-range-hover":t.rangeHovered!==null&&n===Oc(t.rangeHovered)})}function pl(e,t){let{currentDateISO:n,isToday:r,isSelected:i,isDisabled:a}=e,o=t.range&&(t.activeSelected.length===2||t.rangeHovered!==null)&&n===t.activeSelected[0],s=t.range&&t.activeSelected.length===2&&n===t.activeSelected[1];return(0,$.default)({"pkt-calendar__date":!0,"pkt-calendar__date--today":r,"pkt-calendar__date--selected":i,"pkt-calendar__date--disabled":a,"pkt-calendar__date--in-range":t.inRange[n],"pkt-calendar__date--in-range-hover":t.rangeHovered!==null&&n===Oc(t.rangeHovered),"pkt-calendar__date--range-start":o,"pkt-calendar__date--range-end":s})}var ml=({state:e})=>{let{strings:t,year:r,month:i,activeSelected:a,focusedDate:o,inRange:s,rangeHovered:c,range:l,multiple:u,weeknumbers:d,selectableDatesRef:f,tabIndexSetRef:p,handleDateSelect:m,handleRangeHover:h,isExcluded:g,isDayDisabled:_,setFocusedDate:v,todayDate:y}=e,b={year:r,month:i,activeSelected:a,focusedDate:o,tabIndexSetRef:p,isDayDisabled:_},x={range:l,activeSelected:a,rangeHovered:c,inRange:s,isExcluded:g},S=()=>{let e=[];d&&e.push((0,n.jsx)(`th`,{children:(0,n.jsx)(`div`,{className:`pkt-calendar__week-number`,children:t.week})},`week-header`));for(let r=0;r<t.daysShort.length;r++)e.push((0,n.jsx)(`th`,{children:(0,n.jsx)(`div`,{className:`pkt-calendar__day-name`,"aria-label":t.days[r],children:t.daysShort[r]})},`day-${r}`));return(0,n.jsx)(`tr`,{className:`pkt-cal-week-row`,children:e})},C=(e,t)=>{let r=dl(e,t,b),{currentDate:i,currentDateISO:a,isSelected:o,isDisabled:s,ariaLabel:c,tabindex:u}=r;f.current.push({currentDateISO:a,isDisabled:s,tabindex:u});let d=fl(r,x),p=pl(r,x);return(0,n.jsx)(`td`,{className:d,children:(0,n.jsx)(`button`,{type:`button`,"aria-pressed":o?`true`:`false`,disabled:s,className:`pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${p}`,onMouseOver:()=>l&&!g(i)&&h(i),onFocus:()=>{l&&!g(i)&&h(i),v(a)},"aria-label":c,tabIndex:parseInt(u),"data-disabled":s?`disabled`:void 0,"data-date":a,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),m(i))},onClick:e=>{s||(e.preventDefault(),m(i))},children:(0,n.jsx)(`span`,{className:`pkt-btn__text pkt-txt-14-light`,children:e})})},a)},w=(e,t)=>(0,n.jsx)(`td`,{className:`pkt-cal-other`,children:(0,n.jsx)(`div`,{className:`pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only`,"data-disabled":`disabled`,children:(0,n.jsx)(`span`,{className:`pkt-btn__text pkt-txt-14-light`,children:e})})},t);return(0,n.jsxs)(`table`,{className:`pkt-cal-days pkt-txt-12-medium pkt-calendar__body`,role:`grid`,"aria-multiselectable":l||u||void 0,children:[(0,n.jsx)(`thead`,{children:S()}),(0,n.jsx)(`tbody`,{children:(()=>{let e=y,t=tl(r,i);f.current=[],p.current=0;let a=1,o=t.initialWeek,s=[];for(let r=0;r<t.numRows;r++){let i=[];d&&i.push((0,n.jsx)(`td`,{className:`pkt-cal-week`,children:o},`week-${o}`)),o++;for(let n=0;n<7;n++){let o=nl(r,n,a,t);if(o===`current-month`)i.push(C(a,e)),a++;else{let e=rl(o,n,a,t);i.push(w(e,`${o}-${r}-${n}`)),o===`next-month`&&a++}}s.push((0,n.jsx)(`tr`,{className:`pkt-cal-week-row`,role:`row`,children:i},`row-${r}`))}return s})()})]})},hl=(0,t.forwardRef)((e,r)=>{let i=ll(e);return(0,t.useImperativeHandle)(r,()=>({handleDateSelect:i.handleDateSelect,addToSelected:i.addToSelected,removeFromSelected:i.removeFromSelected,toggleSelected:i.toggleSelectedDate,focusOnCurrentDate:i.focusOnCurrentDate,close:i.close}),[i.handleDateSelect,i.addToSelected,i.removeFromSelected,i.toggleSelectedDate,i.focusOnCurrentDate,i.close]),(0,n.jsxs)(`div`,{ref:i.calendarRef,className:[`pkt-calendar`,i.weeknumbers&&`pkt-cal-weeknumbers`,i.className].filter(Boolean).join(` `),onBlur:i.handleFocusOut,onKeyDown:i.handleKeydown,children:[(0,n.jsx)(ul,{componentId:i.componentId,strings:i.strings,year:i.year,month:i.month,earliest:i.earliest,latest:i.latest,withcontrols:i.withcontrols,prevMonth:i.prevMonth,nextMonth:i.nextMonth,changeMonth:i.changeMonth}),(0,n.jsx)(ml,{state:i})]})});hl.displayName=`PktCalendar`;var gl=(0,t.forwardRef)(({children:e,skin:r,textStyle:i,size:a,closeTag:o,className:s,iconName:c,ariaLabel:l,onClose:u,type:d,"aria-description":f,...p},m)=>{let[h,g]=(0,t.useState)(!1),_=(0,t.useCallback)(()=>{g(!0),u&&u()},[u]),v=(0,t.useRef)(null),[y,b]=(0,t.useState)(``);(0,t.useEffect)(()=>{b(v.current?.textContent?.trim()??``)},[e]);let x=(0,t.useMemo)(()=>{if(o&&!l)return y&&`Klikk for å fjerne ${y}`||f},[o,l,y,f]),S={"pkt-tag":!0,[`pkt-tag--${a}`]:!!a,[`pkt-tag--${r}`]:!!r,[`pkt-tag--${i}`]:!!i},C={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${a}`]:!!a,[`pkt-tag--${r}`]:!!r,"pkt-btn--icons-right-and-left":o&&!!c,"pkt-hide":h};return o?(0,n.jsxs)(`button`,{...p,className:(0,$.default)(C,s),type:d,onClick:_,"aria-label":l,"aria-description":x,ref:m,children:[c&&(0,n.jsx)(Q,{className:`pkt-tag__icon`,name:c}),(0,n.jsx)(`span`,{ref:v,children:e}),(0,n.jsx)(Q,{className:`pkt-tag__close-btn`,name:`close`})]}):(0,n.jsxs)(`span`,{...p,className:(0,$.default)(S,s),ref:m,children:[c&&(0,n.jsx)(Q,{className:`pkt-tag__icon`,name:c,"aria-hidden":`true`}),(0,n.jsx)(`span`,{ref:v,children:e})]})});gl.displayName=`PktTag`;var _l=(0,t.forwardRef)(({children:e,className:t,ariaLabel:r,metaLead:i,borderOnHover:a=!0,metaTrail:o,layout:s=`vertical`,heading:c=``,headingLevel:l=3,image:u,imageShape:d=`square`,clickCardLink:f,padding:p=`default`,openLinkInNewTab:m=!1,skin:h=`outlined`,subheading:g=``,tagPosition:_=`top`,tags:v=[],...y},b)=>{let x=(0,$.default)({"pkt-card":!0,[`pkt-card--${h}`]:h,[`pkt-card--${s}`]:s,[`pkt-card--padding-${p}`]:p,"pkt-card--border-on-hover":a}),S=r?.trim()||(c?`${c} lenkekort`:`lenkekort`),C=r?.trim()||c||`kort`,w=`h${l}`,ee=()=>u?.src?(0,n.jsx)(`div`,{className:(0,$.default)(`pkt-card__image`,`pkt-card__image-${d}`),children:(0,n.jsx)(`img`,{src:u.src,alt:u.alt||``})}):null,T=()=>v.length===0?null:(0,n.jsx)(`div`,{className:(0,$.default)(`pkt-card__tags`,`pkt-card__tags-${_}`),role:`list`,"aria-label":v.length>1?`merkelapper`:`merkelapp`,children:v.map((e,t)=>(0,n.jsx)(gl,{role:`listitem`,textStyle:`normal-text`,size:`medium`,skin:e.skin,iconName:e.iconName,children:(0,n.jsx)(`span`,{children:e.text})},t))}),E=()=>!c||f?null:(0,n.jsx)(w,{className:`pkt-heading pkt-heading--medium pkt-heading--fw-regular pkt-card__heading`,children:c}),te=()=>f?(0,n.jsx)(w,{className:`pkt-heading pkt-heading--medium pkt-heading--fw-regular pkt-card__link-heading pkt-card__heading`,children:(0,n.jsx)(`a`,{className:`pkt-card__link`,href:f,target:m?`_blank`:`_self`,rel:m?`noopener noreferrer`:void 0,children:c})}):null,ne=()=>g?(0,n.jsx)(`p`,{className:`pkt-card__subheading`,children:g}):null,re=()=>!c&&!g?null:(0,n.jsxs)(`header`,{className:`pkt-card__header`,children:[E(),te(),ne()]}),D=()=>!i&&!o?null:(0,n.jsxs)(`footer`,{className:`pkt-card__metadata`,children:[i&&(0,n.jsx)(`span`,{className:`pkt-card__metadata-lead`,children:i}),o&&(0,n.jsx)(`span`,{className:`pkt-card__metadata-trail`,children:o})]});return(0,n.jsx)(`div`,{ref:b,className:(0,$.default)(`pkt-card-root`,t),style:{display:`block`,width:`100%`},children:(0,n.jsxs)(`article`,{...y,className:x,"aria-label":f?S:C,children:[ee(),(0,n.jsxs)(`div`,{className:`pkt-card__wrapper`,children:[_===`top`&&T(),re(),(0,n.jsx)(`section`,{className:`pkt-card__content`,children:e}),_===`bottom`&&T(),D()]})]})})});_l.displayName=`PktCard`;var vl=(0,t.forwardRef)(({id:e,hasTile:r=!1,disabled:i=!1,label:a,checkHelptext:o,hasError:s=!1,className:c,isSwitch:l=!1,hideLabel:u=!1,labelPosition:d=`right`,defaultChecked:f,checked:p,indeterminate:m,optionalTag:h,optionalText:g=`Valgfritt`,requiredTag:_,requiredText:v=`Må fylles ut`,tagText:y,...b},x)=>{let S=(0,t.useRef)(null);(0,t.useEffect)(()=>{S.current&&m!==void 0&&(S.current.indeterminate=m)},[m]),(0,t.useEffect)(()=>{typeof x==`function`?x(S.current):x&&(x.current=S.current)},[x]);let C=[c,`pkt-input-check`].filter(Boolean).join(` `),w=[`pkt-input-check__input-label`,i?`pkt-input-check__input-label--disabled`:``,`pkt-input-check__input-label--${d}`,u?`pkt-sr-only`:``].filter(Boolean).join(` `),ee=[`pkt-input-check__input`,r?`pkt-input-check__input--tile`:``,i&&r?`pkt-input-check__input--tile-disabled`:``].filter(Boolean).join(` `),T=[`pkt-tag`,`pkt-tag--small`,`pkt-tag--thin-text`].join(` `),E=()=>(0,n.jsxs)(n.Fragment,{children:[y&&(0,n.jsx)(`span`,{className:T+` pkt-tag--gray`,children:y}),h&&(0,n.jsx)(`span`,{className:T+` pkt-tag--blue-light`,children:g}),_&&(0,n.jsx)(`span`,{className:T+` pkt-tag--beige`,children:v})]});return(0,n.jsx)(`div`,{className:C,children:(0,n.jsxs)(`div`,{className:ee,children:[d===`left`&&(0,n.jsxs)(`label`,{className:w,htmlFor:e,children:[a,` `,E(),o&&(0,n.jsx)(`div`,{className:`pkt-input-check__input-helptext`,children:o})]}),(0,n.jsx)(`input`,{role:l?`switch`:`checkbox`,ref:S,className:`pkt-input-check__input-checkbox ${s?`pkt-input-check__input-checkbox--error`:``}`,type:`checkbox`,id:e,disabled:i,...p===void 0?{defaultChecked:f}:{checked:p},...b}),d===`right`&&(0,n.jsxs)(`label`,{className:w,htmlFor:e,children:[a,` `,E(),o&&(0,n.jsx)(`div`,{className:`pkt-input-check__input-helptext`,children:o})]})]})})});vl.displayName=`PktCheckbox`;var yl=(0,t.forwardRef)(({forId:e,label:r,helptext:i,helptextDropdown:a,helptextDropdownButton:o,counter:s,counterCurrent:c=0,counterMaxLength:l,optionalTag:u=!1,optionalText:d=`Valgfritt`,requiredTag:f=!1,requiredText:p=`Må fylles ut`,tagText:m=null,hasError:h=!1,errorMessage:g,disabled:_=!1,inline:v=!1,ariaDescribedby:y,useWrapper:b=!0,children:x,className:S=``,hasFieldset:C=!1,role:w=`group`,counterPosition:ee=`bottom`},T)=>{let[E,te]=(0,t.useState)(!1),ne=y||(i?`${e}-helptext`:void 0),re=!!s,D=re&&ee===`top`,ie=re&&ee===`bottom`,ae=()=>te(e=>!e),oe=[`pkt-inputwrapper`,S,h?`pkt-inputwrapper--error`:``,_?`pkt-inputwrapper--disabled`:``,v?`pkt-inputwrapper--inline`:``].filter(Boolean).join(` `),se=[`pkt-tag`,`pkt-tag--small`,`pkt-tag--thin-text`].join(` `),ce=()=>re?(0,n.jsxs)(`div`,{className:`pkt-input__counter`,"aria-live":`polite`,"aria-atomic":`true`,children:[c,l?`/${l}`:``]}):null,O=()=>(0,n.jsxs)(n.Fragment,{children:[m&&(0,n.jsx)(`span`,{className:se+` pkt-tag--gray`,children:m}),u&&(0,n.jsx)(`span`,{className:se+` pkt-tag--blue-light`,children:d}),f&&(0,n.jsx)(`span`,{className:se+` pkt-tag--beige`,children:p})]}),le=(0,n.jsxs)(n.Fragment,{children:[(()=>{let t=(0,n.jsxs)(n.Fragment,{children:[r,` `,O()]});return b?C?(0,n.jsx)(`legend`,{className:`pkt-inputwrapper__legend`,id:`${e}-label`,children:t}):(0,n.jsx)(`label`,{className:`pkt-inputwrapper__label`,htmlFor:e,"aria-describedby":ne,id:`${e}-label`,children:t}):(0,n.jsx)(`label`,{htmlFor:e,className:`pkt-sr-only`,"aria-describedby":ne,id:`${e}-label`,children:r})})(),!i&&!a?null:(0,n.jsxs)(n.Fragment,{children:[i&&b&&(0,n.jsx)(`div`,{className:`pkt-inputwrapper__helptext`,id:`${e}-helptext`,children:i}),a&&(0,n.jsxs)(`div`,{className:`pkt-inputwrapper__helptext-expandable`,children:[(0,n.jsx)(es,{skin:`tertiary`,size:`small`,variant:`icon-right`,iconName:E?`chevron-thin-up`:`chevron-thin-down`,className:`pkt-link pkt-link--icon-right`,onClick:ae,children:(0,n.jsx)(`span`,{dangerouslySetInnerHTML:{__html:o??`Les mer <span class="pkt-sr-only">om inputfeltet</span>`}})}),(0,n.jsx)(`div`,{className:`pkt-inputwrapper__helptext ${E?`pkt-inputwrapper__helptext-expandable-open`:`pkt-inputwrapper__helptext-expandable-closed`}`,children:a})]})]}),D&&(0,n.jsx)(ce,{}),x,ie&&(0,n.jsx)(ce,{}),h&&g&&(0,n.jsx)(`div`,{className:`pkt-inputwrapper__alert-wrapper`,children:(0,n.jsx)(Zo,{skin:`error`,"aria-live":`assertive`,role:`alert`,id:`${e}-error`,compact:!0,children:g})})]});return(0,n.jsx)(`div`,{className:oe,ref:T,role:w,children:C?(0,n.jsx)(`fieldset`,{className:`pkt-inputwrapper__fieldset`,"aria-describedby":ne,children:le}):(0,n.jsx)(`div`,{className:`pkt-inputwrapper__fieldset`,children:le})})});yl.displayName=`PktInputWrapper`;var bl=(e,t)=>t&&(e.find(e=>e.value===t)||e.find(e=>e.label===t))||null,xl=(e,t)=>{if(!t)return-1;let n=e.findIndex(e=>e.value===t);return n>=0?n:e.findIndex(e=>e.label===t)},Sl=(e,t)=>{if(!t)return[...e];let n=t.toLowerCase();return e.filter(e=>(e.fulltext||e.value+(e.label||``)+(e.prefix||``)).toLowerCase().includes(n))},Cl=e=>e.value+(e.label||``)+(e.prefix||``),wl=(e,t)=>t!==null&&e>=t,Tl=(e,t)=>{if(!e)return``;switch(t){case`prefixAndValue`:return`${e.prefix||``} ${e.value}`.trim();case`value`:return e.value;default:return e.label||e.value}},El=(e,t)=>e?Array.isArray(e)?t?e:e.length>0?[e[0]]:[]:t?e.split(`,`).filter(Boolean):[e]:[],Dl=(e,t)=>{if(!t)return{filtered:[...e],suggestion:null};let n=t.toLowerCase(),r=e.filter(e=>e.fulltext?.toLowerCase().includes(n));return{filtered:r,suggestion:r.find(e=>!e.selected&&e.label?.toLowerCase().startsWith(n))||null}},Ol=(e,t,n,r)=>{if(!e.trim())return{addValueText:null,userInfoMessage:``};let i=e.trim().toLowerCase(),a=t.find(e=>e.toLowerCase()===i),o=n.filter(e=>e.label?.toLowerCase().includes(i)||e.value.toLowerCase().includes(i)),s=o.find(e=>e.label?.toLowerCase()===i||e.value.toLowerCase()===i);return(o.length===0||!s)&&r?{addValueText:e,userInfoMessage:``}:o.length===0&&!r?{addValueText:null,userInfoMessage:`Ingen treff i søket`}:a?{addValueText:null,userInfoMessage:`Verdien er allerede valgt`}:{addValueText:null,userInfoMessage:``}},kl=(e,t,n)=>{switch(e){case`,`:return n?`addValue`:null;case`Enter`:return`addValue`;case`Tab`:case`ArrowDown`:return t?null:`focusListbox`;case`Escape`:return`closeOptions`;default:return null}},Al=(e,t,n,r,i)=>{if(!e)return{action:`none`,value:null};let a=bl(n,e);return!t.includes(e)&&!a?r?{action:`addUserValue`,value:e}:i?{action:`none`,value:null}:{action:`removeValue`,value:t[0]}:a&&!t.includes(a.value)?{action:`selectOption`,value:a.value}:{action:`none`,value:null}},jl=(e,t,n)=>{let r=bl(t,e);return n===`label`&&r?.label?r.label:e},Ml=e=>{e.scrollIntoView({block:`nearest`}),window.setTimeout(()=>e.focus(),0)},Nl=e=>Array.from(e.querySelectorAll(`[role="option"]:not([data-disabled])`)||[]),Pl=e=>{let t=e.nextElementSibling;t&&Ml(t)},Fl=(e,t,n)=>{let r=e.previousElementSibling;if(e.dataset.index===`0`&&n){let e=t.querySelector(`[role="searchbox"]`);e&&Ml(e)}else r&&Ml(r)},Il=e=>{let t=Nl(e);t[0]&&Ml(t[0])},Ll=(e,t)=>{if(t.disabled)return;let n=Nl(e);if(t.allowUserInput&&t.customUserInput){let t=e.querySelector(`[data-type="new-option"]`);if(t){Ml(t);return}}let r=n.find(e=>e.dataset.selected===`true`);if(r){Ml(r);return}if(t.includeSearch&&!(document.activeElement instanceof HTMLInputElement)){let t=e.querySelector(`[role="searchbox"]`);if(t){window.setTimeout(()=>t.focus(),0);return}}n[0]&&Ml(n[0])},Rl=({state:e,outside:r=!1})=>{let{values:i,options:a,disabled:o,displayValueAs:s,handleTagRemove:c,handleTagKeydown:l,focusedTagIndex:u}=e,d=(0,t.useRef)([]);if((0,t.useEffect)(()=>{!r&&u>=0&&u<i.length&&d.current[u]?.focus()},[r,u,i.length]),i.length===0)return null;let f=i.map((e,t)=>{let i=bl(a,e),f=i?.tagSkinColor,p=i?Tl(i,s):e;return o?(0,n.jsx)(`li`,{role:`listitem`,children:(0,n.jsx)(gl,{skin:f||`blue-dark`,children:(0,n.jsx)(`span`,{className:`pkt-combobox__value`,children:p})})},e):r?(0,n.jsx)(`li`,{role:`listitem`,children:(0,n.jsx)(gl,{skin:f||`blue-dark`,closeTag:!0,onClose:()=>c(e),children:(0,n.jsx)(`span`,{className:`pkt-combobox__value`,children:p})})},e):(0,n.jsx)(`li`,{role:`listitem`,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.preventDefault(),children:(0,n.jsx)(gl,{ref:e=>{d.current[t]=e},skin:f||`blue-dark`,closeTag:!0,tabIndex:u===t?0:-1,onClose:()=>c(e),onKeyDown:e=>l(e,t),children:(0,n.jsx)(`span`,{className:`pkt-combobox__value`,children:p})})},e)});return r?(0,n.jsx)(`div`,{className:`pkt-combobox__tags-outside`,children:(0,n.jsx)(`ul`,{role:`list`,className:`pkt-combobox__tag-list`,children:f})}):(0,n.jsx)(`ul`,{role:`list`,className:`pkt-combobox__tag-list`,children:f})},zl=({state:e})=>{let{values:t,options:r,editingSingleValue:i,displayValueAs:a}=e;if(i||t.length===0)return null;let o=bl(r,t[0]);return o?(0,n.jsx)(`span`,{className:`pkt-combobox__value`,children:Tl(o,a)}):null},Bl=({state:e})=>{let{id:t,inputId:r,listboxId:i,values:a,options:o,isOpen:s,multiple:c,typeahead:l,allowUserInput:u,tagPlacement:d,placeholder:f,disabled:p,fullwidth:m,hasError:h,label:g,inputFocus:_,inputRef:v,triggerRef:y,handleInputChange:b,handleInputKeydown:x,handleInputFocus:S,handleInputBlur:C,handleInputClick:w,handlePlaceholderClick:ee,handleSelectOnlyKeydown:T,name:E}=e,te=[`pkt-combobox__input`,m&&`pkt-combobox__input--fullwidth`,s&&`pkt-combobox__input--open`,h&&`pkt-combobox__input--error`,p&&`pkt-combobox__input--disabled`].filter(Boolean).join(` `),ne=[`pkt-combobox__arrow-icon`,s&&`pkt-combobox__arrow-icon--open`].filter(Boolean).join(` `),re=l||u,D=!re&&f&&(!a.length||c&&d===`outside`)&&!_,ie=d!==`outside`,ae=a[0]&&bl(o,a[0])?`${i}-${xl(o,a[0])}`:void 0,oe=c&&a.length>0?`${a.length} valgt`:void 0;return(0,n.jsxs)(`div`,{ref:y,className:te,onClick:w,...re?{tabIndex:-1}:{id:`${t}-combobox`,role:`combobox`,"aria-expanded":s?`true`:`false`,"aria-controls":i,"aria-haspopup":`listbox`,"aria-labelledby":`${t}-combobox-label`,"aria-activedescendant":ae,"aria-description":oe,tabIndex:p?-1:0,onKeyDown:T},children:[D?(0,n.jsx)(`span`,{className:`pkt-combobox__placeholder`,onClick:ee,children:f}):ie?c?(0,n.jsx)(Rl,{state:e}):re?null:(0,n.jsx)(zl,{state:e}):null,re?(0,n.jsx)(`div`,{className:`pkt-combobox__input-div combobox__input`,children:(0,n.jsx)(`input`,{ref:v,type:`text`,id:r,name:`${E||t}-input`,onChange:b,onKeyDown:x,onFocus:S,onBlur:C,placeholder:!a.length||c&&d===`outside`?f:void 0,autoComplete:`off`,role:`combobox`,"aria-expanded":s?`true`:`false`,"aria-label":g,"aria-autocomplete":l?`both`:u?`list`:`none`,"aria-controls":i,"aria-activedescendant":ae,"aria-description":oe,disabled:p})}):(0,n.jsx)(`input`,{ref:v,type:`hidden`,id:r,name:`${E||t}-input`,value:a.join(`,`),readOnly:!0}),(0,n.jsx)(Q,{className:ne,name:`chevron-thin-down`,"aria-hidden":`true`})]})},Vl=({state:e})=>{let{listboxId:t,label:r,isOpen:i,options:a,filteredOptions:o,multiple:s,disabled:c,maxIsReached:l,maxlength:u,includeSearch:d,allowUserInput:f,addValueText:p,userInfoMessage:m,searchPlaceholder:h,searchValue:g,handleOptionClick:_,handleOptionKeydown:v,handleSearchInput:y,handleSearchKeydown:b,handleNewOptionClick:x,handleNewOptionKeydown:S,listboxRef:C}=e,w=o.filter(e=>e.selected).length,ee=s&&w>0&&u!=null&&u>0,T=f&&p&&!l,E=!!m;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(`div`,{ref:C,id:t,className:[`pkt-listbox`,i&&`pkt-listbox__open`,`pkt-txt-16-light`].filter(Boolean).join(` `),role:o.length>0?`listbox`:void 0,"aria-label":o.length>0?`Liste: ${r||``}`:void 0,"aria-multiselectable":o.length>0&&s?`true`:void 0,children:[(0,n.jsxs)(`div`,{className:`pkt-listbox__banners`,children:[d&&(0,n.jsxs)(`div`,{className:`pkt-listbox__search`,children:[(0,n.jsx)(`span`,{className:`pkt-listbox__search-icon`,children:(0,n.jsx)(Q,{name:`magnifying-glass-small`})}),(0,n.jsx)(`input`,{className:`pkt-txt-16-light`,type:`text`,"aria-label":`Søk i listen`,form:``,placeholder:h||`Søk...`,onChange:y,onKeyDown:b,value:g,"data-type":`searchbox`,disabled:c,readOnly:c,role:`searchbox`})]}),ee&&(0,n.jsxs)(`div`,{className:`pkt-listbox__banner pkt-listbox__banner--maximum-reached`,children:[w,` av maks `,u,` mulige er valgt.`]}),E&&(0,n.jsxs)(`div`,{className:`pkt-listbox__banner pkt-listbox__banner--user-message`,children:[(0,n.jsx)(Q,{className:`pkt-listbox__banner-icon`,name:`exclamation-mark-circle`}),m]}),T&&(0,n.jsxs)(`div`,{className:`pkt-listbox__banner pkt-listbox__banner--new-option pkt-listbox__option`,"data-type":`new-option`,"data-value":p,"data-selected":`false`,tabIndex:0,onClick:()=>x(p),onKeyDown:S,children:[(0,n.jsx)(Q,{className:`pkt-listbox__banner-icon`,name:`plus-sign`}),`Legg til "`,p,`"`]}),a.length===0&&o.length===0&&!E&&(0,n.jsxs)(`div`,{className:`pkt-listbox__banner pkt-listbox__banner--empty`,children:[(0,n.jsx)(Q,{className:`pkt-listbox__banner-icon`,name:`exclamation-mark-circle`}),`Tom liste`]})]}),(0,n.jsx)(`ul`,{className:`pkt-listbox__options`,role:`presentation`,children:o.map((e,r)=>{let i=[`pkt-listbox__option`,!s&&e.selected&&`pkt-listbox__option--selected`,s&&`pkt-listbox__option--checkBox`].filter(Boolean).join(` `),a=c||e.disabled||l&&!e.selected;return(0,n.jsxs)(`li`,{className:i,onClick:()=>_(e.value),onKeyDown:t=>v(t,e.value),"aria-selected":e.selected?`true`:`false`,tabIndex:a?-1:0,"data-index":r,"data-value":e.value,"data-selected":e.selected?`true`:`false`,"data-disabled":a||void 0,"aria-disabled":a?`true`:`false`,role:`option`,id:`${t}-${r}`,children:[s?(0,n.jsx)(`input`,{className:`pkt-input-check__input-checkbox`,type:`checkbox`,tabIndex:-1,value:e.value,checked:e.selected||!1,readOnly:!0,"aria-hidden":`true`,disabled:a}):e.selected?(0,n.jsx)(Q,{name:`check-big`}):null,(0,n.jsxs)(`span`,{className:`pkt-listbox__option-label`,id:`${t}-option-label-${r}`,children:[e.prefix&&(0,n.jsx)(`span`,{className:`pkt-listbox__option-prefix`,children:e.prefix}),e.label||e.value]}),e.description&&(0,n.jsx)(`span`,{className:`pkt-listbox__option-description pkt-txt-14-light`,children:e.description})]},`${e.value}-${r}`)})})]}),(0,n.jsx)(`div`,{"aria-live":`polite`,className:`pkt-visually-hidden`,children:m})]})};function Hl(e,t){return e.map(e=>({...e,label:e.label||e.value,fulltext:Cl(e),selected:t.includes(e.value)}))}function Ul(e,n){let{id:r=``,label:i,value:a,defaultValue:o,options:s,defaultOptions:c,multiple:l=!1,maxlength:u,typeahead:d=!1,includeSearch:f=!1,allowUserInput:p=!1,displayValueAs:m=`label`,tagPlacement:h,searchPlaceholder:g,placeholder:_,disabled:v=!1,required:y=!1,fullwidth:b=!1,hasError:x=!1,errorMessage:S,helptext:C,helptextDropdown:w,helptextDropdownButton:ee,optionalTag:T=!1,optionalText:E,requiredTag:te=!1,requiredText:ne,tagText:re,useWrapper:D=!0,name:ie,className:ae,onChange:oe,onValueChange:se,children:ce}=e,O=`${r}-input`,le=`${r}-listbox`,k=d||p,A=(0,t.useRef)(null),ue=(0,t.useRef)(null),de=(0,t.useRef)(null),j=(0,t.useRef)(null),M=(0,t.useRef)(null),N=(0,t.useCallback)(()=>{k?A.current?.focus():de.current?.focus()},[k]),P=(0,t.useMemo)(()=>{let e=[];return t.Children.forEach(ce,n=>{if((0,t.isValidElement)(n)&&n.type===`option`){let t=n.props;e.push({value:t.value??t.children??``,label:t.children??t.value??``,selected:t.selected,disabled:t.disabled})}}),e},[ce]),F=(0,t.useMemo)(()=>c&&c.length>0?c.map(e=>({...e,fulltext:Cl(e)})):s&&s.length>0?s.map(e=>({...e,fulltext:Cl(e)})):P.length>0?P.map(e=>({...e,fulltext:Cl(e)})):[],[c,s,P]),I=a!==void 0,[fe,pe]=(0,t.useState)(()=>El(a??o,l)),me=(0,t.useRef)(fe);(0,t.useEffect)(()=>{I&&pe(El(a,l))},[a,I,l]);let L=I?El(a,l):fe,[he,ge]=(0,t.useState)([]),R=(0,t.useMemo)(()=>Hl([...he.filter(e=>!F.some(t=>t.value===e.value)),...F],L),[F,he,L]),[z,B]=(0,t.useState)(!1),[_e,V]=(0,t.useState)(``),[ve,ye]=(0,t.useState)(``),[H,be]=(0,t.useState)(``),[xe,Se]=(0,t.useState)(null),[Ce,we]=(0,t.useState)(!1),[Te,Ee]=(0,t.useState)(!1),[De,Oe]=(0,t.useState)(-1),ke=(0,t.useRef)(!1),Ae=wl(L.length,u??null),je=l&&u!=null,Me=(0,t.useMemo)(()=>_e?d?Dl(R,_e).filtered:Sl(R,_e):R,[R,_e,d]),Ne=(0,t.useMemo)(()=>Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`)?.set,[]),Pe=(0,t.useCallback)(e=>{let t=ue.current;if(!t||!Ne)return;let n=l?e.join(`,`):e[0]||``;Ne.call(t,n),t.dispatchEvent(new Event(`input`,{bubbles:!0}))},[Ne,l]),Fe=l?L.join(`,`):L[0]||``;(0,t.useEffect)(()=>{ue.current&&(ue.current.value=Fe)},[Fe]),(0,t.useEffect)(()=>{if(z||l||!A.current)return;let e=L[0]?jl(L[0],R,m):``;A.current.value!==e&&(A.current.value=e)},[L,R,m,l,z]);let Ie=(0,t.useCallback)((e,t=!0)=>{I||pe(e),t&&(se?.(e),Pe(e))},[I,se,Pe]),Le=(0,t.useCallback)(e=>{if(e&&!L.includes(e)){if(l&&wl(L.length,u??null)){be(`Maks antall valg nådd`);return}Ie(l?[...L,e]:[e])}},[L,l,u,Ie]),Re=(0,t.useCallback)(e=>{if(!e)return;let t=L.filter(t=>t!==e);bl(R,e)?.userAdded&&ge(t=>t.filter(t=>t.value!==e)),Ie(t)},[L,R,Ie]),ze=(0,t.useCallback)(()=>{ge([]),Ie([])},[Ie]),Be=(0,t.useCallback)(e=>{if(!e||e.trim()===``)return;let t;if(!l)t=[e];else{if(bl(R,e)||wl(L.length,u??null))return;t=[...L,e]}let n={value:e,label:e,userAdded:!0,selected:!0};ge(t=>[n,...t.filter(t=>t.value!==e)]),Ie(t)},[l,R,L,u,Ie]),Ve=(0,t.useCallback)((e=!0,t)=>{if(Se(null),e&&A.current&&A.current.type!==`hidden`){V(``),ye(``);let e=t===void 0?L[0]:t;!l&&e?A.current.value=jl(e,R,m):A.current.value=``,l||(Ee(!1),be(``))}},[l,L,R,m]),He=(0,t.useCallback)(e=>{if(v)return;be(``),Se(null);let t=bl(R,e)?.value||null,n=L.includes(e||t||``),r=!!t,i=R.find(t=>t.value===e)?.disabled||!1,a=!e?.trim(),o=!l,s=l,c=wl(L.length,u??null),d=!1,f=!0,m=``,h=``,g;i||(!r&&p&&!a?(Be(e),m=`Ny verdi lagt til`,d=s,o&&(g=e||``)):!r&&!p?(o&&L[0]&&Re(L[0]),f=!1,d=!0,m=`Ingen treff i søket`):n?(Re(t),d=!0,g=``,o&&k&&A.current&&A.current.type!==`hidden`&&(A.current.value=``)):a&&o?(ze(),d=!0,g=``):o?(L[0]&&Re(L[0]),Le(t),d=!1,g=t||``):s&&!c?(Le(t),d=!0):s&&c?(m=`Maks antall valg nådd`,f=!1,h=e||``):(o&&ze(),m=`Ingen gyldig verdi valgt`,f=!1,d=!0,h=e||``,g=``),B(d),be(m),V(h),Ve(f,g),d||(o&&k&&(ke.current=!0),window.setTimeout(()=>{N()},0)))},[v,R,L,l,u,p,Be,Re,ze,Le,Ve,N]),Ue=(0,t.useCallback)(()=>{if(we(!1),Se(null),be(``),V(``),A.current&&A.current.type!==`hidden`){let e=A.current.value,t=L[0];if(!l)if(!e)L[0]&&Re(L[0]),t=void 0;else{let n=bl(R,e);n&&n.value!==L[0]?(L[0]&&Re(L[0]),Le(n.value),t=n.value):!n&&p&&(L[0]&&Re(L[0]),Be(e),t=e)}else if(e!==``){let{action:t,value:n}=Al(e,L,R,p,l);switch(t){case`addUserValue`:Be(n);break;case`selectOption`:Le(n);break;case`removeValue`:Re(n);break}}!l&&t?A.current.value=jl(t,R,m):A.current.value=``}B(!1),Ee(!1)},[L,R,p,l,m,Be,Le,Re]),We=(0,t.useCallback)(e=>{if(!e.trim().toLowerCase()){Se(null),be(``),!l&&L[0]&&Re(L[0]);return}let t=Ol(e,L,R,p);Se(t.addValueText),be(t.userInfoMessage)},[L,R,p,l,Re]),U=(0,t.useCallback)(e=>{if(v)return;let t=e.target.value;if(ye(t),V(t),We(t),d&&t){let{suggestion:n}=Dl(R,t);n?.label&&A.current&&!e.nativeEvent.inputType?.includes(`deleteContent`)&&(A.current.value=n.label,window.setTimeout(()=>A.current?.setSelectionRange(t.length,n.label.length),0))}},[v,d,R,We]),W=(0,t.useCallback)(e=>{if(e.key===`Backspace`){let t=!A.current?.value;if(!_e&&t&&l&&L.length>0){e.preventDefault();let t=L[L.length-1];Re(t)}return}if(e.key===`ArrowLeft`&&l&&L.length>0&&(A.current?.selectionStart??0)===0&&!A.current?.value){e.preventDefault(),Oe(L.length-1);return}let t=kl(e.key,e.shiftKey,l);if(t&&!(e.key===`Tab`&&!z)){if(t===`focusListbox`&&e.key===`Tab`&&!j.current?.querySelector(`[role="option"]:not([data-disabled]), [data-type="new-option"]`)){Ue();return}switch(e.preventDefault(),t){case`addValue`:{let e=A.current?.value.trim()||``;if(V(e),e&&L.includes(e)){Ve(!0),be(`Verdien er allerede valgt`);break}He(e);break}case`focusListbox`:j.current&&(z||B(!0),Ll(j.current,{disabled:v,allowUserInput:p,customUserInput:xe,includeSearch:f}));break;case`closeOptions`:B(!1);break}}},[_e,L,l,v,p,xe,f,z,Re,He,N]),Ge=(0,t.useCallback)(()=>{if(!v){if(ke.current){ke.current=!1,we(!0);return}!l&&L[0]&&A.current&&A.current.type!==`hidden`&&(Ee(!0),A.current.value=jl(L[0],R,m)),we(!0),V(``),B(!0)}},[v,l,L,R,m]),Ke=(0,t.useCallback)(()=>{we(!1),Ee(!1)},[]),qe=(0,t.useCallback)(e=>{if(v||!z)return;let t=e.relatedTarget,n=M.current;n&&t&&n.contains(t)||Ue()},[v,z,Ue]),Je=(0,t.useCallback)(e=>{if(v){e.preventDefault(),e.stopPropagation();return}if(k)A.current?.focus();else{e.stopPropagation(),e.preventDefault();let t=!z;B(t),t&&j.current&&Ll(j.current,{disabled:v,allowUserInput:p,customUserInput:xe,includeSearch:f})}},[v,k,z,p,xe,f]),G=(0,t.useCallback)(e=>{v||(e.stopPropagation(),k&&A.current?(A.current.focus(),we(!0)):B(e=>!e))},[v,k]),Ye=(0,t.useCallback)(e=>{if(!v)switch(e.key){case`Enter`:case` `:case`ArrowDown`:case`ArrowUp`:e.preventDefault(),z?B(!1):(B(!0),j.current&&window.setTimeout(()=>{j.current&&Ll(j.current,{disabled:v,allowUserInput:p&&!Ae,customUserInput:xe,includeSearch:f})},0));break;case`Escape`:z&&(e.preventDefault(),B(!1));break;case`Home`:case`End`:e.preventDefault(),z||B(!0),j.current&&window.setTimeout(()=>{j.current&&Ll(j.current,{disabled:v,allowUserInput:p&&!Ae,customUserInput:xe,includeSearch:f})},0);break;case`ArrowLeft`:l&&L.length>0&&(e.preventDefault(),Oe(L.length-1));break;case`Backspace`:case`Delete`:if(l&&L.length>0){e.preventDefault();let t=L[L.length-1];Re(t)}break}},[v,z,p,Ae,xe,f,l,L,Re]),Xe=(0,t.useCallback)(e=>{He(e)},[He]),Ze=(0,t.useCallback)((e,t)=>{switch(e.key){case`Enter`:case` `:e.preventDefault(),He(t);break;case`ArrowDown`:e.preventDefault(),Pl(e.currentTarget);break;case`ArrowUp`:e.preventDefault(),j.current&&Fl(e.currentTarget,j.current,f);break;case`Escape`:e.preventDefault(),B(!1),N();break;case`Tab`:Ue();break}},[He,f,N,Ue]),Qe=(0,t.useCallback)(e=>{Re(e),Oe(-1),k&&A.current&&(we(!0),A.current.focus())},[Re,k]),$e=(0,t.useCallback)((e,t)=>{switch(e.stopPropagation(),e.key){case`ArrowLeft`:e.preventDefault(),t>0&&Oe(t-1);break;case`ArrowRight`:e.preventDefault(),t<L.length-1?Oe(t+1):(Oe(-1),k&&A.current?A.current.focus():de.current?.focus());break;case`Backspace`:case`Delete`:e.preventDefault();{let e=L[t],n=t>=L.length-1?t-1:t;Re(e),n>=0?Oe(n):(Oe(-1),k&&A.current?A.current.focus():de.current?.focus())}break;case`Tab`:Oe(-1);break;case`Escape`:e.preventDefault(),Oe(-1),k&&A.current?A.current.focus():de.current?.focus();break}},[L,k,Re]),K=(0,t.useCallback)(e=>{V(e.target.value),We(e.target.value)},[We]),et=(0,t.useCallback)(e=>{switch(e.key){case`ArrowDown`:e.preventDefault(),j.current&&j.current.querySelector(`[role="option"]:not([data-disabled]), [data-type="new-option"]`)?.focus();break;case`Tab`:Ue();break;case`Escape`:e.preventDefault(),B(!1),N();break}},[N,Ue]),tt=(0,t.useCallback)(e=>{He(e)},[He]),nt=(0,t.useCallback)(e=>{switch(e.key){case`Enter`:case` `:e.preventDefault(),He(e.currentTarget.dataset.value||``);break;case`ArrowDown`:e.preventDefault(),j.current&&Il(j.current);break;case`ArrowUp`:e.preventDefault(),j.current&&Fl(e.currentTarget,j.current,f);break;case`Escape`:e.preventDefault(),B(!1),N();break}},[He,f,N]);return(0,t.useEffect)(()=>{if(!z)return;let e=e=>{let t=e.target;M.current&&!M.current.contains(t)&&Ue()};return document.addEventListener(`click`,e,!0),()=>{document.removeEventListener(`click`,e,!0)}},[z,Ue]),(0,t.useEffect)(()=>{let e=M.current?.closest(`form`);if(!e)return;let t=()=>{window.setTimeout(()=>{if(pe(me.current),ge([]),ye(``),V(``),Se(null),be(``),ue.current){let e=l?me.current.join(`,`):me.current[0]||``;ue.current.value=e}},0)};return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)},[l]),(0,t.useImperativeHandle)(n,()=>({get value(){return ue.current?.value??``},set value(e){let t=Array.isArray(e)?e:e?String(e).split(`,`).filter(Boolean):[];I||pe(t),ue.current&&(ue.current.value=t.join(`,`))},focus(){k?A.current?.focus():de.current?.focus()},blur(){k?A.current?.blur():de.current?.blur()}}),[I]),{id:r,inputId:O,listboxId:le,values:L,inputValue:ve,searchValue:_e,options:R,filteredOptions:Me,isOpen:z,userInfoMessage:H,addValueText:xe,maxIsReached:Ae,editingSingleValue:Te,inputFocus:Ce,focusedTagIndex:De,label:i,multiple:l,maxlength:u,typeahead:d,includeSearch:f,allowUserInput:p,displayValueAs:m,tagPlacement:h,searchPlaceholder:g,placeholder:_,disabled:v,required:y,fullwidth:b,hasError:x,errorMessage:S,helptext:C,helptextDropdown:w,helptextDropdownButton:ee,optionalTag:T,optionalText:E,requiredTag:te,requiredText:ne,tagText:re,useWrapper:D,name:ie,className:ae,hasCounter:je,inputRef:A,changeInputRef:ue,triggerRef:de,listboxRef:j,wrapperRef:M,handleInputChange:U,handleInputKeydown:W,handleInputFocus:Ge,handleInputBlur:Ke,handleFocusOut:qe,handleInputClick:Je,handlePlaceholderClick:G,handleSelectOnlyKeydown:Ye,handleOptionClick:Xe,handleOptionKeydown:Ze,handleTagRemove:Qe,handleTagKeydown:$e,handleSearchInput:K,handleSearchKeydown:et,handleNewOptionClick:tt,handleNewOptionKeydown:nt,onChange:oe}}var Wl=(0,t.forwardRef)((e,t)=>{let r=Ul(e,t),i=[`pkt-combobox-component`,r.fullwidth&&`pkt-combobox-component--fullwidth`,r.className].filter(Boolean).join(` `),a=r.allowUserInput||r.typeahead,o=a?r.inputId:`${r.id}-combobox`;return(0,n.jsxs)(`div`,{className:i,ref:r.wrapperRef,id:r.id||void 0,children:[(0,n.jsxs)(yl,{forId:o,hasFieldset:!a,label:r.label||``,helptext:r.helptext,helptextDropdown:r.helptextDropdown,helptextDropdownButton:r.helptextDropdownButton,hasError:r.hasError,errorMessage:r.errorMessage,disabled:r.disabled,optionalTag:r.optionalTag,optionalText:r.optionalText,requiredTag:r.requiredTag,requiredText:r.requiredText,tagText:r.tagText,useWrapper:r.useWrapper,counter:r.hasCounter,counterCurrent:r.values.length,counterMaxLength:r.maxlength,className:`pkt-combobox__wrapper`,children:[(0,n.jsxs)(`div`,{className:`pkt-combobox`,onBlur:r.handleFocusOut,children:[(0,n.jsx)(Bl,{state:r}),(0,n.jsx)(Vl,{state:r})]}),r.tagPlacement===`outside`&&r.multiple&&(0,n.jsx)(Rl,{state:r,outside:!0})]}),(0,n.jsx)(`input`,{ref:r.changeInputRef,type:`text`,name:r.name||r.id,onChange:r.onChange,tabIndex:-1,"aria-hidden":`true`,className:`pkt-visually-hidden`})]})});Wl.displayName=`PktCombobox`;var Gl=x({tagName:`pkt-consent`,elementClass:Ja,react:t.default,displayName:`PktConsent`,events:{onToggleConsent:`toggle-consent`}});Gl.displayName=`PktConsent`;var Kl=()=>{let e=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(e)||/Macintosh/.test(e)&&`ontouchend`in document)},ql=()=>Kl()?`text`:`date`,Jl=e=>!e||e.length!==2?!0:Uc(e[0],e[1]),Yl=(e,t,n,r,i,a)=>({"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":e,"pkt-datepicker--hasrangelabels":t,"pkt-datepicker--multiple":n,"pkt-datepicker--range":r,"ios-readonly-hack":i===!1&&a===`text`}),Xl=()=>({"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}),Zl=e=>({"pkt-input-prefix":e,"pkt-hide":!e}),Ql=(e,t,n)=>!t&&!n?Array.isArray(e)?e[0]||``:e:Array.isArray(e)?e.join(`,`):e,$l=(e,t,n=!1)=>{if(!e||!t)return;let r=t.parentElement?.getBoundingClientRect()||t.getBoundingClientRect(),i=n?r.height+30:r.height,a=e.getBoundingClientRect().height,o=n?`calc(100% - 30px)`:`100%`;r&&r.top+a>window.innerHeight&&r.top-a>0&&(o=`calc(100% - ${i}px - ${a}px)`),e.style.top=o},eu=(e,t,n,r,i,a)=>{let{key:o}=e;o===`,`&&(e.preventDefault(),a?a(e):i&&i()),(o===`Space`||o===` `)&&(e.preventDefault(),t(e)),o===`Enter`&&(e.preventDefault(),n?n():r?r():i&&i())},tu=({open:e,multiple:r=!1,range:i=!1,weeknumbers:a=!1,withcontrols:o=!1,selected:s=[],earliest:c,latest:l,excludedates:u,excludeweekdays:d,maxMultiple:f,currentmonth:p,today:m,inputRef:h,hasCounter:g=!1,onDateSelected:_,onClose:v})=>{let y=(0,t.useRef)(null),b=(0,t.useRef)(!1);e&&(b.current=!0),(0,t.useEffect)(()=>{e&&$l(y.current,h?.current??null,g)},[e,h,g]);let x=[`pkt-calendar-popup`,e?`show`:`hide`].join(` `),S=e||b.current;return(0,n.jsx)(`div`,{ref:y,className:x,hidden:!e,"aria-hidden":!e,children:S&&(0,n.jsx)(hl,{multiple:r,range:i,weeknumbers:a,withcontrols:o,selected:s,earliest:c,latest:l,excludedates:u,excludeweekdays:d,maxMultiple:f,currentmonth:p,today:m,onDateSelected:_,onClose:v})})},nu=({dates:e,dateformat:t,idBase:r,strings:i,onDateRemoved:a})=>{let o=Hc(e),s=i?.calendar?.buttonAltText??`Slett dato`;return(0,n.jsx)(`div`,{className:`pkt-date-tags pkt-datepicker__tags`,"aria-live":`polite`,children:o.map(e=>{let i=Ac(e,t);return(0,n.jsx)(gl,{id:`${r}${e}-tag`,closeTag:!0,ariaLabel:`${s} ${i}`,onClose:()=>a(e),children:(0,n.jsx)(`time`,{dateTime:e,children:i})},e)})})},ru=({state:e})=>{let{id:t,inputId:r,values:i,dateformat:a,multiple:o,range:s,showRangeLabels:c,disabled:l,readOnly:u,required:d,label:f,name:p,placeholder:m,hasError:h,helptext:g,minStr:_,maxStr:v,inputType:y,isIOSDevice:b,strings:x,inputClasses:S,buttonClasses:C,rangeLabelClasses:w,datepickerInputsClasses:ee,isInputDisabled:T,inputRef:E,inputRefTo:te,btnRef:ne,toggleCalendar:re,handleFocus:D,handleSingleInputChange:ie,handleRangeFromChange:ae,handleRangeToChange:oe,handleRangeBlur:se,handleMultipleBlur:ce,handleTagRemoved:O,handleSingleKeydown:le,handleRangeFromKeydown:k,handleRangeToKeydown:A,handleMultipleKeydown:ue,restProps:de}=e,j=e=>{e.preventDefault(),re()},M=()=>(0,n.jsxs)(`button`,{ref:ne,className:C,type:`button`,onClick:re,disabled:l,"aria-label":x.calendar?.buttonAltText??`Åpne kalender`,children:[(0,n.jsx)(Q,{name:`calendar`}),(0,n.jsx)(`span`,{className:`pkt-btn__text`,children:x.calendar?.buttonAltText??`Åpne kalender`})]});return o?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(nu,{dates:i,dateformat:a,idBase:t,strings:x,onDateRemoved:O}),(0,n.jsx)(`div`,{className:`pkt-datepicker__inputs`,children:(0,n.jsxs)(`div`,{className:`pkt-input__container`,children:[(0,n.jsx)(`input`,{...de,ref:E,className:S,type:y,id:r,name:p??t,placeholder:m,readOnly:u||b&&!u,disabled:T,"aria-describedby":g?`${t}-helptext`:void 0,"aria-invalid":h,"aria-errormessage":h?`${t}-error`:void 0,onClick:j,onKeyDown:ue,onFocus:D,onBlur:ce}),M()]})})]}):s?(0,n.jsx)(`div`,{className:ee,children:(0,n.jsxs)(`div`,{className:`pkt-input__container`,children:[c&&(0,n.jsx)(`div`,{className:`pkt-input-prefix`,children:x.generic?.from??`Fra`}),(0,n.jsx)(`input`,{...de,ref:E,className:S,type:y,id:r,name:p?`${p}-from`:`${t}-from`,value:i[0]??``,min:_,max:v,placeholder:m,readOnly:u||b&&!u,disabled:l,required:d,"aria-label":`${f} ${x.generic?.from??`Fra`}`,"aria-describedby":g?`${t}-helptext`:void 0,"aria-invalid":h,"aria-errormessage":h?`${t}-error`:void 0,onClick:j,onKeyDown:k,onFocus:D,onBlur:se,onChange:ae}),(0,n.jsx)(`div`,{className:w,id:`${t}-to-label`,children:x.generic?.to??`Til`}),!c&&(0,n.jsx)(`div`,{className:`pkt-input-separator`,children:`–`}),(0,n.jsx)(`input`,{ref:te,className:S,type:y,id:`${t}-to`,name:p?`${p}-to`:`${t}-to`,value:i[1]??``,min:_,max:v,readOnly:u||b&&!u,disabled:l,"aria-label":`${f} ${x.generic?.to??`Til`}`,"aria-invalid":h,onClick:j,onKeyDown:A,onFocus:D,onBlur:se,onChange:oe}),M()]})}):(0,n.jsx)(`div`,{className:`pkt-datepicker__inputs`,children:(0,n.jsxs)(`div`,{className:`pkt-input__container`,children:[(0,n.jsx)(`input`,{...de,ref:E,className:S,type:y,id:r,name:p??t,value:i[0]??``,min:_,max:v,placeholder:m,readOnly:u||b&&!u,disabled:l,required:d,"aria-describedby":g?`${t}-helptext`:void 0,"aria-invalid":h,"aria-errormessage":h?`${t}-error`:void 0,onClick:j,onKeyDown:le,onFocus:D,onBlur:void 0,onChange:ie}),M()]})})},iu={calendar:{buttonAltText:`Åpne kalender`}},au={calendar:{buttonAltText:`Åpne kalender`},generic:{from:`Fra`,to:`Til`}},ou=e=>{if(!e)return[];if(Array.isArray(e))return e.filter(Boolean);if(typeof e==`string`&&e.trimStart().startsWith(`[`))try{let t=JSON.parse(e);if(Array.isArray(t))return t.filter(Boolean)}catch{}return String(e).split(`,`).map(e=>e.trim()).filter(Boolean)};function su(e,n){let{id:r,label:i,value:a,defaultValue:o,dateformat:s=`dd.MM.yyyy`,multiple:c=!1,maxlength:l,range:u=!1,showRangeLabels:d=!1,weeknumbers:f=!1,withcontrols:p=!1,excludedates:m,excludeweekdays:h,currentmonth:g,today:_,calendarOpen:v,timezone:y,fullwidth:b=!1,hasFieldset:x=!1,inline:S=!1,helptext:C,helptextDropdown:w,helptextDropdownButton:ee,hasError:T=!1,errorMessage:E,optionalTag:te=!1,optionalText:ne,requiredTag:re=!1,requiredText:D,tagText:ie,useWrapper:ae=!0,strings:oe,disabled:se=!1,readOnly:ce=!1,required:O=!1,name:le,min:k,max:A,placeholder:ue,onChange:de,onValueChange:j,className:M,...N}=e,P=(0,t.useCallback)(e=>e===void 0?[]:ou(e),[]),F=a!==void 0,I=typeof o==`number`?void 0:o,[fe,pe]=(0,t.useState)(()=>P(a??I)),me=F?P(a):fe,L=(0,t.useRef)(fe);(0,t.useEffect)(()=>{F&&pe(P(a))},[a,F,P]);let[he,ge]=(0,t.useState)(v??!1);(0,t.useEffect)(()=>{v!==void 0&&ge(v)},[v]);let R=(0,t.useRef)(null),z=(0,t.useRef)(null),B=(0,t.useRef)(null),_e=(0,t.useRef)(null),V=(0,t.useRef)(null),ve=(0,t.useMemo)(()=>ql(),[]),ye=(0,t.useMemo)(()=>Kl(),[]),H=(0,t.useMemo)(()=>oe??(u?au:iu),[oe,u]),be=typeof k==`string`?k:k===void 0?void 0:String(k),xe=typeof A==`string`?A:A===void 0?void 0:String(A),Se=(0,t.useMemo)(()=>{let e=Yl(b,d,c,u,ce,ve);return Object.entries(e).filter(([,e])=>e).map(([e])=>e).join(` `)},[b,d,c,u,ce,ve]),Ce=(0,t.useMemo)(()=>{let e=Xl();return Object.entries(e).filter(([,e])=>e).map(([e])=>e).join(` `)},[]),we=(0,t.useMemo)(()=>{let e=Zl(d);return Object.entries(e).filter(([,e])=>e).map(([e])=>e).join(` `)},[d]),Te=(0,t.useMemo)(()=>[`pkt-datepicker__inputs`,u&&`pkt-input__range-inputs`].filter(Boolean).join(` `),[u,d]),Ee=(0,t.useMemo)(()=>{if(g)return g;if(xe)return xe.slice(0,7)},[g,xe]),De=se||c&&l!=null&&me.length>=l,Oe=c&&l!=null,ke=`${r}-input`,Ae=me.join(`,`);(0,t.useEffect)(()=>{B.current&&(B.current.value=Ae)},[Ae]),(0,t.useEffect)(()=>{y&&typeof window<`u`&&y!==window.pktTz&&(window.pktTz=y)},[y]);let je=(0,t.useCallback)((e,t=!0)=>{F||pe(e),t&&j?.(e)},[F,j]),Me=(0,t.useMemo)(()=>Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`)?.set,[]),Ne=(0,t.useCallback)(e=>{let t=B.current;!t||!Me||(Me.call(t,e.join(`,`)),t.dispatchEvent(new Event(`input`,{bubbles:!0})))},[Me]),Pe=(0,t.useCallback)(()=>{se||ge(e=>!e)},[se]),Fe=(0,t.useCallback)(()=>{ge(!1)},[]);(0,t.useEffect)(()=>{if(!he)return;let e=e=>{let t=e.target;V.current&&!V.current.contains(t)&&!t.closest?.(`.pkt-calendar-popup`)&&Fe()},t=e=>{e.key===`Escape`&&(Fe(),R.current?.focus())};return document.addEventListener(`click`,e,!0),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`click`,e,!0),document.removeEventListener(`keydown`,t)}},[he,Fe]);let Ie=(0,t.useCallback)(()=>{ye&&!he&&ge(!0)},[ye,he]),Le=(0,t.useCallback)(e=>{let t=ou(Ql(e,c,u));je(t),Ne(t),!c&&!u&&(Fe(),R.current?.focus())},[c,u,je,Ne,Fe]),Re=(0,t.useCallback)(()=>{Fe(),R.current?.focus()},[Fe]),ze=(0,t.useCallback)(e=>{let t=e.target.value,n=t?[t]:[];je(n),Ne(n)},[je,Ne]),Be=(0,t.useCallback)(e=>{let t=[e.target.value,me[1]??``].filter(Boolean);je(t),Ne(t)},[me,je,Ne]),Ve=(0,t.useCallback)(e=>{let t=[me[0]??``,e.target.value].filter(Boolean);je(t),Ne(t)},[me,je,Ne]),He=(0,t.useCallback)(()=>{me.length===2&&!Jl(me)&&(je([me[0]]),Ne([me[0]]))},[me,je,Ne]),Ue=(0,t.useCallback)(e=>{let t=jc(e),n=be?jc(be):null,r=xe?jc(xe):null;if(t&&!isNaN(t.getTime())&&(!n||t>=n)&&(!r||t<=r)){let t=Vc([...me,e],be,xe,m,h),n=[...new Set(t)];je(n),Ne(n)}},[me,be,xe,m,h,je,Ne]),We=(0,t.useCallback)(e=>{let t=e.target;t.value&&=(Ue(t.value.split(`,`)[0]),``)},[Ue]),U=(0,t.useCallback)(e=>{let t=e.target;t.value&&=(Ue(t.value.split(`,`)[0]),``)},[Ue]),W=(0,t.useCallback)(e=>{let t=me.filter(t=>t!==e);je(t),Ne(t)},[me,je,Ne]),Ge=(0,t.useCallback)(e=>{let t=e?.closest(`form`);t?t.requestSubmit():e?.blur()},[]),Ke=(0,t.useCallback)(e=>{eu(e.nativeEvent,()=>Pe(),()=>Ge(R.current),void 0,()=>R.current?.blur())},[Pe,Ge]),qe=(0,t.useCallback)(e=>{eu(e.nativeEvent,()=>Pe(),()=>Ge(R.current),()=>z.current?.focus(),()=>R.current?.blur())},[Pe,Ge]),Je=(0,t.useCallback)(e=>{eu(e.nativeEvent,()=>Pe(),()=>Ge(z.current),void 0,()=>z.current?.blur())},[Pe,Ge]),G=(0,t.useCallback)(e=>{eu(e.nativeEvent,()=>Pe(),()=>Ge(R.current),void 0,()=>R.current?.blur(),U)},[Pe,Ge,U]);return(0,t.useEffect)(()=>{let e=V.current?.closest(`form`);if(!e)return;let t=()=>{window.setTimeout(()=>{pe(L.current),ge(!1),B.current&&(B.current.value=L.current.join(`,`))},0)};return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)},[]),(0,t.useImperativeHandle)(n,()=>({get value(){return B.current?.value??``},set value(e){pe(e?e.split(`,`).filter(Boolean):[]),B.current&&(B.current.value=e??``)},focus(){R.current?.focus()},blur(){R.current?.blur()}}),[]),{id:r,inputId:ke,label:i,values:me,calendarOpen:he,dateformat:s,multiple:c,maxlength:l,range:u,showRangeLabels:d,weeknumbers:f,withcontrols:p,excludedates:m,excludeweekdays:h,disabled:se,readOnly:ce,required:O,name:le,placeholder:ue,fullwidth:b,hasFieldset:x,inline:S,helptext:C,helptextDropdown:w,helptextDropdownButton:ee,hasError:T,errorMessage:E,optionalTag:te,optionalText:ne,requiredTag:re,requiredText:D,tagText:ie,useWrapper:ae,className:M,minStr:be,maxStr:xe,effectiveCurrentMonth:Ee,today:_,inputType:ve,isIOSDevice:ye,strings:H,inputClasses:Se,buttonClasses:Ce,rangeLabelClasses:we,datepickerInputsClasses:Te,isInputDisabled:De,hasCounter:Oe,inputRef:R,inputRefTo:z,changeInputRef:B,btnRef:_e,wrapperRef:V,onChange:de,toggleCalendar:Pe,hideCalendar:Fe,handleDateSelected:Le,handleCalendarClose:Re,handleFocus:Ie,handleSingleInputChange:ze,handleRangeFromChange:Be,handleRangeToChange:Ve,handleRangeBlur:He,handleMultipleBlur:We,handleTagRemoved:W,handleSingleKeydown:Ke,handleRangeFromKeydown:qe,handleRangeToKeydown:Je,handleMultipleKeydown:G,restProps:N}}var cu=(0,t.forwardRef)((e,t)=>{let r=su(e,t);return(0,n.jsxs)(`div`,{className:[`pkt-datepicker`,r.className].filter(Boolean).join(` `),id:r.id||void 0,children:[(0,n.jsx)(yl,{ref:r.wrapperRef,forId:r.inputId,label:r.label,hasFieldset:r.hasFieldset,inline:r.inline,helptext:r.helptext,helptextDropdown:r.helptextDropdown,helptextDropdownButton:r.helptextDropdownButton,hasError:r.hasError,errorMessage:r.errorMessage,disabled:r.disabled,optionalTag:r.optionalTag,optionalText:r.optionalText,requiredTag:r.requiredTag,requiredText:r.requiredText,tagText:r.tagText,useWrapper:r.useWrapper,counter:r.hasCounter,counterCurrent:r.values.length,counterMaxLength:r.maxlength,children:(0,n.jsx)(ru,{state:r})}),(0,n.jsx)(tu,{open:r.calendarOpen,multiple:r.multiple,range:r.range,weeknumbers:r.weeknumbers,withcontrols:r.withcontrols,selected:r.values,earliest:r.minStr,latest:r.maxStr,excludedates:r.excludedates,excludeweekdays:r.excludeweekdays,maxMultiple:r.maxlength,currentmonth:r.effectiveCurrentMonth,today:r.today,inputRef:r.inputRef,hasCounter:r.hasCounter,onDateSelected:r.handleDateSelected,onClose:r.handleCalendarClose}),(0,n.jsx)(`input`,{ref:r.changeInputRef,type:`text`,name:r.name,onChange:r.onChange,tabIndex:-1,"aria-hidden":`true`,className:`pkt-visually-hidden`})]})});cu.displayName=`PktDatepicker`;var lu={dropFilesHere:`Slipp filene her ...`,selectOrDragFiles:`Dra filer hit for å laste dem opp eller `,chooseFiles:`velg filer`},uu={dropFilesHere:`Slipp filen her ...`,selectOrDragFiles:`Dra en fil for å laste den opp eller `,chooseFiles:`velg en fil`},du={dropFilesHere:`Slipp bildene her ...`,selectOrDragFiles:`Dra bilder hit for å laste dem opp eller `,chooseFiles:`velg fra kamerarull`},fu={dropFilesHere:`Slipp bildet her ...`,selectOrDragFiles:`Dra et bilde for å laste det opp eller `,chooseFiles:`velg fra kamerarull`},pu=()=>(`00000000000000000`+(Math.random()*0x10000000000000000).toString(16)).slice(-16),mu=()=>{let e=pu(),t=pu();return e.slice(0,8)+`-`+e.slice(8,12)+`-4`+e.slice(13)+`-a`+t.slice(1,4)+`-`+t.slice(4)},hu=class{fileId;file;attributes={};constructor(e,t){this.fileId=t||mu(),this.file=e,this.attributes={targetFilename:e.name}}},gu=(0,t.createContext)({}),_u=`.PDF, .JPEG, .JPG, .PNG, .HEIC, .DOC, .DOCX, .ODT`,vu=(0,t.forwardRef)(({id:e,multiple:r,value:i,onFilesAdded:a=()=>{},name:o,uploadStrategy:s,accept:c,isThumbnailView:l=!1,disabled:u=!1,srAnnouncementIds:d,hasVisibleLabel:f=!1,...p},m)=>{let h=(0,t.useRef)(null),g=typeof c==`string`&&c.trim().length>0?c:void 0,_=(0,t.useMemo)(()=>g?g.split(/\s*,\s*/).map(e=>e.trim()).filter(Boolean).join(`, `).toUpperCase():_u,[g]);(0,t.useImperativeHandle)(m,()=>h.current);let[v,y]=(0,t.useState)(!1),b=(0,t.useMemo)(()=>l?r?du:fu:r?lu:uu,[r,l]),x=(0,t.useCallback)(e=>{if(h.current)try{h.current.files=yu(e)}catch{}},[h.current,i]);(0,t.useEffect)(()=>{x(i)},[h,i]);let S=(0,t.useCallback)(e=>{a(e.map(e=>new hu(e))),h.current&&(h.current.value=``)},[a]),C=e=>{let t=e.target.files;if(t.length===0){r&&x(i);return}S(Array.from(t))},w=e=>{S(e)};return(0,n.jsxs)(`div`,{onDrop:e=>{if(e.preventDefault(),y(!1),u)return;let t=e.dataTransfer.files;w(Array.from(t))},onDragOver:e=>{e.preventDefault(),!u&&y(!0)},onDragLeave:()=>{y(!1)},onClick:(0,t.useCallback)(e=>{u||e.target.closest(`.pkt-fileupload__drop-zone__placeholder__title__open-file-dialog`)||h.current?.click()},[u]),className:(0,$.default)(`pkt-fileupload__drop-zone`,{"pkt-fileupload__drop-zone--drag-active":v,"pkt-fileupload__drop-zone--disabled":u}),children:[(0,n.jsx)(`input`,{...p,id:e,type:`file`,ref:h,multiple:r,onChange:C,accept:g,disabled:u,name:s===`form`&&o||void 0,"aria-label":f?void 0:r?`Velg filer`:`Velg fil`}),s===`custom`&&(0,n.jsx)(n.Fragment,{children:i?.map(e=>(0,n.jsx)(`input`,{type:`hidden`,name:o,value:e.fileId},e.fileId))}),(0,n.jsxs)(`div`,{className:`pkt-fileupload__drop-zone__placeholder`,children:[(0,n.jsx)(Q,{name:`attachment`,className:`pkt-fileupload__drop-zone__placeholder__icon`,"aria-hidden":`true`}),(0,n.jsx)(`p`,{className:`pkt-fileupload__drop-zone__placeholder__title`,children:v?`${b.dropFilesHere} ...`:(0,n.jsxs)(n.Fragment,{children:[b.selectOrDragFiles,` `,(0,n.jsx)(`button`,{className:`pkt-fileupload__drop-zone__placeholder__title__open-file-dialog`,onClick:e=>{e.preventDefault(),e.stopPropagation(),h.current?.click()},type:`button`,children:b.chooseFiles})]})}),(0,n.jsxs)(`p`,{className:`pkt-fileupload__drop-zone__placeholder__formats`,children:[`Format: `,_]})]})]})}),yu=e=>{let t=new DataTransfer;for(let n of e)t.items.add(n.file);return t.files},bu=(0,t.forwardRef)(({id:e,ariaDescribedby:r,ariaLabelledby:i,counter:a,counterMaxLength:o,className:s,disabled:c,errorMessage:l,hasError:u,helptext:d,helptextDropdown:f,helptextDropdownButton:p,inline:m,fullwidth:h=!1,label:g,name:_,optionalTag:v=!1,optionalText:y,requiredTag:b=!1,requiredText:x,tagText:S=null,placeholder:C,rows:w,useWrapper:ee=!0,onChange:T,value:E,autoComplete:te=`off`,minLength:ne,maxLength:re,readOnly:D,skipForwardTestid:ie=!1,...ae},oe)=>{let se=[s,`pkt-textinput`,`pkt-textarea`].join(` `),ce=`${e}-input`,O=`${ce}-label`,le=i||O,[k,A]=(0,t.useState)(0),ue=e=>{a&&A(e.currentTarget?.value?.length||0),T&&T(e)};return(0,t.useEffect)(()=>{E!==void 0&&A(E?.length||0)},[E]),(0,n.jsx)(yl,{ariaDescribedby:r,className:se,disabled:c,errorMessage:l,forId:ce,hasError:u,helptext:d,helptextDropdown:f,helptextDropdownButton:p,inline:m,label:g,optionalTag:v,optionalText:y,requiredTag:b,requiredText:x,tagText:S,useWrapper:ee,counter:a,counterCurrent:k,counterMaxLength:o,children:(0,n.jsx)(`textarea`,{ref:oe,className:`pkt-input ${h?`pkt-input--fullwidth`:``} ${o&&k>o?`pkt-input--counter-error`:``}`,name:`${_||e}`,id:ce,placeholder:C,disabled:c,rows:w,"aria-labelledby":le,"aria-invalid":u,"aria-errormessage":`${e}-error`,...ae,onChange:ue,value:E,autoComplete:te,minLength:ne,maxLength:re,readOnly:D,"data-skip-forward-testid":ie?`true`:void 0})})});bu.displayName=`PktTextarea`;var xu=Symbol(`comment`),Su=e=>`${String(e.getDate()).padStart(2,`0`)}.${String(e.getMonth()+1).padStart(2,`0`)}.${e.getFullYear()} kl. ${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}`,Cu=({fileItem:e,closeOperationUi:r,onAddComment:i,existingComment:a})=>{let o=(0,t.useRef)(null),s=!!a;return(0,t.useLayoutEffect)(()=>{let e=setTimeout(()=>o.current?.focus({preventScroll:!0}),0);return()=>clearTimeout(e)},[e.fileId]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(bu,{autoFocus:!0,label:s?`Rediger kommentar`:`Legg til kommentar`,name:`comment-${e.fileId}`,className:`pkt-fileupload__queue-display__item__comment-input`,placeholder:`Skriv inn kommentar`,rows:2,id:`comment-${e.fileId}`,ref:o,defaultValue:a?.text}),(0,n.jsx)(es,{skin:`secondary`,size:`small`,onClick:()=>{let e=o.current?.value?.trim();e&&i({text:e,timestamp:new Date}),r()},children:s?`Lagre kommentar`:`Legg til kommentar`}),(0,n.jsx)(es,{skin:`tertiary`,size:`small`,onClick:r,children:`Avbryt`})]})},wu=({comments:e,onDeleteComment:t,onEditComment:r})=>e&&e.length>0?(0,n.jsx)(`div`,{className:`pkt-fileupload__queue-display__item__comments`,children:e.map((e,i)=>(0,n.jsxs)(`div`,{className:`pkt-fileupload__queue-display__item__comment`,children:[(0,n.jsxs)(`div`,{className:`pkt-fileupload__queue-display__item__comment__content`,children:[(0,n.jsx)(`span`,{className:`pkt-fileupload__queue-display__item__comment__text`,"aria-label":`Kommentar tekst`,children:e.text}),(0,n.jsx)(`time`,{className:`pkt-fileupload__queue-display__item__comment__time`,children:Su(e.timestamp)})]}),(0,n.jsxs)(`div`,{className:`pkt-fileupload__queue-display__item__comment__actions`,children:[t&&(0,n.jsx)(`button`,{type:`button`,className:`pkt-fileupload__queue-display__item__comment__action`,onClick:()=>t(i),"aria-label":`Slett kommentar`,children:(0,n.jsx)(Q,{name:`trash-can`})}),r&&(0,n.jsx)(`button`,{type:`button`,className:`pkt-fileupload__queue-display__item__comment__action`,onClick:()=>r(i),"aria-label":`Rediger kommentar`,children:(0,n.jsx)(Q,{name:`edit`})})]})]},i))}):null,Tu=e=>(0,n.jsx)(`input`,{type:`hidden`,name:`${(0,t.useContext)(gu).name}-comments`,value:e.comments?JSON.stringify(e.comments):``}),Eu=e=>{let t=e(`comments`),r=(e,n)=>{t.set(e,[n])},i=(e,n)=>{let r=(t.get(e)||[]).filter((e,t)=>t!==n);t.set(e,r.length>0?r:void 0)};return{title:e=>{let n=t.get(e.fileId);return n&&n.length>0?``:`Legg til kommentar`},renderExtendedUI:(e,i)=>{let a=t.get(e.fileId)?.[0];return(0,n.jsx)(Cu,{fileItem:e,closeOperationUi:i,onAddComment:t=>r(e.fileId,t),existingComment:a})},renderContent:(e,r,a)=>a?null:(0,n.jsx)(wu,{comments:t.get(e.fileId),onDeleteComment:t=>i(e.fileId,t),onEditComment:r?()=>r():void 0}),renderHidden:e=>(0,n.jsx)(Tu,{comments:t.get(e.fileId)},`comments${e.fileId}`),symbol:xu}},Du=Symbol(`deleteFile`),Ou=e=>({title:`Slett`,ariaLabel:`Slett fil`,onClick:t=>e(t.fileId),symbol:Du}),ku=Symbol(`renameFile`),Au=e=>{let r=(0,t.useRef)(null),i=(0,t.useId)(),a=()=>{e.onSave(r.current?.value??``)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`label`,{htmlFor:i,className:`pkt-sr-only`,children:`Endre filnavn`}),(0,n.jsx)(`input`,{id:i,ref:r,type:`text`,autoFocus:!0,defaultValue:e.value,className:`pkt-fileupload__queue-display__item__rename-input`,onKeyDown:t=>{t.key===`Enter`&&(t.preventDefault(),t.stopPropagation(),a()),t.key===`Escape`&&(t.preventDefault(),t.stopPropagation(),e.onCancel())}}),(0,n.jsx)(es,{skin:`secondary`,size:`small`,onClick:()=>e.onSave(r.current.value),children:`Lagre`}),(0,n.jsx)(es,{skin:`tertiary`,size:`small`,onClick:e.onCancel,children:`Avbryt`})]})},ju=e=>(0,n.jsx)(`input`,{type:`hidden`,name:`${(0,t.useContext)(gu).name}-targetFilename`,value:e.targetFilename}),Mu=e=>{let t=e(`targetFilename`);return{title:`Rediger`,ariaLabel:`Rediger filnavn`,renderInlineUI:(e,r)=>(0,n.jsx)(Au,{value:t.get(e.fileId)||void 0,onSave:n=>{t.set(e.fileId,n),r()},onCancel:r}),renderHidden:e=>(0,n.jsx)(ju,{targetFilename:t.get(e.fileId)||e.file.name},`rename${e.fileId}`),symbol:ku}},Nu=(e,n)=>{let r=(0,t.useCallback)((t,r,i)=>{let a=e.find(e=>e.fileId===t);a.attributes={...a.attributes||{},[r]:i},n(t,{attributes:a.attributes})},[n,e]),i=(0,t.useCallback)((t,n)=>(e.find(e=>e.fileId===t).attributes||{})[n],[e]);return{fileAttributes:(0,t.useCallback)(e=>({get:t=>i(t,e),set:(t,n)=>{r(t,e,n)}}),[i,r])}},Pu=e=>{let[n,r]=(0,t.useState)(!1),[i,a]=(0,t.useState)(0),o=(0,t.useRef)(null);return{isOpen:n,currentIndex:i,modalRef:o,open:(0,t.useCallback)(t=>{let n=e.findIndex(e=>e.fileId===t);n>=0&&(a(n),r(!0),o.current?.showModal())},[e]),close:(0,t.useCallback)(()=>{r(!1),o.current?.close()},[]),navigate:(0,t.useCallback)(t=>{e.length!==0&&a(n=>t===`prev`?n<=0?e.length-1:n-1:n>=e.length-1?0:n+1)},[e.length])}},Fu=e=>{let[n,r]=(0,t.useState)({});return{getActivated:(0,t.useCallback)(t=>{let r=n[t];if(r)return e.find(e=>e.symbol===r)},[n,e]),activate:(0,t.useCallback)((e,t)=>{r(n=>({...n,[e]:t.symbol}))},[]),close:(0,t.useCallback)(e=>{r(t=>{let n={...t};return delete n[e],n})},[])}},Iu=(0,t.forwardRef)(({children:e,className:r,open:i=!1,headingText:a=``,hideCloseButton:o=!1,closeOnBackdropClick:s=!1,size:c=`medium`,removePadding:l=!1,closeButtonSkin:u=`blue`,variant:d=`dialog`,drawerPosition:f=`right`,transparentBackdrop:p=!1,onClose:m,...h},g)=>{let _=(0,t.useRef)(null),v=g||_,y=(0,t.useCallback)(()=>{v.current?.open&&(v.current?.close(),m?.())},[v,m]);(0,t.useEffect)(()=>{let e=v.current;if(!e)return;let t=new MutationObserver(()=>{e.open?document.body.classList.add(`pkt-modal--open`):document.body.classList.remove(`pkt-modal--open`)});return t.observe(e,{attributes:!0,attributeFilter:[`open`]}),()=>t.disconnect()},[v]),(0,t.useEffect)(()=>{i?v.current?.open||v.current?.showModal():v.current?.open&&v.current?.close()},[i,v]);let b=(0,t.useCallback)(e=>{s&&e.target===v.current&&y()},[s,v,y]),x=(0,t.useCallback)(()=>{m?.()},[m]),S=u===`blue`,C=(0,$.default)({"pkt-modal":!0,"pkt-modal--removePadding":l,"pkt-modal--noHeadingText":!a,"pkt-modal--noShadow":u===`yellow-filled`,"pkt-modal--transparentBackdrop":p,[`pkt-modal--${c}`]:c,[`pkt-modal__${d}`]:d,[`pkt-modal__drawer--${f}`]:d===`drawer`},r);return(0,n.jsx)(`dialog`,{...h,className:C,ref:v,"aria-labelledby":a?`pkt-modal__headingText`:void 0,"aria-describedby":`pkt-modal__content`,onClick:b,onClose:x,children:(0,n.jsxs)(`div`,{className:`pkt-modal__wrapper`,children:[(a||!o)&&(0,n.jsxs)(`div`,{className:`pkt-modal__header`,children:[(0,n.jsx)(`div`,{className:`pkt-modal__header-background`}),a?(0,n.jsx)(`h1`,{id:`pkt-modal__headingText`,className:`pkt-modal__headingText pkt-txt-24`,children:a}):(0,n.jsx)(`div`,{className:`pkt-modal__headingText`}),o?(0,n.jsx)(`div`,{className:`pkt-modal__noCloseButton`}):(0,n.jsx)(`div`,{className:(0,$.default)(`pkt-modal__closeButton`,{[`pkt-modal__closeButton--${u}`]:!0}),children:(0,n.jsx)(es,{onClick:y,"aria-label":`close`,iconName:`close`,variant:`icon-only`,size:`medium`,skin:S?`tertiary`:`primary`,children:`Lukk`})})]}),(0,n.jsx)(`div`,{className:`pkt-modal__container`,children:(0,n.jsx)(`div`,{id:`pkt-modal__content`,className:`pkt-modal__content pkt-txt-18-light`,children:e})})]})})});Iu.displayName=`PktModal`;var Lu=2,Ru=e=>{let t=window.getComputedStyle(e),n=parseFloat(t.lineHeight);if(!Number.isNaN(n)&&n>0)return n;let r=parseFloat(t.fontSize);return(!Number.isNaN(r)&&r>0?r:16)*1.2},zu=(e,t,n)=>{let r=t*n;return e.getBoundingClientRect().height>r+.5},Bu=(0,t.createContext)({tail:5}),Vu=({children:e,tail:r,...i})=>{let a=e,o=(0,t.useContext)(Bu),s=r===void 0?o.tail||0:r,c=e.length<=s+3?null:e.slice(-s),l=(0,t.useRef)(null),u=(0,t.useRef)(null),[d,f]=(0,t.useState)(!1),p=(0,t.useCallback)(()=>{let e=l.current,t=u.current;!e||!t||f(zu(t,Ru(e),Lu))},[]),m=(0,t.useMemo)(()=>new ResizeObserver(e=>{e.some(e=>e.target===l.current)&&p()}),[p]);return(0,t.useLayoutEffect)(()=>(l.current&&m.observe(l.current),p(),()=>m.disconnect()),[e,m,p]),(0,n.jsxs)(`span`,{ref:l,...i,"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`,...i.style},children:[(0,n.jsx)(`span`,{"data-pkt-truncate-part":`first`,style:{minWidth:0,display:`-webkit-box`,WebkitBoxOrient:`vertical`,WebkitLineClamp:Lu,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`normal`,overflowWrap:`anywhere`},children:a}),s!==0&&(0,n.jsx)(`span`,{"data-pkt-truncate-part":`tail`,style:{whiteSpace:`nowrap`,display:d?`inline`:`none`,paddingRight:`0.5rem`},"aria-hidden":!0,children:c}),(0,n.jsx)(`span`,{ref:u,"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:e})]})},Hu=e=>{if(typeof e==`number`)return e;let t=e.trim().match(/^(\d+(?:\.\d+)?)\s*(B|KB|MB|GB)$/i);if(!t)return console.warn(`PktFileUpload: Invalid maxFileSize format "${e}". Use format like "5MB", "500KB", or a number in bytes.`),0;let n=parseFloat(t[1]);switch(t[2].toUpperCase()){case`B`:return n;case`KB`:return n*1024;case`MB`:return n*1024*1024;case`GB`:return n*1024*1024*1024;default:return n}},Uu=e=>e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:e<1024*1024*1024?`${Math.round(e/(1024*1024))} MB`:`${Math.round(e/(1024*1024*1024))} GB`,Wu=e=>(0,n.jsx)(`button`,{onClick:e.onClick,className:`pkt-fileupload__queue-display__item__cancel-button`,"aria-label":e.ariaLabel||`Avbryt opplasting`,children:e.label||`Avbryt`}),Gu=()=>{let[e,r]=(0,t.useState)(1);return(0,t.useEffect)(()=>{let e=setInterval(()=>{r(e=>e>=3?1:e+1)},400);return()=>clearInterval(e)},[]),(0,n.jsxs)(`span`,{className:`pkt-fileupload__queue-display__item__loading-text`,"aria-label":`Laster opp fil`,children:[`Laster opp`,`.`.repeat(e)]})},Ku=({cancelTransfer:e,transferItem:t})=>{let r=t.showProgress??t.progress!==0;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Q,{name:`document-text`,className:`pkt-fileupload__queue-display__item__icon pkt-icon--medium`,"aria-hidden":`true`}),(0,n.jsx)(`p`,{className:`pkt-fileupload__queue-display__item__title`,"aria-label":`Filnavn`,children:(0,n.jsx)(Vu,{children:t.attributes.targetFilename})}),(0,n.jsx)(Wu,{onClick:e}),r?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Fd,{valueCurrent:t.progress*100,statusType:`none`,valueMax:100,statusPlacement:`following`,className:`pkt-fileupload__queue-display__item__progress`}),(0,n.jsx)(`span`,{className:`pkt-fileupload__queue-display__item__filesize`,children:Uu(t.file.size)}),(0,n.jsx)(`span`,{className:`pkt-fileupload__queue-display__item__percentage`,"aria-hidden":`true`,children:`${Math.round(t.progress*100)}%`})]}):(0,n.jsx)(Gu,{})]})},qu=({transferItem:e,onRemove:t})=>{let r=(e.lastProgress??1)*100;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Q,{className:`pkt-fileupload__queue-display__item__icon pkt-icon--medium`,name:`alert-error`,"aria-hidden":`true`}),(0,n.jsx)(`p`,{className:`pkt-fileupload__queue-display__item__title`,children:(0,n.jsx)(Vu,{children:e.attributes.targetFilename})}),(0,n.jsx)(Wu,{onClick:t,label:`Fjern`,ariaLabel:`Fjern fil som feilet under opplasting`}),(0,n.jsx)(Fd,{valueCurrent:r,statusType:`none`,valueMax:100,statusPlacement:`following`,className:`pkt-fileupload__queue-display__item__progress pkt-fileupload__queue-display__item__progress--error`}),(0,n.jsx)(`span`,{className:`pkt-fileupload__queue-display__item__filesize`,children:Uu(e.file.size)}),e.errorMessage&&(0,n.jsx)(`span`,{className:`pkt-fileupload__queue-display__item__error-message`,children:e.errorMessage})]})},Ju=({transferItem:e,onRemove:t})=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Q,{className:`pkt-fileupload__queue-display__item__icon pkt-icon--medium`,name:`alert-error`,"aria-hidden":`true`}),(0,n.jsx)(`p`,{className:`pkt-fileupload__queue-display__item__title`,children:(0,n.jsx)(Vu,{children:e.attributes.targetFilename})}),(0,n.jsx)(Wu,{onClick:t,label:`Fjern`,ariaLabel:`Fjern fil som feilet under opplasting`}),e.errorMessage&&(0,n.jsx)(`span`,{className:`pkt-fileupload__queue-display__item__error-message`,children:e.errorMessage})]}),Yu=({transferItem:e,onRemove:t})=>e.showProgress?(0,n.jsx)(qu,{transferItem:e,onRemove:t}):(0,n.jsx)(Ju,{transferItem:e,onRemove:t}),Xu=({operation:e,onActivate:t,transferItem:r})=>{let i=typeof e.title==`function`?e.title(r):e.title;return i?(0,n.jsx)(`button`,{type:`button`,className:`pkt-fileupload__queue-display__item__operation`,onClick:()=>{(e.renderInlineUI||e.renderExtendedUI)&&t(r.fileId,e),e.onClick&&e.onClick(r)},"aria-label":typeof e.ariaLabel==`function`?e.ariaLabel(r):e.ariaLabel,children:i}):null},Zu=({transferItem:e})=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Q,{name:`document-text`,className:`pkt-fileupload__queue-display__item__icon pkt-icon--medium`,"aria-hidden":`true`}),(0,n.jsx)(`p`,{className:`pkt-fileupload__queue-display__item__title`,children:(0,n.jsx)(Vu,{children:e.attributes.targetFilename})}),(0,n.jsx)(`span`,{className:`pkt-fileupload__queue-display__item__filesize`,children:Uu(e.file.size)})]}),Qu=({transferItem:e,onPreviewClick:r})=>{let[i,a]=(0,t.useState)(null),[o,s]=(0,t.useState)(!1),c=e.file;(0,t.useEffect)(()=>{if(s(!1),c.type.startsWith(`image/`)){let e=URL.createObjectURL(c);return a(e),()=>{URL.revokeObjectURL(e)}}a(null)},[c]);let l=i&&!o&&(0,n.jsx)(`img`,{src:i,alt:e.attributes.targetFilename,onError:()=>s(!0)})||(0,n.jsx)(Q,{name:`document-text`,className:`pkt-fileupload__queue-display__item__icon pkt-icon--medium`}),u=!!r;return(0,n.jsxs)(`div`,{className:`pkt-fileupload__queue-display__item__thumbnail${i&&!o?``:` pkt-fileupload__queue-display__item__thumbnail--fallback`}`,children:[(0,n.jsxs)(es,{className:`pkt-fileupload__queue-display__item__thumbnail__image-wrapper`,"aria-label":`Forhåndsvis bilde ${e.attributes.targetFilename}`,type:`button`,skin:`secondary`,onClick:r,children:[u&&(0,n.jsx)(Q,{name:`expand`,className:`pkt-fileupload__queue-display__item__thumbnail__expand-icon`,"aria-hidden":`true`}),l]}),(0,n.jsx)(Vu,{className:`pkt-fileupload__queue-display__item__thumbnail__title`,children:e.attributes.targetFilename})]})},$u=(0,t.forwardRef)(({isOpen:e,images:r,currentIndex:i,onClose:a,onNavigate:o},s)=>{let[c,l]=(0,t.useState)(null),[u,d]=(0,t.useState)(!1),f=r[i],p=r.length>1;return(0,t.useEffect)(()=>{if(d(!1),f&&f.file.type.startsWith(`image/`)){let e=URL.createObjectURL(f.file);return l(e),()=>URL.revokeObjectURL(e)}l(null)},[f]),(0,t.useEffect)(()=>{if(!e)return;let t=e=>{switch(e.key){case`ArrowLeft`:e.preventDefault(),o(`prev`);break;case`ArrowRight`:e.preventDefault(),o(`next`);break;case`Escape`:e.preventDefault(),a();break}};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,o,a]),f?(0,n.jsx)(Iu,{ref:s,headingText:f.attributes.targetFilename,closeOnBackdropClick:!0,className:`pkt-fileupload__image-preview-modal`,children:(0,n.jsxs)(`div`,{className:`pkt-fileupload__image-preview`,children:[p&&(0,n.jsx)(es,{variant:`icon-only`,iconName:`chevron-thin-left`,skin:`secondary`,size:`small`,className:`pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--prev`,onClick:()=>o(`prev`),"aria-label":`Forrige bilde ${i} / ${r.length}`}),(0,n.jsx)(`div`,{className:`pkt-fileupload__image-preview__content`,children:c&&!u?(0,n.jsx)(`img`,{src:c,alt:`${f.attributes.targetFilename} - ${i+1} av ${r.length}`,className:`pkt-fileupload__image-preview__image`,onError:()=>d(!0)}):(0,n.jsx)(Q,{name:`picture`,className:`pkt-fileupload__queue-display__item__icon pkt-icon--medium`})}),p&&(0,n.jsxs)(`span`,{className:`pkt-fileupload__image-preview__counter`,children:[i+1,` / `,r.length]}),p&&(0,n.jsx)(es,{variant:`icon-only`,iconName:`chevron-thin-right`,skin:`secondary`,size:`small`,className:`pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--next`,onClick:()=>o(`next`),"aria-label":`Neste bilde ${i+2} / ${r.length}`})]})}):null});$u.displayName=`ImagePreviewModal`;var ed=e=>e.file.type?.startsWith(`image/`)?!0:/\.(jpe?g|png|gif|webp|heic|heif|bmp|svg)$/i.test(e.file.name||``),td=e=>typeof e==`number`?`in-progress`:e===`error`?`error`:`idle`,nd=({operations:e,activatedOperation:t,onActivate:r,transferItem:i})=>(0,n.jsx)(`div`,{className:`pkt-fileupload__queue-display__item__actions`,children:e.filter(e=>!t||e.symbol!==t.symbol).map(e=>(0,n.jsx)(Xu,{operation:e,onActivate:r,transferItem:i},e.symbol.toString()))}),rd=({operations:e,activatedOperation:t,onActivate:r,transferItem:i})=>(0,n.jsx)(n.Fragment,{children:e.filter(e=>e.renderContent).map(e=>(0,n.jsx)(`div`,{className:`pkt-fileupload__queue-display__item__operation-content`,children:e.renderContent(i,()=>r(i.fileId,e),t?.symbol===e.symbol)},e.symbol.toString()))}),id=({transferItem:e,activatedOperation:t,operations:r,ItemRenderer:i,onActivate:a,onClose:o,onPreviewClick:s})=>{let c=()=>o(e.fileId),l=t?.renderInlineUI||t?.renderExtendedUI?[]:r;return(0,n.jsxs)(n.Fragment,{children:[t?.renderInlineUI?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Q,{name:`document-text`,className:`pkt-fileupload__queue-display__item__icon`}),(0,n.jsx)(`div`,{className:`pkt-fileupload__queue-display__item__inline-ui`,children:t.renderInlineUI(e,c)})]}):(0,n.jsx)(i,{transferItem:e,queueItemOperations:r,onPreviewClick:s}),l.length>0&&(0,n.jsx)(nd,{operations:l,activatedOperation:t,onActivate:a,transferItem:e}),(0,n.jsx)(rd,{operations:r,activatedOperation:t,onActivate:a,transferItem:e}),t?.renderExtendedUI&&(0,n.jsx)(`div`,{className:`pkt-fileupload__queue-display__item__expanded-operation-ui`,children:t.renderExtendedUI(e,c)})]})},ad=({transferItem:e,activatedOperation:t,operations:r,ItemRenderer:i,enableImagePreview:a,onActivate:o,onClose:s,onCancelTransfer:c,onOpenPreview:l})=>{let u=td(e.progress),d=a&&e.progress===`done`&&ed(e);switch(u){case`in-progress`:return(0,n.jsx)(Ku,{"aria-live":`off`,transferItem:e,cancelTransfer:()=>c(e.fileId)});case`error`:return(0,n.jsx)(Yu,{transferItem:e,onRemove:()=>c(e.fileId)});case`idle`:return(0,n.jsx)(id,{transferItem:e,activatedOperation:t,operations:r,ItemRenderer:i,onActivate:o,onClose:s,onPreviewClick:d?()=>l(e.fileId):void 0})}},od=e=>e.file.type?.startsWith(`image/`)?!0:/\.(jpe?g|png|gif|webp|heic|heif|bmp|svg)$/i.test(e.file.name||``),sd=(e,n,r)=>(0,t.useMemo)(()=>{let t=e.map(e=>{let t=n.find(t=>t.fileId===e.fileId);return{...e,progress:t?.progress??(r===`form`?`done`:`queued`),errorMessage:t?.errorMessage,showProgress:t?.showProgress,lastProgress:t?.lastProgress}}),i={"in-progress":0,error:1,idle:2};return t.sort((e,t)=>i[td(e.progress)]-i[td(t.progress)])},[e,n,r]),cd=(e,n)=>(0,t.useMemo)(()=>n?e.filter(e=>e.progress===`done`&&od(e)):[],[e,n]),ld=({files:e,cancelTransfer:t,transfers:r=[],queueItemOperations:i=[],ItemRenderer:a=Zu,truncateTail:o,enableImagePreview:s=!1,uploadStrategy:c=`form`})=>{let l=sd(e,r,c),u=cd(l,s),d=Fu(i),f=Pu(u);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`ul`,{className:`pkt-fileupload__queue-display`,children:(0,n.jsx)(Bu.Provider,{value:{tail:o},children:l.map(e=>(0,n.jsxs)(`li`,{className:(0,$.default)(`pkt-fileupload__queue-display__item`,{"pkt-fileupload__queue-display__item--in-progress":typeof e.progress==`number`,[`pkt-fileupload__queue-display__item--${e.progress}`]:typeof e.progress==`string`}),children:[i.filter(e=>e.renderHidden).map(t=>t.renderHidden(e)),(0,n.jsx)(ad,{transferItem:e,activatedOperation:d.getActivated(e.fileId),operations:i,ItemRenderer:a,enableImagePreview:s,onActivate:d.activate,onClose:d.close,onCancelTransfer:t,onOpenPreview:f.open})]},e.fileId))})}),s&&u.length>0&&(0,n.jsx)($u,{ref:f.modalRef,isOpen:f.isOpen,images:u,currentIndex:f.currentIndex,onClose:f.close,onNavigate:f.navigate})]})},ud={filename:Zu,thumbnail:Qu},dd=(0,t.forwardRef)(({value:e,defaultValue:r,id:i,multiple:a=!1,uploadStrategy:o=`form`,addCommentsEnabled:s=!1,renameFilesEnabled:c=!1,truncateTail:l,onFilesChanged:u,onFileUploadRequested:d,extraOperations:f=[],itemRenderer:p=ud.filename,fullWidth:m=!1,allowedFormats:h,formatErrorMessage:g,maxFileSize:_,sizeErrorMessage:v,onFileValidation:y,errorMessage:b,hasError:x=!1,disabled:S=!1,label:C,helptext:w,optionalTag:ee,requiredTag:T,required:E=!1,enableImagePreview:te=!1,"aria-describedby":ne,"aria-invalid":re,...D},ie)=>{let ae=(0,t.useId)(),oe=i??`pkt-fileupload-${ae}`,se=(0,t.useRef)(null);(0,t.useImperativeHandle)(ie,()=>se.current,[]);let ce=`transfers`in D?D.transfers:void 0,[O,le]=(0,t.useState)(null),k=x||!!O,A=b||O,ue=A?`${oe}-error`:void 0,de=[ne,w?`${oe}-helptext`:void 0,ue].filter(Boolean).join(` `)||void 0,j=k||re===!0||re===`true`,M=_?Hu(_):void 0,N=(0,t.useCallback)(e=>{if(h&&h.length>0){let t=e.name.split(`.`).pop()?.toLowerCase()||``,n=e.type.toLowerCase();if(!h.some(e=>{let r=e.toLowerCase().replace(/^\./,``);if(r.includes(`/`)){if(r.endsWith(`/*`)){let e=r.replace(`/*`,``);return n.startsWith(e+`/`)}return n===r}return t===r})){let e=h.join(`, `),t=`Ugyldig filtype. Tillatte formater: ${e}`;return g?.replace(`{formats}`,e)||t}}if(M&&e.size>M){let e=Uu(M),t=`Filen er for stor. Maks størrelse er ${e}.`;return v?.replace(`{maxSize}`,e)||t}return y?y(e):null},[h,g,M,v,y]);e!==void 0&&r!==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`),e!==void 0&&u===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`);let P=e===void 0?r||[]:e;(0,t.useEffect)(()=>{if(o!==`custom`||!E)return;let e=se.current?.form;if(!e)return;let t=e=>{P.length>0||(e.preventDefault(),le(`Velg minst én fil før du sender inn skjemaet.`))};return e.addEventListener(`submit`,t),()=>{e.removeEventListener(`submit`,t)}},[E,o,P.length]);let F=typeof p==`string`?ud[p]:p,I=p===`thumbnail`,fe=typeof D.accept==`string`?D.accept.trim():void 0,pe=(0,t.useMemo)(()=>{if(!(!h||h.length===0))return h.map(e=>e.trim()).filter(Boolean).map(e=>{let t=e.toLowerCase();return t.includes(`/`)||t.startsWith(`.`)?t:`.${t}`}).join(`, `)},[h]),me=fe||pe,L=c&&!I,he=s&&!I,ge=(0,t.useCallback)(e=>{for(let t of e){let e=N(t.file);if(e){le(e);return}}le(null);let t=a?[...P,...e]:[e[0]];u&&u(t),o===`custom`&&d&&e.forEach(e=>{d?.(e)})},[u,P,a,o,d,N]),R=(0,t.useCallback)((e,t)=>{let n=P.map(n=>n.fileId===e?{...n,...t}:n);u&&u(n)},[u,P]),z=(0,t.useCallback)(e=>{let t=P.filter(t=>t.fileId!==e);u&&u(t),`onTransferCancelled`in D&&D.onTransferCancelled&&D.onTransferCancelled?.(e)},[u,P,D]),{fileAttributes:B}=Nu(P,R),_e=(0,t.useMemo)(()=>[{op:Mu,enabled:L},{op:e=>Eu(e),enabled:he}].filter(({enabled:e})=>e).map(({op:e})=>e).concat(...f),[L,he]),V=(0,t.useMemo)(()=>({uploaded:`${oe}-uploaded`,errors:`${oe}-errors`}),[oe]),{totalCount:ve,uploadedCount:ye,failedCount:H}=(0,t.useMemo)(()=>{let e=P.length;if(!ce)return{totalCount:e,uploadedCount:0,failedCount:0};let t=0,n=0;for(let e of P){let r=ce.find(t=>t.fileId===e.fileId);r?.progress===`done`&&t++,r?.progress===`error`&&n++}return{totalCount:e,uploadedCount:t,failedCount:n}},[P,ce]),be=ve===1?`fil`:`filer`,xe=(0,n.jsx)(`div`,{className:(0,$.default)(`pkt-fileupload`,{"pkt-fileupload--full-width":m,"pkt-fileupload--error":k,"pkt-fileupload--disabled":S}),"aria-disabled":S,...S?{inert:``}:{},children:(0,n.jsxs)(gu.Provider,{value:{name:D.name||``,multiple:!!a,id:oe},children:[(0,n.jsx)(`div`,{id:V.uploaded,className:`pkt-sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:ve>0&&ye>0&&`${ye} av ${ve} ${be} lastet opp`}),(0,n.jsx)(`div`,{id:V.errors,className:`pkt-sr-only`,"aria-live":`assertive`,"aria-atomic":`true`,children:ve>0&&H>0&&`Feil ved opplasting: ${H} av ${ve} ${be} feilet`}),(0,n.jsx)(vu,{id:oe,name:D.name||``,value:P,onFilesAdded:ge,multiple:a,uploadStrategy:o,ref:se,accept:I?`.jpeg, .jpg, .png, .gif, .webp, .heic`:me,isThumbnailView:I,disabled:S,srAnnouncementIds:V,required:E&&o===`form`,"aria-required":E?`true`:void 0,"aria-invalid":j?`true`:void 0,"aria-describedby":de,hasVisibleLabel:!!C}),k&&A&&(0,n.jsx)(Zo,{skin:`error`,"aria-live":`assertive`,role:`alert`,compact:!0,id:ue,className:`pkt-fileupload__error-alert`,children:A}),(0,n.jsx)(ld,{files:P,cancelTransfer:z,truncateTail:l,transfers:ce,uploadStrategy:o,ItemRenderer:F,enableImagePreview:I&&te,queueItemOperations:_e.map(e=>e(B)).concat(Ou(z))})]})});return C?(0,n.jsx)(yl,{forId:oe,label:C,helptext:w,disabled:S,hasError:k,optionalTag:ee,requiredTag:T,className:(0,$.default)(`pkt-fileupload-wrapper`,{"pkt-fileupload-wrapper--full-width":m}),children:xe}):xe});dd.displayName=`PktFileUpload`;var fd=({columnOne:e,columnTwo:r,socialLinks:i,className:a,openLinksInNewTab:o=!1,personvernOgInfoLink:s=`https://www.oslo.kommune.no/personvern-og-informasjonskapsler/`,tilgjengelighetLink:c=`https://www.oslo.kommune.no/tilgjengelighet/`,includeConsent:l=!1,hotjarId:u=null,googleAnalyticsId:d=null,devMode:f=!1,cookieDomain:p=null,cookieSecure:m=null,cookieExpiryDays:h=null,onToggleConsent:g=e=>{console.log(e.detail)}})=>(0,n.jsx)(`footer`,{className:[a,`pkt-footer`].filter(Boolean).join(` `),"data-mode":`dark`,children:(0,n.jsxs)(`div`,{className:`pkt-footer__container`,children:[(0,n.jsxs)(`div`,{className:`pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16`,children:[(0,n.jsxs)(`div`,{className:`pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up`,children:[(0,n.jsx)(`h2`,{className:`pkt-footer__title`,children:e.title}),(0,n.jsxs)(`ul`,{className:`pkt-footer__list`,children:[e.text&&(0,n.jsx)(`li`,{className:`pkt-footer__text`,children:e.text}),e.links?.map((e,t)=>(0,n.jsx)(`li`,{className:`pkt-footer__list-item`,children:(0,n.jsxs)(`a`,{className:`pkt-footer__link ${e.external?`pkt-link--external`:``}`,href:e.href,target:e.openInNewTab||o?`_blank`:`_self`,rel:e.openInNewTab||o?`noopener noreferrer`:void 0,children:[(0,n.jsx)(Q,{className:`pkt-footer__link-icon`,name:`chevron-right`}),e.text]})},`links-${t}`))]})]}),(0,n.jsxs)(`div`,{className:`pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up`,children:[(0,n.jsx)(`h2`,{className:`pkt-footer__title`,children:r.title}),(0,n.jsxs)(`ul`,{className:`pkt-footer__list`,children:[r.text&&(0,n.jsx)(`li`,{className:`pkt-footer__text`,children:r.text}),r.links?.map((e,t)=>(0,n.jsx)(`li`,{className:`pkt-footer__list-item`,children:(0,n.jsxs)(`a`,{className:`pkt-footer__link ${e.external?`pkt-link--external`:``}`,href:e.href,target:e.openInNewTab||o?`_blank`:`_self`,rel:e.openInNewTab||o?`noopener noreferrer`:void 0,children:[(0,n.jsx)(Q,{className:`pkt-footer__link-icon`,name:`chevron-right`}),e.text]})},`links-${t}`))]})]}),(0,n.jsxs)(`div`,{className:`pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up`,children:[(0,n.jsx)(`h2`,{className:`pkt-footer__title`,children:`Om nettstedet`}),(0,n.jsxs)(`ul`,{className:`pkt-footer__list`,children:[(0,n.jsx)(`li`,{className:`pkt-footer__list-item`,children:(0,n.jsxs)(`a`,{className:`pkt-footer__link`,href:s,target:o?`_blank`:`_self`,rel:o?`noopener noreferrer`:void 0,children:[(0,n.jsx)(Q,{className:`pkt-footer__link-icon`,name:`chevron-right`}),`Personvern og informasjonskapsler`]})}),(0,n.jsx)(`li`,{className:`pkt-footer__list-item`,children:(0,n.jsxs)(`a`,{className:`pkt-footer__link`,href:c,target:o?`_blank`:`_self`,rel:o?`noopener noreferrer`:void 0,children:[(0,n.jsx)(Q,{className:`pkt-footer__link-icon`,name:`chevron-right`}),`Tilgjengelighet`]})}),l&&(0,n.jsx)(`li`,{className:`pkt-footer__list-item`,children:(0,n.jsx)(Gl,{triggerType:`footerlink`,hotjarId:u,googleAnalyticsId:d,devMode:f,cookieDomain:p,cookieSecure:m,cookieExpiryDays:h,onToggleConsent:g})})]})]})]}),i&&(0,n.jsxs)(`div`,{className:`pkt-footer__social`,"aria-label":`standard lenker`,children:[(0,n.jsx)(`div`,{className:`pkt-footer__social-languages`,children:i.filter(e=>e.language).map((e,t)=>(0,n.jsx)(`div`,{className:`pkt-footer__social-language`,children:(0,n.jsx)(`a`,{href:e.href,"aria-label":`til ${e.language} versjon av nettsiden`,target:e.openInNewTab||o?`_blank`:`_self`,rel:e.openInNewTab||o?`noopener noreferrer`:void 0,children:e.language})},`sociallinks-language-${t}`))}),(0,n.jsx)(`div`,{className:`pkt-footer__social-icons`,children:i.filter(e=>e.iconName).map((e,r)=>(0,n.jsx)(t.Fragment,{children:(0,n.jsx)(`a`,{href:e.href,"aria-label":`til ${e.iconName}`,className:`pkt-footer__social-icon-link`,target:e.openInNewTab||o?`_blank`:`_self`,rel:e.openInNewTab||o?`noopener noreferrer`:void 0,children:(0,n.jsx)(Q,{className:`pkt-footer__social-icon`,name:e.iconName})})},`sociallinks-${r}`))})]})]})}),pd=({links:e=[],openLinksInNewTab:t=!1,personvernOgInfoLink:r=`https://www.oslo.kommune.no/personvern-og-informasjonskapsler/`,tilgjengelighetLink:i=`https://www.oslo.kommune.no/tilgjengelighet/`,includeConsent:a=!1,hotjarId:o=null,googleAnalyticsId:s=null,devMode:c=!1,cookieDomain:l=null,cookieSecure:u=null,cookieExpiryDays:d=null,onToggleConsent:f=e=>{console.log(e.detail)},className:p})=>(0,n.jsx)(`footer`,{className:[p,`pkt-footer-simple`].filter(Boolean).join(` `),"data-mode":`dark`,children:(0,n.jsx)(`div`,{className:`pkt-footer-simple__container`,children:(0,n.jsxs)(`ul`,{className:`pkt-footer-simple__list`,children:[e.map((e,r)=>(0,n.jsx)(`li`,{className:`pkt-footer-simple__list-item`,children:(0,n.jsxs)(`a`,{className:`pkt-footer-simple__link ${e.external?` pkt-link--external`:``}`,href:e.href,target:e.openInNewTab||t?`_blank`:`_self`,rel:e.openInNewTab||t?`noopener noreferrer`:void 0,children:[(0,n.jsx)(Q,{className:`pkt-footer-simple__link-icon`,name:`chevron-right`}),e.text]})},r)),(0,n.jsx)(`li`,{className:`pkt-footer-simple__list-item`,children:(0,n.jsxs)(`a`,{className:`pkt-footer-simple__link`,href:r,target:t?`_blank`:`_self`,rel:t?`noopener noreferrer`:void 0,children:[(0,n.jsx)(Q,{className:`pkt-footer-simple__link-icon`,name:`chevron-right`}),`Personvern og informasjonskapsler`]})}),(0,n.jsx)(`li`,{className:`pkt-footer-simple__list-item`,children:(0,n.jsxs)(`a`,{className:`pkt-footer-simple__link`,href:i,target:t?`_blank`:`_self`,rel:t?`noopener noreferrer`:void 0,children:[(0,n.jsx)(Q,{className:`pkt-footer-simple__link-icon`,name:`chevron-right`}),`Tilgjengelighet`]})}),a&&(0,n.jsx)(`li`,{className:`pkt-footer-simple__list-item`,children:(0,n.jsx)(Gl,{triggerType:`footerlink`,hotjarId:o,googleAnalyticsId:s,devMode:c,cookieDomain:l,cookieSecure:u,cookieExpiryDays:d,onToggleConsent:f})})]})})}),md=(e,n)=>{let[r,i]=(0,t.useState)(()=>typeof window>`u`?n??0:n??window.innerWidth);return(0,t.useEffect)(()=>{let t=e.current;if(!t)return;if(i(t.offsetWidth),typeof ResizeObserver>`u`){let e=()=>{t&&i(t.offsetWidth)};return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)}let n=new ResizeObserver(e=>{for(let t of e)t.borderBoxSize&&t.borderBoxSize.length>0?i(t.borderBoxSize[0].inlineSize):i(t.contentRect.width)});return n.observe(t),()=>{n.disconnect()}},[e]),r};function hd(e){let n=(0,t.useRef)(0);(0,t.useEffect)(()=>{let t=document.body,r=document.documentElement;if(e){n.current=window.scrollY||window.pageYOffset;let e=window.innerWidth-r.clientWidth;e>0&&(t.style.paddingRight=`${e}px`),t.style.position=`fixed`,t.style.top=`-${n.current}px`,t.style.left=`0`,t.style.right=`0`,t.style.width=`100%`,t.style.overflow=`hidden`,r.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:n.current});return()=>{e&&(t.style.cssText=``,document.documentElement.classList.remove(`is-scroll-locked`),window.scrollTo({top:n.current}))}},[e])}var gd=({href:e,iconName:t,className:r,iconPosition:i,external:a,target:o,children:s,...c})=>{let l={"pkt-link":!0,"pkt-link--icon-left":!!t&&i===`left`||!!(t&&!i),"pkt-link--icon-right":!!t&&i===`right`,"pkt-link--external":a};return(0,n.jsxs)(`a`,{...c,className:(0,$.default)(l,r),href:e,target:o,rel:a?`noopener noreferrer`:void 0,children:[t&&(0,n.jsx)(Q,{name:t,className:`pkt-link__icon`}),s]})};gd.displayName=`PktLink`;var _d=e=>typeof e.target==`string`?{title:e.title,iconName:e.iconName,href:e.target}:{title:e.title,iconName:e.iconName,onClick:e.target},vd=({item:e,className:t})=>`href`in e?(0,n.jsx)(gd,{iconName:e.iconName,href:e.href,"aria-hidden":`true`,className:(0,$.default)(`pkt-user-menu__link`,t),children:e.title}):(0,n.jsxs)(`button`,{className:(0,$.default)(`pkt-user-menu__link pkt-link-button pkt-link pkt-link--icon-left`,t),type:`button`,onClick:()=>{`onClick`in e&&typeof e.onClick==`function`?e.onClick():console.error(`UserMenuButton item is missing onClick handler or onClick is not a function:`,e)},children:[e.iconName&&(0,n.jsx)(Q,{name:e.iconName,className:`pkt-link__icon`,"aria-hidden":`true`}),e.title]}),yd=({links:e})=>(0,n.jsx)(`ul`,{className:`pkt-user-menu__sublist`,children:e.map((e,t)=>(0,n.jsx)(`li`,{className:`pkt-user-menu__subitem`,children:(0,n.jsx)(vd,{item:e})},t))}),bd=(0,t.forwardRef)(({user:e,formattedLastLoggedIn:t,representing:r,userMenu:i,canChangeRepresentation:a,changeRepresentation:o,logoutOnClick:s},c)=>{let l=i?.map(_d);return(0,n.jsx)(`nav`,{className:`pkt-user-menu`,ref:c,"aria-label":`Meny for innlogget bruker`,children:(0,n.jsxs)(`ul`,{className:`pkt-user-menu__list`,children:[e&&(0,n.jsxs)(`li`,{className:`pkt-user-menu__item`,children:[(0,n.jsx)(`div`,{className:`pkt-user-menu__label`,children:`Pålogget som`}),(0,n.jsx)(`div`,{className:`pkt-user-menu__name`,translate:`no`,children:e.name}),t&&(0,n.jsxs)(`div`,{className:`pkt-user-menu__last-logged-in`,children:[`Sist pålogget: `,(0,n.jsx)(`time`,{children:t})]})]}),l&&l.length>0&&(0,n.jsx)(`li`,{className:`pkt-user-menu__item`,children:(0,n.jsx)(yd,{links:l})}),r&&(0,n.jsxs)(`li`,{className:`pkt-user-menu__item`,children:[(0,n.jsx)(`div`,{className:`pkt-user-menu__label`,children:`Representerer`}),(0,n.jsx)(`div`,{className:`pkt-user-menu__name`,translate:`no`,children:r.name}),r.orgNumber&&(0,n.jsxs)(`div`,{className:`pkt-user-menu__org-number`,children:[`Org.nr. `,r.orgNumber]}),a&&o&&(0,n.jsx)(`ul`,{className:`pkt-user-menu__sublist mt-size-16`,children:(0,n.jsx)(`li`,{className:`pkt-user-menu__subitem`,children:(0,n.jsx)(vd,{item:{title:`Endre organisasjon`,iconName:`cogwheel`,onClick:o}})})})]}),!r&&a&&o&&(0,n.jsx)(`li`,{className:`pkt-user-menu__item`,children:(0,n.jsx)(`ul`,{className:`pkt-user-menu__sublist`,children:(0,n.jsx)(`li`,{className:`pkt-user-menu__subitem`,children:(0,n.jsx)(vd,{item:{title:`Endre organisasjon`,iconName:`cogwheel`,onClick:o}})})})}),s&&(0,n.jsx)(`li`,{className:`pkt-user-menu__item`,children:(0,n.jsx)(vd,{item:{title:`Logg ut`,iconName:`exit`,onClick:s}})})]})})});bd.displayName=`PktHeaderUserMenu`;var xd=(0,t.forwardRef)(({id:e,ariaDescribedby:r,ariaLabelledby:i,autocomplete:a=`off`,counter:o,counterMaxLength:s,className:c,disabled:l=!1,errorMessage:u,hasError:d=!1,helptext:f,helptextDropdown:p,helptextDropdownButton:m,iconNameRight:h,inline:g=!1,fullwidth:_=!1,label:v,name:y,optionalTag:b=!1,optionalText:x,requiredTag:S=!1,requiredText:C,tagText:w=null,placeholder:ee,prefix:T,suffix:E,type:te=`text`,useWrapper:ne=!0,omitSearchIcon:re=!1,value:D,minLength:ie,maxLength:ae,min:oe,max:se,step:ce,size:O,readonly:le,required:k,dataTestid:A,onChange:ue,skipForwardTestid:de=!1,...j},M)=>{let N=[c,`pkt-textinput`].join(` `),P=te===`search`&&!h&&!re,F=te===`date`&&D?D.slice(0,10):D,[I,fe]=(0,t.useState)(D?.length||0),pe=`${e}`,me=`${pe}-label`,L=i||me,he=e=>{o&&fe(e.currentTarget?.value?.length||0),ue&&ue(e)};return(0,t.useEffect)(()=>{D!==void 0&&fe(D?.length||0)},[D]),(0,n.jsx)(yl,{ariaDescribedby:r,className:N,disabled:l,errorMessage:u,forId:pe,hasError:d,helptext:f,helptextDropdown:p,helptextDropdownButton:m,inline:g,label:v,optionalTag:b,optionalText:x,requiredTag:S,requiredText:C,tagText:w,useWrapper:ne,counter:o,counterCurrent:I,counterMaxLength:s,children:(0,n.jsxs)(`div`,{className:`pkt-input__container`,"data-testid":A,"data-skip-forward-testid":de?`true`:void 0,children:[T&&(0,n.jsx)(`div`,{className:`pkt-input-prefix`,children:T}),(0,n.jsx)(`input`,{...j,ref:M,className:`pkt-input ${_?`pkt-input--fullwidth`:``} ${s&&I>s?`pkt-input--counter-error`:``}`,type:te,name:`${y||e}`,value:F,id:pe,placeholder:ee,autoComplete:a,disabled:l,"aria-invalid":d,"aria-errormessage":`${e}-error`,"aria-labelledby":L,min:oe,max:se,onChange:he,step:ce,minLength:ie,maxLength:ae,size:O,readOnly:le,required:k}),E&&(0,n.jsxs)(`p`,{className:`pkt-input-suffix`,children:[E,h&&(0,n.jsx)(Q,{className:`pkt-input-suffix-icon`,name:h}),P&&(0,n.jsx)(Q,{className:`pkt-input-suffix-icon`,name:`magnifying-glass-big`})]}),!E&&h&&(0,n.jsx)(Q,{className:`pkt-input-icon`,name:h}),!E&&P&&(0,n.jsx)(Q,{className:`pkt-input-icon`,name:`magnifying-glass-big`})]})})});xd.displayName=`PktTextinput`;var Sd=(0,t.forwardRef)(({mobileBreakpoint:e=768,tabletBreakpoint:r=1280,children:i,className:a,compact:o=!1,"data-mode":s,logOutButtonPlacement:c=`none`,logOut:l,openedMenu:u,showSearch:d=!1,onSearch:f,onSearchChange:p,searchValue:m,searchPlaceholder:h=`Søk`,representing:g,serviceLink:_,serviceClick:v,serviceName:y,user:b,userMenu:x,userMenuFooter:S,userOptions:C,canChangeRepresentation:w=!1,changeRepresentation:ee,hideLogo:T=!1,logoLink:E,logoClick:te,position:ne=`fixed`,scrollBehavior:re=`hide`,slotMenuVariant:D=`icon-only`,slotMenuText:ie=`Meny`},ae)=>{let oe=ne===`fixed`,se=re===`hide`;(0,t.useEffect)(()=>{S&&console.warn(`PktHeaderService: The "userMenuFooter" prop is deprecated and will be removed in a future version. Please use "userMenu" instead.`)},[S]),(0,t.useEffect)(()=>{C&&console.warn(`PktHeaderService: The "userOptions" prop is no longer available. Please use "userMenu" instead.`)},[C]),(0,t.useEffect)(()=>{b?.shortname&&console.warn(`PktHeaderService: The "shortname" property on the user object is deprecated and will be removed in a future version.`),g?.shortname&&console.warn(`PktHeaderService: The "shortname" property on the representing object is deprecated and will be removed in a future version.`)},[b?.shortname,g?.shortname]);let ce=(0,t.useMemo)(()=>{if(b?.lastLoggedIn)return typeof b.lastLoggedIn==`string`?b.lastLoggedIn:new Date(b.lastLoggedIn).toLocaleString(`nb-NO`,{year:`numeric`,month:`long`,day:`numeric`})},[b?.lastLoggedIn]),[O,le]=(0,t.useState)(u||`none`);(0,t.useEffect)(()=>{u!==void 0&&le(u)},[u]);let[k,A]=(0,t.useState)(!1),[ue,de]=(0,t.useState)(0),[j,M]=(0,t.useState)(!1),[N,P]=(0,t.useState)(!1),F=(0,t.useRef)(null),I=(0,t.useRef)(null),fe=(0,t.useRef)(null),pe=(0,t.useRef)(null),me=(0,t.useRef)(null),L=(0,t.useRef)(null),he=(0,t.useRef)(null),ge=(0,t.useRef)(!1),R=md(F),z=R<e,B=R<r,_e=(0,t.useCallback)(e=>{F.current=e,typeof ae==`function`?ae(e):ae&&(ae.current=e)},[ae]);hd(oe&&z&&O!==`none`);let V=(0,t.useCallback)((e,t)=>{let n=e.relatedTarget,r;switch(t){case`user`:r=I;break;case`slot`:r=fe;break;case`search`:r=pe;break;default:return}let i=r.current;i&&(!n||!i.contains(n))&&le(`none`)},[]),ve=(0,t.useCallback)(()=>{ge.current&&he.current&&document.contains(he.current)&&he.current.focus(),he.current=null,ge.current=!1},[]);(0,t.useEffect)(()=>{let e=e=>{b&&O===`user`&&!e.target.closest(`.pkt-header-service__user-container`)&&le(`none`),O===`slot`&&!e.target.closest(`.pkt-header-service__slot-container`)&&le(`none`),O===`search`&&!e.target.closest(`.pkt-header-service__search-container`)&&!e.target.closest(`.pkt-header-service__search-input`)&&le(`none`)},t=e=>{e.key===`Escape`&&O!==`none`&&(e.preventDefault(),ge.current=!0,le(`none`))};if(O!==`none`)return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)};ve()},[O,b,ve]),(0,t.useEffect)(()=>{let e=()=>{if(se){let e=window.pageYOffset||document.documentElement.scrollTop;if(e<0||Math.abs(e-ue)<60)return;A(e>ue),de(e)}};return document&&window.addEventListener(`scroll`,e),()=>{document&&window.removeEventListener(`scroll`,e)}},[se,ue]);let ye=(0,t.useCallback)(e=>{let t=e===`slot`?fe:pe,n=e===`slot`?me:L;if(!t.current||!n.current||!B||z)return;let r=t.current.getBoundingClientRect(),i=n.current.offsetWidth,a=r.left+i>window.innerWidth;e===`slot`?M(a):P(a)},[B,z]),H=(0,t.useCallback)(e=>{O===`none`?(he.current=document.activeElement,le(e)):le(`none`)},[O]);(0,t.useEffect)(()=>{(O===`slot`||O===`search`)&&requestAnimationFrame(()=>{ye(O)})},[O,ye]);let be=(0,n.jsxs)(`header`,{className:(0,$.default)(`pkt-header-service`,o&&`pkt-header-service--compact`,z&&`pkt-header-service--mobile`,B&&`pkt-header-service--tablet`,oe&&`pkt-header-service--fixed`,se&&`pkt-header-service--scroll-to-hide`,k&&`pkt-header-service--hidden`,a),"data-mode":s,ref:_e,children:[(0,n.jsxs)(`div`,{className:(0,$.default)(`pkt-header-service__logo-area`,(!y||y===``)&&`pkt-header-service__logo-area--without-service`),children:[!T&&(0,n.jsx)(`span`,{className:`pkt-header-service__logo`,children:E?(0,n.jsx)(`a`,{href:E,"aria-label":`Tilbake til forside`,children:(0,n.jsx)(Q,{name:`oslologo`,"aria-hidden":`true`,path:`https://punkt-cdn.oslo.kommune.no/16.11/logos/`})}):te?(0,n.jsx)(`button`,{"aria-label":`Tilbake til forside`,className:`pkt-link-button pkt-link pkt-header-service__logo-link`,onClick:te,children:(0,n.jsx)(Q,{name:`oslologo`,"aria-hidden":`true`,path:`https://punkt-cdn.oslo.kommune.no/16.11/logos/`})}):(0,n.jsx)(Q,{name:`oslologo`,"aria-hidden":`true`,path:`https://punkt-cdn.oslo.kommune.no/16.11/logos/`})}),y&&(0,n.jsx)(`span`,{className:`pkt-header-service__service-name`,children:_?(0,n.jsx)(gd,{href:_,className:`pkt-header-service__service-link `,children:y}):v?(0,n.jsx)(`button`,{className:`pkt-link-button pkt-link pkt-header-service__service-link`,onClick:v,children:y}):(0,n.jsx)(`span`,{className:`pkt-header-service__service-link`,children:y})})]}),i||d||B&&l&&(c===`header`||c===`both`)?(0,n.jsxs)(`div`,{className:`pkt-header-service__content`,children:[(0,n.jsxs)(`div`,{className:(0,$.default)(`pkt-header-service__slot-container`,O===`slot`&&`is-open`),onBlur:e=>V(e,`slot`),ref:fe,children:[B&&i&&(0,n.jsx)(es,{skin:`secondary`,variant:D,iconName:`menu`,size:z?`small`:`medium`,state:O===`slot`?`active`:`normal`,onClick:()=>H(`slot`),"aria-expanded":O===`slot`,"aria-controls":`mobile-slot-menu`,"aria-label":`Åpne meny`,children:ie}),(0,n.jsx)(`div`,{className:(0,$.default)(`pkt-header-service__slot-content`,j&&`align-right`),id:`mobile-slot-menu`,role:B?`menu`:void 0,"aria-label":B?`Meny`:void 0,ref:me,children:(0,n.jsx)(`div`,{className:`pkt-contents`,children:i})})]}),d&&(0,n.jsx)(n.Fragment,{children:B?(0,n.jsxs)(`div`,{className:(0,$.default)(`pkt-header-service__search-container`,O===`search`&&`is-open`),onBlur:e=>V(e,`search`),ref:pe,children:[(0,n.jsx)(es,{skin:`secondary`,variant:`icon-only`,iconName:`magnifying-glass-big`,size:z?`small`:`medium`,onClick:()=>H(`search`),state:O===`search`?`active`:`normal`,"aria-expanded":O===`search`,"aria-controls":`mobile-search-menu`,"aria-label":`Åpne søkefelt`,children:`Søk`}),(0,n.jsx)(`div`,{className:(0,$.default)(`pkt-header-service__mobile-menu`,O===`search`&&`is-open`,N&&`align-right`),ref:L,children:O===`search`&&(0,n.jsx)(xd,{id:`mobile-search-menu`,className:`pkt-header-service__search-input`,type:`search`,label:`Søk`,useWrapper:!1,placeholder:h,value:m,autoFocus:!0,fullwidth:!0,onChange:e=>p?.(e.target.value),onKeyDown:e=>{e.key===`Enter`&&f?.(e.target.value)}})})]}):(0,n.jsx)(xd,{id:`header-service-search`,className:`pkt-header-service__search-input`,type:`search`,label:`Søk`,useWrapper:!1,placeholder:h,value:m,onChange:e=>p?.(e.target.value),onKeyDown:e=>{e.key===`Enter`&&f?.(e.target.value)}})}),z&&l&&(c===`header`||c===`both`)&&(0,n.jsx)(es,{skin:`secondary`,size:z?`small`:`medium`,variant:`icon-only`,iconName:`exit`,onClick:l,children:`Logg ut`})]}):null,(b||!z&&l&&(c===`header`||c===`both`))&&(0,n.jsxs)(`div`,{className:`pkt-header-service__user`,children:[b&&(0,n.jsxs)(`div`,{className:`pkt-header-service__user-container`,onBlur:e=>V(e,`user`),ref:I,children:[(0,n.jsxs)(es,{className:(0,$.default)(`pkt-header-service__user-button`,z&&`pkt-header-service__user-button--mobile`),skin:`secondary`,size:z?`small`:`medium`,state:O===`user`?`active`:`normal`,variant:`icons-right-and-left`,iconName:`user`,secondIconName:O===`user`?`chevron-thin-up`:`chevron-thin-down`,onClick:()=>H(`user`),children:[(0,n.jsx)(`span`,{className:`pkt-sr-only`,children:`Brukermeny: `}),g?.name||b.name]}),O===`user`&&b&&(0,n.jsx)(`div`,{className:(0,$.default)(z?`pkt-header-service__mobile-menu`:`pkt-header-service__user-menu`,`is-open`),children:(0,n.jsx)(bd,{user:b,formattedLastLoggedIn:ce,representing:g,userMenu:x,canChangeRepresentation:w,changeRepresentation:ee,logoutOnClick:c===`userMenu`||c===`both`?l:void 0})})]}),!z&&l&&(c===`header`||c===`both`)&&(0,n.jsx)(es,{skin:`tertiary`,size:`medium`,variant:`icon-right`,iconName:`exit`,onClick:l,children:`Logg ut`})]})]});return oe?(0,n.jsxs)(`div`,{className:`pkt-header-service-wrapper`,children:[be,(0,n.jsx)(`div`,{className:(0,$.default)(`pkt-header-service-spacer`,o&&`pkt-header-service-spacer--compact`,b&&`pkt-header-service-spacer--has-user`,z&&`pkt-header-service-spacer--mobile`,B&&`pkt-header-service-spacer--tablet`)})]}):be});Sd.displayName=`PktHeaderService`;var Cd=(0,t.forwardRef)((e,t)=>(0,n.jsx)(Sd,{...e,ref:t}));Cd.displayName=`PktHeader`;var wd=x({tagName:`pkt-heading`,elementClass:mi,react:t.default,displayName:`PktHeading`}),Td=(0,t.forwardRef)(({children:e,...t},r)=>(0,n.jsx)(wd,{"data-testid":`pkt-heading`,...t,ref:r,children:e}));Td.displayName=`PktHeading`;var Ed=x({tagName:`pkt-helptext`,elementClass:Ki,react:t.default,displayName:`PktHelptext`,events:{onToggleHelpText:`toggleHelpText`}}),Dd=(0,t.forwardRef)(({children:e,...t},r)=>(0,n.jsx)(Ed,{...t,ref:r,children:(0,n.jsx)(`div`,{className:`pkt-contents`,children:e})}));Dd.displayName=`PktHelptext`;var Od=(0,t.forwardRef)(({label:e,id:t,children:r,...i},a)=>(0,n.jsxs)(`div`,{className:`pkt-form-group`,children:[(0,n.jsx)(`label`,{htmlFor:t,className:`pkt-form-label`,children:e}),(0,n.jsx)(`input`,{className:`pkt-form-input`,id:t,...i,ref:a}),r]}));Od.displayName=`PktInput`;var kd=({children:e,skin:t,title:r,href:i,iconName:a,openInNewTab:o,external:s,className:c,...l})=>{let u=[`pkt-linkcard`,t&&`pkt-linkcard--${t}`].filter(Boolean).join(` `),d=[`pkt-linkcard__title`,s&&`pkt-link pkt-link--external`].filter(Boolean).join(` `);return(0,n.jsxs)(`a`,{...l,href:i,className:(0,$.default)(u,c),target:o?`_blank`:`_self`,rel:o?`noopener noreferrer`:void 0,children:[a&&(0,n.jsx)(Q,{className:`pkt-link__icon`,name:a}),r&&(0,n.jsx)(`div`,{className:(0,$.default)(d),children:r}),(0,n.jsx)(`div`,{className:`pkt-linkcard__text`,children:e})]})};kd.displayName=`PktLinkCard`;var Ad=x({tagName:`pkt-loader`,elementClass:Za,react:t.default,displayName:`PktLoader`,events:{}}),jd=(0,t.forwardRef)(({children:e,...t},r)=>(0,n.jsx)(Ad,{...t,ref:r,children:(0,n.jsx)(`div`,{className:`pkt-contents`,children:e})}));jd.displayName=`PktLoader`;var Md=({children:e,className:r,skin:i,title:a,compact:o,closable:s,onClose:c,...l})=>{let[u,d]=(0,t.useState)(!1),f={"pkt-messagebox":!0,"pkt-messagebox--compact":o,[`pkt-messagebox--${i}`]:i,"pkt-messagebox--closable":s,"pkt-hide":u},p=(0,t.createRef)(),m=(0,t.useCallback)(()=>{d(!0),c&&c()},[d,c]);return(0,n.jsxs)(`div`,{...l,className:(0,$.default)(f,r),ref:p,children:[s&&(0,n.jsx)(`div`,{className:`pkt-messagebox__close`,children:(0,n.jsx)(`button`,{onClick:m,className:`pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only`,"aria-label":`Lukk`,children:(0,n.jsx)(Q,{name:`close`,className:`pkt-link__icon`})})}),a&&(0,n.jsx)(`div`,{className:`pkt-messagebox__title`,children:a}),(0,n.jsx)(`div`,{className:`pkt-messagebox__text`,children:e})]})};Md.displayName=`PktMessagebox`;var Nd=()=>(`00000000000000000`+(Math.random()*0x10000000000000000).toString(16)).slice(-16),Pd=()=>{let e=Nd(),t=Nd();return e.slice(0,8)+`-`+e.slice(8,12)+`-4`+e.slice(13)+`-a`+t.slice(1,4)+`-`+t.slice(4)},Fd=(0,t.forwardRef)(({ariaLabel:e,ariaLabelledby:r,ariaLive:i=`polite`,ariaValueText:a,id:o,role:s=`progressbar`,skin:c=`dark-blue`,statusPlacement:l=`following`,statusType:u=`none`,title:d,titlePosition:f=`left`,valueCurrent:p=0,valueMax:m=100,valueMin:h=0,className:g,..._},v)=>{let y=(0,t.useMemo)(()=>Pd(),[]),b=o||y,x=(0,t.useRef)(null),[S,C]=(0,t.useState)(0);(0,t.useEffect)(()=>{x.current&&C(x.current.getBoundingClientRect().width||0)},[p]);let w=m-h,ee=Math.round(u===`fraction`?p/w*100:(p-h)/w*100),T=`${p} av ${w}`,E=u===`fraction`&&!a?`${p} av ${m-h}`:a||void 0,te=e?void 0:r||`${b}-title`;return(0,n.jsx)(`div`,{ref:v,id:b,role:s,"aria-live":i,"aria-atomic":`true`,"aria-valuenow":p,"aria-valuemin":h,"aria-valuemax":m,"aria-valuetext":E,"aria-label":e||void 0,"aria-labelledby":te,className:(0,$.default)(`pkt-progressbar`,g),..._,children:(0,n.jsxs)(`div`,{className:`pkt-progressbar__container`,style:{"--pkt-progress-label-width":`${S}px`,"--pkt-progress-width":`${ee}%`},children:[d&&(0,n.jsx)(`p`,{id:`${b}-title`,className:(0,$.default)(`pkt-progressbar__title`,{"pkt-progressbar__title-center":f===`center`}),children:d}),(0,n.jsx)(`div`,{className:`pkt-progressbar__bar-wrapper`,children:(0,n.jsx)(`div`,{className:(0,$.default)(`pkt-progressbar__bar`,`pkt-progressbar__bar--${c}`)})}),u!==`none`&&(0,n.jsx)(`div`,{className:(0,$.default)(`pkt-progressbar__status`,{"pkt-progressbar__status--center":l===`center`}),children:(0,n.jsx)(`span`,{ref:x,className:(0,$.default)({"pkt-progressbar__status-placement--following":l===`following`,"pkt-progressbar__status-placement--center":l===`center`,"pkt-progressbar__status-placement--left":l===`left`}),children:u===`percentage`?`${ee}%`:T})})]})})});Fd.displayName=`PktProgressbar`;var Id=(0,t.forwardRef)(({id:e,name:t,label:r,className:i,hasTile:a=!1,disabled:o=!1,checkHelptext:s,hasError:c=!1,defaultChecked:l,checked:u,optionalTag:d,optionalText:f,requiredTag:p,requiredText:m,tagText:h,...g},_)=>{let v=[i,`pkt-input-check`].filter(Boolean).join(` `),y=[`pkt-input-check__input`,a?`pkt-input-check__input--tile`:``,o&&a?`pkt-input-check__input--tile-disabled`:``].filter(Boolean).join(` `),b=[`pkt-input-check__input-checkbox`,c?`pkt-input-check__input-checkbox--error`:``].filter(Boolean).join(` `),x=[`pkt-input-check__input-label`,o?`pkt-input-check__input-label--disabled`:``].filter(Boolean).join(` `),S=[`pkt-tag`,`pkt-tag--small`,`pkt-tag--thin-text`].join(` `),C=()=>(0,n.jsxs)(n.Fragment,{children:[h&&(0,n.jsx)(`span`,{className:S+` pkt-tag--gray`,children:h}),d&&(0,n.jsx)(`span`,{className:S+` pkt-tag--blue-light`,children:f}),p&&(0,n.jsx)(`span`,{className:S+` pkt-tag--beige`,children:m})]});return(0,n.jsx)(`div`,{className:v,children:(0,n.jsxs)(`div`,{className:y,children:[(0,n.jsx)(`input`,{ref:_,id:e,type:`radio`,name:t,disabled:o,className:b,...u===void 0?{defaultChecked:l}:{checked:u},...g}),(0,n.jsxs)(`label`,{className:x,htmlFor:e,children:[r,` `,C(),s&&(0,n.jsx)(`div`,{className:`pkt-input-check__input-helptext`,children:s})]})]})})});Id.displayName=`PktRadioButton`;var Ld=(0,t.forwardRef)(({appearance:e=`local`,disabled:r=!1,fullwidth:i=!1,id:a,label:o,name:s,placeholder:c=`Søk…`,suggestions:l,value:u=``,action:d,method:f,onChange:p,onSearch:m,onSuggestionClick:h,...g},_)=>{let v=(e,t)=>{e?e():h&&h(t)},y=e=>{u=e.target.value},b=`pkt-searchinput pkt-searchinput--${e} ${i?`pkt-searchinput--fullwidth`:``}`,x;return x=d?e=>(0,n.jsx)(`form`,{role:`search`,className:b,action:d,method:f,children:e}):e=>(0,n.jsx)(`div`,{role:`search`,className:b,children:e}),x((0,n.jsxs)(n.Fragment,{children:[o&&(0,n.jsx)(`label`,{htmlFor:o?a:void 0,className:o?`pkt-inputwrapper__label`:``,children:o}),(0,n.jsxs)(`div`,{className:e===`local`?`pkt-input__container`:`pkt-searchinput__field`,children:[(0,n.jsx)(`input`,{className:`pkt-input ${i?`pkt-input--fullwidth`:``}`,type:`search`,name:s||a,id:a,placeholder:c,defaultValue:u,disabled:r,autoComplete:`off`,"aria-autocomplete":`list`,ref:_,"aria-controls":`${a}-suggestions`,onChange:p||y,onKeyUp:m&&(e=>{e.key===`Enter`&&(e.preventDefault(),m(u))}),...g}),(0,n.jsx)(es,{className:`pkt-searchinput__button ${e===`local`?`pkt-input-icon`:``}`,variant:`icon-only`,iconName:`magnifying-glass-big`,skin:e===`local`?`tertiary`:`primary`,color:e===`global`?`yellow`:void 0,type:`submit`,disabled:r,onClick:m&&(e=>{e.preventDefault(),m(u)}),children:o||c})]}),l&&(0,n.jsx)(`ul`,{id:`${a}-suggestions`,className:`pkt-searchinput__suggestions`,"aria-live":`assertive`,children:l.map((e,r)=>(0,n.jsx)(`li`,{children:(0,t.createElement)(e.href?`a`:e.onClick?`button`:`div`,{href:e.href,className:`pkt-searchinput__suggestion ${e.onClick?`pkt-link-button`:``} ${e.href||e.onClick?`pkt-searchinput__suggestion--has-hover`:``}`,type:e.onClick?`button`:void 0,onClick:()=>v(e.onClick,r),onKeyUp:t=>t.key===`Enter`&&v(e.onClick,r)},(0,n.jsxs)(n.Fragment,{children:[e.title&&(0,n.jsx)(`h3`,{className:`pkt-searchinput__suggestion-title`,children:e.title}),e.text&&(0,n.jsx)(`p`,{className:`pkt-searchinput__suggestion-text`,children:e.text})]}))},`search-suggestion-${r}`))})]}))});Ld.displayName=`PktSearchInput`;var Rd=(0,t.forwardRef)(({ariaDescribedby:e,ariaLabelledby:t,children:r,className:i,disabled:a=!1,errorMessage:o,hasError:s,helptext:c,helptextDropdown:l,helptextDropdownButton:u,id:d,inline:f=!1,fullwidth:p=!1,label:m,name:h,optionalTag:g=!1,optionalText:_,requiredTag:v=!1,requiredText:y,tagText:b,...x},S)=>(0,n.jsx)(yl,{className:[i,`pkt-select`].join(` `),forId:`${d}-input`,label:m,helptext:c,helptextDropdown:l,helptextDropdownButton:u,optionalTag:g,optionalText:_,requiredTag:v,requiredText:y,tagText:b,hasError:s,errorMessage:o,disabled:a,inline:f,ariaDescribedby:e,children:(0,n.jsx)(`select`,{ref:S,className:`pkt-input ${p?`pkt-input--fullwidth`:``}`,"aria-invalid":s,"aria-errormessage":`${d}-error`,"aria-labelledby":t||void 0,disabled:a,id:`${d}-input`,name:h||d,...x,children:r})}));Rd.displayName=`PktSelect`;var zd=(0,n.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,fill:`none`,children:(0,n.jsx)(`circle`,{cx:`12`,cy:`12`,r:`7`,style:{fill:`var(--pkt-color-grays-grey-200, #CCC)`}})}),Bd=(0,n.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,fill:`none`,children:[(0,n.jsx)(`circle`,{opacity:`.15`,cx:`12`,cy:`12`,r:`12`,fill:`#2A2859`}),(0,n.jsx)(`circle`,{cx:`12`,cy:`12`,r:`6`,fill:`#2A2859`})]}),Vd=(0,n.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,fill:`none`,children:[(0,n.jsx)(`path`,{fill:`#2A2859`,d:`M3 3h18v18H3z`}),(0,n.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`})]}),Hd=({children:e,className:t,status:r=`incomplete`,title:i})=>(0,n.jsxs)(`li`,{className:(0,$.default)(`pkt-step`,t,`pkt-step--${r}`),"data-testid":`pkt-step`,children:[(0,n.jsx)(`span`,{className:`pkt-step__line pkt-step__line--1`,"aria-hidden":!0}),(0,n.jsx)(`span`,{className:`pkt-step__line pkt-step__line--2`,"aria-hidden":!0}),(0,n.jsx)(`span`,{className:(0,$.default)(`pkt-step__indicator`),children:r===`current`?Bd:r===`completed`?Vd:zd}),(0,n.jsx)(`span`,{className:`pkt-step__line pkt-step__line--3`,"aria-hidden":!0}),(0,n.jsxs)(`div`,{className:`pkt-step__wrapper`,children:[(0,n.jsx)(`div`,{className:`pkt-step__title`,children:i}),(0,n.jsx)(`div`,{className:`pkt-step__content`,children:e})]})]}),Ud=(0,t.forwardRef)(({activeStep:e,className:r,children:i,hideNonActiveSteps:a=!1,hideNonActiveStepsContent:o=!0,orientation:s=`vertical`,...c},l)=>{let u=(0,$.default)(r,`pkt-stepper`,s===`horizontal`?`pkt-stepper--horizontal`:`pkt-stepper--vertical`),d=t.Children.map(i,(n,r)=>(0,t.isValidElement)(n)?(0,t.cloneElement)(n,{className:(0,$.default)(n.props.className,{"pkt-step--hideStep":a&&r!==e,"pkt-step--hideContent":o&&r!==e})}):n);return(0,n.jsx)(`ol`,{"data-testid":`pkt-stepper`,className:u,ref:l,...c,children:d})});Ud.displayName=`PktStepper`;var Wd=({className:e,compact:t=!1,skin:r=`basic`,responsiveView:i=!0,children:a,...o})=>(0,n.jsx)(`table`,{"data-testid":`pkt-table`,className:(0,$.default)(e,`pkt-table`,{"pkt-table--responsive":i,"pkt-table--compact":t,"pkt-table--basic":r===`basic`,"pkt-table--zebra-blue":r===`zebra-blue`}),role:`table`,...o,children:a}),Gd=({id:e,children:t,className:r,...i})=>(0,n.jsx)(`tbody`,{id:e,className:(0,$.default)(r,`pkt-table__body`,{}),...i,role:`rowgroup`,children:t}),Kd=({children:e,className:t,dataLabel:r,...i})=>(0,n.jsx)(`td`,{className:(0,$.default)(t,`pkt-table__data-cell`,{}),"data-label":r,role:`cell`,"data-testid":`pkt-table__data-cell`,...i,children:e}),qd=({className:e,children:t,...r})=>(0,n.jsx)(`thead`,{className:(0,$.default)(e,`pkt-table__header`,{}),role:`rowgroup`,...r,children:t}),Jd=({className:e,children:t,...r})=>(0,n.jsx)(`th`,{className:(0,$.default)(e,`pkt-table__header-cell`,{}),role:`columnheader`,...r,children:t}),Yd=({className:e,children:t,...r})=>(0,n.jsx)(`tr`,{className:(0,$.default)(e,`pkt-table__row`,{}),role:`row`,...r,children:t}),Xd=(0,t.forwardRef)(({children:e,active:t,disabled:r=!1,href:i,onClick:a,icon:o,controls:s,tag:c,tagSkin:l,index:u=0},d)=>{let{arrowNav:f,registerTabRef:p,handleKeyPress:m,selectTab:h}=Qd(),g=!!t&&!r,_={"aria-selected":f?g:void 0,"aria-controls":s,role:f?`tab`:void 0,onKeyDown:e=>{if(r&&(e.key===`Enter`||e.key===` `||e.key===`Spacebar`)){e.preventDefault(),e.stopPropagation();return}m(u,e)},onClick:e=>{if(r){e.preventDefault(),e.stopPropagation();return}h(u),a?.(e)},tabIndex:r?-1:g||!f?void 0:-1,ref:e=>{p(u,e,r),typeof d==`function`?d(e):d&&(d.current=e)}},v=(0,n.jsxs)(n.Fragment,{children:[o&&(0,n.jsx)(Q,{name:o,className:`pkt-icon--small ${o===`check`?`pkt-tabs__status-icon`:``}`}),e,c&&(0,n.jsx)(gl,{skin:l,size:`small`,children:c})]});return i?(0,n.jsx)(`a`,{..._,href:r?void 0:i,"aria-disabled":r||void 0,className:`pkt-tabs__link ${g?`active`:``} ${r?`pkt-tabs__item--disabled`:``}`,children:v}):(0,n.jsx)(`button`,{..._,type:`button`,disabled:r,"aria-disabled":r||void 0,className:`pkt-tabs__button pkt-link-button ${g?`active`:``} ${r?`pkt-tabs__item--disabled`:``}`,children:v})});Xd.displayName=`PktTabItem`;var Zd=(0,t.createContext)(null),Qd=()=>{let e=(0,t.useContext)(Zd);if(!e)throw Error(`TabItem must be used within a Tabs component`);return e},$d=(0,t.forwardRef)(({arrowNav:e=!0,disableArrowNav:r=!1,separatorIconName:i,separatorIconPath:a,tabs:o,onTabSelected:s,children:c},l)=>{let u=(0,t.useRef)([]),d=(0,t.useRef)({}),f=e&&!r,p=t.Children.toArray(c),m=p.length>0,h=m?p.length:o?.length||0,g=!!(i||a);(0,t.useEffect)(()=>{u.current=u.current.slice(0,h),Object.keys(d.current).forEach(e=>{let t=Number(e);t>=h&&delete d.current[t]})},[h]);let _=e=>o?!!o[e]?.disabled:!!d.current[e],v=e=>{if(_(e))return;let t=o?.[e];t?.action&&t.action(e),s&&s(e)},y=(e,t)=>{let n=e+t;for(;n>=0&&n<h;){if(!_(n))return n;n+=t}return null},b=(e,t)=>{if(f){if(t.key===`ArrowLeft`){t.preventDefault();let n=y(e,-1);n!==null&&u.current[n]?.focus()}if(t.key===`ArrowRight`){t.preventDefault();let n=y(e,1);n!==null&&u.current[n]?.focus()}(t.key===`Enter`||t.key===` `||t.key===`Spacebar`||t.key===`ArrowDown`)&&(t.preventDefault(),_(e)||v(e))}},x=(e,t,n=!1)=>{u.current[e]=t,d.current[e]=n},S=e=>(0,n.jsx)(`span`,{className:`pkt-tabs__separator`,"aria-hidden":`true`,role:`presentation`,children:a?(0,n.jsx)(`img`,{src:a,alt:``,"aria-hidden":`true`}):i?(0,n.jsx)(Q,{name:i,className:`pkt-tabs__separator-icon`}):null},e),C=e=>!g||e.length<=1?e:e.flatMap((t,n)=>n<e.length-1?[t,S(`separator-${n}`)]:[t]),w=o?.map((e,t)=>(0,n.jsx)(Xd,{active:e.disabled?!1:e.active,disabled:e.disabled,href:e.href,icon:e.icon,controls:e.controls,tag:e.tag?.text,tagSkin:e.tag?.skin,index:t,children:e.text},t)),ee=[`pkt-tabs`,g&&`pkt-tabs--with-separator`].filter(Boolean).join(` `),T=C(m?p:w||[]);return(0,n.jsx)(Zd.Provider,{value:{arrowNav:f,registerTabRef:x,handleKeyPress:b,selectTab:v},children:(0,n.jsx)(`div`,{className:ee,ref:l,children:(0,n.jsx)(`div`,{className:`pkt-tabs__list`,role:f?`tablist`:`navigation`,children:T})})})});$d.displayName=`PktTabs`;var ef={hours:`Timer`,minutes:`Minutter`,openPicker:`Åpne tidspunkt-velger`,prevTime:`Forrige tidspunkt`,nextTime:`Neste tidspunkt`,selectTime:`Velg tidspunkt`},tf=e=>e?Math.max(1,Math.round(e/60)):1,nf=(e,t)=>{let n=e?parseInt(String(e).split(`:`)[0],10):0,r=t?parseInt(String(t).split(`:`)[0],10):23;return Array.from({length:r-n+1},(e,t)=>t+n)},rf=e=>{let t=tf(e);return Array.from({length:Math.floor(60/t)},(e,n)=>n*t)},af=(e,t,n,r)=>{let i=e===``?n===1?0:23:parseInt(e,10),a=t===``?n===1?0:Math.floor(59/r)*r:parseInt(t,10);return a+=n*r,a>59?(a=0,i=(i+1)%24):a<0&&(a=Math.floor(59/r)*r,i=(i-1+24)%24),{hours:String(i).padStart(2,`0`),minutes:String(a).padStart(2,`0`)}},of=e=>/^\d{2}:\d{2}$/.test(e)&&parseInt(e.slice(0,2),10)<=23&&parseInt(e.slice(3),10)<=59,sf=e=>{let[t,n]=e.split(`:`).map(Number);return t*60+n},cf={required:`Dette feltet er påkrevd`,invalid:`Ugyldig verdi`,timeStepMismatch:`Må treffe på et steg, for eksempel 0, {step} minutter`,timeStepMismatchHour:`Må treffe på hver hele time`,timeStepMismatchHalfHour:`Må treffe på hver hele eller halve time`,rangeUnderflowMin:`Verdien må være større enn eller lik {min}.`,rangeOverflowMax:`Verdien må være mindre enn eller lik {max}.`};function lf(e){if(e&&of(e)){let[t,n]=e.split(`:`);return[t,n]}return[``,``]}function uf(e,t){return`${String(parseInt(e,10)).padStart(2,`0`)}:${String(parseInt(t,10)).padStart(2,`0`)}`}function df(e,t){let{required:n,min:r,max:i,step:a}=t;if(n&&!e)return{valid:!1,message:cf.required};if(!e)return{valid:!0};if(!of(e))return{valid:!1,message:cf.invalid};let o=sf(e),s=tf(a);return r&&o<sf(String(r))?{valid:!1,message:cf.rangeUnderflowMin.replace(`{min}`,String(r))}:i&&o>sf(String(i))?{valid:!1,message:cf.rangeOverflowMax.replace(`{max}`,String(i))}:a&&o%s!==0?{valid:!1,message:s===60?cf.timeStepMismatchHour:s===30?cf.timeStepMismatchHalfHour:cf.timeStepMismatch.replace(`{step}`,`${s}, ${s*2}, ${s*3}`)}:{valid:!0}}function ff(e){return e===3600||e<3600&&3600%e==0&&e%60==0}function pf(e,n){let{id:r,label:i,value:a,defaultValue:o,min:s,max:c,step:l=60,hidePicker:u=!1,stepArrows:d=!1,fullwidth:f=!1,name:p,disabled:m=!1,required:h=!1,helptext:g,helptextDropdown:_,helptextDropdownButton:v,hasError:y=!1,errorMessage:b,optionalTag:x=!1,optionalText:S,requiredTag:C=!1,requiredText:w,tagText:ee,inline:T=!1,useWrapper:E=!0,ariaDescribedby:te,strings:ne,className:re,onValueChange:D,onFocus:ie,onBlur:ae}=e,oe=(0,t.useMemo)(()=>ne??ef,[ne]),se=a!==void 0,ce=a===void 0?o??``:a??``,O=(0,t.useRef)(ce),[le,k]=(0,t.useState)(()=>ce),A=se?a??``:le,[ue,de]=(0,t.useState)(()=>lf(a===void 0?o:a)[0]),[j,M]=(0,t.useState)(()=>lf(a===void 0?o:a)[1]),N=(0,t.useRef)(ue),P=(0,t.useRef)(j),F=(0,t.useCallback)(e=>{N.current=e,de(e)},[]),I=(0,t.useCallback)(e=>{P.current=e,M(e)},[]),[fe,pe]=(0,t.useState)(!1),[me,L]=(0,t.useState)(!1),he=(0,t.useRef)(a);(0,t.useEffect)(()=>{if(!se||a===he.current)return;he.current=a;let[e,t]=lf(a);F(e),I(t)},[a,se,F,I]),(0,t.useEffect)(()=>{l!=null&&!ff(l)&&console.warn(`PktTimepicker: step="${l}" er ikke en gyldig verdi. Step må være et multiplum av 60 (hele minutter) eller nøyaktig 3600 (hel time).`)},[l]);let ge=(0,t.useRef)(null),R=(0,t.useRef)(null),z=(0,t.useRef)(null),B=(0,t.useRef)(null),_e=(0,t.useRef)(null),V=(0,t.useRef)(null),ve=(0,t.useRef)(0),ye=(0,t.useRef)(-1),H=(0,t.useRef)(0),be=(0,t.useRef)(-1),[xe,Se]=(0,t.useState)(!1),Ce=(0,t.useMemo)(()=>Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`)?.set,[]),we=(0,t.useMemo)(()=>tf(l),[l]),Te=(0,t.useMemo)(()=>nf(s,c),[s,c]),Ee=(0,t.useMemo)(()=>rf(l),[l]),De=`${r}-hours`,Oe=`${r}-minutes`,ke=`${r}-popup`,Ae=`${r}-input`;(0,t.useEffect)(()=>{let e=ge.current;if(!e)return;let t=df(A,{required:h,min:s,max:c,step:l});e.setCustomValidity(t.valid?``:t.message??``),L(xe&&!t.valid)},[A,h,s,c,l,xe]);let je=(0,t.useCallback)(e=>{se||k(e);let t=V.current;!t||!Ce||(Ce.call(t,e),t.dispatchEvent(new Event(`input`,{bubbles:!0})),D?.(e))},[se,Ce,D]),Me=(0,t.useCallback)(()=>{let e=N.current,t=P.current;if(e!==``&&t!==``){let n=uf(e,t);n!==A&&je(n)}else A!==``&&je(``)},[A,je]),Ne=(0,t.useCallback)(()=>{let e=N.current,t=P.current;if(e!==``&&t!==``){let n=uf(e,t);n===A?V.current?.dispatchEvent(new Event(`input`,{bubbles:!0})):je(n)}else A===``?V.current?.dispatchEvent(new Event(`input`,{bubbles:!0})):je(``)},[A,je]),Pe=(0,t.useCallback)(()=>{Se(!0),Me();let e=ge.current,t=V.current;if(!e)return;let n=df(t?.value??``,{required:h,min:s,max:c,step:l});e.setCustomValidity(n.valid?``:n.message??``)},[Me,h,s,c,l]);(0,t.useEffect)(()=>{let e=_e.current?.closest(`form`);if(!e)return;let t=t=>{let n=t;if(!n||!e.contains(n))return!1;let r=n.closest(`button, input[type="submit"], input[type="image"]`);return!r||!e.contains(r)?!1:r instanceof HTMLButtonElement?r.type!==`button`&&r.type!==`reset`:r instanceof HTMLInputElement},n=e=>{t(e.target)&&Pe()};return e.addEventListener(`pointerdown`,n,!0),()=>e.removeEventListener(`pointerdown`,n,!0)},[Pe]),(0,t.useEffect)(()=>{V.current&&(V.current.value=A)},[A]);let Fe=(0,t.useCallback)(()=>{pe(!1),Me()},[Me]);(0,t.useLayoutEffect)(()=>{if(!fe)return;let e=B.current;if(!e)return;e.querySelectorAll(`.pkt-timepicker-popup__col`).forEach(e=>{let t=e.querySelector(`.pkt-timepicker-popup__option--selected`);t&&t.scrollIntoView({block:`center`})});let t=e.querySelectorAll(`.pkt-timepicker-popup__col`)[0];if(!t)return;let n=t.querySelector(`.pkt-timepicker-popup__option--selected`),r=t.querySelector(`.pkt-timepicker-popup__option`);(n||r)?.focus()},[fe]),(0,t.useEffect)(()=>{if(!fe)return;let e=e=>{let t=e.target;_e.current&&!_e.current.contains(t)&&Fe()};return document.addEventListener(`click`,e,!0),()=>document.removeEventListener(`click`,e,!0)},[fe,Fe]);let Ie=(0,t.useCallback)(e=>{let t=B.current;if(!t)return;let n=t.querySelectorAll(`.pkt-timepicker-popup__col`),r=e===`hour`?n[0]:n[1];if(!r)return;let i=r.querySelector(`.pkt-timepicker-popup__option--selected`),a=r.querySelector(`.pkt-timepicker-popup__option`);(i||a)?.focus()},[]),Le=(0,t.useCallback)((e,t)=>{let n=String(e).padStart(2,`0`);if(t===`hour`)F(n),requestAnimationFrame(()=>Ie(`minute`));else{I(n),pe(!1);let e=N.current;e!==``&&je(`${e}:${n}`),requestAnimationFrame(()=>z.current?.focus())}},[je,Ie,F,I]),Re=(0,t.useCallback)(e=>{let t=af(N.current,P.current,e,we);F(t.hours),I(t.minutes),`${t.hours}:${t.minutes}`!==A&&je(`${t.hours}:${t.minutes}`)},[we,A,je,F,I]),ze=(0,t.useCallback)(e=>{ge.current?.setCustomValidity(``);let t=e.currentTarget,n=P.current;switch(e.key){case`ArrowUp`:{e.preventDefault();let t=N.current===``?0:parseInt(N.current,10),r=String((t+1)%24).padStart(2,`0`);if(F(r),n!==``){let e=`${r}:${n}`;e===A?V.current?.dispatchEvent(new Event(`input`,{bubbles:!0})):je(e)}break}case`ArrowDown`:{e.preventDefault();let t=N.current===``?0:parseInt(N.current,10),r=String((t-1+24)%24).padStart(2,`0`);if(F(r),n!==``){let e=`${r}:${n}`;e===A?V.current?.dispatchEvent(new Event(`input`,{bubbles:!0})):je(e)}break}case`ArrowRight`:e.preventDefault(),R.current?.focus();break;case`Backspace`:case`Delete`:{e.preventDefault(),ve.current=0,ye.current=-1;let t=N.current;t.length>0&&F(t.slice(0,-1)),Ne();break}case`Tab`:break;case`Enter`:{e.preventDefault(),Pe();let n=t.form;n?n.requestSubmit():t.blur();break}default:if(/^\d$/.test(e.key)){e.preventDefault();let t=parseInt(e.key,10);if(ve.current===0)ye.current=t,F(String(t).padStart(2,`0`)),ve.current=1,V.current?.dispatchEvent(new Event(`input`,{bubbles:!0})),t>=3&&(ye.current=-1,ve.current=0,Ne(),R.current?.focus());else{let e=ye.current*10+t;F(e<=23?String(e).padStart(2,`0`):String(t).padStart(2,`0`)),ye.current=-1,ve.current=0,Ne(),R.current?.focus()}}else e.preventDefault()}},[A,je,F,Ne,Pe]),Be=(0,t.useCallback)(()=>{Se(!0),N.current!==``&&F(String(parseInt(N.current,10)).padStart(2,`0`)),ve.current=0,ye.current=-1,Me()},[F,Me]),Ve=(0,t.useCallback)(e=>{ge.current?.setCustomValidity(``);let t=e.currentTarget,n=N.current;switch(e.key){case`ArrowUp`:{e.preventDefault();let t=P.current===``?0:parseInt(P.current,10),r=String((t+we)%60).padStart(2,`0`);if(I(r),n!==``){let e=`${n}:${r}`;e===A?V.current?.dispatchEvent(new Event(`input`,{bubbles:!0})):je(e)}break}case`ArrowDown`:{e.preventDefault();let t=P.current===``?0:parseInt(P.current,10),r=String((t-we+60)%60).padStart(2,`0`);if(I(r),n!==``){let e=`${n}:${r}`;e===A?V.current?.dispatchEvent(new Event(`input`,{bubbles:!0})):je(e)}break}case`ArrowLeft`:e.preventDefault(),ge.current?.focus();break;case`Backspace`:case`Delete`:{e.preventDefault(),H.current=0,be.current=-1;let t=P.current;t.length>0&&I(t.slice(0,-1)),Ne();break}case`Tab`:break;case`Enter`:{e.preventDefault(),Pe();let n=t.form;n?n.requestSubmit():t.blur();break}default:if(/^\d$/.test(e.key)){e.preventDefault();let t=parseInt(e.key,10);if(H.current===0)be.current=t,I(String(t).padStart(2,`0`)),H.current=1,V.current?.dispatchEvent(new Event(`input`,{bubbles:!0})),t>=6&&(be.current=-1,H.current=0,Ne());else{let e=be.current*10+t;I(e<=59?String(e).padStart(2,`0`):String(t).padStart(2,`0`)),be.current=-1,H.current=0,Ne()}}else e.preventDefault()}},[we,A,je,I,Ne,Pe]),He=(0,t.useCallback)(()=>{Se(!0),P.current!==``&&I(String(parseInt(P.current,10)).padStart(2,`0`)),H.current=0,be.current=-1,Me()},[I,Me]),Ue=(0,t.useCallback)(e=>{let t=document.activeElement,n=t.closest(`.pkt-timepicker-popup__col`);if(!n)return;let r=Array.from(n.querySelectorAll(`.pkt-timepicker-popup__option`)),i=r.indexOf(t),a=e=>{if(!e)return;let n=parseInt(e.dataset.value??`0`,10),r=String(n).padStart(2,`0`);t.dataset.type===`hour`?F(r):I(r),e.focus()};switch(e.key){case`ArrowDown`:e.preventDefault(),a(r[Math.min(i+1,r.length-1)]);break;case`ArrowUp`:e.preventDefault(),a(r[Math.max(i-1,0)]);break;case`Home`:e.preventDefault(),a(r[0]);break;case`End`:e.preventDefault(),a(r[r.length-1]);break;case`ArrowRight`:if(e.preventDefault(),t.dataset.type===`hour`){let e=parseInt(t.dataset.value??`0`,10);F(String(e).padStart(2,`0`)),requestAnimationFrame(()=>{B.current?.querySelectorAll(`.pkt-timepicker-popup__col`).forEach(e=>{e.querySelector(`.pkt-timepicker-popup__option--selected`)?.scrollIntoView({block:`center`})}),Ie(`minute`)})}break;case`ArrowLeft`:if(e.preventDefault(),t.dataset.type===`minute`){let e=parseInt(t.dataset.value??`0`,10);I(String(e).padStart(2,`0`)),requestAnimationFrame(()=>{B.current?.querySelectorAll(`.pkt-timepicker-popup__col`).forEach(e=>{e.querySelector(`.pkt-timepicker-popup__option--selected`)?.scrollIntoView({block:`center`})}),Ie(`hour`)})}break;case`Enter`:case` `:e.preventDefault(),t.click();break;case`Escape`:e.preventDefault(),Fe(),z.current?.focus();break;default:break}},[Fe,Ie,F,I]),We=(0,t.useCallback)(e=>{let t=B.current;if(!t)return;let n=e.relatedTarget;(!n||!t.contains(n))&&Fe()},[Fe]),U=(0,t.useCallback)(e=>{let t=_e.current;if(!t)return;let n=e.relatedTarget;n&&t.contains(n)||ie?.(e)},[ie]),W=(0,t.useCallback)(e=>{let t=_e.current;if(!t)return;let n=e.relatedTarget;n&&t.contains(n)||ae?.(e)},[ae]),Ge=(0,t.useCallback)(()=>{m||(fe?Fe():pe(!0))},[m,fe,Fe]);return(0,t.useImperativeHandle)(n,()=>({get value(){return V.current?.value??``},set value(e){let t=e??``;se||k(t);let[n,r]=lf(t);F(n),I(r),V.current&&(V.current.value=t)},focus(){ge.current?.focus()},blur(){ge.current?.blur()}}),[se,F,I]),(0,t.useEffect)(()=>{let e=_e.current?.closest(`form`);if(!e)return;let t=()=>{window.setTimeout(()=>{let e=O.current,[t,n]=lf(e);F(t),I(n),se||k(e),V.current&&(V.current.value=e),pe(!1),Se(!1)},0)};return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)},[se,F,I]),{id:r,containerRef:_e,outerClasses:[`pkt-timepicker`,f?`pkt-timepicker--fullwidth`:``,d?`pkt-timepicker--stepper`:``,re??``].filter(Boolean).join(` `),strings:oe,label:i,disabled:m,required:h,helptext:g,helptextDropdown:_,helptextDropdownButton:v,hasError:y,isInvalid:me,errorMessage:b,optionalTag:x,optionalText:S,requiredTag:C,requiredText:w,tagText:ee,inline:T,useWrapper:E,ariaDescribedby:te,hidePicker:u,stepArrows:d,min:s,max:c,step:l,hours:ue,minutes:j,hoursId:De,minutesId:Oe,popupId:ke,hiddenInputId:Ae,name:p??r,isOpen:fe,hourOptions:Te,minuteOptions:Ee,hoursInputRef:ge,minutesInputRef:R,buttonRef:z,popupRef:B,changeInputRef:V,handleHoursKeydown:ze,handleHoursBlur:Be,handleMinutesKeydown:Ve,handleMinutesBlur:He,handlePopupKeydown:Ue,handlePopupFocusOut:We,handleFocusIn:U,handleFocusOut:W,handleOptionClick:Le,handleClockButtonClick:Ge,closePopup:Fe,stepTimeDelta:Re,effectiveValue:A}}var mf=(0,t.forwardRef)((e,t)=>{let{onChange:r,onInput:i}=e,a=pf(e,t),o=a.strings.hours,s=a.strings.minutes,c=a.label?`${o}, ${a.label}`:o,l=a.label?`${s}, ${a.label}`:s,u=(e,t)=>{let r=String(e).padStart(2,`0`),i=e===(t===`hour`?a.hours===``?NaN:parseInt(a.hours,10):a.minutes===``?NaN:parseInt(a.minutes,10));return(0,n.jsx)(`button`,{type:`button`,className:[`pkt-btn`,`pkt-btn--tertiary`,`pkt-btn--small`,`pkt-btn--label-only`,`pkt-timepicker-popup__option`,i?`pkt-timepicker-popup__option--selected`:``].filter(Boolean).join(` `),role:`option`,"aria-selected":i?`true`:`false`,tabIndex:i?0:-1,"data-type":t,"data-value":e,onClick:n=>{n.stopPropagation(),a.handleOptionClick(e,t)},children:(0,n.jsx)(`span`,{className:`pkt-btn__text pkt-txt-14-light`,children:r})},`${t}-${e}`)},d=()=>(0,n.jsxs)(`div`,{ref:a.popupRef,className:`pkt-timepicker-popup`,id:a.popupId,hidden:!a.isOpen,role:`group`,"aria-label":a.strings.selectTime,onKeyDown:a.handlePopupKeydown,onBlur:a.handlePopupFocusOut,children:[(0,n.jsx)(`div`,{className:`pkt-timepicker-popup__col`,role:`listbox`,"aria-label":o,"aria-orientation":`vertical`,children:a.hourOptions.map(e=>u(e,`hour`))}),(0,n.jsx)(`div`,{className:`pkt-timepicker-popup__col`,role:`listbox`,"aria-label":s,"aria-orientation":`vertical`,children:a.minuteOptions.map(e=>u(e,`minute`))})]}),f=()=>(0,n.jsxs)(`div`,{className:`pkt-input__container`,onClick:e=>{e.target.closest(`button, input`)||a.hoursInputRef.current?.focus()},children:[a.stepArrows&&(0,n.jsxs)(`button`,{type:`button`,className:`pkt-input-icon pkt-btn pkt-btn--icon-only pkt-btn--tertiary pkt-timepicker__button pkt-timepicker__button--prev`,"aria-label":a.strings.prevTime,disabled:a.disabled,onClick:()=>a.stepTimeDelta(-1),children:[(0,n.jsx)(Q,{name:`chevron-thin-left`}),(0,n.jsx)(`span`,{className:`pkt-btn__text`,children:a.strings.prevTime})]}),(0,n.jsx)(`input`,{ref:a.hoursInputRef,type:`text`,inputMode:`numeric`,maxLength:2,size:2,className:`pkt-input pkt-timepicker__input`,id:a.hoursId,"data-min":`0`,"data-max":`23`,value:a.hours,placeholder:`––`,"aria-label":c,role:`spinbutton`,"aria-invalid":a.hasError||a.isInvalid||void 0,"aria-valuemin":0,"aria-valuemax":23,"aria-valuenow":a.hours===``?void 0:parseInt(a.hours,10),"aria-valuetext":a.hours===``?void 0:`${a.hours} ${o.toLowerCase()}`,autoComplete:`off`,disabled:a.disabled,onKeyDown:a.handleHoursKeydown,onBlur:a.handleHoursBlur,onFocus:e=>{e.currentTarget.select()},onChange:()=>{},onPaste:e=>e.preventDefault()}),(0,n.jsx)(`span`,{className:`pkt-timepicker__separator`,children:`:`}),(0,n.jsx)(`input`,{ref:a.minutesInputRef,type:`text`,inputMode:`numeric`,maxLength:2,size:2,className:`pkt-input pkt-timepicker__input`,id:a.minutesId,"data-min":`0`,"data-max":`59`,value:a.minutes,placeholder:`––`,"aria-label":l,role:`spinbutton`,"aria-invalid":a.hasError||a.isInvalid||void 0,"aria-valuemin":0,"aria-valuemax":59,"aria-valuenow":a.minutes===``?void 0:parseInt(a.minutes,10),"aria-valuetext":a.minutes===``?void 0:`${a.minutes} ${s.toLowerCase()}`,autoComplete:`off`,disabled:a.disabled,onKeyDown:a.handleMinutesKeydown,onBlur:a.handleMinutesBlur,onFocus:e=>{e.currentTarget.select()},onChange:()=>{},onPaste:e=>e.preventDefault()}),a.hidePicker&&!a.stepArrows&&(0,n.jsx)(Q,{className:`pkt-input-icon pkt-timepicker__icon`,name:`clock`,"aria-hidden":!0}),!a.hidePicker&&!a.stepArrows&&(0,n.jsxs)(`button`,{ref:a.buttonRef,type:`button`,className:`pkt-input-icon pkt-btn pkt-btn--icon-only pkt-btn--tertiary pkt-timepicker__button`,"aria-label":a.strings.openPicker,"aria-haspopup":`listbox`,"aria-expanded":a.isOpen,"aria-controls":a.popupId,disabled:a.disabled,onClick:a.handleClockButtonClick,children:[(0,n.jsx)(Q,{name:`clock`}),(0,n.jsx)(`span`,{className:`pkt-btn__text`,children:a.strings.openPicker})]}),a.stepArrows&&(0,n.jsxs)(`button`,{type:`button`,className:`pkt-input-icon pkt-btn pkt-btn--icon-only pkt-btn--tertiary pkt-timepicker__button pkt-timepicker__button--next`,"aria-label":a.strings.nextTime,disabled:a.disabled,onClick:()=>a.stepTimeDelta(1),children:[(0,n.jsx)(Q,{name:`chevron-thin-right`}),(0,n.jsx)(`span`,{className:`pkt-btn__text`,children:a.strings.nextTime})]}),(0,n.jsx)(`input`,{ref:a.changeInputRef,type:`time`,hidden:!0,name:a.name,id:a.hiddenInputId,disabled:a.disabled,tabIndex:-1,"aria-hidden":!0,onChange:r,onInput:i})]});return(0,n.jsx)(`div`,{ref:a.containerRef,className:a.outerClasses,id:a.id||void 0,onFocus:a.handleFocusIn,onBlur:a.handleFocusOut,children:(0,n.jsx)(yl,{forId:a.hoursId,label:a.label,disabled:a.disabled,hasError:a.hasError,inline:a.inline,optionalTag:a.optionalTag,optionalText:a.optionalText,requiredTag:a.requiredTag,requiredText:a.requiredText,useWrapper:a.useWrapper,ariaDescribedby:a.ariaDescribedby,errorMessage:a.errorMessage,helptext:a.helptext,helptextDropdown:a.helptextDropdown,helptextDropdownButton:a.helptextDropdownButton,tagText:a.tagText,children:!a.hidePicker&&!a.stepArrows?(0,n.jsxs)(`div`,{className:`pkt-timepicker__anchor`,children:[f(),d()]}):f()})})});mf.displayName=`PktTimepicker`,e.FileItem=hu,e.ItemRenderers=ud,e.PktAccordion=_,e.PktAccordionItem=Xo,e.PktAlert=Zo,e.PktBackLink=Qo,e.PktBreadcrumbs=$o,e.PktButton=es,e.PktCalendar=hl,e.PktCard=_l,e.PktCheckbox=vl,e.PktCombobox=Wl,e.PktConsent=Gl,e.PktDatepicker=cu,e.PktFileUpload=dd,e.PktFooter=fd,e.PktFooterSimple=pd,e.PktHeader=Cd,e.PktHeaderService=Sd,e.PktHeading=Td,e.PktHelptext=Dd,e.PktIcon=Q,e.PktInput=Od,e.PktInputWrapper=yl,e.PktLink=gd,e.PktLinkCard=kd,e.PktLoader=jd,e.PktMessagebox=Md,e.PktModal=Iu,e.PktProgressbar=Fd,e.PktRadioButton=Id,e.PktSearchInput=Ld,e.PktSelect=Rd,e.PktStep=Hd,e.PktStepper=Ud,e.PktTabItem=Xd,e.PktTable=Wd,e.PktTableBody=Gd,e.PktTableDataCell=Kd,e.PktTableHeader=qd,e.PktTableHeaderCell=Jd,e.PktTableRow=Yd,e.PktTabs=$d,e.PktTag=gl,e.PktTextarea=bu,e.PktTextinput=xd,e.PktTimepicker=mf});