@oslokommune/punkt-react 16.16.2 → 16.17.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,7 +34,7 @@
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.16/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.16/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]===`.`?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.17/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.17/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`
38
38
  <button
39
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})}
40
40
  type=${this.type}
@@ -101,9 +101,9 @@
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
+ `}};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(){let e={"pkt-accordion-item":!0,"pkt-accordion-item--compact":this.compact,[`pkt-accordion-item--${this.skin}`]:!!this.skin},t=this.skin===`plus-minus`;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=${q(e)}
107
107
  id=${this.id}
108
108
  ?open=${this.isOpen}
109
109
  ${X(this.accordionItemRef)}
@@ -111,11 +111,24 @@
111
111
  >
112
112
  <summary class="pkt-accordion-item__title" id=${`pkt-accordion-item-summary-${this.id}`}>
113
113
  ${this.title}
114
- <pkt-icon
115
- name="chevron-thin-down"
116
- class="pkt-accordion-item__icon"
117
- aria-hidden="true"
118
- ></pkt-icon>
114
+ ${t?j`
115
+ <pkt-icon
116
+ name="plus-sign"
117
+ class="pkt-accordion-item__icon pkt-accordion-item__icon--plus"
118
+ aria-hidden="true"
119
+ ></pkt-icon>
120
+ <pkt-icon
121
+ name="minus-sign"
122
+ class="pkt-accordion-item__icon pkt-accordion-item__icon--minus"
123
+ aria-hidden="true"
124
+ ></pkt-icon>
125
+ `:j`
126
+ <pkt-icon
127
+ name="chevron-thin-down"
128
+ class="pkt-accordion-item__icon"
129
+ aria-hidden="true"
130
+ ></pkt-icon>
131
+ `}
119
132
  </summary>
120
133
  <div
121
134
  class="pkt-accordion-item__content"
@@ -853,7 +866,7 @@
853
866
  `:N}
854
867
  </ul>
855
868
  </nav>
856
- `}};K([W({type:Object})],fa.prototype,`user`,void 0),K([W({type:String,attribute:`formatted-last-logged-in`})],fa.prototype,`formattedLastLoggedIn`,void 0),K([W({type:Object})],fa.prototype,`representing`,void 0),K([W({type:Array,attribute:`user-menu`})],fa.prototype,`userMenu`,void 0),K([W({type:Boolean,attribute:`can-change-representation`,converter:zi})],fa.prototype,`canChangeRepresentation`,void 0),K([W({type:Boolean,attribute:`logout-on-click`,converter:zi})],fa.prototype,`logoutOnClick`,void 0);try{U(`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.16/logos/`,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,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 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`
869
+ `}};K([W({type:Object})],fa.prototype,`user`,void 0),K([W({type:String,attribute:`formatted-last-logged-in`})],fa.prototype,`formattedLastLoggedIn`,void 0),K([W({type:Object})],fa.prototype,`representing`,void 0),K([W({type:Array,attribute:`user-menu`})],fa.prototype,`userMenu`,void 0),K([W({type:Boolean,attribute:`can-change-representation`,converter:zi})],fa.prototype,`canChangeRepresentation`,void 0),K([W({type:Boolean,attribute:`logout-on-click`,converter:zi})],fa.prototype,`logoutOnClick`,void 0);try{U(`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.17/logos/`,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,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 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`
857
870
  <pkt-icon name="oslologo" aria-hidden="true" path=${pa}></pkt-icon>
858
871
  `;return this.logoLink&&typeof this.logoLink==`string`?j`
859
872
  <span class="pkt-header-service__logo">
@@ -1046,7 +1059,7 @@
1046
1059
  `}render(){let e=this.renderHeader();return this.isFixed?j`
1047
1060
  <div class="pkt-header-service-wrapper">
1048
1061
  ${e}
1049
- <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>
1062
+ <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,"pkt-header-service-spacer--tablet":this.isTablet})}></div>
1050
1063
  </div>
1051
1064
  `:e}};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([G()],ma.prototype,`isMobile`,void 0),K([G()],ma.prototype,`isTablet`,void 0),K([G()],ma.prototype,`openMenu`,void 0),K([G()],ma.prototype,`isHidden`,void 0),K([G()],ma.prototype,`componentWidth`,void 0),K([G()],ma.prototype,`alignSlotRight`,void 0),K([G()],ma.prototype,`alignSearchRight`,void 0);try{U(`pkt-header-service`)(ma)}catch{console.warn(`Forsøker å definere <pkt-header-service>, men den er allerede definert`)}var ha=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`
1052
1065
  <pkt-header-service
@@ -1074,7 +1087,132 @@
1074
1087
  >
1075
1088
  ${this.hasSlotContent()?j`<div class="pkt-contents">${Et(this)}</div>`:N}
1076
1089
  </pkt-header-service>
1077
- `}};K([W({type:String,attribute:`service-name`})],ha.prototype,`serviceName`,void 0),K([W({type:String,attribute:`service-link`})],ha.prototype,`serviceLink`,void 0),K([W({type:String,attribute:`logo-link`})],ha.prototype,`logoLink`,void 0),K([W({type:String,attribute:`search-placeholder`})],ha.prototype,`searchPlaceholder`,void 0),K([W({type:String,attribute:`search-value`})],ha.prototype,`searchValue`,void 0),K([W({type:Number,attribute:`mobile-breakpoint`})],ha.prototype,`mobileBreakpoint`,void 0),K([W({type:Number,attribute:`tablet-breakpoint`})],ha.prototype,`tabletBreakpoint`,void 0),K([W({type:String,attribute:`opened-menu`})],ha.prototype,`openedMenu`,void 0),K([W({type:String,attribute:`log-out-button-placement`})],ha.prototype,`logOutButtonPlacement`,void 0),K([W({type:String})],ha.prototype,`position`,void 0),K([W({type:String,attribute:`scroll-behavior`})],ha.prototype,`scrollBehavior`,void 0),K([W({type:String,attribute:`slot-menu-variant`})],ha.prototype,`slotMenuVariant`,void 0),K([W({type:String,attribute:`slot-menu-text`})],ha.prototype,`slotMenuText`,void 0),K([W({type:Boolean,attribute:`hide-logo`,converter:zi})],ha.prototype,`hideLogo`,void 0),K([W({type:Boolean,converter:zi})],ha.prototype,`compact`,void 0),K([W({type:Boolean,attribute:`show-search`,converter:zi})],ha.prototype,`showSearch`,void 0),K([W({type:Boolean,attribute:`can-change-representation`,converter:zi})],ha.prototype,`canChangeRepresentation`,void 0),K([W({type:Boolean,attribute:`has-log-out`,converter:zi})],ha.prototype,`hasLogOut`,void 0),K([W({type:Object})],ha.prototype,`user`,void 0),K([W({type:Array,attribute:`user-menu`})],ha.prototype,`userMenu`,void 0),K([W({type:Object})],ha.prototype,`representing`,void 0),K([W({type:Array,attribute:`user-menu-footer`})],ha.prototype,`userMenuFooter`,void 0),K([W({type:Array,attribute:`user-options`})],ha.prototype,`userOptions`,void 0);try{U(`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 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`
1090
+ `}};K([W({type:String,attribute:`service-name`})],ha.prototype,`serviceName`,void 0),K([W({type:String,attribute:`service-link`})],ha.prototype,`serviceLink`,void 0),K([W({type:String,attribute:`logo-link`})],ha.prototype,`logoLink`,void 0),K([W({type:String,attribute:`search-placeholder`})],ha.prototype,`searchPlaceholder`,void 0),K([W({type:String,attribute:`search-value`})],ha.prototype,`searchValue`,void 0),K([W({type:Number,attribute:`mobile-breakpoint`})],ha.prototype,`mobileBreakpoint`,void 0),K([W({type:Number,attribute:`tablet-breakpoint`})],ha.prototype,`tabletBreakpoint`,void 0),K([W({type:String,attribute:`opened-menu`})],ha.prototype,`openedMenu`,void 0),K([W({type:String,attribute:`log-out-button-placement`})],ha.prototype,`logOutButtonPlacement`,void 0),K([W({type:String})],ha.prototype,`position`,void 0),K([W({type:String,attribute:`scroll-behavior`})],ha.prototype,`scrollBehavior`,void 0),K([W({type:String,attribute:`slot-menu-variant`})],ha.prototype,`slotMenuVariant`,void 0),K([W({type:String,attribute:`slot-menu-text`})],ha.prototype,`slotMenuText`,void 0),K([W({type:Boolean,attribute:`hide-logo`,converter:zi})],ha.prototype,`hideLogo`,void 0),K([W({type:Boolean,converter:zi})],ha.prototype,`compact`,void 0),K([W({type:Boolean,attribute:`show-search`,converter:zi})],ha.prototype,`showSearch`,void 0),K([W({type:Boolean,attribute:`can-change-representation`,converter:zi})],ha.prototype,`canChangeRepresentation`,void 0),K([W({type:Boolean,attribute:`has-log-out`,converter:zi})],ha.prototype,`hasLogOut`,void 0),K([W({type:Object})],ha.prototype,`user`,void 0),K([W({type:Array,attribute:`user-menu`})],ha.prototype,`userMenu`,void 0),K([W({type:Object})],ha.prototype,`representing`,void 0),K([W({type:Array,attribute:`user-menu-footer`})],ha.prototype,`userMenuFooter`,void 0),K([W({type:Array,attribute:`user-options`})],ha.prototype,`userOptions`,void 0);try{U(`pkt-header`)(ha)}catch{console.warn(`Forsøker å definere <pkt-header>, men den er allerede definert`)}var ga=`https://cdn.web.oslo.kommune.no/header-footer/header-footer.json`,_a={automat:`parking-meter`,bike:`bicycle`,corona:`virus`,directions:`arrow-directions`,document:`document-plain`,"download-document":`document-download`,elcar:`electric-car`,"error-hexa":`alert-error`,"fire-emblem":`shield-fire`,"link-arrow":`arrow-link`,"linked-in":`linkedin`,"map-layer":`map-layers`,mobile:`mobile-phone`,neutral:`smiley-neutral`,placeholder:`placeholder-icon`,sad:`smiley-sad`,signing:`signature`,sky:`cloud`,smile:`smiley-smile`,"success-square":`alert-success`,trash:`trash-can`,treatment:`processing`,"warning-triangle":`alert-warning`};function va(e){return e&&(_a[e]??e)}var ya={"facebook.com":`facebook`,"fb.com":`facebook`,"instagram.com":`instagram`,"linkedin.com":`linkedin`,"x.com":`x`,"github.com":`github`};function ba(e){return e.toLowerCase().replace(/^(?:www|m)\./,``)}function xa(e,t){if(e)try{let t=ya[ba(new URL(e).hostname)];if(t)return t}catch{}if(t){let e=t.trim().toLowerCase().replace(/\s+/g,`-`);if(e){let t=va(e);if(t)return t}}}var Sa=`nb-NO`;function Ca(e,t=Sa){if(e)return e[t]??e[Sa]}async function wa(e=ga,t){let n=await fetch(e,{signal:t});if(!n.ok)throw Error(`pkt-header-menu: failed to fetch ${e} (HTTP ${n.status})`);let r=await n.json();if(!r||typeof r!=`object`)throw Error(`pkt-header-menu: ${e} returned a non-object payload`);return r}var Ta=class extends Ye{constructor(...e){super(...e),this.dataUrl=ga,this.locale=`nb-NO`,this.open=!1,this.ariaLabelledBy=``,this.mobileBreakpoint=768,this.loadState=`idle`,this.isMobile=!1,this.handleMediaChange=e=>{this.isMobile=e.matches}}connectedCallback(){super.connectedCallback(),this.classList.add(`pkt-header-menu`),this.updateOpenClass(),this.setupMediaQuery(),this.data?(this.loadState=`ready`,this.dispatchEvent(new CustomEvent(`data-loaded`,{detail:{data:this.data},bubbles:!0,composed:!0}))):this.loadData()}updateOpenClass(){this.classList.toggle(`pkt-header-menu--open`,!!this.open)}disconnectedCallback(){super.disconnectedCallback(),this.abortController?.abort(),this.teardownMediaQuery()}updated(e){super.updated(e),e.has(`open`)&&this.updateOpenClass(),e.has(`mobileBreakpoint`)&&e.get(`mobileBreakpoint`)!==void 0&&this.setupMediaQuery(),e.has(`dataUrl`)&&e.get(`dataUrl`)!==void 0&&!this.data&&this.loadData(),e.has(`data`)&&e.get(`data`)!==void 0&&this.data&&(this.loadState=`ready`,this.dispatchEvent(new CustomEvent(`data-loaded`,{detail:{data:this.data},bubbles:!0,composed:!0})))}setupMediaQuery(){this.teardownMediaQuery(),!(typeof window>`u`||typeof window.matchMedia!=`function`)&&(this.mediaQuery=window.matchMedia(`(max-width: ${this.mobileBreakpoint-1}px)`),this.isMobile=this.mediaQuery.matches,this.mediaQuery.addEventListener(`change`,this.handleMediaChange))}teardownMediaQuery(){this.mediaQuery?.removeEventListener(`change`,this.handleMediaChange),this.mediaQuery=void 0}async loadData(){this.abortController?.abort(),this.abortController=new AbortController,this.loadState=`loading`;try{let e=await wa(this.dataUrl,this.abortController.signal);this.fetchedData=e,this.loadState=`ready`,this.dispatchEvent(new CustomEvent(`data-loaded`,{detail:{data:e},bubbles:!0,composed:!0}))}catch(e){if(e.name===`AbortError`)return;this.loadState=`error`,this.dispatchEvent(new CustomEvent(`data-error`,{detail:{error:e},bubbles:!0,composed:!0}))}}get effectiveData(){return this.data??this.fetchedData}get localeData(){return Ca(this.effectiveData,this.locale)}render(){if(this.loadState===`loading`)return j`
1091
+ <nav aria-busy="true">
1092
+ <p class="pkt-header-menu__loading">Laster meny…</p>
1093
+ </nav>
1094
+ `;if(this.loadState===`error`||!this.localeData)return j`
1095
+ <nav aria-hidden=${!this.open}>
1096
+ <p class="pkt-header-menu__error">Kunne ikke laste meny.</p>
1097
+ </nav>
1098
+ `;let{megamenu:e,i18n:t}=this.localeData,n=t?.navAriaLabel||`Hovedmeny`;return this.isMobile?j`
1099
+ <nav aria-label=${n}>
1100
+ ${this.renderMobileAccordion(e.services,e.sections)}
1101
+ ${this.renderButtons(e.buttons,!0)}
1102
+ ${this.renderFooter(e.links,e.some)}
1103
+ </nav>
1104
+ `:j`
1105
+ <nav aria-label=${n}>
1106
+ ${this.renderServices(e.services)} ${this.renderButtons(e.buttons,!1)}
1107
+ ${this.renderSections(e.sections)}
1108
+ ${this.renderFooter(e.links,e.some)}
1109
+ </nav>
1110
+ `}renderMobileAccordion(e,t){return j`
1111
+ <div class="pkt-header-menu__sections">
1112
+ <pkt-accordion
1113
+ class="pkt-header-menu__sections-inner"
1114
+ skin="plus-minus"
1115
+ name="header-menu-accordion"
1116
+ >
1117
+ <pkt-accordion-item
1118
+ class="pkt-header-menu__section"
1119
+ skin="plus-minus"
1120
+ id="pkt-header-menu-services"
1121
+ title=${e.title}
1122
+ >
1123
+ ${this.renderServicesList(e)}
1124
+ </pkt-accordion-item>
1125
+ ${t.map((e,t)=>j`
1126
+ <pkt-accordion-item
1127
+ class="pkt-header-menu__section"
1128
+ skin="plus-minus"
1129
+ id=${`pkt-header-menu-section-${t}`}
1130
+ title=${e.title}
1131
+ >
1132
+ ${this.renderSectionList(e.links)}
1133
+ </pkt-accordion-item>
1134
+ `)}
1135
+ </pkt-accordion>
1136
+ </div>
1137
+ `}renderServicesList(e){return j`
1138
+ <ul class="pkt-header-menu__services-list">
1139
+ ${e.links.map(e=>j`
1140
+ <li class="pkt-header-menu__service">
1141
+ <a class="pkt-header-menu__service-link" href=${e.url}>
1142
+ <pkt-icon
1143
+ class="pkt-header-menu__service-icon"
1144
+ name=${va(e.icon)}
1145
+ aria-hidden="true"
1146
+ ></pkt-icon>
1147
+ <span class="pkt-header-menu__service-text">${e.text}</span>
1148
+ </a>
1149
+ </li>
1150
+ `)}
1151
+ </ul>
1152
+ `}renderServices(e){return j`
1153
+ <div class="pkt-header-menu__services">
1154
+ <h2 class="pkt-header-menu__services-title">${e.title}</h2>
1155
+ ${this.renderServicesList(e)}
1156
+ </div>
1157
+ `}renderButtons(e,t){return!e||e.length===0?N:j`
1158
+ <div class=${q({"pkt-header-menu__buttons":!0,"pkt-header-menu__buttons--mobile":t})}>
1159
+ ${e.map(e=>j`
1160
+ <a
1161
+ class="pkt-btn pkt-btn--secondary pkt-btn--icon-right pkt-btn--small"
1162
+ href=${e.url}
1163
+ >
1164
+ <pkt-icon
1165
+ class="pkt-btn__icon"
1166
+ name=${e.iconName?va(e.iconName):`user`}
1167
+ aria-hidden="true"
1168
+ ></pkt-icon>
1169
+ <span class="pkt-btn__text">${e.text}</span>
1170
+ </a>
1171
+ `)}
1172
+ </div>
1173
+ `}renderSections(e){return!e||e.length===0?N:j`
1174
+ <div class="pkt-header-menu__sections">
1175
+ <div class="pkt-header-menu__sections-inner">
1176
+ ${e.map(e=>j`
1177
+ <div class="pkt-header-menu__section">
1178
+ <h2 class="pkt-header-menu__section-title">${e.title}</h2>
1179
+ ${this.renderSectionList(e.links)}
1180
+ </div>
1181
+ `)}
1182
+ </div>
1183
+ </div>
1184
+ `}renderSectionList(e){return j`
1185
+ <ul class="pkt-header-menu__section-list">
1186
+ ${e.map(e=>j`
1187
+ <li>
1188
+ <a class="pkt-header-menu__section-link" href=${e.url}>${e.text}</a>
1189
+ </li>
1190
+ `)}
1191
+ </ul>
1192
+ `}renderFooter(e,t){return(!e||e.length===0)&&(!t||t.length===0)?N:j`
1193
+ <div class="pkt-header-menu__footer">
1194
+ ${e&&e.length>0?j`
1195
+ <ul class="pkt-header-menu__footer-list">
1196
+ ${e.map(e=>j`
1197
+ <li>
1198
+ <a class="pkt-header-menu__footer-link" href=${e.url}>${e.text}</a>
1199
+ </li>
1200
+ `)}
1201
+ </ul>
1202
+ `:N}
1203
+ ${t&&t.length>0?j`
1204
+ <ul class="pkt-header-menu__footer-list pkt-header-menu__footer-list--social">
1205
+ ${t.map(e=>this.renderSocialLink(e))}
1206
+ </ul>
1207
+ `:N}
1208
+ </div>
1209
+ `}renderSocialLink(e){let t=xa(e.url,e.text);return j`
1210
+ <li>
1211
+ <a class="pkt-header-menu__social-link" href=${e.url} aria-label=${e.text}>
1212
+ ${t?j`<pkt-icon name=${t} aria-hidden="true"></pkt-icon>`:j`<span>${e.text}</span>`}
1213
+ </a>
1214
+ </li>
1215
+ `}};K([W({type:String,attribute:`data-url`})],Ta.prototype,`dataUrl`,void 0),K([W({type:Object,attribute:!1})],Ta.prototype,`data`,void 0),K([W({type:String})],Ta.prototype,`locale`,void 0),K([W({type:Boolean,reflect:!0,converter:zi})],Ta.prototype,`open`,void 0),K([W({type:String,attribute:`aria-labelledby`,reflect:!0})],Ta.prototype,`ariaLabelledBy`,void 0),K([W({type:Number,attribute:`mobile-breakpoint`})],Ta.prototype,`mobileBreakpoint`,void 0),K([G()],Ta.prototype,`loadState`,void 0),K([G()],Ta.prototype,`fetchedData`,void 0),K([G()],Ta.prototype,`isMobile`,void 0);try{U(`pkt-header-menu`)(Ta)}catch{console.warn(`Forsøker å definere <pkt-header-menu>, men den er allerede definert`)}var Ea={calendar:{buttonAltText:`Åpne kalender`}},Da={calendar:{buttonAltText:`Åpne kalender`},generic:{from:`Fra`,to:`Til`}},Oa=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`
1078
1216
  <div class=${q(this.classes)} aria-live="polite">
1079
1217
  ${Array.isArray(this.dates)&&this.dates[0]?_i(Ir((this.dates??[]).filter(Boolean)),e=>e,e=>j` <pkt-tag
1080
1218
  id=${this.idBase+e+`-tag`}
@@ -1085,7 +1223,7 @@
1085
1223
  <time datetime=${e}>${wr(e,this.dateformat)}</time>
1086
1224
  </pkt-tag>`):N}
1087
1225
  </div>
1088
- `}};K([W({type:Array})],va.prototype,`dates`,void 0),K([W({type:String})],va.prototype,`dateformat`,void 0),K([W({type:String,attribute:`class`})],va.prototype,`className`,void 0),K([W({type:String,attribute:`id-base`})],va.prototype,`idBase`,void 0);try{U(`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:Lr(e[0],e[1]),Ca=e=>Ir(e),wa=(e,t,n,r,i)=>Fr(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?Tr(n):null,o=r?Tr(r):null,s=Tr(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=Cr(a.value);e&&n?.value?.handleDateSelect(e)}else t[0]&&r()}},Ra={handleInputKeydown:Aa,handleButtonKeydown:ja},za=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 Fa.addToSelected==`function`)return Fa.addToSelected(e,this.calendarRef,t,n);let r=e.target;if(!r.value)return;let i=t?Tr(t):null,a=n?Tr(n):null,o=Tr(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=Sr(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`
1226
+ `}};K([W({type:Array})],Oa.prototype,`dates`,void 0),K([W({type:String})],Oa.prototype,`dateformat`,void 0),K([W({type:String,attribute:`class`})],Oa.prototype,`className`,void 0),K([W({type:String,attribute:`id-base`})],Oa.prototype,`idBase`,void 0);try{U(`pkt-date-tags`)(Oa)}catch{console.warn(`Forsøker å definere <pkt-date-tags>, men den er allerede definert`)}var ka={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.`}}},Aa=()=>{let e=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(e)||/Macintosh/.test(e)&&`ontouchend`in document)},ja=()=>Aa()?`text`:`date`,Ma=e=>!e||e.length!==2?!0:Lr(e[0],e[1]),Na=e=>Ir(e),Pa=(e,t,n,r,i)=>Fr(e,t,n,r,i),Fa=(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`}),Ia=()=>({"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}),La=e=>({"pkt-input-prefix":e,"pkt-hide":!e}),Ra=(e,t,n)=>!t&&!n?Array.isArray(e)?e[0]||``:e:Array.isArray(e)?e.join(`,`):e,za=(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},Ba=(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())},Va=(e,t)=>{let{key:n}=e;(n===`Enter`||n===` `||n===`Space`)&&(e.preventDefault(),t(e))},Ha={validateRangeOrder:Ma,sortDates:Na,filterSelectableDates:Pa},Ua={getInputType:ja},Wa={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))}},Ga={addToSelected(e,t,n,r){let i=e.target;if(!i.value)return;let a=n?Tr(n):null,o=r?Tr(r):null,s=Tr(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){za(e.value??null,t.value??null,n)}},Ka={getInputClasses:Fa,getButtonClasses:Ia,getRangeLabelClasses:La},qa={processDateSelection:Ra,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=Cr(a.value);e&&n?.value?.handleDateSelect(e)}else t[0]&&r()}},Ja={handleInputKeydown:Ba,handleButtonKeydown:Va},Ya=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 Ga.addToSelected==`function`)return Ga.addToSelected(e,this.calendarRef,t,n);let r=e.target;if(!r.value)return;let i=t?Tr(t):null,a=n?Tr(n):null,o=Tr(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=Sr(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`
1089
1227
  <div
1090
1228
  class="${q({"pkt-calendar-popup":!0,show:this.open,hide:!this.open})}"
1091
1229
  ${X(this.popupRef)}
@@ -1111,9 +1249,9 @@
1111
1249
  @close=${()=>{this.hide(),this.dispatchEvent(new CustomEvent(`close`,{bubbles:!0,composed:!0}))}}
1112
1250
  ></pkt-calendar>`:N}
1113
1251
  </div>
1114
- `}};K([W({type:Boolean,reflect:!0})],za.prototype,`open`,void 0),K([W({type:Boolean})],za.prototype,`multiple`,void 0),K([W({type:Boolean})],za.prototype,`range`,void 0),K([W({type:Boolean})],za.prototype,`weeknumbers`,void 0),K([W({type:Boolean})],za.prototype,`withcontrols`,void 0),K([W({type:Number})],za.prototype,`maxMultiple`,void 0),K([W({type:Array})],za.prototype,`selected`,void 0),K([W({type:String})],za.prototype,`earliest`,void 0),K([W({type:String})],za.prototype,`latest`,void 0),K([W({type:Array})],za.prototype,`excludedates`,void 0),K([W({type:Array})],za.prototype,`excludeweekdays`,void 0),K([W({type:String})],za.prototype,`currentmonth`,void 0),K([W({type:String})],za.prototype,`today`,void 0),K([G()],za.prototype,`_hasBeenOpened`,void 0);try{U(`pkt-datepicker-popup`)(za)}catch{console.warn(`Forsøker å definere <pkt-datepicker-popup>, men den er allerede definert`)}var Ba=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`
1252
+ `}};K([W({type:Boolean,reflect:!0})],Ya.prototype,`open`,void 0),K([W({type:Boolean})],Ya.prototype,`multiple`,void 0),K([W({type:Boolean})],Ya.prototype,`range`,void 0),K([W({type:Boolean})],Ya.prototype,`weeknumbers`,void 0),K([W({type:Boolean})],Ya.prototype,`withcontrols`,void 0),K([W({type:Number})],Ya.prototype,`maxMultiple`,void 0),K([W({type:Array})],Ya.prototype,`selected`,void 0),K([W({type:String})],Ya.prototype,`earliest`,void 0),K([W({type:String})],Ya.prototype,`latest`,void 0),K([W({type:Array})],Ya.prototype,`excludedates`,void 0),K([W({type:Array})],Ya.prototype,`excludeweekdays`,void 0),K([W({type:String})],Ya.prototype,`currentmonth`,void 0),K([W({type:String})],Ya.prototype,`today`,void 0),K([G()],Ya.prototype,`_hasBeenOpened`,void 0);try{U(`pkt-datepicker-popup`)(Ya)}catch{console.warn(`Forsøker å definere <pkt-datepicker-popup>, men den er allerede definert`)}var Xa=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`
1115
1253
  <button
1116
- class="${q(Ia.getButtonClasses())}"
1254
+ class="${q(Ka.getButtonClasses())}"
1117
1255
  type="button"
1118
1256
  @click=${e=>this.dispatchToggleCalendar(e)}
1119
1257
  @keydown=${e=>{let{key:t}=e;(t===`Enter`||t===` `||t===`Space`)&&(e.preventDefault(),this.dispatchToggleCalendar(e))}}
@@ -1123,7 +1261,7 @@
1123
1261
  <pkt-icon name="calendar"></pkt-icon>
1124
1262
  <span class="pkt-btn__text">${this.strings.calendar?.buttonAltText||`Åpne kalender`}</span>
1125
1263
  </button>
1126
- `}createRenderRoot(){return this}};K([W({type:String})],Ba.prototype,`inputType`,void 0),K([W({type:String})],Ba.prototype,`id`,void 0),K([W({type:String})],Ba.prototype,`min`,void 0),K([W({type:String})],Ba.prototype,`max`,void 0),K([W({type:String})],Ba.prototype,`placeholder`,void 0),K([W({type:Boolean})],Ba.prototype,`readonly`,void 0),K([W({type:Boolean})],Ba.prototype,`disabled`,void 0),K([W({type:Object})],Ba.prototype,`inputClasses`,void 0),K([W({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`
1264
+ `}createRenderRoot(){return this}};K([W({type:String})],Xa.prototype,`inputType`,void 0),K([W({type:String})],Xa.prototype,`id`,void 0),K([W({type:String})],Xa.prototype,`min`,void 0),K([W({type:String})],Xa.prototype,`max`,void 0),K([W({type:String})],Xa.prototype,`placeholder`,void 0),K([W({type:Boolean})],Xa.prototype,`readonly`,void 0),K([W({type:Boolean})],Xa.prototype,`disabled`,void 0),K([W({type:Object})],Xa.prototype,`inputClasses`,void 0),K([W({type:Object})],Xa.prototype,`internals`,void 0);var Za=class extends Xa{constructor(...e){super(...e),this.value=``,this.strings=Ea}dispatchManageValidity(e){this.dispatchEvent(new CustomEvent(`manage-validity`,{detail:e,bubbles:!0,composed:!0}))}render(){return j`
1127
1265
  <div class="pkt-input__container">
1128
1266
  <input
1129
1267
  class="${q(this.inputClasses)}"
@@ -1138,16 +1276,16 @@
1138
1276
  @click=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
1139
1277
  @touchend=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
1140
1278
  ?disabled=${this.disabled}
1141
- @keydown=${e=>Ra.handleInputKeydown(e,e=>this.dispatchToggleCalendar(e),()=>Pa.submitFormOrFallback(this.internals,()=>this.inputRef.value?.blur()),void 0,()=>this.inputRef.value?.blur())}
1279
+ @keydown=${e=>Ja.handleInputKeydown(e,e=>this.dispatchToggleCalendar(e),()=>Wa.submitFormOrFallback(this.internals,()=>this.inputRef.value?.blur()),void 0,()=>this.inputRef.value?.blur())}
1142
1280
  @input=${e=>{this.dispatchInput(e),e.stopImmediatePropagation()}}
1143
- @focus=${()=>{this.dispatchFocus(),ba()&&this.dispatchToggleCalendar(new Event(`focus`))}}
1281
+ @focus=${()=>{this.dispatchFocus(),Aa()&&this.dispatchToggleCalendar(new Event(`focus`))}}
1144
1282
  @blur=${e=>{this.dispatchBlur(e),this.dispatchManageValidity(e.target),this.dispatchEvent(new CustomEvent(`value-change`,{detail:e.target.value,bubbles:!0,composed:!0}))}}
1145
1283
  @change=${e=>{this.dispatchChange(e),e.stopImmediatePropagation()}}
1146
1284
  ${X(this.inputRef)}
1147
1285
  />
1148
1286
  ${this.renderCalendarButton()}
1149
1287
  </div>
1150
- `}};K([W({type:String})],Va.prototype,`value`,void 0),K([W({type:Object})],Va.prototype,`strings`,void 0);try{U(`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=Y()}get inputElementTo(){return this.inputRefTo.value}render(){let e=Ia.getRangeLabelClasses(this.showRangeLabels);return j`
1288
+ `}};K([W({type:String})],Za.prototype,`value`,void 0),K([W({type:Object})],Za.prototype,`strings`,void 0);try{U(`pkt-datepicker-single`)(Za)}catch{console.warn(`Forsøker å definere <pkt-datepicker-single>, men den er allerede definert`)}var Qa=class extends Xa{constructor(...e){super(...e),this.value=[],this.label=``,this.showRangeLabels=!1,this.strings=Da,this.inputRefTo=Y()}get inputElementTo(){return this.inputRefTo.value}render(){let e=Ka.getRangeLabelClasses(this.showRangeLabels);return j`
1151
1289
  <div class="pkt-input__container">
1152
1290
  ${this.showRangeLabels?j` <div class="pkt-input-prefix">${this.strings.generic?.from}</div> `:N}
1153
1291
  <input
@@ -1163,9 +1301,9 @@
1163
1301
  ?disabled=${this.disabled}
1164
1302
  @click=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
1165
1303
  @touchend=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
1166
- @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())}
1304
+ @keydown=${e=>Ja.handleInputKeydown(e,e=>this.dispatchToggleCalendar(e),()=>Wa.submitFormOrFallback(this.internals,()=>this.inputRefTo.value?.focus()),()=>this.inputRefTo.value?.focus(),()=>this.inputRef.value?.blur())}
1167
1305
  @input=${e=>{this.dispatchInput(e),e.stopImmediatePropagation()}}
1168
- @focus=${()=>{this.dispatchFocus(),ba()&&this.dispatchToggleCalendar(new Event(`focus`))}}
1306
+ @focus=${()=>{this.dispatchFocus(),Aa()&&this.dispatchToggleCalendar(new Event(`focus`))}}
1169
1307
  @blur=${e=>{this.dispatchBlur(e),this.dispatchEvent(new CustomEvent(`range-blur`,{detail:{event:e,values:this.value,inputType:`from`},bubbles:!0,composed:!0}))}}
1170
1308
  @change=${e=>{this.dispatchChange(e),e.stopImmediatePropagation()}}
1171
1309
  ${X(this.inputRef)}
@@ -1187,16 +1325,16 @@
1187
1325
  ?disabled=${this.disabled}
1188
1326
  @click=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
1189
1327
  @touchend=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
1190
- @keydown=${e=>Ra.handleInputKeydown(e,e=>this.dispatchToggleCalendar(e),()=>Pa.submitFormOrFallback(this.internals,()=>this.inputRefTo.value?.blur()),void 0,()=>this.inputRefTo.value?.blur())}
1328
+ @keydown=${e=>Ja.handleInputKeydown(e,e=>this.dispatchToggleCalendar(e),()=>Wa.submitFormOrFallback(this.internals,()=>this.inputRefTo.value?.blur()),void 0,()=>this.inputRefTo.value?.blur())}
1191
1329
  @input=${e=>{this.dispatchInput(e),e.stopImmediatePropagation()}}
1192
- @focus=${()=>{this.dispatchFocus(),ba()&&this.dispatchToggleCalendar(new Event(`focus`))}}
1330
+ @focus=${()=>{this.dispatchFocus(),Aa()&&this.dispatchToggleCalendar(new Event(`focus`))}}
1193
1331
  @blur=${e=>{this.dispatchBlur(e),this.dispatchEvent(new CustomEvent(`range-blur`,{detail:{event:e,values:this.value,inputType:`to`},bubbles:!0,composed:!0}))}}
1194
1332
  @change=${e=>{this.dispatchChange(e),e.stopImmediatePropagation()}}
1195
1333
  ${X(this.inputRefTo)}
1196
1334
  />
1197
1335
  ${this.renderCalendarButton()}
1198
1336
  </div>
1199
- `}};K([W({type:Array})],Ha.prototype,`value`,void 0),K([W({type:String})],Ha.prototype,`label`,void 0),K([W({type:Boolean})],Ha.prototype,`showRangeLabels`,void 0),K([W({type:Object})],Ha.prototype,`strings`,void 0);try{U(`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`
1337
+ `}};K([W({type:Array})],Qa.prototype,`value`,void 0),K([W({type:String})],Qa.prototype,`label`,void 0),K([W({type:Boolean})],Qa.prototype,`showRangeLabels`,void 0),K([W({type:Object})],Qa.prototype,`strings`,void 0);try{U(`pkt-datepicker-range`)(Qa)}catch{console.warn(`Forsøker å definere <pkt-datepicker-range>, men den er allerede definert`)}var $a=class extends Xa{constructor(...e){super(...e),this.value=[],this.strings=Ea}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`
1200
1338
  <div class="pkt-input__container">
1201
1339
  <input
1202
1340
  class=${q(this.inputClasses)}
@@ -1211,14 +1349,14 @@
1211
1349
  @touchend=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
1212
1350
  @blur=${e=>{this.dispatchBlur(e),this.dispatchAddToSelected(e)}}
1213
1351
  @input=${e=>{this.dispatchInput(e),e.stopImmediatePropagation()}}
1214
- @focus=${()=>{this.dispatchFocus(),ba()&&this.dispatchToggleCalendar(new Event(`focus`))}}
1215
- @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))}
1352
+ @focus=${()=>{this.dispatchFocus(),Aa()&&this.dispatchToggleCalendar(new Event(`focus`))}}
1353
+ @keydown=${e=>Ja.handleInputKeydown(e,e=>this.dispatchToggleCalendar(e),()=>Wa.submitFormOrFallback(this.internals,()=>this.inputRef.value?.blur()),void 0,void 0,e=>this.dispatchAddToSelected(e))}
1216
1354
  @change=${e=>{this.dispatchChange(e),e.stopImmediatePropagation()}}
1217
1355
  ${X(this.inputRef)}
1218
1356
  />
1219
1357
  ${this.renderCalendarButton()}
1220
1358
  </div>
1221
- `}};K([W({type:Array})],Ua.prototype,`value`,void 0),K([W({type:Number})],Ua.prototype,`maxlength`,void 0),K([W({type:Object})],Ua.prototype,`strings`,void 0);try{U(`pkt-datepicker-multiple`)(Ua)}catch{console.warn(`Forsøker å definere <pkt-datepicker-multiple>, men den er allerede definert`)}var Wa=class extends Z{constructor(...e){super(...e),this._valueProperty=``,this._valueProcessing=!1,this.datepickerPopupRef=Y(),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=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):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=Rr(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=zr(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=Rr(n||``)),e===`excludeweekdays`&&typeof this.excludeweekdays==`string`&&(this.excludeweekdays=Rr(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=Rr(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`
1359
+ `}};K([W({type:Array})],$a.prototype,`value`,void 0),K([W({type:Number})],$a.prototype,`maxlength`,void 0),K([W({type:Object})],$a.prototype,`strings`,void 0);try{U(`pkt-datepicker-multiple`)($a)}catch{console.warn(`Forsøker å definere <pkt-datepicker-multiple>, men den er allerede definert`)}var eo=class extends Z{constructor(...e){super(...e),this._valueProperty=``,this._valueProcessing=!1,this.datepickerPopupRef=Y(),this._value=[],this.label=`Datovelger`,this.dateformat=ka.props.dateformat.default,this.multiple=ka.props.multiple.default,this.maxlength=null,this.range=ka.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=ka.props.weeknumbers.default,this.withcontrols=ka.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):Ga.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 Ua.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=Rr(e),r=this.multiple&&n.length>1?Ha.filterSelectableDates(n,this.min,this.max,this.excludedates,this.excludeweekdays):n;if(this.range&&!Ha.validateRangeOrder(r)){this._value=[],this._valueProperty=``,super.valueChanged(``,t);return}this._value=r;let i=zr(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=Rr(n||``)),e===`excludeweekdays`&&typeof this.excludeweekdays==`string`&&(this.excludeweekdays=Rr(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=Rr(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`
1222
1360
  <pkt-datepicker-single
1223
1361
  .value=${this._value[0]??``}
1224
1362
  .inputType=${this.inputType}
@@ -1259,9 +1397,9 @@
1259
1397
  @input-change=${()=>this.onInput()}
1260
1398
  @input-focus=${()=>this.onFocus()}
1261
1399
  @input-blur=${e=>{this.calRef.value?.contains(e.detail.relatedTarget)||this.onBlur()}}
1262
- @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))}}
1400
+ @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(`,`))}}qa.processRangeBlur(e.detail.event,e.detail.values,this.calRef,()=>this.clearInputValue(),e=>this.manageValidity(e))}}
1263
1401
  @manage-validity=${e=>this.manageValidity(e.detail)}
1264
- @validate-date-input=${e=>{Pa.validateDateInput(e.detail,this.internals,this.min,this.max,this.strings)}}
1402
+ @validate-date-input=${e=>{Wa.validateDateInput(e.detail,this.internals,this.min,this.max,this.strings)}}
1265
1403
  @handle-date-select=${e=>{let t=Cr(e.detail);if(t){let e=Sr(t);this._value[0]!==e&&this._value[1]!==e&&this.calRef?.value?.handleDateSelect(t)}}}
1266
1404
  @input-changed=${()=>{this.touched=!0}}
1267
1405
  ${X(this.rangeInputRef)}
@@ -1304,11 +1442,11 @@
1304
1442
  .excludeweekdays=${this.excludeweekdays}
1305
1443
  .currentmonth=${this.currentmonth?xr(this.currentmonth):null}
1306
1444
  .today=${this.today}
1307
- @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))}}
1445
+ @date-selected=${e=>{this.value=qa.processDateSelection(e.detail,this.multiple,this.range),this._value=e.detail,qa.updateInputValues(this.inputRef,this.inputRefTo,this._value,this.range,this.multiple,e=>this.manageValidity(e))}}
1308
1446
  @close=${()=>{this.onBlur(),this.hideCalendar()}}
1309
1447
  ${X(this.datepickerPopupRef)}
1310
1448
  ></pkt-datepicker-popup>
1311
- `}render(){return this.inputClasses=Ia.getInputClasses(this.fullwidth,this.showRangeLabels,this.multiple,this.range,this.readonly,this.inputType),j`
1449
+ `}render(){return this.inputClasses=Ka.getInputClasses(this.fullwidth,this.showRangeLabels,this.multiple,this.range,this.readonly,this.inputType),j`
1312
1450
  <pkt-input-wrapper
1313
1451
  label="${this.label}"
1314
1452
  forId="${this.id}-input"
@@ -1346,7 +1484,7 @@
1346
1484
  </div>
1347
1485
  </pkt-input-wrapper>
1348
1486
  ${this.renderCalendar()}
1349
- `}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 yi(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}))}};K([W({type:String,reflect:!0})],Wa.prototype,`value`,null),K([W({type:String,reflect:!0})],Wa.prototype,`label`,void 0),K([W({type:String})],Wa.prototype,`dateformat`,void 0),K([W({type:Boolean,reflect:!0})],Wa.prototype,`multiple`,void 0),K([W({type:Number,reflect:!0})],Wa.prototype,`maxlength`,void 0),K([W({type:Boolean,reflect:!0})],Wa.prototype,`range`,void 0),K([W({type:Boolean,attribute:`show-range-labels`})],Wa.prototype,`showRangeLabels`,void 0),K([W({type:String,reflect:!0})],Wa.prototype,`min`,void 0),K([W({type:String,reflect:!0})],Wa.prototype,`max`,void 0),K([W({type:Boolean})],Wa.prototype,`weeknumbers`,void 0),K([W({type:Boolean,reflect:!0})],Wa.prototype,`withcontrols`,void 0),K([W({converter:Br.csvToArray})],Wa.prototype,`excludedates`,void 0),K([W({converter:Br.csvToArray})],Wa.prototype,`excludeweekdays`,void 0),K([W({type:String})],Wa.prototype,`currentmonth`,void 0),K([W({type:String})],Wa.prototype,`today`,void 0),K([W({type:Boolean,reflect:!0,attribute:`calendar-open`})],Wa.prototype,`calendarOpen`,void 0),K([W({type:String})],Wa.prototype,`timezone`,void 0),K([G()],Wa.prototype,`inputClasses`,void 0);try{U(`pkt-datepicker`)(Wa)}catch{console.warn(`Forsøker å definere <pkt-datepicker>, men den er allerede definert`)}var Ga=f({default:()=>io});function Ka(e,t){var n=`on`+t.type.toLowerCase();return typeof e[n]==`function`&&e[n](t),e.dispatchEvent(t)}function qa(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 Ja(e){for(;e;){if(e.localName===`dialog`)return e;e=e.parentElement?e.parentElement:e.parentNode?e.parentNode.host:null}return null}function Ya(e){for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;e&&e.blur&&e!==document.body&&e.blur()}function Xa(e,t){for(var n=0;n<e.length;++n)if(e[n]===t)return!0;return!1}function Za(e){return!e||!e.hasAttribute(`method`)?!1:e.getAttribute(`method`).toLowerCase()===`dialog`}function Qa(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=Qa(r[i].shadowRoot),n));i++);return n}function $a(e){return e.isConnected||document.body.contains(e)}function eo(e){if(e.submitter)return e.submitter;var t=e.target;if(!(t instanceof HTMLFormElement))return null;var n=io.formSubmitter;if(!n){var r=e.target;n=(`getRootNode`in r&&r.getRootNode()||document).activeElement}return!n||n.form!==t?null:n}function to(e){if(!e.defaultPrevented){var t=e.target,n=io.imagemapUseValue,r=eo(e);n===null&&r&&(n=r.value);var i=Ja(t);i&&(r&&r.getAttribute(`formmethod`)||t.getAttribute(`method`))===`dialog`&&(e.preventDefault(),n==null?i.close():i.close(n))}}function no(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`,to,!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 ro,io,ao,oo,so,co,lo,uo,fo=u((()=>{ro=window.CustomEvent,(!ro||typeof ro==`object`)&&(ro=function(e,t){t||={};var n=document.createEvent(`CustomEvent`);return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail||null),n},ro.prototype=window.Event.prototype),no.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute(`open`)&&$a(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_),io.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||=Qa(this.dialog_),Ya(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(!$a(this.dialog_))throw Error(`Failed to execute 'showModal' on dialog: The element is not in a Document.`);if(!io.dm.pushDialog(this))throw Error(`Failed to execute 'showModal' on dialog: There are too many open modal dialogs.`);qa(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,io.needsCentering(this.dialog_)?(io.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 ro(`close`,{bubbles:!1,cancelable:!1});Ka(this.dialog_,t)}},io={},io.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`},io.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||!Xa(o,e))){var s=a.style.getPropertyValue(`top`),c=a.style.getPropertyValue(`bottom`);if(s&&s!==`auto`||c&&c!==`auto`)return!0}}}return!1},io.needsCentering=function(e){return window.getComputedStyle(e).position!==`absolute`||e.style.top!==`auto`&&e.style.top!==``||e.style.bottom!==`auto`&&e.style.bottom!==``?!1:!io.isInlinePositionSetByStylesheet(e)},io.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 no(e)},io.registerDialog=function(e){e.showModal||io.forceRegisterDialog(e)},io.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)}))},io.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})},io.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener(`focus`,this.handleFocus_,!0),document.removeEventListener(`keydown`,this.handleKey_),this.mo_&&this.mo_.disconnect()},io.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)},io.DialogManager.prototype.containedByTopDialog_=function(e){for(;e=Ja(e);){for(var t=0,n;n=this.pendingDialogStack[t];++t)if(n.dialog===e)return t===0;e=e.parentElement}return!1},io.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(),Ya(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}},io.DialogManager.prototype.handleKey_=function(e){if(this.forwardTab_=void 0,e.keyCode===27){e.preventDefault(),e.stopPropagation();var t=new ro(`cancel`,{bubbles:!1,cancelable:!0}),n=this.pendingDialogStack[0];n&&Ka(n.dialog,t)&&n.dialog.close()}else e.keyCode===9&&(this.forwardTab_=!e.shiftKey)},io.DialogManager.prototype.checkDOM_=function(e){this.pendingDialogStack.slice().forEach(function(t){e.indexOf(t.dialog)===-1?t.maybeHideModal():t.downgradeModal()})},io.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)},io.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())},io.dm=new io.DialogManager,io.formSubmitter=null,io.imagemapUseValue=null,window.HTMLDialogElement===void 0&&(ao=document.createElement(`form`),ao.setAttribute(`method`,`dialog`),ao.method!==`dialog`&&(oo=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,`method`),oo&&(so=oo.get,oo.get=function(){return Za(this)?`dialog`:so.call(this)},co=oo.set,oo.set=function(e){return typeof e==`string`&&e.toLowerCase()===`dialog`?this.setAttribute(`method`,e):co.call(this,e)},Object.defineProperty(HTMLFormElement.prototype,`method`,oo))),document.addEventListener(`click`,function(e){if(io.formSubmitter=null,io.imagemapUseValue=null,!e.defaultPrevented){var t=e.target;if(`composedPath`in e&&(t=e.composedPath().shift()||t),!(!t||!Za(t.form))){if(!(t.type===`submit`&&[`button`,`input`].indexOf(t.localName)>-1)){if(!(t.localName===`input`&&t.type===`image`))return;io.imagemapUseValue=e.offsetX+`,`+e.offsetY}Ja(t)&&(io.formSubmitter=t)}}},!1),document.addEventListener(`submit`,function(e){var t=e.target;if(!Ja(t)){var n=eo(e);(n&&n.getAttribute(`formmethod`)||t.getAttribute(`method`))===`dialog`&&e.preventDefault()}}),lo=HTMLFormElement.prototype.submit,uo=function(){if(!Za(this))return lo.call(this);var e=Ja(this);e&&e.close()},HTMLFormElement.prototype.submit=uo)})),po={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.`}}},mo=class extends Dt{constructor(){super(),this.open=!1,this.headingText=``,this.removePadding=!1,this.hideCloseButton=po.props.hideCloseButton.default,this.closeOnBackdropClick=po.props.closeOnBackdropClick.default,this.closeButtonSkin=`blue`,this.size=po.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(()=>(fo(),Ga)).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`
1487
+ `}handleCalendarPosition(){let e=this.multiple&&!!this.maxlength;Ga.handleCalendarPosition(this.popupRef,this.inputRef,e)}async showCalendar(){let e=this.datepickerPopupRef.value;if(this.calendarOpen=!0,e&&typeof e.show==`function`){e.show(),Aa()&&e.focusOnCurrentDate();return}await yi(20),this.handleCalendarPosition(),Aa()&&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})],eo.prototype,`value`,null),K([W({type:String,reflect:!0})],eo.prototype,`label`,void 0),K([W({type:String})],eo.prototype,`dateformat`,void 0),K([W({type:Boolean,reflect:!0})],eo.prototype,`multiple`,void 0),K([W({type:Number,reflect:!0})],eo.prototype,`maxlength`,void 0),K([W({type:Boolean,reflect:!0})],eo.prototype,`range`,void 0),K([W({type:Boolean,attribute:`show-range-labels`})],eo.prototype,`showRangeLabels`,void 0),K([W({type:String,reflect:!0})],eo.prototype,`min`,void 0),K([W({type:String,reflect:!0})],eo.prototype,`max`,void 0),K([W({type:Boolean})],eo.prototype,`weeknumbers`,void 0),K([W({type:Boolean,reflect:!0})],eo.prototype,`withcontrols`,void 0),K([W({converter:Br.csvToArray})],eo.prototype,`excludedates`,void 0),K([W({converter:Br.csvToArray})],eo.prototype,`excludeweekdays`,void 0),K([W({type:String})],eo.prototype,`currentmonth`,void 0),K([W({type:String})],eo.prototype,`today`,void 0),K([W({type:Boolean,reflect:!0,attribute:`calendar-open`})],eo.prototype,`calendarOpen`,void 0),K([W({type:String})],eo.prototype,`timezone`,void 0),K([G()],eo.prototype,`inputClasses`,void 0);try{U(`pkt-datepicker`)(eo)}catch{console.warn(`Forsøker å definere <pkt-datepicker>, men den er allerede definert`)}var to=f({default:()=>ho});function no(e,t){var n=`on`+t.type.toLowerCase();return typeof e[n]==`function`&&e[n](t),e.dispatchEvent(t)}function ro(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 io(e){for(;e;){if(e.localName===`dialog`)return e;e=e.parentElement?e.parentElement:e.parentNode?e.parentNode.host:null}return null}function ao(e){for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;e&&e.blur&&e!==document.body&&e.blur()}function oo(e,t){for(var n=0;n<e.length;++n)if(e[n]===t)return!0;return!1}function so(e){return!e||!e.hasAttribute(`method`)?!1:e.getAttribute(`method`).toLowerCase()===`dialog`}function co(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=co(r[i].shadowRoot),n));i++);return n}function lo(e){return e.isConnected||document.body.contains(e)}function uo(e){if(e.submitter)return e.submitter;var t=e.target;if(!(t instanceof HTMLFormElement))return null;var n=ho.formSubmitter;if(!n){var r=e.target;n=(`getRootNode`in r&&r.getRootNode()||document).activeElement}return!n||n.form!==t?null:n}function fo(e){if(!e.defaultPrevented){var t=e.target,n=ho.imagemapUseValue,r=uo(e);n===null&&r&&(n=r.value);var i=io(t);i&&(r&&r.getAttribute(`formmethod`)||t.getAttribute(`method`))===`dialog`&&(e.preventDefault(),n==null?i.close():i.close(n))}}function po(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`,fo,!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 mo,ho,go,_o,vo,yo,bo,xo,So=u((()=>{mo=window.CustomEvent,(!mo||typeof mo==`object`)&&(mo=function(e,t){t||={};var n=document.createEvent(`CustomEvent`);return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail||null),n},mo.prototype=window.Event.prototype),po.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute(`open`)&&lo(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_),ho.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||=co(this.dialog_),ao(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(!lo(this.dialog_))throw Error(`Failed to execute 'showModal' on dialog: The element is not in a Document.`);if(!ho.dm.pushDialog(this))throw Error(`Failed to execute 'showModal' on dialog: There are too many open modal dialogs.`);ro(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,ho.needsCentering(this.dialog_)?(ho.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 mo(`close`,{bubbles:!1,cancelable:!1});no(this.dialog_,t)}},ho={},ho.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`},ho.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||!oo(o,e))){var s=a.style.getPropertyValue(`top`),c=a.style.getPropertyValue(`bottom`);if(s&&s!==`auto`||c&&c!==`auto`)return!0}}}return!1},ho.needsCentering=function(e){return window.getComputedStyle(e).position!==`absolute`||e.style.top!==`auto`&&e.style.top!==``||e.style.bottom!==`auto`&&e.style.bottom!==``?!1:!ho.isInlinePositionSetByStylesheet(e)},ho.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 po(e)},ho.registerDialog=function(e){e.showModal||ho.forceRegisterDialog(e)},ho.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)}))},ho.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})},ho.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener(`focus`,this.handleFocus_,!0),document.removeEventListener(`keydown`,this.handleKey_),this.mo_&&this.mo_.disconnect()},ho.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)},ho.DialogManager.prototype.containedByTopDialog_=function(e){for(;e=io(e);){for(var t=0,n;n=this.pendingDialogStack[t];++t)if(n.dialog===e)return t===0;e=e.parentElement}return!1},ho.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(),ao(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}},ho.DialogManager.prototype.handleKey_=function(e){if(this.forwardTab_=void 0,e.keyCode===27){e.preventDefault(),e.stopPropagation();var t=new mo(`cancel`,{bubbles:!1,cancelable:!0}),n=this.pendingDialogStack[0];n&&no(n.dialog,t)&&n.dialog.close()}else e.keyCode===9&&(this.forwardTab_=!e.shiftKey)},ho.DialogManager.prototype.checkDOM_=function(e){this.pendingDialogStack.slice().forEach(function(t){e.indexOf(t.dialog)===-1?t.maybeHideModal():t.downgradeModal()})},ho.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)},ho.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())},ho.dm=new ho.DialogManager,ho.formSubmitter=null,ho.imagemapUseValue=null,window.HTMLDialogElement===void 0&&(go=document.createElement(`form`),go.setAttribute(`method`,`dialog`),go.method!==`dialog`&&(_o=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,`method`),_o&&(vo=_o.get,_o.get=function(){return so(this)?`dialog`:vo.call(this)},yo=_o.set,_o.set=function(e){return typeof e==`string`&&e.toLowerCase()===`dialog`?this.setAttribute(`method`,e):yo.call(this,e)},Object.defineProperty(HTMLFormElement.prototype,`method`,_o))),document.addEventListener(`click`,function(e){if(ho.formSubmitter=null,ho.imagemapUseValue=null,!e.defaultPrevented){var t=e.target;if(`composedPath`in e&&(t=e.composedPath().shift()||t),!(!t||!so(t.form))){if(!(t.type===`submit`&&[`button`,`input`].indexOf(t.localName)>-1)){if(!(t.localName===`input`&&t.type===`image`))return;ho.imagemapUseValue=e.offsetX+`,`+e.offsetY}io(t)&&(ho.formSubmitter=t)}}},!1),document.addEventListener(`submit`,function(e){var t=e.target;if(!io(t)){var n=uo(e);(n&&n.getAttribute(`formmethod`)||t.getAttribute(`method`))===`dialog`&&e.preventDefault()}}),bo=HTMLFormElement.prototype.submit,xo=function(){if(!so(this))return bo.call(this);var e=io(this);e&&e.close()},HTMLFormElement.prototype.submit=xo)})),Co={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.`}}},wo=class extends Dt{constructor(){super(),this.open=!1,this.headingText=``,this.removePadding=!1,this.hideCloseButton=Co.props.hideCloseButton.default,this.closeOnBackdropClick=Co.props.closeOnBackdropClick.default,this.closeButtonSkin=`blue`,this.size=Co.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(()=>(So(),to)).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`
1350
1488
  <dialog
1351
1489
  class=${q(e)}
1352
1490
  ${X(this.dialogRef)}
@@ -1380,10 +1518,10 @@
1380
1518
  </div>
1381
1519
  </div>
1382
1520
  </dialog>
1383
- `}};K([W({type:Boolean,reflect:!0})],mo.prototype,`open`,void 0),K([W({type:String})],mo.prototype,`headingText`,void 0),K([W({type:Boolean})],mo.prototype,`removePadding`,void 0),K([W({type:Boolean})],mo.prototype,`hideCloseButton`,void 0),K([W({type:Boolean})],mo.prototype,`closeOnBackdropClick`,void 0),K([W({type:String})],mo.prototype,`closeButtonSkin`,void 0),K([W({type:String})],mo.prototype,`size`,void 0),K([W({type:String})],mo.prototype,`variant`,void 0),K([W({type:String})],mo.prototype,`drawerPosition`,void 0),K([W({type:Boolean})],mo.prototype,`transparentBackdrop`,void 0),K([G()],mo.prototype,`_isOpen`,void 0);try{U(`pkt-modal`)(mo)}catch{console.warn(`Forsøker å definere <pkt-modal>, men den er allerede definert`)}var ho=`important`,go=` !`+ho,_o=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(go);e.includes(`-`)||t?n.setProperty(e,t?r.slice(0,-11):r,t?ho:``):n[e]=r}}return M}}),vo=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
1521
+ `}};K([W({type:Boolean,reflect:!0})],wo.prototype,`open`,void 0),K([W({type:String})],wo.prototype,`headingText`,void 0),K([W({type:Boolean})],wo.prototype,`removePadding`,void 0),K([W({type:Boolean})],wo.prototype,`hideCloseButton`,void 0),K([W({type:Boolean})],wo.prototype,`closeOnBackdropClick`,void 0),K([W({type:String})],wo.prototype,`closeButtonSkin`,void 0),K([W({type:String})],wo.prototype,`size`,void 0),K([W({type:String})],wo.prototype,`variant`,void 0),K([W({type:String})],wo.prototype,`drawerPosition`,void 0),K([W({type:Boolean})],wo.prototype,`transparentBackdrop`,void 0),K([G()],wo.prototype,`_isOpen`,void 0);try{U(`pkt-modal`)(wo)}catch{console.warn(`Forsøker å definere <pkt-modal>, men den er allerede definert`)}var To=`important`,Eo=` !`+To,Do=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(Eo);e.includes(`-`)||t?n.setProperty(e,t?r.slice(0,-11):r,t?To:``):n[e]=r}}return M}}),Oo=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
1384
1522
  class="pkt-progressbar__container"
1385
1523
  .ref=${this.progressBarRef}
1386
- style=${_o({"--pkt-progress-label-width":`${this.labelWidth}px`,"--pkt-progress-width":`${r}%`})}
1524
+ style=${Do({"--pkt-progress-label-width":`${this.labelWidth}px`,"--pkt-progress-width":`${r}%`})}
1387
1525
  >
1388
1526
  ${this.title?j`<p id=${`${this.progressBarId}-title`} class=${o}>${this.title}</p>`:N}
1389
1527
 
@@ -1396,7 +1534,7 @@
1396
1534
  ${this.statusType===`percentage`?`${r}%`:i}
1397
1535
  </span>
1398
1536
  </div>`:N}
1399
- </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})],vo.prototype,`ariaLabel`,void 0),K([W({type:String,reflect:!0})],vo.prototype,`ariaLabelledby`,void 0),K([W({type:String,reflect:!0})],vo.prototype,`ariaValueText`,void 0),K([W({type:String})],vo.prototype,`ariaLive`,void 0),K([W({type:String,reflect:!0})],vo.prototype,`id`,void 0),K([W({type:String})],vo.prototype,`role`,void 0),K([W({type:String})],vo.prototype,`skin`,void 0),K([W({type:String})],vo.prototype,`statusPlacement`,void 0),K([W({type:String})],vo.prototype,`statusType`,void 0),K([W({type:String,reflect:!0})],vo.prototype,`title`,void 0),K([W({type:String})],vo.prototype,`titlePosition`,void 0),K([W({type:Number,reflect:!0})],vo.prototype,`valueCurrent`,void 0),K([W({type:Number})],vo.prototype,`valueMax`,void 0),K([W({type:Number})],vo.prototype,`valueMin`,void 0),K([G()],vo.prototype,`labelWidth`,void 0),K([G()],vo.prototype,`progressbarId`,void 0),K([G()],vo.prototype,`computedAriaLabelledby`,void 0),K([G()],vo.prototype,`computedAriaValueText`,void 0);try{U(`pkt-progressbar`)(vo)}catch{console.warn(`Forsøker å definere <pkt-progressbar>, men den er allerede definert`)}var yo={dropZoneDragMultiple:`Dra filer hit for å laste dem opp eller`,dropZoneDragSingle:`Dra en fil hit for å laste den opp eller`,dropZoneDragMultipleThumbnail:`Dra bilder hit for å laste dem opp eller`,dropZoneDragSingleThumbnail:`Dra et bilde hit for å laste det opp eller`,dropZoneDragActiveMultiple:`Slipp filene her`,dropZoneDragActiveSingle:`Slipp filen her`,dropZoneDragActiveMultipleThumbnail:`Slipp bildene her`,dropZoneDragActiveSingleThumbnail:`Slipp bildet her`,dropZoneOpenFileDialogMultiple:`velg filer`,dropZoneOpenFileDialogSingle:`velg en fil`,dropZoneOpenFileDialogMultipleThumbnail:`velg fra kamerarull`,dropZoneOpenFileDialogSingleThumbnail:`velg fra kamerarull`,supportedFormatsPrefix:`Format:`,invalidFormatDefault:e=>`Ugyldig filtype. Tillatte formater: ${e}`,sizeTooLargeDefault:e=>`Filen er for stor. Maks størrelse er ${e}.`,requiredMissing:`Du må laste opp minst én fil.`,genericValidationRejection:`Filen ble avvist av validering.`,unknownFilename:`Ukjent fil`,fileLabel:e=>e===1?`fil`:`filer`,srFileAdded:e=>`Filen «${e}» er lagt til`,srFilesAdded:e=>`${e} filer er lagt til`,srFilesUploadedOfTotal:(e,t,n)=>`${e} av ${t} ${n} lastet opp`,srFilesFailedOfTotal:(e,t,n)=>`Feil ved opplasting: ${e} av ${t} ${n} feilet`};function bo(e){if(e==null||e===``)return;if(typeof e==`number`)return Number.isFinite(e)&&e>0?e:void 0;let t=String(e).trim(),n=Number(t);if(!Number.isNaN(n)&&n>0)return n;let r=t.match(/^(\d+(?:\.\d+)?)\s*(B|KB|MB|GB)$/i);if(!r){console.warn(`PktFileUpload: Invalid maxFileSize format "${t}". Use format like "5MB", "500KB", "1GB", or bytes.`);return}let i=parseFloat(r[1]);switch(r[2].toUpperCase()){case`B`:return i;case`KB`:return i*1024;case`MB`:return i*1024*1024;case`GB`:return i*1024*1024*1024;default:return}}function xo(e){return e<1024?`${Math.round(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`}function So(e){return Array.isArray(e)?e.map(e=>String(e).trim().toLowerCase()).filter(Boolean):[]}function Co(e){return e?e.split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean):[]}function wo(e,t,n){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}function To(e,t){let n=So(t);if(n.length===0)return!0;let r=e.name.split(`.`).pop()?.toLowerCase()??``,i=e.type.toLowerCase();return n.some(e=>wo(e,r,i))}function Eo(e,t){let n=(e??``).trim();if(n)return n;let r=So(t);return r.length===0?``:r.map(e=>e.includes(`/`)||e.startsWith(`.`)?e:`.${e}`).join(`, `)}function Do(e){return e.includes(`/`)?e:e.replace(/^\./,``).toUpperCase()}function Oo(e,t){let n=So(e);if(n.length>0)return n.map(Do).join(`, `);let r=Co(t);return r.length>0?r.map(Do).join(`, `):``}function ko(e,t,n){return((e??``).trim()||t).replace(/\{(\w+)\}/g,(e,t)=>n[t]??`{${t}}`)}function Ao(e,t){let n=So(t.allowedFormats);if(n.length>0&&!To(e,n)){let e=n.join(`, `),r=`Ugyldig filtype. Tillatte formater: ${e}`;return ko(t.formatErrorMessage,r,{formats:e})}let r=bo(t.maxFileSize);if(r!==void 0&&e.size>r){let e=xo(r),n=`Filen er for stor. Maks størrelse er ${e}.`;return ko(t.sizeErrorMessage,n,{maxSize:e})}if(t.onFileValidation){let n=t.onFileValidation(e);if(n)return n}return null}function jo(e){let t=e.file;if(t?.type?.startsWith(`image/`))return!0;let n=e.attributes?.targetFilename||t?.name||``;return/\.(jpe?g|png|gif|webp|heic|heif|bmp|svg)$/i.test(n)}function Mo(e){return typeof e==`number`?`in-progress`:e===`error`?`error`:`idle`}function No(e,t,n){let r={"in-progress":0,error:1,idle:2};return e.map(e=>{let r=t?.find(t=>t.fileId===e.fileId);return{...e,progress:r?.progress??(n===`form`?`done`:`queued`),errorMessage:r?.errorMessage,showProgress:r?.showProgress,lastProgress:r?.lastProgress}}).sort((e,t)=>r[Mo(e.progress)]-r[Mo(t.progress)])}function Po(e){if(!e)return[];let t=[`a[href]:not([tabindex="-1"])`,`button:not([disabled]):not([tabindex="-1"])`,`input:not([disabled]):not([type="hidden"]):not([tabindex="-1"])`,`select:not([disabled]):not([tabindex="-1"])`,`textarea:not([disabled]):not([tabindex="-1"])`,`[tabindex]:not([tabindex="-1"])`].join(`, `);return Array.from(e.querySelectorAll(t)).filter(e=>!e.hasAttribute(`inert`))}function Fo(e,t){if(e.key!==`Tab`)return!1;let n=Po(t);if(n.length===0)return e.preventDefault(),!0;let r=n[0],i=n[n.length-1],a=(t?.ownerDocument??document).activeElement,o=!!a&&n.includes(a);return e.shiftKey?!o||a===r?(e.preventDefault(),i.focus(),!0):!1:!o||a===i?(e.preventDefault(),r.focus(),!0):!1}function Io(e,t){return!t||t<=0||e.length<=t+3?null:{head:e.slice(0,e.length-t),tail:e.slice(-t)}}function Lo(e,t,n){return n<=0?0:t===`prev`?e<=0?n-1:e-1:e>=n-1?0:e+1}function Ro(e,t){let n=e.length;if(n===0||!t||t.length===0)return{totalCount:n,uploadedCount:0,failedCount:0};let r=0,i=0;for(let n of e){let e=t.find(e=>e.fileId===n.fileId);e?.progress===`done`?r++:e?.progress===`error`&&i++}return{totalCount:n,uploadedCount:r,failedCount:i}}function zo(e,t=yo.unknownFilename){return e.attributes?.targetFilename||e.file?.name||t}var Bo=class extends Ye{constructor(...e){super(...e),this.id=`pkt-fileupload-${bi()}`,this.name=`files`,this.label=``,this.helptext=``,this.required=!1,this.multiple=!1,this.disabled=!1,this.fullwidth=!1,this.uploadStrategy=`form`,this.itemRenderer=`filename`,this.accept=``,this.allowedFormats=[],this.formatErrorMessage=``,this.sizeErrorMessage=``,this.transfers=[],this.addCommentsEnabled=!1,this.renameFilesEnabled=!1,this.extraOperations=[],this.enableImagePreview=!1,this.hasError=!1,this.errorMessage=``,this.optionalTag=!1,this.requiredTag=!1,this.truncateTail=4,this.files=[],this.isDragActive=!1,this.validationErrorMessage=null,this.addedAnnouncement=``,this.thumbnailUrls={},this.hasInitializedValue=!1,this.hasWarnedInvalidValueCombo=!1,this.thumbnailFileById=new Map,this.connectedForm=null,this.addedAnnouncementTimer=null,this.requiredSelectionMessage=yo.requiredMissing,this.onNativeFileChange=e=>{let t=e.target;this.addFiles(t.files?Array.from(t.files):[]),this.uploadStrategy===`custom`&&(t.value=``)},this.openFileDialog=e=>{e.preventDefault(),e.stopPropagation(),!this.disabled&&this.querySelector(`#${this.id}-input`)?.click()},this.onDropZoneClick=e=>{this.disabled||e.target.closest(`.pkt-fileupload__drop-zone__placeholder__title__open-file-dialog`)||this.querySelector(`#${this.id}-input`)?.click()},this.onDragOver=e=>{e.preventDefault(),!this.disabled&&(this.isDragActive=!0)},this.onDragLeave=()=>{this.isDragActive=!1},this.onDrop=e=>{if(e.preventDefault(),this.isDragActive=!1,this.disabled)return;let t=e.dataTransfer?.files?Array.from(e.dataTransfer.files):[];this.addFiles(t)},this.onHostFormSubmit=e=>{!this.required||this.uploadStrategy!==`custom`||this.getCurrentFiles().length>0||(this.validationErrorMessage=this.requiredSelectionMessage,e.preventDefault())}}get isControlled(){return this.value!==void 0}get hasEffectiveError(){return!!this.validationErrorMessage||this.hasError||!!this.errorMessage.trim()}get effectiveErrorMessage(){return this.validationErrorMessage??this.errorMessage??``}get hasValidationError(){return!!this.validationErrorMessage}firstUpdated(e){super.firstUpdated?.(e),this.hasInitializedValue||=(this.files=this.value??this.defaultValue??[],this.syncThumbnailUrls(this.files),!0),this.value!==void 0&&this.defaultValue!==void 0&&this.warnInvalidValueCombo()}willUpdate(e){super.willUpdate(e),this.hasInitializedValue&&this.isControlled&&(e.has(`value`)||e.has(`itemRenderer`)||e.has(`enableImagePreview`))&&(this.files=this.value??[],this.syncThumbnailUrls(this.files))}updated(e){super.updated(e),(e.has(`uploadStrategy`)||e.has(`required`)||e.has(`value`))&&this.syncFormSubmitListener(),this.uploadStrategy===`form`&&(e.has(`value`)||e.has(`files`)||e.has(`uploadStrategy`))&&this.syncNativeInputFiles()}syncNativeInputFiles(){let e=this.querySelector(`#${this.id}-input`);if(!(!e||typeof DataTransfer>`u`))try{let t=new DataTransfer;for(let e of this.getCurrentFiles())e.file&&t.items.add(e.file);e.files=t.files}catch{}}warnInvalidValueCombo(){this.hasWarnedInvalidValueCombo||=(console.warn(`PktFileUpload: Både value og defaultValue er angitt. Komponenten kan være enten kontrollert eller ukontrollert, ikke begge. value vil bli prioritert.`),!0)}disconnectedCallback(){this.teardownFormSubmitListener(),this.addedAnnouncementTimer&&=(clearTimeout(this.addedAnnouncementTimer),null),super.disconnectedCallback(),this.revokeAllThumbnailUrls()}setAddedAnnouncement(e){this.addedAnnouncement=e,this.addedAnnouncementTimer&&clearTimeout(this.addedAnnouncementTimer),this.addedAnnouncementTimer=setTimeout(()=>{this.addedAnnouncement=``,this.addedAnnouncementTimer=null},1500)}connectedCallback(){super.connectedCallback(),this.syncFormSubmitListener()}addFiles(e){if(e.length===0)return;let t=this.multiple?e:[e[0]];for(let e of t){let t=this.validateFile(e);if(t){this.validationErrorMessage=t;return}}this.validationErrorMessage=null;let n=t.map(e=>({fileId:bi(),file:e,attributes:{targetFilename:e.name}}));this.setAddedAnnouncement(n.length===1?yo.srFileAdded(n[0].attributes.targetFilename):yo.srFilesAdded(n.length));let r=this.getCurrentFiles(),i=this.multiple?[...r,...n]:[n[0]];this.commitFiles(i,`add`,n.map(e=>e.fileId)),this.uploadStrategy===`custom`&&n.forEach(e=>{this.dispatchEvent(new CustomEvent(`file-upload-requested`,{detail:{fileId:e.fileId,file:e.file,attributes:e.attributes},bubbles:!0,composed:!0}))})}getCurrentFiles(){return this.isControlled?this.value??[]:this.files}cancelTransfer(e){if(this.disabled)return;let t=this.getCurrentFiles().find(t=>t.fileId===e);t&&(this.removeFileItem(e),this.dispatchEvent(new CustomEvent(`transfer-cancelled`,{detail:{fileId:t.fileId,file:t.file,attributes:t.attributes},bubbles:!0,composed:!0})))}removeFileItem(e){if(this.disabled)return;let t=this.getCurrentFiles(),n=t.filter(t=>t.fileId!==e);n.length!==t.length&&this.commitFiles(n,`remove`,[e])}updateFileItem(e,t){let n=this.getCurrentFiles().map(n=>n.fileId===e?{...n,...t}:n);this.commitFiles(n,`update`,[e])}commitFiles(e,t,n){this.isControlled||(this.files=e,this.syncThumbnailUrls(e)),this.validationErrorMessage===this.requiredSelectionMessage&&e.length>0&&(this.validationErrorMessage=null),this.dispatchEvent(new CustomEvent(`files-changed`,{detail:{files:e,reason:t,changedFileIds:n},bubbles:!0,composed:!0}))}getThumbnailUrl(e){return this.thumbnailUrls[e.fileId]}getTransferProgress(e){let t=this.transfers.find(t=>t.fileId===e);return t?t.progress:this.uploadStrategy===`form`?`done`:`queued`}getTransferForFile(e){return this.transfers.find(t=>t.fileId===e)}isImageFile(e){return jo(e)}formatFileSize(e){return xo(e)}getResolvedAcceptValue(){return Eo(this.accept,this.allowedFormats)}getSupportedFormatsText(){return Oo(this.allowedFormats,this.accept)}getSortedFilesAndTransfers(){return No(this.getCurrentFiles(),this.transfers,this.uploadStrategy)}validateFile(e){let t=Ao(e,{allowedFormats:this.allowedFormats,maxFileSize:this.maxFileSize,formatErrorMessage:this.formatErrorMessage,sizeErrorMessage:this.sizeErrorMessage,onFileValidation:this.onFileValidation});if(t)return t;let n={file:e,errorMessage:null},r=new CustomEvent(`file-validate`,{detail:n,bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(r),n.errorMessage?n.errorMessage:r.defaultPrevented?yo.genericValidationRejection:null}syncThumbnailUrls(e){if(!(typeof URL<`u`&&typeof URL.createObjectURL==`function`&&typeof URL.revokeObjectURL==`function`)){this.thumbnailUrls={},this.thumbnailFileById.clear();return}let t=new Set(e.map(e=>e.fileId)),n={};for(let[e,n]of Object.entries(this.thumbnailUrls))t.has(e)||(URL.revokeObjectURL(n),this.thumbnailFileById.delete(e));for(let t of e){let e=this.thumbnailUrls[t.fileId],r=this.thumbnailFileById.get(t.fileId);if(!t.file||!this.isImageFile(t)){e&&(URL.revokeObjectURL(e),this.thumbnailFileById.delete(t.fileId));continue}if(e&&r===t.file){n[t.fileId]=e;continue}e&&r!==t.file&&URL.revokeObjectURL(e);let i=URL.createObjectURL(t.file);this.thumbnailFileById.set(t.fileId,t.file),n[t.fileId]=i}this.thumbnailUrls=n}revokeAllThumbnailUrls(){if(typeof URL>`u`||typeof URL.revokeObjectURL!=`function`){this.thumbnailUrls={},this.thumbnailFileById.clear();return}Object.values(this.thumbnailUrls).forEach(e=>URL.revokeObjectURL(e)),this.thumbnailUrls={},this.thumbnailFileById.clear()}getSrUploadedMessage(){if(this.addedAnnouncement)return this.addedAnnouncement;let{totalCount:e,uploadedCount:t}=Ro(this.getCurrentFiles(),this.transfers);return e===0||t===0?``:yo.srFilesUploadedOfTotal(t,e,yo.fileLabel(e))}getSrErrorsMessage(){let{totalCount:e,failedCount:t}=Ro(this.getCurrentFiles(),this.transfers);return e===0||t===0?``:yo.srFilesFailedOfTotal(t,e,yo.fileLabel(e))}syncFormSubmitListener(){let e=this.closest(`form`);this.connectedForm!==e&&(this.teardownFormSubmitListener(),this.connectedForm=e,this.connectedForm&&this.connectedForm.addEventListener(`submit`,this.onHostFormSubmit))}teardownFormSubmitListener(){this.connectedForm&&=(this.connectedForm.removeEventListener(`submit`,this.onHostFormSubmit),null)}};K([W({type:String})],Bo.prototype,`id`,void 0),K([W({type:String})],Bo.prototype,`name`,void 0),K([W({type:String})],Bo.prototype,`label`,void 0),K([W({type:String})],Bo.prototype,`helptext`,void 0),K([W({type:Boolean,reflect:!0})],Bo.prototype,`required`,void 0),K([W({type:Boolean,reflect:!0})],Bo.prototype,`multiple`,void 0),K([W({type:Boolean,reflect:!0})],Bo.prototype,`disabled`,void 0),K([W({type:Boolean,reflect:!0,attribute:`fullwidth`})],Bo.prototype,`fullwidth`,void 0),K([W({type:String,reflect:!0,attribute:`upload-strategy`})],Bo.prototype,`uploadStrategy`,void 0),K([W({type:String,reflect:!0,attribute:`item-renderer`})],Bo.prototype,`itemRenderer`,void 0),K([W({type:String})],Bo.prototype,`accept`,void 0),K([W({converter:Br.csvToArray,attribute:`allowed-formats`})],Bo.prototype,`allowedFormats`,void 0),K([W({type:String,attribute:`format-error-message`})],Bo.prototype,`formatErrorMessage`,void 0),K([W({attribute:`max-file-size`})],Bo.prototype,`maxFileSize`,void 0),K([W({type:String,attribute:`size-error-message`})],Bo.prototype,`sizeErrorMessage`,void 0),K([W({attribute:!1})],Bo.prototype,`onFileValidation`,void 0),K([W({attribute:!1})],Bo.prototype,`transfers`,void 0),K([W({type:Boolean,attribute:`add-comments-enabled`})],Bo.prototype,`addCommentsEnabled`,void 0),K([W({type:Boolean,attribute:`rename-files-enabled`})],Bo.prototype,`renameFilesEnabled`,void 0),K([W({attribute:!1})],Bo.prototype,`extraOperations`,void 0),K([W({type:Boolean,reflect:!0,attribute:`enable-image-preview`})],Bo.prototype,`enableImagePreview`,void 0),K([W({type:Boolean,attribute:`has-error`})],Bo.prototype,`hasError`,void 0),K([W({type:String,attribute:`error-message`})],Bo.prototype,`errorMessage`,void 0),K([W({type:Boolean,attribute:`optional-tag`})],Bo.prototype,`optionalTag`,void 0),K([W({type:Boolean,attribute:`required-tag`})],Bo.prototype,`requiredTag`,void 0),K([W({type:Number,attribute:`truncate-tail`})],Bo.prototype,`truncateTail`,void 0),K([W({attribute:!1})],Bo.prototype,`value`,void 0),K([W({attribute:!1})],Bo.prototype,`defaultValue`,void 0),K([G()],Bo.prototype,`files`,void 0),K([G()],Bo.prototype,`isDragActive`,void 0),K([G()],Bo.prototype,`validationErrorMessage`,void 0),K([G()],Bo.prototype,`addedAnnouncement`,void 0),K([G()],Bo.prototype,`thumbnailUrls`,void 0);var Vo=`comments`,Ho=e=>{let t=new Date(e);return Number.isNaN(t.getTime())?e:`${String(t.getDate()).padStart(2,`0`)}.${String(t.getMonth()+1).padStart(2,`0`)}.${t.getFullYear()} kl. ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`},Uo=(e,t,n)=>{e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),t()),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),n())},Wo=(e,t,n)=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),n()),(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),t())},Go=e=>({id:`remove`,title:`Slett`,ariaLabel:`Slett fil`,onClick:({file:t})=>e(t.fileId)}),Ko=()=>({id:`rename`,title:`Rediger`,ariaLabel:`Rediger filnavn`,renderInlineUI:e=>{let t=e.getAttribute(`targetFilename`)||e.file.attributes?.targetFilename||e.file.file?.name||``,n=`pkt-fileupload-rename-${e.file.fileId}`,r=()=>{let t=document.getElementById(n)?.value?.trim();t&&e.setAttribute(`targetFilename`,t),e.close()};return j`
1537
+ </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})],Oo.prototype,`ariaLabel`,void 0),K([W({type:String,reflect:!0})],Oo.prototype,`ariaLabelledby`,void 0),K([W({type:String,reflect:!0})],Oo.prototype,`ariaValueText`,void 0),K([W({type:String})],Oo.prototype,`ariaLive`,void 0),K([W({type:String,reflect:!0})],Oo.prototype,`id`,void 0),K([W({type:String})],Oo.prototype,`role`,void 0),K([W({type:String})],Oo.prototype,`skin`,void 0),K([W({type:String})],Oo.prototype,`statusPlacement`,void 0),K([W({type:String})],Oo.prototype,`statusType`,void 0),K([W({type:String,reflect:!0})],Oo.prototype,`title`,void 0),K([W({type:String})],Oo.prototype,`titlePosition`,void 0),K([W({type:Number,reflect:!0})],Oo.prototype,`valueCurrent`,void 0),K([W({type:Number})],Oo.prototype,`valueMax`,void 0),K([W({type:Number})],Oo.prototype,`valueMin`,void 0),K([G()],Oo.prototype,`labelWidth`,void 0),K([G()],Oo.prototype,`progressbarId`,void 0),K([G()],Oo.prototype,`computedAriaLabelledby`,void 0),K([G()],Oo.prototype,`computedAriaValueText`,void 0);try{U(`pkt-progressbar`)(Oo)}catch{console.warn(`Forsøker å definere <pkt-progressbar>, men den er allerede definert`)}var ko={dropZoneDragMultiple:`Dra filer hit for å laste dem opp eller`,dropZoneDragSingle:`Dra en fil hit for å laste den opp eller`,dropZoneDragMultipleThumbnail:`Dra bilder hit for å laste dem opp eller`,dropZoneDragSingleThumbnail:`Dra et bilde hit for å laste det opp eller`,dropZoneDragActiveMultiple:`Slipp filene her`,dropZoneDragActiveSingle:`Slipp filen her`,dropZoneDragActiveMultipleThumbnail:`Slipp bildene her`,dropZoneDragActiveSingleThumbnail:`Slipp bildet her`,dropZoneOpenFileDialogMultiple:`velg filer`,dropZoneOpenFileDialogSingle:`velg en fil`,dropZoneOpenFileDialogMultipleThumbnail:`velg fra kamerarull`,dropZoneOpenFileDialogSingleThumbnail:`velg fra kamerarull`,supportedFormatsPrefix:`Format:`,invalidFormatDefault:e=>`Ugyldig filtype. Tillatte formater: ${e}`,sizeTooLargeDefault:e=>`Filen er for stor. Maks størrelse er ${e}.`,requiredMissing:`Du må laste opp minst én fil.`,genericValidationRejection:`Filen ble avvist av validering.`,unknownFilename:`Ukjent fil`,fileLabel:e=>e===1?`fil`:`filer`,srFileAdded:e=>`Filen «${e}» er lagt til`,srFilesAdded:e=>`${e} filer er lagt til`,srFilesUploadedOfTotal:(e,t,n)=>`${e} av ${t} ${n} lastet opp`,srFilesFailedOfTotal:(e,t,n)=>`Feil ved opplasting: ${e} av ${t} ${n} feilet`};function Ao(e){if(e==null||e===``)return;if(typeof e==`number`)return Number.isFinite(e)&&e>0?e:void 0;let t=String(e).trim(),n=Number(t);if(!Number.isNaN(n)&&n>0)return n;let r=t.match(/^(\d+(?:\.\d+)?)\s*(B|KB|MB|GB)$/i);if(!r){console.warn(`PktFileUpload: Invalid maxFileSize format "${t}". Use format like "5MB", "500KB", "1GB", or bytes.`);return}let i=parseFloat(r[1]);switch(r[2].toUpperCase()){case`B`:return i;case`KB`:return i*1024;case`MB`:return i*1024*1024;case`GB`:return i*1024*1024*1024;default:return}}function jo(e){return e<1024?`${Math.round(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`}function Mo(e){return Array.isArray(e)?e.map(e=>String(e).trim().toLowerCase()).filter(Boolean):[]}function No(e){return e?e.split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean):[]}function Po(e,t,n){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}function Fo(e,t){let n=Mo(t);if(n.length===0)return!0;let r=e.name.split(`.`).pop()?.toLowerCase()??``,i=e.type.toLowerCase();return n.some(e=>Po(e,r,i))}function Io(e,t){let n=(e??``).trim();if(n)return n;let r=Mo(t);return r.length===0?``:r.map(e=>e.includes(`/`)||e.startsWith(`.`)?e:`.${e}`).join(`, `)}function Lo(e){return e.includes(`/`)?e:e.replace(/^\./,``).toUpperCase()}function Ro(e,t){let n=Mo(e);if(n.length>0)return n.map(Lo).join(`, `);let r=No(t);return r.length>0?r.map(Lo).join(`, `):``}function zo(e,t,n){return((e??``).trim()||t).replace(/\{(\w+)\}/g,(e,t)=>n[t]??`{${t}}`)}function Bo(e,t){let n=Mo(t.allowedFormats);if(n.length>0&&!Fo(e,n)){let e=n.join(`, `),r=`Ugyldig filtype. Tillatte formater: ${e}`;return zo(t.formatErrorMessage,r,{formats:e})}let r=Ao(t.maxFileSize);if(r!==void 0&&e.size>r){let e=jo(r),n=`Filen er for stor. Maks størrelse er ${e}.`;return zo(t.sizeErrorMessage,n,{maxSize:e})}if(t.onFileValidation){let n=t.onFileValidation(e);if(n)return n}return null}function Vo(e){let t=e.file;if(t?.type?.startsWith(`image/`))return!0;let n=e.attributes?.targetFilename||t?.name||``;return/\.(jpe?g|png|gif|webp|heic|heif|bmp|svg)$/i.test(n)}function Ho(e){return typeof e==`number`?`in-progress`:e===`error`?`error`:`idle`}function Uo(e,t,n){let r={"in-progress":0,error:1,idle:2};return e.map(e=>{let r=t?.find(t=>t.fileId===e.fileId);return{...e,progress:r?.progress??(n===`form`?`done`:`queued`),errorMessage:r?.errorMessage,showProgress:r?.showProgress,lastProgress:r?.lastProgress}}).sort((e,t)=>r[Ho(e.progress)]-r[Ho(t.progress)])}function Wo(e){if(!e)return[];let t=[`a[href]:not([tabindex="-1"])`,`button:not([disabled]):not([tabindex="-1"])`,`input:not([disabled]):not([type="hidden"]):not([tabindex="-1"])`,`select:not([disabled]):not([tabindex="-1"])`,`textarea:not([disabled]):not([tabindex="-1"])`,`[tabindex]:not([tabindex="-1"])`].join(`, `);return Array.from(e.querySelectorAll(t)).filter(e=>!e.hasAttribute(`inert`))}function Go(e,t){if(e.key!==`Tab`)return!1;let n=Wo(t);if(n.length===0)return e.preventDefault(),!0;let r=n[0],i=n[n.length-1],a=(t?.ownerDocument??document).activeElement,o=!!a&&n.includes(a);return e.shiftKey?!o||a===r?(e.preventDefault(),i.focus(),!0):!1:!o||a===i?(e.preventDefault(),r.focus(),!0):!1}function Ko(e,t){return!t||t<=0||e.length<=t+3?null:{head:e.slice(0,e.length-t),tail:e.slice(-t)}}function qo(e,t,n){return n<=0?0:t===`prev`?e<=0?n-1:e-1:e>=n-1?0:e+1}function Jo(e,t){let n=e.length;if(n===0||!t||t.length===0)return{totalCount:n,uploadedCount:0,failedCount:0};let r=0,i=0;for(let n of e){let e=t.find(e=>e.fileId===n.fileId);e?.progress===`done`?r++:e?.progress===`error`&&i++}return{totalCount:n,uploadedCount:r,failedCount:i}}function Yo(e,t=ko.unknownFilename){return e.attributes?.targetFilename||e.file?.name||t}var Xo=class extends Ye{constructor(...e){super(...e),this.id=`pkt-fileupload-${bi()}`,this.name=`files`,this.label=``,this.helptext=``,this.required=!1,this.multiple=!1,this.disabled=!1,this.fullwidth=!1,this.uploadStrategy=`form`,this.itemRenderer=`filename`,this.accept=``,this.allowedFormats=[],this.formatErrorMessage=``,this.sizeErrorMessage=``,this.transfers=[],this.addCommentsEnabled=!1,this.renameFilesEnabled=!1,this.extraOperations=[],this.enableImagePreview=!1,this.hasError=!1,this.errorMessage=``,this.optionalTag=!1,this.requiredTag=!1,this.truncateTail=4,this.files=[],this.isDragActive=!1,this.validationErrorMessage=null,this.addedAnnouncement=``,this.thumbnailUrls={},this.hasInitializedValue=!1,this.hasWarnedInvalidValueCombo=!1,this.thumbnailFileById=new Map,this.connectedForm=null,this.addedAnnouncementTimer=null,this.requiredSelectionMessage=ko.requiredMissing,this.onNativeFileChange=e=>{let t=e.target;this.addFiles(t.files?Array.from(t.files):[]),this.uploadStrategy===`custom`&&(t.value=``)},this.openFileDialog=e=>{e.preventDefault(),e.stopPropagation(),!this.disabled&&this.querySelector(`#${this.id}-input`)?.click()},this.onDropZoneClick=e=>{this.disabled||e.target.closest(`.pkt-fileupload__drop-zone__placeholder__title__open-file-dialog`)||this.querySelector(`#${this.id}-input`)?.click()},this.onDragOver=e=>{e.preventDefault(),!this.disabled&&(this.isDragActive=!0)},this.onDragLeave=()=>{this.isDragActive=!1},this.onDrop=e=>{if(e.preventDefault(),this.isDragActive=!1,this.disabled)return;let t=e.dataTransfer?.files?Array.from(e.dataTransfer.files):[];this.addFiles(t)},this.onHostFormSubmit=e=>{!this.required||this.uploadStrategy!==`custom`||this.getCurrentFiles().length>0||(this.validationErrorMessage=this.requiredSelectionMessage,e.preventDefault())}}get isControlled(){return this.value!==void 0}get hasEffectiveError(){return!!this.validationErrorMessage||this.hasError||!!this.errorMessage.trim()}get effectiveErrorMessage(){return this.validationErrorMessage??this.errorMessage??``}get hasValidationError(){return!!this.validationErrorMessage}firstUpdated(e){super.firstUpdated?.(e),this.hasInitializedValue||=(this.files=this.value??this.defaultValue??[],this.syncThumbnailUrls(this.files),!0),this.value!==void 0&&this.defaultValue!==void 0&&this.warnInvalidValueCombo()}willUpdate(e){super.willUpdate(e),this.hasInitializedValue&&this.isControlled&&(e.has(`value`)||e.has(`itemRenderer`)||e.has(`enableImagePreview`))&&(this.files=this.value??[],this.syncThumbnailUrls(this.files))}updated(e){super.updated(e),(e.has(`uploadStrategy`)||e.has(`required`)||e.has(`value`))&&this.syncFormSubmitListener(),this.uploadStrategy===`form`&&(e.has(`value`)||e.has(`files`)||e.has(`uploadStrategy`))&&this.syncNativeInputFiles()}syncNativeInputFiles(){let e=this.querySelector(`#${this.id}-input`);if(!(!e||typeof DataTransfer>`u`))try{let t=new DataTransfer;for(let e of this.getCurrentFiles())e.file&&t.items.add(e.file);e.files=t.files}catch{}}warnInvalidValueCombo(){this.hasWarnedInvalidValueCombo||=(console.warn(`PktFileUpload: Både value og defaultValue er angitt. Komponenten kan være enten kontrollert eller ukontrollert, ikke begge. value vil bli prioritert.`),!0)}disconnectedCallback(){this.teardownFormSubmitListener(),this.addedAnnouncementTimer&&=(clearTimeout(this.addedAnnouncementTimer),null),super.disconnectedCallback(),this.revokeAllThumbnailUrls()}setAddedAnnouncement(e){this.addedAnnouncement=e,this.addedAnnouncementTimer&&clearTimeout(this.addedAnnouncementTimer),this.addedAnnouncementTimer=setTimeout(()=>{this.addedAnnouncement=``,this.addedAnnouncementTimer=null},1500)}connectedCallback(){super.connectedCallback(),this.syncFormSubmitListener()}addFiles(e){if(e.length===0)return;let t=this.multiple?e:[e[0]];for(let e of t){let t=this.validateFile(e);if(t){this.validationErrorMessage=t;return}}this.validationErrorMessage=null;let n=t.map(e=>({fileId:bi(),file:e,attributes:{targetFilename:e.name}}));this.setAddedAnnouncement(n.length===1?ko.srFileAdded(n[0].attributes.targetFilename):ko.srFilesAdded(n.length));let r=this.getCurrentFiles(),i=this.multiple?[...r,...n]:[n[0]];this.commitFiles(i,`add`,n.map(e=>e.fileId)),this.uploadStrategy===`custom`&&n.forEach(e=>{this.dispatchEvent(new CustomEvent(`file-upload-requested`,{detail:{fileId:e.fileId,file:e.file,attributes:e.attributes},bubbles:!0,composed:!0}))})}getCurrentFiles(){return this.isControlled?this.value??[]:this.files}cancelTransfer(e){if(this.disabled)return;let t=this.getCurrentFiles().find(t=>t.fileId===e);t&&(this.removeFileItem(e),this.dispatchEvent(new CustomEvent(`transfer-cancelled`,{detail:{fileId:t.fileId,file:t.file,attributes:t.attributes},bubbles:!0,composed:!0})))}removeFileItem(e){if(this.disabled)return;let t=this.getCurrentFiles(),n=t.filter(t=>t.fileId!==e);n.length!==t.length&&this.commitFiles(n,`remove`,[e])}updateFileItem(e,t){let n=this.getCurrentFiles().map(n=>n.fileId===e?{...n,...t}:n);this.commitFiles(n,`update`,[e])}commitFiles(e,t,n){this.isControlled||(this.files=e,this.syncThumbnailUrls(e)),this.validationErrorMessage===this.requiredSelectionMessage&&e.length>0&&(this.validationErrorMessage=null),this.dispatchEvent(new CustomEvent(`files-changed`,{detail:{files:e,reason:t,changedFileIds:n},bubbles:!0,composed:!0}))}getThumbnailUrl(e){return this.thumbnailUrls[e.fileId]}getTransferProgress(e){let t=this.transfers.find(t=>t.fileId===e);return t?t.progress:this.uploadStrategy===`form`?`done`:`queued`}getTransferForFile(e){return this.transfers.find(t=>t.fileId===e)}isImageFile(e){return Vo(e)}formatFileSize(e){return jo(e)}getResolvedAcceptValue(){return Io(this.accept,this.allowedFormats)}getSupportedFormatsText(){return Ro(this.allowedFormats,this.accept)}getSortedFilesAndTransfers(){return Uo(this.getCurrentFiles(),this.transfers,this.uploadStrategy)}validateFile(e){let t=Bo(e,{allowedFormats:this.allowedFormats,maxFileSize:this.maxFileSize,formatErrorMessage:this.formatErrorMessage,sizeErrorMessage:this.sizeErrorMessage,onFileValidation:this.onFileValidation});if(t)return t;let n={file:e,errorMessage:null},r=new CustomEvent(`file-validate`,{detail:n,bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(r),n.errorMessage?n.errorMessage:r.defaultPrevented?ko.genericValidationRejection:null}syncThumbnailUrls(e){if(!(typeof URL<`u`&&typeof URL.createObjectURL==`function`&&typeof URL.revokeObjectURL==`function`)){this.thumbnailUrls={},this.thumbnailFileById.clear();return}let t=new Set(e.map(e=>e.fileId)),n={};for(let[e,n]of Object.entries(this.thumbnailUrls))t.has(e)||(URL.revokeObjectURL(n),this.thumbnailFileById.delete(e));for(let t of e){let e=this.thumbnailUrls[t.fileId],r=this.thumbnailFileById.get(t.fileId);if(!t.file||!this.isImageFile(t)){e&&(URL.revokeObjectURL(e),this.thumbnailFileById.delete(t.fileId));continue}if(e&&r===t.file){n[t.fileId]=e;continue}e&&r!==t.file&&URL.revokeObjectURL(e);let i=URL.createObjectURL(t.file);this.thumbnailFileById.set(t.fileId,t.file),n[t.fileId]=i}this.thumbnailUrls=n}revokeAllThumbnailUrls(){if(typeof URL>`u`||typeof URL.revokeObjectURL!=`function`){this.thumbnailUrls={},this.thumbnailFileById.clear();return}Object.values(this.thumbnailUrls).forEach(e=>URL.revokeObjectURL(e)),this.thumbnailUrls={},this.thumbnailFileById.clear()}getSrUploadedMessage(){if(this.addedAnnouncement)return this.addedAnnouncement;let{totalCount:e,uploadedCount:t}=Jo(this.getCurrentFiles(),this.transfers);return e===0||t===0?``:ko.srFilesUploadedOfTotal(t,e,ko.fileLabel(e))}getSrErrorsMessage(){let{totalCount:e,failedCount:t}=Jo(this.getCurrentFiles(),this.transfers);return e===0||t===0?``:ko.srFilesFailedOfTotal(t,e,ko.fileLabel(e))}syncFormSubmitListener(){let e=this.closest(`form`);this.connectedForm!==e&&(this.teardownFormSubmitListener(),this.connectedForm=e,this.connectedForm&&this.connectedForm.addEventListener(`submit`,this.onHostFormSubmit))}teardownFormSubmitListener(){this.connectedForm&&=(this.connectedForm.removeEventListener(`submit`,this.onHostFormSubmit),null)}};K([W({type:String})],Xo.prototype,`id`,void 0),K([W({type:String})],Xo.prototype,`name`,void 0),K([W({type:String})],Xo.prototype,`label`,void 0),K([W({type:String})],Xo.prototype,`helptext`,void 0),K([W({type:Boolean,reflect:!0})],Xo.prototype,`required`,void 0),K([W({type:Boolean,reflect:!0})],Xo.prototype,`multiple`,void 0),K([W({type:Boolean,reflect:!0})],Xo.prototype,`disabled`,void 0),K([W({type:Boolean,reflect:!0,attribute:`fullwidth`})],Xo.prototype,`fullwidth`,void 0),K([W({type:String,reflect:!0,attribute:`upload-strategy`})],Xo.prototype,`uploadStrategy`,void 0),K([W({type:String,reflect:!0,attribute:`item-renderer`})],Xo.prototype,`itemRenderer`,void 0),K([W({type:String})],Xo.prototype,`accept`,void 0),K([W({converter:Br.csvToArray,attribute:`allowed-formats`})],Xo.prototype,`allowedFormats`,void 0),K([W({type:String,attribute:`format-error-message`})],Xo.prototype,`formatErrorMessage`,void 0),K([W({attribute:`max-file-size`})],Xo.prototype,`maxFileSize`,void 0),K([W({type:String,attribute:`size-error-message`})],Xo.prototype,`sizeErrorMessage`,void 0),K([W({attribute:!1})],Xo.prototype,`onFileValidation`,void 0),K([W({attribute:!1})],Xo.prototype,`transfers`,void 0),K([W({type:Boolean,attribute:`add-comments-enabled`})],Xo.prototype,`addCommentsEnabled`,void 0),K([W({type:Boolean,attribute:`rename-files-enabled`})],Xo.prototype,`renameFilesEnabled`,void 0),K([W({attribute:!1})],Xo.prototype,`extraOperations`,void 0),K([W({type:Boolean,reflect:!0,attribute:`enable-image-preview`})],Xo.prototype,`enableImagePreview`,void 0),K([W({type:Boolean,attribute:`has-error`})],Xo.prototype,`hasError`,void 0),K([W({type:String,attribute:`error-message`})],Xo.prototype,`errorMessage`,void 0),K([W({type:Boolean,attribute:`optional-tag`})],Xo.prototype,`optionalTag`,void 0),K([W({type:Boolean,attribute:`required-tag`})],Xo.prototype,`requiredTag`,void 0),K([W({type:Number,attribute:`truncate-tail`})],Xo.prototype,`truncateTail`,void 0),K([W({attribute:!1})],Xo.prototype,`value`,void 0),K([W({attribute:!1})],Xo.prototype,`defaultValue`,void 0),K([G()],Xo.prototype,`files`,void 0),K([G()],Xo.prototype,`isDragActive`,void 0),K([G()],Xo.prototype,`validationErrorMessage`,void 0),K([G()],Xo.prototype,`addedAnnouncement`,void 0),K([G()],Xo.prototype,`thumbnailUrls`,void 0);var Zo=`comments`,Qo=e=>{let t=new Date(e);return Number.isNaN(t.getTime())?e:`${String(t.getDate()).padStart(2,`0`)}.${String(t.getMonth()+1).padStart(2,`0`)}.${t.getFullYear()} kl. ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`},$o=(e,t,n)=>{e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),t()),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),n())},es=(e,t,n)=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),n()),(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),t())},ts=e=>({id:`remove`,title:`Slett`,ariaLabel:`Slett fil`,onClick:({file:t})=>e(t.fileId)}),ns=()=>({id:`rename`,title:`Rediger`,ariaLabel:`Rediger filnavn`,renderInlineUI:e=>{let t=e.getAttribute(`targetFilename`)||e.file.attributes?.targetFilename||e.file.file?.name||``,n=`pkt-fileupload-rename-${e.file.fileId}`,r=()=>{let t=document.getElementById(n)?.value?.trim();t&&e.setAttribute(`targetFilename`,t),e.close()};return j`
1400
1538
  <label for=${n} class="pkt-sr-only">Endre filnavn</label>
1401
1539
  <input
1402
1540
  id=${n}
@@ -1404,7 +1542,7 @@
1404
1542
  class="pkt-fileupload__queue-display__item__rename-input"
1405
1543
  ?disabled=${e.disabled}
1406
1544
  .value=${t}
1407
- @keydown=${t=>Uo(t,r,e.close)}
1545
+ @keydown=${t=>$o(t,r,e.close)}
1408
1546
  />
1409
1547
  <button
1410
1548
  type="button"
@@ -1426,7 +1564,7 @@
1426
1564
  type="hidden"
1427
1565
  name=${`${e.inputName}-targetFilename`}
1428
1566
  value=${t}
1429
- />`}}),qo=()=>({id:`comment`,title:e=>(e.attributes?.[Vo]??[]).length>0?``:`Legg til kommentar`,ariaLabel:`Legg til kommentar`,renderExtendedUI:e=>{let t=(e.getAttribute(Vo)??[])[0],n=`pkt-fileupload-comment-${e.file.fileId}`,r=()=>{let t=document.getElementById(n)?.value?.trim();t&&e.setAttribute(Vo,[{text:t,timestamp:new Date().toISOString()}]),e.close()};return j`
1567
+ />`}}),rs=()=>({id:`comment`,title:e=>(e.attributes?.[Zo]??[]).length>0?``:`Legg til kommentar`,ariaLabel:`Legg til kommentar`,renderExtendedUI:e=>{let t=(e.getAttribute(Zo)??[])[0],n=`pkt-fileupload-comment-${e.file.fileId}`,r=()=>{let t=document.getElementById(n)?.value?.trim();t&&e.setAttribute(Zo,[{text:t,timestamp:new Date().toISOString()}]),e.close()};return j`
1430
1568
  <label for=${n} class="pkt-fileupload__queue-display__item__comment-label">
1431
1569
  ${t?`Rediger kommentar`:`Legg til kommentar`}
1432
1570
  </label>
@@ -1437,7 +1575,7 @@
1437
1575
  .value=${t?.text??``}
1438
1576
  rows="2"
1439
1577
  placeholder="Skriv inn kommentar"
1440
- @keydown=${t=>Wo(t,r,e.close)}
1578
+ @keydown=${t=>es(t,r,e.close)}
1441
1579
  ></textarea>
1442
1580
  <button
1443
1581
  type="button"
@@ -1455,7 +1593,7 @@
1455
1593
  >
1456
1594
  Avbryt
1457
1595
  </button>
1458
- `},renderContent:e=>{if(e.isActive)return null;let t=e.getAttribute(Vo)??[];if(t.length===0)return null;let n=t[0];return j`
1596
+ `},renderContent:e=>{if(e.isActive)return null;let t=e.getAttribute(Zo)??[];if(t.length===0)return null;let n=t[0];return j`
1459
1597
  <div class="pkt-fileupload__queue-display__item__comments">
1460
1598
  <div class="pkt-fileupload__queue-display__item__comment">
1461
1599
  <div class="pkt-fileupload__queue-display__item__comment__content">
@@ -1463,7 +1601,7 @@
1463
1601
  ${n.text}
1464
1602
  </span>
1465
1603
  <time class="pkt-fileupload__queue-display__item__comment__time">
1466
- ${Ho(n.timestamp)}
1604
+ ${Qo(n.timestamp)}
1467
1605
  </time>
1468
1606
  </div>
1469
1607
  <div class="pkt-fileupload__queue-display__item__comment__actions">
@@ -1481,18 +1619,18 @@
1481
1619
  class="pkt-fileupload__queue-display__item__comment__action"
1482
1620
  aria-label="Slett kommentar"
1483
1621
  ?disabled=${e.disabled}
1484
- @click=${()=>e.setAttribute(Vo,void 0)}
1622
+ @click=${()=>e.setAttribute(Zo,void 0)}
1485
1623
  >
1486
1624
  <pkt-icon name="trash-can"></pkt-icon>
1487
1625
  </button>
1488
1626
  </div>
1489
1627
  </div>
1490
1628
  </div>
1491
- `},renderHidden:e=>{let t=e.getAttribute(Vo);return j`<input
1629
+ `},renderHidden:e=>{let t=e.getAttribute(Zo);return j`<input
1492
1630
  type="hidden"
1493
1631
  name=${`${e.inputName}-comments`}
1494
1632
  value=${t?JSON.stringify(t):``}
1495
- />`}}),Jo=(e,t)=>{let n=Io(e,t);return n?j`<span
1633
+ />`}}),is=(e,t)=>{let n=Ko(e,t);return n?j`<span
1496
1634
  class="pkt-fileupload__queue-display__item__title__head"
1497
1635
  data-pkt-truncate-part="first"
1498
1636
  >${n.head}</span
@@ -1500,19 +1638,19 @@
1500
1638
  class="pkt-fileupload__queue-display__item__title__tail"
1501
1639
  data-pkt-truncate-part="tail"
1502
1640
  >${n.tail}</span
1503
- >`:j`<span data-pkt-truncate-part="first">${e}</span>`},Yo=(e,t,n)=>j`
1641
+ >`:j`<span data-pkt-truncate-part="first">${e}</span>`},as=(e,t,n)=>j`
1504
1642
  <p class="pkt-fileupload__queue-display__item__title">
1505
- ${Jo(e,n)}${t?j`<span class="pkt-fileupload__queue-display__item__filesize"> (${t})</span>`:null}
1643
+ ${is(e,n)}${t?j`<span class="pkt-fileupload__queue-display__item__filesize"> (${t})</span>`:null}
1506
1644
  </p>
1507
- `,Xo=e=>typeof e==`number`?`in-progress`:e===`error`?`error`:`idle`,Zo=e=>j`<span class="pkt-fileupload__queue-display__item__loading-text" aria-label="Laster opp fil"
1645
+ `,os=e=>typeof e==`number`?`in-progress`:e===`error`?`error`:`idle`,ss=e=>j`<span class="pkt-fileupload__queue-display__item__loading-text" aria-label="Laster opp fil"
1508
1646
  >${e??`Laster opp...`}</span
1509
- >`,Qo=({operationId:e,file:t,inputName:n,disabled:r,isActive:i,onActivateOperation:a,onCloseOperation:o,getFileAttribute:s,setFileAttribute:c})=>({file:t,inputName:n,disabled:r,isActive:i,activate:()=>a(t.fileId,e),close:()=>o(t.fileId),getAttribute:e=>s(t.fileId,e),setAttribute:(e,n)=>c(t.fileId,e,n)}),$o=({file:e,fileSize:t,disabled:n,transferProgress:r,transferShowProgress:i,loadingText:a,truncateTail:o,onCancel:s,iconName:c=`document-text`})=>{let l=zo(e),u=i??r!==0;return j`
1647
+ >`,cs=({operationId:e,file:t,inputName:n,disabled:r,isActive:i,onActivateOperation:a,onCloseOperation:o,getFileAttribute:s,setFileAttribute:c})=>({file:t,inputName:n,disabled:r,isActive:i,activate:()=>a(t.fileId,e),close:()=>o(t.fileId),getAttribute:e=>s(t.fileId,e),setAttribute:(e,n)=>c(t.fileId,e,n)}),ls=({file:e,fileSize:t,disabled:n,transferProgress:r,transferShowProgress:i,loadingText:a,truncateTail:o,onCancel:s,iconName:c=`document-text`})=>{let l=Yo(e),u=i??r!==0;return j`
1510
1648
  <pkt-icon
1511
1649
  name=${c}
1512
1650
  class="pkt-fileupload__queue-display__item__icon pkt-icon--medium"
1513
1651
  aria-hidden="true"
1514
1652
  ></pkt-icon>
1515
- ${Yo(l,t,o)}
1653
+ ${as(l,t,o)}
1516
1654
  <button
1517
1655
  type="button"
1518
1656
  class="pkt-fileupload__queue-display__item__cancel-button"
@@ -1533,14 +1671,14 @@
1533
1671
  <span class="pkt-fileupload__queue-display__item__percentage" aria-hidden="true"
1534
1672
  >${Math.round(r*100)}%</span
1535
1673
  >
1536
- `:Zo(a)}
1537
- `},es=({file:e,fileSize:t,disabled:n,transferShowProgress:r,transferLastProgress:i,transferErrorMessage:a,truncateTail:o,onCancel:s})=>{let c=zo(e),l=!!r,u=Math.round((i??1)*100);return j`
1674
+ `:ss(a)}
1675
+ `},us=({file:e,fileSize:t,disabled:n,transferShowProgress:r,transferLastProgress:i,transferErrorMessage:a,truncateTail:o,onCancel:s})=>{let c=Yo(e),l=!!r,u=Math.round((i??1)*100);return j`
1538
1676
  <pkt-icon
1539
1677
  name="alert-error"
1540
1678
  class="pkt-fileupload__queue-display__item__icon pkt-icon--medium"
1541
1679
  aria-hidden="true"
1542
1680
  ></pkt-icon>
1543
- ${Yo(c,t,o)}
1681
+ ${as(c,t,o)}
1544
1682
  <button
1545
1683
  type="button"
1546
1684
  class="pkt-fileupload__queue-display__item__cancel-button"
@@ -1562,7 +1700,7 @@
1562
1700
  ${a?j`<span class="pkt-fileupload__queue-display__item__error-message"
1563
1701
  >${a}</span
1564
1702
  >`:null}
1565
- `},ts=({file:e,disabled:t,inputName:n,operations:r,activeOperationId:i,onActivateOperation:a,onCloseOperation:o,getFileAttribute:s,setFileAttribute:c})=>{let l=r.find(e=>e.id===i);if(l?.renderInlineUI||l?.renderExtendedUI)return null;let u=r.map(r=>{let l=Qo({operationId:r.id,file:e,inputName:n,disabled:t,isActive:r.id===i,onActivateOperation:a,onCloseOperation:o,getFileAttribute:s,setFileAttribute:c}),u=typeof r.title==`function`?r.title(e):r.title;return u?j`<button
1703
+ `},ds=({file:e,disabled:t,inputName:n,operations:r,activeOperationId:i,onActivateOperation:a,onCloseOperation:o,getFileAttribute:s,setFileAttribute:c})=>{let l=r.find(e=>e.id===i);if(l?.renderInlineUI||l?.renderExtendedUI)return null;let u=r.map(r=>{let l=cs({operationId:r.id,file:e,inputName:n,disabled:t,isActive:r.id===i,onActivateOperation:a,onCloseOperation:o,getFileAttribute:s,setFileAttribute:c}),u=typeof r.title==`function`?r.title(e):r.title;return u?j`<button
1566
1704
  type="button"
1567
1705
  class="pkt-fileupload__queue-display__item__operation"
1568
1706
  aria-label=${J(typeof r.ariaLabel==`function`?r.ariaLabel(e):r.ariaLabel)}
@@ -1570,18 +1708,18 @@
1570
1708
  @click=${()=>{(r.renderInlineUI||r.renderExtendedUI)&&l.activate(),r.onClick?.(l)}}
1571
1709
  >
1572
1710
  ${u}
1573
- </button>`:null}).filter(Boolean);return u.length===0?null:j`<div class="pkt-fileupload__queue-display__item__actions">${u}</div>`},ns=({file:e,disabled:t,inputName:n,operations:r,activeOperationId:i,onActivateOperation:a,onCloseOperation:o,getFileAttribute:s,setFileAttribute:c})=>r.map(r=>{if(!r.renderContent)return null;let l=Qo({operationId:r.id,file:e,inputName:n,disabled:t,isActive:r.id===i,onActivateOperation:a,onCloseOperation:o,getFileAttribute:s,setFileAttribute:c}),u=r.renderContent(l);return u==null?null:j`<div class="pkt-fileupload__queue-display__item__operation-content">
1711
+ </button>`:null}).filter(Boolean);return u.length===0?null:j`<div class="pkt-fileupload__queue-display__item__actions">${u}</div>`},fs=({file:e,disabled:t,inputName:n,operations:r,activeOperationId:i,onActivateOperation:a,onCloseOperation:o,getFileAttribute:s,setFileAttribute:c})=>r.map(r=>{if(!r.renderContent)return null;let l=cs({operationId:r.id,file:e,inputName:n,disabled:t,isActive:r.id===i,onActivateOperation:a,onCloseOperation:o,getFileAttribute:s,setFileAttribute:c}),u=r.renderContent(l);return u==null?null:j`<div class="pkt-fileupload__queue-display__item__operation-content">
1574
1712
  ${u}
1575
- </div>`}),rs=({file:e,disabled:t,inputName:n,operations:r,activeOperationId:i,onActivateOperation:a,onCloseOperation:o,getFileAttribute:s,setFileAttribute:c})=>{if(!i)return null;let l=r.find(e=>e.id===i);if(!l?.renderExtendedUI)return null;let u=Qo({operationId:l.id,file:e,inputName:n,disabled:t,isActive:!0,onActivateOperation:a,onCloseOperation:o,getFileAttribute:s,setFileAttribute:c});return j`<div class="pkt-fileupload__queue-display__item__expanded-operation-ui">
1713
+ </div>`}),ps=({file:e,disabled:t,inputName:n,operations:r,activeOperationId:i,onActivateOperation:a,onCloseOperation:o,getFileAttribute:s,setFileAttribute:c})=>{if(!i)return null;let l=r.find(e=>e.id===i);if(!l?.renderExtendedUI)return null;let u=cs({operationId:l.id,file:e,inputName:n,disabled:t,isActive:!0,onActivateOperation:a,onCloseOperation:o,getFileAttribute:s,setFileAttribute:c});return j`<div class="pkt-fileupload__queue-display__item__expanded-operation-ui">
1576
1714
  ${l.renderExtendedUI(u)}
1577
- </div>`},is=({file:e,disabled:t,inputName:n,operations:r,activeOperationId:i,onActivateOperation:a,onCloseOperation:o,getFileAttribute:s,setFileAttribute:c})=>r.map(r=>{if(!r.renderHidden)return null;let l=Qo({operationId:r.id,file:e,inputName:n,disabled:t,isActive:r.id===i,onActivateOperation:a,onCloseOperation:o,getFileAttribute:s,setFileAttribute:c});return r.renderHidden(l)}),as=(e,t,n)=>j`
1715
+ </div>`},ms=({file:e,disabled:t,inputName:n,operations:r,activeOperationId:i,onActivateOperation:a,onCloseOperation:o,getFileAttribute:s,setFileAttribute:c})=>r.map(r=>{if(!r.renderHidden)return null;let l=cs({operationId:r.id,file:e,inputName:n,disabled:t,isActive:r.id===i,onActivateOperation:a,onCloseOperation:o,getFileAttribute:s,setFileAttribute:c});return r.renderHidden(l)}),hs=(e,t,n)=>j`
1578
1716
  <pkt-icon
1579
1717
  name="document-text"
1580
1718
  class="pkt-fileupload__queue-display__item__icon pkt-icon--medium"
1581
1719
  aria-hidden="true"
1582
1720
  ></pkt-icon>
1583
- ${Yo(zo(e),t,n)}
1584
- `,os=({file:e,thumbnailUrl:t,previewEnabled:n,canOpenPreview:r,truncateTail:i,onOpenPreview:a,onThumbnailImageError:o})=>{let s=zo(e),c=!!t,l=!!n&&!!r,u=l&&!!a;return j`
1721
+ ${as(Yo(e),t,n)}
1722
+ `,gs=({file:e,thumbnailUrl:t,previewEnabled:n,canOpenPreview:r,truncateTail:i,onOpenPreview:a,onThumbnailImageError:o})=>{let s=Yo(e),c=!!t,l=!!n&&!!r,u=l&&!!a;return j`
1585
1723
  <div
1586
1724
  class=${q({"pkt-fileupload__queue-display__item__thumbnail":!0,"pkt-fileupload__queue-display__item__thumbnail--fallback":!c})}
1587
1725
  >
@@ -1610,15 +1748,15 @@
1610
1748
  </span>
1611
1749
  </button>
1612
1750
  <span class="pkt-fileupload__queue-display__item__thumbnail__title"
1613
- >${Jo(s,i)}</span
1751
+ >${is(s,i)}</span
1614
1752
  >
1615
1753
  </div>
1616
- `},ss=({file:e,inputName:t,disabled:n,fileSize:r,operations:i,activeOperationId:a,onActivateOperation:o,onCloseOperation:s,getFileAttribute:c,setFileAttribute:l,transferProgress:u,transferErrorMessage:d,transferShowProgress:f,transferLastProgress:p,loadingText:m,truncateTail:h,onCancel:g})=>{let _=Xo(u),v=i.find(e=>e.id===a),y=v?.renderInlineUI?v.renderInlineUI(Qo({operationId:v.id,file:e,inputName:t,disabled:n,isActive:!0,onActivateOperation:o,onCloseOperation:s,getFileAttribute:c,setFileAttribute:l})):null;return j`
1754
+ `},_s=({file:e,inputName:t,disabled:n,fileSize:r,operations:i,activeOperationId:a,onActivateOperation:o,onCloseOperation:s,getFileAttribute:c,setFileAttribute:l,transferProgress:u,transferErrorMessage:d,transferShowProgress:f,transferLastProgress:p,loadingText:m,truncateTail:h,onCancel:g})=>{let _=os(u),v=i.find(e=>e.id===a),y=v?.renderInlineUI?v.renderInlineUI(cs({operationId:v.id,file:e,inputName:t,disabled:n,isActive:!0,onActivateOperation:o,onCloseOperation:s,getFileAttribute:c,setFileAttribute:l})):null;return j`
1617
1755
  <li
1618
1756
  class=${q({"pkt-fileupload__queue-display__item":!0,"pkt-fileupload__queue-display__item--in-progress":_===`in-progress`,"pkt-fileupload__queue-display__item--error":_===`error`,[`pkt-fileupload__queue-display__item--${u}`]:typeof u==`string`})}
1619
1757
  >
1620
- ${is({file:e,disabled:n,inputName:t,operations:i,activeOperationId:a,onActivateOperation:o,onCloseOperation:s,getFileAttribute:c,setFileAttribute:l})}
1621
- ${_===`in-progress`?$o({file:e,fileSize:r,disabled:n,transferProgress:u,transferShowProgress:f,loadingText:m,truncateTail:h,onCancel:g}):_===`error`?es({file:e,fileSize:r,disabled:n,transferShowProgress:f,transferLastProgress:p,transferErrorMessage:d,truncateTail:h,onCancel:g}):y?j`
1758
+ ${ms({file:e,disabled:n,inputName:t,operations:i,activeOperationId:a,onActivateOperation:o,onCloseOperation:s,getFileAttribute:c,setFileAttribute:l})}
1759
+ ${_===`in-progress`?ls({file:e,fileSize:r,disabled:n,transferProgress:u,transferShowProgress:f,loadingText:m,truncateTail:h,onCancel:g}):_===`error`?us({file:e,fileSize:r,disabled:n,transferShowProgress:f,transferLastProgress:p,transferErrorMessage:d,truncateTail:h,onCancel:g}):y?j`
1622
1760
  <pkt-icon
1623
1761
  name="document-text"
1624
1762
  class="pkt-fileupload__queue-display__item__icon pkt-icon--medium"
@@ -1627,17 +1765,17 @@
1627
1765
  <div class="pkt-fileupload__queue-display__item__inline-ui">
1628
1766
  ${y}
1629
1767
  </div>
1630
- `:as(e,r,h)}
1631
- ${_===`idle`?ts({file:e,disabled:n,inputName:t,operations:i,activeOperationId:a,onActivateOperation:o,onCloseOperation:s,getFileAttribute:c,setFileAttribute:l}):null}
1632
- ${_===`idle`?ns({file:e,disabled:n,inputName:t,operations:i,activeOperationId:a,onActivateOperation:o,onCloseOperation:s,getFileAttribute:c,setFileAttribute:l}):null}
1633
- ${_===`idle`?rs({file:e,disabled:n,inputName:t,operations:i,activeOperationId:a,onActivateOperation:o,onCloseOperation:s,getFileAttribute:c,setFileAttribute:l}):null}
1768
+ `:hs(e,r,h)}
1769
+ ${_===`idle`?ds({file:e,disabled:n,inputName:t,operations:i,activeOperationId:a,onActivateOperation:o,onCloseOperation:s,getFileAttribute:c,setFileAttribute:l}):null}
1770
+ ${_===`idle`?fs({file:e,disabled:n,inputName:t,operations:i,activeOperationId:a,onActivateOperation:o,onCloseOperation:s,getFileAttribute:c,setFileAttribute:l}):null}
1771
+ ${_===`idle`?ps({file:e,disabled:n,inputName:t,operations:i,activeOperationId:a,onActivateOperation:o,onCloseOperation:s,getFileAttribute:c,setFileAttribute:l}):null}
1634
1772
  </li>
1635
- `},cs=({file:e,inputName:t,disabled:n,fileSize:r,thumbnailUrl:i,previewEnabled:a,canOpenPreview:o,operations:s,activeOperationId:c,onActivateOperation:l,onCloseOperation:u,getFileAttribute:d,setFileAttribute:f,transferProgress:p,transferErrorMessage:m,transferShowProgress:h,transferLastProgress:g,loadingText:_,truncateTail:v,onCancel:y,onOpenPreview:b,onThumbnailImageError:x})=>{let S=Xo(p),C=s.find(e=>e.id===c),w=C?.renderInlineUI?C.renderInlineUI(Qo({operationId:C.id,file:e,inputName:t,disabled:n,isActive:!0,onActivateOperation:l,onCloseOperation:u,getFileAttribute:d,setFileAttribute:f})):null;return j`
1773
+ `},vs=({file:e,inputName:t,disabled:n,fileSize:r,thumbnailUrl:i,previewEnabled:a,canOpenPreview:o,operations:s,activeOperationId:c,onActivateOperation:l,onCloseOperation:u,getFileAttribute:d,setFileAttribute:f,transferProgress:p,transferErrorMessage:m,transferShowProgress:h,transferLastProgress:g,loadingText:_,truncateTail:v,onCancel:y,onOpenPreview:b,onThumbnailImageError:x})=>{let S=os(p),C=s.find(e=>e.id===c),w=C?.renderInlineUI?C.renderInlineUI(cs({operationId:C.id,file:e,inputName:t,disabled:n,isActive:!0,onActivateOperation:l,onCloseOperation:u,getFileAttribute:d,setFileAttribute:f})):null;return j`
1636
1774
  <li
1637
1775
  class=${q({"pkt-fileupload__queue-display__item":!0,"pkt-fileupload__queue-display__item--in-progress":S===`in-progress`,"pkt-fileupload__queue-display__item--error":S===`error`,[`pkt-fileupload__queue-display__item--${p}`]:typeof p==`string`})}
1638
1776
  >
1639
- ${is({file:e,disabled:n,inputName:t,operations:s,activeOperationId:c,onActivateOperation:l,onCloseOperation:u,getFileAttribute:d,setFileAttribute:f})}
1640
- ${S===`in-progress`?$o({file:e,fileSize:r,disabled:n,transferProgress:p,transferShowProgress:h,loadingText:_,truncateTail:v,onCancel:y,iconName:`picture`}):S===`error`?es({file:e,fileSize:r,disabled:n,transferShowProgress:h,transferLastProgress:g,transferErrorMessage:m,truncateTail:v,onCancel:y}):w?j`
1777
+ ${ms({file:e,disabled:n,inputName:t,operations:s,activeOperationId:c,onActivateOperation:l,onCloseOperation:u,getFileAttribute:d,setFileAttribute:f})}
1778
+ ${S===`in-progress`?ls({file:e,fileSize:r,disabled:n,transferProgress:p,transferShowProgress:h,loadingText:_,truncateTail:v,onCancel:y,iconName:`picture`}):S===`error`?us({file:e,fileSize:r,disabled:n,transferShowProgress:h,transferLastProgress:g,transferErrorMessage:m,truncateTail:v,onCancel:y}):w?j`
1641
1779
  <pkt-icon
1642
1780
  name="picture"
1643
1781
  class="pkt-fileupload__queue-display__item__icon pkt-icon--medium"
@@ -1646,12 +1784,12 @@
1646
1784
  <div class="pkt-fileupload__queue-display__item__inline-ui">
1647
1785
  ${w}
1648
1786
  </div>
1649
- `:os({file:e,thumbnailUrl:i,previewEnabled:a,canOpenPreview:o,truncateTail:v,onOpenPreview:b,onThumbnailImageError:x})}
1650
- ${S===`idle`?ts({file:e,disabled:n,inputName:t,operations:s,activeOperationId:c,onActivateOperation:l,onCloseOperation:u,getFileAttribute:d,setFileAttribute:f}):null}
1651
- ${S===`idle`?ns({file:e,disabled:n,inputName:t,operations:s,activeOperationId:c,onActivateOperation:l,onCloseOperation:u,getFileAttribute:d,setFileAttribute:f}):null}
1652
- ${S===`idle`?rs({file:e,disabled:n,inputName:t,operations:s,activeOperationId:c,onActivateOperation:l,onCloseOperation:u,getFileAttribute:d,setFileAttribute:f}):null}
1787
+ `:gs({file:e,thumbnailUrl:i,previewEnabled:a,canOpenPreview:o,truncateTail:v,onOpenPreview:b,onThumbnailImageError:x})}
1788
+ ${S===`idle`?ds({file:e,disabled:n,inputName:t,operations:s,activeOperationId:c,onActivateOperation:l,onCloseOperation:u,getFileAttribute:d,setFileAttribute:f}):null}
1789
+ ${S===`idle`?fs({file:e,disabled:n,inputName:t,operations:s,activeOperationId:c,onActivateOperation:l,onCloseOperation:u,getFileAttribute:d,setFileAttribute:f}):null}
1790
+ ${S===`idle`?ps({file:e,disabled:n,inputName:t,operations:s,activeOperationId:c,onActivateOperation:l,onCloseOperation:u,getFileAttribute:d,setFileAttribute:f}):null}
1653
1791
  </li>
1654
- `},ls=class extends Bo{constructor(...e){super(...e),this.activeOperationByFileId={},this.isPreviewModalOpen=!1,this.previewCurrentIndex=0,this.failedImageFileIds={},this.closePreview=()=>{this.isPreviewModalOpen=!1},this.onPreviewKeyDown=(e,t)=>{if(this.isPreviewModalOpen){if(e.key===`Tab`){Fo(e,e.currentTarget);return}switch(e.key){case`ArrowLeft`:e.preventDefault(),this.navigatePreview(`prev`,t);break;case`ArrowRight`:e.preventDefault(),this.navigatePreview(`next`,t);break;case`Escape`:e.preventDefault(),this.closePreview();break;default:break}}}}render(){let e=this.renderContent();return this.label?j`
1792
+ `},ys=class extends Xo{constructor(...e){super(...e),this.activeOperationByFileId={},this.isPreviewModalOpen=!1,this.previewCurrentIndex=0,this.failedImageFileIds={},this.closePreview=()=>{this.isPreviewModalOpen=!1},this.onPreviewKeyDown=(e,t)=>{if(this.isPreviewModalOpen){if(e.key===`Tab`){Go(e,e.currentTarget);return}switch(e.key){case`ArrowLeft`:e.preventDefault(),this.navigatePreview(`prev`,t);break;case`ArrowRight`:e.preventDefault(),this.navigatePreview(`next`,t);break;case`Escape`:e.preventDefault(),this.closePreview();break;default:break}}}}render(){let e=this.renderContent();return this.label?j`
1655
1793
  <pkt-input-wrapper
1656
1794
  .forId=${`${this.id}-input`}
1657
1795
  .label=${this.label}
@@ -1664,7 +1802,7 @@
1664
1802
  >
1665
1803
  ${e}
1666
1804
  </pkt-input-wrapper>
1667
- `:e}renderContent(){let e=this.getSortedFilesAndTransfers(),t=this.getPreviewableImages(e),n=this.getSupportedFormatsText(),r=[!this.label&&this.helptext?`${this.id}-helptext`:void 0,this.hasEffectiveError?`${this.id}-error`:void 0].filter(Boolean).join(` `)||void 0,i=this.itemRenderer===`thumbnail`?this.multiple?{dragInactive:yo.dropZoneDragMultipleThumbnail,dragActive:yo.dropZoneDragActiveMultipleThumbnail,openFileDialog:yo.dropZoneOpenFileDialogMultipleThumbnail}:{dragInactive:yo.dropZoneDragSingleThumbnail,dragActive:yo.dropZoneDragActiveSingleThumbnail,openFileDialog:yo.dropZoneOpenFileDialogSingleThumbnail}:this.multiple?{dragInactive:yo.dropZoneDragMultiple,dragActive:yo.dropZoneDragActiveMultiple,openFileDialog:yo.dropZoneOpenFileDialogMultiple}:{dragInactive:yo.dropZoneDragSingle,dragActive:yo.dropZoneDragActiveSingle,openFileDialog:yo.dropZoneOpenFileDialogSingle};return j`
1805
+ `:e}renderContent(){let e=this.getSortedFilesAndTransfers(),t=this.getPreviewableImages(e),n=this.getSupportedFormatsText(),r=[!this.label&&this.helptext?`${this.id}-helptext`:void 0,this.hasEffectiveError?`${this.id}-error`:void 0].filter(Boolean).join(` `)||void 0,i=this.itemRenderer===`thumbnail`?this.multiple?{dragInactive:ko.dropZoneDragMultipleThumbnail,dragActive:ko.dropZoneDragActiveMultipleThumbnail,openFileDialog:ko.dropZoneOpenFileDialogMultipleThumbnail}:{dragInactive:ko.dropZoneDragSingleThumbnail,dragActive:ko.dropZoneDragActiveSingleThumbnail,openFileDialog:ko.dropZoneOpenFileDialogSingleThumbnail}:this.multiple?{dragInactive:ko.dropZoneDragMultiple,dragActive:ko.dropZoneDragActiveMultiple,openFileDialog:ko.dropZoneOpenFileDialogMultiple}:{dragInactive:ko.dropZoneDragSingle,dragActive:ko.dropZoneDragActiveSingle,openFileDialog:ko.dropZoneOpenFileDialogSingle};return j`
1668
1806
  <div
1669
1807
  class=${q({"pkt-fileupload":!0,"pkt-fileupload--full-width":this.fullwidth,"pkt-fileupload--error":this.hasEffectiveError,"pkt-fileupload--disabled":this.disabled})}
1670
1808
  aria-disabled=${String(this.disabled)}
@@ -1715,7 +1853,7 @@
1715
1853
  </button>`}
1716
1854
  </p>
1717
1855
  ${n?j`<p class="pkt-fileupload__drop-zone__placeholder__formats">
1718
- ${yo.supportedFormatsPrefix} ${n}
1856
+ ${ko.supportedFormatsPrefix} ${n}
1719
1857
  </p>`:null}
1720
1858
  </div>
1721
1859
  </div>
@@ -1736,7 +1874,7 @@
1736
1874
  </ul>`:null}
1737
1875
  ${this.renderPreviewModal(t)}
1738
1876
  </div>
1739
- `}renderQueueItem(e,t){let n=typeof e.file?.size==`number`?this.formatFileSize(e.file.size):``,r=this.getQueueItemOperations();if(this.itemRenderer===`thumbnail`){let i=this.canOpenPreview(e),a=this.failedImageFileIds[e.fileId]?.thumbnail?void 0:this.getThumbnailUrl(e);return cs({file:e,inputName:this.name,disabled:this.disabled,fileSize:n,operations:r,activeOperationId:this.activeOperationByFileId[e.fileId],onActivateOperation:(e,t)=>this.activateOperation(e,t),onCloseOperation:e=>this.closeOperation(e),getFileAttribute:(e,t)=>this.getFileAttribute(e,t),setFileAttribute:(e,t,n)=>this.setFileAttribute(e,t,n),thumbnailUrl:a,previewEnabled:this.enableImagePreview,canOpenPreview:i,transferProgress:e.progress,transferErrorMessage:e.errorMessage,transferShowProgress:e.showProgress,transferLastProgress:e.lastProgress,loadingText:`Laster opp`,truncateTail:this.truncateTail,onCancel:e=>this.cancelTransfer(e),onOpenPreview:e=>this.openPreview(e,t),onThumbnailImageError:e=>this.markImageFailed(e,`thumbnail`)})}return ss({file:e,inputName:this.name,disabled:this.disabled,fileSize:n,operations:r,activeOperationId:this.activeOperationByFileId[e.fileId],onActivateOperation:(e,t)=>this.activateOperation(e,t),onCloseOperation:e=>this.closeOperation(e),getFileAttribute:(e,t)=>this.getFileAttribute(e,t),setFileAttribute:(e,t,n)=>this.setFileAttribute(e,t,n),transferProgress:e.progress,transferErrorMessage:e.errorMessage,transferShowProgress:e.showProgress,transferLastProgress:e.lastProgress,loadingText:`Laster opp`,truncateTail:this.truncateTail,onCancel:e=>this.cancelTransfer(e)})}markImageFailed(e,t){this.failedImageFileIds={...this.failedImageFileIds,[e]:{...this.failedImageFileIds[e],[t]:!0}}}getPreviewableImages(e){return this.enableImagePreview?e.filter(e=>e.progress===`done`&&this.isImageFile(e)):[]}canOpenPreview(e){return this.enableImagePreview&&e.progress===`done`&&this.isImageFile(e)}openPreview(e,t){let n=t.findIndex(t=>t.fileId===e);n<0||(this.previewCurrentIndex=n,this.isPreviewModalOpen=!0,this.failedImageFileIds={...this.failedImageFileIds,[e]:{...this.failedImageFileIds[e],preview:!1}})}navigatePreview(e,t){t.length!==0&&(this.previewCurrentIndex=Lo(this.previewCurrentIndex,e,t.length))}renderPreviewModal(e){if(!this.enableImagePreview||e.length===0)return null;let t=e[this.previewCurrentIndex];if(!t)return null;let n=e.length>1,r=this.getThumbnailUrl(t),i=!!r&&!this.failedImageFileIds[t.fileId]?.preview,a=t.attributes?.targetFilename||t.file?.name||`Forhåndsvisning`;return j`
1877
+ `}renderQueueItem(e,t){let n=typeof e.file?.size==`number`?this.formatFileSize(e.file.size):``,r=this.getQueueItemOperations();if(this.itemRenderer===`thumbnail`){let i=this.canOpenPreview(e),a=this.failedImageFileIds[e.fileId]?.thumbnail?void 0:this.getThumbnailUrl(e);return vs({file:e,inputName:this.name,disabled:this.disabled,fileSize:n,operations:r,activeOperationId:this.activeOperationByFileId[e.fileId],onActivateOperation:(e,t)=>this.activateOperation(e,t),onCloseOperation:e=>this.closeOperation(e),getFileAttribute:(e,t)=>this.getFileAttribute(e,t),setFileAttribute:(e,t,n)=>this.setFileAttribute(e,t,n),thumbnailUrl:a,previewEnabled:this.enableImagePreview,canOpenPreview:i,transferProgress:e.progress,transferErrorMessage:e.errorMessage,transferShowProgress:e.showProgress,transferLastProgress:e.lastProgress,loadingText:`Laster opp`,truncateTail:this.truncateTail,onCancel:e=>this.cancelTransfer(e),onOpenPreview:e=>this.openPreview(e,t),onThumbnailImageError:e=>this.markImageFailed(e,`thumbnail`)})}return _s({file:e,inputName:this.name,disabled:this.disabled,fileSize:n,operations:r,activeOperationId:this.activeOperationByFileId[e.fileId],onActivateOperation:(e,t)=>this.activateOperation(e,t),onCloseOperation:e=>this.closeOperation(e),getFileAttribute:(e,t)=>this.getFileAttribute(e,t),setFileAttribute:(e,t,n)=>this.setFileAttribute(e,t,n),transferProgress:e.progress,transferErrorMessage:e.errorMessage,transferShowProgress:e.showProgress,transferLastProgress:e.lastProgress,loadingText:`Laster opp`,truncateTail:this.truncateTail,onCancel:e=>this.cancelTransfer(e)})}markImageFailed(e,t){this.failedImageFileIds={...this.failedImageFileIds,[e]:{...this.failedImageFileIds[e],[t]:!0}}}getPreviewableImages(e){return this.enableImagePreview?e.filter(e=>e.progress===`done`&&this.isImageFile(e)):[]}canOpenPreview(e){return this.enableImagePreview&&e.progress===`done`&&this.isImageFile(e)}openPreview(e,t){let n=t.findIndex(t=>t.fileId===e);n<0||(this.previewCurrentIndex=n,this.isPreviewModalOpen=!0,this.failedImageFileIds={...this.failedImageFileIds,[e]:{...this.failedImageFileIds[e],preview:!1}})}navigatePreview(e,t){t.length!==0&&(this.previewCurrentIndex=qo(this.previewCurrentIndex,e,t.length))}renderPreviewModal(e){if(!this.enableImagePreview||e.length===0)return null;let t=e[this.previewCurrentIndex];if(!t)return null;let n=e.length>1,r=this.getThumbnailUrl(t),i=!!r&&!this.failedImageFileIds[t.fileId]?.preview,a=t.attributes?.targetFilename||t.file?.name||`Forhåndsvisning`;return j`
1740
1878
  <pkt-modal
1741
1879
  .open=${this.isPreviewModalOpen}
1742
1880
  .headingText=${a}
@@ -1791,7 +1929,7 @@
1791
1929
  </button>`:null}
1792
1930
  </div>
1793
1931
  </pkt-modal>
1794
- `}getQueueItemOperations(){let e=[];return this.renameFilesEnabled&&this.itemRenderer!==`thumbnail`&&e.push(Ko()),this.addCommentsEnabled&&this.itemRenderer!==`thumbnail`&&e.push(qo()),e.push(...this.extraOperations),e.push(Go(e=>this.removeFileItem(e))),e}activateOperation(e,t){this.activeOperationByFileId={...this.activeOperationByFileId,[e]:t}}closeOperation(e){this.activeOperationByFileId={...this.activeOperationByFileId,[e]:void 0}}getFileAttribute(e,t){let n=this.getCurrentFiles().find(t=>t.fileId===e);if(n)return n.attributes?.[t]??void 0}setFileAttribute(e,t,n){let r=this.getCurrentFiles().find(t=>t.fileId===e);if(!r)return;let i={...r.attributes,[t]:n};n===void 0&&delete i[t],this.updateFileItem(e,{attributes:i})}};K([G()],ls.prototype,`activeOperationByFileId`,void 0),K([G()],ls.prototype,`isPreviewModalOpen`,void 0),K([G()],ls.prototype,`previewCurrentIndex`,void 0),K([G()],ls.prototype,`failedImageFileIds`,void 0),ls=K([U(`pkt-fileupload`)],ls);var us={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`}}}}]},ds=null;function fs(){return ds||(ds=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)}),ds)}var ps=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||us.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 fs(),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}>
1932
+ `}getQueueItemOperations(){let e=[];return this.renameFilesEnabled&&this.itemRenderer!==`thumbnail`&&e.push(ns()),this.addCommentsEnabled&&this.itemRenderer!==`thumbnail`&&e.push(rs()),e.push(...this.extraOperations),e.push(ts(e=>this.removeFileItem(e))),e}activateOperation(e,t){this.activeOperationByFileId={...this.activeOperationByFileId,[e]:t}}closeOperation(e){this.activeOperationByFileId={...this.activeOperationByFileId,[e]:void 0}}getFileAttribute(e,t){let n=this.getCurrentFiles().find(t=>t.fileId===e);if(n)return n.attributes?.[t]??void 0}setFileAttribute(e,t,n){let r=this.getCurrentFiles().find(t=>t.fileId===e);if(!r)return;let i={...r.attributes,[t]:n};n===void 0&&delete i[t],this.updateFileItem(e,{attributes:i})}};K([G()],ys.prototype,`activeOperationByFileId`,void 0),K([G()],ys.prototype,`isPreviewModalOpen`,void 0),K([G()],ys.prototype,`previewCurrentIndex`,void 0),K([G()],ys.prototype,`failedImageFileIds`,void 0),ys=K([U(`pkt-fileupload`)],ys);var bs={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`}}}}]},xs=null;function Ss(){return xs||(xs=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)}),xs)}var Cs=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||bs.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 Ss(),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}>
1795
1933
  <pkt-icon name="chevron-right" class="pkt-footer__link-icon"></pkt-icon>
1796
1934
  ${this.triggerText}
1797
1935
  </a>`:this.triggerType===`icon`?j`<pkt-button
@@ -1801,7 +1939,7 @@
1801
1939
  @click=${this.openModal}
1802
1940
  >
1803
1941
  >${this.triggerText}</pkt-button
1804
- >`:j`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`}};K([W({type:Boolean})],ps.prototype,`devMode`,void 0),K([W({type:String})],ps.prototype,`hotjarId`,void 0),K([W({type:String})],ps.prototype,`googleAnalyticsId`,void 0),K([W({type:String})],ps.prototype,`cookieDomain`,void 0),K([W({type:String})],ps.prototype,`cookieSecure`,void 0),K([W({type:String})],ps.prototype,`cookieExpiryDays`,void 0),K([W({type:String})],ps.prototype,`triggerType`,void 0),K([W({type:String})],ps.prototype,`triggerText`,void 0),K([W({type:String})],ps.prototype,`i18nLanguage`,void 0);try{U(`pkt-consent`)(ps)}catch{console.warn(`Forsøker å definere <pkt-consent>, men den er allerede definert`)}var ms=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`
1942
+ >`:j`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`}};K([W({type:Boolean})],Cs.prototype,`devMode`,void 0),K([W({type:String})],Cs.prototype,`hotjarId`,void 0),K([W({type:String})],Cs.prototype,`googleAnalyticsId`,void 0),K([W({type:String})],Cs.prototype,`cookieDomain`,void 0),K([W({type:String})],Cs.prototype,`cookieSecure`,void 0),K([W({type:String})],Cs.prototype,`cookieExpiryDays`,void 0),K([W({type:String})],Cs.prototype,`triggerType`,void 0),K([W({type:String})],Cs.prototype,`triggerText`,void 0),K([W({type:String})],Cs.prototype,`i18nLanguage`,void 0);try{U(`pkt-consent`)(Cs)}catch{console.warn(`Forsøker å definere <pkt-consent>, men den er allerede definert`)}var ws=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`
1805
1943
  ${this.tagText?j`<span class=${r+` pkt-tag--gray`}>${this.tagText}</span>`:N}
1806
1944
  ${this.optionalTag?j`<span class=${r+` pkt-tag--blue-light`}>${this.optionalText}</span>`:N}
1807
1945
  ${this.requiredTag?j`<span class=${r+` pkt-tag--beige`}>${this.requiredText}</span>`:N}
@@ -1831,7 +1969,7 @@
1831
1969
  ${this.labelPosition===`right`?a():N}
1832
1970
  </div>
1833
1971
  </div>
1834
- `}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})],ms.prototype,`value`,void 0),K([W({type:String})],ms.prototype,`checkHelptext`,void 0),K([W({type:Boolean})],ms.prototype,`defaultChecked`,void 0),K([W({type:Boolean})],ms.prototype,`hasTile`,void 0),K([W({type:Boolean})],ms.prototype,`isSwitch`,void 0),K([W({type:String})],ms.prototype,`labelPosition`,void 0),K([W({type:Boolean})],ms.prototype,`hideLabel`,void 0),K([W({type:Boolean,reflect:!0})],ms.prototype,`checked`,void 0),K([W({type:Boolean,reflect:!0})],ms.prototype,`indeterminate`,void 0),K([W({type:String,reflect:!0})],ms.prototype,`type`,void 0),K([W({type:String})],ms.prototype,`tagText`,void 0),K([W({type:Boolean})],ms.prototype,`optionalTag`,void 0),K([W({type:String})],ms.prototype,`optionalText`,void 0),K([W({type:Boolean})],ms.prototype,`requiredTag`,void 0),K([W({type:String})],ms.prototype,`requiredText`,void 0);try{U(`pkt-checkbox`)(ms)}catch{console.warn(`Forsøker å definere <pkt-checkbox>, men den er allerede definert`)}var hs=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`
1972
+ `}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})],ws.prototype,`value`,void 0),K([W({type:String})],ws.prototype,`checkHelptext`,void 0),K([W({type:Boolean})],ws.prototype,`defaultChecked`,void 0),K([W({type:Boolean})],ws.prototype,`hasTile`,void 0),K([W({type:Boolean})],ws.prototype,`isSwitch`,void 0),K([W({type:String})],ws.prototype,`labelPosition`,void 0),K([W({type:Boolean})],ws.prototype,`hideLabel`,void 0),K([W({type:Boolean,reflect:!0})],ws.prototype,`checked`,void 0),K([W({type:Boolean,reflect:!0})],ws.prototype,`indeterminate`,void 0),K([W({type:String,reflect:!0})],ws.prototype,`type`,void 0),K([W({type:String})],ws.prototype,`tagText`,void 0),K([W({type:Boolean})],ws.prototype,`optionalTag`,void 0),K([W({type:String})],ws.prototype,`optionalText`,void 0),K([W({type:Boolean})],ws.prototype,`requiredTag`,void 0),K([W({type:String})],ws.prototype,`requiredText`,void 0);try{U(`pkt-checkbox`)(ws)}catch{console.warn(`Forsøker å definere <pkt-checkbox>, men den er allerede definert`)}var Ts=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`
1835
1973
  <a
1836
1974
  href=${this.href}
1837
1975
  class=${e}
@@ -1843,7 +1981,7 @@
1843
1981
 
1844
1982
  <div class="pkt-linkcard__text">${Et(this)}</div>
1845
1983
  </a>
1846
- `}};K([W({type:String,reflect:!0})],hs.prototype,`title`,void 0),K([W({type:String,reflect:!0})],hs.prototype,`href`,void 0),K([W({type:String,reflect:!0})],hs.prototype,`iconName`,void 0),K([W({type:Boolean,reflect:!0})],hs.prototype,`external`,void 0),K([W({type:Boolean,reflect:!0})],hs.prototype,`openInNewTab`,void 0),K([W({type:String,reflect:!0})],hs.prototype,`skin`,void 0);try{U(`pkt-linkcard`)(hs)}catch{console.warn(`Forsøker å definere <pkt-linkcard>, men den er allerede definert`)}window.pktAnimationPath=window.pktAnimationPath||`https://punkt-cdn.oslo.kommune.no/16.16/animations/`;var gs=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
1984
+ `}};K([W({type:String,reflect:!0})],Ts.prototype,`title`,void 0),K([W({type:String,reflect:!0})],Ts.prototype,`href`,void 0),K([W({type:String,reflect:!0})],Ts.prototype,`iconName`,void 0),K([W({type:Boolean,reflect:!0})],Ts.prototype,`external`,void 0),K([W({type:Boolean,reflect:!0})],Ts.prototype,`openInNewTab`,void 0),K([W({type:String,reflect:!0})],Ts.prototype,`skin`,void 0);try{U(`pkt-linkcard`)(Ts)}catch{console.warn(`Forsøker å definere <pkt-linkcard>, men den er allerede definert`)}window.pktAnimationPath=window.pktAnimationPath||`https://punkt-cdn.oslo.kommune.no/16.17/animations/`;var Es=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
1847
1985
  role="status"
1848
1986
  aria-live="polite"
1849
1987
  aria-busy=${this.isLoading?`true`:`false`}
@@ -1858,7 +1996,7 @@
1858
1996
  ${this.message&&j`<p>${this.message}</p>`}
1859
1997
  </div>`:N}
1860
1998
  <div class=${t}>${Et(this)}</div>
1861
- </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})],gs.prototype,`delay`,void 0),K([W({type:Boolean})],gs.prototype,`inline`,void 0),K([W({type:Boolean})],gs.prototype,`isLoading`,void 0),K([W({type:String})],gs.prototype,`message`,void 0),K([W({type:String})],gs.prototype,`size`,void 0),K([W({type:String})],gs.prototype,`variant`,void 0),K([W({type:String})],gs.prototype,`loadingAnimationPath`,void 0),K([G()],gs.prototype,`_shouldDisplayLoader`,void 0);try{U(`pkt-loader`)(gs)}catch{console.warn(`Forsøker å definere <pkt-loader>, men den er allerede definert`)}var _s={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`}}},vs=class extends Dt{constructor(){super(),this.closable=_s.props.closable.default,this.compact=_s.props.compact.default,this.title=``,this.skin=_s.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})}>
1999
+ </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})],Es.prototype,`delay`,void 0),K([W({type:Boolean})],Es.prototype,`inline`,void 0),K([W({type:Boolean})],Es.prototype,`isLoading`,void 0),K([W({type:String})],Es.prototype,`message`,void 0),K([W({type:String})],Es.prototype,`size`,void 0),K([W({type:String})],Es.prototype,`variant`,void 0),K([W({type:String})],Es.prototype,`loadingAnimationPath`,void 0),K([G()],Es.prototype,`_shouldDisplayLoader`,void 0);try{U(`pkt-loader`)(Es)}catch{console.warn(`Forsøker å definere <pkt-loader>, men den er allerede definert`)}var Ds={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`}}},Os=class extends Dt{constructor(){super(),this.closable=Ds.props.closable.default,this.compact=Ds.props.compact.default,this.title=``,this.skin=Ds.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})}>
1862
2000
  ${this.closable?j`<div class="pkt-messagebox__close">
1863
2001
  <button
1864
2002
  @click=${this.close}
@@ -1870,7 +2008,7 @@
1870
2008
  </div>`:N}
1871
2009
  ${this.title?j`<div class="pkt-messagebox__title">${this.title}</div>`:N}
1872
2010
  <div class="pkt-messagebox__text">${Et(this)}</div>
1873
- </div>`}};K([W({type:Boolean,reflect:!0})],vs.prototype,`closable`,void 0),K([W({type:Boolean,reflect:!0})],vs.prototype,`compact`,void 0),K([W({type:String,reflect:!0})],vs.prototype,`title`,void 0),K([W({type:String,reflect:!0})],vs.prototype,`skin`,void 0),K([G()],vs.prototype,`_isClosed`,void 0);try{U(`pkt-messagebox`)(vs)}catch{console.warn(`Forsøker å definere <pkt-messagebox>, men den er allerede definert`)}var ys=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`
2011
+ </div>`}};K([W({type:Boolean,reflect:!0})],Os.prototype,`closable`,void 0),K([W({type:Boolean,reflect:!0})],Os.prototype,`compact`,void 0),K([W({type:String,reflect:!0})],Os.prototype,`title`,void 0),K([W({type:String,reflect:!0})],Os.prototype,`skin`,void 0),K([G()],Os.prototype,`_isClosed`,void 0);try{U(`pkt-messagebox`)(Os)}catch{console.warn(`Forsøker å definere <pkt-messagebox>, men den er allerede definert`)}var ks=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`
1874
2012
  <div class="pkt-input-check">
1875
2013
  <div class=${e}>
1876
2014
  <input
@@ -1900,11 +2038,11 @@
1900
2038
  `}
1901
2039
  </div>
1902
2040
  </div>
1903
- `}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})],ys.prototype,`value`,void 0),K([W({type:String})],ys.prototype,`checkHelptext`,void 0),K([W({type:Boolean})],ys.prototype,`defaultChecked`,void 0),K([W({type:Boolean})],ys.prototype,`hasTile`,void 0),K([W({type:Boolean,reflect:!0})],ys.prototype,`checked`,void 0),K([W({type:String,reflect:!0})],ys.prototype,`type`,void 0),K([W({type:String})],ys.prototype,`tagText`,void 0),K([W({type:Boolean})],ys.prototype,`optionalTag`,void 0),K([W({type:String})],ys.prototype,`optionalText`,void 0),K([W({type:Boolean})],ys.prototype,`requiredTag`,void 0),K([W({type:String})],ys.prototype,`requiredText`,void 0),K([G()],ys.prototype,`_checked`,void 0);try{U(`pkt-radiobutton`)(ys)}catch{console.warn(`Forsøker å definere <pkt-radiobutton>, men den er allerede definert`)}var bs=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 xs(e){return e}var Ss=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 bs(this.context,this.host,this.t,this.subscribe))}},Cs=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()}},ws=class extends Event{constructor(e,t){super(`context-provider`,{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t}},Ts=class extends Cs{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 bs(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 ws(this.context,this.host))}};function Es({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 Ts(this,{context:e,initialValue:t})),t}};{t.constructor.addInitializer((t=>{r.set(t,new Ts(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 Ds({context:e,subscribe:t}){return(n,r)=>{typeof r==`object`?r.addInitializer((function(){new Ss(this,{context:e,callback:e=>{n.set.call(this,e)},subscribe:t})})):n.constructor.addInitializer((n=>{new Ss(n,{context:e,callback:e=>{n[r]=e},subscribe:t})}))}}var Os=xs(Symbol(`pkt-tabs-context`)),ks=class extends Dt{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`
2041
+ `}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})],ks.prototype,`value`,void 0),K([W({type:String})],ks.prototype,`checkHelptext`,void 0),K([W({type:Boolean})],ks.prototype,`defaultChecked`,void 0),K([W({type:Boolean})],ks.prototype,`hasTile`,void 0),K([W({type:Boolean,reflect:!0})],ks.prototype,`checked`,void 0),K([W({type:String,reflect:!0})],ks.prototype,`type`,void 0),K([W({type:String})],ks.prototype,`tagText`,void 0),K([W({type:Boolean})],ks.prototype,`optionalTag`,void 0),K([W({type:String})],ks.prototype,`optionalText`,void 0),K([W({type:Boolean})],ks.prototype,`requiredTag`,void 0),K([W({type:String})],ks.prototype,`requiredText`,void 0),K([G()],ks.prototype,`_checked`,void 0);try{U(`pkt-radiobutton`)(ks)}catch{console.warn(`Forsøker å definere <pkt-radiobutton>, men den er allerede definert`)}var As=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 js(e){return e}var Ms=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 As(this.context,this.host,this.t,this.subscribe))}},Ns=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()}},Ps=class extends Event{constructor(e,t){super(`context-provider`,{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t}},Fs=class extends Ns{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 As(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 Ps(this.context,this.host))}};function Is({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 Fs(this,{context:e,initialValue:t})),t}};{t.constructor.addInitializer((t=>{r.set(t,new Fs(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 Ls({context:e,subscribe:t}){return(n,r)=>{typeof r==`object`?r.addInitializer((function(){new Ms(this,{context:e,callback:e=>{n.set.call(this,e)},subscribe:t})})):n.constructor.addInitializer((n=>{new Ms(n,{context:e,callback:e=>{n[r]=e},subscribe:t})}))}}var Rs=js(Symbol(`pkt-tabs-context`)),zs=class extends Dt{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`
1904
2042
  <div class=${this.separatorIconName||this.separatorIconPath?`pkt-tabs pkt-tabs--with-separator`:`pkt-tabs`}>
1905
2043
  <div class="pkt-tabs__list" role=${e}>${Et(this)}</div>
1906
2044
  </div>
1907
- `}};K([W({type:Boolean,reflect:!0,attribute:`arrow-nav`})],ks.prototype,`arrowNav`,void 0),K([W({type:Boolean,reflect:!0,attribute:`disable-arrow-nav`})],ks.prototype,`disableArrowNav`,void 0),K([W({type:String,reflect:!0,attribute:`separator-icon-name`})],ks.prototype,`separatorIconName`,void 0),K([W({type:String,reflect:!0,attribute:`separator-icon-path`})],ks.prototype,`separatorIconPath`,void 0),K([G()],ks.prototype,`tabRefs`,void 0),K([G()],ks.prototype,`disabledMap`,void 0),K([G()],ks.prototype,`tabCount`,void 0),K([Es({context:Os}),G()],ks.prototype,`context`,void 0);try{U(`pkt-tabs`)(ks)}catch{console.warn(`Forsøker å definere <pkt-tabs>, men den er allerede definert`)}var As=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=`pkt-icon--small ${this.icon===`check`?`pkt-tabs__status-icon`:``}`,s=j`
2045
+ `}};K([W({type:Boolean,reflect:!0,attribute:`arrow-nav`})],zs.prototype,`arrowNav`,void 0),K([W({type:Boolean,reflect:!0,attribute:`disable-arrow-nav`})],zs.prototype,`disableArrowNav`,void 0),K([W({type:String,reflect:!0,attribute:`separator-icon-name`})],zs.prototype,`separatorIconName`,void 0),K([W({type:String,reflect:!0,attribute:`separator-icon-path`})],zs.prototype,`separatorIconPath`,void 0),K([G()],zs.prototype,`tabRefs`,void 0),K([G()],zs.prototype,`disabledMap`,void 0),K([G()],zs.prototype,`tabCount`,void 0),K([Is({context:Rs}),G()],zs.prototype,`context`,void 0);try{U(`pkt-tabs`)(zs)}catch{console.warn(`Forsøker å definere <pkt-tabs>, men den er allerede definert`)}var Bs=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=`pkt-icon--small ${this.icon===`check`?`pkt-tabs__status-icon`:``}`,s=j`
1908
2046
  ${this.icon?j`<pkt-icon name=${this.icon} class=${o}></pkt-icon>`:``}
1909
2047
  <span>${Et(this)}</span>
1910
2048
  ${this.tag?j`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>`:``}
@@ -1939,7 +2077,7 @@
1939
2077
  >
1940
2078
  ${s}
1941
2079
  </button>
1942
- `}};K([W({type:Boolean,reflect:!0})],As.prototype,`active`,void 0),K([W({type:Boolean,reflect:!0})],As.prototype,`disabled`,void 0),K([W({type:String,reflect:!0})],As.prototype,`href`,void 0),K([W({type:String,reflect:!0})],As.prototype,`icon`,void 0),K([W({type:String,reflect:!0})],As.prototype,`controls`,void 0),K([W({type:String,reflect:!0})],As.prototype,`tag`,void 0),K([W({type:String,reflect:!0,attribute:`tag-skin`})],As.prototype,`tagSkin`,void 0),K([W({type:Number,reflect:!0})],As.prototype,`index`,void 0),K([Ds({context:Os,subscribe:!0}),W({attribute:!1})],As.prototype,`context`,void 0);try{U(`pkt-tab-item`)(As)}catch{console.warn(`Forsøker å definere <pkt-tab-item>, men den er allerede definert`)}var js=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}}),Ms=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
2080
+ `}};K([W({type:Boolean,reflect:!0})],Bs.prototype,`active`,void 0),K([W({type:Boolean,reflect:!0})],Bs.prototype,`disabled`,void 0),K([W({type:String,reflect:!0})],Bs.prototype,`href`,void 0),K([W({type:String,reflect:!0})],Bs.prototype,`icon`,void 0),K([W({type:String,reflect:!0})],Bs.prototype,`controls`,void 0),K([W({type:String,reflect:!0})],Bs.prototype,`tag`,void 0),K([W({type:String,reflect:!0,attribute:`tag-skin`})],Bs.prototype,`tagSkin`,void 0),K([W({type:Number,reflect:!0})],Bs.prototype,`index`,void 0),K([Ls({context:Rs,subscribe:!0}),W({attribute:!1})],Bs.prototype,`context`,void 0);try{U(`pkt-tab-item`)(Bs)}catch{console.warn(`Forsøker å definere <pkt-tab-item>, men den er allerede definert`)}var Vs=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}}),Hs=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
1943
2081
  label=${this.label}
1944
2082
  ?counter=${this.counter}
1945
2083
  ?disabled=${this.disabled}
@@ -1969,7 +2107,7 @@
1969
2107
  id=${this.id+`-input`}
1970
2108
  name=${(this.name||this.id)+`-input`}
1971
2109
  placeholder=${J(this.placeholder)}
1972
- .value=${js(this.value)}
2110
+ .value=${Vs(this.value)}
1973
2111
  minlength=${J(this.minlength)}
1974
2112
  maxlength=${J(this.maxlength)}
1975
2113
  ?readonly=${this.readonly}
@@ -1984,7 +2122,7 @@
1984
2122
  @focus=${e=>{this.onFocus(),e.stopImmediatePropagation()}}
1985
2123
  @blur=${e=>{this.value=e.target.value,this.onBlur(),e.stopImmediatePropagation()}}
1986
2124
  ></textarea>
1987
- </pkt-input-wrapper>`}};K([W({type:String,reflect:!0})],Ms.prototype,`value`,void 0),K([W({type:String})],Ms.prototype,`autocomplete`,void 0),K([W({type:Number})],Ms.prototype,`rows`,void 0),K([G()],Ms.prototype,`counterCurrent`,void 0);try{U(`pkt-textarea`)(Ms)}catch{console.warn(`Forsøker å definere <pkt-textarea>, men den er allerede definert`)}var Ns=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`})],Ns.prototype,`_optionsProp`,void 0),K([G()],Ns.prototype,`_options`,void 0);var Ps=class extends Ns{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`
2125
+ </pkt-input-wrapper>`}};K([W({type:String,reflect:!0})],Hs.prototype,`value`,void 0),K([W({type:String})],Hs.prototype,`autocomplete`,void 0),K([W({type:Number})],Hs.prototype,`rows`,void 0),K([G()],Hs.prototype,`counterCurrent`,void 0);try{U(`pkt-textarea`)(Hs)}catch{console.warn(`Forsøker å definere <pkt-textarea>, men den er allerede definert`)}var Us=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`})],Us.prototype,`_optionsProp`,void 0),K([G()],Us.prototype,`_options`,void 0);var Ws=class extends Us{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`
1988
2126
  <pkt-input-wrapper
1989
2127
  ?counter=${this.counter}
1990
2128
  ?disabled=${this.disabled}
@@ -2032,7 +2170,7 @@
2032
2170
  </select>
2033
2171
  <div class="pkt-contents" slot="helptext">${Et(this,`helptext`)}</div>
2034
2172
  </pkt-input-wrapper>
2035
- `}returnNumberOrNull(e){return e==null||isNaN(e)?null:e}};K([W({type:String})],Ps.prototype,`value`,void 0);try{U(`pkt-select`)(Ps)}catch{console.warn(`Forsøker å definere <pkt-select>, men den er allerede definert`)}var Fs=e=>/^\d{2}:\d{2}$/.test(e)&&parseInt(e.slice(0,2),10)<=23&&parseInt(e.slice(3),10)<=59,Is=e=>{let[t,n]=e.split(`:`).map(Number);return t*60+n},Ls=e=>e?Math.max(1,Math.round(e/60)):1,Rs=(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)},zs=e=>{let t=Ls(e);return Array.from({length:Math.floor(60/t)},(e,n)=>n*t)},Bs=(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`)}},Vs=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=Is(this.value),r=Ls(this.step);if(this.min&&n<Is(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>Is(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=Fs(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 Ls(this.step)}get _hourOptions(){return Rs(this.min,this.max)}get _minuteOptions(){return zs(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=Bs(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`
2173
+ `}returnNumberOrNull(e){return e==null||isNaN(e)?null:e}};K([W({type:String})],Ws.prototype,`value`,void 0);try{U(`pkt-select`)(Ws)}catch{console.warn(`Forsøker å definere <pkt-select>, men den er allerede definert`)}var Gs=e=>/^\d{2}:\d{2}$/.test(e)&&parseInt(e.slice(0,2),10)<=23&&parseInt(e.slice(3),10)<=59,Ks=e=>{let[t,n]=e.split(`:`).map(Number);return t*60+n},qs=e=>e?Math.max(1,Math.round(e/60)):1,Js=(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)},Ys=e=>{let t=qs(e);return Array.from({length:Math.floor(60/t)},(e,n)=>n*t)},Xs=(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`)}},Zs=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=Ks(this.value),r=qs(this.step);if(this.min&&n<Ks(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>Ks(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=Gs(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 qs(this.step)}get _hourOptions(){return Js(this.min,this.max)}get _minuteOptions(){return Ys(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=Xs(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`
2036
2174
  <button
2037
2175
  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})}
2038
2176
  type="button"
@@ -2222,4 +2360,4 @@
2222
2360
  </div>
2223
2361
  `:this._renderContainer()}
2224
2362
  </pkt-input-wrapper>
2225
- `}};K([W({type:String,reflect:!0})],Vs.prototype,`value`,void 0),K([W({type:Boolean,reflect:!0,attribute:`hide-picker`})],Vs.prototype,`hidePicker`,void 0),K([W({type:Boolean,reflect:!0,attribute:`step-arrows`})],Vs.prototype,`stepArrows`,void 0),K([G()],Vs.prototype,`_hours`,void 0),K([G()],Vs.prototype,`_minutes`,void 0),K([G()],Vs.prototype,`_isOpen`,void 0);try{U(`pkt-timepicker`)(Vs)}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:{}}),Hs=(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})})]})});Hs.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),Us=({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)(Ks,{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]})]})})};Us.displayName=`PktAlert`;var Ws=(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})})});Ws.displayName=`PktBackLink`;var Gs=(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})]})});Gs.displayName=`PktBreadcrumbs`,window.pktAnimationPath=window.pktAnimationPath||`https://punkt-cdn.oslo.kommune.no/16.16/animations/`;var Ks=(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}})]})});Ks.displayName=`PktButton`;var qs=365.2425,Js=6048e5,Ys=864e5,Xs=3600*24;Xs*7,Xs*qs/12*3;var Zs=Symbol.for(`constructDateFrom`);function Qs(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&Zs in e?e[Zs](t):e instanceof Date?new e.constructor(t):new Date(t)}function $s(e,t){return Qs(t||e,e)}function ec(e,t,n){let r=$s(e,n?.in);return isNaN(t)?Qs(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}var tc={};function nc(){return tc}function rc(e,t){let n=nc(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=$s(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 ic(e,t){return rc(e,{...t,weekStartsOn:1})}function ac(e,t){let n=$s(e,t?.in),r=n.getFullYear(),i=Qs(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let a=ic(i),o=Qs(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);let s=ic(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function oc(e){let t=$s(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 sc(e,...t){let n=Qs.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function cc(e,t){let n=$s(e,t?.in);return n.setHours(0,0,0,0),n}function lc(e,t,n){let[r,i]=sc(n?.in,e,t),a=cc(r),o=cc(i),s=+a-oc(a),c=+o-oc(o);return Math.round((s-c)/Ys)}function uc(e,t){let n=ac(e,t),r=Qs(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),ic(r)}function dc(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function fc(e){return!(!dc(e)&&typeof e!=`number`||isNaN(+$s(e)))}function pc(e,t){let n=$s(e,t?.in);return n.setHours(23,59,59,999),n}function mc(e,t){let[n,r]=sc(e,t.start,t.end);return{start:n,end:r}}function hc(e,t){let{start:n,end:r}=mc(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(Qs(n,o)),o.setDate(o.getDate()+s),o.setHours(0,0,0,0);return i?c.reverse():c}function gc(e,t){let n=$s(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}var _c={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`}},vc=(e,t,n)=>{let r,i=_c[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 yc(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var bc={date:yc({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:yc({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:yc({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},xc={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},Sc=(e,t,n,r)=>xc[e];function Cc(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 wc={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:Cc({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:Cc({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:Cc({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:Cc({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:Cc({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 Tc(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)?Dc(s,e=>e.test(o)):Ec(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 Ec(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Dc(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Oc(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 kc={code:`en-US`,formatDistance:vc,formatLong:bc,formatRelative:Sc,localize:wc,match:{ordinalNumber:Oc({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:Tc({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:Tc({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:Tc({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:Tc({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:Tc({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 Ac(e,t){let n=$s(e,t?.in);return lc(n,gc(n))+1}function jc(e,t){let n=$s(e,t?.in),r=ic(n)-+uc(n);return Math.round(r/Js)+1}function Mc(e,t){let n=$s(e,t?.in),r=n.getFullYear(),i=nc(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=Qs(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=rc(o,t),c=Qs(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=rc(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function Nc(e,t){let n=nc(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=Mc(e,t),a=Qs(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),rc(a,t)}function Pc(e,t){let n=$s(e,t?.in),r=rc(n,t)-+Nc(n,t);return Math.round(r/Js)+1}function Fc(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var Ic={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return Fc(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):Fc(n+1,2)},d(e,t){return Fc(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 Fc(e.getHours()%12||12,t.length)},H(e,t){return Fc(e.getHours(),t.length)},m(e,t){return Fc(e.getMinutes(),t.length)},s(e,t){return Fc(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return Fc(Math.trunc(r*10**(n-3)),t.length)}},Lc={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},Rc={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 Ic.y(e,t)},Y:function(e,t,n,r){let i=Mc(e,r),a=i>0?i:1-i;return t===`YY`?Fc(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):Fc(a,t.length)},R:function(e,t){return Fc(ac(e),t.length)},u:function(e,t){return Fc(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 Fc(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 Fc(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 Ic.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 Fc(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=Pc(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):Fc(i,t.length)},I:function(e,t,n){let r=jc(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):Fc(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):Ic.d(e,t)},D:function(e,t,n){let r=Ac(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):Fc(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 Fc(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 Fc(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 Fc(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?Lc.noon:r===0?Lc.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?Lc.evening:r>=12?Lc.afternoon:r>=4?Lc.morning:Lc.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 Ic.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):Ic.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):Fc(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):Fc(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):Ic.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):Ic.s(e,t)},S:function(e,t){return Ic.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return Bc(r);case`XXXX`:case`XX`:return Vc(r);default:return Vc(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return Bc(r);case`xxxx`:case`xx`:return Vc(r);default:return Vc(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+zc(r,`:`);default:return`GMT`+Vc(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+zc(r,`:`);default:return`GMT`+Vc(r,`:`)}},t:function(e,t,n){return Fc(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return Fc(+e,t.length)}};function zc(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+Fc(a,2)}function Bc(e,t){return e%60==0?(e>0?`-`:`+`)+Fc(Math.abs(e)/60,2):Vc(e,t)}function Vc(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Fc(Math.trunc(r/60),2),a=Fc(r%60,2);return n+i+t+a}var Hc=(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`})}},Uc=(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`})}},Wc={p:Uc,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Hc(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}}`,Hc(r,t)).replace(`{{time}}`,Uc(i,t))}},Gc=/^D+$/,Kc=/^Y+$/,qc=[`D`,`DD`,`YY`,`YYYY`];function Jc(e){return Gc.test(e)}function Yc(e){return Kc.test(e)}function Xc(e,t,n){let r=Zc(e,t,n);if(console.warn(r),qc.includes(e))throw RangeError(r)}function Zc(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 Qc=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$c=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,el=/^'([^]*?)'?$/,tl=/''/g,nl=/[a-zA-Z]/;function rl(e,t,n){let r=nc(),i=n?.locale??r.locale??kc,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=$s(e,n?.in);if(!fc(s))throw RangeError(`Invalid time value`);let c=t.match($c).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=Wc[t];return n(e,i.formatLong)}return e}).join(``).match(Qc).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:il(e)};if(Rc[t])return{isToken:!0,value:e};if(t.match(nl))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&&Yc(a)||!n?.useAdditionalDayOfYearTokens&&Jc(a))&&Xc(a,t,String(e));let o=Rc[a[0]];return o(s,a,i.localize,l)}).join(``)}function il(e){let t=e.match(el);return t?t[1].replace(tl,`'`):e}function al(e,t){let n=$s(e,t?.in).getDay();return n===0?7:n}function ol(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 sl={},cl={};function ll(e,t){try{let n=(sl[e]||=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`longOffset`}).format)(t).split(`GMT`)[1];return n in cl?cl[n]:dl(n,n.split(`:`))}catch{if(e in cl)return cl[e];let t=e?.match(ul);return t?dl(e,t.slice(1)):NaN}}var ul=/([+-]\d\d):?(\d\d)?/;function dl(e,t){let n=+(t[0]||0),r=+(t[1]||0),i=(t[2]||0)/60;return cl[e]=n*60+r>0?n*60+r+i:n*60-r-i}var fl=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(ll(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)),gl(this,NaN),ml(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=-ll(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),ml(this),+this}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}},pl=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!pl.test(e))return;let t=e.replace(pl,`$1UTC`);fl.prototype[t]&&(e.startsWith(`get`)?fl.prototype[e]=function(){return this.internal[t]()}:(fl.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),hl(this),+this},fl.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),ml(this),+this}))});function ml(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-ll(e.timeZone,e)*60))}function hl(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()),gl(e)}function gl(e){let t=ll(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(-(ll(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=ll(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=ll(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 _l=class e extends fl{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} (${ol(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 vl=(e=window.pktTz)=>{let t=new _l(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 yl(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 bl=e=>!e||isNaN(e.getTime())?``:`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`,xl=e=>{if(!e)return null;let t=yl(e);return isNaN(t.getTime())?null:t},Sl=(e,t)=>{let n=Cl(e);return isNaN(n.getTime())?``:rl(n,t)},Cl=(e=``,t)=>{let n=typeof e==`string`?yl(e):e;return!n||isNaN(n.getTime())?new Date:t?t===`end`?pc(n):cc(n):n},wl=(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},Tl=e=>{let t;return t=new _l(e,window.pktTz),t.setHours(12,0,0,0),t},El=null,Dl=void 0,Ol=e=>{if(!e||isNaN(e.getTime()))return``;let t=typeof window<`u`?window.pktTz:void 0;return(!El||Dl!==t)&&(El=new Intl.DateTimeFormat(`no`,{dateStyle:`full`,timeZone:t}),Dl=t),El.format(e)},kl=(e,t,n)=>{if(!e||isNaN(e.getTime()))return!1;let r=t?Cl(t):null,i=n?Cl(n):null;return!(r&&e<r||i&&e>i)},Al=(e,t)=>{if(!e||isNaN(e.getTime())||!Array.isArray(t))return!1;let n=bl(e);return t.includes(n)},jl=(e,t)=>{if(!e||isNaN(e.getTime())||!Array.isArray(t))return!1;let n=e.getDay().toString();return t.includes(n)},Ml=(e,t,n,r,i)=>!(!e||isNaN(e.getTime())||!kl(e,t,n)||r&&Al(e,r)||i&&jl(e,i)),Nl=(e,t,n,r,i)=>e.filter(e=>{let a=xl(e);return a&&Ml(a,t,n,r,i)}),Pl=e=>e.slice().sort((e,t)=>{let n=xl(e),r=xl(t);return!n||!r?0:n.getTime()-r.getTime()}),Fl=(e,t)=>{let n=xl(e),r=xl(t);return!n||!r?!1:n<=r};function Il(e,t){let n=(t.excludedates??[]).map(e=>typeof e==`string`?e:bl(e));return!Ml(e,t.earliest,t.latest,n,t.excludeweekdays??[])}function Ll(e,t,n,r){return!!(Il(e,n)||!t&&r.multiple&&r.maxMultiple>0&&r.selectedCount>=r.maxMultiple)}function Rl(e,t,n){let r=wl(e,t,0);return!(n&&Cl(n)>r)}function zl(e,t,n){let r=wl(t===11?e+1:e,t===11?0:t+1,1);return!(n&&Cl(n)<r)}function Bl(e){return typeof e==`string`&&(e=e.split(`,`)),e.length===1&&e[0]===``?[]:e.map(e=>yl(e))}function Vl(e,t){let n=hc({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[bl(a)]=o}return r}function Hl(e,t,n,r){if(t.length!==1)return!0;let i=hc({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(al(i[a]).toString()))return!1}return!0}function Ul(e,t){let n=bl(e);return t.includes(n)?t:[...t,n]}function Wl(e,t){let n=bl(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 Gl(e,t,n){let r=bl(e);return t.includes(r)?Wl(e,t):n>0&&t.length>=n?t:Ul(e,t)}function Kl(e,t,n){let r=bl(e),i=Bl(t);return t.includes(r)?t.indexOf(r)===0?[]:Wl(e,t):t.length>1||t.length===1&&(!Hl(e,i,n.excludedates,n.excludeweekdays)||i[0]>e)?[r]:Ul(e,t)}function ql(e,t){let n=wl(e,t,1),r=wl(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:wl(e,t,0).getDate(),initialWeek:Pc(n)}}function Jl(e,t,n,r){let{startingDay:i,numDays:a}=r;return e===0&&t<i?`prev-month`:n>a?`next-month`:`current-month`}function Yl(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 Xl={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7};function Zl(e){let t=e.nodeName;return t===`INPUT`||t===`SELECT`||t===`BUTTON`&&!e.dataset?.date}function Ql(e,t,n){let r=ec(e,t);if(!r)return null;let i=n(`button[data-date="${bl(r)}"]`);for(;i instanceof HTMLButtonElement&&i.dataset.disabled;)if(r=ec(r,t),i=n(`button[data-date="${bl(r)}"]`),!i)return null;return r}function $l(e){return Xl[e]??null}var eu={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 tu(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)(()=>({...eu,...m}),[m]),S=(0,t.useMemo)(()=>p?yl(p):vl(),[p]),C=(0,t.useMemo)(()=>c?c.map(e=>typeof e==`string`?yl(e):e):[],[c]),w=n!==void 0,[ee,T]=(0,t.useState)([]),E=w?n:ee,te=(0,t.useMemo)(()=>Bl(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=Tl(f):typeof f==`string`&&(e=yl(f))),!e||isNaN(e.getTime()))if(E.length>0&&E[0]!==``){let t=yl(E[E.length-1]);e=isNaN(t.getTime())?Tl(S):t}else e=Tl(S);if((!e||isNaN(e.getTime()))&&(e=Tl(S)),s){let t=typeof s==`string`?yl(s):s;!isNaN(t.getTime())&&e>t&&(e=t)}if(o){let t=typeof o==`string`?yl(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=yl(E[E.length-1]);isNaN(e.getTime())||(re(e.getFullYear()),ie(e.getMonth()))}},[E]),(0,t.useEffect)(()=>{a&&te.length===2?oe(Vl(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=>Il(e,M),[M]),L=(0,t.useCallback)((e,t)=>Ll(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||!Hl(e,te,C,l)||te[0]>=e){ce(null);return}ce(e),oe(Vl(te[0],e))},[a,te,C,l]),he=(0,t.useCallback)(e=>{if(!e)return;let t;if(a)t=Kl(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=Gl(e,R(),i),N(t);else{let n=bl(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=Ul(e,R());w||T(t),a&&t.length===2&&(h?.(t),P())},[R,w,a,h,P]),B=(0,t.useCallback)(e=>{let t=Wl(e,R());w||T(t)},[R,w]),V=(0,t.useCallback)(e=>{let t=Gl(e,R(),i);w||T(t)},[R,i,w]),ge=(0,t.useCallback)(()=>{let e=bl(Tl(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(Zl(n))return;if(e.preventDefault(),!O){ge();return}let r=Ql(Cl(O),t,k.current.querySelector.bind(k.current));if(r){let e=k.current.querySelector(`button[data-date="${bl(r)}"]`);e instanceof HTMLButtonElement&&!e.dataset.disabled&&(le(bl(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=$l(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 nu=({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?Rl(r,i,a):zl(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 ru(e,t,n){let r=wl(n.year,n.month,e),i=bl(r),a=i===bl(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:Ol(r),tabindex:c}}function iu(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===bl(t.rangeHovered)})}function au(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===bl(t.rangeHovered),"pkt-calendar__date--range-start":o,"pkt-calendar__date--range-end":s})}var ou=({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=ru(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=iu(r,x),p=au(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=ql(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=Jl(r,n,a,t);if(o===`current-month`)i.push(C(a,e)),a++;else{let e=Yl(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})()})]})},su=(0,t.forwardRef)((e,r)=>{let i=tu(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)(nu,{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)(ou,{state:i})]})});su.displayName=`PktCalendar`;var cu=(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})]})});cu.displayName=`PktTag`;var lu=(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)(cu,{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()]})]})})});lu.displayName=`PktCard`;var uu=(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})]})]})})});uu.displayName=`PktCheckbox`;function du(e){let n=(0,t.useRef)(null),r=(0,t.useRef)(!1),i=(0,t.useRef)(void 0),a=e=>{let t=n.current;t&&(e===void 0?delete t.dataset.navtype:t.dataset.navtype=e)};return(0,t.useEffect)(()=>()=>{i.current!==void 0&&clearTimeout(i.current)},[]),{ref:t=>{n.current=t,typeof e==`function`?e(t):e&&(e.current=t)},onPointerDown:()=>{r.current=!0,i.current!==void 0&&clearTimeout(i.current),i.current=window.setTimeout(()=>{r.current=!1,i.current=void 0},0)},onFocus:()=>{a(r.current?`pointer`:void 0)},onBlur:e=>{n.current?.contains(e.relatedTarget)||a(void 0)}}}var fu=(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=du(T),re=y||(i?`${e}-helptext`:void 0),D=!!s,ie=D&&ee===`top`,ae=D&&ee===`bottom`,oe=()=>te(e=>!e),se=[`pkt-inputwrapper`,S,h?`pkt-inputwrapper--error`:``,_?`pkt-inputwrapper--disabled`:``,v?`pkt-inputwrapper--inline`:``].filter(Boolean).join(` `),ce=[`pkt-tag`,`pkt-tag--small`,`pkt-tag--thin-text`].join(` `),O=()=>D?(0,n.jsxs)(`div`,{className:`pkt-input__counter`,"aria-live":`polite`,"aria-atomic":`true`,children:[c,l?`/${l}`:``]}):null,le=()=>(0,n.jsxs)(n.Fragment,{children:[m&&(0,n.jsx)(`span`,{className:ce+` pkt-tag--gray`,children:m}),u&&(0,n.jsx)(`span`,{className:ce+` pkt-tag--blue-light`,children:d}),f&&(0,n.jsx)(`span`,{className:ce+` pkt-tag--beige`,children:p})]}),k=(0,n.jsxs)(n.Fragment,{children:[(()=>{let t=(0,n.jsxs)(n.Fragment,{children:[r,` `,le()]});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":re,id:`${e}-label`,children:t}):(0,n.jsx)(`label`,{htmlFor:e,className:`pkt-sr-only`,"aria-describedby":re,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)(Ks,{skin:`tertiary`,size:`small`,variant:`icon-right`,iconName:E?`chevron-thin-up`:`chevron-thin-down`,className:`pkt-link pkt-link--icon-right`,onClick:oe,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})]})]}),ie&&(0,n.jsx)(O,{}),x,ae&&(0,n.jsx)(O,{}),h&&g&&(0,n.jsx)(`div`,{className:`pkt-inputwrapper__alert-wrapper`,children:(0,n.jsx)(Us,{skin:`error`,"aria-live":`assertive`,role:`alert`,id:`${e}-error`,compact:!0,children:g})})]});return(0,n.jsx)(`div`,{className:se,role:w,...ne,children:C?(0,n.jsx)(`fieldset`,{className:`pkt-inputwrapper__fieldset`,"aria-describedby":re,children:k}):(0,n.jsx)(`div`,{className:`pkt-inputwrapper__fieldset`,children:k})})});fu.displayName=`PktInputWrapper`;var pu=(e,t)=>t&&(e.find(e=>e.value===t)||e.find(e=>e.label===t))||null,mu=(e,t)=>{if(!t)return-1;let n=e.findIndex(e=>e.value===t);return n>=0?n:e.findIndex(e=>e.label===t)},hu=(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))},gu=e=>e.value+(e.label||``)+(e.prefix||``),_u=(e,t)=>t!==null&&e>=t,vu=(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}},yu=(e,t)=>e?Array.isArray(e)?t?e:e.length>0?[e[0]]:[]:t?e.split(`,`).filter(Boolean):[e]:[],bu=(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}},xu=(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:``}},Su=(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}},Cu=(e,t,n,r,i)=>{if(!e)return{action:`none`,value:null};let a=pu(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}},wu=(e,t,n)=>{let r=pu(t,e);return n===`label`&&r?.label?r.label:e},Tu=e=>{e.scrollIntoView({block:`nearest`}),window.setTimeout(()=>e.focus(),0)},Eu=e=>Array.from(e.querySelectorAll(`[role="option"]:not([data-disabled])`)||[]),Du=e=>{let t=e.nextElementSibling;t&&Tu(t)},Ou=(e,t,n)=>{let r=e.previousElementSibling;if(e.dataset.index===`0`&&n){let e=t.querySelector(`[role="searchbox"]`);e&&Tu(e)}else r&&Tu(r)},ku=e=>{let t=Eu(e);t[0]&&Tu(t[0])},Au=(e,t)=>{if(t.disabled)return;let n=Eu(e);if(t.allowUserInput&&t.customUserInput){let t=e.querySelector(`[data-type="new-option"]`);if(t){Tu(t);return}}let r=n.find(e=>e.dataset.selected===`true`);if(r){Tu(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]&&Tu(n[0])},ju=({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=pu(a,e),f=i?.tagSkinColor,p=i?vu(i,s):e;return o?(0,n.jsx)(`li`,{role:`listitem`,children:(0,n.jsx)(cu,{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)(cu,{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)(cu,{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})},Mu=({state:e})=>{let{values:t,options:r,editingSingleValue:i,displayValueAs:a}=e;if(i||t.length===0)return null;let o=pu(r,t[0]);return o?(0,n.jsx)(`span`,{className:`pkt-combobox__value`,children:vu(o,a)}):null},Nu=({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]&&pu(o,a[0])?`${i}-${mu(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)(ju,{state:e}):re?null:(0,n.jsx)(Mu,{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`})]})},Pu=({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 Fu(e,t){return e.map(e=>({...e,label:e.label||e.value,fulltext:gu(e),selected:t.includes(e.value)}))}function Iu(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:gu(e)})):s&&s.length>0?s.map(e=>({...e,fulltext:gu(e)})):P.length>0?P.map(e=>({...e,fulltext:gu(e)})):[],[c,s,P]),I=a!==void 0,[fe,pe]=(0,t.useState)(()=>yu(a??o,l)),L=(0,t.useRef)(fe);(0,t.useEffect)(()=>{I&&pe(yu(a,l))},[a,I,l]);let R=I?yu(a,l):fe,[me,he]=(0,t.useState)([]),z=(0,t.useMemo)(()=>Fu([...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=_u(R.length,u??null),Ae=l&&u!=null,je=(0,t.useMemo)(()=>ge?d?bu(z,ge).filtered:hu(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]?wu(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&&_u(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);pu(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(pu(z,e)||_u(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=wu(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=pu(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=_u(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=pu(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}=Cu(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=wu(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=xu(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}=bu(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=Su(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),Au(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=wu(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&&Au(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&&Au(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&&Au(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(),Du(e.currentTarget);break;case`ArrowUp`:e.preventDefault(),j.current&&Ou(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&&ku(j.current);break;case`ArrowUp`:e.preventDefault(),j.current&&Ou(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 Lu=(0,t.forwardRef)((e,t)=>{let r=Iu(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)(fu,{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)(Nu,{state:r}),(0,n.jsx)(Pu,{state:r})]}),r.tagPlacement===`outside`&&r.multiple&&(0,n.jsx)(ju,{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`})]})});Lu.displayName=`PktCombobox`;var Ru=x({tagName:`pkt-consent`,elementClass:ps,react:t.default,displayName:`PktConsent`,events:{onToggleConsent:`toggle-consent`}});Ru.displayName=`PktConsent`;var zu=()=>{let e=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(e)||/Macintosh/.test(e)&&`ontouchend`in document)},Bu=()=>zu()?`text`:`date`,Vu=e=>!e||e.length!==2?!0:Fl(e[0],e[1]),Hu=(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`}),Uu=()=>({"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}),Wu=e=>({"pkt-input-prefix":e,"pkt-hide":!e}),Gu=(e,t,n)=>!t&&!n?Array.isArray(e)?e[0]||``:e:Array.isArray(e)?e.join(`,`):e,Ku=(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},qu=(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())},Ju=({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&&Ku(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)(su,{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})})},Yu=({dates:e,dateformat:t,idBase:r,strings:i,onDateRemoved:a})=>{let o=Pl(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=Sl(e,t);return(0,n.jsx)(cu,{id:`${r}${e}-tag`,closeTag:!0,ariaLabel:`${s} ${i}`,onClose:()=>a(e),children:(0,n.jsx)(`time`,{dateTime:e,children:i})},e)})})},Xu=({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)(Yu,{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()]})})},Zu={calendar:{buttonAltText:`Åpne kalender`}},Qu={calendar:{buttonAltText:`Åpne kalender`},generic:{from:`Fra`,to:`Til`}},$u=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 ed(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?[]:$u(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)(()=>Bu(),[]),ve=(0,t.useMemo)(()=>zu(),[]),U=(0,t.useMemo)(()=>oe??(u?Qu:Zu),[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=Hu(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=Uu();return Object.entries(e).filter(([,e])=>e).map(([e])=>e).join(` `)},[]),Ce=(0,t.useMemo)(()=>{let e=Wu(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=$u(Gu(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&&!Vu(L)&&(Ae([L[0]]),Me([L[0]]))},[L,Ae,Me]),He=(0,t.useCallback)(e=>{let t=Cl(e),n=ye?Cl(ye):null,r=be?Cl(be):null;if(t&&!isNaN(t.getTime())&&(!n||t>=n)&&(!r||t<=r)){let t=Nl([...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=>{qu(e.nativeEvent,()=>Ne(),()=>We(z.current),void 0,()=>z.current?.blur())},[Ne,We]),Ke=(0,t.useCallback)(e=>{qu(e.nativeEvent,()=>Ne(),()=>We(z.current),()=>B.current?.focus(),()=>z.current?.blur())},[Ne,We]),qe=(0,t.useCallback)(e=>{qu(e.nativeEvent,()=>Ne(),()=>We(B.current),void 0,()=>B.current?.blur())},[Ne,We]),K=(0,t.useCallback)(e=>{qu(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 td=(0,t.forwardRef)((e,t)=>{let r=ed(e,t);return(0,n.jsxs)(`div`,{className:[`pkt-datepicker`,r.className].filter(Boolean).join(` `),id:r.id||void 0,children:[(0,n.jsx)(fu,{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)(Xu,{state:r})}),(0,n.jsx)(Ju,{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`})]})});td.displayName=`PktDatepicker`;var nd={hours:`Timer`,minutes:`Minutter`,openPicker:`Åpne tidspunkt-velger`,prevTime:`Forrige tidspunkt`,nextTime:`Neste tidspunkt`,selectTime:`Velg tidspunkt`},rd={dropZoneDragMultiple:`Dra filer hit for å laste dem opp eller`,dropZoneDragSingle:`Dra en fil hit for å laste den opp eller`,dropZoneDragMultipleThumbnail:`Dra bilder hit for å laste dem opp eller`,dropZoneDragSingleThumbnail:`Dra et bilde hit for å laste det opp eller`,dropZoneDragActiveMultiple:`Slipp filene her`,dropZoneDragActiveSingle:`Slipp filen her`,dropZoneDragActiveMultipleThumbnail:`Slipp bildene her`,dropZoneDragActiveSingleThumbnail:`Slipp bildet her`,dropZoneOpenFileDialogMultiple:`velg filer`,dropZoneOpenFileDialogSingle:`velg en fil`,dropZoneOpenFileDialogMultipleThumbnail:`velg fra kamerarull`,dropZoneOpenFileDialogSingleThumbnail:`velg fra kamerarull`,supportedFormatsPrefix:`Format:`,invalidFormatDefault:e=>`Ugyldig filtype. Tillatte formater: ${e}`,sizeTooLargeDefault:e=>`Filen er for stor. Maks størrelse er ${e}.`,requiredMissing:`Du må laste opp minst én fil.`,genericValidationRejection:`Filen ble avvist av validering.`,unknownFilename:`Ukjent fil`,fileLabel:e=>e===1?`fil`:`filer`,srFileAdded:e=>`Filen «${e}» er lagt til`,srFilesAdded:e=>`${e} filer er lagt til`,srFilesUploadedOfTotal:(e,t,n)=>`${e} av ${t} ${n} lastet opp`,srFilesFailedOfTotal:(e,t,n)=>`Feil ved opplasting: ${e} av ${t} ${n} feilet`};function id(e){if(e==null||e===``)return;if(typeof e==`number`)return Number.isFinite(e)&&e>0?e:void 0;let t=String(e).trim(),n=Number(t);if(!Number.isNaN(n)&&n>0)return n;let r=t.match(/^(\d+(?:\.\d+)?)\s*(B|KB|MB|GB)$/i);if(!r){console.warn(`PktFileUpload: Invalid maxFileSize format "${t}". Use format like "5MB", "500KB", "1GB", or bytes.`);return}let i=parseFloat(r[1]);switch(r[2].toUpperCase()){case`B`:return i;case`KB`:return i*1024;case`MB`:return i*1024*1024;case`GB`:return i*1024*1024*1024;default:return}}function ad(e){return e<1024?`${Math.round(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`}function od(e){return Array.isArray(e)?e.map(e=>String(e).trim().toLowerCase()).filter(Boolean):[]}function sd(e,t,n){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}function cd(e,t){let n=od(t);if(n.length===0)return!0;let r=e.name.split(`.`).pop()?.toLowerCase()??``,i=e.type.toLowerCase();return n.some(e=>sd(e,r,i))}function ld(e,t){let n=(e??``).trim();if(n)return n;let r=od(t);return r.length===0?``:r.map(e=>e.includes(`/`)||e.startsWith(`.`)?e:`.${e}`).join(`, `)}function ud(e,t,n){return((e??``).trim()||t).replace(/\{(\w+)\}/g,(e,t)=>n[t]??`{${t}}`)}function dd(e,t){let n=od(t.allowedFormats);if(n.length>0&&!cd(e,n)){let e=n.join(`, `),r=`Ugyldig filtype. Tillatte formater: ${e}`;return ud(t.formatErrorMessage,r,{formats:e})}let r=id(t.maxFileSize);if(r!==void 0&&e.size>r){let e=ad(r),n=`Filen er for stor. Maks størrelse er ${e}.`;return ud(t.sizeErrorMessage,n,{maxSize:e})}if(t.onFileValidation){let n=t.onFileValidation(e);if(n)return n}return null}function fd(e){let t=e.file;if(t?.type?.startsWith(`image/`))return!0;let n=e.attributes?.targetFilename||t?.name||``;return/\.(jpe?g|png|gif|webp|heic|heif|bmp|svg)$/i.test(n)}function pd(e){return typeof e==`number`?`in-progress`:e===`error`?`error`:`idle`}function md(e,t,n){let r={"in-progress":0,error:1,idle:2};return e.map(e=>{let r=t?.find(t=>t.fileId===e.fileId);return{...e,progress:r?.progress??(n===`form`?`done`:`queued`),errorMessage:r?.errorMessage,showProgress:r?.showProgress,lastProgress:r?.lastProgress}}).sort((e,t)=>r[pd(e.progress)]-r[pd(t.progress)])}function hd(e){if(!e)return[];let t=[`a[href]:not([tabindex="-1"])`,`button:not([disabled]):not([tabindex="-1"])`,`input:not([disabled]):not([type="hidden"]):not([tabindex="-1"])`,`select:not([disabled]):not([tabindex="-1"])`,`textarea:not([disabled]):not([tabindex="-1"])`,`[tabindex]:not([tabindex="-1"])`].join(`, `);return Array.from(e.querySelectorAll(t)).filter(e=>!e.hasAttribute(`inert`))}function gd(e,t){if(e.key!==`Tab`)return!1;let n=hd(t);if(n.length===0)return e.preventDefault(),!0;let r=n[0],i=n[n.length-1],a=(t?.ownerDocument??document).activeElement,o=!!a&&n.includes(a);return e.shiftKey?!o||a===r?(e.preventDefault(),i.focus(),!0):!1:!o||a===i?(e.preventDefault(),r.focus(),!0):!1}function _d(e,t){return!t||t<=0||e.length<=t+3?null:{head:e.slice(0,e.length-t),tail:e.slice(-t)}}function vd(e,t,n){return n<=0?0:t===`prev`?e<=0?n-1:e-1:e>=n-1?0:e+1}function yd(e,t){let n=e.length;if(n===0||!t||t.length===0)return{totalCount:n,uploadedCount:0,failedCount:0};let r=0,i=0;for(let n of e){let e=t.find(e=>e.fileId===n.fileId);e?.progress===`done`?r++:e?.progress===`error`&&i++}return{totalCount:n,uploadedCount:r,failedCount:i}}var bd=`.jpeg, .jpg, .png, .gif, .webp, .heic`;function xd(e,t=rd.unknownFilename){return e.attributes?.targetFilename||e.file?.name||t}var Sd=()=>(`00000000000000000`+(Math.random()*0x10000000000000000).toString(16)).slice(-16),Cd=()=>{let e=Sd(),t=Sd();return e.slice(0,8)+`-`+e.slice(8,12)+`-4`+e.slice(13)+`-a`+t.slice(1,4)+`-`+t.slice(4)},wd=class{fileId;file;attributes;constructor(e,t){this.fileId=t||Cd(),this.file=e,this.attributes={targetFilename:e.name}}},Td=(0,t.createContext)({}),Ed=(0,t.forwardRef)(({id:e,multiple:r,value:i,onFilesAdded:a=()=>{},name:o,uploadStrategy:s,accept:c,isThumbnailView:l=!1,disabled:u=!1,hasVisibleLabel:d=!1,...f},p)=>{let m=(0,t.useRef)(null),h=typeof c==`string`&&c.trim().length>0?c:void 0,g=(0,t.useMemo)(()=>h?h.split(/\s*,\s*/).map(e=>e.trim()).filter(Boolean).join(`, `).toUpperCase():``,[h]);(0,t.useImperativeHandle)(p,()=>m.current);let[_,v]=(0,t.useState)(!1),y=(0,t.useMemo)(()=>l?r?{dragInactive:rd.dropZoneDragMultipleThumbnail,dragActive:rd.dropZoneDragActiveMultipleThumbnail,openFileDialog:rd.dropZoneOpenFileDialogMultipleThumbnail}:{dragInactive:rd.dropZoneDragSingleThumbnail,dragActive:rd.dropZoneDragActiveSingleThumbnail,openFileDialog:rd.dropZoneOpenFileDialogSingleThumbnail}:r?{dragInactive:rd.dropZoneDragMultiple,dragActive:rd.dropZoneDragActiveMultiple,openFileDialog:rd.dropZoneOpenFileDialogMultiple}:{dragInactive:rd.dropZoneDragSingle,dragActive:rd.dropZoneDragActiveSingle,openFileDialog:rd.dropZoneOpenFileDialogSingle},[r,l]),b=(0,t.useCallback)(e=>{if(m.current)try{m.current.files=Dd(e)}catch{}},[m.current,i]);(0,t.useEffect)(()=>{b(i)},[m,i]);let x=(0,t.useCallback)(e=>{a(e.map(e=>new wd(e))),m.current&&(m.current.value=``)},[a]),S=e=>{let t=e.target.files;if(t.length===0){b(i);return}x(Array.from(t))},C=e=>{x(e)};return(0,n.jsxs)(`div`,{onDrop:e=>{if(e.preventDefault(),v(!1),u)return;let t=e.dataTransfer.files;C(Array.from(t))},onDragOver:e=>{e.preventDefault(),!u&&v(!0)},onDragLeave:()=>{v(!1)},onClick:(0,t.useCallback)(e=>{u||e.target.closest(`.pkt-fileupload__drop-zone__placeholder__title__open-file-dialog`)||m.current?.click()},[u]),className:(0,$.default)(`pkt-fileupload__drop-zone`,{"pkt-fileupload__drop-zone--drag-active":_,"pkt-fileupload__drop-zone--disabled":u}),children:[(0,n.jsx)(`input`,{...f,id:e,type:`file`,ref:m,multiple:r,onChange:S,accept:h,disabled:u,name:s===`form`&&o||void 0,"aria-label":d?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:_?`${y.dragActive} ...`:(0,n.jsxs)(n.Fragment,{children:[y.dragInactive,` `,(0,n.jsx)(`button`,{className:`pkt-fileupload__drop-zone__placeholder__title__open-file-dialog`,onClick:e=>{e.preventDefault(),e.stopPropagation(),m.current?.click()},type:`button`,children:y.openFileDialog})]})}),g?(0,n.jsxs)(`p`,{className:`pkt-fileupload__drop-zone__placeholder__formats`,children:[rd.supportedFormatsPrefix,` `,g]}):null]})]})}),Dd=e=>{let t=new DataTransfer;for(let n of e)t.items.add(n.file);return t.files},Od=(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)(fu,{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:e=>{A(e?.value?.length||0),typeof oe==`function`&&oe(e)},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})})});Od.displayName=`PktTextarea`;var kd=`comments`,Ad=e=>{let t=new Date(e);return Number.isNaN(t.getTime())?e:`${String(t.getDate()).padStart(2,`0`)}.${String(t.getMonth()+1).padStart(2,`0`)}.${t.getFullYear()} kl. ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`},jd=({fileItem:e,disabled:r,closeOperationUi:i,onAddComment:a,existingComment:o})=>{let s=(0,t.useRef)(null),c=!!o;return(0,t.useLayoutEffect)(()=>{let e=setTimeout(()=>s.current?.focus({preventScroll:!0}),0);return()=>clearTimeout(e)},[e.fileId]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Od,{autoFocus:!0,label:c?`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:s,disabled:r,defaultValue:o?.text}),(0,n.jsx)(Ks,{skin:`secondary`,size:`small`,disabled:r,onClick:()=>{let e=s.current?.value?.trim();e&&a({text:e,timestamp:new Date().toISOString()}),i()},children:c?`Lagre kommentar`:`Legg til kommentar`}),(0,n.jsx)(Ks,{skin:`tertiary`,size:`small`,disabled:r,onClick:i,children:`Avbryt`})]})},Md=({comment:e,disabled:t,onDeleteComment:r,onEditComment:i})=>(0,n.jsx)(`div`,{className:`pkt-fileupload__queue-display__item__comments`,children:(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:Ad(e.timestamp)})]}),(0,n.jsxs)(`div`,{className:`pkt-fileupload__queue-display__item__comment__actions`,children:[(0,n.jsx)(`button`,{type:`button`,className:`pkt-fileupload__queue-display__item__comment__action`,onClick:i,disabled:t,"aria-label":`Rediger kommentar`,children:(0,n.jsx)(Q,{name:`edit`})}),(0,n.jsx)(`button`,{type:`button`,className:`pkt-fileupload__queue-display__item__comment__action`,onClick:r,disabled:t,"aria-label":`Slett kommentar`,children:(0,n.jsx)(Q,{name:`trash-can`})})]})]})}),Nd=({comments:e})=>(0,n.jsx)(`input`,{type:`hidden`,name:`${(0,t.useContext)(Td).name}-comments`,value:e?JSON.stringify(e):``}),Pd=e=>e.getAttribute(kd)??[],Fd={id:`comment`,title:e=>(e.attributes?.[kd]??[]).length>0?``:`Legg til kommentar`,ariaLabel:`Legg til kommentar`,renderExtendedUI:e=>{let t=Pd(e)[0];return(0,n.jsx)(jd,{fileItem:e.file,disabled:e.disabled,closeOperationUi:e.close,onAddComment:t=>{e.setAttribute(kd,[t])},existingComment:t})},renderContent:e=>{if(e.isActive)return null;let t=Pd(e)[0];return t?(0,n.jsx)(Md,{comment:t,disabled:e.disabled,onEditComment:e.activate,onDeleteComment:()=>e.setAttribute(kd,void 0)}):null},renderHidden:e=>(0,n.jsx)(Nd,{comments:e.getAttribute(kd)},`comments${e.file.fileId}`)},Id=e=>({id:`remove`,title:`Slett`,ariaLabel:`Slett fil`,onClick:({file:t})=>e(t.fileId)}),Ld=({initialValue:e,disabled:r,onSave:i,onCancel:a})=>{let o=(0,t.useRef)(null),s=(0,t.useId)(),c=()=>i(o.current?.value??``);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`label`,{htmlFor:s,className:`pkt-sr-only`,children:`Endre filnavn`}),(0,n.jsx)(`input`,{id:s,ref:o,type:`text`,autoFocus:!0,disabled:r,defaultValue:e,className:`pkt-fileupload__queue-display__item__rename-input`,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),c()),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),a())}}),(0,n.jsx)(Ks,{skin:`secondary`,size:`small`,disabled:r,onClick:c,children:`Lagre`}),(0,n.jsx)(Ks,{skin:`tertiary`,size:`small`,disabled:r,onClick:a,children:`Avbryt`})]})},Rd=({targetFilename:e})=>(0,n.jsx)(`input`,{type:`hidden`,name:`${(0,t.useContext)(Td).name}-targetFilename`,value:e}),zd=e=>e.getAttribute(`targetFilename`)||xd(e.file,``),Bd={id:`rename`,title:`Rediger`,ariaLabel:`Rediger filnavn`,renderInlineUI:e=>(0,n.jsx)(Ld,{initialValue:zd(e),disabled:e.disabled,onSave:t=>{let n=t.trim();n&&e.setAttribute(`targetFilename`,n),e.close()},onCancel:e.close}),renderHidden:e=>(0,n.jsx)(Rd,{targetFilename:zd(e)},`rename${e.file.fileId}`)},Vd=(e,n)=>{let r=(0,t.useCallback)((t,n)=>e.find(e=>e.fileId===t)?.attributes?.[n],[e]),i=(0,t.useCallback)((t,r,i)=>{let a=e.find(e=>e.fileId===t);if(!a)return;let o={...a.attributes,[r]:i};i===void 0&&delete o[r],n(t,{attributes:o})},[n,e]);return{fileAttributes:(0,t.useMemo)(()=>e=>({get:t=>r(t,e),set:(t,n)=>i(t,e,n)}),[r,i]),buildAttributeAccessors:(0,t.useCallback)(e=>({getAttribute:t=>r(e,t),setAttribute:(t,n)=>i(e,t,n)}),[r,i])}},Hd=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=>vd(n,t,e.length))},[e.length])}},Ud=e=>{let[n,r]=(0,t.useState)({});return(0,t.useEffect)(()=>{r(t=>{let n=new Set(e.map(e=>e.id)),r=!1,i={};for(let[e,a]of Object.entries(t))n.has(a)?i[e]=a:r=!0;return r?i:t})},[e]),{getActivated:(0,t.useCallback)(t=>{let r=n[t];if(r)return e.find(e=>e.id===r)},[n,e]),activate:(0,t.useCallback)((e,t)=>{r(n=>({...n,[e]:t.id}))},[]),close:(0,t.useCallback)(e=>{r(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n})},[])}},Wd=(e,{uploadStrategy:n,required:r,currentFileCount:i,onMissingFiles:a})=>{(0,t.useEffect)(()=>{if(n!==`custom`||!r)return;let t=e.current?.form;if(!t)return;let o=e=>{i>0||(e.preventDefault(),a())};return t.addEventListener(`submit`,o),()=>{t.removeEventListener(`submit`,o)}},[e,n,r,i,a])},Gd=(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=(0,t.useCallback)(e=>{_.current=e,typeof g==`function`?g(e):g&&(g.current=e)},[g]),y=(0,t.useCallback)(()=>{_.current?.open&&(_.current.close(),m?.())},[m]);(0,t.useEffect)(()=>{let e=_.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()},[]),(0,t.useEffect)(()=>{i?_.current?.open||_.current?.showModal():_.current?.open&&_.current.close()},[i]);let b=(0,t.useCallback)(e=>{s&&e.target===_.current&&y()},[s,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)(Ks,{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})})]})})});Gd.displayName=`PktModal`;var Kd=(0,t.createContext)({tail:5}),qd=({children:e,tail:r})=>{let i=(0,t.useContext)(Kd),a=_d(e,r===void 0?i.tail:r);return a?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`span`,{className:`pkt-fileupload__queue-display__item__title__head`,"data-pkt-truncate-part":`first`,children:a.head}),(0,n.jsx)(`span`,{className:`pkt-fileupload__queue-display__item__title__tail`,"data-pkt-truncate-part":`tail`,children:a.tail})]}):(0,n.jsx)(`span`,{"data-pkt-truncate-part":`first`,children:e})},Jd=e=>(0,n.jsx)(`button`,{type:`button`,onClick:e.onClick,disabled:e.disabled,className:`pkt-fileupload__queue-display__item__cancel-button`,"aria-label":e.ariaLabel||`Avbryt opplasting`,children:e.label||`Avbryt`}),Yd=()=>(0,n.jsx)(`span`,{className:`pkt-fileupload__queue-display__item__loading-text`,"aria-label":`Laster opp fil`,children:`Laster opp`}),Xd=({cancelTransfer:e,transferItem:t,disabled:r=!1})=>{let i=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.jsxs)(`p`,{className:`pkt-fileupload__queue-display__item__title`,"aria-label":`Filnavn`,children:[(0,n.jsx)(qd,{children:xd(t)}),(0,n.jsxs)(`span`,{className:`pkt-fileupload__queue-display__item__filesize`,children:[` `,`(`,ad(t.file.size),`)`]})]}),(0,n.jsx)(Jd,{onClick:e,disabled:r}),i?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Bf,{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__percentage`,"aria-hidden":`true`,children:`${Math.round(t.progress*100)}%`})]}):(0,n.jsx)(Yd,{})]})},Zd=({transferItem:e})=>(0,n.jsxs)(`p`,{className:`pkt-fileupload__queue-display__item__title`,children:[(0,n.jsx)(qd,{children:xd(e)}),e.file&&(0,n.jsxs)(`span`,{className:`pkt-fileupload__queue-display__item__filesize`,children:[` `,`(`,ad(e.file.size),`)`]})]}),Qd=({transferItem:e,onRemove:t,disabled:r})=>{let i=(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)(Zd,{transferItem:e}),(0,n.jsx)(Jd,{onClick:t,label:`Fjern`,ariaLabel:`Fjern fil som feilet under opplasting`,disabled:r}),(0,n.jsx)(Bf,{valueCurrent:i,statusType:`none`,valueMax:100,statusPlacement:`following`,className:`pkt-fileupload__queue-display__item__progress pkt-fileupload__queue-display__item__progress--error`}),e.errorMessage&&(0,n.jsx)(`span`,{className:`pkt-fileupload__queue-display__item__error-message`,children:e.errorMessage})]})},$d=({transferItem:e,onRemove:t,disabled:r})=>(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)(Zd,{transferItem:e}),(0,n.jsx)(Jd,{onClick:t,label:`Fjern`,ariaLabel:`Fjern fil som feilet under opplasting`,disabled:r}),e.errorMessage&&(0,n.jsx)(`span`,{className:`pkt-fileupload__queue-display__item__error-message`,children:e.errorMessage})]}),ef=({transferItem:e,onRemove:t,disabled:r})=>e.showProgress?(0,n.jsx)(Qd,{transferItem:e,onRemove:t,disabled:r}):(0,n.jsx)($d,{transferItem:e,onRemove:t,disabled:r}),tf=({operation:e,context:t})=>{let r=typeof e.title==`function`?e.title(t.file):e.title;return r?(0,n.jsx)(`button`,{type:`button`,className:`pkt-fileupload__queue-display__item__operation`,onClick:()=>{(e.renderInlineUI||e.renderExtendedUI)&&t.activate(),e.onClick?.(t)},disabled:t.disabled,"aria-label":typeof e.ariaLabel==`function`?e.ariaLabel(t.file):e.ariaLabel,children:r}):null},nf=({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)(Zd,{transferItem:e})]}),rf=({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)(Ks,{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)(`span`,{className:`pkt-fileupload__queue-display__item__thumbnail__title`,children:(0,n.jsx)(qd,{children:e.attributes.targetFilename})})]})},af=({isOpen:e,images:r,currentIndex:i,onClose:a,onNavigate:o,modalRef: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=>{if(e.key===`Tab`){gd(e,s.current);return}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,s]),f?(0,n.jsx)(Gd,{ref:s,headingText:f.attributes.targetFilename,closeOnBackdropClick:!0,className:`pkt-fileupload__image-preview-modal`,onClose:a,children:(0,n.jsxs)(`div`,{className:`pkt-fileupload__image-preview`,children:[p&&(0,n.jsx)(Ks,{variant:`icon-only`,iconName:`chevron-thin-left`,skin:`secondary`,size:`medium`,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)(Ks,{variant:`icon-only`,iconName:`chevron-thin-right`,skin:`secondary`,size:`medium`,className:`pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--next`,onClick:()=>o(`next`),"aria-label":`Neste bilde ${i+2} / ${r.length}`})]})}):null},of=({operation:e,transferItem:t,inputName:n,disabled:r,activatedOperation:i,onActivate:a,onClose:o,buildAttributeAccessors:s})=>{let c=s(t.fileId);return{file:t,inputName:n,disabled:r,isActive:i?.id===e.id,activate:()=>a(t.fileId,e),close:()=>o(t.fileId),getAttribute:c.getAttribute,setAttribute:c.setAttribute}},sf=(e,t)=>e.map(e=>({operation:e,context:of({operation:e,...t})})),cf=e=>(0,n.jsx)(`div`,{className:`pkt-fileupload__queue-display__item__actions`,children:sf(e.operations,e).filter(({operation:t})=>t.id!==e.activatedOperation?.id).map(({operation:e,context:t})=>(0,n.jsx)(tf,{operation:e,context:t},e.id))}),lf=e=>(0,n.jsx)(n.Fragment,{children:sf(e.operations,e).filter(({operation:e})=>e.renderContent).map(({operation:e,context:t})=>(0,n.jsx)(`div`,{className:`pkt-fileupload__queue-display__item__operation-content`,children:e.renderContent(t)},e.id))}),uf=e=>{let{transferItem:t,activatedOperation:r,operations:i,ItemRenderer:a,onPreviewClick:o}=e,s=r?of({operation:r,...e}):void 0,c=r?.renderInlineUI||r?.renderExtendedUI?[]:i;return(0,n.jsxs)(n.Fragment,{children:[r?.renderInlineUI&&s?(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:r.renderInlineUI(s)})]}):(0,n.jsx)(a,{transferItem:t,queueItemOperations:i,onPreviewClick:o}),c.length>0&&(0,n.jsx)(cf,{...e,operations:c}),(0,n.jsx)(lf,{...e}),r?.renderExtendedUI&&s&&(0,n.jsx)(`div`,{className:`pkt-fileupload__queue-display__item__expanded-operation-ui`,children:r.renderExtendedUI(s)})]})},df=e=>{let{transferItem:t,enableImagePreview:r,onCancelTransfer:i,onOpenPreview:a,disabled:o}=e,s=pd(t.progress),c=r&&t.progress===`done`&&fd(t);switch(s){case`in-progress`:return(0,n.jsx)(Xd,{transferItem:t,cancelTransfer:()=>i(t.fileId),disabled:o});case`error`:return(0,n.jsx)(ef,{transferItem:t,onRemove:()=>i(t.fileId),disabled:o});case`idle`:return(0,n.jsx)(uf,{...e,onPreviewClick:c?()=>a(t.fileId):void 0})}},ff=(e,n,r)=>(0,t.useMemo)(()=>md(e,n,r),[e,n,r]),pf=(e,n)=>(0,t.useMemo)(()=>n?e.filter(e=>e.progress===`done`&&fd(e)):[],[e,n]),mf=({files:e,cancelTransfer:t,transfers:r=[],queueItemOperations:i=[],ItemRenderer:a=nf,truncateTail:o,enableImagePreview:s=!1,uploadStrategy:c=`form`,disabled:l=!1,inputName:u,buildAttributeAccessors:d})=>{let f=ff(e,r,c),p=pf(f,s),m=Ud(i),h=Hd(p);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`ul`,{className:`pkt-fileupload__queue-display`,children:(0,n.jsx)(Kd.Provider,{value:{tail:o},children:f.map(e=>{let r={transferItem:e,operations:i,activatedOperation:m.getActivated(e.fileId),inputName:u,disabled:l,onActivate:m.activate,onClose:m.close,buildAttributeAccessors:d};return(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=>(0,n.jsx)(`span`,{children:t.renderHidden(of({operation:t,...r}))},`${t.id}-${e.fileId}`)),(0,n.jsx)(df,{...r,ItemRenderer:a,enableImagePreview:s,onCancelTransfer:t,onOpenPreview:h.open})]},e.fileId)})})}),s&&p.length>0&&(0,n.jsx)(af,{modalRef:h.modalRef,isOpen:h.isOpen,images:p,currentIndex:h.currentIndex,onClose:h.close,onNavigate:h.navigate})]})},hf={filename:nf,thumbnail:rf},gf=(0,t.forwardRef)(({value:e,defaultValue:r,id:i,multiple:a=!1,uploadStrategy:o=`form`,addCommentsEnabled:s=!1,renameFilesEnabled:c=!1,truncateTail:l=4,onFilesChanged:u,onFileUploadRequested:d,extraOperations:f=[],itemRenderer:p=hf.filename,fullwidth:m=!1,allowedFormats:h,formatErrorMessage:g,maxFileSize:_,sizeErrorMessage:v,onFileValidation:y,onFileValidate:b,errorMessage:x,hasError:S=!1,disabled:C=!1,label:w,helptext:ee,optionalTag:T,requiredTag:E,required:te=!1,enableImagePreview:ne=!1,"aria-describedby":re,"aria-invalid":D,...ie},ae)=>{let oe=(0,t.useId)(),se=i??`pkt-fileupload-${oe}`,ce=(0,t.useRef)(null);(0,t.useImperativeHandle)(ae,()=>ce.current,[]);let O=`transfers`in ie?ie.transfers:void 0,[le,k]=(0,t.useState)(null),[A,ue]=(0,t.useState)(``);(0,t.useEffect)(()=>{if(!A)return;let e=setTimeout(()=>ue(``),1500);return()=>clearTimeout(e)},[A]);let de=le??x??null,j=S||!!le||!!(x&&x.trim()),M=de?`${se}-error`:void 0,N=[re,ee?`${se}-helptext`:void 0,M].filter(Boolean).join(` `)||void 0,P=j||D===!0||D===`true`,F=(0,t.useCallback)(e=>{let t=dd(e,{allowedFormats:h,maxFileSize:_,formatErrorMessage:g,sizeErrorMessage:v,onFileValidation:y});if(t)return t;if(b){let t={file:e,errorMessage:null};if(b(t),t.errorMessage)return t.errorMessage}return null},[h,g,_,v,y,b]);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 I=e!==void 0,[fe,pe]=(0,t.useState)(()=>r??[]),L=I?e:fe;Wd(ce,{uploadStrategy:o,required:te,currentFileCount:L.length,onMissingFiles:(0,t.useCallback)(()=>k(rd.requiredMissing),[])});let R=typeof p==`string`?hf[p]:p,me=p===`thumbnail`,he=typeof ie.accept==`string`?ie.accept.trim():void 0,z=(0,t.useMemo)(()=>ld(he,h)||void 0,[he,h]),B=c&&!me,V=s&&!me,ge=(0,t.useCallback)(e=>{for(let t of e){let e=F(t.file);if(e){k(e);return}}k(null);let t=a?[...L,...e]:[e[0]],n=a?e:[e[0]];ue(n.length===1?rd.srFileAdded(n[0].attributes.targetFilename):rd.srFilesAdded(n.length)),I||pe(t),u?.(t),o===`custom`&&d&&e.forEach(e=>{d?.(e)})},[u,L,a,o,d,F,I]),H=(0,t.useCallback)((e,t)=>{let n=L.map(n=>n.fileId===e?{...n,...t}:n);I||pe(n),u?.(n)},[u,L,I]),_e=(0,t.useCallback)(e=>{let t=L.filter(t=>t.fileId!==e);I||pe(t),u?.(t),`onTransferCancelled`in ie&&ie.onTransferCancelled&&ie.onTransferCancelled?.(e)},[u,L,ie,I]),{buildAttributeAccessors:ve}=Vd(L,H),U=(0,t.useMemo)(()=>{let e=[];return B&&e.push(Bd),V&&e.push(Fd),e.push(...f),e.push(Id(_e)),e},[B,V,f,_e]),{totalCount:ye,uploadedCount:be,failedCount:xe}=(0,t.useMemo)(()=>yd(L,O),[L,O]),Se=rd.fileLabel(ye),Ce=(0,n.jsx)(`div`,{className:(0,$.default)(`pkt-fileupload`,{"pkt-fileupload--full-width":m,"pkt-fileupload--error":j,"pkt-fileupload--disabled":C}),"aria-disabled":C,...C?{inert:``}:{},children:(0,n.jsxs)(Td.Provider,{value:{name:ie.name||``,multiple:!!a,id:se},children:[(0,n.jsx)(`div`,{className:`pkt-sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:A||(ye>0&&be>0?rd.srFilesUploadedOfTotal(be,ye,Se):``)}),(0,n.jsx)(`div`,{className:`pkt-sr-only`,"aria-live":`assertive`,"aria-atomic":`true`,children:ye>0&&xe>0&&rd.srFilesFailedOfTotal(xe,ye,Se)}),(0,n.jsx)(Ed,{id:se,name:ie.name||``,value:L,onFilesAdded:ge,multiple:a,uploadStrategy:o,ref:ce,accept:me?bd:z,isThumbnailView:me,disabled:C,required:te&&o===`form`,"aria-required":te?`true`:void 0,"aria-invalid":P?`true`:void 0,"aria-describedby":N,hasVisibleLabel:!!w}),j&&de&&(0,n.jsx)(Us,{skin:`error`,"aria-live":`assertive`,role:`alert`,compact:!0,id:M,className:`pkt-fileupload__error-alert`,children:de}),L.length>0&&(0,n.jsx)(mf,{files:L,cancelTransfer:_e,truncateTail:l,transfers:O,uploadStrategy:o,ItemRenderer:R,enableImagePreview:me&&ne,disabled:C,inputName:ie.name||``,buildAttributeAccessors:ve,queueItemOperations:U})]})});return w?(0,n.jsx)(fu,{forId:se,label:w,helptext:ee,disabled:C,hasError:j,optionalTag:T,requiredTag:E,className:(0,$.default)(`pkt-fileupload-wrapper`,{"pkt-fileupload-wrapper--full-width":m}),children:Ce}):Ce});gf.displayName=`PktFileUpload`;var _f=({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)(Ru,{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}`))})]})]})}),vf=({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)(Ru,{triggerType:`footerlink`,hotjarId:o,googleAnalyticsId:s,devMode:c,cookieDomain:l,cookieSecure:u,cookieExpiryDays:d,onToggleConsent:f})})]})})}),yf=(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 bf(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 xf=({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]})};xf.displayName=`PktLink`;var Sf=e=>typeof e.target==`string`?{title:e.title,iconName:e.iconName,href:e.target}:{title:e.title,iconName:e.iconName,onClick:e.target},Cf=({item:e,className:t})=>`href`in e?(0,n.jsx)(xf,{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]}),wf=({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)(Cf,{item:e})},t))}),Tf=(0,t.forwardRef)(({user:e,formattedLastLoggedIn:t,representing:r,userMenu:i,canChangeRepresentation:a,changeRepresentation:o,logoutOnClick:s},c)=>{let l=i?.map(Sf);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)(wf,{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)(Cf,{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)(Cf,{item:{title:`Endre organisasjon`,iconName:`cogwheel`,onClick:o}})})})}),s&&(0,n.jsx)(`li`,{className:`pkt-user-menu__item`,children:(0,n.jsx)(Cf,{item:{title:`Logg ut`,iconName:`exit`,onClick:s}})})]})})});Tf.displayName=`PktHeaderUserMenu`;var Ef=(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)(fu,{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`})]})})});Ef.displayName=`PktTextinput`;var Df=(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=yf(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]);bf(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.16/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.16/logos/`})}):(0,n.jsx)(Q,{name:`oslologo`,"aria-hidden":`true`,path:`https://punkt-cdn.oslo.kommune.no/16.16/logos/`})}),y&&(0,n.jsx)(`span`,{className:`pkt-header-service__service-name`,children:_?(0,n.jsx)(xf,{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)(Ks,{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)(Ks,{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)(Ef,{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)(Ef,{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)(Ks,{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)(Ks,{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)(Tf,{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)(Ks,{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});Df.displayName=`PktHeaderService`;var Of=(0,t.forwardRef)((e,t)=>(0,n.jsx)(Df,{...e,ref:t}));Of.displayName=`PktHeader`;var kf=x({tagName:`pkt-heading`,elementClass:pi,react:t.default,displayName:`PktHeading`}),Af=(0,t.forwardRef)(({children:e,...t},r)=>(0,n.jsx)(kf,{"data-testid":`pkt-heading`,...t,ref:r,children:e}));Af.displayName=`PktHeading`;var jf=x({tagName:`pkt-helptext`,elementClass:Gi,react:t.default,displayName:`PktHelptext`,events:{onToggleHelpText:`toggleHelpText`}}),Mf=(0,t.forwardRef)(({children:e,...t},r)=>(0,n.jsx)(jf,{...t,ref:r,children:(0,n.jsx)(`div`,{className:`pkt-contents`,children:e})}));Mf.displayName=`PktHelptext`;var Nf=(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]}));Nf.displayName=`PktInput`;var Pf=({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})]})};Pf.displayName=`PktLinkCard`;var Ff=x({tagName:`pkt-loader`,elementClass:gs,react:t.default,displayName:`PktLoader`,events:{}}),If=(0,t.forwardRef)(({children:e,...t},r)=>(0,n.jsx)(Ff,{...t,ref:r,children:(0,n.jsx)(`div`,{className:`pkt-contents`,children:e})}));If.displayName=`PktLoader`;var Lf=({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})]})};Lf.displayName=`PktMessagebox`;var Rf=()=>(`00000000000000000`+(Math.random()*0x10000000000000000).toString(16)).slice(-16),zf=()=>{let e=Rf(),t=Rf();return e.slice(0,8)+`-`+e.slice(8,12)+`-4`+e.slice(13)+`-a`+t.slice(1,4)+`-`+t.slice(4)},Bf=(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)(()=>zf(),[]),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})})]})})});Bf.displayName=`PktProgressbar`;var Vf=(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})]})]})})});Vf.displayName=`PktRadioButton`;var Hf=(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={role:`search`,className:`pkt-searchinput pkt-searchinput--${e} ${i?`pkt-searchinput--fullwidth`:``}`,...du()};return(e=>d?(0,n.jsx)(`form`,{...b,action:d,method:f,children:e}):(0,n.jsx)(`div`,{...b,children:e}))((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)(Ks,{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}`))})]}))});Hf.displayName=`PktSearchInput`;var Uf=(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)(fu,{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})}));Uf.displayName=`PktSelect`;var Wf=(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)`}})}),Gf=(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`})]}),Kf=(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`})]}),qf=({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`?Gf:r===`completed`?Kf:Wf}),(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})]})]}),Jf=(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})});Jf.displayName=`PktStepper`;var Yf=({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}),Xf=({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}),Zf=({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}),Qf=({className:e,children:t,...r})=>(0,n.jsx)(`thead`,{className:(0,$.default)(e,`pkt-table__header`,{}),role:`rowgroup`,...r,children:t}),$f=({className:e,children:t,...r})=>(0,n.jsx)(`th`,{className:(0,$.default)(e,`pkt-table__header-cell`,{}),role:`columnheader`,...r,children:t}),ep=({className:e,children:t,...r})=>(0,n.jsx)(`tr`,{className:(0,$.default)(e,`pkt-table__row`,{}),role:`row`,...r,children:t}),tp=(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}=rp(),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)(cu,{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})});tp.displayName=`PktTabItem`;var np=(0,t.createContext)(null),rp=()=>{let e=(0,t.useContext)(np);if(!e)throw Error(`TabItem must be used within a Tabs component`);return e},ip=(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)(tp,{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)(np.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})})})});ip.displayName=`PktTabs`;var ap=e=>e?Math.max(1,Math.round(e/60)):1,op=(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)},sp=e=>{let t=ap(e);return Array.from({length:Math.floor(60/t)},(e,n)=>n*t)},cp=(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`)}},lp=e=>/^\d{2}:\d{2}$/.test(e)&&parseInt(e.slice(0,2),10)<=23&&parseInt(e.slice(3),10)<=59,up=e=>{let[t,n]=e.split(`:`).map(Number);return t*60+n},dp={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 fp(e){if(e&&lp(e)){let[t,n]=e.split(`:`);return[t,n]}return[``,``]}function pp(e,t){return`${String(parseInt(e,10)).padStart(2,`0`)}:${String(parseInt(t,10)).padStart(2,`0`)}`}function mp(e,t){let{required:n,min:r,max:i,step:a}=t;if(n&&!e)return{valid:!1,message:dp.required};if(!e)return{valid:!0};if(!lp(e))return{valid:!1,message:dp.invalid};let o=up(e),s=ap(a);return r&&o<up(String(r))?{valid:!1,message:dp.rangeUnderflowMin.replace(`{min}`,String(r))}:i&&o>up(String(i))?{valid:!1,message:dp.rangeOverflowMax.replace(`{max}`,String(i))}:a&&o%s!==0?{valid:!1,message:s===60?dp.timeStepMismatchHour:s===30?dp.timeStepMismatchHalfHour:dp.timeStepMismatch.replace(`{step}`,`${s}, ${s*2}, ${s*3}`)}:{valid:!0}}function hp(e){return e===3600||e<3600&&3600%e==0&&e%60==0}function gp(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??nd,[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)(()=>fp(a===void 0?o:a)[0]),[j,M]=(0,t.useState)(()=>fp(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]=fp(a);F(e),I(t)},[a,se,F,I]),(0,t.useEffect)(()=>{l!=null&&!hp(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)(()=>ap(l),[l]),we=(0,t.useMemo)(()=>op(s,c),[s,c]),Te=(0,t.useMemo)(()=>sp(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=mp(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=pp(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=pp(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=mp(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=cp(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]=fp(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]=fp(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 _p=(0,t.forwardRef)((e,t)=>{let{onChange:r,onInput:i}=e,a=gp(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)(fu,{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()})})});_p.displayName=`PktTimepicker`,e.FileItem=wd,e.ItemRenderers=hf,e.PktAccordion=_,e.PktAccordionItem=Hs,e.PktAlert=Us,e.PktBackLink=Ws,e.PktBreadcrumbs=Gs,e.PktButton=Ks,e.PktCalendar=su,e.PktCard=lu,e.PktCheckbox=uu,e.PktCombobox=Lu,e.PktConsent=Ru,e.PktDatepicker=td,e.PktFileUpload=gf,e.PktFooter=_f,e.PktFooterSimple=vf,e.PktHeader=Of,e.PktHeaderService=Df,e.PktHeading=Af,e.PktHelptext=Mf,e.PktIcon=Q,e.PktInput=Nf,e.PktInputWrapper=fu,e.PktLink=xf,e.PktLinkCard=Pf,e.PktLoader=If,e.PktMessagebox=Lf,e.PktModal=Gd,e.PktProgressbar=Bf,e.PktRadioButton=Vf,e.PktSearchInput=Hf,e.PktSelect=Uf,e.PktStep=qf,e.PktStepper=Jf,e.PktTabItem=tp,e.PktTable=Yf,e.PktTableBody=Xf,e.PktTableDataCell=Zf,e.PktTableHeader=Qf,e.PktTableHeaderCell=$f,e.PktTableRow=ep,e.PktTabs=ip,e.PktTag=cu,e.PktTextarea=Od,e.PktTextinput=Ef,e.PktTimepicker=_p});
2363
+ `}};K([W({type:String,reflect:!0})],Zs.prototype,`value`,void 0),K([W({type:Boolean,reflect:!0,attribute:`hide-picker`})],Zs.prototype,`hidePicker`,void 0),K([W({type:Boolean,reflect:!0,attribute:`step-arrows`})],Zs.prototype,`stepArrows`,void 0),K([G()],Zs.prototype,`_hours`,void 0),K([G()],Zs.prototype,`_minutes`,void 0),K([G()],Zs.prototype,`_isOpen`,void 0);try{U(`pkt-timepicker`)(Zs)}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:{}}),Qs=(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,a===`plus-minus`?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Q,{name:`plus-sign`,className:`pkt-accordion-item__icon pkt-accordion-item__icon--plus`,"aria-hidden":`true`}),(0,n.jsx)(Q,{name:`minus-sign`,className:`pkt-accordion-item__icon pkt-accordion-item__icon--minus`,"aria-hidden":`true`})]}):(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})})]})});Qs.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),$s=({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)(nc,{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]})]})})};$s.displayName=`PktAlert`;var ec=(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})})});ec.displayName=`PktBackLink`;var tc=(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})]})});tc.displayName=`PktBreadcrumbs`,window.pktAnimationPath=window.pktAnimationPath||`https://punkt-cdn.oslo.kommune.no/16.17/animations/`;var nc=(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}})]})});nc.displayName=`PktButton`;var rc=365.2425,ic=6048e5,ac=864e5,oc=3600*24;oc*7,oc*rc/12*3;var sc=Symbol.for(`constructDateFrom`);function cc(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&sc in e?e[sc](t):e instanceof Date?new e.constructor(t):new Date(t)}function lc(e,t){return cc(t||e,e)}function uc(e,t,n){let r=lc(e,n?.in);return isNaN(t)?cc(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}var dc={};function fc(){return dc}function pc(e,t){let n=fc(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=lc(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 mc(e,t){return pc(e,{...t,weekStartsOn:1})}function hc(e,t){let n=lc(e,t?.in),r=n.getFullYear(),i=cc(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let a=mc(i),o=cc(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);let s=mc(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function gc(e){let t=lc(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 _c(e,...t){let n=cc.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function vc(e,t){let n=lc(e,t?.in);return n.setHours(0,0,0,0),n}function yc(e,t,n){let[r,i]=_c(n?.in,e,t),a=vc(r),o=vc(i),s=+a-gc(a),c=+o-gc(o);return Math.round((s-c)/ac)}function bc(e,t){let n=hc(e,t),r=cc(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),mc(r)}function xc(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function Sc(e){return!(!xc(e)&&typeof e!=`number`||isNaN(+lc(e)))}function Cc(e,t){let n=lc(e,t?.in);return n.setHours(23,59,59,999),n}function wc(e,t){let[n,r]=_c(e,t.start,t.end);return{start:n,end:r}}function Tc(e,t){let{start:n,end:r}=wc(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(cc(n,o)),o.setDate(o.getDate()+s),o.setHours(0,0,0,0);return i?c.reverse():c}function Ec(e,t){let n=lc(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}var Dc={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`}},Oc=(e,t,n)=>{let r,i=Dc[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 kc(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var Ac={date:kc({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:kc({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:kc({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},jc={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},Mc=(e,t,n,r)=>jc[e];function Nc(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 Pc={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:Nc({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:Nc({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:Nc({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:Nc({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:Nc({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 Fc(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)?Lc(s,e=>e.test(o)):Ic(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 Ic(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Lc(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Rc(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 zc={code:`en-US`,formatDistance:Oc,formatLong:Ac,formatRelative:Mc,localize:Pc,match:{ordinalNumber:Rc({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:Fc({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:Fc({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:Fc({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:Fc({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:Fc({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 Bc(e,t){let n=lc(e,t?.in);return yc(n,Ec(n))+1}function Vc(e,t){let n=lc(e,t?.in),r=mc(n)-+bc(n);return Math.round(r/ic)+1}function Hc(e,t){let n=lc(e,t?.in),r=n.getFullYear(),i=fc(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=cc(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=pc(o,t),c=cc(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=pc(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function Uc(e,t){let n=fc(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=Hc(e,t),a=cc(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),pc(a,t)}function Wc(e,t){let n=lc(e,t?.in),r=pc(n,t)-+Uc(n,t);return Math.round(r/ic)+1}function Gc(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var Kc={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return Gc(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):Gc(n+1,2)},d(e,t){return Gc(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 Gc(e.getHours()%12||12,t.length)},H(e,t){return Gc(e.getHours(),t.length)},m(e,t){return Gc(e.getMinutes(),t.length)},s(e,t){return Gc(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return Gc(Math.trunc(r*10**(n-3)),t.length)}},qc={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},Jc={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 Kc.y(e,t)},Y:function(e,t,n,r){let i=Hc(e,r),a=i>0?i:1-i;return t===`YY`?Gc(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):Gc(a,t.length)},R:function(e,t){return Gc(hc(e),t.length)},u:function(e,t){return Gc(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 Gc(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 Gc(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 Kc.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 Gc(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=Wc(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):Gc(i,t.length)},I:function(e,t,n){let r=Vc(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):Gc(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):Kc.d(e,t)},D:function(e,t,n){let r=Bc(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):Gc(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 Gc(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 Gc(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 Gc(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?qc.noon:r===0?qc.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?qc.evening:r>=12?qc.afternoon:r>=4?qc.morning:qc.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 Kc.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):Kc.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):Gc(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):Gc(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):Kc.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):Kc.s(e,t)},S:function(e,t){return Kc.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return Xc(r);case`XXXX`:case`XX`:return Zc(r);default:return Zc(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return Xc(r);case`xxxx`:case`xx`:return Zc(r);default:return Zc(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+Yc(r,`:`);default:return`GMT`+Zc(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+Yc(r,`:`);default:return`GMT`+Zc(r,`:`)}},t:function(e,t,n){return Gc(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return Gc(+e,t.length)}};function Yc(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+Gc(a,2)}function Xc(e,t){return e%60==0?(e>0?`-`:`+`)+Gc(Math.abs(e)/60,2):Zc(e,t)}function Zc(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Gc(Math.trunc(r/60),2),a=Gc(r%60,2);return n+i+t+a}var Qc=(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`})}},$c=(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`})}},el={p:$c,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Qc(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}}`,Qc(r,t)).replace(`{{time}}`,$c(i,t))}},tl=/^D+$/,nl=/^Y+$/,rl=[`D`,`DD`,`YY`,`YYYY`];function il(e){return tl.test(e)}function al(e){return nl.test(e)}function ol(e,t,n){let r=sl(e,t,n);if(console.warn(r),rl.includes(e))throw RangeError(r)}function sl(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 cl=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ll=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ul=/^'([^]*?)'?$/,dl=/''/g,fl=/[a-zA-Z]/;function pl(e,t,n){let r=fc(),i=n?.locale??r.locale??zc,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=lc(e,n?.in);if(!Sc(s))throw RangeError(`Invalid time value`);let c=t.match(ll).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=el[t];return n(e,i.formatLong)}return e}).join(``).match(cl).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:ml(e)};if(Jc[t])return{isToken:!0,value:e};if(t.match(fl))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&&al(a)||!n?.useAdditionalDayOfYearTokens&&il(a))&&ol(a,t,String(e));let o=Jc[a[0]];return o(s,a,i.localize,l)}).join(``)}function ml(e){let t=e.match(ul);return t?t[1].replace(dl,`'`):e}function hl(e,t){let n=lc(e,t?.in).getDay();return n===0?7:n}function gl(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 _l={},vl={};function yl(e,t){try{let n=(_l[e]||=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`longOffset`}).format)(t).split(`GMT`)[1];return n in vl?vl[n]:xl(n,n.split(`:`))}catch{if(e in vl)return vl[e];let t=e?.match(bl);return t?xl(e,t.slice(1)):NaN}}var bl=/([+-]\d\d):?(\d\d)?/;function xl(e,t){let n=+(t[0]||0),r=+(t[1]||0),i=(t[2]||0)/60;return vl[e]=n*60+r>0?n*60+r+i:n*60-r-i}var Sl=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(yl(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)),El(this,NaN),wl(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=-yl(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),wl(this),+this}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}},Cl=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!Cl.test(e))return;let t=e.replace(Cl,`$1UTC`);Sl.prototype[t]&&(e.startsWith(`get`)?Sl.prototype[e]=function(){return this.internal[t]()}:(Sl.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),Tl(this),+this},Sl.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),wl(this),+this}))});function wl(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-yl(e.timeZone,e)*60))}function Tl(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()),El(e)}function El(e){let t=yl(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(-(yl(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=yl(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=yl(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 Dl=class e extends Sl{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} (${gl(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 Ol=(e=window.pktTz)=>{let t=new Dl(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 kl(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 Al=e=>!e||isNaN(e.getTime())?``:`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`,jl=e=>{if(!e)return null;let t=kl(e);return isNaN(t.getTime())?null:t},Ml=(e,t)=>{let n=Nl(e);return isNaN(n.getTime())?``:pl(n,t)},Nl=(e=``,t)=>{let n=typeof e==`string`?kl(e):e;return!n||isNaN(n.getTime())?new Date:t?t===`end`?Cc(n):vc(n):n},Pl=(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},Fl=e=>{let t;return t=new Dl(e,window.pktTz),t.setHours(12,0,0,0),t},Il=null,Ll=void 0,Rl=e=>{if(!e||isNaN(e.getTime()))return``;let t=typeof window<`u`?window.pktTz:void 0;return(!Il||Ll!==t)&&(Il=new Intl.DateTimeFormat(`no`,{dateStyle:`full`,timeZone:t}),Ll=t),Il.format(e)},zl=(e,t,n)=>{if(!e||isNaN(e.getTime()))return!1;let r=t?Nl(t):null,i=n?Nl(n):null;return!(r&&e<r||i&&e>i)},Bl=(e,t)=>{if(!e||isNaN(e.getTime())||!Array.isArray(t))return!1;let n=Al(e);return t.includes(n)},Vl=(e,t)=>{if(!e||isNaN(e.getTime())||!Array.isArray(t))return!1;let n=e.getDay().toString();return t.includes(n)},Hl=(e,t,n,r,i)=>!(!e||isNaN(e.getTime())||!zl(e,t,n)||r&&Bl(e,r)||i&&Vl(e,i)),Ul=(e,t,n,r,i)=>e.filter(e=>{let a=jl(e);return a&&Hl(a,t,n,r,i)}),Wl=e=>e.slice().sort((e,t)=>{let n=jl(e),r=jl(t);return!n||!r?0:n.getTime()-r.getTime()}),Gl=(e,t)=>{let n=jl(e),r=jl(t);return!n||!r?!1:n<=r};function Kl(e,t){let n=(t.excludedates??[]).map(e=>typeof e==`string`?e:Al(e));return!Hl(e,t.earliest,t.latest,n,t.excludeweekdays??[])}function ql(e,t,n,r){return!!(Kl(e,n)||!t&&r.multiple&&r.maxMultiple>0&&r.selectedCount>=r.maxMultiple)}function Jl(e,t,n){let r=Pl(e,t,0);return!(n&&Nl(n)>r)}function Yl(e,t,n){let r=Pl(t===11?e+1:e,t===11?0:t+1,1);return!(n&&Nl(n)<r)}function Xl(e){return typeof e==`string`&&(e=e.split(`,`)),e.length===1&&e[0]===``?[]:e.map(e=>kl(e))}function Zl(e,t){let n=Tc({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[Al(a)]=o}return r}function Ql(e,t,n,r){if(t.length!==1)return!0;let i=Tc({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(hl(i[a]).toString()))return!1}return!0}function $l(e,t){let n=Al(e);return t.includes(n)?t:[...t,n]}function eu(e,t){let n=Al(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 tu(e,t,n){let r=Al(e);return t.includes(r)?eu(e,t):n>0&&t.length>=n?t:$l(e,t)}function nu(e,t,n){let r=Al(e),i=Xl(t);return t.includes(r)?t.indexOf(r)===0?[]:eu(e,t):t.length>1||t.length===1&&(!Ql(e,i,n.excludedates,n.excludeweekdays)||i[0]>e)?[r]:$l(e,t)}function ru(e,t){let n=Pl(e,t,1),r=Pl(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:Pl(e,t,0).getDate(),initialWeek:Wc(n)}}function iu(e,t,n,r){let{startingDay:i,numDays:a}=r;return e===0&&t<i?`prev-month`:n>a?`next-month`:`current-month`}function au(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 ou={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7};function su(e){let t=e.nodeName;return t===`INPUT`||t===`SELECT`||t===`BUTTON`&&!e.dataset?.date}function cu(e,t,n){let r=uc(e,t);if(!r)return null;let i=n(`button[data-date="${Al(r)}"]`);for(;i instanceof HTMLButtonElement&&i.dataset.disabled;)if(r=uc(r,t),i=n(`button[data-date="${Al(r)}"]`),!i)return null;return r}function lu(e){return ou[e]??null}var uu={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 du(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)(()=>({...uu,...m}),[m]),S=(0,t.useMemo)(()=>p?kl(p):Ol(),[p]),C=(0,t.useMemo)(()=>c?c.map(e=>typeof e==`string`?kl(e):e):[],[c]),w=n!==void 0,[ee,T]=(0,t.useState)([]),E=w?n:ee,te=(0,t.useMemo)(()=>Xl(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=Fl(f):typeof f==`string`&&(e=kl(f))),!e||isNaN(e.getTime()))if(E.length>0&&E[0]!==``){let t=kl(E[E.length-1]);e=isNaN(t.getTime())?Fl(S):t}else e=Fl(S);if((!e||isNaN(e.getTime()))&&(e=Fl(S)),s){let t=typeof s==`string`?kl(s):s;!isNaN(t.getTime())&&e>t&&(e=t)}if(o){let t=typeof o==`string`?kl(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=kl(E[E.length-1]);isNaN(e.getTime())||(re(e.getFullYear()),ie(e.getMonth()))}},[E]),(0,t.useEffect)(()=>{a&&te.length===2?oe(Zl(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=>Kl(e,M),[M]),L=(0,t.useCallback)((e,t)=>ql(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||!Ql(e,te,C,l)||te[0]>=e){ce(null);return}ce(e),oe(Zl(te[0],e))},[a,te,C,l]),he=(0,t.useCallback)(e=>{if(!e)return;let t;if(a)t=nu(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=tu(e,R(),i),N(t);else{let n=Al(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=$l(e,R());w||T(t),a&&t.length===2&&(h?.(t),P())},[R,w,a,h,P]),B=(0,t.useCallback)(e=>{let t=eu(e,R());w||T(t)},[R,w]),V=(0,t.useCallback)(e=>{let t=tu(e,R(),i);w||T(t)},[R,i,w]),ge=(0,t.useCallback)(()=>{let e=Al(Fl(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(su(n))return;if(e.preventDefault(),!O){ge();return}let r=cu(Nl(O),t,k.current.querySelector.bind(k.current));if(r){let e=k.current.querySelector(`button[data-date="${Al(r)}"]`);e instanceof HTMLButtonElement&&!e.dataset.disabled&&(le(Al(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=lu(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 fu=({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?Jl(r,i,a):Yl(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 pu(e,t,n){let r=Pl(n.year,n.month,e),i=Al(r),a=i===Al(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:Rl(r),tabindex:c}}function mu(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===Al(t.rangeHovered)})}function hu(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===Al(t.rangeHovered),"pkt-calendar__date--range-start":o,"pkt-calendar__date--range-end":s})}var gu=({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=pu(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=mu(r,x),p=hu(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=ru(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=iu(r,n,a,t);if(o===`current-month`)i.push(C(a,e)),a++;else{let e=au(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})()})]})},_u=(0,t.forwardRef)((e,r)=>{let i=du(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)(fu,{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)(gu,{state:i})]})});_u.displayName=`PktCalendar`;var vu=(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})]})});vu.displayName=`PktTag`;var yu=(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)(vu,{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()]})]})})});yu.displayName=`PktCard`;var bu=(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})]})]})})});bu.displayName=`PktCheckbox`;function xu(e){let n=(0,t.useRef)(null),r=(0,t.useRef)(!1),i=(0,t.useRef)(void 0),a=e=>{let t=n.current;t&&(e===void 0?delete t.dataset.navtype:t.dataset.navtype=e)};return(0,t.useEffect)(()=>()=>{i.current!==void 0&&clearTimeout(i.current)},[]),{ref:t=>{n.current=t,typeof e==`function`?e(t):e&&(e.current=t)},onPointerDown:()=>{r.current=!0,i.current!==void 0&&clearTimeout(i.current),i.current=window.setTimeout(()=>{r.current=!1,i.current=void 0},0)},onFocus:()=>{a(r.current?`pointer`:void 0)},onBlur:e=>{n.current?.contains(e.relatedTarget)||a(void 0)}}}var Su=(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=xu(T),re=y||(i?`${e}-helptext`:void 0),D=!!s,ie=D&&ee===`top`,ae=D&&ee===`bottom`,oe=()=>te(e=>!e),se=[`pkt-inputwrapper`,S,h?`pkt-inputwrapper--error`:``,_?`pkt-inputwrapper--disabled`:``,v?`pkt-inputwrapper--inline`:``].filter(Boolean).join(` `),ce=[`pkt-tag`,`pkt-tag--small`,`pkt-tag--thin-text`].join(` `),O=()=>D?(0,n.jsxs)(`div`,{className:`pkt-input__counter`,"aria-live":`polite`,"aria-atomic":`true`,children:[c,l?`/${l}`:``]}):null,le=()=>(0,n.jsxs)(n.Fragment,{children:[m&&(0,n.jsx)(`span`,{className:ce+` pkt-tag--gray`,children:m}),u&&(0,n.jsx)(`span`,{className:ce+` pkt-tag--blue-light`,children:d}),f&&(0,n.jsx)(`span`,{className:ce+` pkt-tag--beige`,children:p})]}),k=(0,n.jsxs)(n.Fragment,{children:[(()=>{let t=(0,n.jsxs)(n.Fragment,{children:[r,` `,le()]});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":re,id:`${e}-label`,children:t}):(0,n.jsx)(`label`,{htmlFor:e,className:`pkt-sr-only`,"aria-describedby":re,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)(nc,{skin:`tertiary`,size:`small`,variant:`icon-right`,iconName:E?`chevron-thin-up`:`chevron-thin-down`,className:`pkt-link pkt-link--icon-right`,onClick:oe,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})]})]}),ie&&(0,n.jsx)(O,{}),x,ae&&(0,n.jsx)(O,{}),h&&g&&(0,n.jsx)(`div`,{className:`pkt-inputwrapper__alert-wrapper`,children:(0,n.jsx)($s,{skin:`error`,"aria-live":`assertive`,role:`alert`,id:`${e}-error`,compact:!0,children:g})})]});return(0,n.jsx)(`div`,{className:se,role:w,...ne,children:C?(0,n.jsx)(`fieldset`,{className:`pkt-inputwrapper__fieldset`,"aria-describedby":re,children:k}):(0,n.jsx)(`div`,{className:`pkt-inputwrapper__fieldset`,children:k})})});Su.displayName=`PktInputWrapper`;var Cu=(e,t)=>t&&(e.find(e=>e.value===t)||e.find(e=>e.label===t))||null,wu=(e,t)=>{if(!t)return-1;let n=e.findIndex(e=>e.value===t);return n>=0?n:e.findIndex(e=>e.label===t)},Tu=(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))},Eu=e=>e.value+(e.label||``)+(e.prefix||``),Du=(e,t)=>t!==null&&e>=t,Ou=(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}},ku=(e,t)=>e?Array.isArray(e)?t?e:e.length>0?[e[0]]:[]:t?e.split(`,`).filter(Boolean):[e]:[],Au=(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}},ju=(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:``}},Mu=(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}},Nu=(e,t,n,r,i)=>{if(!e)return{action:`none`,value:null};let a=Cu(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}},Pu=(e,t,n)=>{let r=Cu(t,e);return n===`label`&&r?.label?r.label:e},Fu=e=>{e.scrollIntoView({block:`nearest`}),window.setTimeout(()=>e.focus(),0)},Iu=e=>Array.from(e.querySelectorAll(`[role="option"]:not([data-disabled])`)||[]),Lu=e=>{let t=e.nextElementSibling;t&&Fu(t)},Ru=(e,t,n)=>{let r=e.previousElementSibling;if(e.dataset.index===`0`&&n){let e=t.querySelector(`[role="searchbox"]`);e&&Fu(e)}else r&&Fu(r)},zu=e=>{let t=Iu(e);t[0]&&Fu(t[0])},Bu=(e,t)=>{if(t.disabled)return;let n=Iu(e);if(t.allowUserInput&&t.customUserInput){let t=e.querySelector(`[data-type="new-option"]`);if(t){Fu(t);return}}let r=n.find(e=>e.dataset.selected===`true`);if(r){Fu(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]&&Fu(n[0])},Vu=({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=Cu(a,e),f=i?.tagSkinColor,p=i?Ou(i,s):e;return o?(0,n.jsx)(`li`,{role:`listitem`,children:(0,n.jsx)(vu,{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)(vu,{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)(vu,{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})},Hu=({state:e})=>{let{values:t,options:r,editingSingleValue:i,displayValueAs:a}=e;if(i||t.length===0)return null;let o=Cu(r,t[0]);return o?(0,n.jsx)(`span`,{className:`pkt-combobox__value`,children:Ou(o,a)}):null},Uu=({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]&&Cu(o,a[0])?`${i}-${wu(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)(Vu,{state:e}):re?null:(0,n.jsx)(Hu,{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`})]})},Wu=({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 Gu(e,t){return e.map(e=>({...e,label:e.label||e.value,fulltext:Eu(e),selected:t.includes(e.value)}))}function Ku(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:Eu(e)})):s&&s.length>0?s.map(e=>({...e,fulltext:Eu(e)})):P.length>0?P.map(e=>({...e,fulltext:Eu(e)})):[],[c,s,P]),I=a!==void 0,[fe,pe]=(0,t.useState)(()=>ku(a??o,l)),L=(0,t.useRef)(fe);(0,t.useEffect)(()=>{I&&pe(ku(a,l))},[a,I,l]);let R=I?ku(a,l):fe,[me,he]=(0,t.useState)([]),z=(0,t.useMemo)(()=>Gu([...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=Du(R.length,u??null),Ae=l&&u!=null,je=(0,t.useMemo)(()=>ge?d?Au(z,ge).filtered:Tu(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]?Pu(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&&Du(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);Cu(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(Cu(z,e)||Du(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=Pu(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=Cu(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=Du(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=Cu(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}=Nu(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=Pu(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=ju(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}=Au(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=Mu(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),Bu(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=Pu(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&&Bu(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&&Bu(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&&Bu(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(),Lu(e.currentTarget);break;case`ArrowUp`:e.preventDefault(),j.current&&Ru(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&&zu(j.current);break;case`ArrowUp`:e.preventDefault(),j.current&&Ru(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 qu=(0,t.forwardRef)((e,t)=>{let r=Ku(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)(Su,{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)(Uu,{state:r}),(0,n.jsx)(Wu,{state:r})]}),r.tagPlacement===`outside`&&r.multiple&&(0,n.jsx)(Vu,{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`})]})});qu.displayName=`PktCombobox`;var Ju=x({tagName:`pkt-consent`,elementClass:Cs,react:t.default,displayName:`PktConsent`,events:{onToggleConsent:`toggle-consent`}});Ju.displayName=`PktConsent`;var Yu=()=>{let e=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(e)||/Macintosh/.test(e)&&`ontouchend`in document)},Xu=()=>Yu()?`text`:`date`,Zu=e=>!e||e.length!==2?!0:Gl(e[0],e[1]),Qu=(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`}),$u=()=>({"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}),ed=e=>({"pkt-input-prefix":e,"pkt-hide":!e}),td=(e,t,n)=>!t&&!n?Array.isArray(e)?e[0]||``:e:Array.isArray(e)?e.join(`,`):e,nd=(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},rd=(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())},id=({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&&nd(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)(_u,{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})})},ad=({dates:e,dateformat:t,idBase:r,strings:i,onDateRemoved:a})=>{let o=Wl(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=Ml(e,t);return(0,n.jsx)(vu,{id:`${r}${e}-tag`,closeTag:!0,ariaLabel:`${s} ${i}`,onClose:()=>a(e),children:(0,n.jsx)(`time`,{dateTime:e,children:i})},e)})})},od=({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)(ad,{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()]})})},sd={calendar:{buttonAltText:`Åpne kalender`}},cd={calendar:{buttonAltText:`Åpne kalender`},generic:{from:`Fra`,to:`Til`}},ld=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 ud(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?[]:ld(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)(()=>Xu(),[]),ve=(0,t.useMemo)(()=>Yu(),[]),U=(0,t.useMemo)(()=>oe??(u?cd:sd),[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=Qu(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=$u();return Object.entries(e).filter(([,e])=>e).map(([e])=>e).join(` `)},[]),Ce=(0,t.useMemo)(()=>{let e=ed(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=ld(td(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&&!Zu(L)&&(Ae([L[0]]),Me([L[0]]))},[L,Ae,Me]),He=(0,t.useCallback)(e=>{let t=Nl(e),n=ye?Nl(ye):null,r=be?Nl(be):null;if(t&&!isNaN(t.getTime())&&(!n||t>=n)&&(!r||t<=r)){let t=Ul([...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=>{rd(e.nativeEvent,()=>Ne(),()=>We(z.current),void 0,()=>z.current?.blur())},[Ne,We]),Ke=(0,t.useCallback)(e=>{rd(e.nativeEvent,()=>Ne(),()=>We(z.current),()=>B.current?.focus(),()=>z.current?.blur())},[Ne,We]),qe=(0,t.useCallback)(e=>{rd(e.nativeEvent,()=>Ne(),()=>We(B.current),void 0,()=>B.current?.blur())},[Ne,We]),K=(0,t.useCallback)(e=>{rd(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 dd=(0,t.forwardRef)((e,t)=>{let r=ud(e,t);return(0,n.jsxs)(`div`,{className:[`pkt-datepicker`,r.className].filter(Boolean).join(` `),id:r.id||void 0,children:[(0,n.jsx)(Su,{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)(od,{state:r})}),(0,n.jsx)(id,{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`})]})});dd.displayName=`PktDatepicker`;var fd=`https://cdn.web.oslo.kommune.no/header-footer/header-footer.json`,pd={hours:`Timer`,minutes:`Minutter`,openPicker:`Åpne tidspunkt-velger`,prevTime:`Forrige tidspunkt`,nextTime:`Neste tidspunkt`,selectTime:`Velg tidspunkt`},md={dropZoneDragMultiple:`Dra filer hit for å laste dem opp eller`,dropZoneDragSingle:`Dra en fil hit for å laste den opp eller`,dropZoneDragMultipleThumbnail:`Dra bilder hit for å laste dem opp eller`,dropZoneDragSingleThumbnail:`Dra et bilde hit for å laste det opp eller`,dropZoneDragActiveMultiple:`Slipp filene her`,dropZoneDragActiveSingle:`Slipp filen her`,dropZoneDragActiveMultipleThumbnail:`Slipp bildene her`,dropZoneDragActiveSingleThumbnail:`Slipp bildet her`,dropZoneOpenFileDialogMultiple:`velg filer`,dropZoneOpenFileDialogSingle:`velg en fil`,dropZoneOpenFileDialogMultipleThumbnail:`velg fra kamerarull`,dropZoneOpenFileDialogSingleThumbnail:`velg fra kamerarull`,supportedFormatsPrefix:`Format:`,invalidFormatDefault:e=>`Ugyldig filtype. Tillatte formater: ${e}`,sizeTooLargeDefault:e=>`Filen er for stor. Maks størrelse er ${e}.`,requiredMissing:`Du må laste opp minst én fil.`,genericValidationRejection:`Filen ble avvist av validering.`,unknownFilename:`Ukjent fil`,fileLabel:e=>e===1?`fil`:`filer`,srFileAdded:e=>`Filen «${e}» er lagt til`,srFilesAdded:e=>`${e} filer er lagt til`,srFilesUploadedOfTotal:(e,t,n)=>`${e} av ${t} ${n} lastet opp`,srFilesFailedOfTotal:(e,t,n)=>`Feil ved opplasting: ${e} av ${t} ${n} feilet`};function hd(e){if(e==null||e===``)return;if(typeof e==`number`)return Number.isFinite(e)&&e>0?e:void 0;let t=String(e).trim(),n=Number(t);if(!Number.isNaN(n)&&n>0)return n;let r=t.match(/^(\d+(?:\.\d+)?)\s*(B|KB|MB|GB)$/i);if(!r){console.warn(`PktFileUpload: Invalid maxFileSize format "${t}". Use format like "5MB", "500KB", "1GB", or bytes.`);return}let i=parseFloat(r[1]);switch(r[2].toUpperCase()){case`B`:return i;case`KB`:return i*1024;case`MB`:return i*1024*1024;case`GB`:return i*1024*1024*1024;default:return}}function gd(e){return e<1024?`${Math.round(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`}function _d(e){return Array.isArray(e)?e.map(e=>String(e).trim().toLowerCase()).filter(Boolean):[]}function vd(e,t,n){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}function yd(e,t){let n=_d(t);if(n.length===0)return!0;let r=e.name.split(`.`).pop()?.toLowerCase()??``,i=e.type.toLowerCase();return n.some(e=>vd(e,r,i))}function bd(e,t){let n=(e??``).trim();if(n)return n;let r=_d(t);return r.length===0?``:r.map(e=>e.includes(`/`)||e.startsWith(`.`)?e:`.${e}`).join(`, `)}function xd(e,t,n){return((e??``).trim()||t).replace(/\{(\w+)\}/g,(e,t)=>n[t]??`{${t}}`)}function Sd(e,t){let n=_d(t.allowedFormats);if(n.length>0&&!yd(e,n)){let e=n.join(`, `),r=`Ugyldig filtype. Tillatte formater: ${e}`;return xd(t.formatErrorMessage,r,{formats:e})}let r=hd(t.maxFileSize);if(r!==void 0&&e.size>r){let e=gd(r),n=`Filen er for stor. Maks størrelse er ${e}.`;return xd(t.sizeErrorMessage,n,{maxSize:e})}if(t.onFileValidation){let n=t.onFileValidation(e);if(n)return n}return null}function Cd(e){let t=e.file;if(t?.type?.startsWith(`image/`))return!0;let n=e.attributes?.targetFilename||t?.name||``;return/\.(jpe?g|png|gif|webp|heic|heif|bmp|svg)$/i.test(n)}function wd(e){return typeof e==`number`?`in-progress`:e===`error`?`error`:`idle`}function Td(e,t,n){let r={"in-progress":0,error:1,idle:2};return e.map(e=>{let r=t?.find(t=>t.fileId===e.fileId);return{...e,progress:r?.progress??(n===`form`?`done`:`queued`),errorMessage:r?.errorMessage,showProgress:r?.showProgress,lastProgress:r?.lastProgress}}).sort((e,t)=>r[wd(e.progress)]-r[wd(t.progress)])}function Ed(e){if(!e)return[];let t=[`a[href]:not([tabindex="-1"])`,`button:not([disabled]):not([tabindex="-1"])`,`input:not([disabled]):not([type="hidden"]):not([tabindex="-1"])`,`select:not([disabled]):not([tabindex="-1"])`,`textarea:not([disabled]):not([tabindex="-1"])`,`[tabindex]:not([tabindex="-1"])`].join(`, `);return Array.from(e.querySelectorAll(t)).filter(e=>!e.hasAttribute(`inert`))}function Dd(e,t){if(e.key!==`Tab`)return!1;let n=Ed(t);if(n.length===0)return e.preventDefault(),!0;let r=n[0],i=n[n.length-1],a=(t?.ownerDocument??document).activeElement,o=!!a&&n.includes(a);return e.shiftKey?!o||a===r?(e.preventDefault(),i.focus(),!0):!1:!o||a===i?(e.preventDefault(),r.focus(),!0):!1}function Od(e,t){return!t||t<=0||e.length<=t+3?null:{head:e.slice(0,e.length-t),tail:e.slice(-t)}}function kd(e,t,n){return n<=0?0:t===`prev`?e<=0?n-1:e-1:e>=n-1?0:e+1}function Ad(e,t){let n=e.length;if(n===0||!t||t.length===0)return{totalCount:n,uploadedCount:0,failedCount:0};let r=0,i=0;for(let n of e){let e=t.find(e=>e.fileId===n.fileId);e?.progress===`done`?r++:e?.progress===`error`&&i++}return{totalCount:n,uploadedCount:r,failedCount:i}}var jd=`.jpeg, .jpg, .png, .gif, .webp, .heic`;function Md(e,t=md.unknownFilename){return e.attributes?.targetFilename||e.file?.name||t}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=class{fileId;file;attributes;constructor(e,t){this.fileId=t||Pd(),this.file=e,this.attributes={targetFilename:e.name}}},Id=(0,t.createContext)({}),Ld=(0,t.forwardRef)(({id:e,multiple:r,value:i,onFilesAdded:a=()=>{},name:o,uploadStrategy:s,accept:c,isThumbnailView:l=!1,disabled:u=!1,hasVisibleLabel:d=!1,...f},p)=>{let m=(0,t.useRef)(null),h=typeof c==`string`&&c.trim().length>0?c:void 0,g=(0,t.useMemo)(()=>h?h.split(/\s*,\s*/).map(e=>e.trim()).filter(Boolean).join(`, `).toUpperCase():``,[h]);(0,t.useImperativeHandle)(p,()=>m.current);let[_,v]=(0,t.useState)(!1),y=(0,t.useMemo)(()=>l?r?{dragInactive:md.dropZoneDragMultipleThumbnail,dragActive:md.dropZoneDragActiveMultipleThumbnail,openFileDialog:md.dropZoneOpenFileDialogMultipleThumbnail}:{dragInactive:md.dropZoneDragSingleThumbnail,dragActive:md.dropZoneDragActiveSingleThumbnail,openFileDialog:md.dropZoneOpenFileDialogSingleThumbnail}:r?{dragInactive:md.dropZoneDragMultiple,dragActive:md.dropZoneDragActiveMultiple,openFileDialog:md.dropZoneOpenFileDialogMultiple}:{dragInactive:md.dropZoneDragSingle,dragActive:md.dropZoneDragActiveSingle,openFileDialog:md.dropZoneOpenFileDialogSingle},[r,l]),b=(0,t.useCallback)(e=>{if(m.current)try{m.current.files=Rd(e)}catch{}},[m.current,i]);(0,t.useEffect)(()=>{b(i)},[m,i]);let x=(0,t.useCallback)(e=>{a(e.map(e=>new Fd(e))),m.current&&(m.current.value=``)},[a]),S=e=>{let t=e.target.files;if(t.length===0){b(i);return}x(Array.from(t))},C=e=>{x(e)};return(0,n.jsxs)(`div`,{onDrop:e=>{if(e.preventDefault(),v(!1),u)return;let t=e.dataTransfer.files;C(Array.from(t))},onDragOver:e=>{e.preventDefault(),!u&&v(!0)},onDragLeave:()=>{v(!1)},onClick:(0,t.useCallback)(e=>{u||e.target.closest(`.pkt-fileupload__drop-zone__placeholder__title__open-file-dialog`)||m.current?.click()},[u]),className:(0,$.default)(`pkt-fileupload__drop-zone`,{"pkt-fileupload__drop-zone--drag-active":_,"pkt-fileupload__drop-zone--disabled":u}),children:[(0,n.jsx)(`input`,{...f,id:e,type:`file`,ref:m,multiple:r,onChange:S,accept:h,disabled:u,name:s===`form`&&o||void 0,"aria-label":d?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:_?`${y.dragActive} ...`:(0,n.jsxs)(n.Fragment,{children:[y.dragInactive,` `,(0,n.jsx)(`button`,{className:`pkt-fileupload__drop-zone__placeholder__title__open-file-dialog`,onClick:e=>{e.preventDefault(),e.stopPropagation(),m.current?.click()},type:`button`,children:y.openFileDialog})]})}),g?(0,n.jsxs)(`p`,{className:`pkt-fileupload__drop-zone__placeholder__formats`,children:[md.supportedFormatsPrefix,` `,g]}):null]})]})}),Rd=e=>{let t=new DataTransfer;for(let n of e)t.items.add(n.file);return t.files},zd=(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)(Su,{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:e=>{A(e?.value?.length||0),typeof oe==`function`&&oe(e)},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})})});zd.displayName=`PktTextarea`;var Bd=`comments`,Vd=e=>{let t=new Date(e);return Number.isNaN(t.getTime())?e:`${String(t.getDate()).padStart(2,`0`)}.${String(t.getMonth()+1).padStart(2,`0`)}.${t.getFullYear()} kl. ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`},Hd=({fileItem:e,disabled:r,closeOperationUi:i,onAddComment:a,existingComment:o})=>{let s=(0,t.useRef)(null),c=!!o;return(0,t.useLayoutEffect)(()=>{let e=setTimeout(()=>s.current?.focus({preventScroll:!0}),0);return()=>clearTimeout(e)},[e.fileId]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(zd,{autoFocus:!0,label:c?`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:s,disabled:r,defaultValue:o?.text}),(0,n.jsx)(nc,{skin:`secondary`,size:`small`,disabled:r,onClick:()=>{let e=s.current?.value?.trim();e&&a({text:e,timestamp:new Date().toISOString()}),i()},children:c?`Lagre kommentar`:`Legg til kommentar`}),(0,n.jsx)(nc,{skin:`tertiary`,size:`small`,disabled:r,onClick:i,children:`Avbryt`})]})},Ud=({comment:e,disabled:t,onDeleteComment:r,onEditComment:i})=>(0,n.jsx)(`div`,{className:`pkt-fileupload__queue-display__item__comments`,children:(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:Vd(e.timestamp)})]}),(0,n.jsxs)(`div`,{className:`pkt-fileupload__queue-display__item__comment__actions`,children:[(0,n.jsx)(`button`,{type:`button`,className:`pkt-fileupload__queue-display__item__comment__action`,onClick:i,disabled:t,"aria-label":`Rediger kommentar`,children:(0,n.jsx)(Q,{name:`edit`})}),(0,n.jsx)(`button`,{type:`button`,className:`pkt-fileupload__queue-display__item__comment__action`,onClick:r,disabled:t,"aria-label":`Slett kommentar`,children:(0,n.jsx)(Q,{name:`trash-can`})})]})]})}),Wd=({comments:e})=>(0,n.jsx)(`input`,{type:`hidden`,name:`${(0,t.useContext)(Id).name}-comments`,value:e?JSON.stringify(e):``}),Gd=e=>e.getAttribute(Bd)??[],Kd={id:`comment`,title:e=>(e.attributes?.[Bd]??[]).length>0?``:`Legg til kommentar`,ariaLabel:`Legg til kommentar`,renderExtendedUI:e=>{let t=Gd(e)[0];return(0,n.jsx)(Hd,{fileItem:e.file,disabled:e.disabled,closeOperationUi:e.close,onAddComment:t=>{e.setAttribute(Bd,[t])},existingComment:t})},renderContent:e=>{if(e.isActive)return null;let t=Gd(e)[0];return t?(0,n.jsx)(Ud,{comment:t,disabled:e.disabled,onEditComment:e.activate,onDeleteComment:()=>e.setAttribute(Bd,void 0)}):null},renderHidden:e=>(0,n.jsx)(Wd,{comments:e.getAttribute(Bd)},`comments${e.file.fileId}`)},qd=e=>({id:`remove`,title:`Slett`,ariaLabel:`Slett fil`,onClick:({file:t})=>e(t.fileId)}),Jd=({initialValue:e,disabled:r,onSave:i,onCancel:a})=>{let o=(0,t.useRef)(null),s=(0,t.useId)(),c=()=>i(o.current?.value??``);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`label`,{htmlFor:s,className:`pkt-sr-only`,children:`Endre filnavn`}),(0,n.jsx)(`input`,{id:s,ref:o,type:`text`,autoFocus:!0,disabled:r,defaultValue:e,className:`pkt-fileupload__queue-display__item__rename-input`,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),c()),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),a())}}),(0,n.jsx)(nc,{skin:`secondary`,size:`small`,disabled:r,onClick:c,children:`Lagre`}),(0,n.jsx)(nc,{skin:`tertiary`,size:`small`,disabled:r,onClick:a,children:`Avbryt`})]})},Yd=({targetFilename:e})=>(0,n.jsx)(`input`,{type:`hidden`,name:`${(0,t.useContext)(Id).name}-targetFilename`,value:e}),Xd=e=>e.getAttribute(`targetFilename`)||Md(e.file,``),Zd={id:`rename`,title:`Rediger`,ariaLabel:`Rediger filnavn`,renderInlineUI:e=>(0,n.jsx)(Jd,{initialValue:Xd(e),disabled:e.disabled,onSave:t=>{let n=t.trim();n&&e.setAttribute(`targetFilename`,n),e.close()},onCancel:e.close}),renderHidden:e=>(0,n.jsx)(Yd,{targetFilename:Xd(e)},`rename${e.file.fileId}`)},Qd=(e,n)=>{let r=(0,t.useCallback)((t,n)=>e.find(e=>e.fileId===t)?.attributes?.[n],[e]),i=(0,t.useCallback)((t,r,i)=>{let a=e.find(e=>e.fileId===t);if(!a)return;let o={...a.attributes,[r]:i};i===void 0&&delete o[r],n(t,{attributes:o})},[n,e]);return{fileAttributes:(0,t.useMemo)(()=>e=>({get:t=>r(t,e),set:(t,n)=>i(t,e,n)}),[r,i]),buildAttributeAccessors:(0,t.useCallback)(e=>({getAttribute:t=>r(e,t),setAttribute:(t,n)=>i(e,t,n)}),[r,i])}},$d=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=>kd(n,t,e.length))},[e.length])}},ef=e=>{let[n,r]=(0,t.useState)({});return(0,t.useEffect)(()=>{r(t=>{let n=new Set(e.map(e=>e.id)),r=!1,i={};for(let[e,a]of Object.entries(t))n.has(a)?i[e]=a:r=!0;return r?i:t})},[e]),{getActivated:(0,t.useCallback)(t=>{let r=n[t];if(r)return e.find(e=>e.id===r)},[n,e]),activate:(0,t.useCallback)((e,t)=>{r(n=>({...n,[e]:t.id}))},[]),close:(0,t.useCallback)(e=>{r(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n})},[])}},tf=(e,{uploadStrategy:n,required:r,currentFileCount:i,onMissingFiles:a})=>{(0,t.useEffect)(()=>{if(n!==`custom`||!r)return;let t=e.current?.form;if(!t)return;let o=e=>{i>0||(e.preventDefault(),a())};return t.addEventListener(`submit`,o),()=>{t.removeEventListener(`submit`,o)}},[e,n,r,i,a])},nf=(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=(0,t.useCallback)(e=>{_.current=e,typeof g==`function`?g(e):g&&(g.current=e)},[g]),y=(0,t.useCallback)(()=>{_.current?.open&&(_.current.close(),m?.())},[m]);(0,t.useEffect)(()=>{let e=_.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()},[]),(0,t.useEffect)(()=>{i?_.current?.open||_.current?.showModal():_.current?.open&&_.current.close()},[i]);let b=(0,t.useCallback)(e=>{s&&e.target===_.current&&y()},[s,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)(nc,{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})})]})})});nf.displayName=`PktModal`;var rf=(0,t.createContext)({tail:5}),af=({children:e,tail:r})=>{let i=(0,t.useContext)(rf),a=Od(e,r===void 0?i.tail:r);return a?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`span`,{className:`pkt-fileupload__queue-display__item__title__head`,"data-pkt-truncate-part":`first`,children:a.head}),(0,n.jsx)(`span`,{className:`pkt-fileupload__queue-display__item__title__tail`,"data-pkt-truncate-part":`tail`,children:a.tail})]}):(0,n.jsx)(`span`,{"data-pkt-truncate-part":`first`,children:e})},of=e=>(0,n.jsx)(`button`,{type:`button`,onClick:e.onClick,disabled:e.disabled,className:`pkt-fileupload__queue-display__item__cancel-button`,"aria-label":e.ariaLabel||`Avbryt opplasting`,children:e.label||`Avbryt`}),sf=()=>(0,n.jsx)(`span`,{className:`pkt-fileupload__queue-display__item__loading-text`,"aria-label":`Laster opp fil`,children:`Laster opp`}),cf=({cancelTransfer:e,transferItem:t,disabled:r=!1})=>{let i=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.jsxs)(`p`,{className:`pkt-fileupload__queue-display__item__title`,"aria-label":`Filnavn`,children:[(0,n.jsx)(af,{children:Md(t)}),(0,n.jsxs)(`span`,{className:`pkt-fileupload__queue-display__item__filesize`,children:[` `,`(`,gd(t.file.size),`)`]})]}),(0,n.jsx)(of,{onClick:e,disabled:r}),i?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(mp,{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__percentage`,"aria-hidden":`true`,children:`${Math.round(t.progress*100)}%`})]}):(0,n.jsx)(sf,{})]})},lf=({transferItem:e})=>(0,n.jsxs)(`p`,{className:`pkt-fileupload__queue-display__item__title`,children:[(0,n.jsx)(af,{children:Md(e)}),e.file&&(0,n.jsxs)(`span`,{className:`pkt-fileupload__queue-display__item__filesize`,children:[` `,`(`,gd(e.file.size),`)`]})]}),uf=({transferItem:e,onRemove:t,disabled:r})=>{let i=(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)(lf,{transferItem:e}),(0,n.jsx)(of,{onClick:t,label:`Fjern`,ariaLabel:`Fjern fil som feilet under opplasting`,disabled:r}),(0,n.jsx)(mp,{valueCurrent:i,statusType:`none`,valueMax:100,statusPlacement:`following`,className:`pkt-fileupload__queue-display__item__progress pkt-fileupload__queue-display__item__progress--error`}),e.errorMessage&&(0,n.jsx)(`span`,{className:`pkt-fileupload__queue-display__item__error-message`,children:e.errorMessage})]})},df=({transferItem:e,onRemove:t,disabled:r})=>(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)(lf,{transferItem:e}),(0,n.jsx)(of,{onClick:t,label:`Fjern`,ariaLabel:`Fjern fil som feilet under opplasting`,disabled:r}),e.errorMessage&&(0,n.jsx)(`span`,{className:`pkt-fileupload__queue-display__item__error-message`,children:e.errorMessage})]}),ff=({transferItem:e,onRemove:t,disabled:r})=>e.showProgress?(0,n.jsx)(uf,{transferItem:e,onRemove:t,disabled:r}):(0,n.jsx)(df,{transferItem:e,onRemove:t,disabled:r}),pf=({operation:e,context:t})=>{let r=typeof e.title==`function`?e.title(t.file):e.title;return r?(0,n.jsx)(`button`,{type:`button`,className:`pkt-fileupload__queue-display__item__operation`,onClick:()=>{(e.renderInlineUI||e.renderExtendedUI)&&t.activate(),e.onClick?.(t)},disabled:t.disabled,"aria-label":typeof e.ariaLabel==`function`?e.ariaLabel(t.file):e.ariaLabel,children:r}):null},mf=({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)(lf,{transferItem:e})]}),hf=({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)(nc,{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)(`span`,{className:`pkt-fileupload__queue-display__item__thumbnail__title`,children:(0,n.jsx)(af,{children:e.attributes.targetFilename})})]})},gf=({isOpen:e,images:r,currentIndex:i,onClose:a,onNavigate:o,modalRef: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=>{if(e.key===`Tab`){Dd(e,s.current);return}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,s]),f?(0,n.jsx)(nf,{ref:s,headingText:f.attributes.targetFilename,closeOnBackdropClick:!0,className:`pkt-fileupload__image-preview-modal`,onClose:a,children:(0,n.jsxs)(`div`,{className:`pkt-fileupload__image-preview`,children:[p&&(0,n.jsx)(nc,{variant:`icon-only`,iconName:`chevron-thin-left`,skin:`secondary`,size:`medium`,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)(nc,{variant:`icon-only`,iconName:`chevron-thin-right`,skin:`secondary`,size:`medium`,className:`pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--next`,onClick:()=>o(`next`),"aria-label":`Neste bilde ${i+2} / ${r.length}`})]})}):null},_f=({operation:e,transferItem:t,inputName:n,disabled:r,activatedOperation:i,onActivate:a,onClose:o,buildAttributeAccessors:s})=>{let c=s(t.fileId);return{file:t,inputName:n,disabled:r,isActive:i?.id===e.id,activate:()=>a(t.fileId,e),close:()=>o(t.fileId),getAttribute:c.getAttribute,setAttribute:c.setAttribute}},vf=(e,t)=>e.map(e=>({operation:e,context:_f({operation:e,...t})})),yf=e=>(0,n.jsx)(`div`,{className:`pkt-fileupload__queue-display__item__actions`,children:vf(e.operations,e).filter(({operation:t})=>t.id!==e.activatedOperation?.id).map(({operation:e,context:t})=>(0,n.jsx)(pf,{operation:e,context:t},e.id))}),bf=e=>(0,n.jsx)(n.Fragment,{children:vf(e.operations,e).filter(({operation:e})=>e.renderContent).map(({operation:e,context:t})=>(0,n.jsx)(`div`,{className:`pkt-fileupload__queue-display__item__operation-content`,children:e.renderContent(t)},e.id))}),xf=e=>{let{transferItem:t,activatedOperation:r,operations:i,ItemRenderer:a,onPreviewClick:o}=e,s=r?_f({operation:r,...e}):void 0,c=r?.renderInlineUI||r?.renderExtendedUI?[]:i;return(0,n.jsxs)(n.Fragment,{children:[r?.renderInlineUI&&s?(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:r.renderInlineUI(s)})]}):(0,n.jsx)(a,{transferItem:t,queueItemOperations:i,onPreviewClick:o}),c.length>0&&(0,n.jsx)(yf,{...e,operations:c}),(0,n.jsx)(bf,{...e}),r?.renderExtendedUI&&s&&(0,n.jsx)(`div`,{className:`pkt-fileupload__queue-display__item__expanded-operation-ui`,children:r.renderExtendedUI(s)})]})},Sf=e=>{let{transferItem:t,enableImagePreview:r,onCancelTransfer:i,onOpenPreview:a,disabled:o}=e,s=wd(t.progress),c=r&&t.progress===`done`&&Cd(t);switch(s){case`in-progress`:return(0,n.jsx)(cf,{transferItem:t,cancelTransfer:()=>i(t.fileId),disabled:o});case`error`:return(0,n.jsx)(ff,{transferItem:t,onRemove:()=>i(t.fileId),disabled:o});case`idle`:return(0,n.jsx)(xf,{...e,onPreviewClick:c?()=>a(t.fileId):void 0})}},Cf=(e,n,r)=>(0,t.useMemo)(()=>Td(e,n,r),[e,n,r]),wf=(e,n)=>(0,t.useMemo)(()=>n?e.filter(e=>e.progress===`done`&&Cd(e)):[],[e,n]),Tf=({files:e,cancelTransfer:t,transfers:r=[],queueItemOperations:i=[],ItemRenderer:a=mf,truncateTail:o,enableImagePreview:s=!1,uploadStrategy:c=`form`,disabled:l=!1,inputName:u,buildAttributeAccessors:d})=>{let f=Cf(e,r,c),p=wf(f,s),m=ef(i),h=$d(p);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`ul`,{className:`pkt-fileupload__queue-display`,children:(0,n.jsx)(rf.Provider,{value:{tail:o},children:f.map(e=>{let r={transferItem:e,operations:i,activatedOperation:m.getActivated(e.fileId),inputName:u,disabled:l,onActivate:m.activate,onClose:m.close,buildAttributeAccessors:d};return(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=>(0,n.jsx)(`span`,{children:t.renderHidden(_f({operation:t,...r}))},`${t.id}-${e.fileId}`)),(0,n.jsx)(Sf,{...r,ItemRenderer:a,enableImagePreview:s,onCancelTransfer:t,onOpenPreview:h.open})]},e.fileId)})})}),s&&p.length>0&&(0,n.jsx)(gf,{modalRef:h.modalRef,isOpen:h.isOpen,images:p,currentIndex:h.currentIndex,onClose:h.close,onNavigate:h.navigate})]})},Ef={filename:mf,thumbnail:hf},Df=(0,t.forwardRef)(({value:e,defaultValue:r,id:i,multiple:a=!1,uploadStrategy:o=`form`,addCommentsEnabled:s=!1,renameFilesEnabled:c=!1,truncateTail:l=4,onFilesChanged:u,onFileUploadRequested:d,extraOperations:f=[],itemRenderer:p=Ef.filename,fullwidth:m=!1,allowedFormats:h,formatErrorMessage:g,maxFileSize:_,sizeErrorMessage:v,onFileValidation:y,onFileValidate:b,errorMessage:x,hasError:S=!1,disabled:C=!1,label:w,helptext:ee,optionalTag:T,requiredTag:E,required:te=!1,enableImagePreview:ne=!1,"aria-describedby":re,"aria-invalid":D,...ie},ae)=>{let oe=(0,t.useId)(),se=i??`pkt-fileupload-${oe}`,ce=(0,t.useRef)(null);(0,t.useImperativeHandle)(ae,()=>ce.current,[]);let O=`transfers`in ie?ie.transfers:void 0,[le,k]=(0,t.useState)(null),[A,ue]=(0,t.useState)(``);(0,t.useEffect)(()=>{if(!A)return;let e=setTimeout(()=>ue(``),1500);return()=>clearTimeout(e)},[A]);let de=le??x??null,j=S||!!le||!!(x&&x.trim()),M=de?`${se}-error`:void 0,N=[re,ee?`${se}-helptext`:void 0,M].filter(Boolean).join(` `)||void 0,P=j||D===!0||D===`true`,F=(0,t.useCallback)(e=>{let t=Sd(e,{allowedFormats:h,maxFileSize:_,formatErrorMessage:g,sizeErrorMessage:v,onFileValidation:y});if(t)return t;if(b){let t={file:e,errorMessage:null};if(b(t),t.errorMessage)return t.errorMessage}return null},[h,g,_,v,y,b]);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 I=e!==void 0,[fe,pe]=(0,t.useState)(()=>r??[]),L=I?e:fe;tf(ce,{uploadStrategy:o,required:te,currentFileCount:L.length,onMissingFiles:(0,t.useCallback)(()=>k(md.requiredMissing),[])});let R=typeof p==`string`?Ef[p]:p,me=p===`thumbnail`,he=typeof ie.accept==`string`?ie.accept.trim():void 0,z=(0,t.useMemo)(()=>bd(he,h)||void 0,[he,h]),B=c&&!me,V=s&&!me,ge=(0,t.useCallback)(e=>{for(let t of e){let e=F(t.file);if(e){k(e);return}}k(null);let t=a?[...L,...e]:[e[0]],n=a?e:[e[0]];ue(n.length===1?md.srFileAdded(n[0].attributes.targetFilename):md.srFilesAdded(n.length)),I||pe(t),u?.(t),o===`custom`&&d&&e.forEach(e=>{d?.(e)})},[u,L,a,o,d,F,I]),H=(0,t.useCallback)((e,t)=>{let n=L.map(n=>n.fileId===e?{...n,...t}:n);I||pe(n),u?.(n)},[u,L,I]),_e=(0,t.useCallback)(e=>{let t=L.filter(t=>t.fileId!==e);I||pe(t),u?.(t),`onTransferCancelled`in ie&&ie.onTransferCancelled&&ie.onTransferCancelled?.(e)},[u,L,ie,I]),{buildAttributeAccessors:ve}=Qd(L,H),U=(0,t.useMemo)(()=>{let e=[];return B&&e.push(Zd),V&&e.push(Kd),e.push(...f),e.push(qd(_e)),e},[B,V,f,_e]),{totalCount:ye,uploadedCount:be,failedCount:xe}=(0,t.useMemo)(()=>Ad(L,O),[L,O]),Se=md.fileLabel(ye),Ce=(0,n.jsx)(`div`,{className:(0,$.default)(`pkt-fileupload`,{"pkt-fileupload--full-width":m,"pkt-fileupload--error":j,"pkt-fileupload--disabled":C}),"aria-disabled":C,...C?{inert:``}:{},children:(0,n.jsxs)(Id.Provider,{value:{name:ie.name||``,multiple:!!a,id:se},children:[(0,n.jsx)(`div`,{className:`pkt-sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:A||(ye>0&&be>0?md.srFilesUploadedOfTotal(be,ye,Se):``)}),(0,n.jsx)(`div`,{className:`pkt-sr-only`,"aria-live":`assertive`,"aria-atomic":`true`,children:ye>0&&xe>0&&md.srFilesFailedOfTotal(xe,ye,Se)}),(0,n.jsx)(Ld,{id:se,name:ie.name||``,value:L,onFilesAdded:ge,multiple:a,uploadStrategy:o,ref:ce,accept:me?jd:z,isThumbnailView:me,disabled:C,required:te&&o===`form`,"aria-required":te?`true`:void 0,"aria-invalid":P?`true`:void 0,"aria-describedby":N,hasVisibleLabel:!!w}),j&&de&&(0,n.jsx)($s,{skin:`error`,"aria-live":`assertive`,role:`alert`,compact:!0,id:M,className:`pkt-fileupload__error-alert`,children:de}),L.length>0&&(0,n.jsx)(Tf,{files:L,cancelTransfer:_e,truncateTail:l,transfers:O,uploadStrategy:o,ItemRenderer:R,enableImagePreview:me&&ne,disabled:C,inputName:ie.name||``,buildAttributeAccessors:ve,queueItemOperations:U})]})});return w?(0,n.jsx)(Su,{forId:se,label:w,helptext:ee,disabled:C,hasError:j,optionalTag:T,requiredTag:E,className:(0,$.default)(`pkt-fileupload-wrapper`,{"pkt-fileupload-wrapper--full-width":m}),children:Ce}):Ce});Df.displayName=`PktFileUpload`;var Of=({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)(Ju,{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}`))})]})]})}),kf=({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)(Ju,{triggerType:`footerlink`,hotjarId:o,googleAnalyticsId:s,devMode:c,cookieDomain:l,cookieSecure:u,cookieExpiryDays:d,onToggleConsent:f})})]})})}),Af=(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 jf(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 Mf=({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]})};Mf.displayName=`PktLink`;var Nf=e=>typeof e.target==`string`?{title:e.title,iconName:e.iconName,href:e.target}:{title:e.title,iconName:e.iconName,onClick:e.target},Pf=({item:e,className:t})=>`href`in e?(0,n.jsx)(Mf,{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]}),Ff=({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)(Pf,{item:e})},t))}),If=(0,t.forwardRef)(({user:e,formattedLastLoggedIn:t,representing:r,userMenu:i,canChangeRepresentation:a,changeRepresentation:o,logoutOnClick:s},c)=>{let l=i?.map(Nf);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)(Ff,{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)(Pf,{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)(Pf,{item:{title:`Endre organisasjon`,iconName:`cogwheel`,onClick:o}})})})}),s&&(0,n.jsx)(`li`,{className:`pkt-user-menu__item`,children:(0,n.jsx)(Pf,{item:{title:`Logg ut`,iconName:`exit`,onClick:s}})})]})})});If.displayName=`PktHeaderUserMenu`;var Lf=(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)(Su,{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`})]})})});Lf.displayName=`PktTextinput`;var Rf=(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=Af(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]);jf(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.17/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.17/logos/`})}):(0,n.jsx)(Q,{name:`oslologo`,"aria-hidden":`true`,path:`https://punkt-cdn.oslo.kommune.no/16.17/logos/`})}),y&&(0,n.jsx)(`span`,{className:`pkt-header-service__service-name`,children:_?(0,n.jsx)(Mf,{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)(nc,{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)(nc,{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)(Lf,{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)(Lf,{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)(nc,{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)(nc,{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)(If,{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)(nc,{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});Rf.displayName=`PktHeaderService`;var zf=(0,t.forwardRef)((e,t)=>(0,n.jsx)(Rf,{...e,ref:t}));zf.displayName=`PktHeader`;var Bf={automat:`parking-meter`,bike:`bicycle`,corona:`virus`,directions:`arrow-directions`,document:`document-plain`,"download-document":`document-download`,elcar:`electric-car`,"error-hexa":`alert-error`,"fire-emblem":`shield-fire`,"link-arrow":`arrow-link`,"linked-in":`linkedin`,"map-layer":`map-layers`,mobile:`mobile-phone`,neutral:`smiley-neutral`,placeholder:`placeholder-icon`,sad:`smiley-sad`,signing:`signature`,sky:`cloud`,smile:`smiley-smile`,"success-square":`alert-success`,trash:`trash-can`,treatment:`processing`,"warning-triangle":`alert-warning`};function Vf(e){return e&&(Bf[e]??e)}var Hf={"facebook.com":`facebook`,"fb.com":`facebook`,"instagram.com":`instagram`,"linkedin.com":`linkedin`,"x.com":`x`,"github.com":`github`};function Uf(e){return e.toLowerCase().replace(/^(?:www|m)\./,``)}function Wf(e,t){if(e)try{let t=Hf[Uf(new URL(e).hostname)];if(t)return t}catch{}if(t){let e=t.trim().toLowerCase().replace(/\s+/g,`-`);if(e){let t=Vf(e);if(t)return t}}}var Gf=`nb-NO`;function Kf(e,t=Gf){if(e)return e[t]??e[Gf]}async function qf(e=fd,t){let n=await fetch(e,{signal:t});if(!n.ok)throw Error(`pkt-header-menu: failed to fetch ${e} (HTTP ${n.status})`);let r=await n.json();if(!r||typeof r!=`object`)throw Error(`pkt-header-menu: ${e} returned a non-object payload`);return r}var Jf=({dataUrl:e=fd,data:r,locale:i=`nb-NO`,open:a=!1,mobileBreakpoint:o=768,ariaLabelledBy:s,className:c,onDataLoaded:l,onDataError:u,ref:d,...f})=>{let[p,m]=(0,t.useState)(r?`ready`:`idle`),[h,g]=(0,t.useState)(void 0),[_,v]=(0,t.useState)(!1),y=(0,t.useRef)(l),b=(0,t.useRef)(u);(0,t.useEffect)(()=>{y.current=l},[l]),(0,t.useEffect)(()=>{b.current=u},[u]),(0,t.useEffect)(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let e=window.matchMedia(`(max-width: ${o-1}px)`);v(e.matches);let t=e=>v(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[o]),(0,t.useEffect)(()=>{r&&(m(`ready`),y.current?.(r))},[r]),(0,t.useEffect)(()=>{if(r)return;let t=new AbortController;return m(`loading`),qf(e,t.signal).then(e=>{t.signal.aborted||(g(e),m(`ready`),y.current?.(e))}).catch(e=>{e.name!==`AbortError`&&(m(`error`),b.current?.(e))}),()=>t.abort()},[r,e]);let x=r??h,S=(0,t.useMemo)(()=>Kf(x,i),[x,i]),C=[`pkt-header-menu`,a&&`pkt-header-menu--open`,c].filter(Boolean).join(` `);if(p===`loading`)return(0,n.jsx)(`section`,{...f,ref:d,className:C,children:(0,n.jsx)(`nav`,{"aria-busy":`true`,children:(0,n.jsx)(`p`,{className:`pkt-header-menu__loading`,children:`Laster meny…`})})});if(p===`error`||!S)return(0,n.jsx)(`section`,{...f,ref:d,className:C,children:(0,n.jsx)(`nav`,{"aria-hidden":!a,children:(0,n.jsx)(`p`,{className:`pkt-header-menu__error`,children:`Kunne ikke laste meny.`})})});let{megamenu:w,i18n:ee}=S,T=ee?.navAriaLabel||`Hovedmeny`;return(0,n.jsx)(`section`,{...f,ref:d,className:C,"aria-labelledby":s||void 0,children:(0,n.jsxs)(`nav`,{"aria-label":T,children:[_?(0,n.jsx)(Xf,{services:w.services,sections:w.sections}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Zf,{services:w.services}),(0,n.jsx)(Qf,{buttons:w.buttons,mobile:!1}),(0,n.jsx)($f,{sections:w.sections})]}),(0,n.jsx)(Qf,{buttons:w.buttons,mobile:!0}),(0,n.jsx)(tp,{links:w.links,some:w.some})]})})},Yf=({services:e})=>(0,n.jsx)(`ul`,{className:`pkt-header-menu__services-list`,children:e.links.map((e,t)=>(0,n.jsx)(`li`,{className:`pkt-header-menu__service`,children:(0,n.jsxs)(`a`,{className:`pkt-header-menu__service-link`,href:e.url,children:[(0,n.jsx)(Q,{className:`pkt-header-menu__service-icon`,name:Vf(e.icon),"aria-hidden":`true`}),(0,n.jsx)(`span`,{className:`pkt-header-menu__service-text`,children:e.text})]})},`service-${t}`))}),Xf=({services:e,sections:t})=>(0,n.jsx)(`div`,{className:`pkt-header-menu__sections`,children:(0,n.jsxs)(_,{className:`pkt-header-menu__sections-inner`,skin:`plus-minus`,name:`header-menu-accordion`,children:[(0,n.jsx)(Qs,{className:`pkt-header-menu__section`,skin:`plus-minus`,id:`pkt-header-menu-services`,title:e.title,children:(0,n.jsx)(Yf,{services:e})}),t.map((e,t)=>(0,n.jsx)(Qs,{className:`pkt-header-menu__section`,skin:`plus-minus`,id:`pkt-header-menu-section-${t}`,title:e.title,children:(0,n.jsx)(ep,{links:e.links})},`section-${t}`))]})}),Zf=({services:e})=>(0,n.jsxs)(`div`,{className:`pkt-header-menu__services`,children:[(0,n.jsx)(`h2`,{className:`pkt-header-menu__services-title`,children:e.title}),(0,n.jsx)(Yf,{services:e})]}),Qf=({buttons:e,mobile:t})=>!e||e.length===0?null:(0,n.jsx)(`div`,{className:[`pkt-header-menu__buttons`,t&&`pkt-header-menu__buttons--mobile`].filter(Boolean).join(` `),children:e.map((e,t)=>(0,n.jsxs)(`a`,{className:`pkt-btn pkt-btn--secondary pkt-btn--icon-right pkt-btn--small`,href:e.url,children:[(0,n.jsx)(Q,{className:`pkt-btn__icon`,name:e.iconName?Vf(e.iconName):`user`,"aria-hidden":`true`}),(0,n.jsx)(`span`,{className:`pkt-btn__text`,children:e.text})]},`button-${t}`))}),$f=({sections:e})=>!e||e.length===0?null:(0,n.jsx)(`div`,{className:`pkt-header-menu__sections`,children:(0,n.jsx)(`div`,{className:`pkt-header-menu__sections-inner`,children:e.map((e,t)=>(0,n.jsxs)(`div`,{className:`pkt-header-menu__section`,children:[(0,n.jsx)(`h2`,{className:`pkt-header-menu__section-title`,children:e.title}),(0,n.jsx)(ep,{links:e.links})]},`section-${t}`))})}),ep=({links:e})=>(0,n.jsx)(`ul`,{className:`pkt-header-menu__section-list`,children:e.map((e,t)=>(0,n.jsx)(`li`,{children:(0,n.jsx)(`a`,{className:`pkt-header-menu__section-link`,href:e.url,children:e.text})},`section-link-${t}`))}),tp=({links:e,some:t})=>{let r=e&&e.length>0,i=t&&t.length>0;return!r&&!i?null:(0,n.jsxs)(`div`,{className:`pkt-header-menu__footer`,children:[r&&(0,n.jsx)(`ul`,{className:`pkt-header-menu__footer-list`,children:e.map((e,t)=>(0,n.jsx)(`li`,{children:(0,n.jsx)(`a`,{className:`pkt-header-menu__footer-link`,href:e.url,children:e.text})},`footer-link-${t}`))}),i&&(0,n.jsx)(`ul`,{className:`pkt-header-menu__footer-list pkt-header-menu__footer-list--social`,children:t.map((e,t)=>(0,n.jsx)(np,{entry:e},`some-${t}`))})]})},np=({entry:e})=>{let t=Wf(e.url,e.text);return(0,n.jsx)(`li`,{children:(0,n.jsx)(`a`,{className:`pkt-header-menu__social-link`,href:e.url,"aria-label":e.text,children:t?(0,n.jsx)(Q,{name:t,"aria-hidden":`true`}):(0,n.jsx)(`span`,{children:e.text})})})},rp=x({tagName:`pkt-heading`,elementClass:pi,react:t.default,displayName:`PktHeading`}),ip=(0,t.forwardRef)(({children:e,...t},r)=>(0,n.jsx)(rp,{"data-testid":`pkt-heading`,...t,ref:r,children:e}));ip.displayName=`PktHeading`;var ap=x({tagName:`pkt-helptext`,elementClass:Gi,react:t.default,displayName:`PktHelptext`,events:{onToggleHelpText:`toggleHelpText`}}),op=(0,t.forwardRef)(({children:e,...t},r)=>(0,n.jsx)(ap,{...t,ref:r,children:(0,n.jsx)(`div`,{className:`pkt-contents`,children:e})}));op.displayName=`PktHelptext`;var sp=(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]}));sp.displayName=`PktInput`;var cp=({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})]})};cp.displayName=`PktLinkCard`;var lp=x({tagName:`pkt-loader`,elementClass:Es,react:t.default,displayName:`PktLoader`,events:{}}),up=(0,t.forwardRef)(({children:e,...t},r)=>(0,n.jsx)(lp,{...t,ref:r,children:(0,n.jsx)(`div`,{className:`pkt-contents`,children:e})}));up.displayName=`PktLoader`;var dp=({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})]})};dp.displayName=`PktMessagebox`;var fp=()=>(`00000000000000000`+(Math.random()*0x10000000000000000).toString(16)).slice(-16),pp=()=>{let e=fp(),t=fp();return e.slice(0,8)+`-`+e.slice(8,12)+`-4`+e.slice(13)+`-a`+t.slice(1,4)+`-`+t.slice(4)},mp=(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)(()=>pp(),[]),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})})]})})});mp.displayName=`PktProgressbar`;var hp=(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})]})]})})});hp.displayName=`PktRadioButton`;var gp=(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={role:`search`,className:`pkt-searchinput pkt-searchinput--${e} ${i?`pkt-searchinput--fullwidth`:``}`,...xu()};return(e=>d?(0,n.jsx)(`form`,{...b,action:d,method:f,children:e}):(0,n.jsx)(`div`,{...b,children:e}))((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)(nc,{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}`))})]}))});gp.displayName=`PktSearchInput`;var _p=(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)(Su,{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})}));_p.displayName=`PktSelect`;var vp=(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)`}})}),yp=(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`})]}),bp=(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`})]}),xp=({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`?yp:r===`completed`?bp:vp}),(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})]})]}),Sp=(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})});Sp.displayName=`PktStepper`;var Cp=({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}),wp=({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}),Tp=({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}),Ep=({className:e,children:t,...r})=>(0,n.jsx)(`thead`,{className:(0,$.default)(e,`pkt-table__header`,{}),role:`rowgroup`,...r,children:t}),Dp=({className:e,children:t,...r})=>(0,n.jsx)(`th`,{className:(0,$.default)(e,`pkt-table__header-cell`,{}),role:`columnheader`,...r,children:t}),Op=({className:e,children:t,...r})=>(0,n.jsx)(`tr`,{className:(0,$.default)(e,`pkt-table__row`,{}),role:`row`,...r,children:t}),kp=(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}=jp(),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)(vu,{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})});kp.displayName=`PktTabItem`;var Ap=(0,t.createContext)(null),jp=()=>{let e=(0,t.useContext)(Ap);if(!e)throw Error(`TabItem must be used within a Tabs component`);return e},Mp=(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)(kp,{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)(Ap.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})})})});Mp.displayName=`PktTabs`;var Np=e=>e?Math.max(1,Math.round(e/60)):1,Pp=(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)},Fp=e=>{let t=Np(e);return Array.from({length:Math.floor(60/t)},(e,n)=>n*t)},Ip=(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`)}},Lp=e=>/^\d{2}:\d{2}$/.test(e)&&parseInt(e.slice(0,2),10)<=23&&parseInt(e.slice(3),10)<=59,Rp=e=>{let[t,n]=e.split(`:`).map(Number);return t*60+n},zp={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 Bp(e){if(e&&Lp(e)){let[t,n]=e.split(`:`);return[t,n]}return[``,``]}function Vp(e,t){return`${String(parseInt(e,10)).padStart(2,`0`)}:${String(parseInt(t,10)).padStart(2,`0`)}`}function Hp(e,t){let{required:n,min:r,max:i,step:a}=t;if(n&&!e)return{valid:!1,message:zp.required};if(!e)return{valid:!0};if(!Lp(e))return{valid:!1,message:zp.invalid};let o=Rp(e),s=Np(a);return r&&o<Rp(String(r))?{valid:!1,message:zp.rangeUnderflowMin.replace(`{min}`,String(r))}:i&&o>Rp(String(i))?{valid:!1,message:zp.rangeOverflowMax.replace(`{max}`,String(i))}:a&&o%s!==0?{valid:!1,message:s===60?zp.timeStepMismatchHour:s===30?zp.timeStepMismatchHalfHour:zp.timeStepMismatch.replace(`{step}`,`${s}, ${s*2}, ${s*3}`)}:{valid:!0}}function Up(e){return e===3600||e<3600&&3600%e==0&&e%60==0}function Wp(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??pd,[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)(()=>Bp(a===void 0?o:a)[0]),[j,M]=(0,t.useState)(()=>Bp(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]=Bp(a);F(e),I(t)},[a,se,F,I]),(0,t.useEffect)(()=>{l!=null&&!Up(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)(()=>Np(l),[l]),we=(0,t.useMemo)(()=>Pp(s,c),[s,c]),Te=(0,t.useMemo)(()=>Fp(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=Hp(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=Vp(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=Vp(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=Hp(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=Ip(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]=Bp(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]=Bp(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 Gp=(0,t.forwardRef)((e,t)=>{let{onChange:r,onInput:i}=e,a=Wp(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)(Su,{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()})})});Gp.displayName=`PktTimepicker`,e.FileItem=Fd,e.ItemRenderers=Ef,e.PktAccordion=_,e.PktAccordionItem=Qs,e.PktAlert=$s,e.PktBackLink=ec,e.PktBreadcrumbs=tc,e.PktButton=nc,e.PktCalendar=_u,e.PktCard=yu,e.PktCheckbox=bu,e.PktCombobox=qu,e.PktConsent=Ju,e.PktDatepicker=dd,e.PktFileUpload=Df,e.PktFooter=Of,e.PktFooterSimple=kf,e.PktHeader=zf,e.PktHeaderMenu=Jf,e.PktHeaderService=Rf,e.PktHeading=ip,e.PktHelptext=op,e.PktIcon=Q,e.PktInput=sp,e.PktInputWrapper=Su,e.PktLink=Mf,e.PktLinkCard=cp,e.PktLoader=up,e.PktMessagebox=dp,e.PktModal=nf,e.PktProgressbar=mp,e.PktRadioButton=hp,e.PktSearchInput=gp,e.PktSelect=_p,e.PktStep=xp,e.PktStepper=Sp,e.PktTabItem=kp,e.PktTable=Cp,e.PktTableBody=wp,e.PktTableDataCell=Tp,e.PktTableHeader=Ep,e.PktTableHeaderCell=Dp,e.PktTableRow=Op,e.PktTabs=Mp,e.PktTag=vu,e.PktTextarea=zd,e.PktTextinput=Lf,e.PktTimepicker=Gp});