@oslokommune/punkt-react 12.30.0 → 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.
- package/dist/punkt-react.es.js +16 -10
- package/dist/punkt-react.umd.js +3 -3
- package/package.json +5 -5
package/dist/punkt-react.es.js
CHANGED
|
@@ -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
|
|
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;
|
|
@@ -37320,11 +37321,6 @@ const IU = [
|
|
|
37320
37321
|
fn: "filter.svg",
|
|
37321
37322
|
cat: "ui"
|
|
37322
37323
|
},
|
|
37323
|
-
{
|
|
37324
|
-
id: "fire-emblem",
|
|
37325
|
-
fn: "fire-emblem.svg",
|
|
37326
|
-
cat: "services"
|
|
37327
|
-
},
|
|
37328
37324
|
{
|
|
37329
37325
|
id: "fire-safety",
|
|
37330
37326
|
fn: "fire-safety.svg",
|
|
@@ -37690,6 +37686,16 @@ const IU = [
|
|
|
37690
37686
|
fn: "share.svg",
|
|
37691
37687
|
cat: "ui"
|
|
37692
37688
|
},
|
|
37689
|
+
{
|
|
37690
|
+
id: "shield-fire",
|
|
37691
|
+
fn: "shield-fire.svg",
|
|
37692
|
+
cat: "services"
|
|
37693
|
+
},
|
|
37694
|
+
{
|
|
37695
|
+
id: "shield-law-paragraph",
|
|
37696
|
+
fn: "shield-law-paragraph.svg",
|
|
37697
|
+
cat: "ui"
|
|
37698
|
+
},
|
|
37693
37699
|
{
|
|
37694
37700
|
id: "slack",
|
|
37695
37701
|
fn: "slack.svg",
|
package/dist/punkt-react.umd.js
CHANGED
|
@@ -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)
|
|
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}
|
|
@@ -1189,5 +1189,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1189
1189
|
* @public
|
|
1190
1190
|
*/var o=function(u){var f=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,g=0,v={},C={manual:u.Prism&&u.Prism.manual,disableWorkerMessageHandler:u.Prism&&u.Prism.disableWorkerMessageHandler,util:{encode:function K(Y){return Y instanceof E?new E(Y.type,K(Y.content),Y.alias):Array.isArray(Y)?Y.map(K):Y.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(K){return Object.prototype.toString.call(K).slice(8,-1)},objId:function(K){return K.__id||Object.defineProperty(K,"__id",{value:++g}),K.__id},clone:function K(Y,ne){ne=ne||{};var U,ae;switch(C.util.type(Y)){case"Object":if(ae=C.util.objId(Y),ne[ae])return ne[ae];U={},ne[ae]=U;for(var oe in Y)Y.hasOwnProperty(oe)&&(U[oe]=K(Y[oe],ne));return U;case"Array":return ae=C.util.objId(Y),ne[ae]?ne[ae]:(U=[],ne[ae]=U,Y.forEach(function(Te,ye){U[ye]=K(Te,ne)}),U);default:return Y}},getLanguage:function(K){for(;K;){var Y=f.exec(K.className);if(Y)return Y[1].toLowerCase();K=K.parentElement}return"none"},setLanguage:function(K,Y){K.className=K.className.replace(RegExp(f,"gi"),""),K.classList.add("language-"+Y)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(U){var K=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(U.stack)||[])[1];if(K){var Y=document.getElementsByTagName("script");for(var ne in Y)if(Y[ne].src==K)return Y[ne]}return null}},isActive:function(K,Y,ne){for(var U="no-"+Y;K;){var ae=K.classList;if(ae.contains(Y))return!0;if(ae.contains(U))return!1;K=K.parentElement}return!!ne}},languages:{plain:v,plaintext:v,text:v,txt:v,extend:function(K,Y){var ne=C.util.clone(C.languages[K]);for(var U in Y)ne[U]=Y[U];return ne},insertBefore:function(K,Y,ne,U){U=U||C.languages;var ae=U[K],oe={};for(var Te in ae)if(ae.hasOwnProperty(Te)){if(Te==Y)for(var ye in ne)ne.hasOwnProperty(ye)&&(oe[ye]=ne[ye]);ne.hasOwnProperty(Te)||(oe[Te]=ae[Te])}var Ve=U[K];return U[K]=oe,C.languages.DFS(C.languages,function(rt,Ye){Ye===Ve&&rt!=K&&(this[rt]=oe)}),oe},DFS:function K(Y,ne,U,ae){ae=ae||{};var oe=C.util.objId;for(var Te in Y)if(Y.hasOwnProperty(Te)){ne.call(Y,Te,Y[Te],U||Te);var ye=Y[Te],Ve=C.util.type(ye);Ve==="Object"&&!ae[oe(ye)]?(ae[oe(ye)]=!0,K(ye,ne,null,ae)):Ve==="Array"&&!ae[oe(ye)]&&(ae[oe(ye)]=!0,K(ye,ne,Te,ae))}}},plugins:{},highlightAll:function(K,Y){C.highlightAllUnder(document,K,Y)},highlightAllUnder:function(K,Y,ne){var U={callback:ne,container:K,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};C.hooks.run("before-highlightall",U),U.elements=Array.prototype.slice.apply(U.container.querySelectorAll(U.selector)),C.hooks.run("before-all-elements-highlight",U);for(var ae=0,oe;oe=U.elements[ae++];)C.highlightElement(oe,Y===!0,U.callback)},highlightElement:function(K,Y,ne){var U=C.util.getLanguage(K),ae=C.languages[U];C.util.setLanguage(K,U);var oe=K.parentElement;oe&&oe.nodeName.toLowerCase()==="pre"&&C.util.setLanguage(oe,U);var Te=K.textContent,ye={element:K,language:U,grammar:ae,code:Te};function Ve(Ye){ye.highlightedCode=Ye,C.hooks.run("before-insert",ye),ye.element.innerHTML=ye.highlightedCode,C.hooks.run("after-highlight",ye),C.hooks.run("complete",ye),ne&&ne.call(ye.element)}if(C.hooks.run("before-sanity-check",ye),oe=ye.element.parentElement,oe&&oe.nodeName.toLowerCase()==="pre"&&!oe.hasAttribute("tabindex")&&oe.setAttribute("tabindex","0"),!ye.code){C.hooks.run("complete",ye),ne&&ne.call(ye.element);return}if(C.hooks.run("before-highlight",ye),!ye.grammar){Ve(C.util.encode(ye.code));return}if(Y&&u.Worker){var rt=new Worker(C.filename);rt.onmessage=function(Ye){Ve(Ye.data)},rt.postMessage(JSON.stringify({language:ye.language,code:ye.code,immediateClose:!0}))}else Ve(C.highlight(ye.code,ye.grammar,ye.language))},highlight:function(K,Y,ne){var U={code:K,grammar:Y,language:ne};if(C.hooks.run("before-tokenize",U),!U.grammar)throw new Error('The language "'+U.language+'" has no grammar.');return U.tokens=C.tokenize(U.code,U.grammar),C.hooks.run("after-tokenize",U),E.stringify(C.util.encode(U.tokens),U.language)},tokenize:function(K,Y){var ne=Y.rest;if(ne){for(var U in ne)Y[U]=ne[U];delete Y.rest}var ae=new N;return R(ae,ae.head,K),$(K,ae,Y,ae.head,0),M(ae)},hooks:{all:{},add:function(K,Y){var ne=C.hooks.all;ne[K]=ne[K]||[],ne[K].push(Y)},run:function(K,Y){var ne=C.hooks.all[K];if(!(!ne||!ne.length))for(var U=0,ae;ae=ne[U++];)ae(Y)}},Token:E};u.Prism=C;function E(K,Y,ne,U){this.type=K,this.content=Y,this.alias=ne,this.length=(U||"").length|0}E.stringify=function K(Y,ne){if(typeof Y=="string")return Y;if(Array.isArray(Y)){var U="";return Y.forEach(function(Ve){U+=K(Ve,ne)}),U}var ae={type:Y.type,content:K(Y.content,ne),tag:"span",classes:["token",Y.type],attributes:{},language:ne},oe=Y.alias;oe&&(Array.isArray(oe)?Array.prototype.push.apply(ae.classes,oe):ae.classes.push(oe)),C.hooks.run("wrap",ae);var Te="";for(var ye in ae.attributes)Te+=" "+ye+'="'+(ae.attributes[ye]||"").replace(/"/g,""")+'"';return"<"+ae.tag+' class="'+ae.classes.join(" ")+'"'+Te+">"+ae.content+"</"+ae.tag+">"};function _(K,Y,ne,U){K.lastIndex=Y;var ae=K.exec(ne);if(ae&&U&&ae[1]){var oe=ae[1].length;ae.index+=oe,ae[0]=ae[0].slice(oe)}return ae}function $(K,Y,ne,U,ae,oe){for(var Te in ne)if(!(!ne.hasOwnProperty(Te)||!ne[Te])){var ye=ne[Te];ye=Array.isArray(ye)?ye:[ye];for(var Ve=0;Ve<ye.length;++Ve){if(oe&&oe.cause==Te+","+Ve)return;var rt=ye[Ve],Ye=rt.inside,Fe=!!rt.lookbehind,Pe=!!rt.greedy,Ze=rt.alias;if(Pe&&!rt.pattern.global){var Ne=rt.pattern.toString().match(/[imsuy]*$/)[0];rt.pattern=RegExp(rt.pattern.source,Ne+"g")}for(var Be=rt.pattern||rt,ve=U.next,Re=ae;ve!==Y.tail&&!(oe&&Re>=oe.reach);Re+=ve.value.length,ve=ve.next){var xe=ve.value;if(Y.length>K.length)return;if(!(xe instanceof E)){var G=1,ce;if(Pe){if(ce=_(Be,Re,K,Fe),!ce||ce.index>=K.length)break;var yt=ce.index,vt=ce.index+ce[0].length,ut=Re;for(ut+=ve.value.length;yt>=ut;)ve=ve.next,ut+=ve.value.length;if(ut-=ve.value.length,Re=ut,ve.value instanceof E)continue;for(var ct=ve;ct!==Y.tail&&(ut<vt||typeof ct.value=="string");ct=ct.next)G++,ut+=ct.value.length;G--,xe=K.slice(Re,ut),ce.index-=Re}else if(ce=_(Be,0,xe,Fe),!ce)continue;var yt=ce.index,it=ce[0],Rt=xe.slice(0,yt),Lt=xe.slice(yt+it.length),sn=Re+xe.length;oe&&sn>oe.reach&&(oe.reach=sn);var $n=ve.prev;Rt&&($n=R(Y,$n,Rt),Re+=Rt.length),B(Y,$n,G);var br=new E(Te,Ye?C.tokenize(it,Ye):it,Ze,it);if(ve=R(Y,$n,br),Lt&&R(Y,ve,Lt),G>1){var nn={cause:Te+","+Ve,reach:sn};$(K,Y,ne,ve.prev,Re,nn),oe&&nn.reach>oe.reach&&(oe.reach=nn.reach)}}}}}}function N(){var K={value:null,prev:null,next:null},Y={value:null,prev:K,next:null};K.next=Y,this.head=K,this.tail=Y,this.length=0}function R(K,Y,ne){var U=Y.next,ae={value:ne,prev:Y,next:U};return Y.next=ae,U.prev=ae,K.length++,ae}function B(K,Y,ne){for(var U=Y.next,ae=0;ae<ne&&U!==K.tail;ae++)U=U.next;Y.next=U,U.prev=Y,K.length-=ae}function M(K){for(var Y=[],ne=K.head.next;ne!==K.tail;)Y.push(ne.value),ne=ne.next;return Y}if(!u.document)return u.addEventListener&&(C.disableWorkerMessageHandler||u.addEventListener("message",function(K){var Y=JSON.parse(K.data),ne=Y.language,U=Y.code,ae=Y.immediateClose;u.postMessage(C.highlight(U,C.languages[ne],ne)),ae&&u.close()},!1)),C;var V=C.util.currentScript();V&&(C.filename=V.src,V.hasAttribute("data-manual")&&(C.manual=!0));function H(){C.manual||C.highlightAll()}if(!C.manual){var ge=document.readyState;ge==="loading"||ge==="interactive"&&V&&V.defer?document.addEventListener("DOMContentLoaded",H):window.requestAnimationFrame?window.requestAnimationFrame(H):window.setTimeout(H,16)}return C}(r);n.exports&&(n.exports=o),typeof qc<"u"&&(qc.Prism=o)})(a_);var _4=a_.exports,T4=L1;L1.displayName="markup",L1.aliases=["html","mathml","svg","xml","ssml","atom","rss"];function L1(n){n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside["internal-subset"].inside=n.languages.markup,n.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.value.replace(/&/,"&"))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(o,u){var f={};f["language-"+u]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[u]},f.cdata=/^<!\[CDATA\[|\]\]>$/i;var g={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:f}};g["language-"+u]={pattern:/[\s\S]+/,inside:n.languages[u]};var v={};v[o]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return o}),"i"),lookbehind:!0,greedy:!0,inside:g},n.languages.insertBefore("markup","cdata",v)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(r,o){n.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[o,"language-"+o],inside:n.languages[o]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml}var A4=B1;B1.displayName="css",B1.aliases=[];function B1(n){(function(r){var o=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+o.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+o.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+o.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:o,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var u=r.languages.markup;u&&(u.tag.addInlined("style","css"),u.tag.addAttribute("style","css"))})(n)}var F4=j1;j1.displayName="clike",j1.aliases=[];function j1(n){n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}var $4=I1;I1.displayName="javascript",I1.aliases=["js"];function I1(n){n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),n.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),n.languages.markup&&(n.languages.markup.tag.addInlined("script","javascript"),n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),n.languages.js=n.languages.javascript}var Ng=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof qc=="object"?qc:{},P4=G4();Ng.Prism={manual:!0,disableWorkerMessageHandler:!0};var N4=VI,R4=c4,i_=_4,O4=T4,L4=A4,B4=F4,j4=$4;P4();var M1={}.hasOwnProperty;function o_(){}o_.prototype=i_;var oa=new o_,I4=oa;oa.highlight=z4,oa.register=Rg,oa.alias=M4,oa.registered=U4,oa.listLanguages=H4,Rg(O4),Rg(L4),Rg(B4),Rg(j4),oa.util.encode=V4,oa.Token.stringify=q4;function Rg(n){if(typeof n!="function"||!n.displayName)throw new Error("Expected `function` for `grammar`, got `"+n+"`");oa.languages[n.displayName]===void 0&&n(oa)}function M4(n,r){var o=oa.languages,u=n,f,g,v,C;r&&(u={},u[n]=r);for(f in u)for(g=u[f],g=typeof g=="string"?[g]:g,v=g.length,C=-1;++C<v;)o[g[C]]=o[f]}function z4(n,r){var o=i_.highlight,u;if(typeof n!="string")throw new Error("Expected `string` for `value`, got `"+n+"`");if(oa.util.type(r)==="Object")u=r,r=null;else{if(typeof r!="string")throw new Error("Expected `string` for `name`, got `"+r+"`");if(M1.call(oa.languages,r))u=oa.languages[r];else throw new Error("Unknown language: `"+r+"` is not registered")}return o.call(this,n,u,r)}function U4(n){if(typeof n!="string")throw new Error("Expected `string` for `language`, got `"+n+"`");return M1.call(oa.languages,n)}function H4(){var n=oa.languages,r=[],o;for(o in n)M1.call(n,o)&&typeof n[o]=="object"&&r.push(o);return r}function q4(n,r,o){var u;return typeof n=="string"?{type:"text",value:n}:oa.util.type(n)==="Array"?W4(n,r):(u={type:n.type,content:oa.Token.stringify(n.content,r,o),tag:"span",classes:["token",n.type],attributes:{},language:r,parent:o},n.alias&&(u.classes=u.classes.concat(n.alias)),oa.hooks.run("wrap",u),N4(u.tag+"."+u.classes.join("."),Y4(u.attributes),u.content))}function W4(n,r){for(var o=[],u=n.length,f=-1,g;++f<u;)g=n[f],g!==""&&g!==null&&g!==void 0&&o.push(g);for(f=-1,u=o.length;++f<u;)g=o[f],o[f]=oa.Token.stringify(g,r,o);return o}function V4(n){return n}function Y4(n){var r;for(r in n)n[r]=R4(n[r]);return n}function G4(){var n="Prism"in Ng,r=n?Ng.Prism:void 0;return o;function o(){n?Ng.Prism=r:delete Ng.Prism,n=void 0,r=void 0}}const z1=ky(I4);var Og=Tj(z1,{});Og.registerLanguage=function(n,r){return z1.register(r)},Og.alias=function(n,r){return z1.alias(n,r)};const s_={'code[class*="language-"]':{color:"black",background:"none",textShadow:"0 1px white",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{color:"black",background:"#f5f2f0",textShadow:"0 1px white",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:".5em 0",overflow:"auto"},'pre[class*="language-"]::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'pre[class*="language-"] ::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"]::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"] ::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'pre[class*="language-"]::selection':{textShadow:"none",background:"#b3d4fc"},'pre[class*="language-"] ::selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"]::selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"] ::selection':{textShadow:"none",background:"#b3d4fc"},':not(pre) > code[class*="language-"]':{background:"#f5f2f0",padding:".1em",borderRadius:".3em",whiteSpace:"normal"},comment:{color:"slategray"},prolog:{color:"slategray"},doctype:{color:"slategray"},cdata:{color:"slategray"},punctuation:{color:"#999"},namespace:{Opacity:".7"},property:{color:"#905"},tag:{color:"#905"},boolean:{color:"#905"},number:{color:"#905"},constant:{color:"#905"},symbol:{color:"#905"},deleted:{color:"#905"},selector:{color:"#690"},"attr-name":{color:"#690"},string:{color:"#690"},char:{color:"#690"},builtin:{color:"#690"},inserted:{color:"#690"},operator:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},entity:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)",cursor:"help"},url:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},".language-css .token.string":{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},".style .token.string":{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},atrule:{color:"#07a"},"attr-value":{color:"#07a"},keyword:{color:"#07a"},function:{color:"#DD4A68"},"class-name":{color:"#DD4A68"},regex:{color:"#e90"},important:{color:"#e90",fontWeight:"bold"},variable:{color:"#e90"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"}};var Q4=U1;U1.displayName="jsx",U1.aliases=[];function U1(n){(function(r){var o=r.util.clone(r.languages.javascript),u=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,f=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,g=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function v(_,$){return _=_.replace(/<S>/g,function(){return u}).replace(/<BRACES>/g,function(){return f}).replace(/<SPREAD>/g,function(){return g}),RegExp(_,$)}g=v(g).source,r.languages.jsx=r.languages.extend("markup",o),r.languages.jsx.tag.pattern=v(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),r.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,r.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,r.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,r.languages.jsx.tag.inside.comment=o.comment,r.languages.insertBefore("inside","attr-name",{spread:{pattern:v(/<SPREAD>/.source),inside:r.languages.jsx}},r.languages.jsx.tag),r.languages.insertBefore("inside","special-attr",{script:{pattern:v(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:r.languages.jsx}}},r.languages.jsx.tag);var C=function(_){return _?typeof _=="string"?_:typeof _.content=="string"?_.content:_.content.map(C).join(""):""},E=function(_){for(var $=[],N=0;N<_.length;N++){var R=_[N],B=!1;if(typeof R!="string"&&(R.type==="tag"&&R.content[0]&&R.content[0].type==="tag"?R.content[0].content[0].content==="</"?$.length>0&&$[$.length-1].tagName===C(R.content[0].content[1])&&$.pop():R.content[R.content.length-1].content==="/>"||$.push({tagName:C(R.content[0].content[1]),openedBraces:0}):$.length>0&&R.type==="punctuation"&&R.content==="{"?$[$.length-1].openedBraces++:$.length>0&&$[$.length-1].openedBraces>0&&R.type==="punctuation"&&R.content==="}"?$[$.length-1].openedBraces--:B=!0),(B||typeof R=="string")&&$.length>0&&$[$.length-1].openedBraces===0){var M=C(R);N<_.length-1&&(typeof _[N+1]=="string"||_[N+1].type==="plain-text")&&(M+=C(_[N+1]),_.splice(N+1,1)),N>0&&(typeof _[N-1]=="string"||_[N-1].type==="plain-text")&&(M=C(_[N-1])+M,_.splice(N-1,1),N--),_[N]=new r.Token("plain-text",M,null,M)}R.content&&typeof R.content!="string"&&E(R.content)}};r.hooks.add("after-tokenize",function(_){_.language!=="jsx"&&_.language!=="tsx"||E(_.tokens)})})(n)}const K4=ky(Q4),Z4=ga({tagName:"pkt-tag",elementClass:Gs,react:je,displayName:"PktTag",events:{onClose:"close"}}),Dh=je.forwardRef(({children:n,...r},o)=>L.jsx(Z4,{ref:o,...r,children:L.jsx("div",{className:"pkt-contents",children:n})}));Dh.displayName="PktTag";const l_=je.forwardRef(({arrowNav:n=!0,tabs:r,onTabSelected:o},u)=>{const f=je.useRef([]);je.useEffect(()=>{f.current=f.current.slice(0,r.length)},[r]);const g=(C,E)=>{E.action&&E.action(C),o&&o(C)},v=(C,E)=>{var _,$;n&&(E.code==="ArrowLeft"&&C!==0&&((_=f.current[C-1])==null||_.focus()),E.code==="ArrowRight"&&C<r.length-1&&(($=f.current[C+1])==null||$.focus()),(E.code==="ArrowDown"||E.code==="Space")&&g(C,r[C]))};return L.jsx("div",{className:"pkt-tabs",ref:u,children:L.jsx("div",{className:"pkt-tabs__list",role:n?"tablist":"navigation",children:r.map((C,E)=>L.jsx(je.Fragment,{children:C.href?L.jsxs("a",{"aria-selected":!!C.active,role:n?"tab":void 0,href:C.href,"aria-controls":C.controls,className:`pkt-tabs__link ${C.active?"active":""}`,onKeyUp:_=>v(E,_),onClick:()=>g(E,C),tabIndex:C.active||!n?void 0:-1,ref:_=>{f.current[E]=_},children:[C.icon&&L.jsx(rr,{name:C.icon,className:"pkt-icon--small"}),C.text,C.tag&&L.jsx(Dh,{skin:C.tag.skin,size:"small",children:C.tag.text})]}):L.jsxs("button",{"aria-selected":!!C.active,role:n?"tab":void 0,type:"button","aria-controls":C.controls,className:`pkt-tabs__button pkt-link-button ${C.active?"active":""}`,onKeyUp:_=>v(E,_),onClick:()=>g(E,C),tabIndex:C.active||!n?void 0:-1,ref:_=>{f.current[E]=_},children:[C.icon&&L.jsx(rr,{name:C.icon,className:"pkt-icon--small"}),C.text,C.tag&&L.jsx(Dh,{skin:C.tag.skin,size:"small",children:C.tag.text})]},"b-"+E)},E))})})}),X4=ga({tagName:"pkt-textinput",elementClass:us,react:je,displayName:"PktTextinput",events:{onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"valueChange",onToggleHelpText:"toggleHelpText"}}),Lg=je.forwardRef(({helptext:n,...r},o)=>L.jsx(X4,{...r,ref:o,children:n&&L.jsx("div",{slot:"helptext",className:"pkt-contents",children:n})}));Lg.displayName="PktTextinput";const ib=({className:n,compact:r=!1,skin:o="basic",responsiveView:u=!0,children:f})=>L.jsx("table",{"data-testid":"pkt-table",className:cs(n,"pkt-table",{"pkt-table--responsive":u,"pkt-table--compact":r,"pkt-table--basic":o==="basic","pkt-table--zebra-blue":o==="zebra-blue"}),role:"table",children:f}),ob=({className:n,children:r})=>L.jsx("thead",{className:cs(n,"pkt-table__header",{}),role:"rowgroup",children:r}),sb=({children:n,className:r})=>L.jsx("tbody",{className:cs(r,"pkt-table__body",{}),role:"rowgroup",children:n}),Mp=({className:n,children:r})=>L.jsx("tr",{className:cs(n,"pkt-table__row",{}),role:"row",children:r}),Qs=({className:n,children:r})=>L.jsx("th",{className:cs(n,"pkt-table__header-cell",{}),role:"columnheader",children:r}),Ho=({children:n,className:r,dataLabel:o})=>L.jsx("td",{className:cs(r,"pkt-table__data-cell",{}),"data-label":o,role:"cell","data-testid":"pkt-table__data-cell",children:n}),J4=({specs:n})=>{const r=u=>Array.isArray(u)?u.join(`
|
|
1191
1191
|
`):u,o=u=>typeof u=="boolean"?u?"true":"false":u;return L.jsxs(L.Fragment,{children:[L.jsx("h2",{children:"Egenskaper"}),L.jsxs(ib,{compact:!0,children:[L.jsx(ob,{children:L.jsxs(Mp,{children:[L.jsx(Qs,{children:"Prop"}),L.jsx(Qs,{children:"Navn"}),L.jsx(Qs,{children:"Beskrivelse"}),L.jsx(Qs,{children:"Type"}),L.jsx(Qs,{children:"Standardverdi"})]})}),L.jsx(sb,{children:Object.entries(n.props||{}).map(([u,f])=>L.jsxs(Mp,{children:[L.jsx(Ho,{dataLabel:"Prop",children:L.jsx("pre",{children:u})}),L.jsx(Ho,{dataLabel:"Navn",children:!Array.isArray(f)&&f.name||u}),Array.isArray(f)?L.jsxs(L.Fragment,{children:[L.jsx(Ho,{dataLabel:"Beskrivelse"}),L.jsx(Ho,{dataLabel:"Type",children:L.jsx("pre",{children:f.join(`
|
|
1192
|
-
`)})})]}):L.jsxs(L.Fragment,{children:[L.jsx(Ho,{dataLabel:"Beskrivelse",children:L.jsx("span",{dangerouslySetInnerHTML:{__html:f.description||""}})}),L.jsx(Ho,{dataLabel:"Type",children:L.jsx("pre",{children:f.type&&r(f.type)})}),L.jsx(Ho,{dataLabel:"Standardverdi",children:L.jsx("pre",{children:o(f.default)})})]})]},u))})]}),n.events&&L.jsxs(L.Fragment,{children:[L.jsx("h2",{children:"Hendelser / handlinger"}),L.jsxs(ib,{compact:!0,children:[L.jsx(ob,{children:L.jsxs(Mp,{children:[L.jsx(Qs,{children:"Event"}),L.jsx(Qs,{children:"Beskrivelse"}),L.jsx(Qs,{children:"Type"})]})}),L.jsx(sb,{children:Object.entries(n.events||{}).map(([u,f])=>L.jsxs(Mp,{children:[L.jsx(Ho,{dataLabel:"Event",children:L.jsx("pre",{children:u})}),L.jsx(Ho,{dataLabel:"Beskrivelse",children:L.jsx("span",{dangerouslySetInnerHTML:{__html:f.description||""}})}),L.jsx(Ho,{dataLabel:"Type",children:f.type})]},u))})]})]}),n.slots&&L.jsxs(L.Fragment,{children:[L.jsx("h2",{children:"Innhold"}),L.jsxs(ib,{compact:!0,children:[L.jsx(ob,{children:L.jsxs(Mp,{children:[L.jsx(Qs,{children:"Slot"}),L.jsx(Qs,{children:"Beskrivelse"})]})}),L.jsx(sb,{children:Object.entries(n.slots||{}).map(([u,f])=>L.jsxs(Mp,{children:[L.jsx(Ho,{dataLabel:"Slot",children:L.jsx("pre",{children:u})}),L.jsx(Ho,{dataLabel:"Beskrivelse",children:L.jsx("span",{dangerouslySetInnerHTML:{__html:f.description||""}})})]},u))})]})]})]})},eM=ga({tagName:"pkt-select",elementClass:uh,react:je,displayName:"PktSelect",events:{onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"valueChange",onToggleHelpText:"toggleHelpText"}}),lb=je.forwardRef(({children:n,helptext:r,...o},u)=>L.jsxs(eM,{ref:u,...o,children:[r&&L.jsx("div",{slot:"helptext",className:"pkt-contents",children:r}),n]}));lb.displayName="PktSelect";const tM=[{id:"24h",fn:"24h.svg",cat:"services"},{id:"active-person",fn:"active-person.svg",cat:"people-and-health"},{id:"adjust",fn:"adjust.svg",cat:"ui"},{id:"advice",fn:"advice.svg",cat:"ui"},{id:"alert-circle",fn:"alert-circle.svg",cat:"ui"},{id:"alert-error",fn:"alert-error.svg",cat:"ui"},{id:"alert-information",fn:"alert-information.svg",cat:"ui"},{id:"alert-success",fn:"alert-success.svg",cat:"ui"},{id:"alert-warning",fn:"alert-warning.svg",cat:"ui"},{id:"apple",fn:"apple.svg",cat:"ui"},{id:"archive",fn:"archive.svg",cat:"ui"},{id:"arrow-circle",fn:"arrow-circle.svg",cat:"ui"},{id:"arrow-return",fn:"arrow-return.svg",cat:"arrows"},{id:"arrow",fn:"arrow.svg",cat:"arrows"},{id:"attachment",fn:"attachment.svg",cat:"ui"},{id:"backpack",fn:"backpack.svg",cat:"services"},{id:"balloons",fn:"balloons.svg",cat:"ui"},{id:"books",fn:"books.svg",cat:"services"},{id:"brain-heart",fn:"brain-heart.svg",cat:"people-and-health"},{id:"brain-signal",fn:"brain-signal.svg",cat:"people-and-health"},{id:"briefcase",fn:"briefcase.svg",cat:"sign"},{id:"bullseye",fn:"bullseye.svg",cat:"ui"},{id:"bus",fn:"bus.svg",cat:"services"},{id:"cafe",fn:"cafe.svg",cat:"sign"},{id:"calendar",fn:"calendar.svg",cat:"ui"},{id:"camera",fn:"camera.svg",cat:"ui"},{id:"car",fn:"car.svg",cat:"sign"},{id:"care-room",fn:"care-room.svg",cat:"sign"},{id:"character-exclamation-mark",fn:"character-exclamation-mark.svg",cat:"ui"},{id:"character-information",fn:"character-information.svg",cat:"ui"},{id:"check-big",fn:"check-big.svg",cat:"ui"},{id:"check-circle",fn:"check-circle.svg",cat:"ui"},{id:"check-medium",fn:"check-medium.svg",cat:"ui"},{id:"check",fn:"check.svg",cat:"ui"},{id:"chevron-down",fn:"chevron-down.svg",cat:"arrows"},{id:"chevron-left",fn:"chevron-left.svg",cat:"arrows"},{id:"chevron-right",fn:"chevron-right.svg",cat:"arrows"},{id:"chevron-thin-down",fn:"chevron-thin-down.svg",cat:"arrows"},{id:"chevron-thin-left",fn:"chevron-thin-left.svg",cat:"arrows"},{id:"chevron-thin-right",fn:"chevron-thin-right.svg",cat:"arrows"},{id:"chevron-thin-up",fn:"chevron-thin-up.svg",cat:"arrows"},{id:"chevron-up-and-down",fn:"chevron-up-and-down.svg",cat:"ui"},{id:"chevron-up",fn:"chevron-up.svg",cat:"arrows"},{id:"clock-history",fn:"clock-history.svg",cat:"ui"},{id:"clock",fn:"clock.svg",cat:"ui"},{id:"",fn:"close.svg",cat:"none"},{id:"cloud",fn:"cloud.svg",cat:"ui"},{id:"code",fn:"code.svg",cat:"ui"},{id:"coffee",fn:"coffee.svg",cat:"sign"},{id:"cogwheel",fn:"cogwheel.svg",cat:"ui"},{id:"coin-stacks",fn:"coin-stacks.svg",cat:"services"},{id:"computer",fn:"computer.svg",cat:"ui"},{id:"copy",fn:"copy.svg",cat:"ui"},{id:"crane",fn:"crane.svg",cat:"services"},{id:"cross-circle-big",fn:"cross-circle-big.svg",cat:"ui"},{id:"cross-circle-fill-large",fn:"cross-circle-fill-large.svg",cat:"none"},{id:"cross-circle-fill",fn:"cross-circle-fill.svg",cat:"ui"},{id:"cross-circle",fn:"cross-circle.svg",cat:"ui"},{id:"cross",fn:"cross.svg",cat:"ui"},{id:"data",fn:"data.svg",cat:"ui"},{id:"defibrillators",fn:"defibrillators.svg",cat:"sign"},{id:"district",fn:"district.svg",cat:"ui"},{id:"document-code",fn:"document-code.svg",cat:"ui"},{id:"document-pdf",fn:"document-pdf.svg",cat:"ui"},{id:"document-plain",fn:"document-plain.svg",cat:"ui"},{id:"document-table",fn:"document-table.svg",cat:"ui"},{id:"document-text",fn:"document-text.svg",cat:"ui"},{id:"download",fn:"download.svg",cat:"ui"},{id:"drag",fn:"drag.svg",cat:"ui"},{id:"drinking-area-refreshments",fn:"drinking-area-refreshments.svg",cat:"sign"},{id:"ecg-heart",fn:"ecg-heart.svg",cat:"people-and-health"},{id:"edit",fn:"edit.svg",cat:"ui"},{id:"email",fn:"email.svg",cat:"ui"},{id:"exclamation-mark-circle",fn:"exclamation-mark-circle.svg",cat:"ui"},{id:"exclamation-mark-square",fn:"exclamation-mark-square.svg",cat:"ui"},{id:"exit",fn:"exit.svg",cat:"ui"},{id:"expand",fn:"expand.svg",cat:"ui"},{id:"eye",fn:"eye.svg",cat:"ui"},{id:"face-almost-happy",fn:"face-almost-happy.svg",cat:"feedback"},{id:"face-almost-sad",fn:"face-almost-sad.svg",cat:"feedback"},{id:"face-happy",fn:"face-happy.svg",cat:"feedback"},{id:"face-neutral",fn:"face-neutral.svg",cat:"feedback"},{id:"face-sad",fn:"face-sad.svg",cat:"feedback"},{id:"facebook",fn:"facebook.svg",cat:"social"},{id:"factory-fill",fn:"factory-fill.svg",cat:"ui"},{id:"feedback",fn:"feedback.svg",cat:"ui"},{id:"figma",fn:"figma.svg",cat:"social"},{id:"filter",fn:"filter.svg",cat:"ui"},{id:"fire-emblem",fn:"fire-emblem.svg",cat:"services"},{id:"fire-safety",fn:"fire-safety.svg",cat:"people-and-health"},{id:"folder",fn:"folder.svg",cat:"ui"},{id:"game-console",fn:"game-console.svg",cat:"ui"},{id:"github",fn:"github.svg",cat:"social"},{id:"graph",fn:"graph.svg",cat:"ui"},{id:"grid",fn:"grid.svg",cat:"ui"},{id:"hands-globe",fn:"hands-globe.svg",cat:"people-and-health"},{id:"headset",fn:"headset.svg",cat:"ui"},{id:"heart-hand",fn:"heart-hand.svg",cat:"people-and-health"},{id:"heart-plus",fn:"heart-plus.svg",cat:"services"},{id:"heart",fn:"heart.svg",cat:"ui"},{id:"holding-hands",fn:"holding-hands.svg",cat:"people-and-health"},{id:"home",fn:"home.svg",cat:"ui"},{id:"horizontal-menu",fn:"horizontal-menu.svg",cat:"ui"},{id:"house-heart",fn:"house-heart.svg",cat:"services"},{id:"information",fn:"information.svg",cat:"ui"},{id:"instagram",fn:"instagram.svg",cat:"social"},{id:"invoice",fn:"invoice.svg",cat:"ui"},{id:"key",fn:"key.svg",cat:"ui"},{id:"language",fn:"language.svg",cat:"ui"},{id:"law-paragraph",fn:"law-paragraph.svg",cat:"ui"},{id:"lecture-workplace",fn:"lecture-workplace.svg",cat:"sign"},{id:"link",fn:"link.svg",cat:"ui"},{id:"linkedin",fn:"linkedin.svg",cat:"social"},{id:"list",fn:"list.svg",cat:"ui"},{id:"location-pin-filled",fn:"location-pin-filled.svg",cat:"ui"},{id:"location-pin",fn:"location-pin.svg",cat:"ui"},{id:"lock-locked",fn:"lock-locked.svg",cat:"ui"},{id:"lock-unlocked",fn:"lock-unlocked.svg",cat:"ui"},{id:"magnifying-glass-big",fn:"magnifying-glass-big.svg",cat:"ui"},{id:"magnifying-glass-small",fn:"magnifying-glass-small.svg",cat:"ui"},{id:"map",fn:"map.svg",cat:"ui"},{id:"medicine-cabinet",fn:"medicine-cabinet.svg",cat:"ui"},{id:"menu",fn:"menu.svg",cat:"ui"},{id:"message",fn:"message.svg",cat:"ui"},{id:"minimize",fn:"minimize.svg",cat:"ui"},{id:"minus-circle-fill",fn:"minus-circle-fill.svg",cat:"plusminus"},{id:"minus-circle",fn:"minus-circle.svg",cat:"plusminus"},{id:"minus-sign",fn:"minus-sign.svg",cat:"plusminus"},{id:"mobile-phone",fn:"mobile-phone.svg",cat:"ui"},{id:"music-notes",fn:"music-notes.svg",cat:"ui"},{id:"new-window-small",fn:"new-window-small.svg",cat:"ui"},{id:"new-window",fn:"new-window.svg",cat:"ui"},{id:"nodejs",fn:"nodejs.svg",cat:"social"},{id:"obstacle",fn:"obstacle.svg",cat:"ui"},{id:"organization",fn:"organization.svg",cat:"ui"},{id:"paint-bucket",fn:"paint-bucket.svg",cat:"ui"},{id:"palette",fn:"palette.svg",cat:"ui"},{id:"paragraph",fn:"paragraph.svg",cat:"ui"},{id:"park",fn:"park.svg",cat:"services"},{id:"partner-workout",fn:"partner-workout.svg",cat:"people-and-health"},{id:"paste",fn:"paste.svg",cat:"ui"},{id:"picture",fn:"picture.svg",cat:"ui"},{id:"placeholder-icon",fn:"placeholder-icon.svg",cat:"ui"},{id:"plus-circle-fill",fn:"plus-circle-fill.svg",cat:"plusminus"},{id:"plus-circle",fn:"plus-circle.svg",cat:"plusminus"},{id:"plus-sign",fn:"plus-sign.svg",cat:"plusminus"},{id:"pride-heart",fn:"pride-heart.svg",cat:"people-and-health"},{id:"print",fn:"print.svg",cat:"ui"},{id:"privacy",fn:"privacy.svg",cat:"ui"},{id:"punkt-circle-blue",fn:"punkt-circle-blue.svg",cat:"social"},{id:"qr-code",fn:"qr-code.svg",cat:"ui"},{id:"question",fn:"question.svg",cat:"ui"},{id:"react",fn:"react.svg",cat:"social"},{id:"receipt",fn:"receipt.svg",cat:"ui"},{id:"recycling",fn:"recycling.svg",cat:"services"},{id:"restaurant",fn:"restaurant.svg",cat:"sign"},{id:"ruler",fn:"ruler.svg",cat:"ui"},{id:"sass",fn:"sass.svg",cat:"social"},{id:"save",fn:"save.svg",cat:"ui"},{id:"scooter",fn:"scooter.svg",cat:"ui"},{id:"share-outline",fn:"share-outline.svg",cat:"ui"},{id:"share",fn:"share.svg",cat:"ui"},{id:"slack",fn:"slack.svg",cat:"social"},{id:"smiley-neutral",fn:"smiley-neutral.svg",cat:"feedback"},{id:"smiley-sad",fn:"smiley-sad.svg",cat:"feedback"},{id:"smiley-smile",fn:"smiley-smile.svg",cat:"feedback"},{id:"sort",fn:"sort.svg",cat:"ui"},{id:"sound-off",fn:"sound-off.svg",cat:"ui"},{id:"sound-on",fn:"sound-on.svg",cat:"ui"},{id:"sparkles",fn:"sparkles.svg",cat:"ui"},{id:"svg-logo",fn:"svg.svg",cat:"social"},{id:"swingset",fn:"swingset.svg",cat:"services"},{id:"table",fn:"table.svg",cat:"ui"},{id:"tap",fn:"tap.svg",cat:"ui"},{id:"target",fn:"target.svg",cat:"ui"},{id:"thumbs-down",fn:"thumbs-down.svg",cat:"feedback"},{id:"thumbs-up",fn:"thumbs-up.svg",cat:"feedback"},{id:"tickets",fn:"tickets.svg",cat:"none"},{id:"trail",fn:"trail.svg",cat:"sign"},{id:"trash-can",fn:"trash-can.svg",cat:"ui"},{id:"trash",fn:"trash.svg",cat:"sign"},{id:"twitter",fn:"twitter.svg",cat:"social"},{id:"two-people-dancing",fn:"two-people-dancing.svg",cat:"people-and-health"},{id:"two-people-talking",fn:"two-people-talking.svg",cat:"people-and-health"},{id:"user",fn:"user.svg",cat:"ui"},{id:"vertical-menu",fn:"vertical-menu.svg",cat:"ui"},{id:"vue",fn:"vue.svg",cat:"social"},{id:"wardrobe-boys",fn:"wardrobe-boys.svg",cat:"sign"},{id:"wardrobe-girls",fn:"wardrobe-girls.svg",cat:"sign"},{id:"wardrobe",fn:"wardrobe.svg",cat:"sign"},{id:"water-faucet",fn:"water-faucet.svg",cat:"services"},{id:"wheelchair",fn:"wheelchair.svg",cat:"none"},{id:"wifi",fn:"wifi.svg",cat:"sign"},{id:"wine-bottle",fn:"wine-bottle.svg",cat:"people-and-health"},{id:"workplace",fn:"workplace.svg",cat:"social"},{id:"wrench",fn:"wrench.svg",cat:"ui"}],H1=({propKey:n,spec:r,props:o,handleChange:u})=>{const f={BOOLEAN:"boolean",ICON:"icon",ARRAY:"array",OBJECT:"object",DATE:"ISOdatestring",NUMBER:"number",STRING:"string"},g=(_,$)=>{u(n,{...o[n],[_]:$})},v=(_,$,N)=>{const R=[...o[n]];R[_]={...R[_],[$]:N},u(n,R)},C=()=>{const _=[...o[n],{}];u(n,_)},E=_=>{const $=o[n].filter((N,R)=>R!==_);u(n,$)};if(r.type===f.BOOLEAN)return L.jsx(xC,{label:r.name||n,forId:n,helptext:r.description||null,hasFieldset:!0,requiredTag:r.required,children:L.jsx(jk,{id:n,label:n,type:"checkbox",checked:o[n]||!1,onChange:_=>u(n,_.target.checked,r.displayAsFalse),labelPosition:"right",isSwitch:!0})});if(r.type===f.ICON)return L.jsxs(lb,{label:r.name||n,helptext:r.description||null,id:n,value:o[n]||"",onChange:_=>u(n,_.target.value),requiredTag:r.required,children:[L.jsx("option",{value:""}),tM.map(_=>L.jsx("option",{value:_.id,children:_.id},_.id))]});if(r.type===f.DATE)return L.jsx(Ik,{id:n,label:r.name||n,helptext:r.description||null,value:o[n]||"",multiple:r.variant==="multiple",maxlength:999,onChange:_=>u(n,_.target.value),requiredTag:r.required});if(Array.isArray(r)||Array.isArray(r.type)||Array.isArray(r.values)){const _=Array.isArray(r)?r:r.values||r.type;return L.jsxs(lb,{label:r.name||n,helptext:r.description||null,id:n,value:o[n],onChange:$=>u(n,$.target.value),requiredTag:r.required,children:[L.jsx("option",{value:""}),_.map($=>L.jsx("option",{value:$,children:$},$))]})}return r.type===f.NUMBER?L.jsx(Lg,{id:n,label:r.name||n,helptext:r.description||null,type:"number",value:o[n]||"",onChange:_=>u(n,parseFloat(_.currentTarget.value)),requiredTag:r.required}):r.type===f.OBJECT?(o[n]||(o[n]={}),L.jsxs("div",{children:[L.jsx("div",{className:"pkt-inputwrapper__label",children:L.jsx("h2",{children:r.name||n})}),r.description&&L.jsx("p",{children:r.description}),L.jsxs("fieldset",{children:[L.jsx("legend",{children:r.name||n}),Object.entries(r.properties).map(([_,$])=>L.jsx(H1,{propKey:_,props:o[n],spec:$,handleChange:(N,R)=>g(N,R)},_))]})]})):r.type===f.ARRAY&&r.items.type===f.OBJECT?(o[n]||(o[n]=[]),L.jsxs("div",{children:[L.jsx("div",{className:"pkt-inputwrapper__label",children:L.jsx("h2",{children:r.name||n})}),r.description&&L.jsx("p",{children:r.description}),o[n].map((_,$)=>L.jsx("div",{children:L.jsxs("fieldset",{children:[L.jsxs("legend",{children:["Item ",$+1]}),Object.entries(r.items.properties).map(([N,R])=>L.jsx(H1,{propKey:N,props:_,spec:R,handleChange:(B,M)=>v($,B,M)},N)),L.jsx(Jc,{onClick:()=>E($),children:"Fjern denne"})]})},$)),L.jsx(Jc,{onClick:C,children:"Legg til ny"})]})):L.jsx(Lg,{id:n,label:r.name||n,helptext:r.description||null,type:"text",value:o[n]||"",onChange:_=>u(n,r.type==="number"?parseFloat(_.currentTarget.value):_.currentTarget.value),requiredTag:r.required})};Og.registerLanguage("jsx",K4);const u_=({specs:n,children:r,fullWidth:o})=>{var Pe,Ze;const u=n.props&&typeof n.props=="object"&&!Array.isArray(n.props)?Object.entries(n.props).reduce((Ne,[Be,ve])=>(typeof ve=="object"&&!Array.isArray(ve)&&ve.default!==void 0&&ve.default!==null&&(ve.default==="false"&&(ve.default=!1),ve.default==="true"&&(ve.default=!0),Ne[Be]=ve.default),Ne),{}):{},[f,g]=je.useState(0),[v,C]=je.useState(u),[E,_]=je.useState("light"),[$,N]=je.useState(""),[R,B]=je.useState(""),[M,V]=je.useState(""),[H,ge]=je.useState("Rediger innhold"),[K,Y]=je.useState([{text:"Rediger",icon:"adjust",active:!0},{text:"Kode (React)",icon:"react",active:!1},{text:`Kode (${n.isElement?"Element":"HTML"})`,icon:"code",active:!1},{text:"Egenskaper",icon:"list",active:!1}]),ne=Ne=>{Ne===1&&oe(),Ne===2&&ae(),V(""),Y(Be=>Be.map((ve,Re)=>({...ve,active:Re===Ne})))},U=je.useRef(null),ae=async()=>{if(n.isElement&&je.isValidElement(Ye)){const Ne=je.isValidElement(Ye)?Ye.type.displayName||Ye.type.name:n.name,Be=Object.entries(v).map(([Re,xe])=>{if(xe&&!ye(xe)&&!Ve(xe))return typeof xe=="object"?`${Re}='${JSON.stringify(xe)}'`:`${Re}="${xe}"`}).join(" "),ve=await eb(`<${n.name||Ne} ${Be}>${H}</${n.name||Ne}>`,{parser:"html",plugins:[fE]});N(`<!-- Denne koden bør testes grundig før bruk. Spør en Punkt-utvikler om du er usikker. -->
|
|
1192
|
+
`)})})]}):L.jsxs(L.Fragment,{children:[L.jsx(Ho,{dataLabel:"Beskrivelse",children:L.jsx("span",{dangerouslySetInnerHTML:{__html:f.description||""}})}),L.jsx(Ho,{dataLabel:"Type",children:L.jsx("pre",{children:f.type&&r(f.type)})}),L.jsx(Ho,{dataLabel:"Standardverdi",children:L.jsx("pre",{children:o(f.default)})})]})]},u))})]}),n.events&&L.jsxs(L.Fragment,{children:[L.jsx("h2",{children:"Hendelser / handlinger"}),L.jsxs(ib,{compact:!0,children:[L.jsx(ob,{children:L.jsxs(Mp,{children:[L.jsx(Qs,{children:"Event"}),L.jsx(Qs,{children:"Beskrivelse"}),L.jsx(Qs,{children:"Type"})]})}),L.jsx(sb,{children:Object.entries(n.events||{}).map(([u,f])=>L.jsxs(Mp,{children:[L.jsx(Ho,{dataLabel:"Event",children:L.jsx("pre",{children:u})}),L.jsx(Ho,{dataLabel:"Beskrivelse",children:L.jsx("span",{dangerouslySetInnerHTML:{__html:f.description||""}})}),L.jsx(Ho,{dataLabel:"Type",children:f.type})]},u))})]})]}),n.slots&&L.jsxs(L.Fragment,{children:[L.jsx("h2",{children:"Innhold"}),L.jsxs(ib,{compact:!0,children:[L.jsx(ob,{children:L.jsxs(Mp,{children:[L.jsx(Qs,{children:"Slot"}),L.jsx(Qs,{children:"Beskrivelse"})]})}),L.jsx(sb,{children:Object.entries(n.slots||{}).map(([u,f])=>L.jsxs(Mp,{children:[L.jsx(Ho,{dataLabel:"Slot",children:L.jsx("pre",{children:u})}),L.jsx(Ho,{dataLabel:"Beskrivelse",children:L.jsx("span",{dangerouslySetInnerHTML:{__html:f.description||""}})})]},u))})]})]})]})},eM=ga({tagName:"pkt-select",elementClass:uh,react:je,displayName:"PktSelect",events:{onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"valueChange",onToggleHelpText:"toggleHelpText"}}),lb=je.forwardRef(({children:n,helptext:r,...o},u)=>L.jsxs(eM,{ref:u,...o,children:[r&&L.jsx("div",{slot:"helptext",className:"pkt-contents",children:r}),n]}));lb.displayName="PktSelect";const tM=[{id:"24h",fn:"24h.svg",cat:"services"},{id:"active-person",fn:"active-person.svg",cat:"people-and-health"},{id:"adjust",fn:"adjust.svg",cat:"ui"},{id:"advice",fn:"advice.svg",cat:"ui"},{id:"alert-circle",fn:"alert-circle.svg",cat:"ui"},{id:"alert-error",fn:"alert-error.svg",cat:"ui"},{id:"alert-information",fn:"alert-information.svg",cat:"ui"},{id:"alert-success",fn:"alert-success.svg",cat:"ui"},{id:"alert-warning",fn:"alert-warning.svg",cat:"ui"},{id:"apple",fn:"apple.svg",cat:"ui"},{id:"archive",fn:"archive.svg",cat:"ui"},{id:"arrow-circle",fn:"arrow-circle.svg",cat:"ui"},{id:"arrow-return",fn:"arrow-return.svg",cat:"arrows"},{id:"arrow",fn:"arrow.svg",cat:"arrows"},{id:"attachment",fn:"attachment.svg",cat:"ui"},{id:"backpack",fn:"backpack.svg",cat:"services"},{id:"balloons",fn:"balloons.svg",cat:"ui"},{id:"books",fn:"books.svg",cat:"services"},{id:"brain-heart",fn:"brain-heart.svg",cat:"people-and-health"},{id:"brain-signal",fn:"brain-signal.svg",cat:"people-and-health"},{id:"briefcase",fn:"briefcase.svg",cat:"sign"},{id:"bullseye",fn:"bullseye.svg",cat:"ui"},{id:"bus",fn:"bus.svg",cat:"services"},{id:"cafe",fn:"cafe.svg",cat:"sign"},{id:"calendar",fn:"calendar.svg",cat:"ui"},{id:"camera",fn:"camera.svg",cat:"ui"},{id:"car",fn:"car.svg",cat:"sign"},{id:"care-room",fn:"care-room.svg",cat:"sign"},{id:"character-exclamation-mark",fn:"character-exclamation-mark.svg",cat:"ui"},{id:"character-information",fn:"character-information.svg",cat:"ui"},{id:"check-big",fn:"check-big.svg",cat:"ui"},{id:"check-circle",fn:"check-circle.svg",cat:"ui"},{id:"check-medium",fn:"check-medium.svg",cat:"ui"},{id:"check",fn:"check.svg",cat:"ui"},{id:"chevron-down",fn:"chevron-down.svg",cat:"arrows"},{id:"chevron-left",fn:"chevron-left.svg",cat:"arrows"},{id:"chevron-right",fn:"chevron-right.svg",cat:"arrows"},{id:"chevron-thin-down",fn:"chevron-thin-down.svg",cat:"arrows"},{id:"chevron-thin-left",fn:"chevron-thin-left.svg",cat:"arrows"},{id:"chevron-thin-right",fn:"chevron-thin-right.svg",cat:"arrows"},{id:"chevron-thin-up",fn:"chevron-thin-up.svg",cat:"arrows"},{id:"chevron-up-and-down",fn:"chevron-up-and-down.svg",cat:"ui"},{id:"chevron-up",fn:"chevron-up.svg",cat:"arrows"},{id:"clock-history",fn:"clock-history.svg",cat:"ui"},{id:"clock",fn:"clock.svg",cat:"ui"},{id:"",fn:"close.svg",cat:"none"},{id:"cloud",fn:"cloud.svg",cat:"ui"},{id:"code",fn:"code.svg",cat:"ui"},{id:"coffee",fn:"coffee.svg",cat:"sign"},{id:"cogwheel",fn:"cogwheel.svg",cat:"ui"},{id:"coin-stacks",fn:"coin-stacks.svg",cat:"services"},{id:"computer",fn:"computer.svg",cat:"ui"},{id:"copy",fn:"copy.svg",cat:"ui"},{id:"crane",fn:"crane.svg",cat:"services"},{id:"cross-circle-big",fn:"cross-circle-big.svg",cat:"ui"},{id:"cross-circle-fill-large",fn:"cross-circle-fill-large.svg",cat:"none"},{id:"cross-circle-fill",fn:"cross-circle-fill.svg",cat:"ui"},{id:"cross-circle",fn:"cross-circle.svg",cat:"ui"},{id:"cross",fn:"cross.svg",cat:"ui"},{id:"data",fn:"data.svg",cat:"ui"},{id:"defibrillators",fn:"defibrillators.svg",cat:"sign"},{id:"district",fn:"district.svg",cat:"ui"},{id:"document-code",fn:"document-code.svg",cat:"ui"},{id:"document-pdf",fn:"document-pdf.svg",cat:"ui"},{id:"document-plain",fn:"document-plain.svg",cat:"ui"},{id:"document-table",fn:"document-table.svg",cat:"ui"},{id:"document-text",fn:"document-text.svg",cat:"ui"},{id:"download",fn:"download.svg",cat:"ui"},{id:"drag",fn:"drag.svg",cat:"ui"},{id:"drinking-area-refreshments",fn:"drinking-area-refreshments.svg",cat:"sign"},{id:"ecg-heart",fn:"ecg-heart.svg",cat:"people-and-health"},{id:"edit",fn:"edit.svg",cat:"ui"},{id:"email",fn:"email.svg",cat:"ui"},{id:"exclamation-mark-circle",fn:"exclamation-mark-circle.svg",cat:"ui"},{id:"exclamation-mark-square",fn:"exclamation-mark-square.svg",cat:"ui"},{id:"exit",fn:"exit.svg",cat:"ui"},{id:"expand",fn:"expand.svg",cat:"ui"},{id:"eye",fn:"eye.svg",cat:"ui"},{id:"face-almost-happy",fn:"face-almost-happy.svg",cat:"feedback"},{id:"face-almost-sad",fn:"face-almost-sad.svg",cat:"feedback"},{id:"face-happy",fn:"face-happy.svg",cat:"feedback"},{id:"face-neutral",fn:"face-neutral.svg",cat:"feedback"},{id:"face-sad",fn:"face-sad.svg",cat:"feedback"},{id:"facebook",fn:"facebook.svg",cat:"social"},{id:"factory-fill",fn:"factory-fill.svg",cat:"ui"},{id:"feedback",fn:"feedback.svg",cat:"ui"},{id:"figma",fn:"figma.svg",cat:"social"},{id:"filter",fn:"filter.svg",cat:"ui"},{id:"fire-safety",fn:"fire-safety.svg",cat:"people-and-health"},{id:"folder",fn:"folder.svg",cat:"ui"},{id:"game-console",fn:"game-console.svg",cat:"ui"},{id:"github",fn:"github.svg",cat:"social"},{id:"graph",fn:"graph.svg",cat:"ui"},{id:"grid",fn:"grid.svg",cat:"ui"},{id:"hands-globe",fn:"hands-globe.svg",cat:"people-and-health"},{id:"headset",fn:"headset.svg",cat:"ui"},{id:"heart-hand",fn:"heart-hand.svg",cat:"people-and-health"},{id:"heart-plus",fn:"heart-plus.svg",cat:"services"},{id:"heart",fn:"heart.svg",cat:"ui"},{id:"holding-hands",fn:"holding-hands.svg",cat:"people-and-health"},{id:"home",fn:"home.svg",cat:"ui"},{id:"horizontal-menu",fn:"horizontal-menu.svg",cat:"ui"},{id:"house-heart",fn:"house-heart.svg",cat:"services"},{id:"information",fn:"information.svg",cat:"ui"},{id:"instagram",fn:"instagram.svg",cat:"social"},{id:"invoice",fn:"invoice.svg",cat:"ui"},{id:"key",fn:"key.svg",cat:"ui"},{id:"language",fn:"language.svg",cat:"ui"},{id:"law-paragraph",fn:"law-paragraph.svg",cat:"ui"},{id:"lecture-workplace",fn:"lecture-workplace.svg",cat:"sign"},{id:"link",fn:"link.svg",cat:"ui"},{id:"linkedin",fn:"linkedin.svg",cat:"social"},{id:"list",fn:"list.svg",cat:"ui"},{id:"location-pin-filled",fn:"location-pin-filled.svg",cat:"ui"},{id:"location-pin",fn:"location-pin.svg",cat:"ui"},{id:"lock-locked",fn:"lock-locked.svg",cat:"ui"},{id:"lock-unlocked",fn:"lock-unlocked.svg",cat:"ui"},{id:"magnifying-glass-big",fn:"magnifying-glass-big.svg",cat:"ui"},{id:"magnifying-glass-small",fn:"magnifying-glass-small.svg",cat:"ui"},{id:"map",fn:"map.svg",cat:"ui"},{id:"medicine-cabinet",fn:"medicine-cabinet.svg",cat:"ui"},{id:"menu",fn:"menu.svg",cat:"ui"},{id:"message",fn:"message.svg",cat:"ui"},{id:"minimize",fn:"minimize.svg",cat:"ui"},{id:"minus-circle-fill",fn:"minus-circle-fill.svg",cat:"plusminus"},{id:"minus-circle",fn:"minus-circle.svg",cat:"plusminus"},{id:"minus-sign",fn:"minus-sign.svg",cat:"plusminus"},{id:"mobile-phone",fn:"mobile-phone.svg",cat:"ui"},{id:"music-notes",fn:"music-notes.svg",cat:"ui"},{id:"new-window-small",fn:"new-window-small.svg",cat:"ui"},{id:"new-window",fn:"new-window.svg",cat:"ui"},{id:"nodejs",fn:"nodejs.svg",cat:"social"},{id:"obstacle",fn:"obstacle.svg",cat:"ui"},{id:"organization",fn:"organization.svg",cat:"ui"},{id:"paint-bucket",fn:"paint-bucket.svg",cat:"ui"},{id:"palette",fn:"palette.svg",cat:"ui"},{id:"paragraph",fn:"paragraph.svg",cat:"ui"},{id:"park",fn:"park.svg",cat:"services"},{id:"partner-workout",fn:"partner-workout.svg",cat:"people-and-health"},{id:"paste",fn:"paste.svg",cat:"ui"},{id:"picture",fn:"picture.svg",cat:"ui"},{id:"placeholder-icon",fn:"placeholder-icon.svg",cat:"ui"},{id:"plus-circle-fill",fn:"plus-circle-fill.svg",cat:"plusminus"},{id:"plus-circle",fn:"plus-circle.svg",cat:"plusminus"},{id:"plus-sign",fn:"plus-sign.svg",cat:"plusminus"},{id:"pride-heart",fn:"pride-heart.svg",cat:"people-and-health"},{id:"print",fn:"print.svg",cat:"ui"},{id:"privacy",fn:"privacy.svg",cat:"ui"},{id:"punkt-circle-blue",fn:"punkt-circle-blue.svg",cat:"social"},{id:"qr-code",fn:"qr-code.svg",cat:"ui"},{id:"question",fn:"question.svg",cat:"ui"},{id:"react",fn:"react.svg",cat:"social"},{id:"receipt",fn:"receipt.svg",cat:"ui"},{id:"recycling",fn:"recycling.svg",cat:"services"},{id:"restaurant",fn:"restaurant.svg",cat:"sign"},{id:"ruler",fn:"ruler.svg",cat:"ui"},{id:"sass",fn:"sass.svg",cat:"social"},{id:"save",fn:"save.svg",cat:"ui"},{id:"scooter",fn:"scooter.svg",cat:"ui"},{id:"share-outline",fn:"share-outline.svg",cat:"ui"},{id:"share",fn:"share.svg",cat:"ui"},{id:"shield-fire",fn:"shield-fire.svg",cat:"services"},{id:"shield-law-paragraph",fn:"shield-law-paragraph.svg",cat:"ui"},{id:"slack",fn:"slack.svg",cat:"social"},{id:"smiley-neutral",fn:"smiley-neutral.svg",cat:"feedback"},{id:"smiley-sad",fn:"smiley-sad.svg",cat:"feedback"},{id:"smiley-smile",fn:"smiley-smile.svg",cat:"feedback"},{id:"sort",fn:"sort.svg",cat:"ui"},{id:"sound-off",fn:"sound-off.svg",cat:"ui"},{id:"sound-on",fn:"sound-on.svg",cat:"ui"},{id:"sparkles",fn:"sparkles.svg",cat:"ui"},{id:"svg-logo",fn:"svg.svg",cat:"social"},{id:"swingset",fn:"swingset.svg",cat:"services"},{id:"table",fn:"table.svg",cat:"ui"},{id:"tap",fn:"tap.svg",cat:"ui"},{id:"target",fn:"target.svg",cat:"ui"},{id:"thumbs-down",fn:"thumbs-down.svg",cat:"feedback"},{id:"thumbs-up",fn:"thumbs-up.svg",cat:"feedback"},{id:"tickets",fn:"tickets.svg",cat:"none"},{id:"trail",fn:"trail.svg",cat:"sign"},{id:"trash-can",fn:"trash-can.svg",cat:"ui"},{id:"trash",fn:"trash.svg",cat:"sign"},{id:"twitter",fn:"twitter.svg",cat:"social"},{id:"two-people-dancing",fn:"two-people-dancing.svg",cat:"people-and-health"},{id:"two-people-talking",fn:"two-people-talking.svg",cat:"people-and-health"},{id:"user",fn:"user.svg",cat:"ui"},{id:"vertical-menu",fn:"vertical-menu.svg",cat:"ui"},{id:"vue",fn:"vue.svg",cat:"social"},{id:"wardrobe-boys",fn:"wardrobe-boys.svg",cat:"sign"},{id:"wardrobe-girls",fn:"wardrobe-girls.svg",cat:"sign"},{id:"wardrobe",fn:"wardrobe.svg",cat:"sign"},{id:"water-faucet",fn:"water-faucet.svg",cat:"services"},{id:"wheelchair",fn:"wheelchair.svg",cat:"none"},{id:"wifi",fn:"wifi.svg",cat:"sign"},{id:"wine-bottle",fn:"wine-bottle.svg",cat:"people-and-health"},{id:"workplace",fn:"workplace.svg",cat:"social"},{id:"wrench",fn:"wrench.svg",cat:"ui"}],H1=({propKey:n,spec:r,props:o,handleChange:u})=>{const f={BOOLEAN:"boolean",ICON:"icon",ARRAY:"array",OBJECT:"object",DATE:"ISOdatestring",NUMBER:"number",STRING:"string"},g=(_,$)=>{u(n,{...o[n],[_]:$})},v=(_,$,N)=>{const R=[...o[n]];R[_]={...R[_],[$]:N},u(n,R)},C=()=>{const _=[...o[n],{}];u(n,_)},E=_=>{const $=o[n].filter((N,R)=>R!==_);u(n,$)};if(r.type===f.BOOLEAN)return L.jsx(xC,{label:r.name||n,forId:n,helptext:r.description||null,hasFieldset:!0,requiredTag:r.required,children:L.jsx(jk,{id:n,label:n,type:"checkbox",checked:o[n]||!1,onChange:_=>u(n,_.target.checked,r.displayAsFalse),labelPosition:"right",isSwitch:!0})});if(r.type===f.ICON)return L.jsxs(lb,{label:r.name||n,helptext:r.description||null,id:n,value:o[n]||"",onChange:_=>u(n,_.target.value),requiredTag:r.required,children:[L.jsx("option",{value:""}),tM.map(_=>L.jsx("option",{value:_.id,children:_.id},_.id))]});if(r.type===f.DATE)return L.jsx(Ik,{id:n,label:r.name||n,helptext:r.description||null,value:o[n]||"",multiple:r.variant==="multiple",maxlength:999,onChange:_=>u(n,_.target.value),requiredTag:r.required});if(Array.isArray(r)||Array.isArray(r.type)||Array.isArray(r.values)){const _=Array.isArray(r)?r:r.values||r.type;return L.jsxs(lb,{label:r.name||n,helptext:r.description||null,id:n,value:o[n],onChange:$=>u(n,$.target.value),requiredTag:r.required,children:[L.jsx("option",{value:""}),_.map($=>L.jsx("option",{value:$,children:$},$))]})}return r.type===f.NUMBER?L.jsx(Lg,{id:n,label:r.name||n,helptext:r.description||null,type:"number",value:o[n]||"",onChange:_=>u(n,parseFloat(_.currentTarget.value)),requiredTag:r.required}):r.type===f.OBJECT?(o[n]||(o[n]={}),L.jsxs("div",{children:[L.jsx("div",{className:"pkt-inputwrapper__label",children:L.jsx("h2",{children:r.name||n})}),r.description&&L.jsx("p",{children:r.description}),L.jsxs("fieldset",{children:[L.jsx("legend",{children:r.name||n}),Object.entries(r.properties).map(([_,$])=>L.jsx(H1,{propKey:_,props:o[n],spec:$,handleChange:(N,R)=>g(N,R)},_))]})]})):r.type===f.ARRAY&&r.items.type===f.OBJECT?(o[n]||(o[n]=[]),L.jsxs("div",{children:[L.jsx("div",{className:"pkt-inputwrapper__label",children:L.jsx("h2",{children:r.name||n})}),r.description&&L.jsx("p",{children:r.description}),o[n].map((_,$)=>L.jsx("div",{children:L.jsxs("fieldset",{children:[L.jsxs("legend",{children:["Item ",$+1]}),Object.entries(r.items.properties).map(([N,R])=>L.jsx(H1,{propKey:N,props:_,spec:R,handleChange:(B,M)=>v($,B,M)},N)),L.jsx(Jc,{onClick:()=>E($),children:"Fjern denne"})]})},$)),L.jsx(Jc,{onClick:C,children:"Legg til ny"})]})):L.jsx(Lg,{id:n,label:r.name||n,helptext:r.description||null,type:"text",value:o[n]||"",onChange:_=>u(n,r.type==="number"?parseFloat(_.currentTarget.value):_.currentTarget.value),requiredTag:r.required})};Og.registerLanguage("jsx",K4);const u_=({specs:n,children:r,fullWidth:o})=>{var Pe,Ze;const u=n.props&&typeof n.props=="object"&&!Array.isArray(n.props)?Object.entries(n.props).reduce((Ne,[Be,ve])=>(typeof ve=="object"&&!Array.isArray(ve)&&ve.default!==void 0&&ve.default!==null&&(ve.default==="false"&&(ve.default=!1),ve.default==="true"&&(ve.default=!0),Ne[Be]=ve.default),Ne),{}):{},[f,g]=je.useState(0),[v,C]=je.useState(u),[E,_]=je.useState("light"),[$,N]=je.useState(""),[R,B]=je.useState(""),[M,V]=je.useState(""),[H,ge]=je.useState("Rediger innhold"),[K,Y]=je.useState([{text:"Rediger",icon:"adjust",active:!0},{text:"Kode (React)",icon:"react",active:!1},{text:`Kode (${n.isElement?"Element":"HTML"})`,icon:"code",active:!1},{text:"Egenskaper",icon:"list",active:!1}]),ne=Ne=>{Ne===1&&oe(),Ne===2&&ae(),V(""),Y(Be=>Be.map((ve,Re)=>({...ve,active:Re===Ne})))},U=je.useRef(null),ae=async()=>{if(n.isElement&&je.isValidElement(Ye)){const Ne=je.isValidElement(Ye)?Ye.type.displayName||Ye.type.name:n.name,Be=Object.entries(v).map(([Re,xe])=>{if(xe&&!ye(xe)&&!Ve(xe))return typeof xe=="object"?`${Re}='${JSON.stringify(xe)}'`:`${Re}="${xe}"`}).join(" "),ve=await eb(`<${n.name||Ne} ${Be}>${H}</${n.name||Ne}>`,{parser:"html",plugins:[fE]});N(`<!-- Denne koden bør testes grundig før bruk. Spør en Punkt-utvikler om du er usikker. -->
|
|
1193
1193
|
`+ve)}else{const Ne=await eb(U.current.innerHTML,{parser:"html",plugins:[fE]});N(Ne.replace(/<\!--.*?-->/g,""))}},oe=async()=>{const Ne=await qR(Ye);return B(Ne),Promise.resolve()},Te=(Ne,Be)=>{navigator.clipboard.writeText(Be).then(()=>{V(Ne),console.log("Copied to clipboard",Ne)})},ye=Ne=>Array.isArray(Ne)&&Ne.length===0,Ve=Ne=>Ne&&typeof Ne=="object"&&!Object.keys(Ne).length,rt=(Ne,Be)=>L.jsxs("div",{className:"pkt-preview__copy",children:[M===Ne&&L.jsx("span",{className:"pkt-preview__copied",children:"Kode kopiert til utklippstavle"}),L.jsx(Jc,{skin:"tertiary",variant:"icon-only",size:"small",iconName:"copy",onClick:()=>Te(Ne,Be),children:"Kopier kode"})]}),Ye=je.isValidElement(r)&&je.cloneElement(r,{...v},r.props.children?r.props.children:(Pe=n.slots)!=null&&Pe.default?H:null),Fe=(Ne,Be,ve=!1)=>{if(g(f+1),!ve&&(!Be||Be=="false")){const{[Ne]:Re,...xe}=v;C(xe)}else C(Re=>({...Re,[Ne]:Be}))};return L.jsxs("div",{className:"pkt-preview",children:[L.jsxs("div",{className:"pkt-preview__component-container","data-mode":E,children:[n["dark-mode"]&&L.jsx("div",{className:"pkt-preview__mode",children:L.jsx(jk,{id:"mode",label:"Dark mode",type:"checkbox",checked:E==="dark",onChange:Ne=>_(Ne.target.checked?"dark":"light"),labelPosition:"right",isSwitch:!0})}),L.jsx("div",{className:`pkt-preview__component ${o&&"pkt-preview__component--fullwidth"}`,ref:U,children:L.jsx("div",{children:Ye})},f)]}),L.jsx(l_,{tabs:K,onTabSelected:ne}),L.jsxs("div",{className:`pkt-grid pkt-preview__opts ${K[0].active?"":"pkt-hide"}`,children:[((Ze=n.slots)==null?void 0:Ze.default)&&!r.props.children&&L.jsxs("div",{className:"pkt-cell pkt-cell--span12 pkt-cell--span6-phablet-up",children:[L.jsx(Dh,{size:"small",skin:"blue-light",textStyle:"thin-text",children:"children"}),L.jsx(Lg,{id:"slot",label:"Slot",helptext:n.slots.default.description||"Innholdet i slot",type:"text",value:H,onChange:Ne=>ge(Ne.currentTarget.value)})]}),n.props&&typeof n.props=="object"&&!Array.isArray(n.props)?Object.entries(n.props).map(([Ne,Be])=>L.jsxs("div",{className:"pkt-cell pkt-cell--span12 pkt-cell--span6-phablet-up",children:[L.jsx(Dh,{size:"small",skin:"blue-light",textStyle:"thin-text",children:Ne}),L.jsx(H1,{propKey:Ne,props:v,spec:Be,handleChange:Fe})]},Ne)):L.jsx("p",{children:"OBS! Specs mangler props!"})]}),L.jsxs("div",{className:`pkt-preview__code ${K[1].active?"":"pkt-hide"}`,children:[L.jsx(Og,{language:"jsx",style:s_,children:R}),rt("jsx",R)]}),L.jsxs("div",{className:`pkt-preview__code ${K[2].active?"":"pkt-hide"}`,children:[L.jsx(Og,{language:"html",style:s_,children:$}),rt("html",$)]}),L.jsx("div",{className:`pkt-preview__specs ${K[3].active?"":"pkt-hide"}`,children:L.jsx(J4,{specs:n})})]})};u_.displayName="PktPreview";const nM=ga({tagName:"pkt-progressbar",elementClass:Zr,react:je,displayName:"PktProgressbar",events:{}}),c_=je.forwardRef(({children:n,...r},o)=>L.jsx(nM,{ref:o,...r,children:L.jsx("div",{className:"pkt-contents",children:n})}));c_.displayName="PktProgressbar";const rM=ga({tagName:"pkt-radiobutton",elementClass:Pl,react:je,displayName:"PktRadioButton",events:{onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"valueChange"}}),aM=je.forwardRef(({appearance:n="local",disabled:r=!1,fullwidth:o=!1,id:u,label:f,name:g,placeholder:v="Søk…",suggestions:C,value:E="",action:_,method:$,onChange:N,onSearch:R,onSuggestionClick:B,...M},V)=>{const H=(U,ae)=>{U?U():B&&B(ae)},ge=U=>{E=U.target.value},K=`pkt-searchinput pkt-searchinput--${n} ${o?"pkt-searchinput--fullwidth":""}`,Y=f?"label":"div";let ne;return _?ne=U=>L.jsx("form",{role:"search",className:K,action:_,method:$,children:U}):ne=U=>L.jsx("div",{role:"search",className:K,children:U}),ne(L.jsxs(L.Fragment,{children:[L.jsxs(Y,{htmlFor:f?u:void 0,className:f?"pkt-inputwrapper__label":"",children:[f&&L.jsx(L.Fragment,{children:f}),L.jsxs("div",{className:n==="local"?"pkt-input__container":"pkt-searchinput__field",children:[L.jsx("input",{className:`pkt-input ${o?"pkt-input--fullwidth":""}`,type:"search",name:g||u,id:u,placeholder:v,defaultValue:E,disabled:r,autoComplete:"off","aria-autocomplete":"list",ref:V,"aria-controls":`${u}-suggestions`,onChange:N||ge,onKeyUp:R&&(U=>{U.key==="Enter"&&(U.preventDefault(),R(E))}),...M}),L.jsx(Jc,{className:`pkt-searchinput__button ${n==="local"?"pkt-input-icon":""}`,variant:"icon-only",iconName:"magnifying-glass-big",skin:n==="local"?"tertiary":"primary",color:n==="global"?"yellow":void 0,type:"submit",disabled:r,onClick:R&&(U=>{U.preventDefault(),R(E)}),children:f||v})]})]}),C&&L.jsx("ul",{id:`${u}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:C.map((U,ae)=>L.jsx("li",{children:je.createElement(U.href?"a":U.onClick?"button":"div",{href:U.href,className:`pkt-searchinput__suggestion ${U.onClick?"pkt-link-button":""} ${U.href||U.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:U.onClick?"button":void 0,onClick:()=>H(U.onClick,ae),onKeyUp:()=>H(U.onClick,ae)},L.jsxs(L.Fragment,{children:[U.title&&L.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:U.title}),U.text&&L.jsx("p",{className:"pkt-searchinput__suggestion-text",children:U.text})]}))},`search-suggestion-${ae}`))})]}))}),iM=je.forwardRef(({activeStep:n,className:r,children:o,hideNonActiveSteps:u=!1,hideNonActiveStepsContent:f=!0,orientation:g="vertical",...v},C)=>{const E=cs(r,"pkt-stepper",g==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),_=je.Children.map(o,($,N)=>je.isValidElement($)?je.cloneElement($,{className:cs($.props.className,{"pkt-step--hideStep":u&&N!==n,"pkt-step--hideContent":f&&N!==n})}):$);return L.jsx("ol",{"data-testid":"pkt-stepper",className:E,ref:C,...v,children:_})}),oM=L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:L.jsx("circle",{cx:"12",cy:"12",r:"7",style:{fill:"var(--pkt-color-grays-grey-200, #CCC)"}})}),sM=L.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[L.jsx("circle",{opacity:".15",cx:"12",cy:"12",r:"12",fill:"#2A2859"}),L.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"#2A2859"})]}),lM=L.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[L.jsx("path",{fill:"#2A2859",d:"M3 3h18v18H3z"}),L.jsx("path",{d:"m10.34 16-1.11-1.14L7 12.58l1.11-1.15 2.23 2.28L15.88 8 17 9.15l-5.55 5.71L10.34 16Z",fill:"#F1FDFF"})]}),uM=({children:n,className:r,status:o="incomplete",title:u})=>L.jsxs("li",{className:cs("pkt-step",r,`pkt-step--${o}`),"data-testid":"pkt-step",children:[L.jsx("span",{className:"pkt-step__line pkt-step__line--1","aria-hidden":!0}),L.jsx("span",{className:"pkt-step__line pkt-step__line--2","aria-hidden":!0}),L.jsx("span",{className:cs("pkt-step__indicator"),children:o==="current"?sM:o==="completed"?lM:oM}),L.jsx("span",{className:"pkt-step__line pkt-step__line--3","aria-hidden":!0}),L.jsxs("div",{className:"pkt-step__wrapper",children:[L.jsx("div",{className:"pkt-step__title",children:u}),L.jsx("div",{className:"pkt-step__content",children:n})]})]}),cM=ga({tagName:"pkt-textarea",elementClass:Ap,react:je,displayName:"PktTextarea",events:{onChange:"change",onInput:"change",onBlur:"blur",onFocus:"focus",onValueChange:"valueChange",onToggleHelpText:"toggleHelpText"}}),d_=je.forwardRef(({helptext:n,...r},o)=>L.jsx(cM,{...r,ref:o,children:n&&L.jsx("div",{slot:"helptext",className:"pkt-contents",children:n})}));d_.displayName="PktTextarea",Bt.PktAccordion=t$,Bt.PktAccordionItem=j3,Bt.PktAlert=kC,Bt.PktBackLink=wC,Bt.PktBreadcrumbs=M3,Bt.PktButton=Jc,Bt.PktCard=DC,Bt.PktCheckbox=jk,Bt.PktDatepicker=Ik,Bt.PktFooter=q3,Bt.PktFooterSimple=W3,Bt.PktHeader=V3,Bt.PktHelptext=SC,Bt.PktIcon=rr,Bt.PktInput=CC,Bt.PktInputWrapper=xC,Bt.PktLink=EC,Bt.PktLinkCard=_C,Bt.PktLoader=TC,Bt.PktMessagebox=AC,Bt.PktModal=FC,Bt.PktPreview=u_,Bt.PktProgressbar=c_,Bt.PktRadioButton=rM,Bt.PktSearchInput=aM,Bt.PktSelect=lb,Bt.PktStep=uM,Bt.PktStepper=iM,Bt.PktTable=ib,Bt.PktTableBody=sb,Bt.PktTableDataCell=Ho,Bt.PktTableHeader=ob,Bt.PktTableHeaderCell=Qs,Bt.PktTableRow=Mp,Bt.PktTabs=l_,Bt.PktTag=Dh,Bt.PktTextarea=d_,Bt.PktTextinput=Lg,Object.defineProperty(Bt,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-react",
|
|
3
|
-
"version": "12.30.
|
|
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.
|
|
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",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"react-syntax-highlighter": "^15.5.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@oslokommune/punkt-assets": "^12.30.
|
|
51
|
-
"@oslokommune/punkt-css": "^12.30.
|
|
50
|
+
"@oslokommune/punkt-assets": "^12.30.1",
|
|
51
|
+
"@oslokommune/punkt-css": "^12.30.1",
|
|
52
52
|
"@testing-library/jest-dom": "^6.5.0",
|
|
53
53
|
"@testing-library/react": "^16.0.1",
|
|
54
54
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -111,5 +111,5 @@
|
|
|
111
111
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
112
112
|
},
|
|
113
113
|
"license": "MIT",
|
|
114
|
-
"gitHead": "
|
|
114
|
+
"gitHead": "a4b93e347c6b9167efadde236794e42aafc18489"
|
|
115
115
|
}
|