@oslokommune/punkt-react 14.5.0 → 14.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/index.d.ts +16 -19
- package/dist/punkt-react.es.js +1308 -1382
- package/dist/punkt-react.umd.js +154 -182
- package/package.json +9 -3
- package/src/components/accordion/Accordion.test.tsx +4 -2
- package/src/components/accordion/Accordion.tsx +1 -1
- package/src/components/accordion/AccordionItem.tsx +3 -3
- package/src/components/alert/Alert.test.tsx +4 -5
- package/src/components/alert/Alert.tsx +5 -4
- package/src/components/backlink/BackLink.tsx +3 -3
- package/src/components/breadcrumbs/Breadcrumbs.test.tsx +4 -1
- package/src/components/breadcrumbs/Breadcrumbs.tsx +3 -5
- package/src/components/button/Button.test.tsx +5 -3
- package/src/components/button/Button.tsx +1 -2
- package/src/components/card/Card.tsx +6 -3
- package/src/components/checkbox/Checkbox.test.tsx +1 -1
- package/src/components/checkbox/Checkbox.tsx +10 -2
- package/src/components/combobox/Combobox.tsx +9 -8
- package/src/components/consent/Consent.tsx +3 -3
- package/src/components/datepicker/Datepicker.test.tsx +3 -1
- package/src/components/datepicker/Datepicker.tsx +11 -8
- package/src/components/footer/Footer.test.tsx +1 -1
- package/src/components/footer/Footer.tsx +3 -3
- package/src/components/footerSimple/FooterSimple.test.tsx +1 -1
- package/src/components/footerSimple/FooterSimple.tsx +3 -3
- package/src/components/header/Header.test.tsx +0 -1
- package/src/components/header/Header.tsx +1 -0
- package/src/components/header/HeaderService.test.tsx +2 -2
- package/src/components/header/HeaderService.tsx +34 -15
- package/src/components/header/types.ts +8 -8
- package/src/components/headerUserMenu/UserMenu.test.tsx +3 -3
- package/src/components/headerUserMenu/UserMenu.tsx +6 -2
- package/src/components/heading/Heading.test.tsx +4 -2
- package/src/components/heading/Heading.tsx +6 -5
- package/src/components/helptext/Helptext.tsx +3 -2
- package/src/components/icon/Icon.test.tsx +0 -1
- package/src/components/icon/Icon.tsx +4 -5
- package/src/components/input/Input.tsx +4 -5
- package/src/components/inputwrapper/InputWrapper.tsx +2 -1
- package/src/components/interfaces.ts +1 -1
- package/src/components/loader/Loader.test.tsx +0 -1
- package/src/components/loader/Loader.tsx +6 -4
- package/src/components/messagebox/Messagebox.tsx +1 -1
- package/src/components/modal/Modal.test.tsx +5 -6
- package/src/components/modal/Modal.tsx +4 -2
- package/src/components/progressbar/Progressbar.test.tsx +5 -3
- package/src/components/progressbar/Progressbar.tsx +6 -4
- package/src/components/radio/RadioButton.tsx +9 -3
- package/src/components/searchinput/SearchInput.test.tsx +3 -3
- package/src/components/searchinput/SearchInput.tsx +5 -1
- package/src/components/select/Select.test.tsx +0 -1
- package/src/components/select/Select.tsx +2 -0
- package/src/components/stepper/Step.tsx +2 -1
- package/src/components/stepper/Stepper.test.tsx +5 -3
- package/src/components/stepper/Stepper.tsx +5 -3
- package/src/components/table/Table.test.tsx +6 -6
- package/src/components/table/Table.tsx +2 -3
- package/src/components/table/TableBody.tsx +2 -3
- package/src/components/table/TableData.tsx +2 -3
- package/src/components/table/TableDataCell.tsx +2 -3
- package/src/components/table/TableHeader.tsx +2 -3
- package/src/components/table/TableHeaderCell.tsx +2 -3
- package/src/components/table/TableRow.tsx +2 -3
- package/src/components/tabs/TabItem.tsx +4 -4
- package/src/components/tabs/Tabs.test.tsx +5 -4
- package/src/components/tabs/Tabs.tsx +8 -5
- package/src/components/textarea/Textarea.test.tsx +0 -1
- package/src/components/textarea/Textarea.tsx +9 -4
- package/src/components/textinput/Textinput.tsx +11 -6
package/dist/punkt-react.umd.js
CHANGED
|
@@ -33,37 +33,37 @@
|
|
|
33
33
|
return [];
|
|
34
34
|
};
|
|
35
35
|
}
|
|
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,w,
|
|
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,w,lr){"use strict";const dn=w.createContext({}),hr=()=>w.useContext(dn),un=w.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(dn.Provider,{value:{name:n},children:l.jsx("div",{ref:r,className:h,"data-testid":"pkt-accordion","aria-labelledby":e||void 0,children:i})})});un.displayName="PktAccordion";/**
|
|
37
37
|
* @license
|
|
38
38
|
* Copyright 2018 Google LLC
|
|
39
39
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
40
|
-
*/const
|
|
40
|
+
*/const cr=new Set(["children","localName","ref","style","className"]),pn=new WeakMap,fn=(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 p=pn.get(r);p===void 0&&pn.set(r,p=new Map);let m=p.get(h);d!==void 0?m===void 0?(p.set(h,m={handleEvent:d}),r.addEventListener(h,m)):m.handleEvent=d:m!==void 0&&(p.delete(h),r.removeEventListener(h,m))})(s,a,e)},Jt=({react:s,tagName:t,elementClass:e,events:i,displayName:n})=>{const a=new Set(Object.keys(i??{})),r=s.forwardRef(((h,d)=>{const p=s.useRef(new Map),m=s.useRef(null),v={},y={};for(const[$,b]of Object.entries(h))cr.has($)?v[$==="className"?"class":$]=b:a.has($)||$ in e.prototype?y[$]=b:v[$]=b;return s.useLayoutEffect((()=>{if(m.current===null)return;const $=new Map;for(const b in y)fn(m.current,b,h[b],p.current.get(b),i),p.current.delete(b),$.set(b,h[b]);for(const[b,x]of p.current)fn(m.current,b,void 0,x,i);p.current=$})),s.useLayoutEffect((()=>{var $;($=m.current)==null||$.removeAttribute("defer-hydration")}),[]),v.suppressHydrationWarning=!0,s.createElement(t,{...v,ref:s.useCallback(($=>{m.current=$,typeof d=="function"?d($):d!==null&&(d.current=$)}),[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 ni=globalThis,ai=ni.trustedTypes,gn=ai?ai.createPolicy("lit-html",{createHTML:s=>s}):void 0,mn="$lit$",Se=`lit$${Math.random().toFixed(9).slice(2)}$`,vn="?"+Se,dr=`<${vn}>`,Ie=document,Ts=()=>Ie.createComment(""),Ns=s=>s===null||typeof s!="object"&&typeof s!="function",Mi=Array.isArray,ur=s=>Mi(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",Ai=`[
|
|
45
|
+
\f\r]`,Es=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,bn=/-->/g,kn=/>/g,Le=RegExp(`>|${Ai}(?:([^\\s"'>=/]+)(${Ai}*=${Ai}*(?:[^
|
|
46
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),yn=/'/g,$n=/"/g,_n=/^(?:script|style|textarea|title)$/i,pr=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),u=pr(1),Et=Symbol.for("lit-noChange"),k=Symbol.for("lit-nothing"),wn=new WeakMap,Be=Ie.createTreeWalker(Ie,129);function xn(s,t){if(!Mi(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return gn!==void 0?gn.createHTML(t):t}const fr=(s,t)=>{const e=s.length-1,i=[];let n,a=t===2?"<svg>":t===3?"<math>":"",r=Es;for(let h=0;h<e;h++){const d=s[h];let p,m,v=-1,y=0;for(;y<d.length&&(r.lastIndex=y,m=r.exec(d),m!==null);)y=r.lastIndex,r===Es?m[1]==="!--"?r=bn:m[1]!==void 0?r=kn:m[2]!==void 0?(_n.test(m[2])&&(n=RegExp("</"+m[2],"g")),r=Le):m[3]!==void 0&&(r=Le):r===Le?m[0]===">"?(r=n??Es,v=-1):m[1]===void 0?v=-2:(v=r.lastIndex-m[2].length,p=m[1],r=m[3]===void 0?Le:m[3]==='"'?$n:yn):r===$n||r===yn?r=Le:r===bn||r===kn?r=Es:(r=Le,n=void 0);const $=r===Le&&s[h+1].startsWith("/>")?" ":"";a+=r===Es?d+dr:v>=0?(i.push(p),d.slice(0,v)+mn+d.slice(v)+Se+$):d+Se+(v===-2?h:$)}return[xn(s,a+(s[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]};let Oi=class rr{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let a=0,r=0;const h=t.length-1,d=this.parts,[p,m]=fr(t,e);if(this.el=rr.createElement(p,i),Be.currentNode=this.el.content,e===2||e===3){const v=this.el.content.firstChild;v.replaceWith(...v.childNodes)}for(;(n=Be.nextNode())!==null&&d.length<h;){if(n.nodeType===1){if(n.hasAttributes())for(const v of n.getAttributeNames())if(v.endsWith(mn)){const y=m[r++],$=n.getAttribute(v).split(Se),b=/([.?@])?(.*)/.exec(y);d.push({type:1,index:a,name:b[2],strings:$,ctor:b[1]==="."?mr:b[1]==="?"?vr:b[1]==="@"?br:oi}),n.removeAttribute(v)}else v.startsWith(Se)&&(d.push({type:6,index:a}),n.removeAttribute(v));if(_n.test(n.tagName)){const v=n.textContent.split(Se),y=v.length-1;if(y>0){n.textContent=ai?ai.emptyScript:"";for(let $=0;$<y;$++)n.append(v[$],Ts()),Be.nextNode(),d.push({type:2,index:++a});n.append(v[y],Ts())}}}else if(n.nodeType===8)if(n.data===vn)d.push({type:2,index:a});else{let v=-1;for(;(v=n.data.indexOf(Se,v+1))!==-1;)d.push({type:7,index:a}),v+=Se.length-1}a++}}static createElement(t,e){const i=Ie.createElement("template");return i.innerHTML=t,i}};function ss(s,t,e=s,i){var n,a;if(t===Et)return t;let r=i!==void 0?(n=e._$Co)==null?void 0:n[i]:e._$Cl;const h=Ns(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=ss(s,r._$AS(s,t.values),r,i)),t}let gr=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)??Ie).importNode(e,!0);Be.currentNode=n;let a=Be.nextNode(),r=0,h=0,d=i[0];for(;d!==void 0;){if(r===d.index){let p;d.type===2?p=new ri(a,a.nextSibling,this,t):d.type===1?p=new d.ctor(a,d.name,d.strings,this,t):d.type===6&&(p=new kr(a,this,t)),this._$AV.push(p),d=i[++h]}r!==(d==null?void 0:d.index)&&(a=Be.nextNode(),r++)}return Be.currentNode=Ie,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++}},ri=class or{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=ss(this,t,e),Ns(t)?t===k||t==null||t===""?(this._$AH!==k&&this._$AR(),this._$AH=k):t!==this._$AH&&t!==Et&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):ur(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&&Ns(this._$AH)?this._$AA.nextSibling.data=t:this.T(Ie.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=Oi.createElement(xn(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 gr(a,this),h=r.u(this.options);r.p(i),this.T(h),this._$AH=r}}_$AC(t){let e=wn.get(t.strings);return e===void 0&&wn.set(t.strings,e=new Oi(t)),e}k(t){Mi(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 or(this.O(Ts()),this.O(Ts()),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))}},oi=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=ss(this,t,e,0),r=!Ns(t)||t!==this._$AH&&t!==Et,r&&(this._$AH=t);else{const h=t;let d,p;for(t=a[0],d=0;d<a.length-1;d++)p=ss(this,h[i+d],e,d),p===Et&&(p=this._$AH[d]),r||(r=!Ns(p)||p!==this._$AH[d]),p===k?t=k:t!==k&&(t+=(p??"")+a[d+1]),this._$AH[d]=p}r&&!n&&this.j(t)}j(t){t===k?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},mr=class extends oi{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===k?void 0:t}};class vr extends oi{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==k)}}let br=class extends oi{constructor(t,e,i,n,a){super(t,e,i,n,a),this.type=5}_$AI(t,e=this){if((t=ss(this,t,e,0)??k)===Et)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)}},kr=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){ss(this,t)}};const yr={I:ri},Sn=ni.litHtmlPolyfillSupport;Sn==null||Sn(Oi,ri),(ni.litHtmlVersions??(ni.litHtmlVersions=[])).push("3.3.1");const $r=(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 ri(t.insertBefore(Ts(),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 H=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 li=globalThis,Pi=li.ShadowRoot&&(li.ShadyCSS===void 0||li.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Cn=Symbol(),Tn=new WeakMap;let _r=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==Cn)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(Pi&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=Tn.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Tn.set(e,t))}return t}toString(){return this.cssText}};const wr=s=>new _r(typeof s=="string"?s:s+"",void 0,Cn),xr=(s,t)=>{if(Pi)s.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const e of t){const i=document.createElement("style"),n=li.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=e.cssText,s.appendChild(i)}},Nn=Pi?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return wr(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:Sr,defineProperty:Cr,getOwnPropertyDescriptor:Tr,getOwnPropertyNames:Nr,getOwnPropertySymbols:Er,getPrototypeOf:Mr}=Object,is=globalThis,En=is.trustedTypes,Ar=En?En.emptyScript:"",Mn=is.reactiveElementPolyfillSupport,Ms=(s,t)=>s,hi={toAttribute(s,t){switch(t){case Boolean:s=s?Ar: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}},Di=(s,t)=>!Sr(s,t),An={attribute:!0,type:String,converter:hi,reflect:!1,useDefault:!1,hasChanged:Di};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),is.litPropertyMetadata??(is.litPropertyMetadata=new WeakMap);let ns=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=An){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&&Cr(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){const{get:n,set:a}=Tr(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)??An}static _$Ei(){if(this.hasOwnProperty(Ms("elementProperties")))return;const t=Mr(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Ms("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ms("properties"))){const e=this.properties,i=[...Nr(e),...Er(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(Nn(n))}else t!==void 0&&e.push(Nn(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 xr(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:hi).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:hi;this._$Em=r;const p=d.fromAttribute(e,h.type);this[r]=p??((n=this._$Ej)==null?void 0:n.get(r))??p,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??Di)(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){}};ns.elementStyles=[],ns.shadowRootOptions={mode:"open"},ns[Ms("elementProperties")]=new Map,ns[Ms("finalized")]=new Map,Mn==null||Mn({ReactiveElement:ns}),(is.reactiveElementVersions??(is.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 Or={attribute:!0,type:String,converter:hi,reflect:!1,hasChanged:Di},Pr=(s=Or,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"?Pr(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 As=globalThis;let as=class extends ns{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=$r(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 Et}};var On;as._$litElement$=!0,as.finalized=!0,(On=As.litElementHydrateSupport)==null||On.call(As,{LitElement:as});const Pn=As.litElementPolyfillSupport;Pn==null||Pn({LitElement:as}),(As.litElementVersions??(As.litElementVersions=[])).push("4.2.1");const Dr={hi:"Hei!"},Ir={from:"Fra",to:"Til"},Lr={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"},Fr={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."}},Mt={example:Dr,generic:Ir,calendar:Lr,dates:Br,forms:Fr};var Vr=Object.defineProperty,Dn=(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&&Vr(t,e,n),n};let ci=class extends as{constructor(){super(...arguments),this.strings=Mt,this.role=null}hotReplacedCallback(){this.requestUpdate()}};Dn([o({type:Object})],ci.prototype,"strings"),Dn([o({type:String})],ci.prototype,"role");let J=class extends ci{createRenderRoot(){return this}};/**
|
|
67
67
|
* @license
|
|
68
68
|
* Copyright 2017 Google LLC
|
|
69
69
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -75,31 +75,31 @@
|
|
|
75
75
|
* @license
|
|
76
76
|
* Copyright 2017 Google LLC
|
|
77
77
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
78
|
-
*/function L(s){return o({...s,state:!0,attribute:!1})}function
|
|
78
|
+
*/function L(s){return o({...s,state:!0,attribute:!1})}function In(s,t){return t.some(e=>e.value===s)}function Os(s){return s.classList&&(s.classList.contains("_dialog_overlay")||s.classList.contains("backdrop"))?!0:typeof s.hasAttribute=="function"&&s.hasAttribute("data-skip")}function os(s){return s.nodeName==="OPTION"||s.nodeName==="DATA"}function Hr(s,t){return s.nodeType===Node.ELEMENT_NODE&&!In(s,t)}function Ii(s){var t;return s.nodeType===Node.TEXT_NODE&&((t=s.nodeValue)==null?void 0:t.trim())!==""}let ot=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=>{Os(t)||os(t)&&this.skipOptions||(!In(t,this.slots)||Ii(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(Os(a))return!1;if((h=a.textContent)!=null&&h.trim())return!0}return!1})&&t.add(i);const n=this.nodes.flatMap(a=>Ii(a)||a.getAttribute&&a.getAttribute("slot")==i&&!Os(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=>{Os(n)||os(n)&&this.skipOptions||(Hr(n,this.slots)||Ii(n))&&(this.nodes.push(n),e=!0)}),i.removedNodes.forEach(n=>{Os(n)||os(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:jr}=yr,Ln=s=>s.strings===void 0,Bn=()=>document.createComment(""),Ps=(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(Bn(),a),h=n.insertBefore(Bn(),a);e=new jr(r,h,s,s.options)}else{const r=e._$AB.nextSibling,h=e._$AM,d=h!==s;if(d){let p;(i=e._$AQ)==null||i.call(e,s),e._$AM=s,e._$AP!==void 0&&(p=s._$AU)!==h._$AU&&e._$AP(p)}if(r!==a||d){let p=e._$AA;for(;p!==r;){const m=p.nextSibling;n.insertBefore(p,a),p=m}}}return e},Ve=(s,t,e=s)=>(s._$AI(t,e),s),Ur={},Fn=(s,t=Ur)=>s._$AH=t,zr=s=>s._$AH,Li=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 Ds=(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),Ds(n,t);return!0},di=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)},Vn=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),Rr(t)}};function qr(s){this._$AN!==void 0?(di(this),this._$AM=s,Vn(this)):this._$AM=s}function Wr(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++)Ds(i[a],!1),di(i[a]);else i!=null&&(Ds(i,!1),di(i));else Ds(this,s)}const Rr=s=>{s.type==Qt.CHILD&&(s._$AP??(s._$AP=Wr),s._$AQ??(s._$AQ=qr))};let Kr=class extends rs{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),Vn(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&&(Ds(this,t),di(this))}setValue(t){if(Ln(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 A=()=>new Yr;let Yr=class{};const Bi=new WeakMap,O=Fe(class extends Kr{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=Bi.get(t);e===void 0&&(e=new WeakMap,Bi.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=Bi.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 Hn(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 ui=class extends rs{constructor(t){if(super(t),this.it=k,t.type!==Qt.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===Et)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:[]}}};ui.directiveName="unsafeHTML",ui.resultType=1;const pi=Fe(ui);/**
|
|
95
95
|
* @license
|
|
96
96
|
* Copyright 2017 Google LLC
|
|
97
97
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
98
|
-
*/let
|
|
98
|
+
*/let Fi=class extends ui{};Fi.directiveName="unsafeSVG",Fi.resultType=2;const jn=Fe(Fi);var Gr=Object.defineProperty,Zr=Object.getOwnPropertyDescriptor,Is=(s,t,e,i)=>{for(var n=i>1?void 0:i?Zr(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&&Gr(t,e,n),n};const Vi="https://punkt-cdn.oslo.kommune.no/14.5/icons/";typeof window<"u"&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||Vi);const Xr=s=>new Promise(t=>setTimeout(t,s)),fi='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',Hi={},Jr=async(s,t)=>{let e=0;for(;Hi[t+s+".svg"]==="fetching"&&(e++,!(e>50));)await Xr(50);const i=typeof Storage<"u"&&typeof sessionStorage<"u";return i&&sessionStorage.getItem(t+s+".svg")?Promise.resolve(sessionStorage.getItem(t+s+".svg")):typeof window<"u"&&typeof window.pktFetch=="function"?(Hi[t+s+".svg"]="fetching",Promise.resolve(window.pktFetch(t+s+".svg").then(n=>n.ok?n.text():(console.error("Missing icon: "+t+s+".svg"),fi)).then(n=>(n!==fi&&i&&sessionStorage.setItem(t+s+".svg",n),Hi[t+s+".svg"]="fetched",n)))):Promise.resolve(fi)};let He=class extends J{constructor(){super(...arguments),this.path=typeof window<"u"?window.pktIconPath:Vi,this.name="",this.icon=jn(fi),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=jn(await Jr(this.name||"",this.path).then(e=>e)),this._updatedProps=[]):this._updatedProps.includes(t)||this._updatedProps.push(t)}render(){return u`${this.name&&this.icon}`}};Is([o({type:String,reflect:!1})],He.prototype,"path",2),Is([o({type:String,reflect:!0})],He.prototype,"name",2),Is([o({type:SVGElement})],He.prototype,"icon",2),Is([o({type:Array,noAccessor:!0})],He.prototype,"_updatedProps",2),He=Is([H("pkt-icon")],He);/**
|
|
99
99
|
* @license
|
|
100
100
|
* Copyright 2018 Google LLC
|
|
101
101
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
102
|
-
*/const C=s=>s??k;var
|
|
102
|
+
*/const C=s=>s??k;var Qr=Object.defineProperty,to=Object.getOwnPropertyDescriptor,vt=(s,t,e,i)=>{for(var n=i>1?void 0:i?to(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&&Qr(t,e,n),n};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/14.5/animations/";let ut=class extends J{constructor(){super(),this.defaultSlot=A(),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 ot(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 u`
|
|
103
103
|
<button
|
|
104
104
|
class=${N(e)}
|
|
105
105
|
type=${this.type}
|
|
@@ -118,14 +118,14 @@
|
|
|
118
118
|
name=${this.iconName}
|
|
119
119
|
path=${C(this.iconPath)}
|
|
120
120
|
></pkt-icon>`:k}
|
|
121
|
-
<span class="pkt-btn__text" ${
|
|
121
|
+
<span class="pkt-btn__text" ${O(this.defaultSlot)}></span>
|
|
122
122
|
${this.variant==="icons-right-and-left"?u`<pkt-icon
|
|
123
123
|
class="pkt-btn__icon"
|
|
124
124
|
name=${this.secondIconName}
|
|
125
125
|
path=${C(this.secondIconPath)}
|
|
126
126
|
></pkt-icon>`:k}
|
|
127
127
|
</button>
|
|
128
|
-
`}};vt([o({type:String})],
|
|
128
|
+
`}};vt([o({type:String})],ut.prototype,"iconName",2),vt([o({type:String})],ut.prototype,"secondIconName",2),vt([o({type:String})],ut.prototype,"iconPath",2),vt([o({type:String})],ut.prototype,"secondIconPath",2),vt([o({type:String})],ut.prototype,"mode",2),vt([o({type:String})],ut.prototype,"size",2),vt([o({type:Boolean,attribute:"full-width"})],ut.prototype,"fullWidth",2),vt([o({type:Boolean,attribute:"full-width-on-mobile"})],ut.prototype,"fullWidthOnMobile",2),vt([o({type:String})],ut.prototype,"color",2),vt([o({type:String})],ut.prototype,"skin",2),vt([o({type:String})],ut.prototype,"variant",2),vt([o({type:String,reflect:!0})],ut.prototype,"state",2),vt([o({type:String,reflect:!0})],ut.prototype,"type",2),vt([o({type:String})],ut.prototype,"form",2),vt([o({type:Boolean,reflect:!0})],ut.prototype,"isLoading",2),vt([o({type:Boolean,reflect:!0})],ut.prototype,"disabled",2),vt([o({type:String})],ut.prototype,"loadingAnimationPath",2),ut=vt([H("pkt-button")],ut);const eo={skin:{default:"info"},ariaLive:{default:"polite"},compact:{default:!1},closeAlert:{default:!1}},gi={props:eo};var so=Object.defineProperty,io=Object.getOwnPropertyDescriptor,oe=(s,t,e,i)=>{for(var n=i>1?void 0:i?io(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&&so(t,e,n),n};let te=class extends J{constructor(){super(),this.defaultSlot=A(),this.compact=gi.props.compact.default,this.title="",this.skin=gi.props.skin.default,this.ariaLive=gi.props.ariaLive.default,this["aria-live"]=null,this.closeAlert=gi.props.closeAlert.default,this.date=null,this.role="status",this._isClosed=!1,this.close=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 ot(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")&&Hn(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 u`
|
|
129
129
|
<div class=${N(t)} aria-live=${this["aria-live"]}>
|
|
130
130
|
<div class=${N(e)}>
|
|
131
131
|
<pkt-icon
|
|
@@ -152,12 +152,12 @@
|
|
|
152
152
|
`:k}
|
|
153
153
|
${this.title?u`<div class="pkt-alert__title">${this.title}</div>`:k}
|
|
154
154
|
|
|
155
|
-
<div class="pkt-alert__text" ${
|
|
155
|
+
<div class="pkt-alert__text" ${O(this.defaultSlot)}></div>
|
|
156
156
|
|
|
157
157
|
${this.date?u`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>`:k}
|
|
158
158
|
</div>
|
|
159
159
|
</div>
|
|
160
|
-
`}};oe([o({type:Boolean,reflect:!1})],te.prototype,"compact",2),oe([o({type:String,reflect:!0})],te.prototype,"title",2),oe([o({type:String,reflect:!0})],te.prototype,"skin",2),oe([o({type:String})],te.prototype,"ariaLive",2),oe([o({type:String,reflect:!0})],te.prototype,"aria-live",2),oe([o({type:Boolean,reflect:!0})],te.prototype,"closeAlert",2),oe([o({type:String,reflect:!0})],te.prototype,"date",2),oe([o({type:String,reflect:!0})],te.prototype,"role",2),oe([L()],te.prototype,"_isClosed",2),te=oe([
|
|
160
|
+
`}};oe([o({type:Boolean,reflect:!1})],te.prototype,"compact",2),oe([o({type:String,reflect:!0})],te.prototype,"title",2),oe([o({type:String,reflect:!0})],te.prototype,"skin",2),oe([o({type:String})],te.prototype,"ariaLive",2),oe([o({type:String,reflect:!0})],te.prototype,"aria-live",2),oe([o({type:Boolean,reflect:!0})],te.prototype,"closeAlert",2),oe([o({type:String,reflect:!0})],te.prototype,"date",2),oe([o({type:String,reflect:!0})],te.prototype,"role",2),oe([L()],te.prototype,"_isClosed",2),te=oe([H("pkt-alert")],te);var no=Object.defineProperty,ao=Object.getOwnPropertyDescriptor,Ls=(s,t,e,i)=>{for(var n=i>1?void 0:i?ao(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&&no(t,e,n),n};let ls=class extends as{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 u`
|
|
161
161
|
<div
|
|
162
162
|
part="container"
|
|
163
163
|
class=${N(t)}
|
|
@@ -166,12 +166,12 @@
|
|
|
166
166
|
>
|
|
167
167
|
<slot></slot>
|
|
168
168
|
</div>
|
|
169
|
-
`}};
|
|
169
|
+
`}};Ls([o({type:String,reflect:!0,attribute:"aria-labelledby"})],ls.prototype,"ariaLabelledBy",2),Ls([o({type:Boolean,reflect:!0,attribute:"compact"})],ls.prototype,"compact",2),Ls([o({type:String,reflect:!0,attribute:"skin"})],ls.prototype,"skin",2),Ls([o({type:String,reflect:!0,attribute:"name"})],ls.prototype,"name",2),ls=Ls([H("pkt-accordion")],ls);var ro=Object.defineProperty,oo=Object.getOwnPropertyDescriptor,je=(s,t,e,i)=>{for(var n=i>1?void 0:i?oo(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&&ro(t,e,n),n};let Ce=class extends J{constructor(){super(),this.defaultOpen=!1,this.title="",this.skin=void 0,this.compact=!1,this.isOpen=!1,this.name=void 0,this.accordionItemRef=A(),this.defaultSlot=A(),this.slotController=new ot(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 u`
|
|
170
170
|
<details
|
|
171
171
|
class=${N(t)}
|
|
172
172
|
id=${this.id}
|
|
173
173
|
?open=${this.isOpen}
|
|
174
|
-
${
|
|
174
|
+
${O(this.accordionItemRef)}
|
|
175
175
|
name=${C(this.name)}
|
|
176
176
|
>
|
|
177
177
|
<summary class="pkt-accordion-item__title" id=${`pkt-accordion-item-summary-${this.id}`}>
|
|
@@ -187,10 +187,10 @@
|
|
|
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" ${O(this.defaultSlot)}></div>
|
|
191
191
|
</div>
|
|
192
192
|
</details>
|
|
193
|
-
`}};
|
|
193
|
+
`}};je([o({type:Boolean})],Ce.prototype,"defaultOpen",2),je([o({type:String})],Ce.prototype,"title",2),je([o({type:String,reflect:!0})],Ce.prototype,"skin",2),je([o({type:Boolean,reflect:!0})],Ce.prototype,"compact",2),je([o({type:Boolean,reflect:!0})],Ce.prototype,"isOpen",2),je([o({type:String,reflect:!0})],Ce.prototype,"name",2),Ce=je([H("pkt-accordion-item")],Ce);var lo=Object.defineProperty,ho=Object.getOwnPropertyDescriptor,mi=(s,t,e,i)=>{for(var n=i>1?void 0:i?ho(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&&lo(t,e,n),n};let hs=class extends J{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 u`<nav
|
|
194
194
|
class="pkt-back-link"
|
|
195
195
|
aria-label=${this.ariaLabel||"Gå tilbake til forrige side"}
|
|
196
196
|
>
|
|
@@ -202,7 +202,7 @@
|
|
|
202
202
|
></pkt-icon
|
|
203
203
|
><span class="pkt-back-link__text">${this.text}</span></a
|
|
204
204
|
>
|
|
205
|
-
</nav>`}};bi([o({type:String})],hs.prototype,"href",2),bi([o({type:String})],hs.prototype,"text",2),bi([o({type:String})],hs.prototype,"ariaLabel",2),hs=bi([j("pkt-backlink")],hs);const zn=6048e5,ro=864e5,qn=Symbol.for("constructDateFrom");function le(s,t){return typeof s=="function"?s(t):s&&typeof s=="object"&&qn in s?s[qn](t):s instanceof Date?new s.constructor(t):new Date(t)}function Bt(s,t){return le(t||s,s)}function Wn(s,t,e){const i=Bt(s,void 0);return isNaN(t)?le(s,NaN):(t&&i.setDate(i.getDate()+t),i)}let oo={};function ki(){return oo}function Fs(s,t){var e,i,n,a;const r=ki(),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=Bt(s,t==null?void 0:t.in),p=d.getDay(),m=(p<h?7:0)+p-h;return d.setDate(d.getDate()-m),d.setHours(0,0,0,0),d}function yi(s,t){return Fs(s,{...t,weekStartsOn:1})}function Rn(s,t){const e=Bt(s,void 0),i=e.getFullYear(),n=le(e,0);n.setFullYear(i+1,0,4),n.setHours(0,0,0,0);const a=yi(n),r=le(e,0);r.setFullYear(i,0,4),r.setHours(0,0,0,0);const h=yi(r);return e.getTime()>=a.getTime()?i+1:e.getTime()>=h.getTime()?i:i-1}function Kn(s){const t=Bt(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 Yn(s,...t){const e=le.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Gn(s,t){const e=Bt(s,void 0);return e.setHours(0,0,0,0),e}function lo(s,t,e){const[i,n]=Yn(void 0,s,t),a=Gn(i),r=Gn(n),h=+a-Kn(a),d=+r-Kn(r);return Math.round((h-d)/ro)}function ho(s,t){const e=Rn(s),i=le(s,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),yi(i)}function co(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function uo(s){return!(!co(s)&&typeof s!="number"||isNaN(+Bt(s)))}function po(s,t){const[e,i]=Yn(s,t.start,t.end);return{start:e,end:i}}function Zn(s,t){const{start:e,end:i}=po(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(le(e,r)),r.setDate(r.getDate()+h),r.setHours(0,0,0,0);return n?d.reverse():d}function fo(s,t){const e=Bt(s,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const go={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"}},mo=(s,t,e)=>{let i;const n=go[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 Ui(s){return(t={})=>{const e=t.width?String(t.width):s.defaultWidth;return s.formats[e]||s.formats[s.defaultWidth]}}const vo={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},bo={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ko={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},yo={date:Ui({formats:vo,defaultWidth:"full"}),time:Ui({formats:bo,defaultWidth:"full"}),dateTime:Ui({formats:ko,defaultWidth:"full"})},$o={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},_o=(s,t,e,i)=>$o[s];function Vs(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 wo={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},xo={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},So={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"]},To={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"}},No={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"},Mo={ordinalNumber:Eo,era:Vs({values:wo,defaultWidth:"wide"}),quarter:Vs({values:xo,defaultWidth:"wide",argumentCallback:s=>s-1}),month:Vs({values:So,defaultWidth:"wide"}),day:Vs({values:Co,defaultWidth:"wide"}),dayPeriod:Vs({values:To,defaultWidth:"wide",formattingValues:No,defaultFormattingWidth:"wide"})};function js(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)?Oo(h,v=>v.test(r)):Ao(h,v=>v.test(r));let p;p=s.valueCallback?s.valueCallback(d):d,p=e.valueCallback?e.valueCallback(p):p;const m=t.slice(r.length);return{value:p,rest:m}}}function Ao(s,t){for(const e in s)if(Object.prototype.hasOwnProperty.call(s,e)&&t(s[e]))return e}function Oo(s,t){for(let e=0;e<s.length;e++)if(t(s[e]))return e}function Po(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 Do=/^(\d+)(th|st|nd|rd)?/i,Io=/\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},Bo={any:[/^b/i,/^(a|c)/i]},Fo={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Vo={any:[/1/i,/2/i,/3/i,/4/i]},jo={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},Ho={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]},Uo={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},zo={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]},qo={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},Wo={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}},Ro={ordinalNumber:Po({matchPattern:Do,parsePattern:Io,valueCallback:s=>parseInt(s,10)}),era:js({matchPatterns:Lo,defaultMatchWidth:"wide",parsePatterns:Bo,defaultParseWidth:"any"}),quarter:js({matchPatterns:Fo,defaultMatchWidth:"wide",parsePatterns:Vo,defaultParseWidth:"any",valueCallback:s=>s+1}),month:js({matchPatterns:jo,defaultMatchWidth:"wide",parsePatterns:Ho,defaultParseWidth:"any"}),day:js({matchPatterns:Uo,defaultMatchWidth:"wide",parsePatterns:zo,defaultParseWidth:"any"}),dayPeriod:js({matchPatterns:qo,defaultMatchWidth:"any",parsePatterns:Wo,defaultParseWidth:"any"})},Ko={code:"en-US",formatDistance:mo,formatLong:yo,formatRelative:_o,localize:Mo,match:Ro,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Yo(s,t){const e=Bt(s,void 0);return lo(e,fo(e))+1}function Go(s,t){const e=Bt(s,void 0),i=+yi(e)-+ho(e);return Math.round(i/zn)+1}function Xn(s,t){var e,i,n,a;const r=Bt(s,t==null?void 0:t.in),h=r.getFullYear(),d=ki(),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??((a=(n=d.locale)==null?void 0:n.options)==null?void 0:a.firstWeekContainsDate)??1,m=le((t==null?void 0:t.in)||s,0);m.setFullYear(h+1,0,p),m.setHours(0,0,0,0);const v=Fs(m,t),y=le((t==null?void 0:t.in)||s,0);y.setFullYear(h,0,p),y.setHours(0,0,0,0);const $=Fs(y,t);return+r>=+v?h+1:+r>=+$?h:h-1}function Zo(s,t){var e,i,n,a;const r=ki(),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=Xn(s,t),p=le((t==null?void 0:t.in)||s,0);return p.setFullYear(d,0,h),p.setHours(0,0,0,0),Fs(p,t)}function Jn(s,t){const e=Bt(s,t==null?void 0:t.in),i=+Fs(e,t)-+Zo(e,t);return Math.round(i/zn)+1}function Y(s,t){const e=s<0?"-":"",i=Math.abs(s).toString().padStart(t,"0");return e+i}const Te={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)}},cs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Qn={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 Te.y(s,t)},Y:function(s,t,e,i){const n=Xn(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=Rn(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 Te.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=Jn(s,i);return t==="wo"?e.ordinalNumber(n,{unit:"week"}):Y(n,t.length)},I:function(s,t,e){const i=Go(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"}):Te.d(s,t)},D:function(s,t,e){const i=Yo(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=cs.noon:i===0?n=cs.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=cs.evening:i>=12?n=cs.afternoon:i>=4?n=cs.morning:n=cs.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 Te.h(s,t)},H:function(s,t,e){return t==="Ho"?e.ordinalNumber(s.getHours(),{unit:"hour"}):Te.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"}):Te.m(s,t)},s:function(s,t,e){return t==="so"?e.ordinalNumber(s.getSeconds(),{unit:"second"}):Te.s(s,t)},S:function(s,t){return Te.S(s,t)},X:function(s,t,e){const i=s.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return ea(i);case"XXXX":case"XX":return Ue(i);case"XXXXX":case"XXX":default:return Ue(i,":")}},x:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"x":return ea(i);case"xxxx":case"xx":return Ue(i);case"xxxxx":case"xxx":default:return Ue(i,":")}},O:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ta(i,":");case"OOOO":default:return"GMT"+Ue(i,":")}},z:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ta(i,":");case"zzzz":default:return"GMT"+Ue(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 ta(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 ea(s,t){return s%60===0?(s>0?"-":"+")+Y(Math.abs(s)/60,2):Ue(s,t)}function Ue(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 sa=(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],n=e[2];if(!n)return sa(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}}",sa(i,t)).replace("{{time}}",ia(n,t))},Jo={p:ia,P:Xo},Qo=/^D+$/,tl=/^Y+$/,el=["D","DD","YY","YYYY"];function sl(s){return Qo.test(s)}function il(s){return tl.test(s)}function nl(s,t,e){const i=al(s,t,e);if(console.warn(i),el.includes(s))throw new RangeError(i)}function al(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 rl=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ol=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ll=/^'([^]*?)'?$/,hl=/''/g,cl=/[a-zA-Z]/;function dl(s,t,e){var i,n,a,r;const h=ki(),d=h.locale??Ko,p=h.firstWeekContainsDate??((n=(i=h.locale)==null?void 0:i.options)==null?void 0:n.firstWeekContainsDate)??1,m=h.weekStartsOn??((r=(a=h.locale)==null?void 0:a.options)==null?void 0:r.weekStartsOn)??0,v=Bt(s,void 0);if(!uo(v))throw new RangeError("Invalid time value");let y=t.match(ol).map(b=>{const x=b[0];if(x==="p"||x==="P"){const T=Jo[x];return T(b,d.formatLong)}return b}).join("").match(rl).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const x=b[0];if(x==="'")return{isToken:!1,value:ul(b)};if(Qn[x])return{isToken:!0,value:b};if(x.match(cl))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:b}});d.localize.preprocessor&&(y=d.localize.preprocessor(v,y));const $={firstWeekContainsDate:p,weekStartsOn:m,locale:d};return y.map(b=>{if(!b.isToken)return b.value;const x=b.value;(il(x)||sl(x))&&nl(x,t,String(s));const T=Qn[x[0]];return T(v,x,d.localize,$)}).join("")}function ul(s){const t=s.match(ll);return t?t[1].replace(hl,"'"):s}function pl(s,t){const e=Bt(s,void 0).getDay();return e===0?7:e}function fl(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 na={},Hs={};function ze(s,t){try{const e=(na[s]||(na[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return e in Hs?Hs[e]:aa(e,e.split(":"))}catch{if(s in Hs)return Hs[s];const e=s==null?void 0:s.match(gl);return e?aa(s,e.slice(1)):NaN}}const gl=/([+-]\d\d):?(\d\d)?/;function aa(s,t){const e=+(t[0]||0),i=+(t[1]||0),n=+(t[2]||0)/60;return Hs[s]=e*60+i>0?e*60+i+n:e*60-i-n}let Us=class ni 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)),oa(this),zi(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new ni(...e,t):new ni(Date.now(),t)}withTimeZone(t){return new ni(+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),zi(this),+this}[Symbol.for("constructDateFrom")](t){return new ni(+new Date(t),this.timeZone)}};const ra=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!ra.test(s))return;const t=s.replace(ra,"$1UTC");Us.prototype[t]&&(s.startsWith("get")?Us.prototype[s]=function(){return this.internal[t]()}:(Us.prototype[s]=function(){return Date.prototype[t].apply(this.internal,arguments),ml(this),+this},Us.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),zi(this),+this}))});function zi(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-ze(s.timeZone,s)*60))}function ml(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()),oa(s)}function oa(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 p=new Date(+s);p.setUTCSeconds(0);const m=n>0?p.getSeconds():(p.getSeconds()-60)%60,v=Math.round(-(ze(s.timeZone,s)*60))%60;(v||m)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+v),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+v+m));const y=ze(s.timeZone,s),$=y>0?Math.floor(y):Math.ceil(y),b=-new Date(+s).getTimezoneOffset()-$,x=$!==e,T=b-d;if(x&&T){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+T);const O=ze(s.timeZone,s),S=O>0?Math.floor(O):Math.ceil(O),B=$-S;B&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+B),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+B))}}let qi=class ai extends Us{static tz(t,...e){return e.length?new ai(...e,t):new ai(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} (${fl(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 ai(+this,t)}[Symbol.for("constructDateFrom")](t){return new ai(+new Date(t),this.timeZone)}};window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const vl=(s=window.pktTz)=>{const t=new qi(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 Ne(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 bt=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}`},Ee=s=>{if(!s)return null;const t=Ne(s);return isNaN(t.getTime())?null:t},la=(s,t)=>{const e=me(s);return isNaN(e.getTime())?"":dl(e,t)},me=(s="",t)=>{const e=typeof s=="string"?Ne(s):s;return!e||isNaN(e.getTime())?new Date:e},qe=(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},zs=s=>{let t;return typeof s=="number"?t=new qi(s,window.pktTz):t=new qi(s,window.pktTz),t.setHours(12,0,0,0),t},bl=s=>!s||isNaN(s.getTime())?"":new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(s),kl=(s,t,e)=>{if(!s||isNaN(s.getTime()))return!1;const i=t?me(t):null,n=e?me(e):null;return!(i&&s<i||n&&s>n)},yl=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=bt(s);return t.includes(e)},$l=(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,n)=>!(!s||isNaN(s.getTime())||!kl(s,t,e)||i&&yl(s,i)||n&&$l(s,n)),_l=(s,t,e,i,n)=>s.filter(a=>{const r=Ee(a);return r&&ha(r,t,e,i,n)}),ca=s=>s.slice().sort((t,e)=>{const i=Ee(t),n=Ee(e);return!i||!n?0:i.getTime()-n.getTime()}),wl=(s,t)=>{const e=Ee(s),i=Ee(t);return!e||!i?!1:e<=i},qs=s=>s?Array.isArray(s)?s.filter(Boolean):String(s).split(",").map(t=>t.trim()).filter(Boolean):[],xl=s=>s.join(","),da=s=>qs(s),Sl=s=>s?Ne(s):null,Cl=s=>{if(typeof s=="string")return s.split(",").map(t=>Ne(t));if(Array.isArray(s))return s.map(t=>Ne(t))},ds={csvToArray:da,stringToDate:Sl,stringsToDate:Cl},Tl={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},We={props:Tl};function ua(s,t){const e=t.excludedates.map(i=>typeof i=="string"?i:bt(i));return!ha(s,t.earliest,t.latest,e,t.excludeweekdays)}function Nl(s,t,e,i){return!!(ua(s,e)||!t&&i.multiple&&i.maxMultiple>0&&i.selectedCount>=i.maxMultiple)}function El(s,t,e){const i=qe(s,t,0);return!(e&&me(e)>i)}function Ml(s,t,e){const i=qe(t===11?s+1:s,t===11?0:t+1,1);return!(e&&me(e)<i)}const Ws=7,Al=6;function Ol(s,t){const e=qe(s,t,1),i=qe(s,t+1,0),n=(e.getDay()+Al)%Ws,a=i.getDate(),r=Math.ceil((a+n)/Ws),h=qe(s,t,0).getDate(),d=Jn(e);return{firstDayOfMonth:e,lastDayOfMonth:i,startingDay:n,numDays:a,numRows:r,numDaysPrevMonth:h,initialWeek:d}}function Pl(s,t,e,i){const{startingDay:n,numDays:a}=i;return s===0&&t<n?"prev-month":e>a?"next-month":"current-month"}function Dl(s,t,e,i){const{startingDay:n,numDaysPrevMonth:a,numDays:r}=i;return s==="prev-month"?a-(n-t-1):s==="next-month"?e-r:e}function us(s){return typeof s=="string"&&(s=s.split(",")),s.length===1&&s[0]===""?[]:s.map(t=>Ne(t))}function pa(s,t){const e=Zn({start:s,end:t}),i={};if(Array.isArray(e)&&e.length)for(let n=0;n<e.length;n++){const a=e[n],r=a>s&&a<t;i[bt(a)]=r}return i}function fa(s,t,e,i){if(t.length!==1)return!0;const n=Zn({start:t[0],end:s});if(!Array.isArray(n)||!n.length)return!0;for(let a=0;a<n.length;a++){for(const r of e)if(r>t[0]&&r<s)return!1;if(i.includes(pl(n[a]).toString()))return!1}return!0}function Wi(s,t){const e=bt(s);return t.includes(e)?t:[...t,e]}function Ri(s,t){const e=bt(s),i=t.indexOf(e);if(i===-1)return t;if(t.length===1)return[];const n=[...t];return n.splice(i,1),n}function Il(s,t,e){const i=bt(s);return t.includes(i)?Ri(s,t):e>0&&t.length>=e?t:Wi(s,t)}function Ll(s,t,e){const i=bt(s),n=us(t);if(t.includes(i))return t.indexOf(i)===0?[]:Ri(s,t);if(t.length>1)return[i];if(t.length===1){if(!fa(s,n,e.excludedates,e.excludeweekdays))return[i];if(n[0]>s)return[i]}return Wi(s,t)}const Bl={ArrowLeft:-1,ArrowRight:1,ArrowUp:-Ws,ArrowDown:Ws};function Fl(s){var t;const e=s.nodeName;return e==="INPUT"||e==="SELECT"||e==="BUTTON"&&!((t=s.dataset)!=null&&t.date)}function Vl(s,t,e){let i=Wn(s,t);if(!i)return null;let n=e(`button[data-date="${bt(i)}"]`);for(;n instanceof HTMLButtonElement&&n.dataset.disabled;)if(i=Wn(i,t),n=e(`button[data-date="${bt(i)}"]`),!n)return null;return i}function jl(s){return Bl[s]??null}var Hl=Object.defineProperty,Ul=Object.getOwnPropertyDescriptor,J=(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&&Hl(t,e,n),n};let G=class extends X{constructor(){super(...arguments),this.selected=[],this.multiple=We.props.multiple.default,this.maxMultiple=We.props.maxMultiple.default,this.range=We.props.range.default,this.earliest=We.props.earliest.default,this.latest=We.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.weeknumbers=We.props.weeknumbers.default,this.withcontrols=We.props.withcontrols.default,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.inRange={},this.rangeHovered=null,this.year=0,this.month=0,this.week=0,this.currentmonthtouched=!1,this.focusedDate=null,this.selectableDates=[],this.tabIndexSet=0}firstUpdated(t){this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}updated(t){super.updated(t),t.has("selected")&&this.convertSelected()}convertSelected(){typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=us(this.selected),this.range&&this.selected.length===2&&(this.inRange=pa(this._selected[0],this._selected[1])),this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==""){const t=Ne(this.selected[this.selected.length-1]);this.currentmonth=isNaN(t.getTime())?zs(new Date):t}else this.currentmonth===null&&(this.currentmonth=zs(new Date));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=zs(new Date)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(t){const e=jl(t.key);e!==null&&this.handleArrowKey(t,e)}handleArrowKey(t,e){const i=t.target;if(Fl(i))return;if(t.preventDefault(),!this.focusedDate){this.focusOnCurrentDate();return}const n=this.focusedDate?me(this.focusedDate):qe(this.year,this.month,1),a=Vl(n,e,this.querySelector.bind(this));if(a){const r=this.querySelector(`button[data-date="${bt(a)}"]`);r instanceof HTMLButtonElement&&!r.dataset.disabled&&(this.focusedDate=bt(a),r.focus())}}render(){return u`
|
|
205
|
+
</nav>`}};mi([o({type:String})],hs.prototype,"href",2),mi([o({type:String})],hs.prototype,"text",2),mi([o({type:String})],hs.prototype,"ariaLabel",2),hs=mi([H("pkt-backlink")],hs);const Un=6048e5,co=864e5,zn=Symbol.for("constructDateFrom");function le(s,t){return typeof s=="function"?s(t):s&&typeof s=="object"&&zn in s?s[zn](t):s instanceof Date?new s.constructor(t):new Date(t)}function Bt(s,t){return le(t||s,s)}function qn(s,t,e){const i=Bt(s,void 0);return isNaN(t)?le(s,NaN):(t&&i.setDate(i.getDate()+t),i)}let uo={};function vi(){return uo}function Bs(s,t){var e,i,n,a;const r=vi(),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=Bt(s,t==null?void 0:t.in),p=d.getDay(),m=(p<h?7:0)+p-h;return d.setDate(d.getDate()-m),d.setHours(0,0,0,0),d}function bi(s,t){return Bs(s,{...t,weekStartsOn:1})}function Wn(s,t){const e=Bt(s,void 0),i=e.getFullYear(),n=le(e,0);n.setFullYear(i+1,0,4),n.setHours(0,0,0,0);const a=bi(n),r=le(e,0);r.setFullYear(i,0,4),r.setHours(0,0,0,0);const h=bi(r);return e.getTime()>=a.getTime()?i+1:e.getTime()>=h.getTime()?i:i-1}function Rn(s){const t=Bt(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 Kn(s,...t){const e=le.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Yn(s,t){const e=Bt(s,void 0);return e.setHours(0,0,0,0),e}function po(s,t,e){const[i,n]=Kn(void 0,s,t),a=Yn(i),r=Yn(n),h=+a-Rn(a),d=+r-Rn(r);return Math.round((h-d)/co)}function fo(s,t){const e=Wn(s),i=le(s,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),bi(i)}function go(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function mo(s){return!(!go(s)&&typeof s!="number"||isNaN(+Bt(s)))}function vo(s,t){const[e,i]=Kn(s,t.start,t.end);return{start:e,end:i}}function Gn(s,t){const{start:e,end:i}=vo(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(le(e,r)),r.setDate(r.getDate()+h),r.setHours(0,0,0,0);return n?d.reverse():d}function bo(s,t){const e=Bt(s,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const ko={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"}},yo=(s,t,e)=>{let i;const n=ko[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 ji(s){return(t={})=>{const e=t.width?String(t.width):s.defaultWidth;return s.formats[e]||s.formats[s.defaultWidth]}}const $o={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},_o={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},wo={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},xo={date:ji({formats:$o,defaultWidth:"full"}),time:ji({formats:_o,defaultWidth:"full"}),dateTime:ji({formats:wo,defaultWidth:"full"})},So={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Co=(s,t,e,i)=>So[s];function Fs(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 To={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},No={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Eo={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"]},Mo={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"]},Ao={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"}},Oo={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"}},Po=(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"},Do={ordinalNumber:Po,era:Fs({values:To,defaultWidth:"wide"}),quarter:Fs({values:No,defaultWidth:"wide",argumentCallback:s=>s-1}),month:Fs({values:Eo,defaultWidth:"wide"}),day:Fs({values:Mo,defaultWidth:"wide"}),dayPeriod:Fs({values:Ao,defaultWidth:"wide",formattingValues:Oo,defaultFormattingWidth:"wide"})};function Vs(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)?Lo(h,v=>v.test(r)):Io(h,v=>v.test(r));let p;p=s.valueCallback?s.valueCallback(d):d,p=e.valueCallback?e.valueCallback(p):p;const m=t.slice(r.length);return{value:p,rest:m}}}function Io(s,t){for(const e in s)if(Object.prototype.hasOwnProperty.call(s,e)&&t(s[e]))return e}function Lo(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 Fo=/^(\d+)(th|st|nd|rd)?/i,Vo=/\d+/i,Ho={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},jo={any:[/^b/i,/^(a|c)/i]},Uo={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},zo={any:[/1/i,/2/i,/3/i,/4/i]},qo={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},Wo={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]},Ro={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},Ko={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]},Yo={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},Go={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}},Zo={ordinalNumber:Bo({matchPattern:Fo,parsePattern:Vo,valueCallback:s=>parseInt(s,10)}),era:Vs({matchPatterns:Ho,defaultMatchWidth:"wide",parsePatterns:jo,defaultParseWidth:"any"}),quarter:Vs({matchPatterns:Uo,defaultMatchWidth:"wide",parsePatterns:zo,defaultParseWidth:"any",valueCallback:s=>s+1}),month:Vs({matchPatterns:qo,defaultMatchWidth:"wide",parsePatterns:Wo,defaultParseWidth:"any"}),day:Vs({matchPatterns:Ro,defaultMatchWidth:"wide",parsePatterns:Ko,defaultParseWidth:"any"}),dayPeriod:Vs({matchPatterns:Yo,defaultMatchWidth:"any",parsePatterns:Go,defaultParseWidth:"any"})},Xo={code:"en-US",formatDistance:yo,formatLong:xo,formatRelative:Co,localize:Do,match:Zo,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Jo(s,t){const e=Bt(s,void 0);return po(e,bo(e))+1}function Qo(s,t){const e=Bt(s,void 0),i=+bi(e)-+fo(e);return Math.round(i/Un)+1}function Zn(s,t){var e,i,n,a;const r=Bt(s,t==null?void 0:t.in),h=r.getFullYear(),d=vi(),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??((a=(n=d.locale)==null?void 0:n.options)==null?void 0:a.firstWeekContainsDate)??1,m=le((t==null?void 0:t.in)||s,0);m.setFullYear(h+1,0,p),m.setHours(0,0,0,0);const v=Bs(m,t),y=le((t==null?void 0:t.in)||s,0);y.setFullYear(h,0,p),y.setHours(0,0,0,0);const $=Bs(y,t);return+r>=+v?h+1:+r>=+$?h:h-1}function tl(s,t){var e,i,n,a;const r=vi(),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=Zn(s,t),p=le((t==null?void 0:t.in)||s,0);return p.setFullYear(d,0,h),p.setHours(0,0,0,0),Bs(p,t)}function Xn(s,t){const e=Bt(s,t==null?void 0:t.in),i=+Bs(e,t)-+tl(e,t);return Math.round(i/Un)+1}function Y(s,t){const e=s<0?"-":"",i=Math.abs(s).toString().padStart(t,"0");return e+i}const Te={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)}},cs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Jn={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 Te.y(s,t)},Y:function(s,t,e,i){const n=Zn(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=Wn(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 Te.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=Xn(s,i);return t==="wo"?e.ordinalNumber(n,{unit:"week"}):Y(n,t.length)},I:function(s,t,e){const i=Qo(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"}):Te.d(s,t)},D:function(s,t,e){const i=Jo(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=cs.noon:i===0?n=cs.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=cs.evening:i>=12?n=cs.afternoon:i>=4?n=cs.morning:n=cs.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 Te.h(s,t)},H:function(s,t,e){return t==="Ho"?e.ordinalNumber(s.getHours(),{unit:"hour"}):Te.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"}):Te.m(s,t)},s:function(s,t,e){return t==="so"?e.ordinalNumber(s.getSeconds(),{unit:"second"}):Te.s(s,t)},S:function(s,t){return Te.S(s,t)},X:function(s,t,e){const i=s.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return ta(i);case"XXXX":case"XX":return Ue(i);case"XXXXX":case"XXX":default:return Ue(i,":")}},x:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"x":return ta(i);case"xxxx":case"xx":return Ue(i);case"xxxxx":case"xxx":default:return Ue(i,":")}},O:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Qn(i,":");case"OOOO":default:return"GMT"+Ue(i,":")}},z:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Qn(i,":");case"zzzz":default:return"GMT"+Ue(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 Qn(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 ta(s,t){return s%60===0?(s>0?"-":"+")+Y(Math.abs(s)/60,2):Ue(s,t)}function Ue(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 ea=(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"})}},sa=(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"})}},el=(s,t)=>{const e=s.match(/(P+)(p+)?/)||[],i=e[1],n=e[2];if(!n)return ea(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}}",ea(i,t)).replace("{{time}}",sa(n,t))},sl={p:sa,P:el},il=/^D+$/,nl=/^Y+$/,al=["D","DD","YY","YYYY"];function rl(s){return il.test(s)}function ol(s){return nl.test(s)}function ll(s,t,e){const i=hl(s,t,e);if(console.warn(i),al.includes(s))throw new RangeError(i)}function hl(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 cl=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,dl=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ul=/^'([^]*?)'?$/,pl=/''/g,fl=/[a-zA-Z]/;function gl(s,t,e){var i,n,a,r;const h=vi(),d=h.locale??Xo,p=h.firstWeekContainsDate??((n=(i=h.locale)==null?void 0:i.options)==null?void 0:n.firstWeekContainsDate)??1,m=h.weekStartsOn??((r=(a=h.locale)==null?void 0:a.options)==null?void 0:r.weekStartsOn)??0,v=Bt(s,void 0);if(!mo(v))throw new RangeError("Invalid time value");let y=t.match(dl).map(b=>{const x=b[0];if(x==="p"||x==="P"){const T=sl[x];return T(b,d.formatLong)}return b}).join("").match(cl).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const x=b[0];if(x==="'")return{isToken:!1,value:ml(b)};if(Jn[x])return{isToken:!0,value:b};if(x.match(fl))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:b}});d.localize.preprocessor&&(y=d.localize.preprocessor(v,y));const $={firstWeekContainsDate:p,weekStartsOn:m,locale:d};return y.map(b=>{if(!b.isToken)return b.value;const x=b.value;(ol(x)||rl(x))&&ll(x,t,String(s));const T=Jn[x[0]];return T(v,x,d.localize,$)}).join("")}function ml(s){const t=s.match(ul);return t?t[1].replace(pl,"'"):s}function vl(s,t){const e=Bt(s,void 0).getDay();return e===0?7:e}function bl(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 ia={},Hs={};function ze(s,t){try{const e=(ia[s]||(ia[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return e in Hs?Hs[e]:na(e,e.split(":"))}catch{if(s in Hs)return Hs[s];const e=s==null?void 0:s.match(kl);return e?na(s,e.slice(1)):NaN}}const kl=/([+-]\d\d):?(\d\d)?/;function na(s,t){const e=+(t[0]||0),i=+(t[1]||0),n=+(t[2]||0)/60;return Hs[s]=e*60+i>0?e*60+i+n:e*60-i-n}let js=class si 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)),ra(this),Ui(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new si(...e,t):new si(Date.now(),t)}withTimeZone(t){return new si(+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),Ui(this),+this}[Symbol.for("constructDateFrom")](t){return new si(+new Date(t),this.timeZone)}};const aa=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!aa.test(s))return;const t=s.replace(aa,"$1UTC");js.prototype[t]&&(s.startsWith("get")?js.prototype[s]=function(){return this.internal[t]()}:(js.prototype[s]=function(){return Date.prototype[t].apply(this.internal,arguments),yl(this),+this},js.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Ui(this),+this}))});function Ui(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-ze(s.timeZone,s)*60))}function yl(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()),ra(s)}function ra(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 p=new Date(+s);p.setUTCSeconds(0);const m=n>0?p.getSeconds():(p.getSeconds()-60)%60,v=Math.round(-(ze(s.timeZone,s)*60))%60;(v||m)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+v),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+v+m));const y=ze(s.timeZone,s),$=y>0?Math.floor(y):Math.ceil(y),b=-new Date(+s).getTimezoneOffset()-$,x=$!==e,T=b-d;if(x&&T){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+T);const M=ze(s.timeZone,s),S=M>0?Math.floor(M):Math.ceil(M),B=$-S;B&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+B),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+B))}}let zi=class ii extends js{static tz(t,...e){return e.length?new ii(...e,t):new ii(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} (${bl(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 ii(+this,t)}[Symbol.for("constructDateFrom")](t){return new ii(+new Date(t),this.timeZone)}};window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const $l=(s=window.pktTz)=>{const t=new zi(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 Ne(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 bt=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}`},Ee=s=>{if(!s)return null;const t=Ne(s);return isNaN(t.getTime())?null:t},oa=(s,t)=>{const e=me(s);return isNaN(e.getTime())?"":gl(e,t)},me=(s="",t)=>{const e=typeof s=="string"?Ne(s):s;return!e||isNaN(e.getTime())?new Date:e},qe=(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},Us=s=>{let t;return typeof s=="number"?t=new zi(s,window.pktTz):t=new zi(s,window.pktTz),t.setHours(12,0,0,0),t},_l=s=>!s||isNaN(s.getTime())?"":new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(s),wl=(s,t,e)=>{if(!s||isNaN(s.getTime()))return!1;const i=t?me(t):null,n=e?me(e):null;return!(i&&s<i||n&&s>n)},xl=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=bt(s);return t.includes(e)},Sl=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=s.getDay().toString();return t.includes(e)},la=(s,t,e,i,n)=>!(!s||isNaN(s.getTime())||!wl(s,t,e)||i&&xl(s,i)||n&&Sl(s,n)),Cl=(s,t,e,i,n)=>s.filter(a=>{const r=Ee(a);return r&&la(r,t,e,i,n)}),ha=s=>s.slice().sort((t,e)=>{const i=Ee(t),n=Ee(e);return!i||!n?0:i.getTime()-n.getTime()}),Tl=(s,t)=>{const e=Ee(s),i=Ee(t);return!e||!i?!1:e<=i},zs=s=>s?Array.isArray(s)?s.filter(Boolean):String(s).split(",").map(t=>t.trim()).filter(Boolean):[],Nl=s=>s.join(","),El=s=>zs(s),Ml=s=>s?Ne(s):null,Al=s=>{if(typeof s=="string")return s.split(",").map(t=>Ne(t));if(Array.isArray(s))return s.map(t=>Ne(t))},ds={csvToArray:El,stringToDate:Ml,stringsToDate:Al},Ol={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},We={props:Ol};function ca(s,t){const e=t.excludedates.map(i=>typeof i=="string"?i:bt(i));return!la(s,t.earliest,t.latest,e,t.excludeweekdays)}function Pl(s,t,e,i){return!!(ca(s,e)||!t&&i.multiple&&i.maxMultiple>0&&i.selectedCount>=i.maxMultiple)}function Dl(s,t,e){const i=qe(s,t,0);return!(e&&me(e)>i)}function Il(s,t,e){const i=qe(t===11?s+1:s,t===11?0:t+1,1);return!(e&&me(e)<i)}const qs=7,Ll=6;function Bl(s,t){const e=qe(s,t,1),i=qe(s,t+1,0),n=(e.getDay()+Ll)%qs,a=i.getDate(),r=Math.ceil((a+n)/qs),h=qe(s,t,0).getDate(),d=Xn(e);return{firstDayOfMonth:e,lastDayOfMonth:i,startingDay:n,numDays:a,numRows:r,numDaysPrevMonth:h,initialWeek:d}}function Fl(s,t,e,i){const{startingDay:n,numDays:a}=i;return s===0&&t<n?"prev-month":e>a?"next-month":"current-month"}function Vl(s,t,e,i){const{startingDay:n,numDaysPrevMonth:a,numDays:r}=i;return s==="prev-month"?a-(n-t-1):s==="next-month"?e-r:e}function us(s){return typeof s=="string"&&(s=s.split(",")),s.length===1&&s[0]===""?[]:s.map(t=>Ne(t))}function da(s,t){const e=Gn({start:s,end:t}),i={};if(Array.isArray(e)&&e.length)for(let n=0;n<e.length;n++){const a=e[n],r=a>s&&a<t;i[bt(a)]=r}return i}function ua(s,t,e,i){if(t.length!==1)return!0;const n=Gn({start:t[0],end:s});if(!Array.isArray(n)||!n.length)return!0;for(let a=0;a<n.length;a++){for(const r of e)if(r>t[0]&&r<s)return!1;if(i.includes(vl(n[a]).toString()))return!1}return!0}function qi(s,t){const e=bt(s);return t.includes(e)?t:[...t,e]}function Wi(s,t){const e=bt(s),i=t.indexOf(e);if(i===-1)return t;if(t.length===1)return[];const n=[...t];return n.splice(i,1),n}function Hl(s,t,e){const i=bt(s);return t.includes(i)?Wi(s,t):e>0&&t.length>=e?t:qi(s,t)}function jl(s,t,e){const i=bt(s),n=us(t);if(t.includes(i))return t.indexOf(i)===0?[]:Wi(s,t);if(t.length>1)return[i];if(t.length===1){if(!ua(s,n,e.excludedates,e.excludeweekdays))return[i];if(n[0]>s)return[i]}return qi(s,t)}const Ul={ArrowLeft:-1,ArrowRight:1,ArrowUp:-qs,ArrowDown:qs};function zl(s){var t;const e=s.nodeName;return e==="INPUT"||e==="SELECT"||e==="BUTTON"&&!((t=s.dataset)!=null&&t.date)}function ql(s,t,e){let i=qn(s,t);if(!i)return null;let n=e(`button[data-date="${bt(i)}"]`);for(;n instanceof HTMLButtonElement&&n.dataset.disabled;)if(i=qn(i,t),n=e(`button[data-date="${bt(i)}"]`),!n)return null;return i}function Wl(s){return Ul[s]??null}var Rl=Object.defineProperty,Kl=Object.getOwnPropertyDescriptor,X=(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 G=class extends J{constructor(){super(...arguments),this.selected=[],this.multiple=We.props.multiple.default,this.maxMultiple=We.props.maxMultiple.default,this.range=We.props.range.default,this.earliest=We.props.earliest.default,this.latest=We.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.weeknumbers=We.props.weeknumbers.default,this.withcontrols=We.props.withcontrols.default,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.inRange={},this.rangeHovered=null,this.year=0,this.month=0,this.week=0,this.currentmonthtouched=!1,this.focusedDate=null,this.selectableDates=[],this.tabIndexSet=0}firstUpdated(t){this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}updated(t){super.updated(t),t.has("selected")&&this.convertSelected()}convertSelected(){typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=us(this.selected),this.range&&this.selected.length===2&&(this.inRange=da(this._selected[0],this._selected[1])),this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==""){const t=Ne(this.selected[this.selected.length-1]);this.currentmonth=isNaN(t.getTime())?Us(new Date):t}else this.currentmonth===null&&(this.currentmonth=Us(new Date));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=Us(new Date)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(t){const e=Wl(t.key);e!==null&&this.handleArrowKey(t,e)}handleArrowKey(t,e){const i=t.target;if(zl(i))return;if(t.preventDefault(),!this.focusedDate){this.focusOnCurrentDate();return}const n=this.focusedDate?me(this.focusedDate):qe(this.year,this.month,1),a=ql(n,e,this.querySelector.bind(this));if(a){const r=this.querySelector(`button[data-date="${bt(a)}"]`);r instanceof HTMLButtonElement&&!r.dataset.disabled&&(this.focusedDate=bt(a),r.focus())}}render(){return u`
|
|
206
206
|
<div
|
|
207
207
|
class="pkt-calendar ${this.weeknumbers?"pkt-cal-weeknumbers":""}"
|
|
208
208
|
@focusout=${this.closeEvent}
|
|
@@ -267,7 +267,7 @@
|
|
|
267
267
|
/>
|
|
268
268
|
</div>`:u`<div class="pkt-txt-16-medium pkt-calendar__month-title" aria-live="polite">
|
|
269
269
|
${this.monthStrings[this.month]} ${this.year}
|
|
270
|
-
</div>`}getDayViewData(t,e){const i=qe(this.year,this.month,t),n=bt(i),a=n===bt(e),r=this.selected.includes(n),h=this.isDayDisabled(i,r),d=this.calculateTabIndex(n,h,t);return{currentDate:i,currentDateISO:n,isToday:a,isSelected:r,isDisabled:h,ariaLabel:
|
|
270
|
+
</div>`}getDayViewData(t,e){const i=qe(this.year,this.month,t),n=bt(i),a=n===bt(e),r=this.selected.includes(n),h=this.isDayDisabled(i,r),d=this.calculateTabIndex(n,h,t);return{currentDate:i,currentDateISO:n,isToday:a,isSelected:r,isDisabled:h,ariaLabel:_l(i),tabindex:d}}getDateConstraints(){return{earliest:this.earliest,latest:this.latest,excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}}isDayDisabled(t,e){return Pl(t,e,this.getDateConstraints(),{multiple:this.multiple,maxMultiple:this.maxMultiple,selectedCount:this.selected.length})}calculateTabIndex(t,e,i){return this.focusedDate?this.focusedDate===t&&!e?"0":"-1":!e&&this.tabIndexSet===0?(this.tabIndexSet=i,"0"):this.tabIndexSet===i?"0":"-1"}getDayCellClasses(t){const{currentDateISO:e,isToday:i,isSelected:n}=t,a=this.range&&(this.selected.length===2||this.rangeHovered!==null)&&e===this.selected[0],r=this.range&&this.selected.length===2&&e===this.selected[1];return{"pkt-cal-today":i,"pkt-cal-selected":n,"pkt-cal-in-range":this.inRange[e],"pkt-cal-excluded":this.isExcluded(t.currentDate),"pkt-cal-in-range-first":a,"pkt-cal-in-range-last":r,"pkt-cal-range-hover":this.rangeHovered!==null&&e===bt(this.rangeHovered)}}getDayButtonClasses(t){const{currentDateISO:e,isToday:i,isSelected:n,isDisabled:a}=t,r=this.range&&(this.selected.length===2||this.rangeHovered!==null)&&e===this.selected[0],h=this.range&&this.selected.length===2&&e===this.selected[1];return{"pkt-calendar__date":!0,"pkt-calendar__date--today":i,"pkt-calendar__date--selected":n,"pkt-calendar__date--disabled":a,"pkt-calendar__date--in-range":this.inRange[e],"pkt-calendar__date--in-range-hover":this.rangeHovered!==null&&e===bt(this.rangeHovered),"pkt-calendar__date--range-start":r,"pkt-calendar__date--range-end":h}}handleDayFocus(t,e){this.range&&!this.isExcluded(t)&&this.handleRangeHover(t),this.focusedDate=e}renderDayView(t,e){const i=this.getDayViewData(t,e),{currentDate:n,currentDateISO:a,isSelected:r,isDisabled:h,ariaLabel:d,tabindex:p}=i;this.selectableDates.push({currentDateISO:a,isDisabled:h,tabindex:p});const m=this.getDayCellClasses(i),v=this.getDayButtonClasses(i);return u`<td class=${N(m)}>
|
|
271
271
|
<button
|
|
272
272
|
type="button"
|
|
273
273
|
aria-pressed=${r?"true":"false"}
|
|
@@ -291,7 +291,7 @@
|
|
|
291
291
|
>
|
|
292
292
|
<span class="pkt-btn__text pkt-txt-14-light">${t}</span>
|
|
293
293
|
</div>
|
|
294
|
-
</td>`}renderWeekRow(t){return u`<tr class="pkt-cal-week-row" role="row">${t}</tr>`}renderCalendarBody(){const t
|
|
294
|
+
</td>`}renderWeekRow(t){return u`<tr class="pkt-cal-week-row" role="row">${t}</tr>`}renderCalendarBody(){const t=$l(),e=Bl(this.year,this.month);let i=1;this.week=e.initialWeek;const n=[];for(let a=0;a<e.numRows;a++){const r=[];this.weeknumbers&&r.push(u`<td class="pkt-cal-week">${this.week}</td>`),this.week++;for(let h=0;h<qs;h++){const d=Fl(a,h,i,e);if(d==="current-month")r.push(this.renderDayView(i,t)),i++;else{const p=Vl(d,h,i,e);r.push(this.renderEmptyDayCell(p)),d==="next-month"&&i++}}n.push(this.renderWeekRow(r))}return n}isExcluded(t){return ca(t,this.getDateConstraints())}isPrevMonthAllowed(){return Dl(this.year,this.month,this.earliest)}prevMonth(){const t=this.month===0?11:this.month-1,e=this.month===0?this.year-1:this.year;this.changeMonth(e,t)}isNextMonthAllowed(){return Il(this.year,this.month,this.latest)}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=Us(new Date(this.year,this.month,1)),this.tabIndexSet=0,this.focusedDate=null,this.selectableDates=[]}emptySelected(){this.selected=[],this._selected=[],this.inRange={}}normalizeSelected(){return typeof this.selected=="string"?this.selected.split(","):this.selected}addToSelected(t){this.selected=qi(t,this.normalizeSelected()),this._selected=us(this.selected),this.range&&this.selected.length===2&&(this.convertSelected(),this.close())}removeFromSelected(t){this.selected=Wi(t,this.normalizeSelected()),this._selected=us(this.selected)}toggleSelected(t){this.selected=Hl(t,this.normalizeSelected(),this.maxMultiple),this._selected=us(this.selected)}isRangeAllowed(t){return ua(t,this._selected,this.excludedates,this.excludeweekdays)}handleRangeSelect(t){return this.selected=jl(t,this.normalizeSelected(),{excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}),this._selected=us(this.selected),this.selected.length===2?this.convertSelected():this.selected.length===1&&(this.inRange={}),Promise.resolve()}handleRangeHover(t){if(!this.range||this._selected.length!==1||!this.isRangeAllowed(t)||this._selected[0]>=t){this.rangeHovered=null;return}this.rangeHovered=t,this.inRange=da(this._selected[0],t)}handleDateSelect(t){return t&&(this.range?this.handleRangeSelect(t):this.multiple?this.toggleSelected(t):(this.selected.includes(bt(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=bt(Us(new Date)),e=this.querySelector(`button[data-date="${t}"]`);if(e instanceof HTMLButtonElement){this.focusedDate=t,e.focus();return}const i=this.selectableDates.find(n=>!n.isDisabled);if(i){const n=this.querySelector(`button[data-date="${i.currentDateISO}"]`);n instanceof HTMLButtonElement&&(this.focusedDate=i.currentDateISO,n.focus())}}closeEvent(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}))}};X([o({converter:ds.csvToArray})],G.prototype,"selected",2),X([o({type:Boolean})],G.prototype,"multiple",2),X([o({type:Number})],G.prototype,"maxMultiple",2),X([o({type:Boolean})],G.prototype,"range",2),X([o({type:String})],G.prototype,"earliest",2),X([o({type:String})],G.prototype,"latest",2),X([o({converter:ds.stringsToDate})],G.prototype,"excludedates",2),X([o({converter:ds.csvToArray})],G.prototype,"excludeweekdays",2),X([o({type:Boolean})],G.prototype,"weeknumbers",2),X([o({type:Boolean})],G.prototype,"withcontrols",2),X([o({converter:ds.stringToDate})],G.prototype,"currentmonth",2),X([o({type:Array})],G.prototype,"dayStrings",2),X([o({type:Array})],G.prototype,"dayStringsLong",2),X([o({type:Array})],G.prototype,"monthStrings",2),X([o({type:String})],G.prototype,"weekString",2),X([o({type:String})],G.prototype,"prevMonthString",2),X([o({type:String})],G.prototype,"nextMonthString",2),X([o({type:Array})],G.prototype,"_selected",2),X([L()],G.prototype,"inRange",2),X([o({type:Date})],G.prototype,"rangeHovered",2),X([o({type:Number})],G.prototype,"year",2),X([o({type:Number})],G.prototype,"month",2),X([o({type:Number})],G.prototype,"week",2),X([L()],G.prototype,"currentmonthtouched",2),X([L()],G.prototype,"focusedDate",2),X([L()],G.prototype,"selectableDates",2),X([L()],G.prototype,"tabIndexSet",2),G=X([H("pkt-calendar")],G);const Yl={size:{default:"medium"},skin:{default:"blue"},closeTag:{default:!1},type:{default:"button"}},ki={props:Yl};var Gl=Object.defineProperty,Zl=Object.getOwnPropertyDescriptor,he=(s,t,e,i)=>{for(var n=i>1?void 0:i?Zl(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&&Gl(t,e,n),n};let ee=class extends J{constructor(){super(),this.defaultSlot=A(),this.closeTag=ki.props.closeTag.default,this.size=ki.props.size.default,this.skin=ki.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=ki.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 ot(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?u`
|
|
295
295
|
<button
|
|
296
296
|
class=${N(e)}
|
|
297
297
|
type=${this.type}
|
|
@@ -304,7 +304,7 @@
|
|
|
304
304
|
name=${this.iconName}
|
|
305
305
|
aria-hidden="true"
|
|
306
306
|
></pkt-icon>`}
|
|
307
|
-
<span ${
|
|
307
|
+
<span ${O(this.defaultSlot)}></span>
|
|
308
308
|
<pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
|
|
309
309
|
</button>
|
|
310
310
|
`:u`
|
|
@@ -314,9 +314,9 @@
|
|
|
314
314
|
name=${this.iconName}
|
|
315
315
|
aria-hidden="true"
|
|
316
316
|
></pkt-icon>`}
|
|
317
|
-
<span ${
|
|
317
|
+
<span ${O(this.defaultSlot)}></span>
|
|
318
318
|
</span>
|
|
319
|
-
`}};he([o({type:Boolean,reflect:!0})],ee.prototype,"closeTag",2),he([o({type:String,reflect:!0})],ee.prototype,"size",2),he([o({type:String,reflect:!0})],ee.prototype,"skin",2),he([o({type:String,reflect:!0})],ee.prototype,"textStyle",2),he([o({type:String,reflect:!0})],ee.prototype,"iconName",2),he([o({type:String})],ee.prototype,"type",2),he([o({type:String})],ee.prototype,"ariaLabel",2),he([L()],ee.prototype,"_isClosed",2),he([L()],ee.prototype,"_ariaDescription",2),ee=he([
|
|
319
|
+
`}};he([o({type:Boolean,reflect:!0})],ee.prototype,"closeTag",2),he([o({type:String,reflect:!0})],ee.prototype,"size",2),he([o({type:String,reflect:!0})],ee.prototype,"skin",2),he([o({type:String,reflect:!0})],ee.prototype,"textStyle",2),he([o({type:String,reflect:!0})],ee.prototype,"iconName",2),he([o({type:String})],ee.prototype,"type",2),he([o({type:String})],ee.prototype,"ariaLabel",2),he([L()],ee.prototype,"_isClosed",2),he([L()],ee.prototype,"_ariaDescription",2),ee=he([H("pkt-tag")],ee);var Xl=Object.defineProperty,Jl=Object.getOwnPropertyDescriptor,ps=(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&&Xl(t,e,n),n};let Me=class extends ci{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 u`<slot></slot>`}};ps([o({type:String,reflect:!0})],Me.prototype,"size",2),ps([o({type:Number,reflect:!0})],Me.prototype,"level",2),ps([o({type:String,reflect:!0})],Me.prototype,"weight",2),ps([o({type:Boolean,reflect:!0})],Me.prototype,"visuallyHidden",2),ps([o({type:String,reflect:!0})],Me.prototype,"align",2),Me=ps([H("pkt-heading")],Me);const Ql={layout:{default:"vertical"},skin:{type:["outlined","outlined-beige","gray","blue","beige","green"],default:"outlined"},padding:{default:"default"}},fs={props:Ql};var th=Object.defineProperty,eh=Object.getOwnPropertyDescriptor,kt=(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 pt=class extends J{constructor(){super(),this.defaultSlot=A(),this.ariaLabel="",this.metaLead=null,this.borderOnHover=!0,this.clickCardLink=null,this.metaTrail=null,this.layout=fs.props.layout.default,this.heading="",this.headinglevel=3,this.image={src:"",alt:""},this.imageShape="square",this.openLinkInNewTab=!1,this.padding=fs.props.padding.default,this.skin=fs.props.skin.default,this.subheading="",this.tagPosition="top",this.tags=[],this.slotController=new ot(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 u`
|
|
320
320
|
<article
|
|
321
321
|
class=${N(i)}
|
|
322
322
|
aria-label=${C(this.clickCardLink?n:a)}
|
|
@@ -396,7 +396,7 @@
|
|
|
396
396
|
</div>
|
|
397
397
|
`:k}
|
|
398
398
|
`}renderSlot(){return u`
|
|
399
|
-
${this.defaultSlot&&u`<section class="pkt-card__content" ${
|
|
399
|
+
${this.defaultSlot&&u`<section class="pkt-card__content" ${O(this.defaultSlot)}></section>`}
|
|
400
400
|
`}renderMetadata(){return u`
|
|
401
401
|
${this.metaLead||this.metaTrail?u`
|
|
402
402
|
<footer class="pkt-card__metadata">
|
|
@@ -404,11 +404,11 @@
|
|
|
404
404
|
${this.metaTrail?u`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>`:k}
|
|
405
405
|
</footer>
|
|
406
406
|
`:k}
|
|
407
|
-
`}};kt([o({type:String})],
|
|
407
|
+
`}};kt([o({type:String})],pt.prototype,"ariaLabel",2),kt([o({type:String})],pt.prototype,"metaLead",2),kt([o({type:Boolean})],pt.prototype,"borderOnHover",2),kt([o({type:String,reflect:!0})],pt.prototype,"clickCardLink",2),kt([o({type:String})],pt.prototype,"metaTrail",2),kt([o({type:String})],pt.prototype,"layout",2),kt([o({type:String})],pt.prototype,"heading",2),kt([o({type:Number})],pt.prototype,"headinglevel",2),kt([o({type:Object})],pt.prototype,"image",2),kt([o({type:String})],pt.prototype,"imageShape",2),kt([o({type:Boolean})],pt.prototype,"openLinkInNewTab",2),kt([o({type:String})],pt.prototype,"padding",2),kt([o({type:String,converter:{fromAttribute:s=>{const t=fs.props.skin.type;return s&&t.includes(s)?s:(s&&!t.includes(s)&&console.warn(`Invalid skin value "${s}". Using default skin "${fs.props.skin.default}".`),fs.props.skin.default)},toAttribute:s=>s}})],pt.prototype,"skin",2),kt([o({type:String})],pt.prototype,"subheading",2),kt([o({type:String})],pt.prototype,"tagPosition",2),kt([o({type:Array})],pt.prototype,"tags",2),pt=kt([H("pkt-card")],pt);/**
|
|
408
408
|
* @license
|
|
409
409
|
* Copyright 2017 Google LLC
|
|
410
410
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
411
|
-
*/const ga=(s,t,e)=>{const i=new Map;for(let n=t;n<=e;n++)i.set(s[n],n);return i},Ki=Fe(class extends rs{constructor(s){if(super(s),s.type!==Qt.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=Vr(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 p,m,v=0,y=n.length-1,$=0,b=a.length-1;for(;v<=y&&$<=b;)if(n[v]===null)v++;else if(n[y]===null)y--;else if(h[v]===r[$])d[$]=Ve(n[v],a[$]),v++,$++;else if(h[y]===r[b])d[b]=Ve(n[y],a[b]),y--,b--;else if(h[v]===r[b])d[b]=Ve(n[v],a[b]),Ds(s,d[b+1],n[v]),v++,b--;else if(h[y]===r[$])d[$]=Ve(n[y],a[$]),Ds(s,n[v],n[y]),y--,$++;else if(p===void 0&&(p=ga(r,$,b),m=ga(h,v,y)),p.has(h[v]))if(p.has(h[y])){const x=m.get(r[$]),T=x!==void 0?n[x]:null;if(T===null){const O=Ds(s,n[v]);Ve(O,a[$]),d[$]=O}else d[$]=Ve(T,a[$]),Ds(s,n[v],T),n[x]=null;$++}else Bi(n[y]),y--;else Bi(n[v]),v++;for(;$<=b;){const x=Ds(s,d[b+1]);Ve(x,a[$]),d[$++]=x}for(;v<=y;){const x=n[v++];x!==null&&Bi(x)}return this.ut=r,Vn(s,d),Et}}),ma=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),Xl=s=>new Promise(t=>setTimeout(t,s)),Ae=()=>{const s=ma(),t=ma();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+t.slice(1,4)+"-"+t.slice(4)},Mt={fromAttribute(s){return s==null?!1:s===""||s==="true"||s===!0?!0:s==="false"||s===!1?!1:!!s},toAttribute(s){return s?"true":"false"}},Jl={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}},Ft={props:Jl};var Ql={},va;function th(){return va||(va=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,p=new WeakMap,m=new WeakMap,v=new WeakMap,y=new WeakMap,$=new WeakMap,b=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"},O=(g,c)=>{for(let f in T){c[f]=null;let _=null;const D=T[f];Object.defineProperty(c,f,{get(){return _},set(V){_=V,g.isConnected?gt(g,D,V):m.set(g,c)}})}};function S(g){const c=n.get(g),{form:f}=c;ae(g,f,c),Pt(g,c.labels)}const B=(g,c=!1)=>{const f=document.createTreeWalker(g,NodeFilter.SHOW_ELEMENT,{acceptNode(V){return n.has(V)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let _=f.nextNode();const D=!c||g.disabled;for(;_;)_.formDisabledCallback&&D&&Ut(_,g.disabled),_=f.nextNode()},A={attributes:!0,attributeFilter:["disabled","name"]},R=re()?new MutationObserver(g=>{for(const c of g){const f=c.target;if(c.attributeName==="disabled"&&(f.constructor.formAssociated?Ut(f,f.hasAttribute("disabled")):f.localName==="fieldset"&&B(f)),c.attributeName==="name"&&f.constructor.formAssociated){const _=n.get(f),D=p.get(f);_.setFormValue(D)}}}):{};function et(g){g.forEach(c=>{const{addedNodes:f,removedNodes:_}=c,D=Array.from(f),V=Array.from(_);D.forEach(H=>{var qt;if(n.has(H)&&H.constructor.formAssociated&&S(H),m.has(H)){const wt=m.get(H);Object.keys(T).filter(Wt=>wt[Wt]!==null).forEach(Wt=>{gt(H,T[Wt],wt[Wt])}),m.delete(H)}if(x.has(H)){const wt=x.get(H);gt(H,"internals-valid",wt.validity.valid.toString()),gt(H,"internals-invalid",(!wt.validity.valid).toString()),gt(H,"aria-invalid",(!wt.validity.valid).toString()),x.delete(H)}if(H.localName==="form"){const wt=d.get(H),Wt=document.createTreeWalker(H,NodeFilter.SHOW_ELEMENT,{acceptNode(dn){return n.has(dn)&&dn.constructor.formAssociated&&!(wt&&wt.has(dn))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let ii=Wt.nextNode();for(;ii;)S(ii),ii=Wt.nextNode()}H.localName==="fieldset"&&((qt=R.observe)===null||qt===void 0||qt.call(R,H,A),B(H,!0))}),V.forEach(H=>{const qt=n.get(H);qt&&i.get(qt)&&Yt(qt),h.has(H)&&h.get(H).disconnect()})})}function Tt(g){g.forEach(c=>{const{removedNodes:f}=c;f.forEach(_=>{const D=$.get(c.target);n.has(_)&&we(_),D.disconnect()})})}const Nt=g=>{var c,f;const _=new MutationObserver(Tt);!((c=window==null?void 0:window.ShadyDOM)===null||c===void 0)&&c.inUse&&g.mode&&g.host&&(g=g.host),(f=_.observe)===null||f===void 0||f.call(_,g,{childList:!0}),$.set(g,_)};re()&&new MutationObserver(et);const nt={childList:!0,subtree:!0},gt=(g,c,f)=>{g.getAttribute(c)!==f&&g.setAttribute(c,f)},Ut=(g,c)=>{g.toggleAttribute("internals-disabled",c),c?gt(g,"aria-disabled","true"):g.removeAttribute("aria-disabled"),g.formDisabledCallback&&g.formDisabledCallback.apply(g,[c])},Yt=g=>{i.get(g).forEach(c=>{c.remove()}),i.set(g,[])},mt=(g,c)=>{const f=document.createElement("input");return f.type="hidden",f.name=g.getAttribute("name"),g.after(f),i.get(c).push(f),f},$e=(g,c)=>{var f;i.set(c,[]),(f=R.observe)===null||f===void 0||f.call(R,g,A)},Pt=(g,c)=>{if(c.length){Array.from(c).forEach(_=>_.addEventListener("click",g.click.bind(g)));let f=c[0].id;c[0].id||(f=`${c[0].htmlFor}_Label`,c[0].id=f),gt(g,"aria-labelledby",f)}},Dt=g=>{const c=Array.from(g.elements).filter(V=>!V.tagName.includes("-")&&V.validity).map(V=>V.validity.valid),f=d.get(g)||[],_=Array.from(f).filter(V=>V.isConnected).map(V=>n.get(V).validity.valid),D=[...c,..._].includes(!1);g.toggleAttribute("internals-invalid",D),g.toggleAttribute("internals-valid",!D)},zt=g=>{Dt(Lt(g.target))},Gt=g=>{Dt(Lt(g.target))},z=g=>{const c=["button[type=submit]","input[type=submit]","button:not([type])"].map(f=>`${f}:not([disabled])`).map(f=>`${f}:not([form])${g.id?`,${f}[form='${g.id}']`:""}`).join(",");g.addEventListener("click",f=>{if(f.target.closest(c)){const _=d.get(g);if(g.noValidate)return;_.size&&Array.from(_).reverse().map(D=>n.get(D).reportValidity()).includes(!1)&&f.preventDefault()}})},It=g=>{const c=d.get(g.target);c&&c.size&&c.forEach(f=>{f.constructor.formAssociated&&f.formResetCallback&&f.formResetCallback.apply(f)})},ae=(g,c,f)=>{if(c){const _=d.get(c);if(_)_.add(g);else{const D=new Set;D.add(g),d.set(c,D),z(c),c.addEventListener("reset",It),c.addEventListener("input",zt),c.addEventListener("change",Gt)}r.set(c,{ref:g,internals:f}),g.constructor.formAssociated&&g.formAssociatedCallback&&setTimeout(()=>{g.formAssociatedCallback.apply(g,[c])},0),Dt(c)}},Lt=g=>{let c=g.parentNode;return c&&c.tagName!=="FORM"&&(c=Lt(c)),c},rt=(g,c,f=DOMException)=>{if(!g.constructor.formAssociated)throw new f(c)},_e=(g,c,f)=>{const _=d.get(g);return _&&_.size&&_.forEach(D=>{n.get(D)[f]()||(c=!1)}),c},we=g=>{if(g.constructor.formAssociated){const c=n.get(g),{labels:f,form:_}=c;Pt(g,f),ae(g,_,c)}};function re(){return typeof MutationObserver<"u"}class ei{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 ws=g=>(g.badInput=!1,g.customError=!1,g.patternMismatch=!1,g.rangeOverflow=!1,g.rangeUnderflow=!1,g.stepMismatch=!1,g.tooLong=!1,g.tooShort=!1,g.typeMismatch=!1,g.valid=!0,g.valueMissing=!1,g),xs=(g,c,f)=>(g.valid=Qe(c),Object.keys(c).forEach(_=>g[_]=c[_]),f&&Dt(f),g),Qe=g=>{let c=!0;for(let f in g)f!=="valid"&&g[f]!==!1&&(c=!1);return c},fe=new WeakMap;function ge(g,c){g.toggleAttribute(c,!0),g.part&&g.part.add(c)}class De extends Set{static get isPolyfilled(){return!0}constructor(c){if(super(),!c||!c.tagName||c.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");fe.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 f=super.add(c),_=fe.get(this),D=`state${c}`;return _.isConnected?ge(_,D):setTimeout(()=>{ge(_,D)}),f}clear(){for(let[c]of this.entries())this.delete(c);super.clear()}delete(c){const f=super.delete(c),_=fe.get(this);return _.isConnected?(_.toggleAttribute(`state${c}`,!1),_.part&&_.part.remove(`state${c}`)):setTimeout(()=>{_.toggleAttribute(`state${c}`,!1),_.part&&_.part.remove(`state${c}`)}),f}}function ts(g,c,f,_){if(typeof c=="function"?g!==c||!_:!c.has(g))throw new TypeError("Cannot read private member from an object whose class did not declare it");return f==="m"?_:f==="a"?_.call(g):_?_.value:c.get(g)}function xe(g,c,f,_,D){if(typeof c=="function"?g!==c||!0:!c.has(g))throw new TypeError("Cannot write private member to an object whose class did not declare it");return c.set(g,f),f}var Zt;class es{constructor(c){Zt.set(this,void 0),xe(this,Zt,c);for(let f=0;f<c.length;f++){let _=c[f];this[f]=_,_.hasAttribute("name")&&(this[_.getAttribute("name")]=_)}Object.freeze(this)}get length(){return ts(this,Zt,"f").length}[(Zt=new WeakMap,Symbol.iterator)](){return ts(this,Zt,"f")[Symbol.iterator]()}item(c){return this[c]==null?null:this[c]}namedItem(c){return this[c]==null?null:this[c]}}function _t(){const g=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=f;const c=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=_;function f(...V){let H=g.apply(this,V);return _e(this,H,"checkValidity")}function _(...V){let H=c.apply(this,V);return _e(this,H,"reportValidity")}const{get:D}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...V){const H=D.call(this,...V),qt=Array.from(d.get(this)||[]);if(qt.length===0)return H;const wt=Array.from(H).concat(qt).sort((Wt,ii)=>Wt.compareDocumentPosition?Wt.compareDocumentPosition(ii)&2?1:-1:0);return new es(wt)}})}class Xt{static get isPolyfilled(){return!0}constructor(c){if(!c||!c.tagName||c.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const f=c.getRootNode(),_=new ei;this.states=new De(c),t.set(this,c),e.set(this,_),n.set(c,this),O(c,this),$e(c,this),Object.seal(this),f instanceof DocumentFragment&&Nt(f)}checkValidity(){const c=t.get(this);if(rt(c,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const f=e.get(this);if(!f.valid){const _=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});c.dispatchEvent(_)}return f.valid}get form(){const c=t.get(this);rt(c,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let f;return c.constructor.formAssociated===!0&&(f=Lt(c)),f}get labels(){const c=t.get(this);rt(c,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const f=c.getAttribute("id"),_=c.getRootNode();return _&&f?_.querySelectorAll(`[for="${f}"]`):[]}reportValidity(){const c=t.get(this);if(rt(c,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const f=this.checkValidity(),_=y.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!f&&_&&(c.focus(),_.focus()),f}setFormValue(c){const f=t.get(this);if(rt(f,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),Yt(this),c!=null&&!(c instanceof FormData)){if(f.getAttribute("name")){const _=mt(f,this);_.value=c}}else c!=null&&c instanceof FormData&&Array.from(c).reverse().forEach(([_,D])=>{if(typeof D=="string"){const V=mt(f,this);V.name=_,V.value=D}});p.set(f,c)}setValidity(c,f,_){const D=t.get(this);if(rt(D,"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.");y.set(this,_);const V=e.get(this),H={};for(const Wt in c)H[Wt]=c[Wt];Object.keys(H).length===0&&ws(V);const qt=Object.assign(Object.assign({},V),H);delete qt.valid;const{valid:wt}=xs(V,qt,this.form);if(!wt&&!f)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,wt?"":f),D.isConnected?(D.toggleAttribute("internals-invalid",!wt),D.toggleAttribute("internals-valid",wt),gt(D,"aria-invalid",`${!wt}`)):x.set(D,this)}get shadowRoot(){const c=t.get(this);return v.get(c)||null}get validationMessage(){const c=t.get(this);return rt(c,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),a.get(this)}get validity(){const c=t.get(this);return rt(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 rt(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 cn(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class g 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,g);const f=new g;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(_=>_ in f.internals)}let Ss=!1,si=!1;function Cs(g){si||(si=!0,window.CustomStateSet=De,g&&(HTMLElement.prototype.attachInternals=function(...c){const f=g.call(this,c);return f.states=new De(this),f}))}function Ts(g=!0){if(!Ss){if(Ss=!0,typeof window<"u"&&(window.ElementInternals=Xt),typeof CustomElementRegistry<"u"){const c=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(f,_,D){if(_.formAssociated){const V=_.prototype.connectedCallback;_.prototype.connectedCallback=function(){b.has(this)||(b.set(this,!0),this.hasAttribute("disabled")&&Ut(this,!0)),V!=null&&V.apply(this),we(this)}}c.call(this,f,_,D)}}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 Xt(this)}),typeof Element<"u"){let c=function(..._){const D=f.apply(this,_);if(v.set(this,D),re()){const V=new MutationObserver(et);window.ShadyDOM?V.observe(this,nt):V.observe(D,nt),h.set(this,V)}return D};const f=Element.prototype.attachShadow;Element.prototype.attachShadow=c}re()&&typeof document<"u"&&new MutationObserver(et).observe(document.documentElement,nt),typeof HTMLFormElement<"u"&&_t(),(g||typeof window<"u"&&!window.CustomStateSet)&&Cs()}}return customElements.polyfillWrapFlushCallback||(cn()?typeof window<"u"&&!window.CustomStateSet&&Cs(HTMLElement.prototype.attachInternals):Ts(!1)),s.forceCustomStateSetPolyfill=Cs,s.forceElementInternalsPolyfill=Ts,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})()),Ql}th();var eh=Object.defineProperty,F=(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&&eh(t,e,n),n};const ba="on",Yi="--checked",_i=",";let I=class extends X{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=Ae(),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=Ft.props.helptextDropdownButton.default,this.label=null,this.optionalText=Ct.forms.labels.optional,this.requiredText=Ct.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,p,m,v,y;if(!t){console.warn("manageValidity called without valid input element");return}this.required&&!this.value?this.internals.setValidity({valueMissing:!0},Ct.forms.messages.required,t):(e=t.validity)!=null&&e.typeMismatch||(i=t.validity)!=null&&i.badInput?this.internals.setValidity({typeMismatch:!0},Ct.forms.messages.invalid,t):(n=t.validity)!=null&&n.patternMismatch?this.internals.setValidity({patternMismatch:!0},Ct.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},Ct.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},Ct.forms.messages.tooLong,t):(h=t.validity)!=null&&h.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?Ct.forms.messages.rangeUnderflowMin.replace("{min}",(d=this.min)==null?void 0:d.toString()):Ct.forms.messages.rangeUnderflow,t):(p=t.validity)!=null&&p.stepMismatch?this.internals.setValidity({stepMismatch:!0},Ct.forms.messages.invalid,t):(m=t.validity)!=null&&m.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?Ct.forms.messages.rangeOverflowMax.replace("{max}",(v=this.max)==null?void 0:v.toString()):Ct.forms.messages.rangeOverflow,t):(y=t.validity)!=null&&y.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)}coordinateRadioGroup(){if(!this.form||!this.name||this.type!=="radio")return;const t=`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`;this.form.querySelectorAll(t).forEach(e=>{var i;if(e!==this&&e.getAttribute("name")===this.name&&e.getAttribute("value")!==this.value){const n=e;n.checked&&(n.checked=!1,n.internals&&(n.internals.setFormValue(null),(i=n.internals.states)==null||i.delete(Yi)))}})}valueChecked(t){if(!this.touched)return;const e=this.internals.form||this.closest("form"),i=e?new FormData(e):null;if(this.type==="radio"&&this.coordinateRadioGroup(),typeof t=="string"?(this.checked=t==="true",this.internals.ariaChecked=String(t==="true")):typeof t=="boolean"&&(this.checked=t,this.internals.ariaChecked=String(t)),this.checked){const n=(typeof this.value=="string"?this.value:"")||ba;this.internals.setFormValue(n),i&&i.append(this.name,n),this.internals.states.add(Yi)}else this.internals.setFormValue(null),i&&i.delete(this.name),this.internals.states.delete(Yi);this.dispatchChangeEvents(this.checked),this.internals.reportValidity()}valueChanged(t,e){(e!==this.value||e!==this._value)&&(typeof t=="string"?((this.multiple||this.range)&&t.includes(_i)&&(t=t.split(_i)),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()))}dispatchChangeEvents(t){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0}))}clearInputValue(){const t=this.multiple||this.range?[]:"";this.value=t,this.setFormValue(t),this.dispatchChangeEvents(t)}onFocus(){this.dispatchEvent(new FocusEvent("focus",{bubbles:!0,composed:!0}))}onBlur(){this.dispatchEvent(new FocusEvent("blur",{bubbles:!0,composed:!0}))}onInput(){this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}normalizeValue(t){return(this.range||this.multiple)&&typeof t=="string"&&t.includes(_i)?t.split(_i):!this.multiple&&!this.range&&Array.isArray(t)?t[0]||"":t}validate(){var t,e;(t=this.inputRef)!=null&&t.value&&this.manageValidity(this.inputRef.value),(e=this.inputRefTo)!=null&&e.value&&this.manageValidity(this.inputRefTo.value)}onChange(t){if(!this.touched){this.touched=!0,t&&this.setFormValue(t);return}if(typeof t!="string"&&!Array.isArray(t))return;const e=this.normalizeValue(t);this.setFormValue(e),this.validate(),this.dispatchChangeEvents(e)}formResetCallback(){var t;if(this.touched=!1,this._options&&this._options.length&&this._options.forEach(e=>{"selected"in e&&(e.selected=!1)}),this.checked!==void 0)this.checked=!1,this.internals.ariaChecked="false",this.internals.setFormValue(""),(t=this.inputRef)!=null&&t.value&&"checked"in this.inputRef.value&&(this.inputRef.value.checked=!1),this.valueChecked(this.checked);else{this.internals.setFormValue("");const e=this.defaultValue||(this.multiple||this.range?[]:"");this.value=e,this._value=Array.isArray(e)?e:[e],this.valueChanged(this.value,null)}this.internals.ariaInvalid="false"}updated(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="true",this.checked=!0),this.required&&(this.internals.ariaRequired="true"),this.disabled&&(this.internals.ariaDisabled="true"),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const e=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=String(e);const i=e?(typeof this.value=="string"?this.value:"")||ba:null;this.internals.setFormValue(i)}else this.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute("form",""),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute("form",""),this.manageValidity(this.inputRefTo.value))}};F([o({type:Boolean,reflect:!0})],I.prototype,"checked"),F([o({type:Boolean})],I.prototype,"defaultChecked"),F([o({type:Boolean})],I.prototype,"multiple"),F([o({type:Boolean})],I.prototype,"range"),F([o({type:String,reflect:!0})],I.prototype,"type"),F([o()],I.prototype,"defaultValue"),F([o({type:Boolean,reflect:!0})],I.prototype,"disabled"),F([o({type:Boolean,reflect:!0})],I.prototype,"readonly"),F([o({type:Boolean,reflect:!0})],I.prototype,"required"),F([o({reflect:!0,converter:{fromAttribute:s=>s,toAttribute:s=>(s==null?void 0:s.toString())??null}})],I.prototype,"max"),F([o({type:Number,reflect:!0})],I.prototype,"maxlength"),F([o({reflect:!0,converter:{fromAttribute:s=>s,toAttribute:s=>(s==null?void 0:s.toString())??null}})],I.prototype,"min"),F([o({type:Number,reflect:!0})],I.prototype,"minlength"),F([o({type:Number,reflect:!0})],I.prototype,"step"),F([o({type:String})],I.prototype,"ariaDescribedBy"),F([o({type:String})],I.prototype,"ariaLabelledby"),F([o({type:String,reflect:!0})],I.prototype,"name"),F([o({type:String,reflect:!0})],I.prototype,"pattern"),F([o({type:String,reflect:!0})],I.prototype,"placeholder"),F([o({type:String,reflect:!0})],I.prototype,"id"),F([o({type:Boolean})],I.prototype,"counter"),F([o({type:Boolean})],I.prototype,"hasError"),F([o({type:Boolean})],I.prototype,"inline"),F([o({type:Boolean})],I.prototype,"hasFieldset"),F([o({type:Boolean})],I.prototype,"optionalTag"),F([o({type:Boolean})],I.prototype,"requiredTag"),F([o({type:Boolean})],I.prototype,"skipForwardTestid"),F([o({type:Boolean,reflect:!0,converter:Mt})],I.prototype,"useWrapper"),F([o({type:Boolean,reflect:!0})],I.prototype,"fullwidth"),F([o({type:Number})],I.prototype,"counterMaxLength"),F([o({type:String})],I.prototype,"errorMessage"),F([o({type:String})],I.prototype,"helptext"),F([o({type:String})],I.prototype,"helptextDropdown"),F([o({type:String,reflect:!1})],I.prototype,"helptextDropdownButton"),F([o({type:String})],I.prototype,"label"),F([o({type:String,reflect:!1})],I.prototype,"optionalText"),F([o({type:String,reflect:!1})],I.prototype,"requiredText"),F([o({type:String,reflect:!1})],I.prototype,"tagText"),F([o({type:String,attribute:"data-testid"})],I.prototype,"dataTestid"),F([L()],I.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.createOptions(),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.requestUpdate()}handleMutations(t){let e=!1;t.forEach(i=>{i.type==="childList"&&(i.addedNodes.forEach(n=>{os(n)&&(this.addNode(n),e=!0)}),i.removedNodes.forEach(n=>{os(n)&&(this.nodes=this.nodes.filter(a=>a!==n),e=!0)})),i.type==="attributes"&&os(i.target)&&(this.addNode(i.target),e=!0)}),e&&this.createOptions()}};var sh=Object.defineProperty,ih=Object.getOwnPropertyDescriptor,Re=(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 ve=class extends X{constructor(){super(),this.defaultSlot=E(),this.forId=Ae(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=Ft.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new ot(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=N({"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">
|
|
411
|
+
*/const pa=(s,t,e)=>{const i=new Map;for(let n=t;n<=e;n++)i.set(s[n],n);return i},Ri=Fe(class extends rs{constructor(s){if(super(s),s.type!==Qt.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=zr(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 p,m,v=0,y=n.length-1,$=0,b=a.length-1;for(;v<=y&&$<=b;)if(n[v]===null)v++;else if(n[y]===null)y--;else if(h[v]===r[$])d[$]=Ve(n[v],a[$]),v++,$++;else if(h[y]===r[b])d[b]=Ve(n[y],a[b]),y--,b--;else if(h[v]===r[b])d[b]=Ve(n[v],a[b]),Ps(s,d[b+1],n[v]),v++,b--;else if(h[y]===r[$])d[$]=Ve(n[y],a[$]),Ps(s,n[v],n[y]),y--,$++;else if(p===void 0&&(p=pa(r,$,b),m=pa(h,v,y)),p.has(h[v]))if(p.has(h[y])){const x=m.get(r[$]),T=x!==void 0?n[x]:null;if(T===null){const M=Ps(s,n[v]);Ve(M,a[$]),d[$]=M}else d[$]=Ve(T,a[$]),Ps(s,n[v],T),n[x]=null;$++}else Li(n[y]),y--;else Li(n[v]),v++;for(;$<=b;){const x=Ps(s,d[b+1]);Ve(x,a[$]),d[$++]=x}for(;v<=y;){const x=n[v++];x!==null&&Li(x)}return this.ut=r,Fn(s,d),Et}}),fa=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),sh=s=>new Promise(t=>setTimeout(t,s)),Ae=()=>{const s=fa(),t=fa();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+t.slice(1,4)+"-"+t.slice(4)},At={fromAttribute(s){return s==null?!1:s===""||s==="true"||s===!0?!0:s==="false"||s===!1?!1:!!s},toAttribute(s){return s?"true":"false"}},ih={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}},Ft={props:ih};var nh={},ga;function ah(){return ga||(ga=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,p=new WeakMap,m=new WeakMap,v=new WeakMap,y=new WeakMap,$=new WeakMap,b=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"},M=(g,c)=>{for(let f in T){c[f]=null;let _=null;const D=T[f];Object.defineProperty(c,f,{get(){return _},set(V){_=V,g.isConnected?mt(g,D,V):m.set(g,c)}})}};function S(g){const c=n.get(g),{form:f}=c;ae(g,f,c),Dt(g,c.labels)}const B=(g,c=!1)=>{const f=document.createTreeWalker(g,NodeFilter.SHOW_ELEMENT,{acceptNode(V){return n.has(V)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let _=f.nextNode();const D=!c||g.disabled;for(;_;)_.formDisabledCallback&&D&&Ut(_,g.disabled),_=f.nextNode()},E={attributes:!0,attributeFilter:["disabled","name"]},R=re()?new MutationObserver(g=>{for(const c of g){const f=c.target;if(c.attributeName==="disabled"&&(f.constructor.formAssociated?Ut(f,f.hasAttribute("disabled")):f.localName==="fieldset"&&B(f)),c.attributeName==="name"&&f.constructor.formAssociated){const _=n.get(f),D=p.get(f);_.setFormValue(D)}}}):{};function et(g){g.forEach(c=>{const{addedNodes:f,removedNodes:_}=c,D=Array.from(f),V=Array.from(_);D.forEach(j=>{var qt;if(n.has(j)&&j.constructor.formAssociated&&S(j),m.has(j)){const wt=m.get(j);Object.keys(T).filter(Wt=>wt[Wt]!==null).forEach(Wt=>{mt(j,T[Wt],wt[Wt])}),m.delete(j)}if(x.has(j)){const wt=x.get(j);mt(j,"internals-valid",wt.validity.valid.toString()),mt(j,"internals-invalid",(!wt.validity.valid).toString()),mt(j,"aria-invalid",(!wt.validity.valid).toString()),x.delete(j)}if(j.localName==="form"){const wt=d.get(j),Wt=document.createTreeWalker(j,NodeFilter.SHOW_ELEMENT,{acceptNode(cn){return n.has(cn)&&cn.constructor.formAssociated&&!(wt&&wt.has(cn))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let ei=Wt.nextNode();for(;ei;)S(ei),ei=Wt.nextNode()}j.localName==="fieldset"&&((qt=R.observe)===null||qt===void 0||qt.call(R,j,E),B(j,!0))}),V.forEach(j=>{const qt=n.get(j);qt&&i.get(qt)&&Yt(qt),h.has(j)&&h.get(j).disconnect()})})}function Ct(g){g.forEach(c=>{const{removedNodes:f}=c;f.forEach(_=>{const D=$.get(c.target);n.has(_)&&we(_),D.disconnect()})})}const Tt=g=>{var c,f;const _=new MutationObserver(Ct);!((c=window==null?void 0:window.ShadyDOM)===null||c===void 0)&&c.inUse&&g.mode&&g.host&&(g=g.host),(f=_.observe)===null||f===void 0||f.call(_,g,{childList:!0}),$.set(g,_)};re()&&new MutationObserver(et);const nt={childList:!0,subtree:!0},mt=(g,c,f)=>{g.getAttribute(c)!==f&&g.setAttribute(c,f)},Ut=(g,c)=>{g.toggleAttribute("internals-disabled",c),c?mt(g,"aria-disabled","true"):g.removeAttribute("aria-disabled"),g.formDisabledCallback&&g.formDisabledCallback.apply(g,[c])},Yt=g=>{i.get(g).forEach(c=>{c.remove()}),i.set(g,[])},dt=(g,c)=>{const f=document.createElement("input");return f.type="hidden",f.name=g.getAttribute("name"),g.after(f),i.get(c).push(f),f},$e=(g,c)=>{var f;i.set(c,[]),(f=R.observe)===null||f===void 0||f.call(R,g,E)},Dt=(g,c)=>{if(c.length){Array.from(c).forEach(_=>_.addEventListener("click",g.click.bind(g)));let f=c[0].id;c[0].id||(f=`${c[0].htmlFor}_Label`,c[0].id=f),mt(g,"aria-labelledby",f)}},It=g=>{const c=Array.from(g.elements).filter(V=>!V.tagName.includes("-")&&V.validity).map(V=>V.validity.valid),f=d.get(g)||[],_=Array.from(f).filter(V=>V.isConnected).map(V=>n.get(V).validity.valid),D=[...c,..._].includes(!1);g.toggleAttribute("internals-invalid",D),g.toggleAttribute("internals-valid",!D)},zt=g=>{It(Lt(g.target))},Gt=g=>{It(Lt(g.target))},z=g=>{const c=["button[type=submit]","input[type=submit]","button:not([type])"].map(f=>`${f}:not([disabled])`).map(f=>`${f}:not([form])${g.id?`,${f}[form='${g.id}']`:""}`).join(",");g.addEventListener("click",f=>{if(f.target.closest(c)){const _=d.get(g);if(g.noValidate)return;_.size&&Array.from(_).reverse().map(D=>n.get(D).reportValidity()).includes(!1)&&f.preventDefault()}})},Nt=g=>{const c=d.get(g.target);c&&c.size&&c.forEach(f=>{f.constructor.formAssociated&&f.formResetCallback&&f.formResetCallback.apply(f)})},ae=(g,c,f)=>{if(c){const _=d.get(c);if(_)_.add(g);else{const D=new Set;D.add(g),d.set(c,D),z(c),c.addEventListener("reset",Nt),c.addEventListener("input",zt),c.addEventListener("change",Gt)}r.set(c,{ref:g,internals:f}),g.constructor.formAssociated&&g.formAssociatedCallback&&setTimeout(()=>{g.formAssociatedCallback.apply(g,[c])},0),It(c)}},Lt=g=>{let c=g.parentNode;return c&&c.tagName!=="FORM"&&(c=Lt(c)),c},rt=(g,c,f=DOMException)=>{if(!g.constructor.formAssociated)throw new f(c)},_e=(g,c,f)=>{const _=d.get(g);return _&&_.size&&_.forEach(D=>{n.get(D)[f]()||(c=!1)}),c},we=g=>{if(g.constructor.formAssociated){const c=n.get(g),{labels:f,form:_}=c;Dt(g,f),ae(g,_,c)}};function re(){return typeof MutationObserver<"u"}class Qs{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 _s=g=>(g.badInput=!1,g.customError=!1,g.patternMismatch=!1,g.rangeOverflow=!1,g.rangeUnderflow=!1,g.stepMismatch=!1,g.tooLong=!1,g.tooShort=!1,g.typeMismatch=!1,g.valid=!0,g.valueMissing=!1,g),ws=(g,c,f)=>(g.valid=Qe(c),Object.keys(c).forEach(_=>g[_]=c[_]),f&&It(f),g),Qe=g=>{let c=!0;for(let f in g)f!=="valid"&&g[f]!==!1&&(c=!1);return c},fe=new WeakMap;function ge(g,c){g.toggleAttribute(c,!0),g.part&&g.part.add(c)}class De extends Set{static get isPolyfilled(){return!0}constructor(c){if(super(),!c||!c.tagName||c.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");fe.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 f=super.add(c),_=fe.get(this),D=`state${c}`;return _.isConnected?ge(_,D):setTimeout(()=>{ge(_,D)}),f}clear(){for(let[c]of this.entries())this.delete(c);super.clear()}delete(c){const f=super.delete(c),_=fe.get(this);return _.isConnected?(_.toggleAttribute(`state${c}`,!1),_.part&&_.part.remove(`state${c}`)):setTimeout(()=>{_.toggleAttribute(`state${c}`,!1),_.part&&_.part.remove(`state${c}`)}),f}}function ts(g,c,f,_){if(typeof c=="function"?g!==c||!_:!c.has(g))throw new TypeError("Cannot read private member from an object whose class did not declare it");return f==="m"?_:f==="a"?_.call(g):_?_.value:c.get(g)}function xe(g,c,f,_,D){if(typeof c=="function"?g!==c||!0:!c.has(g))throw new TypeError("Cannot write private member to an object whose class did not declare it");return c.set(g,f),f}var Zt;class es{constructor(c){Zt.set(this,void 0),xe(this,Zt,c);for(let f=0;f<c.length;f++){let _=c[f];this[f]=_,_.hasAttribute("name")&&(this[_.getAttribute("name")]=_)}Object.freeze(this)}get length(){return ts(this,Zt,"f").length}[(Zt=new WeakMap,Symbol.iterator)](){return ts(this,Zt,"f")[Symbol.iterator]()}item(c){return this[c]==null?null:this[c]}namedItem(c){return this[c]==null?null:this[c]}}function _t(){const g=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=f;const c=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=_;function f(...V){let j=g.apply(this,V);return _e(this,j,"checkValidity")}function _(...V){let j=c.apply(this,V);return _e(this,j,"reportValidity")}const{get:D}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...V){const j=D.call(this,...V),qt=Array.from(d.get(this)||[]);if(qt.length===0)return j;const wt=Array.from(j).concat(qt).sort((Wt,ei)=>Wt.compareDocumentPosition?Wt.compareDocumentPosition(ei)&2?1:-1:0);return new es(wt)}})}class Xt{static get isPolyfilled(){return!0}constructor(c){if(!c||!c.tagName||c.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const f=c.getRootNode(),_=new Qs;this.states=new De(c),t.set(this,c),e.set(this,_),n.set(c,this),M(c,this),$e(c,this),Object.seal(this),f instanceof DocumentFragment&&Tt(f)}checkValidity(){const c=t.get(this);if(rt(c,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const f=e.get(this);if(!f.valid){const _=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});c.dispatchEvent(_)}return f.valid}get form(){const c=t.get(this);rt(c,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let f;return c.constructor.formAssociated===!0&&(f=Lt(c)),f}get labels(){const c=t.get(this);rt(c,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const f=c.getAttribute("id"),_=c.getRootNode();return _&&f?_.querySelectorAll(`[for="${f}"]`):[]}reportValidity(){const c=t.get(this);if(rt(c,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const f=this.checkValidity(),_=y.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!f&&_&&(c.focus(),_.focus()),f}setFormValue(c){const f=t.get(this);if(rt(f,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),Yt(this),c!=null&&!(c instanceof FormData)){if(f.getAttribute("name")){const _=dt(f,this);_.value=c}}else c!=null&&c instanceof FormData&&Array.from(c).reverse().forEach(([_,D])=>{if(typeof D=="string"){const V=dt(f,this);V.name=_,V.value=D}});p.set(f,c)}setValidity(c,f,_){const D=t.get(this);if(rt(D,"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.");y.set(this,_);const V=e.get(this),j={};for(const Wt in c)j[Wt]=c[Wt];Object.keys(j).length===0&&_s(V);const qt=Object.assign(Object.assign({},V),j);delete qt.valid;const{valid:wt}=ws(V,qt,this.form);if(!wt&&!f)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,wt?"":f),D.isConnected?(D.toggleAttribute("internals-invalid",!wt),D.toggleAttribute("internals-valid",wt),mt(D,"aria-invalid",`${!wt}`)):x.set(D,this)}get shadowRoot(){const c=t.get(this);return v.get(c)||null}get validationMessage(){const c=t.get(this);return rt(c,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),a.get(this)}get validity(){const c=t.get(this);return rt(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 rt(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 hn(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class g 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,g);const f=new g;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(_=>_ in f.internals)}let xs=!1,ti=!1;function Ss(g){ti||(ti=!0,window.CustomStateSet=De,g&&(HTMLElement.prototype.attachInternals=function(...c){const f=g.call(this,c);return f.states=new De(this),f}))}function Cs(g=!0){if(!xs){if(xs=!0,typeof window<"u"&&(window.ElementInternals=Xt),typeof CustomElementRegistry<"u"){const c=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(f,_,D){if(_.formAssociated){const V=_.prototype.connectedCallback;_.prototype.connectedCallback=function(){b.has(this)||(b.set(this,!0),this.hasAttribute("disabled")&&Ut(this,!0)),V!=null&&V.apply(this),we(this)}}c.call(this,f,_,D)}}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 Xt(this)}),typeof Element<"u"){let c=function(..._){const D=f.apply(this,_);if(v.set(this,D),re()){const V=new MutationObserver(et);window.ShadyDOM?V.observe(this,nt):V.observe(D,nt),h.set(this,V)}return D};const f=Element.prototype.attachShadow;Element.prototype.attachShadow=c}re()&&typeof document<"u"&&new MutationObserver(et).observe(document.documentElement,nt),typeof HTMLFormElement<"u"&&_t(),(g||typeof window<"u"&&!window.CustomStateSet)&&Ss()}}return customElements.polyfillWrapFlushCallback||(hn()?typeof window<"u"&&!window.CustomStateSet&&Ss(HTMLElement.prototype.attachInternals):Cs(!1)),s.forceCustomStateSetPolyfill=Ss,s.forceElementInternalsPolyfill=Cs,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})()),nh}ah();var rh=Object.defineProperty,F=(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&&rh(t,e,n),n};const ma="on",Ki="--checked",yi=",";let I=class extends J{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=Ae(),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=Ft.props.helptextDropdownButton.default,this.label=null,this.optionalText=Mt.forms.labels.optional,this.requiredText=Mt.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,p,m,v,y;if(!t){console.warn("manageValidity called without valid input element");return}this.required&&!this.value?this.internals.setValidity({valueMissing:!0},Mt.forms.messages.required,t):(e=t.validity)!=null&&e.typeMismatch||(i=t.validity)!=null&&i.badInput?this.internals.setValidity({typeMismatch:!0},Mt.forms.messages.invalid,t):(n=t.validity)!=null&&n.patternMismatch?this.internals.setValidity({patternMismatch:!0},Mt.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},Mt.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},Mt.forms.messages.tooLong,t):(h=t.validity)!=null&&h.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?Mt.forms.messages.rangeUnderflowMin.replace("{min}",(d=this.min)==null?void 0:d.toString()):Mt.forms.messages.rangeUnderflow,t):(p=t.validity)!=null&&p.stepMismatch?this.internals.setValidity({stepMismatch:!0},Mt.forms.messages.invalid,t):(m=t.validity)!=null&&m.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?Mt.forms.messages.rangeOverflowMax.replace("{max}",(v=this.max)==null?void 0:v.toString()):Mt.forms.messages.rangeOverflow,t):(y=t.validity)!=null&&y.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)}coordinateRadioGroup(){if(!this.form||!this.name||this.type!=="radio")return;const t=`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`;this.form.querySelectorAll(t).forEach(e=>{var i;if(e!==this&&e.getAttribute("name")===this.name&&e.getAttribute("value")!==this.value){const n=e;n.checked&&(n.checked=!1,n.internals&&(n.internals.setFormValue(null),(i=n.internals.states)==null||i.delete(Ki)))}})}valueChecked(t){if(!this.touched)return;const e=this.internals.form||this.closest("form"),i=e?new FormData(e):null;if(this.type==="radio"&&this.coordinateRadioGroup(),typeof t=="string"?(this.checked=t==="true",this.internals.ariaChecked=String(t==="true")):typeof t=="boolean"&&(this.checked=t,this.internals.ariaChecked=String(t)),this.checked){const n=(typeof this.value=="string"?this.value:"")||ma;this.internals.setFormValue(n),i&&i.append(this.name,n),this.internals.states.add(Ki)}else this.internals.setFormValue(null),i&&i.delete(this.name),this.internals.states.delete(Ki);this.dispatchChangeEvents(this.checked),this.internals.reportValidity()}valueChanged(t,e){(e!==this.value||e!==this._value)&&(typeof t=="string"?((this.multiple||this.range)&&t.includes(yi)&&(t=t.split(yi)),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()))}dispatchChangeEvents(t){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0}))}clearInputValue(){const t=this.multiple||this.range?[]:"";this.value=t,this.setFormValue(t),this.dispatchChangeEvents(t)}onFocus(){this.dispatchEvent(new FocusEvent("focus",{bubbles:!0,composed:!0}))}onBlur(){this.dispatchEvent(new FocusEvent("blur",{bubbles:!0,composed:!0}))}onInput(){this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}normalizeValue(t){return(this.range||this.multiple)&&typeof t=="string"&&t.includes(yi)?t.split(yi):!this.multiple&&!this.range&&Array.isArray(t)?t[0]||"":t}validate(){var t,e;(t=this.inputRef)!=null&&t.value&&this.manageValidity(this.inputRef.value),(e=this.inputRefTo)!=null&&e.value&&this.manageValidity(this.inputRefTo.value)}onChange(t){if(!this.touched){this.touched=!0,t&&this.setFormValue(t);return}if(typeof t!="string"&&!Array.isArray(t))return;const e=this.normalizeValue(t);this.setFormValue(e),this.validate(),this.dispatchChangeEvents(e)}formResetCallback(){var t;if(this.touched=!1,this._options&&this._options.length&&this._options.forEach(e=>{"selected"in e&&(e.selected=!1)}),this.checked!==void 0)this.checked=!1,this.internals.ariaChecked="false",this.internals.setFormValue(""),(t=this.inputRef)!=null&&t.value&&"checked"in this.inputRef.value&&(this.inputRef.value.checked=!1),this.valueChecked(this.checked);else{this.internals.setFormValue("");const e=this.defaultValue||(this.multiple||this.range?[]:"");this.value=e,this._value=Array.isArray(e)?e:[e],this.valueChanged(this.value,null)}this.internals.ariaInvalid="false"}updated(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="true",this.checked=!0),this.required&&(this.internals.ariaRequired="true"),this.disabled&&(this.internals.ariaDisabled="true"),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const e=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=String(e);const i=e?(typeof this.value=="string"?this.value:"")||ma:null;this.internals.setFormValue(i)}else this.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute("form",""),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute("form",""),this.manageValidity(this.inputRefTo.value))}};F([o({type:Boolean,reflect:!0})],I.prototype,"checked"),F([o({type:Boolean})],I.prototype,"defaultChecked"),F([o({type:Boolean})],I.prototype,"multiple"),F([o({type:Boolean})],I.prototype,"range"),F([o({type:String,reflect:!0})],I.prototype,"type"),F([o()],I.prototype,"defaultValue"),F([o({type:Boolean,reflect:!0})],I.prototype,"disabled"),F([o({type:Boolean,reflect:!0})],I.prototype,"readonly"),F([o({type:Boolean,reflect:!0})],I.prototype,"required"),F([o({reflect:!0,converter:{fromAttribute:s=>s,toAttribute:s=>(s==null?void 0:s.toString())??null}})],I.prototype,"max"),F([o({type:Number,reflect:!0})],I.prototype,"maxlength"),F([o({reflect:!0,converter:{fromAttribute:s=>s,toAttribute:s=>(s==null?void 0:s.toString())??null}})],I.prototype,"min"),F([o({type:Number,reflect:!0})],I.prototype,"minlength"),F([o({type:Number,reflect:!0})],I.prototype,"step"),F([o({type:String})],I.prototype,"ariaDescribedBy"),F([o({type:String})],I.prototype,"ariaLabelledby"),F([o({type:String,reflect:!0})],I.prototype,"name"),F([o({type:String,reflect:!0})],I.prototype,"pattern"),F([o({type:String,reflect:!0})],I.prototype,"placeholder"),F([o({type:String,reflect:!0})],I.prototype,"id"),F([o({type:Boolean})],I.prototype,"counter"),F([o({type:Boolean})],I.prototype,"hasError"),F([o({type:Boolean})],I.prototype,"inline"),F([o({type:Boolean})],I.prototype,"hasFieldset"),F([o({type:Boolean})],I.prototype,"optionalTag"),F([o({type:Boolean})],I.prototype,"requiredTag"),F([o({type:Boolean})],I.prototype,"skipForwardTestid"),F([o({type:Boolean,reflect:!0,converter:At})],I.prototype,"useWrapper"),F([o({type:Boolean,reflect:!0})],I.prototype,"fullwidth"),F([o({type:Number})],I.prototype,"counterMaxLength"),F([o({type:String})],I.prototype,"errorMessage"),F([o({type:String})],I.prototype,"helptext"),F([o({type:String})],I.prototype,"helptextDropdown"),F([o({type:String,reflect:!1})],I.prototype,"helptextDropdownButton"),F([o({type:String})],I.prototype,"label"),F([o({type:String,reflect:!1})],I.prototype,"optionalText"),F([o({type:String,reflect:!1})],I.prototype,"requiredText"),F([o({type:String,reflect:!1})],I.prototype,"tagText"),F([o({type:String,attribute:"data-testid"})],I.prototype,"dataTestid"),F([L()],I.prototype,"touched");let va=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.createOptions(),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.requestUpdate()}handleMutations(t){let e=!1;t.forEach(i=>{i.type==="childList"&&(i.addedNodes.forEach(n=>{os(n)&&(this.addNode(n),e=!0)}),i.removedNodes.forEach(n=>{os(n)&&(this.nodes=this.nodes.filter(a=>a!==n),e=!0)})),i.type==="attributes"&&os(i.target)&&(this.addNode(i.target),e=!0)}),e&&this.createOptions()}};var oh=Object.defineProperty,lh=Object.getOwnPropertyDescriptor,Re=(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 ve=class extends J{constructor(){super(),this.defaultSlot=A(),this.forId=Ae(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=Ft.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new ot(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=N({"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">
|
|
412
412
|
<button
|
|
413
413
|
class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
|
|
414
414
|
type="button"
|
|
@@ -418,20 +418,20 @@
|
|
|
418
418
|
class="pkt-btn__icon"
|
|
419
419
|
name="${this.isHelpTextOpen?"chevron-thin-up":"chevron-thin-down"}"
|
|
420
420
|
></pkt-icon>
|
|
421
|
-
<span class="pkt-btn__text">${
|
|
421
|
+
<span class="pkt-btn__text">${pi(this.helptextDropdownButton)}</span>
|
|
422
422
|
</button>
|
|
423
423
|
<div
|
|
424
424
|
class="${N({"pkt-inputwrapper__helptext":!0,"pkt-inputwrapper__helptext-expandable-open":this.isHelpTextOpen,"pkt-inputwrapper__helptext-expandable-closed":!this.isHelpTextOpen})}"
|
|
425
425
|
>
|
|
426
|
-
${
|
|
426
|
+
${pi(this.helptextDropdown)}
|
|
427
427
|
</div>
|
|
428
428
|
</div>`:k;return u`${u`<div class="${e}">
|
|
429
429
|
<div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
|
|
430
|
-
<div class="pkt-contents" ${
|
|
431
|
-
${this.helptext&&
|
|
430
|
+
<div class="pkt-contents" ${O(this.defaultSlot)} name="helptext"></div>
|
|
431
|
+
${this.helptext&&pi(this.helptext)}
|
|
432
432
|
</div>
|
|
433
433
|
${i()}
|
|
434
|
-
</div>`}`}};Re([o({type:String,reflect:!0})],ve.prototype,"forId",2),Re([o({type:String})],ve.prototype,"helptext",2),Re([o({type:String})],ve.prototype,"helptextDropdown",2),Re([o({type:String})],ve.prototype,"helptextDropdownButton",2),Re([L()],ve.prototype,"isHelpTextOpen",2),Re([L()],ve.prototype,"filledSlots",2),ve=Re([
|
|
434
|
+
</div>`}`}};Re([o({type:String,reflect:!0})],ve.prototype,"forId",2),Re([o({type:String})],ve.prototype,"helptext",2),Re([o({type:String})],ve.prototype,"helptextDropdown",2),Re([o({type:String})],ve.prototype,"helptextDropdownButton",2),Re([L()],ve.prototype,"isHelpTextOpen",2),Re([L()],ve.prototype,"filledSlots",2),ve=Re([H("pkt-helptext")],ve);var hh=Object.defineProperty,ch=Object.getOwnPropertyDescriptor,st=(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&&hh(t,e,n),n};let Q=class extends J{constructor(){super(),this.defaultSlot=A(),this.helptextSlot=A(),this.forId=Ae(),this.label="",this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=Ft.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.counterError=null,this.counterPosition="bottom",this.optionalTag=Ft.props.optionalTag.default,this.optionalText=Ft.props.optionalText.default,this.requiredTag=Ft.props.requiredTag.default,this.requiredText=Ft.props.requiredText.default,this.tagText=null,this.hasError=Ft.props.hasError.default,this.errorMessage="",this.disabled=Ft.props.disabled.default,this.inline=Ft.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=Ft.props.hasFieldset.default,this.role="group",this.useWrapper=Ft.props.useWrapper.default,this.slotController=new ot(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=()=>u`
|
|
435
435
|
${this.tagText?u`<span class=${e+" pkt-tag--gray"}>${this.tagText}</span>`:k}
|
|
436
436
|
${this.optionalTag?u`<span class=${e+" pkt-tag--blue-light"}>${this.optionalText}</span>`:k}
|
|
437
437
|
${this.requiredTag?u`<span class=${e+" pkt-tag--beige"}>${this.requiredText}</span>`:k}
|
|
@@ -463,7 +463,7 @@
|
|
|
463
463
|
.helptextDropdown=${this.helptextDropdown}
|
|
464
464
|
.helptextDropdownButton=${this.helptextDropdownButton||Ft.props.helptextDropdownButton.default}
|
|
465
465
|
@toggleHelpText=${v=>{this.toggleDropdown(v)}}
|
|
466
|
-
${
|
|
466
|
+
${O(this.helptextSlot)}
|
|
467
467
|
name="helptext"
|
|
468
468
|
></pkt-helptext>
|
|
469
469
|
`,h=()=>this.counter?u`<div class="pkt-input__counter" aria-live="polite" aria-atomic="true">
|
|
@@ -476,17 +476,17 @@
|
|
|
476
476
|
aria-live="assertive"
|
|
477
477
|
aria-atomic="true"
|
|
478
478
|
>
|
|
479
|
-
${
|
|
479
|
+
${pi(this.errorMessage)}
|
|
480
480
|
</pkt-alert>`:k,p=()=>u`
|
|
481
481
|
${a()}
|
|
482
482
|
${r()}
|
|
483
483
|
${this.counterPosition==="top"?h():k}
|
|
484
|
-
<div class="pkt-contents" ${
|
|
484
|
+
<div class="pkt-contents" ${O(this.defaultSlot)}></div>
|
|
485
485
|
${this.counterPosition==="bottom"?h():k}
|
|
486
486
|
${d()}
|
|
487
487
|
`,m=()=>this.hasFieldset?u`<fieldset class="pkt-inputwrapper__fieldset" aria-describedby="${i}">
|
|
488
488
|
${p()}
|
|
489
|
-
</fieldset>`:u`<div class="pkt-inputwrapper__fieldset">${p()}</div>`;return u`<div class=${N(t)}>${m()}</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})],Q.prototype,"forId",2),st([o({type:String})],Q.prototype,"label",2),st([o({type:String})],Q.prototype,"helptext",2),st([o({type:String})],Q.prototype,"helptextDropdown",2),st([o({type:String})],Q.prototype,"helptextDropdownButton",2),st([o({type:Boolean})],Q.prototype,"counter",2),st([o({type:Number})],Q.prototype,"counterCurrent",2),st([o({type:Number})],Q.prototype,"counterMaxLength",2),st([o({type:String})],Q.prototype,"counterError",2),st([o({type:String,reflect:!1})],Q.prototype,"counterPosition",2),st([o({type:Boolean})],Q.prototype,"optionalTag",2),st([o({type:String})],Q.prototype,"optionalText",2),st([o({type:Boolean})],Q.prototype,"requiredTag",2),st([o({type:String})],Q.prototype,"requiredText",2),st([o({type:String})],Q.prototype,"tagText",2),st([o({type:Boolean})],Q.prototype,"hasError",2),st([o({type:String})],Q.prototype,"errorMessage",2),st([o({type:Boolean})],Q.prototype,"disabled",2),st([o({type:Boolean})],Q.prototype,"inline",2),st([o({type:String})],Q.prototype,"ariaDescribedby",2),st([o({type:Boolean})],Q.prototype,"hasFieldset",2),st([o({type:String,reflect:!0})],Q.prototype,"role",2),st([o({type:Boolean,reflect:!0,converter:
|
|
489
|
+
</fieldset>`:u`<div class="pkt-inputwrapper__fieldset">${p()}</div>`;return u`<div class=${N(t)}>${m()}</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})],Q.prototype,"forId",2),st([o({type:String})],Q.prototype,"label",2),st([o({type:String})],Q.prototype,"helptext",2),st([o({type:String})],Q.prototype,"helptextDropdown",2),st([o({type:String})],Q.prototype,"helptextDropdownButton",2),st([o({type:Boolean})],Q.prototype,"counter",2),st([o({type:Number})],Q.prototype,"counterCurrent",2),st([o({type:Number})],Q.prototype,"counterMaxLength",2),st([o({type:String})],Q.prototype,"counterError",2),st([o({type:String,reflect:!1})],Q.prototype,"counterPosition",2),st([o({type:Boolean})],Q.prototype,"optionalTag",2),st([o({type:String})],Q.prototype,"optionalText",2),st([o({type:Boolean})],Q.prototype,"requiredTag",2),st([o({type:String})],Q.prototype,"requiredText",2),st([o({type:String})],Q.prototype,"tagText",2),st([o({type:Boolean})],Q.prototype,"hasError",2),st([o({type:String})],Q.prototype,"errorMessage",2),st([o({type:Boolean})],Q.prototype,"disabled",2),st([o({type:Boolean})],Q.prototype,"inline",2),st([o({type:String})],Q.prototype,"ariaDescribedby",2),st([o({type:Boolean})],Q.prototype,"hasFieldset",2),st([o({type:String,reflect:!0})],Q.prototype,"role",2),st([o({type:Boolean,reflect:!0,converter:At})],Q.prototype,"useWrapper",2),Q=st([H("pkt-input-wrapper")],Q);var dh=Object.defineProperty,uh=Object.getOwnPropertyDescriptor,xt=(s,t,e,i)=>{for(var n=i>1?void 0:i?uh(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 yt=class extends J{constructor(){super(...arguments),this.id=Ae(),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 u`
|
|
490
490
|
<div
|
|
491
491
|
class=${N({"pkt-listbox":!0,"pkt-listbox__open":this.isOpen,"pkt-txt-16-light":!0})}
|
|
492
492
|
role="listbox"
|
|
@@ -512,7 +512,7 @@
|
|
|
512
512
|
?disabled=${this.disabled||t.disabled||this.maxIsReached&&!t.selected}
|
|
513
513
|
/>
|
|
514
514
|
`:t.selected?u`<pkt-icon name="check-big"></pkt-icon>`:k}renderList(){return u`
|
|
515
|
-
${
|
|
515
|
+
${Ri(this._filteredOptions,t=>t.value,(t,e)=>u`
|
|
516
516
|
<li
|
|
517
517
|
@click=${()=>{this.toggleOption(t)}}
|
|
518
518
|
aria-selected=${t.selected?"true":"false"}
|
|
@@ -570,7 +570,7 @@
|
|
|
570
570
|
type="text"
|
|
571
571
|
aria-label="Søk i listen"
|
|
572
572
|
form=""
|
|
573
|
-
placeholder=${this.searchPlaceholder||
|
|
573
|
+
placeholder=${this.searchPlaceholder||Mt.forms.search.placeholder}
|
|
574
574
|
@input=${this.handleSearchInput}
|
|
575
575
|
@keydown=${this.handleSearchKeydown}
|
|
576
576
|
.value=${this.searchValue}
|
|
@@ -580,7 +580,7 @@
|
|
|
580
580
|
role="searchbox"
|
|
581
581
|
/>
|
|
582
582
|
</div>
|
|
583
|
-
`: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])')||[]):[]}};xt([o({type:String})],yt.prototype,"id",2),xt([o({type:String})],yt.prototype,"label",2),xt([o({type:Array})],yt.prototype,"options",2),xt([o({type:Boolean,reflect:!0})],yt.prototype,"isOpen",2),xt([o({type:Boolean})],yt.prototype,"disabled",2),xt([o({type:Boolean})],yt.prototype,"includeSearch",2),xt([o({type:Boolean})],yt.prototype,"isMultiSelect",2),xt([o({type:Boolean})],yt.prototype,"allowUserInput",2),xt([o({type:Boolean})],yt.prototype,"maxIsReached",2),xt([o({type:String})],yt.prototype,"customUserInput",2),xt([o({type:String})],yt.prototype,"searchPlaceholder",2),xt([o({type:String})],yt.prototype,"searchValue",2),xt([o({type:Number})],yt.prototype,"maxLength",2),xt([o({type:String})],yt.prototype,"userMessage",2),xt([L()],yt.prototype,"_filteredOptions",2),yt=xt([
|
|
583
|
+
`: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])')||[]):[]}};xt([o({type:String})],yt.prototype,"id",2),xt([o({type:String})],yt.prototype,"label",2),xt([o({type:Array})],yt.prototype,"options",2),xt([o({type:Boolean,reflect:!0})],yt.prototype,"isOpen",2),xt([o({type:Boolean})],yt.prototype,"disabled",2),xt([o({type:Boolean})],yt.prototype,"includeSearch",2),xt([o({type:Boolean})],yt.prototype,"isMultiSelect",2),xt([o({type:Boolean})],yt.prototype,"allowUserInput",2),xt([o({type:Boolean})],yt.prototype,"maxIsReached",2),xt([o({type:String})],yt.prototype,"customUserInput",2),xt([o({type:String})],yt.prototype,"searchPlaceholder",2),xt([o({type:String})],yt.prototype,"searchValue",2),xt([o({type:Number})],yt.prototype,"maxLength",2),xt([o({type:String})],yt.prototype,"userMessage",2),xt([L()],yt.prototype,"_filteredOptions",2),yt=xt([H("pkt-listbox")],yt);const ph={displayValueAs:{default:"label"}},fh={props:ph};var gh=Object.defineProperty,mh=Object.getOwnPropertyDescriptor,lt=(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};let at=class extends I{constructor(){super(),this.helptextSlot=A(),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=fh.props.displayValueAs.default,this.tagPlacement=null,this._options=[],this._value=[],this._isOptionsOpen=!1,this._userInfoMessage="",this._addValueText=null,this._maxIsReached=!1,this._search="",this._inputFocus=!1,this._editingSingleValue=!1,this.inputRef=A(),this.arrowRef=A(),this.listboxRef=A(),this.focusRef=A(),this.optionTagRef=A(),this.optionsController=new va(this),this.slotController=new ot(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){var t,e;if(super.connectedCallback(),document&&document.body.addEventListener("click",i=>{this._isOptionsOpen&&!this.contains(i.target)&&this.handleFocusOut(i)}),this._options=[],this.defaultOptions&&this.defaultOptions.length){const i=((t=this.options)==null?void 0:t.filter(n=>n.userAdded))||[];this.options=[...i,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if((e=this.optionsController)!=null&&e.nodes&&this.optionsController.nodes.length){const i=[];this.optionsController.nodes.forEach(n=>{if(!n.textContent&&!n.getAttribute("value"))return null;const a={value:n.getAttribute("value")||n.textContent||"",label:n.textContent||n.getAttribute("value")||""};n.getAttribute("data-prefix")&&(a.prefix=n.getAttribute("data-prefix")||void 0),n.getAttribute("tagskincolor")&&(a.tagSkinColor=n.getAttribute("tagskincolor")),n.getAttribute("description")&&(a.description=n.getAttribute("description")||void 0),a.fulltext=a.value+a.label+(a.prefix||""),i.push(a)}),i.length&&(this.options=[...i],this._options=[...i])}}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 u`
|
|
584
584
|
<pkt-input-wrapper
|
|
585
585
|
.label=${this.label}
|
|
586
586
|
.helptext=${this.helptext}
|
|
@@ -601,7 +601,7 @@
|
|
|
601
601
|
class="pkt-combobox__wrapper"
|
|
602
602
|
@labelClick=${this.handleInputClick}
|
|
603
603
|
>
|
|
604
|
-
<div class="pkt-contents" ${
|
|
604
|
+
<div class="pkt-contents" ${O(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
605
605
|
<div class="pkt-combobox" @focusout=${this.handleFocusOut}>
|
|
606
606
|
<div
|
|
607
607
|
class=${N({"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})}
|
|
@@ -617,7 +617,7 @@
|
|
|
617
617
|
@click=${this.handleArrowClick}
|
|
618
618
|
@keydown=${this.handleArrowClick}
|
|
619
619
|
id="${this.id}-arrow"
|
|
620
|
-
${
|
|
620
|
+
${O(this.arrowRef)}
|
|
621
621
|
aria-expanded=${this._isOptionsOpen}
|
|
622
622
|
aria-controls="${this.id}-listbox"
|
|
623
623
|
aria-haspopup="listbox"
|
|
@@ -633,7 +633,7 @@
|
|
|
633
633
|
></pkt-icon>
|
|
634
634
|
</div>
|
|
635
635
|
<div
|
|
636
|
-
${
|
|
636
|
+
${O(this.focusRef)}
|
|
637
637
|
tabindex="-1"
|
|
638
638
|
@keydown=${this.handleArrowClick}
|
|
639
639
|
class="pkt-contents"
|
|
@@ -658,7 +658,7 @@
|
|
|
658
658
|
@close-options=${()=>this._isOptionsOpen=!1}
|
|
659
659
|
.searchValue=${this._search||null}
|
|
660
660
|
.maxLength=${this.maxlength||0}
|
|
661
|
-
${
|
|
661
|
+
${O(this.listboxRef)}
|
|
662
662
|
></pkt-listbox>
|
|
663
663
|
</div>
|
|
664
664
|
|
|
@@ -683,7 +683,7 @@
|
|
|
683
683
|
aria-controls="${this.id}-listbox"
|
|
684
684
|
aria-multiselectable=${C(this.multiple?"true":void 0)}
|
|
685
685
|
aria-activedescendant=${C(this._value[0]&&this.findValueInOptions(this._value[0])?`${this.id}-listbox-${this.findIndexInOptions(this._value[0])}`:void 0)}
|
|
686
|
-
${
|
|
686
|
+
${O(this.inputRef)}
|
|
687
687
|
/>
|
|
688
688
|
</div>
|
|
689
689
|
`:u`
|
|
@@ -692,9 +692,9 @@
|
|
|
692
692
|
id="${this.id}-input"
|
|
693
693
|
name=${(this.name||this.id)+"-input"}
|
|
694
694
|
.value=${this._value.join(",")}
|
|
695
|
-
${
|
|
695
|
+
${O(this.inputRef)}
|
|
696
696
|
/>
|
|
697
|
-
`}renderSingleOrMultipleValues(){const t=!this.multiple,e=this._editingSingleValue?null:this.renderValueTag(this.findValueInOptions(this._value[0])),i=
|
|
697
|
+
`}renderSingleOrMultipleValues(){const t=!this.multiple,e=this._editingSingleValue?null:this.renderValueTag(this.findValueInOptions(this._value[0])),i=Ri(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 u`
|
|
698
698
|
<pkt-tag
|
|
699
699
|
skin=${h||"blue-dark"}
|
|
700
700
|
?closeTag=${!this.disabled}
|
|
@@ -708,7 +708,7 @@
|
|
|
708
708
|
>${t.value}</span
|
|
709
709
|
>`;case"label":default:return u`<span class="pkt-combobox__value" data-focusfix=${this.id}
|
|
710
710
|
>${t.label||t.value}</span
|
|
711
|
-
>`}}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()),p=!this.multiple,m=this.multiple,v=this.isMaxItemsReached();let y=!1,$=!0,b="",x="";h||(!r&&this.allowUserInput&&!d?(this.addNewUserValue(t),b="Ny verdi lagt til",y=!m):!r&&!this.allowUserInput?(p&&this._value[0]&&this.removeValue(this._value[0]),$=!1,y=!0,b="Ingen treff i søket"):a?(this.removeValue(n),y=!0):d&&p?(this.removeAllSelected(),y=!0):p?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(n),y=!1,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="",this.inputRef.value.blur())):m&&!v?(this.setSelected(n),y=!0):m&&v?(this._userInfoMessage="Maks antall valg nådd",$=!1,x=t):(p&&this.removeAllSelected(),this._userInfoMessage="Ingen gyldig verdi valgt",$=!1,y=!0,x=t),this._isOptionsOpen=y,y||window.setTimeout(()=>{var T;(T=this.focusRef.value)==null||T.focus()},0),this._userInfoMessage=b,this._search=x||"",this.resetComboboxInput($),m&&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})],at.prototype,"value",2),lt([o({type:Array})],at.prototype,"options",2),lt([o({type:Array})],at.prototype,"defaultOptions",2),lt([o({type:Boolean})],at.prototype,"allowUserInput",2),lt([o({type:Boolean})],at.prototype,"typeahead",2),lt([o({type:Boolean})],at.prototype,"includeSearch",2),lt([o({type:String})],at.prototype,"searchPlaceholder",2),lt([o({type:Boolean})],at.prototype,"multiple",2),lt([o({type:Number})],at.prototype,"maxlength",2),lt([o({type:String})],at.prototype,"displayValueAs",2),lt([o({type:String})],at.prototype,"tagPlacement",2),lt([L()],at.prototype,"_options",2),lt([L()],at.prototype,"_value",2),lt([L()],at.prototype,"_isOptionsOpen",2),lt([L()],at.prototype,"_userInfoMessage",2),lt([L()],at.prototype,"_addValueText",2),lt([L()],at.prototype,"_maxIsReached",2),lt([L()],at.prototype,"_search",2),lt([L()],at.prototype,"_inputFocus",2),lt([L()],at.prototype,"_editingSingleValue",2),at=lt([j("pkt-combobox")],at);const uh={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 ph=Object.defineProperty,fh=Object.getOwnPropertyDescriptor,ce=(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&&ph(t,e,n),n};let Gi=null;function gh(){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 Rt=class extends X{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||uh.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 gh(),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}>
|
|
711
|
+
>`}}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()),p=!this.multiple,m=this.multiple,v=this.isMaxItemsReached();let y=!1,$=!0,b="",x="";h||(!r&&this.allowUserInput&&!d?(this.addNewUserValue(t),b="Ny verdi lagt til",y=!m):!r&&!this.allowUserInput?(p&&this._value[0]&&this.removeValue(this._value[0]),$=!1,y=!0,b="Ingen treff i søket"):a?(this.removeValue(n),y=!0):d&&p?(this.removeAllSelected(),y=!0):p?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(n),y=!1,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="",this.inputRef.value.blur())):m&&!v?(this.setSelected(n),y=!0):m&&v?(this._userInfoMessage="Maks antall valg nådd",$=!1,x=t):(p&&this.removeAllSelected(),this._userInfoMessage="Ingen gyldig verdi valgt",$=!1,y=!0,x=t),this._isOptionsOpen=y,y||window.setTimeout(()=>{var T;(T=this.focusRef.value)==null||T.focus()},0),this._userInfoMessage=b,this._search=x||"",this.resetComboboxInput($),m&&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})],at.prototype,"value",2),lt([o({type:Array})],at.prototype,"options",2),lt([o({type:Array})],at.prototype,"defaultOptions",2),lt([o({type:Boolean})],at.prototype,"allowUserInput",2),lt([o({type:Boolean})],at.prototype,"typeahead",2),lt([o({type:Boolean})],at.prototype,"includeSearch",2),lt([o({type:String})],at.prototype,"searchPlaceholder",2),lt([o({type:Boolean})],at.prototype,"multiple",2),lt([o({type:Number})],at.prototype,"maxlength",2),lt([o({type:String})],at.prototype,"displayValueAs",2),lt([o({type:String})],at.prototype,"tagPlacement",2),lt([L()],at.prototype,"_options",2),lt([L()],at.prototype,"_value",2),lt([L()],at.prototype,"_isOptionsOpen",2),lt([L()],at.prototype,"_userInfoMessage",2),lt([L()],at.prototype,"_addValueText",2),lt([L()],at.prototype,"_maxIsReached",2),lt([L()],at.prototype,"_search",2),lt([L()],at.prototype,"_inputFocus",2),lt([L()],at.prototype,"_editingSingleValue",2),at=lt([H("pkt-combobox")],at);const vh={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 bh=Object.defineProperty,kh=Object.getOwnPropertyDescriptor,ce=(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 Yi=null;function yh(){return Yi||(Yi=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)}),Yi)}let Rt=class extends J{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||vh.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 yh(),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}>
|
|
712
712
|
<pkt-icon name="chevron-right" class="pkt-footer__link-icon"></pkt-icon>
|
|
713
713
|
${this.triggerText}
|
|
714
714
|
</a>`:this.triggerType==="icon"?u`<pkt-button
|
|
@@ -718,7 +718,7 @@
|
|
|
718
718
|
@click=${this.openModal}
|
|
719
719
|
>
|
|
720
720
|
>${this.triggerText}</pkt-button
|
|
721
|
-
>`:u`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`}};ce([o({type:Boolean})],Rt.prototype,"devMode",2),ce([o({type:String})],Rt.prototype,"hotjarId",2),ce([o({type:String})],Rt.prototype,"googleAnalyticsId",2),ce([o({type:String})],Rt.prototype,"cookieDomain",2),ce([o({type:String})],Rt.prototype,"cookieSecure",2),ce([o({type:String})],Rt.prototype,"cookieExpiryDays",2),ce([o({type:String})],Rt.prototype,"triggerType",2),ce([o({type:String})],Rt.prototype,"triggerText",2),ce([o({type:String})],Rt.prototype,"i18nLanguage",2),Rt=ce([
|
|
721
|
+
>`:u`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`}};ce([o({type:Boolean})],Rt.prototype,"devMode",2),ce([o({type:String})],Rt.prototype,"hotjarId",2),ce([o({type:String})],Rt.prototype,"googleAnalyticsId",2),ce([o({type:String})],Rt.prototype,"cookieDomain",2),ce([o({type:String})],Rt.prototype,"cookieSecure",2),ce([o({type:String})],Rt.prototype,"cookieExpiryDays",2),ce([o({type:String})],Rt.prototype,"triggerType",2),ce([o({type:String})],Rt.prototype,"triggerText",2),ce([o({type:String})],Rt.prototype,"i18nLanguage",2),Rt=ce([H("pkt-consent")],Rt);var $h=Object.defineProperty,_h=Object.getOwnPropertyDescriptor,St=(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&&$h(t,e,n),n};let $t=class extends I{constructor(){super(...arguments),this.inputRef=A(),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=N({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),e=N({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),i=N({"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=()=>u`
|
|
722
722
|
${this.tagText?u`<span class=${n+" pkt-tag--gray"}>${this.tagText}</span>`:k}
|
|
723
723
|
${this.optionalTag?u`<span class=${n+" pkt-tag--blue-light"}>${this.optionalText}</span>`:k}
|
|
724
724
|
${this.requiredTag?u`<span class=${n+" pkt-tag--beige"}>${this.requiredText}</span>`:k}
|
|
@@ -737,7 +737,7 @@
|
|
|
737
737
|
type="checkbox"
|
|
738
738
|
?disabled=${this.disabled}
|
|
739
739
|
name=${this.name+"-internal"}
|
|
740
|
-
${
|
|
740
|
+
${O(this.inputRef)}
|
|
741
741
|
@change=${this.handleChange}
|
|
742
742
|
@click=${this.handleClick}
|
|
743
743
|
@blur=${this.onBlur}
|
|
@@ -748,27 +748,27 @@
|
|
|
748
748
|
${this.labelPosition==="right"?r():k}
|
|
749
749
|
</div>
|
|
750
750
|
</div>
|
|
751
|
-
`}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))}};St([o({type:String,reflect:!0})],$t.prototype,"value",2),St([o({type:String})],$t.prototype,"checkHelptext",2),St([o({type:Boolean})],$t.prototype,"defaultChecked",2),St([o({type:Boolean})],$t.prototype,"hasTile",2),St([o({type:Boolean})],$t.prototype,"isSwitch",2),St([o({type:String})],$t.prototype,"labelPosition",2),St([o({type:Boolean})],$t.prototype,"hideLabel",2),St([o({type:Boolean,reflect:!0})],$t.prototype,"checked",2),St([o({type:Boolean,reflect:!0})],$t.prototype,"indeterminate",2),St([o({type:String,reflect:!0})],$t.prototype,"type",2),St([o({type:String})],$t.prototype,"tagText",2),St([o({type:Boolean})],$t.prototype,"optionalTag",2),St([o({type:String})],$t.prototype,"optionalText",2),St([o({type:Boolean})],$t.prototype,"requiredTag",2),St([o({type:String})],$t.prototype,"requiredText",2),$t=St([
|
|
751
|
+
`}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))}};St([o({type:String,reflect:!0})],$t.prototype,"value",2),St([o({type:String})],$t.prototype,"checkHelptext",2),St([o({type:Boolean})],$t.prototype,"defaultChecked",2),St([o({type:Boolean})],$t.prototype,"hasTile",2),St([o({type:Boolean})],$t.prototype,"isSwitch",2),St([o({type:String})],$t.prototype,"labelPosition",2),St([o({type:Boolean})],$t.prototype,"hideLabel",2),St([o({type:Boolean,reflect:!0})],$t.prototype,"checked",2),St([o({type:Boolean,reflect:!0})],$t.prototype,"indeterminate",2),St([o({type:String,reflect:!0})],$t.prototype,"type",2),St([o({type:String})],$t.prototype,"tagText",2),St([o({type:Boolean})],$t.prototype,"optionalTag",2),St([o({type:String})],$t.prototype,"optionalText",2),St([o({type:Boolean})],$t.prototype,"requiredTag",2),St([o({type:String})],$t.prototype,"requiredText",2),$t=St([H("pkt-checkbox")],$t);var wh=Object.defineProperty,xh=Object.getOwnPropertyDescriptor,Ws=(s,t,e,i)=>{for(var n=i>1?void 0:i?xh(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 gs=class extends J{constructor(){super(...arguments),this.dates=[],this.dateformat="dd.MM.yyyy",this.className="pkt-datepicker__tags",this.idBase=Ae()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},u`
|
|
752
752
|
<div class=${N(this.classes)} aria-live="polite">
|
|
753
|
-
${Array.isArray(this.dates)&&this.dates[0]?
|
|
753
|
+
${Array.isArray(this.dates)&&this.dates[0]?Ri(ha((this.dates??[]).filter(Boolean)),t=>t,t=>{var e;return u` <pkt-tag
|
|
754
754
|
id=${this.idBase+t+"-tag"}
|
|
755
755
|
closeTag
|
|
756
756
|
@close=${()=>{this.dispatchEvent(new CustomEvent("date-tag-removed",{detail:t}))}}
|
|
757
|
-
.ariaLabel=${`${(e=this.strings)==null?void 0:e.calendar.deleteDate} ${
|
|
757
|
+
.ariaLabel=${`${(e=this.strings)==null?void 0:e.calendar.deleteDate} ${oa(t,this.dateformat)}`}
|
|
758
758
|
>
|
|
759
|
-
<time datetime=${t}>${
|
|
759
|
+
<time datetime=${t}>${oa(t,this.dateformat)}</time>
|
|
760
760
|
</pkt-tag>`}):k}
|
|
761
761
|
</div>
|
|
762
|
-
`}};
|
|
762
|
+
`}};Ws([o({type:Array})],gs.prototype,"dates",2),Ws([o({type:String})],gs.prototype,"dateformat",2),Ws([o({type:String,attribute:"class"})],gs.prototype,"className",2),Ws([o({type:String,attribute:"id-base"})],gs.prototype,"idBase",2),gs=Ws([H("pkt-date-tags")],gs);const Sh={dateformat:{default:"dd.MM.yyyy"},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},Rs={props:Sh},Ke=()=>{const s=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(s)||/Macintosh/.test(s)&&"ontouchend"in document)},ba={validateRangeOrder(s){return!s||s.length!==2?!0:Tl(s[0],s[1])},sortDates(s){return ha(s)},filterSelectableDates(s,t,e,i,n){return Cl(s,t,e,i,n)}},Ch={getInputType(){return Ke()?"text":"date"}},Ks={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 p=s.value;p&&(e&&e>p?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<p&&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))}},$i={addToSelected(s,t,e,i){const n=s.target;if(!n.value)return;const a=e?me(e):null,r=i?me(i):null,h=me(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}},Gi={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=Ee(r.value);h&&((a=e==null?void 0:e.value)==null||a.handleDateSelect(h))}else t[0]&&i()}},_i={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 Th=Object.defineProperty,Nh=Object.getOwnPropertyDescriptor,Vt=(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&&Th(t,e,n),n};let Ot=class extends J{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=A(),this.calendarRef=A(),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 $i.addToSelected=="function")return $i.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 u`
|
|
763
763
|
<div
|
|
764
764
|
class="${N(t)}"
|
|
765
|
-
${
|
|
765
|
+
${O(this.popupRef)}
|
|
766
766
|
id="date-popup"
|
|
767
767
|
?hidden=${!this.open}
|
|
768
768
|
aria-hidden="${!this.open}"
|
|
769
769
|
>
|
|
770
770
|
<pkt-calendar
|
|
771
|
-
${
|
|
771
|
+
${O(this.calendarRef)}
|
|
772
772
|
?multiple=${this.multiple}
|
|
773
773
|
?range=${this.range}
|
|
774
774
|
?weeknumbers=${this.weeknumbers}
|
|
@@ -784,9 +784,9 @@
|
|
|
784
784
|
@close=${()=>{this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}
|
|
785
785
|
></pkt-calendar>
|
|
786
786
|
</div>
|
|
787
|
-
`}};Vt([o({type:Boolean,reflect:!0})],
|
|
787
|
+
`}};Vt([o({type:Boolean,reflect:!0})],Ot.prototype,"open",2),Vt([o({type:Boolean})],Ot.prototype,"multiple",2),Vt([o({type:Boolean})],Ot.prototype,"range",2),Vt([o({type:Boolean})],Ot.prototype,"weeknumbers",2),Vt([o({type:Boolean})],Ot.prototype,"withcontrols",2),Vt([o({type:Number})],Ot.prototype,"maxMultiple",2),Vt([o({type:Array})],Ot.prototype,"selected",2),Vt([o({type:String})],Ot.prototype,"earliest",2),Vt([o({type:String})],Ot.prototype,"latest",2),Vt([o({type:Array})],Ot.prototype,"excludedates",2),Vt([o({type:Array})],Ot.prototype,"excludeweekdays",2),Vt([o({type:String})],Ot.prototype,"currentmonth",2),Ot=Vt([H("pkt-datepicker-popup")],Ot);var Eh=Object.defineProperty,be=(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&&Eh(t,e,n),n};let Kt=class extends J{constructor(){super(...arguments),this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.inputClasses={},this.inputRef=A(),this.btnRef=A()}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}))}renderCalendarButton(){var t;return u`
|
|
788
788
|
<button
|
|
789
|
-
class="${N(
|
|
789
|
+
class="${N(Gi.getButtonClasses())}"
|
|
790
790
|
type="button"
|
|
791
791
|
@click=${e=>this.dispatchToggleCalendar(e)}
|
|
792
792
|
@keydown=${e=>{const{key:i}=e;(i==="Enter"||i===" "||i==="Space")&&(e.preventDefault(),this.dispatchToggleCalendar(e))}}
|
|
@@ -796,7 +796,7 @@
|
|
|
796
796
|
<pkt-icon name="calendar"></pkt-icon>
|
|
797
797
|
<span class="pkt-btn__text">${((t=this.strings.calendar)==null?void 0:t.buttonAltText)||"Åpne kalender"}</span>
|
|
798
798
|
</button>
|
|
799
|
-
`}createRenderRoot(){return this}};be([o({type:String})],Kt.prototype,"inputType"),be([o({type:String})],Kt.prototype,"id"),be([o({type:String})],Kt.prototype,"min"),be([o({type:String})],Kt.prototype,"max"),be([o({type:String})],Kt.prototype,"placeholder"),be([o({type:Boolean})],Kt.prototype,"readonly"),be([o({type:Boolean})],Kt.prototype,"disabled"),be([o({type:Object})],Kt.prototype,"inputClasses"),be([o({type:Object})],Kt.prototype,"internals");const
|
|
799
|
+
`}createRenderRoot(){return this}};be([o({type:String})],Kt.prototype,"inputType"),be([o({type:String})],Kt.prototype,"id"),be([o({type:String})],Kt.prototype,"min"),be([o({type:String})],Kt.prototype,"max"),be([o({type:String})],Kt.prototype,"placeholder"),be([o({type:Boolean})],Kt.prototype,"readonly"),be([o({type:Boolean})],Kt.prototype,"disabled"),be([o({type:Object})],Kt.prototype,"inputClasses"),be([o({type:Object})],Kt.prototype,"internals");const ka={calendar:{buttonAltText:"Åpne kalender"}},Mh={calendar:{buttonAltText:"Åpne kalender"},generic:{from:"Fra",to:"Til"}};var Ah=Object.defineProperty,Oh=Object.getOwnPropertyDescriptor,Xi=(s,t,e,i)=>{for(var n=i>1?void 0:i?Oh(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&&Ah(t,e,n),n};let wi=class extends Kt{constructor(){super(...arguments),this.value="",this.strings=ka}dispatchManageValidity(t){this.dispatchEvent(new CustomEvent("manage-validity",{detail:t,bubbles:!0,composed:!0}))}render(){return u`
|
|
800
800
|
<div class="pkt-input__container">
|
|
801
801
|
<input
|
|
802
802
|
class="${N(this.inputClasses)}"
|
|
@@ -811,16 +811,16 @@
|
|
|
811
811
|
@click=${t=>{t.preventDefault(),this.dispatchToggleCalendar(t)}}
|
|
812
812
|
@touchend=${t=>{t.preventDefault(),this.dispatchToggleCalendar(t)}}
|
|
813
813
|
?disabled=${this.disabled}
|
|
814
|
-
@keydown=${t=>
|
|
814
|
+
@keydown=${t=>_i.handleInputKeydown(t,e=>this.dispatchToggleCalendar(e),()=>Ks.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()})}
|
|
815
815
|
@input=${t=>{this.dispatchInput(t),t.stopImmediatePropagation()}}
|
|
816
816
|
@focus=${()=>{this.dispatchFocus(),Ke()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
817
817
|
@blur=${t=>{this.dispatchBlur(t),this.dispatchManageValidity(t.target),this.dispatchEvent(new CustomEvent("value-change",{detail:t.target.value,bubbles:!0,composed:!0}))}}
|
|
818
818
|
@change=${t=>{this.dispatchChange(t),t.stopImmediatePropagation()}}
|
|
819
|
-
${
|
|
819
|
+
${O(this.inputRef)}
|
|
820
820
|
/>
|
|
821
821
|
${this.renderCalendarButton()}
|
|
822
822
|
</div>
|
|
823
|
-
`}};
|
|
823
|
+
`}};Xi([o({type:String})],wi.prototype,"value",2),Xi([o({type:Object})],wi.prototype,"strings",2),wi=Xi([H("pkt-datepicker-single")],wi);var Ph=Object.defineProperty,Dh=Object.getOwnPropertyDescriptor,xi=(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&&Ph(t,e,n),n};let Ys=class extends Kt{constructor(){super(...arguments),this.value=[],this.showRangeLabels=!1,this.strings=Mh,this.inputRefTo=A()}get inputElementTo(){return this.inputRefTo.value}render(){var t,e;const i=Gi.getRangeLabelClasses(this.showRangeLabels);return u`
|
|
824
824
|
<div class="pkt-input__container">
|
|
825
825
|
${this.showRangeLabels?u` <div class="pkt-input-prefix">${(t=this.strings.generic)==null?void 0:t.from}</div> `:k}
|
|
826
826
|
<input
|
|
@@ -835,12 +835,12 @@
|
|
|
835
835
|
?disabled=${this.disabled}
|
|
836
836
|
@click=${n=>{n.preventDefault(),this.dispatchToggleCalendar(n)}}
|
|
837
837
|
@touchend=${n=>{n.preventDefault(),this.dispatchToggleCalendar(n)}}
|
|
838
|
-
@keydown=${n=>
|
|
838
|
+
@keydown=${n=>_i.handleInputKeydown(n,a=>this.dispatchToggleCalendar(a),()=>Ks.submitFormOrFallback(this.internals,()=>{var a;return(a=this.inputRefTo.value)==null?void 0:a.focus()}),()=>{var a;return(a=this.inputRefTo.value)==null?void 0:a.focus()},()=>{var a;return(a=this.inputRef.value)==null?void 0:a.blur()})}
|
|
839
839
|
@input=${n=>{this.dispatchInput(n),n.stopImmediatePropagation()}}
|
|
840
840
|
@focus=${()=>{this.dispatchFocus(),Ke()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
841
841
|
@blur=${n=>{this.dispatchBlur(n),this.dispatchEvent(new CustomEvent("range-blur",{detail:{event:n,values:this.value,inputType:"from"},bubbles:!0,composed:!0}))}}
|
|
842
842
|
@change=${n=>{this.dispatchChange(n),n.stopImmediatePropagation()}}
|
|
843
|
-
${
|
|
843
|
+
${O(this.inputRef)}
|
|
844
844
|
/>
|
|
845
845
|
<div class="${N(i)}" id="${this.id}-to-label">
|
|
846
846
|
${(e=this.strings.generic)==null?void 0:e.to}
|
|
@@ -859,16 +859,16 @@
|
|
|
859
859
|
?disabled=${this.disabled}
|
|
860
860
|
@click=${n=>{n.preventDefault(),this.dispatchToggleCalendar(n)}}
|
|
861
861
|
@touchend=${n=>{n.preventDefault(),this.dispatchToggleCalendar(n)}}
|
|
862
|
-
@keydown=${n=>
|
|
862
|
+
@keydown=${n=>_i.handleInputKeydown(n,a=>this.dispatchToggleCalendar(a),()=>Ks.submitFormOrFallback(this.internals,()=>{var a;return(a=this.inputRefTo.value)==null?void 0:a.blur()}),void 0,()=>{var a;return(a=this.inputRefTo.value)==null?void 0:a.blur()})}
|
|
863
863
|
@input=${n=>{this.dispatchInput(n),n.stopImmediatePropagation()}}
|
|
864
864
|
@focus=${()=>{this.dispatchFocus(),Ke()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
865
865
|
@blur=${n=>{this.dispatchBlur(n),this.dispatchEvent(new CustomEvent("range-blur",{detail:{event:n,values:this.value,inputType:"to"},bubbles:!0,composed:!0}))}}
|
|
866
866
|
@change=${n=>{this.dispatchChange(n),n.stopImmediatePropagation()}}
|
|
867
|
-
${
|
|
867
|
+
${O(this.inputRefTo)}
|
|
868
868
|
/>
|
|
869
869
|
${this.renderCalendarButton()}
|
|
870
870
|
</div>
|
|
871
|
-
`}};
|
|
871
|
+
`}};xi([o({type:Array})],Ys.prototype,"value",2),xi([o({type:Boolean})],Ys.prototype,"showRangeLabels",2),xi([o({type:Object})],Ys.prototype,"strings",2),Ys=xi([H("pkt-datepicker-range")],Ys);var Ih=Object.defineProperty,Lh=Object.getOwnPropertyDescriptor,Si=(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&&Ih(t,e,n),n};let Gs=class extends Kt{constructor(){super(...arguments),this.value=[],this.strings=ka}get isInputDisabled(){return this.disabled||this.maxlength!==void 0&&this.maxlength!==null&&this.value.length>=this.maxlength}dispatchAddToSelected(t){this.dispatchEvent(new CustomEvent("add-to-selected",{detail:t,bubbles:!0,composed:!0}))}render(){return u`
|
|
872
872
|
<div class="pkt-input__container">
|
|
873
873
|
<input
|
|
874
874
|
class=${N(this.inputClasses)}
|
|
@@ -884,13 +884,13 @@
|
|
|
884
884
|
@blur=${t=>{this.dispatchBlur(t),this.dispatchAddToSelected(t)}}
|
|
885
885
|
@input=${t=>{this.dispatchInput(t),t.stopImmediatePropagation()}}
|
|
886
886
|
@focus=${()=>{this.dispatchFocus(),Ke()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
887
|
-
@keydown=${t=>
|
|
887
|
+
@keydown=${t=>_i.handleInputKeydown(t,e=>this.dispatchToggleCalendar(e),()=>Ks.submitFormOrFallback(this.internals,()=>{var e;return(e=this.inputRef.value)==null?void 0:e.blur()}),void 0,void 0,e=>this.dispatchAddToSelected(e))}
|
|
888
888
|
@change=${t=>{this.dispatchChange(t),t.stopImmediatePropagation()}}
|
|
889
|
-
${
|
|
889
|
+
${O(this.inputRef)}
|
|
890
890
|
/>
|
|
891
891
|
${this.renderCalendarButton()}
|
|
892
892
|
</div>
|
|
893
|
-
`}};
|
|
893
|
+
`}};Si([o({type:Array})],Gs.prototype,"value",2),Si([o({type:Number})],Gs.prototype,"maxlength",2),Si([o({type:Object})],Gs.prototype,"strings",2),Gs=Si([H("pkt-datepicker-multiple")],Gs);var Bh=Object.defineProperty,Fh=Object.getOwnPropertyDescriptor,ft=(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&&Bh(t,e,n),n};let ht=class extends I{constructor(){super(),this._valueProperty="",this.datepickerPopupRef=A(),this._value=[],this.label="Datovelger",this.dateformat=Rs.props.dateformat.default,this.multiple=Rs.props.multiple.default,this.maxlength=null,this.range=Rs.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=Rs.props.weeknumbers.default,this.withcontrols=Rs.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.calendarOpen=!1,this.timezone="Europe/Oslo",this.inputClasses={},this.calRef=A(),this.popupRef=A(),this.helptextSlot=A(),this.singleInputRef=A(),this.rangeInputRef=A(),this.multipleInputRef=A(),this.addToSelected=t=>{const e=this.datepickerPopupRef.value;return e&&typeof e.addToSelected=="function"?e.addToSelected(t,this.min,this.max):$i.addToSelected(t,this.calRef,this.min,this.max)},this.slotController=new ot(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 Ch.getInputType()}connectedCallback(){super.connectedCallback(),this.timezone&&this.timezone!==window.pktTz&&(window.pktTz=this.timezone)}disconnectedCallback(){super.disconnectedCallback()}onInput(){this.dispatchEvent(new Event("input",{bubbles:!0}))}valueChanged(t,e){if(t===e)return;const i=zs(t),n=this.multiple&&i.length>1?ba.filterSelectableDates(i,this.min,this.max,this.excludedates,this.excludeweekdays):i;if(this.range&&!ba.validateRangeOrder(n)){this._value=[],this._valueProperty="",super.valueChanged("",e);return}this._value=n;const a=Nl(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=zs(i||"")),t==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=zs(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")&&(this.multiple&&!Array.isArray(this._value)?this._value=zs(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 u`
|
|
894
894
|
<pkt-datepicker-single
|
|
895
895
|
.value=${this._value[0]??""}
|
|
896
896
|
.inputType=${this.inputType}
|
|
@@ -910,7 +910,7 @@
|
|
|
910
910
|
@manage-validity=${t=>this.manageValidity(t.detail)}
|
|
911
911
|
@value-change=${t=>{this.value=t.detail}}
|
|
912
912
|
@input-changed=${()=>{this.touched=!0}}
|
|
913
|
-
${
|
|
913
|
+
${O(this.singleInputRef)}
|
|
914
914
|
></pkt-datepicker-single>
|
|
915
915
|
`}renderRangeInput(){return u`
|
|
916
916
|
<pkt-datepicker-range
|
|
@@ -930,12 +930,12 @@
|
|
|
930
930
|
@input-change=${()=>this.onInput()}
|
|
931
931
|
@input-focus=${()=>this.onFocus()}
|
|
932
932
|
@input-blur=${t=>{var e;(e=this.calRef.value)!=null&&e.contains(t.detail.relatedTarget)||this.onBlur()}}
|
|
933
|
-
@range-blur=${t=>{const e=this.currentInputElement,i=this.currentInputElementTo;if(e&&i){const n=e.value,a=i.value;if(n&&a&&n>a)i.value="",this._value=[n],this.value=n;else{const r=[n,a].filter(Boolean);r.length>0&&(r[0]!==this._value[0]||r[1]!==this._value[1])&&(this._value=r,this.value=r.join(","))}}
|
|
933
|
+
@range-blur=${t=>{const e=this.currentInputElement,i=this.currentInputElementTo;if(e&&i){const n=e.value,a=i.value;if(n&&a&&n>a)i.value="",this._value=[n],this.value=n;else{const r=[n,a].filter(Boolean);r.length>0&&(r[0]!==this._value[0]||r[1]!==this._value[1])&&(this._value=r,this.value=r.join(","))}}Zi.processRangeBlur(t.detail.event,t.detail.values,this.calRef,()=>this.clearInputValue(),n=>this.manageValidity(n))}}
|
|
934
934
|
@manage-validity=${t=>this.manageValidity(t.detail)}
|
|
935
|
-
@validate-date-input=${t=>{
|
|
935
|
+
@validate-date-input=${t=>{Ks.validateDateInput(t.detail,this.internals,this.min,this.max,this.strings)}}
|
|
936
936
|
@handle-date-select=${t=>{var e,i;const n=Ee(t.detail);if(n){const a=bt(n);this._value[0]!==a&&this._value[1]!==a&&((i=(e=this.calRef)==null?void 0:e.value)==null||i.handleDateSelect(n))}}}
|
|
937
937
|
@input-changed=${()=>{this.touched=!0}}
|
|
938
|
-
${
|
|
938
|
+
${O(this.rangeInputRef)}
|
|
939
939
|
></pkt-datepicker-range>
|
|
940
940
|
`}renderMultipleInput(){return u`
|
|
941
941
|
<pkt-datepicker-multiple
|
|
@@ -957,7 +957,7 @@
|
|
|
957
957
|
@input-blur=${t=>{var e;(e=this.calRef.value)!=null&&e.contains(t.detail.relatedTarget)||this.onBlur()}}
|
|
958
958
|
@add-to-selected=${t=>this.addToSelected(t.detail)}
|
|
959
959
|
@input-changed=${()=>{this.touched=!0}}
|
|
960
|
-
${
|
|
960
|
+
${O(this.multipleInputRef)}
|
|
961
961
|
></pkt-datepicker-multiple>
|
|
962
962
|
`}renderCalendar(){return u`
|
|
963
963
|
<pkt-datepicker-popup
|
|
@@ -974,11 +974,11 @@
|
|
|
974
974
|
.excludedates=${Array.isArray(this.excludedates)?this.excludedates:this.excludedates.split(",")}
|
|
975
975
|
.excludeweekdays=${this.excludeweekdays}
|
|
976
976
|
.currentmonth=${this.currentmonth?Ne(this.currentmonth):null}
|
|
977
|
-
@date-selected=${t=>{this.value=
|
|
977
|
+
@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))}}
|
|
978
978
|
@close=${()=>{this.onBlur(),this.hideCalendar()}}
|
|
979
|
-
${
|
|
979
|
+
${O(this.datepickerPopupRef)}
|
|
980
980
|
></pkt-datepicker-popup>
|
|
981
|
-
`}render(){return this.inputClasses=
|
|
981
|
+
`}render(){return this.inputClasses=Gi.getInputClasses(this.fullwidth,this.showRangeLabels,this.multiple,this.range,this.readonly,this.inputType),u`
|
|
982
982
|
<pkt-input-wrapper
|
|
983
983
|
label="${this.label}"
|
|
984
984
|
forId="${this.id}-input"
|
|
@@ -1003,7 +1003,7 @@
|
|
|
1003
1003
|
.ariaDescribedBy=${this.ariaDescribedBy}
|
|
1004
1004
|
class="pkt-datepicker"
|
|
1005
1005
|
>
|
|
1006
|
-
<div class="pkt-contents" ${
|
|
1006
|
+
<div class="pkt-contents" ${O(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1007
1007
|
${this.multiple?u`<pkt-date-tags
|
|
1008
1008
|
.dates=${this._value}
|
|
1009
1009
|
dateformat=${this.dateformat}
|
|
@@ -1018,13 +1018,13 @@
|
|
|
1018
1018
|
</div>
|
|
1019
1019
|
</pkt-input-wrapper>
|
|
1020
1020
|
${this.renderCalendar()}
|
|
1021
|
-
`}handleCalendarPosition(){const t=this.multiple&&!!this.maxlength
|
|
1021
|
+
`}handleCalendarPosition(){const t=this.multiple&&!!this.maxlength;$i.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(),Ke()&&e.focusOnCurrentDate();return}await sh(20),this.handleCalendarPosition(),Ke()&&((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}))}};ft([o({type:String,reflect:!0})],ht.prototype,"value",1),ft([o({type:Array})],ht.prototype,"_value",2),ft([o({type:String,reflect:!0})],ht.prototype,"label",2),ft([o({type:String})],ht.prototype,"dateformat",2),ft([o({type:Boolean,reflect:!0})],ht.prototype,"multiple",2),ft([o({type:Number,reflect:!0})],ht.prototype,"maxlength",2),ft([o({type:Boolean,reflect:!0})],ht.prototype,"range",2),ft([o({type:Boolean})],ht.prototype,"showRangeLabels",2),ft([o({type:String,reflect:!0})],ht.prototype,"min",2),ft([o({type:String,reflect:!0})],ht.prototype,"max",2),ft([o({type:Boolean})],ht.prototype,"weeknumbers",2),ft([o({type:Boolean,reflect:!0})],ht.prototype,"withcontrols",2),ft([o({converter:ds.csvToArray})],ht.prototype,"excludedates",2),ft([o({converter:ds.csvToArray})],ht.prototype,"excludeweekdays",2),ft([o({type:String})],ht.prototype,"currentmonth",2),ft([o({type:Boolean,reflect:!0})],ht.prototype,"calendarOpen",2),ft([o({type:String})],ht.prototype,"timezone",2),ft([L()],ht.prototype,"inputClasses",2),ht=ft([H("pkt-datepicker")],ht);const Vh={href:{default:"#"},target:{default:"_self"}},ya={props:Vh};var Hh=Object.defineProperty,jh=Object.getOwnPropertyDescriptor,ms=(s,t,e,i)=>{for(var n=i>1?void 0:i?jh(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 Ye=class extends J{constructor(){super(),this.defaultSlot=A(),this.href=ya.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=!1,this.target=ya.props.target.default,this.slotController=new ot(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 u`<a
|
|
1022
1022
|
class=${N(t)}
|
|
1023
1023
|
href=${this.href}
|
|
1024
1024
|
.target=${this.target}
|
|
1025
1025
|
.rel=${this.external?"noopener noreferrer":k}
|
|
1026
|
-
>${this.iconName?u`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:""} <span ${
|
|
1027
|
-
>`}};ms([o({type:String,reflect:!0})],Ye.prototype,"href",2),ms([o({type:String,reflect:!0})],Ye.prototype,"iconName",2),ms([o({type:String,reflect:!0})],Ye.prototype,"iconPosition",2),ms([o({type:Boolean,reflect:!0})],Ye.prototype,"external",2),ms([o({type:String,reflect:!0})],Ye.prototype,"target",2),Ye=ms([
|
|
1026
|
+
>${this.iconName?u`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:""} <span ${O(this.defaultSlot)}>Link</span></a
|
|
1027
|
+
>`}};ms([o({type:String,reflect:!0})],Ye.prototype,"href",2),ms([o({type:String,reflect:!0})],Ye.prototype,"iconName",2),ms([o({type:String,reflect:!0})],Ye.prototype,"iconPosition",2),ms([o({type:Boolean,reflect:!0})],Ye.prototype,"external",2),ms([o({type:String,reflect:!0})],Ye.prototype,"target",2),Ye=ms([H("pkt-link")],Ye);var Uh=Object.defineProperty,zh=Object.getOwnPropertyDescriptor,de=(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 se=class extends I{constructor(){super(),this.inputRef=A(),this.helptextSlot=A(),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 ot(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=N({"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 u`
|
|
1028
1028
|
<pkt-input-wrapper
|
|
1029
1029
|
label="${this.label}"
|
|
1030
1030
|
?counter=${this.counter}
|
|
@@ -1049,11 +1049,11 @@
|
|
|
1049
1049
|
.tagText=${this.tagText}
|
|
1050
1050
|
class="pkt-textinput"
|
|
1051
1051
|
>
|
|
1052
|
-
<div class="pkt-contents" ${
|
|
1052
|
+
<div class="pkt-contents" ${O(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1053
1053
|
<div class="pkt-input__container">
|
|
1054
1054
|
${this.prefix?u`<div class="pkt-input-prefix">${this.prefix}</div>`:k}
|
|
1055
1055
|
<input
|
|
1056
|
-
${
|
|
1056
|
+
${O(this.inputRef)}
|
|
1057
1057
|
class=${e}
|
|
1058
1058
|
type=${this.type}
|
|
1059
1059
|
name=${(this.name||this.id)+"-input"}
|
|
@@ -1093,7 +1093,7 @@
|
|
|
1093
1093
|
${!this.suffix&&t?u`<pkt-icon class="pkt-input-icon" name="magnifying-glass-big"></pkt-icon>`:k}
|
|
1094
1094
|
</div>
|
|
1095
1095
|
</pkt-input-wrapper>
|
|
1096
|
-
`}};de([o({type:String,reflect:!0})],se.prototype,"value",2),de([o({type:String})],se.prototype,"type",2),de([o({type:Number})],se.prototype,"size",2),de([o({type:String})],se.prototype,"autocomplete",2),de([o({type:String})],se.prototype,"iconNameRight",2),de([o({type:String})],se.prototype,"prefix",2),de([o({type:String})],se.prototype,"suffix",2),de([o({type:Boolean})],se.prototype,"omitSearchIcon",2),de([L()],se.prototype,"counterCurrent",2),se=de([
|
|
1096
|
+
`}};de([o({type:String,reflect:!0})],se.prototype,"value",2),de([o({type:String})],se.prototype,"type",2),de([o({type:Number})],se.prototype,"size",2),de([o({type:String})],se.prototype,"autocomplete",2),de([o({type:String})],se.prototype,"iconNameRight",2),de([o({type:String})],se.prototype,"prefix",2),de([o({type:String})],se.prototype,"suffix",2),de([o({type:Boolean})],se.prototype,"omitSearchIcon",2),de([L()],se.prototype,"counterCurrent",2),se=de([H("pkt-textinput")],se);const qh=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},Wh=s=>qh(s),Rh=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 Kh=Object.defineProperty,Yh=Object.getOwnPropertyDescriptor,Ge=(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 Oe=class extends J{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=N({"pkt-user-menu__link":!0,"pkt-link-button":!i,"pkt-link":!i,"pkt-link--icon-left":!i,[e||""]:!!e});return i?u`
|
|
1097
1097
|
<pkt-link
|
|
1098
1098
|
icon-name=${t.iconName||k}
|
|
1099
1099
|
href=${t.href}
|
|
@@ -1117,7 +1117,7 @@
|
|
|
1117
1117
|
<li class="pkt-user-menu__subitem">${this.renderLinkOrButton(e)}</li>
|
|
1118
1118
|
`)}
|
|
1119
1119
|
</ul>
|
|
1120
|
-
`}render(){var t;const e=(t=this.userMenu)==null?void 0:t.map(
|
|
1120
|
+
`}render(){var t;const e=(t=this.userMenu)==null?void 0:t.map(Wh);return u`
|
|
1121
1121
|
<nav class="pkt-user-menu" aria-label="Meny for innlogget bruker">
|
|
1122
1122
|
<ul class="pkt-user-menu__list">
|
|
1123
1123
|
<!-- User section -->
|
|
@@ -1175,8 +1175,8 @@
|
|
|
1175
1175
|
`:k}
|
|
1176
1176
|
</ul>
|
|
1177
1177
|
</nav>
|
|
1178
|
-
`}};Ge([o({type:Object})],Oe.prototype,"user",2),Ge([o({type:String,attribute:"formatted-last-logged-in"})],Oe.prototype,"formattedLastLoggedIn",2),Ge([o({type:Object})],Oe.prototype,"representing",2),Ge([o({type:Array,attribute:"user-menu"})],Oe.prototype,"userMenu",2),Ge([o({type:Boolean,attribute:"can-change-representation",converter:
|
|
1179
|
-
<pkt-icon name="oslologo" aria-hidden="true" path=${
|
|
1178
|
+
`}};Ge([o({type:Object})],Oe.prototype,"user",2),Ge([o({type:String,attribute:"formatted-last-logged-in"})],Oe.prototype,"formattedLastLoggedIn",2),Ge([o({type:Object})],Oe.prototype,"representing",2),Ge([o({type:Array,attribute:"user-menu"})],Oe.prototype,"userMenu",2),Ge([o({type:Boolean,attribute:"can-change-representation",converter:At})],Oe.prototype,"canChangeRepresentation",2),Ge([o({type:Boolean,attribute:"logout-on-click",converter:At})],Oe.prototype,"logoutOnClick",2),Oe=Ge([H("pkt-header-user-menu")],Oe);var Gh=Object.defineProperty,Zh=Object.getOwnPropertyDescriptor,K=(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};const Xh="https://punkt-cdn.oslo.kommune.no/14.5/logos/";let q=class extends J{constructor(){super(),this.searchPlaceholder="Søk",this.searchValue="",this.mobileBreakpoint=768,this.tabletBreakpoint=1280,this.openedMenu="none",this.logOutButtonPlacement="none",this.position="fixed",this.scrollBehavior="hide",this.slotMenuVariant="icon-only",this.slotMenuText="Meny",this.hideLogo=!1,this.compact=!1,this.showSearch=!1,this.canChangeRepresentation=!1,this.hasLogOut=!1,this.isMobile=!1,this.isTablet=!1,this.openMenu="none",this.isHidden=!1,this.componentWidth=typeof window<"u"?window.innerWidth:0,this.hasSlotContent=!1,this.alignSlotRight=!1,this.alignSearchRight=!1,this.defaultSlot=A(),this.headerRef=A(),this.userContainerRef=A(),this.slotContainerRef=A(),this.searchContainerRef=A(),this.slotContentRef=A(),this.searchMenuRef=A(),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 ot(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 Rh((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=u`
|
|
1179
|
+
<pkt-icon name="oslologo" aria-hidden="true" path=${Xh}></pkt-icon>
|
|
1180
1180
|
`;return this.logoLink&&typeof this.logoLink=="string"?u`
|
|
1181
1181
|
<span class="pkt-header-service__logo">
|
|
1182
1182
|
<a href=${this.logoLink} aria-label="Tilbake til forside" @click=${this.handleLogoClick}>
|
|
@@ -1222,7 +1222,7 @@
|
|
|
1222
1222
|
<div
|
|
1223
1223
|
class=${t}
|
|
1224
1224
|
@focusout=${i=>this.handleFocusOut(i,"slot")}
|
|
1225
|
-
${
|
|
1225
|
+
${O(this.slotContainerRef)}
|
|
1226
1226
|
>
|
|
1227
1227
|
${this.isTablet&&this.hasSlotContent?u`
|
|
1228
1228
|
<pkt-button
|
|
@@ -1244,15 +1244,15 @@
|
|
|
1244
1244
|
id="mobile-slot-menu"
|
|
1245
1245
|
role=${this.isTablet?"menu":k}
|
|
1246
1246
|
aria-label=${this.isTablet?"Meny":k}
|
|
1247
|
-
${
|
|
1248
|
-
${
|
|
1247
|
+
${O(this.slotContentRef)}
|
|
1248
|
+
${O(this.defaultSlot)}
|
|
1249
1249
|
></div>
|
|
1250
1250
|
</div>
|
|
1251
1251
|
`}renderSearch(){if(!this.showSearch)return k;if(this.isTablet){const t=N({"pkt-header-service__search-container":!0,"is-open":this.openMenu==="search"}),e=N({"pkt-header-service__mobile-menu":!0,"is-open":this.openMenu==="search","align-right":this.alignSearchRight});return u`
|
|
1252
1252
|
<div
|
|
1253
1253
|
class=${t}
|
|
1254
1254
|
@focusout=${i=>this.handleFocusOut(i,"search")}
|
|
1255
|
-
${
|
|
1255
|
+
${O(this.searchContainerRef)}
|
|
1256
1256
|
>
|
|
1257
1257
|
<pkt-button
|
|
1258
1258
|
skin="secondary"
|
|
@@ -1267,7 +1267,7 @@
|
|
|
1267
1267
|
>
|
|
1268
1268
|
Søk
|
|
1269
1269
|
</pkt-button>
|
|
1270
|
-
<div class=${e} ${
|
|
1270
|
+
<div class=${e} ${O(this.searchMenuRef)}>
|
|
1271
1271
|
${this.openMenu==="search"?u`
|
|
1272
1272
|
<pkt-textinput
|
|
1273
1273
|
id="mobile-search-menu"
|
|
@@ -1301,7 +1301,7 @@
|
|
|
1301
1301
|
<div
|
|
1302
1302
|
class="pkt-header-service__user-container"
|
|
1303
1303
|
@focusout=${i=>this.handleFocusOut(i,"user")}
|
|
1304
|
-
${
|
|
1304
|
+
${O(this.userContainerRef)}
|
|
1305
1305
|
>
|
|
1306
1306
|
<pkt-button
|
|
1307
1307
|
class=${N({"pkt-header-service__user-button":!0,"pkt-header-service__user-button--mobile":this.isMobile})}
|
|
@@ -1332,7 +1332,7 @@
|
|
|
1332
1332
|
`:k}
|
|
1333
1333
|
</div>
|
|
1334
1334
|
`}renderHeader(){const t=N({"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=N({"pkt-header-service__logo-area":!0,"pkt-header-service__logo-area--without-service":!this.serviceName});return u`
|
|
1335
|
-
<header class=${t} ${
|
|
1335
|
+
<header class=${t} ${O(this.headerRef)}>
|
|
1336
1336
|
<div class=${e}>${this.renderLogo()} ${this.renderServiceName()}</div>
|
|
1337
1337
|
|
|
1338
1338
|
<div class="pkt-header-service__content">
|
|
@@ -1370,7 +1370,7 @@
|
|
|
1370
1370
|
${t}
|
|
1371
1371
|
<div class=${e}></div>
|
|
1372
1372
|
</div>
|
|
1373
|
-
`}return t}};K([o({type:String,attribute:"service-name"})],q.prototype,"serviceName",2),K([o({type:String,attribute:"service-link"})],q.prototype,"serviceLink",2),K([o({type:String,attribute:"logo-link"})],q.prototype,"logoLink",2),K([o({type:String,attribute:"search-placeholder"})],q.prototype,"searchPlaceholder",2),K([o({type:String,attribute:"search-value"})],q.prototype,"searchValue",2),K([o({type:Number,attribute:"mobile-breakpoint"})],q.prototype,"mobileBreakpoint",2),K([o({type:Number,attribute:"tablet-breakpoint"})],q.prototype,"tabletBreakpoint",2),K([o({type:String,attribute:"opened-menu"})],q.prototype,"openedMenu",2),K([o({type:String,attribute:"log-out-button-placement"})],q.prototype,"logOutButtonPlacement",2),K([o({type:String})],q.prototype,"position",2),K([o({type:String,attribute:"scroll-behavior"})],q.prototype,"scrollBehavior",2),K([o({type:String,attribute:"slot-menu-variant"})],q.prototype,"slotMenuVariant",2),K([o({type:String,attribute:"slot-menu-text"})],q.prototype,"slotMenuText",2),K([o({type:Boolean,attribute:"hide-logo",converter:
|
|
1373
|
+
`}return t}};K([o({type:String,attribute:"service-name"})],q.prototype,"serviceName",2),K([o({type:String,attribute:"service-link"})],q.prototype,"serviceLink",2),K([o({type:String,attribute:"logo-link"})],q.prototype,"logoLink",2),K([o({type:String,attribute:"search-placeholder"})],q.prototype,"searchPlaceholder",2),K([o({type:String,attribute:"search-value"})],q.prototype,"searchValue",2),K([o({type:Number,attribute:"mobile-breakpoint"})],q.prototype,"mobileBreakpoint",2),K([o({type:Number,attribute:"tablet-breakpoint"})],q.prototype,"tabletBreakpoint",2),K([o({type:String,attribute:"opened-menu"})],q.prototype,"openedMenu",2),K([o({type:String,attribute:"log-out-button-placement"})],q.prototype,"logOutButtonPlacement",2),K([o({type:String})],q.prototype,"position",2),K([o({type:String,attribute:"scroll-behavior"})],q.prototype,"scrollBehavior",2),K([o({type:String,attribute:"slot-menu-variant"})],q.prototype,"slotMenuVariant",2),K([o({type:String,attribute:"slot-menu-text"})],q.prototype,"slotMenuText",2),K([o({type:Boolean,attribute:"hide-logo",converter:At})],q.prototype,"hideLogo",2),K([o({type:Boolean,converter:At})],q.prototype,"compact",2),K([o({type:Boolean,attribute:"show-search",converter:At})],q.prototype,"showSearch",2),K([o({type:Boolean,attribute:"can-change-representation",converter:At})],q.prototype,"canChangeRepresentation",2),K([o({type:Boolean,attribute:"has-log-out",converter:At})],q.prototype,"hasLogOut",2),K([o({type:Object})],q.prototype,"user",2),K([o({type:Array,attribute:"user-menu"})],q.prototype,"userMenu",2),K([o({type:Object})],q.prototype,"representing",2),K([L()],q.prototype,"isMobile",2),K([L()],q.prototype,"isTablet",2),K([L()],q.prototype,"openMenu",2),K([L()],q.prototype,"isHidden",2),K([L()],q.prototype,"componentWidth",2),K([L()],q.prototype,"hasSlotContent",2),K([L()],q.prototype,"alignSlotRight",2),K([L()],q.prototype,"alignSearchRight",2),q=K([H("pkt-header-service")],q);var Jh=Object.defineProperty,Qh=Object.getOwnPropertyDescriptor,it=(s,t,e,i)=>{for(var n=i>1?void 0:i?Qh(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&&Jh(t,e,n),n};let tt=class extends J{constructor(){super(),this.defaultSlot=A(),this.searchPlaceholder="Søk",this.searchValue="",this.mobileBreakpoint=768,this.tabletBreakpoint=1280,this.openedMenu="none",this.logOutButtonPlacement="none",this.position="fixed",this.scrollBehavior="hide",this.slotMenuVariant="icon-only",this.slotMenuText="Meny",this.hideLogo=!1,this.compact=!1,this.showSearch=!1,this.canChangeRepresentation=!1,this.hasLogOut=!1,this.slotController=new ot(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 u`
|
|
1374
1374
|
<pkt-header-service
|
|
1375
1375
|
service-name=${C(this.serviceName)}
|
|
1376
1376
|
service-link=${C(this.serviceLink)}
|
|
@@ -1394,9 +1394,9 @@
|
|
|
1394
1394
|
.userMenu=${this.effectiveUserMenu}
|
|
1395
1395
|
.representing=${this.representing}
|
|
1396
1396
|
>
|
|
1397
|
-
<div class="pkt-contents" ${
|
|
1397
|
+
<div class="pkt-contents" ${O(this.defaultSlot)}></div>
|
|
1398
1398
|
</pkt-header-service>
|
|
1399
|
-
`}};it([o({type:String,attribute:"service-name"})],tt.prototype,"serviceName",2),it([o({type:String,attribute:"service-link"})],tt.prototype,"serviceLink",2),it([o({type:String,attribute:"logo-link"})],tt.prototype,"logoLink",2),it([o({type:String,attribute:"search-placeholder"})],tt.prototype,"searchPlaceholder",2),it([o({type:String,attribute:"search-value"})],tt.prototype,"searchValue",2),it([o({type:Number,attribute:"mobile-breakpoint"})],tt.prototype,"mobileBreakpoint",2),it([o({type:Number,attribute:"tablet-breakpoint"})],tt.prototype,"tabletBreakpoint",2),it([o({type:String,attribute:"opened-menu"})],tt.prototype,"openedMenu",2),it([o({type:String,attribute:"log-out-button-placement"})],tt.prototype,"logOutButtonPlacement",2),it([o({type:String})],tt.prototype,"position",2),it([o({type:String,attribute:"scroll-behavior"})],tt.prototype,"scrollBehavior",2),it([o({type:String,attribute:"slot-menu-variant"})],tt.prototype,"slotMenuVariant",2),it([o({type:String,attribute:"slot-menu-text"})],tt.prototype,"slotMenuText",2),it([o({type:Boolean,attribute:"hide-logo",converter:
|
|
1399
|
+
`}};it([o({type:String,attribute:"service-name"})],tt.prototype,"serviceName",2),it([o({type:String,attribute:"service-link"})],tt.prototype,"serviceLink",2),it([o({type:String,attribute:"logo-link"})],tt.prototype,"logoLink",2),it([o({type:String,attribute:"search-placeholder"})],tt.prototype,"searchPlaceholder",2),it([o({type:String,attribute:"search-value"})],tt.prototype,"searchValue",2),it([o({type:Number,attribute:"mobile-breakpoint"})],tt.prototype,"mobileBreakpoint",2),it([o({type:Number,attribute:"tablet-breakpoint"})],tt.prototype,"tabletBreakpoint",2),it([o({type:String,attribute:"opened-menu"})],tt.prototype,"openedMenu",2),it([o({type:String,attribute:"log-out-button-placement"})],tt.prototype,"logOutButtonPlacement",2),it([o({type:String})],tt.prototype,"position",2),it([o({type:String,attribute:"scroll-behavior"})],tt.prototype,"scrollBehavior",2),it([o({type:String,attribute:"slot-menu-variant"})],tt.prototype,"slotMenuVariant",2),it([o({type:String,attribute:"slot-menu-text"})],tt.prototype,"slotMenuText",2),it([o({type:Boolean,attribute:"hide-logo",converter:At})],tt.prototype,"hideLogo",2),it([o({type:Boolean,converter:At})],tt.prototype,"compact",2),it([o({type:Boolean,attribute:"show-search",converter:At})],tt.prototype,"showSearch",2),it([o({type:Boolean,attribute:"can-change-representation",converter:At})],tt.prototype,"canChangeRepresentation",2),it([o({type:Boolean,attribute:"has-log-out",converter:At})],tt.prototype,"hasLogOut",2),it([o({type:Object})],tt.prototype,"user",2),it([o({type:Array,attribute:"user-menu"})],tt.prototype,"userMenu",2),it([o({type:Object})],tt.prototype,"representing",2),it([o({type:Array,attribute:"user-menu-footer"})],tt.prototype,"userMenuFooter",2),it([o({type:Array,attribute:"user-options"})],tt.prototype,"userOptions",2),tt=it([H("pkt-header")],tt);var tc=Object.defineProperty,ec=Object.getOwnPropertyDescriptor,Ze=(s,t,e,i)=>{for(var n=i>1?void 0:i?ec(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&&tc(t,e,n),n};let Pe=class extends J{constructor(){super(),this.defaultSlot=A(),this.title="",this.href="#",this.iconName="",this.external=!1,this.openInNewTab=!1,this.skin="normal",this.slotController=new ot(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 u`
|
|
1400
1400
|
<a
|
|
1401
1401
|
href=${this.href}
|
|
1402
1402
|
class=${t}
|
|
@@ -1406,9 +1406,9 @@
|
|
|
1406
1406
|
${this.iconName&&u`<pkt-icon class="pkt-link__icon" name="${this.iconName}" />`}
|
|
1407
1407
|
${this.title&&u`<div class=${e}>${this.title}</div>`}
|
|
1408
1408
|
|
|
1409
|
-
<div class="pkt-linkcard__text" ${
|
|
1409
|
+
<div class="pkt-linkcard__text" ${O(this.defaultSlot)}></div>
|
|
1410
1410
|
</a>
|
|
1411
|
-
`}};Ze([o({type:String,reflect:!0})],Pe.prototype,"title",2),Ze([o({type:String,reflect:!0})],Pe.prototype,"href",2),Ze([o({type:String,reflect:!0})],Pe.prototype,"iconName",2),Ze([o({type:Boolean,reflect:!0})],Pe.prototype,"external",2),Ze([o({type:Boolean,reflect:!0})],Pe.prototype,"openInNewTab",2),Ze([o({type:String,reflect:!0})],Pe.prototype,"skin",2),Pe=Ze([
|
|
1411
|
+
`}};Ze([o({type:String,reflect:!0})],Pe.prototype,"title",2),Ze([o({type:String,reflect:!0})],Pe.prototype,"href",2),Ze([o({type:String,reflect:!0})],Pe.prototype,"iconName",2),Ze([o({type:Boolean,reflect:!0})],Pe.prototype,"external",2),Ze([o({type:Boolean,reflect:!0})],Pe.prototype,"openInNewTab",2),Ze([o({type:String,reflect:!0})],Pe.prototype,"skin",2),Pe=Ze([H("pkt-linkcard")],Pe);var sc=Object.defineProperty,ic=Object.getOwnPropertyDescriptor,ke=(s,t,e,i)=>{for(var n=i>1?void 0:i?ic(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&&sc(t,e,n),n};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/14.5/animations/";let ie=class extends J{constructor(){super(),this.defaultSlot=A(),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 ot(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=N({"pkt-loader":!0,[`pkt-loader--${this.inline?"inline":"box"}`]:!0,[`pkt-loader--${this.size}`]:!0}),e=N({"pkt-contents":!0,"pkt-hide":this.isLoading});return u`<div
|
|
1412
1412
|
role="status"
|
|
1413
1413
|
aria-live="polite"
|
|
1414
1414
|
aria-busy=${this.isLoading?"true":"false"}
|
|
@@ -1422,8 +1422,8 @@
|
|
|
1422
1422
|
></pkt-icon>
|
|
1423
1423
|
${this.message&&u`<p>${this.message}</p>`}
|
|
1424
1424
|
</div>`:k}
|
|
1425
|
-
<div class=${e} ${
|
|
1426
|
-
</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))}};ke([o({type:Number})],ie.prototype,"delay",2),ke([o({type:Boolean})],ie.prototype,"inline",2),ke([o({type:Boolean})],ie.prototype,"isLoading",2),ke([o({type:String})],ie.prototype,"message",2),ke([o({type:String})],ie.prototype,"size",2),ke([o({type:String})],ie.prototype,"variant",2),ke([o({type:String})],ie.prototype,"loadingAnimationPath",2),ke([L()],ie.prototype,"_shouldDisplayLoader",2),ie=ke([
|
|
1425
|
+
<div class=${e} ${O(this.defaultSlot)}></div>
|
|
1426
|
+
</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))}};ke([o({type:Number})],ie.prototype,"delay",2),ke([o({type:Boolean})],ie.prototype,"inline",2),ke([o({type:Boolean})],ie.prototype,"isLoading",2),ke([o({type:String})],ie.prototype,"message",2),ke([o({type:String})],ie.prototype,"size",2),ke([o({type:String})],ie.prototype,"variant",2),ke([o({type:String})],ie.prototype,"loadingAnimationPath",2),ke([L()],ie.prototype,"_shouldDisplayLoader",2),ie=ke([H("pkt-loader")],ie);const nc={skin:{default:"beige"},compact:{default:!1},closable:{default:!1}},Ji={props:nc};var ac=Object.defineProperty,rc=Object.getOwnPropertyDescriptor,vs=(s,t,e,i)=>{for(var n=i>1?void 0:i?rc(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&&ac(t,e,n),n};let Xe=class extends J{constructor(){super(),this.defaultSlot=A(),this.closable=Ji.props.closable.default,this.compact=Ji.props.compact.default,this.title="",this.skin=Ji.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 ot(this,this.defaultSlot),this._isClosed=!1}updated(s){super.updated(s),s.has("_isClosed")&&Hn(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 u`<div class=${N(s)}>
|
|
1427
1427
|
${this.closable?u`<div class="pkt-messagebox__close">
|
|
1428
1428
|
<button
|
|
1429
1429
|
@click=${this.close}
|
|
@@ -1434,29 +1434,29 @@
|
|
|
1434
1434
|
</button>
|
|
1435
1435
|
</div>`:k}
|
|
1436
1436
|
${this.title?u`<div class="pkt-messagebox__title">${this.title}</div>`:k}
|
|
1437
|
-
<div class="pkt-messagebox__text" ${
|
|
1438
|
-
</div>`}};vs([o({type:Boolean,reflect:!0})],Xe.prototype,"closable",2),vs([o({type:Boolean,reflect:!0})],Xe.prototype,"compact",2),vs([o({type:String,reflect:!0})],Xe.prototype,"title",2),vs([o({type:String,reflect:!0})],Xe.prototype,"skin",2),vs([L()],Xe.prototype,"_isClosed",2),Xe=vs([
|
|
1437
|
+
<div class="pkt-messagebox__text" ${O(this.defaultSlot)}></div>
|
|
1438
|
+
</div>`}};vs([o({type:Boolean,reflect:!0})],Xe.prototype,"closable",2),vs([o({type:Boolean,reflect:!0})],Xe.prototype,"compact",2),vs([o({type:String,reflect:!0})],Xe.prototype,"title",2),vs([o({type:String,reflect:!0})],Xe.prototype,"skin",2),vs([L()],Xe.prototype,"_isClosed",2),Xe=vs([H("pkt-messagebox")],Xe);const oc={hideCloseButton:{default:!1},closeOnBackdropClick:{default:!1},size:{default:"medium"}},Qi={props:oc};var lc=Object.defineProperty,hc=Object.getOwnPropertyDescriptor,ne=(s,t,e,i)=>{for(var n=i>1?void 0:i?hc(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&&lc(t,e,n),n};let Ht=class extends J{constructor(){super(),this.headingText="",this.removePadding=!1,this.hideCloseButton=Qi.props.hideCloseButton.default,this.closeOnBackdropClick=Qi.props.closeOnBackdropClick.default,this.closeButtonSkin="blue",this.size=Qi.props.size.default,this.variant="dialog",this.drawerPosition="right",this.transparentBackdrop=!1,this.defaultSlot=A(),this.dialogRef=A(),this._isOpen=!1,this.close=(s,t=!1)=>{var e;if(!this._isOpen)return;this._isOpen=!1,document.body.classList.remove("pkt-modal--open");const i=document.activeElement;i&&!this.isElementInViewport(i)&&i.scrollIntoView({behavior:"smooth",block:"nearest"}),this.dispatchEvent(new CustomEvent("close",{detail:{origin:s},bubbles:!0,composed:!0})),t||(e=this.dialogRef.value)==null||e.close(),this.requestUpdate()},this.showModal=(s=null)=>{var t;this._isOpen=!0,(t=this.dialogRef.value)==null||t.showModal();const e=document.querySelector(".pkt-modal");requestAnimationFrame(()=>{var i;this.dialogRef.value&&((i=this.dialogRef.value)==null||i.focus())}),e&&document.body.classList.add("pkt-modal--open"),this.dispatchEvent(new CustomEvent("showModal",{detail:{origin:s},bubbles:!0,composed:!0})),this.requestUpdate()},this.slotController=new ot(this,this.defaultSlot),this._isOpen=!1}async connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleKeyDown.bind(this)),document.addEventListener("click",this.handleBackdropClick.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("click",this.handleBackdropClick)}async firstUpdated(s){super.firstUpdated(s),this.dialogRef.value&&!window.HTMLDialogElement&&!this.dialogRef.value.showModal&&("document"in window&&"createElement"in document&&(await Promise.resolve().then(()=>dd).then(t=>t.default)).registerDialog(this.dialogRef.value),this.dialogRef.value.addEventListener("close",()=>{this.close(new Event("close"),!0)}))}handleKeyDown(s){s.key==="Escape"&&this.close(s)}handleBackdropClick(s){var t;this.closeOnBackdropClick&&s.target===((t=this.dialogRef)==null?void 0:t.value)&&this.close(s)}isElementInViewport(s){const t=s.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}render(){const s={"pkt-modal":!0,"pkt-modal--removePadding":this.removePadding??!1,"pkt-modal--noHeadingText":this.headingText===""||this.headingText===void 0,"pkt-modal--noShadow":this.closeButtonSkin==="yellow-filled","pkt-modal--transparentBackdrop":this.transparentBackdrop??!1,[`pkt-modal--${this.size}`]:this.size!==void 0,[`pkt-modal__${this.variant}`]:this.variant!==void 0,[`pkt-modal__drawer--${this.drawerPosition}`]:this.variant==="drawer"},t={"pkt-modal__headingText":!0,"pkt-txt-24":!0},e={"pkt-modal__content":!0,"pkt-txt-18-light":!0},i=this.closeButtonSkin==="blue",n={"pkt-modal__closeButton":!0,[`pkt-modal__closeButton--${this.closeButtonSkin}`]:!0};return u`
|
|
1439
1439
|
<dialog
|
|
1440
|
-
class=${N(
|
|
1441
|
-
${
|
|
1440
|
+
class=${N(s)}
|
|
1441
|
+
${O(this.dialogRef)}
|
|
1442
1442
|
aria-labelledby="pkt-modal__headingText"
|
|
1443
1443
|
aria-describedby="pkt-modal__content"
|
|
1444
|
-
@close=${
|
|
1444
|
+
@close=${a=>this.close(a,!0)}
|
|
1445
1445
|
>
|
|
1446
1446
|
<div class="pkt-modal__wrapper">
|
|
1447
1447
|
${this.headingText||!this.hideCloseButton?u`<div class="pkt-modal__header">
|
|
1448
1448
|
<div class="pkt-modal__header-background"></div>
|
|
1449
|
-
${this.headingText?u`<h1 id="pkt-modal__headingText" class=${N(
|
|
1449
|
+
${this.headingText?u`<h1 id="pkt-modal__headingText" class=${N(t)}>
|
|
1450
1450
|
${this.headingText}
|
|
1451
1451
|
</h1>`:u`<div class="pkt-modal__headingText"></div>`}
|
|
1452
|
-
${this.hideCloseButton?u`<div class="pkt-modal__noCloseButton"></div>`:u`<div class="${N(
|
|
1452
|
+
${this.hideCloseButton?u`<div class="pkt-modal__noCloseButton"></div>`:u`<div class="${N(n)}">
|
|
1453
1453
|
<pkt-button
|
|
1454
|
-
@click=${
|
|
1454
|
+
@click=${a=>this.close(a)}
|
|
1455
1455
|
aria-label="close"
|
|
1456
1456
|
iconname="close"
|
|
1457
1457
|
variant="icon-only"
|
|
1458
1458
|
size="medium"
|
|
1459
|
-
skin=${
|
|
1459
|
+
skin=${i?"tertiary":"primary"}
|
|
1460
1460
|
>
|
|
1461
1461
|
Lukk
|
|
1462
1462
|
</pkt-button>
|
|
@@ -1465,20 +1465,20 @@
|
|
|
1465
1465
|
<div class="pkt-modal__container">
|
|
1466
1466
|
<div
|
|
1467
1467
|
id="pkt-modal__content"
|
|
1468
|
-
class=${N(
|
|
1469
|
-
${
|
|
1468
|
+
class=${N(e)}
|
|
1469
|
+
${O(this.defaultSlot)}
|
|
1470
1470
|
></div>
|
|
1471
1471
|
</div>
|
|
1472
1472
|
</div>
|
|
1473
1473
|
</dialog>
|
|
1474
|
-
`}};ne([o({type:String})],
|
|
1474
|
+
`}};ne([o({type:String})],Ht.prototype,"headingText",2),ne([o({type:Boolean})],Ht.prototype,"removePadding",2),ne([o({type:Boolean})],Ht.prototype,"hideCloseButton",2),ne([o({type:Boolean})],Ht.prototype,"closeOnBackdropClick",2),ne([o({type:String})],Ht.prototype,"closeButtonSkin",2),ne([o({type:String})],Ht.prototype,"size",2),ne([o({type:String})],Ht.prototype,"variant",2),ne([o({type:String})],Ht.prototype,"drawerPosition",2),ne([o({type:Boolean})],Ht.prototype,"transparentBackdrop",2),ne([L()],Ht.prototype,"_isOpen",2),Ht=ne([H("pkt-modal")],Ht);/**
|
|
1475
1475
|
* @license
|
|
1476
1476
|
* Copyright 2018 Google LLC
|
|
1477
1477
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1478
|
-
*/const
|
|
1478
|
+
*/const $a="important",cc=" !"+$a,dc=Fe(class extends rs{constructor(s){var t;if(super(s),s.type!==Qt.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(cc);i.includes("-")||a?e.setProperty(i,a?n.slice(0,-11):n,a?$a:""):e[i]=n}}return Et}});var uc=Object.defineProperty,pc=Object.getOwnPropertyDescriptor,gt=(s,t,e,i)=>{for(var n=i>1?void 0:i?pc(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&&uc(t,e,n),n};let ct=class extends J{constructor(){super(),this.ariaLabel=null,this.ariaLabelledby=null,this.ariaValueText=null,this.ariaLive="polite",this.id=Ae(),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=A(),this.progressBarRef=A()}firstUpdated(t){super.firstUpdated(t),this.setComputedValues(),this.syncAttributes()}updated(t){super.updated(t),t.has("valueCurrent")&&this.labelRef.value&&(this.labelWidth=this.labelRef.value.getBoundingClientRect().width||0),t.has("id")&&this.id&&(this.progressBarId=this.id),(t.has("statusType")||t.has("id")||t.has("ariaLabelledby"))&&(this.progressbarId=this.id||Ae(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`),(t.has("ariaValueText")||t.has("valueCurrent")||t.has("valueMax"))&&(this.computedAriaValueText=this.statusType==="fraction"&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||""),this.syncAttributes()}render(){const t=this.statusType!=="none",e=this.valueMax-this.valueMin,i=this.valueCurrent/e*100,n=this.statusType==="fraction"?Math.round(i):Math.round((this.valueCurrent-this.valueMin)/(this.valueMax-this.valueMin)*100),a=`${this.valueCurrent} av ${e}`,r=N({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),h=N({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition==="center"}),d=N({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement==="center"}),p=N({"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 u` <div
|
|
1479
1479
|
class="pkt-progressbar__container"
|
|
1480
1480
|
.ref=${this.progressBarRef}
|
|
1481
|
-
style=${
|
|
1481
|
+
style=${dc({"--pkt-progress-label-width":`${this.labelWidth}px`,"--pkt-progress-width":`${n}%`})}
|
|
1482
1482
|
>
|
|
1483
1483
|
${this.title?u`<p id=${`${this.progressBarId}-title`} class=${h}>${this.title}</p>`:k}
|
|
1484
1484
|
|
|
@@ -1487,11 +1487,11 @@
|
|
|
1487
1487
|
</div>
|
|
1488
1488
|
|
|
1489
1489
|
${t?u`<div class=${d}>
|
|
1490
|
-
<span class=${p} ${
|
|
1490
|
+
<span class=${p} ${O(this.labelRef)}>
|
|
1491
1491
|
${this.statusType==="percentage"?`${n}%`:a}
|
|
1492
1492
|
</span>
|
|
1493
1493
|
</div>`:k}
|
|
1494
|
-
</div>`}setComputedValues(){this.progressbarId=this.id||Ae(),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(t,e){e==null||e===""?this.removeAttribute(t):this.setAttribute(t,String(e))}};
|
|
1494
|
+
</div>`}setComputedValues(){this.progressbarId=this.id||Ae(),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(t,e){e==null||e===""?this.removeAttribute(t):this.setAttribute(t,String(e))}};gt([o({type:String})],ct.prototype,"ariaLabel",2),gt([o({type:String,reflect:!0})],ct.prototype,"ariaLabelledby",2),gt([o({type:String,reflect:!0})],ct.prototype,"ariaValueText",2),gt([o({type:String})],ct.prototype,"ariaLive",2),gt([o({type:String,reflect:!0})],ct.prototype,"id",2),gt([o({type:String})],ct.prototype,"role",2),gt([o({type:String})],ct.prototype,"skin",2),gt([o({type:String})],ct.prototype,"statusPlacement",2),gt([o({type:String})],ct.prototype,"statusType",2),gt([o({type:String,reflect:!0})],ct.prototype,"title",2),gt([o({type:String})],ct.prototype,"titlePosition",2),gt([o({type:Number,reflect:!0})],ct.prototype,"valueCurrent",2),gt([o({type:Number})],ct.prototype,"valueMax",2),gt([o({type:Number})],ct.prototype,"valueMin",2),gt([L()],ct.prototype,"labelWidth",2),gt([L()],ct.prototype,"progressbarId",2),gt([L()],ct.prototype,"computedAriaLabelledby",2),gt([L()],ct.prototype,"computedAriaValueText",2),ct=gt([H("pkt-progressbar")],ct);var fc=Object.defineProperty,gc=Object.getOwnPropertyDescriptor,jt=(s,t,e,i)=>{for(var n=i>1?void 0:i?gc(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&&fc(t,e,n),n};let Pt=class extends I{constructor(){super(...arguments),this.inputRef=A(),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=N({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),t=N({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),e=N({"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=()=>u`
|
|
1495
1495
|
${this.tagText?u`<span class=${i+" pkt-tag--gray"}>${this.tagText}</span>`:k}
|
|
1496
1496
|
${this.optionalTag?u`<span class=${i+" pkt-tag--blue-light"}>${this.optionalText}</span>`:k}
|
|
1497
1497
|
${this.requiredTag?u`<span class=${i+" pkt-tag--beige"}>${this.requiredText}</span>`:k}
|
|
@@ -1511,7 +1511,7 @@
|
|
|
1511
1511
|
?disabled=${this.disabled}
|
|
1512
1512
|
form=""
|
|
1513
1513
|
name=${this.name+"-internal"}
|
|
1514
|
-
${
|
|
1514
|
+
${O(this.inputRef)}
|
|
1515
1515
|
@change=${this.toggleChecked}
|
|
1516
1516
|
@input=${this.onInput}
|
|
1517
1517
|
@blur=${this.onBlur}
|
|
@@ -1521,11 +1521,11 @@
|
|
|
1521
1521
|
${a()}
|
|
1522
1522
|
</div>
|
|
1523
1523
|
</div>
|
|
1524
|
-
`}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))}};
|
|
1524
|
+
`}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))}};jt([o({type:String,reflect:!0})],Pt.prototype,"value",2),jt([o({type:String})],Pt.prototype,"checkHelptext",2),jt([o({type:Boolean})],Pt.prototype,"defaultChecked",2),jt([o({type:Boolean})],Pt.prototype,"hasTile",2),jt([o({type:Boolean,reflect:!0})],Pt.prototype,"checked",2),jt([o({type:String,reflect:!0})],Pt.prototype,"type",2),jt([o({type:String})],Pt.prototype,"tagText",2),jt([o({type:Boolean})],Pt.prototype,"optionalTag",2),jt([o({type:String})],Pt.prototype,"optionalText",2),jt([o({type:Boolean})],Pt.prototype,"requiredTag",2),jt([o({type:String})],Pt.prototype,"requiredText",2),jt([L()],Pt.prototype,"_checked",2),Pt=jt([H("pkt-radiobutton")],Pt);/**
|
|
1525
1525
|
* @license
|
|
1526
1526
|
* Copyright 2021 Google LLC
|
|
1527
1527
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1528
|
-
*/let
|
|
1528
|
+
*/let _a=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}};/**
|
|
1529
1529
|
* @license
|
|
1530
1530
|
* Copyright 2021 Google LLC
|
|
1531
1531
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -1533,33 +1533,33 @@
|
|
|
1533
1533
|
* @license
|
|
1534
1534
|
* Copyright 2021 Google LLC
|
|
1535
1535
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1536
|
-
*/let
|
|
1536
|
+
*/let wa=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 _a(this.context,this.host,this.t,this.subscribe))}};/**
|
|
1537
1537
|
* @license
|
|
1538
1538
|
* Copyright 2021 Google LLC
|
|
1539
1539
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1540
|
-
*/class
|
|
1540
|
+
*/class mc{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()}}/**
|
|
1541
1541
|
* @license
|
|
1542
1542
|
* Copyright 2021 Google LLC
|
|
1543
1543
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1544
|
-
*/let
|
|
1544
|
+
*/let vc=class extends Event{constructor(t,e){super("context-provider",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e}},xa=class extends mc{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:p}]of this.subscriptions)h.has(d)||(h.add(d),p.dispatchEvent(new _a(this.context,p,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 vc(this.context,this.host))}};/**
|
|
1545
1545
|
* @license
|
|
1546
1546
|
* Copyright 2017 Google LLC
|
|
1547
1547
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1548
|
-
*/function
|
|
1548
|
+
*/function bc({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 xa(this,{context:s,initialValue:n})),n}};{t.constructor.addInitializer((r=>{i.set(r,new xa(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)}}}/**
|
|
1549
1549
|
* @license
|
|
1550
1550
|
* Copyright 2022 Google LLC
|
|
1551
1551
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1552
|
-
*/function
|
|
1552
|
+
*/function kc({context:s,subscribe:t}){return(e,i)=>{typeof i=="object"?i.addInitializer((function(){new wa(this,{context:s,callback:n=>{e.set.call(this,n)},subscribe:t})})):e.constructor.addInitializer((n=>{new wa(n,{context:s,callback:a=>{n[i]=a},subscribe:t})}))}}const Sa=Symbol("pkt-tabs-context");var yc=Object.defineProperty,$c=Object.getOwnPropertyDescriptor,bs=(s,t,e,i)=>{for(var n=i>1?void 0:i?$c(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&&yc(t,e,n),n};let Je=class extends J{constructor(){super(),this.arrowNav=!0,this.disableArrowNav=!1,this.tabRefs=[],this.tabCount=0,this.defaultSlot=A(),this.context={useArrowNav:this.useArrowNav,registerTab:this.registerTab.bind(this),handleClick:this.handleClick.bind(this),handleKeyUp:this.handleKeyUp.bind(this)},this.slotController=new ot(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 u`
|
|
1553
1553
|
<div class="pkt-tabs">
|
|
1554
|
-
<div class="pkt-tabs__list" role=${t} ${
|
|
1554
|
+
<div class="pkt-tabs__list" role=${t} ${O(this.defaultSlot)}></div>
|
|
1555
1555
|
</div>
|
|
1556
|
-
`}};bs([o({type:Boolean,reflect:!0,attribute:"arrow-nav"})],Je.prototype,"arrowNav",2),bs([o({type:Boolean,reflect:!0,attribute:"disable-arrow-nav"})],Je.prototype,"disableArrowNav",2),bs([L()],Je.prototype,"tabRefs",2),bs([L()],Je.prototype,"tabCount",2),bs([
|
|
1556
|
+
`}};bs([o({type:Boolean,reflect:!0,attribute:"arrow-nav"})],Je.prototype,"arrowNav",2),bs([o({type:Boolean,reflect:!0,attribute:"disable-arrow-nav"})],Je.prototype,"disableArrowNav",2),bs([L()],Je.prototype,"tabRefs",2),bs([L()],Je.prototype,"tabCount",2),bs([bc({context:Sa}),L()],Je.prototype,"context",2),Je=bs([H("pkt-tabs")],Je);var _c=Object.defineProperty,wc=Object.getOwnPropertyDescriptor,ye=(s,t,e,i)=>{for(var n=i>1?void 0:i?wc(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&&_c(t,e,n),n};let ue=class extends J{constructor(){super(),this.active=!1,this.href="",this.icon="",this.controls="",this.tag="",this.tagSkin="blue",this.index=0,this.elementRef=A(),this.defaultSlot=A(),this.slotController=new ot(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=u`
|
|
1557
1557
|
${this.icon?u`<pkt-icon name=${this.icon} class="pkt-icon--small"></pkt-icon>`:""}
|
|
1558
|
-
<span ${
|
|
1558
|
+
<span ${O(this.defaultSlot)}></span>
|
|
1559
1559
|
${this.tag?u`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>`:""}
|
|
1560
1560
|
`;return this.href?u`
|
|
1561
1561
|
<a
|
|
1562
|
-
${
|
|
1562
|
+
${O(this.elementRef)}
|
|
1563
1563
|
href=${this.href}
|
|
1564
1564
|
class="pkt-tabs__link ${i}"
|
|
1565
1565
|
role=${C(n)}
|
|
@@ -1573,7 +1573,7 @@
|
|
|
1573
1573
|
</a>
|
|
1574
1574
|
`:u`
|
|
1575
1575
|
<button
|
|
1576
|
-
${
|
|
1576
|
+
${O(this.elementRef)}
|
|
1577
1577
|
type="button"
|
|
1578
1578
|
class="pkt-tabs__button pkt-link-button ${i}"
|
|
1579
1579
|
role=${C(n)}
|
|
@@ -1585,11 +1585,11 @@
|
|
|
1585
1585
|
>
|
|
1586
1586
|
${h}
|
|
1587
1587
|
</button>
|
|
1588
|
-
`}};ye([o({type:Boolean,reflect:!0})],ue.prototype,"active",2),ye([o({type:String,reflect:!0})],ue.prototype,"href",2),ye([o({type:String,reflect:!0})],ue.prototype,"icon",2),ye([o({type:String,reflect:!0})],ue.prototype,"controls",2),ye([o({type:String,reflect:!0})],ue.prototype,"tag",2),ye([o({type:String,reflect:!0,attribute:"tag-skin"})],ue.prototype,"tagSkin",2),ye([o({type:Number,reflect:!0})],ue.prototype,"index",2),ye([
|
|
1588
|
+
`}};ye([o({type:Boolean,reflect:!0})],ue.prototype,"active",2),ye([o({type:String,reflect:!0})],ue.prototype,"href",2),ye([o({type:String,reflect:!0})],ue.prototype,"icon",2),ye([o({type:String,reflect:!0})],ue.prototype,"controls",2),ye([o({type:String,reflect:!0})],ue.prototype,"tag",2),ye([o({type:String,reflect:!0,attribute:"tag-skin"})],ue.prototype,"tagSkin",2),ye([o({type:Number,reflect:!0})],ue.prototype,"index",2),ye([kc({context:Sa,subscribe:!0}),o({attribute:!1})],ue.prototype,"context",2),ue=ye([H("pkt-tab-item")],ue);/**
|
|
1589
1589
|
* @license
|
|
1590
1590
|
* Copyright 2020 Google LLC
|
|
1591
1591
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1592
|
-
*/const
|
|
1592
|
+
*/const xc=Fe(class extends rs{constructor(s){if(super(s),s.type!==Qt.PROPERTY&&s.type!==Qt.ATTRIBUTE&&s.type!==Qt.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Ln(s))throw Error("`live` bindings can only contain a single expression")}render(s){return s}update(s,[t]){if(t===Et||t===k)return t;const e=s.element,i=s.name;if(s.type===Qt.PROPERTY){if(t===e[i])return Et}else if(s.type===Qt.BOOLEAN_ATTRIBUTE){if(!!t===e.hasAttribute(i))return Et}else if(s.type===Qt.ATTRIBUTE&&e.getAttribute(i)===t+"")return Et;return Fn(s),t}});var Sc=Object.defineProperty,Cc=Object.getOwnPropertyDescriptor,Zs=(s,t,e,i)=>{for(var n=i>1?void 0:i?Cc(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&&Sc(t,e,n),n};let ks=class extends I{constructor(){super(),this.inputRef=A(),this.helptextSlot=A(),this.value="",this.autocomplete="off",this.rows=null,this.counterCurrent=0,this.slotController=new ot(this,this.helptextSlot)}attributeChangedCallback(s,t,e){s==="value"&&this.value!==t&&(this.counterCurrent=e?e.length:0,this.valueChanged(e,t)),super.attributeChangedCallback(s,t,e)}updated(s){var t;super.updated(s),s.has("value")&&(this.counterCurrent=((t=this.value)==null?void 0:t.length)||0,this.valueChanged(this.value,s.get("value"))),s.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const s=N({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),t=this.ariaLabelledby||`${this.id}-input-label`;return u`<pkt-input-wrapper
|
|
1593
1593
|
label=${this.label}
|
|
1594
1594
|
?counter=${this.counter}
|
|
1595
1595
|
?disabled=${this.disabled}
|
|
@@ -1612,29 +1612,29 @@
|
|
|
1612
1612
|
.tagText=${this.tagText}
|
|
1613
1613
|
class="pkt-textarea"
|
|
1614
1614
|
>
|
|
1615
|
-
<div class="pkt-contents" ${
|
|
1615
|
+
<div class="pkt-contents" ${O(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1616
1616
|
<textarea
|
|
1617
|
-
${
|
|
1618
|
-
class=${
|
|
1617
|
+
${O(this.inputRef)}
|
|
1618
|
+
class=${s}
|
|
1619
1619
|
id=${this.id+"-input"}
|
|
1620
1620
|
name=${(this.name||this.id)+"-input"}
|
|
1621
1621
|
placeholder=${C(this.placeholder)}
|
|
1622
|
-
.value=${
|
|
1622
|
+
.value=${xc(this.value)}
|
|
1623
1623
|
minlength=${C(this.minlength)}
|
|
1624
1624
|
maxlength=${C(this.maxlength)}
|
|
1625
1625
|
?readonly=${this.readonly}
|
|
1626
1626
|
autocomplete=${this.autocomplete}
|
|
1627
|
-
aria-labelledby=${
|
|
1627
|
+
aria-labelledby=${t}
|
|
1628
1628
|
aria-invalid=${this.hasError}
|
|
1629
1629
|
aria-errormessage=${`${this.id}-error`}
|
|
1630
1630
|
rows=${this.rows}
|
|
1631
1631
|
?disabled=${this.disabled}
|
|
1632
|
-
@input=${
|
|
1633
|
-
@change=${
|
|
1634
|
-
@focus=${
|
|
1635
|
-
@blur=${
|
|
1632
|
+
@input=${e=>{this.value=e.target.value,this.onInput(),e.stopImmediatePropagation()}}
|
|
1633
|
+
@change=${e=>{e.stopImmediatePropagation()}}
|
|
1634
|
+
@focus=${e=>{this.onFocus(),e.stopImmediatePropagation()}}
|
|
1635
|
+
@blur=${e=>{this.value=e.target.value,this.onBlur(),e.stopImmediatePropagation()}}
|
|
1636
1636
|
></textarea>
|
|
1637
|
-
</pkt-input-wrapper>`}};
|
|
1637
|
+
</pkt-input-wrapper>`}};Zs([o({type:String,reflect:!0})],ks.prototype,"value",2),Zs([o({type:String})],ks.prototype,"autocomplete",2),Zs([o({type:Number})],ks.prototype,"rows",2),Zs([L()],ks.prototype,"counterCurrent",2),ks=Zs([H("pkt-textarea")],ks);var Tc=Object.defineProperty,Ca=(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&&Tc(t,e,n),n};let tn=class extends I{constructor(){super(...arguments),this._optionsProp=[],this._options=[]}get options(){return this._options.map(t=>({...t,selected:this.isOptionSelected(t)}))}set options(t){this._optionsProp=t,this.requestUpdate("_optionsProp",this._options)}isOptionSelected(t){return Array.isArray(this.value)?this.value.includes(t.value):t.value===this.value}findOptionByValue(t){return this._options.find(e=>e.value===t)}getSelectedOptions(){return this._options.filter(t=>this.isOptionSelected(t))}parseOptions(){var t,e;const i=this._optionsProp.length>0,n=((e=(t=this.optionsController)==null?void 0:t.nodes)==null?void 0:e.length)&&this.optionsController.nodes.length>0;i?this._options=this._optionsProp:n&&(this._options=this.optionsController.options)}willUpdate(t){super.willUpdate(t),this.parseOptions()}};Ca([o({type:Array,attribute:"options"})],tn.prototype,"_optionsProp"),Ca([L()],tn.prototype,"_options");var Nc=Object.defineProperty,Ec=Object.getOwnPropertyDescriptor,Ta=(s,t,e,i)=>{for(var n=i>1?void 0:i?Ec(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&&Nc(t,e,n),n};let en=class extends tn{constructor(){super(),this.inputRef=A(),this.helptextSlot=A(),this.value="",this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new va(this),this.slotController=new ot(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){super.connectedCallback(),this.parseOptions(),this._options.forEach(s=>{s.selected&&!this.value&&(this.value=s.value)})}add(s,t){const e={value:s.value||s.text,label:s.text||s.value,selected:s.selected,disabled:s.disabled};if(t===void 0)this._options.push(e);else if(typeof t=="number")this._options.splice(t,0,e);else{const i=t.value||t.text,n=this._options.findIndex(a=>a.value===i);n>=0?this._options.splice(n,0,e):this._options.push(e)}s.selected&&(this.value=s.value||s.text,this.selectedIndex=this._options.findIndex(i=>i.value===this.value)),this.requestUpdate()}remove(s){var t;typeof s=="number"&&(this.selectedIndex===s&&(this.value=((t=this._options[0])==null?void 0:t.value)||""),this._options.splice(s,1),this.requestUpdate())}item(s){var t;return(t=this.inputRef.value)==null?void 0:t.item(s)}namedItem(s){var t;return(t=this.inputRef.value)==null?void 0:t.namedItem(s)}showPicker(){this.inputRef.value&&"showPicker"in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(s,t,e){var i,n;s==="options"&&(this._options=e?JSON.parse(e):[]),s==="value"&&this.value!==t&&(this.selectedIndex=this.touched?this.returnNumberOrNull((i=this.inputRef.value)==null?void 0:i.selectedIndex):this._options.findIndex(a=>a.value===e),this.selectedOptions=(n=this.inputRef.value)==null?void 0:n.selectedOptions,this.valueChanged(e,t)),super.attributeChangedCallback(s,t,e)}update(s){var t,e;super.update(s),s.has("_optionsProp")&&this._optionsProp.length>0&&(this._options=this._optionsProp,this.requestUpdate("_options"),!this.value&&this._options.length>0&&(this.value=this._options[0].value,this.selectedIndex=0)),s.has("value")&&this.value!==s.get("value")&&(this.selectedIndex=this.touched?this.returnNumberOrNull((t=this.inputRef.value)==null?void 0:t.selectedIndex):this._options.findIndex(i=>i.value===this.value),this.selectedOptions=(e=this.inputRef.value)==null?void 0:e.selectedOptions,this.valueChanged(this.value,s.get("value"))),s.has("id")&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(s){var t;super.firstUpdated(s),this._optionsProp.length&&(this._options=this._optionsProp),!this.value&&this._options.length>0?(this.value=this._options[0].value,this.selectedIndex=0):this.selectedIndex=this._options.findIndex(e=>e.value===this.value),this.selectedOptions=(t=this.inputRef.value)==null?void 0:t.selectedOptions}render(){const s=`pkt-input ${this.fullwidth?"pkt-input--fullwidth":""}`;return u`
|
|
1638
1638
|
<pkt-input-wrapper
|
|
1639
1639
|
?counter=${this.counter}
|
|
1640
1640
|
?disabled=${this.disabled}
|
|
@@ -1669,7 +1669,7 @@
|
|
|
1669
1669
|
@input=${t=>{this.onInput(),t.stopImmediatePropagation()}}
|
|
1670
1670
|
@focus=${t=>{this.onFocus(),t.stopImmediatePropagation()}}
|
|
1671
1671
|
@blur=${t=>{this.onBlur(),t.stopImmediatePropagation()}}
|
|
1672
|
-
${
|
|
1672
|
+
${O(this.inputRef)}
|
|
1673
1673
|
>
|
|
1674
1674
|
${this._options.length>0?this._options.map(t=>u`<option
|
|
1675
1675
|
value=${t.value}
|
|
@@ -1680,38 +1680,10 @@
|
|
|
1680
1680
|
${t.label}
|
|
1681
1681
|
</option>`):""}
|
|
1682
1682
|
</select>
|
|
1683
|
-
<div class="pkt-contents" ${
|
|
1683
|
+
<div class="pkt-contents" ${O(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1684
1684
|
</pkt-input-wrapper>
|
|
1685
|
-
`}returnNumberOrNull(s){return s==null||isNaN(s)?null:s}};
|
|
1686
|
-
<div class="${N(s)}">
|
|
1687
|
-
<h1 class="pkt-txt-28">${this.string}</h1>
|
|
1688
|
-
|
|
1689
|
-
<h2 class="pkt-txt-22">Innhold fra attributter og funksjoner</h2>
|
|
1690
|
-
<div>${this.renderList(this.strings)}</div>
|
|
1691
|
-
<div>${this.renderList(this.doStuff(this._list))}</div>
|
|
1692
|
-
|
|
1693
|
-
<h2 class="pkt-txt-22">Slot</h2>
|
|
1694
|
-
<div ${M(this.defaultSlot)}>defaultSlotRef</div>
|
|
1695
|
-
<h2 class="pkt-txt-22">Named slot</h2>
|
|
1696
|
-
<select
|
|
1697
|
-
name="named-slot"
|
|
1698
|
-
${M(this.namedSlot)}
|
|
1699
|
-
@change=${t=>alert(t.target.value)}
|
|
1700
|
-
>
|
|
1701
|
-
namedSlotRef
|
|
1702
|
-
</select>
|
|
1703
|
-
|
|
1704
|
-
<h2 class="pkt-txt-22">Knapp som emitter en event</h2>
|
|
1705
|
-
<button type="button" @click=${()=>this.handleGreeting()}>
|
|
1706
|
-
Si ${Ct.example.hi}
|
|
1707
|
-
</button>
|
|
1708
|
-
</div>
|
|
1709
|
-
`}renderList(s){return u`
|
|
1710
|
-
<ul>
|
|
1711
|
-
${s.map(t=>u`<li>${t}</li>`)}
|
|
1712
|
-
</ul>
|
|
1713
|
-
`}doStuff(s){return s.reverse()}handleGreeting(){this.dispatchEvent(new CustomEvent("pkt-greeting",{detail:"Hei på deg!"}))}};Js([o({type:String})],ys.prototype,"string",2),Js([o({converter:da})],ys.prototype,"strings",2),Js([o({type:Boolean})],ys.prototype,"darkmode",2),Js([o({type:Array})],ys.prototype,"_list",2),ys=Js([j("pkt-component")],ys);const W=Jt({tagName:"pkt-icon",elementClass:je,react:w,displayName:"PktIcon",events:{}}),Ma=w.forwardRef(({defaultOpen:s=!1,id:t,title:e,skin:i,compact:n=!1,isOpen:a,children:r,name:h,className:d,onClick:p,onToggle:m},v)=>{const[y,$]=w.useState(s),{name:b}=ar(),x=h||b,T=a!==void 0?a:y;w.useEffect(()=>{a===void 0&&$(s)},[s,a]);const O=A=>{const et=A.currentTarget.open;a===void 0&&$(et),m==null||m(A)},S=A=>{setTimeout(()=>{p==null||p(A)},0)},B=["pkt-accordion-item",n&&"pkt-accordion-item--compact",i&&`pkt-accordion-item--${i}`,d].filter(Boolean).join(" ");return l.jsxs("details",{ref:v,className:B,id:t,open:T,onClick:S,name:x,onToggle:O,children:[l.jsxs("summary",{className:"pkt-accordion-item__title",id:`pkt-accordion-item-summary-${t}`,children:[e,l.jsx(W,{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 Tc(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var nn={exports:{}};/*!
|
|
1685
|
+
`}returnNumberOrNull(s){return s==null||isNaN(s)?null:s}};Ta([o({type:String})],en.prototype,"value",2),en=Ta([H("pkt-select")],en);const W=Jt({tagName:"pkt-icon",elementClass:He,react:w,displayName:"PktIcon",events:{}}),Na=w.forwardRef(({defaultOpen:s=!1,id:t,title:e,skin:i,compact:n=!1,isOpen:a,children:r,name:h,className:d,onClick:p,onToggle:m},v)=>{const[y,$]=w.useState(s),{name:b}=hr(),x=h||b,T=a!==void 0?a:y;w.useEffect(()=>{a===void 0&&$(s)},[s,a]);const M=E=>{const et=E.currentTarget.open;a===void 0&&$(et),m==null||m(E)},S=E=>{setTimeout(()=>{p==null||p(E)},0)},B=["pkt-accordion-item",n&&"pkt-accordion-item--compact",i&&`pkt-accordion-item--${i}`,d].filter(Boolean).join(" ");return l.jsxs("details",{ref:v,className:B,id:t,open:T,onClick:S,name:x,onToggle:M,children:[l.jsxs("summary",{className:"pkt-accordion-item__title",id:`pkt-accordion-item-summary-${t}`,children:[e,l.jsx(W,{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})})]})});Na.displayName="PktAccordionItem";function Mc(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var sn={exports:{}};/*!
|
|
1714
1686
|
Copyright (c) 2018 Jed Watson.
|
|
1715
1687
|
Licensed under the MIT License (MIT), see
|
|
1716
1688
|
http://jedwatson.github.io/classnames
|
|
1717
|
-
*/var Aa;function Nc(){return Aa||(Aa=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})()})(nn)),nn.exports}var Ec=Nc();const Z=Tc(Ec),an=({children:s,closeAlert:t,compact:e,title:i,date:n,ariaLive:a,"aria-live":r="polite",role:h="status",skin:d="info",className:p,...m})=>{const[v,y]=w.useState(!1),$={"pkt-alert":!0,"pkt-alert--compact":e,[`pkt-alert--${d}`]:d,"pkt-hide":v},b={"pkt-alert__grid":!0,"pkt-alert__noTitle":!i,"pkt-alert__noDate":!n},x=w.useCallback(()=>{y(!0),m.onClose&&m.onClose(new CustomEvent("close",{detail:{origin:event},bubbles:!0,composed:!0}))},[m.onClose,y]),T=a||r;return l.jsx("div",{...m,"aria-live":T,role:h,className:Z($,p),children:l.jsxs("div",{className:Z(b),children:[l.jsx(W,{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(pe,{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]})]})})};an.displayName="PktAlert";const Oa=Jt({tagName:"pkt-backlink",elementClass:hs,react:w,displayName:"PktBackLink"});Oa.displayName="PktBackLink";const Mc=w.forwardRef(({breadcrumbs:s,navigationType:t,renderLink:e,className:i,...n},a)=>{const r=s,h=r[r.length-2],d=[i,"pkt-breadcrumbs"].filter(Boolean).join(" "),p=e||(t==="router"?({href:m,className:v,children:y,props:$})=>l.jsx(nr.Link,{to:m,className:v,...$,children:y}):({href:m,className:v,children:y,props:$})=>l.jsx("a",{href:m,className:v,...$,children:y}));return l.jsxs("nav",{ref:a,"aria-label":"brødsmulemeny",className:d,children:[l.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:r.map((m,v)=>l.jsx("li",{className:"pkt-breadcrumbs__item",children:v===r.length-1?l.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:l.jsx("span",{className:"pkt-breadcrumbs__text",children:m.text})}):p({href:m.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",children:l.jsxs(l.Fragment,{children:[l.jsx(W,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:m.text})]}),props:n})},`breadcrumb-${v}`))}),p({href:h.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",children:l.jsxs(l.Fragment,{children:[l.jsx(W,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:h.text})]}),props:n})]})});window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/14.5/animations/";const pe=w.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:p="primary",type:m="button",variant:v="label-only",state:y,color:$,isLoading:b=void 0,disabled:x=void 0,loadingAnimationPath:T=window.pktAnimationPath,...O},S)=>{const B=[t,"pkt-btn",r&&`pkt-btn--${r}`,h&&"pkt-btn--full",d&&"pkt-btn--full-small",p&&`pkt-btn--${p}`,v&&`pkt-btn--${v}`,$&&`pkt-btn--${$}`,y&&`pkt-btn--${y}`,b&&"pkt-btn--isLoading"].filter(Boolean).join(" ");return l.jsxs("button",{...O,"aria-busy":b||void 0,"aria-disabled":x||void 0,disabled:x,className:B,type:m,ref:S,children:[b&&l.jsx(W,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:T}),v!=="label-only"&&l.jsx(W,{className:"pkt-btn__icon",name:e,...n&&{path:n}}),l.jsx("span",{className:"pkt-btn__text",children:s}),v==="icons-right-and-left"&&l.jsx(W,{className:"pkt-btn__icon",name:i,...a&&{path:a}})]})});pe.displayName="PktButton";const Ac=Jt({tagName:"pkt-card",elementClass:ut,react:w,displayName:"PktCard",events:{}}),Pa=w.forwardRef(({children:s,...t},e)=>l.jsx(Ac,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));Pa.displayName="PktCard";const Da=w.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:p="right",defaultChecked:m,checked:v,indeterminate:y,optionalTag:$,optionalText:b="Valgfritt",requiredTag:x,requiredText:T="Må fylles ut",tagText:O,...S},B)=>{const A=w.useRef(null);w.useEffect(()=>{A.current&&y!==void 0&&(A.current.indeterminate=y)},[y]),w.useEffect(()=>{typeof B=="function"?B(A.current):B&&(B.current=A.current)},[B]);const R=[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--${p}`,d?"pkt-sr-only":""].filter(Boolean).join(" "),Tt=["pkt-input-check__input",t?"pkt-input-check__input--tile":"",e&&t?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),Nt=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),nt=()=>l.jsxs(l.Fragment,{children:[O&&l.jsx("span",{className:Nt+" pkt-tag--gray",children:O}),$&&l.jsx("span",{className:Nt+" pkt-tag--blue-light",children:b}),x&&l.jsx("span",{className:Nt+" pkt-tag--beige",children:T})]});return l.jsx("div",{className:R,children:l.jsxs("div",{className:Tt,children:[p==="left"&&l.jsxs("label",{className:et,htmlFor:s,children:[i," ",nt(),n&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]}),l.jsx("input",{role:h?"switch":"checkbox",ref:A,className:`pkt-input-check__input-checkbox ${a?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:s,disabled:e,...v!==void 0?{checked:v}:{defaultChecked:m},...S}),p==="right"&&l.jsxs("label",{className:et,htmlFor:s,children:[i," ",nt(),n&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]})]})})});Da.displayName="PktCheckbox";const Oc=Jt({tagName:"pkt-combobox",elementClass:at,react:w,displayName:"PktCombobox",events:{onClick:"click",onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),Ia=w.forwardRef(({children:s,helptext:t,...e},i)=>l.jsxs(Oc,{...e,ref:i,children:[t&&l.jsx("div",{slot:"helptext",className:"pkt-contents",children:t}),s]}));Ia.displayName="PktCombobox";const Ni=Jt({tagName:"pkt-consent",elementClass:Rt,react:w,displayName:"PktConsent",events:{onToggleConsent:"toggle-consent"}});Ni.displayName="PktConsent";const Pc=Jt({tagName:"pkt-datepicker",elementClass:ht,react:w,displayName:"PktDatepicker",events:{onChange:"change",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),La=w.forwardRef(({helptext:s,...t},e)=>l.jsx(Pc,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",slot:"helptext",children:s})}));La.displayName="PktDatepicker";const Dc=({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:p=null,devMode:m=!1,cookieDomain:v=null,cookieSecure:y=null,cookieExpiryDays:$=null,onToggleConsent:b=x=>{console.log(x.detail)}})=>{var T,O;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((S,B)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${S.external?"pkt-link--external":""}`,href:S.href,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:[l.jsx(W,{className:"pkt-footer__link-icon",name:"chevron-right"}),S.text]})},`links-${B}`))]})]}),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}),(O=t.links)==null?void 0:O.map((S,B)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${S.external?"pkt-link--external":""}`,href:S.href,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:[l.jsx(W,{className:"pkt-footer__link-icon",name:"chevron-right"}),S.text]})},`links-${B}`))]})]}),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(W,{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(W,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),h&&l.jsx("li",{className:"pkt-footer__list-item",children:l.jsx(Ni,{triggerType:"footerlink",hotjarId:d,googleAnalyticsId:p,devMode:m,cookieDomain:v,cookieSecure:y,cookieExpiryDays:$,onToggleConsent:b})})]})]})]}),e&&l.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[l.jsx("div",{className:"pkt-footer__social-languages",children:e.filter(S=>S.language).map((S,B)=>l.jsx("div",{className:"pkt-footer__social-language",children:l.jsx("a",{href:S.href,"aria-label":`til ${S.language} versjon av nettsiden`,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:S.language})},`sociallinks-language-${B}`))}),l.jsx("div",{className:"pkt-footer__social-icons",children:e.filter(S=>S.iconName).map((S,B)=>l.jsx(w.Fragment,{children:l.jsx("a",{href:S.href,"aria-label":`til ${S.iconName}`,className:"pkt-footer__social-icon-link",target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:l.jsx(W,{className:"pkt-footer__social-icon",name:S.iconName})})},`sociallinks-${B}`))})]})]})})},Ic=({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:p=null,cookieExpiryDays:m=null,onToggleConsent:v=$=>{console.log($.detail)},className:y})=>{const $=[y,"pkt-footer-simple"].filter(Boolean).join(" ");return l.jsx("footer",{className:$,"data-mode":"dark",children:l.jsx("div",{className:"pkt-footer-simple__container",children:l.jsxs("ul",{className:"pkt-footer-simple__list",children:[s.map((b,x)=>l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:`pkt-footer-simple__link ${b.external?" pkt-link--external":""}`,href:b.href,target:b.openInNewTab||t?"_blank":"_self",rel:b.openInNewTab||t?"noopener noreferrer":void 0,children:[l.jsx(W,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),b.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(W,{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(W,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),n&&l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsx(Ni,{triggerType:"footerlink",hotjarId:a,googleAnalyticsId:r,devMode:h,cookieDomain:d,cookieSecure:p,cookieExpiryDays:m,onToggleConsent:v})})]})})})},Ei=({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:Z(d,e),href:s,target:a,rel:n?"noopener noreferrer":void 0,children:[t&&l.jsx(W,{name:t,className:"pkt-link__icon"}),r]})};Ei.displayName="PktLink";const Lc=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(Ei,{iconName:s.iconName,href:s.href,"aria-hidden":"true",className:Z("pkt-user-menu__link",t),children:s.title}):l.jsxs("button",{className:Z("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(W,{name:s.iconName,className:"pkt-link__icon","aria-hidden":"true"}),s.title]}),Bc=({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))}),Fc=w.forwardRef(({user:s,formattedLastLoggedIn:t,representing:e,userMenu:i,canChangeRepresentation:n,changeRepresentation:a,logoutOnClick:r},h)=>{const d=i==null?void 0:i.map(Lc);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(Bc,{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}})})]})})}),Qs=w.forwardRef(({forId:s,label:t,helptext:e,helptextDropdown:i,helptextDropdownButton:n,counter:a,counterCurrent:r=0,counterMaxLength:h,optionalTag:d=!1,optionalText:p="Valgfritt",requiredTag:m=!1,requiredText:v="Må fylles ut",tagText:y=null,hasError:$=!1,errorMessage:b,disabled:x=!1,inline:T=!1,ariaDescribedby:O,useWrapper:S=!0,children:B,className:A="",hasFieldset:R=!1,role:et="group",counterPosition:Tt="bottom"},Nt)=>{const[nt,gt]=w.useState(!1),Ut=O||(e?`${s}-helptext`:void 0),Yt=!!a,mt=Yt&&Tt==="top",$e=Yt&&Tt==="bottom",Pt=()=>gt(rt=>!rt),Dt=["pkt-inputwrapper",A,$?"pkt-inputwrapper--error":"",x?"pkt-inputwrapper--disabled":"",T?"pkt-inputwrapper--inline":""].filter(Boolean).join(" "),zt=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),Gt=()=>Yt?l.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":"true",children:[r,h?`/${h}`:""]}):null,z=()=>l.jsxs(l.Fragment,{children:[y&&l.jsx("span",{className:zt+" pkt-tag--gray",children:y}),d&&l.jsx("span",{className:zt+" pkt-tag--blue-light",children:p}),m&&l.jsx("span",{className:zt+" pkt-tag--beige",children:v})]}),It=()=>{const rt=l.jsxs(l.Fragment,{children:[t," ",z()]});return S?R?l.jsx("legend",{className:"pkt-inputwrapper__legend",id:`${s}-label`,children:rt}):l.jsx("label",{className:"pkt-inputwrapper__label",htmlFor:s,"aria-describedby":Ut,id:`${s}-label`,children:rt}):l.jsx("label",{htmlFor:s,className:"pkt-sr-only","aria-describedby":Ut,id:`${s}-label`,children:t})},ae=()=>!e&&!i?null:l.jsxs(l.Fragment,{children:[e&&S&&l.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${s}-helptext`,children:e}),i&&l.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[l.jsx(pe,{skin:"tertiary",size:"small",variant:"icon-right",iconName:nt?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:Pt,children:l.jsx("span",{dangerouslySetInnerHTML:{__html:n??'Les mer <span class="pkt-sr-only">om inputfeltet</span>'}})}),l.jsx("div",{className:`pkt-inputwrapper__helptext ${nt?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i})]})]}),Lt=l.jsxs(l.Fragment,{children:[It(),ae(),mt&&l.jsx(Gt,{}),B,$e&&l.jsx(Gt,{}),$&&b&&l.jsx("div",{className:"pkt-inputwrapper__alert-wrapper",children:l.jsx(an,{skin:"error","aria-live":"assertive",role:"alert",id:`${s}-error`,compact:!0,children:b})})]});return l.jsx("div",{className:Dt,ref:Nt,role:et,children:R?l.jsx("fieldset",{className:"pkt-inputwrapper__fieldset","aria-describedby":Ut,children:Lt}):l.jsx("div",{className:"pkt-inputwrapper__fieldset",children:Lt})})});Qs.displayName="PktInputWrapper";const rn=w.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,autocomplete:i="off",counter:n,counterMaxLength:a,className:r,disabled:h=!1,errorMessage:d,hasError:p=!1,helptext:m,helptextDropdown:v,helptextDropdownButton:y,iconNameRight:$,inline:b=!1,fullwidth:x=!1,label:T,name:O,optionalTag:S=!1,optionalText:B,requiredTag:A=!1,requiredText:R,tagText:et=null,placeholder:Tt,prefix:Nt,suffix:nt,type:gt="text",useWrapper:Ut=!0,omitSearchIcon:Yt=!1,value:mt,minLength:$e,maxLength:Pt,min:Dt,max:zt,step:Gt,size:z,readonly:It,required:ae,dataTestid:Lt,onChange:rt,skipForwardTestid:_e=!1,...we},re)=>{const ei=[r,"pkt-textinput"].join(" "),ws=gt==="search"&&!$&&!Yt,xs=gt==="date"&&mt?mt.slice(0,10):mt,[Qe,fe]=w.useState((mt==null?void 0:mt.length)||0),ge=`${s}`,De=`${ge}-label`,ts=e||De,xe=Zt=>{var es,_t;n&&fe(((_t=(es=Zt.currentTarget)==null?void 0:es.value)==null?void 0:_t.length)||0),rt&&rt(Zt)};return w.useEffect(()=>{mt!==void 0&&fe((mt==null?void 0:mt.length)||0)},[mt]),l.jsx(Qs,{ariaDescribedby:t,className:ei,disabled:h,errorMessage:d,forId:ge,hasError:p,helptext:m,helptextDropdown:v,helptextDropdownButton:y,inline:b,label:T,optionalTag:S,optionalText:B,requiredTag:A,requiredText:R,tagText:et,useWrapper:Ut,counter:n,counterCurrent:Qe,counterMaxLength:a,children:l.jsxs("div",{className:"pkt-input__container","data-testid":Lt,"data-skip-forward-testid":_e?"true":void 0,children:[Nt&&l.jsx("div",{className:"pkt-input-prefix",children:Nt}),l.jsx("input",{...we,ref:re,className:`pkt-input ${x?"pkt-input--fullwidth":""} ${a&&Qe>a?"pkt-input--counter-error":""}`,type:gt,name:`${O||s}`,value:xs,id:ge,placeholder:Tt,autoComplete:i,disabled:h,"aria-invalid":p,"aria-errormessage":`${s}-error`,"aria-labelledby":ts,min:Dt,max:zt,onChange:xe,step:Gt,minLength:$e,maxLength:Pt,size:z,required:ae}),nt&&l.jsxs("p",{className:"pkt-input-suffix",children:[nt,$&&l.jsx(W,{className:"pkt-input-suffix-icon",name:$}),ws&&l.jsx(W,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!nt&&$&&l.jsx(W,{className:"pkt-input-icon",name:$}),!nt&&ws&&l.jsx(W,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})}),Vc=(s,t)=>{const e=()=>typeof window>"u"?0:window.innerWidth,[i,n]=w.useState(e);return w.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 jc(s){const t=w.useRef(0);w.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 Ba=w.forwardRef(({mobileBreakpoint:s=768,tabletBreakpoint:t=1280,children:e,className:i,compact:n=!1,"data-mode":a,logOutButtonPlacement:r="none",logOut:h,openedMenu:d,showSearch:p=!1,onSearch:m,onSearchChange:v,searchValue:y,searchPlaceholder:$="Søk",representing:b,serviceLink:x,serviceClick:T,serviceName:O,user:S,userMenu:B,userMenuFooter:A,userOptions:R,canChangeRepresentation:et=!1,changeRepresentation:Tt,hideLogo:Nt=!1,logoLink:nt,logoClick:gt,position:Ut="fixed",scrollBehavior:Yt="hide",slotMenuVariant:mt="icon-only",slotMenuText:$e="Meny"},Pt)=>{const Dt=Ut==="fixed",zt=Yt==="hide";w.useEffect(()=>{A&&console.warn('PktHeaderService: The "userMenuFooter" prop is deprecated and will be removed in a future version. Please use "userMenu" instead.')},[A]),w.useEffect(()=>{R&&console.warn('PktHeaderService: The "userOptions" prop is no longer available. Please use "userMenu" instead.')},[R]),w.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 Gt=w.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]),[z,It]=w.useState(d||"none"),[ae,Lt]=w.useState(!1),[rt,_e]=w.useState(0),[we,re]=w.useState(!1),[ei,ws]=w.useState(!1),xs=w.useRef(null),Qe=w.useRef(null),fe=w.useRef(null),ge=w.useRef(null),De=w.useRef(null),ts=w.useRef(null),xe=w.useRef(null),Zt=w.useRef(!1),es=Vc(xs),_t=es<s,Xt=es<t,cn=w.useCallback(c=>{xs.current=c,typeof Pt=="function"?Pt(c):Pt&&(Pt.current=c)},[Pt]);jc(Dt&&_t&&z!=="none");const Ss=w.useCallback((c,f)=>{const _=c.relatedTarget;let D;switch(f){case"user":D=Qe;break;case"slot":D=fe;break;case"search":D=ge;break;default:return}const V=D.current;V&&(!_||!V.contains(_))&&It("none")},[]),si=w.useCallback(()=>{Zt.current&&xe.current&&document.contains(xe.current)&&xe.current.focus(),xe.current=null,Zt.current=!1},[]);w.useEffect(()=>{const c=_=>{S&&z==="user"&&!_.target.closest(".pkt-header-service__user-container")&&It("none"),z==="slot"&&!_.target.closest(".pkt-header-service__slot-container")&&It("none"),z==="search"&&!_.target.closest(".pkt-header-service__search-container")&&!_.target.closest(".pkt-header-service__search-input")&&It("none")},f=_=>{_.key==="Escape"&&z!=="none"&&(_.preventDefault(),Zt.current=!0,It("none"))};if(z!=="none")return document.addEventListener("mousedown",c),document.addEventListener("keydown",f),()=>{document.removeEventListener("mousedown",c),document.removeEventListener("keydown",f)};si()},[z,S,si]),w.useEffect(()=>{const c=()=>{if(zt){const f=window.pageYOffset||document.documentElement.scrollTop;if(f<0||Math.abs(f-rt)<60)return;Lt(f>rt),_e(f)}};return document&&window.addEventListener("scroll",c),()=>{document&&window.removeEventListener("scroll",c)}},[zt,rt]);const Cs=w.useCallback(c=>{const f=c==="slot"?fe:ge,_=c==="slot"?De:ts;if(!f.current||!_.current||!Xt||_t)return;const D=f.current.getBoundingClientRect(),V=_.current.offsetWidth,H=D.left+V>window.innerWidth;c==="slot"?re(H):ws(H)},[Xt,_t]),Ts=w.useCallback(c=>{z!=="none"?It("none"):(xe.current=document.activeElement,It(c))},[z]);w.useEffect(()=>{(z==="slot"||z==="search")&&requestAnimationFrame(()=>{Cs(z)})},[z,Cs]);const g=l.jsxs("header",{className:Z("pkt-header-service",n&&"pkt-header-service--compact",_t&&"pkt-header-service--mobile",Xt&&"pkt-header-service--tablet",Dt&&"pkt-header-service--fixed",zt&&"pkt-header-service--scroll-to-hide",ae&&"pkt-header-service--hidden",i),"data-mode":a,ref:cn,children:[l.jsxs("div",{className:Z("pkt-header-service__logo-area",(!O||O==="")&&"pkt-header-service__logo-area--without-service"),children:[!Nt&&l.jsx("span",{className:"pkt-header-service__logo",children:nt?l.jsx("a",{href:nt,"aria-label":"Tilbake til forside",children:l.jsx(W,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.5/logos/"})}):gt?l.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header-service__logo-link",onClick:gt,children:l.jsx(W,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.5/logos/"})}):l.jsx(W,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.5/logos/"})}),O&&l.jsx("span",{className:"pkt-header-service__service-name",children:x?l.jsx(Ei,{href:x,className:"pkt-header-service__service-link ",children:O}):T?l.jsx("button",{className:"pkt-link-button pkt-link pkt-header-service__service-link",onClick:T,children:O}):l.jsx("span",{className:"pkt-header-service__service-link",children:O})})]}),l.jsxs("div",{className:"pkt-header-service__content",children:[l.jsxs("div",{className:Z("pkt-header-service__slot-container",z==="slot"&&"is-open"),onBlur:c=>Ss(c,"slot"),ref:fe,children:[Xt&&e&&l.jsx(pe,{skin:"secondary",variant:mt,iconName:"menu",size:_t?"small":"medium",state:z==="slot"?"active":"normal",onClick:()=>Ts("slot"),"aria-expanded":z==="slot","aria-controls":"mobile-slot-menu","aria-label":"Åpne meny",children:$e}),l.jsx("div",{className:Z("pkt-header-service__slot-content",we&&"align-right"),id:"mobile-slot-menu",role:Xt?"menu":void 0,"aria-label":Xt?"Meny":void 0,ref:De,children:l.jsx("div",{className:"pkt-contents",children:e})})]}),p&&l.jsx(l.Fragment,{children:Xt?l.jsxs("div",{className:Z("pkt-header-service__search-container",z==="search"&&"is-open"),onBlur:c=>Ss(c,"search"),ref:ge,children:[l.jsx(pe,{skin:"secondary",variant:"icon-only",iconName:"magnifying-glass-big",size:_t?"small":"medium",onClick:()=>Ts("search"),state:z==="search"?"active":"normal","aria-expanded":z==="search","aria-controls":"mobile-search-menu","aria-label":"Åpne søkefelt",children:"Søk"}),l.jsx("div",{className:Z("pkt-header-service__mobile-menu",z==="search"&&"is-open",ei&&"align-right"),ref:ts,children:z==="search"&&l.jsx(rn,{id:"mobile-search-menu",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:$,value:y,autoFocus:!0,fullwidth:!0,onChange:c=>v==null?void 0:v(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(m==null||m(c.target.value))}})})]}):l.jsx(rn,{id:"header-service-search",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:$,value:y,onChange:c=>v==null?void 0:v(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(m==null||m(c.target.value))}})}),Xt&&h&&(r==="header"||r==="both")&&l.jsx(pe,{skin:"secondary",size:_t?"small":"medium",variant:"icon-only",iconName:"exit",onClick:h,children:"Logg ut"})]}),l.jsxs("div",{className:"pkt-header-service__user",children:[S&&l.jsxs("div",{className:"pkt-header-service__user-container",onBlur:c=>Ss(c,"user"),ref:Qe,children:[l.jsxs(pe,{className:Z("pkt-header-service__user-button",_t&&"pkt-header-service__user-button--mobile"),skin:"secondary",size:_t?"small":"medium",state:z==="user"?"active":"normal",variant:"icons-right-and-left",iconName:"user",secondIconName:z==="user"?"chevron-thin-up":"chevron-thin-down",onClick:()=>Ts("user"),children:[l.jsx("span",{className:"pkt-sr-only",children:"Brukermeny: "}),(b==null?void 0:b.name)||S.name]}),z==="user"&&S&&l.jsx("div",{className:Z(_t?"pkt-header-service__mobile-menu":"pkt-header-service__user-menu","is-open"),children:l.jsx(Fc,{user:S,formattedLastLoggedIn:Gt,representing:b,userMenu:B,canChangeRepresentation:et,changeRepresentation:Tt,logoutOnClick:r==="userMenu"||r==="both"?h:void 0})})]}),!_t&&h&&(r==="header"||r==="both")&&l.jsx(pe,{skin:"tertiary",size:"medium",variant:"icon-right",iconName:"exit",onClick:h,children:"Logg ut"})]})]});return Dt?l.jsxs("div",{className:"pkt-header-service-wrapper",children:[g,l.jsx("div",{className:Z("pkt-header-service-spacer",n&&"pkt-header-service-spacer--compact",S&&"pkt-header-service-spacer--has-user",_t&&"pkt-header-service-spacer--mobile",Xt&&"pkt-header-service-spacer--tablet")})]}):g}),Fa=w.forwardRef((s,t)=>l.jsx(Ba,{...s,ref:t}));Fa.displayName="PktHeader";const Hc=Jt({tagName:"pkt-heading",elementClass:Me,react:w,displayName:"PktHeading"}),Va=w.forwardRef(({children:s,...t},e)=>l.jsx(Hc,{"data-testid":"pkt-heading",...t,ref:e,children:s}));Va.displayName="PktHeading";const Uc=Jt({tagName:"pkt-helptext",elementClass:ve,react:w,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),ja=w.forwardRef(({children:s,...t},e)=>l.jsx(Uc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));ja.displayName="PktHelptext";const Ha=w.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]}));Ha.displayName="PktInput";const Ua=({children:s,skin:t,title:e,href:i,iconName:n,openInNewTab:a,external:r,className:h,...d})=>{const p=["pkt-linkcard",t&&`pkt-linkcard--${t}`].filter(Boolean).join(" "),m=["pkt-linkcard__title",r&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return l.jsxs("a",{...d,href:i,className:Z(p,h),target:a?"_blank":"_self",rel:a?"noopener noreferrer":void 0,children:[n&&l.jsx(W,{className:"pkt-link__icon",name:n}),e&&l.jsx("div",{className:Z(m),children:e}),l.jsx("div",{className:"pkt-linkcard__text",children:s})]})};Ua.displayName="PktLinkCard";const zc=Jt({tagName:"pkt-loader",elementClass:ie,react:w,displayName:"PktLoader",events:{}}),za=w.forwardRef(({children:s,...t},e)=>l.jsx(zc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));za.displayName="PktLoader";const qa=({children:s,className:t,skin:e,title:i,compact:n,closable:a,onClose:r,...h})=>{const[d,p]=w.useState(!1),m={"pkt-messagebox":!0,"pkt-messagebox--compact":n,[`pkt-messagebox--${e}`]:e,"pkt-messagebox--closable":a,"pkt-hide":d},v=w.createRef(),y=w.useCallback(()=>{p(!0),r&&r()},[p,r]);return l.jsxs("div",{...h,className:Z(m,t),ref:v,children:[a&&l.jsx("div",{className:"pkt-messagebox__close",children:l.jsx("button",{onClick:y,className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only","aria-label":"Lukk",children:l.jsx(W,{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})]})};qa.displayName="PktMessagebox";const qc=Jt({tagName:"pkt-modal",elementClass:jt,react:w,displayName:"PktModal",events:{}}),Wa=w.forwardRef(({children:s,...t},e)=>l.jsx(qc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));Wa.displayName="PktModal";const Wc=Jt({tagName:"pkt-progressbar",elementClass:ct,react:w,displayName:"PktProgressbar",events:{}}),Ra=w.forwardRef(({children:s,...t},e)=>l.jsx(Wc,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",children:s})}));Ra.displayName="PktProgressbar";const Ka=w.forwardRef(({id:s,name:t,label:e,className:i,hasTile:n=!1,disabled:a=!1,checkHelptext:r,hasError:h=!1,defaultChecked:d,checked:p,optionalTag:m,optionalText:v,requiredTag:y,requiredText:$,tagText:b,...x},T)=>{const O=[i,"pkt-input-check"].filter(Boolean).join(" "),S=["pkt-input-check__input",n?"pkt-input-check__input--tile":"",a&&n?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),B=["pkt-input-check__input-checkbox",h?"pkt-input-check__input-checkbox--error":""].filter(Boolean).join(" "),A=["pkt-input-check__input-label",a?"pkt-input-check__input-label--disabled":""].filter(Boolean).join(" "),R=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),et=()=>l.jsxs(l.Fragment,{children:[b&&l.jsx("span",{className:R+" pkt-tag--gray",children:b}),m&&l.jsx("span",{className:R+" pkt-tag--blue-light",children:v}),y&&l.jsx("span",{className:R+" pkt-tag--beige",children:$})]});return l.jsx("div",{className:O,children:l.jsxs("div",{className:S,children:[l.jsx("input",{ref:T,id:s,type:"radio",name:t,disabled:a,className:B,...p!==void 0?{checked:p}:{defaultChecked:d},...x}),l.jsxs("label",{className:A,htmlFor:s,children:[e," ",et(),r&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:r})]})]})})});Ka.displayName="PktRadioButton";const Rc=w.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:p,method:m,onChange:v,onSearch:y,onSuggestionClick:$,...b},x)=>{const T=(A,R)=>{A?A():$&&$(R)},O=A=>{d=A.target.value},S=`pkt-searchinput pkt-searchinput--${s} ${e?"pkt-searchinput--fullwidth":""}`;let B;return p?B=A=>l.jsx("form",{role:"search",className:S,action:p,method:m,children:A}):B=A=>l.jsx("div",{role:"search",className:S,children:A}),B(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:v||O,onKeyUp:y&&(A=>{A.key==="Enter"&&(A.preventDefault(),y(d))}),...b}),l.jsx(pe,{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:y&&(A=>{A.preventDefault(),y(d)}),children:n||r})]}),h&&l.jsx("ul",{id:`${i}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:h.map((A,R)=>l.jsx("li",{children:w.createElement(A.href?"a":A.onClick?"button":"div",{href:A.href,className:`pkt-searchinput__suggestion ${A.onClick?"pkt-link-button":""} ${A.href||A.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:A.onClick?"button":void 0,onClick:()=>T(A.onClick,R),onKeyUp:et=>et.key==="Enter"&&T(A.onClick,R)},l.jsxs(l.Fragment,{children:[A.title&&l.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:A.title}),A.text&&l.jsx("p",{className:"pkt-searchinput__suggestion-text",children:A.text})]}))},`search-suggestion-${R}`))})]}))}),Kc=w.forwardRef(({ariaDescribedby:s,ariaLabelledby:t,children:e,className:i,disabled:n=!1,errorMessage:a,hasError:r,helptext:h,helptextDropdown:d,helptextDropdownButton:p,id:m,inline:v=!1,fullwidth:y=!1,label:$,name:b,optionalTag:x=!1,optionalText:T,requiredTag:O=!1,requiredText:S,tagText:B,...A},R)=>{const et=[i,"pkt-select"].join(" ");return l.jsx(Qs,{className:et,forId:`${m}-input`,label:$,helptext:h,helptextDropdown:d,helptextDropdownButton:p,optionalTag:x,optionalText:T,requiredTag:O,requiredText:S,tagText:B,hasError:r,errorMessage:a,disabled:n,inline:v,ariaDescribedby:s,children:l.jsx("select",{ref:R,className:`pkt-input ${y?"pkt-input--fullwidth":""}`,"aria-invalid":r,"aria-errormessage":`${m}-error`,"aria-labelledby":t||void 0,disabled:n,id:`${m}-input`,name:b||m,...A,children:e})})}),Yc=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)"}})}),Gc=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"})]}),Zc=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"})]}),Xc=({children:s,className:t,status:e="incomplete",title:i})=>l.jsxs("li",{className:Z("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:Z("pkt-step__indicator"),children:e==="current"?Gc:e==="completed"?Zc:Yc}),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})]})]}),Jc=w.forwardRef(({activeStep:s,className:t,children:e,hideNonActiveSteps:i=!1,hideNonActiveStepsContent:n=!0,orientation:a="vertical",...r},h)=>{const d=Z(t,"pkt-stepper",a==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),p=w.Children.map(e,(m,v)=>w.isValidElement(m)?w.cloneElement(m,{className:Z(m.props.className,{"pkt-step--hideStep":i&&v!==s,"pkt-step--hideContent":n&&v!==s})}):m);return l.jsx("ol",{"data-testid":"pkt-stepper",className:d,ref:h,...r,children:p})}),Qc=({className:s,compact:t=!1,skin:e="basic",responsiveView:i=!0,children:n,...a})=>l.jsx("table",{"data-testid":"pkt-table",className:Z(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}),td=({id:s,children:t,className:e,...i})=>l.jsx("tbody",{id:s,className:Z(e,"pkt-table__body",{}),...i,role:"rowgroup",children:t}),ed=({children:s,className:t,dataLabel:e,...i})=>l.jsx("td",{className:Z(t,"pkt-table__data-cell",{}),"data-label":e,role:"cell","data-testid":"pkt-table__data-cell",...i,children:s}),sd=({className:s,children:t,...e})=>l.jsx("thead",{className:Z(s,"pkt-table__header",{}),role:"rowgroup",...e,children:t}),id=({className:s,children:t,...e})=>l.jsx("th",{className:Z(s,"pkt-table__header-cell",{}),role:"columnheader",...e,children:t}),nd=({className:s,children:t,...e})=>l.jsx("tr",{className:Z(s,"pkt-table__row",{}),role:"row",...e,children:t}),on=w.forwardRef(({children:s,skin:t,textStyle:e,size:i,closeTag:n,className:a,iconName:r,ariaLabel:h,onClose:d,type:p,"aria-description":m,...v},y)=>{const[$,b]=w.useState(!1),x=w.useCallback(()=>{b(!0),d&&d()},[b]),T=w.useRef(null),[O,S]=w.useState("");w.useEffect(()=>{var et,Tt;S(((Tt=(et=T.current)==null?void 0:et.textContent)==null?void 0:Tt.trim())??"")},[s]);const B=w.useMemo(()=>{if(n&&!h)return O&&`Klikk for å fjerne ${O}`||m},[n,h,O,m]),A={"pkt-tag":!0,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${t}`]:!!t,[`pkt-tag--${e}`]:!!e},R={"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":$};return n?l.jsxs("button",{...v,className:Z(R,a),type:p,onClick:x,"aria-label":h,"aria-description":B,ref:y,children:[r&&l.jsx(W,{className:"pkt-tag__icon",name:r}),l.jsx("span",{ref:T,children:s}),l.jsx(W,{className:"pkt-tag__close-btn",name:"close"})]}):l.jsxs("span",{...v,className:Z(A,a),ref:y,children:[r&&l.jsx(W,{className:"pkt-tag__icon",name:r,"aria-hidden":"true"}),l.jsx("span",{ref:T,children:s})]})});on.displayName="PktTag";const ln=w.forwardRef(({children:s,active:t,href:e,onClick:i,icon:n,controls:a,tag:r,tagSkin:h,index:d=0},p)=>{const{arrowNav:m,registerTabRef:v,handleKeyPress:y,selectTab:$}=ad(),x={"aria-selected":m?!!t:void 0,"aria-controls":a,role:m?"tab":void 0,onKeyUp:O=>y(d,O),onClick:O=>{$(d),i==null||i(O)},tabIndex:t||!m?void 0:-1,ref:O=>{v(d,O),typeof p=="function"?p(O):p&&(p.current=O)}},T=l.jsxs(l.Fragment,{children:[n&&l.jsx(W,{name:n,className:"pkt-icon--small"}),s,r&&l.jsx(on,{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})});ln.displayName="PktTabItem";const Ya=w.createContext(null),ad=()=>{const s=w.useContext(Ya);if(!s)throw new Error("TabItem must be used within a Tabs component");return s},rd=w.forwardRef(({arrowNav:s=!0,disableArrowNav:t=!1,tabs:e,onTabSelected:i,children:n},a)=>{const r=w.useRef([]),h=s&&!t,p=n&&w.Children.count(n)>0?w.Children.count(n):(e==null?void 0:e.length)||0;w.useEffect(()=>{r.current=r.current.slice(0,p)},[p]);const m=b=>{const x=e==null?void 0:e[b];x!=null&&x.action&&x.action(b),i&&i(b)},v=(b,x)=>{var T,O;h&&(x.code==="ArrowLeft"&&b!==0&&((T=r.current[b-1])==null||T.focus()),x.code==="ArrowRight"&&b<p-1&&((O=r.current[b+1])==null||O.focus()),(x.code==="ArrowDown"||x.code==="Space")&&m(b))},y=(b,x)=>{r.current[b]=x},$=e==null?void 0:e.map((b,x)=>{var T,O;return l.jsx(ln,{active:b.active,href:b.href,onClick:()=>m(x),icon:b.icon,controls:b.controls,tag:(T=b.tag)==null?void 0:T.text,tagSkin:(O=b.tag)==null?void 0:O.skin,index:x,children:b.text},x)});return l.jsx(Ya.Provider,{value:{arrowNav:h,registerTabRef:y,handleKeyPress:v,selectTab:m},children:l.jsx("div",{className:"pkt-tabs",ref:a,children:l.jsx("div",{className:"pkt-tabs__list",role:h?"tablist":"navigation",children:n||$})})})}),od=w.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,counter:i,counterMaxLength:n,className:a,disabled:r,errorMessage:h,hasError:d,helptext:p,helptextDropdown:m,helptextDropdownButton:v,inline:y,fullwidth:$=!1,label:b,name:x,optionalTag:T=!1,optionalText:O,requiredTag:S=!1,requiredText:B,tagText:A=null,placeholder:R,rows:et,useWrapper:Tt=!0,onChange:Nt,value:nt,autoComplete:gt="off",minLength:Ut,maxLength:Yt,readOnly:mt=!1,skipForwardTestid:$e=!1,...Pt},Dt)=>{const zt=[a,"pkt-textinput","pkt-textarea"].join(" "),Gt=`${s}-input`,z=`${Gt}-label`,It=e||z,[ae,Lt]=w.useState(0),rt=_e=>{var we,re;if(i&&Lt(((re=(we=_e.currentTarget)==null?void 0:we.value)==null?void 0:re.length)||0),Nt)return Nt(_e)};return w.useEffect(()=>{nt!==void 0&&Lt((nt==null?void 0:nt.length)||0)},[nt]),l.jsx(Qs,{ariaDescribedby:t,className:zt,disabled:r,errorMessage:h,forId:Gt,hasError:d,helptext:p,helptextDropdown:m,helptextDropdownButton:v,inline:y,label:b,optionalTag:T,optionalText:O,requiredTag:S,requiredText:B,tagText:A,useWrapper:Tt,counter:i,counterCurrent:ae,counterMaxLength:n,children:l.jsx("textarea",{ref:Dt,className:`pkt-input ${$?"pkt-input--fullwidth":""} ${n&&ae>n?"pkt-input--counter-error":""}`,name:`${x||s}`,id:Gt,placeholder:R,disabled:r,rows:et,"aria-labelledby":It,"aria-invalid":d,"aria-errormessage":`${s}-error`,...Pt,onChange:rt,value:nt,autoComplete:gt,minLength:Ut,maxLength:Yt,"data-skip-forward-testid":$e?"true":void 0})})});var $s=window.CustomEvent;(!$s||typeof $s=="object")&&($s=function(s,t){t=t||{};var e=document.createEvent("CustomEvent");return e.initCustomEvent(s,!!t.bubbles,!!t.cancelable,t.detail||null),e},$s.prototype=window.Event.prototype);function Ga(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,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 ti(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 Za(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 hn(s){return!s||!s.hasAttribute("method")?!1:s.getAttribute("method").toLowerCase()==="dialog"}function Xa(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=Xa(n[a].shadowRoot),i));a++);return i}function Ja(s){return s.isConnected||document.body.contains(s)}function Qa(s){if(s.submitter)return s.submitter;var t=s.target;if(!(t instanceof HTMLFormElement))return null;var e=U.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 cd(s){if(!s.defaultPrevented){var t=s.target,e=U.imagemapUseValue,i=Qa(s);e===null&&i&&(e=i.value);var n=ti(t);if(n){var a=i&&i.getAttribute("formmethod")||t.getAttribute("method");a==="dialog"&&(s.preventDefault(),e!=null?n.close(e):n.close())}}}function tr(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",cd,!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))}tr.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&Ja(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_),U.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=Xa(this.dialog_)),Za(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(!Ja(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!U.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,U.needsCentering(this.dialog_)?(U.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 $s("close",{bubbles:!1,cancelable:!1});Ga(this.dialog_,t)}};var U={};if(U.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"},U.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||!hd(r,s))){var h=a.style.getPropertyValue("top"),d=a.style.getPropertyValue("bottom");if(h&&h!=="auto"||d&&d!=="auto")return!0}}}return!1},U.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:!U.isInlinePositionSetByStylesheet(s)},U.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 tr(s)},U.registerDialog=function(s){s.showModal||U.forceRegisterDialog(s)},U.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)}))},U.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})},U.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},U.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)},U.DialogManager.prototype.containedByTopDialog_=function(s){for(;s=ti(s);){for(var t=0,e;e=this.pendingDialogStack[t];++t)if(e.dialog===s)return t===0;s=s.parentElement}return!1},U.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(),Za(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}},U.DialogManager.prototype.handleKey_=function(s){if(this.forwardTab_=void 0,s.keyCode===27){s.preventDefault(),s.stopPropagation();var t=new $s("cancel",{bubbles:!1,cancelable:!0}),e=this.pendingDialogStack[0];e&&Ga(e.dialog,t)&&e.dialog.close()}else s.keyCode===9&&(this.forwardTab_=!s.shiftKey)},U.DialogManager.prototype.checkDOM_=function(s){var t=this.pendingDialogStack.slice();t.forEach(function(e){s.indexOf(e.dialog)!==-1?e.downgradeModal():e.maybeHideModal()})},U.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)},U.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())},U.dm=new U.DialogManager,U.formSubmitter=null,U.imagemapUseValue=null,window.HTMLDialogElement===void 0){var er=document.createElement("form");if(er.setAttribute("method","dialog"),er.method!=="dialog"){var _s=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(_s){var dd=_s.get;_s.get=function(){return hn(this)?"dialog":dd.call(this)};var ud=_s.set;_s.set=function(s){return typeof s=="string"&&s.toLowerCase()==="dialog"?this.setAttribute("method",s):ud.call(this,s)},Object.defineProperty(HTMLFormElement.prototype,"method",_s)}}document.addEventListener("click",function(s){if(U.formSubmitter=null,U.imagemapUseValue=null,!s.defaultPrevented){var t=s.target;if("composedPath"in s){var e=s.composedPath();t=e.shift()||t}if(!(!t||!hn(t.form))){var i=t.type==="submit"&&["button","input"].indexOf(t.localName)>-1;if(!i){if(!(t.localName==="input"&&t.type==="image"))return;U.imagemapUseValue=s.offsetX+","+s.offsetY}var n=ti(t);n&&(U.formSubmitter=t)}}},!1),document.addEventListener("submit",function(s){var t=s.target,e=ti(t);if(!e){var i=Qa(s),n=i&&i.getAttribute("formmethod")||t.getAttribute("method");n==="dialog"&&s.preventDefault()}});var pd=HTMLFormElement.prototype.submit,fd=function(){if(!hn(this))return pd.call(this);var s=ti(this);s&&s.close()};HTMLFormElement.prototype.submit=fd}const gd=Object.freeze(Object.defineProperty({__proto__:null,default:U},Symbol.toStringTag,{value:"Module"}));P.PktAccordion=pn,P.PktAccordionItem=Ma,P.PktAlert=an,P.PktBackLink=Oa,P.PktBreadcrumbs=Mc,P.PktButton=pe,P.PktCard=Pa,P.PktCheckbox=Da,P.PktCombobox=Ia,P.PktConsent=Ni,P.PktDatepicker=La,P.PktFooter=Dc,P.PktFooterSimple=Ic,P.PktHeader=Fa,P.PktHeaderService=Ba,P.PktHeading=Va,P.PktHelptext=ja,P.PktIcon=W,P.PktInput=Ha,P.PktInputWrapper=Qs,P.PktLink=Ei,P.PktLinkCard=Ua,P.PktLoader=za,P.PktMessagebox=qa,P.PktModal=Wa,P.PktProgressbar=Ra,P.PktRadioButton=Ka,P.PktSearchInput=Rc,P.PktSelect=Kc,P.PktStep=Xc,P.PktStepper=Jc,P.PktTabItem=ln,P.PktTable=Qc,P.PktTableBody=td,P.PktTableDataCell=ed,P.PktTableHeader=sd,P.PktTableHeaderCell=id,P.PktTableRow=nd,P.PktTabs=rd,P.PktTag=on,P.PktTextarea=od,P.PktTextinput=rn,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})}));
|
|
1689
|
+
*/var Ea;function Ac(){return Ea||(Ea=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})()})(sn)),sn.exports}var Oc=Ac();const Z=Mc(Oc),nn=({children:s,closeAlert:t,compact:e,title:i,date:n,ariaLive:a,"aria-live":r="polite",role:h="status",skin:d="info",className:p,...m})=>{const[v,y]=w.useState(!1),$={"pkt-alert":!0,"pkt-alert--compact":e,[`pkt-alert--${d}`]:d,"pkt-hide":v},b={"pkt-alert__grid":!0,"pkt-alert__noTitle":!i,"pkt-alert__noDate":!n},x=w.useCallback(()=>{y(!0),m.onClose&&m.onClose(new CustomEvent("close",{detail:{origin:event},bubbles:!0,composed:!0}))},[m.onClose,y]),T=a||r;return l.jsx("div",{...m,"aria-live":T,role:h,className:Z($,p),children:l.jsxs("div",{className:Z(b),children:[l.jsx(W,{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(pe,{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]})]})})};nn.displayName="PktAlert";const Ma=Jt({tagName:"pkt-backlink",elementClass:hs,react:w,displayName:"PktBackLink"});Ma.displayName="PktBackLink";const Aa=w.forwardRef(({breadcrumbs:s,navigationType:t,renderLink:e,className:i,...n},a)=>{const r=s,h=r[r.length-2],d=[i,"pkt-breadcrumbs"].filter(Boolean).join(" "),p=e||(t==="router"?({href:m,className:v,children:y,props:$})=>l.jsx(lr.Link,{to:m,className:v,...$,children:y}):({href:m,className:v,children:y,props:$})=>l.jsx("a",{href:m,className:v,...$,children:y}));return l.jsxs("nav",{ref:a,"aria-label":"brødsmulemeny",className:d,children:[l.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:r.map((m,v)=>l.jsx("li",{className:"pkt-breadcrumbs__item",children:v===r.length-1?l.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:l.jsx("span",{className:"pkt-breadcrumbs__text",children:m.text})}):p({href:m.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",children:l.jsxs(l.Fragment,{children:[l.jsx(W,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:m.text})]}),props:n})},`breadcrumb-${v}`))}),p({href:h.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",children:l.jsxs(l.Fragment,{children:[l.jsx(W,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:h.text})]}),props:n})]})});Aa.displayName="PktBreadcrumbs",window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/14.5/animations/";const pe=w.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:p="primary",type:m="button",variant:v="label-only",state:y,color:$,isLoading:b=void 0,disabled:x=void 0,loadingAnimationPath:T=window.pktAnimationPath,...M},S)=>{const B=[t,"pkt-btn",r&&`pkt-btn--${r}`,h&&"pkt-btn--full",d&&"pkt-btn--full-small",p&&`pkt-btn--${p}`,v&&`pkt-btn--${v}`,$&&`pkt-btn--${$}`,y&&`pkt-btn--${y}`,b&&"pkt-btn--isLoading"].filter(Boolean).join(" ");return l.jsxs("button",{...M,"aria-busy":b||void 0,"aria-disabled":x||void 0,disabled:x,className:B,type:m,ref:S,children:[b&&l.jsx(W,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:T}),v!=="label-only"&&l.jsx(W,{className:"pkt-btn__icon",name:e,...n&&{path:n}}),l.jsx("span",{className:"pkt-btn__text",children:s}),v==="icons-right-and-left"&&l.jsx(W,{className:"pkt-btn__icon",name:i,...a&&{path:a}})]})});pe.displayName="PktButton";const Pc=Jt({tagName:"pkt-card",elementClass:pt,react:w,displayName:"PktCard",events:{}}),Oa=w.forwardRef(({children:s,...t},e)=>l.jsx(Pc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));Oa.displayName="PktCard";const Pa=w.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:p="right",defaultChecked:m,checked:v,indeterminate:y,optionalTag:$,optionalText:b="Valgfritt",requiredTag:x,requiredText:T="Må fylles ut",tagText:M,...S},B)=>{const E=w.useRef(null);w.useEffect(()=>{E.current&&y!==void 0&&(E.current.indeterminate=y)},[y]),w.useEffect(()=>{typeof B=="function"?B(E.current):B&&(B.current=E.current)},[B]);const R=[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--${p}`,d?"pkt-sr-only":""].filter(Boolean).join(" "),Ct=["pkt-input-check__input",t?"pkt-input-check__input--tile":"",e&&t?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),Tt=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),nt=()=>l.jsxs(l.Fragment,{children:[M&&l.jsx("span",{className:Tt+" pkt-tag--gray",children:M}),$&&l.jsx("span",{className:Tt+" pkt-tag--blue-light",children:b}),x&&l.jsx("span",{className:Tt+" pkt-tag--beige",children:T})]});return l.jsx("div",{className:R,children:l.jsxs("div",{className:Ct,children:[p==="left"&&l.jsxs("label",{className:et,htmlFor:s,children:[i," ",nt(),n&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]}),l.jsx("input",{role:h?"switch":"checkbox",ref:E,className:`pkt-input-check__input-checkbox ${a?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:s,disabled:e,...v!==void 0?{checked:v}:{defaultChecked:m},...S}),p==="right"&&l.jsxs("label",{className:et,htmlFor:s,children:[i," ",nt(),n&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]})]})})});Pa.displayName="PktCheckbox";const Dc=Jt({tagName:"pkt-combobox",elementClass:at,react:w,displayName:"PktCombobox",events:{onClick:"click",onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),Da=w.forwardRef(({children:s,helptext:t,...e},i)=>l.jsxs(Dc,{...e,ref:i,children:[t&&l.jsx("div",{slot:"helptext",className:"pkt-contents",children:t}),s]}));Da.displayName="PktCombobox";const Ci=Jt({tagName:"pkt-consent",elementClass:Rt,react:w,displayName:"PktConsent",events:{onToggleConsent:"toggle-consent"}});Ci.displayName="PktConsent";const Ic=Jt({tagName:"pkt-datepicker",elementClass:ht,react:w,displayName:"PktDatepicker",events:{onChange:"change",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),Ia=w.forwardRef(({helptext:s,...t},e)=>l.jsx(Ic,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",slot:"helptext",children:s})}));Ia.displayName="PktDatepicker";const Lc=({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:p=null,devMode:m=!1,cookieDomain:v=null,cookieSecure:y=null,cookieExpiryDays:$=null,onToggleConsent:b=x=>{console.log(x.detail)}})=>{var T,M;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((S,B)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${S.external?"pkt-link--external":""}`,href:S.href,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:[l.jsx(W,{className:"pkt-footer__link-icon",name:"chevron-right"}),S.text]})},`links-${B}`))]})]}),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}),(M=t.links)==null?void 0:M.map((S,B)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${S.external?"pkt-link--external":""}`,href:S.href,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:[l.jsx(W,{className:"pkt-footer__link-icon",name:"chevron-right"}),S.text]})},`links-${B}`))]})]}),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(W,{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(W,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),h&&l.jsx("li",{className:"pkt-footer__list-item",children:l.jsx(Ci,{triggerType:"footerlink",hotjarId:d,googleAnalyticsId:p,devMode:m,cookieDomain:v,cookieSecure:y,cookieExpiryDays:$,onToggleConsent:b})})]})]})]}),e&&l.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[l.jsx("div",{className:"pkt-footer__social-languages",children:e.filter(S=>S.language).map((S,B)=>l.jsx("div",{className:"pkt-footer__social-language",children:l.jsx("a",{href:S.href,"aria-label":`til ${S.language} versjon av nettsiden`,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:S.language})},`sociallinks-language-${B}`))}),l.jsx("div",{className:"pkt-footer__social-icons",children:e.filter(S=>S.iconName).map((S,B)=>l.jsx(w.Fragment,{children:l.jsx("a",{href:S.href,"aria-label":`til ${S.iconName}`,className:"pkt-footer__social-icon-link",target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:l.jsx(W,{className:"pkt-footer__social-icon",name:S.iconName})})},`sociallinks-${B}`))})]})]})})},Bc=({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:p=null,cookieExpiryDays:m=null,onToggleConsent:v=$=>{console.log($.detail)},className:y})=>{const $=[y,"pkt-footer-simple"].filter(Boolean).join(" ");return l.jsx("footer",{className:$,"data-mode":"dark",children:l.jsx("div",{className:"pkt-footer-simple__container",children:l.jsxs("ul",{className:"pkt-footer-simple__list",children:[s.map((b,x)=>l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:`pkt-footer-simple__link ${b.external?" pkt-link--external":""}`,href:b.href,target:b.openInNewTab||t?"_blank":"_self",rel:b.openInNewTab||t?"noopener noreferrer":void 0,children:[l.jsx(W,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),b.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(W,{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(W,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),n&&l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsx(Ci,{triggerType:"footerlink",hotjarId:a,googleAnalyticsId:r,devMode:h,cookieDomain:d,cookieSecure:p,cookieExpiryDays:m,onToggleConsent:v})})]})})})},Fc=(s,t)=>{const e=()=>typeof window>"u"?0:window.innerWidth,[i,n]=w.useState(e);return w.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 Vc(s){const t=w.useRef(0);w.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 Ti=({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:Z(d,e),href:s,target:a,rel:n?"noopener noreferrer":void 0,children:[t&&l.jsx(W,{name:t,className:"pkt-link__icon"}),r]})};Ti.displayName="PktLink";const Hc=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},Ni=({item:s,className:t})=>"href"in s?l.jsx(Ti,{iconName:s.iconName,href:s.href,"aria-hidden":"true",className:Z("pkt-user-menu__link",t),children:s.title}):l.jsxs("button",{className:Z("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(W,{name:s.iconName,className:"pkt-link__icon","aria-hidden":"true"}),s.title]}),jc=({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(Ni,{item:t})},e))}),La=w.forwardRef(({user:s,formattedLastLoggedIn:t,representing:e,userMenu:i,canChangeRepresentation:n,changeRepresentation:a,logoutOnClick:r},h)=>{const d=i==null?void 0:i.map(Hc);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(jc,{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(Ni,{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(Ni,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:a}})})})}),r&&l.jsx("li",{className:"pkt-user-menu__item",children:l.jsx(Ni,{item:{title:"Logg ut",iconName:"exit",onClick:r}})})]})})});La.displayName="PktHeaderUserMenu";const Xs=w.forwardRef(({forId:s,label:t,helptext:e,helptextDropdown:i,helptextDropdownButton:n,counter:a,counterCurrent:r=0,counterMaxLength:h,optionalTag:d=!1,optionalText:p="Valgfritt",requiredTag:m=!1,requiredText:v="Må fylles ut",tagText:y=null,hasError:$=!1,errorMessage:b,disabled:x=!1,inline:T=!1,ariaDescribedby:M,useWrapper:S=!0,children:B,className:E="",hasFieldset:R=!1,role:et="group",counterPosition:Ct="bottom"},Tt)=>{const[nt,mt]=w.useState(!1),Ut=M||(e?`${s}-helptext`:void 0),Yt=!!a,dt=Yt&&Ct==="top",$e=Yt&&Ct==="bottom",Dt=()=>mt(rt=>!rt),It=["pkt-inputwrapper",E,$?"pkt-inputwrapper--error":"",x?"pkt-inputwrapper--disabled":"",T?"pkt-inputwrapper--inline":""].filter(Boolean).join(" "),zt=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),Gt=()=>Yt?l.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":"true",children:[r,h?`/${h}`:""]}):null,z=()=>l.jsxs(l.Fragment,{children:[y&&l.jsx("span",{className:zt+" pkt-tag--gray",children:y}),d&&l.jsx("span",{className:zt+" pkt-tag--blue-light",children:p}),m&&l.jsx("span",{className:zt+" pkt-tag--beige",children:v})]}),Nt=()=>{const rt=l.jsxs(l.Fragment,{children:[t," ",z()]});return S?R?l.jsx("legend",{className:"pkt-inputwrapper__legend",id:`${s}-label`,children:rt}):l.jsx("label",{className:"pkt-inputwrapper__label",htmlFor:s,"aria-describedby":Ut,id:`${s}-label`,children:rt}):l.jsx("label",{htmlFor:s,className:"pkt-sr-only","aria-describedby":Ut,id:`${s}-label`,children:t})},ae=()=>!e&&!i?null:l.jsxs(l.Fragment,{children:[e&&S&&l.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${s}-helptext`,children:e}),i&&l.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[l.jsx(pe,{skin:"tertiary",size:"small",variant:"icon-right",iconName:nt?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:Dt,children:l.jsx("span",{dangerouslySetInnerHTML:{__html:n??'Les mer <span class="pkt-sr-only">om inputfeltet</span>'}})}),l.jsx("div",{className:`pkt-inputwrapper__helptext ${nt?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i})]})]}),Lt=l.jsxs(l.Fragment,{children:[Nt(),ae(),dt&&l.jsx(Gt,{}),B,$e&&l.jsx(Gt,{}),$&&b&&l.jsx("div",{className:"pkt-inputwrapper__alert-wrapper",children:l.jsx(nn,{skin:"error","aria-live":"assertive",role:"alert",id:`${s}-error`,compact:!0,children:b})})]});return l.jsx("div",{className:It,ref:Tt,role:et,children:R?l.jsx("fieldset",{className:"pkt-inputwrapper__fieldset","aria-describedby":Ut,children:Lt}):l.jsx("div",{className:"pkt-inputwrapper__fieldset",children:Lt})})});Xs.displayName="PktInputWrapper";const Ei=w.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,autocomplete:i="off",counter:n,counterMaxLength:a,className:r,disabled:h=!1,errorMessage:d,hasError:p=!1,helptext:m,helptextDropdown:v,helptextDropdownButton:y,iconNameRight:$,inline:b=!1,fullwidth:x=!1,label:T,name:M,optionalTag:S=!1,optionalText:B,requiredTag:E=!1,requiredText:R,tagText:et=null,placeholder:Ct,prefix:Tt,suffix:nt,type:mt="text",useWrapper:Ut=!0,omitSearchIcon:Yt=!1,value:dt,minLength:$e,maxLength:Dt,min:It,max:zt,step:Gt,size:z,readonly:Nt,required:ae,dataTestid:Lt,onChange:rt,skipForwardTestid:_e=!1,...we},re)=>{const Qs=[r,"pkt-textinput"].join(" "),_s=mt==="search"&&!$&&!Yt,ws=mt==="date"&&dt?dt.slice(0,10):dt,[Qe,fe]=w.useState((dt==null?void 0:dt.length)||0),ge=`${s}`,De=`${ge}-label`,ts=e||De,xe=Zt=>{var es,_t;n&&fe(((_t=(es=Zt.currentTarget)==null?void 0:es.value)==null?void 0:_t.length)||0),rt&&rt(Zt)};return w.useEffect(()=>{dt!==void 0&&fe((dt==null?void 0:dt.length)||0)},[dt]),l.jsx(Xs,{ariaDescribedby:t,className:Qs,disabled:h,errorMessage:d,forId:ge,hasError:p,helptext:m,helptextDropdown:v,helptextDropdownButton:y,inline:b,label:T,optionalTag:S,optionalText:B,requiredTag:E,requiredText:R,tagText:et,useWrapper:Ut,counter:n,counterCurrent:Qe,counterMaxLength:a,children:l.jsxs("div",{className:"pkt-input__container","data-testid":Lt,"data-skip-forward-testid":_e?"true":void 0,children:[Tt&&l.jsx("div",{className:"pkt-input-prefix",children:Tt}),l.jsx("input",{...we,ref:re,className:`pkt-input ${x?"pkt-input--fullwidth":""} ${a&&Qe>a?"pkt-input--counter-error":""}`,type:mt,name:`${M||s}`,value:ws,id:ge,placeholder:Ct,autoComplete:i,disabled:h,"aria-invalid":p,"aria-errormessage":`${s}-error`,"aria-labelledby":ts,min:It,max:zt,onChange:xe,step:Gt,minLength:$e,maxLength:Dt,size:z,readOnly:Nt,required:ae}),nt&&l.jsxs("p",{className:"pkt-input-suffix",children:[nt,$&&l.jsx(W,{className:"pkt-input-suffix-icon",name:$}),_s&&l.jsx(W,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!nt&&$&&l.jsx(W,{className:"pkt-input-icon",name:$}),!nt&&_s&&l.jsx(W,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})});Ei.displayName="PktTextinput";const an=w.forwardRef(({mobileBreakpoint:s=768,tabletBreakpoint:t=1280,children:e,className:i,compact:n=!1,"data-mode":a,logOutButtonPlacement:r="none",logOut:h,openedMenu:d,showSearch:p=!1,onSearch:m,onSearchChange:v,searchValue:y,searchPlaceholder:$="Søk",representing:b,serviceLink:x,serviceClick:T,serviceName:M,user:S,userMenu:B,userMenuFooter:E,userOptions:R,canChangeRepresentation:et=!1,changeRepresentation:Ct,hideLogo:Tt=!1,logoLink:nt,logoClick:mt,position:Ut="fixed",scrollBehavior:Yt="hide",slotMenuVariant:dt="icon-only",slotMenuText:$e="Meny"},Dt)=>{const It=Ut==="fixed",zt=Yt==="hide";w.useEffect(()=>{E&&console.warn('PktHeaderService: The "userMenuFooter" prop is deprecated and will be removed in a future version. Please use "userMenu" instead.')},[E]),w.useEffect(()=>{R&&console.warn('PktHeaderService: The "userOptions" prop is no longer available. Please use "userMenu" instead.')},[R]),w.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 Gt=w.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]),[z,Nt]=w.useState(d||"none"),[ae,Lt]=w.useState(!1),[rt,_e]=w.useState(0),[we,re]=w.useState(!1),[Qs,_s]=w.useState(!1),ws=w.useRef(null),Qe=w.useRef(null),fe=w.useRef(null),ge=w.useRef(null),De=w.useRef(null),ts=w.useRef(null),xe=w.useRef(null),Zt=w.useRef(!1),es=Fc(ws),_t=es<s,Xt=es<t,hn=w.useCallback(c=>{ws.current=c,typeof Dt=="function"?Dt(c):Dt&&(Dt.current=c)},[Dt]);Vc(It&&_t&&z!=="none");const xs=w.useCallback((c,f)=>{const _=c.relatedTarget;let D;switch(f){case"user":D=Qe;break;case"slot":D=fe;break;case"search":D=ge;break;default:return}const V=D.current;V&&(!_||!V.contains(_))&&Nt("none")},[]),ti=w.useCallback(()=>{Zt.current&&xe.current&&document.contains(xe.current)&&xe.current.focus(),xe.current=null,Zt.current=!1},[]);w.useEffect(()=>{const c=_=>{S&&z==="user"&&!_.target.closest(".pkt-header-service__user-container")&&Nt("none"),z==="slot"&&!_.target.closest(".pkt-header-service__slot-container")&&Nt("none"),z==="search"&&!_.target.closest(".pkt-header-service__search-container")&&!_.target.closest(".pkt-header-service__search-input")&&Nt("none")},f=_=>{_.key==="Escape"&&z!=="none"&&(_.preventDefault(),Zt.current=!0,Nt("none"))};if(z!=="none")return document.addEventListener("mousedown",c),document.addEventListener("keydown",f),()=>{document.removeEventListener("mousedown",c),document.removeEventListener("keydown",f)};ti()},[z,S,ti]),w.useEffect(()=>{const c=()=>{if(zt){const f=window.pageYOffset||document.documentElement.scrollTop;if(f<0||Math.abs(f-rt)<60)return;Lt(f>rt),_e(f)}};return document&&window.addEventListener("scroll",c),()=>{document&&window.removeEventListener("scroll",c)}},[zt,rt]);const Ss=w.useCallback(c=>{const f=c==="slot"?fe:ge,_=c==="slot"?De:ts;if(!f.current||!_.current||!Xt||_t)return;const D=f.current.getBoundingClientRect(),V=_.current.offsetWidth,j=D.left+V>window.innerWidth;c==="slot"?re(j):_s(j)},[Xt,_t]),Cs=w.useCallback(c=>{z!=="none"?Nt("none"):(xe.current=document.activeElement,Nt(c))},[z]);w.useEffect(()=>{(z==="slot"||z==="search")&&requestAnimationFrame(()=>{Ss(z)})},[z,Ss]);const g=l.jsxs("header",{className:Z("pkt-header-service",n&&"pkt-header-service--compact",_t&&"pkt-header-service--mobile",Xt&&"pkt-header-service--tablet",It&&"pkt-header-service--fixed",zt&&"pkt-header-service--scroll-to-hide",ae&&"pkt-header-service--hidden",i),"data-mode":a,ref:hn,children:[l.jsxs("div",{className:Z("pkt-header-service__logo-area",(!M||M==="")&&"pkt-header-service__logo-area--without-service"),children:[!Tt&&l.jsx("span",{className:"pkt-header-service__logo",children:nt?l.jsx("a",{href:nt,"aria-label":"Tilbake til forside",children:l.jsx(W,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.5/logos/"})}):mt?l.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header-service__logo-link",onClick:mt,children:l.jsx(W,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.5/logos/"})}):l.jsx(W,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.5/logos/"})}),M&&l.jsx("span",{className:"pkt-header-service__service-name",children:x?l.jsx(Ti,{href:x,className:"pkt-header-service__service-link ",children:M}):T?l.jsx("button",{className:"pkt-link-button pkt-link pkt-header-service__service-link",onClick:T,children:M}):l.jsx("span",{className:"pkt-header-service__service-link",children:M})})]}),l.jsxs("div",{className:"pkt-header-service__content",children:[l.jsxs("div",{className:Z("pkt-header-service__slot-container",z==="slot"&&"is-open"),onBlur:c=>xs(c,"slot"),ref:fe,children:[Xt&&e&&l.jsx(pe,{skin:"secondary",variant:dt,iconName:"menu",size:_t?"small":"medium",state:z==="slot"?"active":"normal",onClick:()=>Cs("slot"),"aria-expanded":z==="slot","aria-controls":"mobile-slot-menu","aria-label":"Åpne meny",children:$e}),l.jsx("div",{className:Z("pkt-header-service__slot-content",we&&"align-right"),id:"mobile-slot-menu",role:Xt?"menu":void 0,"aria-label":Xt?"Meny":void 0,ref:De,children:l.jsx("div",{className:"pkt-contents",children:e})})]}),p&&l.jsx(l.Fragment,{children:Xt?l.jsxs("div",{className:Z("pkt-header-service__search-container",z==="search"&&"is-open"),onBlur:c=>xs(c,"search"),ref:ge,children:[l.jsx(pe,{skin:"secondary",variant:"icon-only",iconName:"magnifying-glass-big",size:_t?"small":"medium",onClick:()=>Cs("search"),state:z==="search"?"active":"normal","aria-expanded":z==="search","aria-controls":"mobile-search-menu","aria-label":"Åpne søkefelt",children:"Søk"}),l.jsx("div",{className:Z("pkt-header-service__mobile-menu",z==="search"&&"is-open",Qs&&"align-right"),ref:ts,children:z==="search"&&l.jsx(Ei,{id:"mobile-search-menu",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:$,value:y,autoFocus:!0,fullwidth:!0,onChange:c=>v==null?void 0:v(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(m==null||m(c.target.value))}})})]}):l.jsx(Ei,{id:"header-service-search",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:$,value:y,onChange:c=>v==null?void 0:v(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(m==null||m(c.target.value))}})}),Xt&&h&&(r==="header"||r==="both")&&l.jsx(pe,{skin:"secondary",size:_t?"small":"medium",variant:"icon-only",iconName:"exit",onClick:h,children:"Logg ut"})]}),l.jsxs("div",{className:"pkt-header-service__user",children:[S&&l.jsxs("div",{className:"pkt-header-service__user-container",onBlur:c=>xs(c,"user"),ref:Qe,children:[l.jsxs(pe,{className:Z("pkt-header-service__user-button",_t&&"pkt-header-service__user-button--mobile"),skin:"secondary",size:_t?"small":"medium",state:z==="user"?"active":"normal",variant:"icons-right-and-left",iconName:"user",secondIconName:z==="user"?"chevron-thin-up":"chevron-thin-down",onClick:()=>Cs("user"),children:[l.jsx("span",{className:"pkt-sr-only",children:"Brukermeny: "}),(b==null?void 0:b.name)||S.name]}),z==="user"&&S&&l.jsx("div",{className:Z(_t?"pkt-header-service__mobile-menu":"pkt-header-service__user-menu","is-open"),children:l.jsx(La,{user:S,formattedLastLoggedIn:Gt,representing:b,userMenu:B,canChangeRepresentation:et,changeRepresentation:Ct,logoutOnClick:r==="userMenu"||r==="both"?h:void 0})})]}),!_t&&h&&(r==="header"||r==="both")&&l.jsx(pe,{skin:"tertiary",size:"medium",variant:"icon-right",iconName:"exit",onClick:h,children:"Logg ut"})]})]});return It?l.jsxs("div",{className:"pkt-header-service-wrapper",children:[g,l.jsx("div",{className:Z("pkt-header-service-spacer",n&&"pkt-header-service-spacer--compact",S&&"pkt-header-service-spacer--has-user",_t&&"pkt-header-service-spacer--mobile",Xt&&"pkt-header-service-spacer--tablet")})]}):g});an.displayName="PktHeaderService";const Ba=w.forwardRef((s,t)=>l.jsx(an,{...s,ref:t}));Ba.displayName="PktHeader";const Uc=Jt({tagName:"pkt-heading",elementClass:Me,react:w,displayName:"PktHeading"}),Fa=w.forwardRef(({children:s,...t},e)=>l.jsx(Uc,{"data-testid":"pkt-heading",...t,ref:e,children:s}));Fa.displayName="PktHeading";const zc=Jt({tagName:"pkt-helptext",elementClass:ve,react:w,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),Va=w.forwardRef(({children:s,...t},e)=>l.jsx(zc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));Va.displayName="PktHelptext";const Ha=w.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]}));Ha.displayName="PktInput";const ja=({children:s,skin:t,title:e,href:i,iconName:n,openInNewTab:a,external:r,className:h,...d})=>{const p=["pkt-linkcard",t&&`pkt-linkcard--${t}`].filter(Boolean).join(" "),m=["pkt-linkcard__title",r&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return l.jsxs("a",{...d,href:i,className:Z(p,h),target:a?"_blank":"_self",rel:a?"noopener noreferrer":void 0,children:[n&&l.jsx(W,{className:"pkt-link__icon",name:n}),e&&l.jsx("div",{className:Z(m),children:e}),l.jsx("div",{className:"pkt-linkcard__text",children:s})]})};ja.displayName="PktLinkCard";const qc=Jt({tagName:"pkt-loader",elementClass:ie,react:w,displayName:"PktLoader",events:{}}),Ua=w.forwardRef(({children:s,...t},e)=>l.jsx(qc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));Ua.displayName="PktLoader";const za=({children:s,className:t,skin:e,title:i,compact:n,closable:a,onClose:r,...h})=>{const[d,p]=w.useState(!1),m={"pkt-messagebox":!0,"pkt-messagebox--compact":n,[`pkt-messagebox--${e}`]:e,"pkt-messagebox--closable":a,"pkt-hide":d},v=w.createRef(),y=w.useCallback(()=>{p(!0),r&&r()},[p,r]);return l.jsxs("div",{...h,className:Z(m,t),ref:v,children:[a&&l.jsx("div",{className:"pkt-messagebox__close",children:l.jsx("button",{onClick:y,className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only","aria-label":"Lukk",children:l.jsx(W,{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})]})};za.displayName="PktMessagebox";const Wc=Jt({tagName:"pkt-modal",elementClass:Ht,react:w,displayName:"PktModal",events:{}}),qa=w.forwardRef(({children:s,...t},e)=>l.jsx(Wc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));qa.displayName="PktModal";const Rc=Jt({tagName:"pkt-progressbar",elementClass:ct,react:w,displayName:"PktProgressbar",events:{}}),Wa=w.forwardRef(({children:s,...t},e)=>l.jsx(Rc,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",children:s})}));Wa.displayName="PktProgressbar";const Ra=w.forwardRef(({id:s,name:t,label:e,className:i,hasTile:n=!1,disabled:a=!1,checkHelptext:r,hasError:h=!1,defaultChecked:d,checked:p,optionalTag:m,optionalText:v,requiredTag:y,requiredText:$,tagText:b,...x},T)=>{const M=[i,"pkt-input-check"].filter(Boolean).join(" "),S=["pkt-input-check__input",n?"pkt-input-check__input--tile":"",a&&n?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),B=["pkt-input-check__input-checkbox",h?"pkt-input-check__input-checkbox--error":""].filter(Boolean).join(" "),E=["pkt-input-check__input-label",a?"pkt-input-check__input-label--disabled":""].filter(Boolean).join(" "),R=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),et=()=>l.jsxs(l.Fragment,{children:[b&&l.jsx("span",{className:R+" pkt-tag--gray",children:b}),m&&l.jsx("span",{className:R+" pkt-tag--blue-light",children:v}),y&&l.jsx("span",{className:R+" pkt-tag--beige",children:$})]});return l.jsx("div",{className:M,children:l.jsxs("div",{className:S,children:[l.jsx("input",{ref:T,id:s,type:"radio",name:t,disabled:a,className:B,...p!==void 0?{checked:p}:{defaultChecked:d},...x}),l.jsxs("label",{className:E,htmlFor:s,children:[e," ",et(),r&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:r})]})]})})});Ra.displayName="PktRadioButton";const Ka=w.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:p,method:m,onChange:v,onSearch:y,onSuggestionClick:$,...b},x)=>{const T=(E,R)=>{E?E():$&&$(R)},M=E=>{d=E.target.value},S=`pkt-searchinput pkt-searchinput--${s} ${e?"pkt-searchinput--fullwidth":""}`;let B;return p?B=E=>l.jsx("form",{role:"search",className:S,action:p,method:m,children:E}):B=E=>l.jsx("div",{role:"search",className:S,children:E}),B(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:v||M,onKeyUp:y&&(E=>{E.key==="Enter"&&(E.preventDefault(),y(d))}),...b}),l.jsx(pe,{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:y&&(E=>{E.preventDefault(),y(d)}),children:n||r})]}),h&&l.jsx("ul",{id:`${i}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:h.map((E,R)=>l.jsx("li",{children:w.createElement(E.href?"a":E.onClick?"button":"div",{href:E.href,className:`pkt-searchinput__suggestion ${E.onClick?"pkt-link-button":""} ${E.href||E.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:E.onClick?"button":void 0,onClick:()=>T(E.onClick,R),onKeyUp:et=>et.key==="Enter"&&T(E.onClick,R)},l.jsxs(l.Fragment,{children:[E.title&&l.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:E.title}),E.text&&l.jsx("p",{className:"pkt-searchinput__suggestion-text",children:E.text})]}))},`search-suggestion-${R}`))})]}))});Ka.displayName="PktSearchInput";const Ya=w.forwardRef(({ariaDescribedby:s,ariaLabelledby:t,children:e,className:i,disabled:n=!1,errorMessage:a,hasError:r,helptext:h,helptextDropdown:d,helptextDropdownButton:p,id:m,inline:v=!1,fullwidth:y=!1,label:$,name:b,optionalTag:x=!1,optionalText:T,requiredTag:M=!1,requiredText:S,tagText:B,...E},R)=>{const et=[i,"pkt-select"].join(" ");return l.jsx(Xs,{className:et,forId:`${m}-input`,label:$,helptext:h,helptextDropdown:d,helptextDropdownButton:p,optionalTag:x,optionalText:T,requiredTag:M,requiredText:S,tagText:B,hasError:r,errorMessage:a,disabled:n,inline:v,ariaDescribedby:s,children:l.jsx("select",{ref:R,className:`pkt-input ${y?"pkt-input--fullwidth":""}`,"aria-invalid":r,"aria-errormessage":`${m}-error`,"aria-labelledby":t||void 0,disabled:n,id:`${m}-input`,name:b||m,...E,children:e})})});Ya.displayName="PktSelect";const Kc=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)"}})}),Yc=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"})]}),Gc=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"})]}),Zc=({children:s,className:t,status:e="incomplete",title:i})=>l.jsxs("li",{className:Z("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:Z("pkt-step__indicator"),children:e==="current"?Yc:e==="completed"?Gc:Kc}),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})]})]}),Ga=w.forwardRef(({activeStep:s,className:t,children:e,hideNonActiveSteps:i=!1,hideNonActiveStepsContent:n=!0,orientation:a="vertical",...r},h)=>{const d=Z(t,"pkt-stepper",a==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),p=w.Children.map(e,(m,v)=>w.isValidElement(m)?w.cloneElement(m,{className:Z(m.props.className,{"pkt-step--hideStep":i&&v!==s,"pkt-step--hideContent":n&&v!==s})}):m);return l.jsx("ol",{"data-testid":"pkt-stepper",className:d,ref:h,...r,children:p})});Ga.displayName="PktStepper";const Xc=({className:s,compact:t=!1,skin:e="basic",responsiveView:i=!0,children:n,...a})=>l.jsx("table",{"data-testid":"pkt-table",className:Z(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}),Jc=({id:s,children:t,className:e,...i})=>l.jsx("tbody",{id:s,className:Z(e,"pkt-table__body",{}),...i,role:"rowgroup",children:t}),Qc=({children:s,className:t,dataLabel:e,...i})=>l.jsx("td",{className:Z(t,"pkt-table__data-cell",{}),"data-label":e,role:"cell","data-testid":"pkt-table__data-cell",...i,children:s}),td=({className:s,children:t,...e})=>l.jsx("thead",{className:Z(s,"pkt-table__header",{}),role:"rowgroup",...e,children:t}),ed=({className:s,children:t,...e})=>l.jsx("th",{className:Z(s,"pkt-table__header-cell",{}),role:"columnheader",...e,children:t}),sd=({className:s,children:t,...e})=>l.jsx("tr",{className:Z(s,"pkt-table__row",{}),role:"row",...e,children:t}),rn=w.forwardRef(({children:s,skin:t,textStyle:e,size:i,closeTag:n,className:a,iconName:r,ariaLabel:h,onClose:d,type:p,"aria-description":m,...v},y)=>{const[$,b]=w.useState(!1),x=w.useCallback(()=>{b(!0),d&&d()},[b]),T=w.useRef(null),[M,S]=w.useState("");w.useEffect(()=>{var et,Ct;S(((Ct=(et=T.current)==null?void 0:et.textContent)==null?void 0:Ct.trim())??"")},[s]);const B=w.useMemo(()=>{if(n&&!h)return M&&`Klikk for å fjerne ${M}`||m},[n,h,M,m]),E={"pkt-tag":!0,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${t}`]:!!t,[`pkt-tag--${e}`]:!!e},R={"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":$};return n?l.jsxs("button",{...v,className:Z(R,a),type:p,onClick:x,"aria-label":h,"aria-description":B,ref:y,children:[r&&l.jsx(W,{className:"pkt-tag__icon",name:r}),l.jsx("span",{ref:T,children:s}),l.jsx(W,{className:"pkt-tag__close-btn",name:"close"})]}):l.jsxs("span",{...v,className:Z(E,a),ref:y,children:[r&&l.jsx(W,{className:"pkt-tag__icon",name:r,"aria-hidden":"true"}),l.jsx("span",{ref:T,children:s})]})});rn.displayName="PktTag";const on=w.forwardRef(({children:s,active:t,href:e,onClick:i,icon:n,controls:a,tag:r,tagSkin:h,index:d=0},p)=>{const{arrowNav:m,registerTabRef:v,handleKeyPress:y,selectTab:$}=id(),x={"aria-selected":m?!!t:void 0,"aria-controls":a,role:m?"tab":void 0,onKeyUp:M=>y(d,M),onClick:M=>{$(d),i==null||i(M)},tabIndex:t||!m?void 0:-1,ref:M=>{v(d,M),typeof p=="function"?p(M):p&&(p.current=M)}},T=l.jsxs(l.Fragment,{children:[n&&l.jsx(W,{name:n,className:"pkt-icon--small"}),s,r&&l.jsx(rn,{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})});on.displayName="PktTabItem";const Za=w.createContext(null),id=()=>{const s=w.useContext(Za);if(!s)throw new Error("TabItem must be used within a Tabs component");return s},Xa=w.forwardRef(({arrowNav:s=!0,disableArrowNav:t=!1,tabs:e,onTabSelected:i,children:n},a)=>{const r=w.useRef([]),h=s&&!t,p=n&&w.Children.count(n)>0?w.Children.count(n):(e==null?void 0:e.length)||0;w.useEffect(()=>{r.current=r.current.slice(0,p)},[p]);const m=b=>{const x=e==null?void 0:e[b];x!=null&&x.action&&x.action(b),i&&i(b)},v=(b,x)=>{var T,M;h&&(x.code==="ArrowLeft"&&b!==0&&((T=r.current[b-1])==null||T.focus()),x.code==="ArrowRight"&&b<p-1&&((M=r.current[b+1])==null||M.focus()),(x.code==="ArrowDown"||x.code==="Space")&&m(b))},y=(b,x)=>{r.current[b]=x},$=e==null?void 0:e.map((b,x)=>{var T,M;return l.jsx(on,{active:b.active,href:b.href,onClick:()=>m(x),icon:b.icon,controls:b.controls,tag:(T=b.tag)==null?void 0:T.text,tagSkin:(M=b.tag)==null?void 0:M.skin,index:x,children:b.text},x)});return l.jsx(Za.Provider,{value:{arrowNav:h,registerTabRef:y,handleKeyPress:v,selectTab:m},children:l.jsx("div",{className:"pkt-tabs",ref:a,children:l.jsx("div",{className:"pkt-tabs__list",role:h?"tablist":"navigation",children:n||$})})})});Xa.displayName="PktTabs";const Ja=w.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,counter:i,counterMaxLength:n,className:a,disabled:r,errorMessage:h,hasError:d,helptext:p,helptextDropdown:m,helptextDropdownButton:v,inline:y,fullwidth:$=!1,label:b,name:x,optionalTag:T=!1,optionalText:M,requiredTag:S=!1,requiredText:B,tagText:E=null,placeholder:R,rows:et,useWrapper:Ct=!0,onChange:Tt,value:nt,autoComplete:mt="off",minLength:Ut,maxLength:Yt,readOnly:dt,skipForwardTestid:$e=!1,...Dt},It)=>{const zt=[a,"pkt-textinput","pkt-textarea"].join(" "),Gt=`${s}-input`,z=`${Gt}-label`,Nt=e||z,[ae,Lt]=w.useState(0),rt=_e=>{var we,re;i&&Lt(((re=(we=_e.currentTarget)==null?void 0:we.value)==null?void 0:re.length)||0),Tt&&Tt(_e)};return w.useEffect(()=>{nt!==void 0&&Lt((nt==null?void 0:nt.length)||0)},[nt]),l.jsx(Xs,{ariaDescribedby:t,className:zt,disabled:r,errorMessage:h,forId:Gt,hasError:d,helptext:p,helptextDropdown:m,helptextDropdownButton:v,inline:y,label:b,optionalTag:T,optionalText:M,requiredTag:S,requiredText:B,tagText:E,useWrapper:Ct,counter:i,counterCurrent:ae,counterMaxLength:n,children:l.jsx("textarea",{ref:It,className:`pkt-input ${$?"pkt-input--fullwidth":""} ${n&&ae>n?"pkt-input--counter-error":""}`,name:`${x||s}`,id:Gt,placeholder:R,disabled:r,rows:et,"aria-labelledby":Nt,"aria-invalid":d,"aria-errormessage":`${s}-error`,...Dt,onChange:rt,value:nt,autoComplete:mt,minLength:Ut,maxLength:Yt,readOnly:dt,"data-skip-forward-testid":$e?"true":void 0})})});Ja.displayName="PktTextarea";var ys=window.CustomEvent;(!ys||typeof ys=="object")&&(ys=function(s,t){t=t||{};var e=document.createEvent("CustomEvent");return e.initCustomEvent(s,!!t.bubbles,!!t.cancelable,t.detail||null),e},ys.prototype=window.Event.prototype);function Qa(s,t){var e="on"+t.type.toLowerCase();return typeof s[e]=="function"&&s[e](t),s.dispatchEvent(t)}function nd(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 Js(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 tr(s){for(;s&&s.shadowRoot&&s.shadowRoot.activeElement;)s=s.shadowRoot.activeElement;s&&s.blur&&s!==document.body&&s.blur()}function ad(s,t){for(var e=0;e<s.length;++e)if(s[e]===t)return!0;return!1}function ln(s){return!s||!s.hasAttribute("method")?!1:s.getAttribute("method").toLowerCase()==="dialog"}function er(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=er(n[a].shadowRoot),i));a++);return i}function sr(s){return s.isConnected||document.body.contains(s)}function ir(s){if(s.submitter)return s.submitter;var t=s.target;if(!(t instanceof HTMLFormElement))return null;var e=U.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 rd(s){if(!s.defaultPrevented){var t=s.target,e=U.imagemapUseValue,i=ir(s);e===null&&i&&(e=i.value);var n=Js(t);if(n){var a=i&&i.getAttribute("formmethod")||t.getAttribute("method");a==="dialog"&&(s.preventDefault(),e!=null?n.close(e):n.close())}}}function nr(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",rd,!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))}nr.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&sr(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_),U.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=er(this.dialog_)),tr(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(!sr(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!U.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");nd(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,U.needsCentering(this.dialog_)?(U.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 ys("close",{bubbles:!1,cancelable:!1});Qa(this.dialog_,t)}};var U={};if(U.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"},U.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||!ad(r,s))){var h=a.style.getPropertyValue("top"),d=a.style.getPropertyValue("bottom");if(h&&h!=="auto"||d&&d!=="auto")return!0}}}return!1},U.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:!U.isInlinePositionSetByStylesheet(s)},U.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 nr(s)},U.registerDialog=function(s){s.showModal||U.forceRegisterDialog(s)},U.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)}))},U.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})},U.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},U.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)},U.DialogManager.prototype.containedByTopDialog_=function(s){for(;s=Js(s);){for(var t=0,e;e=this.pendingDialogStack[t];++t)if(e.dialog===s)return t===0;s=s.parentElement}return!1},U.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(),tr(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}},U.DialogManager.prototype.handleKey_=function(s){if(this.forwardTab_=void 0,s.keyCode===27){s.preventDefault(),s.stopPropagation();var t=new ys("cancel",{bubbles:!1,cancelable:!0}),e=this.pendingDialogStack[0];e&&Qa(e.dialog,t)&&e.dialog.close()}else s.keyCode===9&&(this.forwardTab_=!s.shiftKey)},U.DialogManager.prototype.checkDOM_=function(s){var t=this.pendingDialogStack.slice();t.forEach(function(e){s.indexOf(e.dialog)!==-1?e.downgradeModal():e.maybeHideModal()})},U.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)},U.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())},U.dm=new U.DialogManager,U.formSubmitter=null,U.imagemapUseValue=null,window.HTMLDialogElement===void 0){var ar=document.createElement("form");if(ar.setAttribute("method","dialog"),ar.method!=="dialog"){var $s=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if($s){var od=$s.get;$s.get=function(){return ln(this)?"dialog":od.call(this)};var ld=$s.set;$s.set=function(s){return typeof s=="string"&&s.toLowerCase()==="dialog"?this.setAttribute("method",s):ld.call(this,s)},Object.defineProperty(HTMLFormElement.prototype,"method",$s)}}document.addEventListener("click",function(s){if(U.formSubmitter=null,U.imagemapUseValue=null,!s.defaultPrevented){var t=s.target;if("composedPath"in s){var e=s.composedPath();t=e.shift()||t}if(!(!t||!ln(t.form))){var i=t.type==="submit"&&["button","input"].indexOf(t.localName)>-1;if(!i){if(!(t.localName==="input"&&t.type==="image"))return;U.imagemapUseValue=s.offsetX+","+s.offsetY}var n=Js(t);n&&(U.formSubmitter=t)}}},!1),document.addEventListener("submit",function(s){var t=s.target,e=Js(t);if(!e){var i=ir(s),n=i&&i.getAttribute("formmethod")||t.getAttribute("method");n==="dialog"&&s.preventDefault()}});var hd=HTMLFormElement.prototype.submit,cd=function(){if(!ln(this))return hd.call(this);var s=Js(this);s&&s.close()};HTMLFormElement.prototype.submit=cd}const dd=Object.freeze(Object.defineProperty({__proto__:null,default:U},Symbol.toStringTag,{value:"Module"}));P.PktAccordion=un,P.PktAccordionItem=Na,P.PktAlert=nn,P.PktBackLink=Ma,P.PktBreadcrumbs=Aa,P.PktButton=pe,P.PktCard=Oa,P.PktCheckbox=Pa,P.PktCombobox=Da,P.PktConsent=Ci,P.PktDatepicker=Ia,P.PktFooter=Lc,P.PktFooterSimple=Bc,P.PktHeader=Ba,P.PktHeaderService=an,P.PktHeading=Fa,P.PktHelptext=Va,P.PktIcon=W,P.PktInput=Ha,P.PktInputWrapper=Xs,P.PktLink=Ti,P.PktLinkCard=ja,P.PktLoader=Ua,P.PktMessagebox=za,P.PktModal=qa,P.PktProgressbar=Wa,P.PktRadioButton=Ra,P.PktSearchInput=Ka,P.PktSelect=Ya,P.PktStep=Zc,P.PktStepper=Ga,P.PktTabItem=on,P.PktTable=Xc,P.PktTableBody=Jc,P.PktTableDataCell=Qc,P.PktTableHeader=td,P.PktTableHeaderCell=ed,P.PktTableRow=sd,P.PktTabs=Xa,P.PktTag=rn,P.PktTextarea=Ja,P.PktTextinput=Ei,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})}));
|