@tabworthy/components 0.12.4 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/tabworthy-components.cjs.js +1 -1
- package/dist/cjs/tabworthy-dates-calendar_2.cjs.entry.js +35 -17
- package/dist/cjs/tabworthy-dates.cjs.entry.js +48 -10
- package/dist/cjs/tabworthy-times-picker.cjs.entry.js +82 -10
- package/dist/cjs/tabworthy-times.cjs.entry.js +108 -5
- package/dist/cjs/{utils-y5Vtky2t.js → utils-DGbdK8VF.js} +29 -8
- package/dist/collection/components/tabworthy-dates/tabworthy-dates.js +68 -10
- package/dist/collection/components/tabworthy-dates-calendar/tabworthy-dates-calendar.js +35 -17
- package/dist/collection/components/tabworthy-times/tabworthy-times.js +128 -4
- package/dist/collection/components/tabworthy-times-picker/tabworthy-times-picker.js +128 -10
- package/dist/components/p-BzY8iIVW.js +1 -0
- package/dist/components/p-C_uZGgcG.js +1 -0
- package/dist/components/tabworthy-dates-calendar.js +1 -1
- package/dist/components/tabworthy-dates.js +1 -1
- package/dist/components/tabworthy-times-picker.js +1 -1
- package/dist/components/tabworthy-times.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/tabworthy-components.js +1 -1
- package/dist/esm/tabworthy-dates-calendar_2.entry.js +35 -17
- package/dist/esm/tabworthy-dates.entry.js +48 -10
- package/dist/esm/tabworthy-times-picker.entry.js +82 -10
- package/dist/esm/tabworthy-times.entry.js +108 -5
- package/dist/esm/{utils-BVHu5CWV.js → utils-CoFOnMSw.js} +29 -9
- package/dist/shared/utils/utils.js +28 -8
- package/dist/tabworthy-components/p-69334c34.entry.js +1 -0
- package/dist/tabworthy-components/p-71f5c261.entry.js +1 -0
- package/dist/tabworthy-components/p-7cd6ccc1.entry.js +1 -0
- package/dist/tabworthy-components/{p-BVHu5CWV.js → p-CoFOnMSw.js} +1 -1
- package/dist/tabworthy-components/p-ed3c60d6.entry.js +1 -0
- package/dist/tabworthy-components/tabworthy-components.esm.js +1 -1
- package/dist/themes/light.css +1 -1
- package/dist/types/components/tabworthy-dates/tabworthy-dates.d.ts +7 -0
- package/dist/types/components/tabworthy-times/tabworthy-times.d.ts +8 -1
- package/dist/types/components/tabworthy-times-picker/tabworthy-times-picker.d.ts +15 -0
- package/dist/types/components.d.ts +14 -4
- package/dist/types/home/runner/work/tabworthy-components/tabworthy-components/.stencil/shared/utils/utils.d.ts +6 -0
- package/package.json +1 -1
- package/dist/components/p-BTQaxOHo.js +0 -1
- package/dist/components/p-DAc3jaFB.js +0 -1
- package/dist/tabworthy-components/p-1743bf7a.entry.js +0 -1
- package/dist/tabworthy-components/p-28192b55.entry.js +0 -1
- package/dist/tabworthy-components/p-3b548ae1.entry.js +0 -1
- package/dist/tabworthy-components/p-626a5c0b.entry.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as s,H as i,g as h}from"./p-CwtZ_Lud.js";const a={hours:"Hours",minutes:"Minutes",seconds:"Seconds",am:"AM",pm:"PM",timePicker:"Time picker",incrementHours:"Increment hours",decrementHours:"Decrement hours",incrementMinutes:"Increment minutes",decrementMinutes:"Decrement minutes",incrementSeconds:"Increment seconds",decrementSeconds:"Decrement seconds"},n=class{constructor(s){t(this,s),this.timeChanged=e(this,"timeChanged",7),this.hours=12,this.minutes=0,this.seconds=0,this.useTwelveHourFormat=!1,this.showSeconds=!1,this.labels=a,this.labelsSrOnly=!0,this.disabled=!1,this.elementClassName="tabworthy-times-picker",this.internalHours=this.hours,this.internalMinutes=this.minutes,this.internalSeconds=this.seconds,this.period=this.hours>=12?"PM":"AM",this.handleHourChange=t=>{const e=parseInt(t.target.value,10);this.internalHours=this.useTwelveHourFormat?"AM"===this.period?12===e?0:e:12===e?12:e+12:e,this.emitTimeChange()},this.handleMinuteChange=t=>{this.internalMinutes=parseInt(t.target.value,10),this.emitTimeChange()},this.handlePeriodChange=t=>{if(this.period===t||!this.useTwelveHourFormat)return;this.period=t;const e=this.getDisplayHours();this.internalHours="AM"===t?12===e?0:e:12===e?12:e+12,this.emitTimeChange()},this.handleHourIncrement=()=>{if(this.useTwelveHourFormat){const t=this.getDisplayHours(),e=12===t?1:t+1;this.internalHours="AM"===this.period?12===e?0:e:12===e?12:e+12}else this.internalHours=(this.internalHours+1)%24;this.emitTimeChange()},this.handleHourDecrement=()=>{if(this.useTwelveHourFormat){const t=this.getDisplayHours(),e=1===t?12:t-1;this.internalHours="AM"===this.period?12===e?0:e:12===e?12:e+12}else this.internalHours=0===this.internalHours?23:this.internalHours-1;this.emitTimeChange()},this.handleMinuteIncrement=()=>{this.internalMinutes=(this.internalMinutes+1)%60,this.emitTimeChange()},this.handleMinuteDecrement=()=>{this.internalMinutes=0===this.internalMinutes?59:this.internalMinutes-1,this.emitTimeChange()},this.handleSecondChange=t=>{this.internalSeconds=parseInt(t.target.value,10),this.emitTimeChange()},this.handleSecondIncrement=()=>{this.internalSeconds=(this.internalSeconds+1)%60,this.emitTimeChange()},this.handleSecondDecrement=()=>{this.internalSeconds=0===this.internalSeconds?59:this.internalSeconds-1,this.emitTimeChange()}}watchHours(t){this.internalHours=t,this.period=t>=12?"PM":"AM"}watchMinutes(t){this.internalMinutes=t}watchSeconds(t){this.internalSeconds=t}componentWillLoad(){this.internalHours=this.hours,this.internalMinutes=this.minutes,this.internalSeconds=this.seconds,this.period=this.hours>=12?"PM":"AM"}getDisplayHours(){return this.useTwelveHourFormat?0===this.internalHours?12:this.internalHours>12?this.internalHours-12:this.internalHours:this.internalHours}get24HourValue(){if(!this.useTwelveHourFormat)return this.internalHours;const t=this.getDisplayHours();return"AM"===this.period?12===t?0:t:12===t?12:t+12}emitTimeChange(){this.timeChanged.emit({hours:this.get24HourValue(),minutes:this.internalMinutes,seconds:this.showSeconds?this.internalSeconds:void 0,period:this.useTwelveHourFormat?this.period:void 0})}padZero(t){return t.toString().padStart(2,"0")}render(){const t=this.getDisplayHours(),e=this.useTwelveHourFormat?12:23,h=this.useTwelveHourFormat?1:0;return s(i,{key:"878156f105b2fb61aae67f866c1c436f038d1671",class:this.elementClassName,"aria-label":this.labels.timePicker},s("div",{key:"7b6265d1de95da5423d0d7fcfc6da5e283b64650",class:`${this.elementClassName}__container`},s("div",{key:"6e64ffa764916fb2bad7b88c30eed4ce3de141ed",class:`${this.elementClassName}__field`},s("label",{key:"0b9f82f319299fc3f177ec131f3bcb2d911cae6c",htmlFor:`${this.elementClassName}-hours`,class:{[`${this.elementClassName}__label`]:!0,[`${this.elementClassName}__label--sr-only`]:this.labelsSrOnly}},this.labels.hours),s("div",{key:"0b7c4a24255319fe373aacf275583a6ccf1415ea",class:`${this.elementClassName}__control`},s("button",{key:"24aff5877ad7cb189a6a9118f45e912ee2f97bec",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--increment`,onClick:this.handleHourIncrement,disabled:this.disabled,"aria-label":this.labels.incrementHours},s("svg",{key:"681c818b4e10bc442aca0795024153dda43e6e27",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},s("polyline",{key:"0f86f34c93f99536623d793429bae7109aa29996",points:"18 15 12 9 6 15"}))),s("input",{key:"26043b87943641bdab9322413a36e0019980ef87",id:`${this.elementClassName}-hours`,type:"number",class:`${this.elementClassName}__input`,value:this.padZero(t),min:h,max:e,onInput:this.handleHourChange,disabled:this.disabled,"aria-label":this.labels.hours}),s("button",{key:"d9617f2300e5457bd6480136d33905b35a2c2aba",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--decrement`,onClick:this.handleHourDecrement,disabled:this.disabled,"aria-label":this.labels.decrementHours},s("svg",{key:"468f599326f2a01c873e963ef30904e66dead729",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},s("polyline",{key:"0c54d3e34df989d2514dc95c3e660d94bda4819d",points:"6 9 12 15 18 9"}))))),s("div",{key:"0435c24eb991f0746f1388d440e175d20ba4230a",class:`${this.elementClassName}__separator`},":"),s("div",{key:"1dfb26b32d394101e9a85845d7cb2588c7c2fc63",class:`${this.elementClassName}__field`},s("label",{key:"06e3318c7cd7cd56bc9b1f2616520af38e22501e",htmlFor:`${this.elementClassName}-minutes`,class:{[`${this.elementClassName}__label`]:!0,[`${this.elementClassName}__label--sr-only`]:this.labelsSrOnly}},this.labels.minutes),s("div",{key:"933a0911a02b79fbcd573e0f0ed942fe1f23b7e8",class:`${this.elementClassName}__control`},s("button",{key:"e3a124aab9297ae89ed8deafdc1f2e4066ede58b",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--increment`,onClick:this.handleMinuteIncrement,disabled:this.disabled,"aria-label":this.labels.incrementMinutes},s("svg",{key:"cb33d7fd82b3e9e0293a83c80d0f4c750e381e03",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},s("polyline",{key:"d4fe518f8a5872da32e7093c0e5e6e7f168f7bfe",points:"18 15 12 9 6 15"}))),s("input",{key:"74bb5772b8c12697148e68fbf203184e097bfe40",id:`${this.elementClassName}-minutes`,type:"number",class:`${this.elementClassName}__input`,value:this.padZero(this.internalMinutes),min:0,max:59,onInput:this.handleMinuteChange,disabled:this.disabled,"aria-label":this.labels.minutes}),s("button",{key:"c93e42de64a96a379405942fd7bcd2e4c9430c77",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--decrement`,onClick:this.handleMinuteDecrement,disabled:this.disabled,"aria-label":this.labels.decrementMinutes},s("svg",{key:"0d9eb6746bf467c2275447ec8d6a63f8b17f63a4",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},s("polyline",{key:"beb0425b60d2277477c6ffb5b72ce89ccd7bed20",points:"6 9 12 15 18 9"}))))),this.showSeconds&&[s("div",{key:"b686b7c464e70764bb8dcbec246c72bee6fa51b6",class:`${this.elementClassName}__separator`},":"),s("div",{key:"9dadc9f5a410e40775bd5b28144ee62971448680",class:`${this.elementClassName}__field`},s("label",{key:"233e50d7ddf4ea413ee652d20b917081485dbf93",htmlFor:`${this.elementClassName}-seconds`,class:{[`${this.elementClassName}__label`]:!0,[`${this.elementClassName}__label--sr-only`]:this.labelsSrOnly}},this.labels.seconds),s("div",{key:"df35e6750eeef49671e6a5f233e00a253459554d",class:`${this.elementClassName}__control`},s("button",{key:"521ba9fa8eb10dbf5981c4bab9687479f7888ac9",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--increment`,onClick:this.handleSecondIncrement,disabled:this.disabled,"aria-label":this.labels.incrementSeconds},s("svg",{key:"84d4ac4697aaf7c9042e301b629a254e4ceffc6a",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},s("polyline",{key:"2af46da2a6c4c994ae67c44edb0b4180a6125336",points:"18 15 12 9 6 15"}))),s("input",{key:"bee75b6dd68f723482c295af51250a94df35ab30",id:`${this.elementClassName}-seconds`,type:"number",class:`${this.elementClassName}__input`,value:this.padZero(this.internalSeconds),min:0,max:59,onInput:this.handleSecondChange,disabled:this.disabled,"aria-label":this.labels.seconds}),s("button",{key:"fe1288605003497b92e739f4cec01f160e5a161a",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--decrement`,onClick:this.handleSecondDecrement,disabled:this.disabled,"aria-label":this.labels.decrementSeconds},s("svg",{key:"ca3a8aa73620bc12095f4c6c9bdfd2c33901a6ff",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},s("polyline",{key:"3b68faee709705c929791e9cc7f9e24738f035a1",points:"6 9 12 15 18 9"})))))],this.useTwelveHourFormat&&s("div",{key:"13f65cc5b94a8c498fd233bc72cbd3c9977c7541",class:`${this.elementClassName}__period`},s("button",{key:"3d854b9b5aee10039b38af52513f12cf68e4c657",type:"button",class:{[`${this.elementClassName}__period-button`]:!0,[`${this.elementClassName}__period-button--active`]:"AM"===this.period},onClick:()=>this.handlePeriodChange("AM"),disabled:this.disabled,"aria-label":this.labels.am,"aria-pressed":"AM"===this.period},this.labels.am),s("button",{key:"de12f50f898625cbd5b6afb65e2f396441ab5cf0",type:"button",class:{[`${this.elementClassName}__period-button`]:!0,[`${this.elementClassName}__period-button--active`]:"PM"===this.period},onClick:()=>this.handlePeriodChange("PM"),disabled:this.disabled,"aria-label":this.labels.pm,"aria-pressed":"PM"===this.period},this.labels.pm))))}get el(){return h(this)}static get watchers(){return{hours:[{watchHours:0}],minutes:[{watchMinutes:0}],seconds:[{watchSeconds:0}]}}};export{n as tabworthy_times_picker}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,H as n,g as s}from"./p-CwtZ_Lud.js";import{g as a,r as o,a as r,b as h,c,d,e as u,f as l,h as f,s as v,i as b,j as p,k as y,l as m,m as w,n as g,o as k,p as x,q as O,t as M,u as j,v as D,w as A}from"./p-BVHu5CWV.js";const C={clearButton:"Clear value",closeButton:"Close",monthSelect:"Select month",nextMonthButton:"Next month",nextYearButton:"Next year",picker:"Choose date",previousMonthButton:"Previous month",previousYearButton:"Previous year",todayButton:"Show today",yearSelect:"Select year",keyboardHint:"Keyboard commands",selected:"Selected date",chooseAsStartDate:"choose as start date",chooseAsEndDate:"choose as end date"},S=class{constructor(i){t(this,i),this.selectDate=e(this,"selectDate",3),this.changeMonth=e(this,"changeMonth",3),this.changeYear=e(this,"changeYear",3),this.requestClose=e(this,"requestClose",3),this.disabled=!1,this.modalIsOpen=!1,this.disableDate=()=>!1,this.elementClassName="tabworthy-dates-calendar",this.firstDayOfWeek=0,this.range=!1,this.labels=C,this.locale=(null===navigator||void 0===navigator?void 0:navigator.language)||"en-US",this.inline=!1,this.showClearButton=!1,this.showCloseButton=!1,this.showMonthStepper=!0,this.showTodayButton=!0,this.showYearStepper=!1,this.showKeyboardHint=!1,this.showHiddenTitle=!0,this.startDate=a(new Date),this.init=()=>{this.currentDate=this.startDate?o(new Date(this.startDate)):new Date,this.updateWeekdays()},this.nextMonth=()=>{this.updateCurrentDate(r(this.currentDate))},this.nextYear=()=>{this.updateCurrentDate(h(this.currentDate),!1,!0)},this.previousMonth=()=>{this.updateCurrentDate(c(this.currentDate))},this.previousYear=()=>{this.updateCurrentDate(d(this.currentDate),!1,!0)},this.showToday=()=>{this.updateCurrentDate(new Date,!0)},this.clear=()=>{var t;this.value=void 0,null===(t=this.selectDate)||void 0===t||t.emit(void 0)},this.onClick=t=>{if(this.disabled)return;const e=t.target.closest("[data-date]");if(!Boolean(e))return;const i=o(new Date(e.dataset.date));this.updateCurrentDate(i),this.onSelectDate(i)},this.onMonthSelect=t=>{const e=+t.target.value-1,i=new Date(this.currentDate);u(i,this.minDate,this.maxDate)&&(i.setMonth(e),this.updateCurrentDate(i))},this.onYearSelect=t=>{var e;const i=+t.target.value,n=new Date(this.currentDate);u(n,this.minDate,this.maxDate)&&(n.setFullYear(i),null===(e=this.changeYear)||void 0===e||e.emit({year:i}),this.updateCurrentDate(n))},this.onKeyDown=t=>{this.disabled||("ArrowLeft"===t.code?(t.preventDefault(),this.updateCurrentDate(l(this.currentDate),!0)):"ArrowRight"===t.code?(t.preventDefault(),this.updateCurrentDate(f(this.currentDate),!0)):"ArrowUp"===t.code?(t.preventDefault(),this.updateCurrentDate(v(this.currentDate,7),!0)):"ArrowDown"===t.code?(t.preventDefault(),this.updateCurrentDate(b(this.currentDate,7),!0)):"PageUp"===t.code?(t.preventDefault(),this.updateCurrentDate(t.shiftKey?d(this.currentDate):c(this.currentDate),!0)):"PageDown"===t.code?(t.preventDefault(),this.updateCurrentDate(t.shiftKey?h(this.currentDate):r(this.currentDate),!0)):"Home"===t.code?(t.preventDefault(),this.updateCurrentDate(p(this.currentDate),!0)):"End"===t.code?(t.preventDefault(),this.updateCurrentDate(y(this.currentDate),!0)):"Space"!==t.code&&"Enter"!==t.code||(t.preventDefault(),this.onSelectDate(this.currentDate)))},this.onMouseEnter=t=>{var e;if(this.disabled)return;const i=o(new Date(null===(e=t.target.closest("td"))||void 0===e?void 0:e.dataset.date));this.hoveredDate=i},this.onMouseLeave=()=>{this.hoveredDate=void 0},this.close=()=>{var t;null===(t=this.requestClose)||void 0===t||t.emit()}}componentWillLoad(){this.init()}watchModalIsOpen(){!0===this.modalIsOpen&&(this.moveFocusOnModalOpen=!0)}watchFirstDayOfWeek(){this.updateWeekdays()}watchLocale(){Boolean(this.locale)||(this.locale=(null===navigator||void 0===navigator?void 0:navigator.language)||"en-US"),this.updateWeekdays()}watchRange(){var t;this.value=void 0,null===(t=this.selectDate)||void 0===t||t.emit(void 0)}watchStartDate(){this.currentDate=this.startDate?o(new Date(this.startDate)):new Date}watchValue(){Boolean(this.value)&&(Array.isArray(this.value)&&this.value.length>=1?this.currentDate=this.value[0]:this.value instanceof Date&&(this.currentDate=this.value))}componentDidRender(){this.moveFocusAfterMonthChanged&&(this.focusDate(this.currentDate),this.moveFocusAfterMonthChanged=!1),this.moveFocusOnModalOpen&&setTimeout((()=>{this.focusDate(this.currentDate),this.moveFocusOnModalOpen=!1}),100)}updateWeekdays(){this.weekdays=m(this.firstDayOfWeek,this.locale)}getClassName(t){return Boolean(t)?`${this.elementClassName}__${t}`:this.elementClassName}getCalendarRows(){const t=w(this.currentDate,!0,0===this.firstDayOfWeek?7:this.firstDayOfWeek),e=[];for(let i=0;i<t.length;i+=7){const n=t.slice(i,i+7);e.push(n)}const i=e[e.length-1];let n=null==i?void 0:i[i.length-1];for(;e.length<6&&n;){const t=[];for(let e=0;e<7;e+=1)n=b(n,1),t.push(n);e.push(t)}return e}getTitle(){if(Boolean(this.currentDate))return Intl.DateTimeFormat(this.locale,{month:"long",year:"numeric"}).format(this.currentDate)}focusDate(t){var e;t&&(null===(e=this.el.querySelector(`[data-date="${a(t)}"]`))||void 0===e||e.focus())}updateCurrentDate(t,e,i=!1){var n,s,a;const o=t.getMonth(),r=t.getFullYear();g(t,this.minDate)||(t=new Date(this.minDate)),k(t,this.maxDate)||(t=new Date(this.maxDate)),(o!==(null===(n=this.currentDate)||void 0===n?void 0:n.getMonth())||r!==this.currentDate.getFullYear())&&(null===(s=this.changeMonth)||void 0===s||s.emit({month:O(t),year:x(t)}),e&&(this.moveFocusAfterMonthChanged=!0)),this.currentDate=t,e&&this.focusDate(this.currentDate),i&&(null===(a=this.changeYear)||void 0===a||a.emit({year:x(t)}))}onSelectDate(t){var e,i,n,s;if(!this.disableDate(t)&&u(t,this.minDate,this.maxDate))if(this.isRangeValue(this.value)){const n=void 0===(null===(e=this.value)||void 0===e?void 0:e[0])||2===this.value.length?[t]:[this.value[0],t];2===n.length&&n[0]>n[1]&&n.reverse();const s=void 0===n[1]?[a(n[0])]:[a(n[0]),a(n[1])];this.value=n,null===(i=this.selectDate)||void 0===i||i.emit(s)}else{if((null===(n=this.value)||void 0===n?void 0:n.getTime())===t.getTime())return;this.value=t,null===(s=this.selectDate)||void 0===s||s.emit(a(t))}}isRangeValue(t){return!!this.range}render(){var t;const e=this.showTodayButton||this.showClearButton||this.showCloseButton||this.showKeyboardHint,s={year:{prev:this.disabled||!!this.minDate&&new Date(this.minDate).getFullYear()>d(this.currentDate).getFullYear(),next:this.disabled||!!this.maxDate&&new Date(this.maxDate).getFullYear()<h(this.currentDate).getFullYear()},month:{prev:this.disabled||M(c(this.currentDate).getMonth(),c(this.currentDate).getFullYear(),this.minDate,this.maxDate),next:this.disabled||M(r(this.currentDate).getMonth(),r(this.currentDate).getFullYear(),this.minDate,this.maxDate)}};return i(n,{key:"1bda8d7a489d87cf27ecbcd978accf5363f32804"},i("div",{key:"7118660fbbdfac4a73a1ace99d96d4ac32a4b137",class:{[`${this.getClassName()}-wrapper`]:!0,[`${this.getClassName()}-wrapper--inline`]:this.inline}},i("div",{key:"41b62826cdff428aef8ad89844a50873f8853b5e",class:{[this.getClassName()]:!0,[`${this.getClassName()}--disabled`]:this.disabled}},i("div",{key:"7a9ee67778c6f48e65d88defc1ff620e995d75bc",class:this.getClassName("header")},this.showHiddenTitle&&i("span",{key:"404e50ab0f24235d6678af7c12f6b3cdd491e347","aria-atomic":"true","aria-live":"polite",class:"visually-hidden"},this.getTitle()),this.showYearStepper&&i("button",{key:"88552edc01ae9c4a7d8225c2aab078d2123bf9f6","aria-label":this.labels.previousYearButton,class:this.getClassName("previous-year-button"),"aria-disabled":s.year.prev,innerHTML:this.previousYearButtonContent||void 0,onClick:this.previousYear,type:"button"},i("svg",{key:"5daef016748f562ddf3866557774c87016887fc6",fill:"none",height:"24","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"24"},i("polyline",{key:"5b73b6ec2b5abcae4d2e5cd833b5de441938e533",points:"11 17 6 12 11 7"}),i("polyline",{key:"05e146e1c233c39403147e7af61948798db7c0f7",points:"18 17 13 12 18 7"}))),this.showMonthStepper&&i("button",{key:"6145f62f073563e9136ad454f4e9633e99b8d8a9","aria-label":this.labels.previousMonthButton,class:this.getClassName("previous-month-button"),"aria-disabled":s.month.prev,innerHTML:this.previousMonthButtonContent||void 0,onClick:this.previousMonth,type:"button"},i("svg",{key:"8ae9cc385a6fdbdd915a2717246752c7f2f17b01",fill:"none",height:"24","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"24"},i("polyline",{key:"9395192e65c1e550547220850b29a117569a79e2",points:"15 18 9 12 15 6"}))),i("span",{key:"3b282148e95b8b1facde4a2ab370c6088b72bccd",class:this.getClassName("current-month")},i("select",{key:"f782b9d803abd5eb1add6c869b3ac302a717780d","aria-label":this.labels.monthSelect,class:this.getClassName("month-select"),"aria-disabled":this.disabled,name:"month",onChange:this.onMonthSelect},j(this.locale).map(((t,e)=>i("option",{key:t,selected:this.currentDate.getMonth()===e,value:e+1,disabled:M(e,this.currentDate.getFullYear(),this.minDate,this.maxDate)},t)))),i("input",{key:"dcd8a96a130513d1cf34d900d6f8c09ce974ba15","aria-label":this.labels.yearSelect,class:this.getClassName("year-select"),"aria-disabled":this.disabled,max:this.maxDate?this.maxDate.slice(0,4):9999,min:this.minDate?this.minDate.slice(0,4):1,name:"year",onChange:this.onYearSelect,type:"number",value:this.currentDate.getFullYear()})),this.showMonthStepper&&i("button",{key:"7de261689d242a0116e85f3c5fda265f49eaaf13","aria-label":this.labels.nextMonthButton,class:this.getClassName("next-month-button"),"aria-disabled":s.month.next,innerHTML:this.nextMonthButtonContent||void 0,onClick:this.nextMonth,type:"button"},i("svg",{key:"2033c731d98fd53088857a92bdd35e5e977137d7",fill:"none",height:"24","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"24"},i("polyline",{key:"dc88e8e5e4f79d5ae0b62ea51f6ba52d5e26ce9f",points:"9 18 15 12 9 6"}))),this.showYearStepper&&i("button",{key:"e25bcd81e34e0e162954b2ab67876c148f50f5d4","aria-label":this.labels.nextYearButton,class:this.getClassName("next-year-button"),"aria-disabled":s.year.next,innerHTML:this.nextYearButtonContent||void 0,onClick:this.nextYear,type:"button"},i("svg",{key:"70df81cfd06bcb1e6571933b7a43a5071522159b",fill:"none",height:"24","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"24"},i("polyline",{key:"f8242866ca29743b19055d1ac53fcc8e84d68a35",points:"13 17 18 12 13 7"}),i("polyline",{key:"6bda80ff2eba82dac0d36e287976130e6b16113c",points:"6 17 11 12 6 7"})))),i("div",{key:"6d5b0085437827c1db975f12dc5fe5927c7ba62f",class:this.getClassName("body")},i("table",{key:"61975eac4e06c3a416fcb9503eef9c7a386a6b54",class:this.getClassName("calendar"),onKeyDown:this.onKeyDown,role:"grid","aria-label":this.getTitle()},i("thead",{key:"fd259bd5ba6e12ff39dad5a31133913d17fdf276",class:this.getClassName("calendar-header")},i("tr",{key:"410c84eabac58cf6139dd6c886b4803772abceb5",class:this.getClassName("weekday-row")},null===(t=this.weekdays)||void 0===t?void 0:t.map((t=>i("th",{role:"columnheader",abbr:t[1],class:this.getClassName("weekday"),key:t[0],scope:"col"},i("span",{"aria-hidden":"true"},t[0]),i("span",{class:"visually-hidden"},t[1])))))),i("tbody",{key:"330d3b922d474b42edf0764556d2f2643b5b639d"},this.getCalendarRows().map((t=>{const e=`row-${t[0].getMonth()}-${t[0].getDate()}`;return i("tr",{class:this.getClassName("calendar-row"),key:e},t.map((t=>{var e,n,s;const o=D(t,this.currentDate),r=t.getMonth()!==(null===(e=this.currentDate)||void 0===e?void 0:e.getMonth()),h=Array.isArray(this.value)?D(t,this.value[0])||this.value[1]&&u(t,a(this.value[0]),a(this.value[1])):D(t,this.value),c=this.disableDate(t)||!u(t,this.minDate,this.maxDate),d=!!this.isRangeValue(this.value)&&A(t,{from:null===(n=this.value)||void 0===n?void 0:n[0],to:(null===(s=this.value)||void 0===s?void 0:s[1])||this.hoveredDate||this.currentDate})&&!c,l=D(t,new Date),f=`cell-${t.getMonth()}-${t.getDate()}`,v={[this.getClassName("date")]:!0,[this.getClassName("date--current")]:o,[this.getClassName("date--disabled")]:c,[this.getClassName("date--overflowing")]:r,[this.getClassName("date--today")]:l,[this.getClassName("date--selected")]:h,[this.getClassName("date--in-range")]:d},b=h?"strong":l?"em":"span";return i("td",{"aria-disabled":String(c),"aria-selected":h?"true":void 0,class:v,"data-date":a(t),key:f,onClick:this.onClick,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,role:"gridcell",tabIndex:D(t,this.currentDate)&&!this.disabled?0:-1},i(b,{"aria-hidden":"true"},t.getDate()),i("span",{class:"visually-hidden"},(()=>{if(this.range){let e=this.value?"":`, ${this.labels.chooseAsStartDate}.`;return Array.isArray(this.value)&&(e={1:`, ${this.labels.chooseAsEndDate}.`,2:`, ${this.labels.chooseAsStartDate}.`}[this.value.length]),`${h?`${this.labels.selected}, `:""}${Intl.DateTimeFormat(this.locale,{day:"numeric",month:"long",year:"numeric"}).format(t)}${e}`}return`${h?`${this.labels.selected}, `:""}${Intl.DateTimeFormat(this.locale,{day:"numeric",month:"long",year:"numeric"}).format(t)}`})()))})))}))))),e&&i("div",{key:"88362c2e1731e8813ad9c5da3b34f6afe16f2036",class:this.getClassName("footer")},i("div",{key:"e93a0b8fff1be09855ab87db159cb186b9339a39",class:this.getClassName("footer-buttons")},this.showTodayButton&&i("button",{key:"c1c9583c3d4cfdc70e0ca335e9dad603692050da","aria-label":this.todayButtonContent?this.labels.todayButton:void 0,class:this.getClassName("today-button"),disabled:this.disabled,innerHTML:this.todayButtonContent||void 0,onClick:this.showToday,type:"button"},!this.todayButtonContent&&this.labels.todayButton),this.showClearButton&&i("button",{key:"79a676ea7b12a62121367ce3226a321e0d6821a2","aria-label":this.clearButtonContent?this.labels.clearButton:void 0,class:this.getClassName("clear-button"),disabled:this.disabled,innerHTML:this.clearButtonContent||void 0,onClick:this.clear,type:"button"},!this.clearButtonContent&&this.labels.clearButton),this.showCloseButton&&i("button",{key:"51e4af6bb0ce2471491ef74b577c1f4404ae1b73","aria-label":this.closeButtonContent?this.labels.closeButton:void 0,class:this.getClassName("close-button"),disabled:this.disabled,innerHTML:this.closeButtonContent||void 0,onClick:this.close,type:"button"},!this.closeButtonContent&&this.labels.closeButton)),this.showKeyboardHint&&!window.matchMedia("(pointer: coarse)").matches&&i("button",{key:"89d2636eaca98ee89e38a1650db7f7a9c3ef0be5",type:"button",onClick:()=>alert("Todo: Add Keyboard helper!"),class:this.getClassName("keyboard-hint")},i("svg",{key:"0326ae480467bcb617827f29d84dffc4339f73dd",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",viewBox:"0 0 48 48",fill:"currentColor"},i("path",{key:"760d4c482eab6023fc43c69826ede1f5fbba145e",d:"M7 38q-1.2 0-2.1-.925Q4 36.15 4 35V13q0-1.2.9-2.1.9-.9 2.1-.9h34q1.2 0 2.1.9.9.9.9 2.1v22q0 1.15-.9 2.075Q42.2 38 41 38Zm0-3h34V13H7v22Zm8-3.25h18v-3H15Zm-4.85-6.25h3v-3h-3Zm6.2 0h3v-3h-3Zm6.15 0h3v-3h-3Zm6.2 0h3v-3h-3Zm6.15 0h3v-3h-3Zm-24.7-6.25h3v-3h-3Zm6.2 0h3v-3h-3Zm6.15 0h3v-3h-3Zm6.2 0h3v-3h-3Zm6.15 0h3v-3h-3ZM7 35V13v22Z"})),this.labels.keyboardHint))),i("slot",{key:"5ac974fba92a2afb8b13eaa5a06f560ed707a93f",name:"after-calendar"})))}get el(){return s(this)}static get watchers(){return{modalIsOpen:[{watchModalIsOpen:0}],firstDayOfWeek:[{watchFirstDayOfWeek:0}],locale:[{watchLocale:0}],range:[{watchRange:0}],startDate:[{watchStartDate:0}],value:[{watchValue:0}]}}};function L(t,e,i,n=20,s=0){let a=[];if(s>=n)return a;const o=t=>{const a=t.assignedNodes().filter((t=>1===t.nodeType));return a.length>0?L(a[0].parentElement,e,i,n,s+1):[]},r=Array.from(t.children||[]);for(const t of r)e(t)||(i(t)&&a.push(t),null!=t.shadowRoot?a.push(...L(t.shadowRoot,e,i,n,s+1)):"SLOT"===t.tagName?a.push(...o(t)):a.push(...L(t,e,i,n,s+1)));return a}function B(t){return t.hasAttribute("hidden")||t.hasAttribute("aria-hidden")&&"false"!==t.getAttribute("aria-hidden")||"none"===t.style.display||"0"===t.style.opacity||"hidden"===t.style.visibility||"collapse"===t.style.visibility}function E(t){return"-1"!==t.getAttribute("tabindex")&&!B(t)&&!function(t){return t.hasAttribute("disabled")||t.hasAttribute("aria-disabled")&&"false"!==t.getAttribute("aria-disabled")}(t)&&(t.hasAttribute("tabindex")||(t instanceof HTMLAnchorElement||t instanceof HTMLAreaElement)&&t.hasAttribute("href")||t instanceof HTMLButtonElement||t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement||t instanceof HTMLIFrameElement)}S.style=".visually-hidden.sc-tabworthy-dates-calendar{position:absolute;overflow:hidden;width:1px;height:1px;white-space:nowrap;clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%)}";const T=new Map,H=document.createElement("template");H.innerHTML='\n\t<div id="start"></div>\n\t<div id="backup"></div>\n\t<slot></slot>\n\t<div id="end"></div>\n';class $ extends HTMLElement{constructor(){super(),this.debounceId=Math.random().toString(),this._focused=!1;const t=this.attachShadow({mode:"open"});t.appendChild(H.content.cloneNode(!0)),this.$backup=t.querySelector("#backup"),this.$start=t.querySelector("#start"),this.$end=t.querySelector("#end"),this.focusLastElement=this.focusLastElement.bind(this),this.focusFirstElement=this.focusFirstElement.bind(this),this.onFocusIn=this.onFocusIn.bind(this),this.onFocusOut=this.onFocusOut.bind(this)}static get observedAttributes(){return["inactive"]}get inactive(){return this.hasAttribute("inactive")}set inactive(t){t?this.setAttribute("inactive",""):this.removeAttribute("inactive")}get focused(){return this._focused}connectedCallback(){this.$start.addEventListener("focus",this.focusLastElement),this.$end.addEventListener("focus",this.focusFirstElement),this.addEventListener("focusin",this.onFocusIn),this.addEventListener("focusout",this.onFocusOut),this.render()}disconnectedCallback(){this.$start.removeEventListener("focus",this.focusLastElement),this.$end.removeEventListener("focus",this.focusFirstElement),this.removeEventListener("focusin",this.onFocusIn),this.removeEventListener("focusout",this.onFocusOut)}attributeChangedCallback(){this.render()}focusFirstElement(){this.trapFocus()}focusLastElement(){this.trapFocus(!0)}getFocusableElements(){return L(this,B,E)}trapFocus(t){if(this.inactive)return;let e=this.getFocusableElements();e.length>0?(t?e[e.length-1].focus():e[0].focus(),this.$backup.setAttribute("tabindex","-1")):(this.$backup.setAttribute("tabindex","0"),this.$backup.focus())}onFocusIn(){this.updateFocused(!0)}onFocusOut(){this.updateFocused(!1)}updateFocused(t){!function(t,e,i){const n=T.get(i);null!=n&&window.clearTimeout(n),T.set(i,window.setTimeout((()=>{t(),T.delete(i)}),0))}((()=>{this.focused!==t&&(this._focused=t,this.render())}),0,this.debounceId)}render(){this.$start.setAttribute("tabindex",!this.focused||this.inactive?"-1":"0"),this.$end.setAttribute("tabindex",!this.focused||this.inactive?"-1":"0"),this.focused?this.setAttribute("focused",""):this.removeAttribute("focused")}}window.customElements.define("focus-trap",$);var P=new WeakMap,W=new WeakMap,I={},q=0,Z=function(t){return t&&(t.host||Z(t.parentNode))},F=function(t,e,i){void 0===i&&(i="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),s=function(t){return"undefined"==typeof document?null:(Array.isArray(t)?t[0]:t).ownerDocument.body}(t);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),function(t,e,i,n){var s=function(t,e){return e.map((function(e){if(t.contains(e))return e;var i=Z(e);return i&&t.contains(i)?i:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)})).filter((function(t){return Boolean(t)}))}(e,Array.isArray(t)?t:[t]);I[i]||(I[i]=new WeakMap);var a=I[i],o=[],r=new Set,h=new Set(s),c=function(t){t&&!r.has(t)&&(r.add(t),c(t.parentNode))};s.forEach(c);var d=function(t){t&&!h.has(t)&&Array.prototype.forEach.call(t.children,(function(t){if(r.has(t))d(t);else{var e=t.getAttribute(n),s=null!==e&&"false"!==e,h=(P.get(t)||0)+1,c=(a.get(t)||0)+1;P.set(t,h),a.set(t,c),o.push(t),1===h&&s&&W.set(t,!0),1===c&&t.setAttribute(i,"true"),s||t.setAttribute(n,"true")}}))};return d(e),r.clear(),q++,function(){o.forEach((function(t){var e=P.get(t)-1,s=a.get(t)-1;P.set(t,e),a.set(t,s),e||(W.has(t)||t.removeAttribute(n),W.delete(t)),s||t.removeAttribute(i)})),--q||(P=new WeakMap,P=new WeakMap,W=new WeakMap,I={})}}(n,s,i,"aria-hidden")):function(){return null}},R="top",V="bottom",_="right",U="left",z="auto",K=[R,V,_,U],N="start",Y="end",Q="viewport",G="popper",J=K.reduce((function(t,e){return t.concat([e+"-"+N,e+"-"+Y])}),[]),X=[].concat(K,[z]).reduce((function(t,e){return t.concat([e,e+"-"+N,e+"-"+Y])}),[]),tt=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function et(t){return t?(t.nodeName||"").toLowerCase():null}function it(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function nt(t){return t instanceof it(t).Element||t instanceof Element}function st(t){return t instanceof it(t).HTMLElement||t instanceof HTMLElement}function at(t){return"undefined"!=typeof ShadowRoot&&(t instanceof it(t).ShadowRoot||t instanceof ShadowRoot)}function ot(t){return t.split("-")[0]}var rt=Math.max,ht=Math.min,ct=Math.round;function dt(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function ut(){return!/^((?!chrome|android).)*safari/i.test(dt())}function lt(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),s=1,a=1;e&&st(t)&&(s=t.offsetWidth>0&&ct(n.width)/t.offsetWidth||1,a=t.offsetHeight>0&&ct(n.height)/t.offsetHeight||1);var o=(nt(t)?it(t):window).visualViewport,r=!ut()&&i,h=(n.left+(r&&o?o.offsetLeft:0))/s,c=(n.top+(r&&o?o.offsetTop:0))/a,d=n.width/s,u=n.height/a;return{width:d,height:u,top:c,right:h+d,bottom:c+u,left:h,x:h,y:c}}function ft(t){var e=lt(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function vt(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&at(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function bt(t){return it(t).getComputedStyle(t)}function pt(t){return["table","td","th"].indexOf(et(t))>=0}function yt(t){return((nt(t)?t.ownerDocument:t.document)||window.document).documentElement}function mt(t){return"html"===et(t)?t:t.assignedSlot||t.parentNode||(at(t)?t.host:null)||yt(t)}function wt(t){return st(t)&&"fixed"!==bt(t).position?t.offsetParent:null}function gt(t){for(var e=it(t),i=wt(t);i&&pt(i)&&"static"===bt(i).position;)i=wt(i);return i&&("html"===et(i)||"body"===et(i)&&"static"===bt(i).position)?e:i||function(t){var e=/firefox/i.test(dt());if(/Trident/i.test(dt())&&st(t)&&"fixed"===bt(t).position)return null;var i=mt(t);for(at(i)&&(i=i.host);st(i)&&["html","body"].indexOf(et(i))<0;){var n=bt(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}function kt(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function xt(t,e,i){return rt(t,ht(e,i))}function Ot(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Mt(t,e){return e.reduce((function(e,i){return e[i]=t,e}),{})}function jt(t){return t.split("-")[1]}var Dt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function At(t){var e,i=t.popper,n=t.popperRect,s=t.placement,a=t.variation,o=t.offsets,r=t.position,h=t.gpuAcceleration,c=t.adaptive,d=t.roundOffsets,u=t.isFixed,l=o.x,f=void 0===l?0:l,v=o.y,b=void 0===v?0:v,p="function"==typeof d?d({x:f,y:b}):{x:f,y:b};f=p.x,b=p.y;var y=o.hasOwnProperty("x"),m=o.hasOwnProperty("y"),w=U,g=R,k=window;if(c){var x=gt(i),O="clientHeight",M="clientWidth";x===it(i)&&"static"!==bt(x=yt(i)).position&&"absolute"===r&&(O="scrollHeight",M="scrollWidth"),(s===R||(s===U||s===_)&&a===Y)&&(g=V,b-=(u&&x===k&&k.visualViewport?k.visualViewport.height:x[O])-n.height,b*=h?1:-1),s!==U&&(s!==R&&s!==V||a!==Y)||(w=_,f-=(u&&x===k&&k.visualViewport?k.visualViewport.width:x[M])-n.width,f*=h?1:-1)}var j,D=Object.assign({position:r},c&&Dt),A=!0===d?function(t,e){var i=t.y,n=e.devicePixelRatio||1;return{x:ct(t.x*n)/n||0,y:ct(i*n)/n||0}}({x:f,y:b},it(i)):{x:f,y:b};return f=A.x,b=A.y,Object.assign({},D,h?((j={})[g]=m?"0":"",j[w]=y?"0":"",j.transform=(k.devicePixelRatio||1)<=1?"translate("+f+"px, "+b+"px)":"translate3d("+f+"px, "+b+"px, 0)",j):((e={})[g]=m?b+"px":"",e[w]=y?f+"px":"",e.transform="",e))}var Ct={passive:!0},St={left:"right",right:"left",bottom:"top",top:"bottom"};function Lt(t){return t.replace(/left|right|bottom|top/g,(function(t){return St[t]}))}var Bt={start:"end",end:"start"};function Et(t){return t.replace(/start|end/g,(function(t){return Bt[t]}))}function Tt(t){var e=it(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ht(t){return lt(yt(t)).left+Tt(t).scrollLeft}function $t(t){var e=bt(t);return/auto|scroll|overlay|hidden/.test(e.overflow+e.overflowY+e.overflowX)}function Pt(t){return["html","body","#document"].indexOf(et(t))>=0?t.ownerDocument.body:st(t)&&$t(t)?t:Pt(mt(t))}function Wt(t,e){var i;void 0===e&&(e=[]);var n=Pt(t),s=n===(null==(i=t.ownerDocument)?void 0:i.body),a=it(n),o=s?[a].concat(a.visualViewport||[],$t(n)?n:[]):n,r=e.concat(o);return s?r:r.concat(Wt(mt(o)))}function It(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function qt(t,e,i){return e===Q?It(function(t,e){var i=it(t),n=yt(t),s=i.visualViewport,a=n.clientWidth,o=n.clientHeight,r=0,h=0;if(s){a=s.width,o=s.height;var c=ut();(c||!c&&"fixed"===e)&&(r=s.offsetLeft,h=s.offsetTop)}return{width:a,height:o,x:r+Ht(t),y:h}}(t,i)):nt(e)?function(t,e){var i=lt(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):It(function(t){var e,i=yt(t),n=Tt(t),s=null==(e=t.ownerDocument)?void 0:e.body,a=rt(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=rt(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),r=-n.scrollLeft+Ht(t),h=-n.scrollTop;return"rtl"===bt(s||i).direction&&(r+=rt(i.clientWidth,s?s.clientWidth:0)-a),{width:a,height:o,x:r,y:h}}(yt(t)))}function Zt(t){var e,i=t.reference,n=t.element,s=t.placement,a=s?ot(s):null,o=s?jt(s):null,r=i.x+i.width/2-n.width/2,h=i.y+i.height/2-n.height/2;switch(a){case R:e={x:r,y:i.y-n.height};break;case V:e={x:r,y:i.y+i.height};break;case _:e={x:i.x+i.width,y:h};break;case U:e={x:i.x-n.width,y:h};break;default:e={x:i.x,y:i.y}}var c=a?kt(a):null;if(null!=c){var d="y"===c?"height":"width";switch(o){case N:e[c]=e[c]-(i[d]/2-n[d]/2);break;case Y:e[c]=e[c]+(i[d]/2-n[d]/2)}}return e}function Ft(t,e){void 0===e&&(e={});var i=e.placement,n=void 0===i?t.placement:i,s=e.strategy,a=void 0===s?t.strategy:s,o=e.boundary,r=void 0===o?"clippingParents":o,h=e.rootBoundary,c=void 0===h?Q:h,d=e.elementContext,u=void 0===d?G:d,l=e.altBoundary,f=void 0!==l&&l,v=e.padding,b=void 0===v?0:v,p=Ot("number"!=typeof b?b:Mt(b,K)),y=t.rects.popper,m=t.elements[f?u===G?"reference":G:u],w=function(t,e,i,n){var s="clippingParents"===e?function(t){var e=Wt(mt(t)),i=["absolute","fixed"].indexOf(bt(t).position)>=0&&st(t)?gt(t):t;return nt(i)?e.filter((function(t){return nt(t)&&vt(t,i)&&"body"!==et(t)})):[]}(t):[].concat(e),a=[].concat(s,[i]),o=a.reduce((function(e,i){var s=qt(t,i,n);return e.top=rt(s.top,e.top),e.right=ht(s.right,e.right),e.bottom=ht(s.bottom,e.bottom),e.left=rt(s.left,e.left),e}),qt(t,a[0],n));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}(nt(m)?m:m.contextElement||yt(t.elements.popper),r,c,a),g=lt(t.elements.reference),k=Zt({reference:g,element:y,placement:n}),x=It(Object.assign({},y,k)),O=u===G?x:g,M={top:w.top-O.top+p.top,bottom:O.bottom-w.bottom+p.bottom,left:w.left-O.left+p.left,right:O.right-w.right+p.right},j=t.modifiersData.offset;if(u===G&&j){var D=j[n];Object.keys(M).forEach((function(t){var e=[_,V].indexOf(t)>=0?1:-1,i=[R,V].indexOf(t)>=0?"y":"x";M[t]+=D[i]*e}))}return M}function Rt(t,e){void 0===e&&(e={});var i=e.boundary,n=e.rootBoundary,s=e.padding,a=e.flipVariations,o=e.allowedAutoPlacements,r=void 0===o?X:o,h=jt(e.placement),c=h?a?J:J.filter((function(t){return jt(t)===h})):K,d=c.filter((function(t){return r.indexOf(t)>=0}));0===d.length&&(d=c);var u=d.reduce((function(e,a){return e[a]=Ft(t,{placement:a,boundary:i,rootBoundary:n,padding:s})[ot(a)],e}),{});return Object.keys(u).sort((function(t,e){return u[t]-u[e]}))}var Vt={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var s=i.mainAxis,a=void 0===s||s,o=i.altAxis,r=void 0===o||o,h=i.fallbackPlacements,c=i.padding,d=i.boundary,u=i.rootBoundary,l=i.altBoundary,f=i.flipVariations,v=void 0===f||f,b=i.allowedAutoPlacements,p=e.options.placement,y=ot(p),m=h||(y!==p&&v?function(t){if(ot(t)===z)return[];var e=Lt(t);return[Et(t),e,Et(e)]}(p):[Lt(p)]),w=[p].concat(m).reduce((function(t,i){return t.concat(ot(i)===z?Rt(e,{placement:i,boundary:d,rootBoundary:u,padding:c,flipVariations:v,allowedAutoPlacements:b}):i)}),[]),g=e.rects.reference,k=e.rects.popper,x=new Map,O=!0,M=w[0],j=0;j<w.length;j++){var D=w[j],A=ot(D),C=jt(D)===N,S=[R,V].indexOf(A)>=0,L=S?"width":"height",B=Ft(e,{placement:D,boundary:d,rootBoundary:u,altBoundary:l,padding:c}),E=S?C?_:U:C?V:R;g[L]>k[L]&&(E=Lt(E));var T=Lt(E),H=[];if(a&&H.push(B[A]<=0),r&&H.push(B[E]<=0,B[T]<=0),H.every((function(t){return t}))){M=D,O=!1;break}x.set(D,H)}if(O)for(var $=function(t){var e=w.find((function(e){var i=x.get(e);if(i)return i.slice(0,t).every((function(t){return t}))}));if(e)return M=e,"break"},P=v?3:1;P>0&&"break"!==$(P);P--);e.placement!==M&&(e.modifiersData[n]._skip=!0,e.placement=M,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function _t(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function Ut(t){return[R,_,V,U].some((function(e){return t[e]>=0}))}function zt(t,e,i){void 0===i&&(i=!1);var n,s,a=st(e),o=st(e)&&function(t){var e=t.getBoundingClientRect(),i=ct(e.width)/t.offsetWidth||1,n=ct(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),r=yt(e),h=lt(t,o,i),c={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(a||!a&&!i)&&(("body"!==et(e)||$t(r))&&(c=(n=e)!==it(n)&&st(n)?{scrollLeft:(s=n).scrollLeft,scrollTop:s.scrollTop}:Tt(n)),st(e)?((d=lt(e,!0)).x+=e.clientLeft,d.y+=e.clientTop):r&&(d.x=Ht(r))),{x:h.left+c.scrollLeft-d.x,y:h.top+c.scrollTop-d.y,width:h.width,height:h.height}}function Kt(t){var e=new Map,i=new Set,n=[];function s(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!i.has(t)){var n=e.get(t);n&&s(n)}})),n.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){i.has(t.name)||s(t)})),n}var Nt={placement:"bottom",modifiers:[],strategy:"absolute"};function Yt(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function Qt(t){void 0===t&&(t={});var e=t.defaultModifiers,i=void 0===e?[]:e,n=t.defaultOptions,s=void 0===n?Nt:n;return function(t,e,n){void 0===n&&(n=s);var a,o,r={placement:"bottom",orderedModifiers:[],options:Object.assign({},Nt,s),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},h=[],c=!1,d={state:r,setOptions:function(n){var a="function"==typeof n?n(r.options):n;u(),r.options=Object.assign({},s,r.options,a),r.scrollParents={reference:nt(t)?Wt(t):t.contextElement?Wt(t.contextElement):[],popper:Wt(e)};var o,c,l=function(t){var e=Kt(t);return tt.reduce((function(t,i){return t.concat(e.filter((function(t){return t.phase===i})))}),[])}((o=[].concat(i,r.options.modifiers),c=o.reduce((function(t,e){var i=t[e.name];return t[e.name]=i?Object.assign({},i,e,{options:Object.assign({},i.options,e.options),data:Object.assign({},i.data,e.data)}):e,t}),{}),Object.keys(c).map((function(t){return c[t]}))));return r.orderedModifiers=l.filter((function(t){return t.enabled})),r.orderedModifiers.forEach((function(t){var e=t.options,i=t.effect;if("function"==typeof i){var n=i({state:r,name:t.name,instance:d,options:void 0===e?{}:e});h.push(n||function(){})}})),d.update()},forceUpdate:function(){if(!c){var t=r.elements,e=t.reference,i=t.popper;if(Yt(e,i)){r.rects={reference:zt(e,gt(i),"fixed"===r.options.strategy),popper:ft(i)},r.reset=!1,r.placement=r.options.placement,r.orderedModifiers.forEach((function(t){return r.modifiersData[t.name]=Object.assign({},t.data)}));for(var n=0;n<r.orderedModifiers.length;n++)if(!0!==r.reset){var s=r.orderedModifiers[n],a=s.fn,o=s.options;"function"==typeof a&&(r=a({state:r,options:void 0===o?{}:o,name:s.name,instance:d})||r)}else r.reset=!1,n=-1}}},update:(a=function(){return new Promise((function(t){d.forceUpdate(),t(r)}))},function(){return o||(o=new Promise((function(t){Promise.resolve().then((function(){o=void 0,t(a())}))}))),o}),destroy:function(){u(),c=!0}};if(!Yt(t,e))return d;function u(){h.forEach((function(t){return t()})),h=[]}return d.setOptions(n).then((function(t){!c&&n.onFirstUpdate&&n.onFirstUpdate(t)})),d}}var Gt=Qt({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,s=n.scroll,a=void 0===s||s,o=n.resize,r=void 0===o||o,h=it(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return a&&c.forEach((function(t){t.addEventListener("scroll",i.update,Ct)})),r&&h.addEventListener("resize",i.update,Ct),function(){a&&c.forEach((function(t){t.removeEventListener("scroll",i.update,Ct)})),r&&h.removeEventListener("resize",i.update,Ct)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state;e.modifiersData[t.name]=Zt({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,s=void 0===n||n,a=i.adaptive,o=void 0===a||a,r=i.roundOffsets,h=void 0===r||r,c={placement:ot(e.placement),variation:jt(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,At(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:h})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,At(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:h})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];st(s)&&et(s)&&(Object.assign(s.style,i),Object.keys(n).forEach((function(t){var e=n[t];!1===e?s.removeAttribute(t):s.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach((function(t){var n=e.elements[t],s=e.attributes[t]||{},a=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce((function(t,e){return t[e]="",t}),{});st(n)&&et(n)&&(Object.assign(n.style,a),Object.keys(s).forEach((function(t){n.removeAttribute(t)})))}))}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.name,n=t.options.offset,s=void 0===n?[0,0]:n,a=X.reduce((function(t,i){return t[i]=function(t,e,i){var n=ot(t),s=[U,R].indexOf(n)>=0?-1:1,a="function"==typeof i?i(Object.assign({},e,{placement:t})):i,o=a[0],r=a[1];return o=o||0,r=(r||0)*s,[U,_].indexOf(n)>=0?{x:r,y:o}:{x:o,y:r}}(i,e.rects,s),t}),{}),o=a[e.placement],r=o.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=o.x,e.modifiersData.popperOffsets.y+=r),e.modifiersData[i]=a}},Vt,{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.mainAxis,a=void 0===s||s,o=i.altAxis,r=void 0!==o&&o,h=i.tether,c=void 0===h||h,d=i.tetherOffset,u=void 0===d?0:d,l=Ft(e,{boundary:i.boundary,rootBoundary:i.rootBoundary,padding:i.padding,altBoundary:i.altBoundary}),f=ot(e.placement),v=jt(e.placement),b=!v,p=kt(f),y="x"===p?"y":"x",m=e.modifiersData.popperOffsets,w=e.rects.reference,g=e.rects.popper,k="function"==typeof u?u(Object.assign({},e.rects,{placement:e.placement})):u,x="number"==typeof k?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),O=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,M={x:0,y:0};if(m){if(a){var j,D="y"===p?R:U,A="y"===p?V:_,C="y"===p?"height":"width",S=m[p],L=S+l[D],B=S-l[A],E=c?-g[C]/2:0,T=v===N?w[C]:g[C],H=v===N?-g[C]:-w[C],$=e.elements.arrow,P=c&&$?ft($):{width:0,height:0},W=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},I=W[D],q=W[A],Z=xt(0,w[C],P[C]),F=b?w[C]/2-E-Z-I-x.mainAxis:T-Z-I-x.mainAxis,z=b?-w[C]/2+E+Z+q+x.mainAxis:H+Z+q+x.mainAxis,K=e.elements.arrow&>(e.elements.arrow),Y=null!=(j=null==O?void 0:O[p])?j:0,Q=S+z-Y,G=xt(c?ht(L,S+F-Y-(K?"y"===p?K.clientTop||0:K.clientLeft||0:0)):L,S,c?rt(B,Q):B);m[p]=G,M[p]=G-S}if(r){var J,X=m[y],tt="y"===y?"height":"width",et=X+l["x"===p?R:U],it=X-l["x"===p?V:_],nt=-1!==[R,U].indexOf(f),st=null!=(J=null==O?void 0:O[y])?J:0,at=nt?et:X-w[tt]-g[tt]-st+x.altAxis,ct=nt?X+w[tt]+g[tt]-st-x.altAxis:it,dt=c&&nt?function(t,e,i){var n=xt(t,e,i);return n>i?i:n}(at,X,ct):xt(c?at:et,X,c?ct:it);m[y]=dt,M[y]=dt-X}e.modifiersData[n]=M}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,n=t.name,s=t.options,a=i.elements.arrow,o=i.modifiersData.popperOffsets,r=ot(i.placement),h=kt(r),c=[U,_].indexOf(r)>=0?"height":"width";if(a&&o){var d=function(t,e){return Ot("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Mt(t,K))}(s.padding,i),u=ft(a),l="y"===h?R:U,f="y"===h?V:_,v=i.rects.reference[c]+i.rects.reference[h]-o[h]-i.rects.popper[c],b=o[h]-i.rects.reference[h],p=gt(a),y=p?"y"===h?p.clientHeight||0:p.clientWidth||0:0,m=y/2-u[c]/2+(v/2-b/2),w=xt(d[l],m,y-u[c]-d[f]);i.modifiersData[n]=((e={})[h]=w,e.centerOffset=w-m,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&vt(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,s=e.rects.popper,a=e.modifiersData.preventOverflow,o=Ft(e,{elementContext:"reference"}),r=Ft(e,{altBoundary:!0}),h=_t(o,n),c=_t(r,s,a),d=Ut(h),u=Ut(c);e.modifiersData[i]={referenceClippingOffsets:h,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}}]});const Jt=class{constructor(i){t(this,i),this.opened=e(this,"opened",7),this.closed=e(this,"closed",7),this.inline=!1,this.placement="bottom-start",this.offset=[0,8],this.closing=!1,this.showing=this.inline||!1,this.positioned=!1,this.originalParent=null,this.originalNextSibling=null,this.isMovingPortal=!1,this.popperInstance=null,this.onKeyDown=t=>{"Escape"===t.code&&this.close()}}watchShowing(t){t||(this.destroyPopperInstance(),this.cleanupPortal()),this.positioned=!1}getAppendToElement(){return this.appendTo?"body"===this.appendTo?document.body:"string"==typeof this.appendTo?document.querySelector(this.appendTo):this.appendTo:null}setupPortal(){const t=this.getAppendToElement();t&&(this.originalParent=this.hostElement.parentElement,this.originalNextSibling=this.hostElement.nextSibling,this.isMovingPortal=!0,t.appendChild(this.hostElement),this.isMovingPortal=!1)}cleanupPortal(){this.isMovingPortal||this.originalParent&&(this.isMovingPortal=!0,this.originalNextSibling?this.originalParent.insertBefore(this.hostElement,this.originalNextSibling):this.originalParent.appendChild(this.hostElement),this.originalParent=null,this.originalNextSibling=null,this.isMovingPortal=!1)}createPopperInstance(){if(!this.triggerElement||!this.bodyRef)return;const t=!!this.appendTo,e=t?"viewport":"clippingParents";this.popperInstance=Gt(this.triggerElement,this.bodyRef,{placement:this.placement,strategy:t?"fixed":"absolute",modifiers:[{name:"offset",options:{offset:this.offset}},{name:"flip",options:{fallbackPlacements:["top-start","top-end","bottom-end"],boundary:e}},{name:"preventOverflow",options:{boundary:e,altAxis:!0,padding:8}},{name:"computeStyles",options:{gpuAcceleration:!0}},{name:"applyStyles",enabled:!0}]}),this.popperInstance.forceUpdate(),this.positioned=!0}destroyPopperInstance(){this.popperInstance&&(this.popperInstance.destroy(),this.popperInstance=null)}async open(){this.inline||(this.showing=!0,this.undo=F(this.el),this.opened.emit(void 0))}async close(){var t;this.inline||(this.showing=!1,this.closed.emit(void 0),null===(t=this.undo)||void 0===t||t.call(this),this.triggerElement&&this.triggerElement.focus())}disconnectedCallback(){this.isMovingPortal||(this.destroyPopperInstance(),this.cleanupPortal())}async getState(){return this.showing}async setTriggerElement(t){this.triggerElement=t}async updatePosition(){var t;await(null===(t=this.popperInstance)||void 0===t?void 0:t.update())}handleClick(t){var e;if(this.showing){const i=t.target;this.hostElement.contains(i)||(null===(e=this.triggerElement)||void 0===e?void 0:e.contains(i))||this.originalParent&&this.originalParent.contains(i)||this.close()}}render(){return i(n,{key:"488fb845bb3a168c45f715b5f7315a80e1857589",showing:this.showing,ref:t=>t&&(this.el=t)},!this.inline&&this.showing&&i("div",{key:"d6263beffa3dbeaa7f0e5e65c1f2627c07164648",part:"body",ref:t=>{t&&(this.bodyRef=t,this.showing&&this.triggerElement&&!this.popperInstance&&(this.setupPortal(),requestAnimationFrame((()=>{requestAnimationFrame((()=>{this.createPopperInstance()}))}))))},style:{visibility:this.positioned?"visible":"hidden"},onKeyDown:this.onKeyDown,role:"dialog",tabindex:-1,"aria-hidden":!this.showing,"aria-label":this.label,"aria-modal":this.showing},i("focus-trap",{key:"7ffb9cc684198ab9f3b127a4abe5f60f3241cd49"},i("div",{key:"c6c7c14220c01969f3a5c92dda882685f4c43268",part:"content"},i("slot",{key:"a1e6ce7ed152f61b3970e20b40e36bb13ee7580a"})))),this.inline&&i("div",{key:"632750cfce76139771642e03051f5c4a654db56a",part:"content"},i("slot",{key:"c1aa297a6ffdeee55840a9e05adddb7220e7f954"})))}get hostElement(){return s(this)}static get watchers(){return{showing:[{watchShowing:0}]}}};Jt.style=":host::part(body){position:absolute;top:0;left:0;width:-moz-fit-content;width:fit-content;z-index:1200}:host::part(backdrop){}:host::part(content){}";export{S as tabworthy_dates_calendar,Jt as tabworthy_dates_modal}
|