@oslokommune/punkt-react 13.7.0 → 13.8.1
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 +36 -0
- package/dist/index.d.ts +20 -2
- package/dist/punkt-react.es.js +1713 -1705
- package/dist/punkt-react.umd.js +191 -191
- package/package.json +3 -3
- package/src/components/combobox/Combobox.tsx +1 -1
- package/src/components/index.ts +1 -0
- package/src/components/tabs/TabItem.tsx +77 -0
- package/src/components/tabs/Tabs.test.tsx +393 -1
- package/src/components/tabs/Tabs.tsx +86 -65
package/dist/punkt-react.umd.js
CHANGED
|
@@ -33,37 +33,37 @@
|
|
|
33
33
|
return [];
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
(function(E,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):(E=typeof globalThis<"u"?globalThis:E||self,l(E["punkt-react"]={},E.ReactJsxRuntime,E.React,E.ReactRouterDOM))})(this,(function(E,l,
|
|
36
|
+
(function(E,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):(E=typeof globalThis<"u"?globalThis:E||self,l(E["punkt-react"]={},E.ReactJsxRuntime,E.React,E.ReactRouterDOM))})(this,(function(E,l,x,Hs){"use strict";function wn(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>i[e]})}}return t.default=i,Object.freeze(t)}const js=wn(x),Us=x.createContext({}),xn=()=>x.useContext(Us),qs=x.forwardRef(({compact:i=!1,skin:t="borderless",ariaLabelledBy:e,children:s,name:a,className:n},r)=>{const h=["pkt-accordion",i&&"pkt-accordion--compact",t&&`pkt-accordion--${t}`,n].filter(Boolean).join(" ");return l.jsx(Us.Provider,{value:{name:a},children:l.jsx("div",{ref:r,className:h,"data-testid":"pkt-accordion","aria-labelledby":e||void 0,children:s})})});qs.displayName="PktAccordion";/**
|
|
37
37
|
* @license
|
|
38
38
|
* Copyright 2018 Google LLC
|
|
39
39
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
40
|
-
*/const
|
|
40
|
+
*/const Sn=new Set(["children","localName","ref","style","className"]),zs=new WeakMap,Ws=(i,t,e,s,a)=>{const n=a==null?void 0:a[t];n===void 0?(i[t]=e,e==null&&t in HTMLElement.prototype&&i.removeAttribute(t)):e!==s&&((r,h,d)=>{let c=zs.get(r);c===void 0&&zs.set(r,c=new Map);let v=c.get(h);d!==void 0?v===void 0?(c.set(h,v={handleEvent:d}),r.addEventListener(h,v)):v.handleEvent=d:v!==void 0&&(c.delete(h),r.removeEventListener(h,v))})(i,n,e)},gt=({react:i,tagName:t,elementClass:e,events:s,displayName:a})=>{const n=new Set(Object.keys(s??{})),r=i.forwardRef(((h,d)=>{const c=i.useRef(new Map),v=i.useRef(null),g={},k={};for(const[b,y]of Object.entries(h))Sn.has(b)?g[b==="className"?"class":b]=y:n.has(b)||b in e.prototype?k[b]=y:g[b]=y;return i.useLayoutEffect((()=>{if(v.current===null)return;const b=new Map;for(const y in k)Ws(v.current,y,h[y],c.current.get(y),s),c.current.delete(y),b.set(y,h[y]);for(const[y,w]of c.current)Ws(v.current,y,void 0,w,s);c.current=b})),i.useLayoutEffect((()=>{var b;(b=v.current)==null||b.removeAttribute("defer-hydration")}),[]),g.suppressHydrationWarning=!0,i.createElement(t,{...g,ref:i.useCallback((b=>{v.current=b,typeof d=="function"?d(b):d!==null&&(d.current=b)}),[d])})}));return r.displayName=a??e.name,r};/**
|
|
41
41
|
* @license
|
|
42
42
|
* Copyright 2017 Google LLC
|
|
43
43
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
44
|
-
*/const Vi=globalThis,
|
|
45
|
-
\f\r]`,pi=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
46
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
44
|
+
*/const Vi=globalThis,Hi=Vi.trustedTypes,Rs=Hi?Hi.createPolicy("lit-html",{createHTML:i=>i}):void 0,Ks="$lit$",ue=`lit$${Math.random().toFixed(9).slice(2)}$`,Gs="?"+ue,Cn=`<${Gs}>`,we=document,hi=()=>we.createComment(""),di=i=>i===null||typeof i!="object"&&typeof i!="function",hs=Array.isArray,Tn=i=>hs(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",ds=`[
|
|
45
|
+
\f\r]`,pi=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ys=/-->/g,Zs=/>/g,xe=RegExp(`>|${ds}(?:([^\\s"'>=/]+)(${ds}*=${ds}*(?:[^
|
|
46
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Xs=/'/g,Js=/"/g,Qs=/^(?:script|style|textarea|title)$/i,Nn=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),u=Nn(1),$t=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),ta=new WeakMap,Se=we.createTreeWalker(we,129);function ea(i,t){if(!hs(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Rs!==void 0?Rs.createHTML(t):t}const An=(i,t)=>{const e=i.length-1,s=[];let a,n=t===2?"<svg>":t===3?"<math>":"",r=pi;for(let h=0;h<e;h++){const d=i[h];let c,v,g=-1,k=0;for(;k<d.length&&(r.lastIndex=k,v=r.exec(d),v!==null);)k=r.lastIndex,r===pi?v[1]==="!--"?r=Ys:v[1]!==void 0?r=Zs:v[2]!==void 0?(Qs.test(v[2])&&(a=RegExp("</"+v[2],"g")),r=xe):v[3]!==void 0&&(r=xe):r===xe?v[0]===">"?(r=a??pi,g=-1):v[1]===void 0?g=-2:(g=r.lastIndex-v[2].length,c=v[1],r=v[3]===void 0?xe:v[3]==='"'?Js:Xs):r===Js||r===Xs?r=xe:r===Ys||r===Zs?r=pi:(r=xe,a=void 0);const b=r===xe&&i[h+1].startsWith("/>")?" ":"";n+=r===pi?d+Cn:g>=0?(s.push(c),d.slice(0,g)+Ks+d.slice(g)+ue+b):d+ue+(g===-2?h:b)}return[ea(i,n+(i[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};let ps=class $n{constructor({strings:t,_$litType$:e},s){let a;this.parts=[];let n=0,r=0;const h=t.length-1,d=this.parts,[c,v]=An(t,e);if(this.el=$n.createElement(c,s),Se.currentNode=this.el.content,e===2||e===3){const g=this.el.content.firstChild;g.replaceWith(...g.childNodes)}for(;(a=Se.nextNode())!==null&&d.length<h;){if(a.nodeType===1){if(a.hasAttributes())for(const g of a.getAttributeNames())if(g.endsWith(Ks)){const k=v[r++],b=a.getAttribute(g).split(ue),y=/([.?@])?(.*)/.exec(k);d.push({type:1,index:n,name:y[2],strings:b,ctor:y[1]==="."?Pn:y[1]==="?"?On:y[1]==="@"?Mn:Ui}),a.removeAttribute(g)}else g.startsWith(ue)&&(d.push({type:6,index:n}),a.removeAttribute(g));if(Qs.test(a.tagName)){const g=a.textContent.split(ue),k=g.length-1;if(k>0){a.textContent=Hi?Hi.emptyScript:"";for(let b=0;b<k;b++)a.append(g[b],hi()),Se.nextNode(),d.push({type:2,index:++n});a.append(g[k],hi())}}}else if(a.nodeType===8)if(a.data===Gs)d.push({type:2,index:n});else{let g=-1;for(;(g=a.data.indexOf(ue,g+1))!==-1;)d.push({type:7,index:n}),g+=ue.length-1}n++}}static createElement(t,e){const s=we.createElement("template");return s.innerHTML=t,s}};function je(i,t,e=i,s){var a,n;if(t===$t)return t;let r=s!==void 0?(a=e._$Co)==null?void 0:a[s]:e._$Cl;const h=di(t)?void 0:t._$litDirective$;return(r==null?void 0:r.constructor)!==h&&((n=r==null?void 0:r._$AO)==null||n.call(r,!1),h===void 0?r=void 0:(r=new h(i),r._$AT(i,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=r:e._$Cl=r),r!==void 0&&(t=je(i,r._$AS(i,t.values),r,s)),t}let En=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:s}=this._$AD,a=((t==null?void 0:t.creationScope)??we).importNode(e,!0);Se.currentNode=a;let n=Se.nextNode(),r=0,h=0,d=s[0];for(;d!==void 0;){if(r===d.index){let c;d.type===2?c=new ji(n,n.nextSibling,this,t):d.type===1?c=new d.ctor(n,d.name,d.strings,this,t):d.type===6&&(c=new Dn(n,this,t)),this._$AV.push(c),d=s[++h]}r!==(d==null?void 0:d.index)&&(n=Se.nextNode(),r++)}return Se.currentNode=we,a}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},ji=class _n{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,a){this.type=2,this._$AH=$,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=a,this._$Cv=(a==null?void 0:a.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=je(this,t,e),di(t)?t===$||t==null||t===""?(this._$AH!==$&&this._$AR(),this._$AH=$):t!==this._$AH&&t!==$t&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Tn(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!==$&&di(this._$AH)?this._$AA.nextSibling.data=t:this.T(we.createTextNode(t)),this._$AH=t}$(t){var e;const{values:s,_$litType$:a}=t,n=typeof a=="number"?this._$AC(t):(a.el===void 0&&(a.el=ps.createElement(ea(a.h,a.h[0]),this.options)),a);if(((e=this._$AH)==null?void 0:e._$AD)===n)this._$AH.p(s);else{const r=new En(n,this),h=r.u(this.options);r.p(s),this.T(h),this._$AH=r}}_$AC(t){let e=ta.get(t.strings);return e===void 0&&ta.set(t.strings,e=new ps(t)),e}k(t){hs(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,a=0;for(const n of t)a===e.length?e.push(s=new _n(this.O(hi()),this.O(hi()),this,this.options)):s=e[a],s._$AI(n),a++;a<e.length&&(this._$AR(s&&s._$AB.nextSibling,a),e.length=a)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t!==this._$AB;){const a=t.nextSibling;t.remove(),t=a}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}},Ui=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,a,n){this.type=1,this._$AH=$,this._$AN=void 0,this.element=t,this.name=e,this._$AM=a,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=$}_$AI(t,e=this,s,a){const n=this.strings;let r=!1;if(n===void 0)t=je(this,t,e,0),r=!di(t)||t!==this._$AH&&t!==$t,r&&(this._$AH=t);else{const h=t;let d,c;for(t=n[0],d=0;d<n.length-1;d++)c=je(this,h[s+d],e,d),c===$t&&(c=this._$AH[d]),r||(r=!di(c)||c!==this._$AH[d]),c===$?t=$:t!==$&&(t+=(c??"")+n[d+1]),this._$AH[d]=c}r&&!a&&this.j(t)}j(t){t===$?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},Pn=class extends Ui{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===$?void 0:t}},On=class extends Ui{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==$)}},Mn=class extends Ui{constructor(t,e,s,a,n){super(t,e,s,a,n),this.type=5}_$AI(t,e=this){if((t=je(this,t,e,0)??$)===$t)return;const s=this._$AH,a=t===$&&s!==$||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==$&&(s===$||a);a&&this.element.removeEventListener(this.name,this,s),n&&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)}},Dn=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){je(this,t)}};const In={I:ji},ia=Vi.litHtmlPolyfillSupport;ia==null||ia(ps,ji),(Vi.litHtmlVersions??(Vi.litHtmlVersions=[])).push("3.3.1");const Ln=(i,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let a=s._$litPart$;if(a===void 0){const n=(e==null?void 0:e.renderBefore)??null;s._$litPart$=a=new ji(t.insertBefore(hi(),n),n,void 0,e??{})}return a._$AI(i),a};/**
|
|
47
47
|
* @license
|
|
48
48
|
* Copyright 2017 Google LLC
|
|
49
49
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
50
|
-
*/const
|
|
50
|
+
*/const j=i=>(t,e)=>{e!==void 0?e.addInitializer((()=>{customElements.define(i,t)})):customElements.define(i,t)};/**
|
|
51
51
|
* @license
|
|
52
52
|
* Copyright 2019 Google LLC
|
|
53
53
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
54
|
-
*/const qi=globalThis,
|
|
54
|
+
*/const qi=globalThis,cs=qi.ShadowRoot&&(qi.ShadyCSS===void 0||qi.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,sa=Symbol(),aa=new WeakMap;let Bn=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==sa)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(cs&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=aa.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&aa.set(e,t))}return t}toString(){return this.cssText}};const Fn=i=>new Bn(typeof i=="string"?i:i+"",void 0,sa),Vn=(i,t)=>{if(cs)i.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const e of t){const s=document.createElement("style"),a=qi.litNonce;a!==void 0&&s.setAttribute("nonce",a),s.textContent=e.cssText,i.appendChild(s)}},na=cs?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return Fn(e)})(i):i;/**
|
|
55
55
|
* @license
|
|
56
56
|
* Copyright 2017 Google LLC
|
|
57
57
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
58
|
-
*/const{is:
|
|
58
|
+
*/const{is:Hn,defineProperty:jn,getOwnPropertyDescriptor:Un,getOwnPropertyNames:qn,getOwnPropertySymbols:zn,getPrototypeOf:Wn}=Object,Ue=globalThis,ra=Ue.trustedTypes,Rn=ra?ra.emptyScript:"",oa=Ue.reactiveElementPolyfillSupport,ci=(i,t)=>i,zi={toAttribute(i,t){switch(t){case Boolean:i=i?Rn:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},us=(i,t)=>!Hn(i,t),la={attribute:!0,type:String,converter:zi,reflect:!1,useDefault:!1,hasChanged:us};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Ue.litPropertyMetadata??(Ue.litPropertyMetadata=new WeakMap);let qe=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=la){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 s=Symbol(),a=this.getPropertyDescriptor(t,s,e);a!==void 0&&jn(this.prototype,t,a)}}static getPropertyDescriptor(t,e,s){const{get:a,set:n}=Un(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get:a,set(r){const h=a==null?void 0:a.call(this);n==null||n.call(this,r),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??la}static _$Ei(){if(this.hasOwnProperty(ci("elementProperties")))return;const t=Wn(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(ci("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ci("properties"))){const e=this.properties,s=[...qn(e),...zn(e)];for(const a of s)this.createProperty(a,e[a])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,a]of e)this.elementProperties.set(s,a)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const a=this._$Eu(e,s);a!==void 0&&this._$Eh.set(a,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const a of s)e.unshift(na(a))}else t!==void 0&&e.push(na(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s: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 s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Vn(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 s;return(s=e.hostConnected)==null?void 0:s.call(e)}))}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach((e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)}))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){var s;const a=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,a);if(n!==void 0&&a.reflect===!0){const r=(((s=a.converter)==null?void 0:s.toAttribute)!==void 0?a.converter:zi).toAttribute(e,a.type);this._$Em=t,r==null?this.removeAttribute(n):this.setAttribute(n,r),this._$Em=null}}_$AK(t,e){var s,a;const n=this.constructor,r=n._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const h=n.getPropertyOptions(r),d=typeof h.converter=="function"?{fromAttribute:h.converter}:((s=h.converter)==null?void 0:s.fromAttribute)!==void 0?h.converter:zi;this._$Em=r;const c=d.fromAttribute(e,h.type);this[r]=c??((a=this._$Ej)==null?void 0:a.get(r))??c,this._$Em=null}}requestUpdate(t,e,s){var a;if(t!==void 0){const n=this.constructor,r=this[t];if(s??(s=n.getPropertyOptions(t)),!((s.hasChanged??us)(r,e)||s.useDefault&&s.reflect&&r===((a=this._$Ej)==null?void 0:a.get(t))&&!this.hasAttribute(n._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:a,wrapped:n},r){s&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,r??e??this[t]),n!==!0||r!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),a===!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[n,r]of this._$Ep)this[n]=r;this._$Ep=void 0}const a=this.constructor.elementProperties;if(a.size>0)for(const[n,r]of a){const{wrapped:h}=r,d=this[n];h!==!0||this._$AL.has(n)||d===void 0||this.C(n,void 0,r,d)}}let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),(t=this._$EO)==null||t.forEach((a=>{var n;return(n=a.hostUpdate)==null?void 0:n.call(a)})),this.update(s)):this._$EM()}catch(a){throw e=!1,this._$EM(),a}e&&this._$AE(s)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach((s=>{var a;return(a=s.hostUpdated)==null?void 0:a.call(s)})),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){}};qe.elementStyles=[],qe.shadowRootOptions={mode:"open"},qe[ci("elementProperties")]=new Map,qe[ci("finalized")]=new Map,oa==null||oa({ReactiveElement:qe}),(Ue.reactiveElementVersions??(Ue.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 Kn={attribute:!0,type:String,converter:zi,reflect:!1,hasChanged:us},Gn=(i=Kn,t,e)=>{const{kind:s,metadata:a}=e;let n=globalThis.litPropertyMetadata.get(a);if(n===void 0&&globalThis.litPropertyMetadata.set(a,n=new Map),s==="setter"&&((i=Object.create(i)).wrapped=!0),n.set(e.name,i),s==="accessor"){const{name:r}=e;return{set(h){const d=t.get.call(this);t.set.call(this,h),this.requestUpdate(r,d,i)},init(h){return h!==void 0&&this.C(r,void 0,i,h),h}}}if(s==="setter"){const{name:r}=e;return function(h){const d=this[r];t.call(this,h),this.requestUpdate(r,d,i)}}throw Error("Unsupported decorator location: "+s)};function o(i){return(t,e)=>typeof e=="object"?Gn(i,t,e):((s,a,n)=>{const r=a.hasOwnProperty(n);return a.constructor.createProperty(n,s),r?Object.getOwnPropertyDescriptor(a,n):void 0})(i,t,e)}/**
|
|
63
63
|
* @license
|
|
64
64
|
* Copyright 2017 Google LLC
|
|
65
65
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
66
|
-
*/const ui=globalThis;let ze=class extends qe{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=
|
|
66
|
+
*/const ui=globalThis;let ze=class extends qe{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=Ln(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 $t}};var ha;ze._$litElement$=!0,ze.finalized=!0,(ha=ui.litElementHydrateSupport)==null||ha.call(ui,{LitElement:ze});const da=ui.litElementPolyfillSupport;da==null||da({LitElement:ze}),(ui.litElementVersions??(ui.litElementVersions=[])).push("4.2.1");const Yn={hi:"Hei!"},Zn={from:"Fra",to:"Til"},Xn={buttonAltText:"Åpne kalender",deleteDate:"Fjern dato"},Jn={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"},Qn={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."}},bt={example:Yn,generic:Zn,calendar:Xn,dates:Jn,forms:Qn};var tr=Object.defineProperty,pa=(i,t,e,s)=>{for(var a=void 0,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=r(t,e,a)||a);return a&&tr(t,e,a),a};let Wi=class extends ze{constructor(){super(...arguments),this.strings=bt,this.role=null}hotReplacedCallback(){this.requestUpdate()}};pa([o({type:Object})],Wi.prototype,"strings"),pa([o({type:String})],Wi.prototype,"role");let Y=class extends Wi{createRenderRoot(){return this}};/**
|
|
67
67
|
* @license
|
|
68
68
|
* Copyright 2017 Google LLC
|
|
69
69
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -75,49 +75,49 @@
|
|
|
75
75
|
* @license
|
|
76
76
|
* Copyright 2017 Google LLC
|
|
77
77
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
78
|
-
*/function U(i){return o({...i,state:!0,attribute:!1})}function
|
|
78
|
+
*/function U(i){return o({...i,state:!0,attribute:!1})}function ca(i,t){return t.some(e=>e.value===i)}function fi(i){return i.classList&&(i.classList.contains("_dialog_overlay")||i.classList.contains("backdrop"))?!0:typeof i.hasAttribute=="function"&&i.hasAttribute("data-skip")}function Re(i){return i.nodeName==="OPTION"||i.nodeName==="DATA"}function er(i,t){return i.nodeType===Node.ELEMENT_NODE&&!ca(i,t)}function fs(i){var t;return i.nodeType===Node.TEXT_NODE&&((t=i.nodeValue)==null?void 0:t.trim())!==""}let pt=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(s=>this.handleMutations(s)),this.contentObserver=new MutationObserver(s=>this.handleSlotMutations(s))}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=>{fi(t)||Re(t)&&this.skipOptions||(!ca(t,this.slots)||fs(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 s=e.value.getAttribute("name");Array.from(e.value.childNodes).some(n=>{var r,h;if(n.nodeType===Node.COMMENT_NODE)return!1;if(n.nodeType===Node.TEXT_NODE)return!!((r=n.textContent)!=null&&r.trim());if(n.nodeType===Node.ELEMENT_NODE){if(fi(n))return!1;if((h=n.textContent)!=null&&h.trim())return!0}return!1})&&t.add(s);const a=this.nodes.flatMap(n=>fs(n)||n.getAttribute&&n.getAttribute("slot")==s&&!fi(n)?n:[]).filter(n=>e.value&&!e.value.contains(n)&&!n.contains(e.value));if(a.length>0)if(typeof e.value.replaceChildren!="function"){for(;e.value.firstChild;)e.value.removeChild(e.value.firstChild);e.value.append(...a)}else e.value.replaceChildren(...a)}),(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(s=>{s.type==="childList"&&(s.addedNodes.forEach(a=>{fi(a)||Re(a)&&this.skipOptions||(er(a,this.slots)||fs(a))&&(this.nodes.push(a),e=!0)}),s.removedNodes.forEach(a=>{fi(a)||Re(a)&&this.skipOptions||(this.nodes=this.nodes.filter(n=>n!==a),e=!0)}))}),e&&this.updateSlots()}handleSlotMutations(t){let e=!1;t.forEach(s=>{const a=s.target.parentElement;if(a!=null&&a.hasAttribute("slot")){const n=a.getAttribute("slot"),r=a.hasChildNodes();r&&!this.filledSlots.has(n)?(this.filledSlots.add(n),e=!0):!r&&this.filledSlots.has(n)&&(this.filledSlots.delete(n),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:ir}=In,ua=i=>i.strings===void 0,fa=()=>document.createComment(""),gi=(i,t,e)=>{var s;const a=i._$AA.parentNode,n=t===void 0?i._$AB:t._$AA;if(e===void 0){const r=a.insertBefore(fa(),n),h=a.insertBefore(fa(),n);e=new ir(r,h,i,i.options)}else{const r=e._$AB.nextSibling,h=e._$AM,d=h!==i;if(d){let c;(s=e._$AQ)==null||s.call(e,i),e._$AM=i,e._$AP!==void 0&&(c=i._$AU)!==h._$AU&&e._$AP(c)}if(r!==n||d){let c=e._$AA;for(;c!==r;){const v=c.nextSibling;a.insertBefore(c,n),c=v}}}return e},Te=(i,t,e=i)=>(i._$AI(t,e),i),sr={},ga=(i,t=sr)=>i._$AH=t,ar=i=>i._$AH,gs=i=>{i._$AR(),i._$AA.remove()};/**
|
|
83
83
|
* @license
|
|
84
84
|
* Copyright 2017 Google LLC
|
|
85
85
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
86
|
-
*/const mi=(i,t)=>{var e;const s=i._$AN;if(s===void 0)return!1;for(const a of s)(e=a._$AO)==null||e.call(a,t,!1),mi(a,t);return!0},Ri=i=>{let t,e;do{if((t=i._$AM)===void 0)break;e=t._$AN,e.delete(i),i=t}while((e==null?void 0:e.size)===0)},
|
|
86
|
+
*/const mi=(i,t)=>{var e;const s=i._$AN;if(s===void 0)return!1;for(const a of s)(e=a._$AO)==null||e.call(a,t,!1),mi(a,t);return!0},Ri=i=>{let t,e;do{if((t=i._$AM)===void 0)break;e=t._$AN,e.delete(i),i=t}while((e==null?void 0:e.size)===0)},ma=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),or(t)}};function nr(i){this._$AN!==void 0?(Ri(this),this._$AM=i,ma(this)):this._$AM=i}function rr(i,t=!1,e=0){const s=this._$AH,a=this._$AN;if(a!==void 0&&a.size!==0)if(t)if(Array.isArray(s))for(let n=e;n<s.length;n++)mi(s[n],!1),Ri(s[n]);else s!=null&&(mi(s,!1),Ri(s));else mi(this,i)}const or=i=>{i.type==Kt.CHILD&&(i._$AP??(i._$AP=rr),i._$AQ??(i._$AQ=nr))};let lr=class extends We{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),ma(this),this.isConnected=t._$AU}_$AO(t,e=!0){var s,a;t!==this.isConnected&&(this.isConnected=t,t?(s=this.reconnected)==null||s.call(this):(a=this.disconnected)==null||a.call(this)),e&&(mi(this,t),Ri(this))}setValue(t){if(ua(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 P=()=>new hr;let hr=class{};const ms=new WeakMap,O=Ce(class extends lr{render(i){return $}update(i,[t]){var e;const s=t!==this.G;return s&&this.G!==void 0&&this.rt(void 0),(s||this.lt!==this.ct)&&(this.G=t,this.ht=(e=i.options)==null?void 0:e.host,this.rt(this.ct=i.element)),$}rt(i){if(this.isConnected||(i=void 0),typeof this.G=="function"){const t=this.ht??globalThis;let e=ms.get(t);e===void 0&&(e=new WeakMap,ms.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ht,void 0),e.set(this.G,i),i!==void 0&&this.G.call(this.ht,i)}else this.G.value=i}get lt(){var i,t;return typeof this.G=="function"?(i=ms.get(this.ht??globalThis))==null?void 0:i.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 va(i,t,e){const s=i.getAttribute("class")||"",a=new Set(s.split(/\s+/).filter(Boolean));e?a.add(t):a.delete(t),i.setAttribute("class",Array.from(a).join(" "))}/**
|
|
91
91
|
* @license
|
|
92
92
|
* Copyright 2017 Google LLC
|
|
93
93
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
94
|
-
*/let Ki=class extends We{constructor(t){if(super(t),this.it
|
|
94
|
+
*/let Ki=class extends We{constructor(t){if(super(t),this.it=$,t.type!==Kt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===$||t==null)return this._t=void 0,this.it=t;if(t===$t)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:[]}}};Ki.directiveName="unsafeHTML",Ki.resultType=1;const Gi=Ce(Ki);/**
|
|
95
95
|
* @license
|
|
96
96
|
* Copyright 2017 Google LLC
|
|
97
97
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
98
|
-
*/let
|
|
98
|
+
*/let vs=class extends Ki{};vs.directiveName="unsafeSVG",vs.resultType=2;const ba=Ce(vs);var dr=Object.defineProperty,pr=Object.getOwnPropertyDescriptor,vi=(i,t,e,s)=>{for(var a=s>1?void 0:s?pr(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&dr(t,e,a),a};const bs="https://punkt-cdn.oslo.kommune.no/13.8/icons/";typeof window<"u"&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||bs);const cr=i=>new Promise(t=>setTimeout(t,i)),Yi='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',ys={},ur=async(i,t)=>{let e=0;for(;ys[t+i+".svg"]==="fetching"&&(e++,!(e>50));)await cr(50);const s=typeof Storage<"u"&&typeof localStorage<"u";return s&&localStorage.getItem(t+i+".svg")?Promise.resolve(localStorage.getItem(t+i+".svg")):typeof window<"u"&&typeof window.pktFetch=="function"?(ys[t+i+".svg"]="fetching",Promise.resolve(window.pktFetch(t+i+".svg").then(a=>a.ok?a.text():(console.error("Missing icon: "+t+i+".svg"),Yi)).then(a=>(a!==Yi&&s&&localStorage.setItem(t+i+".svg",a),ys[t+i+".svg"]="fetched",a)))):Promise.resolve(Yi)};let Ne=class extends Y{constructor(){super(...arguments),this.path=typeof window<"u"?window.pktIconPath:bs,this.name="",this.icon=ba(Yi),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(t,e,s){super.attributeChangedCallback(t,e,s),(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:bs),this.icon=ba(await ur(this.name||"",this.path).then(e=>e)),this._updatedProps=[]):this._updatedProps.includes(t)||this._updatedProps.push(t)}render(){return u`${this.name&&this.icon}`}};vi([o({type:String,reflect:!1})],Ne.prototype,"path",2),vi([o({type:String,reflect:!0})],Ne.prototype,"name",2),vi([o({type:SVGElement})],Ne.prototype,"icon",2),vi([o({type:Array,noAccessor:!0})],Ne.prototype,"_updatedProps",2),Ne=vi([j("pkt-icon")],Ne);/**
|
|
99
99
|
* @license
|
|
100
100
|
* Copyright 2018 Google LLC
|
|
101
101
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
102
|
-
*/const
|
|
102
|
+
*/const T=i=>i??$;var fr=Object.defineProperty,gr=Object.getOwnPropertyDescriptor,_t=(i,t,e,s)=>{for(var a=s>1?void 0:s?gr(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&fr(t,e,a),a};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/13.8/animations/";let yt=class extends Y{constructor(){super(),this.defaultSlot=P(),this.iconName="user",this.secondIconName="user",this.mode="light",this.size="medium",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 pt(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,s){super.attributeChangedCallback(t,e,s),t==="disabled"&&s==="false"&&(this.disabled=!1),(t==="isloading"||t==="isLoading")&&s==="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--disabled":!!this.disabled,"pkt-btn--isLoading":!!this.isLoading};return u`
|
|
103
103
|
<button
|
|
104
104
|
class=${A(e)}
|
|
105
105
|
type=${this.type}
|
|
106
106
|
?disabled=${!!this.disabled}
|
|
107
|
-
aria-busy=${
|
|
108
|
-
aria-disabled=${
|
|
109
|
-
form=${
|
|
107
|
+
aria-busy=${T(this.isLoading?"true":void 0)}
|
|
108
|
+
aria-disabled=${T(this.disabled||this.isLoading?"true":void 0)}
|
|
109
|
+
form=${T(t)}
|
|
110
110
|
>
|
|
111
111
|
${this.isLoading?u`<pkt-icon
|
|
112
112
|
class="pkt-btn__icon pkt-btn__spinner"
|
|
113
113
|
name="spinner-blue"
|
|
114
|
-
path=${
|
|
115
|
-
></pkt-icon
|
|
116
|
-
${this.variant!=="label-only"?u`<pkt-icon class="pkt-btn__icon pkt-icon" name=${this.iconName}></pkt-icon
|
|
114
|
+
path=${T(this.loadingAnimationPath)}
|
|
115
|
+
></pkt-icon>`:$}
|
|
116
|
+
${this.variant!=="label-only"?u`<pkt-icon class="pkt-btn__icon pkt-icon" name=${this.iconName}></pkt-icon>`:$}
|
|
117
117
|
<span class="pkt-btn__text" ${O(this.defaultSlot)}></span>
|
|
118
|
-
${this.variant==="icons-right-and-left"?u`<pkt-icon class="pkt-btn__icon" name=${this.secondIconName}></pkt-icon
|
|
118
|
+
${this.variant==="icons-right-and-left"?u`<pkt-icon class="pkt-btn__icon" name=${this.secondIconName}></pkt-icon>`:$}
|
|
119
119
|
</button>
|
|
120
|
-
`}};_t([o({type:String})],
|
|
120
|
+
`}};_t([o({type:String})],yt.prototype,"iconName",2),_t([o({type:String})],yt.prototype,"secondIconName",2),_t([o({type:String})],yt.prototype,"mode",2),_t([o({type:String})],yt.prototype,"size",2),_t([o({type:String})],yt.prototype,"color",2),_t([o({type:String})],yt.prototype,"skin",2),_t([o({type:String})],yt.prototype,"variant",2),_t([o({type:String,reflect:!0})],yt.prototype,"state",2),_t([o({type:String,reflect:!0})],yt.prototype,"type",2),_t([o({type:String})],yt.prototype,"form",2),_t([o({type:Boolean,reflect:!0})],yt.prototype,"isLoading",2),_t([o({type:Boolean,reflect:!0})],yt.prototype,"disabled",2),_t([o({type:String})],yt.prototype,"loadingAnimationPath",2),yt=_t([j("pkt-button")],yt);const mr={skin:{default:"info"},ariaLive:{default:"polite"},compact:{default:!1},closeAlert:{default:!1}},Zi={props:mr};var vr=Object.defineProperty,br=Object.getOwnPropertyDescriptor,Jt=(i,t,e,s)=>{for(var a=s>1?void 0:s?br(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&vr(t,e,a),a};let Ut=class extends Y{constructor(){super(),this.defaultSlot=P(),this.compact=Zi.props.compact.default,this.title="",this.skin=Zi.props.skin.default,this.ariaLive=Zi.props.ariaLive.default,this["aria-live"]=null,this.closeAlert=Zi.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 pt(this,this.defaultSlot),this._isClosed=!1}connectedCallback(){super.connectedCallback(),this["aria-live"]=this.getAttribute("aria-live")||this.ariaLive}attributeChangedCallback(t,e,s){t==="ariaLive"&&(this["aria-live"]=s),super.attributeChangedCallback(t,e,s)}updated(t){super.updated(t),t.has("ariaLive")&&(this["aria-live"]=this.ariaLive),t.has("_isClosed")&&va(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`
|
|
121
121
|
<div class=${A(t)} aria-live=${this["aria-live"]}>
|
|
122
122
|
<div class=${A(e)}>
|
|
123
123
|
<pkt-icon
|
|
@@ -141,15 +141,15 @@
|
|
|
141
141
|
<span class="sr-only">Lukk</span>
|
|
142
142
|
</pkt-button>
|
|
143
143
|
</div>
|
|
144
|
-
|
|
145
|
-
${this.title?u`<div class="pkt-alert__title">${this.title}</div
|
|
144
|
+
`:$}
|
|
145
|
+
${this.title?u`<div class="pkt-alert__title">${this.title}</div>`:$}
|
|
146
146
|
|
|
147
147
|
<div class="pkt-alert__text" ${O(this.defaultSlot)}></div>
|
|
148
148
|
|
|
149
|
-
${this.date?u`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div
|
|
149
|
+
${this.date?u`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>`:$}
|
|
150
150
|
</div>
|
|
151
151
|
</div>
|
|
152
|
-
`}};Jt([o({type:Boolean,reflect:!1})],Ut.prototype,"compact",2),Jt([o({type:String,reflect:!0})],Ut.prototype,"title",2),Jt([o({type:String,reflect:!0})],Ut.prototype,"skin",2),Jt([o({type:String})],Ut.prototype,"ariaLive",2),Jt([o({type:String,reflect:!0})],Ut.prototype,"aria-live",2),Jt([o({type:Boolean,reflect:!0})],Ut.prototype,"closeAlert",2),Jt([o({type:String,reflect:!0})],Ut.prototype,"date",2),Jt([o({type:String,reflect:!0})],Ut.prototype,"role",2),Jt([U()],Ut.prototype,"_isClosed",2),Ut=Jt([
|
|
152
|
+
`}};Jt([o({type:Boolean,reflect:!1})],Ut.prototype,"compact",2),Jt([o({type:String,reflect:!0})],Ut.prototype,"title",2),Jt([o({type:String,reflect:!0})],Ut.prototype,"skin",2),Jt([o({type:String})],Ut.prototype,"ariaLive",2),Jt([o({type:String,reflect:!0})],Ut.prototype,"aria-live",2),Jt([o({type:Boolean,reflect:!0})],Ut.prototype,"closeAlert",2),Jt([o({type:String,reflect:!0})],Ut.prototype,"date",2),Jt([o({type:String,reflect:!0})],Ut.prototype,"role",2),Jt([U()],Ut.prototype,"_isClosed",2),Ut=Jt([j("pkt-alert")],Ut);var yr=Object.defineProperty,kr=Object.getOwnPropertyDescriptor,bi=(i,t,e,s)=>{for(var a=s>1?void 0:s?kr(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&yr(t,e,a),a};let Ke=class extends ze{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(s=>{s.tagName.toLowerCase()==="pkt-accordion-item"&&(s.hasAttribute("name")||s.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`
|
|
153
153
|
<div
|
|
154
154
|
part="container"
|
|
155
155
|
class=${A(t)}
|
|
@@ -158,13 +158,13 @@
|
|
|
158
158
|
>
|
|
159
159
|
<slot></slot>
|
|
160
160
|
</div>
|
|
161
|
-
`}};
|
|
161
|
+
`}};bi([o({type:String,reflect:!0,attribute:"aria-labelledby"})],Ke.prototype,"ariaLabelledBy",2),bi([o({type:Boolean,reflect:!0,attribute:"compact"})],Ke.prototype,"compact",2),bi([o({type:String,reflect:!0,attribute:"skin"})],Ke.prototype,"skin",2),bi([o({type:String,reflect:!0,attribute:"name"})],Ke.prototype,"name",2),Ke=bi([j("pkt-accordion")],Ke);var $r=Object.defineProperty,_r=Object.getOwnPropertyDescriptor,Ae=(i,t,e,s)=>{for(var a=s>1?void 0:s?_r(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&$r(t,e,a),a};let fe=class extends Y{constructor(){super(),this.defaultOpen=!1,this.title="",this.skin=void 0,this.compact=!1,this.isOpen=!1,this.name=void 0,this.accordionItemRef=P(),this.defaultSlot=P(),this.slotController=new pt(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`
|
|
162
162
|
<details
|
|
163
163
|
class=${A(t)}
|
|
164
164
|
id=${this.id}
|
|
165
165
|
?open=${this.isOpen}
|
|
166
166
|
${O(this.accordionItemRef)}
|
|
167
|
-
name=${
|
|
167
|
+
name=${T(this.name)}
|
|
168
168
|
>
|
|
169
169
|
<summary class="pkt-accordion-item__title" id=${`pkt-accordion-item-summary-${this.id}`}>
|
|
170
170
|
${this.title}
|
|
@@ -182,11 +182,11 @@
|
|
|
182
182
|
<div class="pkt-accordion-item__content-inner" ${O(this.defaultSlot)}></div>
|
|
183
183
|
</div>
|
|
184
184
|
</details>
|
|
185
|
-
`}};
|
|
185
|
+
`}};Ae([o({type:Boolean})],fe.prototype,"defaultOpen",2),Ae([o({type:String})],fe.prototype,"title",2),Ae([o({type:String,reflect:!0})],fe.prototype,"skin",2),Ae([o({type:Boolean,reflect:!0})],fe.prototype,"compact",2),Ae([o({type:Boolean,reflect:!0})],fe.prototype,"isOpen",2),Ae([o({type:String,reflect:!0})],fe.prototype,"name",2),fe=Ae([j("pkt-accordion-item")],fe);var wr=Object.defineProperty,xr=Object.getOwnPropertyDescriptor,Xi=(i,t,e,s)=>{for(var a=s>1?void 0:s?xr(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&wr(t,e,a),a};let Ge=class extends Y{constructor(){super(...arguments),this.href="",this.text="Forsiden",this.ariaLabel=""}attributeChangedCallback(t,e,s){t==="arialabel"&&this.removeAttribute("arialabel"),t==="href"&&this.removeAttribute("href"),t==="text"&&this.removeAttribute("text"),super.attributeChangedCallback(t,e,s)}render(){return u`<nav
|
|
186
186
|
class="pkt-back-link"
|
|
187
187
|
aria-label=${this.ariaLabel||"Gå tilbake til forrige side"}
|
|
188
188
|
>
|
|
189
|
-
<a href=${
|
|
189
|
+
<a href=${T(this.href||"/")} class="pkt-link pkt-link--icon-left"
|
|
190
190
|
><pkt-icon
|
|
191
191
|
class="pkt-back-link__icon pkt-icon pkt-link__icon"
|
|
192
192
|
name="chevron-thin-left"
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
></pkt-icon
|
|
195
195
|
><span class="pkt-back-link__text">${this.text}</span></a
|
|
196
196
|
>
|
|
197
|
-
</nav>`}};Xi([o({type:String})],Ge.prototype,"href",2),Xi([o({type:String})],Ge.prototype,"text",2),Xi([o({type:String})],Ge.prototype,"ariaLabel",2),Ge=Xi([H("pkt-backlink")],Ge);const ya=6048e5,wr=864e5,ba=Symbol.for("constructDateFrom");function Qt(i,t){return typeof i=="function"?i(t):i&&typeof i=="object"&&ba in i?i[ba](t):i instanceof Date?new i.constructor(t):new Date(t)}function At(i,t){return Qt(t||i,i)}function $s(i,t,e){const s=At(i,void 0);return isNaN(t)?Qt(i,NaN):(t&&s.setDate(s.getDate()+t),s)}let xr={};function Ji(){return xr}function bi(i,t){var e,s,a,n;const r=Ji(),h=(t==null?void 0:t.weekStartsOn)??((s=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:s.weekStartsOn)??r.weekStartsOn??((n=(a=r.locale)==null?void 0:a.options)==null?void 0:n.weekStartsOn)??0,d=At(i,t==null?void 0:t.in),c=d.getDay(),v=(c<h?7:0)+c-h;return d.setDate(d.getDate()-v),d.setHours(0,0,0,0),d}function Qi(i,t){return bi(i,{...t,weekStartsOn:1})}function ka(i,t){const e=At(i,void 0),s=e.getFullYear(),a=Qt(e,0);a.setFullYear(s+1,0,4),a.setHours(0,0,0,0);const n=Qi(a),r=Qt(e,0);r.setFullYear(s,0,4),r.setHours(0,0,0,0);const h=Qi(r);return e.getTime()>=n.getTime()?s+1:e.getTime()>=h.getTime()?s:s-1}function $a(i){const t=At(i),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+i-+e}function _a(i,...t){const e=Qt.bind(null,t.find(s=>typeof s=="object"));return t.map(e)}function wa(i,t){const e=At(i,void 0);return e.setHours(0,0,0,0),e}function Sr(i,t,e){const[s,a]=_a(void 0,i,t),n=wa(s),r=wa(a),h=+n-$a(n),d=+r-$a(r);return Math.round((h-d)/wr)}function Cr(i,t){const e=ka(i),s=Qt(i,0);return s.setFullYear(e,0,4),s.setHours(0,0,0,0),Qi(s)}function Tr(i){return i instanceof Date||typeof i=="object"&&Object.prototype.toString.call(i)==="[object Date]"}function Ar(i){return!(!Tr(i)&&typeof i!="number"||isNaN(+At(i)))}function Nr(i,t){const[e,s]=_a(i,t.start,t.end);return{start:e,end:s}}function _s(i,t){const{start:e,end:s}=Nr(void 0,i);let a=+e>+s;const n=a?+e:+s,r=a?s:e;r.setHours(0,0,0,0);let h=1;const d=[];for(;+r<=n;)d.push(Qt(e,r)),r.setDate(r.getDate()+h),r.setHours(0,0,0,0);return a?d.reverse():d}function Er(i,t){const e=At(i,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const Or={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"}},Mr=(i,t,e)=>{let s;const a=Or[i];return typeof a=="string"?s=a:t===1?s=a.one:s=a.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+s:s+" ago":s};function ws(i){return(t={})=>{const e=t.width?String(t.width):i.defaultWidth;return i.formats[e]||i.formats[i.defaultWidth]}}const Pr={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Dr={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ir={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Lr={date:ws({formats:Pr,defaultWidth:"full"}),time:ws({formats:Dr,defaultWidth:"full"}),dateTime:ws({formats:Ir,defaultWidth:"full"})},Br={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Fr=(i,t,e,s)=>Br[i];function ki(i){return(t,e)=>{const s=e!=null&&e.context?String(e.context):"standalone";let a;if(s==="formatting"&&i.formattingValues){const r=i.defaultFormattingWidth||i.defaultWidth,h=e!=null&&e.width?String(e.width):r;a=i.formattingValues[h]||i.formattingValues[r]}else{const r=i.defaultWidth,h=e!=null&&e.width?String(e.width):i.defaultWidth;a=i.values[h]||i.values[r]}const n=i.argumentCallback?i.argumentCallback(t):t;return a[n]}}const Vr={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},jr={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Hr={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"]},Ur={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},qr={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},zr={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"}},Wr=(i,t)=>{const e=Number(i),s=e%100;if(s>20||s<10)switch(s%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},Rr={ordinalNumber:Wr,era:ki({values:Vr,defaultWidth:"wide"}),quarter:ki({values:jr,defaultWidth:"wide",argumentCallback:i=>i-1}),month:ki({values:Hr,defaultWidth:"wide"}),day:ki({values:Ur,defaultWidth:"wide"}),dayPeriod:ki({values:qr,defaultWidth:"wide",formattingValues:zr,defaultFormattingWidth:"wide"})};function $i(i){return(t,e={})=>{const s=e.width,a=s&&i.matchPatterns[s]||i.matchPatterns[i.defaultMatchWidth],n=t.match(a);if(!n)return null;const r=n[0],h=s&&i.parsePatterns[s]||i.parsePatterns[i.defaultParseWidth],d=Array.isArray(h)?Gr(h,m=>m.test(r)):Kr(h,m=>m.test(r));let c;c=i.valueCallback?i.valueCallback(d):d,c=e.valueCallback?e.valueCallback(c):c;const v=t.slice(r.length);return{value:c,rest:v}}}function Kr(i,t){for(const e in i)if(Object.prototype.hasOwnProperty.call(i,e)&&t(i[e]))return e}function Gr(i,t){for(let e=0;e<i.length;e++)if(t(i[e]))return e}function Yr(i){return(t,e={})=>{const s=t.match(i.matchPattern);if(!s)return null;const a=s[0],n=t.match(i.parsePattern);if(!n)return null;let r=i.valueCallback?i.valueCallback(n[0]):n[0];r=e.valueCallback?e.valueCallback(r):r;const h=t.slice(a.length);return{value:r,rest:h}}}const Zr=/^(\d+)(th|st|nd|rd)?/i,Xr=/\d+/i,Jr={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},Qr={any:[/^b/i,/^(a|c)/i]},to={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},eo={any:[/1/i,/2/i,/3/i,/4/i]},io={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},so={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]},ao={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},no={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]},ro={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},oo={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}},lo={ordinalNumber:Yr({matchPattern:Zr,parsePattern:Xr,valueCallback:i=>parseInt(i,10)}),era:$i({matchPatterns:Jr,defaultMatchWidth:"wide",parsePatterns:Qr,defaultParseWidth:"any"}),quarter:$i({matchPatterns:to,defaultMatchWidth:"wide",parsePatterns:eo,defaultParseWidth:"any",valueCallback:i=>i+1}),month:$i({matchPatterns:io,defaultMatchWidth:"wide",parsePatterns:so,defaultParseWidth:"any"}),day:$i({matchPatterns:ao,defaultMatchWidth:"wide",parsePatterns:no,defaultParseWidth:"any"}),dayPeriod:$i({matchPatterns:ro,defaultMatchWidth:"any",parsePatterns:oo,defaultParseWidth:"any"})},ho={code:"en-US",formatDistance:Mr,formatLong:Lr,formatRelative:Fr,localize:Rr,match:lo,options:{weekStartsOn:0,firstWeekContainsDate:1}};function po(i,t){const e=At(i,void 0);return Sr(e,Er(e))+1}function co(i,t){const e=At(i,void 0),s=+Qi(e)-+Cr(e);return Math.round(s/ya)+1}function xa(i,t){var e,s,a,n;const r=At(i,t==null?void 0:t.in),h=r.getFullYear(),d=Ji(),c=(t==null?void 0:t.firstWeekContainsDate)??((s=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:s.firstWeekContainsDate)??d.firstWeekContainsDate??((n=(a=d.locale)==null?void 0:a.options)==null?void 0:n.firstWeekContainsDate)??1,v=Qt((t==null?void 0:t.in)||i,0);v.setFullYear(h+1,0,c),v.setHours(0,0,0,0);const m=bi(v,t),b=Qt((t==null?void 0:t.in)||i,0);b.setFullYear(h,0,c),b.setHours(0,0,0,0);const y=bi(b,t);return+r>=+m?h+1:+r>=+y?h:h-1}function uo(i,t){var e,s,a,n;const r=Ji(),h=(t==null?void 0:t.firstWeekContainsDate)??((s=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:s.firstWeekContainsDate)??r.firstWeekContainsDate??((n=(a=r.locale)==null?void 0:a.options)==null?void 0:n.firstWeekContainsDate)??1,d=xa(i,t),c=Qt((t==null?void 0:t.in)||i,0);return c.setFullYear(d,0,h),c.setHours(0,0,0,0),bi(c,t)}function Sa(i,t){const e=At(i,t==null?void 0:t.in),s=+bi(e,t)-+uo(e,t);return Math.round(s/ya)+1}function z(i,t){const e=i<0?"-":"",s=Math.abs(i).toString().padStart(t,"0");return e+s}const ge={y(i,t){const e=i.getFullYear(),s=e>0?e:1-e;return z(t==="yy"?s%100:s,t.length)},M(i,t){const e=i.getMonth();return t==="M"?String(e+1):z(e+1,2)},d(i,t){return z(i.getDate(),t.length)},a(i,t){const e=i.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(i,t){return z(i.getHours()%12||12,t.length)},H(i,t){return z(i.getHours(),t.length)},m(i,t){return z(i.getMinutes(),t.length)},s(i,t){return z(i.getSeconds(),t.length)},S(i,t){const e=t.length,s=i.getMilliseconds(),a=Math.trunc(s*Math.pow(10,e-3));return z(a,t.length)}},Ye={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ca={G:function(i,t,e){const s=i.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(s,{width:"abbreviated"});case"GGGGG":return e.era(s,{width:"narrow"});case"GGGG":default:return e.era(s,{width:"wide"})}},y:function(i,t,e){if(t==="yo"){const s=i.getFullYear(),a=s>0?s:1-s;return e.ordinalNumber(a,{unit:"year"})}return ge.y(i,t)},Y:function(i,t,e,s){const a=xa(i,s),n=a>0?a:1-a;if(t==="YY"){const r=n%100;return z(r,2)}return t==="Yo"?e.ordinalNumber(n,{unit:"year"}):z(n,t.length)},R:function(i,t){const e=ka(i);return z(e,t.length)},u:function(i,t){const e=i.getFullYear();return z(e,t.length)},Q:function(i,t,e){const s=Math.ceil((i.getMonth()+1)/3);switch(t){case"Q":return String(s);case"QQ":return z(s,2);case"Qo":return e.ordinalNumber(s,{unit:"quarter"});case"QQQ":return e.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(s,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(s,{width:"wide",context:"formatting"})}},q:function(i,t,e){const s=Math.ceil((i.getMonth()+1)/3);switch(t){case"q":return String(s);case"qq":return z(s,2);case"qo":return e.ordinalNumber(s,{unit:"quarter"});case"qqq":return e.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(s,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(s,{width:"wide",context:"standalone"})}},M:function(i,t,e){const s=i.getMonth();switch(t){case"M":case"MM":return ge.M(i,t);case"Mo":return e.ordinalNumber(s+1,{unit:"month"});case"MMM":return e.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(s,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(s,{width:"wide",context:"formatting"})}},L:function(i,t,e){const s=i.getMonth();switch(t){case"L":return String(s+1);case"LL":return z(s+1,2);case"Lo":return e.ordinalNumber(s+1,{unit:"month"});case"LLL":return e.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(s,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(s,{width:"wide",context:"standalone"})}},w:function(i,t,e,s){const a=Sa(i,s);return t==="wo"?e.ordinalNumber(a,{unit:"week"}):z(a,t.length)},I:function(i,t,e){const s=co(i);return t==="Io"?e.ordinalNumber(s,{unit:"week"}):z(s,t.length)},d:function(i,t,e){return t==="do"?e.ordinalNumber(i.getDate(),{unit:"date"}):ge.d(i,t)},D:function(i,t,e){const s=po(i);return t==="Do"?e.ordinalNumber(s,{unit:"dayOfYear"}):z(s,t.length)},E:function(i,t,e){const s=i.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(s,{width:"short",context:"formatting"});case"EEEE":default:return e.day(s,{width:"wide",context:"formatting"})}},e:function(i,t,e,s){const a=i.getDay(),n=(a-s.weekStartsOn+8)%7||7;switch(t){case"e":return String(n);case"ee":return z(n,2);case"eo":return e.ordinalNumber(n,{unit:"day"});case"eee":return e.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(a,{width:"short",context:"formatting"});case"eeee":default:return e.day(a,{width:"wide",context:"formatting"})}},c:function(i,t,e,s){const a=i.getDay(),n=(a-s.weekStartsOn+8)%7||7;switch(t){case"c":return String(n);case"cc":return z(n,t.length);case"co":return e.ordinalNumber(n,{unit:"day"});case"ccc":return e.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(a,{width:"narrow",context:"standalone"});case"cccccc":return e.day(a,{width:"short",context:"standalone"});case"cccc":default:return e.day(a,{width:"wide",context:"standalone"})}},i:function(i,t,e){const s=i.getDay(),a=s===0?7:s;switch(t){case"i":return String(a);case"ii":return z(a,t.length);case"io":return e.ordinalNumber(a,{unit:"day"});case"iii":return e.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(s,{width:"short",context:"formatting"});case"iiii":default:return e.day(s,{width:"wide",context:"formatting"})}},a:function(i,t,e){const s=i.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(i,t,e){const s=i.getHours();let a;switch(s===12?a=Ye.noon:s===0?a=Ye.midnight:a=s/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(i,t,e){const s=i.getHours();let a;switch(s>=17?a=Ye.evening:s>=12?a=Ye.afternoon:s>=4?a=Ye.morning:a=Ye.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(i,t,e){if(t==="ho"){let s=i.getHours()%12;return s===0&&(s=12),e.ordinalNumber(s,{unit:"hour"})}return ge.h(i,t)},H:function(i,t,e){return t==="Ho"?e.ordinalNumber(i.getHours(),{unit:"hour"}):ge.H(i,t)},K:function(i,t,e){const s=i.getHours()%12;return t==="Ko"?e.ordinalNumber(s,{unit:"hour"}):z(s,t.length)},k:function(i,t,e){let s=i.getHours();return s===0&&(s=24),t==="ko"?e.ordinalNumber(s,{unit:"hour"}):z(s,t.length)},m:function(i,t,e){return t==="mo"?e.ordinalNumber(i.getMinutes(),{unit:"minute"}):ge.m(i,t)},s:function(i,t,e){return t==="so"?e.ordinalNumber(i.getSeconds(),{unit:"second"}):ge.s(i,t)},S:function(i,t){return ge.S(i,t)},X:function(i,t,e){const s=i.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return Aa(s);case"XXXX":case"XX":return Ee(s);case"XXXXX":case"XXX":default:return Ee(s,":")}},x:function(i,t,e){const s=i.getTimezoneOffset();switch(t){case"x":return Aa(s);case"xxxx":case"xx":return Ee(s);case"xxxxx":case"xxx":default:return Ee(s,":")}},O:function(i,t,e){const s=i.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ta(s,":");case"OOOO":default:return"GMT"+Ee(s,":")}},z:function(i,t,e){const s=i.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ta(s,":");case"zzzz":default:return"GMT"+Ee(s,":")}},t:function(i,t,e){const s=Math.trunc(+i/1e3);return z(s,t.length)},T:function(i,t,e){return z(+i,t.length)}};function Ta(i,t=""){const e=i>0?"-":"+",s=Math.abs(i),a=Math.trunc(s/60),n=s%60;return n===0?e+String(a):e+String(a)+t+z(n,2)}function Aa(i,t){return i%60===0?(i>0?"-":"+")+z(Math.abs(i)/60,2):Ee(i,t)}function Ee(i,t=""){const e=i>0?"-":"+",s=Math.abs(i),a=z(Math.trunc(s/60),2),n=z(s%60,2);return e+a+t+n}const Na=(i,t)=>{switch(i){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"})}},Ea=(i,t)=>{switch(i){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"})}},fo=(i,t)=>{const e=i.match(/(P+)(p+)?/)||[],s=e[1],a=e[2];if(!a)return Na(i,t);let n;switch(s){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;case"PPPP":default:n=t.dateTime({width:"full"});break}return n.replace("{{date}}",Na(s,t)).replace("{{time}}",Ea(a,t))},go={p:Ea,P:fo},mo=/^D+$/,vo=/^Y+$/,yo=["D","DD","YY","YYYY"];function bo(i){return mo.test(i)}function ko(i){return vo.test(i)}function $o(i,t,e){const s=_o(i,t,e);if(console.warn(s),yo.includes(i))throw new RangeError(s)}function _o(i,t,e){const s=i[0]==="Y"?"years":"days of the month";return`Use \`${i.toLowerCase()}\` instead of \`${i}\` (in \`${t}\`) for formatting ${s} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const wo=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,xo=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,So=/^'([^]*?)'?$/,Co=/''/g,To=/[a-zA-Z]/;function Ao(i,t,e){var s,a,n,r;const h=Ji(),d=h.locale??ho,c=h.firstWeekContainsDate??((a=(s=h.locale)==null?void 0:s.options)==null?void 0:a.firstWeekContainsDate)??1,v=h.weekStartsOn??((r=(n=h.locale)==null?void 0:n.options)==null?void 0:r.weekStartsOn)??0,m=At(i,void 0);if(!Ar(m))throw new RangeError("Invalid time value");let b=t.match(xo).map(_=>{const x=_[0];if(x==="p"||x==="P"){const M=go[x];return M(_,d.formatLong)}return _}).join("").match(wo).map(_=>{if(_==="''")return{isToken:!1,value:"'"};const x=_[0];if(x==="'")return{isToken:!1,value:No(_)};if(Ca[x])return{isToken:!0,value:_};if(x.match(To))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:_}});d.localize.preprocessor&&(b=d.localize.preprocessor(m,b));const y={firstWeekContainsDate:c,weekStartsOn:v,locale:d};return b.map(_=>{if(!_.isToken)return _.value;const x=_.value;(ko(x)||bo(x))&&$o(x,t,String(i));const M=Ca[x[0]];return M(m,x,d.localize,y)}).join("")}function No(i){const t=i.match(So);return t?t[1].replace(Co,"'"):i}function Eo(i,t){const e=At(i,void 0).getDay();return e===0?7:e}function Oo(i,t,e="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:i,timeZoneName:e}).format(t).split(/\s/g).slice(2).join(" ")}const Oa={},_i={};function Oe(i,t){try{const e=(Oa[i]||(Oa[i]=new Intl.DateTimeFormat("en-US",{timeZone:i,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return e in _i?_i[e]:Ma(e,e.split(":"))}catch{if(i in _i)return _i[i];const e=i==null?void 0:i.match(Mo);return e?Ma(i,e.slice(1)):NaN}}const Mo=/([+-]\d\d):?(\d\d)?/;function Ma(i,t){const e=+(t[0]||0),s=+(t[1]||0),a=+(t[2]||0)/60;return _i[i]=e*60+s>0?e*60+s+a:e*60-s-a}let wi=class Bi extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Oe(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)),Da(this),xs(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new Bi(...e,t):new Bi(Date.now(),t)}withTimeZone(t){return new Bi(+this,t)}getTimezoneOffset(){const t=-Oe(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),xs(this),+this}[Symbol.for("constructDateFrom")](t){return new Bi(+new Date(t),this.timeZone)}};const Pa=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(i=>{if(!Pa.test(i))return;const t=i.replace(Pa,"$1UTC");wi.prototype[t]&&(i.startsWith("get")?wi.prototype[i]=function(){return this.internal[t]()}:(wi.prototype[i]=function(){return Date.prototype[t].apply(this.internal,arguments),Po(this),+this},wi.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),xs(this),+this}))});function xs(i){i.internal.setTime(+i),i.internal.setUTCSeconds(i.internal.getUTCSeconds()-Math.round(-Oe(i.timeZone,i)*60))}function Po(i){Date.prototype.setFullYear.call(i,i.internal.getUTCFullYear(),i.internal.getUTCMonth(),i.internal.getUTCDate()),Date.prototype.setHours.call(i,i.internal.getUTCHours(),i.internal.getUTCMinutes(),i.internal.getUTCSeconds(),i.internal.getUTCMilliseconds()),Da(i)}function Da(i){const t=Oe(i.timeZone,i),e=t>0?Math.floor(t):Math.ceil(t),s=new Date(+i);s.setUTCHours(s.getUTCHours()-1);const a=-new Date(+i).getTimezoneOffset(),n=-new Date(+s).getTimezoneOffset(),r=a-n,h=Date.prototype.getHours.apply(i)!==i.internal.getUTCHours();r&&h&&i.internal.setUTCMinutes(i.internal.getUTCMinutes()+r);const d=a-e;d&&Date.prototype.setUTCMinutes.call(i,Date.prototype.getUTCMinutes.call(i)+d);const c=new Date(+i);c.setUTCSeconds(0);const v=a>0?c.getSeconds():(c.getSeconds()-60)%60,m=Math.round(-(Oe(i.timeZone,i)*60))%60;(m||v)&&(i.internal.setUTCSeconds(i.internal.getUTCSeconds()+m),Date.prototype.setUTCSeconds.call(i,Date.prototype.getUTCSeconds.call(i)+m+v));const b=Oe(i.timeZone,i),y=b>0?Math.floor(b):Math.ceil(b),_=-new Date(+i).getTimezoneOffset()-y,x=y!==e,M=_-d;if(x&&M){Date.prototype.setUTCMinutes.call(i,Date.prototype.getUTCMinutes.call(i)+M);const R=Oe(i.timeZone,i),S=R>0?Math.floor(R):Math.ceil(R),V=y-S;V&&(i.internal.setUTCMinutes(i.internal.getUTCMinutes()+V),Date.prototype.setUTCMinutes.call(i,Date.prototype.getUTCMinutes.call(i)+V))}}let Ss=class Fi extends wi{static tz(t,...e){return e.length?new Fi(...e,t):new Fi(Date.now(),t)}toISOString(){const[t,e,s]=this.tzComponents(),a=`${t}${e}:${s}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,e,s,a]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${s} ${e} ${a}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[e,s,a]=this.tzComponents();return`${t} GMT${e}${s}${a} (${Oo(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?"-":"+",s=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),a=String(Math.abs(t)%60).padStart(2,"0");return[e,s,a]}withTimeZone(t){return new Fi(+this,t)}[Symbol.for("constructDateFrom")](t){return new Fi(+new Date(t),this.timeZone)}};window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const Do=(i=window.pktTz)=>{const t=new Ss(new Date().toISOString(),i);return t.setHours(0,0,0,0),isNaN(t.getTime())?new Date:new Date(t.getFullYear(),t.getMonth(),t.getDate())};function me(i){if(!i||i==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(i)){const[t,e,s]=i.split("-").map(Number);return new Date(t,e-1,s)}if(/^\d{4}-\d{2}$/.test(i)){const[t,e]=i.split("-").map(Number);return new Date(t,e-1,1)}return/^\d{4}$/.test(i)?new Date(Number(i),0,1):new Date(i)}const at=i=>{if(!i||isNaN(i.getTime()))return"";const t=i.getFullYear(),e=String(i.getMonth()+1).padStart(2,"0"),s=String(i.getDate()).padStart(2,"0");return`${t}-${e}-${s}`},ve=i=>{if(!i)return null;const t=me(i);return isNaN(t.getTime())?null:t},Ia=(i,t)=>{const e=re(i);return isNaN(e.getTime())?"":Ao(e,t)},re=(i="",t)=>{const e=typeof i=="string"?me(i):i;return!e||isNaN(e.getTime())?new Date:e},ye=(i,t,e=1)=>{if(typeof i!="number"||typeof t!="number"||typeof e!="number"||isNaN(i)||isNaN(t)||isNaN(e))return new Date;const s=new Date(i,t,e);return isNaN(s.getTime())?new Date:s},xi=i=>{let t;return typeof i=="number"?t=new Ss(i,window.pktTz):t=new Ss(i,window.pktTz),t.setHours(12,0,0,0),t},Io=i=>!i||isNaN(i.getTime())?"":new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(i),Lo=(i,t,e)=>{if(!i||isNaN(i.getTime()))return!1;const s=t?re(t):null,a=e?re(e):null;return!(s&&i<s||a&&i>a)},Bo=(i,t)=>{if(!i||isNaN(i.getTime())||!Array.isArray(t))return!1;const e=at(i);return t.includes(e)},Fo=(i,t)=>{if(!i||isNaN(i.getTime())||!Array.isArray(t))return!1;const e=i.getDay().toString();return t.includes(e)},La=(i,t,e,s,a)=>!(!i||isNaN(i.getTime())||!Lo(i,t,e)||s&&Bo(i,s)||a&&Fo(i,a)),Vo=(i,t,e,s,a)=>i.filter(n=>{const r=ve(n);return r&&La(r,t,e,s,a)}),jo=i=>i.slice().sort((t,e)=>{const s=ve(t),a=ve(e);return!s||!a?0:s.getTime()-a.getTime()}),Ho=(i,t)=>{const e=ve(i),s=ve(t);return!e||!s?!1:e<=s},Ba=i=>{if(Array.isArray(i))return i;if(typeof i=="string")return i.split(",")},Uo=i=>i?me(i):null,qo=i=>{if(typeof i=="string")return i.split(",").map(t=>me(t));if(Array.isArray(i))return i.map(t=>me(t))},Ze={csvToArray:Ba,stringToDate:Uo,stringsToDate:qo},zo={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},Me={props:zo};var Wo=Object.defineProperty,Ro=Object.getOwnPropertyDescriptor,K=(i,t,e,s)=>{for(var a=s>1?void 0:s?Ro(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&Wo(t,e,a),a};let W=class extends Y{constructor(){super(...arguments),this.multiple=Me.props.multiple.default,this.maxMultiple=Me.props.maxMultiple.default,this.range=Me.props.range.default,this.weeknumbers=Me.props.weeknumbers.default,this.withcontrols=Me.props.withcontrols.default,this.selected=[],this.earliest=Me.props.earliest.default,this.latest=Me.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.year=0,this.month=0,this.week=0,this.rangeHovered=null,this.inRange={},this.focusedDate=null,this.selectableDates=[],this.currentmonthtouched=!1,this.tabIndexSet=0}connectedCallback(){super.connectedCallback()}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}attributeChangedCallback(t,e,s){t==="selected"&&s&&this.convertSelected(),super.attributeChangedCallback(t,e,s)}updated(t){super.updated(t),t.has("selected")&&this.convertSelected()}firstUpdated(t){this.addEventListener("keydown",this.handleKeydown)}convertSelected(){if(typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=this.selected.map(t=>me(t)),this.range&&this.selected.length===2){const t=_s({start:this._selected[0],end:this._selected[1]});if(this.inRange={},Array.isArray(t)&&t.length){const e={};for(let s=0;s<t.length;s++){const a=t[s],n=a>this._selected[0]&&a<this._selected[1];e[at(a)]=n}this.inRange=e}}this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==""){const t=me(this.selected[this.selected.length-1]);this.currentmonth=isNaN(t.getTime())?xi(new Date):t}else this.currentmonth===null&&(this.currentmonth=xi(new Date));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=xi(new Date)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(t){switch(t.key){case"ArrowLeft":this.handleArrowKey(t,-1);break;case"ArrowRight":this.handleArrowKey(t,1);break;case"ArrowUp":this.handleArrowKey(t,-7);break;case"ArrowDown":this.handleArrowKey(t,7);break}}handleArrowKey(t,e){var s,a,n,r,h;if(((s=t.target)==null?void 0:s.nodeName)==="INPUT"||((a=t.target)==null?void 0:a.nodeName)==="SELECT"||((n=t.target)==null?void 0:n.nodeName)==="BUTTON"&&!((h=(r=t.target)==null?void 0:r.dataset)!=null&&h.date))return;t.preventDefault(),this.focusedDate||this.focusOnCurrentDate();const d=this.focusedDate?re(this.focusedDate):ye(this.year,this.month,1);let c=$s(d,e);if(c){let v=this.querySelector(`button[data-date="${at(c)}"]`);if(v instanceof HTMLButtonElement){if(v.dataset.disabled){c=$s(c,e);let m=this.querySelector(`button[data-date="${at(c)}"]`);for(;m&&m instanceof HTMLButtonElement&&m.dataset.disabled;)c=$s(c,e),m=this.querySelector(`button[data-date="${at(c)}"]`);v=m}v instanceof HTMLButtonElement&&!v.dataset.disabled&&(this.focusedDate=at(c),v.focus())}}}render(){return u`
|
|
197
|
+
</nav>`}};Xi([o({type:String})],Ge.prototype,"href",2),Xi([o({type:String})],Ge.prototype,"text",2),Xi([o({type:String})],Ge.prototype,"ariaLabel",2),Ge=Xi([j("pkt-backlink")],Ge);const ya=6048e5,Sr=864e5,ka=Symbol.for("constructDateFrom");function Qt(i,t){return typeof i=="function"?i(t):i&&typeof i=="object"&&ka in i?i[ka](t):i instanceof Date?new i.constructor(t):new Date(t)}function Nt(i,t){return Qt(t||i,i)}function ks(i,t,e){const s=Nt(i,void 0);return isNaN(t)?Qt(i,NaN):(t&&s.setDate(s.getDate()+t),s)}let Cr={};function Ji(){return Cr}function yi(i,t){var e,s,a,n;const r=Ji(),h=(t==null?void 0:t.weekStartsOn)??((s=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:s.weekStartsOn)??r.weekStartsOn??((n=(a=r.locale)==null?void 0:a.options)==null?void 0:n.weekStartsOn)??0,d=Nt(i,t==null?void 0:t.in),c=d.getDay(),v=(c<h?7:0)+c-h;return d.setDate(d.getDate()-v),d.setHours(0,0,0,0),d}function Qi(i,t){return yi(i,{...t,weekStartsOn:1})}function $a(i,t){const e=Nt(i,void 0),s=e.getFullYear(),a=Qt(e,0);a.setFullYear(s+1,0,4),a.setHours(0,0,0,0);const n=Qi(a),r=Qt(e,0);r.setFullYear(s,0,4),r.setHours(0,0,0,0);const h=Qi(r);return e.getTime()>=n.getTime()?s+1:e.getTime()>=h.getTime()?s:s-1}function _a(i){const t=Nt(i),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+i-+e}function wa(i,...t){const e=Qt.bind(null,t.find(s=>typeof s=="object"));return t.map(e)}function xa(i,t){const e=Nt(i,void 0);return e.setHours(0,0,0,0),e}function Tr(i,t,e){const[s,a]=wa(void 0,i,t),n=xa(s),r=xa(a),h=+n-_a(n),d=+r-_a(r);return Math.round((h-d)/Sr)}function Nr(i,t){const e=$a(i),s=Qt(i,0);return s.setFullYear(e,0,4),s.setHours(0,0,0,0),Qi(s)}function Ar(i){return i instanceof Date||typeof i=="object"&&Object.prototype.toString.call(i)==="[object Date]"}function Er(i){return!(!Ar(i)&&typeof i!="number"||isNaN(+Nt(i)))}function Pr(i,t){const[e,s]=wa(i,t.start,t.end);return{start:e,end:s}}function $s(i,t){const{start:e,end:s}=Pr(void 0,i);let a=+e>+s;const n=a?+e:+s,r=a?s:e;r.setHours(0,0,0,0);let h=1;const d=[];for(;+r<=n;)d.push(Qt(e,r)),r.setDate(r.getDate()+h),r.setHours(0,0,0,0);return a?d.reverse():d}function Or(i,t){const e=Nt(i,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const Mr={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"}},Dr=(i,t,e)=>{let s;const a=Mr[i];return typeof a=="string"?s=a:t===1?s=a.one:s=a.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+s:s+" ago":s};function _s(i){return(t={})=>{const e=t.width?String(t.width):i.defaultWidth;return i.formats[e]||i.formats[i.defaultWidth]}}const Ir={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Lr={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Br={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Fr={date:_s({formats:Ir,defaultWidth:"full"}),time:_s({formats:Lr,defaultWidth:"full"}),dateTime:_s({formats:Br,defaultWidth:"full"})},Vr={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Hr=(i,t,e,s)=>Vr[i];function ki(i){return(t,e)=>{const s=e!=null&&e.context?String(e.context):"standalone";let a;if(s==="formatting"&&i.formattingValues){const r=i.defaultFormattingWidth||i.defaultWidth,h=e!=null&&e.width?String(e.width):r;a=i.formattingValues[h]||i.formattingValues[r]}else{const r=i.defaultWidth,h=e!=null&&e.width?String(e.width):i.defaultWidth;a=i.values[h]||i.values[r]}const n=i.argumentCallback?i.argumentCallback(t):t;return a[n]}}const jr={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ur={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},qr={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"]},zr={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"]},Wr={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"}},Rr={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"}},Kr=(i,t)=>{const e=Number(i),s=e%100;if(s>20||s<10)switch(s%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},Gr={ordinalNumber:Kr,era:ki({values:jr,defaultWidth:"wide"}),quarter:ki({values:Ur,defaultWidth:"wide",argumentCallback:i=>i-1}),month:ki({values:qr,defaultWidth:"wide"}),day:ki({values:zr,defaultWidth:"wide"}),dayPeriod:ki({values:Wr,defaultWidth:"wide",formattingValues:Rr,defaultFormattingWidth:"wide"})};function $i(i){return(t,e={})=>{const s=e.width,a=s&&i.matchPatterns[s]||i.matchPatterns[i.defaultMatchWidth],n=t.match(a);if(!n)return null;const r=n[0],h=s&&i.parsePatterns[s]||i.parsePatterns[i.defaultParseWidth],d=Array.isArray(h)?Zr(h,g=>g.test(r)):Yr(h,g=>g.test(r));let c;c=i.valueCallback?i.valueCallback(d):d,c=e.valueCallback?e.valueCallback(c):c;const v=t.slice(r.length);return{value:c,rest:v}}}function Yr(i,t){for(const e in i)if(Object.prototype.hasOwnProperty.call(i,e)&&t(i[e]))return e}function Zr(i,t){for(let e=0;e<i.length;e++)if(t(i[e]))return e}function Xr(i){return(t,e={})=>{const s=t.match(i.matchPattern);if(!s)return null;const a=s[0],n=t.match(i.parsePattern);if(!n)return null;let r=i.valueCallback?i.valueCallback(n[0]):n[0];r=e.valueCallback?e.valueCallback(r):r;const h=t.slice(a.length);return{value:r,rest:h}}}const Jr=/^(\d+)(th|st|nd|rd)?/i,Qr=/\d+/i,to={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},eo={any:[/^b/i,/^(a|c)/i]},io={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},so={any:[/1/i,/2/i,/3/i,/4/i]},ao={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},no={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},oo={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]},lo={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},ho={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}},po={ordinalNumber:Xr({matchPattern:Jr,parsePattern:Qr,valueCallback:i=>parseInt(i,10)}),era:$i({matchPatterns:to,defaultMatchWidth:"wide",parsePatterns:eo,defaultParseWidth:"any"}),quarter:$i({matchPatterns:io,defaultMatchWidth:"wide",parsePatterns:so,defaultParseWidth:"any",valueCallback:i=>i+1}),month:$i({matchPatterns:ao,defaultMatchWidth:"wide",parsePatterns:no,defaultParseWidth:"any"}),day:$i({matchPatterns:ro,defaultMatchWidth:"wide",parsePatterns:oo,defaultParseWidth:"any"}),dayPeriod:$i({matchPatterns:lo,defaultMatchWidth:"any",parsePatterns:ho,defaultParseWidth:"any"})},co={code:"en-US",formatDistance:Dr,formatLong:Fr,formatRelative:Hr,localize:Gr,match:po,options:{weekStartsOn:0,firstWeekContainsDate:1}};function uo(i,t){const e=Nt(i,void 0);return Tr(e,Or(e))+1}function fo(i,t){const e=Nt(i,void 0),s=+Qi(e)-+Nr(e);return Math.round(s/ya)+1}function Sa(i,t){var e,s,a,n;const r=Nt(i,t==null?void 0:t.in),h=r.getFullYear(),d=Ji(),c=(t==null?void 0:t.firstWeekContainsDate)??((s=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:s.firstWeekContainsDate)??d.firstWeekContainsDate??((n=(a=d.locale)==null?void 0:a.options)==null?void 0:n.firstWeekContainsDate)??1,v=Qt((t==null?void 0:t.in)||i,0);v.setFullYear(h+1,0,c),v.setHours(0,0,0,0);const g=yi(v,t),k=Qt((t==null?void 0:t.in)||i,0);k.setFullYear(h,0,c),k.setHours(0,0,0,0);const b=yi(k,t);return+r>=+g?h+1:+r>=+b?h:h-1}function go(i,t){var e,s,a,n;const r=Ji(),h=(t==null?void 0:t.firstWeekContainsDate)??((s=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:s.firstWeekContainsDate)??r.firstWeekContainsDate??((n=(a=r.locale)==null?void 0:a.options)==null?void 0:n.firstWeekContainsDate)??1,d=Sa(i,t),c=Qt((t==null?void 0:t.in)||i,0);return c.setFullYear(d,0,h),c.setHours(0,0,0,0),yi(c,t)}function Ca(i,t){const e=Nt(i,t==null?void 0:t.in),s=+yi(e,t)-+go(e,t);return Math.round(s/ya)+1}function W(i,t){const e=i<0?"-":"",s=Math.abs(i).toString().padStart(t,"0");return e+s}const ge={y(i,t){const e=i.getFullYear(),s=e>0?e:1-e;return W(t==="yy"?s%100:s,t.length)},M(i,t){const e=i.getMonth();return t==="M"?String(e+1):W(e+1,2)},d(i,t){return W(i.getDate(),t.length)},a(i,t){const e=i.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(i,t){return W(i.getHours()%12||12,t.length)},H(i,t){return W(i.getHours(),t.length)},m(i,t){return W(i.getMinutes(),t.length)},s(i,t){return W(i.getSeconds(),t.length)},S(i,t){const e=t.length,s=i.getMilliseconds(),a=Math.trunc(s*Math.pow(10,e-3));return W(a,t.length)}},Ye={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ta={G:function(i,t,e){const s=i.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(s,{width:"abbreviated"});case"GGGGG":return e.era(s,{width:"narrow"});case"GGGG":default:return e.era(s,{width:"wide"})}},y:function(i,t,e){if(t==="yo"){const s=i.getFullYear(),a=s>0?s:1-s;return e.ordinalNumber(a,{unit:"year"})}return ge.y(i,t)},Y:function(i,t,e,s){const a=Sa(i,s),n=a>0?a:1-a;if(t==="YY"){const r=n%100;return W(r,2)}return t==="Yo"?e.ordinalNumber(n,{unit:"year"}):W(n,t.length)},R:function(i,t){const e=$a(i);return W(e,t.length)},u:function(i,t){const e=i.getFullYear();return W(e,t.length)},Q:function(i,t,e){const s=Math.ceil((i.getMonth()+1)/3);switch(t){case"Q":return String(s);case"QQ":return W(s,2);case"Qo":return e.ordinalNumber(s,{unit:"quarter"});case"QQQ":return e.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(s,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(s,{width:"wide",context:"formatting"})}},q:function(i,t,e){const s=Math.ceil((i.getMonth()+1)/3);switch(t){case"q":return String(s);case"qq":return W(s,2);case"qo":return e.ordinalNumber(s,{unit:"quarter"});case"qqq":return e.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(s,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(s,{width:"wide",context:"standalone"})}},M:function(i,t,e){const s=i.getMonth();switch(t){case"M":case"MM":return ge.M(i,t);case"Mo":return e.ordinalNumber(s+1,{unit:"month"});case"MMM":return e.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(s,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(s,{width:"wide",context:"formatting"})}},L:function(i,t,e){const s=i.getMonth();switch(t){case"L":return String(s+1);case"LL":return W(s+1,2);case"Lo":return e.ordinalNumber(s+1,{unit:"month"});case"LLL":return e.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(s,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(s,{width:"wide",context:"standalone"})}},w:function(i,t,e,s){const a=Ca(i,s);return t==="wo"?e.ordinalNumber(a,{unit:"week"}):W(a,t.length)},I:function(i,t,e){const s=fo(i);return t==="Io"?e.ordinalNumber(s,{unit:"week"}):W(s,t.length)},d:function(i,t,e){return t==="do"?e.ordinalNumber(i.getDate(),{unit:"date"}):ge.d(i,t)},D:function(i,t,e){const s=uo(i);return t==="Do"?e.ordinalNumber(s,{unit:"dayOfYear"}):W(s,t.length)},E:function(i,t,e){const s=i.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(s,{width:"short",context:"formatting"});case"EEEE":default:return e.day(s,{width:"wide",context:"formatting"})}},e:function(i,t,e,s){const a=i.getDay(),n=(a-s.weekStartsOn+8)%7||7;switch(t){case"e":return String(n);case"ee":return W(n,2);case"eo":return e.ordinalNumber(n,{unit:"day"});case"eee":return e.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(a,{width:"short",context:"formatting"});case"eeee":default:return e.day(a,{width:"wide",context:"formatting"})}},c:function(i,t,e,s){const a=i.getDay(),n=(a-s.weekStartsOn+8)%7||7;switch(t){case"c":return String(n);case"cc":return W(n,t.length);case"co":return e.ordinalNumber(n,{unit:"day"});case"ccc":return e.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(a,{width:"narrow",context:"standalone"});case"cccccc":return e.day(a,{width:"short",context:"standalone"});case"cccc":default:return e.day(a,{width:"wide",context:"standalone"})}},i:function(i,t,e){const s=i.getDay(),a=s===0?7:s;switch(t){case"i":return String(a);case"ii":return W(a,t.length);case"io":return e.ordinalNumber(a,{unit:"day"});case"iii":return e.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(s,{width:"short",context:"formatting"});case"iiii":default:return e.day(s,{width:"wide",context:"formatting"})}},a:function(i,t,e){const s=i.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(i,t,e){const s=i.getHours();let a;switch(s===12?a=Ye.noon:s===0?a=Ye.midnight:a=s/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(i,t,e){const s=i.getHours();let a;switch(s>=17?a=Ye.evening:s>=12?a=Ye.afternoon:s>=4?a=Ye.morning:a=Ye.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(i,t,e){if(t==="ho"){let s=i.getHours()%12;return s===0&&(s=12),e.ordinalNumber(s,{unit:"hour"})}return ge.h(i,t)},H:function(i,t,e){return t==="Ho"?e.ordinalNumber(i.getHours(),{unit:"hour"}):ge.H(i,t)},K:function(i,t,e){const s=i.getHours()%12;return t==="Ko"?e.ordinalNumber(s,{unit:"hour"}):W(s,t.length)},k:function(i,t,e){let s=i.getHours();return s===0&&(s=24),t==="ko"?e.ordinalNumber(s,{unit:"hour"}):W(s,t.length)},m:function(i,t,e){return t==="mo"?e.ordinalNumber(i.getMinutes(),{unit:"minute"}):ge.m(i,t)},s:function(i,t,e){return t==="so"?e.ordinalNumber(i.getSeconds(),{unit:"second"}):ge.s(i,t)},S:function(i,t){return ge.S(i,t)},X:function(i,t,e){const s=i.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return Aa(s);case"XXXX":case"XX":return Ee(s);case"XXXXX":case"XXX":default:return Ee(s,":")}},x:function(i,t,e){const s=i.getTimezoneOffset();switch(t){case"x":return Aa(s);case"xxxx":case"xx":return Ee(s);case"xxxxx":case"xxx":default:return Ee(s,":")}},O:function(i,t,e){const s=i.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Na(s,":");case"OOOO":default:return"GMT"+Ee(s,":")}},z:function(i,t,e){const s=i.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Na(s,":");case"zzzz":default:return"GMT"+Ee(s,":")}},t:function(i,t,e){const s=Math.trunc(+i/1e3);return W(s,t.length)},T:function(i,t,e){return W(+i,t.length)}};function Na(i,t=""){const e=i>0?"-":"+",s=Math.abs(i),a=Math.trunc(s/60),n=s%60;return n===0?e+String(a):e+String(a)+t+W(n,2)}function Aa(i,t){return i%60===0?(i>0?"-":"+")+W(Math.abs(i)/60,2):Ee(i,t)}function Ee(i,t=""){const e=i>0?"-":"+",s=Math.abs(i),a=W(Math.trunc(s/60),2),n=W(s%60,2);return e+a+t+n}const Ea=(i,t)=>{switch(i){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"})}},Pa=(i,t)=>{switch(i){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"})}},mo=(i,t)=>{const e=i.match(/(P+)(p+)?/)||[],s=e[1],a=e[2];if(!a)return Ea(i,t);let n;switch(s){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;case"PPPP":default:n=t.dateTime({width:"full"});break}return n.replace("{{date}}",Ea(s,t)).replace("{{time}}",Pa(a,t))},vo={p:Pa,P:mo},bo=/^D+$/,yo=/^Y+$/,ko=["D","DD","YY","YYYY"];function $o(i){return bo.test(i)}function _o(i){return yo.test(i)}function wo(i,t,e){const s=xo(i,t,e);if(console.warn(s),ko.includes(i))throw new RangeError(s)}function xo(i,t,e){const s=i[0]==="Y"?"years":"days of the month";return`Use \`${i.toLowerCase()}\` instead of \`${i}\` (in \`${t}\`) for formatting ${s} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const So=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Co=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,To=/^'([^]*?)'?$/,No=/''/g,Ao=/[a-zA-Z]/;function Eo(i,t,e){var s,a,n,r;const h=Ji(),d=h.locale??co,c=h.firstWeekContainsDate??((a=(s=h.locale)==null?void 0:s.options)==null?void 0:a.firstWeekContainsDate)??1,v=h.weekStartsOn??((r=(n=h.locale)==null?void 0:n.options)==null?void 0:r.weekStartsOn)??0,g=Nt(i,void 0);if(!Er(g))throw new RangeError("Invalid time value");let k=t.match(Co).map(y=>{const w=y[0];if(w==="p"||w==="P"){const S=vo[w];return S(y,d.formatLong)}return y}).join("").match(So).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const w=y[0];if(w==="'")return{isToken:!1,value:Po(y)};if(Ta[w])return{isToken:!0,value:y};if(w.match(Ao))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:y}});d.localize.preprocessor&&(k=d.localize.preprocessor(g,k));const b={firstWeekContainsDate:c,weekStartsOn:v,locale:d};return k.map(y=>{if(!y.isToken)return y.value;const w=y.value;(_o(w)||$o(w))&&wo(w,t,String(i));const S=Ta[w[0]];return S(g,w,d.localize,b)}).join("")}function Po(i){const t=i.match(To);return t?t[1].replace(No,"'"):i}function Oo(i,t){const e=Nt(i,void 0).getDay();return e===0?7:e}function Mo(i,t,e="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:i,timeZoneName:e}).format(t).split(/\s/g).slice(2).join(" ")}const Oa={},_i={};function Pe(i,t){try{const e=(Oa[i]||(Oa[i]=new Intl.DateTimeFormat("en-US",{timeZone:i,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return e in _i?_i[e]:Ma(e,e.split(":"))}catch{if(i in _i)return _i[i];const e=i==null?void 0:i.match(Do);return e?Ma(i,e.slice(1)):NaN}}const Do=/([+-]\d\d):?(\d\d)?/;function Ma(i,t){const e=+(t[0]||0),s=+(t[1]||0),a=+(t[2]||0)/60;return _i[i]=e*60+s>0?e*60+s+a:e*60-s-a}let wi=class Bi extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Pe(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)),Ia(this),ws(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new Bi(...e,t):new Bi(Date.now(),t)}withTimeZone(t){return new Bi(+this,t)}getTimezoneOffset(){const t=-Pe(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),ws(this),+this}[Symbol.for("constructDateFrom")](t){return new Bi(+new Date(t),this.timeZone)}};const Da=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(i=>{if(!Da.test(i))return;const t=i.replace(Da,"$1UTC");wi.prototype[t]&&(i.startsWith("get")?wi.prototype[i]=function(){return this.internal[t]()}:(wi.prototype[i]=function(){return Date.prototype[t].apply(this.internal,arguments),Io(this),+this},wi.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),ws(this),+this}))});function ws(i){i.internal.setTime(+i),i.internal.setUTCSeconds(i.internal.getUTCSeconds()-Math.round(-Pe(i.timeZone,i)*60))}function Io(i){Date.prototype.setFullYear.call(i,i.internal.getUTCFullYear(),i.internal.getUTCMonth(),i.internal.getUTCDate()),Date.prototype.setHours.call(i,i.internal.getUTCHours(),i.internal.getUTCMinutes(),i.internal.getUTCSeconds(),i.internal.getUTCMilliseconds()),Ia(i)}function Ia(i){const t=Pe(i.timeZone,i),e=t>0?Math.floor(t):Math.ceil(t),s=new Date(+i);s.setUTCHours(s.getUTCHours()-1);const a=-new Date(+i).getTimezoneOffset(),n=-new Date(+s).getTimezoneOffset(),r=a-n,h=Date.prototype.getHours.apply(i)!==i.internal.getUTCHours();r&&h&&i.internal.setUTCMinutes(i.internal.getUTCMinutes()+r);const d=a-e;d&&Date.prototype.setUTCMinutes.call(i,Date.prototype.getUTCMinutes.call(i)+d);const c=new Date(+i);c.setUTCSeconds(0);const v=a>0?c.getSeconds():(c.getSeconds()-60)%60,g=Math.round(-(Pe(i.timeZone,i)*60))%60;(g||v)&&(i.internal.setUTCSeconds(i.internal.getUTCSeconds()+g),Date.prototype.setUTCSeconds.call(i,Date.prototype.getUTCSeconds.call(i)+g+v));const k=Pe(i.timeZone,i),b=k>0?Math.floor(k):Math.ceil(k),y=-new Date(+i).getTimezoneOffset()-b,w=b!==e,S=y-d;if(w&&S){Date.prototype.setUTCMinutes.call(i,Date.prototype.getUTCMinutes.call(i)+S);const M=Pe(i.timeZone,i),C=M>0?Math.floor(M):Math.ceil(M),V=b-C;V&&(i.internal.setUTCMinutes(i.internal.getUTCMinutes()+V),Date.prototype.setUTCMinutes.call(i,Date.prototype.getUTCMinutes.call(i)+V))}}let xs=class Fi extends wi{static tz(t,...e){return e.length?new Fi(...e,t):new Fi(Date.now(),t)}toISOString(){const[t,e,s]=this.tzComponents(),a=`${t}${e}:${s}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,e,s,a]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${s} ${e} ${a}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[e,s,a]=this.tzComponents();return`${t} GMT${e}${s}${a} (${Mo(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?"-":"+",s=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),a=String(Math.abs(t)%60).padStart(2,"0");return[e,s,a]}withTimeZone(t){return new Fi(+this,t)}[Symbol.for("constructDateFrom")](t){return new Fi(+new Date(t),this.timeZone)}};window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const Lo=(i=window.pktTz)=>{const t=new xs(new Date().toISOString(),i);return t.setHours(0,0,0,0),isNaN(t.getTime())?new Date:new Date(t.getFullYear(),t.getMonth(),t.getDate())};function me(i){if(!i||i==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(i)){const[t,e,s]=i.split("-").map(Number);return new Date(t,e-1,s)}if(/^\d{4}-\d{2}$/.test(i)){const[t,e]=i.split("-").map(Number);return new Date(t,e-1,1)}return/^\d{4}$/.test(i)?new Date(Number(i),0,1):new Date(i)}const at=i=>{if(!i||isNaN(i.getTime()))return"";const t=i.getFullYear(),e=String(i.getMonth()+1).padStart(2,"0"),s=String(i.getDate()).padStart(2,"0");return`${t}-${e}-${s}`},ve=i=>{if(!i)return null;const t=me(i);return isNaN(t.getTime())?null:t},La=(i,t)=>{const e=re(i);return isNaN(e.getTime())?"":Eo(e,t)},re=(i="",t)=>{const e=typeof i=="string"?me(i):i;return!e||isNaN(e.getTime())?new Date:e},be=(i,t,e=1)=>{if(typeof i!="number"||typeof t!="number"||typeof e!="number"||isNaN(i)||isNaN(t)||isNaN(e))return new Date;const s=new Date(i,t,e);return isNaN(s.getTime())?new Date:s},xi=i=>{let t;return typeof i=="number"?t=new xs(i,window.pktTz):t=new xs(i,window.pktTz),t.setHours(12,0,0,0),t},Bo=i=>!i||isNaN(i.getTime())?"":new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(i),Fo=(i,t,e)=>{if(!i||isNaN(i.getTime()))return!1;const s=t?re(t):null,a=e?re(e):null;return!(s&&i<s||a&&i>a)},Vo=(i,t)=>{if(!i||isNaN(i.getTime())||!Array.isArray(t))return!1;const e=at(i);return t.includes(e)},Ho=(i,t)=>{if(!i||isNaN(i.getTime())||!Array.isArray(t))return!1;const e=i.getDay().toString();return t.includes(e)},Ba=(i,t,e,s,a)=>!(!i||isNaN(i.getTime())||!Fo(i,t,e)||s&&Vo(i,s)||a&&Ho(i,a)),jo=(i,t,e,s,a)=>i.filter(n=>{const r=ve(n);return r&&Ba(r,t,e,s,a)}),Uo=i=>i.slice().sort((t,e)=>{const s=ve(t),a=ve(e);return!s||!a?0:s.getTime()-a.getTime()}),qo=(i,t)=>{const e=ve(i),s=ve(t);return!e||!s?!1:e<=s},Fa=i=>{if(Array.isArray(i))return i;if(typeof i=="string")return i.split(",")},zo=i=>i?me(i):null,Wo=i=>{if(typeof i=="string")return i.split(",").map(t=>me(t));if(Array.isArray(i))return i.map(t=>me(t))},Ze={csvToArray:Fa,stringToDate:zo,stringsToDate:Wo},Ro={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},Oe={props:Ro};var Ko=Object.defineProperty,Go=Object.getOwnPropertyDescriptor,K=(i,t,e,s)=>{for(var a=s>1?void 0:s?Go(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&Ko(t,e,a),a};let R=class extends Y{constructor(){super(...arguments),this.multiple=Oe.props.multiple.default,this.maxMultiple=Oe.props.maxMultiple.default,this.range=Oe.props.range.default,this.weeknumbers=Oe.props.weeknumbers.default,this.withcontrols=Oe.props.withcontrols.default,this.selected=[],this.earliest=Oe.props.earliest.default,this.latest=Oe.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.year=0,this.month=0,this.week=0,this.rangeHovered=null,this.inRange={},this.focusedDate=null,this.selectableDates=[],this.currentmonthtouched=!1,this.tabIndexSet=0}connectedCallback(){super.connectedCallback()}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}attributeChangedCallback(t,e,s){t==="selected"&&s&&this.convertSelected(),super.attributeChangedCallback(t,e,s)}updated(t){super.updated(t),t.has("selected")&&this.convertSelected()}firstUpdated(t){this.addEventListener("keydown",this.handleKeydown)}convertSelected(){if(typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=this.selected.map(t=>me(t)),this.range&&this.selected.length===2){const t=$s({start:this._selected[0],end:this._selected[1]});if(this.inRange={},Array.isArray(t)&&t.length){const e={};for(let s=0;s<t.length;s++){const a=t[s],n=a>this._selected[0]&&a<this._selected[1];e[at(a)]=n}this.inRange=e}}this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==""){const t=me(this.selected[this.selected.length-1]);this.currentmonth=isNaN(t.getTime())?xi(new Date):t}else this.currentmonth===null&&(this.currentmonth=xi(new Date));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=xi(new Date)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(t){switch(t.key){case"ArrowLeft":this.handleArrowKey(t,-1);break;case"ArrowRight":this.handleArrowKey(t,1);break;case"ArrowUp":this.handleArrowKey(t,-7);break;case"ArrowDown":this.handleArrowKey(t,7);break}}handleArrowKey(t,e){var s,a,n,r,h;if(((s=t.target)==null?void 0:s.nodeName)==="INPUT"||((a=t.target)==null?void 0:a.nodeName)==="SELECT"||((n=t.target)==null?void 0:n.nodeName)==="BUTTON"&&!((h=(r=t.target)==null?void 0:r.dataset)!=null&&h.date))return;t.preventDefault(),this.focusedDate||this.focusOnCurrentDate();const d=this.focusedDate?re(this.focusedDate):be(this.year,this.month,1);let c=ks(d,e);if(c){let v=this.querySelector(`button[data-date="${at(c)}"]`);if(v instanceof HTMLButtonElement){if(v.dataset.disabled){c=ks(c,e);let g=this.querySelector(`button[data-date="${at(c)}"]`);for(;g&&g instanceof HTMLButtonElement&&g.dataset.disabled;)c=ks(c,e),g=this.querySelector(`button[data-date="${at(c)}"]`);v=g}v instanceof HTMLButtonElement&&!v.dataset.disabled&&(this.focusedDate=at(c),v.focus())}}}render(){return u`
|
|
198
198
|
<div
|
|
199
199
|
class="pkt-calendar ${this.weeknumbers?"pkt-cal-weeknumbers":""}"
|
|
200
200
|
@focusout=${this.closeEvent}
|
|
@@ -208,7 +208,7 @@
|
|
|
208
208
|
@click=${()=>this.isPrevMonthAllowed()&&this.prevMonth()}
|
|
209
209
|
@keydown=${t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.isPrevMonthAllowed()&&this.prevMonth())}}
|
|
210
210
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only pkt-calendar__prev-month ${this.isPrevMonthAllowed()?"":"pkt-hide"}"
|
|
211
|
-
.data-disabled=${this.isPrevMonthAllowed()
|
|
211
|
+
.data-disabled=${this.isPrevMonthAllowed()?$:"disabled"}
|
|
212
212
|
?aria-disabled=${!this.isPrevMonthAllowed()}
|
|
213
213
|
tabindex=${this.isPrevMonthAllowed()?"0":"-1"}
|
|
214
214
|
>
|
|
@@ -224,7 +224,7 @@
|
|
|
224
224
|
@click=${()=>this.isNextMonthAllowed()&&this.nextMonth()}
|
|
225
225
|
@keydown=${t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.isNextMonthAllowed()&&this.nextMonth())}}
|
|
226
226
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only pkt-calendar__next-month ${this.isNextMonthAllowed()?"":"pkt-hide"}"
|
|
227
|
-
.data-disabled=${this.isNextMonthAllowed()
|
|
227
|
+
.data-disabled=${this.isNextMonthAllowed()?$:"disabled"}
|
|
228
228
|
?aria-disabled=${!this.isNextMonthAllowed()}
|
|
229
229
|
tabindex=${this.isNextMonthAllowed()?"0":"-1"}
|
|
230
230
|
>
|
|
@@ -275,46 +275,46 @@
|
|
|
275
275
|
/>
|
|
276
276
|
</div> `):t.push(u`<div class="pkt-txt-16-medium pkt-calendar__month-title" aria-live="polite">
|
|
277
277
|
${this.monthStrings[this.month]} ${this.year}
|
|
278
|
-
</div>`),t}renderDayView(t,e){var s;const a=
|
|
278
|
+
</div>`),t}renderDayView(t,e){var s;const a=be(this.year,this.month,t),n=at(a),r=n===at(e),h=this.selected.includes(n),d=Bo(a),c=this.isExcluded(a)||!h&&this.multiple&&this.maxMultiple>0&&this.selected.length>=this.maxMultiple,v=this.focusedDate?this.focusedDate===n&&!c?"0":"-1":!c&&this.tabIndexSet===0||this.tabIndexSet===t?"0":"-1";v==="0"&&(this.tabIndexSet=t),this.selectableDates.push({currentDateISO:n,isDisabled:c,tabindex:v});const g={"pkt-cal-today":r,"pkt-cal-selected":h,"pkt-cal-in-range":this.inRange[n],"pkt-cal-excluded":this.isExcluded(a),"pkt-cal-in-range-first":this.range&&(this.selected.length===2||this.rangeHovered!==null)&&n===this.selected[0],"pkt-cal-in-range-last":this.range&&this.selected.length===2&&n===this.selected[1],"pkt-cal-range-hover":this.rangeHovered!==null&&n===at(this.rangeHovered)},k={"pkt-calendar__date":!0,"pkt-calendar__date--today":r,"pkt-calendar__date--selected":h,"pkt-calendar__date--disabled":c,"pkt-calendar__date--in-range":this.inRange[n],"pkt-calendar__date--in-range-hover":this.rangeHovered!==null&&n===at(this.rangeHovered),"pkt-calendar__date--range-start":this.range&&(this.selected.length===2||this.rangeHovered!==null)&&n===this.selected[0],"pkt-calendar__date--range-end":this.range&&this.selected.length===2&&n===this.selected[1]};return u`<td class=${A(g)}>
|
|
279
279
|
<button
|
|
280
280
|
type="button"
|
|
281
281
|
aria-pressed=${h?"true":"false"}
|
|
282
282
|
?disabled=${c}
|
|
283
|
-
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${A(
|
|
283
|
+
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${A(k)}"
|
|
284
284
|
@mouseover=${()=>this.range&&!this.isExcluded(a)&&this.handleRangeHover(a)}
|
|
285
285
|
@focus=${()=>{this.range&&!this.isExcluded(a)&&this.handleRangeHover(a),this.focusedDate=n}}
|
|
286
286
|
aria-label="${d}"
|
|
287
|
-
tabindex=${(s=this.selectableDates.find(
|
|
288
|
-
data-disabled=${c?"disabled"
|
|
287
|
+
tabindex=${(s=this.selectableDates.find(b=>b.currentDateISO===n))==null?void 0:s.tabindex}
|
|
288
|
+
data-disabled=${c?"disabled":$}
|
|
289
289
|
data-date=${n}
|
|
290
|
-
@keydown=${
|
|
291
|
-
@click=${
|
|
290
|
+
@keydown=${b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),this.handleDateSelect(a))}}
|
|
291
|
+
@click=${b=>{c||(b.preventDefault(),this.handleDateSelect(a))}}
|
|
292
292
|
>
|
|
293
293
|
<span class="pkt-btn__text pkt-txt-14-light">${t}</span>
|
|
294
294
|
</button>
|
|
295
|
-
</td>`}renderCalendarBody(){const t=
|
|
295
|
+
</td>`}renderCalendarBody(){const t=Lo(),e=be(this.year,this.month,1),s=be(this.year,this.month+1,0),a=(e.getDay()+6)%7,n=s.getDate(),r=Math.ceil((n+a)/7),h=be(this.year,this.month,0).getDate();let d=1;this.week=Ca(be(this.year,this.month,1));const c=[];for(let v=0;v<r;v++){const g=[];this.weeknumbers&&g.push(u`<td class="pkt-cal-week">${this.week}</td>`),this.week++;for(let k=1;k<8;k++)if(v===0&&k<a+1){const b=h-(a-k);g.push(u`<td class="pkt-cal-other">
|
|
296
296
|
<div
|
|
297
297
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
|
|
298
298
|
data-disabled="disabled"
|
|
299
299
|
>
|
|
300
|
-
<span class="pkt-btn__text pkt-txt-14-light">${
|
|
300
|
+
<span class="pkt-btn__text pkt-txt-14-light">${b}</span>
|
|
301
301
|
</div>
|
|
302
|
-
</td>`)}else d>n?(
|
|
302
|
+
</td>`)}else d>n?(g.push(u`<td class="pkt-cal-other">
|
|
303
303
|
<div
|
|
304
304
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
|
|
305
305
|
data-disabled="disabled"
|
|
306
306
|
>
|
|
307
307
|
<span class="pkt-btn__text pkt-txt-14-light">${d-n}</span>
|
|
308
308
|
</div>
|
|
309
|
-
</td>`),d++):(
|
|
310
|
-
${
|
|
311
|
-
</tr>`)}return c}isExcluded(t){const e=this.excludedates.map(s=>typeof s=="string"?s:at(s));return!
|
|
309
|
+
</td>`),d++):(g.push(this.renderDayView(d,t)),d++);c.push(u`<tr class="pkt-cal-week-row" role="row">
|
|
310
|
+
${g}
|
|
311
|
+
</tr>`)}return c}isExcluded(t){const e=this.excludedates.map(s=>typeof s=="string"?s:at(s));return!Ba(t,this.earliest,this.latest,e,this.excludeweekdays)}isPrevMonthAllowed(){const t=be(this.year,this.month,0);return!(this.earliest&&re(this.earliest)>t)}prevMonth(){const t=this.month===0?11:this.month-1,e=this.month===0?this.year-1:this.year;this.changeMonth(e,t)}isNextMonthAllowed(){const t=be(this.month===11?this.year+1:this.year,this.month===11?0:this.month+1,1);return!(this.latest&&re(this.latest)<t)}nextMonth(){const t=this.month===11?0:this.month+1,e=this.month===11?this.year+1:this.year;this.changeMonth(e,t)}changeMonth(t,e){this.year=typeof t=="string"?parseInt(t):t,this.month=typeof e=="string"?parseInt(e):e,this.currentmonth=xi(new Date(this.year,this.month,1)),this.tabIndexSet=0,this.focusedDate=null,this.selectableDates=[]}isRangeAllowed(t){let e=!0;if(this._selected.length===1){const s=$s({start:this._selected[0],end:t});if(Array.isArray(s)&&s.length)for(let a=0;a<s.length;a++)this.excludedates.forEach(n=>{n>this._selected[0]&&n<t&&(e=!1)}),this.excludeweekdays.includes(Oo(s[a]).toString())&&(e=!1)}return e}emptySelected(){this.selected=[],this._selected=[],this.inRange={}}addToSelected(t){this.selected.includes(at(t))||(this.selected=[...this.selected,at(t)],this._selected=[...this._selected,t],this.range&&this.selected.length===2&&(this.convertSelected(),this.close()))}removeFromSelected(t){if(this.selected.length===1)this.emptySelected();else{const e=this.selected.indexOf(at(t)),s=[...this.selected],a=[...this._selected];s.splice(e,1),a.splice(e,1),this.selected=s,this._selected=a}}toggleSelected(t){const e=at(t);this.selected.includes(e)?this.removeFromSelected(t):this.maxMultiple&&this.selected.length>=this.maxMultiple||this.addToSelected(t)}handleRangeSelect(t){const e=at(t);return this.selected.includes(e)?this.selected.indexOf(e)===0?this.emptySelected():this.removeFromSelected(t):this.selected.length>1?(this.emptySelected(),this.addToSelected(t)):(this.selected.length===1&&!this.isRangeAllowed(t)&&this.emptySelected(),this.selected.length===1&&this._selected[0]>t&&this.emptySelected(),this.addToSelected(t)),Promise.resolve()}handleRangeHover(t){if(this.range&&this._selected.length===1&&this.isRangeAllowed(t)&&this._selected[0]<t){this.rangeHovered=t,this.inRange={};const e=$s({start:this._selected[0],end:t});if(Array.isArray(e)&&e.length)for(let s=0;s<e.length;s++){const a=e[s],n=a>this._selected[0]&&a<t;this.inRange[at(a)]=n}}else this.rangeHovered=null}handleDateSelect(t){if(t)return this.range?this.handleRangeSelect(t):this.multiple?this.toggleSelected(t):(this.selected.includes(at(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=at(xi(new Date)),e=this.querySelector(`button[data-date="${t}"]`);if(e instanceof HTMLButtonElement)this.focusedDate=t,e.focus();else{const s=this.selectableDates.find(a=>!a.isDisabled);if(s){const a=this.querySelector(`button[data-date="${s.currentDateISO}"]`);a instanceof HTMLButtonElement&&(this.focusedDate=s.currentDateISO,a.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}))}};K([o({type:Boolean})],R.prototype,"multiple",2),K([o({type:Number})],R.prototype,"maxMultiple",2),K([o({type:Boolean})],R.prototype,"range",2),K([o({type:Boolean})],R.prototype,"weeknumbers",2),K([o({type:Boolean})],R.prototype,"withcontrols",2),K([o({converter:Ze.csvToArray})],R.prototype,"selected",2),K([o({type:String})],R.prototype,"earliest",2),K([o({type:String})],R.prototype,"latest",2),K([o({converter:Ze.stringsToDate})],R.prototype,"excludedates",2),K([o({converter:Ze.csvToArray})],R.prototype,"excludeweekdays",2),K([o({converter:Ze.stringToDate})],R.prototype,"currentmonth",2),K([o({type:Array})],R.prototype,"dayStrings",2),K([o({type:Array})],R.prototype,"dayStringsLong",2),K([o({type:Array})],R.prototype,"monthStrings",2),K([o({type:String})],R.prototype,"weekString",2),K([o({type:String})],R.prototype,"prevMonthString",2),K([o({type:String})],R.prototype,"nextMonthString",2),K([o({type:Array})],R.prototype,"_selected",2),K([o({type:Number})],R.prototype,"year",2),K([o({type:Number})],R.prototype,"month",2),K([o({type:Number})],R.prototype,"week",2),K([o({type:Date})],R.prototype,"rangeHovered",2),K([U()],R.prototype,"inRange",2),K([U()],R.prototype,"focusedDate",2),K([U()],R.prototype,"selectableDates",2),K([U()],R.prototype,"currentmonthtouched",2),K([U()],R.prototype,"tabIndexSet",2),R=K([j("pkt-calendar")],R);const Yo={size:{default:"medium"},skin:{default:"blue"},closeTag:{default:!1},type:{default:"button"}},ts={props:Yo};var Zo=Object.defineProperty,Xo=Object.getOwnPropertyDescriptor,te=(i,t,e,s)=>{for(var a=s>1?void 0:s?Xo(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&Zo(t,e,a),a};let qt=class extends Y{constructor(){super(),this.defaultSlot=P(),this.closeTag=ts.props.closeTag.default,this.size=ts.props.size.default,this.skin=ts.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=ts.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:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:t},bubbles:!0,composed:!0}))},this.slotController=new pt(this,this.defaultSlot),this._isClosed=!1}firstUpdated(t){var e,s;if(super.firstUpdated(t),this.closeTag&&!this.ariaLabel){const a=(s=(e=this.defaultSlot.value)==null?void 0:e.textContent)==null?void 0:s.trim();a&&(this._ariaDescription=`Klikk for å fjerne ${a}`)}}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`
|
|
312
312
|
<button
|
|
313
313
|
class=${A(e)}
|
|
314
314
|
type=${this.type}
|
|
315
315
|
@click=${this.close}
|
|
316
|
-
aria-label=${
|
|
317
|
-
aria-description=${
|
|
316
|
+
aria-label=${T(this.ariaLabel||void 0)}
|
|
317
|
+
aria-description=${T(this._ariaDescription||void 0)}
|
|
318
318
|
>
|
|
319
319
|
${this.iconName&&u`<pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon>`}
|
|
320
320
|
<span ${O(this.defaultSlot)}></span>
|
|
@@ -325,17 +325,17 @@
|
|
|
325
325
|
${this.iconName&&u`<pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon>`}
|
|
326
326
|
<span ${O(this.defaultSlot)}></span>
|
|
327
327
|
</span>
|
|
328
|
-
`}};te([o({type:Boolean,reflect:!0})],qt.prototype,"closeTag",2),te([o({type:String,reflect:!0})],qt.prototype,"size",2),te([o({type:String,reflect:!0})],qt.prototype,"skin",2),te([o({type:String,reflect:!0})],qt.prototype,"textStyle",2),te([o({type:String,reflect:!0})],qt.prototype,"iconName",2),te([o({type:String})],qt.prototype,"type",2),te([o({type:String})],qt.prototype,"ariaLabel",2),te([U()],qt.prototype,"_isClosed",2),te([U()],qt.prototype,"_ariaDescription",2),qt=te([
|
|
328
|
+
`}};te([o({type:Boolean,reflect:!0})],qt.prototype,"closeTag",2),te([o({type:String,reflect:!0})],qt.prototype,"size",2),te([o({type:String,reflect:!0})],qt.prototype,"skin",2),te([o({type:String,reflect:!0})],qt.prototype,"textStyle",2),te([o({type:String,reflect:!0})],qt.prototype,"iconName",2),te([o({type:String})],qt.prototype,"type",2),te([o({type:String})],qt.prototype,"ariaLabel",2),te([U()],qt.prototype,"_isClosed",2),te([U()],qt.prototype,"_ariaDescription",2),qt=te([j("pkt-tag")],qt);var Jo=Object.defineProperty,Qo=Object.getOwnPropertyDescriptor,Si=(i,t,e,s)=>{for(var a=s>1?void 0:s?Qo(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&Jo(t,e,a),a};let Me=class extends Wi{constructor(){super(...arguments),this.size=void 0,this.level=2,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,s){super.attributeChangedCallback(t,e,s),t==="level"&&s&&this.setLevel(Number(s)),t==="visuallyHidden"&&(this.visuallyHidden=s!==null&&s!=="false"),(t==="size"||t==="visuallyHidden"||t==="align")&&this.updateHostClasses()}updated(t){super.updated(t),t.has("level")&&(this.setLevel(this.level),this.hasAttribute("size")||(this.size=this.defaultSizeForLevel)),!this.hasAttribute("size")&&(t.has("level")||this.size===void 0)&&(this.size=this.defaultSizeForLevel),(t.has("size")||t.has("visuallyHidden")||t.has("align"))&&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"}}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"),this.classList.add("pkt-heading"),this.size&&this.classList.add(`pkt-heading--${this.size}`),this.visuallyHidden&&this.classList.add("pkt-sr-only"),this.align&&this.classList.add(`pkt-heading--${this.align}`)}render(){return u`<slot></slot>`}};Si([o({type:String,reflect:!0})],Me.prototype,"size",2),Si([o({type:Number,reflect:!0})],Me.prototype,"level",2),Si([o({type:Boolean,reflect:!0})],Me.prototype,"visuallyHidden",2),Si([o({type:String,reflect:!0})],Me.prototype,"align",2),Me=Si([j("pkt-heading")],Me);const tl={layout:{default:"vertical"},skin:{type:["outlined","outlined-beige","gray","blue","beige","green"],default:"outlined"},padding:{default:"default"}},Xe={props:tl};var el=Object.defineProperty,il=Object.getOwnPropertyDescriptor,ct=(i,t,e,s)=>{for(var a=s>1?void 0:s?il(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&el(t,e,a),a};let ot=class extends Y{constructor(){super(),this.defaultSlot=P(),this.ariaLabel="",this.metaLead=null,this.borderOnHover=!0,this.clickCardLink=null,this.metaTrail=null,this.layout=Xe.props.layout.default,this.heading="",this.headinglevel=3,this.image={src:"",alt:""},this.imageShape="square",this.openLinkInNewTab=!1,this.padding=Xe.props.padding.default,this.skin=Xe.props.skin.default,this.subheading="",this.tagPosition="top",this.tags=[],this.slotController=new pt(this,this.defaultSlot)}connectedCallback(){super.connectedCallback()}render(){var t,e;const s={"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},a=((t=this.ariaLabel)==null?void 0:t.trim())||(this.heading?`${this.heading} lenkekort`:"lenkekort"),n=((e=this.ariaLabel)==null?void 0:e.trim())||(this.heading?this.heading:"kort");return u`
|
|
329
329
|
<article
|
|
330
330
|
class=${A(s)}
|
|
331
|
-
aria-label=${
|
|
331
|
+
aria-label=${T(this.clickCardLink?a:n)}
|
|
332
332
|
>
|
|
333
333
|
${this.renderImage()}
|
|
334
334
|
<div class="pkt-card__wrapper">
|
|
335
|
-
${this.tagPosition==="top"?this.renderTags()
|
|
335
|
+
${this.tagPosition==="top"?this.renderTags():$}
|
|
336
336
|
${this.renderHeader()}
|
|
337
337
|
${this.renderSlot()}
|
|
338
|
-
${this.tagPosition==="bottom"?this.renderTags()
|
|
338
|
+
${this.tagPosition==="bottom"?this.renderTags():$}
|
|
339
339
|
${this.renderMetadata()}
|
|
340
340
|
</div>
|
|
341
341
|
</article>
|
|
@@ -355,7 +355,7 @@
|
|
|
355
355
|
>
|
|
356
356
|
${this.heading}
|
|
357
357
|
</pkt-heading>
|
|
358
|
-
|
|
358
|
+
`:$}
|
|
359
359
|
`}renderLinkHeading(){return u`
|
|
360
360
|
${this.clickCardLink?u`
|
|
361
361
|
<pkt-heading
|
|
@@ -371,9 +371,9 @@
|
|
|
371
371
|
>${this.heading}</a
|
|
372
372
|
>
|
|
373
373
|
</pkt-heading>
|
|
374
|
-
|
|
374
|
+
`:$}
|
|
375
375
|
`}renderSubheading(){return u`
|
|
376
|
-
${this.subheading?u` <p class="pkt-card__subheading ">${this.subheading}</p>
|
|
376
|
+
${this.subheading?u` <p class="pkt-card__subheading ">${this.subheading}</p> `:$}
|
|
377
377
|
`}renderHeader(){const t=!!this.heading||!!this.subheading;return u`
|
|
378
378
|
${t?u`
|
|
379
379
|
<header class="pkt-card__header">
|
|
@@ -381,7 +381,7 @@
|
|
|
381
381
|
${this.renderLinkHeading()}
|
|
382
382
|
${this.renderSubheading()}
|
|
383
383
|
</header>
|
|
384
|
-
|
|
384
|
+
`:$}
|
|
385
385
|
`}renderTags(){const t={"pkt-card__tags":!0,[`pkt-card__tags-${this.tagPosition}`]:this.tagPosition};return u`
|
|
386
386
|
${this.tags.length>0?u`
|
|
387
387
|
<div
|
|
@@ -394,28 +394,28 @@
|
|
|
394
394
|
role="listitem"
|
|
395
395
|
textStyle="normal-text"
|
|
396
396
|
size="medium"
|
|
397
|
-
skin=${
|
|
398
|
-
iconName=${
|
|
397
|
+
skin=${T(e.skin)}
|
|
398
|
+
iconName=${T(e.iconName)}
|
|
399
399
|
>
|
|
400
400
|
<span>${e.text}</span>
|
|
401
401
|
</pkt-tag>
|
|
402
402
|
`)}
|
|
403
403
|
</div>
|
|
404
|
-
|
|
404
|
+
`:$}
|
|
405
405
|
`}renderSlot(){return u`
|
|
406
406
|
${this.defaultSlot&&u`<section class="pkt-card__content" ${O(this.defaultSlot)}></section>`}
|
|
407
407
|
`}renderMetadata(){return u`
|
|
408
408
|
${this.metaLead||this.metaTrail?u`
|
|
409
409
|
<footer class="pkt-card__metadata">
|
|
410
|
-
${this.metaLead?u`<span class="pkt-card__metadata-lead">${this.metaLead}</span
|
|
411
|
-
${this.metaTrail?u`<span class="pkt-card__metadata-trail">${this.metaTrail}</span
|
|
410
|
+
${this.metaLead?u`<span class="pkt-card__metadata-lead">${this.metaLead}</span>`:$}
|
|
411
|
+
${this.metaTrail?u`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>`:$}
|
|
412
412
|
</footer>
|
|
413
|
-
|
|
414
|
-
`}};ct([o({type:String})],ot.prototype,"ariaLabel",2),ct([o({type:String})],ot.prototype,"metaLead",2),ct([o({type:Boolean})],ot.prototype,"borderOnHover",2),ct([o({type:String,reflect:!0})],ot.prototype,"clickCardLink",2),ct([o({type:String})],ot.prototype,"metaTrail",2),ct([o({type:String})],ot.prototype,"layout",2),ct([o({type:String})],ot.prototype,"heading",2),ct([o({type:Number})],ot.prototype,"headinglevel",2),ct([o({type:Object})],ot.prototype,"image",2),ct([o({type:String})],ot.prototype,"imageShape",2),ct([o({type:Boolean})],ot.prototype,"openLinkInNewTab",2),ct([o({type:String})],ot.prototype,"padding",2),ct([o({type:String,converter:{fromAttribute:i=>{const t=Xe.props.skin.type;return i&&t.includes(i)?i:(i&&!t.includes(i)&&console.warn(`Invalid skin value "${i}". Using default skin "${Xe.props.skin.default}".`),Xe.props.skin.default)},toAttribute:i=>i}})],ot.prototype,"skin",2),ct([o({type:String})],ot.prototype,"subheading",2),ct([o({type:String})],ot.prototype,"tagPosition",2),ct([o({type:Array})],ot.prototype,"tags",2),ot=ct([
|
|
413
|
+
`:$}
|
|
414
|
+
`}};ct([o({type:String})],ot.prototype,"ariaLabel",2),ct([o({type:String})],ot.prototype,"metaLead",2),ct([o({type:Boolean})],ot.prototype,"borderOnHover",2),ct([o({type:String,reflect:!0})],ot.prototype,"clickCardLink",2),ct([o({type:String})],ot.prototype,"metaTrail",2),ct([o({type:String})],ot.prototype,"layout",2),ct([o({type:String})],ot.prototype,"heading",2),ct([o({type:Number})],ot.prototype,"headinglevel",2),ct([o({type:Object})],ot.prototype,"image",2),ct([o({type:String})],ot.prototype,"imageShape",2),ct([o({type:Boolean})],ot.prototype,"openLinkInNewTab",2),ct([o({type:String})],ot.prototype,"padding",2),ct([o({type:String,converter:{fromAttribute:i=>{const t=Xe.props.skin.type;return i&&t.includes(i)?i:(i&&!t.includes(i)&&console.warn(`Invalid skin value "${i}". Using default skin "${Xe.props.skin.default}".`),Xe.props.skin.default)},toAttribute:i=>i}})],ot.prototype,"skin",2),ct([o({type:String})],ot.prototype,"subheading",2),ct([o({type:String})],ot.prototype,"tagPosition",2),ct([o({type:Array})],ot.prototype,"tags",2),ot=ct([j("pkt-card")],ot);/**
|
|
415
415
|
* @license
|
|
416
416
|
* Copyright 2017 Google LLC
|
|
417
417
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
418
|
-
*/const Fa=(i,t,e)=>{const s=new Map;for(let a=t;a<=e;a++)s.set(i[a],a);return s},Cs=Ce(class extends We{constructor(i){if(super(i),i.type!==Kt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(i,t,e){let s;e===void 0?e=t:t!==void 0&&(s=t);const a=[],n=[];let r=0;for(const h of i)a[r]=s?s(h,r):r,n[r]=e(h,r),r++;return{values:n,keys:a}}render(i,t,e){return this.dt(i,t,e).values}update(i,[t,e,s]){const a=ir(i),{values:n,keys:r}=this.dt(t,e,s);if(!Array.isArray(a))return this.ut=r,n;const h=this.ut??(this.ut=[]),d=[];let c,v,m=0,b=a.length-1,y=0,_=n.length-1;for(;m<=b&&y<=_;)if(a[m]===null)m++;else if(a[b]===null)b--;else if(h[m]===r[y])d[y]=Te(a[m],n[y]),m++,y++;else if(h[b]===r[_])d[_]=Te(a[b],n[_]),b--,_--;else if(h[m]===r[_])d[_]=Te(a[m],n[_]),gi(i,d[_+1],a[m]),m++,_--;else if(h[b]===r[y])d[y]=Te(a[b],n[y]),gi(i,a[m],a[b]),b--,y++;else if(c===void 0&&(c=Fa(r,y,_),v=Fa(h,m,b)),c.has(h[m]))if(c.has(h[b])){const x=v.get(r[y]),M=x!==void 0?a[x]:null;if(M===null){const R=gi(i,a[m]);Te(R,n[y]),d[y]=R}else d[y]=Te(M,n[y]),gi(i,a[m],M),a[x]=null;y++}else ms(a[b]),b--;else ms(a[m]),m++;for(;y<=_;){const x=gi(i,d[_+1]);Te(x,n[y]),d[y++]=x}for(;m<=b;){const x=a[m++];x!==null&&ms(x)}return this.ut=r,fa(i,d),$t}}),Va=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),be=()=>{const i=Va(),t=Va();return i.slice(0,8)+"-"+i.slice(8,12)+"-4"+i.slice(13)+"-a"+t.slice(1,4)+"-"+t.slice(4)},el={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}},Nt={props:el};var il={},ja;function sl(){return ja||(ja=1,(function(){(function(i){const t=new WeakMap,e=new WeakMap,s=new WeakMap,a=new WeakMap,n=new WeakMap,r=new WeakMap,h=new WeakMap,d=new WeakMap,c=new WeakMap,v=new WeakMap,m=new WeakMap,b=new WeakMap,y=new WeakMap,_=new WeakMap,x=new WeakMap,M={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"},R=(f,p)=>{for(let g in M){p[g]=null;let $=null;const D=M[g];Object.defineProperty(p,g,{get(){return $},set(B){$=B,f.isConnected?nt(f,D,B):v.set(f,p)}})}};function S(f){const p=a.get(f),{form:g}=p;pe(f,g,p),Tt(f,p.labels)}const V=(f,p=!1)=>{const g=document.createTreeWalker(f,NodeFilter.SHOW_ELEMENT,{acceptNode(B){return a.has(B)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let $=g.nextNode();const D=!p||f.disabled;for(;$;)$.formDisabledCallback&&D&&Ft($,f.disabled),$=g.nextNode()},T={attributes:!0,attributeFilter:["disabled","name"]},G=ce()?new MutationObserver(f=>{for(const p of f){const g=p.target;if(p.attributeName==="disabled"&&(g.constructor.formAssociated?Ft(g,g.hasAttribute("disabled")):g.localName==="fieldset"&&V(g)),p.attributeName==="name"&&g.constructor.formAssociated){const $=a.get(g),D=c.get(g);$.setFormValue(D)}}}):{};function J(f){f.forEach(p=>{const{addedNodes:g,removedNodes:$}=p,D=Array.from(g),B=Array.from($);D.forEach(j=>{var jt;if(a.has(j)&&j.constructor.formAssociated&&S(j),v.has(j)){const ft=v.get(j);Object.keys(M).filter(Ht=>ft[Ht]!==null).forEach(Ht=>{nt(j,M[Ht],ft[Ht])}),v.delete(j)}if(x.has(j)){const ft=x.get(j);nt(j,"internals-valid",ft.validity.valid.toString()),nt(j,"internals-invalid",(!ft.validity.valid).toString()),nt(j,"aria-invalid",(!ft.validity.valid).toString()),x.delete(j)}if(j.localName==="form"){const ft=d.get(j),Ht=document.createTreeWalker(j,NodeFilter.SHOW_ELEMENT,{acceptNode(Fs){return a.has(Fs)&&Fs.constructor.formAssociated&&!(ft&&ft.has(Fs))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let Li=Ht.nextNode();for(;Li;)S(Li),Li=Ht.nextNode()}j.localName==="fieldset"&&((jt=G.observe)===null||jt===void 0||jt.call(G,j,T),V(j,!0))}),B.forEach(j=>{const jt=a.get(j);jt&&s.get(jt)&&Vt(jt),h.has(j)&&h.get(j).disconnect()})})}function Lt(f){f.forEach(p=>{const{removedNodes:g}=p;g.forEach($=>{const D=y.get(p.target);a.has($)&&je($),D.disconnect()})})}const Bt=f=>{var p,g;const $=new MutationObserver(Lt);!((p=window==null?void 0:window.ShadyDOM)===null||p===void 0)&&p.inUse&&f.mode&&f.host&&(f=f.host),(g=$.observe)===null||g===void 0||g.call($,f,{childList:!0}),y.set(f,$)};ce()&&new MutationObserver(J);const st={childList:!0,subtree:!0},nt=(f,p,g)=>{f.getAttribute(p)!==g&&f.setAttribute(p,g)},Ft=(f,p)=>{f.toggleAttribute("internals-disabled",p),p?nt(f,"aria-disabled","true"):f.removeAttribute("aria-disabled"),f.formDisabledCallback&&f.formDisabledCallback.apply(f,[p])},Vt=f=>{s.get(f).forEach(p=>{p.remove()}),s.set(f,[])},rt=(f,p)=>{const g=document.createElement("input");return g.type="hidden",g.name=f.getAttribute("name"),f.after(g),s.get(p).push(g),g},I=(f,p)=>{var g;s.set(p,[]),(g=G.observe)===null||g===void 0||g.call(G,f,T)},Tt=(f,p)=>{if(p.length){Array.from(p).forEach($=>$.addEventListener("click",f.click.bind(f)));let g=p[0].id;p[0].id||(g=`${p[0].htmlFor}_Label`,p[0].id=g),nt(f,"aria-labelledby",g)}},ae=f=>{const p=Array.from(f.elements).filter(B=>!B.tagName.includes("-")&&B.validity).map(B=>B.validity.valid),g=d.get(f)||[],$=Array.from(g).filter(B=>B.isConnected).map(B=>a.get(B).validity.valid),D=[...p,...$].includes(!1);f.toggleAttribute("internals-invalid",D),f.toggleAttribute("internals-valid",!D)},de=f=>{ae(Rt(f.target))},ne=f=>{ae(Rt(f.target))},Fe=f=>{const p=["button[type=submit]","input[type=submit]","button:not([type])"].map(g=>`${g}:not([disabled])`).map(g=>`${g}:not([form])${f.id?`,${g}[form='${f.id}']`:""}`).join(",");f.addEventListener("click",g=>{if(g.target.closest(p)){const $=d.get(f);if(f.noValidate)return;$.size&&Array.from($).reverse().map(D=>a.get(D).reportValidity()).includes(!1)&&g.preventDefault()}})},ri=f=>{const p=d.get(f.target);p&&p.size&&p.forEach(g=>{g.constructor.formAssociated&&g.formResetCallback&&g.formResetCallback.apply(g)})},pe=(f,p,g)=>{if(p){const $=d.get(p);if($)$.add(f);else{const D=new Set;D.add(f),d.set(p,D),Fe(p),p.addEventListener("reset",ri),p.addEventListener("input",de),p.addEventListener("change",ne)}r.set(p,{ref:f,internals:g}),f.constructor.formAssociated&&f.formAssociatedCallback&&setTimeout(()=>{f.formAssociatedCallback.apply(f,[p])},0),ae(p)}},Rt=f=>{let p=f.parentNode;return p&&p.tagName!=="FORM"&&(p=Rt(p)),p},dt=(f,p,g=DOMException)=>{if(!f.constructor.formAssociated)throw new g(p)},Ve=(f,p,g)=>{const $=d.get(f);return $&&$.size&&$.forEach(D=>{a.get(D)[g]()||(p=!1)}),p},je=f=>{if(f.constructor.formAssociated){const p=a.get(f),{labels:g,form:$}=p;Tt(f,g),pe(f,$,p)}};function ce(){return typeof MutationObserver<"u"}class Ds{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 ns=f=>(f.badInput=!1,f.customError=!1,f.patternMismatch=!1,f.rangeOverflow=!1,f.rangeUnderflow=!1,f.stepMismatch=!1,f.tooLong=!1,f.tooShort=!1,f.typeMismatch=!1,f.valid=!0,f.valueMissing=!1,f),Is=(f,p,g)=>(f.valid=rs(p),Object.keys(p).forEach($=>f[$]=p[$]),g&&ae(g),f),rs=f=>{let p=!0;for(let g in f)g!=="valid"&&f[g]!==!1&&(p=!1);return p},oi=new WeakMap;function li(f,p){f.toggleAttribute(p,!0),f.part&&f.part.add(p)}class Ii extends Set{static get isPolyfilled(){return!0}constructor(p){if(super(),!p||!p.tagName||p.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");oi.set(this,p)}add(p){if(!/^--/.test(p)||typeof p!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${p} must start with '--'.`);const g=super.add(p),$=oi.get(this),D=`state${p}`;return $.isConnected?li($,D):setTimeout(()=>{li($,D)}),g}clear(){for(let[p]of this.entries())this.delete(p);super.clear()}delete(p){const g=super.delete(p),$=oi.get(this);return $.isConnected?($.toggleAttribute(`state${p}`,!1),$.part&&$.part.remove(`state${p}`)):setTimeout(()=>{$.toggleAttribute(`state${p}`,!1),$.part&&$.part.remove(`state${p}`)}),g}}function os(f,p,g,$){if(typeof p=="function"?f!==p||!$:!p.has(f))throw new TypeError("Cannot read private member from an object whose class did not declare it");return g==="m"?$:g==="a"?$.call(f):$?$.value:p.get(f)}function Ls(f,p,g,$,D){if(typeof p=="function"?f!==p||!0:!p.has(f))throw new TypeError("Cannot write private member to an object whose class did not declare it");return p.set(f,g),g}var _e;class ls{constructor(p){_e.set(this,void 0),Ls(this,_e,p);for(let g=0;g<p.length;g++){let $=p[g];this[g]=$,$.hasAttribute("name")&&(this[$.getAttribute("name")]=$)}Object.freeze(this)}get length(){return os(this,_e,"f").length}[(_e=new WeakMap,Symbol.iterator)](){return os(this,_e,"f")[Symbol.iterator]()}item(p){return this[p]==null?null:this[p]}namedItem(p){return this[p]==null?null:this[p]}}function hs(){const f=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=g;const p=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=$;function g(...B){let j=f.apply(this,B);return Ve(this,j,"checkValidity")}function $(...B){let j=p.apply(this,B);return Ve(this,j,"reportValidity")}const{get:D}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...B){const j=D.call(this,...B),jt=Array.from(d.get(this)||[]);if(jt.length===0)return j;const ft=Array.from(j).concat(jt).sort((Ht,Li)=>Ht.compareDocumentPosition?Ht.compareDocumentPosition(Li)&2?1:-1:0);return new ls(ft)}})}class gn{static get isPolyfilled(){return!0}constructor(p){if(!p||!p.tagName||p.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const g=p.getRootNode(),$=new Ds;this.states=new Ii(p),t.set(this,p),e.set(this,$),a.set(p,this),R(p,this),I(p,this),Object.seal(this),g instanceof DocumentFragment&&Bt(g)}checkValidity(){const p=t.get(this);if(dt(p,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const g=e.get(this);if(!g.valid){const $=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});p.dispatchEvent($)}return g.valid}get form(){const p=t.get(this);dt(p,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let g;return p.constructor.formAssociated===!0&&(g=Rt(p)),g}get labels(){const p=t.get(this);dt(p,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const g=p.getAttribute("id"),$=p.getRootNode();return $&&g?$.querySelectorAll(`[for="${g}"]`):[]}reportValidity(){const p=t.get(this);if(dt(p,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const g=this.checkValidity(),$=b.get(this);if($&&!p.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!g&&$&&(p.focus(),$.focus()),g}setFormValue(p){const g=t.get(this);if(dt(g,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),Vt(this),p!=null&&!(p instanceof FormData)){if(g.getAttribute("name")){const $=rt(g,this);$.value=p}}else p!=null&&p instanceof FormData&&Array.from(p).reverse().forEach(([$,D])=>{if(typeof D=="string"){const B=rt(g,this);B.name=$,B.value=D}});c.set(g,p)}setValidity(p,g,$){const D=t.get(this);if(dt(D,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!p)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");b.set(this,$);const B=e.get(this),j={};for(const Ht in p)j[Ht]=p[Ht];Object.keys(j).length===0&&ns(B);const jt=Object.assign(Object.assign({},B),j);delete jt.valid;const{valid:ft}=Is(B,jt,this.form);if(!ft&&!g)throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");n.set(this,ft?"":g),D.isConnected?(D.toggleAttribute("internals-invalid",!ft),D.toggleAttribute("internals-valid",ft),nt(D,"aria-invalid",`${!ft}`)):x.set(D,this)}get shadowRoot(){const p=t.get(this);return m.get(p)||null}get validationMessage(){const p=t.get(this);return dt(p,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),n.get(this)}get validity(){const p=t.get(this);return dt(p,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),e.get(this)}get willValidate(){const p=t.get(this);return dt(p,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(p.disabled||p.hasAttribute("disabled")||p.hasAttribute("readonly"))}}function ed(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class f extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const p=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(p,f);const g=new f;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every($=>$ in g.internals)}let mn=!1,vn=!1;function Bs(f){vn||(vn=!0,window.CustomStateSet=Ii,f&&(HTMLElement.prototype.attachInternals=function(...p){const g=f.call(this,p);return g.states=new Ii(this),g}))}function yn(f=!0){if(!mn){if(mn=!0,typeof window<"u"&&(window.ElementInternals=gn),typeof CustomElementRegistry<"u"){const p=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(g,$,D){if($.formAssociated){const B=$.prototype.connectedCallback;$.prototype.connectedCallback=function(){_.has(this)||(_.set(this,!0),this.hasAttribute("disabled")&&Ft(this,!0)),B!=null&&B.apply(this),je(this)}}p.call(this,g,$,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(a.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new gn(this)}),typeof Element<"u"){let p=function(...$){const D=g.apply(this,$);if(m.set(this,D),ce()){const B=new MutationObserver(J);window.ShadyDOM?B.observe(this,st):B.observe(D,st),h.set(this,B)}return D};const g=Element.prototype.attachShadow;Element.prototype.attachShadow=p}ce()&&typeof document<"u"&&new MutationObserver(J).observe(document.documentElement,st),typeof HTMLFormElement<"u"&&hs(),(f||typeof window<"u"&&!window.CustomStateSet)&&Bs()}}return customElements.polyfillWrapFlushCallback||(ed()?typeof window<"u"&&!window.CustomStateSet&&Bs(HTMLElement.prototype.attachInternals):yn(!1)),i.forceCustomStateSetPolyfill=Bs,i.forceElementInternalsPolyfill=yn,Object.defineProperty(i,"__esModule",{value:!0}),i})({})})()),il}sl();var al=Object.defineProperty,L=(i,t,e,s)=>{for(var a=void 0,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=r(t,e,a)||a);return a&&al(t,e,a),a};let P=class extends Y{constructor(){super(),this.defaultValue=null,this.disabled=!1,this.readonly=!1,this.required=!1,this.max=null,this.maxlength=null,this.min=null,this.minlength=null,this.step=null,this.ariaDescribedBy=null,this.ariaLabelledby=null,this.name="",this.pattern=null,this.placeholder=null,this.id=be(),this.counter=!1,this.hasError=!1,this.inline=!1,this.hasFieldset=!1,this.optionalTag=!1,this.requiredTag=!1,this.skipForwardTestid=!1,this.useWrapper=!0,this.fullwidth=!1,this.counterMaxLength=0,this.errorMessage="",this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=Nt.props.helptextDropdownButton.default,this.label=null,this.optionalText=yt.forms.labels.optional,this.requiredText=yt.forms.labels.required,this.tagText=null,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(t){var e,s,a,n,r,h,d,c,v,m,b;t&&(this.required&&!this.value?this.internals.setValidity({valueMissing:!0},yt.forms.messages.required,t):(e=t.validity)!=null&&e.typeMismatch||(s=t.validity)!=null&&s.badInput?this.internals.setValidity({typeMismatch:!0},yt.forms.messages.invalid,t):(a=t.validity)!=null&&a.patternMismatch?this.internals.setValidity({patternMismatch:!0},yt.forms.messages.invalidPattern,t):(n=t.validity)!=null&&n.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},yt.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},yt.forms.messages.tooLong,t):(h=t.validity)!=null&&h.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?yt.forms.messages.rangeUnderflowMin.replace("{min}",(d=this.min)==null?void 0:d.toString()):yt.forms.messages.rangeUnderflow,t):(c=t.validity)!=null&&c.stepMismatch?this.internals.setValidity({stepMismatch:!0},yt.forms.messages.invalid,t):(v=t.validity)!=null&&v.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?yt.forms.messages.rangeOverflowMax.replace("{max}",(m=this.max)==null?void 0:m.toString()):yt.forms.messages.rangeOverflow,t):(b=t.validity)!=null&&b.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(s=>{e.append(this.name,s)}),this.internals.setFormValue(e)}else this.internals.setFormValue(t)}valueChecked(t){if(!this.touched)return;const e=this.internals.form||this.closest("form"),s=e?new FormData(e):null;e&&e.querySelectorAll(`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`).forEach(a=>{const n=a;n.name===this.name&&n.value!==this.value&&n.checked&&(n.checked=!1)}),typeof t=="string"?(this.checked=t==="true",this.internals.ariaChecked=t==="true"):typeof t=="boolean"&&(this.checked=t,this.internals.ariaChecked=t),this.checked?(this.internals.setFormValue(this.value||"on",this.value||"on"),s&&s.append(this.name,this.value||"on"),this.internals.states.add("--checked")):(this.internals.setFormValue(null,null),s&&s.delete(this.name),this.internals.states.delete("--checked")),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:this.checked,bubbles:!0,composed:!0})),this.internals.reportValidity()}valueChanged(t,e){(e!==this.value||e!==this._value)&&(typeof t=="string"?((this.multiple||this.range)&&t.includes(",")&&(t=t.split(",")),this.value=t,this._value=Array.isArray(t)?t:[t]):Array.isArray(t)?(this.value=this.multiple||this.range?t:t[0],this._value=t):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&e&&e.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(e==null?void 0:e.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate()))}clearInputValue(){const t=this.multiple||this.range?[]:"";this.value=t,this.internals.setFormValue(t),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0}))}onFocus(){this.dispatchEvent(new FocusEvent("focus",{bubbles:!0,composed:!0}))}onBlur(){this.dispatchEvent(new FocusEvent("blur",{bubbles:!0,composed:!0}))}onInput(){this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}onChange(t){if(!this.touched){this.touched=!0,t&&this.setFormValue(t);return}typeof t!="string"&&!Array.isArray(t)||((this.range||this.multiple)&&!Array.isArray(t)&&t.includes(",")&&(t=t.split(",")),!this.multiple&&!this.range&&Array.isArray(t)&&(t=t[0]),this.setFormValue(t),this.manageValidity(this.inputRef.value),this.inputRefTo&&this.manageValidity(this.inputRefTo.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0})))}formResetCallback(){this.touched=!1,this._options&&this._options.length&&this._options.forEach(t=>{"selected"in t&&(t.selected=!1)}),this.checked!==void 0?(this.checked=!1,this.internals.ariaChecked=!1,this.internals.setFormValue("",""),this.inputRef.value.checked=!1,this.valueChecked(this.checked)):(this.internals.setFormValue(""),this.value=this.defaultValue||(this.multiple||this.range?[]:""),this._value=this.value,this.valueChanged(this.value,null)),this.internals.ariaInvalid=!1}updated(t){super.updated(t),t.has("dataTestid")&&this.dataTestid&&this.inputRef.value&&(this.skipForwardTestid?this.hasAttribute("data-testid")||this.setAttribute("data-testid",this.dataTestid):(this.inputRef.value.dataset.testid=this.dataTestid,this.removeAttribute("data-testid")))}firstUpdated(t){if(super.firstUpdated(t),!this.form){const e=this.internals.form||this.closest("form");this.form=e}if(this.value&&this.defaultValue!==null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked=!0,this.checked=!0),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.ariaDisabled=!0),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const e=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=e,this.internals.setFormValue(e?this.value||"on":"",e?this.value||"on":"")}else this.internals.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute("form",""),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute("form",""),this.manageValidity(this.inputRefTo.value))}};L([o()],P.prototype,"defaultValue"),L([o({type:Boolean,reflect:!0})],P.prototype,"disabled"),L([o({type:Boolean,reflect:!0})],P.prototype,"readonly"),L([o({type:Boolean,reflect:!0})],P.prototype,"required"),L([o({type:Number,reflect:!0})],P.prototype,"max"),L([o({type:Number,reflect:!0})],P.prototype,"maxlength"),L([o({type:Number,reflect:!0})],P.prototype,"min"),L([o({type:Number,reflect:!0})],P.prototype,"minlength"),L([o({type:Number,reflect:!0})],P.prototype,"step"),L([o({type:String})],P.prototype,"ariaDescribedBy"),L([o({type:String})],P.prototype,"ariaLabelledby"),L([o({type:String,reflect:!0})],P.prototype,"name"),L([o({type:String,reflect:!0})],P.prototype,"pattern"),L([o({type:String,reflect:!0})],P.prototype,"placeholder"),L([o({type:String,reflect:!0})],P.prototype,"id"),L([o({type:Boolean})],P.prototype,"counter"),L([o({type:Boolean})],P.prototype,"hasError"),L([o({type:Boolean})],P.prototype,"inline"),L([o({type:Boolean})],P.prototype,"hasFieldset"),L([o({type:Boolean})],P.prototype,"optionalTag"),L([o({type:Boolean})],P.prototype,"requiredTag"),L([o({type:Boolean})],P.prototype,"skipForwardTestid"),L([o({type:Boolean,reflect:!1})],P.prototype,"useWrapper"),L([o({type:Boolean,reflect:!0})],P.prototype,"fullwidth"),L([o({type:Number})],P.prototype,"counterMaxLength"),L([o({type:String})],P.prototype,"errorMessage"),L([o({type:String})],P.prototype,"helptext"),L([o({type:String})],P.prototype,"helptextDropdown"),L([o({type:String,reflect:!1})],P.prototype,"helptextDropdownButton"),L([o({type:String})],P.prototype,"label"),L([o({type:String,reflect:!1})],P.prototype,"optionalText"),L([o({type:String,reflect:!1})],P.prototype,"requiredText"),L([o({type:String,reflect:!1})],P.prototype,"tagText"),L([o({type:String,attribute:"data-testid"})],P.prototype,"dataTestid"),L([U()],P.prototype,"touched");let Ha=class{constructor(t){this.nodes=[],this.options=[],this.host=t,this.host.addController(this),this.nodes=[],this.options=[],this.observer=new MutationObserver(e=>this.handleMutations(e))}hostConnected(){Array.from(this.host.childNodes).forEach(t=>{(t.nodeName==="OPTION"||t.nodeName==="DATA")&&this.addNode(t)}),this.observer.observe(this.host,{childList:!0,subtree:!1,attributes:!0})}hostDisconnected(){this.observer.disconnect()}addNode(t){(t.nodeName==="OPTION"||t.nodeName==="DATA")&&(t.hasAttribute("hidden")&&!t.hasAttribute("data-skip")&&t.setAttribute("data-hidden","true"),!t.hasAttribute("hidden")&&t.hasAttribute("data-skip")&&t.hasAttribute("data-hidden")&&t.removeAttribute("data-hidden"),t.setAttribute("class","pkt-hide"),t.setAttribute("data-skip","true"),t.setAttribute("hidden","true"),this.nodes.push(t))}createOptions(){this.options=this.nodes.map(t=>({value:t.hasAttribute("value")?t.getAttribute("value")??"":t.textContent??"",label:t.textContent||t.getAttribute("value")||"",selected:t.hasAttribute("selected"),disabled:t.hasAttribute("disabled"),hidden:t.hasAttribute("data-hidden")})),this.host.setAttribute("options",JSON.stringify(this.options))}handleMutations(t){let e=!1;t.forEach(s=>{s.type==="childList"&&(s.addedNodes.forEach(a=>{Re(a)&&(this.addNode(a),e=!0)}),s.removedNodes.forEach(a=>{Re(a)&&(this.nodes=this.nodes.filter(n=>n!==a),e=!0)})),s.type==="attributes"&&Re(s.target)&&(this.addNode(s.target),e=!0)}),e&&this.createOptions()}};var nl=Object.defineProperty,rl=Object.getOwnPropertyDescriptor,De=(i,t,e,s)=>{for(var a=s>1?void 0:s?rl(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&nl(t,e,a),a};let oe=class extends Y{constructor(){super(),this.defaultSlot=N(),this.forId=be(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=Nt.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new pt(this,this.defaultSlot)}updateSlots(t){this.filledSlots=new Set(t)}render(){const t=()=>{const a=!this.isHelpTextOpen;this.isHelpTextOpen=a,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:a}}))},e=A({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.filledSlots.size>0}),s=()=>this.helptextDropdown?u`<div class="pkt-inputwrapper__helptext-expandable">
|
|
418
|
+
*/const Va=(i,t,e)=>{const s=new Map;for(let a=t;a<=e;a++)s.set(i[a],a);return s},Ss=Ce(class extends We{constructor(i){if(super(i),i.type!==Kt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(i,t,e){let s;e===void 0?e=t:t!==void 0&&(s=t);const a=[],n=[];let r=0;for(const h of i)a[r]=s?s(h,r):r,n[r]=e(h,r),r++;return{values:n,keys:a}}render(i,t,e){return this.dt(i,t,e).values}update(i,[t,e,s]){const a=ar(i),{values:n,keys:r}=this.dt(t,e,s);if(!Array.isArray(a))return this.ut=r,n;const h=this.ut??(this.ut=[]),d=[];let c,v,g=0,k=a.length-1,b=0,y=n.length-1;for(;g<=k&&b<=y;)if(a[g]===null)g++;else if(a[k]===null)k--;else if(h[g]===r[b])d[b]=Te(a[g],n[b]),g++,b++;else if(h[k]===r[y])d[y]=Te(a[k],n[y]),k--,y--;else if(h[g]===r[y])d[y]=Te(a[g],n[y]),gi(i,d[y+1],a[g]),g++,y--;else if(h[k]===r[b])d[b]=Te(a[k],n[b]),gi(i,a[g],a[k]),k--,b++;else if(c===void 0&&(c=Va(r,b,y),v=Va(h,g,k)),c.has(h[g]))if(c.has(h[k])){const w=v.get(r[b]),S=w!==void 0?a[w]:null;if(S===null){const M=gi(i,a[g]);Te(M,n[b]),d[b]=M}else d[b]=Te(S,n[b]),gi(i,a[g],S),a[w]=null;b++}else gs(a[k]),k--;else gs(a[g]),g++;for(;b<=y;){const w=gi(i,d[y+1]);Te(w,n[b]),d[b++]=w}for(;g<=k;){const w=a[g++];w!==null&&gs(w)}return this.ut=r,ga(i,d),$t}}),Ha=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),ye=()=>{const i=Ha(),t=Ha();return i.slice(0,8)+"-"+i.slice(8,12)+"-4"+i.slice(13)+"-a"+t.slice(1,4)+"-"+t.slice(4)},sl={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}},At={props:sl};var al={},ja;function nl(){return ja||(ja=1,(function(){(function(i){const t=new WeakMap,e=new WeakMap,s=new WeakMap,a=new WeakMap,n=new WeakMap,r=new WeakMap,h=new WeakMap,d=new WeakMap,c=new WeakMap,v=new WeakMap,g=new WeakMap,k=new WeakMap,b=new WeakMap,y=new WeakMap,w=new WeakMap,S={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDescription:"aria-description",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"},M=(f,p)=>{for(let m in S){p[m]=null;let _=null;const I=S[m];Object.defineProperty(p,m,{get(){return _},set(F){_=F,f.isConnected?nt(f,I,F):v.set(f,p)}})}};function C(f){const p=a.get(f),{form:m}=p;pe(f,m,p),Tt(f,p.labels)}const V=(f,p=!1)=>{const m=document.createTreeWalker(f,NodeFilter.SHOW_ELEMENT,{acceptNode(F){return a.has(F)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let _=m.nextNode();const I=!p||f.disabled;for(;_;)_.formDisabledCallback&&I&&Ft(_,f.disabled),_=m.nextNode()},N={attributes:!0,attributeFilter:["disabled","name"]},G=ce()?new MutationObserver(f=>{for(const p of f){const m=p.target;if(p.attributeName==="disabled"&&(m.constructor.formAssociated?Ft(m,m.hasAttribute("disabled")):m.localName==="fieldset"&&V(m)),p.attributeName==="name"&&m.constructor.formAssociated){const _=a.get(m),I=c.get(m);_.setFormValue(I)}}}):{};function J(f){f.forEach(p=>{const{addedNodes:m,removedNodes:_}=p,I=Array.from(m),F=Array.from(_);I.forEach(H=>{var Ht;if(a.has(H)&&H.constructor.formAssociated&&C(H),v.has(H)){const ft=v.get(H);Object.keys(S).filter(jt=>ft[jt]!==null).forEach(jt=>{nt(H,S[jt],ft[jt])}),v.delete(H)}if(w.has(H)){const ft=w.get(H);nt(H,"internals-valid",ft.validity.valid.toString()),nt(H,"internals-invalid",(!ft.validity.valid).toString()),nt(H,"aria-invalid",(!ft.validity.valid).toString()),w.delete(H)}if(H.localName==="form"){const ft=d.get(H),jt=document.createTreeWalker(H,NodeFilter.SHOW_ELEMENT,{acceptNode(Vs){return a.has(Vs)&&Vs.constructor.formAssociated&&!(ft&&ft.has(Vs))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let Li=jt.nextNode();for(;Li;)C(Li),Li=jt.nextNode()}H.localName==="fieldset"&&((Ht=G.observe)===null||Ht===void 0||Ht.call(G,H,N),V(H,!0))}),F.forEach(H=>{const Ht=a.get(H);Ht&&s.get(Ht)&&Vt(Ht),h.has(H)&&h.get(H).disconnect()})})}function Lt(f){f.forEach(p=>{const{removedNodes:m}=p;m.forEach(_=>{const I=b.get(p.target);a.has(_)&&He(_),I.disconnect()})})}const Bt=f=>{var p,m;const _=new MutationObserver(Lt);!((p=window==null?void 0:window.ShadyDOM)===null||p===void 0)&&p.inUse&&f.mode&&f.host&&(f=f.host),(m=_.observe)===null||m===void 0||m.call(_,f,{childList:!0}),b.set(f,_)};ce()&&new MutationObserver(J);const st={childList:!0,subtree:!0},nt=(f,p,m)=>{f.getAttribute(p)!==m&&f.setAttribute(p,m)},Ft=(f,p)=>{f.toggleAttribute("internals-disabled",p),p?nt(f,"aria-disabled","true"):f.removeAttribute("aria-disabled"),f.formDisabledCallback&&f.formDisabledCallback.apply(f,[p])},Vt=f=>{s.get(f).forEach(p=>{p.remove()}),s.set(f,[])},rt=(f,p)=>{const m=document.createElement("input");return m.type="hidden",m.name=f.getAttribute("name"),f.after(m),s.get(p).push(m),m},L=(f,p)=>{var m;s.set(p,[]),(m=G.observe)===null||m===void 0||m.call(G,f,N)},Tt=(f,p)=>{if(p.length){Array.from(p).forEach(_=>_.addEventListener("click",f.click.bind(f)));let m=p[0].id;p[0].id||(m=`${p[0].htmlFor}_Label`,p[0].id=m),nt(f,"aria-labelledby",m)}},ae=f=>{const p=Array.from(f.elements).filter(F=>!F.tagName.includes("-")&&F.validity).map(F=>F.validity.valid),m=d.get(f)||[],_=Array.from(m).filter(F=>F.isConnected).map(F=>a.get(F).validity.valid),I=[...p,..._].includes(!1);f.toggleAttribute("internals-invalid",I),f.toggleAttribute("internals-valid",!I)},de=f=>{ae(Rt(f.target))},ne=f=>{ae(Rt(f.target))},Fe=f=>{const p=["button[type=submit]","input[type=submit]","button:not([type])"].map(m=>`${m}:not([disabled])`).map(m=>`${m}:not([form])${f.id?`,${m}[form='${f.id}']`:""}`).join(",");f.addEventListener("click",m=>{if(m.target.closest(p)){const _=d.get(f);if(f.noValidate)return;_.size&&Array.from(_).reverse().map(I=>a.get(I).reportValidity()).includes(!1)&&m.preventDefault()}})},ri=f=>{const p=d.get(f.target);p&&p.size&&p.forEach(m=>{m.constructor.formAssociated&&m.formResetCallback&&m.formResetCallback.apply(m)})},pe=(f,p,m)=>{if(p){const _=d.get(p);if(_)_.add(f);else{const I=new Set;I.add(f),d.set(p,I),Fe(p),p.addEventListener("reset",ri),p.addEventListener("input",de),p.addEventListener("change",ne)}r.set(p,{ref:f,internals:m}),f.constructor.formAssociated&&f.formAssociatedCallback&&setTimeout(()=>{f.formAssociatedCallback.apply(f,[p])},0),ae(p)}},Rt=f=>{let p=f.parentNode;return p&&p.tagName!=="FORM"&&(p=Rt(p)),p},dt=(f,p,m=DOMException)=>{if(!f.constructor.formAssociated)throw new m(p)},Ve=(f,p,m)=>{const _=d.get(f);return _&&_.size&&_.forEach(I=>{a.get(I)[m]()||(p=!1)}),p},He=f=>{if(f.constructor.formAssociated){const p=a.get(f),{labels:m,form:_}=p;Tt(f,m),pe(f,_,p)}};function ce(){return typeof MutationObserver<"u"}class Is{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 as=f=>(f.badInput=!1,f.customError=!1,f.patternMismatch=!1,f.rangeOverflow=!1,f.rangeUnderflow=!1,f.stepMismatch=!1,f.tooLong=!1,f.tooShort=!1,f.typeMismatch=!1,f.valid=!0,f.valueMissing=!1,f),Ls=(f,p,m)=>(f.valid=ns(p),Object.keys(p).forEach(_=>f[_]=p[_]),m&&ae(m),f),ns=f=>{let p=!0;for(let m in f)m!=="valid"&&f[m]!==!1&&(p=!1);return p},oi=new WeakMap;function li(f,p){f.toggleAttribute(p,!0),f.part&&f.part.add(p)}class Ii extends Set{static get isPolyfilled(){return!0}constructor(p){if(super(),!p||!p.tagName||p.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");oi.set(this,p)}add(p){if(!/^--/.test(p)||typeof p!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${p} must start with '--'.`);const m=super.add(p),_=oi.get(this),I=`state${p}`;return _.isConnected?li(_,I):setTimeout(()=>{li(_,I)}),m}clear(){for(let[p]of this.entries())this.delete(p);super.clear()}delete(p){const m=super.delete(p),_=oi.get(this);return _.isConnected?(_.toggleAttribute(`state${p}`,!1),_.part&&_.part.remove(`state${p}`)):setTimeout(()=>{_.toggleAttribute(`state${p}`,!1),_.part&&_.part.remove(`state${p}`)}),m}}function rs(f,p,m,_){if(typeof p=="function"?f!==p||!_:!p.has(f))throw new TypeError("Cannot read private member from an object whose class did not declare it");return m==="m"?_:m==="a"?_.call(f):_?_.value:p.get(f)}function Bs(f,p,m,_,I){if(typeof p=="function"?f!==p||!0:!p.has(f))throw new TypeError("Cannot write private member to an object whose class did not declare it");return p.set(f,m),m}var _e;class os{constructor(p){_e.set(this,void 0),Bs(this,_e,p);for(let m=0;m<p.length;m++){let _=p[m];this[m]=_,_.hasAttribute("name")&&(this[_.getAttribute("name")]=_)}Object.freeze(this)}get length(){return rs(this,_e,"f").length}[(_e=new WeakMap,Symbol.iterator)](){return rs(this,_e,"f")[Symbol.iterator]()}item(p){return this[p]==null?null:this[p]}namedItem(p){return this[p]==null?null:this[p]}}function ls(){const f=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=m;const p=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=_;function m(...F){let H=f.apply(this,F);return Ve(this,H,"checkValidity")}function _(...F){let H=p.apply(this,F);return Ve(this,H,"reportValidity")}const{get:I}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...F){const H=I.call(this,...F),Ht=Array.from(d.get(this)||[]);if(Ht.length===0)return H;const ft=Array.from(H).concat(Ht).sort((jt,Li)=>jt.compareDocumentPosition?jt.compareDocumentPosition(Li)&2?1:-1:0);return new os(ft)}})}class vn{static get isPolyfilled(){return!0}constructor(p){if(!p||!p.tagName||p.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const m=p.getRootNode(),_=new Is;this.states=new Ii(p),t.set(this,p),e.set(this,_),a.set(p,this),M(p,this),L(p,this),Object.seal(this),m instanceof DocumentFragment&&Bt(m)}checkValidity(){const p=t.get(this);if(dt(p,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const m=e.get(this);if(!m.valid){const _=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});p.dispatchEvent(_)}return m.valid}get form(){const p=t.get(this);dt(p,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let m;return p.constructor.formAssociated===!0&&(m=Rt(p)),m}get labels(){const p=t.get(this);dt(p,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const m=p.getAttribute("id"),_=p.getRootNode();return _&&m?_.querySelectorAll(`[for="${m}"]`):[]}reportValidity(){const p=t.get(this);if(dt(p,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const m=this.checkValidity(),_=k.get(this);if(_&&!p.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!m&&_&&(p.focus(),_.focus()),m}setFormValue(p){const m=t.get(this);if(dt(m,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),Vt(this),p!=null&&!(p instanceof FormData)){if(m.getAttribute("name")){const _=rt(m,this);_.value=p}}else p!=null&&p instanceof FormData&&Array.from(p).reverse().forEach(([_,I])=>{if(typeof I=="string"){const F=rt(m,this);F.name=_,F.value=I}});c.set(m,p)}setValidity(p,m,_){const I=t.get(this);if(dt(I,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!p)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");k.set(this,_);const F=e.get(this),H={};for(const jt in p)H[jt]=p[jt];Object.keys(H).length===0&&as(F);const Ht=Object.assign(Object.assign({},F),H);delete Ht.valid;const{valid:ft}=Ls(F,Ht,this.form);if(!ft&&!m)throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");n.set(this,ft?"":m),I.isConnected?(I.toggleAttribute("internals-invalid",!ft),I.toggleAttribute("internals-valid",ft),nt(I,"aria-invalid",`${!ft}`)):w.set(I,this)}get shadowRoot(){const p=t.get(this);return g.get(p)||null}get validationMessage(){const p=t.get(this);return dt(p,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),n.get(this)}get validity(){const p=t.get(this);return dt(p,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),e.get(this)}get willValidate(){const p=t.get(this);return dt(p,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(p.disabled||p.hasAttribute("disabled")||p.hasAttribute("readonly"))}}function ad(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class f extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const p=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(p,f);const m=new f;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(_=>_ in m.internals)}let bn=!1,yn=!1;function Fs(f){yn||(yn=!0,window.CustomStateSet=Ii,f&&(HTMLElement.prototype.attachInternals=function(...p){const m=f.call(this,p);return m.states=new Ii(this),m}))}function kn(f=!0){if(!bn){if(bn=!0,typeof window<"u"&&(window.ElementInternals=vn),typeof CustomElementRegistry<"u"){const p=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(m,_,I){if(_.formAssociated){const F=_.prototype.connectedCallback;_.prototype.connectedCallback=function(){y.has(this)||(y.set(this,!0),this.hasAttribute("disabled")&&Ft(this,!0)),F!=null&&F.apply(this),He(this)}}p.call(this,m,_,I)}}if(typeof HTMLElement<"u"&&(HTMLElement.prototype.attachInternals=function(){if(this.tagName){if(this.tagName.indexOf("-")===-1)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.")}else return{};if(a.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new vn(this)}),typeof Element<"u"){let p=function(..._){const I=m.apply(this,_);if(g.set(this,I),ce()){const F=new MutationObserver(J);window.ShadyDOM?F.observe(this,st):F.observe(I,st),h.set(this,F)}return I};const m=Element.prototype.attachShadow;Element.prototype.attachShadow=p}ce()&&typeof document<"u"&&new MutationObserver(J).observe(document.documentElement,st),typeof HTMLFormElement<"u"&&ls(),(f||typeof window<"u"&&!window.CustomStateSet)&&Fs()}}return customElements.polyfillWrapFlushCallback||(ad()?typeof window<"u"&&!window.CustomStateSet&&Fs(HTMLElement.prototype.attachInternals):kn(!1)),i.forceCustomStateSetPolyfill=Fs,i.forceElementInternalsPolyfill=kn,Object.defineProperty(i,"__esModule",{value:!0}),i})({})})()),al}nl();var rl=Object.defineProperty,B=(i,t,e,s)=>{for(var a=void 0,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=r(t,e,a)||a);return a&&rl(t,e,a),a};let D=class extends Y{constructor(){super(),this.defaultValue=null,this.disabled=!1,this.readonly=!1,this.required=!1,this.max=null,this.maxlength=null,this.min=null,this.minlength=null,this.step=null,this.ariaDescribedBy=null,this.ariaLabelledby=null,this.name="",this.pattern=null,this.placeholder=null,this.id=ye(),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=At.props.helptextDropdownButton.default,this.label=null,this.optionalText=bt.forms.labels.optional,this.requiredText=bt.forms.labels.required,this.tagText=null,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(t){var e,s,a,n,r,h,d,c,v,g,k;t&&(this.required&&!this.value?this.internals.setValidity({valueMissing:!0},bt.forms.messages.required,t):(e=t.validity)!=null&&e.typeMismatch||(s=t.validity)!=null&&s.badInput?this.internals.setValidity({typeMismatch:!0},bt.forms.messages.invalid,t):(a=t.validity)!=null&&a.patternMismatch?this.internals.setValidity({patternMismatch:!0},bt.forms.messages.invalidPattern,t):(n=t.validity)!=null&&n.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},bt.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},bt.forms.messages.tooLong,t):(h=t.validity)!=null&&h.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?bt.forms.messages.rangeUnderflowMin.replace("{min}",(d=this.min)==null?void 0:d.toString()):bt.forms.messages.rangeUnderflow,t):(c=t.validity)!=null&&c.stepMismatch?this.internals.setValidity({stepMismatch:!0},bt.forms.messages.invalid,t):(v=t.validity)!=null&&v.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?bt.forms.messages.rangeOverflowMax.replace("{max}",(g=this.max)==null?void 0:g.toString()):bt.forms.messages.rangeOverflow,t):(k=t.validity)!=null&&k.customError?this.internals.setValidity({customError:!0},t.validationMessage,t):this.internals.setValidity({}))}setFormValue(t){if(this.internals)if(Array.isArray(t)){const e=new FormData;t.forEach(s=>{e.append(this.name,s)}),this.internals.setFormValue(e)}else this.internals.setFormValue(t)}valueChecked(t){if(!this.touched)return;const e=this.internals.form||this.closest("form"),s=e?new FormData(e):null;e&&e.querySelectorAll(`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`).forEach(a=>{const n=a;n.name===this.name&&n.value!==this.value&&n.checked&&(n.checked=!1)}),typeof t=="string"?(this.checked=t==="true",this.internals.ariaChecked=t==="true"):typeof t=="boolean"&&(this.checked=t,this.internals.ariaChecked=t),this.checked?(this.internals.setFormValue(this.value||"on",this.value||"on"),s&&s.append(this.name,this.value||"on"),this.internals.states.add("--checked")):(this.internals.setFormValue(null,null),s&&s.delete(this.name),this.internals.states.delete("--checked")),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:this.checked,bubbles:!0,composed:!0})),this.internals.reportValidity()}valueChanged(t,e){(e!==this.value||e!==this._value)&&(typeof t=="string"?((this.multiple||this.range)&&t.includes(",")&&(t=t.split(",")),this.value=t,this._value=Array.isArray(t)?t:[t]):Array.isArray(t)?(this.value=this.multiple||this.range?t:t[0],this._value=t):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&e&&e.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(e==null?void 0:e.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate()))}clearInputValue(){const t=this.multiple||this.range?[]:"";this.value=t,this.internals.setFormValue(t),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0}))}onFocus(){this.dispatchEvent(new FocusEvent("focus",{bubbles:!0,composed:!0}))}onBlur(){this.dispatchEvent(new FocusEvent("blur",{bubbles:!0,composed:!0}))}onInput(){this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}onChange(t){if(!this.touched){this.touched=!0,t&&this.setFormValue(t);return}typeof t!="string"&&!Array.isArray(t)||((this.range||this.multiple)&&!Array.isArray(t)&&t.includes(",")&&(t=t.split(",")),!this.multiple&&!this.range&&Array.isArray(t)&&(t=t[0]),this.setFormValue(t),this.manageValidity(this.inputRef.value),this.inputRefTo&&this.manageValidity(this.inputRefTo.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0})))}formResetCallback(){this.touched=!1,this._options&&this._options.length&&this._options.forEach(t=>{"selected"in t&&(t.selected=!1)}),this.checked!==void 0?(this.checked=!1,this.internals.ariaChecked=!1,this.internals.setFormValue("",""),this.inputRef.value.checked=!1,this.valueChecked(this.checked)):(this.internals.setFormValue(""),this.value=this.defaultValue||(this.multiple||this.range?[]:""),this._value=this.value,this.valueChanged(this.value,null)),this.internals.ariaInvalid=!1}updated(t){super.updated(t),t.has("dataTestid")&&this.dataTestid&&this.inputRef.value&&(this.skipForwardTestid?this.hasAttribute("data-testid")||this.setAttribute("data-testid",this.dataTestid):(this.inputRef.value.dataset.testid=this.dataTestid,this.removeAttribute("data-testid")))}firstUpdated(t){if(super.firstUpdated(t),!this.form){const e=this.internals.form||this.closest("form");this.form=e}if(this.value&&this.defaultValue!==null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked=!0,this.checked=!0),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.ariaDisabled=!0),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const e=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=e,this.internals.setFormValue(e?this.value||"on":"",e?this.value||"on":"")}else this.internals.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute("form",""),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute("form",""),this.manageValidity(this.inputRefTo.value))}};B([o()],D.prototype,"defaultValue"),B([o({type:Boolean,reflect:!0})],D.prototype,"disabled"),B([o({type:Boolean,reflect:!0})],D.prototype,"readonly"),B([o({type:Boolean,reflect:!0})],D.prototype,"required"),B([o({type:Number,reflect:!0})],D.prototype,"max"),B([o({type:Number,reflect:!0})],D.prototype,"maxlength"),B([o({type:Number,reflect:!0})],D.prototype,"min"),B([o({type:Number,reflect:!0})],D.prototype,"minlength"),B([o({type:Number,reflect:!0})],D.prototype,"step"),B([o({type:String})],D.prototype,"ariaDescribedBy"),B([o({type:String})],D.prototype,"ariaLabelledby"),B([o({type:String,reflect:!0})],D.prototype,"name"),B([o({type:String,reflect:!0})],D.prototype,"pattern"),B([o({type:String,reflect:!0})],D.prototype,"placeholder"),B([o({type:String,reflect:!0})],D.prototype,"id"),B([o({type:Boolean})],D.prototype,"counter"),B([o({type:Boolean})],D.prototype,"hasError"),B([o({type:Boolean})],D.prototype,"inline"),B([o({type:Boolean})],D.prototype,"hasFieldset"),B([o({type:Boolean})],D.prototype,"optionalTag"),B([o({type:Boolean})],D.prototype,"requiredTag"),B([o({type:Boolean})],D.prototype,"skipForwardTestid"),B([o({type:Boolean,reflect:!1})],D.prototype,"useWrapper"),B([o({type:Boolean,reflect:!0})],D.prototype,"fullwidth"),B([o({type:Number})],D.prototype,"counterMaxLength"),B([o({type:String})],D.prototype,"errorMessage"),B([o({type:String})],D.prototype,"helptext"),B([o({type:String})],D.prototype,"helptextDropdown"),B([o({type:String,reflect:!1})],D.prototype,"helptextDropdownButton"),B([o({type:String})],D.prototype,"label"),B([o({type:String,reflect:!1})],D.prototype,"optionalText"),B([o({type:String,reflect:!1})],D.prototype,"requiredText"),B([o({type:String,reflect:!1})],D.prototype,"tagText"),B([o({type:String,attribute:"data-testid"})],D.prototype,"dataTestid"),B([U()],D.prototype,"touched");let Ua=class{constructor(t){this.nodes=[],this.options=[],this.host=t,this.host.addController(this),this.nodes=[],this.options=[],this.observer=new MutationObserver(e=>this.handleMutations(e))}hostConnected(){Array.from(this.host.childNodes).forEach(t=>{(t.nodeName==="OPTION"||t.nodeName==="DATA")&&this.addNode(t)}),this.observer.observe(this.host,{childList:!0,subtree:!1,attributes:!0})}hostDisconnected(){this.observer.disconnect()}addNode(t){(t.nodeName==="OPTION"||t.nodeName==="DATA")&&(t.hasAttribute("hidden")&&!t.hasAttribute("data-skip")&&t.setAttribute("data-hidden","true"),!t.hasAttribute("hidden")&&t.hasAttribute("data-skip")&&t.hasAttribute("data-hidden")&&t.removeAttribute("data-hidden"),t.setAttribute("class","pkt-hide"),t.setAttribute("data-skip","true"),t.setAttribute("hidden","true"),this.nodes.push(t))}createOptions(){this.options=this.nodes.map(t=>({value:t.hasAttribute("value")?t.getAttribute("value")??"":t.textContent??"",label:t.textContent||t.getAttribute("value")||"",selected:t.hasAttribute("selected"),disabled:t.hasAttribute("disabled"),hidden:t.hasAttribute("data-hidden")})),this.host.setAttribute("options",JSON.stringify(this.options))}handleMutations(t){let e=!1;t.forEach(s=>{s.type==="childList"&&(s.addedNodes.forEach(a=>{Re(a)&&(this.addNode(a),e=!0)}),s.removedNodes.forEach(a=>{Re(a)&&(this.nodes=this.nodes.filter(n=>n!==a),e=!0)})),s.type==="attributes"&&Re(s.target)&&(this.addNode(s.target),e=!0)}),e&&this.createOptions()}};var ol=Object.defineProperty,ll=Object.getOwnPropertyDescriptor,De=(i,t,e,s)=>{for(var a=s>1?void 0:s?ll(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&ol(t,e,a),a};let oe=class extends Y{constructor(){super(),this.defaultSlot=P(),this.forId=ye(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=At.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new pt(this,this.defaultSlot)}updateSlots(t){this.filledSlots=new Set(t)}render(){const t=()=>{const a=!this.isHelpTextOpen;this.isHelpTextOpen=a,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:a}}))},e=A({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.filledSlots.size>0}),s=()=>this.helptextDropdown?u`<div class="pkt-inputwrapper__helptext-expandable">
|
|
419
419
|
<button
|
|
420
420
|
class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
|
|
421
421
|
type="button"
|
|
@@ -432,16 +432,16 @@
|
|
|
432
432
|
>
|
|
433
433
|
${Gi(this.helptextDropdown)}
|
|
434
434
|
</div>
|
|
435
|
-
</div
|
|
435
|
+
</div>`:$;return u`${u`<div class="${e}">
|
|
436
436
|
<div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
|
|
437
437
|
<div class="pkt-contents" ${O(this.defaultSlot)} name="helptext"></div>
|
|
438
438
|
${this.helptext&&Gi(this.helptext)}
|
|
439
439
|
</div>
|
|
440
440
|
${s()}
|
|
441
|
-
</div>`}`}};De([o({type:String,reflect:!0})],oe.prototype,"forId",2),De([o({type:String})],oe.prototype,"helptext",2),De([o({type:String})],oe.prototype,"helptextDropdown",2),De([o({type:String})],oe.prototype,"helptextDropdownButton",2),De([U()],oe.prototype,"isHelpTextOpen",2),De([U()],oe.prototype,"filledSlots",2),oe=De([
|
|
442
|
-
${this.tagText?u`<span class=${e+" pkt-tag--gray"}>${this.tagText}</span
|
|
443
|
-
${this.optionalTag?u`<span class=${e+" pkt-tag--blue-light"}>${this.optionalText}</span
|
|
444
|
-
${this.requiredTag?u`<span class=${e+" pkt-tag--beige"}>${this.requiredText}</span
|
|
441
|
+
</div>`}`}};De([o({type:String,reflect:!0})],oe.prototype,"forId",2),De([o({type:String})],oe.prototype,"helptext",2),De([o({type:String})],oe.prototype,"helptextDropdown",2),De([o({type:String})],oe.prototype,"helptextDropdownButton",2),De([U()],oe.prototype,"isHelpTextOpen",2),De([U()],oe.prototype,"filledSlots",2),oe=De([j("pkt-helptext")],oe);var hl=Object.defineProperty,dl=Object.getOwnPropertyDescriptor,X=(i,t,e,s)=>{for(var a=s>1?void 0:s?dl(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&hl(t,e,a),a};const pl={fromAttribute(i){return i==null?!1:i===""||i==="true"||i===!0?!0:i==="false"||i===!1?!1:!!i},toAttribute(i){return i?"true":"false"}};let Z=class extends Y{constructor(){super(),this.defaultSlot=P(),this.helptextSlot=P(),this.forId=ye(),this.label="",this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=At.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.counterError=null,this.counterPosition="bottom",this.optionalTag=At.props.optionalTag.default,this.optionalText=At.props.optionalText.default,this.requiredTag=At.props.requiredTag.default,this.requiredText=At.props.requiredText.default,this.tagText=null,this.hasError=At.props.hasError.default,this.errorMessage="",this.disabled=At.props.disabled.default,this.inline=At.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=At.props.hasFieldset.default,this.role="group",this.useWrapper=At.props.useWrapper.default,this.slotController=new pt(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",s=this.ariaDescribedby?this.ariaDescribedby:this.helptext?`${this.forId}-helptext`:$,a=()=>u`
|
|
442
|
+
${this.tagText?u`<span class=${e+" pkt-tag--gray"}>${this.tagText}</span>`:$}
|
|
443
|
+
${this.optionalTag?u`<span class=${e+" pkt-tag--blue-light"}>${this.optionalText}</span>`:$}
|
|
444
|
+
${this.requiredTag?u`<span class=${e+" pkt-tag--beige"}>${this.requiredText}</span>`:$}
|
|
445
445
|
`,n=()=>this.useWrapper?this.hasFieldset?u`<legend
|
|
446
446
|
class="pkt-inputwrapper__legend"
|
|
447
447
|
id="${this.forId}-label"
|
|
@@ -464,19 +464,19 @@
|
|
|
464
464
|
${this.label}
|
|
465
465
|
</label>`,r=()=>u`
|
|
466
466
|
<pkt-helptext
|
|
467
|
-
class="${
|
|
467
|
+
class="${T(this.useWrapper?void 0:"pkt-hide")}"
|
|
468
468
|
.forId=${this.forId}
|
|
469
469
|
.helptext=${this.helptext}
|
|
470
470
|
.helptextDropdown=${this.helptextDropdown}
|
|
471
|
-
.helptextDropdownButton=${this.helptextDropdownButton||
|
|
472
|
-
@toggleHelpText=${
|
|
471
|
+
.helptextDropdownButton=${this.helptextDropdownButton||At.props.helptextDropdownButton.default}
|
|
472
|
+
@toggleHelpText=${g=>{this.toggleDropdown(g)}}
|
|
473
473
|
${O(this.helptextSlot)}
|
|
474
474
|
name="helptext"
|
|
475
475
|
></pkt-helptext>
|
|
476
476
|
`,h=()=>this.counter?u`<div class="pkt-input__counter" aria-live="polite" aria-atomic="true">
|
|
477
|
-
${this.counterError?this.counterError
|
|
478
|
-
${this.counterMaxLength?`/${this.counterMaxLength}
|
|
479
|
-
</div
|
|
477
|
+
${this.counterError?this.counterError:$} ${this.counterCurrent||0}
|
|
478
|
+
${this.counterMaxLength?`/${this.counterMaxLength}`:$}
|
|
479
|
+
</div>`:$,d=()=>this.hasError&&this.errorMessage?u`<pkt-alert
|
|
480
480
|
skin="error"
|
|
481
481
|
compact
|
|
482
482
|
id=${`${this.forId}-error`}
|
|
@@ -484,20 +484,20 @@
|
|
|
484
484
|
aria-atomic="true"
|
|
485
485
|
>
|
|
486
486
|
${Gi(this.errorMessage)}
|
|
487
|
-
</pkt-alert
|
|
487
|
+
</pkt-alert>`:$,c=()=>u`
|
|
488
488
|
${n()}
|
|
489
489
|
${r()}
|
|
490
|
-
${this.counterPosition==="top"?h()
|
|
490
|
+
${this.counterPosition==="top"?h():$}
|
|
491
491
|
<div class="pkt-contents" ${O(this.defaultSlot)}></div>
|
|
492
|
-
${this.counterPosition==="bottom"?h()
|
|
492
|
+
${this.counterPosition==="bottom"?h():$}
|
|
493
493
|
${d()}
|
|
494
494
|
`,v=()=>this.hasFieldset?u`<fieldset class="pkt-inputwrapper__fieldset" aria-describedby="${s}">
|
|
495
495
|
${c()}
|
|
496
|
-
</fieldset>`:u`<div class="pkt-inputwrapper__fieldset">${c()}</div>`;return u`<div class=${A(t)}>${v()}</div> `}toggleDropdown(t){this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!1,detail:{isOpen:t.detail.isOpen}}))}handleLabelClick(t){this.disabled&&(t.preventDefault(),t.stopImmediatePropagation()),this.dispatchEvent(new CustomEvent("labelClick",{bubbles:!0,composed:!0,detail:"label clicked"}))}};X([o({type:String})],Z.prototype,"forId",2),X([o({type:String})],Z.prototype,"label",2),X([o({type:String})],Z.prototype,"helptext",2),X([o({type:String})],Z.prototype,"helptextDropdown",2),X([o({type:String})],Z.prototype,"helptextDropdownButton",2),X([o({type:Boolean})],Z.prototype,"counter",2),X([o({type:Number})],Z.prototype,"counterCurrent",2),X([o({type:Number})],Z.prototype,"counterMaxLength",2),X([o({type:String})],Z.prototype,"counterError",2),X([o({type:String,reflect:!1})],Z.prototype,"counterPosition",2),X([o({type:Boolean})],Z.prototype,"optionalTag",2),X([o({type:String})],Z.prototype,"optionalText",2),X([o({type:Boolean})],Z.prototype,"requiredTag",2),X([o({type:String})],Z.prototype,"requiredText",2),X([o({type:String})],Z.prototype,"tagText",2),X([o({type:Boolean})],Z.prototype,"hasError",2),X([o({type:String})],Z.prototype,"errorMessage",2),X([o({type:Boolean})],Z.prototype,"disabled",2),X([o({type:Boolean})],Z.prototype,"inline",2),X([o({type:String})],Z.prototype,"ariaDescribedby",2),X([o({type:Boolean})],Z.prototype,"hasFieldset",2),X([o({type:String,reflect:!0})],Z.prototype,"role",2),X([o({type:Boolean,reflect:!0,converter:
|
|
496
|
+
</fieldset>`:u`<div class="pkt-inputwrapper__fieldset">${c()}</div>`;return u`<div class=${A(t)}>${v()}</div> `}toggleDropdown(t){this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!1,detail:{isOpen:t.detail.isOpen}}))}handleLabelClick(t){this.disabled&&(t.preventDefault(),t.stopImmediatePropagation()),this.dispatchEvent(new CustomEvent("labelClick",{bubbles:!0,composed:!0,detail:"label clicked"}))}};X([o({type:String})],Z.prototype,"forId",2),X([o({type:String})],Z.prototype,"label",2),X([o({type:String})],Z.prototype,"helptext",2),X([o({type:String})],Z.prototype,"helptextDropdown",2),X([o({type:String})],Z.prototype,"helptextDropdownButton",2),X([o({type:Boolean})],Z.prototype,"counter",2),X([o({type:Number})],Z.prototype,"counterCurrent",2),X([o({type:Number})],Z.prototype,"counterMaxLength",2),X([o({type:String})],Z.prototype,"counterError",2),X([o({type:String,reflect:!1})],Z.prototype,"counterPosition",2),X([o({type:Boolean})],Z.prototype,"optionalTag",2),X([o({type:String})],Z.prototype,"optionalText",2),X([o({type:Boolean})],Z.prototype,"requiredTag",2),X([o({type:String})],Z.prototype,"requiredText",2),X([o({type:String})],Z.prototype,"tagText",2),X([o({type:Boolean})],Z.prototype,"hasError",2),X([o({type:String})],Z.prototype,"errorMessage",2),X([o({type:Boolean})],Z.prototype,"disabled",2),X([o({type:Boolean})],Z.prototype,"inline",2),X([o({type:String})],Z.prototype,"ariaDescribedby",2),X([o({type:Boolean})],Z.prototype,"hasFieldset",2),X([o({type:String,reflect:!0})],Z.prototype,"role",2),X([o({type:Boolean,reflect:!0,converter:pl})],Z.prototype,"useWrapper",2),Z=X([j("pkt-input-wrapper")],Z);var cl=Object.defineProperty,ul=Object.getOwnPropertyDescriptor,mt=(i,t,e,s)=>{for(var a=s>1?void 0:s?ul(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&cl(t,e,a),a};let ut=class extends Y{constructor(){super(...arguments),this.id=ye(),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,s){(t==="options"||t==="searchValue"||t==="search-value")&&this.filterOptions(),super.attributeChangedCallback(t,e,s)}render(){return u`
|
|
497
497
|
<div
|
|
498
498
|
class=${A({"pkt-listbox":!0,"pkt-listbox__open":this.isOpen,"pkt-txt-16-light":!0})}
|
|
499
499
|
role="listbox"
|
|
500
|
-
aria-label=${
|
|
500
|
+
aria-label=${T(this.label)}
|
|
501
501
|
>
|
|
502
502
|
<div class="pkt-listbox__banners">
|
|
503
503
|
${this.renderMaximumReachedBanner()} ${this.renderUserMessage()}
|
|
@@ -518,8 +518,8 @@
|
|
|
518
518
|
aria-labelledby=${this.id+"-option-label-"+e}
|
|
519
519
|
?disabled=${this.disabled||t.disabled||this.maxIsReached&&!t.selected}
|
|
520
520
|
/>
|
|
521
|
-
`:t.selected?u`<pkt-icon name="check-big"></pkt-icon
|
|
522
|
-
${
|
|
521
|
+
`:t.selected?u`<pkt-icon name="check-big"></pkt-icon>`:$}renderList(){return u`
|
|
522
|
+
${Ss(this._filteredOptions,t=>t.value,(t,e)=>u`
|
|
523
523
|
<li
|
|
524
524
|
@click=${()=>{this.toggleOption(t)}}
|
|
525
525
|
aria-selected=${t.selected?"true":"false"}
|
|
@@ -535,12 +535,12 @@
|
|
|
535
535
|
>
|
|
536
536
|
${this.renderCheckboxOrCheckIcon(t,e)}
|
|
537
537
|
<span class="pkt-listbox__option-label" id=${this.id+"-option-label-"+e}>
|
|
538
|
-
${t.prefix?u`<span class="pkt-listbox__option-prefix">${t.prefix}</span
|
|
538
|
+
${t.prefix?u`<span class="pkt-listbox__option-prefix">${t.prefix}</span>`:$}
|
|
539
539
|
${t.label||t.value}
|
|
540
540
|
</span>
|
|
541
541
|
${t.description?u`<span class="pkt-listbox__option-description pkt-txt-14-light"
|
|
542
542
|
>${t.description}</span
|
|
543
|
-
|
|
543
|
+
>`:$}
|
|
544
544
|
</li>
|
|
545
545
|
`)}
|
|
546
546
|
`}renderNewOptionBanner(){return this.allowUserInput&&this.customUserInput?u`
|
|
@@ -556,18 +556,18 @@
|
|
|
556
556
|
<pkt-icon class="pkt-listbox__banner-icon" name="plus-sign" size="large"></pkt-icon>
|
|
557
557
|
Legg til “${this.customUserInput}”
|
|
558
558
|
</div>
|
|
559
|
-
|
|
559
|
+
`:$}renderMaximumReachedBanner(){return this._selectedOptions=this.options.filter(t=>t.selected).length,this.isMultiSelect&&this._selectedOptions>0&&this.maxLength>0?u`
|
|
560
560
|
<div class="pkt-listbox__banner pkt-listbox__banner--maximum-reached">
|
|
561
561
|
${this._selectedOptions} av maks ${this.maxLength} mulige er valgt.
|
|
562
562
|
</div>
|
|
563
|
-
|
|
563
|
+
`:$}renderUserMessage(){return this.userMessage?u`<div class="pkt-listbox__banner pkt-listbox__banner--user-message">
|
|
564
564
|
<pkt-icon
|
|
565
565
|
class="pkt-listbox__banner-icon"
|
|
566
566
|
name="exclamation-mark-circle"
|
|
567
567
|
size="large"
|
|
568
568
|
></pkt-icon>
|
|
569
569
|
${this.userMessage}
|
|
570
|
-
</div
|
|
570
|
+
</div>`:$}renderSearch(){return this.includeSearch?u`
|
|
571
571
|
<div class="pkt-listbox__search">
|
|
572
572
|
<span class="pkt-listbox__search-icon">
|
|
573
573
|
<pkt-icon name="magnifying-glass-small" size="large"></pkt-icon>
|
|
@@ -577,7 +577,7 @@
|
|
|
577
577
|
type="text"
|
|
578
578
|
aria-label="Søk i listen"
|
|
579
579
|
form=""
|
|
580
|
-
placeholder=${this.searchPlaceholder||
|
|
580
|
+
placeholder=${this.searchPlaceholder||bt.forms.search.placeholder}
|
|
581
581
|
@input=${this.handleSearchInput}
|
|
582
582
|
@keydown=${this.handleSearchKeydown}
|
|
583
583
|
.value=${this.searchValue}
|
|
@@ -587,12 +587,12 @@
|
|
|
587
587
|
role="searchbox"
|
|
588
588
|
/>
|
|
589
589
|
</div>
|
|
590
|
-
|
|
590
|
+
`:$}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,s=e.dataset.value,a=e.dataset.type,n=e.dataset.selected==="true";if(!(!this.getOptionElements().length&&(!this.customUserInput||!this.allowUserInput&&this.customUserInput)&&a!=="new-option"&&a!=="searchbox"))switch(t.key){case" ":case"Enter":this.toggleOption(e),t.preventDefault();break;case"Backspace":s&&(n?this.toggleOption(e):this.closeOptions()),t.preventDefault();break;case"Escape":case"Tab":this.closeOptions();break;case"ArrowDown":t.altKey?this.focusLastOption():a==="searchbox"||a==="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 s=this.querySelector('[role="searchbox"]');s&&this.focusAndScrollIntoView(s)}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 s=t instanceof HTMLElement?t.dataset.value:t.value;this.dispatchEvent(new CustomEvent("option-toggle",{detail:s,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(s=>{var a;return(a=s.textContent)==null?void 0:a.trim().toLowerCase().startsWith(this.typeAheadString)});e&&this.focusAndScrollIntoView(e)}getOptionElements(){return this._filteredOptions.length?Array.from(this.querySelectorAll('[role="option"]:not([data-disabled])')||[]):[]}};mt([o({type:String})],ut.prototype,"id",2),mt([o({type:String})],ut.prototype,"label",2),mt([o({type:Array})],ut.prototype,"options",2),mt([o({type:Boolean,reflect:!0})],ut.prototype,"isOpen",2),mt([o({type:Boolean})],ut.prototype,"disabled",2),mt([o({type:Boolean})],ut.prototype,"includeSearch",2),mt([o({type:Boolean})],ut.prototype,"isMultiSelect",2),mt([o({type:Boolean})],ut.prototype,"allowUserInput",2),mt([o({type:Boolean})],ut.prototype,"maxIsReached",2),mt([o({type:String})],ut.prototype,"customUserInput",2),mt([o({type:String})],ut.prototype,"searchPlaceholder",2),mt([o({type:String})],ut.prototype,"searchValue",2),mt([o({type:Number})],ut.prototype,"maxLength",2),mt([o({type:String})],ut.prototype,"userMessage",2),mt([U()],ut.prototype,"_filteredOptions",2),ut=mt([j("pkt-listbox")],ut);const fl={displayValueAs:{default:"label"}},gl={props:fl};var ml=Object.defineProperty,vl=Object.getOwnPropertyDescriptor,tt=(i,t,e,s)=>{for(var a=s>1?void 0:s?vl(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&ml(t,e,a),a};let Q=class extends D{constructor(){super(),this.helptextSlot=P(),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=gl.props.displayValueAs.default,this.tagPlacement=null,this._options=[],this._isOptionsOpen=!1,this._value=[],this._userInfoMessage="",this._addValueText=null,this._maxIsReached=!1,this._search="",this._inputFocus=!1,this._editingSingleValue=!1,this.inputRef=P(),this.arrowRef=P(),this.listboxRef=P(),this.focusRef=P(),this.optionTagRef=P(),this.optionsController=new Ua(this),this.slotController=new pt(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){var t;if(super.connectedCallback(),document&&document.body.addEventListener("click",e=>{this._isOptionsOpen&&!this.contains(e.target)&&this.handleFocusOut(e)}),this._options=[],this.defaultOptions&&this.defaultOptions.length){const e=((t=this.options)==null?void 0:t.filter(s=>s.userAdded))||[];this.options=[...e,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(this.optionsController.nodes.length){const e=[];this.optionsController.nodes.forEach(s=>{if(!s.textContent&&!s.getAttribute("value"))return null;const a={value:s.getAttribute("value")||s.textContent||"",label:s.textContent||s.getAttribute("value")||""};s.getAttribute("data-prefix")&&(a.prefix=s.getAttribute("data-prefix")||void 0),s.getAttribute("tagskincolor")&&(a.tagSkinColor=s.getAttribute("tagskincolor")),s.getAttribute("description")&&(a.description=s.getAttribute("description")||void 0),a.fulltext=a.value+a.label+(a.prefix||""),e.push(a)}),e.length&&(this.options=[...e],this._options=[...e])}}updated(t){if(t.has("_value")&&this.valueChanged(this._value,t.get("_value")),t.has("value")&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]]),this.isMaxItemsReached()),t.has("defaultOptions")&&this.defaultOptions.length){const e=(Array.isArray(this.options)?this.options:[]).filter(s=>s.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(a=>a&&a.userAdded).filter(a=>!(Array.isArray(this.options)?this.options:[]).some(n=>n.value===a.value)),s=[...e,...this.options];this._options=s,e.length>0&&(this.options=s),this._options.forEach(a=>{if(a.value&&!a.label&&(a.label=a.value),a.selected&&!this._value.includes(a.value)){const n=[...this._value];this._value=[...this._value,a.value],this.valueChanged(this._value,n)}a.fulltext=a.value+a.label+(a.prefix||""),a.selected=a.selected||this._value.includes(a.value)})}t.has("_search")&&this.dispatchEvent(new CustomEvent("search",{detail:this._search,bubbles:!1})),super.updated(t)}attributeChangedCallback(t,e,s){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(a=>{a.value&&!a.label&&(a.label=a.value),a.selected&&!this._value.includes(a.value)&&(this._value=[...this._value,a.value]),a.fulltext=a.value+a.label+(a.prefix||"")}),this._search=""),super.attributeChangedCallback(t,e,s)}render(){return u`
|
|
591
591
|
<pkt-input-wrapper
|
|
592
592
|
.label=${this.label}
|
|
593
593
|
.helptext=${this.helptext}
|
|
594
|
-
.helptextDropdown=${
|
|
595
|
-
.helptextDropdownButton=${
|
|
594
|
+
.helptextDropdown=${T(this.helptextDropdown)}
|
|
595
|
+
.helptextDropdownButton=${T(this.helptextDropdownButton)}
|
|
596
596
|
?fullwidth=${this.fullwidth}
|
|
597
597
|
?hasError=${this.hasError}
|
|
598
598
|
?inline=${this.inline}
|
|
@@ -617,7 +617,7 @@
|
|
|
617
617
|
>
|
|
618
618
|
${this.placeholder&&(!this._value.length||this.multiple&&this.tagPlacement=="outside")&&!this._inputFocus?u`<span class="pkt-combobox__placeholder" @click=${this.handlePlaceholderClick}
|
|
619
619
|
>${this.placeholder}</span
|
|
620
|
-
>`:this.tagPlacement!=="outside"?this.renderSingleOrMultipleValues()
|
|
620
|
+
>`:this.tagPlacement!=="outside"?this.renderSingleOrMultipleValues():$}
|
|
621
621
|
${this.renderInputField()}
|
|
622
622
|
<div
|
|
623
623
|
class="pkt-btn pkt-btn--tertiary pkt-combobox__arrow"
|
|
@@ -657,7 +657,7 @@
|
|
|
657
657
|
?isMultiSelect=${this.multiple}
|
|
658
658
|
?allowUserInput=${this.allowUserInput&&!this._maxIsReached}
|
|
659
659
|
?maxIsReached=${this._maxIsReached}
|
|
660
|
-
.customUserInput=${
|
|
660
|
+
.customUserInput=${T(this._addValueText)}
|
|
661
661
|
.userMessage=${this._userInfoMessage}
|
|
662
662
|
@search=${this.handleSearch}
|
|
663
663
|
@option-toggle=${this.handleOptionToggled}
|
|
@@ -671,7 +671,7 @@
|
|
|
671
671
|
|
|
672
672
|
${this.tagPlacement==="outside"&&this.multiple?u`<div class="pkt-combobox__tags-outside">
|
|
673
673
|
${this.renderSingleOrMultipleValues()}
|
|
674
|
-
</div
|
|
674
|
+
</div>`:$}
|
|
675
675
|
</pkt-input-wrapper>
|
|
676
676
|
`}renderInputField(){return this.typeahead||this.allowUserInput?u`
|
|
677
677
|
<div class="pkt-combobox__input-div combobox__input">
|
|
@@ -685,11 +685,11 @@
|
|
|
685
685
|
@blur=${this.handleBlur}
|
|
686
686
|
autocomplete="off"
|
|
687
687
|
role="combobox"
|
|
688
|
-
aria-label=${
|
|
688
|
+
aria-label=${T(this.label)}
|
|
689
689
|
aria-autocomplete=${this.typeahead?"both":"list"}
|
|
690
690
|
aria-controls="${this.id}-listbox"
|
|
691
|
-
aria-multiselectable=${
|
|
692
|
-
aria-activedescendant=${
|
|
691
|
+
aria-multiselectable=${T(this.multiple?"true":void 0)}
|
|
692
|
+
aria-activedescendant=${T(this._value[0]&&this.findValueInOptions(this._value[0])?`${this.id}-listbox-${this.findIndexInOptions(this._value[0])}`:void 0)}
|
|
693
693
|
${O(this.inputRef)}
|
|
694
694
|
/>
|
|
695
695
|
</div>
|
|
@@ -701,7 +701,7 @@
|
|
|
701
701
|
.value=${this._value.join(",")}
|
|
702
702
|
${O(this.inputRef)}
|
|
703
703
|
/>
|
|
704
|
-
`}renderSingleOrMultipleValues(){const t=!this.multiple,e=this._editingSingleValue?null:this.renderValueTag(this.findValueInOptions(this._value[0])),s=
|
|
704
|
+
`}renderSingleOrMultipleValues(){const t=!this.multiple,e=this._editingSingleValue?null:this.renderValueTag(this.findValueInOptions(this._value[0])),s=Ss(this._value,a=>a,a=>{var n;const r=this.findValueInOptions(a),h=(n=this.options.find(d=>d.value===a))==null?void 0:n.tagSkinColor;return u`
|
|
705
705
|
<pkt-tag
|
|
706
706
|
skin=${h||"blue-dark"}
|
|
707
707
|
?closeTag=${!this.disabled}
|
|
@@ -715,7 +715,7 @@
|
|
|
715
715
|
>${t.value}</span
|
|
716
716
|
>`;case"label":default:return u`<span class="pkt-combobox__value" data-focusfix=${this.id}
|
|
717
717
|
>${t.label||t.value}</span
|
|
718
|
-
>`}}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(s=>{var a;return(a=s.fulltext)==null?void 0:a.toLowerCase().includes(this._search.toLowerCase())}),t.inputType!=="deleteContentBackward"){const s=this._options.filter(a=>{var n;return!a.selected&&((n=a.label)==null?void 0:n.toLowerCase().startsWith(this._search.toLowerCase()))});if(s.length>0&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const a=s[0];a!=null&&a.label&&(e.value=a.label,window.setTimeout(()=>e.setSelectionRange(this._search.length,e.value.length),0),e.selectionDirection="backward")}}}else this._options=[...this.options]}handleFocus(){if(!this.disabled){if(!this.multiple&&this._value[0]&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const t=this.findValueInOptions(this._value[0]);this._editingSingleValue=!0,this.inputRef.value.value=this.displayValueAs==="label"&&t!=null&&t.label?t.label:this._value[0]}this._inputFocus=!0,this._search="",this._options=[...this.options],this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()}}handleFocusOut(t){var e,s,a,n,r;if(!this.disabled&&((s=(e=t.relatedTarget)==null?void 0:e.closest("pkt-combobox"))==null?void 0:s.id)!==this.id&&((n=(a=t.relatedTarget)==null?void 0:a.closest("pkt-combobox"))==null?void 0:n.id)!==this.id&&((r=t.target)==null?void 0:r.getAttribute("data-focusfix"))!==this.id&&t.relatedTarget!==this.focusRef.value&&t.relatedTarget!==this.inputRef.value&&t.relatedTarget!==this.arrowRef.value&&this._isOptionsOpen){if(this._inputFocus=!1,this._addValueText=null,this._userInfoMessage="",this._search="",this.inputRef.value&&this.inputRef.value.type!=="hidden"&&this.inputRef.value.value!==""){const h=this.inputRef.value.value,d=this.findValueInOptions(h);!this._value.includes(h)&&!d?this.allowUserInput?this.addNewUserValue(h):this.multiple||this.removeValue(this._value[0]):d&&!this._value.includes(d.value)&&this.setSelected(d.value),this.inputRef.value.value=""}this._isOptionsOpen=!1,this.onBlur()}}handleBlur(){this._inputFocus=!1,this._editingSingleValue=!1,this.onBlur()}handleInputClick(t){var e,s;this.disabled||(t.currentTarget&&t.currentTarget!==this.arrowRef.value&&((e=this.inputRef.value)==null?void 0:e.type)!=="hidden"?((s=this.inputRef.value)==null||s.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,s;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():(s=this.arrowRef.value)==null||s.focus())}handleOptionToggled(t){this.toggleValue(t.detail)}handleSearch(t){t.stopPropagation(),this._search=t.detail.toLowerCase()}handleInputKeydown(t){var e,s,a;switch(t.key){case",":this.multiple&&(t.preventDefault(),this.addValue());break;case"Enter":t.preventDefault(),this.addValue();break;case"Backspace":!this._search&&((e=this.inputRef.value)==null?void 0:e.type)==="hidden"&&this.removeLastValue(t);break;case"Tab":case"ArrowDown":t.shiftKey||((s=this.listboxRef.value)==null||s.focusFirstOrSelectedOption(),t.preventDefault());break;case"Escape":this._isOptionsOpen=!1,(a=this.arrowRef.value)==null||a.focus(),t.preventDefault();break}}handleTagRemove(t){this.removeSelected(t)}blurInput(){this.inputRef.value&&this.inputRef.value.matches(":focus")&&this.inputRef.value.blur()}checkForMatches(){var t;const e=((t=this.inputRef.value)==null?void 0:t.value)||this._search||"",s=e.trim().toLowerCase()||"";if(!s){!this.multiple&&this._value[0]&&this.removeValue(this._value[0]),this.resetComboboxInput(!1);return}const a=this._value.find(h=>h.toLowerCase()===s),n=this._options.filter(h=>{var d;return((d=h.label)==null?void 0:d.toLowerCase().includes(s))??!1}),r=n.find(h=>{var d;return((d=h.label)==null?void 0:d.toLowerCase())===s||h.value.toLowerCase()===s});switch(!0){case((n.length===0||!r)&&this.allowUserInput):this._addValueText=e,this._userInfoMessage="";break;case(n.length===0&&!this._options.length&&!this.allowUserInput):this._addValueText=null,this._userInfoMessage="Ingen match i søket";break;case!!a:this._addValueText=null,this._userInfoMessage="Verdien er allerede valgt";break;case n.length>1:this._addValueText=null,this._userInfoMessage="";break;default:this._addValueText=null,this._userInfoMessage=""}}findValueInOptions(t){return this.options.find(e=>e.value===t||e.label===t)||null}findIndexInOptions(t){return this._options.findIndex(e=>e.value===t||e.label===t)}isMaxItemsReached(){const t=this.maxlength!==null&&this._value.length>=this.maxlength;return t?this._maxIsReached=!0:this._maxIsReached=!1,t}toggleValue(t){var e,s;if(this.disabled)return;this.touched=!0,this._userInfoMessage="",this._addValueText=null;const a=((e=this.findValueInOptions(t))==null?void 0:e.value)||null,n=this._value.includes(t||a||""),r=!!a,h=((s=this._options.find(M=>M.value===t))==null?void 0:s.disabled)||!1,d=!(t!=null&&t.trim()),c=!this.multiple,v=this.multiple,m=this.isMaxItemsReached();let b=!1,y=!0,_="",x="";h||(!r&&this.allowUserInput&&!d?(this.addNewUserValue(t),_="Ny verdi lagt til",b=!v):!r&&!this.allowUserInput?(c&&this._value[0]&&this.removeValue(this._value[0]),y=!1,b=!0,_="Ingen treff i søket"):n?(this.removeValue(a),b=!0):d&&c?(this.removeAllSelected(),b=!0):c?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(a),b=!1,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="",this.inputRef.value.blur())):v&&!m?(this.setSelected(a),b=!0):v&&m?(this._userInfoMessage="Maks antall valg nådd",y=!1,x=t):(c&&this.removeAllSelected(),this._userInfoMessage="Ingen gyldig verdi valgt",y=!1,b=!0,x=t),this._isOptionsOpen=b,b||window.setTimeout(()=>{var M;(M=this.focusRef.value)==null||M.focus()},0),this._userInfoMessage=_,this._search=x||"",this.resetComboboxInput(y),v&&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(s=>s!==t);const e=this.findValueInOptions(t);e?(e.selected=!1,e.userAdded?(this._options=[...this._options.filter(s=>s.value!==t)],this.options=[...this.options.filter(s=>s.value!==t)]):this._options=[...this._options,e]):!t&&!this.multiple&&(this._options=this._options.map(s=>(s.selected=!1,s)))}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()}};tt([o({type:String,reflect:!0})],Q.prototype,"value",2),tt([o({type:Array})],Q.prototype,"options",2),tt([o({type:Array})],Q.prototype,"defaultOptions",2),tt([o({type:Boolean})],Q.prototype,"allowUserInput",2),tt([o({type:Boolean})],Q.prototype,"typeahead",2),tt([o({type:Boolean})],Q.prototype,"includeSearch",2),tt([o({type:String})],Q.prototype,"searchPlaceholder",2),tt([o({type:Boolean})],Q.prototype,"multiple",2),tt([o({type:Number})],Q.prototype,"maxlength",2),tt([o({type:String})],Q.prototype,"displayValueAs",2),tt([o({type:String})],Q.prototype,"tagPlacement",2),tt([U()],Q.prototype,"_options",2),tt([U()],Q.prototype,"_isOptionsOpen",2),tt([U()],Q.prototype,"_value",2),tt([U()],Q.prototype,"_userInfoMessage",2),tt([U()],Q.prototype,"_addValueText",2),tt([U()],Q.prototype,"_maxIsReached",2),tt([U()],Q.prototype,"_search",2),tt([U()],Q.prototype,"_inputFocus",2),tt([U()],Q.prototype,"_editingSingleValue",2),Q=tt([H("pkt-combobox")],Q);const ml={i18n:{nb:{contentPresentation:{title:"Oslo kommune bruker informasjonskapsler",description:["For at nettstedet skal fungere og være trygt, bruker Oslo kommune informasjonskapsler. Noen er teknisk nødvendige, mens andre sikrer ulik funksjonalitet.","Godtar du alle informasjonskapsler, tillater du også at vi samler inn data om statistikk og brukeradferd. Da hjelper du oss med å lage et bedre nettsted uten at du trenger å dele noe personlig informasjon med oss."],buttons:{accept:"Godta alle",reject:"Kun nødvendige",settings:"Innstillinger for informasjonskapsler"}},contentSettings:{title:"Innstillinger for informasjonskapsler",description:["Her kan du velge hvilke typer informasjonskapsler du vil tillate. Tillatelsen gjelder i 90 dager. Husk at nødvendige informasjonskapsler ikke kan velges bort.","Du kan når som helst endre innstillingene og finne mer informasjon nederst på nettstedet under «Innstillinger for informasjonskapsler» og «Personvern og informasjonskapsler»."],buttons:{back:"Tilbake",save:"Lagre innstillinger"}}},en:{contentPresentation:{title:"Before you visit Oslo kommune ...",description:["This website uses cookies to make improvements. In this context, we need your consent to measure the traffic on the website in relation to statistics and feedback.","To read more about what we use cookies for, go to our privacy declaration which you will find at the bottom of our websites."],buttons:{accept:"Yes, I accept",reject:"Only necessary",settings:"Go to settings"}},contentSettings:{title:"Her kan du aktivt velge mellom ulike informasjonskapsler",description:["For å lese mer om hva vi bruker informasjonskapsler til gå til vår personvernserklering som du finner på våre nettsider"],buttons:{back:"Back",save:"Save settings"}}}}};var vl=Object.defineProperty,yl=Object.getOwnPropertyDescriptor,ee=(i,t,e,s)=>{for(var a=s>1?void 0:s?yl(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&vl(t,e,a),a};let Ts=null;function bl(){return Ts||(Ts=new Promise((i,t)=>{if(document.querySelector("#oslo-consent-script")){i();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=()=>i(),e.onerror=t,document.head.appendChild(e);const s=document.createElement("link");s.href="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.css",s.type="text/css",s.rel="stylesheet",s.id="oslo-consent-styles",document.head.appendChild(s)}),Ts)}let zt=class extends Y{constructor(){super(),this.devMode=!1,this.hotjarId=null,this.googleAnalyticsId=null,this.cookieDomain=null,this.cookieSecure=null,this.cookieExpiryDays=null,this.triggerType="button",this.triggerText=null,this.i18nLanguage="nb"}connectedCallback(){super.connectedCallback(),this.triggerText=this.triggerText||ml.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((s,a)=>(s[a.name]=a.consent,s),{});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 bl(),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=s=>{this.emitCookieConsents(s)},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}>
|
|
718
|
+
>`}}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(s=>{var a;return(a=s.fulltext)==null?void 0:a.toLowerCase().includes(this._search.toLowerCase())}),t.inputType!=="deleteContentBackward"){const s=this._options.filter(a=>{var n;return!a.selected&&((n=a.label)==null?void 0:n.toLowerCase().startsWith(this._search.toLowerCase()))});if(s.length>0&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const a=s[0];a!=null&&a.label&&(e.value=a.label,window.setTimeout(()=>e.setSelectionRange(this._search.length,e.value.length),0),e.selectionDirection="backward")}}}else this._options=[...this.options]}handleFocus(){if(!this.disabled){if(!this.multiple&&this._value[0]&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const t=this.findValueInOptions(this._value[0]);this._editingSingleValue=!0,this.inputRef.value.value=this.displayValueAs==="label"&&t!=null&&t.label?t.label:this._value[0]}this._inputFocus=!0,this._search="",this._options=[...this.options],this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()}}handleFocusOut(t){var e,s,a,n,r;if(!this.disabled&&((s=(e=t.relatedTarget)==null?void 0:e.closest("pkt-combobox"))==null?void 0:s.id)!==this.id&&((n=(a=t.relatedTarget)==null?void 0:a.closest("pkt-combobox"))==null?void 0:n.id)!==this.id&&((r=t.target)==null?void 0:r.getAttribute("data-focusfix"))!==this.id&&t.relatedTarget!==this.focusRef.value&&t.relatedTarget!==this.inputRef.value&&t.relatedTarget!==this.arrowRef.value&&this._isOptionsOpen){if(this._inputFocus=!1,this._addValueText=null,this._userInfoMessage="",this._search="",this.inputRef.value&&this.inputRef.value.type!=="hidden"&&this.inputRef.value.value!==""){const h=this.inputRef.value.value,d=this.findValueInOptions(h);!this._value.includes(h)&&!d?this.allowUserInput?this.addNewUserValue(h):this.multiple||this.removeValue(this._value[0]):d&&!this._value.includes(d.value)&&this.setSelected(d.value),this.inputRef.value.value=""}this._isOptionsOpen=!1,this.onBlur()}}handleBlur(){this._inputFocus=!1,this._editingSingleValue=!1,this.onBlur()}handleInputClick(t){var e,s;this.disabled||(t.currentTarget&&t.currentTarget!==this.arrowRef.value&&((e=this.inputRef.value)==null?void 0:e.type)!=="hidden"?((s=this.inputRef.value)==null||s.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,s;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():(s=this.arrowRef.value)==null||s.focus())}handleOptionToggled(t){this.toggleValue(t.detail)}handleSearch(t){t.stopPropagation(),this._search=t.detail.toLowerCase()}handleInputKeydown(t){var e,s,a;switch(t.key){case",":this.multiple&&(t.preventDefault(),this.addValue());break;case"Enter":t.preventDefault(),this.addValue();break;case"Backspace":!this._search&&((e=this.inputRef.value)==null?void 0:e.type)==="hidden"&&this.removeLastValue(t);break;case"Tab":case"ArrowDown":t.shiftKey||((s=this.listboxRef.value)==null||s.focusFirstOrSelectedOption(),t.preventDefault());break;case"Escape":this._isOptionsOpen=!1,(a=this.arrowRef.value)==null||a.focus(),t.preventDefault();break}}handleTagRemove(t){this.removeSelected(t)}blurInput(){this.inputRef.value&&this.inputRef.value.matches(":focus")&&this.inputRef.value.blur()}checkForMatches(){var t;const e=((t=this.inputRef.value)==null?void 0:t.value)||this._search||"",s=e.trim().toLowerCase()||"";if(!s){!this.multiple&&this._value[0]&&this.removeValue(this._value[0]),this.resetComboboxInput(!1);return}const a=this._value.find(h=>h.toLowerCase()===s),n=this._options.filter(h=>{var d;return((d=h.label)==null?void 0:d.toLowerCase().includes(s))??!1}),r=n.find(h=>{var d;return((d=h.label)==null?void 0:d.toLowerCase())===s||h.value.toLowerCase()===s});switch(!0){case((n.length===0||!r)&&this.allowUserInput):this._addValueText=e,this._userInfoMessage="";break;case(n.length===0&&!this._options.length&&!this.allowUserInput):this._addValueText=null,this._userInfoMessage="Ingen match i søket";break;case!!a:this._addValueText=null,this._userInfoMessage="Verdien er allerede valgt";break;case n.length>1:this._addValueText=null,this._userInfoMessage="";break;default:this._addValueText=null,this._userInfoMessage=""}}findValueInOptions(t){return this.options.find(e=>e.value===t||e.label===t)||null}findIndexInOptions(t){return this._options.findIndex(e=>e.value===t||e.label===t)}isMaxItemsReached(){const t=this.maxlength!==null&&this._value.length>=this.maxlength;return t?this._maxIsReached=!0:this._maxIsReached=!1,t}toggleValue(t){var e,s;if(this.disabled)return;this.touched=!0,this._userInfoMessage="",this._addValueText=null;const a=((e=this.findValueInOptions(t))==null?void 0:e.value)||null,n=this._value.includes(t||a||""),r=!!a,h=((s=this._options.find(S=>S.value===t))==null?void 0:s.disabled)||!1,d=!(t!=null&&t.trim()),c=!this.multiple,v=this.multiple,g=this.isMaxItemsReached();let k=!1,b=!0,y="",w="";h||(!r&&this.allowUserInput&&!d?(this.addNewUserValue(t),y="Ny verdi lagt til",k=!v):!r&&!this.allowUserInput?(c&&this._value[0]&&this.removeValue(this._value[0]),b=!1,k=!0,y="Ingen treff i søket"):n?(this.removeValue(a),k=!0):d&&c?(this.removeAllSelected(),k=!0):c?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(a),k=!1,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="",this.inputRef.value.blur())):v&&!g?(this.setSelected(a),k=!0):v&&g?(this._userInfoMessage="Maks antall valg nådd",b=!1,w=t):(c&&this.removeAllSelected(),this._userInfoMessage="Ingen gyldig verdi valgt",b=!1,k=!0,w=t),this._isOptionsOpen=k,k||window.setTimeout(()=>{var S;(S=this.focusRef.value)==null||S.focus()},0),this._userInfoMessage=y,this._search=w||"",this.resetComboboxInput(b),v&&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(s=>s!==t);const e=this.findValueInOptions(t);e?(e.selected=!1,e.userAdded?(this._options=[...this._options.filter(s=>s.value!==t)],this.options=[...this.options.filter(s=>s.value!==t)]):this._options=[...this._options,e]):!t&&!this.multiple&&(this._options=this._options.map(s=>(s.selected=!1,s)))}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()}};tt([o({type:String,reflect:!0})],Q.prototype,"value",2),tt([o({type:Array})],Q.prototype,"options",2),tt([o({type:Array})],Q.prototype,"defaultOptions",2),tt([o({type:Boolean})],Q.prototype,"allowUserInput",2),tt([o({type:Boolean})],Q.prototype,"typeahead",2),tt([o({type:Boolean})],Q.prototype,"includeSearch",2),tt([o({type:String})],Q.prototype,"searchPlaceholder",2),tt([o({type:Boolean})],Q.prototype,"multiple",2),tt([o({type:Number})],Q.prototype,"maxlength",2),tt([o({type:String})],Q.prototype,"displayValueAs",2),tt([o({type:String})],Q.prototype,"tagPlacement",2),tt([U()],Q.prototype,"_options",2),tt([U()],Q.prototype,"_isOptionsOpen",2),tt([U()],Q.prototype,"_value",2),tt([U()],Q.prototype,"_userInfoMessage",2),tt([U()],Q.prototype,"_addValueText",2),tt([U()],Q.prototype,"_maxIsReached",2),tt([U()],Q.prototype,"_search",2),tt([U()],Q.prototype,"_inputFocus",2),tt([U()],Q.prototype,"_editingSingleValue",2),Q=tt([j("pkt-combobox")],Q);const bl={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 yl=Object.defineProperty,kl=Object.getOwnPropertyDescriptor,ee=(i,t,e,s)=>{for(var a=s>1?void 0:s?kl(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&yl(t,e,a),a};let Cs=null;function $l(){return Cs||(Cs=new Promise((i,t)=>{if(document.querySelector("#oslo-consent-script")){i();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=()=>i(),e.onerror=t,document.head.appendChild(e);const s=document.createElement("link");s.href="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.css",s.type="text/css",s.rel="stylesheet",s.id="oslo-consent-styles",document.head.appendChild(s)}),Cs)}let zt=class extends Y{constructor(){super(),this.devMode=!1,this.hotjarId=null,this.googleAnalyticsId=null,this.cookieDomain=null,this.cookieSecure=null,this.cookieExpiryDays=null,this.triggerType="button",this.triggerText=null,this.i18nLanguage="nb"}connectedCallback(){super.connectedCallback(),this.triggerText=this.triggerText||bl.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((s,a)=>(s[a.name]=a.consent,s),{});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 $l(),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=s=>{this.emitCookieConsents(s)},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}>
|
|
719
719
|
<pkt-icon name="chevron-right" class="pkt-footer__link-icon"></pkt-icon>
|
|
720
720
|
${this.triggerText}
|
|
721
721
|
</a>`:this.triggerType==="icon"?u`<pkt-button
|
|
@@ -725,19 +725,19 @@
|
|
|
725
725
|
@click=${this.openModal}
|
|
726
726
|
>
|
|
727
727
|
>${this.triggerText}</pkt-button
|
|
728
|
-
>`:u`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`}};ee([o({type:Boolean})],zt.prototype,"devMode",2),ee([o({type:String})],zt.prototype,"hotjarId",2),ee([o({type:String})],zt.prototype,"googleAnalyticsId",2),ee([o({type:String})],zt.prototype,"cookieDomain",2),ee([o({type:String})],zt.prototype,"cookieSecure",2),ee([o({type:String})],zt.prototype,"cookieExpiryDays",2),ee([o({type:String})],zt.prototype,"triggerType",2),ee([o({type:String})],zt.prototype,"triggerText",2),ee([o({type:String})],zt.prototype,"i18nLanguage",2),zt=ee([
|
|
729
|
-
${this.tagText?u`<span class=${a+" pkt-tag--gray"}>${this.tagText}</span
|
|
730
|
-
${this.optionalTag?u`<span class=${a+" pkt-tag--blue-light"}>${this.optionalText}</span
|
|
731
|
-
${this.requiredTag?u`<span class=${a+" pkt-tag--beige"}>${this.requiredText}</span
|
|
728
|
+
>`:u`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`}};ee([o({type:Boolean})],zt.prototype,"devMode",2),ee([o({type:String})],zt.prototype,"hotjarId",2),ee([o({type:String})],zt.prototype,"googleAnalyticsId",2),ee([o({type:String})],zt.prototype,"cookieDomain",2),ee([o({type:String})],zt.prototype,"cookieSecure",2),ee([o({type:String})],zt.prototype,"cookieExpiryDays",2),ee([o({type:String})],zt.prototype,"triggerType",2),ee([o({type:String})],zt.prototype,"triggerText",2),ee([o({type:String})],zt.prototype,"i18nLanguage",2),zt=ee([j("pkt-consent")],zt);var _l=Object.defineProperty,wl=Object.getOwnPropertyDescriptor,kt=(i,t,e,s)=>{for(var a=s>1?void 0:s?wl(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&_l(t,e,a),a};let vt=class extends D{constructor(){super(...arguments),this.inputRef=P(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.isSwitch=!1,this.labelPosition="right",this.hideLabel=!1,this.checked=null,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,s){t==="defaultChecked"&&!this.checked&&(this.checked=this.defaultChecked),t==="checked"&&(this.checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(t,e,s)}firstUpdated(t){t.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),super.firstUpdated(t)}updated(t){t.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),super.updated(t)}render(){const t=A({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),e=A({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),s=A({"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}),a="pkt-tag pkt-tag--small pkt-tag--thin-text",n=()=>u`
|
|
729
|
+
${this.tagText?u`<span class=${a+" pkt-tag--gray"}>${this.tagText}</span>`:$}
|
|
730
|
+
${this.optionalTag?u`<span class=${a+" pkt-tag--blue-light"}>${this.optionalText}</span>`:$}
|
|
731
|
+
${this.requiredTag?u`<span class=${a+" pkt-tag--beige"}>${this.requiredText}</span>`:$}
|
|
732
732
|
`,r=()=>u`
|
|
733
733
|
<label class=${s} for=${this.id+"-internal"}>
|
|
734
734
|
${this.label} ${n()}
|
|
735
|
-
${this.checkHelptext?u`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div
|
|
735
|
+
${this.checkHelptext?u`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:$}
|
|
736
736
|
</label>
|
|
737
737
|
`;return u`
|
|
738
738
|
<div class="pkt-input-check">
|
|
739
739
|
<div class=${t}>
|
|
740
|
-
${this.labelPosition==="left"?r()
|
|
740
|
+
${this.labelPosition==="left"?r():$}
|
|
741
741
|
<input
|
|
742
742
|
id=${this.id+"-internal"}
|
|
743
743
|
class=${e}
|
|
@@ -752,21 +752,21 @@
|
|
|
752
752
|
?checked=${this.checked}
|
|
753
753
|
role=${this.isSwitch?"switch":"checkbox"}
|
|
754
754
|
/>
|
|
755
|
-
${this.labelPosition==="right"?r()
|
|
755
|
+
${this.labelPosition==="right"?r():$}
|
|
756
756
|
</div>
|
|
757
757
|
</div>
|
|
758
|
-
`}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))}};kt([o({type:String,reflect:!0})],vt.prototype,"value",2),kt([o({type:String})],vt.prototype,"checkHelptext",2),kt([o({type:Boolean})],vt.prototype,"defaultChecked",2),kt([o({type:Boolean})],vt.prototype,"hasTile",2),kt([o({type:Boolean})],vt.prototype,"isSwitch",2),kt([o({type:String})],vt.prototype,"labelPosition",2),kt([o({type:Boolean})],vt.prototype,"hideLabel",2),kt([o({type:Boolean,reflect:!0})],vt.prototype,"checked",2),kt([o({type:String,reflect:!0})],vt.prototype,"type",2),kt([o({type:String})],vt.prototype,"tagText",2),kt([o({type:Boolean})],vt.prototype,"optionalTag",2),kt([o({type:String})],vt.prototype,"optionalText",2),kt([o({type:Boolean})],vt.prototype,"requiredTag",2),kt([o({type:String})],vt.prototype,"requiredText",2),vt=kt([
|
|
758
|
+
`}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))}};kt([o({type:String,reflect:!0})],vt.prototype,"value",2),kt([o({type:String})],vt.prototype,"checkHelptext",2),kt([o({type:Boolean})],vt.prototype,"defaultChecked",2),kt([o({type:Boolean})],vt.prototype,"hasTile",2),kt([o({type:Boolean})],vt.prototype,"isSwitch",2),kt([o({type:String})],vt.prototype,"labelPosition",2),kt([o({type:Boolean})],vt.prototype,"hideLabel",2),kt([o({type:Boolean,reflect:!0})],vt.prototype,"checked",2),kt([o({type:String,reflect:!0})],vt.prototype,"type",2),kt([o({type:String})],vt.prototype,"tagText",2),kt([o({type:Boolean})],vt.prototype,"optionalTag",2),kt([o({type:String})],vt.prototype,"optionalText",2),kt([o({type:Boolean})],vt.prototype,"requiredTag",2),kt([o({type:String})],vt.prototype,"requiredText",2),vt=kt([j("pkt-checkbox")],vt);const xl=i=>new Promise(t=>setTimeout(t,i)),Ie={isIOS(){const i=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(i)||/Macintosh/.test(i)&&"ontouchend"in document)}},ie={parseValue(i){return i?Array.isArray(i)?i.filter(Boolean):typeof i=="string"?i.split(",").filter(Boolean):String(i).split(",").filter(Boolean):[]},formatValue(i){return i.join(",")},normalizeNameForMultiple(i,t,e){return i?(t||e)&&!i.endsWith("[]")?i+"[]":i:null},normalizeStringArray(i){return typeof i=="string"?i.split(",").filter(Boolean):Array.isArray(i)?i:[]},validateRangeOrder(i){return!i||i.length!==2?!0:qo(i[0],i[1])},sortDates(i){return Uo(i)},filterSelectableDates(i,t,e,s,a){return jo(i,t,e,s,a)}},Sl={getInputType(){return Ie.isIOS()?"text":"date"}},Ci={submitForm(i){var t;const e=(t=i.internals)==null?void 0:t.form;e&&e.requestSubmit()},submitFormOrFallback(i,t){const e=i==null?void 0:i.form;e?e.requestSubmit():t()},validateDateInput(i,t,e,s,a){var n,r,h,d;const c=i.value;c&&(e&&e>c?t.setValidity({rangeUnderflow:!0},((r=(n=a==null?void 0:a.forms)==null?void 0:n.messages)==null?void 0:r.rangeUnderflow)||"Value is below minimum",i):s&&s<c&&t.setValidity({rangeOverflow:!0},((d=(h=a==null?void 0:a.forms)==null?void 0:h.messages)==null?void 0:d.rangeOverflow)||"Value is above maximum",i))}},es={addToSelected(i,t,e,s){const a=i.target;if(!a.value)return;const n=e?re(e):null,r=s?re(s):null,h=re(a.value.split(",")[0]);h&&!isNaN(h.getTime())&&(!n||h>=n)&&(!r||h<=r)&&t.value&&t.value.handleDateSelect(h),a.value=""},handleCalendarPosition(i,t,e=!1){var s;if(!i.value||!t.value)return;const a=((s=t.value.parentElement)==null?void 0:s.getBoundingClientRect())||t.value.getBoundingClientRect(),n=e?a.height+30:a.height,r=i.value.getBoundingClientRect().height;let h=e?"calc(100% - 30px)":"100%";a&&a.top+r>window.innerHeight&&a.top-r>0&&(h=`calc(100% - ${n}px - ${r}px)`),i.value.style.top=h}},Ti={getInputClasses(i,t,e,s,a,n){return{"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":i,"pkt-datepicker--hasrangelabels":t,"pkt-datepicker--multiple":e,"pkt-datepicker--range":s,"ios-readonly-hack":a===!1&&n==="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(i){return{"pkt-input-prefix":i,"pkt-hide":!i}}},Ts={processDateSelection(i,t,e){return!t&&!e?i[0]||"":Array.isArray(i)?i.join(","):i},updateInputValues(i,t,e,s,a,n){i.value&&(s&&t!=null&&t.value?(i.value.value=e[0]??"",t.value.value=e[1]??"",n(i.value),n(t.value)):a||(i.value.value=e.length?e[0]:"",n(i.value)))},processRangeBlur(i,t,e,s,a){var n;const r=i.target;if(r.value){a(r);const h=ve(r.value);h&&t[0]!==r.value&&t[1]&&(s(),(n=e==null?void 0:e.value)==null||n.handleDateSelect(h))}else t[0]&&s()}},Le={handleInputKeydown(i,t,e,s,a,n){const{key:r}=i;r===","&&(i.preventDefault(),n?n(i):a&&a()),(r==="Space"||r===" ")&&(i.preventDefault(),t(i)),r==="Enter"&&(i.preventDefault(),e?e():s?s():a&&a())},handleButtonKeydown(i,t){const{key:e}=i;(e==="Enter"||e===" "||e==="Space")&&(i.preventDefault(),t(i))}};var Cl=Object.defineProperty,Tl=Object.getOwnPropertyDescriptor,Ni=(i,t,e,s)=>{for(var a=s>1?void 0:s?Tl(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&Cl(t,e,a),a};let Je=class extends Y{constructor(){super(...arguments),this.dates=[],this.dateformat="dd.MM.yyyy",this.className="pkt-datepicker__tags",this.idBase=ye()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},u`
|
|
759
759
|
<div class=${A(this.classes)} aria-live="polite">
|
|
760
|
-
${Array.isArray(this.dates)&&this.dates[0]?
|
|
760
|
+
${Array.isArray(this.dates)&&this.dates[0]?Ss(ie.sortDates((this.dates??[]).filter(Boolean)),t=>t,t=>{var e;return u` <pkt-tag
|
|
761
761
|
id=${this.idBase+t+"-tag"}
|
|
762
762
|
closeTag
|
|
763
763
|
@close=${()=>{this.dispatchEvent(new CustomEvent("date-tag-removed",{detail:t}))}}
|
|
764
|
-
.ariaLabel=${`${(e=this.strings)==null?void 0:e.calendar.deleteDate} ${
|
|
764
|
+
.ariaLabel=${`${(e=this.strings)==null?void 0:e.calendar.deleteDate} ${La(t,this.dateformat)}`}
|
|
765
765
|
>
|
|
766
|
-
<time datetime=${t}>${
|
|
767
|
-
</pkt-tag>`})
|
|
766
|
+
<time datetime=${t}>${La(t,this.dateformat)}</time>
|
|
767
|
+
</pkt-tag>`}):$}
|
|
768
768
|
</div>
|
|
769
|
-
`}};
|
|
769
|
+
`}};Ni([o({type:Array})],Je.prototype,"dates",2),Ni([o({type:String})],Je.prototype,"dateformat",2),Ni([o({type:String,attribute:"class"})],Je.prototype,"className",2),Ni([o({type:String,attribute:"id-base"})],Je.prototype,"idBase",2),Je=Ni([j("pkt-date-tags")],Je);const Nl={dateformat:{default:"dd.MM.yyyy"},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},Ai={props:Nl};var Al=Object.defineProperty,El=Object.getOwnPropertyDescriptor,Et=(i,t,e,s)=>{for(var a=s>1?void 0:s?El(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&Al(t,e,a),a};let wt=class extends Y{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=P(),this.calendarRef=P(),this.handleDocumentClick=t=>{if(!this.open)return;const e=t.composedPath(),s=this.parentElement,a=this.popupRef.value;!e.includes(this)&&!e.includes(a)&&!(s&&e.includes(s))&&(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,s){if(typeof es.addToSelected=="function")return es.addToSelected(t,this.calendarRef,e,s)}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`
|
|
770
770
|
<div
|
|
771
771
|
class="${A(t)}"
|
|
772
772
|
${O(this.popupRef)}
|
|
@@ -791,16 +791,16 @@
|
|
|
791
791
|
@close=${()=>{this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}
|
|
792
792
|
></pkt-calendar>
|
|
793
793
|
</div>
|
|
794
|
-
`}};Et([o({type:Boolean,reflect:!0})],wt.prototype,"open",2),Et([o({type:Boolean})],wt.prototype,"multiple",2),Et([o({type:Boolean})],wt.prototype,"range",2),Et([o({type:Boolean})],wt.prototype,"weeknumbers",2),Et([o({type:Boolean})],wt.prototype,"withcontrols",2),Et([o({type:Number})],wt.prototype,"maxMultiple",2),Et([o({type:Array})],wt.prototype,"selected",2),Et([o({type:String})],wt.prototype,"earliest",2),Et([o({type:String})],wt.prototype,"latest",2),Et([o({type:Array})],wt.prototype,"excludedates",2),Et([o({type:Array})],wt.prototype,"excludeweekdays",2),Et([o({type:String})],wt.prototype,"currentmonth",2),wt=Et([
|
|
794
|
+
`}};Et([o({type:Boolean,reflect:!0})],wt.prototype,"open",2),Et([o({type:Boolean})],wt.prototype,"multiple",2),Et([o({type:Boolean})],wt.prototype,"range",2),Et([o({type:Boolean})],wt.prototype,"weeknumbers",2),Et([o({type:Boolean})],wt.prototype,"withcontrols",2),Et([o({type:Number})],wt.prototype,"maxMultiple",2),Et([o({type:Array})],wt.prototype,"selected",2),Et([o({type:String})],wt.prototype,"earliest",2),Et([o({type:String})],wt.prototype,"latest",2),Et([o({type:Array})],wt.prototype,"excludedates",2),Et([o({type:Array})],wt.prototype,"excludeweekdays",2),Et([o({type:String})],wt.prototype,"currentmonth",2),wt=Et([j("pkt-datepicker-popup")],wt);var Pl=Object.defineProperty,Ol=Object.getOwnPropertyDescriptor,Wt=(i,t,e,s)=>{for(var a=s>1?void 0:s?Ol(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&Pl(t,e,a),a};let Pt=class extends Y{constructor(){super(...arguments),this.value="",this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.inputClasses={},this.strings={calendar:{buttonAltText:"Åpne kalender"}},this.inputRef=P(),this.btnRef=P()}get inputElement(){return this.inputRef.value}get buttonElement(){return this.btnRef.value}get isInputReadonly(){return this.readonly||this.inputType==="text"}dispatchToggleCalendar(t){this.readonly||this.dispatchEvent(new CustomEvent("toggle-calendar",{detail:t,bubbles:!0,composed:!0}))}dispatchInput(t){this.dispatchEvent(new CustomEvent("input-change",{detail:t,bubbles:!0,composed:!0}))}dispatchFocus(){this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0}))}dispatchBlur(t){this.dispatchEvent(new CustomEvent("input-blur",{detail:t,bubbles:!0,composed:!0}))}dispatchChange(t){this.dispatchEvent(new CustomEvent("input-changed",{detail:t,bubbles:!0,composed:!0}))}dispatchManageValidity(t){this.dispatchEvent(new CustomEvent("manage-validity",{detail:t,bubbles:!0,composed:!0}))}createRenderRoot(){return this}render(){return u`
|
|
795
795
|
<div class="pkt-input__container">
|
|
796
796
|
<input
|
|
797
797
|
class="${A(this.inputClasses)}"
|
|
798
798
|
.type=${this.inputType}
|
|
799
799
|
id="${this.id}-input"
|
|
800
800
|
.value=${this.value}
|
|
801
|
-
min=${
|
|
802
|
-
max=${
|
|
803
|
-
placeholder=${
|
|
801
|
+
min=${T(this.min)}
|
|
802
|
+
max=${T(this.max)}
|
|
803
|
+
placeholder=${T(this.placeholder)}
|
|
804
804
|
?readonly=${this.isInputReadonly}
|
|
805
805
|
aria-describedby="${this.id}-helptext"
|
|
806
806
|
@click=${t=>{t.preventDefault(),this.dispatchToggleCalendar(t)}}
|
|
@@ -825,17 +825,17 @@
|
|
|
825
825
|
<span class="pkt-btn__text">${this.strings.calendar.buttonAltText}</span>
|
|
826
826
|
</button>
|
|
827
827
|
</div>
|
|
828
|
-
`}};Wt([o({type:String})],
|
|
828
|
+
`}};Wt([o({type:String})],Pt.prototype,"value",2),Wt([o({type:String})],Pt.prototype,"inputType",2),Wt([o({type:String})],Pt.prototype,"id",2),Wt([o({type:String})],Pt.prototype,"min",2),Wt([o({type:String})],Pt.prototype,"max",2),Wt([o({type:String})],Pt.prototype,"placeholder",2),Wt([o({type:Boolean})],Pt.prototype,"readonly",2),Wt([o({type:Boolean})],Pt.prototype,"disabled",2),Wt([o({type:Object})],Pt.prototype,"inputClasses",2),Wt([o({type:Object})],Pt.prototype,"internals",2),Wt([o({type:Object})],Pt.prototype,"strings",2),Pt=Wt([j("pkt-datepicker-single")],Pt);var Ml=Object.defineProperty,Dl=Object.getOwnPropertyDescriptor,Ot=(i,t,e,s)=>{for(var a=s>1?void 0:s?Dl(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&Ml(t,e,a),a};let xt=class extends Y{constructor(){super(...arguments),this.value=[],this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.showRangeLabels=!1,this.inputClasses={},this.strings={generic:{from:"Fra",to:"Til"}},this.inputRef=P(),this.inputRefTo=P(),this.btnRef=P()}get inputElement(){return this.inputRef.value}get inputElementTo(){return this.inputRefTo.value}get buttonElement(){return this.btnRef.value}get isInputReadonly(){return this.readonly||this.inputType==="text"}dispatchToggleCalendar(t){this.readonly||this.dispatchEvent(new CustomEvent("toggle-calendar",{detail:t,bubbles:!0,composed:!0}))}dispatchInput(t){this.dispatchEvent(new CustomEvent("input-change",{detail:t,bubbles:!0,composed:!0}))}dispatchFocus(){this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0}))}dispatchBlur(t){this.dispatchEvent(new CustomEvent("input-blur",{detail:t,bubbles:!0,composed:!0}))}dispatchChange(t){this.dispatchEvent(new CustomEvent("input-changed",{detail:t,bubbles:!0,composed:!0}))}dispatchManageValidity(t){this.dispatchEvent(new CustomEvent("manage-validity",{detail:t,bubbles:!0,composed:!0}))}createRenderRoot(){return this}render(){const t=Ti.getRangeLabelClasses(this.showRangeLabels);return u`
|
|
829
829
|
<div class="pkt-input__container">
|
|
830
|
-
${this.showRangeLabels?u` <div class="pkt-input-prefix">${this.strings.generic.from}</div>
|
|
830
|
+
${this.showRangeLabels?u` <div class="pkt-input-prefix">${this.strings.generic.from}</div> `:$}
|
|
831
831
|
<input
|
|
832
832
|
class=${A(this.inputClasses)}
|
|
833
833
|
.type=${this.inputType}
|
|
834
834
|
id="${this.id}-input"
|
|
835
835
|
.value=${this.value[0]??""}
|
|
836
|
-
min=${
|
|
837
|
-
max=${
|
|
838
|
-
placeholder=${
|
|
836
|
+
min=${T(this.min)}
|
|
837
|
+
max=${T(this.max)}
|
|
838
|
+
placeholder=${T(this.placeholder)}
|
|
839
839
|
?readonly=${this.isInputReadonly}
|
|
840
840
|
?disabled=${this.disabled}
|
|
841
841
|
@click=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
@@ -850,16 +850,16 @@
|
|
|
850
850
|
<div class="${A(t)}" id="${this.id}-to-label">
|
|
851
851
|
${this.strings.generic.to}
|
|
852
852
|
</div>
|
|
853
|
-
${this.showRangeLabels
|
|
853
|
+
${this.showRangeLabels?$:u` <div class="pkt-input-separator">–</div> `}
|
|
854
854
|
<input
|
|
855
855
|
class=${A(this.inputClasses)}
|
|
856
856
|
.type=${this.inputType}
|
|
857
857
|
id="${this.id}-to"
|
|
858
858
|
aria-labelledby="${this.id}-to-label"
|
|
859
859
|
.value=${this.value[1]??""}
|
|
860
|
-
min=${
|
|
861
|
-
max=${
|
|
862
|
-
placeholder=${
|
|
860
|
+
min=${T(this.min)}
|
|
861
|
+
max=${T(this.max)}
|
|
862
|
+
placeholder=${T(this.placeholder)}
|
|
863
863
|
?readonly=${this.isInputReadonly}
|
|
864
864
|
?disabled=${this.disabled}
|
|
865
865
|
@click=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
@@ -883,15 +883,15 @@
|
|
|
883
883
|
<span class="pkt-btn__text">${this.strings.calendar.buttonAltText}</span>
|
|
884
884
|
</button>
|
|
885
885
|
</div>
|
|
886
|
-
`}};
|
|
886
|
+
`}};Ot([o({type:Array})],xt.prototype,"value",2),Ot([o({type:String})],xt.prototype,"inputType",2),Ot([o({type:String})],xt.prototype,"id",2),Ot([o({type:String})],xt.prototype,"min",2),Ot([o({type:String})],xt.prototype,"max",2),Ot([o({type:String})],xt.prototype,"placeholder",2),Ot([o({type:Boolean})],xt.prototype,"readonly",2),Ot([o({type:Boolean})],xt.prototype,"disabled",2),Ot([o({type:Boolean})],xt.prototype,"showRangeLabels",2),Ot([o({type:Object})],xt.prototype,"inputClasses",2),Ot([o({type:Object})],xt.prototype,"internals",2),Ot([o({type:Object})],xt.prototype,"strings",2),xt=Ot([j("pkt-datepicker-range")],xt);var Il=Object.defineProperty,Ll=Object.getOwnPropertyDescriptor,Mt=(i,t,e,s)=>{for(var a=s>1?void 0:s?Ll(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&Il(t,e,a),a};let St=class extends Y{constructor(){super(...arguments),this.value=[],this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.inputClasses={},this.strings={calendar:{buttonAltText:"Åpne kalender"}},this.inputRef=P(),this.btnRef=P()}get inputElement(){return this.inputRef.value}get buttonElement(){return this.btnRef.value}get isInputReadonly(){return this.readonly||this.inputType==="text"}get isInputDisabled(){return this.disabled||this.maxlength!==void 0&&this.maxlength!==null&&this.value.length>=this.maxlength}dispatchToggleCalendar(t){this.readonly||this.dispatchEvent(new CustomEvent("toggle-calendar",{detail:t,bubbles:!0,composed:!0}))}dispatchInput(t){this.dispatchEvent(new CustomEvent("input-change",{detail:t,bubbles:!0,composed:!0}))}dispatchFocus(){this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0}))}dispatchBlur(t){this.dispatchEvent(new CustomEvent("input-blur",{detail:t,bubbles:!0,composed:!0}))}dispatchChange(t){this.dispatchEvent(new CustomEvent("input-changed",{detail:t,bubbles:!0,composed:!0}))}dispatchAddToSelected(t){this.dispatchEvent(new CustomEvent("add-to-selected",{detail:t,bubbles:!0,composed:!0}))}createRenderRoot(){return this}render(){return u`
|
|
887
887
|
<div class="pkt-input__container">
|
|
888
888
|
<input
|
|
889
889
|
class=${A(this.inputClasses)}
|
|
890
890
|
.type=${this.inputType}
|
|
891
891
|
id="${this.id}-input"
|
|
892
|
-
min=${
|
|
893
|
-
max=${
|
|
894
|
-
placeholder=${
|
|
892
|
+
min=${T(this.min)}
|
|
893
|
+
max=${T(this.max)}
|
|
894
|
+
placeholder=${T(this.placeholder)}
|
|
895
895
|
?readonly=${this.isInputReadonly}
|
|
896
896
|
?disabled=${this.isInputDisabled}
|
|
897
897
|
@click=${t=>{t.preventDefault(),this.dispatchToggleCalendar(t)}}
|
|
@@ -915,7 +915,7 @@
|
|
|
915
915
|
<span class="pkt-btn__text">${this.strings.calendar.buttonAltText}</span>
|
|
916
916
|
</button>
|
|
917
917
|
</div>
|
|
918
|
-
`}};
|
|
918
|
+
`}};Mt([o({type:Array})],St.prototype,"value",2),Mt([o({type:String})],St.prototype,"inputType",2),Mt([o({type:String})],St.prototype,"id",2),Mt([o({type:String})],St.prototype,"min",2),Mt([o({type:String})],St.prototype,"max",2),Mt([o({type:String})],St.prototype,"placeholder",2),Mt([o({type:Boolean})],St.prototype,"readonly",2),Mt([o({type:Boolean})],St.prototype,"disabled",2),Mt([o({type:Number})],St.prototype,"maxlength",2),Mt([o({type:Object})],St.prototype,"inputClasses",2),Mt([o({type:Object})],St.prototype,"internals",2),Mt([o({type:Object})],St.prototype,"strings",2),St=Mt([j("pkt-datepicker-multiple")],St);var Bl=Object.defineProperty,Fl=Object.getOwnPropertyDescriptor,lt=(i,t,e,s)=>{for(var a=s>1?void 0:s?Fl(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&Bl(t,e,a),a};let et=class extends D{constructor(){super(),this._valueProperty="",this.datepickerPopupRef=P(),this._value=[],this.label="Datovelger",this.dateformat=Ai.props.dateformat.default,this.multiple=Ai.props.multiple.default,this.maxlength=null,this.range=Ai.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=Ai.props.weeknumbers.default,this.withcontrols=Ai.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.calendarOpen=!1,this.timezone="Europe/Oslo",this.inputClasses={},this.calRef=P(),this.popupRef=P(),this.helptextSlot=P(),this.singleInputRef=P(),this.rangeInputRef=P(),this.multipleInputRef=P(),this.addToSelected=t=>{const e=this.datepickerPopupRef.value;return e&&typeof e.addToSelected=="function"?e.addToSelected(t,this.min,this.max):es.addToSelected(t,this.calRef,this.min,this.max)},this.slotController=new pt(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 Sl.getInputType()}connectedCallback(){super.connectedCallback(),this.timezone&&this.timezone!==window.pktTz&&(window.pktTz=this.timezone),this.name=ie.normalizeNameForMultiple(this.name,this.multiple,this.range)||this.name}disconnectedCallback(){super.disconnectedCallback()}onInput(){this.dispatchEvent(new Event("input",{bubbles:!0}))}valueChanged(t,e){if(t===e)return;const s=ie.parseValue(t),a=this.multiple&&s.length>1?ie.filterSelectableDates(s,this.min,this.max,this.excludedates,this.excludeweekdays):s;if(this.range&&!ie.validateRangeOrder(a)){this._value=[],this._valueProperty="",super.valueChanged("",e);return}this._value=a;const n=ie.formatValue(a);this._valueProperty!==n&&(this._valueProperty=n),super.valueChanged(n,e)}attributeChangedCallback(t,e,s){t==="value"&&this.value!==e&&this.valueChanged(s,e),t==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=ie.normalizeStringArray(s||"")),t==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=ie.normalizeStringArray(s||"")),super.attributeChangedCallback(t,e,s)}updated(t){if(t.has("value")){const e=Array.isArray(this.value)?this.value.join(","):this.value,s=t.get("value"),a=Array.isArray(s)?s.join(","):s;this.valueChanged(e,a)}(t.has("multiple")||t.has("range"))&&(this.name=ie.normalizeNameForMultiple(this.name,this.multiple,this.range)||this.name),t.has("multiple")&&(this.multiple&&!Array.isArray(this._value)?this._value=ie.parseValue(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,s;return this.multiple?(t=this.multipleInputRef.value)==null?void 0:t.inputElement:this.range?(e=this.rangeInputRef.value)==null?void 0:e.inputElement:(s=this.singleInputRef.value)==null?void 0:s.inputElement}get currentInputElementTo(){var t;if(this.range)return(t=this.rangeInputRef.value)==null?void 0:t.inputElementTo}get currentButtonElement(){var t,e,s;return this.multiple?(t=this.multipleInputRef.value)==null?void 0:t.buttonElement:this.range?(e=this.rangeInputRef.value)==null?void 0:e.buttonElement:(s=this.singleInputRef.value)==null?void 0:s.buttonElement}get btnRef(){return{value:this.currentButtonElement}}renderInput(){return u`
|
|
919
919
|
<pkt-datepicker-single
|
|
920
920
|
.value=${this._value[0]??""}
|
|
921
921
|
.inputType=${this.inputType}
|
|
@@ -955,7 +955,7 @@
|
|
|
955
955
|
@input-change=${()=>this.onInput()}
|
|
956
956
|
@input-focus=${()=>this.onFocus()}
|
|
957
957
|
@input-blur=${t=>{var e;(e=this.calRef.value)!=null&&e.contains(t.detail.relatedTarget)||this.onBlur()}}
|
|
958
|
-
@range-blur=${t=>{
|
|
958
|
+
@range-blur=${t=>{Ts.processRangeBlur(t.detail.event,t.detail.values,this.calRef,()=>this.clearInputValue(),e=>this.manageValidity(e))}}
|
|
959
959
|
@manage-validity=${t=>this.manageValidity(t.detail)}
|
|
960
960
|
@validate-date-input=${t=>{Ci.validateDateInput(t.detail,this.internals,this.min,this.max,this.strings)}}
|
|
961
961
|
@handle-date-select=${t=>{var e,s;const a=ve(t.detail);a&&this._value[1]!==at(a)&&((s=(e=this.calRef)==null?void 0:e.value)==null||s.handleDateSelect(a))}}
|
|
@@ -999,7 +999,7 @@
|
|
|
999
999
|
.excludedates=${Array.isArray(this.excludedates)?this.excludedates:this.excludedates.split(",")}
|
|
1000
1000
|
.excludeweekdays=${this.excludeweekdays}
|
|
1001
1001
|
.currentmonth=${this.currentmonth?me(this.currentmonth):null}
|
|
1002
|
-
@date-selected=${t=>{this.value=
|
|
1002
|
+
@date-selected=${t=>{this.value=Ts.processDateSelection(t.detail,this.multiple,this.range),this._value=t.detail,Ts.updateInputValues(this.inputRef,this.inputRefTo,this._value,this.range,this.multiple,e=>this.manageValidity(e))}}
|
|
1003
1003
|
@close=${()=>{this.onBlur(),this.hideCalendar()}}
|
|
1004
1004
|
${O(this.datepickerPopupRef)}
|
|
1005
1005
|
></pkt-datepicker-popup>
|
|
@@ -1035,7 +1035,7 @@
|
|
|
1035
1035
|
strings=${this.strings}
|
|
1036
1036
|
id-base=${this.id}
|
|
1037
1037
|
@date-tag-removed=${t=>{var e;const s=this.datepickerPopupRef.value,a=ve(t.detail);s&&a&&typeof s.handleDateSelect=="function"?s.handleDateSelect(a):(e=this.calRef.value)==null||e.handleDateSelect(a)}}
|
|
1038
|
-
></pkt-date-tags
|
|
1038
|
+
></pkt-date-tags>`:$}
|
|
1039
1039
|
<div
|
|
1040
1040
|
class="pkt-datepicker__inputs ${this.range&&this.showRangeLabels?"pkt-input__range-inputs":""}"
|
|
1041
1041
|
>
|
|
@@ -1043,25 +1043,25 @@
|
|
|
1043
1043
|
</div>
|
|
1044
1044
|
</pkt-input-wrapper>
|
|
1045
1045
|
${this.renderCalendar()}
|
|
1046
|
-
`}handleCalendarPosition(){const t=this.multiple&&!!this.maxlength;es.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(),Ie.isIOS()&&e.focusOnCurrentDate();return}await
|
|
1046
|
+
`}handleCalendarPosition(){const t=this.multiple&&!!this.maxlength;es.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(),Ie.isIOS()&&e.focusOnCurrentDate();return}await xl(20),this.handleCalendarPosition(),Ie.isIOS()&&((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 s=!!e.open;e.toggle(),this.calendarOpen=!s;return}this.calendarOpen?this.hideCalendar():this.showCalendar()}clearInputValue(){this._value=[],this.value=""}};lt([o({type:String,reflect:!0})],et.prototype,"value",1),lt([o({type:Array})],et.prototype,"_value",2),lt([o({type:String,reflect:!0})],et.prototype,"label",2),lt([o({type:String})],et.prototype,"dateformat",2),lt([o({type:Boolean,reflect:!0})],et.prototype,"multiple",2),lt([o({type:Number,reflect:!0})],et.prototype,"maxlength",2),lt([o({type:Boolean,reflect:!0})],et.prototype,"range",2),lt([o({type:Boolean})],et.prototype,"showRangeLabels",2),lt([o({type:String,reflect:!0})],et.prototype,"min",2),lt([o({type:String,reflect:!0})],et.prototype,"max",2),lt([o({type:Boolean})],et.prototype,"weeknumbers",2),lt([o({type:Boolean,reflect:!0})],et.prototype,"withcontrols",2),lt([o({converter:Ze.csvToArray})],et.prototype,"excludedates",2),lt([o({converter:Ze.csvToArray})],et.prototype,"excludeweekdays",2),lt([o({type:String})],et.prototype,"currentmonth",2),lt([o({type:Boolean,reflect:!0})],et.prototype,"calendarOpen",2),lt([o({type:String})],et.prototype,"timezone",2),lt([U()],et.prototype,"inputClasses",2),et=lt([j("pkt-datepicker")],et);const Vl={href:{default:"#"},target:{default:"_self"}},qa={props:Vl};var Hl=Object.defineProperty,jl=Object.getOwnPropertyDescriptor,Qe=(i,t,e,s)=>{for(var a=s>1?void 0:s?jl(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&Hl(t,e,a),a};let ke=class extends Y{constructor(){super(),this.defaultSlot=P(),this.href=qa.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=!1,this.target=qa.props.target.default,this.slotController=new pt(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
|
|
1047
1047
|
class=${A(t)}
|
|
1048
1048
|
href=${this.href}
|
|
1049
1049
|
.target=${this.target}
|
|
1050
|
-
.rel=${this.external?"noopener noreferrer"
|
|
1050
|
+
.rel=${this.external?"noopener noreferrer":$}
|
|
1051
1051
|
>${this.iconName?u`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:""} <span ${O(this.defaultSlot)}>Link</span></a
|
|
1052
|
-
>`}};Qe([o({type:String,reflect:!0})],ke.prototype,"href",2),Qe([o({type:String,reflect:!0})],ke.prototype,"iconName",2),Qe([o({type:String,reflect:!0})],ke.prototype,"iconPosition",2),Qe([o({type:Boolean,reflect:!0})],ke.prototype,"external",2),Qe([o({type:String,reflect:!0})],ke.prototype,"target",2),ke=Qe([
|
|
1052
|
+
>`}};Qe([o({type:String,reflect:!0})],ke.prototype,"href",2),Qe([o({type:String,reflect:!0})],ke.prototype,"iconName",2),Qe([o({type:String,reflect:!0})],ke.prototype,"iconPosition",2),Qe([o({type:Boolean,reflect:!0})],ke.prototype,"external",2),Qe([o({type:String,reflect:!0})],ke.prototype,"target",2),ke=Qe([j("pkt-link")],ke);var Ul=Object.defineProperty,ql=Object.getOwnPropertyDescriptor,Be=(i,t,e,s)=>{for(var a=s>1?void 0:s?ql(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&Ul(t,e,a),a};let le=class extends Y{constructor(){super(),this.defaultSlot=P(),this.title="",this.href="#",this.iconName="",this.external=!1,this.openInNewTab=!1,this.skin="normal",this.slotController=new pt(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`
|
|
1053
1053
|
<a
|
|
1054
1054
|
href=${this.href}
|
|
1055
1055
|
class=${t}
|
|
1056
1056
|
target=${this.openInNewTab?"_blank":"_self"}
|
|
1057
|
-
rel=${
|
|
1057
|
+
rel=${T(this.openInNewTab?"noopener noreferrer":void 0)}
|
|
1058
1058
|
>
|
|
1059
1059
|
${this.iconName&&u`<pkt-icon class="pkt-link__icon" name="${this.iconName}" />`}
|
|
1060
1060
|
${this.title&&u`<div class=${e}>${this.title}</div>`}
|
|
1061
1061
|
|
|
1062
1062
|
<div class="pkt-linkcard__text" ${O(this.defaultSlot)}></div>
|
|
1063
1063
|
</a>
|
|
1064
|
-
`}};Be([o({type:String,reflect:!0})],le.prototype,"title",2),Be([o({type:String,reflect:!0})],le.prototype,"href",2),Be([o({type:String,reflect:!0})],le.prototype,"iconName",2),Be([o({type:Boolean,reflect:!0})],le.prototype,"external",2),Be([o({type:Boolean,reflect:!0})],le.prototype,"openInNewTab",2),Be([o({type:String,reflect:!0})],le.prototype,"skin",2),le=Be([
|
|
1064
|
+
`}};Be([o({type:String,reflect:!0})],le.prototype,"title",2),Be([o({type:String,reflect:!0})],le.prototype,"href",2),Be([o({type:String,reflect:!0})],le.prototype,"iconName",2),Be([o({type:Boolean,reflect:!0})],le.prototype,"external",2),Be([o({type:Boolean,reflect:!0})],le.prototype,"openInNewTab",2),Be([o({type:String,reflect:!0})],le.prototype,"skin",2),le=Be([j("pkt-linkcard")],le);var zl=Object.defineProperty,Wl=Object.getOwnPropertyDescriptor,he=(i,t,e,s)=>{for(var a=s>1?void 0:s?Wl(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&zl(t,e,a),a};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/13.8/animations/";let Gt=class extends Y{constructor(){super(),this.defaultSlot=P(),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 pt(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=A({"pkt-loader":!0,[`pkt-loader--${this.inline?"inline":"box"}`]:!0,[`pkt-loader--${this.size}`]:!0}),e=A({"pkt-contents":!0,"pkt-hide":this.isLoading});return u`<div
|
|
1065
1065
|
role="status"
|
|
1066
1066
|
aria-live="polite"
|
|
1067
1067
|
aria-busy=${this.isLoading?"true":"false"}
|
|
@@ -1074,9 +1074,9 @@
|
|
|
1074
1074
|
class="pkt-loader__svg pkt-loader__${this.variant}"
|
|
1075
1075
|
></pkt-icon>
|
|
1076
1076
|
${this.message&&u`<p>${this.message}</p>`}
|
|
1077
|
-
</div
|
|
1077
|
+
</div>`:$}
|
|
1078
1078
|
<div class=${e} ${O(this.defaultSlot)}></div>
|
|
1079
|
-
</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))}};he([o({type:Number})],Gt.prototype,"delay",2),he([o({type:Boolean})],Gt.prototype,"inline",2),he([o({type:Boolean})],Gt.prototype,"isLoading",2),he([o({type:String})],Gt.prototype,"message",2),he([o({type:String})],Gt.prototype,"size",2),he([o({type:String})],Gt.prototype,"variant",2),he([o({type:String})],Gt.prototype,"loadingAnimationPath",2),he([U()],Gt.prototype,"_shouldDisplayLoader",2),Gt=he([
|
|
1079
|
+
</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))}};he([o({type:Number})],Gt.prototype,"delay",2),he([o({type:Boolean})],Gt.prototype,"inline",2),he([o({type:Boolean})],Gt.prototype,"isLoading",2),he([o({type:String})],Gt.prototype,"message",2),he([o({type:String})],Gt.prototype,"size",2),he([o({type:String})],Gt.prototype,"variant",2),he([o({type:String})],Gt.prototype,"loadingAnimationPath",2),he([U()],Gt.prototype,"_shouldDisplayLoader",2),Gt=he([j("pkt-loader")],Gt);const Rl={skin:{default:"beige"},compact:{default:!1},closable:{default:!1}},Ns={props:Rl};var Kl=Object.defineProperty,Gl=Object.getOwnPropertyDescriptor,ti=(i,t,e,s)=>{for(var a=s>1?void 0:s?Gl(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&Kl(t,e,a),a};let $e=class extends Y{constructor(){super(),this.defaultSlot=P(),this.closable=Ns.props.closable.default,this.compact=Ns.props.compact.default,this.title="",this.skin=Ns.props.skin.default,this._isClosed=!1,this.close=i=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:i},bubbles:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:i},bubbles:!0}))},this.slotController=new pt(this,this.defaultSlot),this._isClosed=!1}updated(i){super.updated(i),i.has("_isClosed")&&va(this,"pkt-hide",this._isClosed)}render(){const i={"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=${A(i)}>
|
|
1080
1080
|
${this.closable?u`<div class="pkt-messagebox__close">
|
|
1081
1081
|
<button
|
|
1082
1082
|
@click=${this.close}
|
|
@@ -1085,10 +1085,10 @@
|
|
|
1085
1085
|
>
|
|
1086
1086
|
<pkt-icon name="close" class="pkt-link__icon"></pkt-icon>
|
|
1087
1087
|
</button>
|
|
1088
|
-
</div
|
|
1089
|
-
${this.title?u`<div class="pkt-messagebox__title">${this.title}</div
|
|
1088
|
+
</div>`:$}
|
|
1089
|
+
${this.title?u`<div class="pkt-messagebox__title">${this.title}</div>`:$}
|
|
1090
1090
|
<div class="pkt-messagebox__text" ${O(this.defaultSlot)}></div>
|
|
1091
|
-
</div>`}};ti([o({type:Boolean,reflect:!0})],$e.prototype,"closable",2),ti([o({type:Boolean,reflect:!0})],$e.prototype,"compact",2),ti([o({type:String,reflect:!0})],$e.prototype,"title",2),ti([o({type:String,reflect:!0})],$e.prototype,"skin",2),ti([U()],$e.prototype,"_isClosed",2),$e=ti([
|
|
1091
|
+
</div>`}};ti([o({type:Boolean,reflect:!0})],$e.prototype,"closable",2),ti([o({type:Boolean,reflect:!0})],$e.prototype,"compact",2),ti([o({type:String,reflect:!0})],$e.prototype,"title",2),ti([o({type:String,reflect:!0})],$e.prototype,"skin",2),ti([U()],$e.prototype,"_isClosed",2),$e=ti([j("pkt-messagebox")],$e);const Yl={hideCloseButton:{default:!1},closeOnBackdropClick:{default:!1},size:{default:"medium"}},As={props:Yl};var Zl=Object.defineProperty,Xl=Object.getOwnPropertyDescriptor,Yt=(i,t,e,s)=>{for(var a=s>1?void 0:s?Xl(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&Zl(t,e,a),a};let Dt=class extends Y{constructor(){super(),this.headingText="",this.removePadding=!1,this.hideCloseButton=As.props.hideCloseButton.default,this.closeOnBackdropClick=As.props.closeOnBackdropClick.default,this.closeButtonSkin="blue",this.size=As.props.size.default,this.variant="dialog",this.drawerPosition="right",this.transparentBackdrop=!1,this.defaultSlot=P(),this.dialogRef=P(),this._isOpen=!1,this.close=(t,e=!1)=>{var s;if(!this._isOpen)return;this._isOpen=!1,document.body.classList.remove("pkt-modal--open");const a=document.activeElement;a&&!this.isElementInViewport(a)&&a.scrollIntoView({behavior:"smooth",block:"nearest"}),this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!0,composed:!0})),e||(s=this.dialogRef.value)==null||s.close(),this.requestUpdate()},this.showModal=(t=null)=>{var e;this._isOpen=!0,(e=this.dialogRef.value)==null||e.showModal();const s=document.querySelector(".pkt-modal");requestAnimationFrame(()=>{var a;this.dialogRef.value&&((a=this.dialogRef.value)==null||a.focus())}),s&&document.body.classList.add("pkt-modal--open"),this.dispatchEvent(new CustomEvent("showModal",{detail:{origin:t},bubbles:!0,composed:!0})),this.requestUpdate()},this.slotController=new pt(this,this.defaultSlot),this._isOpen=!1}async connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleKeyDown.bind(this)),document.addEventListener("click",this.handleBackdropClick.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("click",this.handleBackdropClick)}async firstUpdated(t){super.firstUpdated(t),this.dialogRef.value&&!window.HTMLDialogElement&&!this.dialogRef.value.showModal&&("document"in window&&"createElement"in document&&(await Promise.resolve().then(()=>sd).then(e=>e.default)).registerDialog(this.dialogRef.value),this.dialogRef.value.addEventListener("close",()=>{this.close(new Event("close"),!0)}))}handleKeyDown(t){t.key==="Escape"&&this.close(t)}handleBackdropClick(t){var e;this.closeOnBackdropClick&&t.target===((e=this.dialogRef)==null?void 0:e.value)&&this.close(t)}isElementInViewport(t){const e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}render(){const t={"pkt-modal":!0,"pkt-modal--removePadding":this.removePadding??!1,"pkt-modal--noHeadingText":this.headingText===""||this.headingText===void 0,"pkt-modal--noShadow":this.closeButtonSkin==="yellow-filled","pkt-modal--transparentBackdrop":this.transparentBackdrop??!1,[`pkt-modal--${this.size}`]:this.size!==void 0,[`pkt-modal__${this.variant}`]:this.variant!==void 0,[`pkt-modal__drawer--${this.drawerPosition}`]:this.variant==="drawer"},e={"pkt-modal__headingText":!0,"pkt-txt-24":!0},s={"pkt-modal__content":!0,"pkt-txt-18-light":!0},a=this.closeButtonSkin==="blue",n={"pkt-modal__closeButton":!0,[`pkt-modal__closeButton--${this.closeButtonSkin}`]:!0};return u`
|
|
1092
1092
|
<dialog
|
|
1093
1093
|
class=${A(t)}
|
|
1094
1094
|
${O(this.dialogRef)}
|
|
@@ -1114,7 +1114,7 @@
|
|
|
1114
1114
|
Lukk
|
|
1115
1115
|
</pkt-button>
|
|
1116
1116
|
</div>`}
|
|
1117
|
-
</div
|
|
1117
|
+
</div>`:$}
|
|
1118
1118
|
<div class="pkt-modal__container">
|
|
1119
1119
|
<div
|
|
1120
1120
|
id="pkt-modal__content"
|
|
@@ -1124,16 +1124,16 @@
|
|
|
1124
1124
|
</div>
|
|
1125
1125
|
</div>
|
|
1126
1126
|
</dialog>
|
|
1127
|
-
`}};Yt([o({type:String})],Dt.prototype,"headingText",2),Yt([o({type:Boolean})],Dt.prototype,"removePadding",2),Yt([o({type:Boolean})],Dt.prototype,"hideCloseButton",2),Yt([o({type:Boolean})],Dt.prototype,"closeOnBackdropClick",2),Yt([o({type:String})],Dt.prototype,"closeButtonSkin",2),Yt([o({type:String})],Dt.prototype,"size",2),Yt([o({type:String})],Dt.prototype,"variant",2),Yt([o({type:String})],Dt.prototype,"drawerPosition",2),Yt([o({type:Boolean})],Dt.prototype,"transparentBackdrop",2),Yt([U()],Dt.prototype,"_isOpen",2),Dt=Yt([
|
|
1127
|
+
`}};Yt([o({type:String})],Dt.prototype,"headingText",2),Yt([o({type:Boolean})],Dt.prototype,"removePadding",2),Yt([o({type:Boolean})],Dt.prototype,"hideCloseButton",2),Yt([o({type:Boolean})],Dt.prototype,"closeOnBackdropClick",2),Yt([o({type:String})],Dt.prototype,"closeButtonSkin",2),Yt([o({type:String})],Dt.prototype,"size",2),Yt([o({type:String})],Dt.prototype,"variant",2),Yt([o({type:String})],Dt.prototype,"drawerPosition",2),Yt([o({type:Boolean})],Dt.prototype,"transparentBackdrop",2),Yt([U()],Dt.prototype,"_isOpen",2),Dt=Yt([j("pkt-modal")],Dt);/**
|
|
1128
1128
|
* @license
|
|
1129
1129
|
* Copyright 2018 Google LLC
|
|
1130
1130
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1131
|
-
*/const
|
|
1131
|
+
*/const za="important",Jl=" !"+za,Ql=Ce(class extends We{constructor(i){var t;if(super(i),i.type!==Kt.ATTRIBUTE||i.name!=="style"||((t=i.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(i){return Object.keys(i).reduce(((t,e)=>{const s=i[e];return s==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`}),"")}update(i,[t]){const{style:e}=i.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const s of this.ft)t[s]==null&&(this.ft.delete(s),s.includes("-")?e.removeProperty(s):e[s]=null);for(const s in t){const a=t[s];if(a!=null){this.ft.add(s);const n=typeof a=="string"&&a.endsWith(Jl);s.includes("-")||n?e.setProperty(s,n?a.slice(0,-11):a,n?za:""):e[s]=a}}return $t}});var th=Object.defineProperty,eh=Object.getOwnPropertyDescriptor,ht=(i,t,e,s)=>{for(var a=s>1?void 0:s?eh(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&th(t,e,a),a};let it=class extends Y{constructor(){super(),this.ariaLabel=null,this.ariaLabelledby=null,this.ariaValueText=null,this.ariaLive="polite",this.id=ye(),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=P(),this.progressBarRef=P()}firstUpdated(i){super.firstUpdated(i),this.setComputedValues(),this.syncAttributes()}updated(i){super.updated(i),i.has("valueCurrent")&&this.labelRef.value&&(this.labelWidth=this.labelRef.value.getBoundingClientRect().width||0),i.has("id")&&this.id&&(this.progressBarId=this.id),(i.has("statusType")||i.has("id")||i.has("ariaLabelledby"))&&(this.progressbarId=this.id||ye(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`),(i.has("ariaValueText")||i.has("valueCurrent")||i.has("valueMax"))&&(this.computedAriaValueText=this.statusType==="fraction"&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||""),this.syncAttributes()}render(){const i=this.statusType!=="none",t=this.valueMax-this.valueMin,e=this.valueCurrent/t*100,s=this.statusType==="fraction"?Math.round(e):Math.round((this.valueCurrent-this.valueMin)/(this.valueMax-this.valueMin)*100),a=`${this.valueCurrent} av ${t}`,n=A({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),r=A({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition==="center"}),h=A({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement==="center"}),d=A({"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
|
|
1132
1132
|
class="pkt-progressbar__container"
|
|
1133
1133
|
.ref=${this.progressBarRef}
|
|
1134
|
-
style=${
|
|
1134
|
+
style=${Ql({"--pkt-progress-label-width":`${this.labelWidth}px`,"--pkt-progress-width":`${s}%`})}
|
|
1135
1135
|
>
|
|
1136
|
-
${this.title?u`<p id=${`${this.progressBarId}-title`} class=${r}>${this.title}</p
|
|
1136
|
+
${this.title?u`<p id=${`${this.progressBarId}-title`} class=${r}>${this.title}</p>`:$}
|
|
1137
1137
|
|
|
1138
1138
|
<div class="pkt-progressbar__bar-wrapper">
|
|
1139
1139
|
<div class=${n}></div>
|
|
@@ -1143,15 +1143,15 @@
|
|
|
1143
1143
|
<span class=${d} ${O(this.labelRef)}>
|
|
1144
1144
|
${this.statusType==="percentage"?`${s}%`:a}
|
|
1145
1145
|
</span>
|
|
1146
|
-
</div
|
|
1147
|
-
</div>`}setComputedValues(){this.progressbarId=this.id||
|
|
1148
|
-
${this.tagText?u`<span class=${s+" pkt-tag--gray"}>${this.tagText}</span
|
|
1149
|
-
${this.optionalTag?u`<span class=${s+" pkt-tag--blue-light"}>${this.optionalText}</span
|
|
1150
|
-
${this.requiredTag?u`<span class=${s+" pkt-tag--beige"}>${this.requiredText}</span
|
|
1146
|
+
</div>`:$}
|
|
1147
|
+
</div>`}setComputedValues(){this.progressbarId=this.id||ye(),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(i,t){t==null||t===""?this.removeAttribute(i):this.setAttribute(i,String(t))}};ht([o({type:String})],it.prototype,"ariaLabel",2),ht([o({type:String,reflect:!0})],it.prototype,"ariaLabelledby",2),ht([o({type:String,reflect:!0})],it.prototype,"ariaValueText",2),ht([o({type:String})],it.prototype,"ariaLive",2),ht([o({type:String,reflect:!0})],it.prototype,"id",2),ht([o({type:String})],it.prototype,"role",2),ht([o({type:String})],it.prototype,"skin",2),ht([o({type:String})],it.prototype,"statusPlacement",2),ht([o({type:String})],it.prototype,"statusType",2),ht([o({type:String,reflect:!0})],it.prototype,"title",2),ht([o({type:String})],it.prototype,"titlePosition",2),ht([o({type:Number,reflect:!0})],it.prototype,"valueCurrent",2),ht([o({type:Number})],it.prototype,"valueMax",2),ht([o({type:Number})],it.prototype,"valueMin",2),ht([U()],it.prototype,"labelWidth",2),ht([U()],it.prototype,"progressbarId",2),ht([U()],it.prototype,"computedAriaLabelledby",2),ht([U()],it.prototype,"computedAriaValueText",2),it=ht([j("pkt-progressbar")],it);var ih=Object.defineProperty,sh=Object.getOwnPropertyDescriptor,It=(i,t,e,s)=>{for(var a=s>1?void 0:s?sh(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&ih(t,e,a),a};let Ct=class extends D{constructor(){super(...arguments),this.inputRef=P(),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(i,t,e){i==="defaultChecked"&&(this._checked=this.defaultChecked),i==="checked"&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(i,t,e)}render(){const i=A({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),t=A({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),e=A({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-sr-only":this.hideLabel}),s="pkt-tag pkt-tag--small pkt-tag--thin-text",a=()=>u`
|
|
1148
|
+
${this.tagText?u`<span class=${s+" pkt-tag--gray"}>${this.tagText}</span>`:$}
|
|
1149
|
+
${this.optionalTag?u`<span class=${s+" pkt-tag--blue-light"}>${this.optionalText}</span>`:$}
|
|
1150
|
+
${this.requiredTag?u`<span class=${s+" pkt-tag--beige"}>${this.requiredText}</span>`:$}
|
|
1151
1151
|
`,n=()=>u`
|
|
1152
1152
|
<label class=${e} for=${this.id+"-internal"}>
|
|
1153
1153
|
${this.label} ${a()}
|
|
1154
|
-
${this.checkHelptext?u`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div
|
|
1154
|
+
${this.checkHelptext?u`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:$}
|
|
1155
1155
|
</label>
|
|
1156
1156
|
`;return u`
|
|
1157
1157
|
<div class="pkt-input-check">
|
|
@@ -1174,11 +1174,11 @@
|
|
|
1174
1174
|
${n()}
|
|
1175
1175
|
</div>
|
|
1176
1176
|
</div>
|
|
1177
|
-
`}toggleChecked(i=null){i&&i.preventDefault(),i&&i.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this._checked=this.inputRef.value.matches(":checked"),this.valueChecked(this._checked))}};It([o({type:String,reflect:!0})],Ct.prototype,"value",2),It([o({type:String})],Ct.prototype,"checkHelptext",2),It([o({type:Boolean})],Ct.prototype,"defaultChecked",2),It([o({type:Boolean})],Ct.prototype,"hasTile",2),It([o({type:Boolean,reflect:!0})],Ct.prototype,"checked",2),It([o({type:String,reflect:!0})],Ct.prototype,"type",2),It([o({type:String})],Ct.prototype,"tagText",2),It([o({type:Boolean})],Ct.prototype,"optionalTag",2),It([o({type:String})],Ct.prototype,"optionalText",2),It([o({type:Boolean})],Ct.prototype,"requiredTag",2),It([o({type:String})],Ct.prototype,"requiredText",2),It([U()],Ct.prototype,"_checked",2),Ct=It([
|
|
1177
|
+
`}toggleChecked(i=null){i&&i.preventDefault(),i&&i.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this._checked=this.inputRef.value.matches(":checked"),this.valueChecked(this._checked))}};It([o({type:String,reflect:!0})],Ct.prototype,"value",2),It([o({type:String})],Ct.prototype,"checkHelptext",2),It([o({type:Boolean})],Ct.prototype,"defaultChecked",2),It([o({type:Boolean})],Ct.prototype,"hasTile",2),It([o({type:Boolean,reflect:!0})],Ct.prototype,"checked",2),It([o({type:String,reflect:!0})],Ct.prototype,"type",2),It([o({type:String})],Ct.prototype,"tagText",2),It([o({type:Boolean})],Ct.prototype,"optionalTag",2),It([o({type:String})],Ct.prototype,"optionalText",2),It([o({type:Boolean})],Ct.prototype,"requiredTag",2),It([o({type:String})],Ct.prototype,"requiredText",2),It([U()],Ct.prototype,"_checked",2),Ct=It([j("pkt-radiobutton")],Ct);/**
|
|
1178
1178
|
* @license
|
|
1179
1179
|
* Copyright 2020 Google LLC
|
|
1180
1180
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1181
|
-
*/const
|
|
1181
|
+
*/const ah=Ce(class extends We{constructor(i){if(super(i),i.type!==Kt.PROPERTY&&i.type!==Kt.ATTRIBUTE&&i.type!==Kt.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!ua(i))throw Error("`live` bindings can only contain a single expression")}render(i){return i}update(i,[t]){if(t===$t||t===$)return t;const e=i.element,s=i.name;if(i.type===Kt.PROPERTY){if(t===e[s])return $t}else if(i.type===Kt.BOOLEAN_ATTRIBUTE){if(!!t===e.hasAttribute(s))return $t}else if(i.type===Kt.ATTRIBUTE&&e.getAttribute(s)===t+"")return $t;return ga(i),t}});var nh=Object.defineProperty,rh=Object.getOwnPropertyDescriptor,Ei=(i,t,e,s)=>{for(var a=s>1?void 0:s?rh(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&nh(t,e,a),a};let ei=class extends D{constructor(){super(),this.inputRef=P(),this.helptextSlot=P(),this.value="",this.autocomplete="off",this.rows=null,this.counterCurrent=0,this.slotController=new pt(this,this.helptextSlot)}attributeChangedCallback(t,e,s){t==="value"&&this.value!==e&&(this.counterCurrent=s?s.length:0,this.valueChanged(s,e)),super.attributeChangedCallback(t,e,s)}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=A({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),e=this.ariaLabelledby||`${this.id}-input-label`;return u`<pkt-input-wrapper
|
|
1182
1182
|
label=${this.label}
|
|
1183
1183
|
?counter=${this.counter}
|
|
1184
1184
|
?disabled=${this.disabled}
|
|
@@ -1207,10 +1207,10 @@
|
|
|
1207
1207
|
class=${t}
|
|
1208
1208
|
id=${this.id+"-input"}
|
|
1209
1209
|
name=${(this.name||this.id)+"-input"}
|
|
1210
|
-
placeholder=${
|
|
1211
|
-
.value=${
|
|
1212
|
-
minlength=${
|
|
1213
|
-
maxlength=${
|
|
1210
|
+
placeholder=${T(this.placeholder)}
|
|
1211
|
+
.value=${ah(this.value)}
|
|
1212
|
+
minlength=${T(this.minlength)}
|
|
1213
|
+
maxlength=${T(this.maxlength)}
|
|
1214
1214
|
?readonly=${this.readonly}
|
|
1215
1215
|
autocomplete=${this.autocomplete}
|
|
1216
1216
|
aria-labelledby=${e}
|
|
@@ -1223,7 +1223,7 @@
|
|
|
1223
1223
|
@focus=${s=>{this.onFocus(),s.stopImmediatePropagation()}}
|
|
1224
1224
|
@blur=${s=>{this.value=s.target.value,this.onBlur(),s.stopImmediatePropagation()}}
|
|
1225
1225
|
></textarea>
|
|
1226
|
-
</pkt-input-wrapper>`}};Ei([o({type:String,reflect:!0})],ei.prototype,"value",2),Ei([o({type:String})],ei.prototype,"autocomplete",2),Ei([o({type:Number})],ei.prototype,"rows",2),Ei([U()],ei.prototype,"counterCurrent",2),ei=Ei([
|
|
1226
|
+
</pkt-input-wrapper>`}};Ei([o({type:String,reflect:!0})],ei.prototype,"value",2),Ei([o({type:String})],ei.prototype,"autocomplete",2),Ei([o({type:Number})],ei.prototype,"rows",2),Ei([U()],ei.prototype,"counterCurrent",2),ei=Ei([j("pkt-textarea")],ei);var oh=Object.defineProperty,lh=Object.getOwnPropertyDescriptor,se=(i,t,e,s)=>{for(var a=s>1?void 0:s?lh(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&oh(t,e,a),a};let Zt=class extends D{constructor(){super(),this.inputRef=P(),this.helptextSlot=P(),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 pt(this,this.helptextSlot)}attributeChangedCallback(t,e,s){t==="value"&&this.value!==e&&(this.counterCurrent=s?s.length:0,this.valueChanged(s,e)),super.attributeChangedCallback(t,e,s)}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=A({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),s=this.ariaLabelledby||`${this.id}-input-label`;return u`
|
|
1227
1227
|
<pkt-input-wrapper
|
|
1228
1228
|
label="${this.label}"
|
|
1229
1229
|
?counter=${this.counter}
|
|
@@ -1250,23 +1250,23 @@
|
|
|
1250
1250
|
>
|
|
1251
1251
|
<div class="pkt-contents" ${O(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1252
1252
|
<div class="pkt-input__container">
|
|
1253
|
-
${this.prefix?u`<div class="pkt-input-prefix">${this.prefix}</div
|
|
1253
|
+
${this.prefix?u`<div class="pkt-input-prefix">${this.prefix}</div>`:$}
|
|
1254
1254
|
<input
|
|
1255
1255
|
${O(this.inputRef)}
|
|
1256
1256
|
class=${e}
|
|
1257
1257
|
type=${this.type}
|
|
1258
1258
|
name=${(this.name||this.id)+"-input"}
|
|
1259
1259
|
id=${this.id+"-input"}
|
|
1260
|
-
placeholder=${
|
|
1260
|
+
placeholder=${T(this.placeholder)}
|
|
1261
1261
|
aria-labelledby=${s}
|
|
1262
1262
|
autocomplete=${this.autocomplete||"off"}
|
|
1263
|
-
minlength=${
|
|
1264
|
-
maxlength=${
|
|
1265
|
-
min=${
|
|
1266
|
-
max=${
|
|
1267
|
-
step=${
|
|
1263
|
+
minlength=${T(this.minlength||void 0)}
|
|
1264
|
+
maxlength=${T(this.maxlength||void 0)}
|
|
1265
|
+
min=${T(this.min||void 0)}
|
|
1266
|
+
max=${T(this.max||void 0)}
|
|
1267
|
+
step=${T(this.step||void 0)}
|
|
1268
1268
|
?readonly=${this.readonly}
|
|
1269
|
-
size=${this.size
|
|
1269
|
+
size=${this.size||$}
|
|
1270
1270
|
.value=${this.value}
|
|
1271
1271
|
?disabled=${this.disabled}
|
|
1272
1272
|
aria-invalid=${this.hasError}
|
|
@@ -1282,17 +1282,17 @@
|
|
|
1282
1282
|
${this.iconNameRight?u`<pkt-icon
|
|
1283
1283
|
class="pkt-input-suffix-icon"
|
|
1284
1284
|
name=${this.iconNameRight}
|
|
1285
|
-
></pkt-icon
|
|
1285
|
+
></pkt-icon>`:$}
|
|
1286
1286
|
${t?u`<pkt-icon
|
|
1287
1287
|
class="pkt-input-suffix-icon"
|
|
1288
1288
|
name="magnifying-glass-big"
|
|
1289
|
-
></pkt-icon
|
|
1290
|
-
</div
|
|
1291
|
-
${!this.suffix&&this.iconNameRight?u`<pkt-icon class="pkt-input-icon" name=${this.iconNameRight}></pkt-icon
|
|
1292
|
-
${!this.suffix&&t?u`<pkt-icon class="pkt-input-icon" name="magnifying-glass-big"></pkt-icon
|
|
1289
|
+
></pkt-icon>`:$}
|
|
1290
|
+
</div>`:$}
|
|
1291
|
+
${!this.suffix&&this.iconNameRight?u`<pkt-icon class="pkt-input-icon" name=${this.iconNameRight}></pkt-icon>`:$}
|
|
1292
|
+
${!this.suffix&&t?u`<pkt-icon class="pkt-input-icon" name="magnifying-glass-big"></pkt-icon>`:$}
|
|
1293
1293
|
</div>
|
|
1294
1294
|
</pkt-input-wrapper>
|
|
1295
|
-
`}};se([o({type:String,reflect:!0})],Zt.prototype,"value",2),se([o({type:String})],Zt.prototype,"type",2),se([o({type:Number})],Zt.prototype,"size",2),se([o({type:String})],Zt.prototype,"autocomplete",2),se([o({type:String})],Zt.prototype,"iconNameRight",2),se([o({type:String})],Zt.prototype,"prefix",2),se([o({type:String})],Zt.prototype,"suffix",2),se([o({type:Boolean})],Zt.prototype,"omitSearchIcon",2),se([U()],Zt.prototype,"counterCurrent",2),Zt=se([
|
|
1295
|
+
`}};se([o({type:String,reflect:!0})],Zt.prototype,"value",2),se([o({type:String})],Zt.prototype,"type",2),se([o({type:Number})],Zt.prototype,"size",2),se([o({type:String})],Zt.prototype,"autocomplete",2),se([o({type:String})],Zt.prototype,"iconNameRight",2),se([o({type:String})],Zt.prototype,"prefix",2),se([o({type:String})],Zt.prototype,"suffix",2),se([o({type:Boolean})],Zt.prototype,"omitSearchIcon",2),se([U()],Zt.prototype,"counterCurrent",2),Zt=se([j("pkt-textinput")],Zt);var hh=Object.defineProperty,dh=Object.getOwnPropertyDescriptor,is=(i,t,e,s)=>{for(var a=s>1?void 0:s?dh(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&hh(t,e,a),a};let Pi=class extends D{constructor(){super(),this.inputRef=P(),this.helptextSlot=P(),this._optionsProp=[],this.value="",this._options=[],this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new Ua(this),this.slotController=new pt(this,this.helptextSlot),this.slotController.skipOptions=!0}get options(){return this._options.map(t=>({...t,selected:t.value===this.value}))}set options(t){this._optionsProp=t,this.requestUpdate("_optionsProp",this._options)}connectedCallback(){super.connectedCallback();const t=this._optionsProp.length>0,e=this.optionsController.nodes.length&&this.optionsController.nodes.length>0;!t&&e?this.optionsController.nodes.forEach(s=>{const a={value:s.hasAttribute("value")?s.getAttribute("value")??"":s.textContent??"",label:s.textContent||s.getAttribute("value")||"",disabled:s.hasAttribute("disabled"),selected:s.hasAttribute("selected"),hidden:s.hasAttribute("data-hidden")};s.getAttribute("selected")&&!this.value&&(this.value=a.value),this._options.push(a)}):(this._options=this._optionsProp,this._options.forEach(s=>{s.selected&&!this.value&&(this.value=s.value)}))}add(t,e){const s={value:t.value||t.text,label:t.text||t.value,selected:t.selected,disabled:t.disabled};if(e===void 0)this._options.push(s);else if(typeof e=="number")this._options.splice(e,0,s);else{const a=e.value||e.text,n=this._options.findIndex(r=>r.value===a);n>=0?this._options.splice(n,0,s):this._options.push(s)}t.selected&&(this.value=t.value||t.text,this.selectedIndex=this._options.findIndex(a=>a.value===this.value)),this.requestUpdate()}remove(t){var e;typeof t=="number"&&(this.selectedIndex===t&&(this.value=((e=this._options[0])==null?void 0:e.value)||""),this._options.splice(t,1),this.requestUpdate())}item(t){var e;return(e=this.inputRef.value)==null?void 0:e.item(t)}namedItem(t){var e;return(e=this.inputRef.value)==null?void 0:e.namedItem(t)}showPicker(){this.inputRef.value&&"showPicker"in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(t,e,s){var a,n;t==="options"&&(this._options=s?JSON.parse(s):[]),t==="value"&&this.value!==e&&(this.selectedIndex=this.touched?this.returnNumberOrNull((a=this.inputRef.value)==null?void 0:a.selectedIndex):this._options.findIndex(r=>r.value===s),this.selectedOptions=(n=this.inputRef.value)==null?void 0:n.selectedOptions,this.valueChanged(s,e)),super.attributeChangedCallback(t,e,s)}update(t){var e,s;super.update(t),t.has("_optionsProp")&&this._optionsProp.length>0&&(this._options=this._optionsProp,this.requestUpdate("_options"),!this.value&&this._options.length>0&&(this.value=this._options[0].value,this.selectedIndex=0)),t.has("value")&&this.value!==t.get("value")&&(this.selectedIndex=this.touched?this.returnNumberOrNull((e=this.inputRef.value)==null?void 0:e.selectedIndex):this._options.findIndex(a=>a.value===this.value),this.selectedOptions=(s=this.inputRef.value)==null?void 0:s.selectedOptions,this.valueChanged(this.value,t.get("value"))),t.has("id")&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(t){var e;super.firstUpdated(t),this._optionsProp.length&&(this._options=this._optionsProp),!this.value&&this._options.length>0?(this.value=this._options[0].value,this.selectedIndex=0):this.selectedIndex=this._options.findIndex(s=>s.value===this.value),this.selectedOptions=(e=this.inputRef.value)==null?void 0:e.selectedOptions}render(){const t=`pkt-input ${this.fullwidth?"pkt-input--fullwidth":""}`;return u`
|
|
1296
1296
|
<pkt-input-wrapper
|
|
1297
1297
|
?counter=${this.counter}
|
|
1298
1298
|
?disabled=${this.disabled}
|
|
@@ -1302,23 +1302,23 @@
|
|
|
1302
1302
|
?optionalTag=${this.optionalTag}
|
|
1303
1303
|
?requiredTag=${this.requiredTag}
|
|
1304
1304
|
?useWrapper=${this.useWrapper}
|
|
1305
|
-
ariaDescribedBy=${
|
|
1305
|
+
ariaDescribedBy=${T(this.ariaDescribedBy)}
|
|
1306
1306
|
class="pkt-select"
|
|
1307
|
-
errorMessage=${
|
|
1307
|
+
errorMessage=${T(this.errorMessage)}
|
|
1308
1308
|
forId=${this.id+"-input"}
|
|
1309
|
-
helptext=${
|
|
1310
|
-
helptextDropdown=${
|
|
1311
|
-
helptextDropdownButton=${
|
|
1312
|
-
label=${
|
|
1313
|
-
optionalText=${
|
|
1314
|
-
requiredText=${
|
|
1315
|
-
tagText=${
|
|
1309
|
+
helptext=${T(this.helptext)}
|
|
1310
|
+
helptextDropdown=${T(this.helptextDropdown)}
|
|
1311
|
+
helptextDropdownButton=${T(this.helptextDropdownButton)}
|
|
1312
|
+
label=${T(this.label)}
|
|
1313
|
+
optionalText=${T(this.optionalText)}
|
|
1314
|
+
requiredText=${T(this.requiredText)}
|
|
1315
|
+
tagText=${T(this.tagText)}
|
|
1316
1316
|
>
|
|
1317
1317
|
<select
|
|
1318
1318
|
class=${t}
|
|
1319
1319
|
aria-invalid=${this.hasError}
|
|
1320
1320
|
aria-errormessage=${`${this.id}-error`}
|
|
1321
|
-
aria-labelledby=${
|
|
1321
|
+
aria-labelledby=${T(this.ariaLabelledby)}
|
|
1322
1322
|
?disabled=${this.disabled}
|
|
1323
1323
|
id=${this.id+"-input"}
|
|
1324
1324
|
name=${(this.name||this.id)+"-input"}
|
|
@@ -1340,7 +1340,7 @@
|
|
|
1340
1340
|
</select>
|
|
1341
1341
|
<div class="pkt-contents" ${O(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1342
1342
|
</pkt-input-wrapper>
|
|
1343
|
-
`}returnNumberOrNull(t){return t==null||isNaN(t)?null:t}};is([o({type:Array,attribute:"options"})],
|
|
1343
|
+
`}returnNumberOrNull(t){return t==null||isNaN(t)?null:t}};is([o({type:Array,attribute:"options"})],Pi.prototype,"_optionsProp",2),is([o({type:String})],Pi.prototype,"value",2),is([U()],Pi.prototype,"_options",2),Pi=is([j("pkt-select")],Pi);var ph=Object.defineProperty,ch=Object.getOwnPropertyDescriptor,Oi=(i,t,e,s)=>{for(var a=s>1?void 0:s?ch(t,e):t,n=i.length-1,r;n>=0;n--)(r=i[n])&&(a=(s?r(t,e,a):r(a))||a);return s&&a&&ph(t,e,a),a};let ii=class extends Y{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=P(),this.namedSlot=P(),this.slotController=new pt(this,this.defaultSlot,this.namedSlot)}connectedCallback(){this.strings.length&&this.strings.forEach(i=>{this._list.push(i.toUpperCase())}),super.connectedCallback()}render(){const i={"pkt-component":!0,"pkt-component--has-list":this.strings.length>0,"pkt-darkmode":this.darkmode};return u`
|
|
1344
1344
|
<div class="${A(i)}">
|
|
1345
1345
|
<h1 class="pkt-txt-28">${this.string}</h1>
|
|
1346
1346
|
|
|
@@ -1361,15 +1361,15 @@
|
|
|
1361
1361
|
|
|
1362
1362
|
<h2 class="pkt-txt-22">Knapp som emitter en event</h2>
|
|
1363
1363
|
<button type="button" @click=${()=>this.handleGreeting()}>
|
|
1364
|
-
Si ${
|
|
1364
|
+
Si ${bt.example.hi}
|
|
1365
1365
|
</button>
|
|
1366
1366
|
</div>
|
|
1367
1367
|
`}renderList(i){return u`
|
|
1368
1368
|
<ul>
|
|
1369
1369
|
${i.map(t=>u`<li>${t}</li>`)}
|
|
1370
1370
|
</ul>
|
|
1371
|
-
`}doStuff(i){return i.reverse()}handleGreeting(){this.dispatchEvent(new CustomEvent("pkt-greeting",{detail:"Hei på deg!"}))}};Mi([o({type:String})],ii.prototype,"string",2),Mi([o({converter:Ba})],ii.prototype,"strings",2),Mi([o({type:Boolean})],ii.prototype,"darkmode",2),Mi([o({type:Array})],ii.prototype,"_list",2),ii=Mi([H("pkt-component")],ii);const F=gt({tagName:"pkt-icon",elementClass:Ae,react:w,displayName:"PktIcon",events:{}}),za=w.forwardRef(({defaultOpen:i=!1,id:t,title:e,skin:s,compact:a=!1,isOpen:n,children:r,name:h,className:d,onClick:c,onToggle:v},m)=>{const[b,y]=w.useState(i),{name:_}=_n(),x=h||_,M=n!==void 0?n:b;w.useEffect(()=>{n===void 0&&y(i)},[i,n]);const R=T=>{const J=T.currentTarget.open;n===void 0&&y(J),v==null||v(T)},S=T=>{setTimeout(()=>{c==null||c(T)},0)},V=["pkt-accordion-item",a&&"pkt-accordion-item--compact",s&&`pkt-accordion-item--${s}`,d].filter(Boolean).join(" ");return l.jsxs("details",{ref:m,className:V,id:t,open:M,onClick:S,name:x,onToggle:R,children:[l.jsxs("summary",{className:"pkt-accordion-item__title",id:`pkt-accordion-item-summary-${t}`,children:[e,l.jsx(F,{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})})]})});za.displayName="PktAccordionItem";const ph=gt({tagName:"pkt-alert",elementClass:Ut,react:js,displayName:"PktAlert",events:{onClose:"close"}}),Os=w.forwardRef(({children:i,...t},e)=>l.jsx(ph,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",children:i})}));Os.displayName="PktAlert";const Wa=gt({tagName:"pkt-backlink",elementClass:Ge,react:w,displayName:"PktBackLink"});Wa.displayName="PktBackLink";const ch=w.forwardRef(({breadcrumbs:i,navigationType:t,className:e,...s},a)=>{const n=i,r=n[n.length-2],h=[e,"pkt-breadcrumbs"].filter(Boolean).join(" ");return l.jsxs("nav",{ref:a,"aria-label":"brødsmulemeny",className:h,children:[l.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:n.map((d,c)=>l.jsx("li",{className:"pkt-breadcrumbs__item",children:c===n.length-1?l.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:l.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})}):t==="router"?l.jsxs(Vs.Link,{to:d.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...s,children:[l.jsx(F,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})]}):l.jsxs("a",{href:d.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...s,children:[l.jsx(F,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})]})},`breadcrumb-${c}`))}),t==="router"?l.jsxs(Vs.Link,{to:r.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...s,children:[l.jsx(F,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:r.text})]}):l.jsxs("a",{href:r.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...s,children:[l.jsx(F,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:r.text})]})]})});window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/13.7/animations/";const si=w.forwardRef(({children:i,className:t,iconName:e="user",secondIconName:s="user",size:a="medium",skin:n="primary",type:r="button",variant:h="label-only",state:d,color:c,isLoading:v=void 0,disabled:m=void 0,loadingAnimationPath:b=window.pktAnimationPath,...y},_)=>{const x=[t,"pkt-btn",a&&`pkt-btn--${a}`,n&&`pkt-btn--${n}`,h&&`pkt-btn--${h}`,c&&`pkt-btn--${c}`,d&&`pkt-btn--${d}`,v&&"pkt-btn--isLoading"].filter(Boolean).join(" ");return l.jsxs("button",{...y,"aria-busy":v||void 0,"aria-disabled":m||void 0,disabled:m,className:x,type:r,ref:_,children:[v&&l.jsx(F,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:b}),h!=="label-only"&&l.jsx(F,{className:"pkt-btn__icon",name:e}),l.jsx("span",{className:"pkt-btn__text",children:i}),h==="icons-right-and-left"&&l.jsx(F,{className:"pkt-btn__icon",name:s})]})});si.displayName="PktButton";const uh=gt({tagName:"pkt-card",elementClass:ot,react:w,displayName:"PktCard",events:{}}),Ra=w.forwardRef(({children:i,...t},e)=>l.jsx(uh,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:i})}));Ra.displayName="PktCard";const Ka=w.forwardRef(({id:i,hasTile:t=!1,disabled:e=!1,label:s,checkHelptext:a,hasError:n=!1,className:r,isSwitch:h=!1,hideLabel:d=!1,labelPosition:c="right",defaultChecked:v,checked:m,optionalTag:b,optionalText:y="Valgfritt",requiredTag:_,requiredText:x="Må fylles ut",tagText:M,...R},S)=>{const V=[r,"pkt-input-check"].filter(Boolean).join(" "),T=["pkt-input-check__input-label",e?"pkt-input-check__input-label--disabled":"",`pkt-input-check__input-label--${c}`,d?"pkt-sr-only":""].filter(Boolean).join(" "),G=["pkt-input-check__input",t?"pkt-input-check__input--tile":"",e&&t?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),J=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),Lt=()=>l.jsxs(l.Fragment,{children:[M&&l.jsx("span",{className:J+" pkt-tag--gray",children:M}),b&&l.jsx("span",{className:J+" pkt-tag--blue-light",children:y}),_&&l.jsx("span",{className:J+" pkt-tag--beige",children:x})]});return l.jsx("div",{className:V,children:l.jsxs("div",{className:G,children:[c==="left"&&l.jsxs("label",{className:T,htmlFor:i,children:[s," ",Lt(),a&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:a})]}),l.jsx("input",{role:h?"switch":"checkbox",ref:S,className:`pkt-input-check__input-checkbox ${n?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:i,disabled:e,...m!==void 0?{checked:m}:{defaultChecked:v},...R}),c==="right"&&l.jsxs("label",{className:T,htmlFor:i,children:[s," ",Lt(),a&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:a})]})]})})});Ka.displayName="PktCheckbox";const fh=gt({tagName:"pkt-combobox",elementClass:Q,react:w,displayName:"PktCombobox",events:{onClick:"click",onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"valueChange",onToggleHelpText:"toggleHelpText"}}),Ga=w.forwardRef(({children:i,helptext:t,...e},s)=>l.jsxs(fh,{...e,ref:s,children:[t&&l.jsx("div",{slot:"helptext",className:"pkt-contents",children:t}),i]}));Ga.displayName="PktCombobox";const ss=gt({tagName:"pkt-consent",elementClass:zt,react:w,displayName:"PktConsent",events:{onToggleConsent:"toggle-consent"}});ss.displayName="PktConsent";const gh=gt({tagName:"pkt-datepicker",elementClass:et,react:w,displayName:"PktDatepicker",events:{onChange:"change",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),Ya=w.forwardRef(({helptext:i,...t},e)=>l.jsx(gh,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",slot:"helptext",children:i})}));Ya.displayName="PktDatepicker";const mh=({columnOne:i,columnTwo:t,socialLinks:e,className:s,openLinksInNewTab:a=!1,personvernOgInfoLink:n="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:r="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:h=!1,hotjarId:d=null,googleAnalyticsId:c=null,devMode:v=!1,cookieDomain:m=null,cookieSecure:b=null,cookieExpiryDays:y=null,onToggleConsent:_=x=>{console.log(x.detail)}})=>{var M,R;const x=[s,"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:i.title}),l.jsxs("ul",{className:"pkt-footer__list",children:[i.text&&l.jsx("li",{className:"pkt-footer__text",children:i.text}),(M=i.links)==null?void 0:M.map((S,V)=>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||a?"_blank":"_self",rel:S.openInNewTab||a?"noopener noreferrer":void 0,children:[l.jsx(F,{className:"pkt-footer__link-icon",name:"chevron-right"}),S.text]})},`links-${V}`))]})]}),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}),(R=t.links)==null?void 0:R.map((S,V)=>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||a?"_blank":"_self",rel:S.openInNewTab||a?"noopener noreferrer":void 0,children:[l.jsx(F,{className:"pkt-footer__link-icon",name:"chevron-right"}),S.text]})},`links-${V}`))]})]}),l.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l.jsx("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),l.jsxs("ul",{className:"pkt-footer__list",children:[l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:"pkt-footer__link",href:n,target:a?"_blank":"_self",rel:a?"noopener noreferrer":void 0,children:[l.jsx(F,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:"pkt-footer__link",href:r,target:a?"_blank":"_self",rel:a?"noopener noreferrer":void 0,children:[l.jsx(F,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),h&&l.jsx("li",{className:"pkt-footer__list-item",children:l.jsx(ss,{triggerType:"footerlink",hotjarId:d,googleAnalyticsId:c,devMode:v,cookieDomain:m,cookieSecure:b,cookieExpiryDays:y,onToggleConsent:_})})]})]})]}),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,V)=>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||a?"_blank":"_self",rel:S.openInNewTab||a?"noopener noreferrer":void 0,children:S.language})},`sociallinks-language-${V}`))}),l.jsx("div",{className:"pkt-footer__social-icons",children:e.filter(S=>S.iconName).map((S,V)=>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||a?"_blank":"_self",rel:S.openInNewTab||a?"noopener noreferrer":void 0,children:l.jsx(F,{className:"pkt-footer__social-icon",name:S.iconName})})},`sociallinks-${V}`))})]})]})})},vh=({links:i=[],openLinksInNewTab:t=!1,personvernOgInfoLink:e="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:s="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:a=!1,hotjarId:n=null,googleAnalyticsId:r=null,devMode:h=!1,cookieDomain:d=null,cookieSecure:c=null,cookieExpiryDays:v=null,onToggleConsent:m=y=>{console.log(y.detail)},className:b})=>{const y=[b,"pkt-footer-simple"].filter(Boolean).join(" ");return l.jsx("footer",{className:y,"data-mode":"dark",children:l.jsx("div",{className:"pkt-footer-simple__container",children:l.jsxs("ul",{className:"pkt-footer-simple__list",children:[i.map((_,x)=>l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:`pkt-footer-simple__link ${_.external?" pkt-link--external":""}`,href:_.href,target:_.openInNewTab||t?"_blank":"_self",rel:_.openInNewTab||t?"noopener noreferrer":void 0,children:[l.jsx(F,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),_.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(F,{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:s,target:t?"_blank":"_self",rel:t?"noopener noreferrer":void 0,children:[l.jsx(F,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),a&&l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsx(ss,{triggerType:"footerlink",hotjarId:n,googleAnalyticsId:r,devMode:h,cookieDomain:d,cookieSecure:c,cookieExpiryDays:v,onToggleConsent:m})})]})})})};function yh(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Ms={exports:{}};/*!
|
|
1371
|
+
`}doStuff(i){return i.reverse()}handleGreeting(){this.dispatchEvent(new CustomEvent("pkt-greeting",{detail:"Hei på deg!"}))}};Oi([o({type:String})],ii.prototype,"string",2),Oi([o({converter:Fa})],ii.prototype,"strings",2),Oi([o({type:Boolean})],ii.prototype,"darkmode",2),Oi([o({type:Array})],ii.prototype,"_list",2),ii=Oi([j("pkt-component")],ii);const q=gt({tagName:"pkt-icon",elementClass:Ne,react:x,displayName:"PktIcon",events:{}}),Wa=x.forwardRef(({defaultOpen:i=!1,id:t,title:e,skin:s,compact:a=!1,isOpen:n,children:r,name:h,className:d,onClick:c,onToggle:v},g)=>{const[k,b]=x.useState(i),{name:y}=xn(),w=h||y,S=n!==void 0?n:k;x.useEffect(()=>{n===void 0&&b(i)},[i,n]);const M=N=>{const J=N.currentTarget.open;n===void 0&&b(J),v==null||v(N)},C=N=>{setTimeout(()=>{c==null||c(N)},0)},V=["pkt-accordion-item",a&&"pkt-accordion-item--compact",s&&`pkt-accordion-item--${s}`,d].filter(Boolean).join(" ");return l.jsxs("details",{ref:g,className:V,id:t,open:S,onClick:C,name:w,onToggle:M,children:[l.jsxs("summary",{className:"pkt-accordion-item__title",id:`pkt-accordion-item-summary-${t}`,children:[e,l.jsx(q,{name:"chevron-thin-down",className:"pkt-accordion-item__icon","aria-hidden":"true"})]}),l.jsx("div",{className:"pkt-accordion-item__content",id:`pkt-accordion-item__content-${t}`,role:"region",children:l.jsx("div",{className:"pkt-accordion-item__content-inner",children:r})})]})});Wa.displayName="PktAccordionItem";const uh=gt({tagName:"pkt-alert",elementClass:Ut,react:js,displayName:"PktAlert",events:{onClose:"close"}}),Es=x.forwardRef(({children:i,...t},e)=>l.jsx(uh,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",children:i})}));Es.displayName="PktAlert";const Ra=gt({tagName:"pkt-backlink",elementClass:Ge,react:x,displayName:"PktBackLink"});Ra.displayName="PktBackLink";const fh=x.forwardRef(({breadcrumbs:i,navigationType:t,className:e,...s},a)=>{const n=i,r=n[n.length-2],h=[e,"pkt-breadcrumbs"].filter(Boolean).join(" ");return l.jsxs("nav",{ref:a,"aria-label":"brødsmulemeny",className:h,children:[l.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:n.map((d,c)=>l.jsx("li",{className:"pkt-breadcrumbs__item",children:c===n.length-1?l.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:l.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})}):t==="router"?l.jsxs(Hs.Link,{to:d.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...s,children:[l.jsx(q,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})]}):l.jsxs("a",{href:d.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...s,children:[l.jsx(q,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})]})},`breadcrumb-${c}`))}),t==="router"?l.jsxs(Hs.Link,{to:r.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...s,children:[l.jsx(q,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:r.text})]}):l.jsxs("a",{href:r.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...s,children:[l.jsx(q,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:r.text})]})]})});window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/13.8/animations/";const si=x.forwardRef(({children:i,className:t,iconName:e="user",secondIconName:s="user",size:a="medium",skin:n="primary",type:r="button",variant:h="label-only",state:d,color:c,isLoading:v=void 0,disabled:g=void 0,loadingAnimationPath:k=window.pktAnimationPath,...b},y)=>{const w=[t,"pkt-btn",a&&`pkt-btn--${a}`,n&&`pkt-btn--${n}`,h&&`pkt-btn--${h}`,c&&`pkt-btn--${c}`,d&&`pkt-btn--${d}`,v&&"pkt-btn--isLoading"].filter(Boolean).join(" ");return l.jsxs("button",{...b,"aria-busy":v||void 0,"aria-disabled":g||void 0,disabled:g,className:w,type:r,ref:y,children:[v&&l.jsx(q,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:k}),h!=="label-only"&&l.jsx(q,{className:"pkt-btn__icon",name:e}),l.jsx("span",{className:"pkt-btn__text",children:i}),h==="icons-right-and-left"&&l.jsx(q,{className:"pkt-btn__icon",name:s})]})});si.displayName="PktButton";const gh=gt({tagName:"pkt-card",elementClass:ot,react:x,displayName:"PktCard",events:{}}),Ka=x.forwardRef(({children:i,...t},e)=>l.jsx(gh,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:i})}));Ka.displayName="PktCard";const Ga=x.forwardRef(({id:i,hasTile:t=!1,disabled:e=!1,label:s,checkHelptext:a,hasError:n=!1,className:r,isSwitch:h=!1,hideLabel:d=!1,labelPosition:c="right",defaultChecked:v,checked:g,optionalTag:k,optionalText:b="Valgfritt",requiredTag:y,requiredText:w="Må fylles ut",tagText:S,...M},C)=>{const V=[r,"pkt-input-check"].filter(Boolean).join(" "),N=["pkt-input-check__input-label",e?"pkt-input-check__input-label--disabled":"",`pkt-input-check__input-label--${c}`,d?"pkt-sr-only":""].filter(Boolean).join(" "),G=["pkt-input-check__input",t?"pkt-input-check__input--tile":"",e&&t?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),J=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),Lt=()=>l.jsxs(l.Fragment,{children:[S&&l.jsx("span",{className:J+" pkt-tag--gray",children:S}),k&&l.jsx("span",{className:J+" pkt-tag--blue-light",children:b}),y&&l.jsx("span",{className:J+" pkt-tag--beige",children:w})]});return l.jsx("div",{className:V,children:l.jsxs("div",{className:G,children:[c==="left"&&l.jsxs("label",{className:N,htmlFor:i,children:[s," ",Lt(),a&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:a})]}),l.jsx("input",{role:h?"switch":"checkbox",ref:C,className:`pkt-input-check__input-checkbox ${n?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:i,disabled:e,...g!==void 0?{checked:g}:{defaultChecked:v},...M}),c==="right"&&l.jsxs("label",{className:N,htmlFor:i,children:[s," ",Lt(),a&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:a})]})]})})});Ga.displayName="PktCheckbox";const mh=gt({tagName:"pkt-combobox",elementClass:Q,react:x,displayName:"PktCombobox",events:{onClick:"click",onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),Ya=x.forwardRef(({children:i,helptext:t,...e},s)=>l.jsxs(mh,{...e,ref:s,children:[t&&l.jsx("div",{slot:"helptext",className:"pkt-contents",children:t}),i]}));Ya.displayName="PktCombobox";const ss=gt({tagName:"pkt-consent",elementClass:zt,react:x,displayName:"PktConsent",events:{onToggleConsent:"toggle-consent"}});ss.displayName="PktConsent";const vh=gt({tagName:"pkt-datepicker",elementClass:et,react:x,displayName:"PktDatepicker",events:{onChange:"change",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),Za=x.forwardRef(({helptext:i,...t},e)=>l.jsx(vh,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",slot:"helptext",children:i})}));Za.displayName="PktDatepicker";const bh=({columnOne:i,columnTwo:t,socialLinks:e,className:s,openLinksInNewTab:a=!1,personvernOgInfoLink:n="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:r="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:h=!1,hotjarId:d=null,googleAnalyticsId:c=null,devMode:v=!1,cookieDomain:g=null,cookieSecure:k=null,cookieExpiryDays:b=null,onToggleConsent:y=w=>{console.log(w.detail)}})=>{var S,M;const w=[s,"pkt-footer"].filter(Boolean).join(" ");return l.jsx("footer",{className:w,"data-mode":"dark",children:l.jsxs("div",{className:"pkt-footer__container",children:[l.jsxs("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[l.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l.jsx("h2",{className:"pkt-footer__title",children:i.title}),l.jsxs("ul",{className:"pkt-footer__list",children:[i.text&&l.jsx("li",{className:"pkt-footer__text",children:i.text}),(S=i.links)==null?void 0:S.map((C,V)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${C.external?"pkt-link--external":""}`,href:C.href,target:C.openInNewTab||a?"_blank":"_self",rel:C.openInNewTab||a?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer__link-icon",name:"chevron-right"}),C.text]})},`links-${V}`))]})]}),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((C,V)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${C.external?"pkt-link--external":""}`,href:C.href,target:C.openInNewTab||a?"_blank":"_self",rel:C.openInNewTab||a?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer__link-icon",name:"chevron-right"}),C.text]})},`links-${V}`))]})]}),l.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l.jsx("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),l.jsxs("ul",{className:"pkt-footer__list",children:[l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:"pkt-footer__link",href:n,target:a?"_blank":"_self",rel:a?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:"pkt-footer__link",href:r,target:a?"_blank":"_self",rel:a?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),h&&l.jsx("li",{className:"pkt-footer__list-item",children:l.jsx(ss,{triggerType:"footerlink",hotjarId:d,googleAnalyticsId:c,devMode:v,cookieDomain:g,cookieSecure:k,cookieExpiryDays:b,onToggleConsent:y})})]})]})]}),e&&l.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[l.jsx("div",{className:"pkt-footer__social-languages",children:e.filter(C=>C.language).map((C,V)=>l.jsx("div",{className:"pkt-footer__social-language",children:l.jsx("a",{href:C.href,"aria-label":`til ${C.language} versjon av nettsiden`,target:C.openInNewTab||a?"_blank":"_self",rel:C.openInNewTab||a?"noopener noreferrer":void 0,children:C.language})},`sociallinks-language-${V}`))}),l.jsx("div",{className:"pkt-footer__social-icons",children:e.filter(C=>C.iconName).map((C,V)=>l.jsx(x.Fragment,{children:l.jsx("a",{href:C.href,"aria-label":`til ${C.iconName}`,className:"pkt-footer__social-icon-link",target:C.openInNewTab||a?"_blank":"_self",rel:C.openInNewTab||a?"noopener noreferrer":void 0,children:l.jsx(q,{className:"pkt-footer__social-icon",name:C.iconName})})},`sociallinks-${V}`))})]})]})})},yh=({links:i=[],openLinksInNewTab:t=!1,personvernOgInfoLink:e="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:s="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:a=!1,hotjarId:n=null,googleAnalyticsId:r=null,devMode:h=!1,cookieDomain:d=null,cookieSecure:c=null,cookieExpiryDays:v=null,onToggleConsent:g=b=>{console.log(b.detail)},className:k})=>{const b=[k,"pkt-footer-simple"].filter(Boolean).join(" ");return l.jsx("footer",{className:b,"data-mode":"dark",children:l.jsx("div",{className:"pkt-footer-simple__container",children:l.jsxs("ul",{className:"pkt-footer-simple__list",children:[i.map((y,w)=>l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:`pkt-footer-simple__link ${y.external?" pkt-link--external":""}`,href:y.href,target:y.openInNewTab||t?"_blank":"_self",rel:y.openInNewTab||t?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),y.text]})},w)),l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:"pkt-footer-simple__link",href:e,target:t?"_blank":"_self",rel:t?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:"pkt-footer-simple__link",href:s,target:t?"_blank":"_self",rel:t?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),a&&l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsx(ss,{triggerType:"footerlink",hotjarId:n,googleAnalyticsId:r,devMode:h,cookieDomain:d,cookieSecure:c,cookieExpiryDays:v,onToggleConsent:g})})]})})})};function kh(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Ps={exports:{}};/*!
|
|
1372
1372
|
Copyright (c) 2018 Jed Watson.
|
|
1373
1373
|
Licensed under the MIT License (MIT), see
|
|
1374
1374
|
http://jedwatson.github.io/classnames
|
|
1375
|
-
*/var Za;function bh(){return Za||(Za=1,(function(i){(function(){var t={}.hasOwnProperty;function e(){for(var n="",r=0;r<arguments.length;r++){var h=arguments[r];h&&(n=a(n,s(h)))}return n}function s(n){if(typeof n=="string"||typeof n=="number")return n;if(typeof n!="object")return"";if(Array.isArray(n))return e.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var r="";for(var h in n)t.call(n,h)&&n[h]&&(r=a(r,h));return r}function a(n,r){return r?n?n+" "+r:n+r:n}i.exports?(e.default=e,i.exports=e):window.classNames=e})()})(Ms)),Ms.exports}var kh=bh();const Xt=yh(kh),$h=w.forwardRef(({className:i,logoLink:t="https://www.oslo.kommune.no/",serviceName:e,fixed:s=!0,scrollToHide:a=!0,user:n,userMenu:r,representing:h,userOptions:d,userMenuFooter:c,canChangeRepresentation:v=!0,showMenuButton:m=!1,showLogOutButton:b=!1,openMenu:y,logOut:_,changeRepresentation:x,children:M,...R},S)=>{const V=w.useMemo(()=>typeof(n==null?void 0:n.lastLoggedIn)=="string"?n.lastLoggedIn:n!=null&&n.lastLoggedIn?new Date(n.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[n]),[T,G]=w.useState(!1),[J,Lt]=w.useState(0),[Bt,st]=w.useState(!1),nt=w.useRef(null);w.useEffect(()=>(document&&(document.addEventListener("mouseup",Vt),window.addEventListener("scroll",rt)),()=>{document&&(document.removeEventListener("mouseup",Vt),window.removeEventListener("scroll",rt))}));const Ft=()=>{st(!Bt)},Vt=I=>{nt.current&&!nt.current.contains(I.target)&&st(!1)},rt=()=>{if(a){const I=window.pageYOffset||document.documentElement.scrollTop;if(I<0||Math.abs(I-J)<60)return;G(I>J),Lt(I)}};return l.jsxs("header",{...R,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:Xt(i,"pkt-header",{"pkt-header--fixed":s,"pkt-header--scroll-to-hide":a,"pkt-header--hidden":T}),ref:S,children:[l.jsxs("div",{className:"pkt-header__logo",children:[typeof t=="string"?l.jsx("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:t,children:l.jsx(F,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/13.7/logos/"})}):l.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header__logo-link",onClick:t,children:l.jsx(F,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/13.7/logos/"})}),l.jsx("span",{className:"pkt-header__logo-service",translate:"no",children:e})]}),l.jsx("nav",{className:"pkt-header__actions",children:l.jsxs("ul",{className:"pkt-header__actions-row",children:[m&&l.jsx("li",{children:l.jsx(si,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:y,children:"Meny"})}),(n||h)&&l.jsxs("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${Bt&&!T?"pkt-header--open-dropdown":""}`,ref:nt,children:[l.jsxs("button",{className:"pkt-header__user-btn pkt-btn pkt-btn--secondary pkt-btn--icons-right-and-left",type:"button",role:"button","aria-controls":"pktUserDropdown","aria-expanded":Bt,onClick:Ft,children:[l.jsx(F,{name:"user",className:"pkt-btn__icon"}),l.jsx("span",{className:"pkt-header__user-fullname",translate:"no",children:(h==null?void 0:h.name)||(n==null?void 0:n.name)}),l.jsx("span",{className:"pkt-header__user-shortname",translate:"no",children:(h==null?void 0:h.shortname)||(n==null?void 0:n.shortname)}),l.jsx(F,{name:"chevron-thin-down",className:"pkt-btn--closed"}),l.jsx(F,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),l.jsxs("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[n&&l.jsxs("li",{children:[l.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),l.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:n.name}),n.lastLoggedIn&&l.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",l.jsx("time",{children:V})]})]}),r&&l.jsx("li",{children:l.jsx("ul",{className:"pkt-list",children:r.map((I,Tt)=>l.jsx("li",{children:typeof I.target=="string"?l.jsxs("a",{href:I.target,className:"pkt-link",children:[I.iconName&&l.jsx(F,{name:I.iconName,className:"pkt-link__icon"}),I.title]}):l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:I.target,children:[I.iconName&&l.jsx(F,{name:I.iconName,className:"pkt-link__icon"}),I.title]})},`userMenu-${Tt}`))})}),(h||v)&&l.jsxs("li",{children:[h&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),l.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:h.name}),h.orgNumber&&l.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",h.orgNumber]})]}),l.jsx("ul",{className:"pkt-list mt-size-16",children:v&&l.jsx("li",{children:l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:x,children:[l.jsx(F,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),l.jsx("li",{children:l.jsx("ul",{className:"pkt-list",children:(d||!b)&&l.jsxs(l.Fragment,{children:[d==null?void 0:d.map((I,Tt)=>l.jsx("li",{children:typeof I.target=="string"?l.jsxs("a",{href:I.target,className:"pkt-link",children:[I.iconName&&l.jsx(F,{name:I.iconName,className:"pkt-link__icon"}),I.title]}):l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:I.target,children:[I.iconName&&l.jsx(F,{name:I.iconName,className:"pkt-link__icon"}),I.title]})},`userOptions-${Tt}`)),!b&&l.jsx("li",{children:l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:_,children:[l.jsx(F,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),c&&l.jsx("li",{className:"footer",children:l.jsx("ul",{className:"pkt-list-horizontal bordered",children:c.map((I,Tt)=>l.jsx("li",{children:typeof I.target=="string"?l.jsx("a",{href:I.target,className:"pkt-link",children:I.title}):l.jsx("button",{className:"pkt-link-button pkt-link",onClick:I.target,children:I.title})},`userMenuFooter-${Tt}`))})})]})]}),M&&l.jsx("li",{children:M}),b&&l.jsx("li",{children:l.jsx(si,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:_,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),_h=gt({tagName:"pkt-heading",elementClass:Pe,react:w,displayName:"PktHeading"}),Xa=w.forwardRef(({children:i,...t},e)=>l.jsx(_h,{"data-testid":"pkt-heading",...t,ref:e,children:i}));Xa.displayName="PktHeading";const wh=gt({tagName:"pkt-helptext",elementClass:oe,react:w,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),Ja=w.forwardRef(({children:i,...t},e)=>l.jsx(wh,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:i})}));Ja.displayName="PktHelptext";const Qa=w.forwardRef(({label:i,id:t,children:e,...s},a)=>l.jsxs("div",{className:"pkt-form-group",children:[l.jsx("label",{htmlFor:t,className:"pkt-form-label",children:i}),l.jsx("input",{className:"pkt-form-input",id:t,...s,ref:a}),e]}));Qa.displayName="PktInput";const Pi=w.forwardRef(({forId:i,label:t,helptext:e,helptextDropdown:s,helptextDropdownButton:a,counter:n,counterCurrent:r=0,counterMaxLength:h,optionalTag:d=!1,optionalText:c="Valgfritt",requiredTag:v=!1,requiredText:m="Må fylles ut",tagText:b=null,hasError:y=!1,errorMessage:_,disabled:x=!1,inline:M=!1,ariaDescribedby:R,useWrapper:S=!0,children:V,className:T="",hasFieldset:G=!1,role:J="group",counterPosition:Lt="bottom"},Bt)=>{const[st,nt]=w.useState(!1),Ft=R||(e?`${i}-helptext`:void 0),Vt=!!n,rt=Vt&&Lt==="top",I=Vt&&Lt==="bottom",Tt=()=>nt(dt=>!dt),ae=["pkt-inputwrapper",T,y?"pkt-inputwrapper--error":"",x?"pkt-inputwrapper--disabled":"",M?"pkt-inputwrapper--inline":""].filter(Boolean).join(" "),de=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),ne=()=>Vt?l.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":"true",children:[r,h?`/${h}`:""]}):null,Fe=()=>l.jsxs(l.Fragment,{children:[b&&l.jsx("span",{className:de+" pkt-tag--gray",children:b}),d&&l.jsx("span",{className:de+" pkt-tag--blue-light",children:c}),v&&l.jsx("span",{className:de+" pkt-tag--beige",children:m})]}),ri=()=>{const dt=l.jsxs(l.Fragment,{children:[t," ",Fe()]});return S?G?l.jsx("legend",{className:"pkt-inputwrapper__legend",id:`${i}-label`,children:dt}):l.jsx("label",{className:"pkt-inputwrapper__label",htmlFor:i,"aria-describedby":Ft,id:`${i}-label`,children:dt}):l.jsx("label",{htmlFor:i,className:"pkt-sr-only","aria-describedby":Ft,id:`${i}-label`,children:t})},pe=()=>!e&&!s?null:l.jsxs(l.Fragment,{children:[e&&S&&l.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${i}-helptext`,children:e}),s&&l.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[l.jsx(si,{skin:"tertiary",size:"small",variant:"icon-right",iconName:st?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:Tt,children:l.jsx("span",{dangerouslySetInnerHTML:{__html:a??'Les mer <span class="pkt-sr-only">om inputfeltet</span>'}})}),l.jsx("div",{className:`pkt-inputwrapper__helptext ${st?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:s})]})]}),Rt=l.jsxs(l.Fragment,{children:[ri(),pe(),rt&&l.jsx(ne,{}),V,I&&l.jsx(ne,{}),y&&_&&l.jsx("div",{className:"pkt-inputwrapper__alert-wrapper",children:l.jsx(Os,{skin:"error","aria-live":"assertive",role:"alert",id:`${i}-error`,compact:!0,children:_})})]});return l.jsx("div",{className:ae,ref:Bt,role:J,children:G?l.jsx("fieldset",{className:"pkt-inputwrapper__fieldset","aria-describedby":Ft,children:Rt}):l.jsx("div",{className:"pkt-inputwrapper__fieldset",children:Rt})})});Pi.displayName="PktInputWrapper";const xh=gt({tagName:"pkt-link",elementClass:ke,react:w,displayName:"PktLink"}),tn=w.forwardRef(({children:i,...t},e)=>l.jsx(xh,{...t,ref:e,children:l.jsx("span",{className:"pkt-contents",children:i})}));tn.displayName="PktLink";const Sh=gt({tagName:"pkt-linkcard",elementClass:le,react:w,displayName:"PktLinkCard",events:{}}),en=w.forwardRef(({children:i,...t},e)=>l.jsx(Sh,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",children:i})}));en.displayName="PktLinkCard";const Ch=gt({tagName:"pkt-loader",elementClass:Gt,react:w,displayName:"PktLoader",events:{}}),sn=w.forwardRef(({children:i,...t},e)=>l.jsx(Ch,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:i})}));sn.displayName="PktLoader";const Th=gt({tagName:"pkt-messagebox",elementClass:$e,react:w,displayName:"PktMessagebox",events:{onClose:"close"}}),an=w.forwardRef(({children:i,...t},e)=>l.jsx(Th,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:i})}));an.displayName="PktMessagebox";const Ah=gt({tagName:"pkt-modal",elementClass:Dt,react:w,displayName:"PktModal",events:{}}),nn=w.forwardRef(({children:i,...t},e)=>l.jsx(Ah,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:i})}));nn.displayName="PktModal";const Nh=gt({tagName:"pkt-progressbar",elementClass:it,react:w,displayName:"PktProgressbar",events:{}}),rn=w.forwardRef(({children:i,...t},e)=>l.jsx(Nh,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",children:i})}));rn.displayName="PktProgressbar";const on=w.forwardRef(({id:i,name:t,label:e,className:s,hasTile:a=!1,disabled:n=!1,checkHelptext:r,hasError:h=!1,defaultChecked:d,checked:c,optionalTag:v,optionalText:m,requiredTag:b,requiredText:y,tagText:_,...x},M)=>{const R=[s,"pkt-input-check"].filter(Boolean).join(" "),S=["pkt-input-check__input",a?"pkt-input-check__input--tile":"",n&&a?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),V=["pkt-input-check__input-checkbox",h?"pkt-input-check__input-checkbox--error":""].filter(Boolean).join(" "),T=["pkt-input-check__input-label",n?"pkt-input-check__input-label--disabled":""].filter(Boolean).join(" "),G=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),J=()=>l.jsxs(l.Fragment,{children:[_&&l.jsx("span",{className:G+" pkt-tag--gray",children:_}),v&&l.jsx("span",{className:G+" pkt-tag--blue-light",children:m}),b&&l.jsx("span",{className:G+" pkt-tag--beige",children:y})]});return l.jsx("div",{className:R,children:l.jsxs("div",{className:S,children:[l.jsx("input",{ref:M,id:i,type:"radio",name:t,disabled:n,className:V,...c!==void 0?{checked:c}:{defaultChecked:d},...x}),l.jsxs("label",{className:T,htmlFor:i,children:[e," ",J(),r&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:r})]})]})})});on.displayName="PktRadioButton";const Eh=w.forwardRef(({appearance:i="local",disabled:t=!1,fullwidth:e=!1,id:s,label:a,name:n,placeholder:r="Søk…",suggestions:h,value:d="",action:c,method:v,onChange:m,onSearch:b,onSuggestionClick:y,..._},x)=>{const M=(T,G)=>{T?T():y&&y(G)},R=T=>{d=T.target.value},S=`pkt-searchinput pkt-searchinput--${i} ${e?"pkt-searchinput--fullwidth":""}`;let V;return c?V=T=>l.jsx("form",{role:"search",className:S,action:c,method:v,children:T}):V=T=>l.jsx("div",{role:"search",className:S,children:T}),V(l.jsxs(l.Fragment,{children:[a&&l.jsx("label",{htmlFor:a?s:void 0,className:a?"pkt-inputwrapper__label":"",children:a}),l.jsxs("div",{className:i==="local"?"pkt-input__container":"pkt-searchinput__field",children:[l.jsx("input",{className:`pkt-input ${e?"pkt-input--fullwidth":""}`,type:"search",name:n||s,id:s,placeholder:r,defaultValue:d,disabled:t,autoComplete:"off","aria-autocomplete":"list",ref:x,"aria-controls":`${s}-suggestions`,onChange:m||R,onKeyUp:b&&(T=>{T.key==="Enter"&&(T.preventDefault(),b(d))}),..._}),l.jsx(si,{className:`pkt-searchinput__button ${i==="local"?"pkt-input-icon":""}`,variant:"icon-only",iconName:"magnifying-glass-big",skin:i==="local"?"tertiary":"primary",color:i==="global"?"yellow":void 0,type:"submit",disabled:t,onClick:b&&(T=>{T.preventDefault(),b(d)}),children:a||r})]}),h&&l.jsx("ul",{id:`${s}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:h.map((T,G)=>l.jsx("li",{children:w.createElement(T.href?"a":T.onClick?"button":"div",{href:T.href,className:`pkt-searchinput__suggestion ${T.onClick?"pkt-link-button":""} ${T.href||T.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:T.onClick?"button":void 0,onClick:()=>M(T.onClick,G),onKeyUp:J=>J.key==="Enter"&&M(T.onClick,G)},l.jsxs(l.Fragment,{children:[T.title&&l.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:T.title}),T.text&&l.jsx("p",{className:"pkt-searchinput__suggestion-text",children:T.text})]}))},`search-suggestion-${G}`))})]}))}),Oh=w.forwardRef(({ariaDescribedby:i,ariaLabelledby:t,children:e,className:s,disabled:a=!1,errorMessage:n,hasError:r,helptext:h,helptextDropdown:d,helptextDropdownButton:c,id:v,inline:m=!1,fullwidth:b=!1,label:y,name:_,optionalTag:x=!1,optionalText:M,requiredTag:R=!1,requiredText:S,tagText:V,...T},G)=>{const J=[s,"pkt-select"].join(" ");return l.jsx(Pi,{className:J,forId:`${v}-input`,label:y,helptext:h,helptextDropdown:d,helptextDropdownButton:c,optionalTag:x,optionalText:M,requiredTag:R,requiredText:S,tagText:V,hasError:r,errorMessage:n,disabled:a,inline:m,ariaDescribedby:i,children:l.jsx("select",{ref:G,className:`pkt-input ${b?"pkt-input--fullwidth":""}`,"aria-invalid":r,"aria-errormessage":`${v}-error`,"aria-labelledby":t||void 0,disabled:a,id:`${v}-input`,name:_||v,...T,children:e})})}),Mh=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)"}})}),Ph=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"})]}),Dh=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"})]}),Ih=({children:i,className:t,status:e="incomplete",title:s})=>l.jsxs("li",{className:Xt("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:Xt("pkt-step__indicator"),children:e==="current"?Ph:e==="completed"?Dh:Mh}),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:s}),l.jsx("div",{className:"pkt-step__content",children:i})]})]}),Lh=w.forwardRef(({activeStep:i,className:t,children:e,hideNonActiveSteps:s=!1,hideNonActiveStepsContent:a=!0,orientation:n="vertical",...r},h)=>{const d=Xt(t,"pkt-stepper",n==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),c=w.Children.map(e,(v,m)=>w.isValidElement(v)?w.cloneElement(v,{className:Xt(v.props.className,{"pkt-step--hideStep":s&&m!==i,"pkt-step--hideContent":a&&m!==i})}):v);return l.jsx("ol",{"data-testid":"pkt-stepper",className:d,ref:h,...r,children:c})}),Bh=({className:i,compact:t=!1,skin:e="basic",responsiveView:s=!0,children:a,...n})=>l.jsx("table",{"data-testid":"pkt-table",className:Xt(i,"pkt-table",{"pkt-table--responsive":s,"pkt-table--compact":t,"pkt-table--basic":e==="basic","pkt-table--zebra-blue":e==="zebra-blue"}),role:"table",...n,children:a}),Fh=({id:i,children:t,className:e,...s})=>l.jsx("tbody",{id:i,className:Xt(e,"pkt-table__body",{}),...s,role:"rowgroup",children:t}),Vh=({children:i,className:t,dataLabel:e,...s})=>l.jsx("td",{className:Xt(t,"pkt-table__data-cell",{}),"data-label":e,role:"cell","data-testid":"pkt-table__data-cell",...s,children:i}),jh=({className:i,children:t,...e})=>l.jsx("thead",{className:Xt(i,"pkt-table__header",{}),role:"rowgroup",...e,children:t}),Hh=({className:i,children:t,...e})=>l.jsx("th",{className:Xt(i,"pkt-table__header-cell",{}),role:"columnheader",...e,children:t}),Uh=({className:i,children:t,...e})=>l.jsx("tr",{className:Xt(i,"pkt-table__row",{}),role:"row",...e,children:t}),qh=gt({tagName:"pkt-tag",elementClass:qt,react:js,displayName:"PktTag",events:{onClose:"close"}}),as=w.forwardRef(({children:i,...t},e)=>l.jsx(qh,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",children:i})}));as.displayName="PktTag";const zh=w.forwardRef(({arrowNav:i=!0,tabs:t,onTabSelected:e},s)=>{const a=w.useRef([]);w.useEffect(()=>{a.current=a.current.slice(0,t.length)},[t]);const n=(h,d)=>{d.action&&d.action(h),e&&e(h)},r=(h,d)=>{var c,v;i&&(d.code==="ArrowLeft"&&h!==0&&((c=a.current[h-1])==null||c.focus()),d.code==="ArrowRight"&&h<t.length-1&&((v=a.current[h+1])==null||v.focus()),(d.code==="ArrowDown"||d.code==="Space")&&n(h,t[h]))};return l.jsx("div",{className:"pkt-tabs",ref:s,children:l.jsx("div",{className:"pkt-tabs__list",role:i?"tablist":"navigation",children:t.map((h,d)=>l.jsx(w.Fragment,{children:h.href?l.jsxs("a",{"aria-selected":!!h.active,role:i?"tab":void 0,href:h.href,"aria-controls":h.controls,className:`pkt-tabs__link ${h.active?"active":""}`,onKeyUp:c=>r(d,c),onClick:()=>n(d,h),tabIndex:h.active||!i?void 0:-1,ref:c=>{a.current[d]=c},children:[h.icon&&l.jsx(F,{name:h.icon,className:"pkt-icon--small"}),h.text,h.tag&&l.jsx(as,{skin:h.tag.skin,size:"small",children:h.tag.text})]}):l.jsxs("button",{"aria-selected":!!h.active,role:i?"tab":void 0,type:"button","aria-controls":h.controls,className:`pkt-tabs__button pkt-link-button ${h.active?"active":""}`,onKeyUp:c=>r(d,c),onClick:()=>n(d,h),tabIndex:h.active||!i?void 0:-1,ref:c=>{a.current[d]=c},children:[h.icon&&l.jsx(F,{name:h.icon,className:"pkt-icon--small"}),h.text,h.tag&&l.jsx(as,{skin:h.tag.skin,size:"small",children:h.tag.text})]},"b-"+d)},d))})})}),Wh=w.forwardRef(({id:i,ariaDescribedby:t,ariaLabelledby:e,counter:s,counterMaxLength:a,className:n,disabled:r,errorMessage:h,hasError:d,helptext:c,helptextDropdown:v,helptextDropdownButton:m,inline:b,fullwidth:y=!1,label:_,name:x,optionalTag:M=!1,optionalText:R,requiredTag:S=!1,requiredText:V,tagText:T=null,placeholder:G,rows:J,useWrapper:Lt=!0,onChange:Bt,value:st,autoComplete:nt="off",minLength:Ft,maxLength:Vt,readOnly:rt=!1,skipForwardTestid:I=!1,...Tt},ae)=>{const de=[n,"pkt-textinput","pkt-textarea"].join(" "),ne=`${i}-input`,Fe=`${ne}-label`,ri=e||Fe,[pe,Rt]=w.useState(0),dt=Ve=>{var je,ce;if(s&&Rt(((ce=(je=Ve.currentTarget)==null?void 0:je.value)==null?void 0:ce.length)||0),Bt)return Bt(Ve)};return w.useEffect(()=>{st!==void 0&&Rt((st==null?void 0:st.length)||0)},[st]),l.jsx(Pi,{ariaDescribedby:t,className:de,disabled:r,errorMessage:h,forId:ne,hasError:d,helptext:c,helptextDropdown:v,helptextDropdownButton:m,inline:b,label:_,optionalTag:M,optionalText:R,requiredTag:S,requiredText:V,tagText:T,useWrapper:Lt,counter:s,counterCurrent:pe,counterMaxLength:a,children:l.jsx("textarea",{ref:ae,className:`pkt-input ${y?"pkt-input--fullwidth":""} ${a&&pe>a?"pkt-input--counter-error":""}`,name:`${x||i}`,id:ne,placeholder:G,disabled:r,rows:J,"aria-labelledby":ri,"aria-invalid":d,"aria-errormessage":`${i}-error`,...Tt,onChange:dt,value:st,autoComplete:nt,minLength:Ft,maxLength:Vt,"data-skip-forward-testid":I?"true":void 0})})}),Rh=w.forwardRef(({id:i,ariaDescribedby:t,ariaLabelledby:e,autocomplete:s="off",counter:a,counterMaxLength:n,className:r,disabled:h=!1,errorMessage:d,hasError:c=!1,helptext:v,helptextDropdown:m,helptextDropdownButton:b,iconNameRight:y,inline:_=!1,fullwidth:x=!1,label:M,name:R,optionalTag:S=!1,optionalText:V,requiredTag:T=!1,requiredText:G,tagText:J=null,placeholder:Lt,prefix:Bt,suffix:st,type:nt="text",useWrapper:Ft=!0,omitSearchIcon:Vt=!1,value:rt,minLength:I,maxLength:Tt,min:ae,max:de,step:ne,size:Fe,readonly:ri,required:pe,dataTestid:Rt,onChange:dt,skipForwardTestid:Ve=!1,...je},ce)=>{const Ds=[r,"pkt-textinput"].join(" "),ns=nt==="search"&&!y&&!Vt,Is=nt==="date"&&rt?rt.slice(0,10):rt,[rs,oi]=w.useState((rt==null?void 0:rt.length)||0),li=`${i}`,Ii=`${li}-label`,os=e||Ii,Ls=_e=>{var ls,hs;a&&oi(((hs=(ls=_e.currentTarget)==null?void 0:ls.value)==null?void 0:hs.length)||0),dt&&dt(_e)};return w.useEffect(()=>{rt!==void 0&&oi((rt==null?void 0:rt.length)||0)},[rt]),l.jsx(Pi,{ariaDescribedby:t,className:Ds,disabled:h,errorMessage:d,forId:li,hasError:c,helptext:v,helptextDropdown:m,helptextDropdownButton:b,inline:_,label:M,optionalTag:S,optionalText:V,requiredTag:T,requiredText:G,tagText:J,useWrapper:Ft,counter:a,counterCurrent:rs,counterMaxLength:n,children:l.jsxs("div",{className:"pkt-input__container","data-testid":Rt,"data-skip-forward-testid":Ve?"true":void 0,children:[Bt&&l.jsx("div",{className:"pkt-input-prefix",children:Bt}),l.jsx("input",{...je,ref:ce,className:`pkt-input ${x?"pkt-input--fullwidth":""} ${n&&rs>n?"pkt-input--counter-error":""}`,type:nt,name:`${R||i}`,value:Is,id:li,placeholder:Lt,autoComplete:s,disabled:h,"aria-invalid":c,"aria-errormessage":`${i}-error`,"aria-labelledby":os,min:ae,max:de,onChange:Ls,step:ne,minLength:I,maxLength:Tt,size:Fe,required:pe}),st&&l.jsxs("p",{className:"pkt-input-suffix",children:[st,y&&l.jsx(F,{className:"pkt-input-suffix-icon",name:y}),ns&&l.jsx(F,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!st&&y&&l.jsx(F,{className:"pkt-input-icon",name:y}),!st&&ns&&l.jsx(F,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})});var ai=window.CustomEvent;(!ai||typeof ai=="object")&&(ai=function(i,t){t=t||{};var e=document.createEvent("CustomEvent");return e.initCustomEvent(i,!!t.bubbles,!!t.cancelable,t.detail||null),e},ai.prototype=window.Event.prototype);function ln(i,t){var e="on"+t.type.toLowerCase();return typeof i[e]=="function"&&i[e](t),i.dispatchEvent(t)}function Kh(i){for(;i&&i!==document.body;){var t=window.getComputedStyle(i),e=function(s,a){return!(t[s]===void 0||t[s]===a)};if(t.opacity<1||e("zIndex","auto")||e("transform","none")||e("mixBlendMode","normal")||e("filter","none")||e("perspective","none")||t.isolation==="isolate"||t.position==="fixed"||t.webkitOverflowScrolling==="touch")return!0;i=i.parentElement}return!1}function Di(i){for(;i;){if(i.localName==="dialog")return i;i.parentElement?i=i.parentElement:i.parentNode?i=i.parentNode.host:i=null}return null}function hn(i){for(;i&&i.shadowRoot&&i.shadowRoot.activeElement;)i=i.shadowRoot.activeElement;i&&i.blur&&i!==document.body&&i.blur()}function Gh(i,t){for(var e=0;e<i.length;++e)if(i[e]===t)return!0;return!1}function Ps(i){return!i||!i.hasAttribute("method")?!1:i.getAttribute("method").toLowerCase()==="dialog"}function dn(i){var t=["button","input","keygen","select","textarea"],e=t.map(function(r){return r+":not([disabled])"});e.push('[tabindex]:not([disabled]):not([tabindex=""])');var s=i.querySelector(e.join(", "));if(!s&&"attachShadow"in Element.prototype)for(var a=i.querySelectorAll("*"),n=0;n<a.length&&!(a[n].tagName&&a[n].shadowRoot&&(s=dn(a[n].shadowRoot),s));n++);return s}function pn(i){return i.isConnected||document.body.contains(i)}function cn(i){if(i.submitter)return i.submitter;var t=i.target;if(!(t instanceof HTMLFormElement))return null;var e=q.formSubmitter;if(!e){var s=i.target,a="getRootNode"in s&&s.getRootNode()||document;e=a.activeElement}return!e||e.form!==t?null:e}function Yh(i){if(!i.defaultPrevented){var t=i.target,e=q.imagemapUseValue,s=cn(i);e===null&&s&&(e=s.value);var a=Di(t);if(a){var n=s&&s.getAttribute("formmethod")||t.getAttribute("method");n==="dialog"&&(i.preventDefault(),e!=null?a.close(e):a.close())}}}function un(i){if(this.dialog_=i,this.replacedStyleTop_=!1,this.openAsModal_=!1,i.hasAttribute("role")||i.setAttribute("role","dialog"),i.show=this.show.bind(this),i.showModal=this.showModal.bind(this),i.close=this.close.bind(this),i.addEventListener("submit",Yh,!1),"returnValue"in i||(i.returnValue=""),"MutationObserver"in window){var t=new MutationObserver(this.maybeHideModal.bind(this));t.observe(i,{attributes:!0,attributeFilter:["open"]})}else{var e=!1,s=(function(){e?this.downgradeModal():this.maybeHideModal(),e=!1}).bind(this),a,n=function(r){if(r.target===i){var h="DOMNodeRemoved";e|=r.type.substr(0,h.length)===h,window.clearTimeout(a),a=window.setTimeout(s,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(r){i.addEventListener(r,n)})}Object.defineProperty(i,"open",{set:this.setOpen.bind(this),get:i.hasAttribute.bind(i,"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))}un.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&pn(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_),q.dm.removeDialog(this))},setOpen:function(i){i?this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open",""):(this.dialog_.removeAttribute("open"),this.maybeHideModal())},backdropMouseEvent_:function(i){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(i.type,i.bubbles,i.cancelable,window,i.detail,i.screenX,i.screenY,i.clientX,i.clientY,i.ctrlKey,i.altKey,i.shiftKey,i.metaKey,i.button,i.relatedTarget),this.dialog_.dispatchEvent(e),i.stopPropagation()},focus_:function(){var i=this.dialog_.querySelector("[autofocus]:not([disabled])");!i&&this.dialog_.tabIndex>=0&&(i=this.dialog_),i||(i=dn(this.dialog_)),hn(document.activeElement),i&&i.focus()},updateZIndex:function(i,t){if(i<t)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=i,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(!pn(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!q.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");Kh(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,q.needsCentering(this.dialog_)?(q.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(i){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),i!==void 0&&(this.dialog_.returnValue=i);var t=new ai("close",{bubbles:!1,cancelable:!1});ln(this.dialog_,t)}};var q={};if(q.reposition=function(i){var t=document.body.scrollTop||document.documentElement.scrollTop,e=t+(window.innerHeight-i.offsetHeight)/2;i.style.top=Math.max(t,e)+"px"},q.isInlinePositionSetByStylesheet=function(i){for(var t=0;t<document.styleSheets.length;++t){var e=document.styleSheets[t],s=null;try{s=e.cssRules}catch{}if(s)for(var a=0;a<s.length;++a){var n=s[a],r=null;try{r=document.querySelectorAll(n.selectorText)}catch{}if(!(!r||!Gh(r,i))){var h=n.style.getPropertyValue("top"),d=n.style.getPropertyValue("bottom");if(h&&h!=="auto"||d&&d!=="auto")return!0}}}return!1},q.needsCentering=function(i){var t=window.getComputedStyle(i);return t.position!=="absolute"||i.style.top!=="auto"&&i.style.top!==""||i.style.bottom!=="auto"&&i.style.bottom!==""?!1:!q.isInlinePositionSetByStylesheet(i)},q.forceRegisterDialog=function(i){if((window.HTMLDialogElement||i.showModal)&&console.warn("This browser already supports <dialog>, the polyfill may not work correctly",i),i.localName!=="dialog")throw new Error("Failed to register dialog: The element is not a dialog.");new un(i)},q.registerDialog=function(i){i.showModal||q.forceRegisterDialog(i)},q.DialogManager=function(){this.pendingDialogStack=[];var i=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(),i([])}).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(s){for(var a=0,n;n=s.removedNodes[a];++a){if(n instanceof Element)n.localName==="dialog"&&e.push(n);else continue;e=e.concat(n.querySelectorAll("dialog"))}}),e.length&&i(e)}))},q.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})},q.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},q.DialogManager.prototype.updateStacking=function(){for(var i=this.zIndexHigh_,t=0,e;e=this.pendingDialogStack[t];++t)e.updateZIndex(--i,--i),t===0&&(this.overlay.style.zIndex=--i);var s=this.pendingDialogStack[0];if(s){var a=s.dialog.parentNode||document.body;a.appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},q.DialogManager.prototype.containedByTopDialog_=function(i){for(;i=Di(i);){for(var t=0,e;e=this.pendingDialogStack[t];++t)if(e.dialog===i)return t===0;i=i.parentElement}return!1},q.DialogManager.prototype.handleFocus_=function(i){var t=i.composedPath?i.composedPath()[0]:i.target;if(!this.containedByTopDialog_(t)&&document.activeElement!==document.documentElement&&(i.preventDefault(),i.stopPropagation(),hn(t),this.forwardTab_!==void 0)){var e=this.pendingDialogStack[0],s=e.dialog,a=s.compareDocumentPosition(t);return a&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?e.focus_():t!==document.documentElement&&document.documentElement.focus()),!1}},q.DialogManager.prototype.handleKey_=function(i){if(this.forwardTab_=void 0,i.keyCode===27){i.preventDefault(),i.stopPropagation();var t=new ai("cancel",{bubbles:!1,cancelable:!0}),e=this.pendingDialogStack[0];e&&ln(e.dialog,t)&&e.dialog.close()}else i.keyCode===9&&(this.forwardTab_=!i.shiftKey)},q.DialogManager.prototype.checkDOM_=function(i){var t=this.pendingDialogStack.slice();t.forEach(function(e){i.indexOf(e.dialog)!==-1?e.downgradeModal():e.maybeHideModal()})},q.DialogManager.prototype.pushDialog=function(i){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=t?!1:(this.pendingDialogStack.unshift(i)===1&&this.blockDocument(),this.updateStacking(),!0)},q.DialogManager.prototype.removeDialog=function(i){var t=this.pendingDialogStack.indexOf(i);t!==-1&&(this.pendingDialogStack.splice(t,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())},q.dm=new q.DialogManager,q.formSubmitter=null,q.imagemapUseValue=null,window.HTMLDialogElement===void 0){var fn=document.createElement("form");if(fn.setAttribute("method","dialog"),fn.method!=="dialog"){var ni=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(ni){var Zh=ni.get;ni.get=function(){return Ps(this)?"dialog":Zh.call(this)};var Xh=ni.set;ni.set=function(i){return typeof i=="string"&&i.toLowerCase()==="dialog"?this.setAttribute("method",i):Xh.call(this,i)},Object.defineProperty(HTMLFormElement.prototype,"method",ni)}}document.addEventListener("click",function(i){if(q.formSubmitter=null,q.imagemapUseValue=null,!i.defaultPrevented){var t=i.target;if("composedPath"in i){var e=i.composedPath();t=e.shift()||t}if(!(!t||!Ps(t.form))){var s=t.type==="submit"&&["button","input"].indexOf(t.localName)>-1;if(!s){if(!(t.localName==="input"&&t.type==="image"))return;q.imagemapUseValue=i.offsetX+","+i.offsetY}var a=Di(t);a&&(q.formSubmitter=t)}}},!1),document.addEventListener("submit",function(i){var t=i.target,e=Di(t);if(!e){var s=cn(i),a=s&&s.getAttribute("formmethod")||t.getAttribute("method");a==="dialog"&&i.preventDefault()}});var Jh=HTMLFormElement.prototype.submit,Qh=function(){if(!Ps(this))return Jh.call(this);var i=Di(this);i&&i.close()};HTMLFormElement.prototype.submit=Qh}const td=Object.freeze(Object.defineProperty({__proto__:null,default:q},Symbol.toStringTag,{value:"Module"}));E.PktAccordion=Us,E.PktAccordionItem=za,E.PktAlert=Os,E.PktBackLink=Wa,E.PktBreadcrumbs=ch,E.PktButton=si,E.PktCard=Ra,E.PktCheckbox=Ka,E.PktCombobox=Ga,E.PktConsent=ss,E.PktDatepicker=Ya,E.PktFooter=mh,E.PktFooterSimple=vh,E.PktHeader=$h,E.PktHeading=Xa,E.PktHelptext=Ja,E.PktIcon=F,E.PktInput=Qa,E.PktInputWrapper=Pi,E.PktLink=tn,E.PktLinkCard=en,E.PktLoader=sn,E.PktMessagebox=an,E.PktModal=nn,E.PktProgressbar=rn,E.PktRadioButton=on,E.PktSearchInput=Eh,E.PktSelect=Oh,E.PktStep=Ih,E.PktStepper=Lh,E.PktTable=Bh,E.PktTableBody=Fh,E.PktTableDataCell=Vh,E.PktTableHeader=jh,E.PktTableHeaderCell=Hh,E.PktTableRow=Uh,E.PktTabs=zh,E.PktTag=as,E.PktTextarea=Wh,E.PktTextinput=Rh,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})}));
|
|
1375
|
+
*/var Xa;function $h(){return Xa||(Xa=1,(function(i){(function(){var t={}.hasOwnProperty;function e(){for(var n="",r=0;r<arguments.length;r++){var h=arguments[r];h&&(n=a(n,s(h)))}return n}function s(n){if(typeof n=="string"||typeof n=="number")return n;if(typeof n!="object")return"";if(Array.isArray(n))return e.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var r="";for(var h in n)t.call(n,h)&&n[h]&&(r=a(r,h));return r}function a(n,r){return r?n?n+" "+r:n+r:n}i.exports?(e.default=e,i.exports=e):window.classNames=e})()})(Ps)),Ps.exports}var _h=$h();const Xt=kh(_h),wh=x.forwardRef(({className:i,logoLink:t="https://www.oslo.kommune.no/",serviceName:e,fixed:s=!0,scrollToHide:a=!0,user:n,userMenu:r,representing:h,userOptions:d,userMenuFooter:c,canChangeRepresentation:v=!0,showMenuButton:g=!1,showLogOutButton:k=!1,openMenu:b,logOut:y,changeRepresentation:w,children:S,...M},C)=>{const V=x.useMemo(()=>typeof(n==null?void 0:n.lastLoggedIn)=="string"?n.lastLoggedIn:n!=null&&n.lastLoggedIn?new Date(n.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[n]),[N,G]=x.useState(!1),[J,Lt]=x.useState(0),[Bt,st]=x.useState(!1),nt=x.useRef(null);x.useEffect(()=>(document&&(document.addEventListener("mouseup",Vt),window.addEventListener("scroll",rt)),()=>{document&&(document.removeEventListener("mouseup",Vt),window.removeEventListener("scroll",rt))}));const Ft=()=>{st(!Bt)},Vt=L=>{nt.current&&!nt.current.contains(L.target)&&st(!1)},rt=()=>{if(a){const L=window.pageYOffset||document.documentElement.scrollTop;if(L<0||Math.abs(L-J)<60)return;G(L>J),Lt(L)}};return l.jsxs("header",{...M,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:Xt(i,"pkt-header",{"pkt-header--fixed":s,"pkt-header--scroll-to-hide":a,"pkt-header--hidden":N}),ref:C,children:[l.jsxs("div",{className:"pkt-header__logo",children:[typeof t=="string"?l.jsx("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:t,children:l.jsx(q,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/13.8/logos/"})}):l.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header__logo-link",onClick:t,children:l.jsx(q,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/13.8/logos/"})}),l.jsx("span",{className:"pkt-header__logo-service",translate:"no",children:e})]}),l.jsx("nav",{className:"pkt-header__actions",children:l.jsxs("ul",{className:"pkt-header__actions-row",children:[g&&l.jsx("li",{children:l.jsx(si,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:b,children:"Meny"})}),(n||h)&&l.jsxs("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${Bt&&!N?"pkt-header--open-dropdown":""}`,ref:nt,children:[l.jsxs("button",{className:"pkt-header__user-btn pkt-btn pkt-btn--secondary pkt-btn--icons-right-and-left",type:"button",role:"button","aria-controls":"pktUserDropdown","aria-expanded":Bt,onClick:Ft,children:[l.jsx(q,{name:"user",className:"pkt-btn__icon"}),l.jsx("span",{className:"pkt-header__user-fullname",translate:"no",children:(h==null?void 0:h.name)||(n==null?void 0:n.name)}),l.jsx("span",{className:"pkt-header__user-shortname",translate:"no",children:(h==null?void 0:h.shortname)||(n==null?void 0:n.shortname)}),l.jsx(q,{name:"chevron-thin-down",className:"pkt-btn--closed"}),l.jsx(q,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),l.jsxs("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[n&&l.jsxs("li",{children:[l.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),l.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:n.name}),n.lastLoggedIn&&l.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",l.jsx("time",{children:V})]})]}),r&&l.jsx("li",{children:l.jsx("ul",{className:"pkt-list",children:r.map((L,Tt)=>l.jsx("li",{children:typeof L.target=="string"?l.jsxs("a",{href:L.target,className:"pkt-link",children:[L.iconName&&l.jsx(q,{name:L.iconName,className:"pkt-link__icon"}),L.title]}):l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:L.target,children:[L.iconName&&l.jsx(q,{name:L.iconName,className:"pkt-link__icon"}),L.title]})},`userMenu-${Tt}`))})}),(h||v)&&l.jsxs("li",{children:[h&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),l.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:h.name}),h.orgNumber&&l.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",h.orgNumber]})]}),l.jsx("ul",{className:"pkt-list mt-size-16",children:v&&l.jsx("li",{children:l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:w,children:[l.jsx(q,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),l.jsx("li",{children:l.jsx("ul",{className:"pkt-list",children:(d||!k)&&l.jsxs(l.Fragment,{children:[d==null?void 0:d.map((L,Tt)=>l.jsx("li",{children:typeof L.target=="string"?l.jsxs("a",{href:L.target,className:"pkt-link",children:[L.iconName&&l.jsx(q,{name:L.iconName,className:"pkt-link__icon"}),L.title]}):l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:L.target,children:[L.iconName&&l.jsx(q,{name:L.iconName,className:"pkt-link__icon"}),L.title]})},`userOptions-${Tt}`)),!k&&l.jsx("li",{children:l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:y,children:[l.jsx(q,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),c&&l.jsx("li",{className:"footer",children:l.jsx("ul",{className:"pkt-list-horizontal bordered",children:c.map((L,Tt)=>l.jsx("li",{children:typeof L.target=="string"?l.jsx("a",{href:L.target,className:"pkt-link",children:L.title}):l.jsx("button",{className:"pkt-link-button pkt-link",onClick:L.target,children:L.title})},`userMenuFooter-${Tt}`))})})]})]}),S&&l.jsx("li",{children:S}),k&&l.jsx("li",{children:l.jsx(si,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:y,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),xh=gt({tagName:"pkt-heading",elementClass:Me,react:x,displayName:"PktHeading"}),Ja=x.forwardRef(({children:i,...t},e)=>l.jsx(xh,{"data-testid":"pkt-heading",...t,ref:e,children:i}));Ja.displayName="PktHeading";const Sh=gt({tagName:"pkt-helptext",elementClass:oe,react:x,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),Qa=x.forwardRef(({children:i,...t},e)=>l.jsx(Sh,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:i})}));Qa.displayName="PktHelptext";const tn=x.forwardRef(({label:i,id:t,children:e,...s},a)=>l.jsxs("div",{className:"pkt-form-group",children:[l.jsx("label",{htmlFor:t,className:"pkt-form-label",children:i}),l.jsx("input",{className:"pkt-form-input",id:t,...s,ref:a}),e]}));tn.displayName="PktInput";const Mi=x.forwardRef(({forId:i,label:t,helptext:e,helptextDropdown:s,helptextDropdownButton:a,counter:n,counterCurrent:r=0,counterMaxLength:h,optionalTag:d=!1,optionalText:c="Valgfritt",requiredTag:v=!1,requiredText:g="Må fylles ut",tagText:k=null,hasError:b=!1,errorMessage:y,disabled:w=!1,inline:S=!1,ariaDescribedby:M,useWrapper:C=!0,children:V,className:N="",hasFieldset:G=!1,role:J="group",counterPosition:Lt="bottom"},Bt)=>{const[st,nt]=x.useState(!1),Ft=M||(e?`${i}-helptext`:void 0),Vt=!!n,rt=Vt&&Lt==="top",L=Vt&&Lt==="bottom",Tt=()=>nt(dt=>!dt),ae=["pkt-inputwrapper",N,b?"pkt-inputwrapper--error":"",w?"pkt-inputwrapper--disabled":"",S?"pkt-inputwrapper--inline":""].filter(Boolean).join(" "),de=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),ne=()=>Vt?l.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":"true",children:[r,h?`/${h}`:""]}):null,Fe=()=>l.jsxs(l.Fragment,{children:[k&&l.jsx("span",{className:de+" pkt-tag--gray",children:k}),d&&l.jsx("span",{className:de+" pkt-tag--blue-light",children:c}),v&&l.jsx("span",{className:de+" pkt-tag--beige",children:g})]}),ri=()=>{const dt=l.jsxs(l.Fragment,{children:[t," ",Fe()]});return C?G?l.jsx("legend",{className:"pkt-inputwrapper__legend",id:`${i}-label`,children:dt}):l.jsx("label",{className:"pkt-inputwrapper__label",htmlFor:i,"aria-describedby":Ft,id:`${i}-label`,children:dt}):l.jsx("label",{htmlFor:i,className:"pkt-sr-only","aria-describedby":Ft,id:`${i}-label`,children:t})},pe=()=>!e&&!s?null:l.jsxs(l.Fragment,{children:[e&&C&&l.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${i}-helptext`,children:e}),s&&l.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[l.jsx(si,{skin:"tertiary",size:"small",variant:"icon-right",iconName:st?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:Tt,children:l.jsx("span",{dangerouslySetInnerHTML:{__html:a??'Les mer <span class="pkt-sr-only">om inputfeltet</span>'}})}),l.jsx("div",{className:`pkt-inputwrapper__helptext ${st?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:s})]})]}),Rt=l.jsxs(l.Fragment,{children:[ri(),pe(),rt&&l.jsx(ne,{}),V,L&&l.jsx(ne,{}),b&&y&&l.jsx("div",{className:"pkt-inputwrapper__alert-wrapper",children:l.jsx(Es,{skin:"error","aria-live":"assertive",role:"alert",id:`${i}-error`,compact:!0,children:y})})]});return l.jsx("div",{className:ae,ref:Bt,role:J,children:G?l.jsx("fieldset",{className:"pkt-inputwrapper__fieldset","aria-describedby":Ft,children:Rt}):l.jsx("div",{className:"pkt-inputwrapper__fieldset",children:Rt})})});Mi.displayName="PktInputWrapper";const Ch=gt({tagName:"pkt-link",elementClass:ke,react:x,displayName:"PktLink"}),en=x.forwardRef(({children:i,...t},e)=>l.jsx(Ch,{...t,ref:e,children:l.jsx("span",{className:"pkt-contents",children:i})}));en.displayName="PktLink";const Th=gt({tagName:"pkt-linkcard",elementClass:le,react:x,displayName:"PktLinkCard",events:{}}),sn=x.forwardRef(({children:i,...t},e)=>l.jsx(Th,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",children:i})}));sn.displayName="PktLinkCard";const Nh=gt({tagName:"pkt-loader",elementClass:Gt,react:x,displayName:"PktLoader",events:{}}),an=x.forwardRef(({children:i,...t},e)=>l.jsx(Nh,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:i})}));an.displayName="PktLoader";const Ah=gt({tagName:"pkt-messagebox",elementClass:$e,react:x,displayName:"PktMessagebox",events:{onClose:"close"}}),nn=x.forwardRef(({children:i,...t},e)=>l.jsx(Ah,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:i})}));nn.displayName="PktMessagebox";const Eh=gt({tagName:"pkt-modal",elementClass:Dt,react:x,displayName:"PktModal",events:{}}),rn=x.forwardRef(({children:i,...t},e)=>l.jsx(Eh,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:i})}));rn.displayName="PktModal";const Ph=gt({tagName:"pkt-progressbar",elementClass:it,react:x,displayName:"PktProgressbar",events:{}}),on=x.forwardRef(({children:i,...t},e)=>l.jsx(Ph,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",children:i})}));on.displayName="PktProgressbar";const ln=x.forwardRef(({id:i,name:t,label:e,className:s,hasTile:a=!1,disabled:n=!1,checkHelptext:r,hasError:h=!1,defaultChecked:d,checked:c,optionalTag:v,optionalText:g,requiredTag:k,requiredText:b,tagText:y,...w},S)=>{const M=[s,"pkt-input-check"].filter(Boolean).join(" "),C=["pkt-input-check__input",a?"pkt-input-check__input--tile":"",n&&a?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),V=["pkt-input-check__input-checkbox",h?"pkt-input-check__input-checkbox--error":""].filter(Boolean).join(" "),N=["pkt-input-check__input-label",n?"pkt-input-check__input-label--disabled":""].filter(Boolean).join(" "),G=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),J=()=>l.jsxs(l.Fragment,{children:[y&&l.jsx("span",{className:G+" pkt-tag--gray",children:y}),v&&l.jsx("span",{className:G+" pkt-tag--blue-light",children:g}),k&&l.jsx("span",{className:G+" pkt-tag--beige",children:b})]});return l.jsx("div",{className:M,children:l.jsxs("div",{className:C,children:[l.jsx("input",{ref:S,id:i,type:"radio",name:t,disabled:n,className:V,...c!==void 0?{checked:c}:{defaultChecked:d},...w}),l.jsxs("label",{className:N,htmlFor:i,children:[e," ",J(),r&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:r})]})]})})});ln.displayName="PktRadioButton";const Oh=x.forwardRef(({appearance:i="local",disabled:t=!1,fullwidth:e=!1,id:s,label:a,name:n,placeholder:r="Søk…",suggestions:h,value:d="",action:c,method:v,onChange:g,onSearch:k,onSuggestionClick:b,...y},w)=>{const S=(N,G)=>{N?N():b&&b(G)},M=N=>{d=N.target.value},C=`pkt-searchinput pkt-searchinput--${i} ${e?"pkt-searchinput--fullwidth":""}`;let V;return c?V=N=>l.jsx("form",{role:"search",className:C,action:c,method:v,children:N}):V=N=>l.jsx("div",{role:"search",className:C,children:N}),V(l.jsxs(l.Fragment,{children:[a&&l.jsx("label",{htmlFor:a?s:void 0,className:a?"pkt-inputwrapper__label":"",children:a}),l.jsxs("div",{className:i==="local"?"pkt-input__container":"pkt-searchinput__field",children:[l.jsx("input",{className:`pkt-input ${e?"pkt-input--fullwidth":""}`,type:"search",name:n||s,id:s,placeholder:r,defaultValue:d,disabled:t,autoComplete:"off","aria-autocomplete":"list",ref:w,"aria-controls":`${s}-suggestions`,onChange:g||M,onKeyUp:k&&(N=>{N.key==="Enter"&&(N.preventDefault(),k(d))}),...y}),l.jsx(si,{className:`pkt-searchinput__button ${i==="local"?"pkt-input-icon":""}`,variant:"icon-only",iconName:"magnifying-glass-big",skin:i==="local"?"tertiary":"primary",color:i==="global"?"yellow":void 0,type:"submit",disabled:t,onClick:k&&(N=>{N.preventDefault(),k(d)}),children:a||r})]}),h&&l.jsx("ul",{id:`${s}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:h.map((N,G)=>l.jsx("li",{children:x.createElement(N.href?"a":N.onClick?"button":"div",{href:N.href,className:`pkt-searchinput__suggestion ${N.onClick?"pkt-link-button":""} ${N.href||N.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:N.onClick?"button":void 0,onClick:()=>S(N.onClick,G),onKeyUp:J=>J.key==="Enter"&&S(N.onClick,G)},l.jsxs(l.Fragment,{children:[N.title&&l.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:N.title}),N.text&&l.jsx("p",{className:"pkt-searchinput__suggestion-text",children:N.text})]}))},`search-suggestion-${G}`))})]}))}),Mh=x.forwardRef(({ariaDescribedby:i,ariaLabelledby:t,children:e,className:s,disabled:a=!1,errorMessage:n,hasError:r,helptext:h,helptextDropdown:d,helptextDropdownButton:c,id:v,inline:g=!1,fullwidth:k=!1,label:b,name:y,optionalTag:w=!1,optionalText:S,requiredTag:M=!1,requiredText:C,tagText:V,...N},G)=>{const J=[s,"pkt-select"].join(" ");return l.jsx(Mi,{className:J,forId:`${v}-input`,label:b,helptext:h,helptextDropdown:d,helptextDropdownButton:c,optionalTag:w,optionalText:S,requiredTag:M,requiredText:C,tagText:V,hasError:r,errorMessage:n,disabled:a,inline:g,ariaDescribedby:i,children:l.jsx("select",{ref:G,className:`pkt-input ${k?"pkt-input--fullwidth":""}`,"aria-invalid":r,"aria-errormessage":`${v}-error`,"aria-labelledby":t||void 0,disabled:a,id:`${v}-input`,name:y||v,...N,children:e})})}),Dh=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)"}})}),Ih=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"})]}),Lh=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"})]}),Bh=({children:i,className:t,status:e="incomplete",title:s})=>l.jsxs("li",{className:Xt("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:Xt("pkt-step__indicator"),children:e==="current"?Ih:e==="completed"?Lh:Dh}),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:s}),l.jsx("div",{className:"pkt-step__content",children:i})]})]}),Fh=x.forwardRef(({activeStep:i,className:t,children:e,hideNonActiveSteps:s=!1,hideNonActiveStepsContent:a=!0,orientation:n="vertical",...r},h)=>{const d=Xt(t,"pkt-stepper",n==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),c=x.Children.map(e,(v,g)=>x.isValidElement(v)?x.cloneElement(v,{className:Xt(v.props.className,{"pkt-step--hideStep":s&&g!==i,"pkt-step--hideContent":a&&g!==i})}):v);return l.jsx("ol",{"data-testid":"pkt-stepper",className:d,ref:h,...r,children:c})}),Vh=({className:i,compact:t=!1,skin:e="basic",responsiveView:s=!0,children:a,...n})=>l.jsx("table",{"data-testid":"pkt-table",className:Xt(i,"pkt-table",{"pkt-table--responsive":s,"pkt-table--compact":t,"pkt-table--basic":e==="basic","pkt-table--zebra-blue":e==="zebra-blue"}),role:"table",...n,children:a}),Hh=({id:i,children:t,className:e,...s})=>l.jsx("tbody",{id:i,className:Xt(e,"pkt-table__body",{}),...s,role:"rowgroup",children:t}),jh=({children:i,className:t,dataLabel:e,...s})=>l.jsx("td",{className:Xt(t,"pkt-table__data-cell",{}),"data-label":e,role:"cell","data-testid":"pkt-table__data-cell",...s,children:i}),Uh=({className:i,children:t,...e})=>l.jsx("thead",{className:Xt(i,"pkt-table__header",{}),role:"rowgroup",...e,children:t}),qh=({className:i,children:t,...e})=>l.jsx("th",{className:Xt(i,"pkt-table__header-cell",{}),role:"columnheader",...e,children:t}),zh=({className:i,children:t,...e})=>l.jsx("tr",{className:Xt(i,"pkt-table__row",{}),role:"row",...e,children:t}),Wh=gt({tagName:"pkt-tag",elementClass:qt,react:js,displayName:"PktTag",events:{onClose:"close"}}),Os=x.forwardRef(({children:i,...t},e)=>l.jsx(Wh,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",children:i})}));Os.displayName="PktTag";const Ms=x.forwardRef(({children:i,active:t,href:e,onClick:s,icon:a,controls:n,tag:r,tagSkin:h,index:d=0},c)=>{const{arrowNav:v,registerTabRef:g,handleKeyPress:k,selectTab:b}=Rh(),w={"aria-selected":v?!!t:void 0,"aria-controls":n,role:v?"tab":void 0,onKeyUp:M=>k(d,M),onClick:M=>{b(d),s==null||s(M)},tabIndex:t||!v?void 0:-1,ref:M=>{g(d,M),typeof c=="function"?c(M):c&&(c.current=M)}},S=l.jsxs(l.Fragment,{children:[a&&l.jsx(q,{name:a,className:"pkt-icon--small"}),i,r&&l.jsx(Os,{skin:h,size:"small",children:r})]});return e?l.jsx("a",{...w,href:e,className:`pkt-tabs__link ${t?"active":""}`,children:S}):l.jsx("button",{...w,type:"button",className:`pkt-tabs__button pkt-link-button ${t?"active":""}`,children:S})});Ms.displayName="PktTabItem";const hn=x.createContext(null),Rh=()=>{const i=x.useContext(hn);if(!i)throw new Error("TabItem must be used within a Tabs component");return i},Kh=x.forwardRef(({arrowNav:i=!0,disableArrowNav:t=!1,tabs:e,onTabSelected:s,children:a},n)=>{const r=x.useRef([]),h=i&&!t,c=a&&x.Children.count(a)>0?x.Children.count(a):(e==null?void 0:e.length)||0;x.useEffect(()=>{r.current=r.current.slice(0,c)},[c]);const v=y=>{const w=e==null?void 0:e[y];w!=null&&w.action&&w.action(y),s&&s(y)},g=(y,w)=>{var S,M;h&&(w.code==="ArrowLeft"&&y!==0&&((S=r.current[y-1])==null||S.focus()),w.code==="ArrowRight"&&y<c-1&&((M=r.current[y+1])==null||M.focus()),(w.code==="ArrowDown"||w.code==="Space")&&v(y))},k=(y,w)=>{r.current[y]=w},b=e==null?void 0:e.map((y,w)=>{var S,M;return l.jsx(Ms,{active:y.active,href:y.href,onClick:()=>v(w),icon:y.icon,controls:y.controls,tag:(S=y.tag)==null?void 0:S.text,tagSkin:(M=y.tag)==null?void 0:M.skin,index:w,children:y.text},w)});return l.jsx(hn.Provider,{value:{arrowNav:h,registerTabRef:k,handleKeyPress:g,selectTab:v},children:l.jsx("div",{className:"pkt-tabs",ref:n,children:l.jsx("div",{className:"pkt-tabs__list",role:h?"tablist":"navigation",children:a||b})})})}),Gh=x.forwardRef(({id:i,ariaDescribedby:t,ariaLabelledby:e,counter:s,counterMaxLength:a,className:n,disabled:r,errorMessage:h,hasError:d,helptext:c,helptextDropdown:v,helptextDropdownButton:g,inline:k,fullwidth:b=!1,label:y,name:w,optionalTag:S=!1,optionalText:M,requiredTag:C=!1,requiredText:V,tagText:N=null,placeholder:G,rows:J,useWrapper:Lt=!0,onChange:Bt,value:st,autoComplete:nt="off",minLength:Ft,maxLength:Vt,readOnly:rt=!1,skipForwardTestid:L=!1,...Tt},ae)=>{const de=[n,"pkt-textinput","pkt-textarea"].join(" "),ne=`${i}-input`,Fe=`${ne}-label`,ri=e||Fe,[pe,Rt]=x.useState(0),dt=Ve=>{var He,ce;if(s&&Rt(((ce=(He=Ve.currentTarget)==null?void 0:He.value)==null?void 0:ce.length)||0),Bt)return Bt(Ve)};return x.useEffect(()=>{st!==void 0&&Rt((st==null?void 0:st.length)||0)},[st]),l.jsx(Mi,{ariaDescribedby:t,className:de,disabled:r,errorMessage:h,forId:ne,hasError:d,helptext:c,helptextDropdown:v,helptextDropdownButton:g,inline:k,label:y,optionalTag:S,optionalText:M,requiredTag:C,requiredText:V,tagText:N,useWrapper:Lt,counter:s,counterCurrent:pe,counterMaxLength:a,children:l.jsx("textarea",{ref:ae,className:`pkt-input ${b?"pkt-input--fullwidth":""} ${a&&pe>a?"pkt-input--counter-error":""}`,name:`${w||i}`,id:ne,placeholder:G,disabled:r,rows:J,"aria-labelledby":ri,"aria-invalid":d,"aria-errormessage":`${i}-error`,...Tt,onChange:dt,value:st,autoComplete:nt,minLength:Ft,maxLength:Vt,"data-skip-forward-testid":L?"true":void 0})})}),Yh=x.forwardRef(({id:i,ariaDescribedby:t,ariaLabelledby:e,autocomplete:s="off",counter:a,counterMaxLength:n,className:r,disabled:h=!1,errorMessage:d,hasError:c=!1,helptext:v,helptextDropdown:g,helptextDropdownButton:k,iconNameRight:b,inline:y=!1,fullwidth:w=!1,label:S,name:M,optionalTag:C=!1,optionalText:V,requiredTag:N=!1,requiredText:G,tagText:J=null,placeholder:Lt,prefix:Bt,suffix:st,type:nt="text",useWrapper:Ft=!0,omitSearchIcon:Vt=!1,value:rt,minLength:L,maxLength:Tt,min:ae,max:de,step:ne,size:Fe,readonly:ri,required:pe,dataTestid:Rt,onChange:dt,skipForwardTestid:Ve=!1,...He},ce)=>{const Is=[r,"pkt-textinput"].join(" "),as=nt==="search"&&!b&&!Vt,Ls=nt==="date"&&rt?rt.slice(0,10):rt,[ns,oi]=x.useState((rt==null?void 0:rt.length)||0),li=`${i}`,Ii=`${li}-label`,rs=e||Ii,Bs=_e=>{var os,ls;a&&oi(((ls=(os=_e.currentTarget)==null?void 0:os.value)==null?void 0:ls.length)||0),dt&&dt(_e)};return x.useEffect(()=>{rt!==void 0&&oi((rt==null?void 0:rt.length)||0)},[rt]),l.jsx(Mi,{ariaDescribedby:t,className:Is,disabled:h,errorMessage:d,forId:li,hasError:c,helptext:v,helptextDropdown:g,helptextDropdownButton:k,inline:y,label:S,optionalTag:C,optionalText:V,requiredTag:N,requiredText:G,tagText:J,useWrapper:Ft,counter:a,counterCurrent:ns,counterMaxLength:n,children:l.jsxs("div",{className:"pkt-input__container","data-testid":Rt,"data-skip-forward-testid":Ve?"true":void 0,children:[Bt&&l.jsx("div",{className:"pkt-input-prefix",children:Bt}),l.jsx("input",{...He,ref:ce,className:`pkt-input ${w?"pkt-input--fullwidth":""} ${n&&ns>n?"pkt-input--counter-error":""}`,type:nt,name:`${M||i}`,value:Ls,id:li,placeholder:Lt,autoComplete:s,disabled:h,"aria-invalid":c,"aria-errormessage":`${i}-error`,"aria-labelledby":rs,min:ae,max:de,onChange:Bs,step:ne,minLength:L,maxLength:Tt,size:Fe,required:pe}),st&&l.jsxs("p",{className:"pkt-input-suffix",children:[st,b&&l.jsx(q,{className:"pkt-input-suffix-icon",name:b}),as&&l.jsx(q,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!st&&b&&l.jsx(q,{className:"pkt-input-icon",name:b}),!st&&as&&l.jsx(q,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})});var ai=window.CustomEvent;(!ai||typeof ai=="object")&&(ai=function(i,t){t=t||{};var e=document.createEvent("CustomEvent");return e.initCustomEvent(i,!!t.bubbles,!!t.cancelable,t.detail||null),e},ai.prototype=window.Event.prototype);function dn(i,t){var e="on"+t.type.toLowerCase();return typeof i[e]=="function"&&i[e](t),i.dispatchEvent(t)}function Zh(i){for(;i&&i!==document.body;){var t=window.getComputedStyle(i),e=function(s,a){return!(t[s]===void 0||t[s]===a)};if(t.opacity<1||e("zIndex","auto")||e("transform","none")||e("mixBlendMode","normal")||e("filter","none")||e("perspective","none")||t.isolation==="isolate"||t.position==="fixed"||t.webkitOverflowScrolling==="touch")return!0;i=i.parentElement}return!1}function Di(i){for(;i;){if(i.localName==="dialog")return i;i.parentElement?i=i.parentElement:i.parentNode?i=i.parentNode.host:i=null}return null}function pn(i){for(;i&&i.shadowRoot&&i.shadowRoot.activeElement;)i=i.shadowRoot.activeElement;i&&i.blur&&i!==document.body&&i.blur()}function Xh(i,t){for(var e=0;e<i.length;++e)if(i[e]===t)return!0;return!1}function Ds(i){return!i||!i.hasAttribute("method")?!1:i.getAttribute("method").toLowerCase()==="dialog"}function cn(i){var t=["button","input","keygen","select","textarea"],e=t.map(function(r){return r+":not([disabled])"});e.push('[tabindex]:not([disabled]):not([tabindex=""])');var s=i.querySelector(e.join(", "));if(!s&&"attachShadow"in Element.prototype)for(var a=i.querySelectorAll("*"),n=0;n<a.length&&!(a[n].tagName&&a[n].shadowRoot&&(s=cn(a[n].shadowRoot),s));n++);return s}function un(i){return i.isConnected||document.body.contains(i)}function fn(i){if(i.submitter)return i.submitter;var t=i.target;if(!(t instanceof HTMLFormElement))return null;var e=z.formSubmitter;if(!e){var s=i.target,a="getRootNode"in s&&s.getRootNode()||document;e=a.activeElement}return!e||e.form!==t?null:e}function Jh(i){if(!i.defaultPrevented){var t=i.target,e=z.imagemapUseValue,s=fn(i);e===null&&s&&(e=s.value);var a=Di(t);if(a){var n=s&&s.getAttribute("formmethod")||t.getAttribute("method");n==="dialog"&&(i.preventDefault(),e!=null?a.close(e):a.close())}}}function gn(i){if(this.dialog_=i,this.replacedStyleTop_=!1,this.openAsModal_=!1,i.hasAttribute("role")||i.setAttribute("role","dialog"),i.show=this.show.bind(this),i.showModal=this.showModal.bind(this),i.close=this.close.bind(this),i.addEventListener("submit",Jh,!1),"returnValue"in i||(i.returnValue=""),"MutationObserver"in window){var t=new MutationObserver(this.maybeHideModal.bind(this));t.observe(i,{attributes:!0,attributeFilter:["open"]})}else{var e=!1,s=(function(){e?this.downgradeModal():this.maybeHideModal(),e=!1}).bind(this),a,n=function(r){if(r.target===i){var h="DOMNodeRemoved";e|=r.type.substr(0,h.length)===h,window.clearTimeout(a),a=window.setTimeout(s,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(r){i.addEventListener(r,n)})}Object.defineProperty(i,"open",{set:this.setOpen.bind(this),get:i.hasAttribute.bind(i,"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))}gn.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&un(this.dialog_)||this.downgradeModal()},downgradeModal:function(){this.openAsModal_&&(this.openAsModal_=!1,this.dialog_.style.zIndex="",this.replacedStyleTop_&&(this.dialog_.style.top="",this.replacedStyleTop_=!1),this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_),z.dm.removeDialog(this))},setOpen:function(i){i?this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open",""):(this.dialog_.removeAttribute("open"),this.maybeHideModal())},backdropMouseEvent_:function(i){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(i.type,i.bubbles,i.cancelable,window,i.detail,i.screenX,i.screenY,i.clientX,i.clientY,i.ctrlKey,i.altKey,i.shiftKey,i.metaKey,i.button,i.relatedTarget),this.dialog_.dispatchEvent(e),i.stopPropagation()},focus_:function(){var i=this.dialog_.querySelector("[autofocus]:not([disabled])");!i&&this.dialog_.tabIndex>=0&&(i=this.dialog_),i||(i=cn(this.dialog_)),pn(document.activeElement),i&&i.focus()},updateZIndex:function(i,t){if(i<t)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=i,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(!un(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!z.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");Zh(this.dialog_.parentElement)&&console.warn("A dialog is being shown inside a stacking context. This may cause it to be unusable. For more information, see this link: https://github.com/GoogleChrome/dialog-polyfill/#stacking-context"),this.setOpen(!0),this.openAsModal_=!0,z.needsCentering(this.dialog_)?(z.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(i){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),i!==void 0&&(this.dialog_.returnValue=i);var t=new ai("close",{bubbles:!1,cancelable:!1});dn(this.dialog_,t)}};var z={};if(z.reposition=function(i){var t=document.body.scrollTop||document.documentElement.scrollTop,e=t+(window.innerHeight-i.offsetHeight)/2;i.style.top=Math.max(t,e)+"px"},z.isInlinePositionSetByStylesheet=function(i){for(var t=0;t<document.styleSheets.length;++t){var e=document.styleSheets[t],s=null;try{s=e.cssRules}catch{}if(s)for(var a=0;a<s.length;++a){var n=s[a],r=null;try{r=document.querySelectorAll(n.selectorText)}catch{}if(!(!r||!Xh(r,i))){var h=n.style.getPropertyValue("top"),d=n.style.getPropertyValue("bottom");if(h&&h!=="auto"||d&&d!=="auto")return!0}}}return!1},z.needsCentering=function(i){var t=window.getComputedStyle(i);return t.position!=="absolute"||i.style.top!=="auto"&&i.style.top!==""||i.style.bottom!=="auto"&&i.style.bottom!==""?!1:!z.isInlinePositionSetByStylesheet(i)},z.forceRegisterDialog=function(i){if((window.HTMLDialogElement||i.showModal)&&console.warn("This browser already supports <dialog>, the polyfill may not work correctly",i),i.localName!=="dialog")throw new Error("Failed to register dialog: The element is not a dialog.");new gn(i)},z.registerDialog=function(i){i.showModal||z.forceRegisterDialog(i)},z.DialogManager=function(){this.pendingDialogStack=[];var i=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(),i([])}).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(s){for(var a=0,n;n=s.removedNodes[a];++a){if(n instanceof Element)n.localName==="dialog"&&e.push(n);else continue;e=e.concat(n.querySelectorAll("dialog"))}}),e.length&&i(e)}))},z.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0),document.addEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})},z.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},z.DialogManager.prototype.updateStacking=function(){for(var i=this.zIndexHigh_,t=0,e;e=this.pendingDialogStack[t];++t)e.updateZIndex(--i,--i),t===0&&(this.overlay.style.zIndex=--i);var s=this.pendingDialogStack[0];if(s){var a=s.dialog.parentNode||document.body;a.appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},z.DialogManager.prototype.containedByTopDialog_=function(i){for(;i=Di(i);){for(var t=0,e;e=this.pendingDialogStack[t];++t)if(e.dialog===i)return t===0;i=i.parentElement}return!1},z.DialogManager.prototype.handleFocus_=function(i){var t=i.composedPath?i.composedPath()[0]:i.target;if(!this.containedByTopDialog_(t)&&document.activeElement!==document.documentElement&&(i.preventDefault(),i.stopPropagation(),pn(t),this.forwardTab_!==void 0)){var e=this.pendingDialogStack[0],s=e.dialog,a=s.compareDocumentPosition(t);return a&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?e.focus_():t!==document.documentElement&&document.documentElement.focus()),!1}},z.DialogManager.prototype.handleKey_=function(i){if(this.forwardTab_=void 0,i.keyCode===27){i.preventDefault(),i.stopPropagation();var t=new ai("cancel",{bubbles:!1,cancelable:!0}),e=this.pendingDialogStack[0];e&&dn(e.dialog,t)&&e.dialog.close()}else i.keyCode===9&&(this.forwardTab_=!i.shiftKey)},z.DialogManager.prototype.checkDOM_=function(i){var t=this.pendingDialogStack.slice();t.forEach(function(e){i.indexOf(e.dialog)!==-1?e.downgradeModal():e.maybeHideModal()})},z.DialogManager.prototype.pushDialog=function(i){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=t?!1:(this.pendingDialogStack.unshift(i)===1&&this.blockDocument(),this.updateStacking(),!0)},z.DialogManager.prototype.removeDialog=function(i){var t=this.pendingDialogStack.indexOf(i);t!==-1&&(this.pendingDialogStack.splice(t,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())},z.dm=new z.DialogManager,z.formSubmitter=null,z.imagemapUseValue=null,window.HTMLDialogElement===void 0){var mn=document.createElement("form");if(mn.setAttribute("method","dialog"),mn.method!=="dialog"){var ni=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(ni){var Qh=ni.get;ni.get=function(){return Ds(this)?"dialog":Qh.call(this)};var td=ni.set;ni.set=function(i){return typeof i=="string"&&i.toLowerCase()==="dialog"?this.setAttribute("method",i):td.call(this,i)},Object.defineProperty(HTMLFormElement.prototype,"method",ni)}}document.addEventListener("click",function(i){if(z.formSubmitter=null,z.imagemapUseValue=null,!i.defaultPrevented){var t=i.target;if("composedPath"in i){var e=i.composedPath();t=e.shift()||t}if(!(!t||!Ds(t.form))){var s=t.type==="submit"&&["button","input"].indexOf(t.localName)>-1;if(!s){if(!(t.localName==="input"&&t.type==="image"))return;z.imagemapUseValue=i.offsetX+","+i.offsetY}var a=Di(t);a&&(z.formSubmitter=t)}}},!1),document.addEventListener("submit",function(i){var t=i.target,e=Di(t);if(!e){var s=fn(i),a=s&&s.getAttribute("formmethod")||t.getAttribute("method");a==="dialog"&&i.preventDefault()}});var ed=HTMLFormElement.prototype.submit,id=function(){if(!Ds(this))return ed.call(this);var i=Di(this);i&&i.close()};HTMLFormElement.prototype.submit=id}const sd=Object.freeze(Object.defineProperty({__proto__:null,default:z},Symbol.toStringTag,{value:"Module"}));E.PktAccordion=qs,E.PktAccordionItem=Wa,E.PktAlert=Es,E.PktBackLink=Ra,E.PktBreadcrumbs=fh,E.PktButton=si,E.PktCard=Ka,E.PktCheckbox=Ga,E.PktCombobox=Ya,E.PktConsent=ss,E.PktDatepicker=Za,E.PktFooter=bh,E.PktFooterSimple=yh,E.PktHeader=wh,E.PktHeading=Ja,E.PktHelptext=Qa,E.PktIcon=q,E.PktInput=tn,E.PktInputWrapper=Mi,E.PktLink=en,E.PktLinkCard=sn,E.PktLoader=an,E.PktMessagebox=nn,E.PktModal=rn,E.PktProgressbar=on,E.PktRadioButton=ln,E.PktSearchInput=Oh,E.PktSelect=Mh,E.PktStep=Bh,E.PktStepper=Fh,E.PktTabItem=Ms,E.PktTable=Vh,E.PktTableBody=Hh,E.PktTableDataCell=jh,E.PktTableHeader=Uh,E.PktTableHeaderCell=qh,E.PktTableRow=zh,E.PktTabs=Kh,E.PktTag=Os,E.PktTextarea=Gh,E.PktTextinput=Yh,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})}));
|