@oslokommune/punkt-elements 16.6.2 → 16.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/{accordionitem-D7sWqDM_.cjs → accordionitem-D1Agl1bB.cjs} +1 -1
- package/dist/{accordionitem-Cj74XruR.js → accordionitem-ZlaXvjt5.js} +5 -5
- package/dist/{alert-ca_hFi-u.js → alert-BuAXrnKl.js} +6 -6
- package/dist/{alert-C95U_RZ0.cjs → alert-DFkFNTxh.cjs} +1 -1
- package/dist/{async-directive-CKx6pubI.js → async-directive-CMzWMlZ5.js} +1 -1
- package/dist/{async-directive-B158h3ba.cjs → async-directive-DoMuclel.cjs} +1 -1
- package/dist/{backlink-CQoNgoa-.cjs → backlink-EiAXUUZP.cjs} +1 -1
- package/dist/{backlink-C68H4Z3b.js → backlink-V4DAt17e.js} +3 -3
- package/dist/{button-BRovt5nm.js → button-DEyvt1LI.js} +5 -5
- package/dist/{button-BXN_JPaH.cjs → button-DYv5Dg4M.cjs} +1 -1
- package/dist/{calendar-43Y_6FD8.cjs → calendar-HIE9nxcc.cjs} +1 -1
- package/dist/{calendar-B5Xwl8mV.js → calendar-S63oreVW.js} +4 -4
- package/dist/{card-DfHo45CG.cjs → card-CyeH6l1c.cjs} +1 -1
- package/dist/{card-DvgCTN4B.js → card-DDiLfuO4.js} +7 -7
- package/dist/{checkbox-mmn3v9ry.cjs → checkbox-BLlwTABj.cjs} +1 -1
- package/dist/{checkbox-CbIUMIYt.js → checkbox-ejBUa5qQ.js} +4 -4
- package/dist/{class-map-3ADKve8g.js → class-map-CEnykyO_.js} +1 -1
- package/dist/{class-map-Bokp1SoS.cjs → class-map-CsENJXf1.cjs} +1 -1
- package/dist/{combobox-CwW0md6G.js → combobox-BmxSecfE.js} +13 -13
- package/dist/{combobox-TKL44xnV.cjs → combobox-Hb2V-fPX.cjs} +1 -1
- package/dist/{consent-CgS1L1xF.js → consent-iXyx5v6J.js} +3 -3
- package/dist/{consent-CIhFwuFO.cjs → consent-ruWAEVXW.cjs} +1 -1
- package/dist/{datepicker-qRWWzmbo.js → datepicker-CZl7b8Na.js} +12 -12
- package/dist/{datepicker-oN9L0Wnm.cjs → datepicker-D2H7U6MS.cjs} +1 -1
- package/dist/{directive-helpers-B3Vpl3xV.cjs → directive-helpers-BP2WOx60.cjs} +1 -1
- package/dist/{directive-helpers-CyPtA1_i.js → directive-helpers-rm-28gIj.js} +1 -1
- package/dist/{element-CV9utnHJ.js → element-CPpT3rFQ.js} +68 -67
- package/dist/{element-CMTfByxQ.cjs → element-gR_VtSiD.cjs} +6 -6
- package/dist/{element-with-slot-1djk8KXi.js → element-with-slot-Dqk6-TRR.js} +2 -2
- package/dist/{element-with-slot-yT8k1Z37.cjs → element-with-slot-ZX-up7jO.cjs} +1 -1
- package/dist/{heading-D9R5UBcv.js → heading-CKt7cVn7.js} +1 -1
- package/dist/{heading-B0XRE0lq.cjs → heading-Cvz8m1xL.cjs} +1 -1
- package/dist/{helptext-B366oeR9.cjs → helptext-5Mzp65-F.cjs} +1 -1
- package/dist/{helptext-DepcDYFV.js → helptext-jIoWRcCF.js} +5 -5
- package/dist/{icon-D0IQAVwS.js → icon-BlKA8YuW.js} +1 -1
- package/dist/{icon-Dj0oZZSa.cjs → icon-Bqj9oBbl.cjs} +1 -1
- package/dist/{if-defined-rXcLNTzN.js → if-defined-B0krMLad.js} +1 -1
- package/dist/{if-defined-hKKmbsI8.cjs → if-defined-BOW3ODSj.cjs} +1 -1
- package/dist/index.d.ts +92 -0
- package/dist/{input-element-n5U38pZ1.js → input-element-8nLwuQS4.js} +3 -3
- package/dist/{input-element-Xe9FTi2a.cjs → input-element-DdVhUvva.cjs} +1 -1
- package/dist/{input-wrapper-BdFdJU-k.cjs → input-wrapper-B0MkQ0IZ.cjs} +1 -1
- package/dist/{input-wrapper-B__6jW4U.js → input-wrapper-B2JpK016.js} +7 -7
- package/dist/{link-DLjXMpvi.cjs → link-R_lNhViF.cjs} +1 -1
- package/dist/{link-oGYvBLYL.js → link-Z_GizclR.js} +4 -4
- package/dist/{linkcard-BhVIc18n.js → linkcard-BlQvdB1a.js} +4 -4
- package/dist/{linkcard-C20WC6Nw.cjs → linkcard-C7HbSLlX.cjs} +1 -1
- package/dist/{listbox-CS4WQOuf.js → listbox-BQKDZvZn.js} +5 -5
- package/dist/{listbox-OAVh_U7u.cjs → listbox-CGgV9MAe.cjs} +1 -1
- package/dist/{loader-BHt9i5Xp.js → loader-Ci3CHU8k.js} +5 -5
- package/dist/{loader-DxAGCcNF.cjs → loader-e2gs_1xz.cjs} +1 -1
- package/dist/{messagebox-DkspcMQg.js → messagebox-Bf-XMlvW.js} +5 -5
- package/dist/{messagebox-B8LW0PSQ.cjs → messagebox-D67w71VX.cjs} +1 -1
- package/dist/{modal-mWn5pjs8.cjs → modal-CyvEkbfQ.cjs} +1 -1
- package/dist/{modal-D3u6ueP5.js → modal-DzGe1g8Z.js} +6 -6
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +2 -2
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +1 -1
- package/dist/pkt-backlink.cjs +1 -1
- package/dist/pkt-backlink.js +1 -1
- package/dist/pkt-breadcrumbs.cjs +1 -1
- package/dist/pkt-breadcrumbs.js +2 -2
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +1 -1
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +1 -1
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +1 -1
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +1 -1
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +1 -1
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +1 -1
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +2 -2
- package/dist/pkt-header.cjs +1 -1
- package/dist/pkt-header.js +10 -10
- package/dist/pkt-heading.cjs +1 -1
- package/dist/pkt-heading.js +1 -1
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +33 -31
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +1 -1
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -1
- package/dist/pkt-listbox.cjs +1 -1
- package/dist/pkt-listbox.js +1 -1
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +1 -1
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +1 -1
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/{pkt-options-controller-DIeKSpWv.cjs → pkt-options-controller-5LXbEzuk.cjs} +1 -1
- package/dist/{pkt-options-controller-W4ITGQy9.js → pkt-options-controller-B5YalfCb.js} +1 -1
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +2 -2
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +1 -1
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +1 -1
- package/dist/pkt-tabs.cjs +1 -1
- package/dist/pkt-tabs.js +2 -2
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +1 -1
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +1 -1
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +1 -1
- package/dist/pkt-timepicker.cjs +188 -0
- package/dist/pkt-timepicker.js +552 -0
- package/dist/{progressbar-CcX-xiPI.js → progressbar-By7e0lEI.js} +5 -5
- package/dist/{progressbar-CC9Qr82_.cjs → progressbar-DsJ2B9Vm.cjs} +1 -1
- package/dist/{radiobutton-RW3h0tJj.js → radiobutton-6frNG9J_.js} +5 -5
- package/dist/{radiobutton-BUDQYAH-.cjs → radiobutton-Bv-BZ1Hw.cjs} +1 -1
- package/dist/{ref-DBGHvw2G.js → ref-Bg_Swj5w.js} +2 -2
- package/dist/{ref-DahIePMT.cjs → ref-CL-Xk9Xm.cjs} +1 -1
- package/dist/{repeat-DnlRNf63.js → repeat-BD8TKgJb.js} +2 -2
- package/dist/{repeat-C-FJ2vfy.cjs → repeat-Cfq8CDlf.cjs} +1 -1
- package/dist/{select-iXKeM3yz.js → select-CXZt1nHS.js} +8 -8
- package/dist/{select-PuEeK4jQ.cjs → select-WFhS4Vfp.cjs} +1 -1
- package/dist/{state-l4hGZdFJ.js → state-C_1EOo3D.js} +1 -1
- package/dist/{state-BNgpvY-A.cjs → state-Dg-53wQ8.cjs} +1 -1
- package/dist/{tabitem-DZSzwag2.js → tabitem-CB8wkKmv.js} +5 -5
- package/dist/{tabitem-Jenus4Qd.cjs → tabitem-DZpspU4Q.cjs} +1 -1
- package/dist/{tag-CIWBLpjv.js → tag-BuCpqaks.js} +6 -6
- package/dist/{tag-DeE1OpmF.cjs → tag-X6xdjR0N.cjs} +1 -1
- package/dist/{textarea-DR9lVDN-.js → textarea-Bzuymclz.js} +10 -10
- package/dist/{textarea-DtiYQWjy.cjs → textarea-DoeHJ7HR.cjs} +1 -1
- package/dist/{textinput-0Bttvt9V.js → textinput-9lHjs4ce.js} +9 -9
- package/dist/{textinput-cKrjvbJW.cjs → textinput-BNsLd26i.cjs} +1 -1
- package/dist/timepicker.d.ts +1 -0
- package/package.json +2 -3
- package/src/components/index.ts +3 -0
- package/src/components/timepicker/index.ts +2 -0
- package/src/components/timepicker/timepicker.test.ts +453 -0
- package/src/components/timepicker/timepicker.ts +787 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,24 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [16.7.0](https://github.com/oslokommune/punkt/compare/16.6.2...16.7.0) (2026-04-10)
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
Ingen
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
* Ny komponent: PktTimepicker (#3380).
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
Ingen
|
|
19
|
+
|
|
20
|
+
### Chores
|
|
21
|
+
Ingen
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
|
|
8
26
|
## [16.6.2](https://github.com/oslokommune/punkt/compare/16.6.1...16.6.2) (2026-04-10)
|
|
9
27
|
|
|
10
28
|
### ⚠ BREAKING CHANGES
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const i=require("./element-
|
|
1
|
+
"use strict";const i=require("./element-gR_VtSiD.cjs"),h=require("./class-map-CsENJXf1.cjs"),m=require("./element-with-slot-ZX-up7jO.cjs"),u=require("./ref-CL-Xk9Xm.cjs"),f=require("./if-defined-BOW3ODSj.cjs");var y=Object.defineProperty,k=Object.getOwnPropertyDescriptor,l=(s,t,o,r)=>{for(var e=r>1?void 0:r?k(t,o):t,c=s.length-1,a;c>=0;c--)(a=s[c])&&(e=(r?a(t,o,e):a(e))||e);return r&&e&&y(t,o,e),e};let p=class extends i.i{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 o=(t=this.renderRoot)==null?void 0:t.querySelector("slot");o&&o.assignedElements().forEach(e=>{e.tagName.toLowerCase()==="pkt-accordion-item"&&(e.hasAttribute("name")||e.setAttribute("name",this.name))})}}firstUpdated(){var o;const t=(o=this.renderRoot)==null?void 0:o.querySelector("slot");t&&t.addEventListener("slotchange",()=>{this.updateAccordionItemNames()})}render(){const t={"pkt-accordion":!0,"pkt-accordion--compact":this.compact,[`pkt-accordion--${this.skin}`]:this.skin};return i.b`
|
|
2
2
|
<div
|
|
3
3
|
part="container"
|
|
4
4
|
class=${h.e(t)}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as u, b as m, n as r, t as h } from "./element-
|
|
2
|
-
import { e as f } from "./class-map-
|
|
3
|
-
import { P as y, s as _ } from "./element-with-slot-
|
|
4
|
-
import { e as k, n as v } from "./ref-
|
|
5
|
-
import { o as $ } from "./if-defined-
|
|
1
|
+
import { i as u, b as m, n as r, t as h } from "./element-CPpT3rFQ.js";
|
|
2
|
+
import { e as f } from "./class-map-CEnykyO_.js";
|
|
3
|
+
import { P as y, s as _ } from "./element-with-slot-Dqk6-TRR.js";
|
|
4
|
+
import { e as k, n as v } from "./ref-Bg_Swj5w.js";
|
|
5
|
+
import { o as $ } from "./if-defined-B0krMLad.js";
|
|
6
6
|
var b = Object.defineProperty, O = Object.getOwnPropertyDescriptor, l = (t, e, a, o) => {
|
|
7
7
|
for (var i = o > 1 ? void 0 : o ? O(e, a) : e, n = t.length - 1, c; n >= 0; n--)
|
|
8
8
|
(c = t[n]) && (i = (o ? c(e, a, i) : c(i)) || i);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { e as h } from "./class-map-
|
|
2
|
-
import { A as u, b as p, n as a, t as v } from "./element-
|
|
3
|
-
import { r as f } from "./state-
|
|
4
|
-
import { P as k, s as m } from "./element-with-slot-
|
|
1
|
+
import { e as h } from "./class-map-CEnykyO_.js";
|
|
2
|
+
import { A as u, b as p, n as a, t as v } from "./element-CPpT3rFQ.js";
|
|
3
|
+
import { r as f } from "./state-C_1EOo3D.js";
|
|
4
|
+
import { P as k, s as m } from "./element-with-slot-Dqk6-TRR.js";
|
|
5
5
|
import { u as _ } from "./classutils-RQs1k6D9.js";
|
|
6
|
-
import "./icon-
|
|
7
|
-
import "./button-
|
|
6
|
+
import "./icon-BlKA8YuW.js";
|
|
7
|
+
import "./button-DEyvt1LI.js";
|
|
8
8
|
const b = { skin: { default: "info" }, ariaLive: { default: "polite" }, compact: { default: !1 }, closeAlert: { default: !1 } }, c = {
|
|
9
9
|
props: b
|
|
10
10
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const c=require("./class-map-
|
|
1
|
+
"use strict";const c=require("./class-map-CsENJXf1.cjs"),e=require("./element-gR_VtSiD.cjs"),d=require("./state-Dg-53wQ8.cjs"),u=require("./element-with-slot-ZX-up7jO.cjs"),h=require("./classutils-BwNK82ZQ.cjs");require("./icon-Bqj9oBbl.cjs");require("./button-DYv5Dg4M.cjs");const k={skin:{default:"info"},ariaLive:{default:"polite"},compact:{default:!1},closeAlert:{default:!1}},a={props:k};var v=Object.defineProperty,f=Object.getOwnPropertyDescriptor,i=(o,t,s,r)=>{for(var l=r>1?void 0:r?f(t,s):t,p=o.length-1,n;p>=0;p--)(n=o[p])&&(l=(r?n(t,s,l):n(l))||l);return r&&l&&v(t,s,l),l};exports.PktAlert=class extends u.PktElementWithSlot{constructor(){super(),this.compact=a.props.compact.default,this.title="",this.skin=a.props.skin.default,this.ariaLive=a.props.ariaLive.default,this["aria-live"]=null,this.closeAlert=a.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._isClosed=!1}connectedCallback(){super.connectedCallback(),this["aria-live"]=this.getAttribute("aria-live")||this.ariaLive}attributeChangedCallback(t,s,r){t==="ariaLive"&&(this["aria-live"]=r),super.attributeChangedCallback(t,s,r)}updated(t){super.updated(t),t.has("ariaLive")&&(this["aria-live"]=this.ariaLive),t.has("_isClosed")&&h.updateClassAttribute(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},s={"pkt-alert__grid":!0,"pkt-alert__noTitle":!this.title,"pkt-alert__noDate":!this.date};return e.b`
|
|
2
2
|
<div class=${c.e(t)} aria-live=${this["aria-live"]}>
|
|
3
3
|
<div class=${c.e(s)}>
|
|
4
4
|
<pkt-icon
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const $=require("./directive-helpers-
|
|
1
|
+
"use strict";const $=require("./directive-helpers-BP2WOx60.cjs"),c=require("./directive-C7oCP5Bh.cjs");/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const r=require("./element-
|
|
1
|
+
"use strict";const r=require("./element-gR_VtSiD.cjs"),c=require("./if-defined-BOW3ODSj.cjs");require("./icon-Bqj9oBbl.cjs");var p=Object.defineProperty,o=Object.getOwnPropertyDescriptor,n=(k,t,a,i)=>{for(var e=i>1?void 0:i?o(t,a):t,s=k.length-1,l;s>=0;s--)(l=k[s])&&(e=(i?l(t,a,e):l(e))||e);return i&&e&&p(t,a,e),e};exports.PktBackLink=class extends r.PktElement{constructor(){super(...arguments),this.href="",this.text="Forsiden",this.ariaLabel=""}attributeChangedCallback(t,a,i){t==="arialabel"&&this.removeAttribute("arialabel"),t==="href"&&this.removeAttribute("href"),t==="text"&&this.removeAttribute("text"),super.attributeChangedCallback(t,a,i)}render(){return r.b`<nav
|
|
2
2
|
class="pkt-back-link"
|
|
3
3
|
aria-label=${this.ariaLabel||"Gå tilbake til forrige side"}
|
|
4
4
|
>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { P as c, b as k, n as o, t as b } from "./element-
|
|
2
|
-
import { o as h } from "./if-defined-
|
|
3
|
-
import "./icon-
|
|
1
|
+
import { P as c, b as k, n as o, t as b } from "./element-CPpT3rFQ.js";
|
|
2
|
+
import { o as h } from "./if-defined-B0krMLad.js";
|
|
3
|
+
import "./icon-BlKA8YuW.js";
|
|
4
4
|
var f = Object.defineProperty, u = Object.getOwnPropertyDescriptor, n = (t, r, i, l) => {
|
|
5
5
|
for (var e = l > 1 ? void 0 : l ? u(r, i) : r, s = t.length - 1, p; s >= 0; s--)
|
|
6
6
|
(p = t[s]) && (e = (l ? p(r, i, e) : p(e)) || e);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { P as c, s as f } from "./element-with-slot-
|
|
2
|
-
import { A as b, b as l, n as s, t as u } from "./element-
|
|
3
|
-
import { e as y } from "./class-map-
|
|
4
|
-
import { o as r } from "./if-defined-
|
|
5
|
-
import "./icon-
|
|
1
|
+
import { P as c, s as f } from "./element-with-slot-Dqk6-TRR.js";
|
|
2
|
+
import { A as b, b as l, n as s, t as u } from "./element-CPpT3rFQ.js";
|
|
3
|
+
import { e as y } from "./class-map-CEnykyO_.js";
|
|
4
|
+
import { o as r } from "./if-defined-B0krMLad.js";
|
|
5
|
+
import "./icon-BlKA8YuW.js";
|
|
6
6
|
var m = Object.defineProperty, g = Object.getOwnPropertyDescriptor, e = (t, o, n, p) => {
|
|
7
7
|
for (var a = p > 1 ? void 0 : p ? g(o, n) : o, d = t.length - 1, h; d >= 0; d--)
|
|
8
8
|
(h = t[d]) && (a = (p ? h(o, n, a) : h(a)) || a);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const d=require("./element-with-slot-
|
|
1
|
+
"use strict";const d=require("./element-with-slot-ZX-up7jO.cjs"),t=require("./element-gR_VtSiD.cjs"),h=require("./class-map-CsENJXf1.cjs"),a=require("./if-defined-BOW3ODSj.cjs");require("./icon-Bqj9oBbl.cjs");var u=Object.defineProperty,c=Object.getOwnPropertyDescriptor,n=(r,i,o,e)=>{for(var s=e>1?void 0:e?c(i,o):i,p=r.length-1,l;p>=0;p--)(l=r[p])&&(s=(e?l(i,o,s):l(s))||s);return e&&s&&u(i,o,s),s};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/latest/animations/";exports.PktButton=class extends d.PktElementWithSlot{constructor(){super(...arguments),this.iconName="user",this.secondIconName="user",this.mode="light",this.size="medium",this.fullWidth=!1,this.fullWidthOnMobile=!1,this.skin="primary",this.variant="label-only",this.state="normal",this.type="button",this.form=void 0,this.isLoading=!1,this.disabled=!1,this.loadingAnimationPath=window.pktAnimationPath}connectedCallback(){super.connectedCallback(),this.addEventListener("click",i=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(i.preventDefault(),i.stopImmediatePropagation())},!0),this.addEventListener("keydown",i=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),i.stopImmediatePropagation())},!0)}attributeChangedCallback(i,o,e){super.attributeChangedCallback(i,o,e),i==="disabled"&&e==="false"&&(this.disabled=!1),(i==="isloading"||i==="isLoading")&&e==="false"&&(this.isLoading=!1)}firstUpdated(i){super.firstUpdated(i),this.disabled==="false"&&(this.disabled=!1),this.isLoading==="false"&&(this.isLoading=!1)}render(){const i=this.form??this.getAttribute("form")??void 0,o={"pkt-btn":!0,[`pkt-btn--${this.size}`]:!!this.size,[`pkt-btn--${this.skin}`]:!!this.skin,[`pkt-btn--${this.variant}`]:!!this.variant,[`pkt-btn--${this.color}`]:!!this.color,[`pkt-btn--${this.state}`]:!!this.state,"pkt-btn--full":!!this.fullWidth,"pkt-btn--full-small":!!this.fullWidthOnMobile,"pkt-btn--disabled":!!this.disabled,"pkt-btn--isLoading":!!this.isLoading};return t.b`
|
|
2
2
|
<button
|
|
3
3
|
class=${h.e(o)}
|
|
4
4
|
type=${this.type}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const et=require("./class-map-Bokp1SoS.cjs"),u=require("./element-CMTfByxQ.cjs"),J=require("./state-BNgpvY-A.cjs");require("./icon-Dj0oZZSa.cjs");const ft=6048e5,Ot=864e5,nt=Symbol.for("constructDateFrom");function k(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&nt in e?e[nt](t):e instanceof Date?new e.constructor(t):new Date(t)}function b(e,t){return k(t||e,e)}function rt(e,t,n){const r=b(e,n==null?void 0:n.in);return isNaN(t)?k(e,NaN):(t&&r.setDate(r.getDate()+t),r)}let xt={};function U(){return xt}function H(e,t){var o,c,d,f;const n=U(),r=(t==null?void 0:t.weekStartsOn)??((c=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??0,a=b(e,t==null?void 0:t.in),s=a.getDay(),i=(s<r?7:0)+s-r;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function L(e,t){return H(e,{...t,weekStartsOn:1})}function mt(e,t){const n=b(e,t==null?void 0:t.in),r=n.getFullYear(),a=k(n,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const s=L(a),i=k(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const o=L(i);return n.getTime()>=s.getTime()?r+1:n.getTime()>=o.getTime()?r:r-1}function at(e){const t=b(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function gt(e,...t){const n=k.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function G(e,t){const n=b(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function Pt(e,t,n){const[r,a]=gt(n==null?void 0:n.in,e,t),s=G(r),i=G(a),o=+s-at(s),c=+i-at(i);return Math.round((o-c)/Ot)}function Ct(e,t){const n=mt(e,t),r=k(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),L(r)}function Nt(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function $t(e){return!(!Nt(e)&&typeof e!="number"||isNaN(+b(e)))}function Et(e,t){const n=b(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function Wt(e,t){const[n,r]=gt(e,t.start,t.end);return{start:n,end:r}}function yt(e,t){const{start:n,end:r}=Wt(t==null?void 0:t.in,e);let a=+n>+r;const s=a?+n:+r,i=a?r:n;i.setHours(0,0,0,0);let o=1;const c=[];for(;+i<=s;)c.push(k(n,i)),i.setDate(i.getDate()+o),i.setHours(0,0,0,0);return a?c.reverse():c}function _t(e,t){const n=b(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const Yt={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"}},It=(e,t,n)=>{let r;const a=Yt[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function j(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Ft={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},At={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ht={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Rt={date:j({formats:Ft,defaultWidth:"full"}),time:j({formats:At,defaultWidth:"full"}),dateTime:j({formats:Ht,defaultWidth:"full"})},qt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Lt=(e,t,n,r)=>qt[e];function Y(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):i;a=e.formattingValues[o]||e.formattingValues[i]}else{const i=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[o]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(t):t;return a[s]}}const Ut={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Bt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},zt={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"]},jt={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"]},Qt={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"}},Xt={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"}},Gt=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Vt={ordinalNumber:Gt,era:Y({values:Ut,defaultWidth:"wide"}),quarter:Y({values:Bt,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Y({values:zt,defaultWidth:"wide"}),day:Y({values:jt,defaultWidth:"wide"}),dayPeriod:Y({values:Qt,defaultWidth:"wide",formattingValues:Xt,defaultFormattingWidth:"wide"})};function I(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(a);if(!s)return null;const i=s[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(o)?Kt(o,y=>y.test(i)):Jt(o,y=>y.test(i));let d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const f=t.slice(i.length);return{value:d,rest:f}}}function Jt(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Kt(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Zt(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=n.valueCallback?n.valueCallback(i):i;const o=t.slice(a.length);return{value:i,rest:o}}}const te=/^(\d+)(th|st|nd|rd)?/i,ee=/\d+/i,ne={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},re={any:[/^b/i,/^(a|c)/i]},ae={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},se={any:[/1/i,/2/i,/3/i,/4/i]},ie={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},oe={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]},ce={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},ue={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]},le={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},he={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}},de={ordinalNumber:Zt({matchPattern:te,parsePattern:ee,valueCallback:e=>parseInt(e,10)}),era:I({matchPatterns:ne,defaultMatchWidth:"wide",parsePatterns:re,defaultParseWidth:"any"}),quarter:I({matchPatterns:ae,defaultMatchWidth:"wide",parsePatterns:se,defaultParseWidth:"any",valueCallback:e=>e+1}),month:I({matchPatterns:ie,defaultMatchWidth:"wide",parsePatterns:oe,defaultParseWidth:"any"}),day:I({matchPatterns:ce,defaultMatchWidth:"wide",parsePatterns:ue,defaultParseWidth:"any"}),dayPeriod:I({matchPatterns:le,defaultMatchWidth:"any",parsePatterns:he,defaultParseWidth:"any"})},fe={code:"en-US",formatDistance:It,formatLong:Rt,formatRelative:Lt,localize:Vt,match:de,options:{weekStartsOn:0,firstWeekContainsDate:1}};function me(e,t){const n=b(e,t==null?void 0:t.in);return Pt(n,_t(n))+1}function ge(e,t){const n=b(e,t==null?void 0:t.in),r=+L(n)-+Ct(n);return Math.round(r/ft)+1}function pt(e,t){var f,y,p,S;const n=b(e,t==null?void 0:t.in),r=n.getFullYear(),a=U(),s=(t==null?void 0:t.firstWeekContainsDate)??((y=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:y.firstWeekContainsDate)??a.firstWeekContainsDate??((S=(p=a.locale)==null?void 0:p.options)==null?void 0:S.firstWeekContainsDate)??1,i=k((t==null?void 0:t.in)||e,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const o=H(i,t),c=k((t==null?void 0:t.in)||e,0);c.setFullYear(r,0,s),c.setHours(0,0,0,0);const d=H(c,t);return+n>=+o?r+1:+n>=+d?r:r-1}function ye(e,t){var o,c,d,f;const n=U(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,a=pt(e,t),s=k((t==null?void 0:t.in)||e,0);return s.setFullYear(a,0,r),s.setHours(0,0,0,0),H(s,t)}function wt(e,t){const n=b(e,t==null?void 0:t.in),r=+H(n,t)-+ye(n,t);return Math.round(r/ft)+1}function l(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const M={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return l(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):l(n+1,2)},d(e,t){return l(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return l(e.getHours()%12||12,t.length)},H(e,t){return l(e.getHours(),t.length)},m(e,t){return l(e.getMinutes(),t.length)},s(e,t){return l(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return l(a,t.length)}},$={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},st={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return M.y(e,t)},Y:function(e,t,n,r){const a=pt(e,r),s=a>0?a:1-a;if(t==="YY"){const i=s%100;return l(i,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):l(s,t.length)},R:function(e,t){const n=mt(e);return l(n,t.length)},u:function(e,t){const n=e.getFullYear();return l(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return l(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return l(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return M.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return l(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const a=wt(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):l(a,t.length)},I:function(e,t,n){const r=ge(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):l(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):M.d(e,t)},D:function(e,t,n){const r=me(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):l(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const a=e.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return l(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return l(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return l(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(r===12?a=$.noon:r===0?a=$.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(r>=17?a=$.evening:r>=12?a=$.afternoon:r>=4?a=$.morning:a=$.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return M.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):M.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):l(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):l(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):M.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):M.s(e,t)},S:function(e,t){return M.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return ot(r);case"XXXX":case"XX":return x(r);case"XXXXX":case"XXX":default:return x(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return ot(r);case"xxxx":case"xx":return x(r);case"xxxxx":case"xxx":default:return x(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+it(r,":");case"OOOO":default:return"GMT"+x(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+it(r,":");case"zzzz":default:return"GMT"+x(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return l(r,t.length)},T:function(e,t,n){return l(+e,t.length)}};function it(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),s=r%60;return s===0?n+String(a):n+String(a)+t+l(s,2)}function ot(e,t){return e%60===0?(e>0?"-":"+")+l(Math.abs(e)/60,2):x(e,t)}function x(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=l(Math.trunc(r/60),2),s=l(r%60,2);return n+a+t+s}const ct=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},bt=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},pe=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return ct(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",ct(r,t)).replace("{{time}}",bt(a,t))},we={p:bt,P:pe},be=/^D+$/,De=/^Y+$/,ke=["D","DD","YY","YYYY"];function Se(e){return be.test(e)}function ve(e){return De.test(e)}function Me(e,t,n){const r=Te(e,t,n);if(console.warn(r),ke.includes(e))throw new RangeError(r)}function Te(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Oe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,xe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Pe=/^'([^]*?)'?$/,Ce=/''/g,Ne=/[a-zA-Z]/;function $e(e,t,n){var f,y,p,S;const r=U(),a=r.locale??fe,s=r.firstWeekContainsDate??((y=(f=r.locale)==null?void 0:f.options)==null?void 0:y.firstWeekContainsDate)??1,i=r.weekStartsOn??((S=(p=r.locale)==null?void 0:p.options)==null?void 0:S.weekStartsOn)??0,o=b(e,n==null?void 0:n.in);if(!$t(o))throw new RangeError("Invalid time value");let c=t.match(xe).map(w=>{const g=w[0];if(g==="p"||g==="P"){const _=we[g];return _(w,a.formatLong)}return w}).join("").match(Oe).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const g=w[0];if(g==="'")return{isToken:!1,value:Ee(w)};if(st[g])return{isToken:!0,value:w};if(g.match(Ne))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:w}});a.localize.preprocessor&&(c=a.localize.preprocessor(o,c));const d={firstWeekContainsDate:s,weekStartsOn:i,locale:a};return c.map(w=>{if(!w.isToken)return w.value;const g=w.value;(ve(g)||Se(g))&&Me(g,t,String(e));const _=st[g[0]];return _(o,g,a.localize,d)}).join("")}function Ee(e){const t=e.match(Pe);return t?t[1].replace(Ce,"'"):e}function We(e,t){const n=b(e,t==null?void 0:t.in).getDay();return n===0?7:n}function _e(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const Q={},A={};function P(e,t){try{const r=(Q[e]||(Q[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return r in A?A[r]:ut(r,r.split(":"))}catch{if(e in A)return A[e];const n=e==null?void 0:e.match(Ye);return n?ut(e,n.slice(1)):NaN}}const Ye=/([+-]\d\d):?(\d\d)?/;function ut(e,t){const n=+(t[0]||0),r=+(t[1]||0),a=+(t[2]||0)/60;return A[e]=n*60+r>0?n*60+r+a:n*60-r-a}class D extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(P(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)),Dt(this),V(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new D(...n,t):new D(Date.now(),t)}withTimeZone(t){return new D(+this,t)}getTimezoneOffset(){const t=-P(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),V(this),+this}[Symbol.for("constructDateFrom")](t){return new D(+new Date(t),this.timeZone)}}const lt=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!lt.test(e))return;const t=e.replace(lt,"$1UTC");D.prototype[t]&&(e.startsWith("get")?D.prototype[e]=function(){return this.internal[t]()}:(D.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),Ie(this),+this},D.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),V(this),+this}))});function V(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-P(e.timeZone,e)*60))}function Ie(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),Dt(e)}function Dt(e){const t=P(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const a=-new Date(+e).getTimezoneOffset(),s=-new Date(+r).getTimezoneOffset(),i=a-s,o=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();i&&o&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+i);const c=a-n;c&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+c);const d=new Date(+e);d.setUTCSeconds(0);const f=a>0?d.getSeconds():(d.getSeconds()-60)%60,y=Math.round(-(P(e.timeZone,e)*60))%60;(y||f)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+y),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+y+f));const p=P(e.timeZone,e),S=p>0?Math.floor(p):Math.ceil(p),g=-new Date(+e).getTimezoneOffset()-S,_=S!==n,tt=g-c;if(_&&tt){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+tt);const B=P(e.timeZone,e),Tt=B>0?Math.floor(B):Math.ceil(B),z=S-Tt;z&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+z),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+z))}}class T extends D{static tz(t,...n){return n.length?new T(...n,t):new T(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),a=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,a]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${n} ${a}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,a]=this.tzComponents();return`${t} GMT${n}${r}${a} (${_e(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),a=String(Math.abs(t)%60).padStart(2,"0");return[n,r,a]}withTimeZone(t){return new T(+this,t)}[Symbol.for("constructDateFrom")](t){return new T(+new Date(t),this.timeZone)}}window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const Fe=(e=window.pktTz)=>{const t=new T(new Date().toISOString(),e);return t.setHours(0,0,0,0),isNaN(t.getTime())?new Date:new Date(t.getFullYear(),t.getMonth(),t.getDate())};function v(e){if(!e||e==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){const[t,n,r]=e.split("-").map(Number);return new Date(t,n-1,r)}if(/^\d{4}-\d{2}$/.test(e)){const[t,n]=e.split("-").map(Number);return new Date(t,n-1,1)}return/^\d{4}$/.test(e)?new Date(Number(e),0,1):new Date(e)}const m=e=>{if(!e||isNaN(e.getTime()))return"";const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${r}`},W=e=>{if(!e)return null;const t=v(e);return isNaN(t.getTime())?null:t},Ae=(e,t)=>{const n=N(e);return isNaN(n.getTime())?"":$e(n,t)},N=(e="",t)=>{const n=typeof e=="string"?v(e):e;return!n||isNaN(n.getTime())?new Date:t?t==="end"?Et(n):G(n):n},C=(e,t,n=1)=>{if(typeof e!="number"||typeof t!="number"||typeof n!="number"||isNaN(e)||isNaN(t)||isNaN(n))return new Date;const r=new Date(e,t,n);return isNaN(r.getTime())?new Date:r},F=e=>{let t;return typeof e=="number"?t=new T(e,window.pktTz):t=new T(e,window.pktTz),t.setHours(12,0,0,0),t};let X=null,ht;const He=e=>{if(!e||isNaN(e.getTime()))return"";const t=typeof window<"u"?window.pktTz:void 0;return(!X||ht!==t)&&(X=new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:t}),ht=t),X.format(e)},Re=(e,t,n)=>{if(!e||isNaN(e.getTime()))return!1;const r=t?N(t):null,a=n?N(n):null;return!(r&&e<r||a&&e>a)},qe=(e,t)=>{if(!e||isNaN(e.getTime())||!Array.isArray(t))return!1;const n=m(e);return t.includes(n)},Le=(e,t)=>{if(!e||isNaN(e.getTime())||!Array.isArray(t))return!1;const n=e.getDay().toString();return t.includes(n)},kt=(e,t,n,r,a)=>!(!e||isNaN(e.getTime())||!Re(e,t,n)||r&&qe(e,r)||a&&Le(e,a)),Ue=(e,t,n,r,a)=>e.filter(s=>{const i=W(s);return i&&kt(i,t,n,r,a)}),Be=e=>e.slice().sort((t,n)=>{const r=W(t),a=W(n);return!r||!a?0:r.getTime()-a.getTime()}),ze=(e,t)=>{const n=W(e),r=W(t);return!n||!r?!1:n<=r},St=e=>{if(!e)return[];if(Array.isArray(e))return e.filter(Boolean);if(typeof e=="string"&&e.trimStart().startsWith("["))try{const t=JSON.parse(e);if(Array.isArray(t))return t.filter(Boolean)}catch{}return String(e).split(",").map(t=>t.trim()).filter(Boolean)},je=e=>e.join(","),Qe=e=>St(e),Xe=e=>e?v(e):null,Ge=e=>{if(typeof e=="string")return e.split(",").map(t=>v(t));if(Array.isArray(e))return e.map(t=>v(t))},q={csvToArray:Qe,stringToDate:Xe,stringsToDate:Ge},Ve={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},O={props:Ve};function vt(e,t){const n=(t.excludedates??[]).map(r=>typeof r=="string"?r:m(r));return!kt(e,t.earliest,t.latest,n,t.excludeweekdays??[])}function Je(e,t,n,r){return!!(vt(e,n)||!t&&r.multiple&&r.maxMultiple>0&&r.selectedCount>=r.maxMultiple)}function Ke(e,t,n){const r=C(e,t,0);return!(n&&N(n)>r)}function Ze(e,t,n){const r=C(t===11?e+1:e,t===11?0:t+1,1);return!(n&&N(n)<r)}const R=7,tn=6;function en(e,t){const n=C(e,t,1),r=C(e,t+1,0),a=(n.getDay()+tn)%R,s=r.getDate(),i=Math.ceil((s+a)/R),c=C(e,t,0).getDate(),d=wt(n);return{firstDayOfMonth:n,lastDayOfMonth:r,startingDay:a,numDays:s,numRows:i,numDaysPrevMonth:c,initialWeek:d}}function nn(e,t,n,r){const{startingDay:a,numDays:s}=r;return e===0&&t<a?"prev-month":n>s?"next-month":"current-month"}function rn(e,t,n,r){const{startingDay:a,numDaysPrevMonth:s,numDays:i}=r;return e==="prev-month"?s-(a-t-1):e==="next-month"?n-i:n}function E(e){return typeof e=="string"&&(e=e.split(",")),e.length===1&&e[0]===""?[]:e.map(t=>v(t))}function dt(e,t){const n=yt({start:e,end:t}),r={};if(Array.isArray(n)&&n.length)for(let a=0;a<n.length;a++){const s=n[a],i=s>e&&s<t;r[m(s)]=i}return r}function Mt(e,t,n,r){if(t.length!==1)return!0;const a=yt({start:t[0],end:e});if(!Array.isArray(a)||!a.length)return!0;for(let s=0;s<a.length;s++){for(const i of n??[])if(i>t[0]&&i<e)return!1;if((r??[]).includes(We(a[s]).toString()))return!1}return!0}function K(e,t){const n=m(e);return t.includes(n)?t:[...t,n]}function Z(e,t){const n=m(e),r=t.indexOf(n);if(r===-1)return t;if(t.length===1)return[];const a=[...t];return a.splice(r,1),a}function an(e,t,n){const r=m(e);return t.includes(r)?Z(e,t):n>0&&t.length>=n?t:K(e,t)}function sn(e,t,n){const r=m(e),a=E(t);if(t.includes(r))return t.indexOf(r)===0?[]:Z(e,t);if(t.length>1)return[r];if(t.length===1){if(!Mt(e,a,n.excludedates,n.excludeweekdays))return[r];if(a[0]>e)return[r]}return K(e,t)}const on={ArrowLeft:-1,ArrowRight:1,ArrowUp:-R,ArrowDown:R};function cn(e){var n;const t=e.nodeName;return t==="INPUT"||t==="SELECT"||t==="BUTTON"&&!((n=e.dataset)!=null&&n.date)}function un(e,t,n){let r=rt(e,t);if(!r)return null;let a=n(`button[data-date="${m(r)}"]`);for(;a instanceof HTMLButtonElement&&a.dataset.disabled;)if(r=rt(r,t),a=n(`button[data-date="${m(r)}"]`),!a)return null;return r}function ln(e){return on[e]??null}var hn=Object.defineProperty,dn=Object.getOwnPropertyDescriptor,h=(e,t,n,r)=>{for(var a=r>1?void 0:r?dn(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&hn(t,n,a),a};exports.PktCalendar=class extends u.PktElement{constructor(){super(...arguments),this.selected=[],this.multiple=O.props.multiple.default,this.maxMultiple=O.props.maxMultiple.default,this.range=O.props.range.default,this.earliest=O.props.earliest.default,this.latest=O.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.weeknumbers=O.props.weeknumbers.default,this.withcontrols=O.props.withcontrols.default,this.currentmonth=null,this.today=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.inRange={},this.rangeHovered=null,this.year=0,this.month=0,this.week=0,this.currentmonthtouched=!1,this.focusedDate=null,this.selectableDates=[],this.tabIndexSet=0}get todayDate(){return this.today?v(this.today):Fe()}firstUpdated(t){this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}updated(t){super.updated(t),t.has("selected")&&this.convertSelected()}convertSelected(){typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=E(this.selected),this.range&&this.selected.length===2&&(this.inRange=dt(this._selected[0],this._selected[1])),this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==""){const t=v(this.selected[this.selected.length-1]);this.currentmonth=isNaN(t.getTime())?F(this.todayDate):t}else this.currentmonth===null&&(this.currentmonth=F(this.todayDate));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=F(this.todayDate)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(t){const n=ln(t.key);n!==null&&this.handleArrowKey(t,n)}handleArrowKey(t,n){const r=t.target;if(cn(r))return;if(t.preventDefault(),!this.focusedDate){this.focusOnCurrentDate();return}const a=this.focusedDate?N(this.focusedDate):C(this.year,this.month,1),s=un(a,n,this.querySelector.bind(this));if(s){const i=this.querySelector(`button[data-date="${m(s)}"]`);i instanceof HTMLButtonElement&&!i.dataset.disabled&&(this.focusedDate=m(s),i.focus())}}render(){return u.b`
|
|
1
|
+
"use strict";const et=require("./class-map-CsENJXf1.cjs"),u=require("./element-gR_VtSiD.cjs"),J=require("./state-Dg-53wQ8.cjs");require("./icon-Bqj9oBbl.cjs");const ft=6048e5,Ot=864e5,nt=Symbol.for("constructDateFrom");function k(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&nt in e?e[nt](t):e instanceof Date?new e.constructor(t):new Date(t)}function b(e,t){return k(t||e,e)}function rt(e,t,n){const r=b(e,n==null?void 0:n.in);return isNaN(t)?k(e,NaN):(t&&r.setDate(r.getDate()+t),r)}let xt={};function U(){return xt}function H(e,t){var o,c,d,f;const n=U(),r=(t==null?void 0:t.weekStartsOn)??((c=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??0,a=b(e,t==null?void 0:t.in),s=a.getDay(),i=(s<r?7:0)+s-r;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function L(e,t){return H(e,{...t,weekStartsOn:1})}function mt(e,t){const n=b(e,t==null?void 0:t.in),r=n.getFullYear(),a=k(n,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const s=L(a),i=k(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const o=L(i);return n.getTime()>=s.getTime()?r+1:n.getTime()>=o.getTime()?r:r-1}function at(e){const t=b(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function gt(e,...t){const n=k.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function G(e,t){const n=b(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function Pt(e,t,n){const[r,a]=gt(n==null?void 0:n.in,e,t),s=G(r),i=G(a),o=+s-at(s),c=+i-at(i);return Math.round((o-c)/Ot)}function Ct(e,t){const n=mt(e,t),r=k(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),L(r)}function Nt(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function $t(e){return!(!Nt(e)&&typeof e!="number"||isNaN(+b(e)))}function Et(e,t){const n=b(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function Wt(e,t){const[n,r]=gt(e,t.start,t.end);return{start:n,end:r}}function yt(e,t){const{start:n,end:r}=Wt(t==null?void 0:t.in,e);let a=+n>+r;const s=a?+n:+r,i=a?r:n;i.setHours(0,0,0,0);let o=1;const c=[];for(;+i<=s;)c.push(k(n,i)),i.setDate(i.getDate()+o),i.setHours(0,0,0,0);return a?c.reverse():c}function _t(e,t){const n=b(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const Yt={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"}},It=(e,t,n)=>{let r;const a=Yt[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function j(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Ft={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},At={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ht={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Rt={date:j({formats:Ft,defaultWidth:"full"}),time:j({formats:At,defaultWidth:"full"}),dateTime:j({formats:Ht,defaultWidth:"full"})},qt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Lt=(e,t,n,r)=>qt[e];function Y(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):i;a=e.formattingValues[o]||e.formattingValues[i]}else{const i=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[o]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(t):t;return a[s]}}const Ut={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Bt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},zt={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"]},jt={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"]},Qt={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"}},Xt={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"}},Gt=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Vt={ordinalNumber:Gt,era:Y({values:Ut,defaultWidth:"wide"}),quarter:Y({values:Bt,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Y({values:zt,defaultWidth:"wide"}),day:Y({values:jt,defaultWidth:"wide"}),dayPeriod:Y({values:Qt,defaultWidth:"wide",formattingValues:Xt,defaultFormattingWidth:"wide"})};function I(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(a);if(!s)return null;const i=s[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(o)?Kt(o,y=>y.test(i)):Jt(o,y=>y.test(i));let d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const f=t.slice(i.length);return{value:d,rest:f}}}function Jt(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Kt(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Zt(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=n.valueCallback?n.valueCallback(i):i;const o=t.slice(a.length);return{value:i,rest:o}}}const te=/^(\d+)(th|st|nd|rd)?/i,ee=/\d+/i,ne={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},re={any:[/^b/i,/^(a|c)/i]},ae={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},se={any:[/1/i,/2/i,/3/i,/4/i]},ie={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},oe={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]},ce={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},ue={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]},le={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},he={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}},de={ordinalNumber:Zt({matchPattern:te,parsePattern:ee,valueCallback:e=>parseInt(e,10)}),era:I({matchPatterns:ne,defaultMatchWidth:"wide",parsePatterns:re,defaultParseWidth:"any"}),quarter:I({matchPatterns:ae,defaultMatchWidth:"wide",parsePatterns:se,defaultParseWidth:"any",valueCallback:e=>e+1}),month:I({matchPatterns:ie,defaultMatchWidth:"wide",parsePatterns:oe,defaultParseWidth:"any"}),day:I({matchPatterns:ce,defaultMatchWidth:"wide",parsePatterns:ue,defaultParseWidth:"any"}),dayPeriod:I({matchPatterns:le,defaultMatchWidth:"any",parsePatterns:he,defaultParseWidth:"any"})},fe={code:"en-US",formatDistance:It,formatLong:Rt,formatRelative:Lt,localize:Vt,match:de,options:{weekStartsOn:0,firstWeekContainsDate:1}};function me(e,t){const n=b(e,t==null?void 0:t.in);return Pt(n,_t(n))+1}function ge(e,t){const n=b(e,t==null?void 0:t.in),r=+L(n)-+Ct(n);return Math.round(r/ft)+1}function pt(e,t){var f,y,p,S;const n=b(e,t==null?void 0:t.in),r=n.getFullYear(),a=U(),s=(t==null?void 0:t.firstWeekContainsDate)??((y=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:y.firstWeekContainsDate)??a.firstWeekContainsDate??((S=(p=a.locale)==null?void 0:p.options)==null?void 0:S.firstWeekContainsDate)??1,i=k((t==null?void 0:t.in)||e,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const o=H(i,t),c=k((t==null?void 0:t.in)||e,0);c.setFullYear(r,0,s),c.setHours(0,0,0,0);const d=H(c,t);return+n>=+o?r+1:+n>=+d?r:r-1}function ye(e,t){var o,c,d,f;const n=U(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,a=pt(e,t),s=k((t==null?void 0:t.in)||e,0);return s.setFullYear(a,0,r),s.setHours(0,0,0,0),H(s,t)}function wt(e,t){const n=b(e,t==null?void 0:t.in),r=+H(n,t)-+ye(n,t);return Math.round(r/ft)+1}function l(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const M={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return l(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):l(n+1,2)},d(e,t){return l(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return l(e.getHours()%12||12,t.length)},H(e,t){return l(e.getHours(),t.length)},m(e,t){return l(e.getMinutes(),t.length)},s(e,t){return l(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return l(a,t.length)}},$={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},st={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return M.y(e,t)},Y:function(e,t,n,r){const a=pt(e,r),s=a>0?a:1-a;if(t==="YY"){const i=s%100;return l(i,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):l(s,t.length)},R:function(e,t){const n=mt(e);return l(n,t.length)},u:function(e,t){const n=e.getFullYear();return l(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return l(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return l(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return M.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return l(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const a=wt(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):l(a,t.length)},I:function(e,t,n){const r=ge(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):l(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):M.d(e,t)},D:function(e,t,n){const r=me(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):l(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const a=e.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return l(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return l(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return l(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(r===12?a=$.noon:r===0?a=$.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(r>=17?a=$.evening:r>=12?a=$.afternoon:r>=4?a=$.morning:a=$.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return M.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):M.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):l(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):l(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):M.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):M.s(e,t)},S:function(e,t){return M.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return ot(r);case"XXXX":case"XX":return x(r);case"XXXXX":case"XXX":default:return x(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return ot(r);case"xxxx":case"xx":return x(r);case"xxxxx":case"xxx":default:return x(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+it(r,":");case"OOOO":default:return"GMT"+x(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+it(r,":");case"zzzz":default:return"GMT"+x(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return l(r,t.length)},T:function(e,t,n){return l(+e,t.length)}};function it(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),s=r%60;return s===0?n+String(a):n+String(a)+t+l(s,2)}function ot(e,t){return e%60===0?(e>0?"-":"+")+l(Math.abs(e)/60,2):x(e,t)}function x(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=l(Math.trunc(r/60),2),s=l(r%60,2);return n+a+t+s}const ct=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},bt=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},pe=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return ct(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",ct(r,t)).replace("{{time}}",bt(a,t))},we={p:bt,P:pe},be=/^D+$/,De=/^Y+$/,ke=["D","DD","YY","YYYY"];function Se(e){return be.test(e)}function ve(e){return De.test(e)}function Me(e,t,n){const r=Te(e,t,n);if(console.warn(r),ke.includes(e))throw new RangeError(r)}function Te(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Oe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,xe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Pe=/^'([^]*?)'?$/,Ce=/''/g,Ne=/[a-zA-Z]/;function $e(e,t,n){var f,y,p,S;const r=U(),a=r.locale??fe,s=r.firstWeekContainsDate??((y=(f=r.locale)==null?void 0:f.options)==null?void 0:y.firstWeekContainsDate)??1,i=r.weekStartsOn??((S=(p=r.locale)==null?void 0:p.options)==null?void 0:S.weekStartsOn)??0,o=b(e,n==null?void 0:n.in);if(!$t(o))throw new RangeError("Invalid time value");let c=t.match(xe).map(w=>{const g=w[0];if(g==="p"||g==="P"){const _=we[g];return _(w,a.formatLong)}return w}).join("").match(Oe).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const g=w[0];if(g==="'")return{isToken:!1,value:Ee(w)};if(st[g])return{isToken:!0,value:w};if(g.match(Ne))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:w}});a.localize.preprocessor&&(c=a.localize.preprocessor(o,c));const d={firstWeekContainsDate:s,weekStartsOn:i,locale:a};return c.map(w=>{if(!w.isToken)return w.value;const g=w.value;(ve(g)||Se(g))&&Me(g,t,String(e));const _=st[g[0]];return _(o,g,a.localize,d)}).join("")}function Ee(e){const t=e.match(Pe);return t?t[1].replace(Ce,"'"):e}function We(e,t){const n=b(e,t==null?void 0:t.in).getDay();return n===0?7:n}function _e(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const Q={},A={};function P(e,t){try{const r=(Q[e]||(Q[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return r in A?A[r]:ut(r,r.split(":"))}catch{if(e in A)return A[e];const n=e==null?void 0:e.match(Ye);return n?ut(e,n.slice(1)):NaN}}const Ye=/([+-]\d\d):?(\d\d)?/;function ut(e,t){const n=+(t[0]||0),r=+(t[1]||0),a=+(t[2]||0)/60;return A[e]=n*60+r>0?n*60+r+a:n*60-r-a}class D extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(P(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)),Dt(this),V(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new D(...n,t):new D(Date.now(),t)}withTimeZone(t){return new D(+this,t)}getTimezoneOffset(){const t=-P(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),V(this),+this}[Symbol.for("constructDateFrom")](t){return new D(+new Date(t),this.timeZone)}}const lt=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!lt.test(e))return;const t=e.replace(lt,"$1UTC");D.prototype[t]&&(e.startsWith("get")?D.prototype[e]=function(){return this.internal[t]()}:(D.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),Ie(this),+this},D.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),V(this),+this}))});function V(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-P(e.timeZone,e)*60))}function Ie(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),Dt(e)}function Dt(e){const t=P(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const a=-new Date(+e).getTimezoneOffset(),s=-new Date(+r).getTimezoneOffset(),i=a-s,o=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();i&&o&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+i);const c=a-n;c&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+c);const d=new Date(+e);d.setUTCSeconds(0);const f=a>0?d.getSeconds():(d.getSeconds()-60)%60,y=Math.round(-(P(e.timeZone,e)*60))%60;(y||f)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+y),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+y+f));const p=P(e.timeZone,e),S=p>0?Math.floor(p):Math.ceil(p),g=-new Date(+e).getTimezoneOffset()-S,_=S!==n,tt=g-c;if(_&&tt){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+tt);const B=P(e.timeZone,e),Tt=B>0?Math.floor(B):Math.ceil(B),z=S-Tt;z&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+z),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+z))}}class T extends D{static tz(t,...n){return n.length?new T(...n,t):new T(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),a=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,a]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${n} ${a}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,a]=this.tzComponents();return`${t} GMT${n}${r}${a} (${_e(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),a=String(Math.abs(t)%60).padStart(2,"0");return[n,r,a]}withTimeZone(t){return new T(+this,t)}[Symbol.for("constructDateFrom")](t){return new T(+new Date(t),this.timeZone)}}window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const Fe=(e=window.pktTz)=>{const t=new T(new Date().toISOString(),e);return t.setHours(0,0,0,0),isNaN(t.getTime())?new Date:new Date(t.getFullYear(),t.getMonth(),t.getDate())};function v(e){if(!e||e==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){const[t,n,r]=e.split("-").map(Number);return new Date(t,n-1,r)}if(/^\d{4}-\d{2}$/.test(e)){const[t,n]=e.split("-").map(Number);return new Date(t,n-1,1)}return/^\d{4}$/.test(e)?new Date(Number(e),0,1):new Date(e)}const m=e=>{if(!e||isNaN(e.getTime()))return"";const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${r}`},W=e=>{if(!e)return null;const t=v(e);return isNaN(t.getTime())?null:t},Ae=(e,t)=>{const n=N(e);return isNaN(n.getTime())?"":$e(n,t)},N=(e="",t)=>{const n=typeof e=="string"?v(e):e;return!n||isNaN(n.getTime())?new Date:t?t==="end"?Et(n):G(n):n},C=(e,t,n=1)=>{if(typeof e!="number"||typeof t!="number"||typeof n!="number"||isNaN(e)||isNaN(t)||isNaN(n))return new Date;const r=new Date(e,t,n);return isNaN(r.getTime())?new Date:r},F=e=>{let t;return typeof e=="number"?t=new T(e,window.pktTz):t=new T(e,window.pktTz),t.setHours(12,0,0,0),t};let X=null,ht;const He=e=>{if(!e||isNaN(e.getTime()))return"";const t=typeof window<"u"?window.pktTz:void 0;return(!X||ht!==t)&&(X=new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:t}),ht=t),X.format(e)},Re=(e,t,n)=>{if(!e||isNaN(e.getTime()))return!1;const r=t?N(t):null,a=n?N(n):null;return!(r&&e<r||a&&e>a)},qe=(e,t)=>{if(!e||isNaN(e.getTime())||!Array.isArray(t))return!1;const n=m(e);return t.includes(n)},Le=(e,t)=>{if(!e||isNaN(e.getTime())||!Array.isArray(t))return!1;const n=e.getDay().toString();return t.includes(n)},kt=(e,t,n,r,a)=>!(!e||isNaN(e.getTime())||!Re(e,t,n)||r&&qe(e,r)||a&&Le(e,a)),Ue=(e,t,n,r,a)=>e.filter(s=>{const i=W(s);return i&&kt(i,t,n,r,a)}),Be=e=>e.slice().sort((t,n)=>{const r=W(t),a=W(n);return!r||!a?0:r.getTime()-a.getTime()}),ze=(e,t)=>{const n=W(e),r=W(t);return!n||!r?!1:n<=r},St=e=>{if(!e)return[];if(Array.isArray(e))return e.filter(Boolean);if(typeof e=="string"&&e.trimStart().startsWith("["))try{const t=JSON.parse(e);if(Array.isArray(t))return t.filter(Boolean)}catch{}return String(e).split(",").map(t=>t.trim()).filter(Boolean)},je=e=>e.join(","),Qe=e=>St(e),Xe=e=>e?v(e):null,Ge=e=>{if(typeof e=="string")return e.split(",").map(t=>v(t));if(Array.isArray(e))return e.map(t=>v(t))},q={csvToArray:Qe,stringToDate:Xe,stringsToDate:Ge},Ve={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},O={props:Ve};function vt(e,t){const n=(t.excludedates??[]).map(r=>typeof r=="string"?r:m(r));return!kt(e,t.earliest,t.latest,n,t.excludeweekdays??[])}function Je(e,t,n,r){return!!(vt(e,n)||!t&&r.multiple&&r.maxMultiple>0&&r.selectedCount>=r.maxMultiple)}function Ke(e,t,n){const r=C(e,t,0);return!(n&&N(n)>r)}function Ze(e,t,n){const r=C(t===11?e+1:e,t===11?0:t+1,1);return!(n&&N(n)<r)}const R=7,tn=6;function en(e,t){const n=C(e,t,1),r=C(e,t+1,0),a=(n.getDay()+tn)%R,s=r.getDate(),i=Math.ceil((s+a)/R),c=C(e,t,0).getDate(),d=wt(n);return{firstDayOfMonth:n,lastDayOfMonth:r,startingDay:a,numDays:s,numRows:i,numDaysPrevMonth:c,initialWeek:d}}function nn(e,t,n,r){const{startingDay:a,numDays:s}=r;return e===0&&t<a?"prev-month":n>s?"next-month":"current-month"}function rn(e,t,n,r){const{startingDay:a,numDaysPrevMonth:s,numDays:i}=r;return e==="prev-month"?s-(a-t-1):e==="next-month"?n-i:n}function E(e){return typeof e=="string"&&(e=e.split(",")),e.length===1&&e[0]===""?[]:e.map(t=>v(t))}function dt(e,t){const n=yt({start:e,end:t}),r={};if(Array.isArray(n)&&n.length)for(let a=0;a<n.length;a++){const s=n[a],i=s>e&&s<t;r[m(s)]=i}return r}function Mt(e,t,n,r){if(t.length!==1)return!0;const a=yt({start:t[0],end:e});if(!Array.isArray(a)||!a.length)return!0;for(let s=0;s<a.length;s++){for(const i of n??[])if(i>t[0]&&i<e)return!1;if((r??[]).includes(We(a[s]).toString()))return!1}return!0}function K(e,t){const n=m(e);return t.includes(n)?t:[...t,n]}function Z(e,t){const n=m(e),r=t.indexOf(n);if(r===-1)return t;if(t.length===1)return[];const a=[...t];return a.splice(r,1),a}function an(e,t,n){const r=m(e);return t.includes(r)?Z(e,t):n>0&&t.length>=n?t:K(e,t)}function sn(e,t,n){const r=m(e),a=E(t);if(t.includes(r))return t.indexOf(r)===0?[]:Z(e,t);if(t.length>1)return[r];if(t.length===1){if(!Mt(e,a,n.excludedates,n.excludeweekdays))return[r];if(a[0]>e)return[r]}return K(e,t)}const on={ArrowLeft:-1,ArrowRight:1,ArrowUp:-R,ArrowDown:R};function cn(e){var n;const t=e.nodeName;return t==="INPUT"||t==="SELECT"||t==="BUTTON"&&!((n=e.dataset)!=null&&n.date)}function un(e,t,n){let r=rt(e,t);if(!r)return null;let a=n(`button[data-date="${m(r)}"]`);for(;a instanceof HTMLButtonElement&&a.dataset.disabled;)if(r=rt(r,t),a=n(`button[data-date="${m(r)}"]`),!a)return null;return r}function ln(e){return on[e]??null}var hn=Object.defineProperty,dn=Object.getOwnPropertyDescriptor,h=(e,t,n,r)=>{for(var a=r>1?void 0:r?dn(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&hn(t,n,a),a};exports.PktCalendar=class extends u.PktElement{constructor(){super(...arguments),this.selected=[],this.multiple=O.props.multiple.default,this.maxMultiple=O.props.maxMultiple.default,this.range=O.props.range.default,this.earliest=O.props.earliest.default,this.latest=O.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.weeknumbers=O.props.weeknumbers.default,this.withcontrols=O.props.withcontrols.default,this.currentmonth=null,this.today=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.inRange={},this.rangeHovered=null,this.year=0,this.month=0,this.week=0,this.currentmonthtouched=!1,this.focusedDate=null,this.selectableDates=[],this.tabIndexSet=0}get todayDate(){return this.today?v(this.today):Fe()}firstUpdated(t){this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}updated(t){super.updated(t),t.has("selected")&&this.convertSelected()}convertSelected(){typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=E(this.selected),this.range&&this.selected.length===2&&(this.inRange=dt(this._selected[0],this._selected[1])),this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==""){const t=v(this.selected[this.selected.length-1]);this.currentmonth=isNaN(t.getTime())?F(this.todayDate):t}else this.currentmonth===null&&(this.currentmonth=F(this.todayDate));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=F(this.todayDate)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(t){const n=ln(t.key);n!==null&&this.handleArrowKey(t,n)}handleArrowKey(t,n){const r=t.target;if(cn(r))return;if(t.preventDefault(),!this.focusedDate){this.focusOnCurrentDate();return}const a=this.focusedDate?N(this.focusedDate):C(this.year,this.month,1),s=un(a,n,this.querySelector.bind(this));if(s){const i=this.querySelector(`button[data-date="${m(s)}"]`);i instanceof HTMLButtonElement&&!i.dataset.disabled&&(this.focusedDate=m(s),i.focus())}}render(){return u.b`
|
|
2
2
|
<div
|
|
3
3
|
class="pkt-calendar ${this.weeknumbers?"pkt-cal-weeknumbers":""}"
|
|
4
4
|
@focusout=${this.closeEvent}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { e as rt } from "./class-map-
|
|
2
|
-
import { P as Pt, b as D, A as at, n as f, t as Nt } from "./element-
|
|
3
|
-
import { r as Z } from "./state-
|
|
4
|
-
import "./icon-
|
|
1
|
+
import { e as rt } from "./class-map-CEnykyO_.js";
|
|
2
|
+
import { P as Pt, b as D, A as at, n as f, t as Nt } from "./element-CPpT3rFQ.js";
|
|
3
|
+
import { r as Z } from "./state-C_1EOo3D.js";
|
|
4
|
+
import "./icon-BlKA8YuW.js";
|
|
5
5
|
const yt = 6048e5, Ct = 864e5, st = Symbol.for("constructDateFrom");
|
|
6
6
|
function k(t, e) {
|
|
7
7
|
return typeof t == "function" ? t(e) : t && typeof t == "object" && st in t ? t[st](e) : t instanceof Date ? new t.constructor(e) : new Date(e);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const l=require("./class-map-
|
|
1
|
+
"use strict";const l=require("./class-map-CsENJXf1.cjs"),h=require("./if-defined-BOW3ODSj.cjs"),t=require("./element-gR_VtSiD.cjs"),g=require("./element-with-slot-ZX-up7jO.cjs");require("./icon-Bqj9oBbl.cjs");require("./tag-X6xdjR0N.cjs");require("./heading-Cvz8m1xL.cjs");const c={layout:{default:"vertical"},skin:{type:["outlined","outlined-beige","gray","blue","beige","green"],default:"outlined"},padding:{default:"default"}},p={props:c};var k=Object.defineProperty,u=Object.getOwnPropertyDescriptor,e=(i,a,n,s)=>{for(var r=s>1?void 0:s?u(a,n):a,d=i.length-1,o;d>=0;d--)(o=i[d])&&(r=(s?o(a,n,r):o(r))||r);return s&&r&&k(a,n,r),r};exports.PktCard=class extends g.PktElementWithSlot{constructor(){super(...arguments),this.ariaLabel="",this.metaLead=null,this.borderOnHover=!0,this.clickCardLink=null,this.metaTrail=null,this.layout=p.props.layout.default,this.heading="",this.headinglevel=3,this.image={src:"",alt:""},this.imageShape="square",this.openLinkInNewTab=!1,this.padding=p.props.padding.default,this.skin=p.props.skin.default,this.subheading="",this.tagPosition="top",this.tags=[]}connectedCallback(){super.connectedCallback()}render(){var r,d;const a={"pkt-card":!0,[`pkt-card--${this.skin}`]:this.skin,[`pkt-card--${this.layout}`]:this.layout,[`pkt-card--padding-${this.padding}`]:this.padding,"pkt-card--border-on-hover":this.borderOnHover},n=((r=this.ariaLabel)==null?void 0:r.trim())||(this.heading?`${this.heading} lenkekort`:"lenkekort"),s=((d=this.ariaLabel)==null?void 0:d.trim())||(this.heading?this.heading:"kort");return t.b`
|
|
2
2
|
<article
|
|
3
3
|
class=${l.e(a)}
|
|
4
4
|
aria-label=${h.o(this.clickCardLink?n:s)}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { e as c } from "./class-map-
|
|
2
|
-
import { o as k } from "./if-defined-
|
|
3
|
-
import { A as d, b as e, n as r, t as u } from "./element-
|
|
4
|
-
import { P as m, s as $ } from "./element-with-slot-
|
|
5
|
-
import "./icon-
|
|
6
|
-
import "./tag-
|
|
7
|
-
import "./heading-
|
|
1
|
+
import { e as c } from "./class-map-CEnykyO_.js";
|
|
2
|
+
import { o as k } from "./if-defined-B0krMLad.js";
|
|
3
|
+
import { A as d, b as e, n as r, t as u } from "./element-CPpT3rFQ.js";
|
|
4
|
+
import { P as m, s as $ } from "./element-with-slot-Dqk6-TRR.js";
|
|
5
|
+
import "./icon-BlKA8YuW.js";
|
|
6
|
+
import "./tag-BuCpqaks.js";
|
|
7
|
+
import "./heading-CKt7cVn7.js";
|
|
8
8
|
const y = { layout: { default: "vertical" }, skin: { type: ["outlined", "outlined-beige", "gray", "blue", "beige", "green"], default: "outlined" }, padding: { default: "default" } }, o = {
|
|
9
9
|
props: y
|
|
10
10
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const t=require("./element-
|
|
1
|
+
"use strict";const t=require("./element-gR_VtSiD.cjs"),o=require("./input-element-DdVhUvva.cjs"),r=require("./ref-CL-Xk9Xm.cjs"),p=require("./class-map-CsENJXf1.cjs");var u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,i=(l,e,h,a)=>{for(var s=a>1?void 0:a?d(e,h):e,c=l.length-1,n;c>=0;c--)(n=l[c])&&(s=(a?n(e,h,s):n(s))||s);return a&&s&&u(e,h,s),s};exports.PktCheckbox=class extends o.PktInputElement{constructor(){super(...arguments),this.inputRef=r.e(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.isSwitch=!1,this.labelPosition="right",this.hideLabel=!1,this.checked=null,this.indeterminate=!1,this.type="checkbox",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut"}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,h,a){e==="defaultChecked"&&!this.checked&&(this.checked=this.defaultChecked),e==="checked"&&(this.checked=this.checked===""||this.checked==="true"||this.checked===!0,this.inputRef.value&&(this.inputRef.value.checked=this.checked)),e==="indeterminate"&&(this.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0,this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate)),super.attributeChangedCallback(e,h,a)}firstUpdated(e){e.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.firstUpdated(e)}updated(e){e.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),e.has("checked")&&this.inputRef.value&&(this.inputRef.value.checked=this.checked===""||this.checked==="true"||this.checked===!0),e.has("indeterminate")&&this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.updated(e)}render(){const e=p.e({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),h=p.e({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),a=p.e({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-input-check__input-label--left":this.labelPosition==="left","pkt-input-check__input-label--right":this.labelPosition==="right","pkt-sr-only":this.hideLabel}),s="pkt-tag pkt-tag--small pkt-tag--thin-text",c=()=>t.b`
|
|
2
2
|
${this.tagText?t.b`<span class=${s+" pkt-tag--gray"}>${this.tagText}</span>`:t.A}
|
|
3
3
|
${this.optionalTag?t.b`<span class=${s+" pkt-tag--blue-light"}>${this.optionalText}</span>`:t.A}
|
|
4
4
|
${this.requiredTag?t.b`<span class=${s+" pkt-tag--beige"}>${this.requiredText}</span>`:t.A}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as r, b as p, n as s, t as d } from "./element-
|
|
2
|
-
import { P as k } from "./input-element-
|
|
3
|
-
import { e as f, n as b } from "./ref-
|
|
4
|
-
import { e as u } from "./class-map-
|
|
1
|
+
import { A as r, b as p, n as s, t as d } from "./element-CPpT3rFQ.js";
|
|
2
|
+
import { P as k } from "./input-element-8nLwuQS4.js";
|
|
3
|
+
import { e as f, n as b } from "./ref-Bg_Swj5w.js";
|
|
4
|
+
import { e as u } from "./class-map-CEnykyO_.js";
|
|
5
5
|
var g = Object.defineProperty, m = Object.getOwnPropertyDescriptor, i = (t, a, n, l) => {
|
|
6
6
|
for (var h = l > 1 ? void 0 : l ? m(a, n) : a, c = t.length - 1, o; c >= 0; c--)
|
|
7
7
|
(o = t[c]) && (h = (l ? o(a, n, h) : o(h)) || h);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const a=require("./element-
|
|
1
|
+
"use strict";const a=require("./element-gR_VtSiD.cjs"),r=require("./directive-C7oCP5Bh.cjs");/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2018 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { n as r, A as m, b as c, t as M } from "./element-
|
|
2
|
-
import { o as u } from "./if-defined-
|
|
3
|
-
import { e as I, n as y } from "./ref-
|
|
4
|
-
import { e as w } from "./class-map-
|
|
5
|
-
import { c as P } from "./repeat-
|
|
6
|
-
import { f, g as B, b as U, i as O, a as E, c as R } from "./listbox-
|
|
7
|
-
import { s as q } from "./element-with-slot-
|
|
8
|
-
import { r as v } from "./state-
|
|
9
|
-
import { P as N } from "./input-element-
|
|
10
|
-
import { P as L } from "./pkt-options-controller-
|
|
11
|
-
import "./input-wrapper-
|
|
12
|
-
import "./icon-
|
|
13
|
-
import "./tag-
|
|
1
|
+
import { n as r, A as m, b as c, t as M } from "./element-CPpT3rFQ.js";
|
|
2
|
+
import { o as u } from "./if-defined-B0krMLad.js";
|
|
3
|
+
import { e as I, n as y } from "./ref-Bg_Swj5w.js";
|
|
4
|
+
import { e as w } from "./class-map-CEnykyO_.js";
|
|
5
|
+
import { c as P } from "./repeat-BD8TKgJb.js";
|
|
6
|
+
import { f, g as B, b as U, i as O, a as E, c as R } from "./listbox-BQKDZvZn.js";
|
|
7
|
+
import { s as q } from "./element-with-slot-Dqk6-TRR.js";
|
|
8
|
+
import { r as v } from "./state-C_1EOo3D.js";
|
|
9
|
+
import { P as N } from "./input-element-8nLwuQS4.js";
|
|
10
|
+
import { P as L } from "./pkt-options-controller-B5YalfCb.js";
|
|
11
|
+
import "./input-wrapper-B2JpK016.js";
|
|
12
|
+
import "./icon-BlKA8YuW.js";
|
|
13
|
+
import "./tag-BuCpqaks.js";
|
|
14
14
|
const j = (i, t, e) => {
|
|
15
15
|
switch (i) {
|
|
16
16
|
case ",":
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const o=require("./element-CMTfByxQ.cjs"),d=require("./if-defined-hKKmbsI8.cjs"),b=require("./ref-DahIePMT.cjs"),V=require("./class-map-Bokp1SoS.cjs"),S=require("./repeat-C-FJ2vfy.cjs"),u=require("./listbox-OAVh_U7u.cjs"),R=require("./element-with-slot-yT8k1Z37.cjs"),v=require("./state-BNgpvY-A.cjs"),w=require("./input-element-Xe9FTi2a.cjs"),C=require("./pkt-options-controller-DIeKSpWv.cjs");require("./input-wrapper-BdFdJU-k.cjs");require("./icon-Dj0oZZSa.cjs");require("./tag-DeE1OpmF.cjs");const F=(a,t,e)=>{switch(a){case",":return e?"addValue":null;case"Enter":return"addValue";case"Tab":case"ArrowDown":return t?null:"focusListbox";case"Escape":return"closeOptions";default:return null}},M=(a,t,e,s,i)=>{if(!a)return{action:"none",value:null};const l=u.findOptionByValue(e,a);return!t.includes(a)&&!l?s?{action:"addUserValue",value:a}:i?{action:"none",value:null}:{action:"removeValue",value:t[0]}:l&&!t.includes(l.value)?{action:"selectOption",value:l.value}:{action:"none",value:null}},U=(a,t,e,s,i)=>a.trim().toLowerCase()?{...u.getSearchInfoMessage(a,t,e,s),shouldRemoveValue:!1,shouldResetInput:!1}:{addValueText:null,userInfoMessage:"",shouldRemoveValue:!i&&!!t[0],shouldResetInput:!0},O=(a,t,e)=>{const s=u.findOptionByValue(t,a);return e==="label"&&(s!=null&&s.label)?s.label:a},m={markOptionSelected(a,t){if(t){for(const e of a)if(e.value===t){e.selected=!0;break}}},markOptionDeselected(a,t){if(t){for(const e of a)if(e.value===t){e.selected=!1;break}}},markAllSelected(a){for(const t of a)t.selected=!0},markAllDeselected(a){for(const t of a)t.selected=!1},removeUserAddedOptions(a){return a.filter(t=>!t.userAdded)}},A={parseOptionsFromSlot(a){const t=[];return a.forEach(e=>{if(!e.textContent&&!e.getAttribute("value"))return;const s={value:e.getAttribute("value")||e.textContent||"",label:e.textContent||e.getAttribute("value")||""};e.getAttribute("data-prefix")&&(s.prefix=e.getAttribute("data-prefix")||void 0),e.getAttribute("tagskincolor")&&(s.tagSkinColor=e.getAttribute("tagskincolor")),e.getAttribute("description")&&(s.description=e.getAttribute("description")||void 0),s.fulltext=u.buildFulltext(s),t.push(s)}),t}},k={syncOptionsWithValues(a,t){const e=[...t];return a.forEach(s=>{s.value&&!s.label&&(s.label=s.value),s.selected&&!e.includes(s.value)&&e.push(s.value),s.fulltext=u.buildFulltext(s),s.selected=s.selected||e.includes(s.value)}),{options:a,newValues:e}},mergeWithUserAdded(a,t){return[...t.filter(i=>(i==null?void 0:i.userAdded)&&i.selected).filter(i=>!(Array.isArray(a)?a:[]).some(l=>l.value===i.value)),...a]}},D={displayValueAs:{default:"label"}},q={props:D};var P=Object.defineProperty,r=(a,t,e,s)=>{for(var i=void 0,l=a.length-1,n;l>=0;l--)(n=a[l])&&(i=n(t,e,i)||i);return i&&P(t,e,i),i};class h extends w.PktInputElement{constructor(){super(),this.value="",this.options=[],this.defaultOptions=[],this.allowUserInput=!1,this.typeahead=!1,this.includeSearch=!1,this.searchPlaceholder="",this.multiple=!1,this.maxlength=null,this.displayValueAs=q.props.displayValueAs.default,this.tagPlacement=null,this.isOpen=!1,this._options=[],this._value=[],this._isOptionsOpen=!1,this._userInfoMessage="",this._addValueText=null,this._maxIsReached=!1,this._search="",this._inputFocus=!1,this._internalValueSync=!1,this._optionsFromSlot=!1,this._lastSlotGeneration=0,this._suppressNextOpen=!1,this.inputRef=b.e(),this.triggerRef=b.e(),this.listboxRef=b.e(),this.optionsController=new C.PktOptionsSlotController(this)}get _hasTextInput(){return this.typeahead||this.allowUserInput}get _selectionDescription(){if(!(!this.multiple||this._value.length===0))return`${this._value.length} valgt`}focusTrigger(){var t,e;this._hasTextInput?(t=this.inputRef.value)==null||t.focus():(e=this.triggerRef.value)==null||e.focus()}parseValue(){return Array.isArray(this.value)?this.multiple?this.value:this.value.length>0?[this.value[0]]:[]:this.value&&this.multiple?this.value.split(","):this.value?[this.value]:[]}updateMaxReached(){this._maxIsReached=u.isMaxSelectionReached(this._value.length,this.maxlength)}syncValueAndDispatch(t){const e=this._value,s=this.multiple?e.join(","):e[0]||"",i=Array.isArray(this.value)?this.value.join(","):String(this.value||"");if(s!==i&&(this._internalValueSync=!0,this.value=s),(t==null?void 0:t.join(","))!==e.join(",")){const l=this.multiple?[...e]:e[0]||"";this.onChange(l)}else e.length===0&&t&&t.length>0&&this.clearInputValue()}onChange(t){this.touched=!0,super.onChange(t)}valueChanged(){}}r([o.n({type:String,reflect:!0})],h.prototype,"value");r([o.n({type:Array})],h.prototype,"options");r([o.n({type:Array,attribute:"default-options"})],h.prototype,"defaultOptions");r([o.n({type:Boolean,attribute:"allow-user-input"})],h.prototype,"allowUserInput");r([o.n({type:Boolean})],h.prototype,"typeahead");r([o.n({type:Boolean,attribute:"include-search"})],h.prototype,"includeSearch");r([o.n({type:String,attribute:"search-placeholder"})],h.prototype,"searchPlaceholder");r([o.n({type:Boolean})],h.prototype,"multiple");r([o.n({type:Number})],h.prototype,"maxlength");r([o.n({type:String,attribute:"display-value-as"})],h.prototype,"displayValueAs");r([o.n({type:String,attribute:"tag-placement"})],h.prototype,"tagPlacement");r([o.n({type:Boolean,attribute:"open"})],h.prototype,"isOpen");r([v.r()],h.prototype,"_options");r([v.r()],h.prototype,"_value");r([v.r()],h.prototype,"_isOptionsOpen");r([v.r()],h.prototype,"_userInfoMessage");r([v.r()],h.prototype,"_addValueText");r([v.r()],h.prototype,"_maxIsReached");r([v.r()],h.prototype,"_search");r([v.r()],h.prototype,"_inputFocus");class B extends h{toggleValue(t){var $,I;if(this.disabled)return;this.touched=!0,this._userInfoMessage="",this._addValueText=null;const e=(($=u.findOptionByValue(this.options,t))==null?void 0:$.value)||null,s=this._value.includes(t||e||""),i=!!e,l=((I=this._options.find(T=>T.value===t))==null?void 0:I.disabled)||!1,n=!(t!=null&&t.trim()),p=!this.multiple,f=this.multiple,_=u.isMaxSelectionReached(this._value.length,this.maxlength);let c=!1,x=!0,g="",y="";l||(!i&&this.allowUserInput&&!n?(this.addNewUserValue(t),g="Ny verdi lagt til",c=f):!i&&!this.allowUserInput?(p&&this._value[0]&&this.removeValue(this._value[0]),x=!1,c=!0,g="Ingen treff i søket"):s?(this.removeValue(e),c=!0,p&&this._hasTextInput&&this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="")):n&&p?(this.removeAllSelected(),c=!0):p?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(e),c=!1):f&&!_?(this.setSelected(e),c=!0):f&&_?(g="Maks antall valg nådd",x=!1,y=t):(p&&this.removeAllSelected(),g="Ingen gyldig verdi valgt",x=!1,c=!0,y=t),this._isOptionsOpen=c,c||(p&&this._hasTextInput&&(this._suppressNextOpen=!0),window.setTimeout(()=>{this.focusTrigger()},0)),this._userInfoMessage=g,this._search=y||"",this.resetComboboxInput(x),f&&this.updateMaxReached())}setSelected(t){if(!this._value.includes(t)){if(this.multiple&&u.isMaxSelectionReached(this._value.length,this.maxlength)){this._userInfoMessage="Maks antall valg nådd";return}!this.multiple&&this.removeAllSelected(),this._value=t?[...this._value,t]:this._value,m.markOptionSelected(this._options,t),this.resetComboboxInput(!0)}}removeSelected(t){if(!t)return;this._value=this._value.filter(s=>s!==t);const e=u.findOptionByValue(this.options,t);e&&(m.markOptionDeselected(this.options,t),e.userAdded?(this._options=[...this._options.filter(s=>s.value!==t)],this.options=[...this.options.filter(s=>s.value!==t)]):this._options.some(s=>s.value===t)||(this._options=[...this._options,e]))}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),m.markAllSelected(this._options),this.requestUpdate()}}removeAllSelected(){this._value=[],m.markAllDeselected(this._options),this._options=m.removeUserAddedOptions(this._options),this.requestUpdate()}addValue(){var e;const t=((e=this.inputRef.value)==null?void 0:e.value.trim())||"";if(this._search=t,t&&this._value.includes(t)){this.resetComboboxInput(!0),this._userInfoMessage="Verdien er allerede valgt";return}this.toggleValue(t)}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];else if(!u.findOptionByValue(this.options,t)){if(u.isMaxSelectionReached(this._value.length,this.maxlength))return;this._value=[...this._value,t]}const e={value:t,label:t,userAdded:!0,selected:!0};this.options=[e,...this.options],this._options=[e,...this._options],this.resetComboboxInput(!0),this.multiple||(this._isOptionsOpen=!1,this._hasTextInput&&(this._suppressNextOpen=!0),window.setTimeout(()=>{this.focusTrigger()},0)),this.requestUpdate()}resetComboboxInput(t=!0){this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&t&&(this._search="",this.multiple?this.inputRef.value.value="":(this.inputRef.value.value=this._value[0]?O(this._value[0],this.options,this.displayValueAs):"",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.updateMaxReached()}}class E extends B{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){const{filtered:s,suggestion:i}=u.findTypeaheadMatches(this.options,this._search);this._options=s,t.inputType!=="deleteContentBackward"&&(i!=null&&i.label)&&this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(e.value=i.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._suppressNextOpen){this._suppressNextOpen=!1,this._inputFocus=!0,this.requestUpdate();return}!this.multiple&&this._value[0]&&this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value=O(this._value[0],this.options,this.displayValueAs)),this._inputFocus=!0,this._search="",this._options=[...this.options],this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()}}handleFocusOut(t){var i,l;if(this.disabled||!this._isOptionsOpen)return;const e=t.relatedTarget;((i=e==null?void 0:e.closest("pkt-combobox"))==null?void 0:i.id)===this.id||((l=t.target)==null?void 0:l.getAttribute("data-focusfix"))===this.id||e===this.inputRef.value||e===this.triggerRef.value||this.closeAndProcessInput()}closeAndProcessInput(){if(this._inputFocus=!1,this._addValueText=null,this._userInfoMessage="",this._search="",this.inputRef.value&&this.inputRef.value.type!=="hidden"){const t=this.inputRef.value.value;if(this.multiple){if(t!==""){const{action:e,value:s}=M(t,this._value,this.options,this.allowUserInput,this.multiple);switch(e){case"addUserValue":this.addNewUserValue(s);break;case"selectOption":this.setSelected(s);break;case"removeValue":this.removeValue(s);break}}}else if(!t)this._value[0]&&this.removeSelected(this._value[0]);else{const e=u.findOptionByValue(this.options,t);e&&e.value!==this._value[0]?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(e.value)):!e&&this.allowUserInput&&(this._value[0]&&this.removeSelected(this._value[0]),this.addNewUserValue(t))}!this.multiple&&this._value[0]?this.inputRef.value.value=O(this._value[0],this.options,this.displayValueAs):this.inputRef.value.value=""}this._isOptionsOpen=!1,this.onBlur()}handleBlur(){this._inputFocus=!1,this.onBlur()}handleInputClick(t){var e,s;if(this.disabled){t.preventDefault(),t.stopImmediatePropagation();return}this._hasTextInput?((e=this.inputRef.value)==null||e.focus(),this.requestUpdate()):(t.stopImmediatePropagation(),t.preventDefault(),this._isOptionsOpen=!this._isOptionsOpen,this._isOptionsOpen&&((s=this.listboxRef.value)==null||s.focusFirstOrSelectedOption()))}handlePlaceholderClick(t){this.disabled||(t.stopPropagation(),this._hasTextInput&&this.inputRef.value?(this.inputRef.value.focus(),this._inputFocus=!0,this.requestUpdate()):(this._isOptionsOpen=!this._isOptionsOpen,this.requestUpdate()))}handleSelectOnlyKeydown(t){var e,s;if(!this.disabled)switch(t.key){case"Enter":case" ":case"ArrowDown":case"ArrowUp":t.preventDefault(),this._isOptionsOpen?this._isOptionsOpen=!1:(this._isOptionsOpen=!0,(e=this.listboxRef.value)==null||e.focusFirstOrSelectedOption());break;case"Escape":this._isOptionsOpen&&(t.preventDefault(),this._isOptionsOpen=!1);break;case"Home":case"End":t.preventDefault(),this._isOptionsOpen||(this._isOptionsOpen=!0),(s=this.listboxRef.value)==null||s.focusFirstOrSelectedOption();break;case"ArrowLeft":this.multiple&&this._value.length>0&&(t.preventDefault(),this.focusTag(this._value.length-1));break;case"Backspace":case"Delete":this.multiple&&this._value.length>0&&(t.preventDefault(),this.removeSelected(this._value[this._value.length-1]));break}}handleOptionToggled(t){this.toggleValue(t.detail)}handleSearch(t){t.stopPropagation(),this._search=t.detail.toLowerCase(),this.checkForMatches()}handleInputKeydown(t){var s,i,l;if(t.key==="Backspace"){const n=!((s=this.inputRef.value)!=null&&s.value);!this._search&&n&&this.multiple&&this._value.length>0&&this.removeLastValue(t);return}if(t.key==="ArrowLeft"&&this.multiple&&this._value.length>0){const n=this.inputRef.value;if(n&&n.selectionStart===0&&!n.value){t.preventDefault(),this.focusTag(this._value.length-1);return}}const e=F(t.key,t.shiftKey,this.multiple);if(e&&!(t.key==="Tab"&&!this._isOptionsOpen)){if(e==="focusListbox"&&t.key==="Tab"&&!((i=this.listboxRef.value)==null?void 0:i.querySelector('[role="option"]:not([data-disabled]), [data-type="new-option"]'))){this.closeAndProcessInput();return}switch(t.preventDefault(),e){case"addValue":this.addValue();break;case"focusListbox":(l=this.listboxRef.value)==null||l.focusFirstOrSelectedOption();break;case"closeOptions":this._isOptionsOpen=!1;break}}}handleTagRemove(t){this.removeSelected(t),this._hasTextInput&&this.inputRef.value&&(this._inputFocus=!0,this.inputRef.value.focus(),this.requestUpdate())}getInsideTags(){return Array.from(this.querySelectorAll(".pkt-combobox__input .pkt-combobox__tag-list pkt-tag"))}focusTag(t){var i;const e=this.getInsideTags();e.forEach((l,n)=>{l.buttonTabindex=n===t?0:-1});const s=(i=e[t])==null?void 0:i.querySelector("button");s==null||s.focus()}resetTagTabindices(){this.getInsideTags().forEach(e=>{e.buttonTabindex=-1})}handleTagKeydown(t,e){t.stopPropagation();const s=()=>{var i;this.resetTagTabindices(),this._hasTextInput&&this.inputRef.value?this.inputRef.value.focus():(i=this.triggerRef.value)==null||i.focus()};switch(t.key){case"ArrowLeft":t.preventDefault(),e>0&&this.focusTag(e-1);break;case"ArrowRight":t.preventDefault(),e<this._value.length-1?this.focusTag(e+1):s();break;case"Backspace":case"Delete":t.preventDefault();{const i=this._value[e],l=e>=this._value.length-1?e-1:e;this.removeSelected(i),l>=0?(this.requestUpdate(),this.updateComplete.then(()=>this.focusTag(l))):s()}break;case"Tab":this.resetTagTabindices();break;case"Escape":t.preventDefault(),s();break}}checkForMatches(){var s;const t=((s=this.inputRef.value)==null?void 0:s.value)||this._search||"",e=U(t,this._value,this.options,this.allowUserInput,this.multiple);if(e.shouldRemoveValue&&this.removeValue(this._value[0]),e.shouldResetInput){this.resetComboboxInput(!1);return}this._addValueText=e.addValueText,this._userInfoMessage=e.userInfoMessage}}var N=Object.getOwnPropertyDescriptor,L=(a,t,e,s)=>{for(var i=s>1?void 0:s?N(t,e):t,l=a.length-1,n;l>=0;l--)(n=a[l])&&(i=n(i)||i);return i};exports.PktCombobox=class extends E{constructor(){super(...arguments),this.handleBodyClick=t=>{this._isOptionsOpen&&!this.contains(t.target)&&this.closeAndProcessInput()}}connectedCallback(){var t,e;if(super.connectedCallback(),document==null||document.body.addEventListener("click",this.handleBodyClick),this._options=[],this.defaultOptions&&this.defaultOptions.length){const s=((t=this.options)==null?void 0:t.filter(i=>i.userAdded))||[];this.options=[...s,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if((e=this.optionsController)!=null&&e.nodes&&this.optionsController.nodes.length){const s=A.parseOptionsFromSlot(this.optionsController.nodes);s.length&&(this.options=[...s],this._options=[...s],this._optionsFromSlot=!0,this._lastSlotGeneration=this.optionsController.generation)}}willUpdate(t){if(this._optionsFromSlot&&this.optionsController){const e=this.optionsController.generation;if(e!==this._lastSlotGeneration){this._lastSlotGeneration=e;const s=A.parseOptionsFromSlot(this.optionsController.nodes),i=this._options.filter(l=>l.userAdded);this.options=[...i,...s]}}super.willUpdate(t)}disconnectedCallback(){super.disconnectedCallback(),document==null||document.body.removeEventListener("click",this.handleBodyClick)}firstUpdated(t){this.defaultValue!==null&&!this.value&&(this.value=this.defaultValue),super.firstUpdated(t)}updated(t){t.has("isOpen")&&(this._isOptionsOpen=this.isOpen);const e=t.has("value"),s=t.has("_value");if(e&&this._internalValueSync)this._internalValueSync=!1,s&&this.syncValueAndDispatch(t.get("_value"));else if(e){const l=[...this._value],n=this.parseValue();n.join(",")!==this._value.join(",")&&(this._value=n),this.updateMaxReached(),this.syncValueAndDispatch(l)}else s&&this.syncValueAndDispatch(t.get("_value"));if(t.has("defaultOptions")&&this.defaultOptions.length){const l=(Array.isArray(this.options)?this.options:[]).filter(n=>n.userAdded)||[];this.options=[...l,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(t.has("options")){const l=t.get("options")||this._options||[],n=k.mergeWithUserAdded(this.options,l);this._options=n,n.length>this.options.length&&(this.options=n);const p=k.syncOptionsWithValues(this._options,this._value);if(this._options=p.options,p.newValues.length>this._value.length){const f=[...this._value];this._value=p.newValues,this.syncValueAndDispatch(f)}}if(t.has("_search")&&this.dispatchEvent(new CustomEvent("search",{detail:this._search,bubbles:!1})),!this._isOptionsOpen&&!this.multiple&&this._hasTextInput&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const l=this._value[0]?O(this._value[0],this.options,this.displayValueAs):"";this.inputRef.value.value!==l&&(this.inputRef.value.value=l)}super.updated(t)}formResetCallback(){this.touched=!1;const t=this.defaultValue||(this.multiple,"");this.value=t,this._value=this.parseValue(),this._options=this._options.filter(e=>!e.userAdded).map(e=>({...e,selected:this._value.includes(e.value)})),this.options=this.options.filter(e=>!e.userAdded).map(e=>({...e,selected:this._value.includes(e.value)})),this._search="",this._isOptionsOpen=!1,this._userInfoMessage="",this._addValueText=null,this._inputFocus=!1,this.updateMaxReached(),this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value=""),this.internals.setFormValue(""),this.internals.ariaInvalid="false",this.requestUpdate()}attributeChangedCallback(t,e,s){if(t==="options"){this._options=Array.isArray(this.options)?[...this.options]:[];const i=k.syncOptionsWithValues(this._options,this._value);this._options=i.options,i.newValues.length>this._value.length&&(this._value=i.newValues),this._search=""}super.attributeChangedCallback(t,e,s)}render(){return o.b`
|
|
1
|
+
"use strict";const o=require("./element-gR_VtSiD.cjs"),d=require("./if-defined-BOW3ODSj.cjs"),b=require("./ref-CL-Xk9Xm.cjs"),V=require("./class-map-CsENJXf1.cjs"),S=require("./repeat-Cfq8CDlf.cjs"),u=require("./listbox-CGgV9MAe.cjs"),R=require("./element-with-slot-ZX-up7jO.cjs"),v=require("./state-Dg-53wQ8.cjs"),w=require("./input-element-DdVhUvva.cjs"),C=require("./pkt-options-controller-5LXbEzuk.cjs");require("./input-wrapper-B0MkQ0IZ.cjs");require("./icon-Bqj9oBbl.cjs");require("./tag-X6xdjR0N.cjs");const F=(a,t,e)=>{switch(a){case",":return e?"addValue":null;case"Enter":return"addValue";case"Tab":case"ArrowDown":return t?null:"focusListbox";case"Escape":return"closeOptions";default:return null}},M=(a,t,e,s,i)=>{if(!a)return{action:"none",value:null};const l=u.findOptionByValue(e,a);return!t.includes(a)&&!l?s?{action:"addUserValue",value:a}:i?{action:"none",value:null}:{action:"removeValue",value:t[0]}:l&&!t.includes(l.value)?{action:"selectOption",value:l.value}:{action:"none",value:null}},U=(a,t,e,s,i)=>a.trim().toLowerCase()?{...u.getSearchInfoMessage(a,t,e,s),shouldRemoveValue:!1,shouldResetInput:!1}:{addValueText:null,userInfoMessage:"",shouldRemoveValue:!i&&!!t[0],shouldResetInput:!0},O=(a,t,e)=>{const s=u.findOptionByValue(t,a);return e==="label"&&(s!=null&&s.label)?s.label:a},m={markOptionSelected(a,t){if(t){for(const e of a)if(e.value===t){e.selected=!0;break}}},markOptionDeselected(a,t){if(t){for(const e of a)if(e.value===t){e.selected=!1;break}}},markAllSelected(a){for(const t of a)t.selected=!0},markAllDeselected(a){for(const t of a)t.selected=!1},removeUserAddedOptions(a){return a.filter(t=>!t.userAdded)}},A={parseOptionsFromSlot(a){const t=[];return a.forEach(e=>{if(!e.textContent&&!e.getAttribute("value"))return;const s={value:e.getAttribute("value")||e.textContent||"",label:e.textContent||e.getAttribute("value")||""};e.getAttribute("data-prefix")&&(s.prefix=e.getAttribute("data-prefix")||void 0),e.getAttribute("tagskincolor")&&(s.tagSkinColor=e.getAttribute("tagskincolor")),e.getAttribute("description")&&(s.description=e.getAttribute("description")||void 0),s.fulltext=u.buildFulltext(s),t.push(s)}),t}},k={syncOptionsWithValues(a,t){const e=[...t];return a.forEach(s=>{s.value&&!s.label&&(s.label=s.value),s.selected&&!e.includes(s.value)&&e.push(s.value),s.fulltext=u.buildFulltext(s),s.selected=s.selected||e.includes(s.value)}),{options:a,newValues:e}},mergeWithUserAdded(a,t){return[...t.filter(i=>(i==null?void 0:i.userAdded)&&i.selected).filter(i=>!(Array.isArray(a)?a:[]).some(l=>l.value===i.value)),...a]}},D={displayValueAs:{default:"label"}},q={props:D};var P=Object.defineProperty,r=(a,t,e,s)=>{for(var i=void 0,l=a.length-1,n;l>=0;l--)(n=a[l])&&(i=n(t,e,i)||i);return i&&P(t,e,i),i};class h extends w.PktInputElement{constructor(){super(),this.value="",this.options=[],this.defaultOptions=[],this.allowUserInput=!1,this.typeahead=!1,this.includeSearch=!1,this.searchPlaceholder="",this.multiple=!1,this.maxlength=null,this.displayValueAs=q.props.displayValueAs.default,this.tagPlacement=null,this.isOpen=!1,this._options=[],this._value=[],this._isOptionsOpen=!1,this._userInfoMessage="",this._addValueText=null,this._maxIsReached=!1,this._search="",this._inputFocus=!1,this._internalValueSync=!1,this._optionsFromSlot=!1,this._lastSlotGeneration=0,this._suppressNextOpen=!1,this.inputRef=b.e(),this.triggerRef=b.e(),this.listboxRef=b.e(),this.optionsController=new C.PktOptionsSlotController(this)}get _hasTextInput(){return this.typeahead||this.allowUserInput}get _selectionDescription(){if(!(!this.multiple||this._value.length===0))return`${this._value.length} valgt`}focusTrigger(){var t,e;this._hasTextInput?(t=this.inputRef.value)==null||t.focus():(e=this.triggerRef.value)==null||e.focus()}parseValue(){return Array.isArray(this.value)?this.multiple?this.value:this.value.length>0?[this.value[0]]:[]:this.value&&this.multiple?this.value.split(","):this.value?[this.value]:[]}updateMaxReached(){this._maxIsReached=u.isMaxSelectionReached(this._value.length,this.maxlength)}syncValueAndDispatch(t){const e=this._value,s=this.multiple?e.join(","):e[0]||"",i=Array.isArray(this.value)?this.value.join(","):String(this.value||"");if(s!==i&&(this._internalValueSync=!0,this.value=s),(t==null?void 0:t.join(","))!==e.join(",")){const l=this.multiple?[...e]:e[0]||"";this.onChange(l)}else e.length===0&&t&&t.length>0&&this.clearInputValue()}onChange(t){this.touched=!0,super.onChange(t)}valueChanged(){}}r([o.n({type:String,reflect:!0})],h.prototype,"value");r([o.n({type:Array})],h.prototype,"options");r([o.n({type:Array,attribute:"default-options"})],h.prototype,"defaultOptions");r([o.n({type:Boolean,attribute:"allow-user-input"})],h.prototype,"allowUserInput");r([o.n({type:Boolean})],h.prototype,"typeahead");r([o.n({type:Boolean,attribute:"include-search"})],h.prototype,"includeSearch");r([o.n({type:String,attribute:"search-placeholder"})],h.prototype,"searchPlaceholder");r([o.n({type:Boolean})],h.prototype,"multiple");r([o.n({type:Number})],h.prototype,"maxlength");r([o.n({type:String,attribute:"display-value-as"})],h.prototype,"displayValueAs");r([o.n({type:String,attribute:"tag-placement"})],h.prototype,"tagPlacement");r([o.n({type:Boolean,attribute:"open"})],h.prototype,"isOpen");r([v.r()],h.prototype,"_options");r([v.r()],h.prototype,"_value");r([v.r()],h.prototype,"_isOptionsOpen");r([v.r()],h.prototype,"_userInfoMessage");r([v.r()],h.prototype,"_addValueText");r([v.r()],h.prototype,"_maxIsReached");r([v.r()],h.prototype,"_search");r([v.r()],h.prototype,"_inputFocus");class B extends h{toggleValue(t){var $,I;if(this.disabled)return;this.touched=!0,this._userInfoMessage="",this._addValueText=null;const e=(($=u.findOptionByValue(this.options,t))==null?void 0:$.value)||null,s=this._value.includes(t||e||""),i=!!e,l=((I=this._options.find(T=>T.value===t))==null?void 0:I.disabled)||!1,n=!(t!=null&&t.trim()),p=!this.multiple,f=this.multiple,_=u.isMaxSelectionReached(this._value.length,this.maxlength);let c=!1,x=!0,g="",y="";l||(!i&&this.allowUserInput&&!n?(this.addNewUserValue(t),g="Ny verdi lagt til",c=f):!i&&!this.allowUserInput?(p&&this._value[0]&&this.removeValue(this._value[0]),x=!1,c=!0,g="Ingen treff i søket"):s?(this.removeValue(e),c=!0,p&&this._hasTextInput&&this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="")):n&&p?(this.removeAllSelected(),c=!0):p?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(e),c=!1):f&&!_?(this.setSelected(e),c=!0):f&&_?(g="Maks antall valg nådd",x=!1,y=t):(p&&this.removeAllSelected(),g="Ingen gyldig verdi valgt",x=!1,c=!0,y=t),this._isOptionsOpen=c,c||(p&&this._hasTextInput&&(this._suppressNextOpen=!0),window.setTimeout(()=>{this.focusTrigger()},0)),this._userInfoMessage=g,this._search=y||"",this.resetComboboxInput(x),f&&this.updateMaxReached())}setSelected(t){if(!this._value.includes(t)){if(this.multiple&&u.isMaxSelectionReached(this._value.length,this.maxlength)){this._userInfoMessage="Maks antall valg nådd";return}!this.multiple&&this.removeAllSelected(),this._value=t?[...this._value,t]:this._value,m.markOptionSelected(this._options,t),this.resetComboboxInput(!0)}}removeSelected(t){if(!t)return;this._value=this._value.filter(s=>s!==t);const e=u.findOptionByValue(this.options,t);e&&(m.markOptionDeselected(this.options,t),e.userAdded?(this._options=[...this._options.filter(s=>s.value!==t)],this.options=[...this.options.filter(s=>s.value!==t)]):this._options.some(s=>s.value===t)||(this._options=[...this._options,e]))}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),m.markAllSelected(this._options),this.requestUpdate()}}removeAllSelected(){this._value=[],m.markAllDeselected(this._options),this._options=m.removeUserAddedOptions(this._options),this.requestUpdate()}addValue(){var e;const t=((e=this.inputRef.value)==null?void 0:e.value.trim())||"";if(this._search=t,t&&this._value.includes(t)){this.resetComboboxInput(!0),this._userInfoMessage="Verdien er allerede valgt";return}this.toggleValue(t)}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];else if(!u.findOptionByValue(this.options,t)){if(u.isMaxSelectionReached(this._value.length,this.maxlength))return;this._value=[...this._value,t]}const e={value:t,label:t,userAdded:!0,selected:!0};this.options=[e,...this.options],this._options=[e,...this._options],this.resetComboboxInput(!0),this.multiple||(this._isOptionsOpen=!1,this._hasTextInput&&(this._suppressNextOpen=!0),window.setTimeout(()=>{this.focusTrigger()},0)),this.requestUpdate()}resetComboboxInput(t=!0){this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&t&&(this._search="",this.multiple?this.inputRef.value.value="":(this.inputRef.value.value=this._value[0]?O(this._value[0],this.options,this.displayValueAs):"",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.updateMaxReached()}}class E extends B{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){const{filtered:s,suggestion:i}=u.findTypeaheadMatches(this.options,this._search);this._options=s,t.inputType!=="deleteContentBackward"&&(i!=null&&i.label)&&this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(e.value=i.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._suppressNextOpen){this._suppressNextOpen=!1,this._inputFocus=!0,this.requestUpdate();return}!this.multiple&&this._value[0]&&this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value=O(this._value[0],this.options,this.displayValueAs)),this._inputFocus=!0,this._search="",this._options=[...this.options],this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()}}handleFocusOut(t){var i,l;if(this.disabled||!this._isOptionsOpen)return;const e=t.relatedTarget;((i=e==null?void 0:e.closest("pkt-combobox"))==null?void 0:i.id)===this.id||((l=t.target)==null?void 0:l.getAttribute("data-focusfix"))===this.id||e===this.inputRef.value||e===this.triggerRef.value||this.closeAndProcessInput()}closeAndProcessInput(){if(this._inputFocus=!1,this._addValueText=null,this._userInfoMessage="",this._search="",this.inputRef.value&&this.inputRef.value.type!=="hidden"){const t=this.inputRef.value.value;if(this.multiple){if(t!==""){const{action:e,value:s}=M(t,this._value,this.options,this.allowUserInput,this.multiple);switch(e){case"addUserValue":this.addNewUserValue(s);break;case"selectOption":this.setSelected(s);break;case"removeValue":this.removeValue(s);break}}}else if(!t)this._value[0]&&this.removeSelected(this._value[0]);else{const e=u.findOptionByValue(this.options,t);e&&e.value!==this._value[0]?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(e.value)):!e&&this.allowUserInput&&(this._value[0]&&this.removeSelected(this._value[0]),this.addNewUserValue(t))}!this.multiple&&this._value[0]?this.inputRef.value.value=O(this._value[0],this.options,this.displayValueAs):this.inputRef.value.value=""}this._isOptionsOpen=!1,this.onBlur()}handleBlur(){this._inputFocus=!1,this.onBlur()}handleInputClick(t){var e,s;if(this.disabled){t.preventDefault(),t.stopImmediatePropagation();return}this._hasTextInput?((e=this.inputRef.value)==null||e.focus(),this.requestUpdate()):(t.stopImmediatePropagation(),t.preventDefault(),this._isOptionsOpen=!this._isOptionsOpen,this._isOptionsOpen&&((s=this.listboxRef.value)==null||s.focusFirstOrSelectedOption()))}handlePlaceholderClick(t){this.disabled||(t.stopPropagation(),this._hasTextInput&&this.inputRef.value?(this.inputRef.value.focus(),this._inputFocus=!0,this.requestUpdate()):(this._isOptionsOpen=!this._isOptionsOpen,this.requestUpdate()))}handleSelectOnlyKeydown(t){var e,s;if(!this.disabled)switch(t.key){case"Enter":case" ":case"ArrowDown":case"ArrowUp":t.preventDefault(),this._isOptionsOpen?this._isOptionsOpen=!1:(this._isOptionsOpen=!0,(e=this.listboxRef.value)==null||e.focusFirstOrSelectedOption());break;case"Escape":this._isOptionsOpen&&(t.preventDefault(),this._isOptionsOpen=!1);break;case"Home":case"End":t.preventDefault(),this._isOptionsOpen||(this._isOptionsOpen=!0),(s=this.listboxRef.value)==null||s.focusFirstOrSelectedOption();break;case"ArrowLeft":this.multiple&&this._value.length>0&&(t.preventDefault(),this.focusTag(this._value.length-1));break;case"Backspace":case"Delete":this.multiple&&this._value.length>0&&(t.preventDefault(),this.removeSelected(this._value[this._value.length-1]));break}}handleOptionToggled(t){this.toggleValue(t.detail)}handleSearch(t){t.stopPropagation(),this._search=t.detail.toLowerCase(),this.checkForMatches()}handleInputKeydown(t){var s,i,l;if(t.key==="Backspace"){const n=!((s=this.inputRef.value)!=null&&s.value);!this._search&&n&&this.multiple&&this._value.length>0&&this.removeLastValue(t);return}if(t.key==="ArrowLeft"&&this.multiple&&this._value.length>0){const n=this.inputRef.value;if(n&&n.selectionStart===0&&!n.value){t.preventDefault(),this.focusTag(this._value.length-1);return}}const e=F(t.key,t.shiftKey,this.multiple);if(e&&!(t.key==="Tab"&&!this._isOptionsOpen)){if(e==="focusListbox"&&t.key==="Tab"&&!((i=this.listboxRef.value)==null?void 0:i.querySelector('[role="option"]:not([data-disabled]), [data-type="new-option"]'))){this.closeAndProcessInput();return}switch(t.preventDefault(),e){case"addValue":this.addValue();break;case"focusListbox":(l=this.listboxRef.value)==null||l.focusFirstOrSelectedOption();break;case"closeOptions":this._isOptionsOpen=!1;break}}}handleTagRemove(t){this.removeSelected(t),this._hasTextInput&&this.inputRef.value&&(this._inputFocus=!0,this.inputRef.value.focus(),this.requestUpdate())}getInsideTags(){return Array.from(this.querySelectorAll(".pkt-combobox__input .pkt-combobox__tag-list pkt-tag"))}focusTag(t){var i;const e=this.getInsideTags();e.forEach((l,n)=>{l.buttonTabindex=n===t?0:-1});const s=(i=e[t])==null?void 0:i.querySelector("button");s==null||s.focus()}resetTagTabindices(){this.getInsideTags().forEach(e=>{e.buttonTabindex=-1})}handleTagKeydown(t,e){t.stopPropagation();const s=()=>{var i;this.resetTagTabindices(),this._hasTextInput&&this.inputRef.value?this.inputRef.value.focus():(i=this.triggerRef.value)==null||i.focus()};switch(t.key){case"ArrowLeft":t.preventDefault(),e>0&&this.focusTag(e-1);break;case"ArrowRight":t.preventDefault(),e<this._value.length-1?this.focusTag(e+1):s();break;case"Backspace":case"Delete":t.preventDefault();{const i=this._value[e],l=e>=this._value.length-1?e-1:e;this.removeSelected(i),l>=0?(this.requestUpdate(),this.updateComplete.then(()=>this.focusTag(l))):s()}break;case"Tab":this.resetTagTabindices();break;case"Escape":t.preventDefault(),s();break}}checkForMatches(){var s;const t=((s=this.inputRef.value)==null?void 0:s.value)||this._search||"",e=U(t,this._value,this.options,this.allowUserInput,this.multiple);if(e.shouldRemoveValue&&this.removeValue(this._value[0]),e.shouldResetInput){this.resetComboboxInput(!1);return}this._addValueText=e.addValueText,this._userInfoMessage=e.userInfoMessage}}var N=Object.getOwnPropertyDescriptor,L=(a,t,e,s)=>{for(var i=s>1?void 0:s?N(t,e):t,l=a.length-1,n;l>=0;l--)(n=a[l])&&(i=n(i)||i);return i};exports.PktCombobox=class extends E{constructor(){super(...arguments),this.handleBodyClick=t=>{this._isOptionsOpen&&!this.contains(t.target)&&this.closeAndProcessInput()}}connectedCallback(){var t,e;if(super.connectedCallback(),document==null||document.body.addEventListener("click",this.handleBodyClick),this._options=[],this.defaultOptions&&this.defaultOptions.length){const s=((t=this.options)==null?void 0:t.filter(i=>i.userAdded))||[];this.options=[...s,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if((e=this.optionsController)!=null&&e.nodes&&this.optionsController.nodes.length){const s=A.parseOptionsFromSlot(this.optionsController.nodes);s.length&&(this.options=[...s],this._options=[...s],this._optionsFromSlot=!0,this._lastSlotGeneration=this.optionsController.generation)}}willUpdate(t){if(this._optionsFromSlot&&this.optionsController){const e=this.optionsController.generation;if(e!==this._lastSlotGeneration){this._lastSlotGeneration=e;const s=A.parseOptionsFromSlot(this.optionsController.nodes),i=this._options.filter(l=>l.userAdded);this.options=[...i,...s]}}super.willUpdate(t)}disconnectedCallback(){super.disconnectedCallback(),document==null||document.body.removeEventListener("click",this.handleBodyClick)}firstUpdated(t){this.defaultValue!==null&&!this.value&&(this.value=this.defaultValue),super.firstUpdated(t)}updated(t){t.has("isOpen")&&(this._isOptionsOpen=this.isOpen);const e=t.has("value"),s=t.has("_value");if(e&&this._internalValueSync)this._internalValueSync=!1,s&&this.syncValueAndDispatch(t.get("_value"));else if(e){const l=[...this._value],n=this.parseValue();n.join(",")!==this._value.join(",")&&(this._value=n),this.updateMaxReached(),this.syncValueAndDispatch(l)}else s&&this.syncValueAndDispatch(t.get("_value"));if(t.has("defaultOptions")&&this.defaultOptions.length){const l=(Array.isArray(this.options)?this.options:[]).filter(n=>n.userAdded)||[];this.options=[...l,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(t.has("options")){const l=t.get("options")||this._options||[],n=k.mergeWithUserAdded(this.options,l);this._options=n,n.length>this.options.length&&(this.options=n);const p=k.syncOptionsWithValues(this._options,this._value);if(this._options=p.options,p.newValues.length>this._value.length){const f=[...this._value];this._value=p.newValues,this.syncValueAndDispatch(f)}}if(t.has("_search")&&this.dispatchEvent(new CustomEvent("search",{detail:this._search,bubbles:!1})),!this._isOptionsOpen&&!this.multiple&&this._hasTextInput&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const l=this._value[0]?O(this._value[0],this.options,this.displayValueAs):"";this.inputRef.value.value!==l&&(this.inputRef.value.value=l)}super.updated(t)}formResetCallback(){this.touched=!1;const t=this.defaultValue||(this.multiple,"");this.value=t,this._value=this.parseValue(),this._options=this._options.filter(e=>!e.userAdded).map(e=>({...e,selected:this._value.includes(e.value)})),this.options=this.options.filter(e=>!e.userAdded).map(e=>({...e,selected:this._value.includes(e.value)})),this._search="",this._isOptionsOpen=!1,this._userInfoMessage="",this._addValueText=null,this._inputFocus=!1,this.updateMaxReached(),this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value=""),this.internals.setFormValue(""),this.internals.ariaInvalid="false",this.requestUpdate()}attributeChangedCallback(t,e,s){if(t==="options"){this._options=Array.isArray(this.options)?[...this.options]:[];const i=k.syncOptionsWithValues(this._options,this._value);this._options=i.options,i.newValues.length>this._value.length&&(this._value=i.newValues),this._search=""}super.attributeChangedCallback(t,e,s)}render(){return o.b`
|
|
2
2
|
<pkt-input-wrapper
|
|
3
3
|
.label=${this.label}
|
|
4
4
|
.helptext=${this.helptext}
|