@oslokommune/punkt-react 12.30.1 → 12.30.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22967,12 +22967,9 @@ var NO = Object.defineProperty, PO = Object.getOwnPropertyDescriptor, Us = (n, r
22967
22967
  };
22968
22968
  let po = class extends ti {
22969
22969
  constructor() {
22970
- super(), this.internals = this.attachInternals(), this.defaultSlot = Hn(), this.iconName = "user", this.secondIconName = "user", this.mode = "light", this.size = "medium", this.skin = "primary", this.variant = "label-only", this.state = "normal", this.type = "button", this.isLoading = !1, this.disabled = !1, this.slotController = new Wi(this, this.defaultSlot);
22970
+ super(), this.internals = this.attachInternals(), this.defaultSlot = Hn(), this.iconName = "user", this.secondIconName = "user", this.mode = "light", this.size = "medium", this.skin = "primary", this.variant = "label-only", this.state = "normal", this.type = "button", this.isLoading = !1, this.disabled = !1, this.slotController = new Wi(this, this.defaultSlot), this.addEventListener("click", this.handleClick), this.addEventListener("keydown", this.handleKeydown);
22971
22971
  }
22972
22972
  // Lifecycle
22973
- connectedCallback() {
22974
- super.connectedCallback(), this.addEventListener("click", this.handleClick), this.addEventListener("keydown", this.handleKeydown);
22975
- }
22976
22973
  disconnectedCallback() {
22977
22974
  super.disconnectedCallback(), this.removeEventListener("click", this.handleClick), this.removeEventListener("keydown", this.handleKeydown);
22978
22975
  }
@@ -23021,7 +23018,11 @@ let po = class extends ti {
23021
23018
  );
23022
23019
  }
23023
23020
  handleKeydown(r) {
23024
- this.disabled || this.isLoading || (r.key === "Enter" || r.key === " ") && (r.preventDefault(), this.handleClick(r));
23021
+ if (!(this.disabled || this.isLoading) && (r.key === "Enter" || r.key === " ")) {
23022
+ r.preventDefault();
23023
+ const o = r.target;
23024
+ o && o.click();
23025
+ }
23025
23026
  }
23026
23027
  };
23027
23028
  po.formAssociated = !0;
@@ -361,7 +361,7 @@ You might need to use a local HTTP server (instead of file://): https://reactjs.
361
361
 
362
362
  ${this.date?qe`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>`:gt}
363
363
  </div>
364
- `}};Nu([Z({type:Boolean,reflect:!1})],Vs.prototype,"compact",2),Nu([Z({type:String,reflect:!0})],Vs.prototype,"title",2),Nu([Z({type:String,reflect:!0})],Vs.prototype,"skin",2),Nu([Z({type:String})],Vs.prototype,"ariaLive",2),Nu([Z({type:String,reflect:!0})],Vs.prototype,"aria-live",2),Nu([Z({type:Boolean,reflect:!0})],Vs.prototype,"closeAlert",2),Nu([Z({type:String,reflect:!0})],Vs.prototype,"date",2),Nu([Rr()],Vs.prototype,"_isClosed",2),Vs=Nu([Kr("pkt-alert")],Vs);var eP=Object.defineProperty,tP=Object.getOwnPropertyDescriptor,ss=(n,r,o,u)=>{for(var f=u>1?void 0:u?tP(r,o):r,g=n.length-1,v;g>=0;g--)(v=n[g])&&(f=(u?v(r,o,f):v(f))||f);return u&&f&&eP(r,o,f),f};let Vi=class extends Oa{constructor(){super(),this.internals=this.attachInternals(),this.defaultSlot=Mn(),this.iconName="user",this.secondIconName="user",this.mode="light",this.size="medium",this.skin="primary",this.variant="label-only",this.state="normal",this.type="button",this.isLoading=!1,this.disabled=!1,this.slotController=new Si(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeydown)}updated(r){super.updated(r),this.setAttribute("role","button"),this.disabled?(this.getAttribute("tabindex")!=="-1"&&this.setAttribute("tabindex","-1"),this.getAttribute("aria-disabled")!=="true"&&this.setAttribute("aria-disabled","true")):(this.getAttribute("tabindex")!=="0"&&this.setAttribute("tabindex","0"),this.getAttribute("aria-disabled")!=="false"&&this.setAttribute("aria-disabled","false")),this.isLoading?this.getAttribute("aria-busy")!=="true"&&this.setAttribute("aria-busy","true"):this.hasAttribute("aria-busy")&&this.removeAttribute("aria-busy"),this.updateElementClasses()}render(){return qe`
364
+ `}};Nu([Z({type:Boolean,reflect:!1})],Vs.prototype,"compact",2),Nu([Z({type:String,reflect:!0})],Vs.prototype,"title",2),Nu([Z({type:String,reflect:!0})],Vs.prototype,"skin",2),Nu([Z({type:String})],Vs.prototype,"ariaLive",2),Nu([Z({type:String,reflect:!0})],Vs.prototype,"aria-live",2),Nu([Z({type:Boolean,reflect:!0})],Vs.prototype,"closeAlert",2),Nu([Z({type:String,reflect:!0})],Vs.prototype,"date",2),Nu([Rr()],Vs.prototype,"_isClosed",2),Vs=Nu([Kr("pkt-alert")],Vs);var eP=Object.defineProperty,tP=Object.getOwnPropertyDescriptor,ss=(n,r,o,u)=>{for(var f=u>1?void 0:u?tP(r,o):r,g=n.length-1,v;g>=0;g--)(v=n[g])&&(f=(u?v(r,o,f):v(f))||f);return u&&f&&eP(r,o,f),f};let Vi=class extends Oa{constructor(){super(),this.internals=this.attachInternals(),this.defaultSlot=Mn(),this.iconName="user",this.secondIconName="user",this.mode="light",this.size="medium",this.skin="primary",this.variant="label-only",this.state="normal",this.type="button",this.isLoading=!1,this.disabled=!1,this.slotController=new Si(this,this.defaultSlot),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeydown)}updated(r){super.updated(r),this.setAttribute("role","button"),this.disabled?(this.getAttribute("tabindex")!=="-1"&&this.setAttribute("tabindex","-1"),this.getAttribute("aria-disabled")!=="true"&&this.setAttribute("aria-disabled","true")):(this.getAttribute("tabindex")!=="0"&&this.setAttribute("tabindex","0"),this.getAttribute("aria-disabled")!=="false"&&this.setAttribute("aria-disabled","false")),this.isLoading?this.getAttribute("aria-busy")!=="true"&&this.setAttribute("aria-busy","true"):this.hasAttribute("aria-busy")&&this.removeAttribute("aria-busy"),this.updateElementClasses()}render(){return qe`
365
365
  <div class="pkt-btn__element-content">
366
366
  ${this.isLoading?qe`<pkt-icon
367
367
  class="pkt-btn__icon pkt-btn__spinner"
@@ -372,7 +372,7 @@ You might need to use a local HTTP server (instead of file://): https://reactjs.
372
372
  <span class="pkt-btn__text" ${Fn(this.defaultSlot)}></span>
373
373
  ${this.variant==="icons-right-and-left"?qe`<pkt-icon class="pkt-btn__icon" name=${this.secondIconName}></pkt-icon>`:gt}
374
374
  </div>
375
- `}updateElementClasses(){const r=new Set,o=this.getAttribute("class");r.add("pkt-btn"),o&&o.split(" ").forEach(u=>r.add(u)),this.size&&r.add(`pkt-btn--${this.size}`),this.skin&&r.add(`pkt-btn--${this.skin}`),this.variant&&r.add(`pkt-btn--${this.variant}`),this.color&&r.add(`pkt-btn--${this.color}`),this.isLoading&&r.add("pkt-btn--active"),this.state&&r.add(`pkt-btn--${this.state}`),this.disabled&&r.add("pkt-btn--disabled"),this.className=[...r].join(" ")}handleClick(r){if(this.disabled||this.isLoading){r.preventDefault(),r.stopImmediatePropagation();return}if(this.type==="submit"&&this.internals.form){this.internals.form.requestSubmit();return}if(this.type==="reset"&&this.internals.form){this.internals.form.reset();return}this.onClick&&typeof this.onClick=="function"&&this.onClick!==this.handleClick&&this.onClick(r),this.dispatchEvent(new CustomEvent("button-click",{bubbles:!0,composed:!0,detail:{originalEvent:r}}))}handleKeydown(r){this.disabled||this.isLoading||(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),this.handleClick(r))}};Vi.formAssociated=!0,ss([Z({type:String})],Vi.prototype,"iconName",2),ss([Z({type:String})],Vi.prototype,"secondIconName",2),ss([Z({type:String})],Vi.prototype,"mode",2),ss([Z({type:String})],Vi.prototype,"size",2),ss([Z({type:String})],Vi.prototype,"color",2),ss([Z({type:String})],Vi.prototype,"skin",2),ss([Z({type:String})],Vi.prototype,"variant",2),ss([Z({type:String,reflect:!0})],Vi.prototype,"state",2),ss([Z({type:String,reflect:!0})],Vi.prototype,"type",2),ss([Z({type:Boolean,reflect:!0})],Vi.prototype,"isLoading",2),ss([Z({type:Boolean,reflect:!0})],Vi.prototype,"disabled",2),Vi=ss([Kr("pkt-button")],Vi);const QS=6048e5,nP=864e5,rP=36e5,KS=Symbol.for("constructDateFrom");function Ys(n,r){return typeof n=="function"?n(r):n&&typeof n=="object"&&KS in n?n[KS](r):n instanceof Date?new n.constructor(r):new Date(r)}function mo(n,r){return Ys(r||n,n)}function Fk(n,r,o){const u=mo(n,void 0);return isNaN(r)?Ys(n,NaN):(r&&u.setDate(u.getDate()+r),u)}function aP(n,r,o){return Ys(n,+mo(n)+r)}function dg(n,r,o){return aP(n,r*rP)}let iP={};function Py(){return iP}function pg(n,r){var o,u,f,g;const v=Py(),C=(r==null?void 0:r.weekStartsOn)??((u=(o=r==null?void 0:r.locale)==null?void 0:o.options)==null?void 0:u.weekStartsOn)??v.weekStartsOn??((g=(f=v.locale)==null?void 0:f.options)==null?void 0:g.weekStartsOn)??0,E=mo(n,r==null?void 0:r.in),_=E.getDay(),$=(_<C?7:0)+_-C;return E.setDate(E.getDate()-$),E.setHours(0,0,0,0),E}function Ny(n,r){return pg(n,{...r,weekStartsOn:1})}function ZS(n,r){const o=mo(n,void 0),u=o.getFullYear(),f=Ys(o,0);f.setFullYear(u+1,0,4),f.setHours(0,0,0,0);const g=Ny(f),v=Ys(o,0);v.setFullYear(u,0,4),v.setHours(0,0,0,0);const C=Ny(v);return o.getTime()>=g.getTime()?u+1:o.getTime()>=C.getTime()?u:u-1}function XS(n){const r=mo(n),o=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return o.setUTCFullYear(r.getFullYear()),+n-+o}function JS(n,...r){const o=Ys.bind(null,r.find(u=>typeof u=="object"));return r.map(o)}function eC(n,r){const o=mo(n,void 0);return o.setHours(0,0,0,0),o}function oP(n,r,o){const[u,f]=JS(void 0,n,r),g=eC(u),v=eC(f),C=+g-XS(g),E=+v-XS(v);return Math.round((C-E)/nP)}function sP(n,r){const o=ZS(n),u=Ys(n,0);return u.setFullYear(o,0,4),u.setHours(0,0,0,0),Ny(u)}function lP(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function uP(n){return!(!lP(n)&&typeof n!="number"||isNaN(+mo(n)))}function cP(n,r){const[o,u]=JS(n,r.start,r.end);return{start:o,end:u}}function $k(n,r){const{start:o,end:u}=cP(void 0,n);let f=+o>+u;const g=f?+o:+u,v=f?u:o;v.setHours(0,0,0,0);let C=1;const E=[];for(;+v<=g;)E.push(Ys(o,v)),v.setDate(v.getDate()+C),v.setHours(0,0,0,0);return f?E.reverse():E}function dP(n,r){const o=mo(n,void 0);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}const pP={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"}},fP=(n,r,o)=>{let u;const f=pP[n];return typeof f=="string"?u=f:r===1?u=f.one:u=f.other.replace("{{count}}",r.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"in "+u:u+" ago":u};function Pk(n){return(r={})=>{const o=r.width?String(r.width):n.defaultWidth;return n.formats[o]||n.formats[n.defaultWidth]}}const hP={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},mP={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},gP={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},vP={date:Pk({formats:hP,defaultWidth:"full"}),time:Pk({formats:mP,defaultWidth:"full"}),dateTime:Pk({formats:gP,defaultWidth:"full"})},yP={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},bP=(n,r,o,u)=>yP[n];function fg(n){return(r,o)=>{const u=o!=null&&o.context?String(o.context):"standalone";let f;if(u==="formatting"&&n.formattingValues){const v=n.defaultFormattingWidth||n.defaultWidth,C=o!=null&&o.width?String(o.width):v;f=n.formattingValues[C]||n.formattingValues[v]}else{const v=n.defaultWidth,C=o!=null&&o.width?String(o.width):n.defaultWidth;f=n.values[C]||n.values[v]}const g=n.argumentCallback?n.argumentCallback(r):r;return f[g]}}const kP={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},wP={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},DP={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"]},SP={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"]},CP={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"}},xP={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"}},EP=(n,r)=>{const o=Number(n),u=o%100;if(u>20||u<10)switch(u%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},_P={ordinalNumber:EP,era:fg({values:kP,defaultWidth:"wide"}),quarter:fg({values:wP,defaultWidth:"wide",argumentCallback:n=>n-1}),month:fg({values:DP,defaultWidth:"wide"}),day:fg({values:SP,defaultWidth:"wide"}),dayPeriod:fg({values:CP,defaultWidth:"wide",formattingValues:xP,defaultFormattingWidth:"wide"})};function hg(n){return(r,o={})=>{const u=o.width,f=u&&n.matchPatterns[u]||n.matchPatterns[n.defaultMatchWidth],g=r.match(f);if(!g)return null;const v=g[0],C=u&&n.parsePatterns[u]||n.parsePatterns[n.defaultParseWidth],E=Array.isArray(C)?AP(C,N=>N.test(v)):TP(C,N=>N.test(v));let _;_=n.valueCallback?n.valueCallback(E):E,_=o.valueCallback?o.valueCallback(_):_;const $=r.slice(v.length);return{value:_,rest:$}}}function TP(n,r){for(const o in n)if(Object.prototype.hasOwnProperty.call(n,o)&&r(n[o]))return o}function AP(n,r){for(let o=0;o<n.length;o++)if(r(n[o]))return o}function FP(n){return(r,o={})=>{const u=r.match(n.matchPattern);if(!u)return null;const f=u[0],g=r.match(n.parsePattern);if(!g)return null;let v=n.valueCallback?n.valueCallback(g[0]):g[0];v=o.valueCallback?o.valueCallback(v):v;const C=r.slice(f.length);return{value:v,rest:C}}}const $P=/^(\d+)(th|st|nd|rd)?/i,PP=/\d+/i,NP={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},RP={any:[/^b/i,/^(a|c)/i]},OP={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},LP={any:[/1/i,/2/i,/3/i,/4/i]},BP={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},jP={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]},IP={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},MP={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]},zP={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},UP={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}},HP={ordinalNumber:FP({matchPattern:$P,parsePattern:PP,valueCallback:n=>parseInt(n,10)}),era:hg({matchPatterns:NP,defaultMatchWidth:"wide",parsePatterns:RP,defaultParseWidth:"any"}),quarter:hg({matchPatterns:OP,defaultMatchWidth:"wide",parsePatterns:LP,defaultParseWidth:"any",valueCallback:n=>n+1}),month:hg({matchPatterns:BP,defaultMatchWidth:"wide",parsePatterns:jP,defaultParseWidth:"any"}),day:hg({matchPatterns:IP,defaultMatchWidth:"wide",parsePatterns:MP,defaultParseWidth:"any"}),dayPeriod:hg({matchPatterns:zP,defaultMatchWidth:"any",parsePatterns:UP,defaultParseWidth:"any"})},qP={code:"en-US",formatDistance:fP,formatLong:vP,formatRelative:bP,localize:_P,match:HP,options:{weekStartsOn:0,firstWeekContainsDate:1}};function WP(n,r){const o=mo(n,void 0);return oP(o,dP(o))+1}function VP(n,r){const o=mo(n,void 0),u=+Ny(o)-+sP(o);return Math.round(u/QS)+1}function tC(n,r){var o,u,f,g;const v=mo(n,r==null?void 0:r.in),C=v.getFullYear(),E=Py(),_=(r==null?void 0:r.firstWeekContainsDate)??((u=(o=r==null?void 0:r.locale)==null?void 0:o.options)==null?void 0:u.firstWeekContainsDate)??E.firstWeekContainsDate??((g=(f=E.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,$=Ys((r==null?void 0:r.in)||n,0);$.setFullYear(C+1,0,_),$.setHours(0,0,0,0);const N=pg($,r),R=Ys((r==null?void 0:r.in)||n,0);R.setFullYear(C,0,_),R.setHours(0,0,0,0);const B=pg(R,r);return+v>=+N?C+1:+v>=+B?C:C-1}function YP(n,r){var o,u,f,g;const v=Py(),C=(r==null?void 0:r.firstWeekContainsDate)??((u=(o=r==null?void 0:r.locale)==null?void 0:o.options)==null?void 0:u.firstWeekContainsDate)??v.firstWeekContainsDate??((g=(f=v.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,E=tC(n,r),_=Ys((r==null?void 0:r.in)||n,0);return _.setFullYear(E,0,C),_.setHours(0,0,0,0),pg(_,r)}function nC(n,r){const o=mo(n,r==null?void 0:r.in),u=+pg(o,r)-+YP(o,r);return Math.round(u/QS)+1}function Xn(n,r){const o=n<0?"-":"",u=Math.abs(n).toString().padStart(r,"0");return o+u}const Wc={y(n,r){const o=n.getFullYear(),u=o>0?o:1-o;return Xn(r==="yy"?u%100:u,r.length)},M(n,r){const o=n.getMonth();return r==="M"?String(o+1):Xn(o+1,2)},d(n,r){return Xn(n.getDate(),r.length)},a(n,r){const o=n.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return o.toUpperCase();case"aaa":return o;case"aaaaa":return o[0];case"aaaa":default:return o==="am"?"a.m.":"p.m."}},h(n,r){return Xn(n.getHours()%12||12,r.length)},H(n,r){return Xn(n.getHours(),r.length)},m(n,r){return Xn(n.getMinutes(),r.length)},s(n,r){return Xn(n.getSeconds(),r.length)},S(n,r){const o=r.length,u=n.getMilliseconds(),f=Math.trunc(u*Math.pow(10,o-3));return Xn(f,r.length)}},rh={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},rC={G:function(n,r,o){const u=n.getFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return o.era(u,{width:"abbreviated"});case"GGGGG":return o.era(u,{width:"narrow"});case"GGGG":default:return o.era(u,{width:"wide"})}},y:function(n,r,o){if(r==="yo"){const u=n.getFullYear(),f=u>0?u:1-u;return o.ordinalNumber(f,{unit:"year"})}return Wc.y(n,r)},Y:function(n,r,o,u){const f=tC(n,u),g=f>0?f:1-f;if(r==="YY"){const v=g%100;return Xn(v,2)}return r==="Yo"?o.ordinalNumber(g,{unit:"year"}):Xn(g,r.length)},R:function(n,r){const o=ZS(n);return Xn(o,r.length)},u:function(n,r){const o=n.getFullYear();return Xn(o,r.length)},Q:function(n,r,o){const u=Math.ceil((n.getMonth()+1)/3);switch(r){case"Q":return String(u);case"QQ":return Xn(u,2);case"Qo":return o.ordinalNumber(u,{unit:"quarter"});case"QQQ":return o.quarter(u,{width:"abbreviated",context:"formatting"});case"QQQQQ":return o.quarter(u,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(u,{width:"wide",context:"formatting"})}},q:function(n,r,o){const u=Math.ceil((n.getMonth()+1)/3);switch(r){case"q":return String(u);case"qq":return Xn(u,2);case"qo":return o.ordinalNumber(u,{unit:"quarter"});case"qqq":return o.quarter(u,{width:"abbreviated",context:"standalone"});case"qqqqq":return o.quarter(u,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(u,{width:"wide",context:"standalone"})}},M:function(n,r,o){const u=n.getMonth();switch(r){case"M":case"MM":return Wc.M(n,r);case"Mo":return o.ordinalNumber(u+1,{unit:"month"});case"MMM":return o.month(u,{width:"abbreviated",context:"formatting"});case"MMMMM":return o.month(u,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(u,{width:"wide",context:"formatting"})}},L:function(n,r,o){const u=n.getMonth();switch(r){case"L":return String(u+1);case"LL":return Xn(u+1,2);case"Lo":return o.ordinalNumber(u+1,{unit:"month"});case"LLL":return o.month(u,{width:"abbreviated",context:"standalone"});case"LLLLL":return o.month(u,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(u,{width:"wide",context:"standalone"})}},w:function(n,r,o,u){const f=nC(n,u);return r==="wo"?o.ordinalNumber(f,{unit:"week"}):Xn(f,r.length)},I:function(n,r,o){const u=VP(n);return r==="Io"?o.ordinalNumber(u,{unit:"week"}):Xn(u,r.length)},d:function(n,r,o){return r==="do"?o.ordinalNumber(n.getDate(),{unit:"date"}):Wc.d(n,r)},D:function(n,r,o){const u=WP(n);return r==="Do"?o.ordinalNumber(u,{unit:"dayOfYear"}):Xn(u,r.length)},E:function(n,r,o){const u=n.getDay();switch(r){case"E":case"EE":case"EEE":return o.day(u,{width:"abbreviated",context:"formatting"});case"EEEEE":return o.day(u,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(u,{width:"short",context:"formatting"});case"EEEE":default:return o.day(u,{width:"wide",context:"formatting"})}},e:function(n,r,o,u){const f=n.getDay(),g=(f-u.weekStartsOn+8)%7||7;switch(r){case"e":return String(g);case"ee":return Xn(g,2);case"eo":return o.ordinalNumber(g,{unit:"day"});case"eee":return o.day(f,{width:"abbreviated",context:"formatting"});case"eeeee":return o.day(f,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(f,{width:"short",context:"formatting"});case"eeee":default:return o.day(f,{width:"wide",context:"formatting"})}},c:function(n,r,o,u){const f=n.getDay(),g=(f-u.weekStartsOn+8)%7||7;switch(r){case"c":return String(g);case"cc":return Xn(g,r.length);case"co":return o.ordinalNumber(g,{unit:"day"});case"ccc":return o.day(f,{width:"abbreviated",context:"standalone"});case"ccccc":return o.day(f,{width:"narrow",context:"standalone"});case"cccccc":return o.day(f,{width:"short",context:"standalone"});case"cccc":default:return o.day(f,{width:"wide",context:"standalone"})}},i:function(n,r,o){const u=n.getDay(),f=u===0?7:u;switch(r){case"i":return String(f);case"ii":return Xn(f,r.length);case"io":return o.ordinalNumber(f,{unit:"day"});case"iii":return o.day(u,{width:"abbreviated",context:"formatting"});case"iiiii":return o.day(u,{width:"narrow",context:"formatting"});case"iiiiii":return o.day(u,{width:"short",context:"formatting"});case"iiii":default:return o.day(u,{width:"wide",context:"formatting"})}},a:function(n,r,o){const u=n.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return o.dayPeriod(u,{width:"abbreviated",context:"formatting"});case"aaa":return o.dayPeriod(u,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return o.dayPeriod(u,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(u,{width:"wide",context:"formatting"})}},b:function(n,r,o){const u=n.getHours();let f;switch(u===12?f=rh.noon:u===0?f=rh.midnight:f=u/12>=1?"pm":"am",r){case"b":case"bb":return o.dayPeriod(f,{width:"abbreviated",context:"formatting"});case"bbb":return o.dayPeriod(f,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return o.dayPeriod(f,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(f,{width:"wide",context:"formatting"})}},B:function(n,r,o){const u=n.getHours();let f;switch(u>=17?f=rh.evening:u>=12?f=rh.afternoon:u>=4?f=rh.morning:f=rh.night,r){case"B":case"BB":case"BBB":return o.dayPeriod(f,{width:"abbreviated",context:"formatting"});case"BBBBB":return o.dayPeriod(f,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(f,{width:"wide",context:"formatting"})}},h:function(n,r,o){if(r==="ho"){let u=n.getHours()%12;return u===0&&(u=12),o.ordinalNumber(u,{unit:"hour"})}return Wc.h(n,r)},H:function(n,r,o){return r==="Ho"?o.ordinalNumber(n.getHours(),{unit:"hour"}):Wc.H(n,r)},K:function(n,r,o){const u=n.getHours()%12;return r==="Ko"?o.ordinalNumber(u,{unit:"hour"}):Xn(u,r.length)},k:function(n,r,o){let u=n.getHours();return u===0&&(u=24),r==="ko"?o.ordinalNumber(u,{unit:"hour"}):Xn(u,r.length)},m:function(n,r,o){return r==="mo"?o.ordinalNumber(n.getMinutes(),{unit:"minute"}):Wc.m(n,r)},s:function(n,r,o){return r==="so"?o.ordinalNumber(n.getSeconds(),{unit:"second"}):Wc.s(n,r)},S:function(n,r){return Wc.S(n,r)},X:function(n,r,o){const u=n.getTimezoneOffset();if(u===0)return"Z";switch(r){case"X":return iC(u);case"XXXX":case"XX":return Cp(u);case"XXXXX":case"XXX":default:return Cp(u,":")}},x:function(n,r,o){const u=n.getTimezoneOffset();switch(r){case"x":return iC(u);case"xxxx":case"xx":return Cp(u);case"xxxxx":case"xxx":default:return Cp(u,":")}},O:function(n,r,o){const u=n.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+aC(u,":");case"OOOO":default:return"GMT"+Cp(u,":")}},z:function(n,r,o){const u=n.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+aC(u,":");case"zzzz":default:return"GMT"+Cp(u,":")}},t:function(n,r,o){const u=Math.trunc(+n/1e3);return Xn(u,r.length)},T:function(n,r,o){return Xn(+n,r.length)}};function aC(n,r=""){const o=n>0?"-":"+",u=Math.abs(n),f=Math.trunc(u/60),g=u%60;return g===0?o+String(f):o+String(f)+r+Xn(g,2)}function iC(n,r){return n%60===0?(n>0?"-":"+")+Xn(Math.abs(n)/60,2):Cp(n,r)}function Cp(n,r=""){const o=n>0?"-":"+",u=Math.abs(n),f=Xn(Math.trunc(u/60),2),g=Xn(u%60,2);return o+f+r+g}const oC=(n,r)=>{switch(n){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},sC=(n,r)=>{switch(n){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},GP=(n,r)=>{const o=n.match(/(P+)(p+)?/)||[],u=o[1],f=o[2];if(!f)return oC(n,r);let g;switch(u){case"P":g=r.dateTime({width:"short"});break;case"PP":g=r.dateTime({width:"medium"});break;case"PPP":g=r.dateTime({width:"long"});break;case"PPPP":default:g=r.dateTime({width:"full"});break}return g.replace("{{date}}",oC(u,r)).replace("{{time}}",sC(f,r))},QP={p:sC,P:GP},KP=/^D+$/,ZP=/^Y+$/,XP=["D","DD","YY","YYYY"];function JP(n){return KP.test(n)}function eN(n){return ZP.test(n)}function tN(n,r,o){const u=nN(n,r,o);if(console.warn(u),XP.includes(n))throw new RangeError(u)}function nN(n,r,o){const u=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${r}\`) for formatting ${u} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const rN=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,aN=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,iN=/^'([^]*?)'?$/,oN=/''/g,sN=/[a-zA-Z]/;function lN(n,r,o){var u,f,g,v;const C=Py(),E=C.locale??qP,_=C.firstWeekContainsDate??((f=(u=C.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,$=C.weekStartsOn??((v=(g=C.locale)==null?void 0:g.options)==null?void 0:v.weekStartsOn)??0,N=mo(n,void 0);if(!uP(N))throw new RangeError("Invalid time value");let R=r.match(aN).map(M=>{const V=M[0];if(V==="p"||V==="P"){const H=QP[V];return H(M,E.formatLong)}return M}).join("").match(rN).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const V=M[0];if(V==="'")return{isToken:!1,value:uN(M)};if(rC[V])return{isToken:!0,value:M};if(V.match(sN))throw new RangeError("Format string contains an unescaped latin alphabet character `"+V+"`");return{isToken:!1,value:M}});E.localize.preprocessor&&(R=E.localize.preprocessor(N,R));const B={firstWeekContainsDate:_,weekStartsOn:$,locale:E};return R.map(M=>{if(!M.isToken)return M.value;const V=M.value;(eN(V)||JP(V))&&tN(V,r,String(n));const H=rC[V[0]];return H(N,V,E.localize,B)}).join("")}function uN(n){const r=n.match(iN);return r?r[1].replace(oN,"'"):n}function cN(n,r){const o=mo(n,void 0).getDay();return o===0?7:o}const lC={},mg={};function gg(n,r){try{const o=(lC[n]||(lC[n]=new Intl.DateTimeFormat("en-GB",{timeZone:n,hour:"numeric",timeZoneName:"longOffset"}).format))(r).split("GMT")[1]||"";return o in mg?mg[o]:uC(o,o.split(":"))}catch{if(n in mg)return mg[n];const o=n==null?void 0:n.match(dN);return o?uC(n,o.slice(1)):NaN}}const dN=/([+-]\d\d):?(\d\d)?/;function uC(n,r){const o=+r[0],u=+(r[1]||0);return mg[n]=o>0?o*60+u:o*60-u}let vg=class vy extends Date{constructor(...r){super(),r.length>1&&typeof r[r.length-1]=="string"&&(this.timeZone=r.pop()),this.internal=new Date,isNaN(gg(this.timeZone,this))?this.setTime(NaN):r.length?typeof r[0]=="number"&&(r.length===1||r.length===2&&typeof r[1]!="number")?this.setTime(r[0]):typeof r[0]=="string"?this.setTime(+new Date(r[0])):r[0]instanceof Date?this.setTime(+r[0]):(this.setTime(+new Date(...r)),dC(this),Nk(this)):this.setTime(Date.now())}static tz(r,...o){return o.length?new vy(...o,r):new vy(Date.now(),r)}withTimeZone(r){return new vy(+this,r)}getTimezoneOffset(){return-gg(this.timeZone,this)}setTime(r){return Date.prototype.setTime.apply(this,arguments),Nk(this),+this}[Symbol.for("constructDateFrom")](r){return new vy(+new Date(r),this.timeZone)}};const cC=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(n=>{if(!cC.test(n))return;const r=n.replace(cC,"$1UTC");vg.prototype[r]&&(n.startsWith("get")?vg.prototype[n]=function(){return this.internal[r]()}:(vg.prototype[n]=function(){return Date.prototype[r].apply(this.internal,arguments),pN(this),+this},vg.prototype[r]=function(){return Date.prototype[r].apply(this,arguments),Nk(this),+this}))});function Nk(n){n.internal.setTime(+n),n.internal.setUTCMinutes(n.internal.getUTCMinutes()-n.getTimezoneOffset())}function pN(n){Date.prototype.setFullYear.call(n,n.internal.getUTCFullYear(),n.internal.getUTCMonth(),n.internal.getUTCDate()),Date.prototype.setHours.call(n,n.internal.getUTCHours(),n.internal.getUTCMinutes(),n.internal.getUTCSeconds(),n.internal.getUTCMilliseconds()),dC(n)}function dC(n){const r=gg(n.timeZone,n),o=new Date(+n);o.setUTCHours(o.getUTCHours()-1);const u=-new Date(+n).getTimezoneOffset(),f=-new Date(+o).getTimezoneOffset(),g=u-f,v=Date.prototype.getHours.apply(n)!==n.internal.getUTCHours();g&&v&&n.internal.setUTCMinutes(n.internal.getUTCMinutes()+g);const C=u-r;C&&Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+C);const E=gg(n.timeZone,n),_=-new Date(+n).getTimezoneOffset()-E,$=E!==r,N=_-C;if($&&N){Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+N);const R=gg(n.timeZone,n),B=E-R;B&&(n.internal.setUTCMinutes(n.internal.getUTCMinutes()+B),Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+B))}}let Ry=class yy extends vg{static tz(r,...o){return o.length?new yy(...o,r):new yy(Date.now(),r)}toISOString(){const[r,o,u]=this.tzComponents(),f=`${r}${o}:${u}`;return this.internal.toISOString().slice(0,-1)+f}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[r,o,u,f]=this.internal.toUTCString().split(" ");return`${r==null?void 0:r.slice(0,-1)} ${u} ${o} ${f}`}toTimeString(){const r=this.internal.toUTCString().split(" ")[4],[o,u,f]=this.tzComponents();return`${r} GMT${o}${u}${f} (${fN(this.timeZone,this)})`}toLocaleString(r,o){return Date.prototype.toLocaleString.call(this,r,{...o,timeZone:(o==null?void 0:o.timeZone)||this.timeZone})}toLocaleDateString(r,o){return Date.prototype.toLocaleDateString.call(this,r,{...o,timeZone:(o==null?void 0:o.timeZone)||this.timeZone})}toLocaleTimeString(r,o){return Date.prototype.toLocaleTimeString.call(this,r,{...o,timeZone:(o==null?void 0:o.timeZone)||this.timeZone})}tzComponents(){const r=this.getTimezoneOffset(),o=r>0?"-":"+",u=String(Math.floor(Math.abs(r)/60)).padStart(2,"0"),f=String(Math.abs(r)%60).padStart(2,"0");return[o,u,f]}withTimeZone(r){return new yy(+this,r)}[Symbol.for("constructDateFrom")](r){return new yy(+new Date(r),this.timeZone)}};function fN(n,r){return new Intl.DateTimeFormat("en-GB",{timeZone:n,timeZoneName:"long"}).format(r).slice(12)}window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const La=n=>n.toISOString().split("T")[0],Rk=n=>{if(!n)return null;const r=dg(new Ry(n,window.pktTz),12);return isNaN(r.getTime())?null:r},pC=(n,r)=>{const o=aa(n);return isNaN(o.getTime())?"":lN(o,r)},aa=(n="")=>dg(n===""||!n?new Ry(new Date,window.pktTz):new Ry(n,window.pktTz),12),Vc=(n,r,o=1)=>dg(new Ry(n,r,o,window.pktTz),12),hN=n=>new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(n),fC=n=>{if(Array.isArray(n))return n;if(typeof n=="string")return n.split(",")},mN=n=>n?new Date(n):null,gN=n=>{if(typeof n=="string")return n.split(",").map(r=>new Date(r));if(Array.isArray(n))return n.map(r=>new Date(r))},ah={csvToArray:fC,stringToDate:mN,stringsToDate:gN},vN="pkt-calendar",yN={id:{type:"string",name:"ID",description:"Unique identifier for the calendar"},currentmonth:{type:"date",converter:"stringToDate",description:"The current month to display"},selected:{type:"array",converter:"csvToArray",reflect:!0,items:{type:"date"},description:"Array of selected dates"},excludeweekdays:{type:"array",converter:"csvToArray",items:{type:"string"},description:"Array of weekdays (1-7) to exclude"},excludedates:{type:"array",converter:"stringsToDate",items:{type:"date"},description:"Array of specific dates to exclude"},earliest:{type:"date",converter:"stringToDate",default:null,description:"Earliest selectable date"},latest:{type:"date",converter:"stringToDate",default:null,description:"Latest selectable date"},weeknumbers:{type:"boolean",reflect:!0,default:!1,description:"Show week numbers in calendar"},withcontrols:{type:"boolean",reflect:!0,default:!1,description:"Show month and year navigation controls"},multiple:{type:"boolean",reflect:!0,default:!1,description:"Allow multiple date selection"},maxMultiple:{type:"number",default:4,description:"Maximum number of dates that can be selected"},range:{type:"boolean",reflect:!0,default:!1,description:"Allow date range selection"}},bN={"date-selected":{description:"Returns ISO formatted date string"}},xp={name:vN,"css-class":"pkt-calendar",props:yN,events:bN};var kN=Object.defineProperty,wN=Object.getOwnPropertyDescriptor,nr=(n,r,o,u)=>{for(var f=u>1?void 0:u?wN(r,o):r,g=n.length-1,v;g>=0;g--)(v=n[g])&&(f=(u?v(r,o,f):v(f))||f);return u&&f&&kN(r,o,f),f};let Jn=class extends Oa{constructor(){super(...arguments),this.multiple=xp.props.multiple.default,this.maxMultiple=xp.props.maxMultiple.default,this.range=xp.props.range.default,this.weeknumbers=xp.props.weeknumbers.default,this.withcontrols=xp.props.withcontrols.default,this.selected=[],this.earliest=xp.props.earliest.default,this.latest=xp.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.year=0,this.month=0,this.week=0,this.rangeHovered=null,this.inRange={},this.focusedDate=null,this.selectableDates=[],this.currentmonthtouched=!1,this.tabIndexSet=0}connectedCallback(){super.connectedCallback()}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}attributeChangedCallback(r,o,u){r==="selected"&&u&&this.convertSelected(),super.attributeChangedCallback(r,o,u)}updated(r){super.updated(r),r.has("selected")&&this.convertSelected()}firstUpdated(r){this.addEventListener("keydown",this.handleKeydown)}convertSelected(){if(typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=this.selected.map(r=>aa(r)),this.range&&this.selected.length===2){const r=$k({start:aa(this.selected[0]),end:aa(this.selected[1])});if(this.inRange={},Array.isArray(r)&&r.length){const o={};for(let u=0;u<r.length;u++)o[La(r[u])]=this.isInRange(r[u]);this.inRange=o}}this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched){this.currentmonthtouched=!0;return}this.selected.length&&this.selected[0]!==""?this.currentmonth=aa(this.selected[this.selected.length-1]):this.currentmonth===null&&(this.currentmonth=aa()),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(r){switch(r.key){case"ArrowLeft":this.handleArrowKey(r,-1);break;case"ArrowRight":this.handleArrowKey(r,1);break;case"ArrowUp":this.handleArrowKey(r,-7);break;case"ArrowDown":this.handleArrowKey(r,7);break}}handleArrowKey(r,o){var u,f,g;if(((u=r.target)==null?void 0:u.nodeName)==="INPUT"||((f=r.target)==null?void 0:f.nodeName)==="SELECT"||((g=r.target)==null?void 0:g.nodeName)==="BUTTON")return;r.preventDefault(),this.focusedDate||this.focusOnCurrentDate();const v=this.focusedDate?aa(this.focusedDate):Vc(this.year,this.month,1);let C=Fk(v,o);if(C){let E=this.querySelector(`div[data-date="${La(C)}"]`);if(E instanceof HTMLDivElement){if(E.dataset.disabled){C=Fk(C,o);let _=this.querySelector(`div[data-date="${La(C)}"]`);for(;_&&_ instanceof HTMLDivElement&&_.dataset.disabled;)C=Fk(C,o),_=this.querySelector(`div[data-date="${La(C)}"]`);E=_}E instanceof HTMLDivElement&&!E.dataset.disabled&&(this.focusedDate=La(C),E.focus())}}}render(){return qe`
375
+ `}updateElementClasses(){const r=new Set,o=this.getAttribute("class");r.add("pkt-btn"),o&&o.split(" ").forEach(u=>r.add(u)),this.size&&r.add(`pkt-btn--${this.size}`),this.skin&&r.add(`pkt-btn--${this.skin}`),this.variant&&r.add(`pkt-btn--${this.variant}`),this.color&&r.add(`pkt-btn--${this.color}`),this.isLoading&&r.add("pkt-btn--active"),this.state&&r.add(`pkt-btn--${this.state}`),this.disabled&&r.add("pkt-btn--disabled"),this.className=[...r].join(" ")}handleClick(r){if(this.disabled||this.isLoading){r.preventDefault(),r.stopImmediatePropagation();return}if(this.type==="submit"&&this.internals.form){this.internals.form.requestSubmit();return}if(this.type==="reset"&&this.internals.form){this.internals.form.reset();return}this.onClick&&typeof this.onClick=="function"&&this.onClick!==this.handleClick&&this.onClick(r),this.dispatchEvent(new CustomEvent("button-click",{bubbles:!0,composed:!0,detail:{originalEvent:r}}))}handleKeydown(r){if(!(this.disabled||this.isLoading)&&(r.key==="Enter"||r.key===" ")){r.preventDefault();const o=r.target;o&&o.click()}}};Vi.formAssociated=!0,ss([Z({type:String})],Vi.prototype,"iconName",2),ss([Z({type:String})],Vi.prototype,"secondIconName",2),ss([Z({type:String})],Vi.prototype,"mode",2),ss([Z({type:String})],Vi.prototype,"size",2),ss([Z({type:String})],Vi.prototype,"color",2),ss([Z({type:String})],Vi.prototype,"skin",2),ss([Z({type:String})],Vi.prototype,"variant",2),ss([Z({type:String,reflect:!0})],Vi.prototype,"state",2),ss([Z({type:String,reflect:!0})],Vi.prototype,"type",2),ss([Z({type:Boolean,reflect:!0})],Vi.prototype,"isLoading",2),ss([Z({type:Boolean,reflect:!0})],Vi.prototype,"disabled",2),Vi=ss([Kr("pkt-button")],Vi);const QS=6048e5,nP=864e5,rP=36e5,KS=Symbol.for("constructDateFrom");function Ys(n,r){return typeof n=="function"?n(r):n&&typeof n=="object"&&KS in n?n[KS](r):n instanceof Date?new n.constructor(r):new Date(r)}function mo(n,r){return Ys(r||n,n)}function Fk(n,r,o){const u=mo(n,void 0);return isNaN(r)?Ys(n,NaN):(r&&u.setDate(u.getDate()+r),u)}function aP(n,r,o){return Ys(n,+mo(n)+r)}function dg(n,r,o){return aP(n,r*rP)}let iP={};function Py(){return iP}function pg(n,r){var o,u,f,g;const v=Py(),C=(r==null?void 0:r.weekStartsOn)??((u=(o=r==null?void 0:r.locale)==null?void 0:o.options)==null?void 0:u.weekStartsOn)??v.weekStartsOn??((g=(f=v.locale)==null?void 0:f.options)==null?void 0:g.weekStartsOn)??0,E=mo(n,r==null?void 0:r.in),_=E.getDay(),$=(_<C?7:0)+_-C;return E.setDate(E.getDate()-$),E.setHours(0,0,0,0),E}function Ny(n,r){return pg(n,{...r,weekStartsOn:1})}function ZS(n,r){const o=mo(n,void 0),u=o.getFullYear(),f=Ys(o,0);f.setFullYear(u+1,0,4),f.setHours(0,0,0,0);const g=Ny(f),v=Ys(o,0);v.setFullYear(u,0,4),v.setHours(0,0,0,0);const C=Ny(v);return o.getTime()>=g.getTime()?u+1:o.getTime()>=C.getTime()?u:u-1}function XS(n){const r=mo(n),o=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return o.setUTCFullYear(r.getFullYear()),+n-+o}function JS(n,...r){const o=Ys.bind(null,r.find(u=>typeof u=="object"));return r.map(o)}function eC(n,r){const o=mo(n,void 0);return o.setHours(0,0,0,0),o}function oP(n,r,o){const[u,f]=JS(void 0,n,r),g=eC(u),v=eC(f),C=+g-XS(g),E=+v-XS(v);return Math.round((C-E)/nP)}function sP(n,r){const o=ZS(n),u=Ys(n,0);return u.setFullYear(o,0,4),u.setHours(0,0,0,0),Ny(u)}function lP(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function uP(n){return!(!lP(n)&&typeof n!="number"||isNaN(+mo(n)))}function cP(n,r){const[o,u]=JS(n,r.start,r.end);return{start:o,end:u}}function $k(n,r){const{start:o,end:u}=cP(void 0,n);let f=+o>+u;const g=f?+o:+u,v=f?u:o;v.setHours(0,0,0,0);let C=1;const E=[];for(;+v<=g;)E.push(Ys(o,v)),v.setDate(v.getDate()+C),v.setHours(0,0,0,0);return f?E.reverse():E}function dP(n,r){const o=mo(n,void 0);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}const pP={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"}},fP=(n,r,o)=>{let u;const f=pP[n];return typeof f=="string"?u=f:r===1?u=f.one:u=f.other.replace("{{count}}",r.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"in "+u:u+" ago":u};function Pk(n){return(r={})=>{const o=r.width?String(r.width):n.defaultWidth;return n.formats[o]||n.formats[n.defaultWidth]}}const hP={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},mP={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},gP={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},vP={date:Pk({formats:hP,defaultWidth:"full"}),time:Pk({formats:mP,defaultWidth:"full"}),dateTime:Pk({formats:gP,defaultWidth:"full"})},yP={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},bP=(n,r,o,u)=>yP[n];function fg(n){return(r,o)=>{const u=o!=null&&o.context?String(o.context):"standalone";let f;if(u==="formatting"&&n.formattingValues){const v=n.defaultFormattingWidth||n.defaultWidth,C=o!=null&&o.width?String(o.width):v;f=n.formattingValues[C]||n.formattingValues[v]}else{const v=n.defaultWidth,C=o!=null&&o.width?String(o.width):n.defaultWidth;f=n.values[C]||n.values[v]}const g=n.argumentCallback?n.argumentCallback(r):r;return f[g]}}const kP={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},wP={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},DP={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"]},SP={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"]},CP={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"}},xP={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"}},EP=(n,r)=>{const o=Number(n),u=o%100;if(u>20||u<10)switch(u%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},_P={ordinalNumber:EP,era:fg({values:kP,defaultWidth:"wide"}),quarter:fg({values:wP,defaultWidth:"wide",argumentCallback:n=>n-1}),month:fg({values:DP,defaultWidth:"wide"}),day:fg({values:SP,defaultWidth:"wide"}),dayPeriod:fg({values:CP,defaultWidth:"wide",formattingValues:xP,defaultFormattingWidth:"wide"})};function hg(n){return(r,o={})=>{const u=o.width,f=u&&n.matchPatterns[u]||n.matchPatterns[n.defaultMatchWidth],g=r.match(f);if(!g)return null;const v=g[0],C=u&&n.parsePatterns[u]||n.parsePatterns[n.defaultParseWidth],E=Array.isArray(C)?AP(C,N=>N.test(v)):TP(C,N=>N.test(v));let _;_=n.valueCallback?n.valueCallback(E):E,_=o.valueCallback?o.valueCallback(_):_;const $=r.slice(v.length);return{value:_,rest:$}}}function TP(n,r){for(const o in n)if(Object.prototype.hasOwnProperty.call(n,o)&&r(n[o]))return o}function AP(n,r){for(let o=0;o<n.length;o++)if(r(n[o]))return o}function FP(n){return(r,o={})=>{const u=r.match(n.matchPattern);if(!u)return null;const f=u[0],g=r.match(n.parsePattern);if(!g)return null;let v=n.valueCallback?n.valueCallback(g[0]):g[0];v=o.valueCallback?o.valueCallback(v):v;const C=r.slice(f.length);return{value:v,rest:C}}}const $P=/^(\d+)(th|st|nd|rd)?/i,PP=/\d+/i,NP={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},RP={any:[/^b/i,/^(a|c)/i]},OP={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},LP={any:[/1/i,/2/i,/3/i,/4/i]},BP={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},jP={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]},IP={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},MP={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]},zP={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},UP={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}},HP={ordinalNumber:FP({matchPattern:$P,parsePattern:PP,valueCallback:n=>parseInt(n,10)}),era:hg({matchPatterns:NP,defaultMatchWidth:"wide",parsePatterns:RP,defaultParseWidth:"any"}),quarter:hg({matchPatterns:OP,defaultMatchWidth:"wide",parsePatterns:LP,defaultParseWidth:"any",valueCallback:n=>n+1}),month:hg({matchPatterns:BP,defaultMatchWidth:"wide",parsePatterns:jP,defaultParseWidth:"any"}),day:hg({matchPatterns:IP,defaultMatchWidth:"wide",parsePatterns:MP,defaultParseWidth:"any"}),dayPeriod:hg({matchPatterns:zP,defaultMatchWidth:"any",parsePatterns:UP,defaultParseWidth:"any"})},qP={code:"en-US",formatDistance:fP,formatLong:vP,formatRelative:bP,localize:_P,match:HP,options:{weekStartsOn:0,firstWeekContainsDate:1}};function WP(n,r){const o=mo(n,void 0);return oP(o,dP(o))+1}function VP(n,r){const o=mo(n,void 0),u=+Ny(o)-+sP(o);return Math.round(u/QS)+1}function tC(n,r){var o,u,f,g;const v=mo(n,r==null?void 0:r.in),C=v.getFullYear(),E=Py(),_=(r==null?void 0:r.firstWeekContainsDate)??((u=(o=r==null?void 0:r.locale)==null?void 0:o.options)==null?void 0:u.firstWeekContainsDate)??E.firstWeekContainsDate??((g=(f=E.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,$=Ys((r==null?void 0:r.in)||n,0);$.setFullYear(C+1,0,_),$.setHours(0,0,0,0);const N=pg($,r),R=Ys((r==null?void 0:r.in)||n,0);R.setFullYear(C,0,_),R.setHours(0,0,0,0);const B=pg(R,r);return+v>=+N?C+1:+v>=+B?C:C-1}function YP(n,r){var o,u,f,g;const v=Py(),C=(r==null?void 0:r.firstWeekContainsDate)??((u=(o=r==null?void 0:r.locale)==null?void 0:o.options)==null?void 0:u.firstWeekContainsDate)??v.firstWeekContainsDate??((g=(f=v.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,E=tC(n,r),_=Ys((r==null?void 0:r.in)||n,0);return _.setFullYear(E,0,C),_.setHours(0,0,0,0),pg(_,r)}function nC(n,r){const o=mo(n,r==null?void 0:r.in),u=+pg(o,r)-+YP(o,r);return Math.round(u/QS)+1}function Xn(n,r){const o=n<0?"-":"",u=Math.abs(n).toString().padStart(r,"0");return o+u}const Wc={y(n,r){const o=n.getFullYear(),u=o>0?o:1-o;return Xn(r==="yy"?u%100:u,r.length)},M(n,r){const o=n.getMonth();return r==="M"?String(o+1):Xn(o+1,2)},d(n,r){return Xn(n.getDate(),r.length)},a(n,r){const o=n.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return o.toUpperCase();case"aaa":return o;case"aaaaa":return o[0];case"aaaa":default:return o==="am"?"a.m.":"p.m."}},h(n,r){return Xn(n.getHours()%12||12,r.length)},H(n,r){return Xn(n.getHours(),r.length)},m(n,r){return Xn(n.getMinutes(),r.length)},s(n,r){return Xn(n.getSeconds(),r.length)},S(n,r){const o=r.length,u=n.getMilliseconds(),f=Math.trunc(u*Math.pow(10,o-3));return Xn(f,r.length)}},rh={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},rC={G:function(n,r,o){const u=n.getFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return o.era(u,{width:"abbreviated"});case"GGGGG":return o.era(u,{width:"narrow"});case"GGGG":default:return o.era(u,{width:"wide"})}},y:function(n,r,o){if(r==="yo"){const u=n.getFullYear(),f=u>0?u:1-u;return o.ordinalNumber(f,{unit:"year"})}return Wc.y(n,r)},Y:function(n,r,o,u){const f=tC(n,u),g=f>0?f:1-f;if(r==="YY"){const v=g%100;return Xn(v,2)}return r==="Yo"?o.ordinalNumber(g,{unit:"year"}):Xn(g,r.length)},R:function(n,r){const o=ZS(n);return Xn(o,r.length)},u:function(n,r){const o=n.getFullYear();return Xn(o,r.length)},Q:function(n,r,o){const u=Math.ceil((n.getMonth()+1)/3);switch(r){case"Q":return String(u);case"QQ":return Xn(u,2);case"Qo":return o.ordinalNumber(u,{unit:"quarter"});case"QQQ":return o.quarter(u,{width:"abbreviated",context:"formatting"});case"QQQQQ":return o.quarter(u,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(u,{width:"wide",context:"formatting"})}},q:function(n,r,o){const u=Math.ceil((n.getMonth()+1)/3);switch(r){case"q":return String(u);case"qq":return Xn(u,2);case"qo":return o.ordinalNumber(u,{unit:"quarter"});case"qqq":return o.quarter(u,{width:"abbreviated",context:"standalone"});case"qqqqq":return o.quarter(u,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(u,{width:"wide",context:"standalone"})}},M:function(n,r,o){const u=n.getMonth();switch(r){case"M":case"MM":return Wc.M(n,r);case"Mo":return o.ordinalNumber(u+1,{unit:"month"});case"MMM":return o.month(u,{width:"abbreviated",context:"formatting"});case"MMMMM":return o.month(u,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(u,{width:"wide",context:"formatting"})}},L:function(n,r,o){const u=n.getMonth();switch(r){case"L":return String(u+1);case"LL":return Xn(u+1,2);case"Lo":return o.ordinalNumber(u+1,{unit:"month"});case"LLL":return o.month(u,{width:"abbreviated",context:"standalone"});case"LLLLL":return o.month(u,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(u,{width:"wide",context:"standalone"})}},w:function(n,r,o,u){const f=nC(n,u);return r==="wo"?o.ordinalNumber(f,{unit:"week"}):Xn(f,r.length)},I:function(n,r,o){const u=VP(n);return r==="Io"?o.ordinalNumber(u,{unit:"week"}):Xn(u,r.length)},d:function(n,r,o){return r==="do"?o.ordinalNumber(n.getDate(),{unit:"date"}):Wc.d(n,r)},D:function(n,r,o){const u=WP(n);return r==="Do"?o.ordinalNumber(u,{unit:"dayOfYear"}):Xn(u,r.length)},E:function(n,r,o){const u=n.getDay();switch(r){case"E":case"EE":case"EEE":return o.day(u,{width:"abbreviated",context:"formatting"});case"EEEEE":return o.day(u,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(u,{width:"short",context:"formatting"});case"EEEE":default:return o.day(u,{width:"wide",context:"formatting"})}},e:function(n,r,o,u){const f=n.getDay(),g=(f-u.weekStartsOn+8)%7||7;switch(r){case"e":return String(g);case"ee":return Xn(g,2);case"eo":return o.ordinalNumber(g,{unit:"day"});case"eee":return o.day(f,{width:"abbreviated",context:"formatting"});case"eeeee":return o.day(f,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(f,{width:"short",context:"formatting"});case"eeee":default:return o.day(f,{width:"wide",context:"formatting"})}},c:function(n,r,o,u){const f=n.getDay(),g=(f-u.weekStartsOn+8)%7||7;switch(r){case"c":return String(g);case"cc":return Xn(g,r.length);case"co":return o.ordinalNumber(g,{unit:"day"});case"ccc":return o.day(f,{width:"abbreviated",context:"standalone"});case"ccccc":return o.day(f,{width:"narrow",context:"standalone"});case"cccccc":return o.day(f,{width:"short",context:"standalone"});case"cccc":default:return o.day(f,{width:"wide",context:"standalone"})}},i:function(n,r,o){const u=n.getDay(),f=u===0?7:u;switch(r){case"i":return String(f);case"ii":return Xn(f,r.length);case"io":return o.ordinalNumber(f,{unit:"day"});case"iii":return o.day(u,{width:"abbreviated",context:"formatting"});case"iiiii":return o.day(u,{width:"narrow",context:"formatting"});case"iiiiii":return o.day(u,{width:"short",context:"formatting"});case"iiii":default:return o.day(u,{width:"wide",context:"formatting"})}},a:function(n,r,o){const u=n.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return o.dayPeriod(u,{width:"abbreviated",context:"formatting"});case"aaa":return o.dayPeriod(u,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return o.dayPeriod(u,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(u,{width:"wide",context:"formatting"})}},b:function(n,r,o){const u=n.getHours();let f;switch(u===12?f=rh.noon:u===0?f=rh.midnight:f=u/12>=1?"pm":"am",r){case"b":case"bb":return o.dayPeriod(f,{width:"abbreviated",context:"formatting"});case"bbb":return o.dayPeriod(f,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return o.dayPeriod(f,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(f,{width:"wide",context:"formatting"})}},B:function(n,r,o){const u=n.getHours();let f;switch(u>=17?f=rh.evening:u>=12?f=rh.afternoon:u>=4?f=rh.morning:f=rh.night,r){case"B":case"BB":case"BBB":return o.dayPeriod(f,{width:"abbreviated",context:"formatting"});case"BBBBB":return o.dayPeriod(f,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(f,{width:"wide",context:"formatting"})}},h:function(n,r,o){if(r==="ho"){let u=n.getHours()%12;return u===0&&(u=12),o.ordinalNumber(u,{unit:"hour"})}return Wc.h(n,r)},H:function(n,r,o){return r==="Ho"?o.ordinalNumber(n.getHours(),{unit:"hour"}):Wc.H(n,r)},K:function(n,r,o){const u=n.getHours()%12;return r==="Ko"?o.ordinalNumber(u,{unit:"hour"}):Xn(u,r.length)},k:function(n,r,o){let u=n.getHours();return u===0&&(u=24),r==="ko"?o.ordinalNumber(u,{unit:"hour"}):Xn(u,r.length)},m:function(n,r,o){return r==="mo"?o.ordinalNumber(n.getMinutes(),{unit:"minute"}):Wc.m(n,r)},s:function(n,r,o){return r==="so"?o.ordinalNumber(n.getSeconds(),{unit:"second"}):Wc.s(n,r)},S:function(n,r){return Wc.S(n,r)},X:function(n,r,o){const u=n.getTimezoneOffset();if(u===0)return"Z";switch(r){case"X":return iC(u);case"XXXX":case"XX":return Cp(u);case"XXXXX":case"XXX":default:return Cp(u,":")}},x:function(n,r,o){const u=n.getTimezoneOffset();switch(r){case"x":return iC(u);case"xxxx":case"xx":return Cp(u);case"xxxxx":case"xxx":default:return Cp(u,":")}},O:function(n,r,o){const u=n.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+aC(u,":");case"OOOO":default:return"GMT"+Cp(u,":")}},z:function(n,r,o){const u=n.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+aC(u,":");case"zzzz":default:return"GMT"+Cp(u,":")}},t:function(n,r,o){const u=Math.trunc(+n/1e3);return Xn(u,r.length)},T:function(n,r,o){return Xn(+n,r.length)}};function aC(n,r=""){const o=n>0?"-":"+",u=Math.abs(n),f=Math.trunc(u/60),g=u%60;return g===0?o+String(f):o+String(f)+r+Xn(g,2)}function iC(n,r){return n%60===0?(n>0?"-":"+")+Xn(Math.abs(n)/60,2):Cp(n,r)}function Cp(n,r=""){const o=n>0?"-":"+",u=Math.abs(n),f=Xn(Math.trunc(u/60),2),g=Xn(u%60,2);return o+f+r+g}const oC=(n,r)=>{switch(n){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},sC=(n,r)=>{switch(n){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},GP=(n,r)=>{const o=n.match(/(P+)(p+)?/)||[],u=o[1],f=o[2];if(!f)return oC(n,r);let g;switch(u){case"P":g=r.dateTime({width:"short"});break;case"PP":g=r.dateTime({width:"medium"});break;case"PPP":g=r.dateTime({width:"long"});break;case"PPPP":default:g=r.dateTime({width:"full"});break}return g.replace("{{date}}",oC(u,r)).replace("{{time}}",sC(f,r))},QP={p:sC,P:GP},KP=/^D+$/,ZP=/^Y+$/,XP=["D","DD","YY","YYYY"];function JP(n){return KP.test(n)}function eN(n){return ZP.test(n)}function tN(n,r,o){const u=nN(n,r,o);if(console.warn(u),XP.includes(n))throw new RangeError(u)}function nN(n,r,o){const u=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${r}\`) for formatting ${u} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const rN=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,aN=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,iN=/^'([^]*?)'?$/,oN=/''/g,sN=/[a-zA-Z]/;function lN(n,r,o){var u,f,g,v;const C=Py(),E=C.locale??qP,_=C.firstWeekContainsDate??((f=(u=C.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,$=C.weekStartsOn??((v=(g=C.locale)==null?void 0:g.options)==null?void 0:v.weekStartsOn)??0,N=mo(n,void 0);if(!uP(N))throw new RangeError("Invalid time value");let R=r.match(aN).map(M=>{const V=M[0];if(V==="p"||V==="P"){const H=QP[V];return H(M,E.formatLong)}return M}).join("").match(rN).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const V=M[0];if(V==="'")return{isToken:!1,value:uN(M)};if(rC[V])return{isToken:!0,value:M};if(V.match(sN))throw new RangeError("Format string contains an unescaped latin alphabet character `"+V+"`");return{isToken:!1,value:M}});E.localize.preprocessor&&(R=E.localize.preprocessor(N,R));const B={firstWeekContainsDate:_,weekStartsOn:$,locale:E};return R.map(M=>{if(!M.isToken)return M.value;const V=M.value;(eN(V)||JP(V))&&tN(V,r,String(n));const H=rC[V[0]];return H(N,V,E.localize,B)}).join("")}function uN(n){const r=n.match(iN);return r?r[1].replace(oN,"'"):n}function cN(n,r){const o=mo(n,void 0).getDay();return o===0?7:o}const lC={},mg={};function gg(n,r){try{const o=(lC[n]||(lC[n]=new Intl.DateTimeFormat("en-GB",{timeZone:n,hour:"numeric",timeZoneName:"longOffset"}).format))(r).split("GMT")[1]||"";return o in mg?mg[o]:uC(o,o.split(":"))}catch{if(n in mg)return mg[n];const o=n==null?void 0:n.match(dN);return o?uC(n,o.slice(1)):NaN}}const dN=/([+-]\d\d):?(\d\d)?/;function uC(n,r){const o=+r[0],u=+(r[1]||0);return mg[n]=o>0?o*60+u:o*60-u}let vg=class vy extends Date{constructor(...r){super(),r.length>1&&typeof r[r.length-1]=="string"&&(this.timeZone=r.pop()),this.internal=new Date,isNaN(gg(this.timeZone,this))?this.setTime(NaN):r.length?typeof r[0]=="number"&&(r.length===1||r.length===2&&typeof r[1]!="number")?this.setTime(r[0]):typeof r[0]=="string"?this.setTime(+new Date(r[0])):r[0]instanceof Date?this.setTime(+r[0]):(this.setTime(+new Date(...r)),dC(this),Nk(this)):this.setTime(Date.now())}static tz(r,...o){return o.length?new vy(...o,r):new vy(Date.now(),r)}withTimeZone(r){return new vy(+this,r)}getTimezoneOffset(){return-gg(this.timeZone,this)}setTime(r){return Date.prototype.setTime.apply(this,arguments),Nk(this),+this}[Symbol.for("constructDateFrom")](r){return new vy(+new Date(r),this.timeZone)}};const cC=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(n=>{if(!cC.test(n))return;const r=n.replace(cC,"$1UTC");vg.prototype[r]&&(n.startsWith("get")?vg.prototype[n]=function(){return this.internal[r]()}:(vg.prototype[n]=function(){return Date.prototype[r].apply(this.internal,arguments),pN(this),+this},vg.prototype[r]=function(){return Date.prototype[r].apply(this,arguments),Nk(this),+this}))});function Nk(n){n.internal.setTime(+n),n.internal.setUTCMinutes(n.internal.getUTCMinutes()-n.getTimezoneOffset())}function pN(n){Date.prototype.setFullYear.call(n,n.internal.getUTCFullYear(),n.internal.getUTCMonth(),n.internal.getUTCDate()),Date.prototype.setHours.call(n,n.internal.getUTCHours(),n.internal.getUTCMinutes(),n.internal.getUTCSeconds(),n.internal.getUTCMilliseconds()),dC(n)}function dC(n){const r=gg(n.timeZone,n),o=new Date(+n);o.setUTCHours(o.getUTCHours()-1);const u=-new Date(+n).getTimezoneOffset(),f=-new Date(+o).getTimezoneOffset(),g=u-f,v=Date.prototype.getHours.apply(n)!==n.internal.getUTCHours();g&&v&&n.internal.setUTCMinutes(n.internal.getUTCMinutes()+g);const C=u-r;C&&Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+C);const E=gg(n.timeZone,n),_=-new Date(+n).getTimezoneOffset()-E,$=E!==r,N=_-C;if($&&N){Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+N);const R=gg(n.timeZone,n),B=E-R;B&&(n.internal.setUTCMinutes(n.internal.getUTCMinutes()+B),Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+B))}}let Ry=class yy extends vg{static tz(r,...o){return o.length?new yy(...o,r):new yy(Date.now(),r)}toISOString(){const[r,o,u]=this.tzComponents(),f=`${r}${o}:${u}`;return this.internal.toISOString().slice(0,-1)+f}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[r,o,u,f]=this.internal.toUTCString().split(" ");return`${r==null?void 0:r.slice(0,-1)} ${u} ${o} ${f}`}toTimeString(){const r=this.internal.toUTCString().split(" ")[4],[o,u,f]=this.tzComponents();return`${r} GMT${o}${u}${f} (${fN(this.timeZone,this)})`}toLocaleString(r,o){return Date.prototype.toLocaleString.call(this,r,{...o,timeZone:(o==null?void 0:o.timeZone)||this.timeZone})}toLocaleDateString(r,o){return Date.prototype.toLocaleDateString.call(this,r,{...o,timeZone:(o==null?void 0:o.timeZone)||this.timeZone})}toLocaleTimeString(r,o){return Date.prototype.toLocaleTimeString.call(this,r,{...o,timeZone:(o==null?void 0:o.timeZone)||this.timeZone})}tzComponents(){const r=this.getTimezoneOffset(),o=r>0?"-":"+",u=String(Math.floor(Math.abs(r)/60)).padStart(2,"0"),f=String(Math.abs(r)%60).padStart(2,"0");return[o,u,f]}withTimeZone(r){return new yy(+this,r)}[Symbol.for("constructDateFrom")](r){return new yy(+new Date(r),this.timeZone)}};function fN(n,r){return new Intl.DateTimeFormat("en-GB",{timeZone:n,timeZoneName:"long"}).format(r).slice(12)}window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const La=n=>n.toISOString().split("T")[0],Rk=n=>{if(!n)return null;const r=dg(new Ry(n,window.pktTz),12);return isNaN(r.getTime())?null:r},pC=(n,r)=>{const o=aa(n);return isNaN(o.getTime())?"":lN(o,r)},aa=(n="")=>dg(n===""||!n?new Ry(new Date,window.pktTz):new Ry(n,window.pktTz),12),Vc=(n,r,o=1)=>dg(new Ry(n,r,o,window.pktTz),12),hN=n=>new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(n),fC=n=>{if(Array.isArray(n))return n;if(typeof n=="string")return n.split(",")},mN=n=>n?new Date(n):null,gN=n=>{if(typeof n=="string")return n.split(",").map(r=>new Date(r));if(Array.isArray(n))return n.map(r=>new Date(r))},ah={csvToArray:fC,stringToDate:mN,stringsToDate:gN},vN="pkt-calendar",yN={id:{type:"string",name:"ID",description:"Unique identifier for the calendar"},currentmonth:{type:"date",converter:"stringToDate",description:"The current month to display"},selected:{type:"array",converter:"csvToArray",reflect:!0,items:{type:"date"},description:"Array of selected dates"},excludeweekdays:{type:"array",converter:"csvToArray",items:{type:"string"},description:"Array of weekdays (1-7) to exclude"},excludedates:{type:"array",converter:"stringsToDate",items:{type:"date"},description:"Array of specific dates to exclude"},earliest:{type:"date",converter:"stringToDate",default:null,description:"Earliest selectable date"},latest:{type:"date",converter:"stringToDate",default:null,description:"Latest selectable date"},weeknumbers:{type:"boolean",reflect:!0,default:!1,description:"Show week numbers in calendar"},withcontrols:{type:"boolean",reflect:!0,default:!1,description:"Show month and year navigation controls"},multiple:{type:"boolean",reflect:!0,default:!1,description:"Allow multiple date selection"},maxMultiple:{type:"number",default:4,description:"Maximum number of dates that can be selected"},range:{type:"boolean",reflect:!0,default:!1,description:"Allow date range selection"}},bN={"date-selected":{description:"Returns ISO formatted date string"}},xp={name:vN,"css-class":"pkt-calendar",props:yN,events:bN};var kN=Object.defineProperty,wN=Object.getOwnPropertyDescriptor,nr=(n,r,o,u)=>{for(var f=u>1?void 0:u?wN(r,o):r,g=n.length-1,v;g>=0;g--)(v=n[g])&&(f=(u?v(r,o,f):v(f))||f);return u&&f&&kN(r,o,f),f};let Jn=class extends Oa{constructor(){super(...arguments),this.multiple=xp.props.multiple.default,this.maxMultiple=xp.props.maxMultiple.default,this.range=xp.props.range.default,this.weeknumbers=xp.props.weeknumbers.default,this.withcontrols=xp.props.withcontrols.default,this.selected=[],this.earliest=xp.props.earliest.default,this.latest=xp.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.year=0,this.month=0,this.week=0,this.rangeHovered=null,this.inRange={},this.focusedDate=null,this.selectableDates=[],this.currentmonthtouched=!1,this.tabIndexSet=0}connectedCallback(){super.connectedCallback()}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}attributeChangedCallback(r,o,u){r==="selected"&&u&&this.convertSelected(),super.attributeChangedCallback(r,o,u)}updated(r){super.updated(r),r.has("selected")&&this.convertSelected()}firstUpdated(r){this.addEventListener("keydown",this.handleKeydown)}convertSelected(){if(typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=this.selected.map(r=>aa(r)),this.range&&this.selected.length===2){const r=$k({start:aa(this.selected[0]),end:aa(this.selected[1])});if(this.inRange={},Array.isArray(r)&&r.length){const o={};for(let u=0;u<r.length;u++)o[La(r[u])]=this.isInRange(r[u]);this.inRange=o}}this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched){this.currentmonthtouched=!0;return}this.selected.length&&this.selected[0]!==""?this.currentmonth=aa(this.selected[this.selected.length-1]):this.currentmonth===null&&(this.currentmonth=aa()),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(r){switch(r.key){case"ArrowLeft":this.handleArrowKey(r,-1);break;case"ArrowRight":this.handleArrowKey(r,1);break;case"ArrowUp":this.handleArrowKey(r,-7);break;case"ArrowDown":this.handleArrowKey(r,7);break}}handleArrowKey(r,o){var u,f,g;if(((u=r.target)==null?void 0:u.nodeName)==="INPUT"||((f=r.target)==null?void 0:f.nodeName)==="SELECT"||((g=r.target)==null?void 0:g.nodeName)==="BUTTON")return;r.preventDefault(),this.focusedDate||this.focusOnCurrentDate();const v=this.focusedDate?aa(this.focusedDate):Vc(this.year,this.month,1);let C=Fk(v,o);if(C){let E=this.querySelector(`div[data-date="${La(C)}"]`);if(E instanceof HTMLDivElement){if(E.dataset.disabled){C=Fk(C,o);let _=this.querySelector(`div[data-date="${La(C)}"]`);for(;_&&_ instanceof HTMLDivElement&&_.dataset.disabled;)C=Fk(C,o),_=this.querySelector(`div[data-date="${La(C)}"]`);E=_}E instanceof HTMLDivElement&&!E.dataset.disabled&&(this.focusedDate=La(C),E.focus())}}}render(){return qe`
376
376
  <div
377
377
  class="pkt-calendar ${this.weeknumbers?"pkt-cal-weeknumbers":gt}"
378
378
  @focusout=${this.closeEvent}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-react",
3
- "version": "12.30.1",
3
+ "version": "12.30.2",
4
4
  "description": "React komponentbibliotek til Punkt, et designsystem laget av Oslo Origo",
5
5
  "homepage": "https://punkt.oslo.kommune.no",
6
6
  "author": "Team Designsystem, Oslo Origo",
@@ -38,7 +38,7 @@
38
38
  "dependencies": {
39
39
  "@lit-labs/ssr-dom-shim": "^1.2.1",
40
40
  "@lit/react": "^1.0.5",
41
- "@oslokommune/punkt-elements": "^12.30.1",
41
+ "@oslokommune/punkt-elements": "^12.30.2",
42
42
  "angular-html-parser": "^6.0.2",
43
43
  "html-format": "^1.1.7",
44
44
  "prettier": "^3.3.3",
@@ -111,5 +111,5 @@
111
111
  "url": "https://github.com/oslokommune/punkt/issues"
112
112
  },
113
113
  "license": "MIT",
114
- "gitHead": "0f1a0e48c876e44bd455daa1a569d3841b66831b"
114
+ "gitHead": "a4b93e347c6b9167efadde236794e42aafc18489"
115
115
  }