@oslokommune/punkt-react 13.22.0 → 14.0.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.
- package/CHANGELOG.md +44 -0
- package/dist/index.d.ts +78 -15
- package/dist/punkt-react.es.js +5090 -3965
- package/dist/punkt-react.umd.js +749 -448
- package/package.json +5 -5
- package/src/components/header/Header.test.tsx +33 -27
- package/src/components/header/Header.tsx +23 -342
- package/src/components/header/HeaderService.test.tsx +515 -0
- package/src/components/header/HeaderService.tsx +525 -0
- package/src/components/header/types.ts +90 -0
- package/src/components/headerUserMenu/UserMenu.test.tsx +75 -0
- package/src/components/headerUserMenu/UserMenu.tsx +173 -0
- package/src/components/index.ts +1 -0
- package/src/components/interfaces.ts +1 -0
package/dist/punkt-react.umd.js
CHANGED
|
@@ -33,108 +33,108 @@
|
|
|
33
33
|
return [];
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
(function(
|
|
36
|
+
(function(P,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react/jsx-runtime"),require("react"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-router-dom"],l):(P=typeof globalThis<"u"?globalThis:P||self,l(P["punkt-react"]={},P.ReactJsxRuntime,P.React,P.ReactRouterDOM))})(this,(function(P,l,_,on){"use strict";const ln=_.createContext({}),qa=()=>_.useContext(ln),hn=_.forwardRef(({compact:s=!1,skin:t="borderless",ariaLabelledBy:e,children:i,name:n,className:a},r)=>{const h=["pkt-accordion",s&&"pkt-accordion--compact",t&&`pkt-accordion--${t}`,a].filter(Boolean).join(" ");return l.jsx(ln.Provider,{value:{name:n},children:l.jsx("div",{ref:r,className:h,"data-testid":"pkt-accordion","aria-labelledby":e||void 0,children:i})})});hn.displayName="PktAccordion";/**
|
|
37
37
|
* @license
|
|
38
38
|
* Copyright 2018 Google LLC
|
|
39
39
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
40
|
-
*/const
|
|
40
|
+
*/const Wa=new Set(["children","localName","ref","style","className"]),dn=new WeakMap,cn=(s,t,e,i,n)=>{const a=n==null?void 0:n[t];a===void 0?(s[t]=e,e==null&&t in HTMLElement.prototype&&s.removeAttribute(t)):e!==i&&((r,h,d)=>{let u=dn.get(r);u===void 0&&dn.set(r,u=new Map);let g=u.get(h);d!==void 0?g===void 0?(u.set(h,g={handleEvent:d}),r.addEventListener(h,g)):g.handleEvent=d:g!==void 0&&(u.delete(h),r.removeEventListener(h,g))})(s,a,e)},ie=({react:s,tagName:t,elementClass:e,events:i,displayName:n})=>{const a=new Set(Object.keys(i??{})),r=s.forwardRef(((h,d)=>{const u=s.useRef(new Map),g=s.useRef(null),m={},$={};for(const[b,y]of Object.entries(h))Wa.has(b)?m[b==="className"?"class":b]=y:a.has(b)||b in e.prototype?$[b]=y:m[b]=y;return s.useLayoutEffect((()=>{if(g.current===null)return;const b=new Map;for(const y in $)cn(g.current,y,h[y],u.current.get(y),i),u.current.delete(y),b.set(y,h[y]);for(const[y,x]of u.current)cn(g.current,y,void 0,x,i);u.current=b})),s.useLayoutEffect((()=>{var b;(b=g.current)==null||b.removeAttribute("defer-hydration")}),[]),m.suppressHydrationWarning=!0,s.createElement(t,{...m,ref:s.useCallback((b=>{g.current=b,typeof d=="function"?d(b):d!==null&&(d.current=b)}),[d])})}));return r.displayName=n??e.name,r};/**
|
|
41
41
|
* @license
|
|
42
42
|
* Copyright 2017 Google LLC
|
|
43
43
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
44
|
-
*/const
|
|
45
|
-
\f\r]`,
|
|
46
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
44
|
+
*/const hi=globalThis,di=hi.trustedTypes,pn=di?di.createPolicy("lit-html",{createHTML:s=>s}):void 0,un="$lit$",Me=`lit$${Math.random().toFixed(9).slice(2)}$`,fn="?"+Me,Ra=`<${fn}>`,Ue=document,Os=()=>Ue.createComment(""),Ps=s=>s===null||typeof s!="object"&&typeof s!="function",Oi=Array.isArray,Ka=s=>Oi(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",Pi=`[
|
|
45
|
+
\f\r]`,Ds=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,gn=/-->/g,mn=/>/g,ze=RegExp(`>|${Pi}(?:([^\\s"'>=/]+)(${Pi}*=${Pi}*(?:[^
|
|
46
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),vn=/'/g,bn=/"/g,kn=/^(?:script|style|textarea|title)$/i,Ya=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),c=Ya(1),Dt=Symbol.for("lit-noChange"),k=Symbol.for("lit-nothing"),yn=new WeakMap,qe=Ue.createTreeWalker(Ue,129);function $n(s,t){if(!Oi(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return pn!==void 0?pn.createHTML(t):t}const Ga=(s,t)=>{const e=s.length-1,i=[];let n,a=t===2?"<svg>":t===3?"<math>":"",r=Ds;for(let h=0;h<e;h++){const d=s[h];let u,g,m=-1,$=0;for(;$<d.length&&(r.lastIndex=$,g=r.exec(d),g!==null);)$=r.lastIndex,r===Ds?g[1]==="!--"?r=gn:g[1]!==void 0?r=mn:g[2]!==void 0?(kn.test(g[2])&&(n=RegExp("</"+g[2],"g")),r=ze):g[3]!==void 0&&(r=ze):r===ze?g[0]===">"?(r=n??Ds,m=-1):g[1]===void 0?m=-2:(m=r.lastIndex-g[2].length,u=g[1],r=g[3]===void 0?ze:g[3]==='"'?bn:vn):r===bn||r===vn?r=ze:r===gn||r===mn?r=Ds:(r=ze,n=void 0);const b=r===ze&&s[h+1].startsWith("/>")?" ":"";a+=r===Ds?d+Ra:m>=0?(i.push(u),d.slice(0,m)+un+d.slice(m)+Me+b):d+Me+(m===-2?h:b)}return[$n(s,a+(s[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]};let Di=class Ua{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let a=0,r=0;const h=t.length-1,d=this.parts,[u,g]=Ga(t,e);if(this.el=Ua.createElement(u,i),qe.currentNode=this.el.content,e===2||e===3){const m=this.el.content.firstChild;m.replaceWith(...m.childNodes)}for(;(n=qe.nextNode())!==null&&d.length<h;){if(n.nodeType===1){if(n.hasAttributes())for(const m of n.getAttributeNames())if(m.endsWith(un)){const $=g[r++],b=n.getAttribute(m).split(Me),y=/([.?@])?(.*)/.exec($);d.push({type:1,index:a,name:y[2],strings:b,ctor:y[1]==="."?Xa:y[1]==="?"?Ja:y[1]==="@"?Qa:pi}),n.removeAttribute(m)}else m.startsWith(Me)&&(d.push({type:6,index:a}),n.removeAttribute(m));if(kn.test(n.tagName)){const m=n.textContent.split(Me),$=m.length-1;if($>0){n.textContent=di?di.emptyScript:"";for(let b=0;b<$;b++)n.append(m[b],Os()),qe.nextNode(),d.push({type:2,index:++a});n.append(m[$],Os())}}}else if(n.nodeType===8)if(n.data===fn)d.push({type:2,index:a});else{let m=-1;for(;(m=n.data.indexOf(Me,m+1))!==-1;)d.push({type:7,index:a}),m+=Me.length-1}a++}}static createElement(t,e){const i=Ue.createElement("template");return i.innerHTML=t,i}};function hs(s,t,e=s,i){var n,a;if(t===Dt)return t;let r=i!==void 0?(n=e._$Co)==null?void 0:n[i]:e._$Cl;const h=Ps(t)?void 0:t._$litDirective$;return(r==null?void 0:r.constructor)!==h&&((a=r==null?void 0:r._$AO)==null||a.call(r,!1),h===void 0?r=void 0:(r=new h(s),r._$AT(s,e,i)),i!==void 0?(e._$Co??(e._$Co=[]))[i]=r:e._$Cl=r),r!==void 0&&(t=hs(s,r._$AS(s,t.values),r,i)),t}let Za=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,n=((t==null?void 0:t.creationScope)??Ue).importNode(e,!0);qe.currentNode=n;let a=qe.nextNode(),r=0,h=0,d=i[0];for(;d!==void 0;){if(r===d.index){let u;d.type===2?u=new ci(a,a.nextSibling,this,t):d.type===1?u=new d.ctor(a,d.name,d.strings,this,t):d.type===6&&(u=new tr(a,this,t)),this._$AV.push(u),d=i[++h]}r!==(d==null?void 0:d.index)&&(a=qe.nextNode(),r++)}return qe.currentNode=Ue,n}p(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}},ci=class za{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,i,n){this.type=2,this._$AH=k,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=n,this._$Cv=(n==null?void 0:n.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=hs(this,t,e),Ps(t)?t===k||t==null||t===""?(this._$AH!==k&&this._$AR(),this._$AH=k):t!==this._$AH&&t!==Dt&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Ka(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==k&&Ps(this._$AH)?this._$AA.nextSibling.data=t:this.T(Ue.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:n}=t,a=typeof n=="number"?this._$AC(t):(n.el===void 0&&(n.el=Di.createElement($n(n.h,n.h[0]),this.options)),n);if(((e=this._$AH)==null?void 0:e._$AD)===a)this._$AH.p(i);else{const r=new Za(a,this),h=r.u(this.options);r.p(i),this.T(h),this._$AH=r}}_$AC(t){let e=yn.get(t.strings);return e===void 0&&yn.set(t.strings,e=new Di(t)),e}k(t){Oi(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,n=0;for(const a of t)n===e.length?e.push(i=new za(this.O(Os()),this.O(Os()),this,this.options)):i=e[n],i._$AI(a),n++;n<e.length&&(this._$AR(i&&i._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t!==this._$AB;){const n=t.nextSibling;t.remove(),t=n}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}},pi=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,n,a){this.type=1,this._$AH=k,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=a,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=k}_$AI(t,e=this,i,n){const a=this.strings;let r=!1;if(a===void 0)t=hs(this,t,e,0),r=!Ps(t)||t!==this._$AH&&t!==Dt,r&&(this._$AH=t);else{const h=t;let d,u;for(t=a[0],d=0;d<a.length-1;d++)u=hs(this,h[i+d],e,d),u===Dt&&(u=this._$AH[d]),r||(r=!Ps(u)||u!==this._$AH[d]),u===k?t=k:t!==k&&(t+=(u??"")+a[d+1]),this._$AH[d]=u}r&&!n&&this.j(t)}j(t){t===k?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},Xa=class extends pi{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===k?void 0:t}},Ja=class extends pi{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==k)}},Qa=class extends pi{constructor(t,e,i,n,a){super(t,e,i,n,a),this.type=5}_$AI(t,e=this){if((t=hs(this,t,e,0)??k)===Dt)return;const i=this._$AH,n=t===k&&i!==k||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,a=t!==k&&(i===k||n);n&&this.element.removeEventListener(this.name,this,i),a&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}},tr=class{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){hs(this,t)}};const er={I:ci},_n=hi.litHtmlPolyfillSupport;_n==null||_n(Di,ci),(hi.litHtmlVersions??(hi.litHtmlVersions=[])).push("3.3.1");const sr=(s,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let n=i._$litPart$;if(n===void 0){const a=(e==null?void 0:e.renderBefore)??null;i._$litPart$=n=new ci(t.insertBefore(Os(),a),a,void 0,e??{})}return n._$AI(s),n};/**
|
|
47
47
|
* @license
|
|
48
48
|
* Copyright 2017 Google LLC
|
|
49
49
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
50
|
-
*/const
|
|
50
|
+
*/const F=s=>(t,e)=>{e!==void 0?e.addInitializer((()=>{customElements.define(s,t)})):customElements.define(s,t)};/**
|
|
51
51
|
* @license
|
|
52
52
|
* Copyright 2019 Google LLC
|
|
53
53
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
54
|
-
*/const
|
|
54
|
+
*/const ui=globalThis,Ii=ui.ShadowRoot&&(ui.ShadyCSS===void 0||ui.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,wn=Symbol(),xn=new WeakMap;let ir=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==wn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(Ii&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=xn.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&xn.set(e,t))}return t}toString(){return this.cssText}};const nr=s=>new ir(typeof s=="string"?s:s+"",void 0,wn),ar=(s,t)=>{if(Ii)s.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const e of t){const i=document.createElement("style"),n=ui.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=e.cssText,s.appendChild(i)}},Sn=Ii?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return nr(e)})(s):s;/**
|
|
55
55
|
* @license
|
|
56
56
|
* Copyright 2017 Google LLC
|
|
57
57
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
58
|
-
*/const{is:
|
|
58
|
+
*/const{is:rr,defineProperty:or,getOwnPropertyDescriptor:lr,getOwnPropertyNames:hr,getOwnPropertySymbols:dr,getPrototypeOf:cr}=Object,ds=globalThis,Cn=ds.trustedTypes,pr=Cn?Cn.emptyScript:"",Tn=ds.reactiveElementPolyfillSupport,Is=(s,t)=>s,fi={toAttribute(s,t){switch(t){case Boolean:s=s?pr:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},Li=(s,t)=>!rr(s,t),En={attribute:!0,type:String,converter:fi,reflect:!1,useDefault:!1,hasChanged:Li};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),ds.litPropertyMetadata??(ds.litPropertyMetadata=new WeakMap);let cs=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=En){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),n=this.getPropertyDescriptor(t,i,e);n!==void 0&&or(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){const{get:n,set:a}=lr(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get:n,set(r){const h=n==null?void 0:n.call(this);a==null||a.call(this,r),this.requestUpdate(t,h,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??En}static _$Ei(){if(this.hasOwnProperty(Is("elementProperties")))return;const t=cr(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Is("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Is("properties"))){const e=this.properties,i=[...hr(e),...dr(e)];for(const n of i)this.createProperty(n,e[n])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,n]of e)this.elementProperties.set(i,n)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const n=this._$Eu(e,i);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const n of i)e.unshift(Sn(n))}else t!==void 0&&e.push(Sn(t));return e}static _$Eu(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach((e=>e(this)))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ar(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach((e=>{var i;return(i=e.hostConnected)==null?void 0:i.call(e)}))}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach((e=>{var i;return(i=e.hostDisconnected)==null?void 0:i.call(e)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){var i;const n=this.constructor.elementProperties.get(t),a=this.constructor._$Eu(t,n);if(a!==void 0&&n.reflect===!0){const r=(((i=n.converter)==null?void 0:i.toAttribute)!==void 0?n.converter:fi).toAttribute(e,n.type);this._$Em=t,r==null?this.removeAttribute(a):this.setAttribute(a,r),this._$Em=null}}_$AK(t,e){var i,n;const a=this.constructor,r=a._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const h=a.getPropertyOptions(r),d=typeof h.converter=="function"?{fromAttribute:h.converter}:((i=h.converter)==null?void 0:i.fromAttribute)!==void 0?h.converter:fi;this._$Em=r;const u=d.fromAttribute(e,h.type);this[r]=u??((n=this._$Ej)==null?void 0:n.get(r))??u,this._$Em=null}}requestUpdate(t,e,i){var n;if(t!==void 0){const a=this.constructor,r=this[t];if(i??(i=a.getPropertyOptions(t)),!((i.hasChanged??Li)(r,e)||i.useDefault&&i.reflect&&r===((n=this._$Ej)==null?void 0:n.get(t))&&!this.hasAttribute(a._$Eu(t,i))))return;this.C(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:n,wrapped:a},r){i&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,r??e??this[t]),a!==!0||r!==void 0)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),n===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[a,r]of this._$Ep)this[a]=r;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[a,r]of n){const{wrapped:h}=r,d=this[a];h!==!0||this._$AL.has(a)||d===void 0||this.C(a,void 0,r,d)}}let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),(t=this._$EO)==null||t.forEach((n=>{var a;return(a=n.hostUpdate)==null?void 0:a.call(n)})),this.update(i)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach((i=>{var n;return(n=i.hostUpdated)==null?void 0:n.call(i)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach((e=>this._$ET(e,this[e])))),this._$EM()}updated(t){}firstUpdated(t){}};cs.elementStyles=[],cs.shadowRootOptions={mode:"open"},cs[Is("elementProperties")]=new Map,cs[Is("finalized")]=new Map,Tn==null||Tn({ReactiveElement:cs}),(ds.reactiveElementVersions??(ds.reactiveElementVersions=[])).push("2.1.1");/**
|
|
59
59
|
* @license
|
|
60
60
|
* Copyright 2017 Google LLC
|
|
61
61
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
62
|
-
*/const
|
|
62
|
+
*/const ur={attribute:!0,type:String,converter:fi,reflect:!1,hasChanged:Li},fr=(s=ur,t,e)=>{const{kind:i,metadata:n}=e;let a=globalThis.litPropertyMetadata.get(n);if(a===void 0&&globalThis.litPropertyMetadata.set(n,a=new Map),i==="setter"&&((s=Object.create(s)).wrapped=!0),a.set(e.name,s),i==="accessor"){const{name:r}=e;return{set(h){const d=t.get.call(this);t.set.call(this,h),this.requestUpdate(r,d,s)},init(h){return h!==void 0&&this.C(r,void 0,s,h),h}}}if(i==="setter"){const{name:r}=e;return function(h){const d=this[r];t.call(this,h),this.requestUpdate(r,d,s)}}throw Error("Unsupported decorator location: "+i)};function o(s){return(t,e)=>typeof e=="object"?fr(s,t,e):((i,n,a)=>{const r=n.hasOwnProperty(a);return n.constructor.createProperty(a,i),r?Object.getOwnPropertyDescriptor(n,a):void 0})(s,t,e)}/**
|
|
63
63
|
* @license
|
|
64
64
|
* Copyright 2017 Google LLC
|
|
65
65
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
66
|
-
*/const
|
|
66
|
+
*/const Ls=globalThis;let ps=class extends cs{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=sr(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return Dt}};var Nn;ps._$litElement$=!0,ps.finalized=!0,(Nn=Ls.litElementHydrateSupport)==null||Nn.call(Ls,{LitElement:ps});const Mn=Ls.litElementPolyfillSupport;Mn==null||Mn({LitElement:ps}),(Ls.litElementVersions??(Ls.litElementVersions=[])).push("4.2.1");const gr={hi:"Hei!"},mr={from:"Fra",to:"Til"},vr={buttonAltText:"Åpne kalender",deleteDate:"Fjern dato"},br={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"},kr={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",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."}},At={example:gr,generic:mr,calendar:vr,dates:br,forms:kr};var yr=Object.defineProperty,An=(s,t,e,i)=>{for(var n=void 0,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=r(t,e,n)||n);return n&&yr(t,e,n),n};let gi=class extends ps{constructor(){super(...arguments),this.strings=At,this.role=null}hotReplacedCallback(){this.requestUpdate()}};An([o({type:Object})],gi.prototype,"strings"),An([o({type:String})],gi.prototype,"role");let R=class extends gi{createRenderRoot(){return this}};/**
|
|
67
67
|
* @license
|
|
68
68
|
* Copyright 2017 Google LLC
|
|
69
69
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
70
|
-
*/const
|
|
70
|
+
*/const ne={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},We=s=>(...t)=>({_$litDirective$:s,values:t});let us=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};/**
|
|
71
71
|
* @license
|
|
72
72
|
* Copyright 2018 Google LLC
|
|
73
73
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
74
|
-
*/const
|
|
74
|
+
*/const E=We(class extends us{constructor(s){var t;if(super(s),s.type!==ne.ATTRIBUTE||s.name!=="class"||((t=s.strings)==null?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(s){return" "+Object.keys(s).filter((t=>s[t])).join(" ")+" "}update(s,[t]){var e,i;if(this.st===void 0){this.st=new Set,s.strings!==void 0&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter((a=>a!==""))));for(const a in t)t[a]&&!((e=this.nt)!=null&&e.has(a))&&this.st.add(a);return this.render(t)}const n=s.element.classList;for(const a of this.st)a in t||(n.remove(a),this.st.delete(a));for(const a in t){const r=!!t[a];r===this.st.has(a)||(i=this.nt)!=null&&i.has(a)||(r?(n.add(a),this.st.add(a)):(n.remove(a),this.st.delete(a)))}return Dt}});/**
|
|
75
75
|
* @license
|
|
76
76
|
* Copyright 2017 Google LLC
|
|
77
77
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
78
|
-
*/function
|
|
78
|
+
*/function D(s){return o({...s,state:!0,attribute:!1})}function On(s,t){return t.some(e=>e.value===s)}function Bs(s){return s.classList&&(s.classList.contains("_dialog_overlay")||s.classList.contains("backdrop"))?!0:typeof s.hasAttribute=="function"&&s.hasAttribute("data-skip")}function fs(s){return s.nodeName==="OPTION"||s.nodeName==="DATA"}function $r(s,t){return s.nodeType===Node.ELEMENT_NODE&&!On(s,t)}function Bi(s){var t;return s.nodeType===Node.TEXT_NODE&&((t=s.nodeValue)==null?void 0:t.trim())!==""}let rt=class{constructor(t,...e){this.nodes=[],this.filledSlots=new Set,this.skipOptions=!1,this.updatingSlots=!1,this.host=t,this.host.addController(this),this.slots=e,this.nodes=[],this.observer=new MutationObserver(i=>this.handleMutations(i)),this.contentObserver=new MutationObserver(i=>this.handleSlotMutations(i))}hostConnected(){this.updateNodes(),this.observer.observe(this.host,{childList:!0}),this.contentObserver.observe(this.host,{childList:!0,subtree:!0})}hostDisconnected(){this.observer.disconnect(),this.contentObserver.disconnect()}hostUpdated(){this.updateSlots()}updateNodes(){this.nodes=[],Array.from(this.host.childNodes).forEach(t=>{Bs(t)||fs(t)&&this.skipOptions||(!On(t,this.slots)||Bi(t))&&this.nodes.push(t)})}updateSlots(){if(this.updatingSlots)return;this.updatingSlots=!0;const t=new Set;this.slots.forEach(e=>{if(!e.value)return;const i=e.value.getAttribute("name");Array.from(e.value.childNodes).some(a=>{var r,h;if(a.nodeType===Node.COMMENT_NODE)return!1;if(a.nodeType===Node.TEXT_NODE)return!!((r=a.textContent)!=null&&r.trim());if(a.nodeType===Node.ELEMENT_NODE){if(Bs(a))return!1;if((h=a.textContent)!=null&&h.trim())return!0}return!1})&&t.add(i);const n=this.nodes.flatMap(a=>Bi(a)||a.getAttribute&&a.getAttribute("slot")==i&&!Bs(a)?a:[]).filter(a=>e.value&&!e.value.contains(a)&&!a.contains(e.value));if(n.length>0)if(typeof e.value.replaceChildren!="function"){for(;e.value.firstChild;)e.value.removeChild(e.value.firstChild);e.value.append(...n)}else e.value.replaceChildren(...n)}),(this.filledSlots.size!==t.size||![...this.filledSlots].every(e=>t.has(e)))&&(this.filledSlots=t,typeof this.host.updateSlots=="function"&&this.host.updateSlots(this.filledSlots)),this.updatingSlots=!1}handleMutations(t){let e=!1;t.forEach(i=>{i.type==="childList"&&(i.addedNodes.forEach(n=>{Bs(n)||fs(n)&&this.skipOptions||($r(n,this.slots)||Bi(n))&&(this.nodes.push(n),e=!0)}),i.removedNodes.forEach(n=>{Bs(n)||fs(n)&&this.skipOptions||(this.nodes=this.nodes.filter(a=>a!==n),e=!0)}))}),e&&this.updateSlots()}handleSlotMutations(t){let e=!1;t.forEach(i=>{const n=i.target.parentElement;if(n!=null&&n.hasAttribute("slot")){const a=n.getAttribute("slot"),r=n.hasChildNodes();r&&!this.filledSlots.has(a)?(this.filledSlots.add(a),e=!0):!r&&this.filledSlots.has(a)&&(this.filledSlots.delete(a),e=!0)}}),e&&typeof this.host.updateSlots=="function"&&this.host.updateSlots(this.filledSlots)}};/**
|
|
79
79
|
* @license
|
|
80
80
|
* Copyright 2020 Google LLC
|
|
81
81
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
82
|
-
*/const{I:
|
|
82
|
+
*/const{I:_r}=er,Pn=s=>s.strings===void 0,Dn=()=>document.createComment(""),Fs=(s,t,e)=>{var i;const n=s._$AA.parentNode,a=t===void 0?s._$AB:t._$AA;if(e===void 0){const r=n.insertBefore(Dn(),a),h=n.insertBefore(Dn(),a);e=new _r(r,h,s,s.options)}else{const r=e._$AB.nextSibling,h=e._$AM,d=h!==s;if(d){let u;(i=e._$AQ)==null||i.call(e,s),e._$AM=s,e._$AP!==void 0&&(u=s._$AU)!==h._$AU&&e._$AP(u)}if(r!==a||d){let u=e._$AA;for(;u!==r;){const g=u.nextSibling;n.insertBefore(u,a),u=g}}}return e},Re=(s,t,e=s)=>(s._$AI(t,e),s),wr={},In=(s,t=wr)=>s._$AH=t,xr=s=>s._$AH,Fi=s=>{s._$AR(),s._$AA.remove()};/**
|
|
83
83
|
* @license
|
|
84
84
|
* Copyright 2017 Google LLC
|
|
85
85
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
86
|
-
*/const
|
|
86
|
+
*/const js=(s,t)=>{var e;const i=s._$AN;if(i===void 0)return!1;for(const n of i)(e=n._$AO)==null||e.call(n,t,!1),js(n,t);return!0},mi=s=>{let t,e;do{if((t=s._$AM)===void 0)break;e=t._$AN,e.delete(s),s=t}while((e==null?void 0:e.size)===0)},Ln=s=>{for(let t;t=s._$AM;s=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(s))break;e.add(s),Tr(t)}};function Sr(s){this._$AN!==void 0?(mi(this),this._$AM=s,Ln(this)):this._$AM=s}function Cr(s,t=!1,e=0){const i=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(t)if(Array.isArray(i))for(let a=e;a<i.length;a++)js(i[a],!1),mi(i[a]);else i!=null&&(js(i,!1),mi(i));else js(this,s)}const Tr=s=>{s.type==ne.CHILD&&(s._$AP??(s._$AP=Cr),s._$AQ??(s._$AQ=Sr))};let Er=class extends us{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),Ln(this),this.isConnected=t._$AU}_$AO(t,e=!0){var i,n;t!==this.isConnected&&(this.isConnected=t,t?(i=this.reconnected)==null||i.call(this):(n=this.disconnected)==null||n.call(this)),e&&(js(this,t),mi(this))}setValue(t){if(Pn(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};/**
|
|
87
87
|
* @license
|
|
88
88
|
* Copyright 2020 Google LLC
|
|
89
89
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
90
|
-
*/const
|
|
90
|
+
*/const N=()=>new Nr;let Nr=class{};const ji=new WeakMap,M=We(class extends Er{render(s){return k}update(s,[t]){var e;const i=t!==this.G;return i&&this.G!==void 0&&this.rt(void 0),(i||this.lt!==this.ct)&&(this.G=t,this.ht=(e=s.options)==null?void 0:e.host,this.rt(this.ct=s.element)),k}rt(s){if(this.isConnected||(s=void 0),typeof this.G=="function"){const t=this.ht??globalThis;let e=ji.get(t);e===void 0&&(e=new WeakMap,ji.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ht,void 0),e.set(this.G,s),s!==void 0&&this.G.call(this.ht,s)}else this.G.value=s}get lt(){var s,t;return typeof this.G=="function"?(s=ji.get(this.ht??globalThis))==null?void 0:s.get(this.G):(t=this.G)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});function Bn(s,t,e){const i=s.getAttribute("class")||"",n=new Set(i.split(/\s+/).filter(Boolean));e?n.add(t):n.delete(t),s.setAttribute("class",Array.from(n).join(" "))}/**
|
|
91
91
|
* @license
|
|
92
92
|
* Copyright 2017 Google LLC
|
|
93
93
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
94
|
-
*/let
|
|
94
|
+
*/let vi=class extends us{constructor(t){if(super(t),this.it=k,t.type!==ne.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===k||t==null)return this._t=void 0,this.it=t;if(t===Dt)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}};vi.directiveName="unsafeHTML",vi.resultType=1;const bi=We(vi);/**
|
|
95
95
|
* @license
|
|
96
96
|
* Copyright 2017 Google LLC
|
|
97
97
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
98
|
-
*/let
|
|
98
|
+
*/let Hi=class extends vi{};Hi.directiveName="unsafeSVG",Hi.resultType=2;const Fn=We(Hi);var Mr=Object.defineProperty,Ar=Object.getOwnPropertyDescriptor,Hs=(s,t,e,i)=>{for(var n=i>1?void 0:i?Ar(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Mr(t,e,n),n};const Vi="https://punkt-cdn.oslo.kommune.no/14.0/icons/";typeof window<"u"&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||Vi);const Or=s=>new Promise(t=>setTimeout(t,s)),ki='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',Ui={},Pr=async(s,t)=>{let e=0;for(;Ui[t+s+".svg"]==="fetching"&&(e++,!(e>50));)await Or(50);const i=typeof Storage<"u"&&typeof localStorage<"u";return i&&localStorage.getItem(t+s+".svg")?Promise.resolve(localStorage.getItem(t+s+".svg")):typeof window<"u"&&typeof window.pktFetch=="function"?(Ui[t+s+".svg"]="fetching",Promise.resolve(window.pktFetch(t+s+".svg").then(n=>n.ok?n.text():(console.error("Missing icon: "+t+s+".svg"),ki)).then(n=>(n!==ki&&i&&localStorage.setItem(t+s+".svg",n),Ui[t+s+".svg"]="fetched",n)))):Promise.resolve(ki)};let Ke=class extends R{constructor(){super(...arguments),this.path=typeof window<"u"?window.pktIconPath:Vi,this.name="",this.icon=Fn(ki),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(t,e,i){super.attributeChangedCallback(t,e,i),(t==="name"||t==="path")&&this.getIcon(this.name)}async updated(t){super.updated(t),(t.has("name")||t.has("path"))&&this.getIcon(this.name)}async getIcon(t=""){this._updatedProps.length>0?(this.path||(this.path=typeof window<"u"?window.pktIconPath:Vi),this.icon=Fn(await Pr(this.name||"",this.path).then(e=>e)),this._updatedProps=[]):this._updatedProps.includes(t)||this._updatedProps.push(t)}render(){return c`${this.name&&this.icon}`}};Hs([o({type:String,reflect:!1})],Ke.prototype,"path",2),Hs([o({type:String,reflect:!0})],Ke.prototype,"name",2),Hs([o({type:SVGElement})],Ke.prototype,"icon",2),Hs([o({type:Array,noAccessor:!0})],Ke.prototype,"_updatedProps",2),Ke=Hs([F("pkt-icon")],Ke);/**
|
|
99
99
|
* @license
|
|
100
100
|
* Copyright 2018 Google LLC
|
|
101
101
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
102
|
-
*/const
|
|
102
|
+
*/const C=s=>s??k;var Dr=Object.defineProperty,Ir=Object.getOwnPropertyDescriptor,bt=(s,t,e,i)=>{for(var n=i>1?void 0:i?Ir(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Dr(t,e,n),n};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/14.0/animations/";let ft=class extends R{constructor(){super(),this.defaultSlot=N(),this.iconName="user",this.secondIconName="user",this.mode="light",this.size="medium",this.fullWidth=!1,this.fullWidthOnMobile=!1,this.skin="primary",this.variant="label-only",this.state="normal",this.type="button",this.form=void 0,this.isLoading=!1,this.disabled=!1,this.loadingAnimationPath=window.pktAnimationPath,this.slotController=new rt(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this.addEventListener("click",t=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(t.preventDefault(),t.stopImmediatePropagation())},!0),this.addEventListener("keydown",t=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),t.stopImmediatePropagation())},!0)}attributeChangedCallback(t,e,i){super.attributeChangedCallback(t,e,i),t==="disabled"&&i==="false"&&(this.disabled=!1),(t==="isloading"||t==="isLoading")&&i==="false"&&(this.isLoading=!1)}firstUpdated(t){super.firstUpdated(t),this.disabled==="false"&&(this.disabled=!1),this.isLoading==="false"&&(this.isLoading=!1)}render(){const t=this.form??this.getAttribute("form")??void 0,e={"pkt-btn":!0,[`pkt-btn--${this.size}`]:!!this.size,[`pkt-btn--${this.skin}`]:!!this.skin,[`pkt-btn--${this.variant}`]:!!this.variant,[`pkt-btn--${this.color}`]:!!this.color,[`pkt-btn--${this.state}`]:!!this.state,"pkt-btn--full":!!this.fullWidth,"pkt-btn--full-small":!!this.fullWidthOnMobile,"pkt-btn--disabled":!!this.disabled,"pkt-btn--isLoading":!!this.isLoading};return c`
|
|
103
103
|
<button
|
|
104
|
-
class=${
|
|
104
|
+
class=${E(e)}
|
|
105
105
|
type=${this.type}
|
|
106
106
|
?disabled=${!!this.disabled}
|
|
107
|
-
aria-busy=${
|
|
108
|
-
aria-disabled=${
|
|
109
|
-
form=${
|
|
107
|
+
aria-busy=${C(this.isLoading?"true":void 0)}
|
|
108
|
+
aria-disabled=${C(this.disabled||this.isLoading?"true":void 0)}
|
|
109
|
+
form=${C(t)}
|
|
110
110
|
>
|
|
111
|
-
${this.isLoading?
|
|
111
|
+
${this.isLoading?c`<pkt-icon
|
|
112
112
|
class="pkt-btn__icon pkt-btn__spinner"
|
|
113
113
|
name="spinner-blue"
|
|
114
|
-
path=${
|
|
115
|
-
></pkt-icon
|
|
116
|
-
${this.variant!=="label-only"?
|
|
114
|
+
path=${C(this.loadingAnimationPath)}
|
|
115
|
+
></pkt-icon>`:k}
|
|
116
|
+
${this.variant!=="label-only"?c`<pkt-icon
|
|
117
117
|
class="pkt-btn__icon pkt-icon"
|
|
118
118
|
name=${this.iconName}
|
|
119
|
-
path=${
|
|
120
|
-
></pkt-icon
|
|
121
|
-
<span class="pkt-btn__text" ${
|
|
122
|
-
${this.variant==="icons-right-and-left"?
|
|
119
|
+
path=${C(this.iconPath)}
|
|
120
|
+
></pkt-icon>`:k}
|
|
121
|
+
<span class="pkt-btn__text" ${M(this.defaultSlot)}></span>
|
|
122
|
+
${this.variant==="icons-right-and-left"?c`<pkt-icon
|
|
123
123
|
class="pkt-btn__icon"
|
|
124
124
|
name=${this.secondIconName}
|
|
125
|
-
path=${
|
|
126
|
-
></pkt-icon
|
|
125
|
+
path=${C(this.secondIconPath)}
|
|
126
|
+
></pkt-icon>`:k}
|
|
127
127
|
</button>
|
|
128
|
-
`}};
|
|
129
|
-
<div class=${
|
|
130
|
-
<div class=${
|
|
128
|
+
`}};bt([o({type:String})],ft.prototype,"iconName",2),bt([o({type:String})],ft.prototype,"secondIconName",2),bt([o({type:String})],ft.prototype,"iconPath",2),bt([o({type:String})],ft.prototype,"secondIconPath",2),bt([o({type:String})],ft.prototype,"mode",2),bt([o({type:String})],ft.prototype,"size",2),bt([o({type:Boolean,attribute:"full-width"})],ft.prototype,"fullWidth",2),bt([o({type:Boolean,attribute:"full-width-on-mobile"})],ft.prototype,"fullWidthOnMobile",2),bt([o({type:String})],ft.prototype,"color",2),bt([o({type:String})],ft.prototype,"skin",2),bt([o({type:String})],ft.prototype,"variant",2),bt([o({type:String,reflect:!0})],ft.prototype,"state",2),bt([o({type:String,reflect:!0})],ft.prototype,"type",2),bt([o({type:String})],ft.prototype,"form",2),bt([o({type:Boolean,reflect:!0})],ft.prototype,"isLoading",2),bt([o({type:Boolean,reflect:!0})],ft.prototype,"disabled",2),bt([o({type:String})],ft.prototype,"loadingAnimationPath",2),ft=bt([F("pkt-button")],ft);const Lr={skin:{default:"info"},ariaLive:{default:"polite"},compact:{default:!1},closeAlert:{default:!1}},yi={props:Lr};var Br=Object.defineProperty,Fr=Object.getOwnPropertyDescriptor,pe=(s,t,e,i)=>{for(var n=i>1?void 0:i?Fr(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Br(t,e,n),n};let ae=class extends R{constructor(){super(),this.defaultSlot=N(),this.compact=yi.props.compact.default,this.title="",this.skin=yi.props.skin.default,this.ariaLive=yi.props.ariaLive.default,this["aria-live"]=null,this.closeAlert=yi.props.closeAlert.default,this.date=null,this.role="status",this._isClosed=!1,this.close=t=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:t},bubbles:!0,composed:!0}))},this.slotController=new rt(this,this.defaultSlot),this._isClosed=!1}connectedCallback(){super.connectedCallback(),this["aria-live"]=this.getAttribute("aria-live")||this.ariaLive}attributeChangedCallback(t,e,i){t==="ariaLive"&&(this["aria-live"]=i),super.attributeChangedCallback(t,e,i)}updated(t){super.updated(t),t.has("ariaLive")&&(this["aria-live"]=this.ariaLive),t.has("_isClosed")&&Bn(this,"pkt-hide",this._isClosed)}render(){const t={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-hide":this._isClosed},e={"pkt-alert__grid":!0,"pkt-alert__noTitle":!this.title,"pkt-alert__noDate":!this.date};return c`
|
|
129
|
+
<div class=${E(t)} aria-live=${this["aria-live"]}>
|
|
130
|
+
<div class=${E(e)}>
|
|
131
131
|
<pkt-icon
|
|
132
132
|
class="pkt-alert__icon"
|
|
133
133
|
aria-hidden="true"
|
|
134
134
|
name=${this.skin==="info"?"alert-information":`alert-${this.skin}`}
|
|
135
135
|
></pkt-icon>
|
|
136
136
|
|
|
137
|
-
${this.closeAlert?
|
|
137
|
+
${this.closeAlert?c`
|
|
138
138
|
<div class="pkt-alert__close">
|
|
139
139
|
<pkt-button
|
|
140
140
|
tabindex="0"
|
|
@@ -149,30 +149,30 @@
|
|
|
149
149
|
<span class="sr-only">Lukk</span>
|
|
150
150
|
</pkt-button>
|
|
151
151
|
</div>
|
|
152
|
-
|
|
153
|
-
${this.title?
|
|
152
|
+
`:k}
|
|
153
|
+
${this.title?c`<div class="pkt-alert__title">${this.title}</div>`:k}
|
|
154
154
|
|
|
155
|
-
<div class="pkt-alert__text" ${
|
|
155
|
+
<div class="pkt-alert__text" ${M(this.defaultSlot)}></div>
|
|
156
156
|
|
|
157
|
-
${this.date?
|
|
157
|
+
${this.date?c`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>`:k}
|
|
158
158
|
</div>
|
|
159
159
|
</div>
|
|
160
|
-
`}};
|
|
160
|
+
`}};pe([o({type:Boolean,reflect:!1})],ae.prototype,"compact",2),pe([o({type:String,reflect:!0})],ae.prototype,"title",2),pe([o({type:String,reflect:!0})],ae.prototype,"skin",2),pe([o({type:String})],ae.prototype,"ariaLive",2),pe([o({type:String,reflect:!0})],ae.prototype,"aria-live",2),pe([o({type:Boolean,reflect:!0})],ae.prototype,"closeAlert",2),pe([o({type:String,reflect:!0})],ae.prototype,"date",2),pe([o({type:String,reflect:!0})],ae.prototype,"role",2),pe([D()],ae.prototype,"_isClosed",2),ae=pe([F("pkt-alert")],ae);var jr=Object.defineProperty,Hr=Object.getOwnPropertyDescriptor,Vs=(s,t,e,i)=>{for(var n=i>1?void 0:i?Hr(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&jr(t,e,n),n};let gs=class extends ps{constructor(){super(...arguments),this.ariaLabelledBy="",this.compact=!1,this.skin="borderless",this.name=""}updated(t){t.has("skin")&&this.requestUpdate(),t.has("name")&&this.updateAccordionItemNames()}updateAccordionItemNames(){var t;if(this.name){const e=(t=this.renderRoot)==null?void 0:t.querySelector("slot");e&&e.assignedElements().forEach(i=>{i.tagName.toLowerCase()==="pkt-accordion-item"&&(i.hasAttribute("name")||i.setAttribute("name",this.name))})}}firstUpdated(){var t;const e=(t=this.renderRoot)==null?void 0:t.querySelector("slot");e&&e.addEventListener("slotchange",()=>{this.updateAccordionItemNames()})}render(){const t={"pkt-accordion":!0,"pkt-accordion--compact":this.compact,[`pkt-accordion--${this.skin}`]:this.skin};return c`
|
|
161
161
|
<div
|
|
162
162
|
part="container"
|
|
163
|
-
class=${
|
|
163
|
+
class=${E(t)}
|
|
164
164
|
data-testid="pkt-accordion"
|
|
165
165
|
aria-labelledby=${this.ariaLabelledBy}
|
|
166
166
|
>
|
|
167
167
|
<slot></slot>
|
|
168
168
|
</div>
|
|
169
|
-
`}};
|
|
169
|
+
`}};Vs([o({type:String,reflect:!0,attribute:"aria-labelledby"})],gs.prototype,"ariaLabelledBy",2),Vs([o({type:Boolean,reflect:!0,attribute:"compact"})],gs.prototype,"compact",2),Vs([o({type:String,reflect:!0,attribute:"skin"})],gs.prototype,"skin",2),Vs([o({type:String,reflect:!0,attribute:"name"})],gs.prototype,"name",2),gs=Vs([F("pkt-accordion")],gs);var Vr=Object.defineProperty,Ur=Object.getOwnPropertyDescriptor,Ye=(s,t,e,i)=>{for(var n=i>1?void 0:i?Ur(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Vr(t,e,n),n};let Ae=class extends R{constructor(){super(),this.defaultOpen=!1,this.title="",this.skin=void 0,this.compact=!1,this.isOpen=!1,this.name=void 0,this.accordionItemRef=N(),this.defaultSlot=N(),this.slotController=new rt(this,this.defaultSlot)}firstUpdated(t){this.defaultOpen&&(this.isOpen=!0)}render(){const t={"pkt-accordion-item":!0,"pkt-accordion-item--compact":this.compact,[`pkt-accordion-item--${this.skin}`]:!!this.skin};return c`
|
|
170
170
|
<details
|
|
171
|
-
class=${
|
|
171
|
+
class=${E(t)}
|
|
172
172
|
id=${this.id}
|
|
173
173
|
?open=${this.isOpen}
|
|
174
|
-
${
|
|
175
|
-
name=${
|
|
174
|
+
${M(this.accordionItemRef)}
|
|
175
|
+
name=${C(this.name)}
|
|
176
176
|
>
|
|
177
177
|
<summary class="pkt-accordion-item__title" id=${`pkt-accordion-item-summary-${this.id}`}>
|
|
178
178
|
${this.title}
|
|
@@ -187,14 +187,14 @@
|
|
|
187
187
|
id="pkt-accordion-item__content-${this.id}"
|
|
188
188
|
role="region"
|
|
189
189
|
>
|
|
190
|
-
<div class="pkt-accordion-item__content-inner" ${
|
|
190
|
+
<div class="pkt-accordion-item__content-inner" ${M(this.defaultSlot)}></div>
|
|
191
191
|
</div>
|
|
192
192
|
</details>
|
|
193
|
-
`}};
|
|
193
|
+
`}};Ye([o({type:Boolean})],Ae.prototype,"defaultOpen",2),Ye([o({type:String})],Ae.prototype,"title",2),Ye([o({type:String,reflect:!0})],Ae.prototype,"skin",2),Ye([o({type:Boolean,reflect:!0})],Ae.prototype,"compact",2),Ye([o({type:Boolean,reflect:!0})],Ae.prototype,"isOpen",2),Ye([o({type:String,reflect:!0})],Ae.prototype,"name",2),Ae=Ye([F("pkt-accordion-item")],Ae);var zr=Object.defineProperty,qr=Object.getOwnPropertyDescriptor,$i=(s,t,e,i)=>{for(var n=i>1?void 0:i?qr(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&zr(t,e,n),n};let ms=class extends R{constructor(){super(...arguments),this.href="",this.text="Forsiden",this.ariaLabel=""}attributeChangedCallback(t,e,i){t==="arialabel"&&this.removeAttribute("arialabel"),t==="href"&&this.removeAttribute("href"),t==="text"&&this.removeAttribute("text"),super.attributeChangedCallback(t,e,i)}render(){return c`<nav
|
|
194
194
|
class="pkt-back-link"
|
|
195
195
|
aria-label=${this.ariaLabel||"Gå tilbake til forrige side"}
|
|
196
196
|
>
|
|
197
|
-
<a href=${
|
|
197
|
+
<a href=${C(this.href||"/")} class="pkt-link pkt-link--icon-left"
|
|
198
198
|
><pkt-icon
|
|
199
199
|
class="pkt-back-link__icon pkt-icon pkt-link__icon"
|
|
200
200
|
name="chevron-thin-left"
|
|
@@ -202,7 +202,7 @@
|
|
|
202
202
|
></pkt-icon
|
|
203
203
|
><span class="pkt-back-link__text">${this.text}</span></a
|
|
204
204
|
>
|
|
205
|
-
</nav>`}};ei([o({type:String})],Xe.prototype,"href",2),ei([o({type:String})],Xe.prototype,"text",2),ei([o({type:String})],Xe.prototype,"ariaLabel",2),Xe=ei([j("pkt-backlink")],Xe);const wa=6048e5,Or=864e5,xa=Symbol.for("constructDateFrom");function Qt(s,t){return typeof s=="function"?s(t):s&&typeof s=="object"&&xa in s?s[xa](t):s instanceof Date?new s.constructor(t):new Date(t)}function Et(s,t){return Qt(t||s,s)}function Si(s,t,e){const i=Et(s,void 0);return isNaN(t)?Qt(s,NaN):(t&&i.setDate(i.getDate()+t),i)}let Dr={};function si(){return Dr}function ws(s,t){var e,i,a,n;const r=si(),h=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??r.weekStartsOn??((n=(a=r.locale)==null?void 0:a.options)==null?void 0:n.weekStartsOn)??0,d=Et(s,t==null?void 0:t.in),p=d.getDay(),f=(p<h?7:0)+p-h;return d.setDate(d.getDate()-f),d.setHours(0,0,0,0),d}function ii(s,t){return ws(s,{...t,weekStartsOn:1})}function Sa(s,t){const e=Et(s,void 0),i=e.getFullYear(),a=Qt(e,0);a.setFullYear(i+1,0,4),a.setHours(0,0,0,0);const n=ii(a),r=Qt(e,0);r.setFullYear(i,0,4),r.setHours(0,0,0,0);const h=ii(r);return e.getTime()>=n.getTime()?i+1:e.getTime()>=h.getTime()?i:i-1}function Ca(s){const t=Et(s),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+s-+e}function Ta(s,...t){const e=Qt.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Na(s,t){const e=Et(s,void 0);return e.setHours(0,0,0,0),e}function Ir(s,t,e){const[i,a]=Ta(void 0,s,t),n=Na(i),r=Na(a),h=+n-Ca(n),d=+r-Ca(r);return Math.round((h-d)/Or)}function Lr(s,t){const e=Sa(s),i=Qt(s,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),ii(i)}function Br(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function Fr(s){return!(!Br(s)&&typeof s!="number"||isNaN(+Et(s)))}function Vr(s,t){const[e,i]=Ta(s,t.start,t.end);return{start:e,end:i}}function Ci(s,t){const{start:e,end:i}=Vr(void 0,s);let a=+e>+i;const n=a?+e:+i,r=a?i:e;r.setHours(0,0,0,0);let h=1;const d=[];for(;+r<=n;)d.push(Qt(e,r)),r.setDate(r.getDate()+h),r.setHours(0,0,0,0);return a?d.reverse():d}function jr(s,t){const e=Et(s,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const Hr={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"}},Ur=(s,t,e)=>{let i;const a=Hr[s];return typeof a=="string"?i=a:t===1?i=a.one:i=a.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Ti(s){return(t={})=>{const e=t.width?String(t.width):s.defaultWidth;return s.formats[e]||s.formats[s.defaultWidth]}}const qr={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},zr={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Wr={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Rr={date:Ti({formats:qr,defaultWidth:"full"}),time:Ti({formats:zr,defaultWidth:"full"}),dateTime:Ti({formats:Wr,defaultWidth:"full"})},Kr={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Gr=(s,t,e,i)=>Kr[s];function xs(s){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let a;if(i==="formatting"&&s.formattingValues){const r=s.defaultFormattingWidth||s.defaultWidth,h=e!=null&&e.width?String(e.width):r;a=s.formattingValues[h]||s.formattingValues[r]}else{const r=s.defaultWidth,h=e!=null&&e.width?String(e.width):s.defaultWidth;a=s.values[h]||s.values[r]}const n=s.argumentCallback?s.argumentCallback(t):t;return a[n]}}const Yr={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Zr={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Xr={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"]},Jr={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"]},Qr={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"}},to={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"}},eo=(s,t)=>{const e=Number(s),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},so={ordinalNumber:eo,era:xs({values:Yr,defaultWidth:"wide"}),quarter:xs({values:Zr,defaultWidth:"wide",argumentCallback:s=>s-1}),month:xs({values:Xr,defaultWidth:"wide"}),day:xs({values:Jr,defaultWidth:"wide"}),dayPeriod:xs({values:Qr,defaultWidth:"wide",formattingValues:to,defaultFormattingWidth:"wide"})};function Ss(s){return(t,e={})=>{const i=e.width,a=i&&s.matchPatterns[i]||s.matchPatterns[s.defaultMatchWidth],n=t.match(a);if(!n)return null;const r=n[0],h=i&&s.parsePatterns[i]||s.parsePatterns[s.defaultParseWidth],d=Array.isArray(h)?ao(h,g=>g.test(r)):io(h,g=>g.test(r));let p;p=s.valueCallback?s.valueCallback(d):d,p=e.valueCallback?e.valueCallback(p):p;const f=t.slice(r.length);return{value:p,rest:f}}}function io(s,t){for(const e in s)if(Object.prototype.hasOwnProperty.call(s,e)&&t(s[e]))return e}function ao(s,t){for(let e=0;e<s.length;e++)if(t(s[e]))return e}function no(s){return(t,e={})=>{const i=t.match(s.matchPattern);if(!i)return null;const a=i[0],n=t.match(s.parsePattern);if(!n)return null;let r=s.valueCallback?s.valueCallback(n[0]):n[0];r=e.valueCallback?e.valueCallback(r):r;const h=t.slice(a.length);return{value:r,rest:h}}}const ro=/^(\d+)(th|st|nd|rd)?/i,oo=/\d+/i,lo={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},ho={any:[/^b/i,/^(a|c)/i]},co={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},po={any:[/1/i,/2/i,/3/i,/4/i]},uo={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},fo={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]},go={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},mo={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]},vo={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},bo={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}},yo={ordinalNumber:no({matchPattern:ro,parsePattern:oo,valueCallback:s=>parseInt(s,10)}),era:Ss({matchPatterns:lo,defaultMatchWidth:"wide",parsePatterns:ho,defaultParseWidth:"any"}),quarter:Ss({matchPatterns:co,defaultMatchWidth:"wide",parsePatterns:po,defaultParseWidth:"any",valueCallback:s=>s+1}),month:Ss({matchPatterns:uo,defaultMatchWidth:"wide",parsePatterns:fo,defaultParseWidth:"any"}),day:Ss({matchPatterns:go,defaultMatchWidth:"wide",parsePatterns:mo,defaultParseWidth:"any"}),dayPeriod:Ss({matchPatterns:vo,defaultMatchWidth:"any",parsePatterns:bo,defaultParseWidth:"any"})},ko={code:"en-US",formatDistance:Ur,formatLong:Rr,formatRelative:Gr,localize:so,match:yo,options:{weekStartsOn:0,firstWeekContainsDate:1}};function $o(s,t){const e=Et(s,void 0);return Ir(e,jr(e))+1}function _o(s,t){const e=Et(s,void 0),i=+ii(e)-+Lr(e);return Math.round(i/wa)+1}function Aa(s,t){var e,i,a,n;const r=Et(s,t==null?void 0:t.in),h=r.getFullYear(),d=si(),p=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??d.firstWeekContainsDate??((n=(a=d.locale)==null?void 0:a.options)==null?void 0:n.firstWeekContainsDate)??1,f=Qt((t==null?void 0:t.in)||s,0);f.setFullYear(h+1,0,p),f.setHours(0,0,0,0);const g=ws(f,t),k=Qt((t==null?void 0:t.in)||s,0);k.setFullYear(h,0,p),k.setHours(0,0,0,0);const b=ws(k,t);return+r>=+g?h+1:+r>=+b?h:h-1}function wo(s,t){var e,i,a,n;const r=si(),h=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??r.firstWeekContainsDate??((n=(a=r.locale)==null?void 0:a.options)==null?void 0:n.firstWeekContainsDate)??1,d=Aa(s,t),p=Qt((t==null?void 0:t.in)||s,0);return p.setFullYear(d,0,h),p.setHours(0,0,0,0),ws(p,t)}function Ea(s,t){const e=Et(s,t==null?void 0:t.in),i=+ws(e,t)-+wo(e,t);return Math.round(i/wa)+1}function R(s,t){const e=s<0?"-":"",i=Math.abs(s).toString().padStart(t,"0");return e+i}const ge={y(s,t){const e=s.getFullYear(),i=e>0?e:1-e;return R(t==="yy"?i%100:i,t.length)},M(s,t){const e=s.getMonth();return t==="M"?String(e+1):R(e+1,2)},d(s,t){return R(s.getDate(),t.length)},a(s,t){const e=s.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(s,t){return R(s.getHours()%12||12,t.length)},H(s,t){return R(s.getHours(),t.length)},m(s,t){return R(s.getMinutes(),t.length)},s(s,t){return R(s.getSeconds(),t.length)},S(s,t){const e=t.length,i=s.getMilliseconds(),a=Math.trunc(i*Math.pow(10,e-3));return R(a,t.length)}},Je={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ma={G:function(s,t,e){const i=s.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(s,t,e){if(t==="yo"){const i=s.getFullYear(),a=i>0?i:1-i;return e.ordinalNumber(a,{unit:"year"})}return ge.y(s,t)},Y:function(s,t,e,i){const a=Aa(s,i),n=a>0?a:1-a;if(t==="YY"){const r=n%100;return R(r,2)}return t==="Yo"?e.ordinalNumber(n,{unit:"year"}):R(n,t.length)},R:function(s,t){const e=Sa(s);return R(e,t.length)},u:function(s,t){const e=s.getFullYear();return R(e,t.length)},Q:function(s,t,e){const i=Math.ceil((s.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return R(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(s,t,e){const i=Math.ceil((s.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return R(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(s,t,e){const i=s.getMonth();switch(t){case"M":case"MM":return ge.M(s,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(s,t,e){const i=s.getMonth();switch(t){case"L":return String(i+1);case"LL":return R(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(s,t,e,i){const a=Ea(s,i);return t==="wo"?e.ordinalNumber(a,{unit:"week"}):R(a,t.length)},I:function(s,t,e){const i=_o(s);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):R(i,t.length)},d:function(s,t,e){return t==="do"?e.ordinalNumber(s.getDate(),{unit:"date"}):ge.d(s,t)},D:function(s,t,e){const i=$o(s);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):R(i,t.length)},E:function(s,t,e){const i=s.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(s,t,e,i){const a=s.getDay(),n=(a-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(n);case"ee":return R(n,2);case"eo":return e.ordinalNumber(n,{unit:"day"});case"eee":return e.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(a,{width:"short",context:"formatting"});case"eeee":default:return e.day(a,{width:"wide",context:"formatting"})}},c:function(s,t,e,i){const a=s.getDay(),n=(a-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(n);case"cc":return R(n,t.length);case"co":return e.ordinalNumber(n,{unit:"day"});case"ccc":return e.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(a,{width:"narrow",context:"standalone"});case"cccccc":return e.day(a,{width:"short",context:"standalone"});case"cccc":default:return e.day(a,{width:"wide",context:"standalone"})}},i:function(s,t,e){const i=s.getDay(),a=i===0?7:i;switch(t){case"i":return String(a);case"ii":return R(a,t.length);case"io":return e.ordinalNumber(a,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(s,t,e){const i=s.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(s,t,e){const i=s.getHours();let a;switch(i===12?a=Je.noon:i===0?a=Je.midnight:a=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(s,t,e){const i=s.getHours();let a;switch(i>=17?a=Je.evening:i>=12?a=Je.afternoon:i>=4?a=Je.morning:a=Je.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(s,t,e){if(t==="ho"){let i=s.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return ge.h(s,t)},H:function(s,t,e){return t==="Ho"?e.ordinalNumber(s.getHours(),{unit:"hour"}):ge.H(s,t)},K:function(s,t,e){const i=s.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):R(i,t.length)},k:function(s,t,e){let i=s.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):R(i,t.length)},m:function(s,t,e){return t==="mo"?e.ordinalNumber(s.getMinutes(),{unit:"minute"}):ge.m(s,t)},s:function(s,t,e){return t==="so"?e.ordinalNumber(s.getSeconds(),{unit:"second"}):ge.s(s,t)},S:function(s,t){return ge.S(s,t)},X:function(s,t,e){const i=s.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Oa(i);case"XXXX":case"XX":return Ee(i);case"XXXXX":case"XXX":default:return Ee(i,":")}},x:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"x":return Oa(i);case"xxxx":case"xx":return Ee(i);case"xxxxx":case"xxx":default:return Ee(i,":")}},O:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Pa(i,":");case"OOOO":default:return"GMT"+Ee(i,":")}},z:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Pa(i,":");case"zzzz":default:return"GMT"+Ee(i,":")}},t:function(s,t,e){const i=Math.trunc(+s/1e3);return R(i,t.length)},T:function(s,t,e){return R(+s,t.length)}};function Pa(s,t=""){const e=s>0?"-":"+",i=Math.abs(s),a=Math.trunc(i/60),n=i%60;return n===0?e+String(a):e+String(a)+t+R(n,2)}function Oa(s,t){return s%60===0?(s>0?"-":"+")+R(Math.abs(s)/60,2):Ee(s,t)}function Ee(s,t=""){const e=s>0?"-":"+",i=Math.abs(s),a=R(Math.trunc(i/60),2),n=R(i%60,2);return e+a+t+n}const Da=(s,t)=>{switch(s){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Ia=(s,t)=>{switch(s){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},xo=(s,t)=>{const e=s.match(/(P+)(p+)?/)||[],i=e[1],a=e[2];if(!a)return Da(s,t);let n;switch(i){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;case"PPPP":default:n=t.dateTime({width:"full"});break}return n.replace("{{date}}",Da(i,t)).replace("{{time}}",Ia(a,t))},So={p:Ia,P:xo},Co=/^D+$/,To=/^Y+$/,No=["D","DD","YY","YYYY"];function Ao(s){return Co.test(s)}function Eo(s){return To.test(s)}function Mo(s,t,e){const i=Po(s,t,e);if(console.warn(i),No.includes(s))throw new RangeError(i)}function Po(s,t,e){const i=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Oo=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Do=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Io=/^'([^]*?)'?$/,Lo=/''/g,Bo=/[a-zA-Z]/;function Fo(s,t,e){var i,a,n,r;const h=si(),d=h.locale??ko,p=h.firstWeekContainsDate??((a=(i=h.locale)==null?void 0:i.options)==null?void 0:a.firstWeekContainsDate)??1,f=h.weekStartsOn??((r=(n=h.locale)==null?void 0:n.options)==null?void 0:r.weekStartsOn)??0,g=Et(s,void 0);if(!Fr(g))throw new RangeError("Invalid time value");let k=t.match(Do).map(y=>{const w=y[0];if(w==="p"||w==="P"){const C=So[w];return C(y,d.formatLong)}return y}).join("").match(Oo).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const w=y[0];if(w==="'")return{isToken:!1,value:Vo(y)};if(Ma[w])return{isToken:!0,value:y};if(w.match(Bo))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:y}});d.localize.preprocessor&&(k=d.localize.preprocessor(g,k));const b={firstWeekContainsDate:p,weekStartsOn:f,locale:d};return k.map(y=>{if(!y.isToken)return y.value;const w=y.value;(Eo(w)||Ao(w))&&Mo(w,t,String(s));const C=Ma[w[0]];return C(g,w,d.localize,b)}).join("")}function Vo(s){const t=s.match(Io);return t?t[1].replace(Lo,"'"):s}function jo(s,t){const e=Et(s,void 0).getDay();return e===0?7:e}function Ho(s,t,e="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:s,timeZoneName:e}).format(t).split(/\s/g).slice(2).join(" ")}const La={},Cs={};function Me(s,t){try{const e=(La[s]||(La[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return e in Cs?Cs[e]:Ba(e,e.split(":"))}catch{if(s in Cs)return Cs[s];const e=s==null?void 0:s.match(Uo);return e?Ba(s,e.slice(1)):NaN}}const Uo=/([+-]\d\d):?(\d\d)?/;function Ba(s,t){const e=+(t[0]||0),i=+(t[1]||0),a=+(t[2]||0)/60;return Cs[s]=e*60+i>0?e*60+i+a:e*60-i-a}let Ts=class Hs extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Me(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),Va(this),Ni(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new Hs(...e,t):new Hs(Date.now(),t)}withTimeZone(t){return new Hs(+this,t)}getTimezoneOffset(){const t=-Me(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Ni(this),+this}[Symbol.for("constructDateFrom")](t){return new Hs(+new Date(t),this.timeZone)}};const Fa=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!Fa.test(s))return;const t=s.replace(Fa,"$1UTC");Ts.prototype[t]&&(s.startsWith("get")?Ts.prototype[s]=function(){return this.internal[t]()}:(Ts.prototype[s]=function(){return Date.prototype[t].apply(this.internal,arguments),qo(this),+this},Ts.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Ni(this),+this}))});function Ni(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-Me(s.timeZone,s)*60))}function qo(s){Date.prototype.setFullYear.call(s,s.internal.getUTCFullYear(),s.internal.getUTCMonth(),s.internal.getUTCDate()),Date.prototype.setHours.call(s,s.internal.getUTCHours(),s.internal.getUTCMinutes(),s.internal.getUTCSeconds(),s.internal.getUTCMilliseconds()),Va(s)}function Va(s){const t=Me(s.timeZone,s),e=t>0?Math.floor(t):Math.ceil(t),i=new Date(+s);i.setUTCHours(i.getUTCHours()-1);const a=-new Date(+s).getTimezoneOffset(),n=-new Date(+i).getTimezoneOffset(),r=a-n,h=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();r&&h&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+r);const d=a-e;d&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+d);const p=new Date(+s);p.setUTCSeconds(0);const f=a>0?p.getSeconds():(p.getSeconds()-60)%60,g=Math.round(-(Me(s.timeZone,s)*60))%60;(g||f)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+g),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+g+f));const k=Me(s.timeZone,s),b=k>0?Math.floor(k):Math.ceil(k),y=-new Date(+s).getTimezoneOffset()-b,w=b!==e,C=y-d;if(w&&C){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+C);const P=Me(s.timeZone,s),T=P>0?Math.floor(P):Math.ceil(P),I=b-T;I&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+I),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+I))}}let Ai=class Us extends Ts{static tz(t,...e){return e.length?new Us(...e,t):new Us(Date.now(),t)}toISOString(){const[t,e,i]=this.tzComponents(),a=`${t}${e}:${i}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,e,i,a]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${i} ${e} ${a}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[e,i,a]=this.tzComponents();return`${t} GMT${e}${i}${a} (${Ho(this.timeZone,this)})`}toLocaleString(t,e){return Date.prototype.toLocaleString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}toLocaleDateString(t,e){return Date.prototype.toLocaleDateString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}toLocaleTimeString(t,e){return Date.prototype.toLocaleTimeString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),e=t>0?"-":"+",i=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),a=String(Math.abs(t)%60).padStart(2,"0");return[e,i,a]}withTimeZone(t){return new Us(+this,t)}[Symbol.for("constructDateFrom")](t){return new Us(+new Date(t),this.timeZone)}};window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const zo=(s=window.pktTz)=>{const t=new Ai(new Date().toISOString(),s);return t.setHours(0,0,0,0),isNaN(t.getTime())?new Date:new Date(t.getFullYear(),t.getMonth(),t.getDate())};function me(s){if(!s||s==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[t,e,i]=s.split("-").map(Number);return new Date(t,e-1,i)}if(/^\d{4}-\d{2}$/.test(s)){const[t,e]=s.split("-").map(Number);return new Date(t,e-1,1)}return/^\d{4}$/.test(s)?new Date(Number(s),0,1):new Date(s)}const nt=s=>{if(!s||isNaN(s.getTime()))return"";const t=s.getFullYear(),e=String(s.getMonth()+1).padStart(2,"0"),i=String(s.getDate()).padStart(2,"0");return`${t}-${e}-${i}`},ve=s=>{if(!s)return null;const t=me(s);return isNaN(t.getTime())?null:t},ja=(s,t)=>{const e=re(s);return isNaN(e.getTime())?"":Fo(e,t)},re=(s="",t)=>{const e=typeof s=="string"?me(s):s;return!e||isNaN(e.getTime())?new Date:e},be=(s,t,e=1)=>{if(typeof s!="number"||typeof t!="number"||typeof e!="number"||isNaN(s)||isNaN(t)||isNaN(e))return new Date;const i=new Date(s,t,e);return isNaN(i.getTime())?new Date:i},Ns=s=>{let t;return typeof s=="number"?t=new Ai(s,window.pktTz):t=new Ai(s,window.pktTz),t.setHours(12,0,0,0),t},Wo=s=>!s||isNaN(s.getTime())?"":new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(s),Ro=(s,t,e)=>{if(!s||isNaN(s.getTime()))return!1;const i=t?re(t):null,a=e?re(e):null;return!(i&&s<i||a&&s>a)},Ko=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=nt(s);return t.includes(e)},Go=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=s.getDay().toString();return t.includes(e)},Ha=(s,t,e,i,a)=>!(!s||isNaN(s.getTime())||!Ro(s,t,e)||i&&Ko(s,i)||a&&Go(s,a)),Yo=(s,t,e,i,a)=>s.filter(n=>{const r=ve(n);return r&&Ha(r,t,e,i,a)}),Ua=s=>s.slice().sort((t,e)=>{const i=ve(t),a=ve(e);return!i||!a?0:i.getTime()-a.getTime()}),Zo=(s,t)=>{const e=ve(s),i=ve(t);return!e||!i?!1:e<=i},As=s=>s?Array.isArray(s)?s.filter(Boolean):String(s).split(",").map(t=>t.trim()).filter(Boolean):[],Xo=s=>s.join(","),qa=s=>As(s),Jo=s=>s?me(s):null,Qo=s=>{if(typeof s=="string")return s.split(",").map(t=>me(t));if(Array.isArray(s))return s.map(t=>me(t))},Qe={csvToArray:qa,stringToDate:Jo,stringsToDate:Qo},tl={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},Pe={props:tl};var el=Object.defineProperty,sl=Object.getOwnPropertyDescriptor,G=(s,t,e,i)=>{for(var a=i>1?void 0:i?sl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&el(t,e,a),a};let K=class extends Y{constructor(){super(...arguments),this.multiple=Pe.props.multiple.default,this.maxMultiple=Pe.props.maxMultiple.default,this.range=Pe.props.range.default,this.weeknumbers=Pe.props.weeknumbers.default,this.withcontrols=Pe.props.withcontrols.default,this.selected=[],this.earliest=Pe.props.earliest.default,this.latest=Pe.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.year=0,this.month=0,this.week=0,this.rangeHovered=null,this.inRange={},this.focusedDate=null,this.selectableDates=[],this.currentmonthtouched=!1,this.tabIndexSet=0}connectedCallback(){super.connectedCallback()}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}attributeChangedCallback(t,e,i){t==="selected"&&i&&this.convertSelected(),super.attributeChangedCallback(t,e,i)}updated(t){super.updated(t),t.has("selected")&&this.convertSelected()}firstUpdated(t){this.addEventListener("keydown",this.handleKeydown)}convertSelected(){if(typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=this.selected.map(t=>me(t)),this.range&&this.selected.length===2){const t=Ci({start:this._selected[0],end:this._selected[1]});if(this.inRange={},Array.isArray(t)&&t.length){const e={};for(let i=0;i<t.length;i++){const a=t[i],n=a>this._selected[0]&&a<this._selected[1];e[nt(a)]=n}this.inRange=e}}this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==""){const t=me(this.selected[this.selected.length-1]);this.currentmonth=isNaN(t.getTime())?Ns(new Date):t}else this.currentmonth===null&&(this.currentmonth=Ns(new Date));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=Ns(new Date)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(t){switch(t.key){case"ArrowLeft":this.handleArrowKey(t,-1);break;case"ArrowRight":this.handleArrowKey(t,1);break;case"ArrowUp":this.handleArrowKey(t,-7);break;case"ArrowDown":this.handleArrowKey(t,7);break}}handleArrowKey(t,e){var i,a,n,r,h;if(((i=t.target)==null?void 0:i.nodeName)==="INPUT"||((a=t.target)==null?void 0:a.nodeName)==="SELECT"||((n=t.target)==null?void 0:n.nodeName)==="BUTTON"&&!((h=(r=t.target)==null?void 0:r.dataset)!=null&&h.date))return;t.preventDefault(),this.focusedDate||this.focusOnCurrentDate();const d=this.focusedDate?re(this.focusedDate):be(this.year,this.month,1);let p=Si(d,e);if(p){let f=this.querySelector(`button[data-date="${nt(p)}"]`);if(f instanceof HTMLButtonElement){if(f.dataset.disabled){p=Si(p,e);let g=this.querySelector(`button[data-date="${nt(p)}"]`);for(;g&&g instanceof HTMLButtonElement&&g.dataset.disabled;)p=Si(p,e),g=this.querySelector(`button[data-date="${nt(p)}"]`);f=g}f instanceof HTMLButtonElement&&!f.dataset.disabled&&(this.focusedDate=nt(p),f.focus())}}}render(){return u`
|
|
205
|
+
</nav>`}};$i([o({type:String})],ms.prototype,"href",2),$i([o({type:String})],ms.prototype,"text",2),$i([o({type:String})],ms.prototype,"ariaLabel",2),ms=$i([F("pkt-backlink")],ms);const jn=6048e5,Wr=864e5,Hn=Symbol.for("constructDateFrom");function ue(s,t){return typeof s=="function"?s(t):s&&typeof s=="object"&&Hn in s?s[Hn](t):s instanceof Date?new s.constructor(t):new Date(t)}function Ht(s,t){return ue(t||s,s)}function zi(s,t,e){const i=Ht(s,void 0);return isNaN(t)?ue(s,NaN):(t&&i.setDate(i.getDate()+t),i)}let Rr={};function _i(){return Rr}function Us(s,t){var e,i,n,a;const r=_i(),h=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??r.weekStartsOn??((a=(n=r.locale)==null?void 0:n.options)==null?void 0:a.weekStartsOn)??0,d=Ht(s,t==null?void 0:t.in),u=d.getDay(),g=(u<h?7:0)+u-h;return d.setDate(d.getDate()-g),d.setHours(0,0,0,0),d}function wi(s,t){return Us(s,{...t,weekStartsOn:1})}function Vn(s,t){const e=Ht(s,void 0),i=e.getFullYear(),n=ue(e,0);n.setFullYear(i+1,0,4),n.setHours(0,0,0,0);const a=wi(n),r=ue(e,0);r.setFullYear(i,0,4),r.setHours(0,0,0,0);const h=wi(r);return e.getTime()>=a.getTime()?i+1:e.getTime()>=h.getTime()?i:i-1}function Un(s){const t=Ht(s),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+s-+e}function zn(s,...t){const e=ue.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function qn(s,t){const e=Ht(s,void 0);return e.setHours(0,0,0,0),e}function Kr(s,t,e){const[i,n]=zn(void 0,s,t),a=qn(i),r=qn(n),h=+a-Un(a),d=+r-Un(r);return Math.round((h-d)/Wr)}function Yr(s,t){const e=Vn(s),i=ue(s,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),wi(i)}function Gr(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function Zr(s){return!(!Gr(s)&&typeof s!="number"||isNaN(+Ht(s)))}function Xr(s,t){const[e,i]=zn(s,t.start,t.end);return{start:e,end:i}}function qi(s,t){const{start:e,end:i}=Xr(void 0,s);let n=+e>+i;const a=n?+e:+i,r=n?i:e;r.setHours(0,0,0,0);let h=1;const d=[];for(;+r<=a;)d.push(ue(e,r)),r.setDate(r.getDate()+h),r.setHours(0,0,0,0);return n?d.reverse():d}function Jr(s,t){const e=Ht(s,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const Qr={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"}},to=(s,t,e)=>{let i;const n=Qr[s];return typeof n=="string"?i=n:t===1?i=n.one:i=n.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Wi(s){return(t={})=>{const e=t.width?String(t.width):s.defaultWidth;return s.formats[e]||s.formats[s.defaultWidth]}}const eo={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},so={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},io={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},no={date:Wi({formats:eo,defaultWidth:"full"}),time:Wi({formats:so,defaultWidth:"full"}),dateTime:Wi({formats:io,defaultWidth:"full"})},ao={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ro=(s,t,e,i)=>ao[s];function zs(s){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let n;if(i==="formatting"&&s.formattingValues){const r=s.defaultFormattingWidth||s.defaultWidth,h=e!=null&&e.width?String(e.width):r;n=s.formattingValues[h]||s.formattingValues[r]}else{const r=s.defaultWidth,h=e!=null&&e.width?String(e.width):s.defaultWidth;n=s.values[h]||s.values[r]}const a=s.argumentCallback?s.argumentCallback(t):t;return n[a]}}const oo={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},lo={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ho={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"]},co={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"]},po={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"}},uo={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"}},fo=(s,t)=>{const e=Number(s),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},go={ordinalNumber:fo,era:zs({values:oo,defaultWidth:"wide"}),quarter:zs({values:lo,defaultWidth:"wide",argumentCallback:s=>s-1}),month:zs({values:ho,defaultWidth:"wide"}),day:zs({values:co,defaultWidth:"wide"}),dayPeriod:zs({values:po,defaultWidth:"wide",formattingValues:uo,defaultFormattingWidth:"wide"})};function qs(s){return(t,e={})=>{const i=e.width,n=i&&s.matchPatterns[i]||s.matchPatterns[s.defaultMatchWidth],a=t.match(n);if(!a)return null;const r=a[0],h=i&&s.parsePatterns[i]||s.parsePatterns[s.defaultParseWidth],d=Array.isArray(h)?vo(h,m=>m.test(r)):mo(h,m=>m.test(r));let u;u=s.valueCallback?s.valueCallback(d):d,u=e.valueCallback?e.valueCallback(u):u;const g=t.slice(r.length);return{value:u,rest:g}}}function mo(s,t){for(const e in s)if(Object.prototype.hasOwnProperty.call(s,e)&&t(s[e]))return e}function vo(s,t){for(let e=0;e<s.length;e++)if(t(s[e]))return e}function bo(s){return(t,e={})=>{const i=t.match(s.matchPattern);if(!i)return null;const n=i[0],a=t.match(s.parsePattern);if(!a)return null;let r=s.valueCallback?s.valueCallback(a[0]):a[0];r=e.valueCallback?e.valueCallback(r):r;const h=t.slice(n.length);return{value:r,rest:h}}}const ko=/^(\d+)(th|st|nd|rd)?/i,yo=/\d+/i,$o={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},_o={any:[/^b/i,/^(a|c)/i]},wo={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xo={any:[/1/i,/2/i,/3/i,/4/i]},So={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},Co={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]},To={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},Eo={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]},No={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},Mo={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}},Ao={ordinalNumber:bo({matchPattern:ko,parsePattern:yo,valueCallback:s=>parseInt(s,10)}),era:qs({matchPatterns:$o,defaultMatchWidth:"wide",parsePatterns:_o,defaultParseWidth:"any"}),quarter:qs({matchPatterns:wo,defaultMatchWidth:"wide",parsePatterns:xo,defaultParseWidth:"any",valueCallback:s=>s+1}),month:qs({matchPatterns:So,defaultMatchWidth:"wide",parsePatterns:Co,defaultParseWidth:"any"}),day:qs({matchPatterns:To,defaultMatchWidth:"wide",parsePatterns:Eo,defaultParseWidth:"any"}),dayPeriod:qs({matchPatterns:No,defaultMatchWidth:"any",parsePatterns:Mo,defaultParseWidth:"any"})},Oo={code:"en-US",formatDistance:to,formatLong:no,formatRelative:ro,localize:go,match:Ao,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Po(s,t){const e=Ht(s,void 0);return Kr(e,Jr(e))+1}function Do(s,t){const e=Ht(s,void 0),i=+wi(e)-+Yr(e);return Math.round(i/jn)+1}function Wn(s,t){var e,i,n,a;const r=Ht(s,t==null?void 0:t.in),h=r.getFullYear(),d=_i(),u=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??d.firstWeekContainsDate??((a=(n=d.locale)==null?void 0:n.options)==null?void 0:a.firstWeekContainsDate)??1,g=ue((t==null?void 0:t.in)||s,0);g.setFullYear(h+1,0,u),g.setHours(0,0,0,0);const m=Us(g,t),$=ue((t==null?void 0:t.in)||s,0);$.setFullYear(h,0,u),$.setHours(0,0,0,0);const b=Us($,t);return+r>=+m?h+1:+r>=+b?h:h-1}function Io(s,t){var e,i,n,a;const r=_i(),h=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??r.firstWeekContainsDate??((a=(n=r.locale)==null?void 0:n.options)==null?void 0:a.firstWeekContainsDate)??1,d=Wn(s,t),u=ue((t==null?void 0:t.in)||s,0);return u.setFullYear(d,0,h),u.setHours(0,0,0,0),Us(u,t)}function Rn(s,t){const e=Ht(s,t==null?void 0:t.in),i=+Us(e,t)-+Io(e,t);return Math.round(i/jn)+1}function Y(s,t){const e=s<0?"-":"",i=Math.abs(s).toString().padStart(t,"0");return e+i}const Oe={y(s,t){const e=s.getFullYear(),i=e>0?e:1-e;return Y(t==="yy"?i%100:i,t.length)},M(s,t){const e=s.getMonth();return t==="M"?String(e+1):Y(e+1,2)},d(s,t){return Y(s.getDate(),t.length)},a(s,t){const e=s.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(s,t){return Y(s.getHours()%12||12,t.length)},H(s,t){return Y(s.getHours(),t.length)},m(s,t){return Y(s.getMinutes(),t.length)},s(s,t){return Y(s.getSeconds(),t.length)},S(s,t){const e=t.length,i=s.getMilliseconds(),n=Math.trunc(i*Math.pow(10,e-3));return Y(n,t.length)}},vs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Kn={G:function(s,t,e){const i=s.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(s,t,e){if(t==="yo"){const i=s.getFullYear(),n=i>0?i:1-i;return e.ordinalNumber(n,{unit:"year"})}return Oe.y(s,t)},Y:function(s,t,e,i){const n=Wn(s,i),a=n>0?n:1-n;if(t==="YY"){const r=a%100;return Y(r,2)}return t==="Yo"?e.ordinalNumber(a,{unit:"year"}):Y(a,t.length)},R:function(s,t){const e=Vn(s);return Y(e,t.length)},u:function(s,t){const e=s.getFullYear();return Y(e,t.length)},Q:function(s,t,e){const i=Math.ceil((s.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Y(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(s,t,e){const i=Math.ceil((s.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Y(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(s,t,e){const i=s.getMonth();switch(t){case"M":case"MM":return Oe.M(s,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(s,t,e){const i=s.getMonth();switch(t){case"L":return String(i+1);case"LL":return Y(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(s,t,e,i){const n=Rn(s,i);return t==="wo"?e.ordinalNumber(n,{unit:"week"}):Y(n,t.length)},I:function(s,t,e){const i=Do(s);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Y(i,t.length)},d:function(s,t,e){return t==="do"?e.ordinalNumber(s.getDate(),{unit:"date"}):Oe.d(s,t)},D:function(s,t,e){const i=Po(s);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Y(i,t.length)},E:function(s,t,e){const i=s.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(s,t,e,i){const n=s.getDay(),a=(n-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return Y(a,2);case"eo":return e.ordinalNumber(a,{unit:"day"});case"eee":return e.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(n,{width:"short",context:"formatting"});case"eeee":default:return e.day(n,{width:"wide",context:"formatting"})}},c:function(s,t,e,i){const n=s.getDay(),a=(n-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return Y(a,t.length);case"co":return e.ordinalNumber(a,{unit:"day"});case"ccc":return e.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(n,{width:"narrow",context:"standalone"});case"cccccc":return e.day(n,{width:"short",context:"standalone"});case"cccc":default:return e.day(n,{width:"wide",context:"standalone"})}},i:function(s,t,e){const i=s.getDay(),n=i===0?7:i;switch(t){case"i":return String(n);case"ii":return Y(n,t.length);case"io":return e.ordinalNumber(n,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(s,t,e){const i=s.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(s,t,e){const i=s.getHours();let n;switch(i===12?n=vs.noon:i===0?n=vs.midnight:n=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(s,t,e){const i=s.getHours();let n;switch(i>=17?n=vs.evening:i>=12?n=vs.afternoon:i>=4?n=vs.morning:n=vs.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(s,t,e){if(t==="ho"){let i=s.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Oe.h(s,t)},H:function(s,t,e){return t==="Ho"?e.ordinalNumber(s.getHours(),{unit:"hour"}):Oe.H(s,t)},K:function(s,t,e){const i=s.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Y(i,t.length)},k:function(s,t,e){let i=s.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Y(i,t.length)},m:function(s,t,e){return t==="mo"?e.ordinalNumber(s.getMinutes(),{unit:"minute"}):Oe.m(s,t)},s:function(s,t,e){return t==="so"?e.ordinalNumber(s.getSeconds(),{unit:"second"}):Oe.s(s,t)},S:function(s,t){return Oe.S(s,t)},X:function(s,t,e){const i=s.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Gn(i);case"XXXX":case"XX":return Ge(i);case"XXXXX":case"XXX":default:return Ge(i,":")}},x:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"x":return Gn(i);case"xxxx":case"xx":return Ge(i);case"xxxxx":case"xxx":default:return Ge(i,":")}},O:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Yn(i,":");case"OOOO":default:return"GMT"+Ge(i,":")}},z:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Yn(i,":");case"zzzz":default:return"GMT"+Ge(i,":")}},t:function(s,t,e){const i=Math.trunc(+s/1e3);return Y(i,t.length)},T:function(s,t,e){return Y(+s,t.length)}};function Yn(s,t=""){const e=s>0?"-":"+",i=Math.abs(s),n=Math.trunc(i/60),a=i%60;return a===0?e+String(n):e+String(n)+t+Y(a,2)}function Gn(s,t){return s%60===0?(s>0?"-":"+")+Y(Math.abs(s)/60,2):Ge(s,t)}function Ge(s,t=""){const e=s>0?"-":"+",i=Math.abs(s),n=Y(Math.trunc(i/60),2),a=Y(i%60,2);return e+n+t+a}const Zn=(s,t)=>{switch(s){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Xn=(s,t)=>{switch(s){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Lo=(s,t)=>{const e=s.match(/(P+)(p+)?/)||[],i=e[1],n=e[2];if(!n)return Zn(s,t);let a;switch(i){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",Zn(i,t)).replace("{{time}}",Xn(n,t))},Bo={p:Xn,P:Lo},Fo=/^D+$/,jo=/^Y+$/,Ho=["D","DD","YY","YYYY"];function Vo(s){return Fo.test(s)}function Uo(s){return jo.test(s)}function zo(s,t,e){const i=qo(s,t,e);if(console.warn(i),Ho.includes(s))throw new RangeError(i)}function qo(s,t,e){const i=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Wo=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ro=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ko=/^'([^]*?)'?$/,Yo=/''/g,Go=/[a-zA-Z]/;function Zo(s,t,e){var i,n,a,r;const h=_i(),d=h.locale??Oo,u=h.firstWeekContainsDate??((n=(i=h.locale)==null?void 0:i.options)==null?void 0:n.firstWeekContainsDate)??1,g=h.weekStartsOn??((r=(a=h.locale)==null?void 0:a.options)==null?void 0:r.weekStartsOn)??0,m=Ht(s,void 0);if(!Zr(m))throw new RangeError("Invalid time value");let $=t.match(Ro).map(y=>{const x=y[0];if(x==="p"||x==="P"){const T=Bo[x];return T(y,d.formatLong)}return y}).join("").match(Wo).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const x=y[0];if(x==="'")return{isToken:!1,value:Xo(y)};if(Kn[x])return{isToken:!0,value:y};if(x.match(Go))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:y}});d.localize.preprocessor&&($=d.localize.preprocessor(m,$));const b={firstWeekContainsDate:u,weekStartsOn:g,locale:d};return $.map(y=>{if(!y.isToken)return y.value;const x=y.value;(Uo(x)||Vo(x))&&zo(x,t,String(s));const T=Kn[x[0]];return T(m,x,d.localize,b)}).join("")}function Xo(s){const t=s.match(Ko);return t?t[1].replace(Yo,"'"):s}function Jo(s,t){const e=Ht(s,void 0).getDay();return e===0?7:e}function Qo(s,t,e="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:s,timeZoneName:e}).format(t).split(/\s/g).slice(2).join(" ")}const Jn={},Ws={};function Ze(s,t){try{const e=(Jn[s]||(Jn[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return e in Ws?Ws[e]:Qn(e,e.split(":"))}catch{if(s in Ws)return Ws[s];const e=s==null?void 0:s.match(tl);return e?Qn(s,e.slice(1)):NaN}}const tl=/([+-]\d\d):?(\d\d)?/;function Qn(s,t){const e=+(t[0]||0),i=+(t[1]||0),n=+(t[2]||0)/60;return Ws[s]=e*60+i>0?e*60+i+n:e*60-i-n}let Rs=class oi extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Ze(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),ea(this),Ri(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new oi(...e,t):new oi(Date.now(),t)}withTimeZone(t){return new oi(+this,t)}getTimezoneOffset(){const t=-Ze(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Ri(this),+this}[Symbol.for("constructDateFrom")](t){return new oi(+new Date(t),this.timeZone)}};const ta=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!ta.test(s))return;const t=s.replace(ta,"$1UTC");Rs.prototype[t]&&(s.startsWith("get")?Rs.prototype[s]=function(){return this.internal[t]()}:(Rs.prototype[s]=function(){return Date.prototype[t].apply(this.internal,arguments),el(this),+this},Rs.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Ri(this),+this}))});function Ri(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-Ze(s.timeZone,s)*60))}function el(s){Date.prototype.setFullYear.call(s,s.internal.getUTCFullYear(),s.internal.getUTCMonth(),s.internal.getUTCDate()),Date.prototype.setHours.call(s,s.internal.getUTCHours(),s.internal.getUTCMinutes(),s.internal.getUTCSeconds(),s.internal.getUTCMilliseconds()),ea(s)}function ea(s){const t=Ze(s.timeZone,s),e=t>0?Math.floor(t):Math.ceil(t),i=new Date(+s);i.setUTCHours(i.getUTCHours()-1);const n=-new Date(+s).getTimezoneOffset(),a=-new Date(+i).getTimezoneOffset(),r=n-a,h=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();r&&h&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+r);const d=n-e;d&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+d);const u=new Date(+s);u.setUTCSeconds(0);const g=n>0?u.getSeconds():(u.getSeconds()-60)%60,m=Math.round(-(Ze(s.timeZone,s)*60))%60;(m||g)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+m),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+m+g));const $=Ze(s.timeZone,s),b=$>0?Math.floor($):Math.ceil($),y=-new Date(+s).getTimezoneOffset()-b,x=b!==e,T=y-d;if(x&&T){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+T);const S=Ze(s.timeZone,s),A=S>0?Math.floor(S):Math.ceil(S),I=b-A;I&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+I),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+I))}}let Ki=class li extends Rs{static tz(t,...e){return e.length?new li(...e,t):new li(Date.now(),t)}toISOString(){const[t,e,i]=this.tzComponents(),n=`${t}${e}:${i}`;return this.internal.toISOString().slice(0,-1)+n}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,e,i,n]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${i} ${e} ${n}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[e,i,n]=this.tzComponents();return`${t} GMT${e}${i}${n} (${Qo(this.timeZone,this)})`}toLocaleString(t,e){return Date.prototype.toLocaleString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}toLocaleDateString(t,e){return Date.prototype.toLocaleDateString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}toLocaleTimeString(t,e){return Date.prototype.toLocaleTimeString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),e=t>0?"-":"+",i=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),n=String(Math.abs(t)%60).padStart(2,"0");return[e,i,n]}withTimeZone(t){return new li(+this,t)}[Symbol.for("constructDateFrom")](t){return new li(+new Date(t),this.timeZone)}};window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const sl=(s=window.pktTz)=>{const t=new Ki(new Date().toISOString(),s);return t.setHours(0,0,0,0),isNaN(t.getTime())?new Date:new Date(t.getFullYear(),t.getMonth(),t.getDate())};function Pe(s){if(!s||s==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[t,e,i]=s.split("-").map(Number);return new Date(t,e-1,i)}if(/^\d{4}-\d{2}$/.test(s)){const[t,e]=s.split("-").map(Number);return new Date(t,e-1,1)}return/^\d{4}$/.test(s)?new Date(Number(s),0,1):new Date(s)}const ut=s=>{if(!s||isNaN(s.getTime()))return"";const t=s.getFullYear(),e=String(s.getMonth()+1).padStart(2,"0"),i=String(s.getDate()).padStart(2,"0");return`${t}-${e}-${i}`},De=s=>{if(!s)return null;const t=Pe(s);return isNaN(t.getTime())?null:t},sa=(s,t)=>{const e=$e(s);return isNaN(e.getTime())?"":Zo(e,t)},$e=(s="",t)=>{const e=typeof s=="string"?Pe(s):s;return!e||isNaN(e.getTime())?new Date:e},Ie=(s,t,e=1)=>{if(typeof s!="number"||typeof t!="number"||typeof e!="number"||isNaN(s)||isNaN(t)||isNaN(e))return new Date;const i=new Date(s,t,e);return isNaN(i.getTime())?new Date:i},Ks=s=>{let t;return typeof s=="number"?t=new Ki(s,window.pktTz):t=new Ki(s,window.pktTz),t.setHours(12,0,0,0),t},il=s=>!s||isNaN(s.getTime())?"":new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(s),nl=(s,t,e)=>{if(!s||isNaN(s.getTime()))return!1;const i=t?$e(t):null,n=e?$e(e):null;return!(i&&s<i||n&&s>n)},al=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=ut(s);return t.includes(e)},rl=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=s.getDay().toString();return t.includes(e)},ia=(s,t,e,i,n)=>!(!s||isNaN(s.getTime())||!nl(s,t,e)||i&&al(s,i)||n&&rl(s,n)),ol=(s,t,e,i,n)=>s.filter(a=>{const r=De(a);return r&&ia(r,t,e,i,n)}),na=s=>s.slice().sort((t,e)=>{const i=De(t),n=De(e);return!i||!n?0:i.getTime()-n.getTime()}),ll=(s,t)=>{const e=De(s),i=De(t);return!e||!i?!1:e<=i},Ys=s=>s?Array.isArray(s)?s.filter(Boolean):String(s).split(",").map(t=>t.trim()).filter(Boolean):[],hl=s=>s.join(","),aa=s=>Ys(s),dl=s=>s?Pe(s):null,cl=s=>{if(typeof s=="string")return s.split(",").map(t=>Pe(t));if(Array.isArray(s))return s.map(t=>Pe(t))},bs={csvToArray:aa,stringToDate:dl,stringsToDate:cl},pl={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},Xe={props:pl};var ul=Object.defineProperty,fl=Object.getOwnPropertyDescriptor,J=(s,t,e,i)=>{for(var n=i>1?void 0:i?fl(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&ul(t,e,n),n};let G=class extends R{constructor(){super(...arguments),this.multiple=Xe.props.multiple.default,this.maxMultiple=Xe.props.maxMultiple.default,this.range=Xe.props.range.default,this.weeknumbers=Xe.props.weeknumbers.default,this.withcontrols=Xe.props.withcontrols.default,this.selected=[],this.earliest=Xe.props.earliest.default,this.latest=Xe.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.year=0,this.month=0,this.week=0,this.rangeHovered=null,this.inRange={},this.focusedDate=null,this.selectableDates=[],this.currentmonthtouched=!1,this.tabIndexSet=0}connectedCallback(){super.connectedCallback()}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}attributeChangedCallback(t,e,i){t==="selected"&&i&&this.convertSelected(),super.attributeChangedCallback(t,e,i)}updated(t){super.updated(t),t.has("selected")&&this.convertSelected()}firstUpdated(t){this.addEventListener("keydown",this.handleKeydown)}convertSelected(){if(typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=this.selected.map(t=>Pe(t)),this.range&&this.selected.length===2){const t=qi({start:this._selected[0],end:this._selected[1]});if(this.inRange={},Array.isArray(t)&&t.length){const e={};for(let i=0;i<t.length;i++){const n=t[i],a=n>this._selected[0]&&n<this._selected[1];e[ut(n)]=a}this.inRange=e}}this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==""){const t=Pe(this.selected[this.selected.length-1]);this.currentmonth=isNaN(t.getTime())?Ks(new Date):t}else this.currentmonth===null&&(this.currentmonth=Ks(new Date));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=Ks(new Date)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(t){switch(t.key){case"ArrowLeft":this.handleArrowKey(t,-1);break;case"ArrowRight":this.handleArrowKey(t,1);break;case"ArrowUp":this.handleArrowKey(t,-7);break;case"ArrowDown":this.handleArrowKey(t,7);break}}handleArrowKey(t,e){var i,n,a,r,h;if(((i=t.target)==null?void 0:i.nodeName)==="INPUT"||((n=t.target)==null?void 0:n.nodeName)==="SELECT"||((a=t.target)==null?void 0:a.nodeName)==="BUTTON"&&!((h=(r=t.target)==null?void 0:r.dataset)!=null&&h.date))return;t.preventDefault(),this.focusedDate||this.focusOnCurrentDate();const d=this.focusedDate?$e(this.focusedDate):Ie(this.year,this.month,1);let u=zi(d,e);if(u){let g=this.querySelector(`button[data-date="${ut(u)}"]`);if(g instanceof HTMLButtonElement){if(g.dataset.disabled){u=zi(u,e);let m=this.querySelector(`button[data-date="${ut(u)}"]`);for(;m&&m instanceof HTMLButtonElement&&m.dataset.disabled;)u=zi(u,e),m=this.querySelector(`button[data-date="${ut(u)}"]`);g=m}g instanceof HTMLButtonElement&&!g.dataset.disabled&&(this.focusedDate=ut(u),g.focus())}}}render(){return c`
|
|
206
206
|
<div
|
|
207
207
|
class="pkt-calendar ${this.weeknumbers?"pkt-cal-weeknumbers":""}"
|
|
208
208
|
@focusout=${this.closeEvent}
|
|
@@ -216,7 +216,7 @@
|
|
|
216
216
|
@click=${()=>this.isPrevMonthAllowed()&&this.prevMonth()}
|
|
217
217
|
@keydown=${t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.isPrevMonthAllowed()&&this.prevMonth())}}
|
|
218
218
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only pkt-calendar__prev-month ${this.isPrevMonthAllowed()?"":"pkt-hide"}"
|
|
219
|
-
.data-disabled=${this.isPrevMonthAllowed()
|
|
219
|
+
.data-disabled=${this.isPrevMonthAllowed()?k:"disabled"}
|
|
220
220
|
?aria-disabled=${!this.isPrevMonthAllowed()}
|
|
221
221
|
tabindex=${this.isPrevMonthAllowed()?"0":"-1"}
|
|
222
222
|
>
|
|
@@ -232,7 +232,7 @@
|
|
|
232
232
|
@click=${()=>this.isNextMonthAllowed()&&this.nextMonth()}
|
|
233
233
|
@keydown=${t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.isNextMonthAllowed()&&this.nextMonth())}}
|
|
234
234
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only pkt-calendar__next-month ${this.isNextMonthAllowed()?"":"pkt-hide"}"
|
|
235
|
-
.data-disabled=${this.isNextMonthAllowed()
|
|
235
|
+
.data-disabled=${this.isNextMonthAllowed()?k:"disabled"}
|
|
236
236
|
?aria-disabled=${!this.isNextMonthAllowed()}
|
|
237
237
|
tabindex=${this.isNextMonthAllowed()?"0":"-1"}
|
|
238
238
|
>
|
|
@@ -254,13 +254,13 @@
|
|
|
254
254
|
</tbody>
|
|
255
255
|
</table>
|
|
256
256
|
</div>
|
|
257
|
-
`}renderDayNames(){const t=[];this.weeknumbers&&t.push(
|
|
257
|
+
`}renderDayNames(){const t=[];this.weeknumbers&&t.push(c`<th><div class="pkt-calendar__week-number">${this.weekString}</div></th>`);for(let e=0;e<this.dayStrings.length;e++)t.push(c`<th>
|
|
258
258
|
<div class="pkt-calendar__day-name" aria-label="${this.dayStringsLong[e]}">
|
|
259
259
|
${this.dayStrings[e]}
|
|
260
260
|
</div>
|
|
261
|
-
</th>`);return
|
|
261
|
+
</th>`);return c`<tr class="pkt-cal-week-row">
|
|
262
262
|
${t}
|
|
263
|
-
</tr>`}renderMonthNav(){let t=[];return this.withcontrols?t.push(
|
|
263
|
+
</tr>`}renderMonthNav(){let t=[];return this.withcontrols?t.push(c`<div class="pkt-cal-month-picker">
|
|
264
264
|
<label for="${this.id}-monthnav" class="pkt-hide">${this.strings.dates.month}</label>
|
|
265
265
|
<select
|
|
266
266
|
aria-label="${this.strings.dates.month}"
|
|
@@ -268,7 +268,7 @@
|
|
|
268
268
|
id="${this.id}-monthnav"
|
|
269
269
|
@change=${e=>{e.stopImmediatePropagation(),this.changeMonth(this.year,e.target.value)}}
|
|
270
270
|
>
|
|
271
|
-
${this.monthStrings.map((e,i)=>
|
|
271
|
+
${this.monthStrings.map((e,i)=>c`<option value=${i} ?selected=${this.month===i}>${e}</option>`)}
|
|
272
272
|
</select>
|
|
273
273
|
<label for="${this.id}-yearnav" class="pkt-hide">${this.strings.dates.year}</label>
|
|
274
274
|
<input
|
|
@@ -281,88 +281,88 @@
|
|
|
281
281
|
@change=${e=>{e.stopImmediatePropagation(),this.changeMonth(e.target.value,this.month)}}
|
|
282
282
|
.value=${this.year}
|
|
283
283
|
/>
|
|
284
|
-
</div> `):t.push(
|
|
284
|
+
</div> `):t.push(c`<div class="pkt-txt-16-medium pkt-calendar__month-title" aria-live="polite">
|
|
285
285
|
${this.monthStrings[this.month]} ${this.year}
|
|
286
|
-
</div>`),t}renderDayView(t,e){var i;const
|
|
286
|
+
</div>`),t}renderDayView(t,e){var i;const n=Ie(this.year,this.month,t),a=ut(n),r=a===ut(e),h=this.selected.includes(a),d=il(n),u=this.isExcluded(n)||!h&&this.multiple&&this.maxMultiple>0&&this.selected.length>=this.maxMultiple,g=this.focusedDate?this.focusedDate===a&&!u?"0":"-1":!u&&this.tabIndexSet===0||this.tabIndexSet===t?"0":"-1";g==="0"&&(this.tabIndexSet=t),this.selectableDates.push({currentDateISO:a,isDisabled:u,tabindex:g});const m={"pkt-cal-today":r,"pkt-cal-selected":h,"pkt-cal-in-range":this.inRange[a],"pkt-cal-excluded":this.isExcluded(n),"pkt-cal-in-range-first":this.range&&(this.selected.length===2||this.rangeHovered!==null)&&a===this.selected[0],"pkt-cal-in-range-last":this.range&&this.selected.length===2&&a===this.selected[1],"pkt-cal-range-hover":this.rangeHovered!==null&&a===ut(this.rangeHovered)},$={"pkt-calendar__date":!0,"pkt-calendar__date--today":r,"pkt-calendar__date--selected":h,"pkt-calendar__date--disabled":u,"pkt-calendar__date--in-range":this.inRange[a],"pkt-calendar__date--in-range-hover":this.rangeHovered!==null&&a===ut(this.rangeHovered),"pkt-calendar__date--range-start":this.range&&(this.selected.length===2||this.rangeHovered!==null)&&a===this.selected[0],"pkt-calendar__date--range-end":this.range&&this.selected.length===2&&a===this.selected[1]};return c`<td class=${E(m)}>
|
|
287
287
|
<button
|
|
288
288
|
type="button"
|
|
289
289
|
aria-pressed=${h?"true":"false"}
|
|
290
|
-
?disabled=${
|
|
291
|
-
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${
|
|
292
|
-
@mouseover=${()=>this.range&&!this.isExcluded(
|
|
293
|
-
@focus=${()=>{this.range&&!this.isExcluded(
|
|
290
|
+
?disabled=${u}
|
|
291
|
+
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${E($)}"
|
|
292
|
+
@mouseover=${()=>this.range&&!this.isExcluded(n)&&this.handleRangeHover(n)}
|
|
293
|
+
@focus=${()=>{this.range&&!this.isExcluded(n)&&this.handleRangeHover(n),this.focusedDate=a}}
|
|
294
294
|
aria-label="${d}"
|
|
295
|
-
tabindex=${(i=this.selectableDates.find(b=>b.currentDateISO===
|
|
296
|
-
data-disabled=${
|
|
297
|
-
data-date=${
|
|
298
|
-
@keydown=${b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),this.handleDateSelect(
|
|
299
|
-
@click=${b=>{
|
|
295
|
+
tabindex=${(i=this.selectableDates.find(b=>b.currentDateISO===a))==null?void 0:i.tabindex}
|
|
296
|
+
data-disabled=${u?"disabled":k}
|
|
297
|
+
data-date=${a}
|
|
298
|
+
@keydown=${b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),this.handleDateSelect(n))}}
|
|
299
|
+
@click=${b=>{u||(b.preventDefault(),this.handleDateSelect(n))}}
|
|
300
300
|
>
|
|
301
301
|
<span class="pkt-btn__text pkt-txt-14-light">${t}</span>
|
|
302
302
|
</button>
|
|
303
|
-
</td>`}renderCalendarBody(){const t=
|
|
303
|
+
</td>`}renderCalendarBody(){const t=sl(),e=Ie(this.year,this.month,1),i=Ie(this.year,this.month+1,0),n=(e.getDay()+6)%7,a=i.getDate(),r=Math.ceil((a+n)/7),h=Ie(this.year,this.month,0).getDate();let d=1;this.week=Rn(Ie(this.year,this.month,1));const u=[];for(let g=0;g<r;g++){const m=[];this.weeknumbers&&m.push(c`<td class="pkt-cal-week">${this.week}</td>`),this.week++;for(let $=1;$<8;$++)if(g===0&&$<n+1){const b=h-(n-$);m.push(c`<td class="pkt-cal-other">
|
|
304
304
|
<div
|
|
305
305
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
|
|
306
306
|
data-disabled="disabled"
|
|
307
307
|
>
|
|
308
308
|
<span class="pkt-btn__text pkt-txt-14-light">${b}</span>
|
|
309
309
|
</div>
|
|
310
|
-
</td>`)}else d>
|
|
310
|
+
</td>`)}else d>a?(m.push(c`<td class="pkt-cal-other">
|
|
311
311
|
<div
|
|
312
312
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
|
|
313
313
|
data-disabled="disabled"
|
|
314
314
|
>
|
|
315
|
-
<span class="pkt-btn__text pkt-txt-14-light">${d-
|
|
315
|
+
<span class="pkt-btn__text pkt-txt-14-light">${d-a}</span>
|
|
316
316
|
</div>
|
|
317
|
-
</td>`),d++):(
|
|
318
|
-
${
|
|
319
|
-
</tr>`)}return
|
|
317
|
+
</td>`),d++):(m.push(this.renderDayView(d,t)),d++);u.push(c`<tr class="pkt-cal-week-row" role="row">
|
|
318
|
+
${m}
|
|
319
|
+
</tr>`)}return u}isExcluded(t){const e=this.excludedates.map(i=>typeof i=="string"?i:ut(i));return!ia(t,this.earliest,this.latest,e,this.excludeweekdays)}isPrevMonthAllowed(){const t=Ie(this.year,this.month,0);return!(this.earliest&&$e(this.earliest)>t)}prevMonth(){const t=this.month===0?11:this.month-1,e=this.month===0?this.year-1:this.year;this.changeMonth(e,t)}isNextMonthAllowed(){const t=Ie(this.month===11?this.year+1:this.year,this.month===11?0:this.month+1,1);return!(this.latest&&$e(this.latest)<t)}nextMonth(){const t=this.month===11?0:this.month+1,e=this.month===11?this.year+1:this.year;this.changeMonth(e,t)}changeMonth(t,e){this.year=typeof t=="string"?parseInt(t):t,this.month=typeof e=="string"?parseInt(e):e,this.currentmonth=Ks(new Date(this.year,this.month,1)),this.tabIndexSet=0,this.focusedDate=null,this.selectableDates=[]}isRangeAllowed(t){let e=!0;if(this._selected.length===1){const i=qi({start:this._selected[0],end:t});if(Array.isArray(i)&&i.length)for(let n=0;n<i.length;n++)this.excludedates.forEach(a=>{a>this._selected[0]&&a<t&&(e=!1)}),this.excludeweekdays.includes(Jo(i[n]).toString())&&(e=!1)}return e}emptySelected(){this.selected=[],this._selected=[],this.inRange={}}addToSelected(t){this.selected.includes(ut(t))||(this.selected=[...this.selected,ut(t)],this._selected=[...this._selected,t],this.range&&this.selected.length===2&&(this.convertSelected(),this.close()))}removeFromSelected(t){if(this.selected.length===1)this.emptySelected();else{const e=this.selected.indexOf(ut(t)),i=[...this.selected],n=[...this._selected];i.splice(e,1),n.splice(e,1),this.selected=i,this._selected=n}}toggleSelected(t){const e=ut(t);this.selected.includes(e)?this.removeFromSelected(t):this.maxMultiple&&this.selected.length>=this.maxMultiple||this.addToSelected(t)}handleRangeSelect(t){const e=ut(t);return this.selected.includes(e)?this.selected.indexOf(e)===0?this.emptySelected():this.removeFromSelected(t):this.selected.length>1?(this.emptySelected(),this.addToSelected(t)):(this.selected.length===1&&!this.isRangeAllowed(t)&&this.emptySelected(),this.selected.length===1&&this._selected[0]>t&&this.emptySelected(),this.addToSelected(t)),Promise.resolve()}handleRangeHover(t){if(this.range&&this._selected.length===1&&this.isRangeAllowed(t)&&this._selected[0]<t){this.rangeHovered=t,this.inRange={};const e=qi({start:this._selected[0],end:t});if(Array.isArray(e)&&e.length)for(let i=0;i<e.length;i++){const n=e[i],a=n>this._selected[0]&&n<t;this.inRange[ut(n)]=a}}else this.rangeHovered=null}handleDateSelect(t){if(t)return this.range?this.handleRangeSelect(t):this.multiple?this.toggleSelected(t):(this.selected.includes(ut(t))?this.emptySelected():(this.emptySelected(),this.addToSelected(t)),this.close()),this.dispatchEvent(new CustomEvent("date-selected",{detail:this.selected,bubbles:!0,composed:!0})),Promise.resolve()}focusOnCurrentDate(){const t=ut(Ks(new Date)),e=this.querySelector(`button[data-date="${t}"]`);if(e instanceof HTMLButtonElement)this.focusedDate=t,e.focus();else{const i=this.selectableDates.find(n=>!n.isDisabled);if(i){const n=this.querySelector(`button[data-date="${i.currentDateISO}"]`);n instanceof HTMLButtonElement&&(this.focusedDate=i.currentDateISO,n.focus())}}}closeEvent(t){!this.contains(t.relatedTarget)&&!t.target.classList.contains("pkt-hide")&&this.close()}close(){this.dispatchEvent(new CustomEvent("close",{detail:!0,bubbles:!0,composed:!0}))}};J([o({type:Boolean})],G.prototype,"multiple",2),J([o({type:Number})],G.prototype,"maxMultiple",2),J([o({type:Boolean})],G.prototype,"range",2),J([o({type:Boolean})],G.prototype,"weeknumbers",2),J([o({type:Boolean})],G.prototype,"withcontrols",2),J([o({converter:bs.csvToArray})],G.prototype,"selected",2),J([o({type:String})],G.prototype,"earliest",2),J([o({type:String})],G.prototype,"latest",2),J([o({converter:bs.stringsToDate})],G.prototype,"excludedates",2),J([o({converter:bs.csvToArray})],G.prototype,"excludeweekdays",2),J([o({converter:bs.stringToDate})],G.prototype,"currentmonth",2),J([o({type:Array})],G.prototype,"dayStrings",2),J([o({type:Array})],G.prototype,"dayStringsLong",2),J([o({type:Array})],G.prototype,"monthStrings",2),J([o({type:String})],G.prototype,"weekString",2),J([o({type:String})],G.prototype,"prevMonthString",2),J([o({type:String})],G.prototype,"nextMonthString",2),J([o({type:Array})],G.prototype,"_selected",2),J([o({type:Number})],G.prototype,"year",2),J([o({type:Number})],G.prototype,"month",2),J([o({type:Number})],G.prototype,"week",2),J([o({type:Date})],G.prototype,"rangeHovered",2),J([D()],G.prototype,"inRange",2),J([D()],G.prototype,"focusedDate",2),J([D()],G.prototype,"selectableDates",2),J([D()],G.prototype,"currentmonthtouched",2),J([D()],G.prototype,"tabIndexSet",2),G=J([F("pkt-calendar")],G);const gl={size:{default:"medium"},skin:{default:"blue"},closeTag:{default:!1},type:{default:"button"}},xi={props:gl};var ml=Object.defineProperty,vl=Object.getOwnPropertyDescriptor,fe=(s,t,e,i)=>{for(var n=i>1?void 0:i?vl(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&ml(t,e,n),n};let re=class extends R{constructor(){super(),this.defaultSlot=N(),this.closeTag=xi.props.closeTag.default,this.size=xi.props.size.default,this.skin=xi.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=xi.props.type.default,this.ariaLabel=null,this._isClosed=!1,this._ariaDescription=null,this.close=t=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!1,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:t},bubbles:!1,composed:!0}))},this.slotController=new rt(this,this.defaultSlot),this._isClosed=!1}firstUpdated(t){var e,i;if(super.firstUpdated(t),this.closeTag&&!this.ariaLabel){const n=(i=(e=this.defaultSlot.value)==null?void 0:e.textContent)==null?void 0:i.trim();n&&(this._ariaDescription=`Klikk for å fjerne ${n}`)}}render(){const t={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},e={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${this.textStyle}`]:!!this.textStyle,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,"pkt-btn--icons-right-and-left":this.closeTag&&!!this.iconName,"pkt-hide":this._isClosed};return this.closeTag?c`
|
|
320
320
|
<button
|
|
321
|
-
class=${
|
|
321
|
+
class=${E(e)}
|
|
322
322
|
type=${this.type}
|
|
323
323
|
@click=${this.close}
|
|
324
|
-
aria-label=${
|
|
325
|
-
aria-description=${
|
|
324
|
+
aria-label=${C(this.ariaLabel||void 0)}
|
|
325
|
+
aria-description=${C(this._ariaDescription||void 0)}
|
|
326
326
|
>
|
|
327
|
-
${this.iconName&&
|
|
327
|
+
${this.iconName&&c`<pkt-icon
|
|
328
328
|
class="pkt-tag__icon"
|
|
329
329
|
name=${this.iconName}
|
|
330
330
|
aria-hidden="true"
|
|
331
331
|
></pkt-icon>`}
|
|
332
|
-
<span ${
|
|
332
|
+
<span ${M(this.defaultSlot)}></span>
|
|
333
333
|
<pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
|
|
334
334
|
</button>
|
|
335
|
-
`:
|
|
336
|
-
<span class=${
|
|
337
|
-
${this.iconName&&
|
|
335
|
+
`:c`
|
|
336
|
+
<span class=${E(t)}>
|
|
337
|
+
${this.iconName&&c`<pkt-icon
|
|
338
338
|
class="pkt-tag__icon"
|
|
339
339
|
name=${this.iconName}
|
|
340
340
|
aria-hidden="true"
|
|
341
341
|
></pkt-icon>`}
|
|
342
|
-
<span ${
|
|
342
|
+
<span ${M(this.defaultSlot)}></span>
|
|
343
343
|
</span>
|
|
344
|
-
`}};
|
|
344
|
+
`}};fe([o({type:Boolean,reflect:!0})],re.prototype,"closeTag",2),fe([o({type:String,reflect:!0})],re.prototype,"size",2),fe([o({type:String,reflect:!0})],re.prototype,"skin",2),fe([o({type:String,reflect:!0})],re.prototype,"textStyle",2),fe([o({type:String,reflect:!0})],re.prototype,"iconName",2),fe([o({type:String})],re.prototype,"type",2),fe([o({type:String})],re.prototype,"ariaLabel",2),fe([D()],re.prototype,"_isClosed",2),fe([D()],re.prototype,"_ariaDescription",2),re=fe([F("pkt-tag")],re);var bl=Object.defineProperty,kl=Object.getOwnPropertyDescriptor,ks=(s,t,e,i)=>{for(var n=i>1?void 0:i?kl(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&bl(t,e,n),n};let Le=class extends gi{constructor(){super(...arguments),this.size=void 0,this.level=2,this.weight=void 0,this.visuallyHidden=!1,this.align=void 0}connectedCallback(){super.connectedCallback(),this.setAttribute("role","heading"),this.setAttribute("aria-level",String(this.level)),this.updateHostClasses()}attributeChangedCallback(t,e,i){super.attributeChangedCallback(t,e,i),t==="level"&&i&&this.setLevel(Number(i)),t==="visuallyHidden"&&(this.visuallyHidden=i!==null&&i!=="false"),(t==="size"||t==="visuallyHidden"||t==="align"||t==="weight")&&this.updateHostClasses()}updated(t){super.updated(t),t.has("level")&&(this.setLevel(this.level),this.hasAttribute("size")||(this.size=this.defaultSizeForLevel),this.hasAttribute("weight")||(this.weight=this.defaultWeightForLevel)),!this.hasAttribute("size")&&(t.has("level")||this.size===void 0)&&(this.size=this.defaultSizeForLevel),(t.has("size")||t.has("visuallyHidden")||t.has("align")||t.has("weight"))&&this.updateHostClasses()}setLevel(t){t>=1&&t<=6?(this.level=t,this.setAttribute("aria-level",String(t))):console.warn(`Invalid heading level: ${t}. Must be between 1 and 6.`)}get defaultSizeForLevel(){switch(this.level){case 1:return"xlarge";case 2:return"large";case 3:return"medium";case 4:return"small";case 5:return"xsmall";case 6:return"xsmall";default:return"medium"}}get defaultWeightForLevel(){switch(this.level){case 1:return"regular";case 2:return"regular";case 3:return"medium";case 4:return"medium";case 5:return"medium";case 6:return"medium";default:return"medium"}}updateHostClasses(){this.classList.remove("pkt-heading","pkt-heading--xsmall","pkt-heading--small","pkt-heading--medium","pkt-heading--large","pkt-heading--xlarge","pkt-sr-only","pkt-heading--start","pkt-heading--center","pkt-heading--end","pkt-heading--light","pkt-heading--regular","pkt-heading--medium","pkt-heading--bold"),this.classList.add("pkt-heading"),this.size&&this.classList.add(`pkt-heading--${this.size}`),this.weight&&this.classList.add(`pkt-heading--fw-${this.weight}`),this.visuallyHidden&&this.classList.add("pkt-sr-only"),this.align&&this.classList.add(`pkt-heading--${this.align}`)}render(){return c`<slot></slot>`}};ks([o({type:String,reflect:!0})],Le.prototype,"size",2),ks([o({type:Number,reflect:!0})],Le.prototype,"level",2),ks([o({type:String,reflect:!0})],Le.prototype,"weight",2),ks([o({type:Boolean,reflect:!0})],Le.prototype,"visuallyHidden",2),ks([o({type:String,reflect:!0})],Le.prototype,"align",2),Le=ks([F("pkt-heading")],Le);const yl={layout:{default:"vertical"},skin:{type:["outlined","outlined-beige","gray","blue","beige","green"],default:"outlined"},padding:{default:"default"}},ys={props:yl};var $l=Object.defineProperty,_l=Object.getOwnPropertyDescriptor,$t=(s,t,e,i)=>{for(var n=i>1?void 0:i?_l(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&$l(t,e,n),n};let gt=class extends R{constructor(){super(),this.defaultSlot=N(),this.ariaLabel="",this.metaLead=null,this.borderOnHover=!0,this.clickCardLink=null,this.metaTrail=null,this.layout=ys.props.layout.default,this.heading="",this.headinglevel=3,this.image={src:"",alt:""},this.imageShape="square",this.openLinkInNewTab=!1,this.padding=ys.props.padding.default,this.skin=ys.props.skin.default,this.subheading="",this.tagPosition="top",this.tags=[],this.slotController=new rt(this,this.defaultSlot)}connectedCallback(){super.connectedCallback()}render(){var t,e;const i={"pkt-card":!0,[`pkt-card--${this.skin}`]:this.skin,[`pkt-card--${this.layout}`]:this.layout,[`pkt-card--padding-${this.padding}`]:this.padding,"pkt-card--border-on-hover":this.borderOnHover},n=((t=this.ariaLabel)==null?void 0:t.trim())||(this.heading?`${this.heading} lenkekort`:"lenkekort"),a=((e=this.ariaLabel)==null?void 0:e.trim())||(this.heading?this.heading:"kort");return c`
|
|
345
345
|
<article
|
|
346
|
-
class=${
|
|
347
|
-
aria-label=${
|
|
346
|
+
class=${E(i)}
|
|
347
|
+
aria-label=${C(this.clickCardLink?n:a)}
|
|
348
348
|
>
|
|
349
349
|
${this.renderImage()}
|
|
350
350
|
<div class="pkt-card__wrapper">
|
|
351
|
-
${this.tagPosition==="top"?this.renderTags()
|
|
351
|
+
${this.tagPosition==="top"?this.renderTags():k}
|
|
352
352
|
${this.renderHeader()}
|
|
353
353
|
${this.renderSlot()}
|
|
354
|
-
${this.tagPosition==="bottom"?this.renderTags()
|
|
354
|
+
${this.tagPosition==="bottom"?this.renderTags():k}
|
|
355
355
|
${this.renderMetadata()}
|
|
356
356
|
</div>
|
|
357
357
|
</article>
|
|
358
|
-
`}renderImage(){const t={"pkt-card__image":!0,[`pkt-card__image-${this.imageShape}`]:this.imageShape};return
|
|
359
|
-
${this.image.src&&
|
|
360
|
-
<div class=${
|
|
358
|
+
`}renderImage(){const t={"pkt-card__image":!0,[`pkt-card__image-${this.imageShape}`]:this.imageShape};return c`
|
|
359
|
+
${this.image.src&&c`
|
|
360
|
+
<div class=${E(t)}>
|
|
361
361
|
<img src=${this.image.src} alt=${this.image.alt||""} />
|
|
362
362
|
</div>
|
|
363
363
|
`}
|
|
364
|
-
`}renderHeading(){return
|
|
365
|
-
${this.heading&&!this.clickCardLink?
|
|
364
|
+
`}renderHeading(){return c`
|
|
365
|
+
${this.heading&&!this.clickCardLink?c`
|
|
366
366
|
<pkt-heading
|
|
367
367
|
class="pkt-card__heading"
|
|
368
368
|
.level=${this.headinglevel||3}
|
|
@@ -372,9 +372,9 @@
|
|
|
372
372
|
>
|
|
373
373
|
${this.heading}
|
|
374
374
|
</pkt-heading>
|
|
375
|
-
|
|
376
|
-
`}renderLinkHeading(){return
|
|
377
|
-
${this.clickCardLink?
|
|
375
|
+
`:k}
|
|
376
|
+
`}renderLinkHeading(){return c`
|
|
377
|
+
${this.clickCardLink?c`
|
|
378
378
|
<pkt-heading
|
|
379
379
|
class="pkt-card__link-heading pkt-card__heading"
|
|
380
380
|
.level=${this.headinglevel||3}
|
|
@@ -389,51 +389,51 @@
|
|
|
389
389
|
>${this.heading}</a
|
|
390
390
|
>
|
|
391
391
|
</pkt-heading>
|
|
392
|
-
|
|
393
|
-
`}renderSubheading(){return
|
|
394
|
-
${this.subheading?
|
|
395
|
-
`}renderHeader(){const t=!!this.heading||!!this.subheading;return
|
|
396
|
-
${t?
|
|
392
|
+
`:k}
|
|
393
|
+
`}renderSubheading(){return c`
|
|
394
|
+
${this.subheading?c` <p class="pkt-card__subheading ">${this.subheading}</p> `:k}
|
|
395
|
+
`}renderHeader(){const t=!!this.heading||!!this.subheading;return c`
|
|
396
|
+
${t?c`
|
|
397
397
|
<header class="pkt-card__header">
|
|
398
398
|
${this.renderHeading()}
|
|
399
399
|
${this.renderLinkHeading()}
|
|
400
400
|
${this.renderSubheading()}
|
|
401
401
|
</header>
|
|
402
|
-
|
|
403
|
-
`}renderTags(){const t={"pkt-card__tags":!0,[`pkt-card__tags-${this.tagPosition}`]:this.tagPosition};return
|
|
404
|
-
${this.tags.length>0?
|
|
402
|
+
`:k}
|
|
403
|
+
`}renderTags(){const t={"pkt-card__tags":!0,[`pkt-card__tags-${this.tagPosition}`]:this.tagPosition};return c`
|
|
404
|
+
${this.tags.length>0?c`
|
|
405
405
|
<div
|
|
406
|
-
class=${
|
|
406
|
+
class=${E(t)}
|
|
407
407
|
role="list"
|
|
408
408
|
aria-label=${this.tags.length>1?"merkelapper":"merkelapp"}
|
|
409
409
|
>
|
|
410
|
-
${this.tags.map(e=>
|
|
410
|
+
${this.tags.map(e=>c`
|
|
411
411
|
<pkt-tag
|
|
412
412
|
role="listitem"
|
|
413
413
|
textStyle="normal-text"
|
|
414
414
|
size="medium"
|
|
415
|
-
skin=${
|
|
416
|
-
iconName=${
|
|
415
|
+
skin=${C(e.skin)}
|
|
416
|
+
iconName=${C(e.iconName)}
|
|
417
417
|
>
|
|
418
418
|
<span>${e.text}</span>
|
|
419
419
|
</pkt-tag>
|
|
420
420
|
`)}
|
|
421
421
|
</div>
|
|
422
|
-
|
|
423
|
-
`}renderSlot(){return
|
|
424
|
-
${this.defaultSlot&&
|
|
425
|
-
`}renderMetadata(){return
|
|
426
|
-
${this.metaLead||this.metaTrail?
|
|
422
|
+
`:k}
|
|
423
|
+
`}renderSlot(){return c`
|
|
424
|
+
${this.defaultSlot&&c`<section class="pkt-card__content" ${M(this.defaultSlot)}></section>`}
|
|
425
|
+
`}renderMetadata(){return c`
|
|
426
|
+
${this.metaLead||this.metaTrail?c`
|
|
427
427
|
<footer class="pkt-card__metadata">
|
|
428
|
-
${this.metaLead?
|
|
429
|
-
${this.metaTrail?
|
|
428
|
+
${this.metaLead?c`<span class="pkt-card__metadata-lead">${this.metaLead}</span>`:k}
|
|
429
|
+
${this.metaTrail?c`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>`:k}
|
|
430
430
|
</footer>
|
|
431
|
-
|
|
432
|
-
`}}
|
|
431
|
+
`:k}
|
|
432
|
+
`}};$t([o({type:String})],gt.prototype,"ariaLabel",2),$t([o({type:String})],gt.prototype,"metaLead",2),$t([o({type:Boolean})],gt.prototype,"borderOnHover",2),$t([o({type:String,reflect:!0})],gt.prototype,"clickCardLink",2),$t([o({type:String})],gt.prototype,"metaTrail",2),$t([o({type:String})],gt.prototype,"layout",2),$t([o({type:String})],gt.prototype,"heading",2),$t([o({type:Number})],gt.prototype,"headinglevel",2),$t([o({type:Object})],gt.prototype,"image",2),$t([o({type:String})],gt.prototype,"imageShape",2),$t([o({type:Boolean})],gt.prototype,"openLinkInNewTab",2),$t([o({type:String})],gt.prototype,"padding",2),$t([o({type:String,converter:{fromAttribute:s=>{const t=ys.props.skin.type;return s&&t.includes(s)?s:(s&&!t.includes(s)&&console.warn(`Invalid skin value "${s}". Using default skin "${ys.props.skin.default}".`),ys.props.skin.default)},toAttribute:s=>s}})],gt.prototype,"skin",2),$t([o({type:String})],gt.prototype,"subheading",2),$t([o({type:String})],gt.prototype,"tagPosition",2),$t([o({type:Array})],gt.prototype,"tags",2),gt=$t([F("pkt-card")],gt);/**
|
|
433
433
|
* @license
|
|
434
434
|
* Copyright 2017 Google LLC
|
|
435
435
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
436
|
-
*/const za=(s,t,e)=>{const i=new Map;for(let a=t;a<=e;a++)i.set(s[a],a);return i},Ei=Ce(class extends Ge{constructor(s){if(super(s),s.type!==Rt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,t,e){let i;e===void 0?e=t:t!==void 0&&(i=t);const a=[],n=[];let r=0;for(const h of s)a[r]=i?i(h,r):r,n[r]=e(h,r),r++;return{values:n,keys:a}}render(s,t,e){return this.dt(s,t,e).values}update(s,[t,e,i]){const a=pr(s),{values:n,keys:r}=this.dt(t,e,i);if(!Array.isArray(a))return this.ut=r,n;const h=this.ut??(this.ut=[]),d=[];let p,f,g=0,k=a.length-1,b=0,y=n.length-1;for(;g<=k&&b<=y;)if(a[g]===null)g++;else if(a[k]===null)k--;else if(h[g]===r[b])d[b]=Te(a[g],n[b]),g++,b++;else if(h[k]===r[y])d[y]=Te(a[k],n[y]),k--,y--;else if(h[g]===r[y])d[y]=Te(a[g],n[y]),ys(s,d[y+1],a[g]),g++,y--;else if(h[k]===r[b])d[b]=Te(a[k],n[b]),ys(s,a[g],a[k]),k--,b++;else if(p===void 0&&(p=za(r,b,y),f=za(h,g,k)),p.has(h[g]))if(p.has(h[k])){const w=f.get(r[b]),C=w!==void 0?a[w]:null;if(C===null){const P=ys(s,a[g]);Te(P,n[b]),d[b]=P}else d[b]=Te(C,n[b]),ys(s,a[g],C),a[w]=null;b++}else ki(a[k]),k--;else ki(a[g]),g++;for(;b<=y;){const w=ys(s,d[y+1]);Te(w,n[b]),d[b++]=w}for(;g<=k;){const w=a[g++];w!==null&&ki(w)}return this.ut=r,ya(s,d),xt}}),Wa=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),cl=s=>new Promise(t=>setTimeout(t,s)),ke=()=>{const s=Wa(),t=Wa();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+t.slice(1,4)+"-"+t.slice(4)},pl={helptextDropdownButton:{default:"Les mer <span class='pkt-sr-only'>om feltet</span>"},counter:{default:!1},optionalTag:{default:!1},optionalText:{default:"Valgfritt"},requiredTag:{default:!1},requiredText:{default:"Må fylles ut"},hasError:{default:!1},disabled:{default:!1},inline:{default:!1},hasFieldset:{default:!1},useWrapper:{default:!0}},Mt={props:pl};var ul={},Ra;function fl(){return Ra||(Ra=1,(function(){(function(s){const t=new WeakMap,e=new WeakMap,i=new WeakMap,a=new WeakMap,n=new WeakMap,r=new WeakMap,h=new WeakMap,d=new WeakMap,p=new WeakMap,f=new WeakMap,g=new WeakMap,k=new WeakMap,b=new WeakMap,y=new WeakMap,w=new WeakMap,C={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDescription:"aria-description",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"},P=(m,c)=>{for(let v in C){c[v]=null;let _=null;const L=C[v];Object.defineProperty(c,v,{get(){return _},set(U){_=U,m.isConnected?rt(m,L,U):f.set(m,c)}})}};function T(m){const c=a.get(m),{form:v}=c;ce(m,v,c),At(m,c.labels)}const I=(m,c=!1)=>{const v=document.createTreeWalker(m,NodeFilter.SHOW_ELEMENT,{acceptNode(U){return a.has(U)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let _=v.nextNode();const L=!c||m.disabled;for(;_;)_.formDisabledCallback&&L&&Ft(_,m.disabled),_=v.nextNode()},N={attributes:!0,attributeFilter:["disabled","name"]},W=pe()?new MutationObserver(m=>{for(const c of m){const v=c.target;if(c.attributeName==="disabled"&&(v.constructor.formAssociated?Ft(v,v.hasAttribute("disabled")):v.localName==="fieldset"&&I(v)),c.attributeName==="name"&&v.constructor.formAssociated){const _=a.get(v),L=p.get(v);_.setFormValue(L)}}}):{};function Z(m){m.forEach(c=>{const{addedNodes:v,removedNodes:_}=c,L=Array.from(v),U=Array.from(_);L.forEach(q=>{var jt;if(a.has(q)&&q.constructor.formAssociated&&T(q),f.has(q)){const yt=f.get(q);Object.keys(C).filter(Ht=>yt[Ht]!==null).forEach(Ht=>{rt(q,C[Ht],yt[Ht])}),f.delete(q)}if(w.has(q)){const yt=w.get(q);rt(q,"internals-valid",yt.validity.valid.toString()),rt(q,"internals-invalid",(!yt.validity.valid).toString()),rt(q,"aria-invalid",(!yt.validity.valid).toString()),w.delete(q)}if(q.localName==="form"){const yt=d.get(q),Ht=document.createTreeWalker(q,NodeFilter.SHOW_ELEMENT,{acceptNode(zi){return a.has(zi)&&zi.constructor.formAssociated&&!(yt&&yt.has(zi))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let js=Ht.nextNode();for(;js;)T(js),js=Ht.nextNode()}q.localName==="fieldset"&&((jt=W.observe)===null||jt===void 0||jt.call(W,q,N),I(q,!0))}),U.forEach(q=>{const jt=a.get(q);jt&&i.get(jt)&&Vt(jt),h.has(q)&&h.get(q).disconnect()})})}function wt(m){m.forEach(c=>{const{removedNodes:v}=c;v.forEach(_=>{const L=b.get(c.target);a.has(_)&&qe(_),L.disconnect()})})}const bt=m=>{var c,v;const _=new MutationObserver(wt);!((c=window==null?void 0:window.ShadyDOM)===null||c===void 0)&&c.inUse&&m.mode&&m.host&&(m=m.host),(v=_.observe)===null||v===void 0||v.call(_,m,{childList:!0}),b.set(m,_)};pe()&&new MutationObserver(Z);const Q={childList:!0,subtree:!0},rt=(m,c,v)=>{m.getAttribute(c)!==v&&m.setAttribute(c,v)},Ft=(m,c)=>{m.toggleAttribute("internals-disabled",c),c?rt(m,"aria-disabled","true"):m.removeAttribute("aria-disabled"),m.formDisabledCallback&&m.formDisabledCallback.apply(m,[c])},Vt=m=>{i.get(m).forEach(c=>{c.remove()}),i.set(m,[])},ot=(m,c)=>{const v=document.createElement("input");return v.type="hidden",v.name=m.getAttribute("name"),m.after(v),i.get(c).push(v),v},F=(m,c)=>{var v;i.set(c,[]),(v=W.observe)===null||v===void 0||v.call(W,m,N)},At=(m,c)=>{if(c.length){Array.from(c).forEach(_=>_.addEventListener("click",m.click.bind(m)));let v=c[0].id;c[0].id||(v=`${c[0].htmlFor}_Label`,c[0].id=v),rt(m,"aria-labelledby",v)}},ae=m=>{const c=Array.from(m.elements).filter(U=>!U.tagName.includes("-")&&U.validity).map(U=>U.validity.valid),v=d.get(m)||[],_=Array.from(v).filter(U=>U.isConnected).map(U=>a.get(U).validity.valid),L=[...c,..._].includes(!1);m.toggleAttribute("internals-invalid",L),m.toggleAttribute("internals-valid",!L)},de=m=>{ae(zt(m.target))},ne=m=>{ae(zt(m.target))},He=m=>{const c=["button[type=submit]","input[type=submit]","button:not([type])"].map(v=>`${v}:not([disabled])`).map(v=>`${v}:not([form])${m.id?`,${v}[form='${m.id}']`:""}`).join(",");m.addEventListener("click",v=>{if(v.target.closest(c)){const _=d.get(m);if(m.noValidate)return;_.size&&Array.from(_).reverse().map(L=>a.get(L).reportValidity()).includes(!1)&&v.preventDefault()}})},ds=m=>{const c=d.get(m.target);c&&c.size&&c.forEach(v=>{v.constructor.formAssociated&&v.formResetCallback&&v.formResetCallback.apply(v)})},ce=(m,c,v)=>{if(c){const _=d.get(c);if(_)_.add(m);else{const L=new Set;L.add(m),d.set(c,L),He(c),c.addEventListener("reset",ds),c.addEventListener("input",de),c.addEventListener("change",ne)}r.set(c,{ref:m,internals:v}),m.constructor.formAssociated&&m.formAssociatedCallback&&setTimeout(()=>{m.formAssociatedCallback.apply(m,[c])},0),ae(c)}},zt=m=>{let c=m.parentNode;return c&&c.tagName!=="FORM"&&(c=zt(c)),c},ut=(m,c,v=DOMException)=>{if(!m.constructor.formAssociated)throw new v(c)},Ue=(m,c,v)=>{const _=d.get(m);return _&&_.size&&_.forEach(L=>{a.get(L)[v]()||(c=!1)}),c},qe=m=>{if(m.constructor.formAssociated){const c=a.get(m),{labels:v,form:_}=c;At(m,v),ce(m,_,c)}};function pe(){return typeof MutationObserver<"u"}class ji{constructor(){this.badInput=!1,this.customError=!1,this.patternMismatch=!1,this.rangeOverflow=!1,this.rangeUnderflow=!1,this.stepMismatch=!1,this.tooLong=!1,this.tooShort=!1,this.typeMismatch=!1,this.valid=!0,this.valueMissing=!1,Object.seal(this)}}const hi=m=>(m.badInput=!1,m.customError=!1,m.patternMismatch=!1,m.rangeOverflow=!1,m.rangeUnderflow=!1,m.stepMismatch=!1,m.tooLong=!1,m.tooShort=!1,m.typeMismatch=!1,m.valid=!0,m.valueMissing=!1,m),Hi=(m,c,v)=>(m.valid=di(c),Object.keys(c).forEach(_=>m[_]=c[_]),v&&ae(v),m),di=m=>{let c=!0;for(let v in m)v!=="valid"&&m[v]!==!1&&(c=!1);return c},cs=new WeakMap;function ps(m,c){m.toggleAttribute(c,!0),m.part&&m.part.add(c)}class Vs extends Set{static get isPolyfilled(){return!0}constructor(c){if(super(),!c||!c.tagName||c.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");cs.set(this,c)}add(c){if(!/^--/.test(c)||typeof c!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${c} must start with '--'.`);const v=super.add(c),_=cs.get(this),L=`state${c}`;return _.isConnected?ps(_,L):setTimeout(()=>{ps(_,L)}),v}clear(){for(let[c]of this.entries())this.delete(c);super.clear()}delete(c){const v=super.delete(c),_=cs.get(this);return _.isConnected?(_.toggleAttribute(`state${c}`,!1),_.part&&_.part.remove(`state${c}`)):setTimeout(()=>{_.toggleAttribute(`state${c}`,!1),_.part&&_.part.remove(`state${c}`)}),v}}function ci(m,c,v,_){if(typeof c=="function"?m!==c||!_:!c.has(m))throw new TypeError("Cannot read private member from an object whose class did not declare it");return v==="m"?_:v==="a"?_.call(m):_?_.value:c.get(m)}function Ui(m,c,v,_,L){if(typeof c=="function"?m!==c||!0:!c.has(m))throw new TypeError("Cannot write private member to an object whose class did not declare it");return c.set(m,v),v}var _e;class pi{constructor(c){_e.set(this,void 0),Ui(this,_e,c);for(let v=0;v<c.length;v++){let _=c[v];this[v]=_,_.hasAttribute("name")&&(this[_.getAttribute("name")]=_)}Object.freeze(this)}get length(){return ci(this,_e,"f").length}[(_e=new WeakMap,Symbol.iterator)](){return ci(this,_e,"f")[Symbol.iterator]()}item(c){return this[c]==null?null:this[c]}namedItem(c){return this[c]==null?null:this[c]}}function ui(){const m=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=v;const c=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=_;function v(...U){let q=m.apply(this,U);return Ue(this,q,"checkValidity")}function _(...U){let q=c.apply(this,U);return Ue(this,q,"reportValidity")}const{get:L}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...U){const q=L.call(this,...U),jt=Array.from(d.get(this)||[]);if(jt.length===0)return q;const yt=Array.from(q).concat(jt).sort((Ht,js)=>Ht.compareDocumentPosition?Ht.compareDocumentPosition(js)&2?1:-1:0);return new pi(yt)}})}class Cn{static get isPolyfilled(){return!0}constructor(c){if(!c||!c.tagName||c.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const v=c.getRootNode(),_=new ji;this.states=new Vs(c),t.set(this,c),e.set(this,_),a.set(c,this),P(c,this),F(c,this),Object.seal(this),v instanceof DocumentFragment&&bt(v)}checkValidity(){const c=t.get(this);if(ut(c,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const v=e.get(this);if(!v.valid){const _=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});c.dispatchEvent(_)}return v.valid}get form(){const c=t.get(this);ut(c,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let v;return c.constructor.formAssociated===!0&&(v=zt(c)),v}get labels(){const c=t.get(this);ut(c,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const v=c.getAttribute("id"),_=c.getRootNode();return _&&v?_.querySelectorAll(`[for="${v}"]`):[]}reportValidity(){const c=t.get(this);if(ut(c,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const v=this.checkValidity(),_=k.get(this);if(_&&!c.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!v&&_&&(c.focus(),_.focus()),v}setFormValue(c){const v=t.get(this);if(ut(v,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),Vt(this),c!=null&&!(c instanceof FormData)){if(v.getAttribute("name")){const _=ot(v,this);_.value=c}}else c!=null&&c instanceof FormData&&Array.from(c).reverse().forEach(([_,L])=>{if(typeof L=="string"){const U=ot(v,this);U.name=_,U.value=L}});p.set(v,c)}setValidity(c,v,_){const L=t.get(this);if(ut(L,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!c)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");k.set(this,_);const U=e.get(this),q={};for(const Ht in c)q[Ht]=c[Ht];Object.keys(q).length===0&&hi(U);const jt=Object.assign(Object.assign({},U),q);delete jt.valid;const{valid:yt}=Hi(U,jt,this.form);if(!yt&&!v)throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");n.set(this,yt?"":v),L.isConnected?(L.toggleAttribute("internals-invalid",!yt),L.toggleAttribute("internals-valid",yt),rt(L,"aria-invalid",`${!yt}`)):w.set(L,this)}get shadowRoot(){const c=t.get(this);return g.get(c)||null}get validationMessage(){const c=t.get(this);return ut(c,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),n.get(this)}get validity(){const c=t.get(this);return ut(c,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),e.get(this)}get willValidate(){const c=t.get(this);return ut(c,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(c.disabled||c.hasAttribute("disabled")||c.hasAttribute("readonly"))}}function md(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class m extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const c=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(c,m);const v=new m;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(_=>_ in v.internals)}let Tn=!1,Nn=!1;function qi(m){Nn||(Nn=!0,window.CustomStateSet=Vs,m&&(HTMLElement.prototype.attachInternals=function(...c){const v=m.call(this,c);return v.states=new Vs(this),v}))}function An(m=!0){if(!Tn){if(Tn=!0,typeof window<"u"&&(window.ElementInternals=Cn),typeof CustomElementRegistry<"u"){const c=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(v,_,L){if(_.formAssociated){const U=_.prototype.connectedCallback;_.prototype.connectedCallback=function(){y.has(this)||(y.set(this,!0),this.hasAttribute("disabled")&&Ft(this,!0)),U!=null&&U.apply(this),qe(this)}}c.call(this,v,_,L)}}if(typeof HTMLElement<"u"&&(HTMLElement.prototype.attachInternals=function(){if(this.tagName){if(this.tagName.indexOf("-")===-1)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.")}else return{};if(a.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new Cn(this)}),typeof Element<"u"){let c=function(..._){const L=v.apply(this,_);if(g.set(this,L),pe()){const U=new MutationObserver(Z);window.ShadyDOM?U.observe(this,Q):U.observe(L,Q),h.set(this,U)}return L};const v=Element.prototype.attachShadow;Element.prototype.attachShadow=c}pe()&&typeof document<"u"&&new MutationObserver(Z).observe(document.documentElement,Q),typeof HTMLFormElement<"u"&&ui(),(m||typeof window<"u"&&!window.CustomStateSet)&&qi()}}return customElements.polyfillWrapFlushCallback||(md()?typeof window<"u"&&!window.CustomStateSet&&qi(HTMLElement.prototype.attachInternals):An(!1)),s.forceCustomStateSetPolyfill=qi,s.forceElementInternalsPolyfill=An,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})()),ul}fl();var gl=Object.defineProperty,H=(s,t,e,i)=>{for(var a=void 0,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=r(t,e,a)||a);return a&&gl(t,e,a),a};const ml={fromAttribute(s){return s==null?!1:s===""||s==="true"||s===!0?!0:s==="false"||s===!1?!1:!!s},toAttribute(s){return s?"true":"false"}};let D=class extends Y{constructor(){super(),this.defaultValue=null,this.disabled=!1,this.readonly=!1,this.required=!1,this.max=null,this.maxlength=null,this.min=null,this.minlength=null,this.step=null,this.ariaDescribedBy=null,this.ariaLabelledby=null,this.name="",this.pattern=null,this.placeholder=null,this.id=ke(),this.counter=!1,this.hasError=!1,this.inline=!1,this.hasFieldset=!1,this.optionalTag=!1,this.requiredTag=!1,this.skipForwardTestid=!1,this.useWrapper=!0,this.fullwidth=!1,this.counterMaxLength=0,this.errorMessage="",this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=Mt.props.helptextDropdownButton.default,this.label=null,this.optionalText=_t.forms.labels.optional,this.requiredText=_t.forms.labels.required,this.tagText=null,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(t){var e,i,a,n,r,h,d,p,f,g,k;t&&(this.required&&!this.value?this.internals.setValidity({valueMissing:!0},_t.forms.messages.required,t):(e=t.validity)!=null&&e.typeMismatch||(i=t.validity)!=null&&i.badInput?this.internals.setValidity({typeMismatch:!0},_t.forms.messages.invalid,t):(a=t.validity)!=null&&a.patternMismatch?this.internals.setValidity({patternMismatch:!0},_t.forms.messages.invalidPattern,t):(n=t.validity)!=null&&n.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},_t.forms.messages.tooShort,t):(r=t.validity)!=null&&r.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},_t.forms.messages.tooLong,t):(h=t.validity)!=null&&h.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?_t.forms.messages.rangeUnderflowMin.replace("{min}",(d=this.min)==null?void 0:d.toString()):_t.forms.messages.rangeUnderflow,t):(p=t.validity)!=null&&p.stepMismatch?this.internals.setValidity({stepMismatch:!0},_t.forms.messages.invalid,t):(f=t.validity)!=null&&f.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?_t.forms.messages.rangeOverflowMax.replace("{max}",(g=this.max)==null?void 0:g.toString()):_t.forms.messages.rangeOverflow,t):(k=t.validity)!=null&&k.customError?this.internals.setValidity({customError:!0},t.validationMessage,t):this.internals.setValidity({}))}setFormValue(t){if(this.internals)if(Array.isArray(t)){const e=new FormData;t.forEach(i=>{e.append(this.name,i)}),this.internals.setFormValue(e)}else this.internals.setFormValue(t)}valueChecked(t){if(!this.touched)return;const e=this.internals.form||this.closest("form"),i=e?new FormData(e):null;e&&e.querySelectorAll(`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`).forEach(a=>{const n=a;n.name===this.name&&n.value!==this.value&&n.checked&&(n.checked=!1)}),typeof t=="string"?(this.checked=t==="true",this.internals.ariaChecked=t==="true"):typeof t=="boolean"&&(this.checked=t,this.internals.ariaChecked=t),this.checked?(this.internals.setFormValue(this.value||"on",this.value||"on"),i&&i.append(this.name,this.value||"on"),this.internals.states.add("--checked")):(this.internals.setFormValue(null,null),i&&i.delete(this.name),this.internals.states.delete("--checked")),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:this.checked,bubbles:!0,composed:!0})),this.internals.reportValidity()}valueChanged(t,e){(e!==this.value||e!==this._value)&&(typeof t=="string"?((this.multiple||this.range)&&t.includes(",")&&(t=t.split(",")),this.value=t,this._value=Array.isArray(t)?t:[t]):Array.isArray(t)?(this.value=this.multiple||this.range?t:t[0],this._value=t):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&e&&e.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(e==null?void 0:e.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate()))}clearInputValue(){const t=this.multiple||this.range?[]:"";this.value=t,this.internals.setFormValue(t),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0}))}onFocus(){this.dispatchEvent(new FocusEvent("focus",{bubbles:!0,composed:!0}))}onBlur(){this.dispatchEvent(new FocusEvent("blur",{bubbles:!0,composed:!0}))}onInput(){this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}onChange(t){if(!this.touched){this.touched=!0,t&&this.setFormValue(t);return}typeof t!="string"&&!Array.isArray(t)||((this.range||this.multiple)&&!Array.isArray(t)&&t.includes(",")&&(t=t.split(",")),!this.multiple&&!this.range&&Array.isArray(t)&&(t=t[0]),this.setFormValue(t),this.manageValidity(this.inputRef.value),this.inputRefTo&&this.manageValidity(this.inputRefTo.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0})))}formResetCallback(){this.touched=!1,this._options&&this._options.length&&this._options.forEach(t=>{"selected"in t&&(t.selected=!1)}),this.checked!==void 0?(this.checked=!1,this.internals.ariaChecked=!1,this.internals.setFormValue("",""),this.inputRef.value.checked=!1,this.valueChecked(this.checked)):(this.internals.setFormValue(""),this.value=this.defaultValue||(this.multiple||this.range?[]:""),this._value=this.value,this.valueChanged(this.value,null)),this.internals.ariaInvalid=!1}updated(t){super.updated(t),t.has("dataTestid")&&this.dataTestid&&this.inputRef.value&&(this.skipForwardTestid?this.hasAttribute("data-testid")||this.setAttribute("data-testid",this.dataTestid):(this.inputRef.value.dataset.testid=this.dataTestid,this.removeAttribute("data-testid")))}firstUpdated(t){if(super.firstUpdated(t),!this.form){const e=this.internals.form||this.closest("form");this.form=e}if(this.value&&this.defaultValue!==null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked=!0,this.checked=!0),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.ariaDisabled=!0),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const e=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=e,this.internals.setFormValue(e?this.value||"on":"",e?this.value||"on":"")}else this.internals.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute("form",""),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute("form",""),this.manageValidity(this.inputRefTo.value))}};H([o()],D.prototype,"defaultValue"),H([o({type:Boolean,reflect:!0})],D.prototype,"disabled"),H([o({type:Boolean,reflect:!0})],D.prototype,"readonly"),H([o({type:Boolean,reflect:!0})],D.prototype,"required"),H([o({type:Number,reflect:!0})],D.prototype,"max"),H([o({type:Number,reflect:!0})],D.prototype,"maxlength"),H([o({type:Number,reflect:!0})],D.prototype,"min"),H([o({type:Number,reflect:!0})],D.prototype,"minlength"),H([o({type:Number,reflect:!0})],D.prototype,"step"),H([o({type:String})],D.prototype,"ariaDescribedBy"),H([o({type:String})],D.prototype,"ariaLabelledby"),H([o({type:String,reflect:!0})],D.prototype,"name"),H([o({type:String,reflect:!0})],D.prototype,"pattern"),H([o({type:String,reflect:!0})],D.prototype,"placeholder"),H([o({type:String,reflect:!0})],D.prototype,"id"),H([o({type:Boolean})],D.prototype,"counter"),H([o({type:Boolean})],D.prototype,"hasError"),H([o({type:Boolean})],D.prototype,"inline"),H([o({type:Boolean})],D.prototype,"hasFieldset"),H([o({type:Boolean})],D.prototype,"optionalTag"),H([o({type:Boolean})],D.prototype,"requiredTag"),H([o({type:Boolean})],D.prototype,"skipForwardTestid"),H([o({type:Boolean,reflect:!0,converter:ml})],D.prototype,"useWrapper"),H([o({type:Boolean,reflect:!0})],D.prototype,"fullwidth"),H([o({type:Number})],D.prototype,"counterMaxLength"),H([o({type:String})],D.prototype,"errorMessage"),H([o({type:String})],D.prototype,"helptext"),H([o({type:String})],D.prototype,"helptextDropdown"),H([o({type:String,reflect:!1})],D.prototype,"helptextDropdownButton"),H([o({type:String})],D.prototype,"label"),H([o({type:String,reflect:!1})],D.prototype,"optionalText"),H([o({type:String,reflect:!1})],D.prototype,"requiredText"),H([o({type:String,reflect:!1})],D.prototype,"tagText"),H([o({type:String,attribute:"data-testid"})],D.prototype,"dataTestid"),H([V()],D.prototype,"touched");let Ka=class{constructor(t){this.nodes=[],this.options=[],this.host=t,this.host.addController(this),this.nodes=[],this.options=[],this.observer=new MutationObserver(e=>this.handleMutations(e))}hostConnected(){Array.from(this.host.childNodes).forEach(t=>{(t.nodeName==="OPTION"||t.nodeName==="DATA")&&this.addNode(t)}),this.observer.observe(this.host,{childList:!0,subtree:!1,attributes:!0})}hostDisconnected(){this.observer.disconnect()}addNode(t){(t.nodeName==="OPTION"||t.nodeName==="DATA")&&(t.hasAttribute("hidden")&&!t.hasAttribute("data-skip")&&t.setAttribute("data-hidden","true"),!t.hasAttribute("hidden")&&t.hasAttribute("data-skip")&&t.hasAttribute("data-hidden")&&t.removeAttribute("data-hidden"),t.setAttribute("class","pkt-hide"),t.setAttribute("data-skip","true"),t.setAttribute("hidden","true"),this.nodes.push(t))}createOptions(){this.options=this.nodes.map(t=>({value:t.hasAttribute("value")?t.getAttribute("value")??"":t.textContent??"",label:t.textContent||t.getAttribute("value")||"",selected:t.hasAttribute("selected"),disabled:t.hasAttribute("disabled"),hidden:t.hasAttribute("data-hidden")})),this.host.setAttribute("options",JSON.stringify(this.options))}handleMutations(t){let e=!1;t.forEach(i=>{i.type==="childList"&&(i.addedNodes.forEach(a=>{Ye(a)&&(this.addNode(a),e=!0)}),i.removedNodes.forEach(a=>{Ye(a)&&(this.nodes=this.nodes.filter(n=>n!==a),e=!0)})),i.type==="attributes"&&Ye(i.target)&&(this.addNode(i.target),e=!0)}),e&&this.createOptions()}};var vl=Object.defineProperty,bl=Object.getOwnPropertyDescriptor,Oe=(s,t,e,i)=>{for(var a=i>1?void 0:i?bl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&vl(t,e,a),a};let oe=class extends Y{constructor(){super(),this.defaultSlot=A(),this.forId=ke(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=Mt.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new at(this,this.defaultSlot)}updateSlots(t){this.filledSlots=new Set(t)}render(){const t=()=>{const a=!this.isHelpTextOpen;this.isHelpTextOpen=a,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:a}}))},e=M({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.filledSlots.size>0}),i=()=>this.helptextDropdown?u`<div class="pkt-inputwrapper__helptext-expandable">
|
|
436
|
+
*/const ra=(s,t,e)=>{const i=new Map;for(let n=t;n<=e;n++)i.set(s[n],n);return i},Yi=We(class extends us{constructor(s){if(super(s),s.type!==ne.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,t,e){let i;e===void 0?e=t:t!==void 0&&(i=t);const n=[],a=[];let r=0;for(const h of s)n[r]=i?i(h,r):r,a[r]=e(h,r),r++;return{values:a,keys:n}}render(s,t,e){return this.dt(s,t,e).values}update(s,[t,e,i]){const n=xr(s),{values:a,keys:r}=this.dt(t,e,i);if(!Array.isArray(n))return this.ut=r,a;const h=this.ut??(this.ut=[]),d=[];let u,g,m=0,$=n.length-1,b=0,y=a.length-1;for(;m<=$&&b<=y;)if(n[m]===null)m++;else if(n[$]===null)$--;else if(h[m]===r[b])d[b]=Re(n[m],a[b]),m++,b++;else if(h[$]===r[y])d[y]=Re(n[$],a[y]),$--,y--;else if(h[m]===r[y])d[y]=Re(n[m],a[y]),Fs(s,d[y+1],n[m]),m++,y--;else if(h[$]===r[b])d[b]=Re(n[$],a[b]),Fs(s,n[m],n[$]),$--,b++;else if(u===void 0&&(u=ra(r,b,y),g=ra(h,m,$)),u.has(h[m]))if(u.has(h[$])){const x=g.get(r[b]),T=x!==void 0?n[x]:null;if(T===null){const S=Fs(s,n[m]);Re(S,a[b]),d[b]=S}else d[b]=Re(T,a[b]),Fs(s,n[m],T),n[x]=null;b++}else Fi(n[$]),$--;else Fi(n[m]),m++;for(;b<=y;){const x=Fs(s,d[y+1]);Re(x,a[b]),d[b++]=x}for(;m<=$;){const x=n[m++];x!==null&&Fi(x)}return this.ut=r,In(s,d),Dt}}),oa=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),wl=s=>new Promise(t=>setTimeout(t,s)),Be=()=>{const s=oa(),t=oa();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+t.slice(1,4)+"-"+t.slice(4)},xl={helptextDropdownButton:{default:"Les mer <span class='pkt-sr-only'>om feltet</span>"},counter:{default:!1},optionalTag:{default:!1},optionalText:{default:"Valgfritt"},requiredTag:{default:!1},requiredText:{default:"Må fylles ut"},hasError:{default:!1},disabled:{default:!1},inline:{default:!1},hasFieldset:{default:!1},useWrapper:{default:!0}},Vt={props:xl};var Sl={},la;function Cl(){return la||(la=1,(function(){(function(s){const t=new WeakMap,e=new WeakMap,i=new WeakMap,n=new WeakMap,a=new WeakMap,r=new WeakMap,h=new WeakMap,d=new WeakMap,u=new WeakMap,g=new WeakMap,m=new WeakMap,$=new WeakMap,b=new WeakMap,y=new WeakMap,x=new WeakMap,T={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDescription:"aria-description",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"},S=(f,p)=>{for(let v in T){p[v]=null;let w=null;const B=T[v];Object.defineProperty(p,v,{get(){return w},set(U){w=U,f.isConnected?kt(f,B,U):g.set(f,p)}})}};function A(f){const p=n.get(f),{form:v}=p;ce(f,v,p),ke(f,p.labels)}const I=(f,p=!1)=>{const v=document.createTreeWalker(f,NodeFilter.SHOW_ELEMENT,{acceptNode(U){return n.has(U)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let w=v.nextNode();const B=!p||f.disabled;for(;w;)w.formDisabledCallback&&B&&Yt(w,f.disabled),w=v.nextNode()},O={attributes:!0,attributeFilter:["disabled","name"]},K=ee()?new MutationObserver(f=>{for(const p of f){const v=p.target;if(p.attributeName==="disabled"&&(v.constructor.formAssociated?Yt(v,v.hasAttribute("disabled")):v.localName==="fieldset"&&I(v)),p.attributeName==="name"&&v.constructor.formAssociated){const w=n.get(v),B=u.get(v);w.setFormValue(B)}}}):{};function et(f){f.forEach(p=>{const{addedNodes:v,removedNodes:w}=p,B=Array.from(v),U=Array.from(w);B.forEach(z=>{var Gt;if(n.has(z)&&z.constructor.formAssociated&&A(z),g.has(z)){const St=g.get(z);Object.keys(T).filter(Zt=>St[Zt]!==null).forEach(Zt=>{kt(z,T[Zt],St[Zt])}),g.delete(z)}if(x.has(z)){const St=x.get(z);kt(z,"internals-valid",St.validity.valid.toString()),kt(z,"internals-invalid",(!St.validity.valid).toString()),kt(z,"aria-invalid",(!St.validity.valid).toString()),x.delete(z)}if(z.localName==="form"){const St=d.get(z),Zt=document.createTreeWalker(z,NodeFilter.SHOW_ELEMENT,{acceptNode(rn){return n.has(rn)&&rn.constructor.formAssociated&&!(St&&St.has(rn))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let ri=Zt.nextNode();for(;ri;)A(ri),ri=Zt.nextNode()}z.localName==="fieldset"&&((Gt=K.observe)===null||Gt===void 0||Gt.call(K,z,O),I(z,!0))}),U.forEach(z=>{const Gt=n.get(z);Gt&&i.get(Gt)&&Nt(Gt),h.has(z)&&h.get(z).disconnect()})})}function Ot(f){f.forEach(p=>{const{removedNodes:v}=p;v.forEach(w=>{const B=b.get(p.target);n.has(w)&&Te(w),B.disconnect()})})}const Et=f=>{var p,v;const w=new MutationObserver(Ot);!((p=window==null?void 0:window.ShadyDOM)===null||p===void 0)&&p.inUse&&f.mode&&f.host&&(f=f.host),(v=w.observe)===null||v===void 0||v.call(w,f,{childList:!0}),b.set(f,w)};ee()&&new MutationObserver(et);const it={childList:!0,subtree:!0},kt=(f,p,v)=>{f.getAttribute(p)!==v&&f.setAttribute(p,v)},Yt=(f,p)=>{f.toggleAttribute("internals-disabled",p),p?kt(f,"aria-disabled","true"):f.removeAttribute("aria-disabled"),f.formDisabledCallback&&f.formDisabledCallback.apply(f,[p])},Nt=f=>{i.get(f).forEach(p=>{p.remove()}),i.set(f,[])},ct=(f,p)=>{const v=document.createElement("input");return v.type="hidden",v.name=f.getAttribute("name"),f.after(v),i.get(p).push(v),v},de=(f,p)=>{var v;i.set(p,[]),(v=K.observe)===null||v===void 0||v.call(K,f,O)},ke=(f,p)=>{if(p.length){Array.from(p).forEach(w=>w.addEventListener("click",f.click.bind(f)));let v=p[0].id;p[0].id||(v=`${p[0].htmlFor}_Label`,p[0].id=v),kt(f,"aria-labelledby",v)}},V=f=>{const p=Array.from(f.elements).filter(U=>!U.tagName.includes("-")&&U.validity).map(U=>U.validity.valid),v=d.get(f)||[],w=Array.from(v).filter(U=>U.isConnected).map(U=>n.get(U).validity.valid),B=[...p,...w].includes(!1);f.toggleAttribute("internals-invalid",B),f.toggleAttribute("internals-valid",!B)},xt=f=>{V(jt(f.target))},te=f=>{V(jt(f.target))},Se=f=>{const p=["button[type=submit]","input[type=submit]","button:not([type])"].map(v=>`${v}:not([disabled])`).map(v=>`${v}:not([form])${f.id?`,${v}[form='${f.id}']`:""}`).join(",");f.addEventListener("click",v=>{if(v.target.closest(p)){const w=d.get(f);if(f.noValidate)return;w.size&&Array.from(w).reverse().map(B=>n.get(B).reportValidity()).includes(!1)&&v.preventDefault()}})},ye=f=>{const p=d.get(f.target);p&&p.size&&p.forEach(v=>{v.constructor.formAssociated&&v.formResetCallback&&v.formResetCallback.apply(v)})},ce=(f,p,v)=>{if(p){const w=d.get(p);if(w)w.add(f);else{const B=new Set;B.add(f),d.set(p,B),Se(p),p.addEventListener("reset",ye),p.addEventListener("input",xt),p.addEventListener("change",te)}r.set(p,{ref:f,internals:v}),f.constructor.formAssociated&&f.formAssociatedCallback&&setTimeout(()=>{f.formAssociatedCallback.apply(f,[p])},0),V(p)}},jt=f=>{let p=f.parentNode;return p&&p.tagName!=="FORM"&&(p=jt(p)),p},pt=(f,p,v=DOMException)=>{if(!f.constructor.formAssociated)throw new v(p)},Ce=(f,p,v)=>{const w=d.get(f);return w&&w.size&&w.forEach(B=>{n.get(B)[v]()||(p=!1)}),p},Te=f=>{if(f.constructor.formAssociated){const p=n.get(f),{labels:v,form:w}=p;ke(f,v),ce(f,w,p)}};function ee(){return typeof MutationObserver<"u"}class Ns{constructor(){this.badInput=!1,this.customError=!1,this.patternMismatch=!1,this.rangeOverflow=!1,this.rangeUnderflow=!1,this.stepMismatch=!1,this.tooLong=!1,this.tooShort=!1,this.typeMismatch=!1,this.valid=!0,this.valueMissing=!1,Object.seal(this)}}const He=f=>(f.badInput=!1,f.customError=!1,f.patternMismatch=!1,f.rangeOverflow=!1,f.rangeUnderflow=!1,f.stepMismatch=!1,f.tooLong=!1,f.tooShort=!1,f.typeMismatch=!1,f.valid=!0,f.valueMissing=!1,f),rs=(f,p,v)=>(f.valid=os(p),Object.keys(p).forEach(w=>f[w]=p[w]),v&&V(v),f),os=f=>{let p=!0;for(let v in f)v!=="valid"&&f[v]!==!1&&(p=!1);return p},Ee=new WeakMap;function se(f,p){f.toggleAttribute(p,!0),f.part&&f.part.add(p)}class Ne extends Set{static get isPolyfilled(){return!0}constructor(p){if(super(),!p||!p.tagName||p.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");Ee.set(this,p)}add(p){if(!/^--/.test(p)||typeof p!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${p} must start with '--'.`);const v=super.add(p),w=Ee.get(this),B=`state${p}`;return w.isConnected?se(w,B):setTimeout(()=>{se(w,B)}),v}clear(){for(let[p]of this.entries())this.delete(p);super.clear()}delete(p){const v=super.delete(p),w=Ee.get(this);return w.isConnected?(w.toggleAttribute(`state${p}`,!1),w.part&&w.part.remove(`state${p}`)):setTimeout(()=>{w.toggleAttribute(`state${p}`,!1),w.part&&w.part.remove(`state${p}`)}),v}}function ls(f,p,v,w){if(typeof p=="function"?f!==p||!w:!p.has(f))throw new TypeError("Cannot read private member from an object whose class did not declare it");return v==="m"?w:v==="a"?w.call(f):w?w.value:p.get(f)}function Mt(f,p,v,w,B){if(typeof p=="function"?f!==p||!0:!p.has(f))throw new TypeError("Cannot write private member to an object whose class did not declare it");return p.set(f,v),v}var yt;class Ms{constructor(p){yt.set(this,void 0),Mt(this,yt,p);for(let v=0;v<p.length;v++){let w=p[v];this[v]=w,w.hasAttribute("name")&&(this[w.getAttribute("name")]=w)}Object.freeze(this)}get length(){return ls(this,yt,"f").length}[(yt=new WeakMap,Symbol.iterator)](){return ls(this,yt,"f")[Symbol.iterator]()}item(p){return this[p]==null?null:this[p]}namedItem(p){return this[p]==null?null:this[p]}}function Ve(){const f=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=v;const p=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=w;function v(...U){let z=f.apply(this,U);return Ce(this,z,"checkValidity")}function w(...U){let z=p.apply(this,U);return Ce(this,z,"reportValidity")}const{get:B}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...U){const z=B.call(this,...U),Gt=Array.from(d.get(this)||[]);if(Gt.length===0)return z;const St=Array.from(z).concat(Gt).sort((Zt,ri)=>Zt.compareDocumentPosition?Zt.compareDocumentPosition(ri)&2?1:-1:0);return new Ms(St)}})}class ni{static get isPolyfilled(){return!0}constructor(p){if(!p||!p.tagName||p.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const v=p.getRootNode(),w=new Ns;this.states=new Ne(p),t.set(this,p),e.set(this,w),n.set(p,this),S(p,this),de(p,this),Object.seal(this),v instanceof DocumentFragment&&Et(v)}checkValidity(){const p=t.get(this);if(pt(p,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const v=e.get(this);if(!v.valid){const w=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});p.dispatchEvent(w)}return v.valid}get form(){const p=t.get(this);pt(p,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let v;return p.constructor.formAssociated===!0&&(v=jt(p)),v}get labels(){const p=t.get(this);pt(p,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const v=p.getAttribute("id"),w=p.getRootNode();return w&&v?w.querySelectorAll(`[for="${v}"]`):[]}reportValidity(){const p=t.get(this);if(pt(p,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const v=this.checkValidity(),w=$.get(this);if(w&&!p.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!v&&w&&(p.focus(),w.focus()),v}setFormValue(p){const v=t.get(this);if(pt(v,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),Nt(this),p!=null&&!(p instanceof FormData)){if(v.getAttribute("name")){const w=ct(v,this);w.value=p}}else p!=null&&p instanceof FormData&&Array.from(p).reverse().forEach(([w,B])=>{if(typeof B=="string"){const U=ct(v,this);U.name=w,U.value=B}});u.set(v,p)}setValidity(p,v,w){const B=t.get(this);if(pt(B,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!p)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");$.set(this,w);const U=e.get(this),z={};for(const Zt in p)z[Zt]=p[Zt];Object.keys(z).length===0&&He(U);const Gt=Object.assign(Object.assign({},U),z);delete Gt.valid;const{valid:St}=rs(U,Gt,this.form);if(!St&&!v)throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");a.set(this,St?"":v),B.isConnected?(B.toggleAttribute("internals-invalid",!St),B.toggleAttribute("internals-valid",St),kt(B,"aria-invalid",`${!St}`)):x.set(B,this)}get shadowRoot(){const p=t.get(this);return m.get(p)||null}get validationMessage(){const p=t.get(this);return pt(p,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),a.get(this)}get validity(){const p=t.get(this);return pt(p,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),e.get(this)}get willValidate(){const p=t.get(this);return pt(p,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(p.disabled||p.hasAttribute("disabled")||p.hasAttribute("readonly"))}}function Ai(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class f extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const p=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(p,f);const v=new f;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(w=>w in v.internals)}let As=!1,ai=!1;function j(f){ai||(ai=!0,window.CustomStateSet=Ne,f&&(HTMLElement.prototype.attachInternals=function(...p){const v=f.call(this,p);return v.states=new Ne(this),v}))}function Pt(f=!0){if(!As){if(As=!0,typeof window<"u"&&(window.ElementInternals=ni),typeof CustomElementRegistry<"u"){const p=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(v,w,B){if(w.formAssociated){const U=w.prototype.connectedCallback;w.prototype.connectedCallback=function(){y.has(this)||(y.set(this,!0),this.hasAttribute("disabled")&&Yt(this,!0)),U!=null&&U.apply(this),Te(this)}}p.call(this,v,w,B)}}if(typeof HTMLElement<"u"&&(HTMLElement.prototype.attachInternals=function(){if(this.tagName){if(this.tagName.indexOf("-")===-1)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.")}else return{};if(n.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new ni(this)}),typeof Element<"u"){let p=function(...w){const B=v.apply(this,w);if(m.set(this,B),ee()){const U=new MutationObserver(et);window.ShadyDOM?U.observe(this,it):U.observe(B,it),h.set(this,U)}return B};const v=Element.prototype.attachShadow;Element.prototype.attachShadow=p}ee()&&typeof document<"u"&&new MutationObserver(et).observe(document.documentElement,it),typeof HTMLFormElement<"u"&&Ve(),(f||typeof window<"u"&&!window.CustomStateSet)&&j()}}return customElements.polyfillWrapFlushCallback||(Ai()?typeof window<"u"&&!window.CustomStateSet&&j(HTMLElement.prototype.attachInternals):Pt(!1)),s.forceCustomStateSetPolyfill=j,s.forceElementInternalsPolyfill=Pt,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})()),Sl}Cl();var Tl=Object.defineProperty,H=(s,t,e,i)=>{for(var n=void 0,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=r(t,e,n)||n);return n&&Tl(t,e,n),n};const El={fromAttribute(s){return s==null?!1:s===""||s==="true"||s===!0?!0:s==="false"||s===!1?!1:!!s},toAttribute(s){return s?"true":"false"}};let L=class extends R{constructor(){super(),this.defaultValue=null,this.disabled=!1,this.readonly=!1,this.required=!1,this.max=null,this.maxlength=null,this.min=null,this.minlength=null,this.step=null,this.ariaDescribedBy=null,this.ariaLabelledby=null,this.name="",this.pattern=null,this.placeholder=null,this.id=Be(),this.counter=!1,this.hasError=!1,this.inline=!1,this.hasFieldset=!1,this.optionalTag=!1,this.requiredTag=!1,this.skipForwardTestid=!1,this.useWrapper=!0,this.fullwidth=!1,this.counterMaxLength=0,this.errorMessage="",this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=Vt.props.helptextDropdownButton.default,this.label=null,this.optionalText=At.forms.labels.optional,this.requiredText=At.forms.labels.required,this.tagText=null,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(t){var e,i,n,a,r,h,d,u,g,m,$;t&&(this.required&&!this.value?this.internals.setValidity({valueMissing:!0},At.forms.messages.required,t):(e=t.validity)!=null&&e.typeMismatch||(i=t.validity)!=null&&i.badInput?this.internals.setValidity({typeMismatch:!0},At.forms.messages.invalid,t):(n=t.validity)!=null&&n.patternMismatch?this.internals.setValidity({patternMismatch:!0},At.forms.messages.invalidPattern,t):(a=t.validity)!=null&&a.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},At.forms.messages.tooShort,t):(r=t.validity)!=null&&r.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},At.forms.messages.tooLong,t):(h=t.validity)!=null&&h.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?At.forms.messages.rangeUnderflowMin.replace("{min}",(d=this.min)==null?void 0:d.toString()):At.forms.messages.rangeUnderflow,t):(u=t.validity)!=null&&u.stepMismatch?this.internals.setValidity({stepMismatch:!0},At.forms.messages.invalid,t):(g=t.validity)!=null&&g.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?At.forms.messages.rangeOverflowMax.replace("{max}",(m=this.max)==null?void 0:m.toString()):At.forms.messages.rangeOverflow,t):($=t.validity)!=null&&$.customError?this.internals.setValidity({customError:!0},t.validationMessage,t):this.internals.setValidity({}))}setFormValue(t){if(this.internals)if(Array.isArray(t)){const e=new FormData;t.forEach(i=>{e.append(this.name,i)}),this.internals.setFormValue(e)}else this.internals.setFormValue(t)}valueChecked(t){if(!this.touched)return;const e=this.internals.form||this.closest("form"),i=e?new FormData(e):null;e&&e.querySelectorAll(`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`).forEach(n=>{const a=n;a.name===this.name&&a.value!==this.value&&a.checked&&(a.checked=!1)}),typeof t=="string"?(this.checked=t==="true",this.internals.ariaChecked=t==="true"):typeof t=="boolean"&&(this.checked=t,this.internals.ariaChecked=t),this.checked?(this.internals.setFormValue(this.value||"on",this.value||"on"),i&&i.append(this.name,this.value||"on"),this.internals.states.add("--checked")):(this.internals.setFormValue(null,null),i&&i.delete(this.name),this.internals.states.delete("--checked")),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:this.checked,bubbles:!0,composed:!0})),this.internals.reportValidity()}valueChanged(t,e){(e!==this.value||e!==this._value)&&(typeof t=="string"?((this.multiple||this.range)&&t.includes(",")&&(t=t.split(",")),this.value=t,this._value=Array.isArray(t)?t:[t]):Array.isArray(t)?(this.value=this.multiple||this.range?t:t[0],this._value=t):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&e&&e.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(e==null?void 0:e.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate()))}clearInputValue(){const t=this.multiple||this.range?[]:"";this.value=t,this.internals.setFormValue(t),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0}))}onFocus(){this.dispatchEvent(new FocusEvent("focus",{bubbles:!0,composed:!0}))}onBlur(){this.dispatchEvent(new FocusEvent("blur",{bubbles:!0,composed:!0}))}onInput(){this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}onChange(t){if(!this.touched){this.touched=!0,t&&this.setFormValue(t);return}typeof t!="string"&&!Array.isArray(t)||((this.range||this.multiple)&&!Array.isArray(t)&&t.includes(",")&&(t=t.split(",")),!this.multiple&&!this.range&&Array.isArray(t)&&(t=t[0]),this.setFormValue(t),this.manageValidity(this.inputRef.value),this.inputRefTo&&this.manageValidity(this.inputRefTo.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0})))}formResetCallback(){this.touched=!1,this._options&&this._options.length&&this._options.forEach(t=>{"selected"in t&&(t.selected=!1)}),this.checked!==void 0?(this.checked=!1,this.internals.ariaChecked=!1,this.internals.setFormValue("",""),this.inputRef.value.checked=!1,this.valueChecked(this.checked)):(this.internals.setFormValue(""),this.value=this.defaultValue||(this.multiple||this.range?[]:""),this._value=this.value,this.valueChanged(this.value,null)),this.internals.ariaInvalid=!1}updated(t){super.updated(t),t.has("dataTestid")&&this.dataTestid&&this.inputRef.value&&(this.skipForwardTestid?this.hasAttribute("data-testid")||this.setAttribute("data-testid",this.dataTestid):(this.inputRef.value.dataset.testid=this.dataTestid,this.removeAttribute("data-testid")))}firstUpdated(t){if(super.firstUpdated(t),!this.form){const e=this.internals.form||this.closest("form");this.form=e}if(this.value&&this.defaultValue!==null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked=!0,this.checked=!0),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.ariaDisabled=!0),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const e=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=e,this.internals.setFormValue(e?this.value||"on":"",e?this.value||"on":"")}else this.internals.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute("form",""),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute("form",""),this.manageValidity(this.inputRefTo.value))}};H([o()],L.prototype,"defaultValue"),H([o({type:Boolean,reflect:!0})],L.prototype,"disabled"),H([o({type:Boolean,reflect:!0})],L.prototype,"readonly"),H([o({type:Boolean,reflect:!0})],L.prototype,"required"),H([o({type:Number,reflect:!0})],L.prototype,"max"),H([o({type:Number,reflect:!0})],L.prototype,"maxlength"),H([o({type:Number,reflect:!0})],L.prototype,"min"),H([o({type:Number,reflect:!0})],L.prototype,"minlength"),H([o({type:Number,reflect:!0})],L.prototype,"step"),H([o({type:String})],L.prototype,"ariaDescribedBy"),H([o({type:String})],L.prototype,"ariaLabelledby"),H([o({type:String,reflect:!0})],L.prototype,"name"),H([o({type:String,reflect:!0})],L.prototype,"pattern"),H([o({type:String,reflect:!0})],L.prototype,"placeholder"),H([o({type:String,reflect:!0})],L.prototype,"id"),H([o({type:Boolean})],L.prototype,"counter"),H([o({type:Boolean})],L.prototype,"hasError"),H([o({type:Boolean})],L.prototype,"inline"),H([o({type:Boolean})],L.prototype,"hasFieldset"),H([o({type:Boolean})],L.prototype,"optionalTag"),H([o({type:Boolean})],L.prototype,"requiredTag"),H([o({type:Boolean})],L.prototype,"skipForwardTestid"),H([o({type:Boolean,reflect:!0,converter:El})],L.prototype,"useWrapper"),H([o({type:Boolean,reflect:!0})],L.prototype,"fullwidth"),H([o({type:Number})],L.prototype,"counterMaxLength"),H([o({type:String})],L.prototype,"errorMessage"),H([o({type:String})],L.prototype,"helptext"),H([o({type:String})],L.prototype,"helptextDropdown"),H([o({type:String,reflect:!1})],L.prototype,"helptextDropdownButton"),H([o({type:String})],L.prototype,"label"),H([o({type:String,reflect:!1})],L.prototype,"optionalText"),H([o({type:String,reflect:!1})],L.prototype,"requiredText"),H([o({type:String,reflect:!1})],L.prototype,"tagText"),H([o({type:String,attribute:"data-testid"})],L.prototype,"dataTestid"),H([D()],L.prototype,"touched");let ha=class{constructor(t){this.nodes=[],this.options=[],this.host=t,this.host.addController(this),this.nodes=[],this.options=[],this.observer=new MutationObserver(e=>this.handleMutations(e))}hostConnected(){Array.from(this.host.childNodes).forEach(t=>{(t.nodeName==="OPTION"||t.nodeName==="DATA")&&this.addNode(t)}),this.observer.observe(this.host,{childList:!0,subtree:!1,attributes:!0})}hostDisconnected(){this.observer.disconnect()}addNode(t){(t.nodeName==="OPTION"||t.nodeName==="DATA")&&(t.hasAttribute("hidden")&&!t.hasAttribute("data-skip")&&t.setAttribute("data-hidden","true"),!t.hasAttribute("hidden")&&t.hasAttribute("data-skip")&&t.hasAttribute("data-hidden")&&t.removeAttribute("data-hidden"),t.setAttribute("class","pkt-hide"),t.setAttribute("data-skip","true"),t.setAttribute("hidden","true"),this.nodes.push(t))}createOptions(){this.options=this.nodes.map(t=>({value:t.hasAttribute("value")?t.getAttribute("value")??"":t.textContent??"",label:t.textContent||t.getAttribute("value")||"",selected:t.hasAttribute("selected"),disabled:t.hasAttribute("disabled"),hidden:t.hasAttribute("data-hidden")})),this.host.setAttribute("options",JSON.stringify(this.options))}handleMutations(t){let e=!1;t.forEach(i=>{i.type==="childList"&&(i.addedNodes.forEach(n=>{fs(n)&&(this.addNode(n),e=!0)}),i.removedNodes.forEach(n=>{fs(n)&&(this.nodes=this.nodes.filter(a=>a!==n),e=!0)})),i.type==="attributes"&&fs(i.target)&&(this.addNode(i.target),e=!0)}),e&&this.createOptions()}};var Nl=Object.defineProperty,Ml=Object.getOwnPropertyDescriptor,Je=(s,t,e,i)=>{for(var n=i>1?void 0:i?Ml(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Nl(t,e,n),n};let _e=class extends R{constructor(){super(),this.defaultSlot=N(),this.forId=Be(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=Vt.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new rt(this,this.defaultSlot)}updateSlots(t){this.filledSlots=new Set(t)}render(){const t=()=>{const n=!this.isHelpTextOpen;this.isHelpTextOpen=n,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:n}}))},e=E({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.filledSlots.size>0}),i=()=>this.helptextDropdown?c`<div class="pkt-inputwrapper__helptext-expandable">
|
|
437
437
|
<button
|
|
438
438
|
class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
|
|
439
439
|
type="button"
|
|
@@ -443,79 +443,79 @@
|
|
|
443
443
|
class="pkt-btn__icon"
|
|
444
444
|
name="${this.isHelpTextOpen?"chevron-thin-up":"chevron-thin-down"}"
|
|
445
445
|
></pkt-icon>
|
|
446
|
-
<span class="pkt-btn__text">${
|
|
446
|
+
<span class="pkt-btn__text">${bi(this.helptextDropdownButton)}</span>
|
|
447
447
|
</button>
|
|
448
448
|
<div
|
|
449
|
-
class="${
|
|
449
|
+
class="${E({"pkt-inputwrapper__helptext":!0,"pkt-inputwrapper__helptext-expandable-open":this.isHelpTextOpen,"pkt-inputwrapper__helptext-expandable-closed":!this.isHelpTextOpen})}"
|
|
450
450
|
>
|
|
451
|
-
${
|
|
451
|
+
${bi(this.helptextDropdown)}
|
|
452
452
|
</div>
|
|
453
|
-
</div
|
|
453
|
+
</div>`:k;return c`${c`<div class="${e}">
|
|
454
454
|
<div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
|
|
455
|
-
<div class="pkt-contents" ${
|
|
456
|
-
${this.helptext&&
|
|
455
|
+
<div class="pkt-contents" ${M(this.defaultSlot)} name="helptext"></div>
|
|
456
|
+
${this.helptext&&bi(this.helptext)}
|
|
457
457
|
</div>
|
|
458
458
|
${i()}
|
|
459
|
-
</div>`}`}};
|
|
460
|
-
${this.tagText?
|
|
461
|
-
${this.optionalTag?
|
|
462
|
-
${this.requiredTag?
|
|
463
|
-
`,
|
|
459
|
+
</div>`}`}};Je([o({type:String,reflect:!0})],_e.prototype,"forId",2),Je([o({type:String})],_e.prototype,"helptext",2),Je([o({type:String})],_e.prototype,"helptextDropdown",2),Je([o({type:String})],_e.prototype,"helptextDropdownButton",2),Je([D()],_e.prototype,"isHelpTextOpen",2),Je([D()],_e.prototype,"filledSlots",2),_e=Je([F("pkt-helptext")],_e);var Al=Object.defineProperty,Ol=Object.getOwnPropertyDescriptor,st=(s,t,e,i)=>{for(var n=i>1?void 0:i?Ol(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Al(t,e,n),n};const Pl={fromAttribute(s){return s==null?!1:s===""||s==="true"||s===!0?!0:s==="false"||s===!1?!1:!!s},toAttribute(s){return s?"true":"false"}};let tt=class extends R{constructor(){super(),this.defaultSlot=N(),this.helptextSlot=N(),this.forId=Be(),this.label="",this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=Vt.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.counterError=null,this.counterPosition="bottom",this.optionalTag=Vt.props.optionalTag.default,this.optionalText=Vt.props.optionalText.default,this.requiredTag=Vt.props.requiredTag.default,this.requiredText=Vt.props.requiredText.default,this.tagText=null,this.hasError=Vt.props.hasError.default,this.errorMessage="",this.disabled=Vt.props.disabled.default,this.inline=Vt.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=Vt.props.hasFieldset.default,this.role="group",this.useWrapper=Vt.props.useWrapper.default,this.slotController=new rt(this,this.defaultSlot,this.helptextSlot)}updated(t){super.updated(t)}render(){const t={"pkt-inputwrapper":!0,"pkt-inputwrapper--error":this.hasError,"pkt-inputwrapper--disabled":this.disabled,"pkt-inputwrapper--inline":this.inline},e="pkt-tag pkt-tag--small pkt-tag--thin-text",i=this.ariaDescribedby?this.ariaDescribedby:this.helptext?`${this.forId}-helptext`:k,n=()=>c`
|
|
460
|
+
${this.tagText?c`<span class=${e+" pkt-tag--gray"}>${this.tagText}</span>`:k}
|
|
461
|
+
${this.optionalTag?c`<span class=${e+" pkt-tag--blue-light"}>${this.optionalText}</span>`:k}
|
|
462
|
+
${this.requiredTag?c`<span class=${e+" pkt-tag--beige"}>${this.requiredText}</span>`:k}
|
|
463
|
+
`,a=()=>this.useWrapper?this.hasFieldset?c`<legend
|
|
464
464
|
class="pkt-inputwrapper__legend"
|
|
465
465
|
id="${this.forId}-label"
|
|
466
466
|
@click=${this.handleLabelClick}
|
|
467
467
|
>
|
|
468
|
-
${this.label} ${
|
|
469
|
-
</legend>`:
|
|
468
|
+
${this.label} ${n()}
|
|
469
|
+
</legend>`:c`<label
|
|
470
470
|
class="pkt-inputwrapper__label"
|
|
471
471
|
for="${this.forId}"
|
|
472
472
|
aria-describedby="${i}"
|
|
473
473
|
id="${this.forId}-label"
|
|
474
474
|
@click=${this.handleLabelClick}
|
|
475
|
-
>${this.label}${
|
|
476
|
-
>`:
|
|
475
|
+
>${this.label}${n()}</label
|
|
476
|
+
>`:c`<label
|
|
477
477
|
for="${this.forId}"
|
|
478
478
|
class="pkt-sr-only"
|
|
479
479
|
aria-describedby="${i}"
|
|
480
480
|
id="${this.forId}-label"
|
|
481
481
|
>
|
|
482
482
|
${this.label}
|
|
483
|
-
</label>`,r=()=>
|
|
483
|
+
</label>`,r=()=>c`
|
|
484
484
|
<pkt-helptext
|
|
485
|
-
class="${
|
|
485
|
+
class="${C(this.useWrapper?void 0:"pkt-hide")}"
|
|
486
486
|
.forId=${this.forId}
|
|
487
487
|
.helptext=${this.helptext}
|
|
488
488
|
.helptextDropdown=${this.helptextDropdown}
|
|
489
|
-
.helptextDropdownButton=${this.helptextDropdownButton||
|
|
490
|
-
@toggleHelpText=${
|
|
491
|
-
${
|
|
489
|
+
.helptextDropdownButton=${this.helptextDropdownButton||Vt.props.helptextDropdownButton.default}
|
|
490
|
+
@toggleHelpText=${m=>{this.toggleDropdown(m)}}
|
|
491
|
+
${M(this.helptextSlot)}
|
|
492
492
|
name="helptext"
|
|
493
493
|
></pkt-helptext>
|
|
494
|
-
`,h=()=>this.counter?
|
|
495
|
-
${this.counterError?this.counterError
|
|
496
|
-
${this.counterMaxLength?`/${this.counterMaxLength}
|
|
497
|
-
</div
|
|
494
|
+
`,h=()=>this.counter?c`<div class="pkt-input__counter" aria-live="polite" aria-atomic="true">
|
|
495
|
+
${this.counterError?this.counterError:k} ${this.counterCurrent||0}
|
|
496
|
+
${this.counterMaxLength?`/${this.counterMaxLength}`:k}
|
|
497
|
+
</div>`:k,d=()=>this.hasError&&this.errorMessage?c`<pkt-alert
|
|
498
498
|
skin="error"
|
|
499
499
|
compact
|
|
500
500
|
id=${`${this.forId}-error`}
|
|
501
501
|
aria-live="assertive"
|
|
502
502
|
aria-atomic="true"
|
|
503
503
|
>
|
|
504
|
-
${
|
|
505
|
-
</pkt-alert
|
|
506
|
-
${
|
|
504
|
+
${bi(this.errorMessage)}
|
|
505
|
+
</pkt-alert>`:k,u=()=>c`
|
|
506
|
+
${a()}
|
|
507
507
|
${r()}
|
|
508
|
-
${this.counterPosition==="top"?h()
|
|
509
|
-
<div class="pkt-contents" ${
|
|
510
|
-
${this.counterPosition==="bottom"?h()
|
|
508
|
+
${this.counterPosition==="top"?h():k}
|
|
509
|
+
<div class="pkt-contents" ${M(this.defaultSlot)}></div>
|
|
510
|
+
${this.counterPosition==="bottom"?h():k}
|
|
511
511
|
${d()}
|
|
512
|
-
`,
|
|
513
|
-
${
|
|
514
|
-
</fieldset>`:
|
|
512
|
+
`,g=()=>this.hasFieldset?c`<fieldset class="pkt-inputwrapper__fieldset" aria-describedby="${i}">
|
|
513
|
+
${u()}
|
|
514
|
+
</fieldset>`:c`<div class="pkt-inputwrapper__fieldset">${u()}</div>`;return c`<div class=${E(t)}>${g()}</div> `}toggleDropdown(t){this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!1,detail:{isOpen:t.detail.isOpen}}))}handleLabelClick(){this.dispatchEvent(new CustomEvent("labelClick",{bubbles:!0,composed:!0,detail:"label clicked"}))}};st([o({type:String})],tt.prototype,"forId",2),st([o({type:String})],tt.prototype,"label",2),st([o({type:String})],tt.prototype,"helptext",2),st([o({type:String})],tt.prototype,"helptextDropdown",2),st([o({type:String})],tt.prototype,"helptextDropdownButton",2),st([o({type:Boolean})],tt.prototype,"counter",2),st([o({type:Number})],tt.prototype,"counterCurrent",2),st([o({type:Number})],tt.prototype,"counterMaxLength",2),st([o({type:String})],tt.prototype,"counterError",2),st([o({type:String,reflect:!1})],tt.prototype,"counterPosition",2),st([o({type:Boolean})],tt.prototype,"optionalTag",2),st([o({type:String})],tt.prototype,"optionalText",2),st([o({type:Boolean})],tt.prototype,"requiredTag",2),st([o({type:String})],tt.prototype,"requiredText",2),st([o({type:String})],tt.prototype,"tagText",2),st([o({type:Boolean})],tt.prototype,"hasError",2),st([o({type:String})],tt.prototype,"errorMessage",2),st([o({type:Boolean})],tt.prototype,"disabled",2),st([o({type:Boolean})],tt.prototype,"inline",2),st([o({type:String})],tt.prototype,"ariaDescribedby",2),st([o({type:Boolean})],tt.prototype,"hasFieldset",2),st([o({type:String,reflect:!0})],tt.prototype,"role",2),st([o({type:Boolean,reflect:!0,converter:Pl})],tt.prototype,"useWrapper",2),tt=st([F("pkt-input-wrapper")],tt);var Dl=Object.defineProperty,Il=Object.getOwnPropertyDescriptor,Ct=(s,t,e,i)=>{for(var n=i>1?void 0:i?Il(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Dl(t,e,n),n};let _t=class extends R{constructor(){super(...arguments),this.id=Be(),this.label=null,this.options=[],this.isOpen=!1,this.disabled=!1,this.includeSearch=!1,this.isMultiSelect=!1,this.allowUserInput=!1,this.maxIsReached=!1,this.customUserInput=null,this.searchPlaceholder=null,this.searchValue=null,this.maxLength=0,this.userMessage=null,this._selectedOptions=0,this._filteredOptions=[]}connectedCallback(){super.connectedCallback(),this.includeSearch&&!this.searchValue&&(this.searchValue=""),this.options.length>0&&this.filterOptions(),this.setAttribute("tabindex","-1"),this.addEventListener("focus",this.focusFirstOrSelectedOption)}updated(t){(t.has("options")||t.has("searchValue"))&&this.filterOptions(),super.updated(t)}attributeChangedCallback(t,e,i){(t==="options"||t==="searchValue"||t==="search-value")&&this.filterOptions(),super.attributeChangedCallback(t,e,i)}render(){return c`
|
|
515
515
|
<div
|
|
516
|
-
class=${
|
|
516
|
+
class=${E({"pkt-listbox":!0,"pkt-listbox__open":this.isOpen,"pkt-txt-16-light":!0})}
|
|
517
517
|
role="listbox"
|
|
518
|
-
aria-label=${
|
|
518
|
+
aria-label=${C(this.label)}
|
|
519
519
|
>
|
|
520
520
|
<div class="pkt-listbox__banners">
|
|
521
521
|
${this.renderMaximumReachedBanner()} ${this.renderUserMessage()}
|
|
@@ -525,7 +525,7 @@
|
|
|
525
525
|
${this.renderList()}
|
|
526
526
|
</ul>
|
|
527
527
|
</div>
|
|
528
|
-
`}renderCheckboxOrCheckIcon(t,e){return this.isMultiSelect?
|
|
528
|
+
`}renderCheckboxOrCheckIcon(t,e){return this.isMultiSelect?c`
|
|
529
529
|
<input
|
|
530
530
|
class="pkt-input-check__input-checkbox"
|
|
531
531
|
type="checkbox"
|
|
@@ -536,13 +536,13 @@
|
|
|
536
536
|
aria-labelledby=${this.id+"-option-label-"+e}
|
|
537
537
|
?disabled=${this.disabled||t.disabled||this.maxIsReached&&!t.selected}
|
|
538
538
|
/>
|
|
539
|
-
`:t.selected?
|
|
540
|
-
${
|
|
539
|
+
`:t.selected?c`<pkt-icon name="check-big"></pkt-icon>`:k}renderList(){return c`
|
|
540
|
+
${Yi(this._filteredOptions,t=>t.value,(t,e)=>c`
|
|
541
541
|
<li
|
|
542
542
|
@click=${()=>{this.toggleOption(t)}}
|
|
543
543
|
aria-selected=${t.selected?"true":"false"}
|
|
544
544
|
@keydown=${this.handleOptionKeydown}
|
|
545
|
-
class=${
|
|
545
|
+
class=${E({"pkt-listbox__option":!0,"pkt-listbox__option--selected":!!(!this.isMultiSelect&&t.selected),"pkt-listbox__option--checkBox":this.isMultiSelect})}
|
|
546
546
|
tabindex="${this.disabled||t.disabled?"-1":"0"}"
|
|
547
547
|
data-index=${e}
|
|
548
548
|
data-value=${t.value}
|
|
@@ -553,15 +553,15 @@
|
|
|
553
553
|
>
|
|
554
554
|
${this.renderCheckboxOrCheckIcon(t,e)}
|
|
555
555
|
<span class="pkt-listbox__option-label" id=${this.id+"-option-label-"+e}>
|
|
556
|
-
${t.prefix?
|
|
556
|
+
${t.prefix?c`<span class="pkt-listbox__option-prefix">${t.prefix}</span>`:k}
|
|
557
557
|
${t.label||t.value}
|
|
558
558
|
</span>
|
|
559
|
-
${t.description?
|
|
559
|
+
${t.description?c`<span class="pkt-listbox__option-description pkt-txt-14-light"
|
|
560
560
|
>${t.description}</span
|
|
561
|
-
|
|
561
|
+
>`:k}
|
|
562
562
|
</li>
|
|
563
563
|
`)}
|
|
564
|
-
`}renderNewOptionBanner(){return this.allowUserInput&&this.customUserInput?
|
|
564
|
+
`}renderNewOptionBanner(){return this.allowUserInput&&this.customUserInput?c`
|
|
565
565
|
<div
|
|
566
566
|
class="pkt-listbox__banner pkt-listbox__banner--new-option pkt-listbox__option"
|
|
567
567
|
data-type="new-option"
|
|
@@ -574,18 +574,18 @@
|
|
|
574
574
|
<pkt-icon class="pkt-listbox__banner-icon" name="plus-sign" size="large"></pkt-icon>
|
|
575
575
|
Legg til “${this.customUserInput}”
|
|
576
576
|
</div>
|
|
577
|
-
|
|
577
|
+
`:k}renderMaximumReachedBanner(){return this._selectedOptions=this.options.filter(t=>t.selected).length,this.isMultiSelect&&this._selectedOptions>0&&this.maxLength>0?c`
|
|
578
578
|
<div class="pkt-listbox__banner pkt-listbox__banner--maximum-reached">
|
|
579
579
|
${this._selectedOptions} av maks ${this.maxLength} mulige er valgt.
|
|
580
580
|
</div>
|
|
581
|
-
|
|
581
|
+
`:k}renderUserMessage(){return this.userMessage?c`<div class="pkt-listbox__banner pkt-listbox__banner--user-message">
|
|
582
582
|
<pkt-icon
|
|
583
583
|
class="pkt-listbox__banner-icon"
|
|
584
584
|
name="exclamation-mark-circle"
|
|
585
585
|
size="large"
|
|
586
586
|
></pkt-icon>
|
|
587
587
|
${this.userMessage}
|
|
588
|
-
</div
|
|
588
|
+
</div>`:k}renderSearch(){return this.includeSearch?c`
|
|
589
589
|
<div class="pkt-listbox__search">
|
|
590
590
|
<span class="pkt-listbox__search-icon">
|
|
591
591
|
<pkt-icon name="magnifying-glass-small" size="large"></pkt-icon>
|
|
@@ -595,7 +595,7 @@
|
|
|
595
595
|
type="text"
|
|
596
596
|
aria-label="Søk i listen"
|
|
597
597
|
form=""
|
|
598
|
-
placeholder=${this.searchPlaceholder||
|
|
598
|
+
placeholder=${this.searchPlaceholder||At.forms.search.placeholder}
|
|
599
599
|
@input=${this.handleSearchInput}
|
|
600
600
|
@keydown=${this.handleSearchKeydown}
|
|
601
601
|
.value=${this.searchValue}
|
|
@@ -605,12 +605,12 @@
|
|
|
605
605
|
role="searchbox"
|
|
606
606
|
/>
|
|
607
607
|
</div>
|
|
608
|
-
|
|
608
|
+
`:k}handleSearchInput(t){this.searchValue=t.target.value,this.dispatchEvent(new CustomEvent("search",{detail:this.searchValue,bubbles:!1}))}handleSearchKeydown(t){switch(t.key){case"Enter":t.preventDefault();break;case"ArrowUp":case"Escape":this.closeOptions(),t.preventDefault();break;case"ArrowDown":case"Tab":this.focusFirstOrSelectedOption();break}}handleOptionKeydown(t){const e=t.currentTarget,i=e.dataset.value,n=e.dataset.type,a=e.dataset.selected==="true";if(!(!this.getOptionElements().length&&(!this.customUserInput||!this.allowUserInput&&this.customUserInput)&&n!=="new-option"&&n!=="searchbox"))switch(t.key){case" ":case"Enter":this.toggleOption(e),t.preventDefault();break;case"Backspace":i&&(a?this.toggleOption(e):this.closeOptions()),t.preventDefault();break;case"Escape":case"Tab":this.closeOptions();break;case"ArrowDown":t.altKey?this.focusLastOption():n==="searchbox"||n==="new-option"?this.focusFirstOption():this.focusNextOption(e),t.preventDefault();break;case"ArrowUp":if(t.altKey)this.focusFirstOption();else if(e.dataset.index==="0"&&this.includeSearch){const r=this.querySelector('[role="searchbox"]');r&&r.focus()}else if(e.dataset.index==="0"&&this.customUserInput){const r=this.querySelector('[data-type="new-option"]');r&&r.focus()}else this.focusPreviousOption(e);t.preventDefault();break;case"Home":this.focusFirstOption(),t.preventDefault();break;case"End":this.focusLastOption(),t.preventDefault();break;default:(t.metaKey||t.ctrlKey)&&t.key==="a"&&(this.selectAll(),t.preventDefault()),this.isLetterOrSpace(t.key)&&(this.handleTypeAhead(t.key),t.preventDefault());break}}focusAndScrollIntoView(t){t.scrollIntoView({block:"nearest"}),window.setTimeout(()=>t.focus(),0)}focusNextOption(t){const e=t.nextElementSibling;e&&this.focusAndScrollIntoView(e)}focusPreviousOption(t){const e=t.previousElementSibling;if(t.dataset.index==="0"&&this.includeSearch){const i=this.querySelector('[role="searchbox"]');i&&this.focusAndScrollIntoView(i)}else e&&this.focusAndScrollIntoView(e)}focusFirstOption(){const t=this.getOptionElements()[0];t&&this.focusAndScrollIntoView(t)}focusLastOption(){const t=this.getOptionElements().pop();t&&this.focusAndScrollIntoView(t)}focusFirstOrSelectedOption(){if(this.disabled)return;const t=this.getOptionElements().find(e=>e.dataset.selected==="true");if(this.allowUserInput&&this.customUserInput){const e=this.querySelector('[data-type="new-option"]');this.focusAndScrollIntoView(e)}else if(t)this.focusAndScrollIntoView(t);else if(this.includeSearch&&!(document.activeElement instanceof HTMLInputElement)){const e=this.querySelector('[role="searchbox"]');window.setTimeout(()=>e.focus(),0)}else this.focusFirstOption()}toggleOption(t){const e=t instanceof HTMLElement?t.dataset.disabled:t.disabled;if(this.disabled||e)return;const i=t instanceof HTMLElement?t.dataset.value:t.value;this.dispatchEvent(new CustomEvent("option-toggle",{detail:i,bubbles:!1}))}selectAll(){this.dispatchEvent(new CustomEvent("select-all",{bubbles:!1}))}closeOptions(){this.dispatchEvent(new CustomEvent("close-options",{bubbles:!1}))}filterOptions(){this.searchValue?this._filteredOptions=this.options.filter(t=>{var e;return(t.fulltext||t.label+t.value+(t.prefix||"")).toLowerCase().includes(((e=this.searchValue)==null?void 0:e.toLowerCase())||"")}):this._filteredOptions=[...this.options]}isLetterOrSpace(t){return/^[\p{L} ]$/u.test(t)}handleTypeAhead(t){this.typeAheadString+=t.toLowerCase(),this.typeAheadTimeout&&clearTimeout(this.typeAheadTimeout),this.typeAheadTimeout=window.setTimeout(()=>{this.typeAheadString=""},500);const e=this.getOptionElements().find(i=>{var n;return(n=i.textContent)==null?void 0:n.trim().toLowerCase().startsWith(this.typeAheadString)});e&&this.focusAndScrollIntoView(e)}getOptionElements(){return this._filteredOptions.length?Array.from(this.querySelectorAll('[role="option"]:not([data-disabled])')||[]):[]}};Ct([o({type:String})],_t.prototype,"id",2),Ct([o({type:String})],_t.prototype,"label",2),Ct([o({type:Array})],_t.prototype,"options",2),Ct([o({type:Boolean,reflect:!0})],_t.prototype,"isOpen",2),Ct([o({type:Boolean})],_t.prototype,"disabled",2),Ct([o({type:Boolean})],_t.prototype,"includeSearch",2),Ct([o({type:Boolean})],_t.prototype,"isMultiSelect",2),Ct([o({type:Boolean})],_t.prototype,"allowUserInput",2),Ct([o({type:Boolean})],_t.prototype,"maxIsReached",2),Ct([o({type:String})],_t.prototype,"customUserInput",2),Ct([o({type:String})],_t.prototype,"searchPlaceholder",2),Ct([o({type:String})],_t.prototype,"searchValue",2),Ct([o({type:Number})],_t.prototype,"maxLength",2),Ct([o({type:String})],_t.prototype,"userMessage",2),Ct([D()],_t.prototype,"_filteredOptions",2),_t=Ct([F("pkt-listbox")],_t);const Ll={displayValueAs:{default:"label"}},Bl={props:Ll};var Fl=Object.defineProperty,jl=Object.getOwnPropertyDescriptor,lt=(s,t,e,i)=>{for(var n=i>1?void 0:i?jl(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Fl(t,e,n),n};let nt=class extends L{constructor(){super(),this.helptextSlot=N(),this.value="",this.options=[],this.defaultOptions=[],this.allowUserInput=!1,this.typeahead=!1,this.includeSearch=!1,this.searchPlaceholder="",this.multiple=!1,this.maxlength=null,this.displayValueAs=Bl.props.displayValueAs.default,this.tagPlacement=null,this._options=[],this._isOptionsOpen=!1,this._value=[],this._userInfoMessage="",this._addValueText=null,this._maxIsReached=!1,this._search="",this._inputFocus=!1,this._editingSingleValue=!1,this.inputRef=N(),this.arrowRef=N(),this.listboxRef=N(),this.focusRef=N(),this.optionTagRef=N(),this.optionsController=new ha(this),this.slotController=new rt(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){var t;if(super.connectedCallback(),document&&document.body.addEventListener("click",e=>{this._isOptionsOpen&&!this.contains(e.target)&&this.handleFocusOut(e)}),this._options=[],this.defaultOptions&&this.defaultOptions.length){const e=((t=this.options)==null?void 0:t.filter(i=>i.userAdded))||[];this.options=[...e,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(this.optionsController.nodes.length){const e=[];this.optionsController.nodes.forEach(i=>{if(!i.textContent&&!i.getAttribute("value"))return null;const n={value:i.getAttribute("value")||i.textContent||"",label:i.textContent||i.getAttribute("value")||""};i.getAttribute("data-prefix")&&(n.prefix=i.getAttribute("data-prefix")||void 0),i.getAttribute("tagskincolor")&&(n.tagSkinColor=i.getAttribute("tagskincolor")),i.getAttribute("description")&&(n.description=i.getAttribute("description")||void 0),n.fulltext=n.value+n.label+(n.prefix||""),e.push(n)}),e.length&&(this.options=[...e],this._options=[...e])}}updated(t){if(t.has("_value")&&this.valueChanged(this._value,t.get("_value")),t.has("value")&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]]),this.isMaxItemsReached()),t.has("defaultOptions")&&this.defaultOptions.length){const e=(Array.isArray(this.options)?this.options:[]).filter(i=>i.userAdded)||[];this.options=[...e,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(t.has("options")){const e=(t.get("options")||this._options||[]).filter(n=>n&&n.userAdded).filter(n=>!(Array.isArray(this.options)?this.options:[]).some(a=>a.value===n.value)),i=[...e,...this.options];this._options=i,e.length>0&&(this.options=i),this._options.forEach(n=>{if(n.value&&!n.label&&(n.label=n.value),n.selected&&!this._value.includes(n.value)){const a=[...this._value];this._value=[...this._value,n.value],this.valueChanged(this._value,a)}n.fulltext=n.value+n.label+(n.prefix||""),n.selected=n.selected||this._value.includes(n.value)})}t.has("_search")&&this.dispatchEvent(new CustomEvent("search",{detail:this._search,bubbles:!1})),super.updated(t)}attributeChangedCallback(t,e,i){t==="value"&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]])),t==="options"&&(this._options=Array.isArray(this.options)?[...this.options]:[],this._options.forEach(n=>{n.value&&!n.label&&(n.label=n.value),n.selected&&!this._value.includes(n.value)&&(this._value=[...this._value,n.value]),n.fulltext=n.value+n.label+(n.prefix||"")}),this._search=""),super.attributeChangedCallback(t,e,i)}render(){return c`
|
|
609
609
|
<pkt-input-wrapper
|
|
610
610
|
.label=${this.label}
|
|
611
611
|
.helptext=${this.helptext}
|
|
612
|
-
.helptextDropdown=${
|
|
613
|
-
.helptextDropdownButton=${
|
|
612
|
+
.helptextDropdown=${C(this.helptextDropdown)}
|
|
613
|
+
.helptextDropdownButton=${C(this.helptextDropdownButton)}
|
|
614
614
|
?fullwidth=${this.fullwidth}
|
|
615
615
|
?hasError=${this.hasError}
|
|
616
616
|
?inline=${this.inline}
|
|
@@ -626,23 +626,23 @@
|
|
|
626
626
|
class="pkt-combobox__wrapper"
|
|
627
627
|
@labelClick=${this.handleInputClick}
|
|
628
628
|
>
|
|
629
|
-
<div class="pkt-contents" ${
|
|
629
|
+
<div class="pkt-contents" ${M(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
630
630
|
<div class="pkt-combobox" @focusout=${this.handleFocusOut}>
|
|
631
631
|
<div
|
|
632
|
-
class=${
|
|
632
|
+
class=${E({"pkt-combobox__input":!0,"pkt-combobox__input--fullwidth":this.fullwidth,"pkt-combobox__input--open":this._isOptionsOpen,"pkt-combobox__input--error":this.hasError,"pkt-combobox__input--disabled":this.disabled})}
|
|
633
633
|
tabindex="-1"
|
|
634
634
|
@click=${this.handleInputClick}
|
|
635
635
|
>
|
|
636
|
-
${this.placeholder&&(!this._value.length||this.multiple&&this.tagPlacement=="outside")&&!this._inputFocus?
|
|
636
|
+
${this.placeholder&&(!this._value.length||this.multiple&&this.tagPlacement=="outside")&&!this._inputFocus?c`<span class="pkt-combobox__placeholder" @click=${this.handlePlaceholderClick}
|
|
637
637
|
>${this.placeholder}</span
|
|
638
|
-
>`:this.tagPlacement!=="outside"?this.renderSingleOrMultipleValues()
|
|
638
|
+
>`:this.tagPlacement!=="outside"?this.renderSingleOrMultipleValues():k}
|
|
639
639
|
${this.renderInputField()}
|
|
640
640
|
<div
|
|
641
641
|
class="pkt-btn pkt-btn--tertiary pkt-combobox__arrow"
|
|
642
642
|
@click=${this.handleArrowClick}
|
|
643
643
|
@keydown=${this.handleArrowClick}
|
|
644
644
|
id="${this.id}-arrow"
|
|
645
|
-
${
|
|
645
|
+
${M(this.arrowRef)}
|
|
646
646
|
aria-expanded=${this._isOptionsOpen}
|
|
647
647
|
aria-controls="${this.id}-listbox"
|
|
648
648
|
aria-haspopup="listbox"
|
|
@@ -653,12 +653,12 @@
|
|
|
653
653
|
tabindex="${this.disabled?"-1":"0"}"
|
|
654
654
|
>
|
|
655
655
|
<pkt-icon
|
|
656
|
-
class=${
|
|
656
|
+
class=${E({"pkt-combobox__arrow-icon":!0,"pkt-combobox__arrow-icon--open":this._isOptionsOpen})}
|
|
657
657
|
name="chevron-thin-down"
|
|
658
658
|
></pkt-icon>
|
|
659
659
|
</div>
|
|
660
660
|
<div
|
|
661
|
-
${
|
|
661
|
+
${M(this.focusRef)}
|
|
662
662
|
tabindex="-1"
|
|
663
663
|
@keydown=${this.handleArrowClick}
|
|
664
664
|
class="pkt-contents"
|
|
@@ -675,7 +675,7 @@
|
|
|
675
675
|
?isMultiSelect=${this.multiple}
|
|
676
676
|
?allowUserInput=${this.allowUserInput&&!this._maxIsReached}
|
|
677
677
|
?maxIsReached=${this._maxIsReached}
|
|
678
|
-
.customUserInput=${
|
|
678
|
+
.customUserInput=${C(this._addValueText)}
|
|
679
679
|
.userMessage=${this._userInfoMessage}
|
|
680
680
|
@search=${this.handleSearch}
|
|
681
681
|
@option-toggle=${this.handleOptionToggled}
|
|
@@ -683,15 +683,15 @@
|
|
|
683
683
|
@close-options=${()=>this._isOptionsOpen=!1}
|
|
684
684
|
.searchValue=${this._search||null}
|
|
685
685
|
.maxLength=${this.maxlength||0}
|
|
686
|
-
${
|
|
686
|
+
${M(this.listboxRef)}
|
|
687
687
|
></pkt-listbox>
|
|
688
688
|
</div>
|
|
689
689
|
|
|
690
|
-
${this.tagPlacement==="outside"&&this.multiple?
|
|
690
|
+
${this.tagPlacement==="outside"&&this.multiple?c`<div class="pkt-combobox__tags-outside">
|
|
691
691
|
${this.renderSingleOrMultipleValues()}
|
|
692
|
-
</div
|
|
692
|
+
</div>`:k}
|
|
693
693
|
</pkt-input-wrapper>
|
|
694
|
-
`}renderInputField(){return this.typeahead||this.allowUserInput?
|
|
694
|
+
`}renderInputField(){return this.typeahead||this.allowUserInput?c`
|
|
695
695
|
<div class="pkt-combobox__input-div combobox__input">
|
|
696
696
|
<input
|
|
697
697
|
type="text"
|
|
@@ -703,66 +703,66 @@
|
|
|
703
703
|
@blur=${this.handleBlur}
|
|
704
704
|
autocomplete="off"
|
|
705
705
|
role="combobox"
|
|
706
|
-
aria-label=${
|
|
706
|
+
aria-label=${C(this.label)}
|
|
707
707
|
aria-autocomplete=${this.typeahead?"both":"list"}
|
|
708
708
|
aria-controls="${this.id}-listbox"
|
|
709
|
-
aria-multiselectable=${
|
|
710
|
-
aria-activedescendant=${
|
|
711
|
-
${
|
|
709
|
+
aria-multiselectable=${C(this.multiple?"true":void 0)}
|
|
710
|
+
aria-activedescendant=${C(this._value[0]&&this.findValueInOptions(this._value[0])?`${this.id}-listbox-${this.findIndexInOptions(this._value[0])}`:void 0)}
|
|
711
|
+
${M(this.inputRef)}
|
|
712
712
|
/>
|
|
713
713
|
</div>
|
|
714
|
-
`:
|
|
714
|
+
`:c`
|
|
715
715
|
<input
|
|
716
716
|
type="hidden"
|
|
717
717
|
id="${this.id}-input"
|
|
718
718
|
name=${(this.name||this.id)+"-input"}
|
|
719
719
|
.value=${this._value.join(",")}
|
|
720
|
-
${
|
|
720
|
+
${M(this.inputRef)}
|
|
721
721
|
/>
|
|
722
|
-
`}renderSingleOrMultipleValues(){const t=!this.multiple,e=this._editingSingleValue?null:this.renderValueTag(this.findValueInOptions(this._value[0])),i=
|
|
722
|
+
`}renderSingleOrMultipleValues(){const t=!this.multiple,e=this._editingSingleValue?null:this.renderValueTag(this.findValueInOptions(this._value[0])),i=Yi(this._value,n=>n,n=>{var a;const r=this.findValueInOptions(n),h=(a=this.options.find(d=>d.value===n))==null?void 0:a.tagSkinColor;return c`
|
|
723
723
|
<pkt-tag
|
|
724
724
|
skin=${h||"blue-dark"}
|
|
725
725
|
?closeTag=${!this.disabled}
|
|
726
|
-
@close=${()=>this.handleTagRemove(
|
|
726
|
+
@close=${()=>this.handleTagRemove(n)}
|
|
727
727
|
>
|
|
728
728
|
${this.renderValueTag(r)}
|
|
729
729
|
</pkt-tag>
|
|
730
|
-
`});return t?e:i}renderValueTag(t){if(!t)return"";switch(this.displayValueAs){case"prefixAndValue":return
|
|
730
|
+
`});return t?e:i}renderValueTag(t){if(!t)return"";switch(this.displayValueAs){case"prefixAndValue":return c`<span class="pkt-combobox__value" data-focusfix=${this.id}
|
|
731
731
|
>${t.prefix||""} ${t.value}</span
|
|
732
|
-
>`;case"value":return
|
|
732
|
+
>`;case"value":return c`<span class="pkt-combobox__value" data-focusfix=${this.id}
|
|
733
733
|
>${t.value}</span
|
|
734
|
-
>`;case"label":default:return
|
|
734
|
+
>`;case"label":default:return c`<span class="pkt-combobox__value" data-focusfix=${this.id}
|
|
735
735
|
>${t.label||t.value}</span
|
|
736
|
-
>`}}handleInput(t){if(t.stopPropagation(),t.stopImmediatePropagation(),this.disabled)return;this.touched=!0;const e=t.target;if(this._search=e.value,this.checkForMatches(),this.typeahead)if(this._search){if(this._options=this.options.filter(i=>{var a;return(a=i.fulltext)==null?void 0:a.toLowerCase().includes(this._search.toLowerCase())}),t.inputType!=="deleteContentBackward"){const i=this._options.filter(a=>{var n;return!a.selected&&((n=a.label)==null?void 0:n.toLowerCase().startsWith(this._search.toLowerCase()))});if(i.length>0&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const a=i[0];a!=null&&a.label&&(e.value=a.label,window.setTimeout(()=>e.setSelectionRange(this._search.length,e.value.length),0),e.selectionDirection="backward")}}}else this._options=[...this.options]}handleFocus(){if(!this.disabled){if(!this.multiple&&this._value[0]&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const t=this.findValueInOptions(this._value[0]);this._editingSingleValue=!0,this.inputRef.value.value=this.displayValueAs==="label"&&t!=null&&t.label?t.label:this._value[0]}this._inputFocus=!0,this._search="",this._options=[...this.options],this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()}}handleFocusOut(t){var e,i,a,n,r;if(!this.disabled&&((i=(e=t.relatedTarget)==null?void 0:e.closest("pkt-combobox"))==null?void 0:i.id)!==this.id&&((n=(a=t.relatedTarget)==null?void 0:a.closest("pkt-combobox"))==null?void 0:n.id)!==this.id&&((r=t.target)==null?void 0:r.getAttribute("data-focusfix"))!==this.id&&t.relatedTarget!==this.focusRef.value&&t.relatedTarget!==this.inputRef.value&&t.relatedTarget!==this.arrowRef.value&&this._isOptionsOpen){if(this._inputFocus=!1,this._addValueText=null,this._userInfoMessage="",this._search="",this.inputRef.value&&this.inputRef.value.type!=="hidden"&&this.inputRef.value.value!==""){const h=this.inputRef.value.value,d=this.findValueInOptions(h);!this._value.includes(h)&&!d?this.allowUserInput?this.addNewUserValue(h):this.multiple||this.removeValue(this._value[0]):d&&!this._value.includes(d.value)&&this.setSelected(d.value),this.inputRef.value.value=""}this._isOptionsOpen=!1,this.onBlur()}}handleBlur(){this._inputFocus=!1,this._editingSingleValue=!1,this.onBlur()}handleInputClick(t){var e,i;if(this.disabled){t.preventDefault(),t.stopImmediatePropagation();return}t.currentTarget&&t.currentTarget!==this.arrowRef.value&&((e=this.inputRef.value)==null?void 0:e.type)!=="hidden"?((i=this.inputRef.value)==null||i.focus(),this.requestUpdate()):this.handleArrowClick(t)}handlePlaceholderClick(t){this.disabled||(t.stopPropagation(),this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.focus(),this._inputFocus=!0,this.requestUpdate()))}handleArrowClick(t){var e,i;this.disabled||t instanceof KeyboardEvent&&t.key&&t.key!=="Enter"&&t.key!==" "&&t.key!=="ArrowDown"||(t.stopImmediatePropagation(),t.preventDefault(),this._isOptionsOpen=!this._isOptionsOpen,this._isOptionsOpen?(e=this.listboxRef.value)==null||e.focusFirstOrSelectedOption():(i=this.arrowRef.value)==null||i.focus())}handleOptionToggled(t){this.toggleValue(t.detail)}handleSearch(t){t.stopPropagation(),this._search=t.detail.toLowerCase()}handleInputKeydown(t){var e,i,a;switch(t.key){case",":this.multiple&&(t.preventDefault(),this.addValue());break;case"Enter":t.preventDefault(),this.addValue();break;case"Backspace":!this._search&&((e=this.inputRef.value)==null?void 0:e.type)==="hidden"&&this.removeLastValue(t);break;case"Tab":case"ArrowDown":t.shiftKey||((i=this.listboxRef.value)==null||i.focusFirstOrSelectedOption(),t.preventDefault());break;case"Escape":this._isOptionsOpen=!1,(a=this.arrowRef.value)==null||a.focus(),t.preventDefault();break}}handleTagRemove(t){this.removeSelected(t)}blurInput(){this.inputRef.value&&this.inputRef.value.matches(":focus")&&this.inputRef.value.blur()}checkForMatches(){var t;const e=((t=this.inputRef.value)==null?void 0:t.value)||this._search||"",i=e.trim().toLowerCase()||"";if(!i){!this.multiple&&this._value[0]&&this.removeValue(this._value[0]),this.resetComboboxInput(!1);return}const a=this._value.find(h=>h.toLowerCase()===i),n=this._options.filter(h=>{var d;return((d=h.label)==null?void 0:d.toLowerCase().includes(i))??!1}),r=n.find(h=>{var d;return((d=h.label)==null?void 0:d.toLowerCase())===i||h.value.toLowerCase()===i});switch(!0){case((n.length===0||!r)&&this.allowUserInput):this._addValueText=e,this._userInfoMessage="";break;case(n.length===0&&!this._options.length&&!this.allowUserInput):this._addValueText=null,this._userInfoMessage="Ingen match i søket";break;case!!a:this._addValueText=null,this._userInfoMessage="Verdien er allerede valgt";break;case n.length>1:this._addValueText=null,this._userInfoMessage="";break;default:this._addValueText=null,this._userInfoMessage=""}}findValueInOptions(t){return this.options.find(e=>e.value===t||e.label===t)||null}findIndexInOptions(t){return this._options.findIndex(e=>e.value===t||e.label===t)}isMaxItemsReached(){const t=this.maxlength!==null&&this._value.length>=this.maxlength;return t?this._maxIsReached=!0:this._maxIsReached=!1,t}toggleValue(t){var e,i;if(this.disabled)return;this.touched=!0,this._userInfoMessage="",this._addValueText=null;const a=((e=this.findValueInOptions(t))==null?void 0:e.value)||null,n=this._value.includes(t||a||""),r=!!a,h=((i=this._options.find(C=>C.value===t))==null?void 0:i.disabled)||!1,d=!(t!=null&&t.trim()),p=!this.multiple,f=this.multiple,g=this.isMaxItemsReached();let k=!1,b=!0,y="",w="";h||(!r&&this.allowUserInput&&!d?(this.addNewUserValue(t),y="Ny verdi lagt til",k=!f):!r&&!this.allowUserInput?(p&&this._value[0]&&this.removeValue(this._value[0]),b=!1,k=!0,y="Ingen treff i søket"):n?(this.removeValue(a),k=!0):d&&p?(this.removeAllSelected(),k=!0):p?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(a),k=!1,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="",this.inputRef.value.blur())):f&&!g?(this.setSelected(a),k=!0):f&&g?(this._userInfoMessage="Maks antall valg nådd",b=!1,w=t):(p&&this.removeAllSelected(),this._userInfoMessage="Ingen gyldig verdi valgt",b=!1,k=!0,w=t),this._isOptionsOpen=k,k||window.setTimeout(()=>{var C;(C=this.focusRef.value)==null||C.focus()},0),this._userInfoMessage=y,this._search=w||"",this.resetComboboxInput(b),f&&this.isMaxItemsReached())}setSelected(t){if(!this._value.includes(t)){if(this.multiple&&this.isMaxItemsReached()){this._userInfoMessage="Maks antall valg nådd";return}!this.multiple&&this.removeAllSelected(),this._value=t?[...this._value,t]:this._value,this._options=this._options.map(e=>(e.value===t&&(e.selected=!0),e)),this.resetComboboxInput(!0)}}removeSelected(t){if(!t)return;this._value=this._value.filter(i=>i!==t);const e=this.findValueInOptions(t);e?(e.selected=!1,e.userAdded?(this._options=[...this._options.filter(i=>i.value!==t)],this.options=[...this.options.filter(i=>i.value!==t)]):this._options=[...this._options,e]):!t&&!this.multiple&&(this._options=this._options.map(i=>(i.selected=!1,i)))}addAllOptions(){if(this.multiple){if(this.maxlength&&this._options.length>this.maxlength){this._userInfoMessage="For mange valgt";return}this._value=this._options.map(t=>t.value),this._options=this._options.map(t=>(t.selected=!0,t)),this.requestUpdate()}}removeAllSelected(){this._value=[],this._options=this._options.map(t=>(t.selected=!1,t)),this._options=this._options.filter(t=>!t.userAdded),this.requestUpdate()}addValue(){var t;const e=((t=this.inputRef.value)==null?void 0:t.value.trim())||"";this._search=e,this.toggleValue(e)}removeValue(t){this._value=this.multiple?this._value.filter(e=>e!==t):[],this.removeSelected(t)}addNewUserValue(t){if(!t||t.trim()==="")return;if(!this.multiple)this._value[0]&&this.removeSelected(this._value[0]),this._value=[t],this._isOptionsOpen=!1,this.blurInput();else if(!this.findValueInOptions(t)){if(this.isMaxItemsReached())return;this._value=[...this._value,t]}const e={value:t,label:t,userAdded:!0};this.options=[e,...this.options],this._options=[e,...this._options],this.setSelected(t),this.requestUpdate()}resetComboboxInput(t=!0){if(this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&t)if(this._search="",this.multiple)this.inputRef.value.value="";else{const e=this.findValueInOptions(this._value[0]);window.setTimeout(()=>{!this.inputRef.value||this.inputRef.value.type==="hidden"||(this.inputRef.value.value=this.displayValueAs==="label"&&e!=null&&e.label?e.label:this._value[0]||"")},0),this._userInfoMessage=""}this._options=[...this.options]}removeLastValue(t){if(this._value.length===0)return;t.preventDefault();const e=this._value[this._value.length-1];e&&this.removeSelected(e),this.isMaxItemsReached()}};et([o({type:String,reflect:!0})],tt.prototype,"value",2),et([o({type:Array})],tt.prototype,"options",2),et([o({type:Array})],tt.prototype,"defaultOptions",2),et([o({type:Boolean})],tt.prototype,"allowUserInput",2),et([o({type:Boolean})],tt.prototype,"typeahead",2),et([o({type:Boolean})],tt.prototype,"includeSearch",2),et([o({type:String})],tt.prototype,"searchPlaceholder",2),et([o({type:Boolean})],tt.prototype,"multiple",2),et([o({type:Number})],tt.prototype,"maxlength",2),et([o({type:String})],tt.prototype,"displayValueAs",2),et([o({type:String})],tt.prototype,"tagPlacement",2),et([V()],tt.prototype,"_options",2),et([V()],tt.prototype,"_isOptionsOpen",2),et([V()],tt.prototype,"_value",2),et([V()],tt.prototype,"_userInfoMessage",2),et([V()],tt.prototype,"_addValueText",2),et([V()],tt.prototype,"_maxIsReached",2),et([V()],tt.prototype,"_search",2),et([V()],tt.prototype,"_inputFocus",2),et([V()],tt.prototype,"_editingSingleValue",2),tt=et([j("pkt-combobox")],tt);const Nl={i18n:{nb:{contentPresentation:{title:"Oslo kommune bruker informasjonskapsler",description:["For at nettstedet skal fungere og være trygt, bruker Oslo kommune informasjonskapsler. Noen er teknisk nødvendige, mens andre sikrer ulik funksjonalitet.","Godtar du alle informasjonskapsler, tillater du også at vi samler inn data om statistikk og brukeradferd. Da hjelper du oss med å lage et bedre nettsted uten at du trenger å dele noe personlig informasjon med oss."],buttons:{accept:"Godta alle",reject:"Kun nødvendige",settings:"Innstillinger for informasjonskapsler"}},contentSettings:{title:"Innstillinger for informasjonskapsler",description:["Her kan du velge hvilke typer informasjonskapsler du vil tillate. Tillatelsen gjelder i 90 dager. Husk at nødvendige informasjonskapsler ikke kan velges bort.","Du kan når som helst endre innstillingene og finne mer informasjon nederst på nettstedet under «Innstillinger for informasjonskapsler» og «Personvern og informasjonskapsler»."],buttons:{back:"Tilbake",save:"Lagre innstillinger"}}},en:{contentPresentation:{title:"Before you visit Oslo kommune ...",description:["This website uses cookies to make improvements. In this context, we need your consent to measure the traffic on the website in relation to statistics and feedback.","To read more about what we use cookies for, go to our privacy declaration which you will find at the bottom of our websites."],buttons:{accept:"Yes, I accept",reject:"Only necessary",settings:"Go to settings"}},contentSettings:{title:"Her kan du aktivt velge mellom ulike informasjonskapsler",description:["For å lese mer om hva vi bruker informasjonskapsler til gå til vår personvernserklering som du finner på våre nettsider"],buttons:{back:"Back",save:"Save settings"}}}}};var Al=Object.defineProperty,El=Object.getOwnPropertyDescriptor,ee=(s,t,e,i)=>{for(var a=i>1?void 0:i?El(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Al(t,e,a),a};let Mi=null;function Ml(){return Mi||(Mi=new Promise((s,t)=>{if(document.querySelector("#oslo-consent-script")){s();return}const e=document.createElement("script");e.src="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.js",e.id="oslo-consent-script",e.onload=()=>s(),e.onerror=t,document.head.appendChild(e);const i=document.createElement("link");i.href="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.css",i.type="text/css",i.rel="stylesheet",i.id="oslo-consent-styles",document.head.appendChild(i)}),Mi)}let Ut=class extends Y{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||Nl.i18n[this.i18nLanguage].contentPresentation.buttons.settings}disconnectedCallback(){var t;super.disconnectedCallback(),this._cookieEventHandler&&((t=window.__cookieEvents)==null||t.off("CookieManager.setCookie",this._cookieEventHandler))}returnJsonOrObject(t){let e;try{e=JSON.parse(t)}catch{e=t}return e}emitCookieConsents(t){const e=this.returnJsonOrObject(t.value).items.reduce((i,a)=>(i[a.name]=a.consent,i),{});this.dispatchEvent(new CustomEvent("toggle-consent",{detail:e,bubbles:!0,cancelable:!1}))}async firstUpdated(t){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 Ml(),this.triggerInit()}triggerInit(){window.document.dispatchEvent(new Event("CookieBannerReady",{bubbles:!0,cancelable:!0})),window.cookieBanner.cookieConsent.validateConsentCookie().then(t=>{if(t){const e={value:window.cookieBanner.cookieConsent.getConsentCookie()};window.setTimeout(()=>this.emitCookieConsents(e),0),this._cookieEventHandler&&window.__cookieEvents.off("CookieManager.setCookie",this._cookieEventHandler),this._cookieEventHandler=i=>{this.emitCookieConsents(i)},window.__cookieEvents.on("CookieManager.setCookie",this._cookieEventHandler)}})}openModal(t){var e;t.preventDefault(),(e=window.cookieBanner)!=null&&e.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner.openCookieModal())}render(){return this.triggerType==="link"?u`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?u`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
|
|
736
|
+
>`}}handleInput(t){if(t.stopPropagation(),t.stopImmediatePropagation(),this.disabled)return;this.touched=!0;const e=t.target;if(this._search=e.value,this.checkForMatches(),this.typeahead)if(this._search){if(this._options=this.options.filter(i=>{var n;return(n=i.fulltext)==null?void 0:n.toLowerCase().includes(this._search.toLowerCase())}),t.inputType!=="deleteContentBackward"){const i=this._options.filter(n=>{var a;return!n.selected&&((a=n.label)==null?void 0:a.toLowerCase().startsWith(this._search.toLowerCase()))});if(i.length>0&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const n=i[0];n!=null&&n.label&&(e.value=n.label,window.setTimeout(()=>e.setSelectionRange(this._search.length,e.value.length),0),e.selectionDirection="backward")}}}else this._options=[...this.options]}handleFocus(){if(!this.disabled){if(!this.multiple&&this._value[0]&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const t=this.findValueInOptions(this._value[0]);this._editingSingleValue=!0,this.inputRef.value.value=this.displayValueAs==="label"&&t!=null&&t.label?t.label:this._value[0]}this._inputFocus=!0,this._search="",this._options=[...this.options],this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()}}handleFocusOut(t){var e,i,n,a,r;if(!this.disabled&&((i=(e=t.relatedTarget)==null?void 0:e.closest("pkt-combobox"))==null?void 0:i.id)!==this.id&&((a=(n=t.relatedTarget)==null?void 0:n.closest("pkt-combobox"))==null?void 0:a.id)!==this.id&&((r=t.target)==null?void 0:r.getAttribute("data-focusfix"))!==this.id&&t.relatedTarget!==this.focusRef.value&&t.relatedTarget!==this.inputRef.value&&t.relatedTarget!==this.arrowRef.value&&this._isOptionsOpen){if(this._inputFocus=!1,this._addValueText=null,this._userInfoMessage="",this._search="",this.inputRef.value&&this.inputRef.value.type!=="hidden"&&this.inputRef.value.value!==""){const h=this.inputRef.value.value,d=this.findValueInOptions(h);!this._value.includes(h)&&!d?this.allowUserInput?this.addNewUserValue(h):this.multiple||this.removeValue(this._value[0]):d&&!this._value.includes(d.value)&&this.setSelected(d.value),this.inputRef.value.value=""}this._isOptionsOpen=!1,this.onBlur()}}handleBlur(){this._inputFocus=!1,this._editingSingleValue=!1,this.onBlur()}handleInputClick(t){var e,i;if(this.disabled){t.preventDefault(),t.stopImmediatePropagation();return}t.currentTarget&&t.currentTarget!==this.arrowRef.value&&((e=this.inputRef.value)==null?void 0:e.type)!=="hidden"?((i=this.inputRef.value)==null||i.focus(),this.requestUpdate()):this.handleArrowClick(t)}handlePlaceholderClick(t){this.disabled||(t.stopPropagation(),this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.focus(),this._inputFocus=!0,this.requestUpdate()))}handleArrowClick(t){var e,i;this.disabled||t instanceof KeyboardEvent&&t.key&&t.key!=="Enter"&&t.key!==" "&&t.key!=="ArrowDown"||(t.stopImmediatePropagation(),t.preventDefault(),this._isOptionsOpen=!this._isOptionsOpen,this._isOptionsOpen?(e=this.listboxRef.value)==null||e.focusFirstOrSelectedOption():(i=this.arrowRef.value)==null||i.focus())}handleOptionToggled(t){this.toggleValue(t.detail)}handleSearch(t){t.stopPropagation(),this._search=t.detail.toLowerCase()}handleInputKeydown(t){var e,i,n;switch(t.key){case",":this.multiple&&(t.preventDefault(),this.addValue());break;case"Enter":t.preventDefault(),this.addValue();break;case"Backspace":!this._search&&((e=this.inputRef.value)==null?void 0:e.type)==="hidden"&&this.removeLastValue(t);break;case"Tab":case"ArrowDown":t.shiftKey||((i=this.listboxRef.value)==null||i.focusFirstOrSelectedOption(),t.preventDefault());break;case"Escape":this._isOptionsOpen=!1,(n=this.arrowRef.value)==null||n.focus(),t.preventDefault();break}}handleTagRemove(t){this.removeSelected(t)}blurInput(){this.inputRef.value&&this.inputRef.value.matches(":focus")&&this.inputRef.value.blur()}checkForMatches(){var t;const e=((t=this.inputRef.value)==null?void 0:t.value)||this._search||"",i=e.trim().toLowerCase()||"";if(!i){!this.multiple&&this._value[0]&&this.removeValue(this._value[0]),this.resetComboboxInput(!1);return}const n=this._value.find(h=>h.toLowerCase()===i),a=this._options.filter(h=>{var d;return((d=h.label)==null?void 0:d.toLowerCase().includes(i))??!1}),r=a.find(h=>{var d;return((d=h.label)==null?void 0:d.toLowerCase())===i||h.value.toLowerCase()===i});switch(!0){case((a.length===0||!r)&&this.allowUserInput):this._addValueText=e,this._userInfoMessage="";break;case(a.length===0&&!this._options.length&&!this.allowUserInput):this._addValueText=null,this._userInfoMessage="Ingen match i søket";break;case!!n:this._addValueText=null,this._userInfoMessage="Verdien er allerede valgt";break;case a.length>1:this._addValueText=null,this._userInfoMessage="";break;default:this._addValueText=null,this._userInfoMessage=""}}findValueInOptions(t){return this.options.find(e=>e.value===t||e.label===t)||null}findIndexInOptions(t){return this._options.findIndex(e=>e.value===t||e.label===t)}isMaxItemsReached(){const t=this.maxlength!==null&&this._value.length>=this.maxlength;return t?this._maxIsReached=!0:this._maxIsReached=!1,t}toggleValue(t){var e,i;if(this.disabled)return;this.touched=!0,this._userInfoMessage="",this._addValueText=null;const n=((e=this.findValueInOptions(t))==null?void 0:e.value)||null,a=this._value.includes(t||n||""),r=!!n,h=((i=this._options.find(T=>T.value===t))==null?void 0:i.disabled)||!1,d=!(t!=null&&t.trim()),u=!this.multiple,g=this.multiple,m=this.isMaxItemsReached();let $=!1,b=!0,y="",x="";h||(!r&&this.allowUserInput&&!d?(this.addNewUserValue(t),y="Ny verdi lagt til",$=!g):!r&&!this.allowUserInput?(u&&this._value[0]&&this.removeValue(this._value[0]),b=!1,$=!0,y="Ingen treff i søket"):a?(this.removeValue(n),$=!0):d&&u?(this.removeAllSelected(),$=!0):u?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(n),$=!1,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="",this.inputRef.value.blur())):g&&!m?(this.setSelected(n),$=!0):g&&m?(this._userInfoMessage="Maks antall valg nådd",b=!1,x=t):(u&&this.removeAllSelected(),this._userInfoMessage="Ingen gyldig verdi valgt",b=!1,$=!0,x=t),this._isOptionsOpen=$,$||window.setTimeout(()=>{var T;(T=this.focusRef.value)==null||T.focus()},0),this._userInfoMessage=y,this._search=x||"",this.resetComboboxInput(b),g&&this.isMaxItemsReached())}setSelected(t){if(!this._value.includes(t)){if(this.multiple&&this.isMaxItemsReached()){this._userInfoMessage="Maks antall valg nådd";return}!this.multiple&&this.removeAllSelected(),this._value=t?[...this._value,t]:this._value,this._options=this._options.map(e=>(e.value===t&&(e.selected=!0),e)),this.resetComboboxInput(!0)}}removeSelected(t){if(!t)return;this._value=this._value.filter(i=>i!==t);const e=this.findValueInOptions(t);e?(e.selected=!1,e.userAdded?(this._options=[...this._options.filter(i=>i.value!==t)],this.options=[...this.options.filter(i=>i.value!==t)]):this._options=[...this._options,e]):!t&&!this.multiple&&(this._options=this._options.map(i=>(i.selected=!1,i)))}addAllOptions(){if(this.multiple){if(this.maxlength&&this._options.length>this.maxlength){this._userInfoMessage="For mange valgt";return}this._value=this._options.map(t=>t.value),this._options=this._options.map(t=>(t.selected=!0,t)),this.requestUpdate()}}removeAllSelected(){this._value=[],this._options=this._options.map(t=>(t.selected=!1,t)),this._options=this._options.filter(t=>!t.userAdded),this.requestUpdate()}addValue(){var t;const e=((t=this.inputRef.value)==null?void 0:t.value.trim())||"";this._search=e,this.toggleValue(e)}removeValue(t){this._value=this.multiple?this._value.filter(e=>e!==t):[],this.removeSelected(t)}addNewUserValue(t){if(!t||t.trim()==="")return;if(!this.multiple)this._value[0]&&this.removeSelected(this._value[0]),this._value=[t],this._isOptionsOpen=!1,this.blurInput();else if(!this.findValueInOptions(t)){if(this.isMaxItemsReached())return;this._value=[...this._value,t]}const e={value:t,label:t,userAdded:!0};this.options=[e,...this.options],this._options=[e,...this._options],this.setSelected(t),this.requestUpdate()}resetComboboxInput(t=!0){if(this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&t)if(this._search="",this.multiple)this.inputRef.value.value="";else{const e=this.findValueInOptions(this._value[0]);window.setTimeout(()=>{!this.inputRef.value||this.inputRef.value.type==="hidden"||(this.inputRef.value.value=this.displayValueAs==="label"&&e!=null&&e.label?e.label:this._value[0]||"")},0),this._userInfoMessage=""}this._options=[...this.options]}removeLastValue(t){if(this._value.length===0)return;t.preventDefault();const e=this._value[this._value.length-1];e&&this.removeSelected(e),this.isMaxItemsReached()}};lt([o({type:String,reflect:!0})],nt.prototype,"value",2),lt([o({type:Array})],nt.prototype,"options",2),lt([o({type:Array})],nt.prototype,"defaultOptions",2),lt([o({type:Boolean})],nt.prototype,"allowUserInput",2),lt([o({type:Boolean})],nt.prototype,"typeahead",2),lt([o({type:Boolean})],nt.prototype,"includeSearch",2),lt([o({type:String})],nt.prototype,"searchPlaceholder",2),lt([o({type:Boolean})],nt.prototype,"multiple",2),lt([o({type:Number})],nt.prototype,"maxlength",2),lt([o({type:String})],nt.prototype,"displayValueAs",2),lt([o({type:String})],nt.prototype,"tagPlacement",2),lt([D()],nt.prototype,"_options",2),lt([D()],nt.prototype,"_isOptionsOpen",2),lt([D()],nt.prototype,"_value",2),lt([D()],nt.prototype,"_userInfoMessage",2),lt([D()],nt.prototype,"_addValueText",2),lt([D()],nt.prototype,"_maxIsReached",2),lt([D()],nt.prototype,"_search",2),lt([D()],nt.prototype,"_inputFocus",2),lt([D()],nt.prototype,"_editingSingleValue",2),nt=lt([F("pkt-combobox")],nt);const Hl={i18n:{nb:{contentPresentation:{title:"Oslo kommune bruker informasjonskapsler",description:["For at nettstedet skal fungere og være trygt, bruker Oslo kommune informasjonskapsler. Noen er teknisk nødvendige, mens andre sikrer ulik funksjonalitet.","Godtar du alle informasjonskapsler, tillater du også at vi samler inn data om statistikk og brukeradferd. Da hjelper du oss med å lage et bedre nettsted uten at du trenger å dele noe personlig informasjon med oss."],buttons:{accept:"Godta alle",reject:"Kun nødvendige",settings:"Innstillinger for informasjonskapsler"}},contentSettings:{title:"Innstillinger for informasjonskapsler",description:["Her kan du velge hvilke typer informasjonskapsler du vil tillate. Tillatelsen gjelder i 90 dager. Husk at nødvendige informasjonskapsler ikke kan velges bort.","Du kan når som helst endre innstillingene og finne mer informasjon nederst på nettstedet under «Innstillinger for informasjonskapsler» og «Personvern og informasjonskapsler»."],buttons:{back:"Tilbake",save:"Lagre innstillinger"}}},en:{contentPresentation:{title:"Before you visit Oslo kommune ...",description:["This website uses cookies to make improvements. In this context, we need your consent to measure the traffic on the website in relation to statistics and feedback.","To read more about what we use cookies for, go to our privacy declaration which you will find at the bottom of our websites."],buttons:{accept:"Yes, I accept",reject:"Only necessary",settings:"Go to settings"}},contentSettings:{title:"Her kan du aktivt velge mellom ulike informasjonskapsler",description:["For å lese mer om hva vi bruker informasjonskapsler til gå til vår personvernserklering som du finner på våre nettsider"],buttons:{back:"Back",save:"Save settings"}}}}};var Vl=Object.defineProperty,Ul=Object.getOwnPropertyDescriptor,ge=(s,t,e,i)=>{for(var n=i>1?void 0:i?Ul(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Vl(t,e,n),n};let Gi=null;function zl(){return Gi||(Gi=new Promise((s,t)=>{if(document.querySelector("#oslo-consent-script")){s();return}const e=document.createElement("script");e.src="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.js",e.id="oslo-consent-script",e.onload=()=>s(),e.onerror=t,document.head.appendChild(e);const i=document.createElement("link");i.href="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.css",i.type="text/css",i.rel="stylesheet",i.id="oslo-consent-styles",document.head.appendChild(i)}),Gi)}let Xt=class extends R{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||Hl.i18n[this.i18nLanguage].contentPresentation.buttons.settings}disconnectedCallback(){var t;super.disconnectedCallback(),this._cookieEventHandler&&((t=window.__cookieEvents)==null||t.off("CookieManager.setCookie",this._cookieEventHandler))}returnJsonOrObject(t){let e;try{e=JSON.parse(t)}catch{e=t}return e}emitCookieConsents(t){const e=this.returnJsonOrObject(t.value).items.reduce((i,n)=>(i[n.name]=n.consent,i),{});this.dispatchEvent(new CustomEvent("toggle-consent",{detail:e,bubbles:!0,cancelable:!1}))}async firstUpdated(t){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 zl(),this.triggerInit()}triggerInit(){window.document.dispatchEvent(new Event("CookieBannerReady",{bubbles:!0,cancelable:!0})),window.cookieBanner.cookieConsent.validateConsentCookie().then(t=>{if(t){const e={value:window.cookieBanner.cookieConsent.getConsentCookie()};window.setTimeout(()=>this.emitCookieConsents(e),0),this._cookieEventHandler&&window.__cookieEvents.off("CookieManager.setCookie",this._cookieEventHandler),this._cookieEventHandler=i=>{this.emitCookieConsents(i)},window.__cookieEvents.on("CookieManager.setCookie",this._cookieEventHandler)}})}openModal(t){var e;t.preventDefault(),(e=window.cookieBanner)!=null&&e.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner.openCookieModal())}render(){return this.triggerType==="link"?c`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?c`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
|
|
737
737
|
<pkt-icon name="chevron-right" class="pkt-footer__link-icon"></pkt-icon>
|
|
738
738
|
${this.triggerText}
|
|
739
|
-
</a>`:this.triggerType==="icon"?
|
|
739
|
+
</a>`:this.triggerType==="icon"?c`<pkt-button
|
|
740
740
|
skin="tertiary"
|
|
741
741
|
variant="icon-only"
|
|
742
742
|
iconName="cookie"
|
|
743
743
|
@click=${this.openModal}
|
|
744
744
|
>
|
|
745
745
|
>${this.triggerText}</pkt-button
|
|
746
|
-
>`:
|
|
747
|
-
${this.tagText?
|
|
748
|
-
${this.optionalTag?
|
|
749
|
-
${this.requiredTag?
|
|
750
|
-
`,r=()=>
|
|
746
|
+
>`:c`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`}};ge([o({type:Boolean})],Xt.prototype,"devMode",2),ge([o({type:String})],Xt.prototype,"hotjarId",2),ge([o({type:String})],Xt.prototype,"googleAnalyticsId",2),ge([o({type:String})],Xt.prototype,"cookieDomain",2),ge([o({type:String})],Xt.prototype,"cookieSecure",2),ge([o({type:String})],Xt.prototype,"cookieExpiryDays",2),ge([o({type:String})],Xt.prototype,"triggerType",2),ge([o({type:String})],Xt.prototype,"triggerText",2),ge([o({type:String})],Xt.prototype,"i18nLanguage",2),Xt=ge([F("pkt-consent")],Xt);var ql=Object.defineProperty,Wl=Object.getOwnPropertyDescriptor,Tt=(s,t,e,i)=>{for(var n=i>1?void 0:i?Wl(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&ql(t,e,n),n};let wt=class extends L{constructor(){super(...arguments),this.inputRef=N(),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(t,e,i){t==="defaultChecked"&&!this.checked&&(this.checked=this.defaultChecked),t==="checked"&&(this.checked=this.checked===""||this.checked==="true"||this.checked===!0,this.inputRef.value&&(this.inputRef.value.checked=this.checked)),t==="indeterminate"&&(this.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0,this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate)),super.attributeChangedCallback(t,e,i)}firstUpdated(t){t.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(t)}updated(t){t.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),t.has("checked")&&this.inputRef.value&&(this.inputRef.value.checked=this.checked===""||this.checked==="true"||this.checked===!0),t.has("indeterminate")&&this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.updated(t)}render(){const t=E({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),e=E({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),i=E({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-input-check__input-label--left":this.labelPosition==="left","pkt-input-check__input-label--right":this.labelPosition==="right","pkt-sr-only":this.hideLabel}),n="pkt-tag pkt-tag--small pkt-tag--thin-text",a=()=>c`
|
|
747
|
+
${this.tagText?c`<span class=${n+" pkt-tag--gray"}>${this.tagText}</span>`:k}
|
|
748
|
+
${this.optionalTag?c`<span class=${n+" pkt-tag--blue-light"}>${this.optionalText}</span>`:k}
|
|
749
|
+
${this.requiredTag?c`<span class=${n+" pkt-tag--beige"}>${this.requiredText}</span>`:k}
|
|
750
|
+
`,r=()=>c`
|
|
751
751
|
<label class=${i} for=${this.id+"-internal"}>
|
|
752
|
-
${this.label} ${
|
|
753
|
-
${this.checkHelptext?
|
|
752
|
+
${this.label} ${a()}
|
|
753
|
+
${this.checkHelptext?c`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:k}
|
|
754
754
|
</label>
|
|
755
|
-
`;return
|
|
755
|
+
`;return c`
|
|
756
756
|
<div class="pkt-input-check">
|
|
757
757
|
<div class=${t}>
|
|
758
|
-
${this.labelPosition==="left"?r()
|
|
758
|
+
${this.labelPosition==="left"?r():k}
|
|
759
759
|
<input
|
|
760
760
|
id=${this.id+"-internal"}
|
|
761
761
|
class=${e}
|
|
762
762
|
type="checkbox"
|
|
763
763
|
?disabled=${this.disabled}
|
|
764
764
|
name=${this.name+"-internal"}
|
|
765
|
-
${
|
|
765
|
+
${M(this.inputRef)}
|
|
766
766
|
@change=${this.handleChange}
|
|
767
767
|
@click=${this.handleClick}
|
|
768
768
|
@blur=${this.onBlur}
|
|
@@ -770,30 +770,30 @@
|
|
|
770
770
|
?checked=${this.checked}
|
|
771
771
|
role=${this.isSwitch?"switch":"checkbox"}
|
|
772
772
|
/>
|
|
773
|
-
${this.labelPosition==="right"?r()
|
|
773
|
+
${this.labelPosition==="right"?r():k}
|
|
774
774
|
</div>
|
|
775
775
|
</div>
|
|
776
|
-
`}handleClick(t){if(this.disabled)return t.preventDefault(),t.stopImmediatePropagation(),!1}handleChange(t){if(this.disabled)return t.preventDefault(),t.stopImmediatePropagation(),!1;this.toggleChecked(t)}toggleChecked(t){if(this.disabled){t.preventDefault(),t.stopImmediatePropagation();return}const e=t.target;if(e&&e.disabled){t.preventDefault(),t.stopImmediatePropagation();return}t.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this.checked=this.inputRef.value.matches(":checked"),this.valueChecked(this.checked))}}
|
|
777
|
-
<div class=${
|
|
778
|
-
${Array.isArray(this.dates)&&this.dates[0]?
|
|
776
|
+
`}handleClick(t){if(this.disabled)return t.preventDefault(),t.stopImmediatePropagation(),!1}handleChange(t){if(this.disabled)return t.preventDefault(),t.stopImmediatePropagation(),!1;this.toggleChecked(t)}toggleChecked(t){if(this.disabled){t.preventDefault(),t.stopImmediatePropagation();return}const e=t.target;if(e&&e.disabled){t.preventDefault(),t.stopImmediatePropagation();return}t.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this.checked=this.inputRef.value.matches(":checked"),this.valueChecked(this.checked))}};Tt([o({type:String,reflect:!0})],wt.prototype,"value",2),Tt([o({type:String})],wt.prototype,"checkHelptext",2),Tt([o({type:Boolean})],wt.prototype,"defaultChecked",2),Tt([o({type:Boolean})],wt.prototype,"hasTile",2),Tt([o({type:Boolean})],wt.prototype,"isSwitch",2),Tt([o({type:String})],wt.prototype,"labelPosition",2),Tt([o({type:Boolean})],wt.prototype,"hideLabel",2),Tt([o({type:Boolean,reflect:!0})],wt.prototype,"checked",2),Tt([o({type:Boolean,reflect:!0})],wt.prototype,"indeterminate",2),Tt([o({type:String,reflect:!0})],wt.prototype,"type",2),Tt([o({type:String})],wt.prototype,"tagText",2),Tt([o({type:Boolean})],wt.prototype,"optionalTag",2),Tt([o({type:String})],wt.prototype,"optionalText",2),Tt([o({type:Boolean})],wt.prototype,"requiredTag",2),Tt([o({type:String})],wt.prototype,"requiredText",2),wt=Tt([F("pkt-checkbox")],wt);var Rl=Object.defineProperty,Kl=Object.getOwnPropertyDescriptor,Gs=(s,t,e,i)=>{for(var n=i>1?void 0:i?Kl(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Rl(t,e,n),n};let $s=class extends R{constructor(){super(...arguments),this.dates=[],this.dateformat="dd.MM.yyyy",this.className="pkt-datepicker__tags",this.idBase=Be()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},c`
|
|
777
|
+
<div class=${E(this.classes)} aria-live="polite">
|
|
778
|
+
${Array.isArray(this.dates)&&this.dates[0]?Yi(na((this.dates??[]).filter(Boolean)),t=>t,t=>{var e;return c` <pkt-tag
|
|
779
779
|
id=${this.idBase+t+"-tag"}
|
|
780
780
|
closeTag
|
|
781
781
|
@close=${()=>{this.dispatchEvent(new CustomEvent("date-tag-removed",{detail:t}))}}
|
|
782
|
-
.ariaLabel=${`${(e=this.strings)==null?void 0:e.calendar.deleteDate} ${
|
|
782
|
+
.ariaLabel=${`${(e=this.strings)==null?void 0:e.calendar.deleteDate} ${sa(t,this.dateformat)}`}
|
|
783
783
|
>
|
|
784
|
-
<time datetime=${t}>${
|
|
785
|
-
</pkt-tag>`})
|
|
784
|
+
<time datetime=${t}>${sa(t,this.dateformat)}</time>
|
|
785
|
+
</pkt-tag>`}):k}
|
|
786
786
|
</div>
|
|
787
|
-
`}};
|
|
787
|
+
`}};Gs([o({type:Array})],$s.prototype,"dates",2),Gs([o({type:String})],$s.prototype,"dateformat",2),Gs([o({type:String,attribute:"class"})],$s.prototype,"className",2),Gs([o({type:String,attribute:"id-base"})],$s.prototype,"idBase",2),$s=Gs([F("pkt-date-tags")],$s);const Yl={dateformat:{default:"dd.MM.yyyy"},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},Zs={props:Yl},Qe=()=>{const s=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(s)||/Macintosh/.test(s)&&"ontouchend"in document)},Si={normalizeNameForMultiple(s,t,e){return s?(t||e)&&!s.endsWith("[]")?s+"[]":s:null},validateRangeOrder(s){return!s||s.length!==2?!0:ll(s[0],s[1])},sortDates(s){return na(s)},filterSelectableDates(s,t,e,i,n){return ol(s,t,e,i,n)}},Gl={getInputType(){return Qe()?"text":"date"}},Xs={submitForm(s){var t;const e=(t=s.internals)==null?void 0:t.form;e&&e.requestSubmit()},submitFormOrFallback(s,t){const e=s==null?void 0:s.form;e?e.requestSubmit():t()},validateDateInput(s,t,e,i,n){var a,r,h,d;const u=s.value;u&&(e&&e>u?t.setValidity({rangeUnderflow:!0},((r=(a=n==null?void 0:n.forms)==null?void 0:a.messages)==null?void 0:r.rangeUnderflow)||"Value is below minimum",s):i&&i<u&&t.setValidity({rangeOverflow:!0},((d=(h=n==null?void 0:n.forms)==null?void 0:h.messages)==null?void 0:d.rangeOverflow)||"Value is above maximum",s))}},Ci={addToSelected(s,t,e,i){const n=s.target;if(!n.value)return;const a=e?$e(e):null,r=i?$e(i):null,h=$e(n.value.split(",")[0]);h&&!isNaN(h.getTime())&&(!a||h>=a)&&(!r||h<=r)&&t.value&&t.value.handleDateSelect(h),n.value=""},handleCalendarPosition(s,t,e=!1){var i;if(!s.value||!t.value)return;const n=((i=t.value.parentElement)==null?void 0:i.getBoundingClientRect())||t.value.getBoundingClientRect(),a=e?n.height+30:n.height,r=s.value.getBoundingClientRect().height;let h=e?"calc(100% - 30px)":"100%";n&&n.top+r>window.innerHeight&&n.top-r>0&&(h=`calc(100% - ${a}px - ${r}px)`),s.value.style.top=h}},Js={getInputClasses(s,t,e,i,n,a){return{"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":s,"pkt-datepicker--hasrangelabels":t,"pkt-datepicker--multiple":e,"pkt-datepicker--range":i,"ios-readonly-hack":n===!1&&a==="text"}},getButtonClasses(){return{"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}},getRangeLabelClasses(s){return{"pkt-input-prefix":s,"pkt-hide":!s}}},Zi={processDateSelection(s,t,e){return!t&&!e?s[0]||"":Array.isArray(s)?s.join(","):s},updateInputValues(s,t,e,i,n,a){s.value&&(i&&t!=null&&t.value?(s.value.value=e[0]??"",t.value.value=e[1]??"",a(s.value),a(t.value)):n||(s.value.value=e.length?e[0]:"",a(s.value)))},processRangeBlur(s,t,e,i,n){var a;const r=s.target;if(r.value){n(r);const h=De(r.value);h&&t[0]!==r.value&&t[1]&&(i(),(a=e==null?void 0:e.value)==null||a.handleDateSelect(h))}else t[0]&&i()}},ts={handleInputKeydown(s,t,e,i,n,a){const{key:r}=s;r===","&&(s.preventDefault(),a?a(s):n&&n()),(r==="Space"||r===" ")&&(s.preventDefault(),t(s)),r==="Enter"&&(s.preventDefault(),e?e():i?i():n&&n())},handleButtonKeydown(s,t){const{key:e}=s;(e==="Enter"||e===" "||e==="Space")&&(s.preventDefault(),t(s))}};var Zl=Object.defineProperty,Xl=Object.getOwnPropertyDescriptor,Ut=(s,t,e,i)=>{for(var n=i>1?void 0:i?Xl(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Zl(t,e,n),n};let It=class extends R{constructor(){super(...arguments),this.open=!1,this.multiple=!1,this.range=!1,this.weeknumbers=!1,this.withcontrols=!1,this.maxMultiple=null,this.selected=[],this.earliest=null,this.latest=null,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.popupRef=N(),this.calendarRef=N(),this.handleDocumentClick=t=>{if(!this.open)return;const e=t.composedPath(),i=this.parentElement,n=this.popupRef.value;!e.includes(this)&&!e.includes(n)&&!(i&&e.includes(i))&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))},this.handleDocumentKeydown=t=>{this.open&&t.key==="Escape"&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))}}firstUpdated(){this.calRef=this.calendarRef,document.addEventListener("keydown",this.handleDocumentKeydown),document.addEventListener("click",this.handleDocumentClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("keydown",this.handleDocumentKeydown)}show(){var t;this.open=!0,(t=this.calendarRef.value)==null||t.focus()}hide(){this.open=!1}toggle(){this.open?this.hide():this.show()}contains(t){var e;return!!t&&!!((e=this.popupRef.value)!=null&&e.contains(t))}focusOnCurrentDate(){const t=this.calendarRef.value;t&&typeof t.focusOnCurrentDate=="function"&&t.focusOnCurrentDate()}addToSelected(t,e,i){if(typeof Ci.addToSelected=="function")return Ci.addToSelected(t,this.calendarRef,e,i)}handleDateSelect(t){const e=this.calendarRef.value;if(e&&typeof e.handleDateSelect=="function")return e.handleDateSelect(t)}render(){const t={"pkt-calendar-popup":!0,show:this.open,hide:!this.open};return c`
|
|
788
788
|
<div
|
|
789
|
-
class="${
|
|
790
|
-
${
|
|
789
|
+
class="${E(t)}"
|
|
790
|
+
${M(this.popupRef)}
|
|
791
791
|
id="date-popup"
|
|
792
792
|
?hidden=${!this.open}
|
|
793
793
|
aria-hidden="${!this.open}"
|
|
794
794
|
>
|
|
795
795
|
<pkt-calendar
|
|
796
|
-
${
|
|
796
|
+
${M(this.calendarRef)}
|
|
797
797
|
?multiple=${this.multiple}
|
|
798
798
|
?range=${this.range}
|
|
799
799
|
?weeknumbers=${this.weeknumbers}
|
|
@@ -809,131 +809,131 @@
|
|
|
809
809
|
@close=${()=>{this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}
|
|
810
810
|
></pkt-calendar>
|
|
811
811
|
</div>
|
|
812
|
-
`}};
|
|
812
|
+
`}};Ut([o({type:Boolean,reflect:!0})],It.prototype,"open",2),Ut([o({type:Boolean})],It.prototype,"multiple",2),Ut([o({type:Boolean})],It.prototype,"range",2),Ut([o({type:Boolean})],It.prototype,"weeknumbers",2),Ut([o({type:Boolean})],It.prototype,"withcontrols",2),Ut([o({type:Number})],It.prototype,"maxMultiple",2),Ut([o({type:Array})],It.prototype,"selected",2),Ut([o({type:String})],It.prototype,"earliest",2),Ut([o({type:String})],It.prototype,"latest",2),Ut([o({type:Array})],It.prototype,"excludedates",2),Ut([o({type:Array})],It.prototype,"excludeweekdays",2),Ut([o({type:String})],It.prototype,"currentmonth",2),It=Ut([F("pkt-datepicker-popup")],It);var Jl=Object.defineProperty,Ql=Object.getOwnPropertyDescriptor,Jt=(s,t,e,i)=>{for(var n=i>1?void 0:i?Ql(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Jl(t,e,n),n};let zt=class extends R{constructor(){super(...arguments),this.value="",this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.inputClasses={},this.strings={calendar:{buttonAltText:"Åpne kalender"}},this.inputRef=N(),this.btnRef=N()}get inputElement(){return this.inputRef.value}get buttonElement(){return this.btnRef.value}get isInputReadonly(){return this.readonly||this.inputType==="text"}dispatchToggleCalendar(t){this.readonly||this.dispatchEvent(new CustomEvent("toggle-calendar",{detail:t,bubbles:!0,composed:!0}))}dispatchInput(t){this.dispatchEvent(new CustomEvent("input-change",{detail:t,bubbles:!0,composed:!0}))}dispatchFocus(){this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0}))}dispatchBlur(t){this.dispatchEvent(new CustomEvent("input-blur",{detail:t,bubbles:!0,composed:!0}))}dispatchChange(t){this.dispatchEvent(new CustomEvent("input-changed",{detail:t,bubbles:!0,composed:!0}))}dispatchManageValidity(t){this.dispatchEvent(new CustomEvent("manage-validity",{detail:t,bubbles:!0,composed:!0}))}createRenderRoot(){return this}render(){return c`
|
|
813
813
|
<div class="pkt-input__container">
|
|
814
814
|
<input
|
|
815
|
-
class="${
|
|
815
|
+
class="${E(this.inputClasses)}"
|
|
816
816
|
.type=${this.inputType}
|
|
817
817
|
id="${this.id}-input"
|
|
818
818
|
.value=${this.value}
|
|
819
|
-
min=${
|
|
820
|
-
max=${
|
|
821
|
-
placeholder=${
|
|
819
|
+
min=${C(this.min)}
|
|
820
|
+
max=${C(this.max)}
|
|
821
|
+
placeholder=${C(this.placeholder)}
|
|
822
822
|
?readonly=${this.isInputReadonly}
|
|
823
823
|
aria-describedby="${this.id}-helptext"
|
|
824
824
|
@click=${t=>{t.preventDefault(),this.dispatchToggleCalendar(t)}}
|
|
825
825
|
@touchend=${t=>{t.preventDefault(),this.dispatchToggleCalendar(t)}}
|
|
826
826
|
?disabled=${this.disabled}
|
|
827
|
-
@keydown=${t=>
|
|
827
|
+
@keydown=${t=>ts.handleInputKeydown(t,e=>this.dispatchToggleCalendar(e),()=>Xs.submitFormOrFallback(this.internals,()=>{var e;return(e=this.inputRef.value)==null?void 0:e.blur()}),void 0,()=>{var e;return(e=this.inputRef.value)==null?void 0:e.blur()})}
|
|
828
828
|
@input=${t=>{this.dispatchInput(t),t.stopImmediatePropagation()}}
|
|
829
|
-
@focus=${()=>{this.dispatchFocus(),
|
|
829
|
+
@focus=${()=>{this.dispatchFocus(),Qe()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
830
830
|
@blur=${t=>{this.dispatchBlur(t),this.dispatchManageValidity(t.target),this.dispatchEvent(new CustomEvent("value-change",{detail:t.target.value,bubbles:!0,composed:!0}))}}
|
|
831
831
|
@change=${t=>{this.dispatchChange(t),t.stopImmediatePropagation()}}
|
|
832
|
-
${
|
|
832
|
+
${M(this.inputRef)}
|
|
833
833
|
/>
|
|
834
834
|
<button
|
|
835
|
-
class="${
|
|
835
|
+
class="${E(Js.getButtonClasses())}"
|
|
836
836
|
type="button"
|
|
837
837
|
@click=${t=>this.dispatchToggleCalendar(t)}
|
|
838
|
-
@keydown=${t=>
|
|
838
|
+
@keydown=${t=>ts.handleButtonKeydown(t,e=>this.dispatchToggleCalendar(e))}
|
|
839
839
|
?disabled=${this.disabled}
|
|
840
|
-
${
|
|
840
|
+
${M(this.btnRef)}
|
|
841
841
|
>
|
|
842
842
|
<pkt-icon name="calendar"></pkt-icon>
|
|
843
843
|
<span class="pkt-btn__text">${this.strings.calendar.buttonAltText}</span>
|
|
844
844
|
</button>
|
|
845
845
|
</div>
|
|
846
|
-
`}};
|
|
846
|
+
`}};Jt([o({type:String})],zt.prototype,"value",2),Jt([o({type:String})],zt.prototype,"inputType",2),Jt([o({type:String})],zt.prototype,"id",2),Jt([o({type:String})],zt.prototype,"min",2),Jt([o({type:String})],zt.prototype,"max",2),Jt([o({type:String})],zt.prototype,"placeholder",2),Jt([o({type:Boolean})],zt.prototype,"readonly",2),Jt([o({type:Boolean})],zt.prototype,"disabled",2),Jt([o({type:Object})],zt.prototype,"inputClasses",2),Jt([o({type:Object})],zt.prototype,"internals",2),Jt([o({type:Object})],zt.prototype,"strings",2),zt=Jt([F("pkt-datepicker-single")],zt);var th=Object.defineProperty,eh=Object.getOwnPropertyDescriptor,qt=(s,t,e,i)=>{for(var n=i>1?void 0:i?eh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&th(t,e,n),n};let Lt=class extends R{constructor(){super(...arguments),this.value=[],this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.showRangeLabels=!1,this.inputClasses={},this.strings={generic:{from:"Fra",to:"Til"}},this.inputRef=N(),this.inputRefTo=N(),this.btnRef=N()}get inputElement(){return this.inputRef.value}get inputElementTo(){return this.inputRefTo.value}get buttonElement(){return this.btnRef.value}get isInputReadonly(){return this.readonly||this.inputType==="text"}dispatchToggleCalendar(t){this.readonly||this.dispatchEvent(new CustomEvent("toggle-calendar",{detail:t,bubbles:!0,composed:!0}))}dispatchInput(t){this.dispatchEvent(new CustomEvent("input-change",{detail:t,bubbles:!0,composed:!0}))}dispatchFocus(){this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0}))}dispatchBlur(t){this.dispatchEvent(new CustomEvent("input-blur",{detail:t,bubbles:!0,composed:!0}))}dispatchChange(t){this.dispatchEvent(new CustomEvent("input-changed",{detail:t,bubbles:!0,composed:!0}))}dispatchManageValidity(t){this.dispatchEvent(new CustomEvent("manage-validity",{detail:t,bubbles:!0,composed:!0}))}createRenderRoot(){return this}render(){const t=Js.getRangeLabelClasses(this.showRangeLabels);return c`
|
|
847
847
|
<div class="pkt-input__container">
|
|
848
|
-
${this.showRangeLabels?
|
|
848
|
+
${this.showRangeLabels?c` <div class="pkt-input-prefix">${this.strings.generic.from}</div> `:k}
|
|
849
849
|
<input
|
|
850
|
-
class=${
|
|
850
|
+
class=${E(this.inputClasses)}
|
|
851
851
|
.type=${this.inputType}
|
|
852
852
|
id="${this.id}-input"
|
|
853
853
|
.value=${this.value[0]??""}
|
|
854
|
-
min=${
|
|
855
|
-
max=${
|
|
856
|
-
placeholder=${
|
|
854
|
+
min=${C(this.min)}
|
|
855
|
+
max=${C(this.max)}
|
|
856
|
+
placeholder=${C(this.placeholder)}
|
|
857
857
|
?readonly=${this.isInputReadonly}
|
|
858
858
|
?disabled=${this.disabled}
|
|
859
859
|
@click=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
860
860
|
@touchend=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
861
|
-
@keydown=${e=>
|
|
861
|
+
@keydown=${e=>ts.handleInputKeydown(e,i=>this.dispatchToggleCalendar(i),()=>Xs.submitFormOrFallback(this.internals,()=>{var i;return(i=this.inputRefTo.value)==null?void 0:i.focus()}),()=>{var i;return(i=this.inputRefTo.value)==null?void 0:i.focus()},()=>{var i;return(i=this.inputRef.value)==null?void 0:i.blur()})}
|
|
862
862
|
@input=${e=>{this.dispatchInput(e),e.stopImmediatePropagation()}}
|
|
863
|
-
@focus=${()=>{this.dispatchFocus(),
|
|
863
|
+
@focus=${()=>{this.dispatchFocus(),Qe()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
864
864
|
@blur=${e=>{this.dispatchEvent(new CustomEvent("range-blur",{detail:{event:e,values:this.value,inputType:"from"},bubbles:!0,composed:!0}))}}
|
|
865
865
|
@change=${e=>{e.stopImmediatePropagation()}}
|
|
866
|
-
${
|
|
866
|
+
${M(this.inputRef)}
|
|
867
867
|
/>
|
|
868
|
-
<div class="${
|
|
868
|
+
<div class="${E(t)}" id="${this.id}-to-label">
|
|
869
869
|
${this.strings.generic.to}
|
|
870
870
|
</div>
|
|
871
|
-
${this.showRangeLabels
|
|
871
|
+
${this.showRangeLabels?k:c` <div class="pkt-input-separator">–</div> `}
|
|
872
872
|
<input
|
|
873
|
-
class=${
|
|
873
|
+
class=${E(this.inputClasses)}
|
|
874
874
|
.type=${this.inputType}
|
|
875
875
|
id="${this.id}-to"
|
|
876
876
|
aria-labelledby="${this.id}-to-label"
|
|
877
877
|
.value=${this.value[1]??""}
|
|
878
|
-
min=${
|
|
879
|
-
max=${
|
|
880
|
-
placeholder=${
|
|
878
|
+
min=${C(this.min)}
|
|
879
|
+
max=${C(this.max)}
|
|
880
|
+
placeholder=${C(this.placeholder)}
|
|
881
881
|
?readonly=${this.isInputReadonly}
|
|
882
882
|
?disabled=${this.disabled}
|
|
883
883
|
@click=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
884
884
|
@touchend=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
885
|
-
@keydown=${e=>
|
|
885
|
+
@keydown=${e=>ts.handleInputKeydown(e,i=>this.dispatchToggleCalendar(i),()=>Xs.submitFormOrFallback(this.internals,()=>{var i;return(i=this.inputRefTo.value)==null?void 0:i.blur()}),void 0,()=>{var i;return(i=this.inputRefTo.value)==null?void 0:i.blur()})}
|
|
886
886
|
@input=${e=>{this.dispatchInput(e),e.stopImmediatePropagation()}}
|
|
887
|
-
@focus=${()=>{this.dispatchFocus(),
|
|
887
|
+
@focus=${()=>{this.dispatchFocus(),Qe()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
888
888
|
@blur=${e=>{this.dispatchBlur(e),e.target.value&&(this.dispatchManageValidity(e.target),this.dispatchEvent(new CustomEvent("validate-date-input",{detail:e.target,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("handle-date-select",{detail:e.target.value,bubbles:!0,composed:!0})))}}
|
|
889
889
|
@change=${e=>{this.dispatchChange(e),e.stopImmediatePropagation()}}
|
|
890
|
-
${
|
|
890
|
+
${M(this.inputRefTo)}
|
|
891
891
|
/>
|
|
892
892
|
<button
|
|
893
|
-
class="${
|
|
893
|
+
class="${E(Js.getButtonClasses())}"
|
|
894
894
|
type="button"
|
|
895
895
|
@click=${e=>this.dispatchToggleCalendar(e)}
|
|
896
|
-
@keydown=${e=>
|
|
896
|
+
@keydown=${e=>ts.handleButtonKeydown(e,i=>this.dispatchToggleCalendar(i))}
|
|
897
897
|
?disabled=${this.disabled}
|
|
898
|
-
${
|
|
898
|
+
${M(this.btnRef)}
|
|
899
899
|
>
|
|
900
900
|
<pkt-icon name="calendar"></pkt-icon>
|
|
901
901
|
<span class="pkt-btn__text">${this.strings.calendar.buttonAltText}</span>
|
|
902
902
|
</button>
|
|
903
903
|
</div>
|
|
904
|
-
`}};
|
|
904
|
+
`}};qt([o({type:Array})],Lt.prototype,"value",2),qt([o({type:String})],Lt.prototype,"inputType",2),qt([o({type:String})],Lt.prototype,"id",2),qt([o({type:String})],Lt.prototype,"min",2),qt([o({type:String})],Lt.prototype,"max",2),qt([o({type:String})],Lt.prototype,"placeholder",2),qt([o({type:Boolean})],Lt.prototype,"readonly",2),qt([o({type:Boolean})],Lt.prototype,"disabled",2),qt([o({type:Boolean})],Lt.prototype,"showRangeLabels",2),qt([o({type:Object})],Lt.prototype,"inputClasses",2),qt([o({type:Object})],Lt.prototype,"internals",2),qt([o({type:Object})],Lt.prototype,"strings",2),Lt=qt([F("pkt-datepicker-range")],Lt);var sh=Object.defineProperty,ih=Object.getOwnPropertyDescriptor,Wt=(s,t,e,i)=>{for(var n=i>1?void 0:i?ih(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&sh(t,e,n),n};let Bt=class extends R{constructor(){super(...arguments),this.value=[],this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.inputClasses={},this.strings={calendar:{buttonAltText:"Åpne kalender"}},this.inputRef=N(),this.btnRef=N()}get inputElement(){return this.inputRef.value}get buttonElement(){return this.btnRef.value}get isInputReadonly(){return this.readonly||this.inputType==="text"}get isInputDisabled(){return this.disabled||this.maxlength!==void 0&&this.maxlength!==null&&this.value.length>=this.maxlength}dispatchToggleCalendar(t){this.readonly||this.dispatchEvent(new CustomEvent("toggle-calendar",{detail:t,bubbles:!0,composed:!0}))}dispatchInput(t){this.dispatchEvent(new CustomEvent("input-change",{detail:t,bubbles:!0,composed:!0}))}dispatchFocus(){this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0}))}dispatchBlur(t){this.dispatchEvent(new CustomEvent("input-blur",{detail:t,bubbles:!0,composed:!0}))}dispatchChange(t){this.dispatchEvent(new CustomEvent("input-changed",{detail:t,bubbles:!0,composed:!0}))}dispatchAddToSelected(t){this.dispatchEvent(new CustomEvent("add-to-selected",{detail:t,bubbles:!0,composed:!0}))}createRenderRoot(){return this}render(){return c`
|
|
905
905
|
<div class="pkt-input__container">
|
|
906
906
|
<input
|
|
907
|
-
class=${
|
|
907
|
+
class=${E(this.inputClasses)}
|
|
908
908
|
.type=${this.inputType}
|
|
909
909
|
id="${this.id}-input"
|
|
910
|
-
min=${
|
|
911
|
-
max=${
|
|
912
|
-
placeholder=${
|
|
910
|
+
min=${C(this.min)}
|
|
911
|
+
max=${C(this.max)}
|
|
912
|
+
placeholder=${C(this.placeholder)}
|
|
913
913
|
?readonly=${this.isInputReadonly}
|
|
914
914
|
?disabled=${this.isInputDisabled}
|
|
915
915
|
@click=${t=>{t.preventDefault(),this.dispatchToggleCalendar(t)}}
|
|
916
916
|
@touchend=${t=>{t.preventDefault(),this.dispatchToggleCalendar(t)}}
|
|
917
917
|
@blur=${t=>{this.dispatchBlur(t),this.dispatchAddToSelected(t)}}
|
|
918
918
|
@input=${t=>{this.dispatchInput(t),t.stopImmediatePropagation()}}
|
|
919
|
-
@focus=${()=>{this.dispatchFocus(),
|
|
920
|
-
@keydown=${t=>
|
|
919
|
+
@focus=${()=>{this.dispatchFocus(),Qe()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
920
|
+
@keydown=${t=>ts.handleInputKeydown(t,e=>this.dispatchToggleCalendar(e),()=>Xs.submitFormOrFallback(this.internals,()=>{var e;return(e=this.inputRef.value)==null?void 0:e.blur()}),void 0,void 0,e=>this.dispatchAddToSelected(e))}
|
|
921
921
|
@change=${t=>{this.dispatchChange(t),t.stopImmediatePropagation()}}
|
|
922
|
-
${
|
|
922
|
+
${M(this.inputRef)}
|
|
923
923
|
/>
|
|
924
924
|
<button
|
|
925
|
-
class="${
|
|
925
|
+
class="${E(Js.getButtonClasses())}"
|
|
926
926
|
type="button"
|
|
927
927
|
@click=${t=>this.dispatchToggleCalendar(t)}
|
|
928
|
-
@keydown=${t=>
|
|
928
|
+
@keydown=${t=>ts.handleButtonKeydown(t,e=>this.dispatchToggleCalendar(e))}
|
|
929
929
|
?disabled=${this.disabled}
|
|
930
|
-
${
|
|
930
|
+
${M(this.btnRef)}
|
|
931
931
|
>
|
|
932
932
|
<pkt-icon name="calendar"></pkt-icon>
|
|
933
933
|
<span class="pkt-btn__text">${this.strings.calendar.buttonAltText}</span>
|
|
934
934
|
</button>
|
|
935
935
|
</div>
|
|
936
|
-
`}};
|
|
936
|
+
`}};Wt([o({type:Array})],Bt.prototype,"value",2),Wt([o({type:String})],Bt.prototype,"inputType",2),Wt([o({type:String})],Bt.prototype,"id",2),Wt([o({type:String})],Bt.prototype,"min",2),Wt([o({type:String})],Bt.prototype,"max",2),Wt([o({type:String})],Bt.prototype,"placeholder",2),Wt([o({type:Boolean})],Bt.prototype,"readonly",2),Wt([o({type:Boolean})],Bt.prototype,"disabled",2),Wt([o({type:Number})],Bt.prototype,"maxlength",2),Wt([o({type:Object})],Bt.prototype,"inputClasses",2),Wt([o({type:Object})],Bt.prototype,"internals",2),Wt([o({type:Object})],Bt.prototype,"strings",2),Bt=Wt([F("pkt-datepicker-multiple")],Bt);var nh=Object.defineProperty,ah=Object.getOwnPropertyDescriptor,mt=(s,t,e,i)=>{for(var n=i>1?void 0:i?ah(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&nh(t,e,n),n};let ht=class extends L{constructor(){super(),this._valueProperty="",this.datepickerPopupRef=N(),this._value=[],this.label="Datovelger",this.dateformat=Zs.props.dateformat.default,this.multiple=Zs.props.multiple.default,this.maxlength=null,this.range=Zs.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=Zs.props.weeknumbers.default,this.withcontrols=Zs.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.calendarOpen=!1,this.timezone="Europe/Oslo",this.inputClasses={},this.calRef=N(),this.popupRef=N(),this.helptextSlot=N(),this.singleInputRef=N(),this.rangeInputRef=N(),this.multipleInputRef=N(),this.addToSelected=t=>{const e=this.datepickerPopupRef.value;return e&&typeof e.addToSelected=="function"?e.addToSelected(t,this.min,this.max):Ci.addToSelected(t,this.calRef,this.min,this.max)},this.slotController=new rt(this,this.helptextSlot)}get value(){return this._valueProperty}set value(t){const e=this._valueProperty;this._valueProperty=Array.isArray(t)?t.join(","):t||"",this.valueChanged(this._valueProperty,e),this.requestUpdate("value",e)}get inputType(){return Gl.getInputType()}connectedCallback(){super.connectedCallback(),this.timezone&&this.timezone!==window.pktTz&&(window.pktTz=this.timezone),this.name=Si.normalizeNameForMultiple(this.name,this.multiple,this.range)||this.name}disconnectedCallback(){super.disconnectedCallback()}onInput(){this.dispatchEvent(new Event("input",{bubbles:!0}))}valueChanged(t,e){if(t===e)return;const i=Ys(t),n=this.multiple&&i.length>1?Si.filterSelectableDates(i,this.min,this.max,this.excludedates,this.excludeweekdays):i;if(this.range&&!Si.validateRangeOrder(n)){this._value=[],this._valueProperty="",super.valueChanged("",e);return}this._value=n;const a=hl(n);this._valueProperty!==a&&(this._valueProperty=a),super.valueChanged(a,e)}attributeChangedCallback(t,e,i){t==="value"&&this.value!==e&&this.valueChanged(i,e),t==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=Ys(i||"")),t==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=Ys(i||"")),super.attributeChangedCallback(t,e,i)}updated(t){if(t.has("value")){const e=Array.isArray(this.value)?this.value.join(","):this.value,i=t.get("value"),n=Array.isArray(i)?i.join(","):i;this.valueChanged(e,n)}(t.has("multiple")||t.has("range"))&&(this.name=Si.normalizeNameForMultiple(this.name,this.multiple,this.range)||this.name),t.has("multiple")&&(this.multiple&&!Array.isArray(this._value)?this._value=Ys(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(t)}get inputRef(){return{value:this.currentInputElement}}get inputRefTo(){return{value:this.currentInputElementTo}}get currentInputElement(){var t,e,i;return this.multiple?(t=this.multipleInputRef.value)==null?void 0:t.inputElement:this.range?(e=this.rangeInputRef.value)==null?void 0:e.inputElement:(i=this.singleInputRef.value)==null?void 0:i.inputElement}get currentInputElementTo(){var t;if(this.range)return(t=this.rangeInputRef.value)==null?void 0:t.inputElementTo}get currentButtonElement(){var t,e,i;return this.multiple?(t=this.multipleInputRef.value)==null?void 0:t.buttonElement:this.range?(e=this.rangeInputRef.value)==null?void 0:e.buttonElement:(i=this.singleInputRef.value)==null?void 0:i.buttonElement}get btnRef(){return{value:this.currentButtonElement}}renderInput(){return c`
|
|
937
937
|
<pkt-datepicker-single
|
|
938
938
|
.value=${this._value[0]??""}
|
|
939
939
|
.inputType=${this.inputType}
|
|
@@ -953,9 +953,9 @@
|
|
|
953
953
|
@manage-validity=${t=>this.manageValidity(t.detail)}
|
|
954
954
|
@value-change=${t=>{this.value=t.detail}}
|
|
955
955
|
@input-changed=${()=>{this.touched=!0}}
|
|
956
|
-
${
|
|
956
|
+
${M(this.singleInputRef)}
|
|
957
957
|
></pkt-datepicker-single>
|
|
958
|
-
`}renderRangeInput(){return
|
|
958
|
+
`}renderRangeInput(){return c`
|
|
959
959
|
<pkt-datepicker-range
|
|
960
960
|
.value=${this._value}
|
|
961
961
|
.inputType=${this.inputType}
|
|
@@ -973,14 +973,14 @@
|
|
|
973
973
|
@input-change=${()=>this.onInput()}
|
|
974
974
|
@input-focus=${()=>this.onFocus()}
|
|
975
975
|
@input-blur=${t=>{var e;(e=this.calRef.value)!=null&&e.contains(t.detail.relatedTarget)||this.onBlur()}}
|
|
976
|
-
@range-blur=${t=>{
|
|
976
|
+
@range-blur=${t=>{Zi.processRangeBlur(t.detail.event,t.detail.values,this.calRef,()=>this.clearInputValue(),e=>this.manageValidity(e))}}
|
|
977
977
|
@manage-validity=${t=>this.manageValidity(t.detail)}
|
|
978
|
-
@validate-date-input=${t=>{
|
|
979
|
-
@handle-date-select=${t=>{var e,i;const
|
|
978
|
+
@validate-date-input=${t=>{Xs.validateDateInput(t.detail,this.internals,this.min,this.max,this.strings)}}
|
|
979
|
+
@handle-date-select=${t=>{var e,i;const n=De(t.detail);n&&this._value[1]!==ut(n)&&((i=(e=this.calRef)==null?void 0:e.value)==null||i.handleDateSelect(n))}}
|
|
980
980
|
@input-changed=${()=>{this.touched=!0}}
|
|
981
|
-
${
|
|
981
|
+
${M(this.rangeInputRef)}
|
|
982
982
|
></pkt-datepicker-range>
|
|
983
|
-
`}renderMultipleInput(){return
|
|
983
|
+
`}renderMultipleInput(){return c`
|
|
984
984
|
<pkt-datepicker-multiple
|
|
985
985
|
.value=${this._value}
|
|
986
986
|
.inputType=${this.inputType}
|
|
@@ -1000,9 +1000,9 @@
|
|
|
1000
1000
|
@input-blur=${t=>{var e;(e=this.calRef.value)!=null&&e.contains(t.detail.relatedTarget)||this.onBlur()}}
|
|
1001
1001
|
@add-to-selected=${t=>this.addToSelected(t.detail)}
|
|
1002
1002
|
@input-changed=${()=>{this.touched=!0}}
|
|
1003
|
-
${
|
|
1003
|
+
${M(this.multipleInputRef)}
|
|
1004
1004
|
></pkt-datepicker-multiple>
|
|
1005
|
-
`}renderCalendar(){return
|
|
1005
|
+
`}renderCalendar(){return c`
|
|
1006
1006
|
<pkt-datepicker-popup
|
|
1007
1007
|
class="pkt-contents"
|
|
1008
1008
|
?open=${this.calendarOpen}
|
|
@@ -1016,12 +1016,12 @@
|
|
|
1016
1016
|
.latest=${this.max}
|
|
1017
1017
|
.excludedates=${Array.isArray(this.excludedates)?this.excludedates:this.excludedates.split(",")}
|
|
1018
1018
|
.excludeweekdays=${this.excludeweekdays}
|
|
1019
|
-
.currentmonth=${this.currentmonth?
|
|
1020
|
-
@date-selected=${t=>{this.value=
|
|
1019
|
+
.currentmonth=${this.currentmonth?Pe(this.currentmonth):null}
|
|
1020
|
+
@date-selected=${t=>{this.value=Zi.processDateSelection(t.detail,this.multiple,this.range),this._value=t.detail,Zi.updateInputValues(this.inputRef,this.inputRefTo,this._value,this.range,this.multiple,e=>this.manageValidity(e))}}
|
|
1021
1021
|
@close=${()=>{this.onBlur(),this.hideCalendar()}}
|
|
1022
|
-
${
|
|
1022
|
+
${M(this.datepickerPopupRef)}
|
|
1023
1023
|
></pkt-datepicker-popup>
|
|
1024
|
-
`}render(){return this.inputClasses=
|
|
1024
|
+
`}render(){return this.inputClasses=Js.getInputClasses(this.fullwidth,this.showRangeLabels,this.multiple,this.range,this.readonly,this.inputType),c`
|
|
1025
1025
|
<pkt-input-wrapper
|
|
1026
1026
|
label="${this.label}"
|
|
1027
1027
|
forId="${this.id}-input"
|
|
@@ -1046,14 +1046,14 @@
|
|
|
1046
1046
|
.ariaDescribedBy=${this.ariaDescribedBy}
|
|
1047
1047
|
class="pkt-datepicker"
|
|
1048
1048
|
>
|
|
1049
|
-
<div class="pkt-contents" ${
|
|
1050
|
-
${this.multiple?
|
|
1049
|
+
<div class="pkt-contents" ${M(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1050
|
+
${this.multiple?c`<pkt-date-tags
|
|
1051
1051
|
.dates=${this._value}
|
|
1052
1052
|
dateformat=${this.dateformat}
|
|
1053
1053
|
strings=${this.strings}
|
|
1054
1054
|
id-base=${this.id}
|
|
1055
|
-
@date-tag-removed=${t=>{var e;const i=this.datepickerPopupRef.value,
|
|
1056
|
-
></pkt-date-tags
|
|
1055
|
+
@date-tag-removed=${t=>{var e;const i=this.datepickerPopupRef.value,n=De(t.detail);i&&n&&typeof i.handleDateSelect=="function"?i.handleDateSelect(n):(e=this.calRef.value)==null||e.handleDateSelect(n)}}
|
|
1056
|
+
></pkt-date-tags>`:k}
|
|
1057
1057
|
<div
|
|
1058
1058
|
class="pkt-datepicker__inputs ${this.range&&this.showRangeLabels?"pkt-input__range-inputs":""}"
|
|
1059
1059
|
>
|
|
@@ -1061,41 +1061,411 @@
|
|
|
1061
1061
|
</div>
|
|
1062
1062
|
</pkt-input-wrapper>
|
|
1063
1063
|
${this.renderCalendar()}
|
|
1064
|
-
`}handleCalendarPosition(){const t=this.multiple&&!!this.maxlength;
|
|
1065
|
-
class=${
|
|
1064
|
+
`}handleCalendarPosition(){const t=this.multiple&&!!this.maxlength;Ci.handleCalendarPosition(this.popupRef,this.inputRef,t)}async showCalendar(){var t;const e=this.datepickerPopupRef.value;if(this.calendarOpen=!0,e&&typeof e.show=="function"){e.show(),Qe()&&e.focusOnCurrentDate();return}await wl(20),this.handleCalendarPosition(),Qe()&&((t=this.calRef.value)==null||t.focusOnCurrentDate())}hideCalendar(){const t=this.datepickerPopupRef.value;if(this.calendarOpen=!1,t&&typeof t.hide=="function")return t.hide()}async toggleCalendar(t){t.preventDefault();const e=this.datepickerPopupRef.value;if(e&&typeof e.toggle=="function"){const i=!!e.open;e.toggle(),this.calendarOpen=!i;return}this.calendarOpen?this.hideCalendar():this.showCalendar()}clearInputValue(){this._value=[],this.value="",this.internals.setFormValue(this.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:this._value,bubbles:!0,composed:!0}))}};mt([o({type:String,reflect:!0})],ht.prototype,"value",1),mt([o({type:Array})],ht.prototype,"_value",2),mt([o({type:String,reflect:!0})],ht.prototype,"label",2),mt([o({type:String})],ht.prototype,"dateformat",2),mt([o({type:Boolean,reflect:!0})],ht.prototype,"multiple",2),mt([o({type:Number,reflect:!0})],ht.prototype,"maxlength",2),mt([o({type:Boolean,reflect:!0})],ht.prototype,"range",2),mt([o({type:Boolean})],ht.prototype,"showRangeLabels",2),mt([o({type:String,reflect:!0})],ht.prototype,"min",2),mt([o({type:String,reflect:!0})],ht.prototype,"max",2),mt([o({type:Boolean})],ht.prototype,"weeknumbers",2),mt([o({type:Boolean,reflect:!0})],ht.prototype,"withcontrols",2),mt([o({converter:bs.csvToArray})],ht.prototype,"excludedates",2),mt([o({converter:bs.csvToArray})],ht.prototype,"excludeweekdays",2),mt([o({type:String})],ht.prototype,"currentmonth",2),mt([o({type:Boolean,reflect:!0})],ht.prototype,"calendarOpen",2),mt([o({type:String})],ht.prototype,"timezone",2),mt([D()],ht.prototype,"inputClasses",2),ht=mt([F("pkt-datepicker")],ht);const rh={href:{default:"#"},target:{default:"_self"}},da={props:rh};var oh=Object.defineProperty,lh=Object.getOwnPropertyDescriptor,_s=(s,t,e,i)=>{for(var n=i>1?void 0:i?lh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&oh(t,e,n),n};let es=class extends R{constructor(){super(),this.defaultSlot=N(),this.href=da.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=!1,this.target=da.props.target.default,this.slotController=new rt(this,this.defaultSlot)}render(){const t={"pkt-link":!0,"pkt-link--icon-left":!!this.iconName&&this.iconPosition==="left"||!!(this.iconName&&!this.iconPosition),"pkt-link--icon-right":!!this.iconName&&this.iconPosition==="right","pkt-link--external":this.external};return c`<a
|
|
1065
|
+
class=${E(t)}
|
|
1066
1066
|
href=${this.href}
|
|
1067
1067
|
.target=${this.target}
|
|
1068
|
-
.rel=${this.external?"noopener noreferrer"
|
|
1069
|
-
>${this.iconName?
|
|
1070
|
-
>`}};
|
|
1068
|
+
.rel=${this.external?"noopener noreferrer":k}
|
|
1069
|
+
>${this.iconName?c`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:""} <span ${M(this.defaultSlot)}>Link</span></a
|
|
1070
|
+
>`}};_s([o({type:String,reflect:!0})],es.prototype,"href",2),_s([o({type:String,reflect:!0})],es.prototype,"iconName",2),_s([o({type:String,reflect:!0})],es.prototype,"iconPosition",2),_s([o({type:Boolean,reflect:!0})],es.prototype,"external",2),_s([o({type:String,reflect:!0})],es.prototype,"target",2),es=_s([F("pkt-link")],es);var hh=Object.defineProperty,dh=Object.getOwnPropertyDescriptor,me=(s,t,e,i)=>{for(var n=i>1?void 0:i?dh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&hh(t,e,n),n};let oe=class extends L{constructor(){super(),this.inputRef=N(),this.helptextSlot=N(),this.value="",this.type="text",this.size=null,this.autocomplete=null,this.iconNameRight=null,this.prefix=null,this.suffix=null,this.omitSearchIcon=!1,this.counterCurrent=0,this.slotController=new rt(this,this.helptextSlot)}attributeChangedCallback(t,e,i){t==="value"&&this.value!==e&&(this.counterCurrent=i?i.length:0,this.valueChanged(i,e)),super.attributeChangedCallback(t,e,i)}updated(t){var e;super.updated(t),t.has("value")&&(this.counterCurrent=((e=this.value)==null?void 0:e.length)||0,this.valueChanged(this.value,t.get("value"))),t.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const t=this.type==="search"&&!this.iconNameRight&&!this.omitSearchIcon,e=E({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),i=this.ariaLabelledby||`${this.id}-input-label`;return c`
|
|
1071
|
+
<pkt-input-wrapper
|
|
1072
|
+
label="${this.label}"
|
|
1073
|
+
?counter=${this.counter}
|
|
1074
|
+
?disabled=${this.disabled}
|
|
1075
|
+
?hasError=${this.hasError}
|
|
1076
|
+
?hasFieldset=${this.hasFieldset}
|
|
1077
|
+
?inline=${this.inline}
|
|
1078
|
+
?optionalTag=${this.optionalTag}
|
|
1079
|
+
?required=${this.required}
|
|
1080
|
+
?requiredTag=${this.requiredTag}
|
|
1081
|
+
useWrapper=${this.useWrapper}
|
|
1082
|
+
.ariaDescribedBy=${this.ariaDescribedBy}
|
|
1083
|
+
.counterCurrent=${this.counterCurrent}
|
|
1084
|
+
.counterMaxLength=${this.counterMaxLength}
|
|
1085
|
+
.errorMessage=${this.errorMessage}
|
|
1086
|
+
.forId="${this.id+"-input"}"
|
|
1087
|
+
.helptext=${this.helptext}
|
|
1088
|
+
.helptextDropdown=${this.helptextDropdown}
|
|
1089
|
+
.helptextDropdownButton=${this.helptextDropdownButton}
|
|
1090
|
+
.optionalText=${this.optionalText}
|
|
1091
|
+
.requiredText=${this.requiredText}
|
|
1092
|
+
.tagText=${this.tagText}
|
|
1093
|
+
class="pkt-textinput"
|
|
1094
|
+
>
|
|
1095
|
+
<div class="pkt-contents" ${M(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1096
|
+
<div class="pkt-input__container">
|
|
1097
|
+
${this.prefix?c`<div class="pkt-input-prefix">${this.prefix}</div>`:k}
|
|
1098
|
+
<input
|
|
1099
|
+
${M(this.inputRef)}
|
|
1100
|
+
class=${e}
|
|
1101
|
+
type=${this.type}
|
|
1102
|
+
name=${(this.name||this.id)+"-input"}
|
|
1103
|
+
id=${this.id+"-input"}
|
|
1104
|
+
placeholder=${C(this.placeholder)}
|
|
1105
|
+
aria-labelledby=${i}
|
|
1106
|
+
autocomplete=${this.autocomplete||"off"}
|
|
1107
|
+
minlength=${C(this.minlength||void 0)}
|
|
1108
|
+
maxlength=${C(this.maxlength||void 0)}
|
|
1109
|
+
min=${C(this.min||void 0)}
|
|
1110
|
+
max=${C(this.max||void 0)}
|
|
1111
|
+
step=${C(this.step||void 0)}
|
|
1112
|
+
?readonly=${this.readonly}
|
|
1113
|
+
size=${this.size||k}
|
|
1114
|
+
.value=${this.value}
|
|
1115
|
+
?disabled=${this.disabled}
|
|
1116
|
+
aria-invalid=${this.hasError}
|
|
1117
|
+
aria-errormessage=${`${this.id}-error`}
|
|
1118
|
+
@input=${n=>{this.value=n.target.value,this.onInput(),n.stopImmediatePropagation()}}
|
|
1119
|
+
@change=${n=>{n.stopImmediatePropagation()}}
|
|
1120
|
+
@focus=${n=>{this.onFocus(),n.stopImmediatePropagation()}}
|
|
1121
|
+
@blur=${n=>{this.value=n.target.value,this.onBlur(),n.stopImmediatePropagation()}}
|
|
1122
|
+
@keydown=${n=>{var a;if(n.key==="Enter"){const r=this.internals.form;r?r.requestSubmit():(a=this.inputRef.value)==null||a.blur()}}}
|
|
1123
|
+
/>
|
|
1124
|
+
${this.suffix?c`<div class="pkt-input-suffix">
|
|
1125
|
+
${this.suffix}
|
|
1126
|
+
${this.iconNameRight?c`<pkt-icon
|
|
1127
|
+
class="pkt-input-suffix-icon"
|
|
1128
|
+
name=${this.iconNameRight}
|
|
1129
|
+
></pkt-icon>`:k}
|
|
1130
|
+
${t?c`<pkt-icon
|
|
1131
|
+
class="pkt-input-suffix-icon"
|
|
1132
|
+
name="magnifying-glass-big"
|
|
1133
|
+
></pkt-icon>`:k}
|
|
1134
|
+
</div>`:k}
|
|
1135
|
+
${!this.suffix&&this.iconNameRight?c`<pkt-icon class="pkt-input-icon" name=${this.iconNameRight}></pkt-icon>`:k}
|
|
1136
|
+
${!this.suffix&&t?c`<pkt-icon class="pkt-input-icon" name="magnifying-glass-big"></pkt-icon>`:k}
|
|
1137
|
+
</div>
|
|
1138
|
+
</pkt-input-wrapper>
|
|
1139
|
+
`}};me([o({type:String,reflect:!0})],oe.prototype,"value",2),me([o({type:String})],oe.prototype,"type",2),me([o({type:Number})],oe.prototype,"size",2),me([o({type:String})],oe.prototype,"autocomplete",2),me([o({type:String})],oe.prototype,"iconNameRight",2),me([o({type:String})],oe.prototype,"prefix",2),me([o({type:String})],oe.prototype,"suffix",2),me([o({type:Boolean})],oe.prototype,"omitSearchIcon",2),me([D()],oe.prototype,"counterCurrent",2),oe=me([F("pkt-textinput")],oe);const Qt={fromAttribute(s){return s==null?!1:s===""||s==="true"||s===!0?!0:s==="false"||s===!1?!1:!!s},toAttribute(s){return s?"true":"false"}},ch=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},ph=s=>{if(!s)return;const t=typeof s=="string"?new Date(s):s;if(!isNaN(t.getTime()))return t.toLocaleDateString("nb-NO",{day:"numeric",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"})};var uh=Object.defineProperty,fh=Object.getOwnPropertyDescriptor,ss=(s,t,e,i)=>{for(var n=i>1?void 0:i?fh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&uh(t,e,n),n};let Fe=class extends R{constructor(){super(...arguments),this.canChangeRepresentation=!1,this.logoutOnClick=!1}handleChangeRepresentation(){this.dispatchEvent(new CustomEvent("change-representation",{bubbles:!0,composed:!0}))}handleLogout(){this.dispatchEvent(new CustomEvent("log-out",{bubbles:!0,composed:!0}))}handleMenuItemClick(t){"onClick"in t&&typeof t.onClick=="function"&&t.onClick()}renderLinkOrButton(t,e){const i="href"in t,n=E({"pkt-user-menu__link":!0,"pkt-link-button":!i,"pkt-link":!i,"pkt-link--icon-left":!i,[e||""]:!!e});return i?c`
|
|
1140
|
+
<pkt-link
|
|
1141
|
+
icon-name=${t.iconName||k}
|
|
1142
|
+
href=${t.href}
|
|
1143
|
+
aria-hidden="true"
|
|
1144
|
+
class="pkt-user-menu__link ${e||""}"
|
|
1145
|
+
>
|
|
1146
|
+
${t.title}
|
|
1147
|
+
</pkt-link>
|
|
1148
|
+
`:c`
|
|
1149
|
+
<button class=${n} type="button" @click=${()=>this.handleMenuItemClick(t)}>
|
|
1150
|
+
${t.iconName?c`<pkt-icon
|
|
1151
|
+
name=${t.iconName}
|
|
1152
|
+
class="pkt-link__icon"
|
|
1153
|
+
aria-hidden="true"
|
|
1154
|
+
></pkt-icon>`:k}
|
|
1155
|
+
${t.title}
|
|
1156
|
+
</button>
|
|
1157
|
+
`}renderLinkSection(t){return c`
|
|
1158
|
+
<ul class="pkt-user-menu__sublist">
|
|
1159
|
+
${t.map(e=>c`
|
|
1160
|
+
<li class="pkt-user-menu__subitem">${this.renderLinkOrButton(e)}</li>
|
|
1161
|
+
`)}
|
|
1162
|
+
</ul>
|
|
1163
|
+
`}render(){var t;const e=(t=this.userMenu)==null?void 0:t.map(ch);return c`
|
|
1164
|
+
<nav class="pkt-user-menu" aria-label="Meny for innlogget bruker">
|
|
1165
|
+
<ul class="pkt-user-menu__list">
|
|
1166
|
+
<!-- User section -->
|
|
1167
|
+
${this.user?c`
|
|
1168
|
+
<li class="pkt-user-menu__item">
|
|
1169
|
+
<div class="pkt-user-menu__label">Pålogget som</div>
|
|
1170
|
+
<div class="pkt-user-menu__name" translate="no">${this.user.name}</div>
|
|
1171
|
+
${this.formattedLastLoggedIn?c`
|
|
1172
|
+
<div class="pkt-user-menu__last-logged-in">
|
|
1173
|
+
Sist pålogget: <time>${this.formattedLastLoggedIn}</time>
|
|
1174
|
+
</div>
|
|
1175
|
+
`:k}
|
|
1176
|
+
</li>
|
|
1177
|
+
`:k}
|
|
1178
|
+
|
|
1179
|
+
<!-- User menu items -->
|
|
1180
|
+
${e&&e.length>0?c`
|
|
1181
|
+
<li class="pkt-user-menu__item">${this.renderLinkSection(e)}</li>
|
|
1182
|
+
`:k}
|
|
1183
|
+
|
|
1184
|
+
<!-- Representing section -->
|
|
1185
|
+
${this.representing?c`
|
|
1186
|
+
<li class="pkt-user-menu__item">
|
|
1187
|
+
<div class="pkt-user-menu__label">Representerer</div>
|
|
1188
|
+
<div class="pkt-user-menu__name" translate="no">${this.representing.name}</div>
|
|
1189
|
+
${this.representing.orgNumber?c`<div class="pkt-user-menu__org-number">
|
|
1190
|
+
Org.nr. ${this.representing.orgNumber}
|
|
1191
|
+
</div>`:k}
|
|
1192
|
+
${this.canChangeRepresentation?c`
|
|
1193
|
+
<ul class="pkt-user-menu__sublist mt-size-16">
|
|
1194
|
+
<li class="pkt-user-menu__subitem">
|
|
1195
|
+
${this.renderLinkOrButton({title:"Endre organisasjon",iconName:"cogwheel",onClick:()=>this.handleChangeRepresentation()})}
|
|
1196
|
+
</li>
|
|
1197
|
+
</ul>
|
|
1198
|
+
`:k}
|
|
1199
|
+
</li>
|
|
1200
|
+
`:k}
|
|
1201
|
+
|
|
1202
|
+
<!-- Change representation without representing object -->
|
|
1203
|
+
${!this.representing&&this.canChangeRepresentation?c`
|
|
1204
|
+
<li class="pkt-user-menu__item">
|
|
1205
|
+
<ul class="pkt-user-menu__sublist">
|
|
1206
|
+
<li class="pkt-user-menu__subitem">
|
|
1207
|
+
${this.renderLinkOrButton({title:"Endre organisasjon",iconName:"cogwheel",onClick:()=>this.handleChangeRepresentation()})}
|
|
1208
|
+
</li>
|
|
1209
|
+
</ul>
|
|
1210
|
+
</li>
|
|
1211
|
+
`:k}
|
|
1212
|
+
|
|
1213
|
+
<!-- Logout -->
|
|
1214
|
+
${this.logoutOnClick?c`
|
|
1215
|
+
<li class="pkt-user-menu__item">
|
|
1216
|
+
${this.renderLinkOrButton({title:"Logg ut",iconName:"exit",onClick:()=>this.handleLogout()})}
|
|
1217
|
+
</li>
|
|
1218
|
+
`:k}
|
|
1219
|
+
</ul>
|
|
1220
|
+
</nav>
|
|
1221
|
+
`}};ss([o({type:Object})],Fe.prototype,"user",2),ss([o({type:String,attribute:"formatted-last-logged-in"})],Fe.prototype,"formattedLastLoggedIn",2),ss([o({type:Object})],Fe.prototype,"representing",2),ss([o({type:Array,attribute:"user-menu"})],Fe.prototype,"userMenu",2),ss([o({type:Boolean,attribute:"can-change-representation",converter:Qt})],Fe.prototype,"canChangeRepresentation",2),ss([o({type:Boolean,attribute:"logout-on-click",converter:Qt})],Fe.prototype,"logoutOnClick",2),Fe=ss([F("pkt-header-user-menu")],Fe);var gh=Object.defineProperty,mh=Object.getOwnPropertyDescriptor,Q=(s,t,e,i)=>{for(var n=i>1?void 0:i?mh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&gh(t,e,n),n};const vh="https://punkt-cdn.oslo.kommune.no/14.0/logos/";let Z=class extends R{constructor(){super(),this.searchPlaceholder="Søk",this.searchValue="",this.mobileBreakpoint=768,this.tabletBreakpoint=1280,this.openedMenu="none",this.logOutButtonPlacement="none",this.position="fixed",this.scrollBehavior="hide",this.hideLogo=!1,this.compact=!1,this.showSearch=!1,this.canChangeRepresentation=!1,this.hasLogOut=!1,this.isMobile=!1,this.isTablet=!1,this.openMenu="none",this.isHidden=!1,this.componentWidth=typeof window<"u"?window.innerWidth:0,this.hasSlotContent=!1,this.alignSlotRight=!1,this.alignSearchRight=!1,this.defaultSlot=N(),this.headerRef=N(),this.userContainerRef=N(),this.slotContainerRef=N(),this.searchContainerRef=N(),this.slotContentRef=N(),this.searchMenuRef=N(),this.lastScrollPosition=0,this.savedScrollY=0,this.lastFocusedElement=null,this.shouldRestoreFocus=!1,this.handleScroll=()=>{if(!this.shouldHideOnScroll)return;const t=window.pageYOffset||document.documentElement.scrollTop;t<0||Math.abs(t-this.lastScrollPosition)<60||(this.isHidden=t>this.lastScrollPosition,this.lastScrollPosition=t)},this.handleClickOutside=t=>{const e=t.target;this.user&&this.openMenu==="user"&&!e.closest(".pkt-header-service__user-container")&&(this.openMenu="none"),this.openMenu==="slot"&&!e.closest(".pkt-header-service__slot-container")&&(this.openMenu="none"),this.openMenu==="search"&&!e.closest(".pkt-header-service__search-container")&&!e.closest(".pkt-header-service__search-input")&&(this.openMenu="none")},this.handleFocusOut=(t,e)=>{const i=t.relatedTarget;let n;switch(e){case"user":n=this.userContainerRef;break;case"slot":n=this.slotContainerRef;break;case"search":n=this.searchContainerRef;break;default:return}const a=n.value;a&&(!i||!a.contains(i))&&(this.openMenu="none")},this.handleEscapeKey=t=>{t.key==="Escape"&&this.openMenu!=="none"&&(t.preventDefault(),this.shouldRestoreFocus=!0,this.openMenu="none")},this.slotController=new rt(this,this.defaultSlot)}updateSlots(t){this.hasSlotContent=t.has(null)||t.has(void 0)}connectedCallback(){super.connectedCallback(),this.setupScrollListener()}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.resizeObserver)==null||t.disconnect(),window.removeEventListener("scroll",this.handleScroll),this.unlockScroll()}firstUpdated(){this.setupResizeObserver()}updated(t){if(super.updated(t),t.has("openedMenu")&&this.openedMenu!==this.openMenu&&(this.openMenu=this.openedMenu),(t.has("mobileBreakpoint")||t.has("tabletBreakpoint"))&&(this.updateIsMobile(),this.updateIsTablet()),t.has("openMenu")){const e=t.get("openMenu");this.openMenu!=="none"&&(e==="none"||e===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"&&e!=="none"&&(document.removeEventListener("mousedown",this.handleClickOutside),document.removeEventListener("keydown",this.handleEscapeKey),this.restoreFocus())}(t.has("openMenu")||t.has("isMobile"))&&this.updateScrollLock()}setupResizeObserver(){const t=this.headerRef.value;t&&(this.componentWidth=t.offsetWidth,this.updateIsMobile(),this.updateIsTablet(),this.resizeObserver=new ResizeObserver(e=>{for(const i of e)i.borderBoxSize&&i.borderBoxSize.length>0?this.componentWidth=i.borderBoxSize[0].inlineSize:this.componentWidth=i.contentRect.width,this.updateIsMobile(),this.updateIsTablet()}),this.resizeObserver.observe(t))}updateIsMobile(){this.isMobile=this.componentWidth<this.mobileBreakpoint}updateIsTablet(){this.isTablet=this.componentWidth<this.tabletBreakpoint}updateScrollLock(){this.position==="fixed"&&this.isMobile&&this.openMenu!=="none"?this.lockScroll():this.unlockScroll()}lockScroll(){const t=document.body,e=document.documentElement;this.savedScrollY=window.scrollY||window.pageYOffset;const i=window.innerWidth-e.clientWidth;i>0&&(t.style.paddingRight=`${i}px`),t.style.position="fixed",t.style.top=`-${this.savedScrollY}px`,t.style.left="0",t.style.right="0",t.style.width="100%",t.style.overflow="hidden",e.classList.add("is-scroll-locked")}unlockScroll(){const t=document.body,e=document.documentElement;e.classList.contains("is-scroll-locked")&&(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"),e.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(t){const e=t==="slot"?this.slotContainerRef:this.searchContainerRef,i=t==="slot"?this.slotContentRef:this.searchMenuRef;if(!e.value||!i.value||!this.isTablet||this.isMobile)return;const n=e.value.getBoundingClientRect(),a=i.value.offsetWidth,r=n.left+a>window.innerWidth;t==="slot"?this.alignSlotRight=r:this.alignSearchRight=r}handleMenuToggle(t){this.openMenu!=="none"?this.openMenu="none":(this.lastFocusedElement=document.activeElement,this.openMenu=t)}handleLogoClick(t){this.dispatchEvent(new CustomEvent("logo-click",{bubbles:!0,composed:!0,detail:{originalEvent:t}}))}handleServiceClick(t){this.dispatchEvent(new CustomEvent("service-click",{bubbles:!0,composed:!0,detail:{originalEvent:t}}))}handleLogout(){this.dispatchEvent(new CustomEvent("log-out",{bubbles:!0,composed:!0}))}handleSearch(t){this.dispatchEvent(new CustomEvent("search",{detail:{query:t},bubbles:!0,composed:!0}))}handleSearchChange(t){this.dispatchEvent(new CustomEvent("search-change",{detail:{query:t},bubbles:!0,composed:!0}))}handleSearchInputChange(t){const e=t.target.value;this.handleSearchChange(e)}handleSearchKeyDown(t){t.key==="Enter"&&this.handleSearch(t.target.value)}get formattedLastLoggedIn(){var t;return ph((t=this.user)==null?void 0:t.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 k;const t=c`
|
|
1222
|
+
<pkt-icon name="oslologo" aria-hidden="true" path=${vh}></pkt-icon>
|
|
1223
|
+
`;return this.logoLink&&typeof this.logoLink=="string"?c`
|
|
1224
|
+
<span class="pkt-header-service__logo">
|
|
1225
|
+
<a href=${this.logoLink} aria-label="Tilbake til forside" @click=${this.handleLogoClick}>
|
|
1226
|
+
${t}
|
|
1227
|
+
</a>
|
|
1228
|
+
</span>
|
|
1229
|
+
`:this.hasAttribute("logo-link")?c`
|
|
1230
|
+
<span class="pkt-header-service__logo">
|
|
1231
|
+
<button
|
|
1232
|
+
aria-label="Tilbake til forside"
|
|
1233
|
+
class="pkt-link-button pkt-link pkt-header-service__logo-link"
|
|
1234
|
+
@click=${this.handleLogoClick}
|
|
1235
|
+
>
|
|
1236
|
+
${t}
|
|
1237
|
+
</button>
|
|
1238
|
+
</span>
|
|
1239
|
+
`:c`
|
|
1240
|
+
<span class="pkt-header-service__logo" @click=${this.handleLogoClick}>${t}</span>
|
|
1241
|
+
`}renderServiceName(){return this.serviceName?this.serviceLink&&typeof this.serviceLink=="string"?c`
|
|
1242
|
+
<span class="pkt-header-service__service-name">
|
|
1243
|
+
<pkt-link
|
|
1244
|
+
href=${this.serviceLink}
|
|
1245
|
+
class="pkt-header-service__service-link"
|
|
1246
|
+
@click=${this.handleServiceClick}
|
|
1247
|
+
>
|
|
1248
|
+
${this.serviceName}
|
|
1249
|
+
</pkt-link>
|
|
1250
|
+
</span>
|
|
1251
|
+
`:this.hasAttribute("service-link")?c`
|
|
1252
|
+
<span class="pkt-header-service__service-name">
|
|
1253
|
+
<button
|
|
1254
|
+
class="pkt-link-button pkt-link pkt-header-service__service-link"
|
|
1255
|
+
@click=${this.handleServiceClick}
|
|
1256
|
+
>
|
|
1257
|
+
${this.serviceName}
|
|
1258
|
+
</button>
|
|
1259
|
+
</span>
|
|
1260
|
+
`:c`
|
|
1261
|
+
<span class="pkt-header-service__service-name" @click=${this.handleServiceClick}>
|
|
1262
|
+
<span class="pkt-header-service__service-link">${this.serviceName}</span>
|
|
1263
|
+
</span>
|
|
1264
|
+
`:k}renderSlotContainer(){const t=E({"pkt-header-service__slot-container":!0,"is-open":this.openMenu==="slot"}),e=E({"pkt-header-service__slot-content":!0,"align-right":this.alignSlotRight});return c`
|
|
1265
|
+
<div
|
|
1266
|
+
class=${t}
|
|
1267
|
+
@focusout=${i=>this.handleFocusOut(i,"slot")}
|
|
1268
|
+
${M(this.slotContainerRef)}
|
|
1269
|
+
>
|
|
1270
|
+
${this.isTablet&&this.hasSlotContent?c`
|
|
1271
|
+
<pkt-button
|
|
1272
|
+
skin="secondary"
|
|
1273
|
+
variant="icon-only"
|
|
1274
|
+
iconName="menu"
|
|
1275
|
+
size=${this.isMobile?"small":"medium"}
|
|
1276
|
+
state=${this.openMenu==="slot"?"active":"normal"}
|
|
1277
|
+
@click=${()=>this.handleMenuToggle("slot")}
|
|
1278
|
+
aria-expanded=${this.openMenu==="slot"}
|
|
1279
|
+
aria-controls="mobile-slot-menu"
|
|
1280
|
+
aria-label="Åpne meny"
|
|
1281
|
+
>
|
|
1282
|
+
Meny
|
|
1283
|
+
</pkt-button>
|
|
1284
|
+
`:k}
|
|
1285
|
+
<div
|
|
1286
|
+
class=${e}
|
|
1287
|
+
id="mobile-slot-menu"
|
|
1288
|
+
role=${this.isTablet?"menu":k}
|
|
1289
|
+
aria-label=${this.isTablet?"Meny":k}
|
|
1290
|
+
${M(this.slotContentRef)}
|
|
1291
|
+
${M(this.defaultSlot)}
|
|
1292
|
+
></div>
|
|
1293
|
+
</div>
|
|
1294
|
+
`}renderSearch(){if(!this.showSearch)return k;if(this.isTablet){const t=E({"pkt-header-service__search-container":!0,"is-open":this.openMenu==="search"}),e=E({"pkt-header-service__mobile-menu":!0,"is-open":this.openMenu==="search","align-right":this.alignSearchRight});return c`
|
|
1295
|
+
<div
|
|
1296
|
+
class=${t}
|
|
1297
|
+
@focusout=${i=>this.handleFocusOut(i,"search")}
|
|
1298
|
+
${M(this.searchContainerRef)}
|
|
1299
|
+
>
|
|
1300
|
+
<pkt-button
|
|
1301
|
+
skin="secondary"
|
|
1302
|
+
variant="icon-only"
|
|
1303
|
+
iconName="magnifying-glass-big"
|
|
1304
|
+
size=${this.isMobile?"small":"medium"}
|
|
1305
|
+
@click=${()=>this.handleMenuToggle("search")}
|
|
1306
|
+
state=${this.openMenu==="search"?"active":"normal"}
|
|
1307
|
+
aria-expanded=${this.openMenu==="search"}
|
|
1308
|
+
aria-controls="mobile-search-menu"
|
|
1309
|
+
aria-label="Åpne søkefelt"
|
|
1310
|
+
>
|
|
1311
|
+
Søk
|
|
1312
|
+
</pkt-button>
|
|
1313
|
+
<div class=${e} ${M(this.searchMenuRef)}>
|
|
1314
|
+
${this.openMenu==="search"?c`
|
|
1315
|
+
<pkt-textinput
|
|
1316
|
+
id="mobile-search-menu"
|
|
1317
|
+
class="pkt-header-service__search-input"
|
|
1318
|
+
type="search"
|
|
1319
|
+
label="Søk"
|
|
1320
|
+
useWrapper="false"
|
|
1321
|
+
placeholder=${this.searchPlaceholder}
|
|
1322
|
+
value=${this.searchValue}
|
|
1323
|
+
autofocus
|
|
1324
|
+
fullwidth
|
|
1325
|
+
@input=${this.handleSearchInputChange}
|
|
1326
|
+
@keydown=${i=>{i.key==="Enter"&&this.handleSearch(i.target.value)}}
|
|
1327
|
+
></pkt-textinput>
|
|
1328
|
+
`:k}
|
|
1329
|
+
</div>
|
|
1330
|
+
</div>
|
|
1331
|
+
`}return c`
|
|
1332
|
+
<pkt-textinput
|
|
1333
|
+
id="header-service-search"
|
|
1334
|
+
class="pkt-header-service__search-input"
|
|
1335
|
+
type="search"
|
|
1336
|
+
label="Søk"
|
|
1337
|
+
useWrapper="false"
|
|
1338
|
+
placeholder=${this.searchPlaceholder}
|
|
1339
|
+
value=${this.searchValue}
|
|
1340
|
+
@input=${this.handleSearchInputChange}
|
|
1341
|
+
@keydown=${this.handleSearchKeyDown}
|
|
1342
|
+
></pkt-textinput>
|
|
1343
|
+
`}renderUserButton(){var t;if(!this.user)return k;const e=E({"pkt-header-service__user-menu":this.isMobile===!1,"pkt-header-service__mobile-menu":this.isMobile===!0,"is-open":this.openMenu==="user"});return c`
|
|
1344
|
+
<div
|
|
1345
|
+
class="pkt-header-service__user-container"
|
|
1346
|
+
@focusout=${i=>this.handleFocusOut(i,"user")}
|
|
1347
|
+
${M(this.userContainerRef)}
|
|
1348
|
+
>
|
|
1349
|
+
<pkt-button
|
|
1350
|
+
class=${E({"pkt-header-service__user-button":!0,"pkt-header-service__user-button--mobile":this.isMobile})}
|
|
1351
|
+
skin="secondary"
|
|
1352
|
+
size=${this.isMobile?"small":"medium"}
|
|
1353
|
+
state=${this.openMenu==="user"?"active":"normal"}
|
|
1354
|
+
variant="icons-right-and-left"
|
|
1355
|
+
iconName="user"
|
|
1356
|
+
secondIconName=${this.openMenu==="user"?"chevron-thin-up":"chevron-thin-down"}
|
|
1357
|
+
@click=${()=>this.handleMenuToggle("user")}
|
|
1358
|
+
>
|
|
1359
|
+
<span class="pkt-sr-only">Brukermeny: </span>
|
|
1360
|
+
${((t=this.representing)==null?void 0:t.name)||this.user.name}
|
|
1361
|
+
</pkt-button>
|
|
1362
|
+
${this.openMenu==="user"&&this.user?c`
|
|
1363
|
+
<div class=${e}>
|
|
1364
|
+
<pkt-header-user-menu
|
|
1365
|
+
.user=${this.user}
|
|
1366
|
+
formatted-last-logged-in=${this.formattedLastLoggedIn||k}
|
|
1367
|
+
.representing=${this.representing}
|
|
1368
|
+
.userMenu=${this.userMenu}
|
|
1369
|
+
?can-change-representation=${this.canChangeRepresentation}
|
|
1370
|
+
?logout-on-click=${this.showLogoutInUserMenu}
|
|
1371
|
+
@change-representation=${()=>this.dispatchEvent(new CustomEvent("change-representation",{bubbles:!0,composed:!0}))}
|
|
1372
|
+
@log-out=${this.handleLogout}
|
|
1373
|
+
></pkt-header-user-menu>
|
|
1374
|
+
</div>
|
|
1375
|
+
`:k}
|
|
1376
|
+
</div>
|
|
1377
|
+
`}renderHeader(){const t=E({"pkt-header-service":!0,"pkt-header-service--compact":this.compact,"pkt-header-service--mobile":this.isMobile,"pkt-header-service--tablet":this.isTablet,"pkt-header-service--fixed":this.isFixed,"pkt-header-service--scroll-to-hide":this.shouldHideOnScroll,"pkt-header-service--hidden":this.isHidden}),e=E({"pkt-header-service__logo-area":!0,"pkt-header-service__logo-area--without-service":!this.serviceName});return c`
|
|
1378
|
+
<header class=${t} ${M(this.headerRef)}>
|
|
1379
|
+
<div class=${e}>${this.renderLogo()} ${this.renderServiceName()}</div>
|
|
1380
|
+
|
|
1381
|
+
<div class="pkt-header-service__content">
|
|
1382
|
+
${this.renderSlotContainer()} ${this.renderSearch()}
|
|
1383
|
+
${this.isTablet&&this.showLogoutInHeader?c`
|
|
1384
|
+
<pkt-button
|
|
1385
|
+
skin="secondary"
|
|
1386
|
+
size=${this.isMobile?"small":"medium"}
|
|
1387
|
+
variant="icon-only"
|
|
1388
|
+
iconName="exit"
|
|
1389
|
+
@click=${this.handleLogout}
|
|
1390
|
+
>
|
|
1391
|
+
Logg ut
|
|
1392
|
+
</pkt-button>
|
|
1393
|
+
`:k}
|
|
1394
|
+
</div>
|
|
1395
|
+
|
|
1396
|
+
<div class="pkt-header-service__user">
|
|
1397
|
+
${this.renderUserButton()}
|
|
1398
|
+
${!this.isTablet&&this.showLogoutInHeader?c`
|
|
1399
|
+
<pkt-button
|
|
1400
|
+
skin="tertiary"
|
|
1401
|
+
size="medium"
|
|
1402
|
+
variant="icon-right"
|
|
1403
|
+
iconName="exit"
|
|
1404
|
+
@click=${this.handleLogout}
|
|
1405
|
+
>
|
|
1406
|
+
Logg ut
|
|
1407
|
+
</pkt-button>
|
|
1408
|
+
`:k}
|
|
1409
|
+
</div>
|
|
1410
|
+
</header>
|
|
1411
|
+
`}render(){const t=this.renderHeader();if(this.isFixed){const e=E({"pkt-header-service-spacer":!0,"pkt-header-service-spacer--compact":this.compact,"pkt-header-service-spacer--has-user":!!this.user,"pkt-header-service-spacer--mobile":this.isMobile});return c`
|
|
1412
|
+
<div class="pkt-header-service-wrapper">
|
|
1413
|
+
${t}
|
|
1414
|
+
<div class=${e}></div>
|
|
1415
|
+
</div>
|
|
1416
|
+
`}return t}};Q([o({type:String,attribute:"service-name"})],Z.prototype,"serviceName",2),Q([o({type:String,attribute:"service-link"})],Z.prototype,"serviceLink",2),Q([o({type:String,attribute:"logo-link"})],Z.prototype,"logoLink",2),Q([o({type:String,attribute:"search-placeholder"})],Z.prototype,"searchPlaceholder",2),Q([o({type:String,attribute:"search-value"})],Z.prototype,"searchValue",2),Q([o({type:Number,attribute:"mobile-breakpoint"})],Z.prototype,"mobileBreakpoint",2),Q([o({type:Number,attribute:"tablet-breakpoint"})],Z.prototype,"tabletBreakpoint",2),Q([o({type:String,attribute:"opened-menu"})],Z.prototype,"openedMenu",2),Q([o({type:String,attribute:"log-out-button-placement"})],Z.prototype,"logOutButtonPlacement",2),Q([o({type:String})],Z.prototype,"position",2),Q([o({type:String,attribute:"scroll-behavior"})],Z.prototype,"scrollBehavior",2),Q([o({type:Boolean,attribute:"hide-logo",converter:Qt})],Z.prototype,"hideLogo",2),Q([o({type:Boolean,converter:Qt})],Z.prototype,"compact",2),Q([o({type:Boolean,attribute:"show-search",converter:Qt})],Z.prototype,"showSearch",2),Q([o({type:Boolean,attribute:"can-change-representation",converter:Qt})],Z.prototype,"canChangeRepresentation",2),Q([o({type:Boolean,attribute:"has-log-out",converter:Qt})],Z.prototype,"hasLogOut",2),Q([o({type:Object})],Z.prototype,"user",2),Q([o({type:Array,attribute:"user-menu"})],Z.prototype,"userMenu",2),Q([o({type:Object})],Z.prototype,"representing",2),Q([D()],Z.prototype,"isMobile",2),Q([D()],Z.prototype,"isTablet",2),Q([D()],Z.prototype,"openMenu",2),Q([D()],Z.prototype,"isHidden",2),Q([D()],Z.prototype,"componentWidth",2),Q([D()],Z.prototype,"hasSlotContent",2),Q([D()],Z.prototype,"alignSlotRight",2),Q([D()],Z.prototype,"alignSearchRight",2),Z=Q([F("pkt-header-service")],Z);var bh=Object.defineProperty,kh=Object.getOwnPropertyDescriptor,ot=(s,t,e,i)=>{for(var n=i>1?void 0:i?kh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&bh(t,e,n),n};let at=class extends R{constructor(){super(),this.defaultSlot=N(),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.hideLogo=!1,this.compact=!1,this.showSearch=!1,this.canChangeRepresentation=!1,this.hasLogOut=!1,this.slotController=new rt(this,this.defaultSlot)}firstUpdated(t){super.firstUpdated(t),this.emitDeprecationWarnings()}emitDeprecationWarnings(){this.userMenuFooter!==void 0&&console.warn("[PktHeader] userMenuFooter is deprecated. Use userMenu instead."),this.userOptions!==void 0&&console.warn("[PktHeader] userOptions is deprecated. Use userMenu instead.")}get effectiveUserMenu(){const t=this.userMenu||[],e=this.userMenuFooter||[],i=this.userOptions||[];return e.length||i.length?[...t,...i,...e]:this.userMenu}render(){return c`
|
|
1417
|
+
<pkt-header-service
|
|
1418
|
+
service-name=${C(this.serviceName)}
|
|
1419
|
+
service-link=${C(this.serviceLink)}
|
|
1420
|
+
logo-link=${C(this.logoLink)}
|
|
1421
|
+
search-placeholder=${this.searchPlaceholder}
|
|
1422
|
+
search-value=${this.searchValue}
|
|
1423
|
+
mobile-breakpoint=${this.mobileBreakpoint}
|
|
1424
|
+
tablet-breakpoint=${this.tabletBreakpoint}
|
|
1425
|
+
opened-menu=${this.openedMenu}
|
|
1426
|
+
log-out-button-placement=${this.logOutButtonPlacement}
|
|
1427
|
+
position=${this.position}
|
|
1428
|
+
scroll-behavior=${this.scrollBehavior}
|
|
1429
|
+
.hideLogo=${this.hideLogo}
|
|
1430
|
+
.compact=${this.compact}
|
|
1431
|
+
.showSearch=${this.showSearch}
|
|
1432
|
+
.canChangeRepresentation=${this.canChangeRepresentation}
|
|
1433
|
+
.hasLogOut=${this.hasLogOut}
|
|
1434
|
+
.user=${this.user}
|
|
1435
|
+
.userMenu=${this.effectiveUserMenu}
|
|
1436
|
+
.representing=${this.representing}
|
|
1437
|
+
>
|
|
1438
|
+
<div class="pkt-contents" ${M(this.defaultSlot)}></div>
|
|
1439
|
+
</pkt-header-service>
|
|
1440
|
+
`}};ot([o({type:String,attribute:"service-name"})],at.prototype,"serviceName",2),ot([o({type:String,attribute:"service-link"})],at.prototype,"serviceLink",2),ot([o({type:String,attribute:"logo-link"})],at.prototype,"logoLink",2),ot([o({type:String,attribute:"search-placeholder"})],at.prototype,"searchPlaceholder",2),ot([o({type:String,attribute:"search-value"})],at.prototype,"searchValue",2),ot([o({type:Number,attribute:"mobile-breakpoint"})],at.prototype,"mobileBreakpoint",2),ot([o({type:Number,attribute:"tablet-breakpoint"})],at.prototype,"tabletBreakpoint",2),ot([o({type:String,attribute:"opened-menu"})],at.prototype,"openedMenu",2),ot([o({type:String,attribute:"log-out-button-placement"})],at.prototype,"logOutButtonPlacement",2),ot([o({type:String})],at.prototype,"position",2),ot([o({type:String,attribute:"scroll-behavior"})],at.prototype,"scrollBehavior",2),ot([o({type:Boolean,attribute:"hide-logo",converter:Qt})],at.prototype,"hideLogo",2),ot([o({type:Boolean,converter:Qt})],at.prototype,"compact",2),ot([o({type:Boolean,attribute:"show-search",converter:Qt})],at.prototype,"showSearch",2),ot([o({type:Boolean,attribute:"can-change-representation",converter:Qt})],at.prototype,"canChangeRepresentation",2),ot([o({type:Boolean,attribute:"has-log-out",converter:Qt})],at.prototype,"hasLogOut",2),ot([o({type:Object})],at.prototype,"user",2),ot([o({type:Array,attribute:"user-menu"})],at.prototype,"userMenu",2),ot([o({type:Object})],at.prototype,"representing",2),ot([o({type:Array,attribute:"user-menu-footer"})],at.prototype,"userMenuFooter",2),ot([o({type:Array,attribute:"user-options"})],at.prototype,"userOptions",2),at=ot([F("pkt-header")],at);var yh=Object.defineProperty,$h=Object.getOwnPropertyDescriptor,is=(s,t,e,i)=>{for(var n=i>1?void 0:i?$h(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&yh(t,e,n),n};let je=class extends R{constructor(){super(),this.defaultSlot=N(),this.title="",this.href="#",this.iconName="",this.external=!1,this.openInNewTab=!1,this.skin="normal",this.slotController=new rt(this,this.defaultSlot)}render(){const t=["pkt-linkcard",this.skin&&`pkt-linkcard--${this.skin}`].filter(Boolean).join(" "),e=["pkt-linkcard__title",this.external&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return c`
|
|
1071
1441
|
<a
|
|
1072
1442
|
href=${this.href}
|
|
1073
1443
|
class=${t}
|
|
1074
1444
|
target=${this.openInNewTab?"_blank":"_self"}
|
|
1075
|
-
rel=${
|
|
1445
|
+
rel=${C(this.openInNewTab?"noopener noreferrer":void 0)}
|
|
1076
1446
|
>
|
|
1077
|
-
${this.iconName&&
|
|
1078
|
-
${this.title&&
|
|
1447
|
+
${this.iconName&&c`<pkt-icon class="pkt-link__icon" name="${this.iconName}" />`}
|
|
1448
|
+
${this.title&&c`<div class=${e}>${this.title}</div>`}
|
|
1079
1449
|
|
|
1080
|
-
<div class="pkt-linkcard__text" ${
|
|
1450
|
+
<div class="pkt-linkcard__text" ${M(this.defaultSlot)}></div>
|
|
1081
1451
|
</a>
|
|
1082
|
-
`}};
|
|
1452
|
+
`}};is([o({type:String,reflect:!0})],je.prototype,"title",2),is([o({type:String,reflect:!0})],je.prototype,"href",2),is([o({type:String,reflect:!0})],je.prototype,"iconName",2),is([o({type:Boolean,reflect:!0})],je.prototype,"external",2),is([o({type:Boolean,reflect:!0})],je.prototype,"openInNewTab",2),is([o({type:String,reflect:!0})],je.prototype,"skin",2),je=is([F("pkt-linkcard")],je);var _h=Object.defineProperty,wh=Object.getOwnPropertyDescriptor,we=(s,t,e,i)=>{for(var n=i>1?void 0:i?wh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&_h(t,e,n),n};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/14.0/animations/";let le=class extends R{constructor(){super(),this.defaultSlot=N(),this.delay=0,this.inline=!1,this.isLoading=!0,this.message=null,this.size="medium",this.variant="shapes",this.loadingAnimationPath=window.pktAnimationPath,this._shouldDisplayLoader=!1,this.slotController=new rt(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(t){t.has("delay")&&this.setupLoader()}render(){const t=E({"pkt-loader":!0,[`pkt-loader--${this.inline?"inline":"box"}`]:!0,[`pkt-loader--${this.size}`]:!0}),e=E({"pkt-contents":!0,"pkt-hide":this.isLoading});return c`<div
|
|
1083
1453
|
role="status"
|
|
1084
1454
|
aria-live="polite"
|
|
1085
1455
|
aria-busy=${this.isLoading?"true":"false"}
|
|
1086
1456
|
class=${t}
|
|
1087
1457
|
>
|
|
1088
|
-
${this.isLoading&&this._shouldDisplayLoader?
|
|
1458
|
+
${this.isLoading&&this._shouldDisplayLoader?c`<div class="pkt-loader__spinner">
|
|
1089
1459
|
<pkt-icon
|
|
1090
1460
|
name=${this.getVariant(this.variant)}
|
|
1091
1461
|
path=${this.loadingAnimationPath}
|
|
1092
1462
|
class="pkt-loader__svg pkt-loader__${this.variant}"
|
|
1093
1463
|
></pkt-icon>
|
|
1094
|
-
${this.message&&
|
|
1095
|
-
</div
|
|
1096
|
-
<div class=${e} ${
|
|
1097
|
-
</div>`}getVariant(t){switch(t){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))}};
|
|
1098
|
-
${this.closable?
|
|
1464
|
+
${this.message&&c`<p>${this.message}</p>`}
|
|
1465
|
+
</div>`:k}
|
|
1466
|
+
<div class=${e} ${M(this.defaultSlot)}></div>
|
|
1467
|
+
</div>`}getVariant(t){switch(t){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))}};we([o({type:Number})],le.prototype,"delay",2),we([o({type:Boolean})],le.prototype,"inline",2),we([o({type:Boolean})],le.prototype,"isLoading",2),we([o({type:String})],le.prototype,"message",2),we([o({type:String})],le.prototype,"size",2),we([o({type:String})],le.prototype,"variant",2),we([o({type:String})],le.prototype,"loadingAnimationPath",2),we([D()],le.prototype,"_shouldDisplayLoader",2),le=we([F("pkt-loader")],le);const xh={skin:{default:"beige"},compact:{default:!1},closable:{default:!1}},Xi={props:xh};var Sh=Object.defineProperty,Ch=Object.getOwnPropertyDescriptor,ws=(s,t,e,i)=>{for(var n=i>1?void 0:i?Ch(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Sh(t,e,n),n};let ns=class extends R{constructor(){super(),this.defaultSlot=N(),this.closable=Xi.props.closable.default,this.compact=Xi.props.compact.default,this.title="",this.skin=Xi.props.skin.default,this._isClosed=!1,this.close=s=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:s},bubbles:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:s},bubbles:!0}))},this.slotController=new rt(this,this.defaultSlot),this._isClosed=!1}updated(s){super.updated(s),s.has("_isClosed")&&Bn(this,"pkt-hide",this._isClosed)}render(){const s={"pkt-messagebox":!0,"pkt-messagebox--compact":this.compact,[`pkt-messagebox--${this.skin}`]:this.skin,"pkt-messagebox--closable":this.closable,"pkt-hide":this._isClosed};return c`<div class=${E(s)}>
|
|
1468
|
+
${this.closable?c`<div class="pkt-messagebox__close">
|
|
1099
1469
|
<button
|
|
1100
1470
|
@click=${this.close}
|
|
1101
1471
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only"
|
|
@@ -1103,75 +1473,75 @@
|
|
|
1103
1473
|
>
|
|
1104
1474
|
<pkt-icon name="close" class="pkt-link__icon"></pkt-icon>
|
|
1105
1475
|
</button>
|
|
1106
|
-
</div
|
|
1107
|
-
${this.title?
|
|
1108
|
-
<div class="pkt-messagebox__text" ${
|
|
1109
|
-
</div>`}};
|
|
1476
|
+
</div>`:k}
|
|
1477
|
+
${this.title?c`<div class="pkt-messagebox__title">${this.title}</div>`:k}
|
|
1478
|
+
<div class="pkt-messagebox__text" ${M(this.defaultSlot)}></div>
|
|
1479
|
+
</div>`}};ws([o({type:Boolean,reflect:!0})],ns.prototype,"closable",2),ws([o({type:Boolean,reflect:!0})],ns.prototype,"compact",2),ws([o({type:String,reflect:!0})],ns.prototype,"title",2),ws([o({type:String,reflect:!0})],ns.prototype,"skin",2),ws([D()],ns.prototype,"_isClosed",2),ns=ws([F("pkt-messagebox")],ns);const Th={hideCloseButton:{default:!1},closeOnBackdropClick:{default:!1},size:{default:"medium"}},Ji={props:Th};var Eh=Object.defineProperty,Nh=Object.getOwnPropertyDescriptor,he=(s,t,e,i)=>{for(var n=i>1?void 0:i?Nh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Eh(t,e,n),n};let Rt=class extends R{constructor(){super(),this.headingText="",this.removePadding=!1,this.hideCloseButton=Ji.props.hideCloseButton.default,this.closeOnBackdropClick=Ji.props.closeOnBackdropClick.default,this.closeButtonSkin="blue",this.size=Ji.props.size.default,this.variant="dialog",this.drawerPosition="right",this.transparentBackdrop=!1,this.defaultSlot=N(),this.dialogRef=N(),this._isOpen=!1,this.close=(t,e=!1)=>{var i;if(!this._isOpen)return;this._isOpen=!1,document.body.classList.remove("pkt-modal--open");const n=document.activeElement;n&&!this.isElementInViewport(n)&&n.scrollIntoView({behavior:"smooth",block:"nearest"}),this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!0,composed:!0})),e||(i=this.dialogRef.value)==null||i.close(),this.requestUpdate()},this.showModal=(t=null)=>{var e;this._isOpen=!0,(e=this.dialogRef.value)==null||e.showModal();const i=document.querySelector(".pkt-modal");requestAnimationFrame(()=>{var n;this.dialogRef.value&&((n=this.dialogRef.value)==null||n.focus())}),i&&document.body.classList.add("pkt-modal--open"),this.dispatchEvent(new CustomEvent("showModal",{detail:{origin:t},bubbles:!0,composed:!0})),this.requestUpdate()},this.slotController=new rt(this,this.defaultSlot),this._isOpen=!1}async connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleKeyDown.bind(this)),document.addEventListener("click",this.handleBackdropClick.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("click",this.handleBackdropClick)}async firstUpdated(t){super.firstUpdated(t),this.dialogRef.value&&!window.HTMLDialogElement&&!this.dialogRef.value.showModal&&("document"in window&&"createElement"in document&&(await Promise.resolve().then(()=>jd).then(e=>e.default)).registerDialog(this.dialogRef.value),this.dialogRef.value.addEventListener("close",()=>{this.close(new Event("close"),!0)}))}handleKeyDown(t){t.key==="Escape"&&this.close(t)}handleBackdropClick(t){var e;this.closeOnBackdropClick&&t.target===((e=this.dialogRef)==null?void 0:e.value)&&this.close(t)}isElementInViewport(t){const e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}render(){const t={"pkt-modal":!0,"pkt-modal--removePadding":this.removePadding??!1,"pkt-modal--noHeadingText":this.headingText===""||this.headingText===void 0,"pkt-modal--noShadow":this.closeButtonSkin==="yellow-filled","pkt-modal--transparentBackdrop":this.transparentBackdrop??!1,[`pkt-modal--${this.size}`]:this.size!==void 0,[`pkt-modal__${this.variant}`]:this.variant!==void 0,[`pkt-modal__drawer--${this.drawerPosition}`]:this.variant==="drawer"},e={"pkt-modal__headingText":!0,"pkt-txt-24":!0},i={"pkt-modal__content":!0,"pkt-txt-18-light":!0},n=this.closeButtonSkin==="blue",a={"pkt-modal__closeButton":!0,[`pkt-modal__closeButton--${this.closeButtonSkin}`]:!0};return c`
|
|
1110
1480
|
<dialog
|
|
1111
|
-
class=${
|
|
1112
|
-
${
|
|
1481
|
+
class=${E(t)}
|
|
1482
|
+
${M(this.dialogRef)}
|
|
1113
1483
|
aria-labelledby="pkt-modal__headingText"
|
|
1114
1484
|
aria-describedby="pkt-modal__content"
|
|
1115
1485
|
@close=${r=>this.close(r,!0)}
|
|
1116
1486
|
>
|
|
1117
1487
|
<div class="pkt-modal__wrapper">
|
|
1118
|
-
${this.headingText||!this.hideCloseButton?
|
|
1488
|
+
${this.headingText||!this.hideCloseButton?c`<div class="pkt-modal__header">
|
|
1119
1489
|
<div class="pkt-modal__header-background"></div>
|
|
1120
|
-
${this.headingText?
|
|
1490
|
+
${this.headingText?c`<h1 id="pkt-modal__headingText" class=${E(e)}>
|
|
1121
1491
|
${this.headingText}
|
|
1122
|
-
</h1>`:
|
|
1123
|
-
${this.hideCloseButton?
|
|
1492
|
+
</h1>`:c`<div class="pkt-modal__headingText"></div>`}
|
|
1493
|
+
${this.hideCloseButton?c`<div class="pkt-modal__noCloseButton"></div>`:c`<div class="${E(a)}">
|
|
1124
1494
|
<pkt-button
|
|
1125
1495
|
@click=${r=>this.close(r)}
|
|
1126
1496
|
aria-label="close"
|
|
1127
1497
|
iconname="close"
|
|
1128
1498
|
variant="icon-only"
|
|
1129
1499
|
size="medium"
|
|
1130
|
-
skin=${
|
|
1500
|
+
skin=${n?"tertiary":"primary"}
|
|
1131
1501
|
>
|
|
1132
1502
|
Lukk
|
|
1133
1503
|
</pkt-button>
|
|
1134
1504
|
</div>`}
|
|
1135
|
-
</div
|
|
1505
|
+
</div>`:k}
|
|
1136
1506
|
<div class="pkt-modal__container">
|
|
1137
1507
|
<div
|
|
1138
1508
|
id="pkt-modal__content"
|
|
1139
|
-
class=${
|
|
1140
|
-
${
|
|
1509
|
+
class=${E(i)}
|
|
1510
|
+
${M(this.defaultSlot)}
|
|
1141
1511
|
></div>
|
|
1142
1512
|
</div>
|
|
1143
1513
|
</div>
|
|
1144
1514
|
</dialog>
|
|
1145
|
-
`}};
|
|
1515
|
+
`}};he([o({type:String})],Rt.prototype,"headingText",2),he([o({type:Boolean})],Rt.prototype,"removePadding",2),he([o({type:Boolean})],Rt.prototype,"hideCloseButton",2),he([o({type:Boolean})],Rt.prototype,"closeOnBackdropClick",2),he([o({type:String})],Rt.prototype,"closeButtonSkin",2),he([o({type:String})],Rt.prototype,"size",2),he([o({type:String})],Rt.prototype,"variant",2),he([o({type:String})],Rt.prototype,"drawerPosition",2),he([o({type:Boolean})],Rt.prototype,"transparentBackdrop",2),he([D()],Rt.prototype,"_isOpen",2),Rt=he([F("pkt-modal")],Rt);/**
|
|
1146
1516
|
* @license
|
|
1147
1517
|
* Copyright 2018 Google LLC
|
|
1148
1518
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1149
|
-
*/const
|
|
1519
|
+
*/const ca="important",Mh=" !"+ca,Ah=We(class extends us{constructor(s){var t;if(super(s),s.type!==ne.ATTRIBUTE||s.name!=="style"||((t=s.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(s){return Object.keys(s).reduce(((t,e)=>{const i=s[e];return i==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(s,[t]){const{style:e}=s.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const i of this.ft)t[i]==null&&(this.ft.delete(i),i.includes("-")?e.removeProperty(i):e[i]=null);for(const i in t){const n=t[i];if(n!=null){this.ft.add(i);const a=typeof n=="string"&&n.endsWith(Mh);i.includes("-")||a?e.setProperty(i,a?n.slice(0,-11):n,a?ca:""):e[i]=n}}return Dt}});var Oh=Object.defineProperty,Ph=Object.getOwnPropertyDescriptor,vt=(s,t,e,i)=>{for(var n=i>1?void 0:i?Ph(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Oh(t,e,n),n};let dt=class extends R{constructor(){super(),this.ariaLabel=null,this.ariaLabelledby=null,this.ariaValueText=null,this.ariaLive="polite",this.id=Be(),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=N(),this.progressBarRef=N()}firstUpdated(s){super.firstUpdated(s),this.setComputedValues(),this.syncAttributes()}updated(s){super.updated(s),s.has("valueCurrent")&&this.labelRef.value&&(this.labelWidth=this.labelRef.value.getBoundingClientRect().width||0),s.has("id")&&this.id&&(this.progressBarId=this.id),(s.has("statusType")||s.has("id")||s.has("ariaLabelledby"))&&(this.progressbarId=this.id||Be(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`),(s.has("ariaValueText")||s.has("valueCurrent")||s.has("valueMax"))&&(this.computedAriaValueText=this.statusType==="fraction"&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||""),this.syncAttributes()}render(){const s=this.statusType!=="none",t=this.valueMax-this.valueMin,e=this.valueCurrent/t*100,i=this.statusType==="fraction"?Math.round(e):Math.round((this.valueCurrent-this.valueMin)/(this.valueMax-this.valueMin)*100),n=`${this.valueCurrent} av ${t}`,a=E({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),r=E({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition==="center"}),h=E({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement==="center"}),d=E({"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 c` <div
|
|
1150
1520
|
class="pkt-progressbar__container"
|
|
1151
1521
|
.ref=${this.progressBarRef}
|
|
1152
|
-
style=${
|
|
1522
|
+
style=${Ah({"--pkt-progress-label-width":`${this.labelWidth}px`,"--pkt-progress-width":`${i}%`})}
|
|
1153
1523
|
>
|
|
1154
|
-
${this.title?
|
|
1524
|
+
${this.title?c`<p id=${`${this.progressBarId}-title`} class=${r}>${this.title}</p>`:k}
|
|
1155
1525
|
|
|
1156
1526
|
<div class="pkt-progressbar__bar-wrapper">
|
|
1157
|
-
<div class=${
|
|
1527
|
+
<div class=${a}></div>
|
|
1158
1528
|
</div>
|
|
1159
1529
|
|
|
1160
|
-
${s?
|
|
1161
|
-
<span class=${d} ${
|
|
1162
|
-
${this.statusType==="percentage"?`${i}%`:
|
|
1530
|
+
${s?c`<div class=${h}>
|
|
1531
|
+
<span class=${d} ${M(this.labelRef)}>
|
|
1532
|
+
${this.statusType==="percentage"?`${i}%`:n}
|
|
1163
1533
|
</span>
|
|
1164
|
-
</div
|
|
1165
|
-
</div>`}setComputedValues(){this.progressbarId=this.id||
|
|
1166
|
-
${this.tagText?
|
|
1167
|
-
${this.optionalTag?
|
|
1168
|
-
${this.requiredTag?
|
|
1169
|
-
`,
|
|
1534
|
+
</div>`:k}
|
|
1535
|
+
</div>`}setComputedValues(){this.progressbarId=this.id||Be(),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(s,t){t==null||t===""?this.removeAttribute(s):this.setAttribute(s,String(t))}};vt([o({type:String})],dt.prototype,"ariaLabel",2),vt([o({type:String,reflect:!0})],dt.prototype,"ariaLabelledby",2),vt([o({type:String,reflect:!0})],dt.prototype,"ariaValueText",2),vt([o({type:String})],dt.prototype,"ariaLive",2),vt([o({type:String,reflect:!0})],dt.prototype,"id",2),vt([o({type:String})],dt.prototype,"role",2),vt([o({type:String})],dt.prototype,"skin",2),vt([o({type:String})],dt.prototype,"statusPlacement",2),vt([o({type:String})],dt.prototype,"statusType",2),vt([o({type:String,reflect:!0})],dt.prototype,"title",2),vt([o({type:String})],dt.prototype,"titlePosition",2),vt([o({type:Number,reflect:!0})],dt.prototype,"valueCurrent",2),vt([o({type:Number})],dt.prototype,"valueMax",2),vt([o({type:Number})],dt.prototype,"valueMin",2),vt([D()],dt.prototype,"labelWidth",2),vt([D()],dt.prototype,"progressbarId",2),vt([D()],dt.prototype,"computedAriaLabelledby",2),vt([D()],dt.prototype,"computedAriaValueText",2),dt=vt([F("pkt-progressbar")],dt);var Dh=Object.defineProperty,Ih=Object.getOwnPropertyDescriptor,Kt=(s,t,e,i)=>{for(var n=i>1?void 0:i?Ih(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Dh(t,e,n),n};let Ft=class extends L{constructor(){super(...arguments),this.inputRef=N(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.checked=null,this.type="radio",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut",this._checked=!1}connectedCallback(){super.connectedCallback()}attributeChangedCallback(s,t,e){s==="defaultChecked"&&(this._checked=this.defaultChecked),s==="checked"&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(s,t,e)}render(){const s=E({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),t=E({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),e=E({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-sr-only":this.hideLabel}),i="pkt-tag pkt-tag--small pkt-tag--thin-text",n=()=>c`
|
|
1536
|
+
${this.tagText?c`<span class=${i+" pkt-tag--gray"}>${this.tagText}</span>`:k}
|
|
1537
|
+
${this.optionalTag?c`<span class=${i+" pkt-tag--blue-light"}>${this.optionalText}</span>`:k}
|
|
1538
|
+
${this.requiredTag?c`<span class=${i+" pkt-tag--beige"}>${this.requiredText}</span>`:k}
|
|
1539
|
+
`,a=()=>c`
|
|
1170
1540
|
<label class=${e} for=${this.id+"-internal"}>
|
|
1171
|
-
${this.label} ${
|
|
1172
|
-
${this.checkHelptext?
|
|
1541
|
+
${this.label} ${n()}
|
|
1542
|
+
${this.checkHelptext?c`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:k}
|
|
1173
1543
|
</label>
|
|
1174
|
-
`;return
|
|
1544
|
+
`;return c`
|
|
1175
1545
|
<div class="pkt-input-check">
|
|
1176
1546
|
<div class=${s}>
|
|
1177
1547
|
<input
|
|
@@ -1182,21 +1552,21 @@
|
|
|
1182
1552
|
?disabled=${this.disabled}
|
|
1183
1553
|
form=""
|
|
1184
1554
|
name=${this.name+"-internal"}
|
|
1185
|
-
${
|
|
1555
|
+
${M(this.inputRef)}
|
|
1186
1556
|
@change=${this.toggleChecked}
|
|
1187
1557
|
@input=${this.onInput}
|
|
1188
1558
|
@blur=${this.onBlur}
|
|
1189
1559
|
@focus=${this.onFocus}
|
|
1190
1560
|
?checked=${this.checked}
|
|
1191
1561
|
/>
|
|
1192
|
-
${
|
|
1562
|
+
${a()}
|
|
1193
1563
|
</div>
|
|
1194
1564
|
</div>
|
|
1195
|
-
`}toggleChecked(s=null){s&&s.preventDefault(),s&&s.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this._checked=this.inputRef.value.matches(":checked"),this.valueChecked(this._checked))}};
|
|
1565
|
+
`}toggleChecked(s=null){s&&s.preventDefault(),s&&s.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this._checked=this.inputRef.value.matches(":checked"),this.valueChecked(this._checked))}};Kt([o({type:String,reflect:!0})],Ft.prototype,"value",2),Kt([o({type:String})],Ft.prototype,"checkHelptext",2),Kt([o({type:Boolean})],Ft.prototype,"defaultChecked",2),Kt([o({type:Boolean})],Ft.prototype,"hasTile",2),Kt([o({type:Boolean,reflect:!0})],Ft.prototype,"checked",2),Kt([o({type:String,reflect:!0})],Ft.prototype,"type",2),Kt([o({type:String})],Ft.prototype,"tagText",2),Kt([o({type:Boolean})],Ft.prototype,"optionalTag",2),Kt([o({type:String})],Ft.prototype,"optionalText",2),Kt([o({type:Boolean})],Ft.prototype,"requiredTag",2),Kt([o({type:String})],Ft.prototype,"requiredText",2),Kt([D()],Ft.prototype,"_checked",2),Ft=Kt([F("pkt-radiobutton")],Ft);/**
|
|
1196
1566
|
* @license
|
|
1197
1567
|
* Copyright 2021 Google LLC
|
|
1198
1568
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1199
|
-
*/let
|
|
1569
|
+
*/let pa=class extends Event{constructor(t,e,i,n){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e,this.callback=i,this.subscribe=n??!1}};/**
|
|
1200
1570
|
* @license
|
|
1201
1571
|
* Copyright 2021 Google LLC
|
|
1202
1572
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -1204,63 +1574,63 @@
|
|
|
1204
1574
|
* @license
|
|
1205
1575
|
* Copyright 2021 Google LLC
|
|
1206
1576
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1207
|
-
*/let
|
|
1577
|
+
*/let ua=class{constructor(t,e,i,n){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(a,r)=>{this.unsubscribe&&(this.unsubscribe!==r&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=a,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(a,r)),this.unsubscribe=r},this.host=t,e.context!==void 0){const a=e;this.context=a.context,this.callback=a.callback,this.subscribe=a.subscribe??!1}else this.context=e,this.callback=i,this.subscribe=n??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new pa(this.context,this.host,this.t,this.subscribe))}};/**
|
|
1208
1578
|
* @license
|
|
1209
1579
|
* Copyright 2021 Google LLC
|
|
1210
1580
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1211
|
-
*/class
|
|
1581
|
+
*/class Lh{get value(){return this.o}set value(t){this.setValue(t)}setValue(t,e=!1){const i=e||!Object.is(t,this.o);this.o=t,i&&this.updateObservers()}constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(const[e,{disposer:i}]of this.subscriptions)e(this.o,i)},t!==void 0&&(this.value=t)}addCallback(t,e,i){if(!i)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:e});const{disposer:n}=this.subscriptions.get(t);t(this.value,n)}clearCallbacks(){this.subscriptions.clear()}}/**
|
|
1212
1582
|
* @license
|
|
1213
1583
|
* Copyright 2021 Google LLC
|
|
1214
1584
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1215
|
-
*/let
|
|
1585
|
+
*/let Bh=class extends Event{constructor(t,e){super("context-provider",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e}},fa=class extends Lh{constructor(t,e,i){var n,a;super(e.context!==void 0?e.initialValue:i),this.onContextRequest=r=>{if(r.context!==this.context)return;const h=r.contextTarget??r.composedPath()[0];h!==this.host&&(r.stopPropagation(),this.addCallback(r.callback,h,r.subscribe))},this.onProviderRequest=r=>{if(r.context!==this.context||(r.contextTarget??r.composedPath()[0])===this.host)return;const h=new Set;for(const[d,{consumerHost:u}]of this.subscriptions)h.has(d)||(h.add(d),u.dispatchEvent(new pa(this.context,u,d,!0)));r.stopPropagation()},this.host=t,e.context!==void 0?this.context=e.context:this.context=e,this.attachListeners(),(a=(n=this.host).addController)==null||a.call(n,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new Bh(this.context,this.host))}};/**
|
|
1216
1586
|
* @license
|
|
1217
1587
|
* Copyright 2017 Google LLC
|
|
1218
1588
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1219
|
-
*/function
|
|
1589
|
+
*/function Fh({context:s}){return(t,e)=>{const i=new WeakMap;if(typeof e=="object")return{get(){return t.get.call(this)},set(n){return i.get(this).setValue(n),t.set.call(this,n)},init(n){return i.set(this,new fa(this,{context:s,initialValue:n})),n}};{t.constructor.addInitializer((r=>{i.set(r,new fa(r,{context:s}))}));const n=Object.getOwnPropertyDescriptor(t,e);let a;if(n===void 0){const r=new WeakMap;a={get(){return r.get(this)},set(h){i.get(this).setValue(h),r.set(this,h)},configurable:!0,enumerable:!0}}else{const r=n.set;a={...n,set(h){i.get(this).setValue(h),r==null||r.call(this,h)}}}return void Object.defineProperty(t,e,a)}}}/**
|
|
1220
1590
|
* @license
|
|
1221
1591
|
* Copyright 2022 Google LLC
|
|
1222
1592
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1223
|
-
*/function
|
|
1593
|
+
*/function jh({context:s,subscribe:t}){return(e,i)=>{typeof i=="object"?i.addInitializer((function(){new ua(this,{context:s,callback:n=>{e.set.call(this,n)},subscribe:t})})):e.constructor.addInitializer((n=>{new ua(n,{context:s,callback:a=>{n[i]=a},subscribe:t})}))}}const ga=Symbol("pkt-tabs-context");var Hh=Object.defineProperty,Vh=Object.getOwnPropertyDescriptor,xs=(s,t,e,i)=>{for(var n=i>1?void 0:i?Vh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Hh(t,e,n),n};let as=class extends R{constructor(){super(),this.arrowNav=!0,this.disableArrowNav=!1,this.tabRefs=[],this.tabCount=0,this.defaultSlot=N(),this.context={useArrowNav:this.useArrowNav,registerTab:this.registerTab.bind(this),handleClick:this.handleClick.bind(this),handleKeyUp:this.handleKeyUp.bind(this)},this.slotController=new rt(this,this.defaultSlot)}get useArrowNav(){return this.arrowNav&&!this.disableArrowNav}updated(t){(t.has("arrowNav")||t.has("disableArrowNav"))&&(this.context={...this.context,useArrowNav:this.useArrowNav})}registerTab(t,e){this.tabRefs[e]=t,this.tabCount=Math.max(this.tabCount,e+1)}handleClick(t){this.dispatchEvent(new CustomEvent("tab-selected",{detail:{index:t},bubbles:!0,composed:!0}))}handleKeyUp(t,e){var i,n;this.useArrowNav&&(t.code==="ArrowLeft"&&e!==0&&((i=this.tabRefs[e-1])==null||i.focus()),t.code==="ArrowRight"&&e<this.tabCount-1&&((n=this.tabRefs[e+1])==null||n.focus()),(t.code==="ArrowDown"||t.code==="Space")&&this.dispatchEvent(new CustomEvent("tab-selected",{detail:{index:e},bubbles:!0,composed:!0})))}render(){const t=this.useArrowNav?"tablist":"navigation";return c`
|
|
1224
1594
|
<div class="pkt-tabs">
|
|
1225
|
-
<div class="pkt-tabs__list" role=${t} ${
|
|
1595
|
+
<div class="pkt-tabs__list" role=${t} ${M(this.defaultSlot)}></div>
|
|
1226
1596
|
</div>
|
|
1227
|
-
`}};
|
|
1228
|
-
${this.icon?
|
|
1229
|
-
<span ${
|
|
1230
|
-
${this.tag?
|
|
1231
|
-
`;return this.href?
|
|
1597
|
+
`}};xs([o({type:Boolean,reflect:!0,attribute:"arrow-nav"})],as.prototype,"arrowNav",2),xs([o({type:Boolean,reflect:!0,attribute:"disable-arrow-nav"})],as.prototype,"disableArrowNav",2),xs([D()],as.prototype,"tabRefs",2),xs([D()],as.prototype,"tabCount",2),xs([Fh({context:ga}),D()],as.prototype,"context",2),as=xs([F("pkt-tabs")],as);var Uh=Object.defineProperty,zh=Object.getOwnPropertyDescriptor,xe=(s,t,e,i)=>{for(var n=i>1?void 0:i?zh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Uh(t,e,n),n};let ve=class extends R{constructor(){super(),this.active=!1,this.href="",this.icon="",this.controls="",this.tag="",this.tagSkin="blue",this.index=0,this.elementRef=N(),this.defaultSlot=N(),this.slotController=new rt(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index)})}handleClick(){this.context&&this.context.handleClick(this.index)}handleKeyUp(t){this.context&&this.context.handleKeyUp(t,this.index)}render(){var t;const e=((t=this.context)==null?void 0:t.useArrowNav)??!0,i=this.active?"active":"",n=e?"tab":void 0,a=e?this.active:void 0,r=this.active||!e?void 0:-1,h=c`
|
|
1598
|
+
${this.icon?c`<pkt-icon name=${this.icon} class="pkt-icon--small"></pkt-icon>`:""}
|
|
1599
|
+
<span ${M(this.defaultSlot)}></span>
|
|
1600
|
+
${this.tag?c`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>`:""}
|
|
1601
|
+
`;return this.href?c`
|
|
1232
1602
|
<a
|
|
1233
|
-
${
|
|
1603
|
+
${M(this.elementRef)}
|
|
1234
1604
|
href=${this.href}
|
|
1235
1605
|
class="pkt-tabs__link ${i}"
|
|
1236
|
-
role=${
|
|
1237
|
-
aria-selected=${
|
|
1238
|
-
aria-controls=${
|
|
1239
|
-
tabindex=${
|
|
1606
|
+
role=${C(n)}
|
|
1607
|
+
aria-selected=${C(a)}
|
|
1608
|
+
aria-controls=${C(this.controls||void 0)}
|
|
1609
|
+
tabindex=${C(r)}
|
|
1240
1610
|
@click=${this.handleClick}
|
|
1241
1611
|
@keyup=${this.handleKeyUp}
|
|
1242
1612
|
>
|
|
1243
1613
|
${h}
|
|
1244
1614
|
</a>
|
|
1245
|
-
`:
|
|
1615
|
+
`:c`
|
|
1246
1616
|
<button
|
|
1247
|
-
${
|
|
1617
|
+
${M(this.elementRef)}
|
|
1248
1618
|
type="button"
|
|
1249
1619
|
class="pkt-tabs__button pkt-link-button ${i}"
|
|
1250
|
-
role=${
|
|
1251
|
-
aria-selected=${
|
|
1252
|
-
aria-controls=${
|
|
1253
|
-
tabindex=${
|
|
1620
|
+
role=${C(n)}
|
|
1621
|
+
aria-selected=${C(a)}
|
|
1622
|
+
aria-controls=${C(this.controls||void 0)}
|
|
1623
|
+
tabindex=${C(r)}
|
|
1254
1624
|
@click=${this.handleClick}
|
|
1255
1625
|
@keyup=${this.handleKeyUp}
|
|
1256
1626
|
>
|
|
1257
1627
|
${h}
|
|
1258
1628
|
</button>
|
|
1259
|
-
`}};
|
|
1629
|
+
`}};xe([o({type:Boolean,reflect:!0})],ve.prototype,"active",2),xe([o({type:String,reflect:!0})],ve.prototype,"href",2),xe([o({type:String,reflect:!0})],ve.prototype,"icon",2),xe([o({type:String,reflect:!0})],ve.prototype,"controls",2),xe([o({type:String,reflect:!0})],ve.prototype,"tag",2),xe([o({type:String,reflect:!0,attribute:"tag-skin"})],ve.prototype,"tagSkin",2),xe([o({type:Number,reflect:!0})],ve.prototype,"index",2),xe([jh({context:ga,subscribe:!0}),o({attribute:!1})],ve.prototype,"context",2),ve=xe([F("pkt-tab-item")],ve);/**
|
|
1260
1630
|
* @license
|
|
1261
1631
|
* Copyright 2020 Google LLC
|
|
1262
1632
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1263
|
-
*/const
|
|
1633
|
+
*/const qh=We(class extends us{constructor(s){if(super(s),s.type!==ne.PROPERTY&&s.type!==ne.ATTRIBUTE&&s.type!==ne.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Pn(s))throw Error("`live` bindings can only contain a single expression")}render(s){return s}update(s,[t]){if(t===Dt||t===k)return t;const e=s.element,i=s.name;if(s.type===ne.PROPERTY){if(t===e[i])return Dt}else if(s.type===ne.BOOLEAN_ATTRIBUTE){if(!!t===e.hasAttribute(i))return Dt}else if(s.type===ne.ATTRIBUTE&&e.getAttribute(i)===t+"")return Dt;return In(s),t}});var Wh=Object.defineProperty,Rh=Object.getOwnPropertyDescriptor,Qs=(s,t,e,i)=>{for(var n=i>1?void 0:i?Rh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Wh(t,e,n),n};let Ss=class extends L{constructor(){super(),this.inputRef=N(),this.helptextSlot=N(),this.value="",this.autocomplete="off",this.rows=null,this.counterCurrent=0,this.slotController=new rt(this,this.helptextSlot)}attributeChangedCallback(t,e,i){t==="value"&&this.value!==e&&(this.counterCurrent=i?i.length:0,this.valueChanged(i,e)),super.attributeChangedCallback(t,e,i)}updated(t){var e;super.updated(t),t.has("value")&&(this.counterCurrent=((e=this.value)==null?void 0:e.length)||0,this.valueChanged(this.value,t.get("value"))),t.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const t=E({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),e=this.ariaLabelledby||`${this.id}-input-label`;return c`<pkt-input-wrapper
|
|
1264
1634
|
label=${this.label}
|
|
1265
1635
|
?counter=${this.counter}
|
|
1266
1636
|
?disabled=${this.disabled}
|
|
@@ -1283,16 +1653,16 @@
|
|
|
1283
1653
|
.tagText=${this.tagText}
|
|
1284
1654
|
class="pkt-textarea"
|
|
1285
1655
|
>
|
|
1286
|
-
<div class="pkt-contents" ${
|
|
1656
|
+
<div class="pkt-contents" ${M(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1287
1657
|
<textarea
|
|
1288
|
-
${
|
|
1658
|
+
${M(this.inputRef)}
|
|
1289
1659
|
class=${t}
|
|
1290
1660
|
id=${this.id+"-input"}
|
|
1291
1661
|
name=${(this.name||this.id)+"-input"}
|
|
1292
|
-
placeholder=${
|
|
1293
|
-
.value=${
|
|
1294
|
-
minlength=${
|
|
1295
|
-
maxlength=${
|
|
1662
|
+
placeholder=${C(this.placeholder)}
|
|
1663
|
+
.value=${qh(this.value)}
|
|
1664
|
+
minlength=${C(this.minlength)}
|
|
1665
|
+
maxlength=${C(this.maxlength)}
|
|
1296
1666
|
?readonly=${this.readonly}
|
|
1297
1667
|
autocomplete=${this.autocomplete}
|
|
1298
1668
|
aria-labelledby=${e}
|
|
@@ -1305,76 +1675,7 @@
|
|
|
1305
1675
|
@focus=${i=>{this.onFocus(),i.stopImmediatePropagation()}}
|
|
1306
1676
|
@blur=${i=>{this.value=i.target.value,this.onBlur(),i.stopImmediatePropagation()}}
|
|
1307
1677
|
></textarea>
|
|
1308
|
-
</pkt-input-wrapper>`}};
|
|
1309
|
-
<pkt-input-wrapper
|
|
1310
|
-
label="${this.label}"
|
|
1311
|
-
?counter=${this.counter}
|
|
1312
|
-
?disabled=${this.disabled}
|
|
1313
|
-
?hasError=${this.hasError}
|
|
1314
|
-
?hasFieldset=${this.hasFieldset}
|
|
1315
|
-
?inline=${this.inline}
|
|
1316
|
-
?optionalTag=${this.optionalTag}
|
|
1317
|
-
?required=${this.required}
|
|
1318
|
-
?requiredTag=${this.requiredTag}
|
|
1319
|
-
useWrapper=${this.useWrapper}
|
|
1320
|
-
.ariaDescribedBy=${this.ariaDescribedBy}
|
|
1321
|
-
.counterCurrent=${this.counterCurrent}
|
|
1322
|
-
.counterMaxLength=${this.counterMaxLength}
|
|
1323
|
-
.errorMessage=${this.errorMessage}
|
|
1324
|
-
.forId="${this.id+"-input"}"
|
|
1325
|
-
.helptext=${this.helptext}
|
|
1326
|
-
.helptextDropdown=${this.helptextDropdown}
|
|
1327
|
-
.helptextDropdownButton=${this.helptextDropdownButton}
|
|
1328
|
-
.optionalText=${this.optionalText}
|
|
1329
|
-
.requiredText=${this.requiredText}
|
|
1330
|
-
.tagText=${this.tagText}
|
|
1331
|
-
class="pkt-textinput"
|
|
1332
|
-
>
|
|
1333
|
-
<div class="pkt-contents" ${E(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1334
|
-
<div class="pkt-input__container">
|
|
1335
|
-
${this.prefix?u`<div class="pkt-input-prefix">${this.prefix}</div>`:$}
|
|
1336
|
-
<input
|
|
1337
|
-
${E(this.inputRef)}
|
|
1338
|
-
class=${e}
|
|
1339
|
-
type=${this.type}
|
|
1340
|
-
name=${(this.name||this.id)+"-input"}
|
|
1341
|
-
id=${this.id+"-input"}
|
|
1342
|
-
placeholder=${S(this.placeholder)}
|
|
1343
|
-
aria-labelledby=${i}
|
|
1344
|
-
autocomplete=${this.autocomplete||"off"}
|
|
1345
|
-
minlength=${S(this.minlength||void 0)}
|
|
1346
|
-
maxlength=${S(this.maxlength||void 0)}
|
|
1347
|
-
min=${S(this.min||void 0)}
|
|
1348
|
-
max=${S(this.max||void 0)}
|
|
1349
|
-
step=${S(this.step||void 0)}
|
|
1350
|
-
?readonly=${this.readonly}
|
|
1351
|
-
size=${this.size||$}
|
|
1352
|
-
.value=${this.value}
|
|
1353
|
-
?disabled=${this.disabled}
|
|
1354
|
-
aria-invalid=${this.hasError}
|
|
1355
|
-
aria-errormessage=${`${this.id}-error`}
|
|
1356
|
-
@input=${a=>{this.value=a.target.value,this.onInput(),a.stopImmediatePropagation()}}
|
|
1357
|
-
@change=${a=>{a.stopImmediatePropagation()}}
|
|
1358
|
-
@focus=${a=>{this.onFocus(),a.stopImmediatePropagation()}}
|
|
1359
|
-
@blur=${a=>{this.value=a.target.value,this.onBlur(),a.stopImmediatePropagation()}}
|
|
1360
|
-
@keydown=${a=>{var n;if(a.key==="Enter"){const r=this.internals.form;r?r.requestSubmit():(n=this.inputRef.value)==null||n.blur()}}}
|
|
1361
|
-
/>
|
|
1362
|
-
${this.suffix?u`<div class="pkt-input-suffix">
|
|
1363
|
-
${this.suffix}
|
|
1364
|
-
${this.iconNameRight?u`<pkt-icon
|
|
1365
|
-
class="pkt-input-suffix-icon"
|
|
1366
|
-
name=${this.iconNameRight}
|
|
1367
|
-
></pkt-icon>`:$}
|
|
1368
|
-
${t?u`<pkt-icon
|
|
1369
|
-
class="pkt-input-suffix-icon"
|
|
1370
|
-
name="magnifying-glass-big"
|
|
1371
|
-
></pkt-icon>`:$}
|
|
1372
|
-
</div>`:$}
|
|
1373
|
-
${!this.suffix&&this.iconNameRight?u`<pkt-icon class="pkt-input-icon" name=${this.iconNameRight}></pkt-icon>`:$}
|
|
1374
|
-
${!this.suffix&&t?u`<pkt-icon class="pkt-input-icon" name="magnifying-glass-big"></pkt-icon>`:$}
|
|
1375
|
-
</div>
|
|
1376
|
-
</pkt-input-wrapper>
|
|
1377
|
-
`}};ie([o({type:String,reflect:!0})],Xt.prototype,"value",2),ie([o({type:String})],Xt.prototype,"type",2),ie([o({type:Number})],Xt.prototype,"size",2),ie([o({type:String})],Xt.prototype,"autocomplete",2),ie([o({type:String})],Xt.prototype,"iconNameRight",2),ie([o({type:String})],Xt.prototype,"prefix",2),ie([o({type:String})],Xt.prototype,"suffix",2),ie([o({type:Boolean})],Xt.prototype,"omitSearchIcon",2),ie([V()],Xt.prototype,"counterCurrent",2),Xt=ie([j("pkt-textinput")],Xt);var Ch=Object.defineProperty,Th=Object.getOwnPropertyDescriptor,oi=(s,t,e,i)=>{for(var a=i>1?void 0:i?Th(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Ch(t,e,a),a};let Is=class extends D{constructor(){super(),this.inputRef=A(),this.helptextSlot=A(),this._optionsProp=[],this.value="",this._options=[],this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new Ka(this),this.slotController=new at(this,this.helptextSlot),this.slotController.skipOptions=!0}get options(){return this._options.map(t=>({...t,selected:t.value===this.value}))}set options(t){this._optionsProp=t,this.requestUpdate("_optionsProp",this._options)}connectedCallback(){super.connectedCallback();const t=this._optionsProp.length>0,e=this.optionsController.nodes.length&&this.optionsController.nodes.length>0;!t&&e?this.optionsController.nodes.forEach(i=>{const a={value:i.hasAttribute("value")?i.getAttribute("value")??"":i.textContent??"",label:i.textContent||i.getAttribute("value")||"",disabled:i.hasAttribute("disabled"),selected:i.hasAttribute("selected"),hidden:i.hasAttribute("data-hidden")};i.getAttribute("selected")&&!this.value&&(this.value=a.value),this._options.push(a)}):(this._options=this._optionsProp,this._options.forEach(i=>{i.selected&&!this.value&&(this.value=i.value)}))}add(t,e){const i={value:t.value||t.text,label:t.text||t.value,selected:t.selected,disabled:t.disabled};if(e===void 0)this._options.push(i);else if(typeof e=="number")this._options.splice(e,0,i);else{const a=e.value||e.text,n=this._options.findIndex(r=>r.value===a);n>=0?this._options.splice(n,0,i):this._options.push(i)}t.selected&&(this.value=t.value||t.text,this.selectedIndex=this._options.findIndex(a=>a.value===this.value)),this.requestUpdate()}remove(t){var e;typeof t=="number"&&(this.selectedIndex===t&&(this.value=((e=this._options[0])==null?void 0:e.value)||""),this._options.splice(t,1),this.requestUpdate())}item(t){var e;return(e=this.inputRef.value)==null?void 0:e.item(t)}namedItem(t){var e;return(e=this.inputRef.value)==null?void 0:e.namedItem(t)}showPicker(){this.inputRef.value&&"showPicker"in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(t,e,i){var a,n;t==="options"&&(this._options=i?JSON.parse(i):[]),t==="value"&&this.value!==e&&(this.selectedIndex=this.touched?this.returnNumberOrNull((a=this.inputRef.value)==null?void 0:a.selectedIndex):this._options.findIndex(r=>r.value===i),this.selectedOptions=(n=this.inputRef.value)==null?void 0:n.selectedOptions,this.valueChanged(i,e)),super.attributeChangedCallback(t,e,i)}update(t){var e,i;super.update(t),t.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)),t.has("value")&&this.value!==t.get("value")&&(this.selectedIndex=this.touched?this.returnNumberOrNull((e=this.inputRef.value)==null?void 0:e.selectedIndex):this._options.findIndex(a=>a.value===this.value),this.selectedOptions=(i=this.inputRef.value)==null?void 0:i.selectedOptions,this.valueChanged(this.value,t.get("value"))),t.has("id")&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(t){var e;super.firstUpdated(t),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(i=>i.value===this.value),this.selectedOptions=(e=this.inputRef.value)==null?void 0:e.selectedOptions}render(){const t=`pkt-input ${this.fullwidth?"pkt-input--fullwidth":""}`;return u`
|
|
1678
|
+
</pkt-input-wrapper>`}};Qs([o({type:String,reflect:!0})],Ss.prototype,"value",2),Qs([o({type:String})],Ss.prototype,"autocomplete",2),Qs([o({type:Number})],Ss.prototype,"rows",2),Qs([D()],Ss.prototype,"counterCurrent",2),Ss=Qs([F("pkt-textarea")],Ss);var Kh=Object.defineProperty,Yh=Object.getOwnPropertyDescriptor,Ti=(s,t,e,i)=>{for(var n=i>1?void 0:i?Yh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Kh(t,e,n),n};let ti=class extends L{constructor(){super(),this.inputRef=N(),this.helptextSlot=N(),this._optionsProp=[],this.value="",this._options=[],this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new ha(this),this.slotController=new rt(this,this.helptextSlot),this.slotController.skipOptions=!0}get options(){return this._options.map(t=>({...t,selected:t.value===this.value}))}set options(t){this._optionsProp=t,this.requestUpdate("_optionsProp",this._options)}connectedCallback(){super.connectedCallback();const t=this._optionsProp.length>0,e=this.optionsController.nodes.length&&this.optionsController.nodes.length>0;!t&&e?this.optionsController.nodes.forEach(i=>{const n={value:i.hasAttribute("value")?i.getAttribute("value")??"":i.textContent??"",label:i.textContent||i.getAttribute("value")||"",disabled:i.hasAttribute("disabled"),selected:i.hasAttribute("selected"),hidden:i.hasAttribute("data-hidden")};i.getAttribute("selected")&&!this.value&&(this.value=n.value),this._options.push(n)}):(this._options=this._optionsProp,this._options.forEach(i=>{i.selected&&!this.value&&(this.value=i.value)}))}add(t,e){const i={value:t.value||t.text,label:t.text||t.value,selected:t.selected,disabled:t.disabled};if(e===void 0)this._options.push(i);else if(typeof e=="number")this._options.splice(e,0,i);else{const n=e.value||e.text,a=this._options.findIndex(r=>r.value===n);a>=0?this._options.splice(a,0,i):this._options.push(i)}t.selected&&(this.value=t.value||t.text,this.selectedIndex=this._options.findIndex(n=>n.value===this.value)),this.requestUpdate()}remove(t){var e;typeof t=="number"&&(this.selectedIndex===t&&(this.value=((e=this._options[0])==null?void 0:e.value)||""),this._options.splice(t,1),this.requestUpdate())}item(t){var e;return(e=this.inputRef.value)==null?void 0:e.item(t)}namedItem(t){var e;return(e=this.inputRef.value)==null?void 0:e.namedItem(t)}showPicker(){this.inputRef.value&&"showPicker"in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(t,e,i){var n,a;t==="options"&&(this._options=i?JSON.parse(i):[]),t==="value"&&this.value!==e&&(this.selectedIndex=this.touched?this.returnNumberOrNull((n=this.inputRef.value)==null?void 0:n.selectedIndex):this._options.findIndex(r=>r.value===i),this.selectedOptions=(a=this.inputRef.value)==null?void 0:a.selectedOptions,this.valueChanged(i,e)),super.attributeChangedCallback(t,e,i)}update(t){var e,i;super.update(t),t.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)),t.has("value")&&this.value!==t.get("value")&&(this.selectedIndex=this.touched?this.returnNumberOrNull((e=this.inputRef.value)==null?void 0:e.selectedIndex):this._options.findIndex(n=>n.value===this.value),this.selectedOptions=(i=this.inputRef.value)==null?void 0:i.selectedOptions,this.valueChanged(this.value,t.get("value"))),t.has("id")&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(t){var e;super.firstUpdated(t),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(i=>i.value===this.value),this.selectedOptions=(e=this.inputRef.value)==null?void 0:e.selectedOptions}render(){const t=`pkt-input ${this.fullwidth?"pkt-input--fullwidth":""}`;return c`
|
|
1378
1679
|
<pkt-input-wrapper
|
|
1379
1680
|
?counter=${this.counter}
|
|
1380
1681
|
?disabled=${this.disabled}
|
|
@@ -1384,23 +1685,23 @@
|
|
|
1384
1685
|
?optionalTag=${this.optionalTag}
|
|
1385
1686
|
?requiredTag=${this.requiredTag}
|
|
1386
1687
|
useWrapper=${this.useWrapper}
|
|
1387
|
-
ariaDescribedBy=${
|
|
1688
|
+
ariaDescribedBy=${C(this.ariaDescribedBy)}
|
|
1388
1689
|
class="pkt-select"
|
|
1389
|
-
errorMessage=${
|
|
1690
|
+
errorMessage=${C(this.errorMessage)}
|
|
1390
1691
|
forId=${this.id+"-input"}
|
|
1391
|
-
helptext=${
|
|
1392
|
-
helptextDropdown=${
|
|
1393
|
-
helptextDropdownButton=${
|
|
1394
|
-
label=${
|
|
1395
|
-
optionalText=${
|
|
1396
|
-
requiredText=${
|
|
1397
|
-
tagText=${
|
|
1692
|
+
helptext=${C(this.helptext)}
|
|
1693
|
+
helptextDropdown=${C(this.helptextDropdown)}
|
|
1694
|
+
helptextDropdownButton=${C(this.helptextDropdownButton)}
|
|
1695
|
+
label=${C(this.label)}
|
|
1696
|
+
optionalText=${C(this.optionalText)}
|
|
1697
|
+
requiredText=${C(this.requiredText)}
|
|
1698
|
+
tagText=${C(this.tagText)}
|
|
1398
1699
|
>
|
|
1399
1700
|
<select
|
|
1400
1701
|
class=${t}
|
|
1401
1702
|
aria-invalid=${this.hasError}
|
|
1402
1703
|
aria-errormessage=${`${this.id}-error`}
|
|
1403
|
-
aria-labelledby=${
|
|
1704
|
+
aria-labelledby=${C(this.ariaLabelledby)}
|
|
1404
1705
|
?disabled=${this.disabled}
|
|
1405
1706
|
id=${this.id+"-input"}
|
|
1406
1707
|
name=${(this.name||this.id)+"-input"}
|
|
@@ -1409,9 +1710,9 @@
|
|
|
1409
1710
|
@input=${e=>{this.onInput(),e.stopImmediatePropagation()}}
|
|
1410
1711
|
@focus=${e=>{this.onFocus(),e.stopImmediatePropagation()}}
|
|
1411
1712
|
@blur=${e=>{this.onBlur(),e.stopImmediatePropagation()}}
|
|
1412
|
-
${
|
|
1713
|
+
${M(this.inputRef)}
|
|
1413
1714
|
>
|
|
1414
|
-
${this._options.length>0?this._options.map(e=>
|
|
1715
|
+
${this._options.length>0?this._options.map(e=>c`<option
|
|
1415
1716
|
value=${e.value}
|
|
1416
1717
|
?selected=${this.value==e.value||e.selected}
|
|
1417
1718
|
?disabled=${e.disabled}
|
|
@@ -1420,10 +1721,10 @@
|
|
|
1420
1721
|
${e.label}
|
|
1421
1722
|
</option>`):""}
|
|
1422
1723
|
</select>
|
|
1423
|
-
<div class="pkt-contents" ${
|
|
1724
|
+
<div class="pkt-contents" ${M(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1424
1725
|
</pkt-input-wrapper>
|
|
1425
|
-
`}returnNumberOrNull(t){return t==null||isNaN(t)?null:t}};
|
|
1426
|
-
<div class="${
|
|
1726
|
+
`}returnNumberOrNull(t){return t==null||isNaN(t)?null:t}};Ti([o({type:Array,attribute:"options"})],ti.prototype,"_optionsProp",2),Ti([o({type:String})],ti.prototype,"value",2),Ti([D()],ti.prototype,"_options",2),ti=Ti([F("pkt-select")],ti);var Gh=Object.defineProperty,Zh=Object.getOwnPropertyDescriptor,ei=(s,t,e,i)=>{for(var n=i>1?void 0:i?Zh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Gh(t,e,n),n};let Cs=class extends R{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=N(),this.namedSlot=N(),this.slotController=new rt(this,this.defaultSlot,this.namedSlot)}connectedCallback(){this.strings.length&&this.strings.forEach(s=>{this._list.push(s.toUpperCase())}),super.connectedCallback()}render(){const s={"pkt-component":!0,"pkt-component--has-list":this.strings.length>0,"pkt-darkmode":this.darkmode};return c`
|
|
1727
|
+
<div class="${E(s)}">
|
|
1427
1728
|
<h1 class="pkt-txt-28">${this.string}</h1>
|
|
1428
1729
|
|
|
1429
1730
|
<h2 class="pkt-txt-22">Innhold fra attributter og funksjoner</h2>
|
|
@@ -1431,11 +1732,11 @@
|
|
|
1431
1732
|
<div>${this.renderList(this.doStuff(this._list))}</div>
|
|
1432
1733
|
|
|
1433
1734
|
<h2 class="pkt-txt-22">Slot</h2>
|
|
1434
|
-
<div ${
|
|
1735
|
+
<div ${M(this.defaultSlot)}>defaultSlotRef</div>
|
|
1435
1736
|
<h2 class="pkt-txt-22">Named slot</h2>
|
|
1436
1737
|
<select
|
|
1437
1738
|
name="named-slot"
|
|
1438
|
-
${
|
|
1739
|
+
${M(this.namedSlot)}
|
|
1439
1740
|
@change=${t=>alert(t.target.value)}
|
|
1440
1741
|
>
|
|
1441
1742
|
namedSlotRef
|
|
@@ -1443,15 +1744,15 @@
|
|
|
1443
1744
|
|
|
1444
1745
|
<h2 class="pkt-txt-22">Knapp som emitter en event</h2>
|
|
1445
1746
|
<button type="button" @click=${()=>this.handleGreeting()}>
|
|
1446
|
-
Si ${
|
|
1747
|
+
Si ${At.example.hi}
|
|
1447
1748
|
</button>
|
|
1448
1749
|
</div>
|
|
1449
|
-
`}renderList(s){return
|
|
1750
|
+
`}renderList(s){return c`
|
|
1450
1751
|
<ul>
|
|
1451
|
-
${s.map(t=>
|
|
1752
|
+
${s.map(t=>c`<li>${t}</li>`)}
|
|
1452
1753
|
</ul>
|
|
1453
|
-
`}doStuff(s){return s.reverse()}handleGreeting(){this.dispatchEvent(new CustomEvent("pkt-greeting",{detail:"Hei på deg!"}))}};
|
|
1754
|
+
`}doStuff(s){return s.reverse()}handleGreeting(){this.dispatchEvent(new CustomEvent("pkt-greeting",{detail:"Hei på deg!"}))}};ei([o({type:String})],Cs.prototype,"string",2),ei([o({converter:aa})],Cs.prototype,"strings",2),ei([o({type:Boolean})],Cs.prototype,"darkmode",2),ei([o({type:Array})],Cs.prototype,"_list",2),Cs=ei([F("pkt-component")],Cs);const q=ie({tagName:"pkt-icon",elementClass:Ke,react:_,displayName:"PktIcon",events:{}}),ma=_.forwardRef(({defaultOpen:s=!1,id:t,title:e,skin:i,compact:n=!1,isOpen:a,children:r,name:h,className:d,onClick:u,onToggle:g},m)=>{const[$,b]=_.useState(s),{name:y}=qa(),x=h||y,T=a!==void 0?a:$;_.useEffect(()=>{a===void 0&&b(s)},[s,a]);const S=O=>{const et=O.currentTarget.open;a===void 0&&b(et),g==null||g(O)},A=O=>{setTimeout(()=>{u==null||u(O)},0)},I=["pkt-accordion-item",n&&"pkt-accordion-item--compact",i&&`pkt-accordion-item--${i}`,d].filter(Boolean).join(" ");return l.jsxs("details",{ref:m,className:I,id:t,open:T,onClick:A,name:x,onToggle:S,children:[l.jsxs("summary",{className:"pkt-accordion-item__title",id:`pkt-accordion-item-summary-${t}`,children:[e,l.jsx(q,{name:"chevron-thin-down",className:"pkt-accordion-item__icon","aria-hidden":"true"})]}),l.jsx("div",{className:"pkt-accordion-item__content",id:`pkt-accordion-item__content-${t}`,role:"region",children:l.jsx("div",{className:"pkt-accordion-item__content-inner",children:r})})]})});ma.displayName="PktAccordionItem";function Xh(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Qi={exports:{}};/*!
|
|
1454
1755
|
Copyright (c) 2018 Jed Watson.
|
|
1455
1756
|
Licensed under the MIT License (MIT), see
|
|
1456
1757
|
http://jedwatson.github.io/classnames
|
|
1457
|
-
*/var en;function Mh(){return en||(en=1,(function(s){(function(){var t={}.hasOwnProperty;function e(){for(var n="",r=0;r<arguments.length;r++){var h=arguments[r];h&&(n=a(n,i(h)))}return n}function i(n){if(typeof n=="string"||typeof n=="number")return n;if(typeof n!="object")return"";if(Array.isArray(n))return e.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var r="";for(var h in n)t.call(n,h)&&n[h]&&(r=a(r,h));return r}function a(n,r){return r?n?n+" "+r:n+r:n}s.exports?(e.default=e,s.exports=e):window.classNames=e})()})(Ii)),Ii.exports}var Ph=Mh();const pt=Eh(Ph),Li=({children:s,closeAlert:t,compact:e,title:i,date:a,ariaLive:n,"aria-live":r="polite",role:h="status",skin:d="info",className:p,...f})=>{const[g,k]=x.useState(!1),b={"pkt-alert":!0,"pkt-alert--compact":e,[`pkt-alert--${d}`]:d,"pkt-hide":g},y={"pkt-alert__grid":!0,"pkt-alert__noTitle":!i,"pkt-alert__noDate":!a},w=x.useCallback(()=>{k(!0),f.onClose&&f.onClose(new CustomEvent("close",{detail:{origin:event},bubbles:!0,composed:!0}))},[f.onClose,k]),C=n||r;return l.jsx("div",{...f,"aria-live":C,role:h,className:pt(b,p),children:l.jsxs("div",{className:pt(y),children:[l.jsx(B,{className:"pkt-alert__icon","aria-hidden":"true",name:d==="info"?"alert-information":`alert-${d}`}),t&&l.jsx("div",{className:"pkt-alert__close",children:l.jsx(je,{tabIndex:0,"aria-label":"close",size:e?"small":"medium",type:"button",skin:"tertiary",iconName:"close",variant:"icon-only",onClick:w,children:l.jsx("span",{className:"sr-only",children:"Lukk"})})}),i&&l.jsx("div",{className:"pkt-alert__title",children:i}),l.jsx("div",{className:"pkt-alert__text",children:s}),a&&l.jsxs("div",{className:"pkt-alert__date",children:["Sist oppdatert: ",a]})]})})};Li.displayName="PktAlert";const sn=Wt({tagName:"pkt-backlink",elementClass:Xe,react:x,displayName:"PktBackLink"});sn.displayName="PktBackLink";const Oh=x.forwardRef(({breadcrumbs:s,navigationType:t,className:e,...i},a)=>{const n=s,r=n[n.length-2],h=[e,"pkt-breadcrumbs"].filter(Boolean).join(" ");return l.jsxs("nav",{ref:a,"aria-label":"brødsmulemeny",className:h,children:[l.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:n.map((d,p)=>l.jsx("li",{className:"pkt-breadcrumbs__item",children:p===n.length-1?l.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:l.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})}):t==="router"?l.jsxs(Wi.Link,{to:d.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[l.jsx(B,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})]}):l.jsxs("a",{href:d.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[l.jsx(B,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})]})},`breadcrumb-${p}`))}),t==="router"?l.jsxs(Wi.Link,{to:r.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...i,children:[l.jsx(B,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:r.text})]}):l.jsxs("a",{href:r.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...i,children:[l.jsx(B,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:r.text})]})]})});window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/13.22/animations/";const je=x.forwardRef(({children:s,className:t,iconName:e="user",secondIconName:i="user",iconPath:a,secondIconPath:n,size:r="medium",fullWidth:h=!1,fullWidthOnMobile:d=!1,skin:p="primary",type:f="button",variant:g="label-only",state:k,color:b,isLoading:y=void 0,disabled:w=void 0,loadingAnimationPath:C=window.pktAnimationPath,...P},T)=>{const I=[t,"pkt-btn",r&&`pkt-btn--${r}`,h&&"pkt-btn--full",d&&"pkt-btn--full-small",p&&`pkt-btn--${p}`,g&&`pkt-btn--${g}`,b&&`pkt-btn--${b}`,k&&`pkt-btn--${k}`,y&&"pkt-btn--isLoading"].filter(Boolean).join(" ");return l.jsxs("button",{...P,"aria-busy":y||void 0,"aria-disabled":w||void 0,disabled:w,className:I,type:f,ref:T,children:[y&&l.jsx(B,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:C}),g!=="label-only"&&l.jsx(B,{className:"pkt-btn__icon",name:e,...a&&{path:a}}),l.jsx("span",{className:"pkt-btn__text",children:s}),g==="icons-right-and-left"&&l.jsx(B,{className:"pkt-btn__icon",name:i,...n&&{path:n}})]})});je.displayName="PktButton";const Dh=Wt({tagName:"pkt-card",elementClass:ht,react:x,displayName:"PktCard",events:{}}),an=x.forwardRef(({children:s,...t},e)=>l.jsx(Dh,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));an.displayName="PktCard";const nn=x.forwardRef(({id:s,hasTile:t=!1,disabled:e=!1,label:i,checkHelptext:a,hasError:n=!1,className:r,isSwitch:h=!1,hideLabel:d=!1,labelPosition:p="right",defaultChecked:f,checked:g,indeterminate:k,optionalTag:b,optionalText:y="Valgfritt",requiredTag:w,requiredText:C="Må fylles ut",tagText:P,...T},I)=>{const N=x.useRef(null);x.useEffect(()=>{N.current&&k!==void 0&&(N.current.indeterminate=k)},[k]),x.useEffect(()=>{typeof I=="function"?I(N.current):I&&(I.current=N.current)},[I]);const W=[r,"pkt-input-check"].filter(Boolean).join(" "),Z=["pkt-input-check__input-label",e?"pkt-input-check__input-label--disabled":"",`pkt-input-check__input-label--${p}`,d?"pkt-sr-only":""].filter(Boolean).join(" "),wt=["pkt-input-check__input",t?"pkt-input-check__input--tile":"",e&&t?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),bt=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),Q=()=>l.jsxs(l.Fragment,{children:[P&&l.jsx("span",{className:bt+" pkt-tag--gray",children:P}),b&&l.jsx("span",{className:bt+" pkt-tag--blue-light",children:y}),w&&l.jsx("span",{className:bt+" pkt-tag--beige",children:C})]});return l.jsx("div",{className:W,children:l.jsxs("div",{className:wt,children:[p==="left"&&l.jsxs("label",{className:Z,htmlFor:s,children:[i," ",Q(),a&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:a})]}),l.jsx("input",{role:h?"switch":"checkbox",ref:N,className:`pkt-input-check__input-checkbox ${n?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:s,disabled:e,...g!==void 0?{checked:g}:{defaultChecked:f},...T}),p==="right"&&l.jsxs("label",{className:Z,htmlFor:s,children:[i," ",Q(),a&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:a})]})]})})});nn.displayName="PktCheckbox";const Ih=Wt({tagName:"pkt-combobox",elementClass:tt,react:x,displayName:"PktCombobox",events:{onClick:"click",onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),rn=x.forwardRef(({children:s,helptext:t,...e},i)=>l.jsxs(Ih,{...e,ref:i,children:[t&&l.jsx("div",{slot:"helptext",className:"pkt-contents",children:t}),s]}));rn.displayName="PktCombobox";const li=Wt({tagName:"pkt-consent",elementClass:Ut,react:x,displayName:"PktConsent",events:{onToggleConsent:"toggle-consent"}});li.displayName="PktConsent";const Lh=Wt({tagName:"pkt-datepicker",elementClass:st,react:x,displayName:"PktDatepicker",events:{onChange:"change",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),on=x.forwardRef(({helptext:s,...t},e)=>l.jsx(Lh,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",slot:"helptext",children:s})}));on.displayName="PktDatepicker";const Bh=({columnOne:s,columnTwo:t,socialLinks:e,className:i,openLinksInNewTab:a=!1,personvernOgInfoLink:n="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:r="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:h=!1,hotjarId:d=null,googleAnalyticsId:p=null,devMode:f=!1,cookieDomain:g=null,cookieSecure:k=null,cookieExpiryDays:b=null,onToggleConsent:y=w=>{console.log(w.detail)}})=>{var C,P;const w=[i,"pkt-footer"].filter(Boolean).join(" ");return l.jsx("footer",{className:w,"data-mode":"dark",children:l.jsxs("div",{className:"pkt-footer__container",children:[l.jsxs("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[l.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l.jsx("h2",{className:"pkt-footer__title",children:s.title}),l.jsxs("ul",{className:"pkt-footer__list",children:[s.text&&l.jsx("li",{className:"pkt-footer__text",children:s.text}),(C=s.links)==null?void 0:C.map((T,I)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${T.external?"pkt-link--external":""}`,href:T.href,target:T.openInNewTab||a?"_blank":"_self",rel:T.openInNewTab||a?"noopener noreferrer":void 0,children:[l.jsx(B,{className:"pkt-footer__link-icon",name:"chevron-right"}),T.text]})},`links-${I}`))]})]}),l.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l.jsx("h2",{className:"pkt-footer__title",children:t.title}),l.jsxs("ul",{className:"pkt-footer__list",children:[t.text&&l.jsx("li",{className:"pkt-footer__text",children:t.text}),(P=t.links)==null?void 0:P.map((T,I)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${T.external?"pkt-link--external":""}`,href:T.href,target:T.openInNewTab||a?"_blank":"_self",rel:T.openInNewTab||a?"noopener noreferrer":void 0,children:[l.jsx(B,{className:"pkt-footer__link-icon",name:"chevron-right"}),T.text]})},`links-${I}`))]})]}),l.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l.jsx("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),l.jsxs("ul",{className:"pkt-footer__list",children:[l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:"pkt-footer__link",href:n,target:a?"_blank":"_self",rel:a?"noopener noreferrer":void 0,children:[l.jsx(B,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:"pkt-footer__link",href:r,target:a?"_blank":"_self",rel:a?"noopener noreferrer":void 0,children:[l.jsx(B,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),h&&l.jsx("li",{className:"pkt-footer__list-item",children:l.jsx(li,{triggerType:"footerlink",hotjarId:d,googleAnalyticsId:p,devMode:f,cookieDomain:g,cookieSecure:k,cookieExpiryDays:b,onToggleConsent:y})})]})]})]}),e&&l.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[l.jsx("div",{className:"pkt-footer__social-languages",children:e.filter(T=>T.language).map((T,I)=>l.jsx("div",{className:"pkt-footer__social-language",children:l.jsx("a",{href:T.href,"aria-label":`til ${T.language} versjon av nettsiden`,target:T.openInNewTab||a?"_blank":"_self",rel:T.openInNewTab||a?"noopener noreferrer":void 0,children:T.language})},`sociallinks-language-${I}`))}),l.jsx("div",{className:"pkt-footer__social-icons",children:e.filter(T=>T.iconName).map((T,I)=>l.jsx(x.Fragment,{children:l.jsx("a",{href:T.href,"aria-label":`til ${T.iconName}`,className:"pkt-footer__social-icon-link",target:T.openInNewTab||a?"_blank":"_self",rel:T.openInNewTab||a?"noopener noreferrer":void 0,children:l.jsx(B,{className:"pkt-footer__social-icon",name:T.iconName})})},`sociallinks-${I}`))})]})]})})},Fh=({links:s=[],openLinksInNewTab:t=!1,personvernOgInfoLink:e="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:i="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:a=!1,hotjarId:n=null,googleAnalyticsId:r=null,devMode:h=!1,cookieDomain:d=null,cookieSecure:p=null,cookieExpiryDays:f=null,onToggleConsent:g=b=>{console.log(b.detail)},className:k})=>{const b=[k,"pkt-footer-simple"].filter(Boolean).join(" ");return l.jsx("footer",{className:b,"data-mode":"dark",children:l.jsx("div",{className:"pkt-footer-simple__container",children:l.jsxs("ul",{className:"pkt-footer-simple__list",children:[s.map((y,w)=>l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:`pkt-footer-simple__link ${y.external?" pkt-link--external":""}`,href:y.href,target:y.openInNewTab||t?"_blank":"_self",rel:y.openInNewTab||t?"noopener noreferrer":void 0,children:[l.jsx(B,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),y.text]})},w)),l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:"pkt-footer-simple__link",href:e,target:t?"_blank":"_self",rel:t?"noopener noreferrer":void 0,children:[l.jsx(B,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:"pkt-footer-simple__link",href:i,target:t?"_blank":"_self",rel:t?"noopener noreferrer":void 0,children:[l.jsx(B,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),a&&l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsx(li,{triggerType:"footerlink",hotjarId:n,googleAnalyticsId:r,devMode:h,cookieDomain:d,cookieSecure:p,cookieExpiryDays:f,onToggleConsent:g})})]})})})},Vh=x.forwardRef(({className:s,logoLink:t="https://www.oslo.kommune.no/",serviceName:e,fixed:i=!0,scrollToHide:a=!0,user:n,userMenu:r,representing:h,userOptions:d,userMenuFooter:p,canChangeRepresentation:f=!0,showMenuButton:g=!1,showLogOutButton:k=!1,openMenu:b,logOut:y,changeRepresentation:w,children:C,...P},T)=>{const I=x.useMemo(()=>typeof(n==null?void 0:n.lastLoggedIn)=="string"?n.lastLoggedIn:n!=null&&n.lastLoggedIn?new Date(n.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[n]),[N,W]=x.useState(!1),[Z,wt]=x.useState(0),[bt,Q]=x.useState(!1),rt=x.useRef(null);x.useEffect(()=>(document&&(document.addEventListener("mouseup",Vt),window.addEventListener("scroll",ot)),()=>{document&&(document.removeEventListener("mouseup",Vt),window.removeEventListener("scroll",ot))}));const Ft=()=>{Q(!bt)},Vt=F=>{rt.current&&!rt.current.contains(F.target)&&Q(!1)},ot=()=>{if(a){const F=window.pageYOffset||document.documentElement.scrollTop;if(F<0||Math.abs(F-Z)<60)return;W(F>Z),wt(F)}};return l.jsxs("header",{...P,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:pt(s,"pkt-header",{"pkt-header--fixed":i,"pkt-header--scroll-to-hide":a,"pkt-header--hidden":N}),ref:T,children:[l.jsxs("div",{className:"pkt-header__logo",children:[typeof t=="string"?l.jsx("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:t,children:l.jsx(B,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/13.22/logos/"})}):l.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header__logo-link",onClick:t,children:l.jsx(B,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/13.22/logos/"})}),l.jsx("span",{className:"pkt-header__logo-service",translate:"no",children:e})]}),l.jsx("nav",{className:"pkt-header__actions",children:l.jsxs("ul",{className:"pkt-header__actions-row",children:[g&&l.jsx("li",{children:l.jsx(je,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:b,children:"Meny"})}),(n||h)&&l.jsxs("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${bt&&!N?"pkt-header--open-dropdown":""}`,ref:rt,children:[l.jsxs("button",{className:"pkt-header__user-btn pkt-btn pkt-btn--secondary pkt-btn--icons-right-and-left",type:"button",role:"button","aria-controls":"pktUserDropdown","aria-expanded":bt,onClick:Ft,children:[l.jsx(B,{name:"user",className:"pkt-btn__icon"}),l.jsx("span",{className:"pkt-header__user-fullname",translate:"no",children:(h==null?void 0:h.name)||(n==null?void 0:n.name)}),l.jsx("span",{className:"pkt-header__user-shortname",translate:"no",children:(h==null?void 0:h.shortname)||(n==null?void 0:n.shortname)}),l.jsx(B,{name:"chevron-thin-down",className:"pkt-btn--closed"}),l.jsx(B,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),l.jsxs("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[n&&l.jsxs("li",{children:[l.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),l.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:n.name}),n.lastLoggedIn&&l.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",l.jsx("time",{children:I})]})]}),r&&l.jsx("li",{children:l.jsx("ul",{className:"pkt-list",children:r.map((F,At)=>l.jsx("li",{children:typeof F.target=="string"?l.jsxs("a",{href:F.target,className:"pkt-link",children:[F.iconName&&l.jsx(B,{name:F.iconName,className:"pkt-link__icon"}),F.title]}):l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:F.target,children:[F.iconName&&l.jsx(B,{name:F.iconName,className:"pkt-link__icon"}),F.title]})},`userMenu-${At}`))})}),(h||f)&&l.jsxs("li",{children:[h&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),l.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:h.name}),h.orgNumber&&l.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",h.orgNumber]})]}),l.jsx("ul",{className:"pkt-list mt-size-16",children:f&&l.jsx("li",{children:l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:w,children:[l.jsx(B,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),l.jsx("li",{children:l.jsx("ul",{className:"pkt-list",children:(d||!k)&&l.jsxs(l.Fragment,{children:[d==null?void 0:d.map((F,At)=>l.jsx("li",{children:typeof F.target=="string"?l.jsxs("a",{href:F.target,className:"pkt-link",children:[F.iconName&&l.jsx(B,{name:F.iconName,className:"pkt-link__icon"}),F.title]}):l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:F.target,children:[F.iconName&&l.jsx(B,{name:F.iconName,className:"pkt-link__icon"}),F.title]})},`userOptions-${At}`)),!k&&l.jsx("li",{children:l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:y,children:[l.jsx(B,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),p&&l.jsx("li",{className:"footer",children:l.jsx("ul",{className:"pkt-list-horizontal bordered",children:p.map((F,At)=>l.jsx("li",{children:typeof F.target=="string"?l.jsx("a",{href:F.target,className:"pkt-link",children:F.title}):l.jsx("button",{className:"pkt-link-button pkt-link",onClick:F.target,children:F.title})},`userMenuFooter-${At}`))})})]})]}),C&&l.jsx("li",{children:C}),k&&l.jsx("li",{children:l.jsx(je,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:y,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),jh=Wt({tagName:"pkt-heading",elementClass:ye,react:x,displayName:"PktHeading"}),ln=x.forwardRef(({children:s,...t},e)=>l.jsx(jh,{"data-testid":"pkt-heading",...t,ref:e,children:s}));ln.displayName="PktHeading";const Hh=Wt({tagName:"pkt-helptext",elementClass:oe,react:x,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),hn=x.forwardRef(({children:s,...t},e)=>l.jsx(Hh,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));hn.displayName="PktHelptext";const dn=x.forwardRef(({label:s,id:t,children:e,...i},a)=>l.jsxs("div",{className:"pkt-form-group",children:[l.jsx("label",{htmlFor:t,className:"pkt-form-label",children:s}),l.jsx("input",{className:"pkt-form-input",id:t,...i,ref:a}),e]}));dn.displayName="PktInput";const Bs=x.forwardRef(({forId:s,label:t,helptext:e,helptextDropdown:i,helptextDropdownButton:a,counter:n,counterCurrent:r=0,counterMaxLength:h,optionalTag:d=!1,optionalText:p="Valgfritt",requiredTag:f=!1,requiredText:g="Må fylles ut",tagText:k=null,hasError:b=!1,errorMessage:y,disabled:w=!1,inline:C=!1,ariaDescribedby:P,useWrapper:T=!0,children:I,className:N="",hasFieldset:W=!1,role:Z="group",counterPosition:wt="bottom"},bt)=>{const[Q,rt]=x.useState(!1),Ft=P||(e?`${s}-helptext`:void 0),Vt=!!n,ot=Vt&&wt==="top",F=Vt&&wt==="bottom",At=()=>rt(ut=>!ut),ae=["pkt-inputwrapper",N,b?"pkt-inputwrapper--error":"",w?"pkt-inputwrapper--disabled":"",C?"pkt-inputwrapper--inline":""].filter(Boolean).join(" "),de=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),ne=()=>Vt?l.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":"true",children:[r,h?`/${h}`:""]}):null,He=()=>l.jsxs(l.Fragment,{children:[k&&l.jsx("span",{className:de+" pkt-tag--gray",children:k}),d&&l.jsx("span",{className:de+" pkt-tag--blue-light",children:p}),f&&l.jsx("span",{className:de+" pkt-tag--beige",children:g})]}),ds=()=>{const ut=l.jsxs(l.Fragment,{children:[t," ",He()]});return T?W?l.jsx("legend",{className:"pkt-inputwrapper__legend",id:`${s}-label`,children:ut}):l.jsx("label",{className:"pkt-inputwrapper__label",htmlFor:s,"aria-describedby":Ft,id:`${s}-label`,children:ut}):l.jsx("label",{htmlFor:s,className:"pkt-sr-only","aria-describedby":Ft,id:`${s}-label`,children:t})},ce=()=>!e&&!i?null:l.jsxs(l.Fragment,{children:[e&&T&&l.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${s}-helptext`,children:e}),i&&l.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[l.jsx(je,{skin:"tertiary",size:"small",variant:"icon-right",iconName:Q?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:At,children:l.jsx("span",{dangerouslySetInnerHTML:{__html:a??'Les mer <span class="pkt-sr-only">om inputfeltet</span>'}})}),l.jsx("div",{className:`pkt-inputwrapper__helptext ${Q?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i})]})]}),zt=l.jsxs(l.Fragment,{children:[ds(),ce(),ot&&l.jsx(ne,{}),I,F&&l.jsx(ne,{}),b&&y&&l.jsx("div",{className:"pkt-inputwrapper__alert-wrapper",children:l.jsx(Li,{skin:"error","aria-live":"assertive",role:"alert",id:`${s}-error`,compact:!0,children:y})})]});return l.jsx("div",{className:ae,ref:bt,role:Z,children:W?l.jsx("fieldset",{className:"pkt-inputwrapper__fieldset","aria-describedby":Ft,children:zt}):l.jsx("div",{className:"pkt-inputwrapper__fieldset",children:zt})})});Bs.displayName="PktInputWrapper";const cn=({href:s,iconName:t,className:e,iconPosition:i,external:a,target:n,children:r,...h})=>{const d={"pkt-link":!0,"pkt-link--icon-left":!!t&&i==="left"||!!(t&&!i),"pkt-link--icon-right":!!t&&i==="right","pkt-link--external":a};return l.jsxs("a",{...h,className:pt(d,e),href:s,target:n,rel:a?"noopener noreferrer":void 0,children:[t&&l.jsx(B,{name:t,className:"pkt-link__icon"}),r]})};cn.displayName="PktLink";const pn=({children:s,skin:t,title:e,href:i,iconName:a,openInNewTab:n,external:r,className:h,...d})=>{const p=["pkt-linkcard",t&&`pkt-linkcard--${t}`].filter(Boolean).join(" "),f=["pkt-linkcard__title",r&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return l.jsxs("a",{...d,href:i,className:pt(p,h),target:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[a&&l.jsx(B,{className:"pkt-link__icon",name:a}),e&&l.jsx("div",{className:pt(f),children:e}),l.jsx("div",{className:"pkt-linkcard__text",children:s})]})};pn.displayName="PktLinkCard";const Uh=Wt({tagName:"pkt-loader",elementClass:Yt,react:x,displayName:"PktLoader",events:{}}),un=x.forwardRef(({children:s,...t},e)=>l.jsx(Uh,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));un.displayName="PktLoader";const fn=({children:s,className:t,skin:e,title:i,compact:a,closable:n,onClose:r,...h})=>{const[d,p]=x.useState(!1),f={"pkt-messagebox":!0,"pkt-messagebox--compact":a,[`pkt-messagebox--${e}`]:e,"pkt-messagebox--closable":n,"pkt-hide":d},g=x.createRef(),k=x.useCallback(()=>{p(!0),r&&r()},[p,r]);return l.jsxs("div",{...h,className:pt(f,t),ref:g,children:[n&&l.jsx("div",{className:"pkt-messagebox__close",children:l.jsx("button",{onClick:k,className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only","aria-label":"Lukk",children:l.jsx(B,{name:"close",className:"pkt-link__icon"})})}),i&&l.jsx("div",{className:"pkt-messagebox__title",children:i}),l.jsx("div",{className:"pkt-messagebox__text",children:s})]})};fn.displayName="PktMessagebox";const qh=Wt({tagName:"pkt-modal",elementClass:Lt,react:x,displayName:"PktModal",events:{}}),gn=x.forwardRef(({children:s,...t},e)=>l.jsx(qh,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));gn.displayName="PktModal";const zh=Wt({tagName:"pkt-progressbar",elementClass:it,react:x,displayName:"PktProgressbar",events:{}}),mn=x.forwardRef(({children:s,...t},e)=>l.jsx(zh,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",children:s})}));mn.displayName="PktProgressbar";const vn=x.forwardRef(({id:s,name:t,label:e,className:i,hasTile:a=!1,disabled:n=!1,checkHelptext:r,hasError:h=!1,defaultChecked:d,checked:p,optionalTag:f,optionalText:g,requiredTag:k,requiredText:b,tagText:y,...w},C)=>{const P=[i,"pkt-input-check"].filter(Boolean).join(" "),T=["pkt-input-check__input",a?"pkt-input-check__input--tile":"",n&&a?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),I=["pkt-input-check__input-checkbox",h?"pkt-input-check__input-checkbox--error":""].filter(Boolean).join(" "),N=["pkt-input-check__input-label",n?"pkt-input-check__input-label--disabled":""].filter(Boolean).join(" "),W=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),Z=()=>l.jsxs(l.Fragment,{children:[y&&l.jsx("span",{className:W+" pkt-tag--gray",children:y}),f&&l.jsx("span",{className:W+" pkt-tag--blue-light",children:g}),k&&l.jsx("span",{className:W+" pkt-tag--beige",children:b})]});return l.jsx("div",{className:P,children:l.jsxs("div",{className:T,children:[l.jsx("input",{ref:C,id:s,type:"radio",name:t,disabled:n,className:I,...p!==void 0?{checked:p}:{defaultChecked:d},...w}),l.jsxs("label",{className:N,htmlFor:s,children:[e," ",Z(),r&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:r})]})]})})});vn.displayName="PktRadioButton";const Wh=x.forwardRef(({appearance:s="local",disabled:t=!1,fullwidth:e=!1,id:i,label:a,name:n,placeholder:r="Søk…",suggestions:h,value:d="",action:p,method:f,onChange:g,onSearch:k,onSuggestionClick:b,...y},w)=>{const C=(N,W)=>{N?N():b&&b(W)},P=N=>{d=N.target.value},T=`pkt-searchinput pkt-searchinput--${s} ${e?"pkt-searchinput--fullwidth":""}`;let I;return p?I=N=>l.jsx("form",{role:"search",className:T,action:p,method:f,children:N}):I=N=>l.jsx("div",{role:"search",className:T,children:N}),I(l.jsxs(l.Fragment,{children:[a&&l.jsx("label",{htmlFor:a?i:void 0,className:a?"pkt-inputwrapper__label":"",children:a}),l.jsxs("div",{className:s==="local"?"pkt-input__container":"pkt-searchinput__field",children:[l.jsx("input",{className:`pkt-input ${e?"pkt-input--fullwidth":""}`,type:"search",name:n||i,id:i,placeholder:r,defaultValue:d,disabled:t,autoComplete:"off","aria-autocomplete":"list",ref:w,"aria-controls":`${i}-suggestions`,onChange:g||P,onKeyUp:k&&(N=>{N.key==="Enter"&&(N.preventDefault(),k(d))}),...y}),l.jsx(je,{className:`pkt-searchinput__button ${s==="local"?"pkt-input-icon":""}`,variant:"icon-only",iconName:"magnifying-glass-big",skin:s==="local"?"tertiary":"primary",color:s==="global"?"yellow":void 0,type:"submit",disabled:t,onClick:k&&(N=>{N.preventDefault(),k(d)}),children:a||r})]}),h&&l.jsx("ul",{id:`${i}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:h.map((N,W)=>l.jsx("li",{children:x.createElement(N.href?"a":N.onClick?"button":"div",{href:N.href,className:`pkt-searchinput__suggestion ${N.onClick?"pkt-link-button":""} ${N.href||N.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:N.onClick?"button":void 0,onClick:()=>C(N.onClick,W),onKeyUp:Z=>Z.key==="Enter"&&C(N.onClick,W)},l.jsxs(l.Fragment,{children:[N.title&&l.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:N.title}),N.text&&l.jsx("p",{className:"pkt-searchinput__suggestion-text",children:N.text})]}))},`search-suggestion-${W}`))})]}))}),Rh=x.forwardRef(({ariaDescribedby:s,ariaLabelledby:t,children:e,className:i,disabled:a=!1,errorMessage:n,hasError:r,helptext:h,helptextDropdown:d,helptextDropdownButton:p,id:f,inline:g=!1,fullwidth:k=!1,label:b,name:y,optionalTag:w=!1,optionalText:C,requiredTag:P=!1,requiredText:T,tagText:I,...N},W)=>{const Z=[i,"pkt-select"].join(" ");return l.jsx(Bs,{className:Z,forId:`${f}-input`,label:b,helptext:h,helptextDropdown:d,helptextDropdownButton:p,optionalTag:w,optionalText:C,requiredTag:P,requiredText:T,tagText:I,hasError:r,errorMessage:n,disabled:a,inline:g,ariaDescribedby:s,children:l.jsx("select",{ref:W,className:`pkt-input ${k?"pkt-input--fullwidth":""}`,"aria-invalid":r,"aria-errormessage":`${f}-error`,"aria-labelledby":t||void 0,disabled:a,id:`${f}-input`,name:y||f,...N,children:e})})}),Kh=l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:l.jsx("circle",{cx:"12",cy:"12",r:"7",style:{fill:"var(--pkt-color-grays-grey-200, #CCC)"}})}),Gh=l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[l.jsx("circle",{opacity:".15",cx:"12",cy:"12",r:"12",fill:"#2A2859"}),l.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"#2A2859"})]}),Yh=l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[l.jsx("path",{fill:"#2A2859",d:"M3 3h18v18H3z"}),l.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"})]}),Zh=({children:s,className:t,status:e="incomplete",title:i})=>l.jsxs("li",{className:pt("pkt-step",t,`pkt-step--${e}`),"data-testid":"pkt-step",children:[l.jsx("span",{className:"pkt-step__line pkt-step__line--1","aria-hidden":!0}),l.jsx("span",{className:"pkt-step__line pkt-step__line--2","aria-hidden":!0}),l.jsx("span",{className:pt("pkt-step__indicator"),children:e==="current"?Gh:e==="completed"?Yh:Kh}),l.jsx("span",{className:"pkt-step__line pkt-step__line--3","aria-hidden":!0}),l.jsxs("div",{className:"pkt-step__wrapper",children:[l.jsx("div",{className:"pkt-step__title",children:i}),l.jsx("div",{className:"pkt-step__content",children:s})]})]}),Xh=x.forwardRef(({activeStep:s,className:t,children:e,hideNonActiveSteps:i=!1,hideNonActiveStepsContent:a=!0,orientation:n="vertical",...r},h)=>{const d=pt(t,"pkt-stepper",n==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),p=x.Children.map(e,(f,g)=>x.isValidElement(f)?x.cloneElement(f,{className:pt(f.props.className,{"pkt-step--hideStep":i&&g!==s,"pkt-step--hideContent":a&&g!==s})}):f);return l.jsx("ol",{"data-testid":"pkt-stepper",className:d,ref:h,...r,children:p})}),Jh=({className:s,compact:t=!1,skin:e="basic",responsiveView:i=!0,children:a,...n})=>l.jsx("table",{"data-testid":"pkt-table",className:pt(s,"pkt-table",{"pkt-table--responsive":i,"pkt-table--compact":t,"pkt-table--basic":e==="basic","pkt-table--zebra-blue":e==="zebra-blue"}),role:"table",...n,children:a}),Qh=({id:s,children:t,className:e,...i})=>l.jsx("tbody",{id:s,className:pt(e,"pkt-table__body",{}),...i,role:"rowgroup",children:t}),td=({children:s,className:t,dataLabel:e,...i})=>l.jsx("td",{className:pt(t,"pkt-table__data-cell",{}),"data-label":e,role:"cell","data-testid":"pkt-table__data-cell",...i,children:s}),ed=({className:s,children:t,...e})=>l.jsx("thead",{className:pt(s,"pkt-table__header",{}),role:"rowgroup",...e,children:t}),sd=({className:s,children:t,...e})=>l.jsx("th",{className:pt(s,"pkt-table__header-cell",{}),role:"columnheader",...e,children:t}),id=({className:s,children:t,...e})=>l.jsx("tr",{className:pt(s,"pkt-table__row",{}),role:"row",...e,children:t}),Bi=x.forwardRef(({children:s,skin:t,textStyle:e,size:i,closeTag:a,className:n,iconName:r,ariaLabel:h,onClose:d,type:p,"aria-description":f,...g},k)=>{const[b,y]=x.useState(!1),w=x.useCallback(()=>{y(!0),d&&d()},[y]),C=x.useRef(null),[P,T]=x.useState("");x.useEffect(()=>{var Z,wt;T(((wt=(Z=C.current)==null?void 0:Z.textContent)==null?void 0:wt.trim())??"")},[s]);const I=x.useMemo(()=>{if(a&&!h)return P&&`Klikk for å fjerne ${P}`||f},[a,h,P,f]),N={"pkt-tag":!0,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${t}`]:!!t,[`pkt-tag--${e}`]:!!e},W={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${e}`]:!!e,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${t}`]:!!t,"pkt-btn--icons-right-and-left":a&&!!r,"pkt-hide":b};return a?l.jsxs("button",{...g,className:pt(W,n),type:p,onClick:w,"aria-label":h,"aria-description":I,ref:k,children:[r&&l.jsx(B,{className:"pkt-tag__icon",name:r}),l.jsx("span",{ref:C,children:s}),l.jsx(B,{className:"pkt-tag__close-btn",name:"close"})]}):l.jsxs("span",{...g,className:pt(N,n),ref:k,children:[r&&l.jsx(B,{className:"pkt-tag__icon",name:r,"aria-hidden":"true"}),l.jsx("span",{ref:C,children:s})]})});Bi.displayName="PktTag";const Fi=x.forwardRef(({children:s,active:t,href:e,onClick:i,icon:a,controls:n,tag:r,tagSkin:h,index:d=0},p)=>{const{arrowNav:f,registerTabRef:g,handleKeyPress:k,selectTab:b}=ad(),w={"aria-selected":f?!!t:void 0,"aria-controls":n,role:f?"tab":void 0,onKeyUp:P=>k(d,P),onClick:P=>{b(d),i==null||i(P)},tabIndex:t||!f?void 0:-1,ref:P=>{g(d,P),typeof p=="function"?p(P):p&&(p.current=P)}},C=l.jsxs(l.Fragment,{children:[a&&l.jsx(B,{name:a,className:"pkt-icon--small"}),s,r&&l.jsx(Bi,{skin:h,size:"small",children:r})]});return e?l.jsx("a",{...w,href:e,className:`pkt-tabs__link ${t?"active":""}`,children:C}):l.jsx("button",{...w,type:"button",className:`pkt-tabs__button pkt-link-button ${t?"active":""}`,children:C})});Fi.displayName="PktTabItem";const bn=x.createContext(null),ad=()=>{const s=x.useContext(bn);if(!s)throw new Error("TabItem must be used within a Tabs component");return s},nd=x.forwardRef(({arrowNav:s=!0,disableArrowNav:t=!1,tabs:e,onTabSelected:i,children:a},n)=>{const r=x.useRef([]),h=s&&!t,p=a&&x.Children.count(a)>0?x.Children.count(a):(e==null?void 0:e.length)||0;x.useEffect(()=>{r.current=r.current.slice(0,p)},[p]);const f=y=>{const w=e==null?void 0:e[y];w!=null&&w.action&&w.action(y),i&&i(y)},g=(y,w)=>{var C,P;h&&(w.code==="ArrowLeft"&&y!==0&&((C=r.current[y-1])==null||C.focus()),w.code==="ArrowRight"&&y<p-1&&((P=r.current[y+1])==null||P.focus()),(w.code==="ArrowDown"||w.code==="Space")&&f(y))},k=(y,w)=>{r.current[y]=w},b=e==null?void 0:e.map((y,w)=>{var C,P;return l.jsx(Fi,{active:y.active,href:y.href,onClick:()=>f(w),icon:y.icon,controls:y.controls,tag:(C=y.tag)==null?void 0:C.text,tagSkin:(P=y.tag)==null?void 0:P.skin,index:w,children:y.text},w)});return l.jsx(bn.Provider,{value:{arrowNav:h,registerTabRef:k,handleKeyPress:g,selectTab:f},children:l.jsx("div",{className:"pkt-tabs",ref:n,children:l.jsx("div",{className:"pkt-tabs__list",role:h?"tablist":"navigation",children:a||b})})})}),rd=x.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,counter:i,counterMaxLength:a,className:n,disabled:r,errorMessage:h,hasError:d,helptext:p,helptextDropdown:f,helptextDropdownButton:g,inline:k,fullwidth:b=!1,label:y,name:w,optionalTag:C=!1,optionalText:P,requiredTag:T=!1,requiredText:I,tagText:N=null,placeholder:W,rows:Z,useWrapper:wt=!0,onChange:bt,value:Q,autoComplete:rt="off",minLength:Ft,maxLength:Vt,readOnly:ot=!1,skipForwardTestid:F=!1,...At},ae)=>{const de=[n,"pkt-textinput","pkt-textarea"].join(" "),ne=`${s}-input`,He=`${ne}-label`,ds=e||He,[ce,zt]=x.useState(0),ut=Ue=>{var qe,pe;if(i&&zt(((pe=(qe=Ue.currentTarget)==null?void 0:qe.value)==null?void 0:pe.length)||0),bt)return bt(Ue)};return x.useEffect(()=>{Q!==void 0&&zt((Q==null?void 0:Q.length)||0)},[Q]),l.jsx(Bs,{ariaDescribedby:t,className:de,disabled:r,errorMessage:h,forId:ne,hasError:d,helptext:p,helptextDropdown:f,helptextDropdownButton:g,inline:k,label:y,optionalTag:C,optionalText:P,requiredTag:T,requiredText:I,tagText:N,useWrapper:wt,counter:i,counterCurrent:ce,counterMaxLength:a,children:l.jsx("textarea",{ref:ae,className:`pkt-input ${b?"pkt-input--fullwidth":""} ${a&&ce>a?"pkt-input--counter-error":""}`,name:`${w||s}`,id:ne,placeholder:W,disabled:r,rows:Z,"aria-labelledby":ds,"aria-invalid":d,"aria-errormessage":`${s}-error`,...At,onChange:ut,value:Q,autoComplete:rt,minLength:Ft,maxLength:Vt,"data-skip-forward-testid":F?"true":void 0})})}),od=x.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,autocomplete:i="off",counter:a,counterMaxLength:n,className:r,disabled:h=!1,errorMessage:d,hasError:p=!1,helptext:f,helptextDropdown:g,helptextDropdownButton:k,iconNameRight:b,inline:y=!1,fullwidth:w=!1,label:C,name:P,optionalTag:T=!1,optionalText:I,requiredTag:N=!1,requiredText:W,tagText:Z=null,placeholder:wt,prefix:bt,suffix:Q,type:rt="text",useWrapper:Ft=!0,omitSearchIcon:Vt=!1,value:ot,minLength:F,maxLength:At,min:ae,max:de,step:ne,size:He,readonly:ds,required:ce,dataTestid:zt,onChange:ut,skipForwardTestid:Ue=!1,...qe},pe)=>{const ji=[r,"pkt-textinput"].join(" "),hi=rt==="search"&&!b&&!Vt,Hi=rt==="date"&&ot?ot.slice(0,10):ot,[di,cs]=x.useState((ot==null?void 0:ot.length)||0),ps=`${s}`,Vs=`${ps}-label`,ci=e||Vs,Ui=_e=>{var pi,ui;a&&cs(((ui=(pi=_e.currentTarget)==null?void 0:pi.value)==null?void 0:ui.length)||0),ut&&ut(_e)};return x.useEffect(()=>{ot!==void 0&&cs((ot==null?void 0:ot.length)||0)},[ot]),l.jsx(Bs,{ariaDescribedby:t,className:ji,disabled:h,errorMessage:d,forId:ps,hasError:p,helptext:f,helptextDropdown:g,helptextDropdownButton:k,inline:y,label:C,optionalTag:T,optionalText:I,requiredTag:N,requiredText:W,tagText:Z,useWrapper:Ft,counter:a,counterCurrent:di,counterMaxLength:n,children:l.jsxs("div",{className:"pkt-input__container","data-testid":zt,"data-skip-forward-testid":Ue?"true":void 0,children:[bt&&l.jsx("div",{className:"pkt-input-prefix",children:bt}),l.jsx("input",{...qe,ref:pe,className:`pkt-input ${w?"pkt-input--fullwidth":""} ${n&&di>n?"pkt-input--counter-error":""}`,type:rt,name:`${P||s}`,value:Hi,id:ps,placeholder:wt,autoComplete:i,disabled:h,"aria-invalid":p,"aria-errormessage":`${s}-error`,"aria-labelledby":ci,min:ae,max:de,onChange:Ui,step:ne,minLength:F,maxLength:At,size:He,required:ce}),Q&&l.jsxs("p",{className:"pkt-input-suffix",children:[Q,b&&l.jsx(B,{className:"pkt-input-suffix-icon",name:b}),hi&&l.jsx(B,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!Q&&b&&l.jsx(B,{className:"pkt-input-icon",name:b}),!Q&&hi&&l.jsx(B,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})});var ls=window.CustomEvent;(!ls||typeof ls=="object")&&(ls=function(s,t){t=t||{};var e=document.createEvent("CustomEvent");return e.initCustomEvent(s,!!t.bubbles,!!t.cancelable,t.detail||null),e},ls.prototype=window.Event.prototype);function yn(s,t){var e="on"+t.type.toLowerCase();return typeof s[e]=="function"&&s[e](t),s.dispatchEvent(t)}function ld(s){for(;s&&s!==document.body;){var t=window.getComputedStyle(s),e=function(i,a){return!(t[i]===void 0||t[i]===a)};if(t.opacity<1||e("zIndex","auto")||e("transform","none")||e("mixBlendMode","normal")||e("filter","none")||e("perspective","none")||t.isolation==="isolate"||t.position==="fixed"||t.webkitOverflowScrolling==="touch")return!0;s=s.parentElement}return!1}function Fs(s){for(;s;){if(s.localName==="dialog")return s;s.parentElement?s=s.parentElement:s.parentNode?s=s.parentNode.host:s=null}return null}function kn(s){for(;s&&s.shadowRoot&&s.shadowRoot.activeElement;)s=s.shadowRoot.activeElement;s&&s.blur&&s!==document.body&&s.blur()}function hd(s,t){for(var e=0;e<s.length;++e)if(s[e]===t)return!0;return!1}function Vi(s){return!s||!s.hasAttribute("method")?!1:s.getAttribute("method").toLowerCase()==="dialog"}function $n(s){var t=["button","input","keygen","select","textarea"],e=t.map(function(r){return r+":not([disabled])"});e.push('[tabindex]:not([disabled]):not([tabindex=""])');var i=s.querySelector(e.join(", "));if(!i&&"attachShadow"in Element.prototype)for(var a=s.querySelectorAll("*"),n=0;n<a.length&&!(a[n].tagName&&a[n].shadowRoot&&(i=$n(a[n].shadowRoot),i));n++);return i}function _n(s){return s.isConnected||document.body.contains(s)}function wn(s){if(s.submitter)return s.submitter;var t=s.target;if(!(t instanceof HTMLFormElement))return null;var e=z.formSubmitter;if(!e){var i=s.target,a="getRootNode"in i&&i.getRootNode()||document;e=a.activeElement}return!e||e.form!==t?null:e}function dd(s){if(!s.defaultPrevented){var t=s.target,e=z.imagemapUseValue,i=wn(s);e===null&&i&&(e=i.value);var a=Fs(t);if(a){var n=i&&i.getAttribute("formmethod")||t.getAttribute("method");n==="dialog"&&(s.preventDefault(),e!=null?a.close(e):a.close())}}}function xn(s){if(this.dialog_=s,this.replacedStyleTop_=!1,this.openAsModal_=!1,s.hasAttribute("role")||s.setAttribute("role","dialog"),s.show=this.show.bind(this),s.showModal=this.showModal.bind(this),s.close=this.close.bind(this),s.addEventListener("submit",dd,!1),"returnValue"in s||(s.returnValue=""),"MutationObserver"in window){var t=new MutationObserver(this.maybeHideModal.bind(this));t.observe(s,{attributes:!0,attributeFilter:["open"]})}else{var e=!1,i=(function(){e?this.downgradeModal():this.maybeHideModal(),e=!1}).bind(this),a,n=function(r){if(r.target===s){var h="DOMNodeRemoved";e|=r.type.substr(0,h.length)===h,window.clearTimeout(a),a=window.setTimeout(i,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(r){s.addEventListener(r,n)})}Object.defineProperty(s,"open",{set:this.setOpen.bind(this),get:s.hasAttribute.bind(s,"open")}),this.backdrop_=document.createElement("div"),this.backdrop_.className="backdrop",this.backdrop_.addEventListener("mouseup",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("mousedown",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("click",this.backdropMouseEvent_.bind(this))}xn.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&_n(this.dialog_)||this.downgradeModal()},downgradeModal:function(){this.openAsModal_&&(this.openAsModal_=!1,this.dialog_.style.zIndex="",this.replacedStyleTop_&&(this.dialog_.style.top="",this.replacedStyleTop_=!1),this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_),z.dm.removeDialog(this))},setOpen:function(s){s?this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open",""):(this.dialog_.removeAttribute("open"),this.maybeHideModal())},backdropMouseEvent_:function(s){if(this.dialog_.hasAttribute("tabindex"))this.dialog_.focus();else{var t=document.createElement("div");this.dialog_.insertBefore(t,this.dialog_.firstChild),t.tabIndex=-1,t.focus(),this.dialog_.removeChild(t)}var e=document.createEvent("MouseEvents");e.initMouseEvent(s.type,s.bubbles,s.cancelable,window,s.detail,s.screenX,s.screenY,s.clientX,s.clientY,s.ctrlKey,s.altKey,s.shiftKey,s.metaKey,s.button,s.relatedTarget),this.dialog_.dispatchEvent(e),s.stopPropagation()},focus_:function(){var s=this.dialog_.querySelector("[autofocus]:not([disabled])");!s&&this.dialog_.tabIndex>=0&&(s=this.dialog_),s||(s=$n(this.dialog_)),kn(document.activeElement),s&&s.focus()},updateZIndex:function(s,t){if(s<t)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=s,this.backdrop_.style.zIndex=t},show:function(){this.dialog_.open||(this.setOpen(!0),this.focus_())},showModal:function(){if(this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.");if(!_n(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!z.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");ld(this.dialog_.parentElement)&&console.warn("A dialog is being shown inside a stacking context. This may cause it to be unusable. For more information, see this link: https://github.com/GoogleChrome/dialog-polyfill/#stacking-context"),this.setOpen(!0),this.openAsModal_=!0,z.needsCentering(this.dialog_)?(z.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(s){if(!this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.");this.setOpen(!1),s!==void 0&&(this.dialog_.returnValue=s);var t=new ls("close",{bubbles:!1,cancelable:!1});yn(this.dialog_,t)}};var z={};if(z.reposition=function(s){var t=document.body.scrollTop||document.documentElement.scrollTop,e=t+(window.innerHeight-s.offsetHeight)/2;s.style.top=Math.max(t,e)+"px"},z.isInlinePositionSetByStylesheet=function(s){for(var t=0;t<document.styleSheets.length;++t){var e=document.styleSheets[t],i=null;try{i=e.cssRules}catch{}if(i)for(var a=0;a<i.length;++a){var n=i[a],r=null;try{r=document.querySelectorAll(n.selectorText)}catch{}if(!(!r||!hd(r,s))){var h=n.style.getPropertyValue("top"),d=n.style.getPropertyValue("bottom");if(h&&h!=="auto"||d&&d!=="auto")return!0}}}return!1},z.needsCentering=function(s){var t=window.getComputedStyle(s);return t.position!=="absolute"||s.style.top!=="auto"&&s.style.top!==""||s.style.bottom!=="auto"&&s.style.bottom!==""?!1:!z.isInlinePositionSetByStylesheet(s)},z.forceRegisterDialog=function(s){if((window.HTMLDialogElement||s.showModal)&&console.warn("This browser already supports <dialog>, the polyfill may not work correctly",s),s.localName!=="dialog")throw new Error("Failed to register dialog: The element is not a dialog.");new xn(s)},z.registerDialog=function(s){s.showModal||z.forceRegisterDialog(s)},z.DialogManager=function(){this.pendingDialogStack=[];var s=this.checkDOM_.bind(this);this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",(function(t){this.forwardTab_=void 0,t.stopPropagation(),s([])}).bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=100150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver(function(t){var e=[];t.forEach(function(i){for(var a=0,n;n=i.removedNodes[a];++a){if(n instanceof Element)n.localName==="dialog"&&e.push(n);else continue;e=e.concat(n.querySelectorAll("dialog"))}}),e.length&&s(e)}))},z.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0),document.addEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})},z.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},z.DialogManager.prototype.updateStacking=function(){for(var s=this.zIndexHigh_,t=0,e;e=this.pendingDialogStack[t];++t)e.updateZIndex(--s,--s),t===0&&(this.overlay.style.zIndex=--s);var i=this.pendingDialogStack[0];if(i){var a=i.dialog.parentNode||document.body;a.appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},z.DialogManager.prototype.containedByTopDialog_=function(s){for(;s=Fs(s);){for(var t=0,e;e=this.pendingDialogStack[t];++t)if(e.dialog===s)return t===0;s=s.parentElement}return!1},z.DialogManager.prototype.handleFocus_=function(s){var t=s.composedPath?s.composedPath()[0]:s.target;if(!this.containedByTopDialog_(t)&&document.activeElement!==document.documentElement&&(s.preventDefault(),s.stopPropagation(),kn(t),this.forwardTab_!==void 0)){var e=this.pendingDialogStack[0],i=e.dialog,a=i.compareDocumentPosition(t);return a&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?e.focus_():t!==document.documentElement&&document.documentElement.focus()),!1}},z.DialogManager.prototype.handleKey_=function(s){if(this.forwardTab_=void 0,s.keyCode===27){s.preventDefault(),s.stopPropagation();var t=new ls("cancel",{bubbles:!1,cancelable:!0}),e=this.pendingDialogStack[0];e&&yn(e.dialog,t)&&e.dialog.close()}else s.keyCode===9&&(this.forwardTab_=!s.shiftKey)},z.DialogManager.prototype.checkDOM_=function(s){var t=this.pendingDialogStack.slice();t.forEach(function(e){s.indexOf(e.dialog)!==-1?e.downgradeModal():e.maybeHideModal()})},z.DialogManager.prototype.pushDialog=function(s){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=t?!1:(this.pendingDialogStack.unshift(s)===1&&this.blockDocument(),this.updateStacking(),!0)},z.DialogManager.prototype.removeDialog=function(s){var t=this.pendingDialogStack.indexOf(s);t!==-1&&(this.pendingDialogStack.splice(t,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())},z.dm=new z.DialogManager,z.formSubmitter=null,z.imagemapUseValue=null,window.HTMLDialogElement===void 0){var Sn=document.createElement("form");if(Sn.setAttribute("method","dialog"),Sn.method!=="dialog"){var hs=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(hs){var cd=hs.get;hs.get=function(){return Vi(this)?"dialog":cd.call(this)};var pd=hs.set;hs.set=function(s){return typeof s=="string"&&s.toLowerCase()==="dialog"?this.setAttribute("method",s):pd.call(this,s)},Object.defineProperty(HTMLFormElement.prototype,"method",hs)}}document.addEventListener("click",function(s){if(z.formSubmitter=null,z.imagemapUseValue=null,!s.defaultPrevented){var t=s.target;if("composedPath"in s){var e=s.composedPath();t=e.shift()||t}if(!(!t||!Vi(t.form))){var i=t.type==="submit"&&["button","input"].indexOf(t.localName)>-1;if(!i){if(!(t.localName==="input"&&t.type==="image"))return;z.imagemapUseValue=s.offsetX+","+s.offsetY}var a=Fs(t);a&&(z.formSubmitter=t)}}},!1),document.addEventListener("submit",function(s){var t=s.target,e=Fs(t);if(!e){var i=wn(s),a=i&&i.getAttribute("formmethod")||t.getAttribute("method");a==="dialog"&&s.preventDefault()}});var ud=HTMLFormElement.prototype.submit,fd=function(){if(!Vi(this))return ud.call(this);var s=Fs(this);s&&s.close()};HTMLFormElement.prototype.submit=fd}const gd=Object.freeze(Object.defineProperty({__proto__:null,default:z},Symbol.toStringTag,{value:"Module"}));O.PktAccordion=Ki,O.PktAccordionItem=tn,O.PktAlert=Li,O.PktBackLink=sn,O.PktBreadcrumbs=Oh,O.PktButton=je,O.PktCard=an,O.PktCheckbox=nn,O.PktCombobox=rn,O.PktConsent=li,O.PktDatepicker=on,O.PktFooter=Bh,O.PktFooterSimple=Fh,O.PktHeader=Vh,O.PktHeading=ln,O.PktHelptext=hn,O.PktIcon=B,O.PktInput=dn,O.PktInputWrapper=Bs,O.PktLink=cn,O.PktLinkCard=pn,O.PktLoader=un,O.PktMessagebox=fn,O.PktModal=gn,O.PktProgressbar=mn,O.PktRadioButton=vn,O.PktSearchInput=Wh,O.PktSelect=Rh,O.PktStep=Zh,O.PktStepper=Xh,O.PktTabItem=Fi,O.PktTable=Jh,O.PktTableBody=Qh,O.PktTableDataCell=td,O.PktTableHeader=ed,O.PktTableHeaderCell=sd,O.PktTableRow=id,O.PktTabs=nd,O.PktTag=Bi,O.PktTextarea=rd,O.PktTextinput=od,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})}));
|
|
1758
|
+
*/var va;function Jh(){return va||(va=1,(function(s){(function(){var t={}.hasOwnProperty;function e(){for(var a="",r=0;r<arguments.length;r++){var h=arguments[r];h&&(a=n(a,i(h)))}return a}function i(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return e.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var r="";for(var h in a)t.call(a,h)&&a[h]&&(r=n(r,h));return r}function n(a,r){return r?a?a+" "+r:a+r:a}s.exports?(e.default=e,s.exports=e):window.classNames=e})()})(Qi)),Qi.exports}var Qh=Jh();const X=Xh(Qh),tn=({children:s,closeAlert:t,compact:e,title:i,date:n,ariaLive:a,"aria-live":r="polite",role:h="status",skin:d="info",className:u,...g})=>{const[m,$]=_.useState(!1),b={"pkt-alert":!0,"pkt-alert--compact":e,[`pkt-alert--${d}`]:d,"pkt-hide":m},y={"pkt-alert__grid":!0,"pkt-alert__noTitle":!i,"pkt-alert__noDate":!n},x=_.useCallback(()=>{$(!0),g.onClose&&g.onClose(new CustomEvent("close",{detail:{origin:event},bubbles:!0,composed:!0}))},[g.onClose,$]),T=a||r;return l.jsx("div",{...g,"aria-live":T,role:h,className:X(b,u),children:l.jsxs("div",{className:X(y),children:[l.jsx(q,{className:"pkt-alert__icon","aria-hidden":"true",name:d==="info"?"alert-information":`alert-${d}`}),t&&l.jsx("div",{className:"pkt-alert__close",children:l.jsx(be,{tabIndex:0,"aria-label":"close",size:e?"small":"medium",type:"button",skin:"tertiary",iconName:"close",variant:"icon-only",onClick:x,children:l.jsx("span",{className:"sr-only",children:"Lukk"})})}),i&&l.jsx("div",{className:"pkt-alert__title",children:i}),l.jsx("div",{className:"pkt-alert__text",children:s}),n&&l.jsxs("div",{className:"pkt-alert__date",children:["Sist oppdatert: ",n]})]})})};tn.displayName="PktAlert";const ba=ie({tagName:"pkt-backlink",elementClass:ms,react:_,displayName:"PktBackLink"});ba.displayName="PktBackLink";const td=_.forwardRef(({breadcrumbs:s,navigationType:t,className:e,...i},n)=>{const a=s,r=a[a.length-2],h=[e,"pkt-breadcrumbs"].filter(Boolean).join(" ");return l.jsxs("nav",{ref:n,"aria-label":"brødsmulemeny",className:h,children:[l.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:a.map((d,u)=>l.jsx("li",{className:"pkt-breadcrumbs__item",children:u===a.length-1?l.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:l.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})}):t==="router"?l.jsxs(on.Link,{to:d.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[l.jsx(q,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})]}):l.jsxs("a",{href:d.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[l.jsx(q,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})]})},`breadcrumb-${u}`))}),t==="router"?l.jsxs(on.Link,{to:r.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...i,children:[l.jsx(q,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:r.text})]}):l.jsxs("a",{href:r.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...i,children:[l.jsx(q,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:r.text})]})]})});window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/14.0/animations/";const be=_.forwardRef(({children:s,className:t,iconName:e="user",secondIconName:i="user",iconPath:n,secondIconPath:a,size:r="medium",fullWidth:h=!1,fullWidthOnMobile:d=!1,skin:u="primary",type:g="button",variant:m="label-only",state:$,color:b,isLoading:y=void 0,disabled:x=void 0,loadingAnimationPath:T=window.pktAnimationPath,...S},A)=>{const I=[t,"pkt-btn",r&&`pkt-btn--${r}`,h&&"pkt-btn--full",d&&"pkt-btn--full-small",u&&`pkt-btn--${u}`,m&&`pkt-btn--${m}`,b&&`pkt-btn--${b}`,$&&`pkt-btn--${$}`,y&&"pkt-btn--isLoading"].filter(Boolean).join(" ");return l.jsxs("button",{...S,"aria-busy":y||void 0,"aria-disabled":x||void 0,disabled:x,className:I,type:g,ref:A,children:[y&&l.jsx(q,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:T}),m!=="label-only"&&l.jsx(q,{className:"pkt-btn__icon",name:e,...n&&{path:n}}),l.jsx("span",{className:"pkt-btn__text",children:s}),m==="icons-right-and-left"&&l.jsx(q,{className:"pkt-btn__icon",name:i,...a&&{path:a}})]})});be.displayName="PktButton";const ed=ie({tagName:"pkt-card",elementClass:gt,react:_,displayName:"PktCard",events:{}}),ka=_.forwardRef(({children:s,...t},e)=>l.jsx(ed,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));ka.displayName="PktCard";const ya=_.forwardRef(({id:s,hasTile:t=!1,disabled:e=!1,label:i,checkHelptext:n,hasError:a=!1,className:r,isSwitch:h=!1,hideLabel:d=!1,labelPosition:u="right",defaultChecked:g,checked:m,indeterminate:$,optionalTag:b,optionalText:y="Valgfritt",requiredTag:x,requiredText:T="Må fylles ut",tagText:S,...A},I)=>{const O=_.useRef(null);_.useEffect(()=>{O.current&&$!==void 0&&(O.current.indeterminate=$)},[$]),_.useEffect(()=>{typeof I=="function"?I(O.current):I&&(I.current=O.current)},[I]);const K=[r,"pkt-input-check"].filter(Boolean).join(" "),et=["pkt-input-check__input-label",e?"pkt-input-check__input-label--disabled":"",`pkt-input-check__input-label--${u}`,d?"pkt-sr-only":""].filter(Boolean).join(" "),Ot=["pkt-input-check__input",t?"pkt-input-check__input--tile":"",e&&t?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),Et=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),it=()=>l.jsxs(l.Fragment,{children:[S&&l.jsx("span",{className:Et+" pkt-tag--gray",children:S}),b&&l.jsx("span",{className:Et+" pkt-tag--blue-light",children:y}),x&&l.jsx("span",{className:Et+" pkt-tag--beige",children:T})]});return l.jsx("div",{className:K,children:l.jsxs("div",{className:Ot,children:[u==="left"&&l.jsxs("label",{className:et,htmlFor:s,children:[i," ",it(),n&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]}),l.jsx("input",{role:h?"switch":"checkbox",ref:O,className:`pkt-input-check__input-checkbox ${a?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:s,disabled:e,...m!==void 0?{checked:m}:{defaultChecked:g},...A}),u==="right"&&l.jsxs("label",{className:et,htmlFor:s,children:[i," ",it(),n&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]})]})})});ya.displayName="PktCheckbox";const sd=ie({tagName:"pkt-combobox",elementClass:nt,react:_,displayName:"PktCombobox",events:{onClick:"click",onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),$a=_.forwardRef(({children:s,helptext:t,...e},i)=>l.jsxs(sd,{...e,ref:i,children:[t&&l.jsx("div",{slot:"helptext",className:"pkt-contents",children:t}),s]}));$a.displayName="PktCombobox";const Ei=ie({tagName:"pkt-consent",elementClass:Xt,react:_,displayName:"PktConsent",events:{onToggleConsent:"toggle-consent"}});Ei.displayName="PktConsent";const id=ie({tagName:"pkt-datepicker",elementClass:ht,react:_,displayName:"PktDatepicker",events:{onChange:"change",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),_a=_.forwardRef(({helptext:s,...t},e)=>l.jsx(id,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",slot:"helptext",children:s})}));_a.displayName="PktDatepicker";const nd=({columnOne:s,columnTwo:t,socialLinks:e,className:i,openLinksInNewTab:n=!1,personvernOgInfoLink:a="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:r="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:h=!1,hotjarId:d=null,googleAnalyticsId:u=null,devMode:g=!1,cookieDomain:m=null,cookieSecure:$=null,cookieExpiryDays:b=null,onToggleConsent:y=x=>{console.log(x.detail)}})=>{var T,S;const x=[i,"pkt-footer"].filter(Boolean).join(" ");return l.jsx("footer",{className:x,"data-mode":"dark",children:l.jsxs("div",{className:"pkt-footer__container",children:[l.jsxs("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[l.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l.jsx("h2",{className:"pkt-footer__title",children:s.title}),l.jsxs("ul",{className:"pkt-footer__list",children:[s.text&&l.jsx("li",{className:"pkt-footer__text",children:s.text}),(T=s.links)==null?void 0:T.map((A,I)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${A.external?"pkt-link--external":""}`,href:A.href,target:A.openInNewTab||n?"_blank":"_self",rel:A.openInNewTab||n?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer__link-icon",name:"chevron-right"}),A.text]})},`links-${I}`))]})]}),l.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l.jsx("h2",{className:"pkt-footer__title",children:t.title}),l.jsxs("ul",{className:"pkt-footer__list",children:[t.text&&l.jsx("li",{className:"pkt-footer__text",children:t.text}),(S=t.links)==null?void 0:S.map((A,I)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${A.external?"pkt-link--external":""}`,href:A.href,target:A.openInNewTab||n?"_blank":"_self",rel:A.openInNewTab||n?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer__link-icon",name:"chevron-right"}),A.text]})},`links-${I}`))]})]}),l.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l.jsx("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),l.jsxs("ul",{className:"pkt-footer__list",children:[l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:"pkt-footer__link",href:a,target:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:"pkt-footer__link",href:r,target:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),h&&l.jsx("li",{className:"pkt-footer__list-item",children:l.jsx(Ei,{triggerType:"footerlink",hotjarId:d,googleAnalyticsId:u,devMode:g,cookieDomain:m,cookieSecure:$,cookieExpiryDays:b,onToggleConsent:y})})]})]})]}),e&&l.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[l.jsx("div",{className:"pkt-footer__social-languages",children:e.filter(A=>A.language).map((A,I)=>l.jsx("div",{className:"pkt-footer__social-language",children:l.jsx("a",{href:A.href,"aria-label":`til ${A.language} versjon av nettsiden`,target:A.openInNewTab||n?"_blank":"_self",rel:A.openInNewTab||n?"noopener noreferrer":void 0,children:A.language})},`sociallinks-language-${I}`))}),l.jsx("div",{className:"pkt-footer__social-icons",children:e.filter(A=>A.iconName).map((A,I)=>l.jsx(_.Fragment,{children:l.jsx("a",{href:A.href,"aria-label":`til ${A.iconName}`,className:"pkt-footer__social-icon-link",target:A.openInNewTab||n?"_blank":"_self",rel:A.openInNewTab||n?"noopener noreferrer":void 0,children:l.jsx(q,{className:"pkt-footer__social-icon",name:A.iconName})})},`sociallinks-${I}`))})]})]})})},ad=({links:s=[],openLinksInNewTab:t=!1,personvernOgInfoLink:e="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:i="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:n=!1,hotjarId:a=null,googleAnalyticsId:r=null,devMode:h=!1,cookieDomain:d=null,cookieSecure:u=null,cookieExpiryDays:g=null,onToggleConsent:m=b=>{console.log(b.detail)},className:$})=>{const b=[$,"pkt-footer-simple"].filter(Boolean).join(" ");return l.jsx("footer",{className:b,"data-mode":"dark",children:l.jsx("div",{className:"pkt-footer-simple__container",children:l.jsxs("ul",{className:"pkt-footer-simple__list",children:[s.map((y,x)=>l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:`pkt-footer-simple__link ${y.external?" pkt-link--external":""}`,href:y.href,target:y.openInNewTab||t?"_blank":"_self",rel:y.openInNewTab||t?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),y.text]})},x)),l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:"pkt-footer-simple__link",href:e,target:t?"_blank":"_self",rel:t?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:"pkt-footer-simple__link",href:i,target:t?"_blank":"_self",rel:t?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),n&&l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsx(Ei,{triggerType:"footerlink",hotjarId:a,googleAnalyticsId:r,devMode:h,cookieDomain:d,cookieSecure:u,cookieExpiryDays:g,onToggleConsent:m})})]})})})},Ni=({href:s,iconName:t,className:e,iconPosition:i,external:n,target:a,children:r,...h})=>{const d={"pkt-link":!0,"pkt-link--icon-left":!!t&&i==="left"||!!(t&&!i),"pkt-link--icon-right":!!t&&i==="right","pkt-link--external":n};return l.jsxs("a",{...h,className:X(d,e),href:s,target:a,rel:n?"noopener noreferrer":void 0,children:[t&&l.jsx(q,{name:t,className:"pkt-link__icon"}),r]})};Ni.displayName="PktLink";const rd=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},Mi=({item:s,className:t})=>"href"in s?l.jsx(Ni,{iconName:s.iconName,href:s.href,"aria-hidden":"true",className:X("pkt-user-menu__link",t),children:s.title}):l.jsxs("button",{className:X("pkt-user-menu__link pkt-link-button pkt-link pkt-link--icon-left",t),type:"button",onClick:()=>{"onClick"in s&&typeof s.onClick=="function"?s.onClick():console.error("UserMenuButton item is missing onClick handler or onClick is not a function:",s)},children:[s.iconName&&l.jsx(q,{name:s.iconName,className:"pkt-link__icon","aria-hidden":"true"}),s.title]}),od=({links:s})=>l.jsx("ul",{className:"pkt-user-menu__sublist",children:s.map((t,e)=>l.jsx("li",{className:"pkt-user-menu__subitem",children:l.jsx(Mi,{item:t})},e))}),ld=_.forwardRef(({user:s,formattedLastLoggedIn:t,representing:e,userMenu:i,canChangeRepresentation:n,changeRepresentation:a,logoutOnClick:r},h)=>{const d=i==null?void 0:i.map(rd);return l.jsx("nav",{className:"pkt-user-menu",ref:h,"aria-label":"Meny for innlogget bruker",children:l.jsxs("ul",{className:"pkt-user-menu__list",children:[s&&l.jsxs("li",{className:"pkt-user-menu__item",children:[l.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),l.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:s.name}),t&&l.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",l.jsx("time",{children:t})]})]}),d&&d.length>0&&l.jsx("li",{className:"pkt-user-menu__item",children:l.jsx(od,{links:d})}),e&&l.jsxs("li",{className:"pkt-user-menu__item",children:[l.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),l.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:e.name}),e.orgNumber&&l.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",e.orgNumber]}),n&&a&&l.jsx("ul",{className:"pkt-user-menu__sublist mt-size-16",children:l.jsx("li",{className:"pkt-user-menu__subitem",children:l.jsx(Mi,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:a}})})})]}),!e&&n&&a&&l.jsx("li",{className:"pkt-user-menu__item",children:l.jsx("ul",{className:"pkt-user-menu__sublist",children:l.jsx("li",{className:"pkt-user-menu__subitem",children:l.jsx(Mi,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:a}})})})}),r&&l.jsx("li",{className:"pkt-user-menu__item",children:l.jsx(Mi,{item:{title:"Logg ut",iconName:"exit",onClick:r}})})]})})}),si=_.forwardRef(({forId:s,label:t,helptext:e,helptextDropdown:i,helptextDropdownButton:n,counter:a,counterCurrent:r=0,counterMaxLength:h,optionalTag:d=!1,optionalText:u="Valgfritt",requiredTag:g=!1,requiredText:m="Må fylles ut",tagText:$=null,hasError:b=!1,errorMessage:y,disabled:x=!1,inline:T=!1,ariaDescribedby:S,useWrapper:A=!0,children:I,className:O="",hasFieldset:K=!1,role:et="group",counterPosition:Ot="bottom"},Et)=>{const[it,kt]=_.useState(!1),Yt=S||(e?`${s}-helptext`:void 0),Nt=!!a,ct=Nt&&Ot==="top",de=Nt&&Ot==="bottom",ke=()=>kt(pt=>!pt),V=["pkt-inputwrapper",O,b?"pkt-inputwrapper--error":"",x?"pkt-inputwrapper--disabled":"",T?"pkt-inputwrapper--inline":""].filter(Boolean).join(" "),xt=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),te=()=>Nt?l.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":"true",children:[r,h?`/${h}`:""]}):null,Se=()=>l.jsxs(l.Fragment,{children:[$&&l.jsx("span",{className:xt+" pkt-tag--gray",children:$}),d&&l.jsx("span",{className:xt+" pkt-tag--blue-light",children:u}),g&&l.jsx("span",{className:xt+" pkt-tag--beige",children:m})]}),ye=()=>{const pt=l.jsxs(l.Fragment,{children:[t," ",Se()]});return A?K?l.jsx("legend",{className:"pkt-inputwrapper__legend",id:`${s}-label`,children:pt}):l.jsx("label",{className:"pkt-inputwrapper__label",htmlFor:s,"aria-describedby":Yt,id:`${s}-label`,children:pt}):l.jsx("label",{htmlFor:s,className:"pkt-sr-only","aria-describedby":Yt,id:`${s}-label`,children:t})},ce=()=>!e&&!i?null:l.jsxs(l.Fragment,{children:[e&&A&&l.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${s}-helptext`,children:e}),i&&l.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[l.jsx(be,{skin:"tertiary",size:"small",variant:"icon-right",iconName:it?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:ke,children:l.jsx("span",{dangerouslySetInnerHTML:{__html:n??'Les mer <span class="pkt-sr-only">om inputfeltet</span>'}})}),l.jsx("div",{className:`pkt-inputwrapper__helptext ${it?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i})]})]}),jt=l.jsxs(l.Fragment,{children:[ye(),ce(),ct&&l.jsx(te,{}),I,de&&l.jsx(te,{}),b&&y&&l.jsx("div",{className:"pkt-inputwrapper__alert-wrapper",children:l.jsx(tn,{skin:"error","aria-live":"assertive",role:"alert",id:`${s}-error`,compact:!0,children:y})})]});return l.jsx("div",{className:V,ref:Et,role:et,children:K?l.jsx("fieldset",{className:"pkt-inputwrapper__fieldset","aria-describedby":Yt,children:jt}):l.jsx("div",{className:"pkt-inputwrapper__fieldset",children:jt})})});si.displayName="PktInputWrapper";const en=_.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,autocomplete:i="off",counter:n,counterMaxLength:a,className:r,disabled:h=!1,errorMessage:d,hasError:u=!1,helptext:g,helptextDropdown:m,helptextDropdownButton:$,iconNameRight:b,inline:y=!1,fullwidth:x=!1,label:T,name:S,optionalTag:A=!1,optionalText:I,requiredTag:O=!1,requiredText:K,tagText:et=null,placeholder:Ot,prefix:Et,suffix:it,type:kt="text",useWrapper:Yt=!0,omitSearchIcon:Nt=!1,value:ct,minLength:de,maxLength:ke,min:V,max:xt,step:te,size:Se,readonly:ye,required:ce,dataTestid:jt,onChange:pt,skipForwardTestid:Ce=!1,...Te},ee)=>{const Ns=[r,"pkt-textinput"].join(" "),He=kt==="search"&&!b&&!Nt,rs=kt==="date"&&ct?ct.slice(0,10):ct,[os,Ee]=_.useState((ct==null?void 0:ct.length)||0),se=`${s}`,Ne=`${se}-label`,ls=e||Ne,Mt=yt=>{var Ms,Ve;n&&Ee(((Ve=(Ms=yt.currentTarget)==null?void 0:Ms.value)==null?void 0:Ve.length)||0),pt&&pt(yt)};return _.useEffect(()=>{ct!==void 0&&Ee((ct==null?void 0:ct.length)||0)},[ct]),l.jsx(si,{ariaDescribedby:t,className:Ns,disabled:h,errorMessage:d,forId:se,hasError:u,helptext:g,helptextDropdown:m,helptextDropdownButton:$,inline:y,label:T,optionalTag:A,optionalText:I,requiredTag:O,requiredText:K,tagText:et,useWrapper:Yt,counter:n,counterCurrent:os,counterMaxLength:a,children:l.jsxs("div",{className:"pkt-input__container","data-testid":jt,"data-skip-forward-testid":Ce?"true":void 0,children:[Et&&l.jsx("div",{className:"pkt-input-prefix",children:Et}),l.jsx("input",{...Te,ref:ee,className:`pkt-input ${x?"pkt-input--fullwidth":""} ${a&&os>a?"pkt-input--counter-error":""}`,type:kt,name:`${S||s}`,value:rs,id:se,placeholder:Ot,autoComplete:i,disabled:h,"aria-invalid":u,"aria-errormessage":`${s}-error`,"aria-labelledby":ls,min:V,max:xt,onChange:Mt,step:te,minLength:de,maxLength:ke,size:Se,required:ce}),it&&l.jsxs("p",{className:"pkt-input-suffix",children:[it,b&&l.jsx(q,{className:"pkt-input-suffix-icon",name:b}),He&&l.jsx(q,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!it&&b&&l.jsx(q,{className:"pkt-input-icon",name:b}),!it&&He&&l.jsx(q,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})}),hd=(s,t)=>{const e=()=>typeof window>"u"?0:window.innerWidth,[i,n]=_.useState(e);return _.useEffect(()=>{const a=s.current;if(!a)return;if(n(a.offsetWidth),typeof ResizeObserver>"u"){const h=()=>{a&&n(a.offsetWidth)};return window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)}const r=new ResizeObserver(h=>{for(const d of h)d.borderBoxSize&&d.borderBoxSize.length>0?n(d.borderBoxSize[0].inlineSize):n(d.contentRect.width)});return r.observe(a),()=>{r.disconnect()}},[s]),i};function dd(s){const t=_.useRef(0);_.useEffect(()=>{const e=document.body,i=document.documentElement;if(s){t.current=window.scrollY||window.pageYOffset;const n=window.innerWidth-i.clientWidth;n>0&&(e.style.paddingRight=`${n}px`),e.style.position="fixed",e.style.top=`-${t.current}px`,e.style.left="0",e.style.right="0",e.style.width="100%",e.style.overflow="hidden",i.classList.add("is-scroll-locked")}else 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"),document.documentElement.classList.remove("is-scroll-locked"),window.scrollTo({top:t.current});return()=>{s&&(e.style.cssText="",document.documentElement.classList.remove("is-scroll-locked"),window.scrollTo({top:t.current}))}},[s])}const wa=_.forwardRef(({mobileBreakpoint:s=768,tabletBreakpoint:t=1280,children:e,compact:i=!1,"data-mode":n,logOutButtonPlacement:a="none",logOut:r,openedMenu:h,showSearch:d=!1,onSearch:u,onSearchChange:g,searchValue:m,searchPlaceholder:$="Søk",representing:b,serviceLink:y,serviceClick:x,serviceName:T,user:S,userMenu:A,userMenuFooter:I,userOptions:O,canChangeRepresentation:K=!1,changeRepresentation:et,hideLogo:Ot=!1,logoLink:Et,logoClick:it,position:kt="fixed",scrollBehavior:Yt="hide"},Nt)=>{const ct=kt==="fixed",de=Yt==="hide";_.useEffect(()=>{I&&console.warn('PktHeaderService: The "userMenuFooter" prop is deprecated and will be removed in a future version. Please use "userMenu" instead.')},[I]),_.useEffect(()=>{O&&console.warn('PktHeaderService: The "userOptions" prop is no longer available. Please use "userMenu" instead.')},[O]),_.useEffect(()=>{S!=null&&S.shortname&&console.warn('PktHeaderService: The "shortname" property on the user object is deprecated and will be removed in a future version.'),b!=null&&b.shortname&&console.warn('PktHeaderService: The "shortname" property on the representing object is deprecated and will be removed in a future version.')},[S==null?void 0:S.shortname,b==null?void 0:b.shortname]);const ke=_.useMemo(()=>{if(S!=null&&S.lastLoggedIn)return typeof S.lastLoggedIn=="string"?S.lastLoggedIn:new Date(S.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"})},[S==null?void 0:S.lastLoggedIn]),[V,xt]=_.useState(h||"none"),[te,Se]=_.useState(!1),[ye,ce]=_.useState(0),[jt,pt]=_.useState(!1),[Ce,Te]=_.useState(!1),ee=_.useRef(null),Ns=_.useRef(null),He=_.useRef(null),rs=_.useRef(null),os=_.useRef(null),Ee=_.useRef(null),se=_.useRef(null),Ne=_.useRef(!1),ls=hd(ee),Mt=ls<s,yt=ls<t,Ms=_.useCallback(j=>{ee.current=j,typeof Nt=="function"?Nt(j):Nt&&(Nt.current=j)},[Nt]);dd(ct&&Mt&&V!=="none");const Ve=_.useCallback((j,Pt)=>{const f=j.relatedTarget;let p;switch(Pt){case"user":p=Ns;break;case"slot":p=He;break;case"search":p=rs;break;default:return}const v=p.current;v&&(!f||!v.contains(f))&&xt("none")},[]),ni=_.useCallback(()=>{Ne.current&&se.current&&document.contains(se.current)&&se.current.focus(),se.current=null,Ne.current=!1},[]);_.useEffect(()=>{const j=f=>{S&&V==="user"&&!f.target.closest(".pkt-header-service__user-container")&&xt("none"),V==="slot"&&!f.target.closest(".pkt-header-service__slot-container")&&xt("none"),V==="search"&&!f.target.closest(".pkt-header-service__search-container")&&!f.target.closest(".pkt-header-service__search-input")&&xt("none")},Pt=f=>{f.key==="Escape"&&V!=="none"&&(f.preventDefault(),Ne.current=!0,xt("none"))};if(V!=="none")return document.addEventListener("mousedown",j),document.addEventListener("keydown",Pt),()=>{document.removeEventListener("mousedown",j),document.removeEventListener("keydown",Pt)};ni()},[V,S,ni]),_.useEffect(()=>{const j=()=>{if(de){const Pt=window.pageYOffset||document.documentElement.scrollTop;if(Pt<0||Math.abs(Pt-ye)<60)return;Se(Pt>ye),ce(Pt)}};return document&&window.addEventListener("scroll",j),()=>{document&&window.removeEventListener("scroll",j)}},[de,ye]);const Ai=_.useCallback(j=>{const Pt=j==="slot"?He:rs,f=j==="slot"?os:Ee;if(!Pt.current||!f.current||!yt||Mt)return;const p=Pt.current.getBoundingClientRect(),v=f.current.offsetWidth,w=p.left+v>window.innerWidth;j==="slot"?pt(w):Te(w)},[yt,Mt]),As=_.useCallback(j=>{V!=="none"?xt("none"):(se.current=document.activeElement,xt(j))},[V]);_.useEffect(()=>{(V==="slot"||V==="search")&&requestAnimationFrame(()=>{Ai(V)})},[V,Ai]);const ai=l.jsxs("header",{className:X("pkt-header-service",i&&"pkt-header-service--compact",Mt&&"pkt-header-service--mobile",yt&&"pkt-header-service--tablet",ct&&"pkt-header-service--fixed",de&&"pkt-header-service--scroll-to-hide",te&&"pkt-header-service--hidden"),"data-mode":n,ref:Ms,children:[l.jsxs("div",{className:X("pkt-header-service__logo-area",(!T||T==="")&&"pkt-header-service__logo-area--without-service"),children:[!Ot&&l.jsx("span",{className:"pkt-header-service__logo",children:Et?l.jsx("a",{href:Et,"aria-label":"Tilbake til forside",children:l.jsx(q,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.0/logos/"})}):it?l.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header-service__logo-link",onClick:it,children:l.jsx(q,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.0/logos/"})}):l.jsx(q,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.0/logos/"})}),T&&l.jsx("span",{className:"pkt-header-service__service-name",children:y?l.jsx(Ni,{href:y,className:"pkt-header-service__service-link ",children:T}):x?l.jsx("button",{className:"pkt-link-button pkt-link pkt-header-service__service-link",onClick:x,children:T}):l.jsx("span",{className:"pkt-header-service__service-link",children:T})})]}),l.jsxs("div",{className:"pkt-header-service__content",children:[l.jsxs("div",{className:X("pkt-header-service__slot-container",V==="slot"&&"is-open"),onBlur:j=>Ve(j,"slot"),ref:He,children:[yt&&e&&l.jsx(be,{skin:"secondary",variant:"icon-only",iconName:"menu",size:Mt?"small":"medium",state:V==="slot"?"active":"normal",onClick:()=>As("slot"),"aria-expanded":V==="slot","aria-controls":"mobile-slot-menu","aria-label":"Åpne meny",children:"Meny"}),l.jsx("div",{className:X("pkt-header-service__slot-content",jt&&"align-right"),id:"mobile-slot-menu",role:yt?"menu":void 0,"aria-label":yt?"Meny":void 0,ref:os,children:l.jsx("div",{className:"pkt-contents",children:e})})]}),d&&l.jsx(l.Fragment,{children:yt?l.jsxs("div",{className:X("pkt-header-service__search-container",V==="search"&&"is-open"),onBlur:j=>Ve(j,"search"),ref:rs,children:[l.jsx(be,{skin:"secondary",variant:"icon-only",iconName:"magnifying-glass-big",size:Mt?"small":"medium",onClick:()=>As("search"),state:V==="search"?"active":"normal","aria-expanded":V==="search","aria-controls":"mobile-search-menu","aria-label":"Åpne søkefelt",children:"Søk"}),l.jsx("div",{className:X("pkt-header-service__mobile-menu",V==="search"&&"is-open",Ce&&"align-right"),ref:Ee,children:V==="search"&&l.jsx(en,{id:"mobile-search-menu",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:$,value:m,autoFocus:!0,fullwidth:!0,onChange:j=>g==null?void 0:g(j.target.value),onKeyDown:j=>{j.key==="Enter"&&(u==null||u(j.target.value))}})})]}):l.jsx(en,{id:"header-service-search",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:$,value:m,onChange:j=>g==null?void 0:g(j.target.value),onKeyDown:j=>{j.key==="Enter"&&(u==null||u(j.target.value))}})}),yt&&r&&(a==="header"||a==="both")&&l.jsx(be,{skin:"secondary",size:Mt?"small":"medium",variant:"icon-only",iconName:"exit",onClick:r,children:"Logg ut"})]}),l.jsxs("div",{className:"pkt-header-service__user",children:[S&&l.jsxs("div",{className:"pkt-header-service__user-container",onBlur:j=>Ve(j,"user"),ref:Ns,children:[l.jsxs(be,{className:X("pkt-header-service__user-button",Mt&&"pkt-header-service__user-button--mobile"),skin:"secondary",size:Mt?"small":"medium",state:V==="user"?"active":"normal",variant:"icons-right-and-left",iconName:"user",secondIconName:V==="user"?"chevron-thin-up":"chevron-thin-down",onClick:()=>As("user"),children:[l.jsx("span",{className:"pkt-sr-only",children:"Brukermeny: "}),(b==null?void 0:b.name)||S.name]}),V==="user"&&S&&l.jsx("div",{className:X(Mt?"pkt-header-service__mobile-menu":"pkt-header-service__user-menu","is-open"),children:l.jsx(ld,{user:S,formattedLastLoggedIn:ke,representing:b,userMenu:A,canChangeRepresentation:K,changeRepresentation:et,logoutOnClick:a==="userMenu"||a==="both"?r:void 0})})]}),!Mt&&r&&(a==="header"||a==="both")&&l.jsx(be,{skin:"tertiary",size:"medium",variant:"icon-right",iconName:"exit",onClick:r,children:"Logg ut"})]})]});return ct?l.jsxs("div",{className:"pkt-header-service-wrapper",children:[ai,l.jsx("div",{className:X("pkt-header-service-spacer",i&&"pkt-header-service-spacer--compact",S&&"pkt-header-service-spacer--has-user",Mt&&"pkt-header-service-spacer--mobile",yt&&"pkt-header-service-spacer--tablet")})]}):ai}),xa=_.forwardRef((s,t)=>l.jsx(wa,{...s,ref:t}));xa.displayName="PktHeader";const cd=ie({tagName:"pkt-heading",elementClass:Le,react:_,displayName:"PktHeading"}),Sa=_.forwardRef(({children:s,...t},e)=>l.jsx(cd,{"data-testid":"pkt-heading",...t,ref:e,children:s}));Sa.displayName="PktHeading";const pd=ie({tagName:"pkt-helptext",elementClass:_e,react:_,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),Ca=_.forwardRef(({children:s,...t},e)=>l.jsx(pd,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));Ca.displayName="PktHelptext";const Ta=_.forwardRef(({label:s,id:t,children:e,...i},n)=>l.jsxs("div",{className:"pkt-form-group",children:[l.jsx("label",{htmlFor:t,className:"pkt-form-label",children:s}),l.jsx("input",{className:"pkt-form-input",id:t,...i,ref:n}),e]}));Ta.displayName="PktInput";const Ea=({children:s,skin:t,title:e,href:i,iconName:n,openInNewTab:a,external:r,className:h,...d})=>{const u=["pkt-linkcard",t&&`pkt-linkcard--${t}`].filter(Boolean).join(" "),g=["pkt-linkcard__title",r&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return l.jsxs("a",{...d,href:i,className:X(u,h),target:a?"_blank":"_self",rel:a?"noopener noreferrer":void 0,children:[n&&l.jsx(q,{className:"pkt-link__icon",name:n}),e&&l.jsx("div",{className:X(g),children:e}),l.jsx("div",{className:"pkt-linkcard__text",children:s})]})};Ea.displayName="PktLinkCard";const ud=ie({tagName:"pkt-loader",elementClass:le,react:_,displayName:"PktLoader",events:{}}),Na=_.forwardRef(({children:s,...t},e)=>l.jsx(ud,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));Na.displayName="PktLoader";const Ma=({children:s,className:t,skin:e,title:i,compact:n,closable:a,onClose:r,...h})=>{const[d,u]=_.useState(!1),g={"pkt-messagebox":!0,"pkt-messagebox--compact":n,[`pkt-messagebox--${e}`]:e,"pkt-messagebox--closable":a,"pkt-hide":d},m=_.createRef(),$=_.useCallback(()=>{u(!0),r&&r()},[u,r]);return l.jsxs("div",{...h,className:X(g,t),ref:m,children:[a&&l.jsx("div",{className:"pkt-messagebox__close",children:l.jsx("button",{onClick:$,className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only","aria-label":"Lukk",children:l.jsx(q,{name:"close",className:"pkt-link__icon"})})}),i&&l.jsx("div",{className:"pkt-messagebox__title",children:i}),l.jsx("div",{className:"pkt-messagebox__text",children:s})]})};Ma.displayName="PktMessagebox";const fd=ie({tagName:"pkt-modal",elementClass:Rt,react:_,displayName:"PktModal",events:{}}),Aa=_.forwardRef(({children:s,...t},e)=>l.jsx(fd,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));Aa.displayName="PktModal";const gd=ie({tagName:"pkt-progressbar",elementClass:dt,react:_,displayName:"PktProgressbar",events:{}}),Oa=_.forwardRef(({children:s,...t},e)=>l.jsx(gd,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",children:s})}));Oa.displayName="PktProgressbar";const Pa=_.forwardRef(({id:s,name:t,label:e,className:i,hasTile:n=!1,disabled:a=!1,checkHelptext:r,hasError:h=!1,defaultChecked:d,checked:u,optionalTag:g,optionalText:m,requiredTag:$,requiredText:b,tagText:y,...x},T)=>{const S=[i,"pkt-input-check"].filter(Boolean).join(" "),A=["pkt-input-check__input",n?"pkt-input-check__input--tile":"",a&&n?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),I=["pkt-input-check__input-checkbox",h?"pkt-input-check__input-checkbox--error":""].filter(Boolean).join(" "),O=["pkt-input-check__input-label",a?"pkt-input-check__input-label--disabled":""].filter(Boolean).join(" "),K=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),et=()=>l.jsxs(l.Fragment,{children:[y&&l.jsx("span",{className:K+" pkt-tag--gray",children:y}),g&&l.jsx("span",{className:K+" pkt-tag--blue-light",children:m}),$&&l.jsx("span",{className:K+" pkt-tag--beige",children:b})]});return l.jsx("div",{className:S,children:l.jsxs("div",{className:A,children:[l.jsx("input",{ref:T,id:s,type:"radio",name:t,disabled:a,className:I,...u!==void 0?{checked:u}:{defaultChecked:d},...x}),l.jsxs("label",{className:O,htmlFor:s,children:[e," ",et(),r&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:r})]})]})})});Pa.displayName="PktRadioButton";const md=_.forwardRef(({appearance:s="local",disabled:t=!1,fullwidth:e=!1,id:i,label:n,name:a,placeholder:r="Søk…",suggestions:h,value:d="",action:u,method:g,onChange:m,onSearch:$,onSuggestionClick:b,...y},x)=>{const T=(O,K)=>{O?O():b&&b(K)},S=O=>{d=O.target.value},A=`pkt-searchinput pkt-searchinput--${s} ${e?"pkt-searchinput--fullwidth":""}`;let I;return u?I=O=>l.jsx("form",{role:"search",className:A,action:u,method:g,children:O}):I=O=>l.jsx("div",{role:"search",className:A,children:O}),I(l.jsxs(l.Fragment,{children:[n&&l.jsx("label",{htmlFor:n?i:void 0,className:n?"pkt-inputwrapper__label":"",children:n}),l.jsxs("div",{className:s==="local"?"pkt-input__container":"pkt-searchinput__field",children:[l.jsx("input",{className:`pkt-input ${e?"pkt-input--fullwidth":""}`,type:"search",name:a||i,id:i,placeholder:r,defaultValue:d,disabled:t,autoComplete:"off","aria-autocomplete":"list",ref:x,"aria-controls":`${i}-suggestions`,onChange:m||S,onKeyUp:$&&(O=>{O.key==="Enter"&&(O.preventDefault(),$(d))}),...y}),l.jsx(be,{className:`pkt-searchinput__button ${s==="local"?"pkt-input-icon":""}`,variant:"icon-only",iconName:"magnifying-glass-big",skin:s==="local"?"tertiary":"primary",color:s==="global"?"yellow":void 0,type:"submit",disabled:t,onClick:$&&(O=>{O.preventDefault(),$(d)}),children:n||r})]}),h&&l.jsx("ul",{id:`${i}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:h.map((O,K)=>l.jsx("li",{children:_.createElement(O.href?"a":O.onClick?"button":"div",{href:O.href,className:`pkt-searchinput__suggestion ${O.onClick?"pkt-link-button":""} ${O.href||O.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:O.onClick?"button":void 0,onClick:()=>T(O.onClick,K),onKeyUp:et=>et.key==="Enter"&&T(O.onClick,K)},l.jsxs(l.Fragment,{children:[O.title&&l.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:O.title}),O.text&&l.jsx("p",{className:"pkt-searchinput__suggestion-text",children:O.text})]}))},`search-suggestion-${K}`))})]}))}),vd=_.forwardRef(({ariaDescribedby:s,ariaLabelledby:t,children:e,className:i,disabled:n=!1,errorMessage:a,hasError:r,helptext:h,helptextDropdown:d,helptextDropdownButton:u,id:g,inline:m=!1,fullwidth:$=!1,label:b,name:y,optionalTag:x=!1,optionalText:T,requiredTag:S=!1,requiredText:A,tagText:I,...O},K)=>{const et=[i,"pkt-select"].join(" ");return l.jsx(si,{className:et,forId:`${g}-input`,label:b,helptext:h,helptextDropdown:d,helptextDropdownButton:u,optionalTag:x,optionalText:T,requiredTag:S,requiredText:A,tagText:I,hasError:r,errorMessage:a,disabled:n,inline:m,ariaDescribedby:s,children:l.jsx("select",{ref:K,className:`pkt-input ${$?"pkt-input--fullwidth":""}`,"aria-invalid":r,"aria-errormessage":`${g}-error`,"aria-labelledby":t||void 0,disabled:n,id:`${g}-input`,name:y||g,...O,children:e})})}),bd=l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:l.jsx("circle",{cx:"12",cy:"12",r:"7",style:{fill:"var(--pkt-color-grays-grey-200, #CCC)"}})}),kd=l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[l.jsx("circle",{opacity:".15",cx:"12",cy:"12",r:"12",fill:"#2A2859"}),l.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"#2A2859"})]}),yd=l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[l.jsx("path",{fill:"#2A2859",d:"M3 3h18v18H3z"}),l.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"})]}),$d=({children:s,className:t,status:e="incomplete",title:i})=>l.jsxs("li",{className:X("pkt-step",t,`pkt-step--${e}`),"data-testid":"pkt-step",children:[l.jsx("span",{className:"pkt-step__line pkt-step__line--1","aria-hidden":!0}),l.jsx("span",{className:"pkt-step__line pkt-step__line--2","aria-hidden":!0}),l.jsx("span",{className:X("pkt-step__indicator"),children:e==="current"?kd:e==="completed"?yd:bd}),l.jsx("span",{className:"pkt-step__line pkt-step__line--3","aria-hidden":!0}),l.jsxs("div",{className:"pkt-step__wrapper",children:[l.jsx("div",{className:"pkt-step__title",children:i}),l.jsx("div",{className:"pkt-step__content",children:s})]})]}),_d=_.forwardRef(({activeStep:s,className:t,children:e,hideNonActiveSteps:i=!1,hideNonActiveStepsContent:n=!0,orientation:a="vertical",...r},h)=>{const d=X(t,"pkt-stepper",a==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),u=_.Children.map(e,(g,m)=>_.isValidElement(g)?_.cloneElement(g,{className:X(g.props.className,{"pkt-step--hideStep":i&&m!==s,"pkt-step--hideContent":n&&m!==s})}):g);return l.jsx("ol",{"data-testid":"pkt-stepper",className:d,ref:h,...r,children:u})}),wd=({className:s,compact:t=!1,skin:e="basic",responsiveView:i=!0,children:n,...a})=>l.jsx("table",{"data-testid":"pkt-table",className:X(s,"pkt-table",{"pkt-table--responsive":i,"pkt-table--compact":t,"pkt-table--basic":e==="basic","pkt-table--zebra-blue":e==="zebra-blue"}),role:"table",...a,children:n}),xd=({id:s,children:t,className:e,...i})=>l.jsx("tbody",{id:s,className:X(e,"pkt-table__body",{}),...i,role:"rowgroup",children:t}),Sd=({children:s,className:t,dataLabel:e,...i})=>l.jsx("td",{className:X(t,"pkt-table__data-cell",{}),"data-label":e,role:"cell","data-testid":"pkt-table__data-cell",...i,children:s}),Cd=({className:s,children:t,...e})=>l.jsx("thead",{className:X(s,"pkt-table__header",{}),role:"rowgroup",...e,children:t}),Td=({className:s,children:t,...e})=>l.jsx("th",{className:X(s,"pkt-table__header-cell",{}),role:"columnheader",...e,children:t}),Ed=({className:s,children:t,...e})=>l.jsx("tr",{className:X(s,"pkt-table__row",{}),role:"row",...e,children:t}),sn=_.forwardRef(({children:s,skin:t,textStyle:e,size:i,closeTag:n,className:a,iconName:r,ariaLabel:h,onClose:d,type:u,"aria-description":g,...m},$)=>{const[b,y]=_.useState(!1),x=_.useCallback(()=>{y(!0),d&&d()},[y]),T=_.useRef(null),[S,A]=_.useState("");_.useEffect(()=>{var et,Ot;A(((Ot=(et=T.current)==null?void 0:et.textContent)==null?void 0:Ot.trim())??"")},[s]);const I=_.useMemo(()=>{if(n&&!h)return S&&`Klikk for å fjerne ${S}`||g},[n,h,S,g]),O={"pkt-tag":!0,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${t}`]:!!t,[`pkt-tag--${e}`]:!!e},K={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${e}`]:!!e,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${t}`]:!!t,"pkt-btn--icons-right-and-left":n&&!!r,"pkt-hide":b};return n?l.jsxs("button",{...m,className:X(K,a),type:u,onClick:x,"aria-label":h,"aria-description":I,ref:$,children:[r&&l.jsx(q,{className:"pkt-tag__icon",name:r}),l.jsx("span",{ref:T,children:s}),l.jsx(q,{className:"pkt-tag__close-btn",name:"close"})]}):l.jsxs("span",{...m,className:X(O,a),ref:$,children:[r&&l.jsx(q,{className:"pkt-tag__icon",name:r,"aria-hidden":"true"}),l.jsx("span",{ref:T,children:s})]})});sn.displayName="PktTag";const nn=_.forwardRef(({children:s,active:t,href:e,onClick:i,icon:n,controls:a,tag:r,tagSkin:h,index:d=0},u)=>{const{arrowNav:g,registerTabRef:m,handleKeyPress:$,selectTab:b}=Nd(),x={"aria-selected":g?!!t:void 0,"aria-controls":a,role:g?"tab":void 0,onKeyUp:S=>$(d,S),onClick:S=>{b(d),i==null||i(S)},tabIndex:t||!g?void 0:-1,ref:S=>{m(d,S),typeof u=="function"?u(S):u&&(u.current=S)}},T=l.jsxs(l.Fragment,{children:[n&&l.jsx(q,{name:n,className:"pkt-icon--small"}),s,r&&l.jsx(sn,{skin:h,size:"small",children:r})]});return e?l.jsx("a",{...x,href:e,className:`pkt-tabs__link ${t?"active":""}`,children:T}):l.jsx("button",{...x,type:"button",className:`pkt-tabs__button pkt-link-button ${t?"active":""}`,children:T})});nn.displayName="PktTabItem";const Da=_.createContext(null),Nd=()=>{const s=_.useContext(Da);if(!s)throw new Error("TabItem must be used within a Tabs component");return s},Md=_.forwardRef(({arrowNav:s=!0,disableArrowNav:t=!1,tabs:e,onTabSelected:i,children:n},a)=>{const r=_.useRef([]),h=s&&!t,u=n&&_.Children.count(n)>0?_.Children.count(n):(e==null?void 0:e.length)||0;_.useEffect(()=>{r.current=r.current.slice(0,u)},[u]);const g=y=>{const x=e==null?void 0:e[y];x!=null&&x.action&&x.action(y),i&&i(y)},m=(y,x)=>{var T,S;h&&(x.code==="ArrowLeft"&&y!==0&&((T=r.current[y-1])==null||T.focus()),x.code==="ArrowRight"&&y<u-1&&((S=r.current[y+1])==null||S.focus()),(x.code==="ArrowDown"||x.code==="Space")&&g(y))},$=(y,x)=>{r.current[y]=x},b=e==null?void 0:e.map((y,x)=>{var T,S;return l.jsx(nn,{active:y.active,href:y.href,onClick:()=>g(x),icon:y.icon,controls:y.controls,tag:(T=y.tag)==null?void 0:T.text,tagSkin:(S=y.tag)==null?void 0:S.skin,index:x,children:y.text},x)});return l.jsx(Da.Provider,{value:{arrowNav:h,registerTabRef:$,handleKeyPress:m,selectTab:g},children:l.jsx("div",{className:"pkt-tabs",ref:a,children:l.jsx("div",{className:"pkt-tabs__list",role:h?"tablist":"navigation",children:n||b})})})}),Ad=_.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,counter:i,counterMaxLength:n,className:a,disabled:r,errorMessage:h,hasError:d,helptext:u,helptextDropdown:g,helptextDropdownButton:m,inline:$,fullwidth:b=!1,label:y,name:x,optionalTag:T=!1,optionalText:S,requiredTag:A=!1,requiredText:I,tagText:O=null,placeholder:K,rows:et,useWrapper:Ot=!0,onChange:Et,value:it,autoComplete:kt="off",minLength:Yt,maxLength:Nt,readOnly:ct=!1,skipForwardTestid:de=!1,...ke},V)=>{const xt=[a,"pkt-textinput","pkt-textarea"].join(" "),te=`${s}-input`,Se=`${te}-label`,ye=e||Se,[ce,jt]=_.useState(0),pt=Ce=>{var Te,ee;if(i&&jt(((ee=(Te=Ce.currentTarget)==null?void 0:Te.value)==null?void 0:ee.length)||0),Et)return Et(Ce)};return _.useEffect(()=>{it!==void 0&&jt((it==null?void 0:it.length)||0)},[it]),l.jsx(si,{ariaDescribedby:t,className:xt,disabled:r,errorMessage:h,forId:te,hasError:d,helptext:u,helptextDropdown:g,helptextDropdownButton:m,inline:$,label:y,optionalTag:T,optionalText:S,requiredTag:A,requiredText:I,tagText:O,useWrapper:Ot,counter:i,counterCurrent:ce,counterMaxLength:n,children:l.jsx("textarea",{ref:V,className:`pkt-input ${b?"pkt-input--fullwidth":""} ${n&&ce>n?"pkt-input--counter-error":""}`,name:`${x||s}`,id:te,placeholder:K,disabled:r,rows:et,"aria-labelledby":ye,"aria-invalid":d,"aria-errormessage":`${s}-error`,...ke,onChange:pt,value:it,autoComplete:kt,minLength:Yt,maxLength:Nt,"data-skip-forward-testid":de?"true":void 0})})});var Ts=window.CustomEvent;(!Ts||typeof Ts=="object")&&(Ts=function(s,t){t=t||{};var e=document.createEvent("CustomEvent");return e.initCustomEvent(s,!!t.bubbles,!!t.cancelable,t.detail||null),e},Ts.prototype=window.Event.prototype);function Ia(s,t){var e="on"+t.type.toLowerCase();return typeof s[e]=="function"&&s[e](t),s.dispatchEvent(t)}function Od(s){for(;s&&s!==document.body;){var t=window.getComputedStyle(s),e=function(i,n){return!(t[i]===void 0||t[i]===n)};if(t.opacity<1||e("zIndex","auto")||e("transform","none")||e("mixBlendMode","normal")||e("filter","none")||e("perspective","none")||t.isolation==="isolate"||t.position==="fixed"||t.webkitOverflowScrolling==="touch")return!0;s=s.parentElement}return!1}function ii(s){for(;s;){if(s.localName==="dialog")return s;s.parentElement?s=s.parentElement:s.parentNode?s=s.parentNode.host:s=null}return null}function La(s){for(;s&&s.shadowRoot&&s.shadowRoot.activeElement;)s=s.shadowRoot.activeElement;s&&s.blur&&s!==document.body&&s.blur()}function Pd(s,t){for(var e=0;e<s.length;++e)if(s[e]===t)return!0;return!1}function an(s){return!s||!s.hasAttribute("method")?!1:s.getAttribute("method").toLowerCase()==="dialog"}function Ba(s){var t=["button","input","keygen","select","textarea"],e=t.map(function(r){return r+":not([disabled])"});e.push('[tabindex]:not([disabled]):not([tabindex=""])');var i=s.querySelector(e.join(", "));if(!i&&"attachShadow"in Element.prototype)for(var n=s.querySelectorAll("*"),a=0;a<n.length&&!(n[a].tagName&&n[a].shadowRoot&&(i=Ba(n[a].shadowRoot),i));a++);return i}function Fa(s){return s.isConnected||document.body.contains(s)}function ja(s){if(s.submitter)return s.submitter;var t=s.target;if(!(t instanceof HTMLFormElement))return null;var e=W.formSubmitter;if(!e){var i=s.target,n="getRootNode"in i&&i.getRootNode()||document;e=n.activeElement}return!e||e.form!==t?null:e}function Dd(s){if(!s.defaultPrevented){var t=s.target,e=W.imagemapUseValue,i=ja(s);e===null&&i&&(e=i.value);var n=ii(t);if(n){var a=i&&i.getAttribute("formmethod")||t.getAttribute("method");a==="dialog"&&(s.preventDefault(),e!=null?n.close(e):n.close())}}}function Ha(s){if(this.dialog_=s,this.replacedStyleTop_=!1,this.openAsModal_=!1,s.hasAttribute("role")||s.setAttribute("role","dialog"),s.show=this.show.bind(this),s.showModal=this.showModal.bind(this),s.close=this.close.bind(this),s.addEventListener("submit",Dd,!1),"returnValue"in s||(s.returnValue=""),"MutationObserver"in window){var t=new MutationObserver(this.maybeHideModal.bind(this));t.observe(s,{attributes:!0,attributeFilter:["open"]})}else{var e=!1,i=(function(){e?this.downgradeModal():this.maybeHideModal(),e=!1}).bind(this),n,a=function(r){if(r.target===s){var h="DOMNodeRemoved";e|=r.type.substr(0,h.length)===h,window.clearTimeout(n),n=window.setTimeout(i,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(r){s.addEventListener(r,a)})}Object.defineProperty(s,"open",{set:this.setOpen.bind(this),get:s.hasAttribute.bind(s,"open")}),this.backdrop_=document.createElement("div"),this.backdrop_.className="backdrop",this.backdrop_.addEventListener("mouseup",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("mousedown",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("click",this.backdropMouseEvent_.bind(this))}Ha.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&Fa(this.dialog_)||this.downgradeModal()},downgradeModal:function(){this.openAsModal_&&(this.openAsModal_=!1,this.dialog_.style.zIndex="",this.replacedStyleTop_&&(this.dialog_.style.top="",this.replacedStyleTop_=!1),this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_),W.dm.removeDialog(this))},setOpen:function(s){s?this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open",""):(this.dialog_.removeAttribute("open"),this.maybeHideModal())},backdropMouseEvent_:function(s){if(this.dialog_.hasAttribute("tabindex"))this.dialog_.focus();else{var t=document.createElement("div");this.dialog_.insertBefore(t,this.dialog_.firstChild),t.tabIndex=-1,t.focus(),this.dialog_.removeChild(t)}var e=document.createEvent("MouseEvents");e.initMouseEvent(s.type,s.bubbles,s.cancelable,window,s.detail,s.screenX,s.screenY,s.clientX,s.clientY,s.ctrlKey,s.altKey,s.shiftKey,s.metaKey,s.button,s.relatedTarget),this.dialog_.dispatchEvent(e),s.stopPropagation()},focus_:function(){var s=this.dialog_.querySelector("[autofocus]:not([disabled])");!s&&this.dialog_.tabIndex>=0&&(s=this.dialog_),s||(s=Ba(this.dialog_)),La(document.activeElement),s&&s.focus()},updateZIndex:function(s,t){if(s<t)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=s,this.backdrop_.style.zIndex=t},show:function(){this.dialog_.open||(this.setOpen(!0),this.focus_())},showModal:function(){if(this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.");if(!Fa(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!W.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");Od(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,W.needsCentering(this.dialog_)?(W.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(s){if(!this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.");this.setOpen(!1),s!==void 0&&(this.dialog_.returnValue=s);var t=new Ts("close",{bubbles:!1,cancelable:!1});Ia(this.dialog_,t)}};var W={};if(W.reposition=function(s){var t=document.body.scrollTop||document.documentElement.scrollTop,e=t+(window.innerHeight-s.offsetHeight)/2;s.style.top=Math.max(t,e)+"px"},W.isInlinePositionSetByStylesheet=function(s){for(var t=0;t<document.styleSheets.length;++t){var e=document.styleSheets[t],i=null;try{i=e.cssRules}catch{}if(i)for(var n=0;n<i.length;++n){var a=i[n],r=null;try{r=document.querySelectorAll(a.selectorText)}catch{}if(!(!r||!Pd(r,s))){var h=a.style.getPropertyValue("top"),d=a.style.getPropertyValue("bottom");if(h&&h!=="auto"||d&&d!=="auto")return!0}}}return!1},W.needsCentering=function(s){var t=window.getComputedStyle(s);return t.position!=="absolute"||s.style.top!=="auto"&&s.style.top!==""||s.style.bottom!=="auto"&&s.style.bottom!==""?!1:!W.isInlinePositionSetByStylesheet(s)},W.forceRegisterDialog=function(s){if((window.HTMLDialogElement||s.showModal)&&console.warn("This browser already supports <dialog>, the polyfill may not work correctly",s),s.localName!=="dialog")throw new Error("Failed to register dialog: The element is not a dialog.");new Ha(s)},W.registerDialog=function(s){s.showModal||W.forceRegisterDialog(s)},W.DialogManager=function(){this.pendingDialogStack=[];var s=this.checkDOM_.bind(this);this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",(function(t){this.forwardTab_=void 0,t.stopPropagation(),s([])}).bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=100150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver(function(t){var e=[];t.forEach(function(i){for(var n=0,a;a=i.removedNodes[n];++n){if(a instanceof Element)a.localName==="dialog"&&e.push(a);else continue;e=e.concat(a.querySelectorAll("dialog"))}}),e.length&&s(e)}))},W.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})},W.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},W.DialogManager.prototype.updateStacking=function(){for(var s=this.zIndexHigh_,t=0,e;e=this.pendingDialogStack[t];++t)e.updateZIndex(--s,--s),t===0&&(this.overlay.style.zIndex=--s);var i=this.pendingDialogStack[0];if(i){var n=i.dialog.parentNode||document.body;n.appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},W.DialogManager.prototype.containedByTopDialog_=function(s){for(;s=ii(s);){for(var t=0,e;e=this.pendingDialogStack[t];++t)if(e.dialog===s)return t===0;s=s.parentElement}return!1},W.DialogManager.prototype.handleFocus_=function(s){var t=s.composedPath?s.composedPath()[0]:s.target;if(!this.containedByTopDialog_(t)&&document.activeElement!==document.documentElement&&(s.preventDefault(),s.stopPropagation(),La(t),this.forwardTab_!==void 0)){var e=this.pendingDialogStack[0],i=e.dialog,n=i.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?e.focus_():t!==document.documentElement&&document.documentElement.focus()),!1}},W.DialogManager.prototype.handleKey_=function(s){if(this.forwardTab_=void 0,s.keyCode===27){s.preventDefault(),s.stopPropagation();var t=new Ts("cancel",{bubbles:!1,cancelable:!0}),e=this.pendingDialogStack[0];e&&Ia(e.dialog,t)&&e.dialog.close()}else s.keyCode===9&&(this.forwardTab_=!s.shiftKey)},W.DialogManager.prototype.checkDOM_=function(s){var t=this.pendingDialogStack.slice();t.forEach(function(e){s.indexOf(e.dialog)!==-1?e.downgradeModal():e.maybeHideModal()})},W.DialogManager.prototype.pushDialog=function(s){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=t?!1:(this.pendingDialogStack.unshift(s)===1&&this.blockDocument(),this.updateStacking(),!0)},W.DialogManager.prototype.removeDialog=function(s){var t=this.pendingDialogStack.indexOf(s);t!==-1&&(this.pendingDialogStack.splice(t,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())},W.dm=new W.DialogManager,W.formSubmitter=null,W.imagemapUseValue=null,window.HTMLDialogElement===void 0){var Va=document.createElement("form");if(Va.setAttribute("method","dialog"),Va.method!=="dialog"){var Es=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(Es){var Id=Es.get;Es.get=function(){return an(this)?"dialog":Id.call(this)};var Ld=Es.set;Es.set=function(s){return typeof s=="string"&&s.toLowerCase()==="dialog"?this.setAttribute("method",s):Ld.call(this,s)},Object.defineProperty(HTMLFormElement.prototype,"method",Es)}}document.addEventListener("click",function(s){if(W.formSubmitter=null,W.imagemapUseValue=null,!s.defaultPrevented){var t=s.target;if("composedPath"in s){var e=s.composedPath();t=e.shift()||t}if(!(!t||!an(t.form))){var i=t.type==="submit"&&["button","input"].indexOf(t.localName)>-1;if(!i){if(!(t.localName==="input"&&t.type==="image"))return;W.imagemapUseValue=s.offsetX+","+s.offsetY}var n=ii(t);n&&(W.formSubmitter=t)}}},!1),document.addEventListener("submit",function(s){var t=s.target,e=ii(t);if(!e){var i=ja(s),n=i&&i.getAttribute("formmethod")||t.getAttribute("method");n==="dialog"&&s.preventDefault()}});var Bd=HTMLFormElement.prototype.submit,Fd=function(){if(!an(this))return Bd.call(this);var s=ii(this);s&&s.close()};HTMLFormElement.prototype.submit=Fd}const jd=Object.freeze(Object.defineProperty({__proto__:null,default:W},Symbol.toStringTag,{value:"Module"}));P.PktAccordion=hn,P.PktAccordionItem=ma,P.PktAlert=tn,P.PktBackLink=ba,P.PktBreadcrumbs=td,P.PktButton=be,P.PktCard=ka,P.PktCheckbox=ya,P.PktCombobox=$a,P.PktConsent=Ei,P.PktDatepicker=_a,P.PktFooter=nd,P.PktFooterSimple=ad,P.PktHeader=xa,P.PktHeaderService=wa,P.PktHeading=Sa,P.PktHelptext=Ca,P.PktIcon=q,P.PktInput=Ta,P.PktInputWrapper=si,P.PktLink=Ni,P.PktLinkCard=Ea,P.PktLoader=Na,P.PktMessagebox=Ma,P.PktModal=Aa,P.PktProgressbar=Oa,P.PktRadioButton=Pa,P.PktSearchInput=md,P.PktSelect=vd,P.PktStep=$d,P.PktStepper=_d,P.PktTabItem=nn,P.PktTable=wd,P.PktTableBody=xd,P.PktTableDataCell=Sd,P.PktTableHeader=Cd,P.PktTableHeaderCell=Td,P.PktTableRow=Ed,P.PktTabs=Md,P.PktTag=sn,P.PktTextarea=Ad,P.PktTextinput=en,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})}));
|