UNPKG

@quasar/quasar-ui-qcalendar

Version:

QCalendar - Day/Month/Week Calendars, Popups, Date Pickers, Schedules, Agendas, Planners and Tasks for your Vue Apps

6 lines 49.9 kB
/*! * @quasar/quasar-ui-qcalendar v4.1.2 * (c) 2025 Jeff Galbraith <jeff@quasar.dev> * Released under the MIT License. */ var vue=require("vue");const PARSE_DATETIME=/^(\d{4})-(\d{1,2})(-(\d{1,2}))?([^\d]+(\d{1,2}))?(:(\d{1,2}))?(:(\d{1,2}))?(.(\d{1,3}))?$/,PARSE_DATE=/^(\d{4})-(\d{1,2})(-(\d{1,2}))?/,PARSE_TIME=/(\d\d?)(:(\d\d?)|)(:(\d\d?)|)/,DAYS_IN_MONTH=[0,31,28,31,30,31,30,31,31,30,31,30,31],DAYS_IN_MONTH_LEAP=[0,31,29,31,30,31,30,31,31,30,31,30,31],TIME_CONSTANTS={MILLISECONDS_IN:{SECOND:1e3,MINUTE:6e4,HOUR:36e5,DAY:864e5,WEEK:6048e5},SECONDS_IN:{MINUTE:60,HOUR:3600,DAY:86400,WEEK:604800},MINUTES_IN:{MINUTE:1,HOUR:60,DAY:1440,WEEK:10080},HOURS_IN:{DAY:24,WEEK:168},DAYS_IN:{WEEK:7}},DAYS_IN_MONTH_MIN=28,DAYS_IN_MONTH_MAX=31,MONTH_MAX=12,MONTH_MIN=1,DAY_MIN=1,FIRST_HOUR=0;function validateTimestamp(e){return"string"===typeof e&&PARSE_DATETIME.test(e)}function parsed(e){if("string"!==typeof e)return null;const t=PARSE_DATETIME.exec(e);if(!t||!t[1]||!t[2])return null;const a=parseInt(t[1],10),n=parseInt(t[2],10),r=parseInt(t[4]||"1",10),o=parseInt(t[6]||"0",10),u=parseInt(t[8]||"0",10);return{date:e,time:o.toString().padStart(2,"0")+":"+u.toString().padStart(2,"0"),year:a,month:n,day:r,hour:o,minute:u,hasDay:!!t[4],hasTime:!0,past:!1,current:!1,future:!1,disabled:!1,weekday:0,doy:0,workweek:0}}function parseDate(e,t=!1){if(!(e instanceof Date))return null;const a=t?"UTC":"";return updateFormatted({date:padNumber(e[`get${a}FullYear`](),4)+"-"+padNumber(e[`get${a}Month`]()+1,2)+"-"+padNumber(e[`get${a}Date`](),2),time:padNumber(e[`get${a}Hours`]()||0,2)+":"+padNumber(e[`get${a}Minutes`]()||0,2),year:e[`get${a}FullYear`](),month:e[`get${a}Month`]()+1,day:e[`get${a}Date`](),hour:e[`get${a}Hours`](),minute:e[`get${a}Minutes`](),weekday:0,doy:0,workweek:0,hasDay:!0,hasTime:!0,past:!1,current:!1,future:!1,disabled:!1})}function padNumber(e,t){let a=String(e);while(a.length<t)a="0"+a;return a}function isLeapYear(e){return e%4===0&&e%100!==0||e%400===0}function daysInMonth(e,t){return(isLeapYear(e)?DAYS_IN_MONTH_LEAP:DAYS_IN_MONTH)[t]}function nextDay(e){const t=new Date(e.year,e.month-1,e.day+1);return updateFormatted(normalizeTimestamp({...e,year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()}))}function prevDay(e){const t=new Date(e.year,e.month-1,e.day-1);return updateFormatted(normalizeTimestamp({...e,year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()}))}function today(){const e=new Date,t=e.getMonth()+1,a=e.getDate(),n=e.getFullYear();return[n,padNumber(t,2),padNumber(a,2)].join("-")}function isToday(e){return e===today()}function getStartOfWeek(e,t,a){let n=copyTimestamp(e);if(t){if(1===n.day||0===n.weekday)while(!t.includes(Number(n.weekday)))n=nextDay(n);n=findWeekday(n,t[0],prevDay),n=updateFormatted(n),a&&(n=updateRelative(n,a,n.hasTime))}return n}function getEndOfWeek(e,t,a){let n=copyTimestamp(e);if(t&&Array.isArray(t)){const r=daysInMonth(n.year,n.month);if(r===n.day||n.weekday===t[t.length-1])while(!t.includes(Number(n.weekday)))n=prevDay(n);n=findWeekday(n,t[t.length-1],nextDay),n=updateFormatted(n),a&&(n=updateRelative(n,a,n.hasTime))}return n}function getStartOfMonth(e){let t=copyTimestamp(e);return t.day=DAY_MIN,t=updateFormatted(t),t}function getEndOfMonth(e){let t=copyTimestamp(e);return t.day=daysInMonth(t.year,t.month),t=updateFormatted(t),t}function parseTime(e){const t=Object.prototype.toString.call(e);switch(t){case"[object Number]":return e;case"[object String]":{const a=PARSE_TIME.exec(e);return a?60*parseInt(a[1],10)+parseInt(a[3]||"0",10):!1}case"[object Object]":return"object"!==typeof e||"number"!==typeof e.hour||"number"!==typeof e.minute?!1:"object"===typeof e&&"hour"in e&&"minute"in e&&60*e.hour+e.minute}return!1}function compareTimestamps(e,t){return!(!e||!t)&&e.year===t.year&&e.month===t.month&&e.day===t.day&&e.hour===t.hour&&e.minute===t.minute}function compareDate(e,t){return getDate(e)===getDate(t)}function compareTime(e,t){return getTime(e)===getTime(t)}function compareDateTime(e,t){return getDateTime(e)===getDateTime(t)}function parseTimestamp(e,t=null){let a=parsed(e);return a?(a=updateFormatted(a),t&&(a=updateRelative(a,t,a.hasTime)),a):null}function getDayIdentifier(e){return 1e8*(e.year??0)+1e6*(e.month??0)+1e4*(e.day??0)}function getTimeIdentifier(e){return 100*(e.hour??0)+(e.minute??0)}function getDayTimeIdentifier(e){return getDayIdentifier(e)+getTimeIdentifier(e)}function diffTimestamp(e,t,a=!1){const n=Date.UTC(e.year??0,(e.month??1)-1,e.day??1,e.hour??0,e.minute??0),r=Date.UTC(t.year??0,(t.month??1)-1,t.day??1,t.hour??0,t.minute??0);return!0===a&&r<n?0:r-n}function updateRelative(e,t,a=!1){let n=copyTimestamp(e),r=getDayIdentifier(t),o=getDayIdentifier(n),u=r===o;return n.hasTime&&a&&u&&(r=getTimeIdentifier(t),o=getTimeIdentifier(n),u=r===o),n.past=o<r,n.current=u,n.future=o>r,n.currentWeekday=n.weekday===t.weekday,n}function updateMinutes(e,t,a=null){let n=copyTimestamp(e);return n.hasTime=!0,n.hour=Math.floor(t/TIME_CONSTANTS.MINUTES_IN.HOUR),n.minute=t%TIME_CONSTANTS.MINUTES_IN.HOUR,n.time=getTime(n),a&&(n=updateRelative(n,a,!0)),n}function updateWeekday(e){let t=copyTimestamp(e);return t.weekday=getWeekday(t),t}function updateDayOfYear(e){let t=copyTimestamp(e);return t.doy=getDayOfYear(t)||0,t}function updateWorkWeek(e){let t=copyTimestamp(e);return t.workweek=getWorkWeek(t),t}function updateDisabled(e,t,a,n,r){let o=copyTimestamp(e);const u=getDayIdentifier(o);if(void 0!==t){const l=parsed(t);if(l){const c=getDayIdentifier(l);u<=c&&(o.disabled=!0)}}if(!0!==o.disabled&&void 0!==a){const m=parsed(a);if(m){const v=getDayIdentifier(m);u>=v&&(o.disabled=!0)}}if(!0!==o.disabled&&Array.isArray(n)&&n.length>0)for(var i in n)if(n[i]===o.weekday){o.disabled=!0;break}if(!0!==o.disabled&&Array.isArray(r)&&r.length>0)for(var d in r)if(Array.isArray(r[d])&&2===r[d].length&&r[d][0]&&r[d][1]){const p=parsed(r[d][0]),y=parsed(r[d][1]);if(p&&y&&isBetweenDates(o,p,y)){o.disabled=!0;break}}else{const f=r[d];if(Array.isArray(f))for(var s of f){const h=parseTimestamp(s);if(h){const g=getDayIdentifier(h);if(g===u){o.disabled=!0;break}}}else if(f){const T=parseTimestamp(f);if(T){const D=getDayIdentifier(T);D===u&&(o.disabled=!0)}}}return o}function updateFormatted(e){let t=copyTimestamp(e);return t.hasTime=!0,t.time=getTime(t),t.date=getDate(t),t.weekday=getWeekday(t),t.doy=getDayOfYear(t)||0,t.workweek=getWorkWeek(t),t}function getDayOfYear(e){if(0!==e.year)return(Date.UTC(e.year,e.month-1,e.day)-Date.UTC(e.year,0,0))/24/60/60/1e3}function getWorkWeek(e){let t=copyTimestamp(e);if(0===t.year){const r=parseTimestamp(today());r&&(t=r)}const a=new Date(Date.UTC(t.year,t.month-1,t.day)),n=4;a.setUTCDate(a.getUTCDate()-(a.getUTCDay()+6)%7+n),a.setUTCDate(a.getUTCDate()+n-(a.getUTCDay()||7));e=new Date(Date.UTC(a.getUTCFullYear(),0,1)),e=Math.ceil(((a.valueOf()-e.valueOf())/864e5+1)/7);return e}function getWeekday(e){let t=e.weekday;if(e.hasDay){const a=Math.floor,n=e.day,r=(e.month+9)%MONTH_MAX+1,o=a(e.year/100),u=e.year%100-(e.month<=2?1:0);t=((n+a(2.6*r-.2)-2*o+u+a(u/4)+a(o/4))%7+7)%7}return t??0}function copyTimestamp(e){return{...e}}function getDate(e){let t=padNumber(e.year,4)+"-"+padNumber(e.month,2);return e.hasDay&&(t+="-"+padNumber(e.day,2)),t}function getTime(e){return e.hasTime?padNumber(e.hour,2)+":"+padNumber(e.minute,2):""}function getDateTime(e){return getDate(e)+" "+(e.hasTime?getTime(e):"00:00")}function moveRelativeDays(e,t=nextDay,a=1,n=[0,1,2,3,4,5,6]){const r=copyTimestamp(e);return relativeDays(r,t,a,n)}function relativeDays(e,t=nextDay,a=1,n=[0,1,2,3,4,5,6]){let r=copyTimestamp(e);n.includes(Number(r.weekday))||0!==r.weekday||t!==nextDay||++a;while(--a>=0)r=t(r),n.length<7&&!n.includes(Number(r.weekday))&&++a;return r}function findWeekday(e,t,a=nextDay,n=6){let r=copyTimestamp(e);while(r.weekday!==t&&--n>=0)r=a(r);return r}function createDayList(e,t,a,n=[0,1,2,3,4,5,6],r=void 0,o=void 0,u=[],i=[],d=42,s=0){const l=getDayIdentifier(e),c=getDayIdentifier(t),m=[];let v=copyTimestamp(e),p=0,y=p===c;if(!(c<l))while((!y||m.length<s)&&m.length<d){if(p=getDayIdentifier(v),y=y||p>c&&m.length>=s,y)break;if(n.includes(Number(v.weekday))){let e=copyTimestamp(v);e=updateFormatted(e),e=updateRelative(e,a),e=updateDisabled(e,r,o,u,i),m.push(e)}v=relativeDays(v,nextDay)}return m}function createIntervalList(t,a,n,r,o){const u=[];for(let e=0;e<r;++e){const i=(a+e)*n,d=copyTimestamp(t);u.push(updateMinutes(d,i,o))}return u}function createNativeLocaleFormatter(n,r){const e=()=>"";return"undefined"===typeof Intl||"undefined"===typeof Intl.DateTimeFormat?e:(t,e)=>{try{const a=new Intl.DateTimeFormat(n||void 0,r(t,e));return a.format(makeDateTime(t))}catch(e){return console.error(`Intl.DateTimeFormat: ${e.message} -> `+getDateTime(t)),""}}}function makeDate(e,t=!0){return t?new Date(Date.UTC(e.year,e.month-1,e.day,0,0)):new Date(e.year,e.month-1,e.day,0,0)}function makeDateTime(e,t=!0){return t?new Date(Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute)):new Date(e.year,e.month-1,e.day,e.hour,e.minute)}function validateNumber(e){return isFinite(Number(e))}function maxTimestamp(e,t=!1){const a=!0===t?getDayTimeIdentifier:getDayIdentifier;return e.reduce((e,t)=>{return Math.max(a(e),a(t))===a(e)?e:t})}function minTimestamp(e,t=!1){const a=!0===t?getDayTimeIdentifier:getDayIdentifier;return e.reduce((e,t)=>{return Math.min(a(e),a(t))===a(e)?e:t})}function isBetweenDates(e,t,a,n=!1){const r=getDayIdentifier(e)+(!0===n?getTimeIdentifier(e):0),o=getDayIdentifier(t)+(!0===n?getTimeIdentifier(t):0),u=getDayIdentifier(a)+(!0===n?getTimeIdentifier(a):0);return r>=o&&r<=u}function isOverlappingDates(e,t,a,n){const r=getDayIdentifier(e),o=getDayIdentifier(t),u=getDayIdentifier(a),i=getDayIdentifier(n);return r>=u&&r<=i||o>=u&&o<=i||u>=r&&o>=i}function addToDate(e,t){const a=copyTimestamp(e);return t.year&&(a.year+=t.year),t.month&&(a.month+=t.month),t.day&&(a.day+=t.day),t.hour&&(a.hour+=t.hour),t.minute&&(a.minute+=t.minute),updateFormatted(normalizeTimestamp(a))}function normalizeTimestamp(e){const t=new Date(e.year,e.month-1,e.day,e.hour,e.minute);return{...e,year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes()}}function daysBetween(e,t){const a=diffTimestamp(e,t,!0);return Math.floor(a/TIME_CONSTANTS.MILLISECONDS_IN.DAY)}function weeksBetween(e,t){let a=copyTimestamp(e),n=copyTimestamp(t);return a=findWeekday(a,0),n=findWeekday(n,6),Math.ceil(daysBetween(a,n)/TIME_CONSTANTS.DAYS_IN.WEEK)}const weekdayDateMap={Sun:new Date("2020-01-05T00:00:00.000Z"),Mon:new Date("2020-01-06T00:00:00.000Z"),Tue:new Date("2020-01-07T00:00:00.000Z"),Wed:new Date("2020-01-08T00:00:00.000Z"),Thu:new Date("2020-01-09T00:00:00.000Z"),Fri:new Date("2020-01-10T00:00:00.000Z"),Sat:new Date("2020-01-11T00:00:00.000Z")};function getWeekdayFormatter(){const e=()=>"",r={long:{timeZone:"UTC",weekday:"long"},short:{timeZone:"UTC",weekday:"short"},narrow:{timeZone:"UTC",weekday:"narrow"}};return"undefined"===typeof Intl||"undefined"===typeof Intl.DateTimeFormat?e:t;function t(t,e,a){try{const n=new Intl.DateTimeFormat(a||void 0,r[e]||r["long"]);return n.format(weekdayDateMap[t])}catch(e){return e instanceof Error&&console.error(`Intl.DateTimeFormat: ${e.message} -> day of week: `+t),""}}}function getWeekdayNames(t,a){const e=Object.keys(weekdayDateMap),n=getWeekdayFormatter();return e.map(e=>String(n(e,t,a)))}function getMonthFormatter(){const e=()=>"",o={long:{timeZone:"UTC",month:"long"},short:{timeZone:"UTC",month:"short"},narrow:{timeZone:"UTC",month:"narrow"}};return"undefined"===typeof Intl||"undefined"===typeof Intl.DateTimeFormat?e:t;function t(t,e,a){try{const n=new Intl.DateTimeFormat(a||void 0,o[e]||o["long"]),r=new Date;return r.setDate(1),r.setMonth(t),n.format(r)}catch(e){return e instanceof Error&&console.error(`Intl.DateTimeFormat: ${e.message} -> month: `+t),""}}}function getMonthNames(t,a){const n=getMonthFormatter();return[...Array(12).keys()].map(e=>n(e,t,a))}function convertToUnit(e,t="px"){if(e)return isNaN(e)?String(e):"auto"===e?e:""+Number(e)+t}function indexOf(t,a){for(let e=0;e<t.length;e++)if(!0===a(t[e],e))return e;return-1}function minCharWidth(e,t){return 0===t?e:e.slice(0,t)}const ResizeObserverDirective={mounted(e,t){if("function"===typeof t.value){const a=t.value,n={callback:a,size:{width:0,height:0},observer:new ResizeObserver(e=>{const t=e[0].contentRect;t.width===n.size.width&&t.height===n.size.height||(n.size.width=t.width,n.size.height=t.height,n.debounceTimeout&&clearTimeout(n.debounceTimeout),n.debounceTimeout=setTimeout(()=>{n.callback(n.size),n.debounceTimeout=void 0},100))})};n.observer.observe(e),e.__onResizeObserver=n}},beforeUnmount(e){if(e.__onResizeObserver){const{observer:t,debounceTimeout:a}=e.__onResizeObserver;a&&clearTimeout(a),t.unobserve(e),delete e.__onResizeObserver}}};function useCalendar(t,a,{scrollArea:e,pane:n}){if(!a){const l="[error: renderCalendar] no renderFunc has been supplied to useCalendar";throw console.error(l),new Error(l)}const r=vue.reactive({width:0,height:0}),o=vue.ref(null);function u({width:e,height:t}){r.width=e,r.height=t}const i=vue.computed(()=>{return!0!==t.noScroll&&e.value&&n.value&&r.height?e.value.offsetWidth-n.value.offsetWidth:0});function d(){}function s(){const e={ref:o,role:"complementary",lang:t.locale,class:`q-calendar ${t.dark?"q-calendar--dark":""} `+(t.bordered?"q-calendar__bordered":"")};return vue.withDirectives(vue.h("div",{...e},[a()]),[[ResizeObserverDirective,u]])}return{rootRef:o,scrollWidth:i,__initCalendar:d,__renderCalendar:s}}const isValidFocusType=e=>e.every(e=>["day","date","weekday","interval","time","resource","task"].includes(e)),useCommonProps={modelValue:{type:String,default:today(),validator:e=>""===e||validateTimestamp(e)},weekdays:{type:Array,default:()=>[0,1,2,3,4,5,6]},dateType:{type:String,default:"round",validator:e=>["round","rounded","square"].includes(e)},weekdayAlign:{type:String,default:"center",validator:e=>["left","center","right"].includes(e)},dateAlign:{type:String,default:"center",validator:e=>["left","center","right"].includes(e)},bordered:Boolean,dark:Boolean,noAria:Boolean,noActiveDate:Boolean,noHeader:Boolean,noScroll:Boolean,shortWeekdayLabel:Boolean,noDefaultHeaderText:Boolean,noDefaultHeaderBtn:Boolean,minWeekdayLabel:{type:[Number,String],default:1},weekdayBreakpoints:{type:Array,default:()=>[75,35],validator:e=>2===e.length},locale:{type:String,default:"en-US"},animated:Boolean,transitionPrev:{type:String,default:"slide-right"},transitionNext:{type:String,default:"slide-left"},disabledDays:Array,disabledBefore:String,disabledAfter:String,disabledWeekdays:{type:Array,default:()=>[]},dragEnterFunc:Function,dragOverFunc:Function,dragLeaveFunc:Function,dropFunc:Function,selectedDates:{type:[Array,Set],default:()=>[]},selectedStartEndDates:{type:Array,default:()=>[]},hoverable:Boolean,focusable:Boolean,focusType:{type:Array,default:()=>["date"],validator:isValidFocusType}};function useCommon(t,{startDate:e,endDate:a,times:n}){const r=vue.computed(()=>parseTimestamp(e.value)),o=vue.computed(()=>{return"0000-00-00"===a.value?getEndOfWeek(r.value,t.weekdays,n.today):parseTimestamp(a.value)||r.value}),u=vue.computed(()=>createNativeLocaleFormatter(t.locale,()=>({timeZone:"UTC",day:"numeric"}))),i=vue.computed(()=>createNativeLocaleFormatter(t.locale,(e,t)=>({timeZone:"UTC",weekday:t?"short":"long"}))),d=vue.computed(()=>createNativeLocaleFormatter(t.locale,()=>({timeZone:"UTC",dateStyle:"full"})));function s(e,t){return e&&e.length>0&&e.includes(t.date)}function l(e,t){const a={firstDay:!1,betweenDays:!1,lastDay:!1};if(2===e.length){const n=getDayIdentifier(t),r=getDayIdentifier(parsed(e[0])),o=getDayIdentifier(parsed(e[1]));a.firstDay=r===n,a.lastDay=o===n,a.betweenDays=r<n&&o>n}return a}function c(e,t=!1,a=[],n=[],r=!1){const o=s(a,e),{firstDay:u,lastDay:i,betweenDays:d}=l(n,e);return{"q-past-day":!u&&!d&&!i&&!o&&!t&&!!e.past,"q-future-day":!u&&!d&&!i&&!o&&!t&&!!e.future,"q-outside":t,"q-current-day":!!e.current,"q-selected":o,"q-range-first":u,"q-range":d,"q-range-last":i,"q-range-hover":r&&(u||i||d),"q-disabled-day disabled":!0===e.disabled}}function m(e){return getStartOfWeek(e,t.weekdays,n.today)}function v(e){return getEndOfWeek(e,t.weekdays,n.today)}function p(){return{}}return{parsedStart:r,parsedEnd:o,dayFormatter:u,weekdayFormatter:i,ariaDateFormatter:d,arrayHasDate:s,checkDays:l,getRelativeClasses:c,startOfWeek:m,endOfWeek:v,dayStyleDefault:p}}function scrollTo(e,t){e instanceof Window?e.scrollTo({top:t,behavior:"instant"}):e.scrollTop=t}function getVerticalScrollPosition(e){return e instanceof Window?e.scrollY:e.scrollTop}function animVerticalScrollTo(o,u,i=500,d=performance.now(),s=getVerticalScrollPosition(o)){i<=0||s===u?scrollTo(o,u):requestAnimationFrame(e=>{const t=e-d,a=Math.min(t/i,1),n=e=>e<.5?2*e*e:(4-2*e)*e-1,r=s+(u-s)*n(a);scrollTo(o,r),a<1&&animVerticalScrollTo(o,u,i,d,s)})}function animHorizontalScrollTo(r,e,o=500){const u=r.scrollLeft,i=e-u;let d=null;function s(e){null===d&&(d=e);const t=e-d,a=Math.min(t/o,1),n=e=>e<.5?2*e*e:(4-2*e)*e-1;r.scrollLeft=u+i*n(a),t<o&&requestAnimationFrame(s)}requestAnimationFrame(s)}const useSchedulerProps={view:{type:String,validator:e=>["day","week","month","month-interval"].includes(e),default:"day"},modelResources:{type:Array},resourceKey:{type:String,default:"id"},resourceLabel:{type:String,default:"label"},resourceHeight:{type:[Number,String],default:0,validator:validateNumber},resourceMinHeight:{type:[Number,String],default:70,validator:validateNumber},resourceStyle:{type:Function,default:null},resourceClass:{type:Function,default:null},weekdayStyle:{type:Function,default:null},weekdayClass:{type:Function,default:null},dayStyle:{type:Function,default:null},dayClass:{type:Function,default:null},dateHeader:{type:String,default:"stacked",validator:e=>["stacked","inline","inverted"].includes(e)}};function useInterval(o,{times:t,scrollArea:n,parsedStart:e,parsedEnd:a,maxDays:r,size:u,headerColumnRef:i}){const d=vue.computed(()=>parseInt(String(o.intervalStart),10)),m=vue.computed(()=>parseInt(String(o.intervalMinutes),10)),s=vue.computed(()=>parseInt(String(o.intervalCount),10)),v=vue.computed(()=>parseFloat(String(o.intervalHeight))),p=vue.computed(()=>{let e=0;const t=Number(o.columnCount);return o.cellWidth?e=Number(o.cellWidth):u.width>0&&i.value&&(e=i.value.offsetWidth/(t>1?t:r.value)),e}),l=vue.computed(()=>d.value*m.value),c=vue.computed(()=>s.value*v.value),y=vue.computed(()=>s.value*p.value),f=vue.computed(()=>D(e.value)),h=vue.computed(()=>w(a.value)),g=vue.computed(()=>{return createDayList(e.value,a.value,t.today,o.weekdays,o.disabledBefore,o.disabledAfter,o.disabledWeekdays,o.disabledDays,r.value)}),T=vue.computed(()=>{return g.value.map(e=>createIntervalList(e,d.value,m.value,s.value,t.now))});function D(e){return getStartOfWeek(e,o.weekdays,t.today)}function w(e){return getEndOfWeek(e,o.weekdays,t.today)}function k(e,t){return e&&e.length>0&&e.includes(getDateTime(t))}function _(e,t){const a={firstDay:!1,betweenDays:!1,lastDay:!1};if(e&&2===e.length){const n=getDayTimeIdentifier(t),r=getDayTimeIdentifier(parsed(e[0])),o=getDayTimeIdentifier(parsed(e[1]));a.firstDay=r===n,a.lastDay=o===n,a.betweenDays=r<n&&o>n}return a}function b(e,t=[],a=[]){const n=k(t,e),{firstDay:r,lastDay:o,betweenDays:u}=_(a,e);return{"q-selected":n,"q-range-first":!0===r,"q-range":!0===u,"q-range-last":!0===o,"q-disabled-interval disabled":!0===e.disabled}}function I(e,t,a){return[]}const S=vue.computed(()=>{const a={timeZone:"UTC",hour12:!o.hour24Format,hour:"2-digit",minute:"2-digit"},n={timeZone:"UTC",hour12:!o.hour24Format,hour:"numeric",minute:"2-digit"},r={timeZone:"UTC",hour12:!o.hour24Format,hour:"numeric"};return createNativeLocaleFormatter(o.locale,(e,t)=>t?0===e.minute?r:n:a)}),x=vue.computed(()=>{const e={timeZone:"UTC",dateStyle:"full",timeStyle:"short"};return createNativeLocaleFormatter(o.locale,()=>e)});function M(e){const t=T.value[0][0],a=t.hour===e.hour&&t.minute===e.minute;return!a&&0===e.minute}function N(e){}function E(e){return{}}function C(e,t,a=!1,n){let r=copyTimestamp(t);if(e.currentTarget){const o=e.currentTarget.getBoundingClientRect(),u=e,i=e,d=u.changedTouches||u.touches,s=(d&&d[0]?d[0]:i).clientY,l=(s-o.top)/v.value,c=Math.floor((a?Math.floor(l):l)*m.value);0!==c&&(r=addToDate(r,{minute:c})),n&&(r=updateRelative(r,n,!0))}return r}function R(e,t,a=!1,n){let r=copyTimestamp(t);const o=e.currentTarget.getBoundingClientRect(),u=e,i=e,d=u.changedTouches||u.touches,s=(d&&d[0]?d[0]:i).clientY,l=(s-o.top)/v.value,c=Math.floor((a?Math.floor(l):l)*m.value);return 0!==c&&(r=addToDate(r,{minute:c})),n&&(r=updateRelative(r,n,!0)),r}function H(e,t,a=!1,n){let r=copyTimestamp(t);if(e.currentTarget){const o=e.currentTarget.getBoundingClientRect(),u=e,i=e,d=u.changedTouches||u.touches,s=(d&&d[0]?d[0]:i).clientX,l=(s-o.left)/p.value,c=Math.floor((a?Math.floor(l):l)*m.value);0!==c&&(r=addToDate(r,{minute:c})),n&&(r=updateRelative(r,n,!0))}return r}function q(e,t){const a={timestamp:e,timeStartPos:O,timeDurationHeight:F};return void 0!==t&&(a.columnIndex=t),a}function U(e,t){const a={timestamp:copyTimestamp(e),timeStartPosX:W,timeDurationWidth:A};return void 0!==t&&(a.index=t),a}function L(e,t=0){const a=O(e);return!(!1===a||!n.value)&&(animVerticalScrollTo(n.value,a,t),!0)}function Y(e,t=0){const a=W(e);return!(!1===a||!n.value)&&(animHorizontalScrollTo(n.value,a,t),!0)}function F(e){return e/m.value*v.value}function A(e){return e/m.value*p.value}function B(e){return e*m.value/v.value}function P(e){return e*m.value/p.value}function O(e,t=!0){const a=parseTime(e);if(!1===a)return!1;const n=l.value,r=s.value*m.value,o=(a-n)/r;let u=o*c.value;return t&&(u<0&&(u=0),u>c.value)&&(u=c.value),u}function W(e,t=!0){const a=parseTime(e);if(!1===a)return!1;const n=l.value,r=s.value*m.value,o=(a-n)/r;let u=o*y.value;return t&&(u<0&&(u=0),u>y.value)&&(u=y.value),u}return{parsedIntervalStart:d,parsedIntervalMinutes:m,parsedIntervalCount:s,parsedIntervalHeight:v,parsedCellWidth:p,parsedStartMinute:l,bodyHeight:c,bodyWidth:y,parsedWeekStart:f,parsedWeekEnd:h,days:g,intervals:T,intervalFormatter:S,ariaDateTimeFormatter:x,arrayHasDateTime:k,checkIntervals:_,getIntervalClasses:b,getResourceClasses:I,showIntervalLabelDefault:M,showResourceLabelDefault:N,styleDefault:E,getTimestampAtEventInterval:C,getTimestampAtEvent:R,getTimestampAtEventX:H,getScopeForSlot:q,getScopeForSlotX:U,scrollToTime:L,scrollToTimeX:Y,timeDurationHeight:F,timeDurationWidth:A,heightToMinutes:B,widthToMinutes:P,timeStartPos:O,timeStartPosX:W}}const useColumnProps={columnCount:{type:[Number,String],default:0,validator:validateNumber},columnIndexStart:{type:[Number,String],default:0,validator:validateNumber}},useMaxDaysProps={maxDays:{type:Number,default:1}},useTimesProps={now:{type:String,validator:e=>""===e||validateTimestamp(e),default:""}};function useTimes(e){const t=vue.reactive({now:parseTimestamp("0000-00-00 00:00"),today:parseTimestamp("0000-00-00")}),a=vue.computed(()=>e.now?parseTimestamp(e.now):o());function n(){t.now&&t.today&&(t.now.current=t.today.current=!0,t.now.past=t.today.past=!1,t.now.future=t.today.future=!1)}function r(){const e=a.value||o();u(e,t.now),i(e,t.now),u(e,t.today)}function o(){return parseDate(new Date)}function u(e,t){e.date!==t.date&&(t.year=e.year,t.month=e.month,t.day=e.day,t.weekday=e.weekday,t.date=e.date)}function i(e,t){e.time!==t.time&&(t.hour=e.hour,t.minute=e.minute,t.time=e.time)}return vue.watch(a,()=>r()),{times:t,parsedNow:a,setCurrent:n,updateCurrent:r,getNow:o,updateDay:u,updateTime:i}}function useRenderValues(r,{parsedView:o,parsedValue:u,times:i}){const e=vue.computed(()=>{const e=u.value;let t=r.maxDays,a=e,n=e;switch(o.value){case"month":a=getStartOfMonth(e),n=getEndOfMonth(e),t=daysInMonth(a.year,a.month);break;case"week":case"week-agenda":case"week-scheduler":a=getStartOfWeek(e,r.weekdays,i.today),n=getEndOfWeek(a,r.weekdays,i.today),t=r.weekdays.length;break;case"day":case"scheduler":case"agenda":n=moveRelativeDays(copyTimestamp(n),nextDay,t>1?t-1:t,r.weekdays),n=updateFormatted(n);break;case"month-interval":case"month-scheduler":case"month-agenda":a=getStartOfMonth(e),n=getEndOfMonth(e),n=updateFormatted(n),t=daysInMonth(a.year,a.month);break;case"resource":t=1,n=moveRelativeDays(copyTimestamp(n),nextDay,t,r.weekdays),n=updateFormatted(n);break}return{start:a,end:n,maxDays:t}});return{renderValues:e}}const toCamelCase=e=>e.replace(/(-\w)/g,e=>e[1].toUpperCase());function getMouseEventHandlers(t,e,a,n){const r={};for(const o in a){const u=a[o],i=toCamelCase("on-"+o);if(!e.value)return console.warn("$listeners has not been set up"),{};if(void 0!==e.value[i]){const d="on"+u.event.charAt(0).toUpperCase()+u.event.slice(1),s=e=>{return(void 0===u.button||"buttons"in e&&e.buttons>0&&e.button===u.button)&&(u.prevent&&e.preventDefault(),u.stop&&e.stopPropagation(),t(o,n(e,o))),u.result};d in r?Array.isArray(r[d])?r[d].push(s):r[d]=[r[d],s]:r[d]=s}}return r}function getDefaultMouseEventHandlers(e,t,a,n){return getMouseEventHandlers(e,t,getMouseEventName(a),n)}function getMouseEventName(e){return{["click"+e]:{event:"click"},["contextmenu"+e]:{event:"contextmenu",prevent:!0,result:!1},["mousedown"+e]:{event:"mousedown"},["mousemove"+e]:{event:"mousemove"},["mouseup"+e]:{event:"mouseup"},["mouseenter"+e]:{event:"mouseenter"},["mouseleave"+e]:{event:"mouseleave"},["touchstart"+e]:{event:"touchstart"},["touchmove"+e]:{event:"touchmove"},["touchend"+e]:{event:"touchend"}}}function getRawMouseEvents(e){return Object.keys(getMouseEventName(e))}function useMouseEvents(a,n){return{getMouseEventHandlers:(e,t)=>getMouseEventHandlers(a,n,e,t),getDefaultMouseEventHandlers:(e,t)=>getDefaultMouseEventHandlers(a,n,e,t),getMouseEventName:getMouseEventName,getRawMouseEvents:getRawMouseEvents}}const useMoveEmits=["moved"];function useMove(d,{parsedView:s,parsedValue:l,direction:c,maxDays:m,times:v,emittedValue:p,emit:y}){function e(a=1){if(0===a)p.value=today();else{let e=copyTimestamp(l.value);const n=getEndOfMonth(e),r=a>0,o=r?nextDay:prevDay,u=r?n.day:1;let t=r?a:-a;c.value=r?"next":"prev";const i=d.weekdays.length;while(--t>=0)switch(s.value){case"month":e.day=u,e=o(e),e=updateWeekday(e);while(!d.weekdays.includes(Number(e.weekday)))e=addToDate(e,{day:r?1:-1});break;case"week":case"week-agenda":case"week-scheduler":e=relativeDays(e,o,i,d.weekdays);break;case"day":case"scheduler":case"agenda":e=relativeDays(e,o,m.value,d.weekdays);break;case"month-interval":case"month-agenda":case"month-scheduler":e.day=u,e=o(e);break;case"resource":e=relativeDays(e,o,m.value,d.weekdays);break}e=updateWeekday(e),e=updateFormatted(e),e=updateDayOfYear(e),e=updateRelative(e,v.now),p.value=e.date,y("moved",e)}}return{move:e}}const listenerRE=/^on[A-Z]/;function useEmitListeners(e=vue.getCurrentInstance()){return{emitListeners:vue.computed(()=>{const t={};return e?.vnode?.props&&Object.keys(e.vnode.props).forEach(e=>{listenerRE.test(e)&&(t[e]=!0)}),t})}}function useFocusHelper(){const e={"aria-hidden":"true",class:"q-calendar__focus-helper"};return[vue.h("span",e)]}function useButton(){function e({focusable:e,focusType:t},a,n){const r=e&&t.includes("date");return vue.h("button",{...a,tabindex:r?0:-1},[n,r&&useFocusHelper()])}return{renderButton:e}}const useCellWidthProps={cellWidth:[Number,String]};function useCellWidth(e){const t=vue.computed(()=>void 0!==e.cellWidth);return{isSticky:t}}const useCheckChangeEmits=["change"];function useCheckChange(n,{days:r,lastStart:o,lastEnd:u}){function e(){const e=r.value;if(0===e.length)return!1;const t=e[0].date,a=e[e.length-1].date;return(!o.value||!u.value||t!==o.value||a!==u.value)&&(o.value=t,u.value=a,n("change",{start:t,end:a,days:e}),!0)}return{checkChange:e}}function useEventUtils(){function e(e,t){return(Array.isArray(t)?t:[t]).includes(e.keyCode)}return{isKeyCode:e}}const isKeyCode=useEventUtils().isKeyCode,useNavigationProps={useNavigation:Boolean};function useNavigation(t,{rootRef:a,focusRef:n,focusValue:r,datesRef:o,parsedView:u,emittedValue:i,direction:d,times:s}){let e=!1;function l(){e||document&&(e=!0,document.addEventListener("keyup",y),document.addEventListener("keydown",p))}function c(){document&&(document.removeEventListener("keyup",y),document.removeEventListener("keydown",p),e=!1)}function m(e){if(e&&document){const t=document.activeElement;if(t!==document.body&&a.value?.contains(t))return!0}return!1}function v(){let t=0;const a=window.setInterval(()=>{const e=o.value[n.value];e&&(e.focus(),50!==++t)&&document.activeElement!==e||window.clearInterval(a)},250)}function p(e){m(e)&&isKeyCode(e,[33,34,35,36,37,38,39,40])&&(e.stopPropagation(),e.preventDefault())}function y(e){if(m(e)&&isKeyCode(e,[33,34,35,36,37,38,39,40])){const t={33:D,34:w,35:_,36:k,37:g,38:f,39:T,40:h};t[e.keyCode]?.()}}function f(){let e=copyTimestamp(r.value);if("month"===u.value){if(e=addToDate(e,{day:-7}),r.value.month!==e.month)return d.value="prev",void(i.value=e.date)}else e=addToDate(e,{minute:Number(t.intervalMinutes)});d.value="prev",n.value=e.date}function h(){let e=copyTimestamp(r.value);if("month"===u.value){if(e=addToDate(e,{day:7}),r.value.month!==e.month)return d.value="next",void(i.value=e.date)}else e=addToDate(e,{minute:Number(t.intervalMinutes)});d.value="next",n.value=e.date}function g(){let e=copyTimestamp(r.value);d.value="prev";do{e=addToDate(e,{day:-1})}while(!t.weekdays.includes(Number(e.weekday)));n.value=e.date}function T(){let e=copyTimestamp(r.value);d.value="next";do{e=addToDate(e,{day:1})}while(!t.weekdays.includes(Number(e.weekday)));n.value=e.date}function D(){let e=copyTimestamp(r.value);e="month"===u.value?addToDate(e,{month:-1}):addToDate(e,{day:-7}),d.value="prev",n.value=e.date}function w(){let e=copyTimestamp(r.value);e="month"===u.value?addToDate(e,{month:1}):addToDate(e,{day:7}),d.value="next",n.value=e.date}function k(){let e=copyTimestamp(r.value);e="month"===u.value?getStartOfMonth(e):getStartOfWeek(e,t.weekdays||[],s.today);while(!t.weekdays.includes(Number(e.weekday)))e=addToDate(e,{day:-1});n.value=e.date}function _(){let e=copyTimestamp(r.value);e="month"===u.value?getEndOfMonth(e):getEndOfWeek(e,t.weekdays||[],s.today);while(!t.weekdays.includes(Number(e.weekday)))e=addToDate(e,{day:-1});n.value=e.date}return vue.onBeforeUnmount(()=>{c()}),vue.watch(()=>t.useNavigation,e=>{(!0===e?l:c)()}),!0===t.useNavigation&&l(),{startNavigation:l,endNavigation:c,tryFocus:v}}const renderButton=useButton().renderButton;var QCalendarScheduler=vue.defineComponent({name:"QCalendarScheduler",directives:{ResizeObserver:ResizeObserverDirective},props:{...useCommonProps,...useSchedulerProps,...useColumnProps,...useMaxDaysProps,...useTimesProps,...useCellWidthProps,...useNavigationProps},emits:["update:model-value","update:model-resources","resource-expanded",...useCheckChangeEmits,...useMoveEmits,...getRawMouseEvents("-date"),...getRawMouseEvents("-day-resource"),...getRawMouseEvents("-head-resources"),...getRawMouseEvents("-head-day"),...getRawMouseEvents("-resource")],setup(f,{slots:h,emit:g,expose:R}){const e=vue.ref(null),t=vue.ref(null),H=vue.ref(null),v=vue.ref(f.modelValue||today()),a=vue.ref(parsed(f.modelValue||today())),p=vue.ref({}),q=vue.ref({}),n=vue.ref(),r=vue.ref(),i=vue.ref("next"),d=vue.ref(f.modelValue||today()),s=vue.ref("0000-00-00"),l=vue.ref(0),T=vue.ref(f.modelValue),c=vue.reactive({width:0,height:0}),y=vue.ref(""),D=vue.ref(""),U=vue.ref(null),L=vue.ref(null),o=(vue.watch(()=>f.view,()=>{l.value=0}),vue.computed(()=>{return"month"===f.view?"month-interval":f.view})),Y=vue.getCurrentInstance();if(null===Y)throw new Error("current instance is null");const w=useEmitListeners(Y).emitListeners,k=useCellWidth(f).isSticky,{times:u,setCurrent:B,updateCurrent:P}=useTimes(f),{parsedStart:V,parsedEnd:K,dayFormatter:z,weekdayFormatter:Z,ariaDateFormatter:$,dayStyleDefault:X,getRelativeClasses:_}=(P(),B(),useCommon(f,{startDate:d,endDate:s,times:u})),b=vue.computed(()=>{return parseTimestamp(f.modelValue,u.now)||V.value||u.today}),j=(a.value=b.value,v.value=b.value.date,useRenderValues(f,{parsedView:o,parsedValue:b,times:u})).renderValues,{rootRef:m,scrollWidth:Q,__renderCalendar:G}=useCalendar(f,Ae,{scrollArea:e,pane:t}),{days:I,parsedCellWidth:S,styleDefault:J}=useInterval(f,{times:u,scrollArea:e,parsedStart:V,parsedEnd:K,maxDays:l,size:c,headerColumnRef:H}),x=useMove(f,{parsedView:o,parsedValue:b,direction:i,maxDays:l,times:u,emittedValue:T,emit:g}).move,M=useMouseEvents(g,w).getDefaultMouseEventHandlers,ee=useCheckChange(g,{days:I,lastStart:U,lastEnd:L}).checkChange,N=useEventUtils().isKeyCode,te=useNavigation(f,{rootRef:m,focusRef:v,focusValue:a,datesRef:p,parsedView:o,emittedValue:T,direction:i,times:u}).tryFocus,E=vue.computed(()=>{const e=parseInt(String(f.columnCount),10);return"day"===o.value&&e>1?e:"day"===o.value&&f.maxDays&&f.maxDays>1?f.maxDays:I.value.length}),ae=vue.computed(()=>{return m.value?parseInt(window.getComputedStyle(m.value).getPropertyValue("--calendar-resources-width"),10):0}),C=vue.computed(()=>{const e=parseInt(String(f.resourceHeight),10);return 0===e?"auto":e}),ne=vue.computed(()=>{return parseInt(String(f.resourceMinHeight),10)}),F=vue.computed(()=>{if(m.value){const e=c.width||m.value.getBoundingClientRect().width;if(e&&ae.value&&E.value)return(e-Q.value-ae.value)/E.value+"px"}return 100/E.value+"%"});function re(){T.value=today()}function oe(e=1){x(e)}function ue(e=1){x(-e)}function ie({width:e,height:t}){c.width=e,c.height=t}function A(e){return e.date===T.value}function de(){return vue.h("div",{roll:"presentation",class:{"q-calendar-scheduler__head":!0,"q-calendar__sticky":!0===k.value},style:{marginRight:Q.value+"px"}},[se(),le()])}function se(){const e=h["head-resources"],t={days:I.value,timestamps:I.value,date:f.modelValue,resources:f.modelResources};return vue.h("div",{class:{"q-calendar-scheduler__head--resources":!0,"q-calendar__sticky":!0===k.value},...M("-head-resources",e=>{return{scope:t,event:e}})},[e&&e({scope:t})])}function le(){return vue.h("div",{ref:H,class:{"q-calendar-scheduler__head--days__column":!0}},[ce(),me()])}function ce(){return vue.h("div",{class:{"q-calendar-scheduler__head--days__weekdays":!0}},[...ve()])}function me(){const e=h["head-days-events"];return vue.nextTick(()=>{if(r.value&&0===parseInt(String(f.columnCount),10)&&window)try{const e=window.getComputedStyle(r.value);n.value&&n.value.parentElement&&(n.value.parentElement.style.height=e.height,n.value.style.height=e.height)}catch{}}),vue.h("div",{class:{"q-calendar-scheduler__head--days__event":!0}},[e&&vue.h("div",{ref:n,style:{position:"absolute",left:0,top:0,right:0,overflow:"hidden",zIndex:1}},[e({scope:{timestamps:I.value,days:I.value,ref:r}})]),...pe()])}function ve(){const e=parseInt(String(f.columnCount),10),a=parseInt(String(f.columnIndexStart),10);return 1===I.value.length&&e>0?Array.apply(null,new Array(e)).map((e,t)=>t+a).map(e=>ye(I.value[0],e)):I.value.map(e=>ye(e,0))}function pe(){const e=parseInt(String(f.columnCount),10),a=parseInt(String(f.columnIndexStart),10);return 1===I.value.length&&e>0?Array.apply(null,new Array(e)).map((e,t)=>t+a).map(e=>he(I.value[0],e)):I.value.map(e=>he(e,0))}function ye(t,e){const a=h["head-day"],n=h["head-date"],r=!0!==f.noActiveDate&&A(t),o={timestamp:t,activeDate:r,droppable:y.value===t.date,disabled:!!f.disabledWeekdays&&f.disabledWeekdays.includes(Number(t.weekday)),columnIndex:e??0},u=!0===k.value?convertToUnit(S.value):F.value,i=f.weekdayStyle||X,d={width:u,maxWidth:u,minWidth:u,...i({scope:o})},s=(!0===k.value&&(d.minWidth=u),"function"===typeof f.weekdayClass?f.weekdayClass({scope:o}):{}),l=!0===f.focusable&&f.focusType.includes("weekday"),c=t.date+(void 0!==e?"-"+e:""),m={key:c,ref:e=>{null!==e&&(p.value[c]=e)},tabindex:!0===l?0:-1,class:{"q-calendar-scheduler__head--day":!0,...s,..._(t),"q-active-date":r,"q-calendar__hoverable":!0===f.hoverable,"q-calendar__focusable":!0===l},style:d,onFocus:()=>{!0===l&&(v.value=c)},onKeydown:e=>{!0!==t.disabled&&N(e,[13,32])&&(e.stopPropagation(),e.preventDefault())},onKeyup:e=>{!0!==t.disabled&&N(e,[13,32])&&(T.value=t.date)},...M("-head-day",e=>{return{scope:o,event:e}}),onDragenter:e=>{void 0!==f.dragEnterFunc&&"function"===typeof f.dragEnterFunc&&(!0===f.dragEnterFunc(e,"head-day",{scope:o})?y.value=t.date:y.value="")},onDragover:e=>{void 0!==f.dragOverFunc&&"function"===typeof f.dragOverFunc&&(!0===f.dragOverFunc(e,"head-day",{scope:o})?y.value=t.date:y.value="")},onDragleave:e=>{void 0!==f.dragLeaveFunc&&"function"===typeof f.dragLeaveFunc&&(!0===f.dragLeaveFunc(e,"head-day",{scope:o})?y.value=t.date:y.value="")},onDrop:e=>{void 0!==f.dropFunc&&"function"===typeof f.dropFunc&&(!0===f.dropFunc(e,"head-day",{scope:o})?y.value=t.date:y.value="")}};return vue.h("div",m,[void 0!==a&&a({scope:o}),void 0===a&&De(t,e),void 0===a&&fe(t),void 0===a&&n&&n({scope:o}),void 0===a&&we(t,e),useFocusHelper()])}function fe(e){return"stacked"===f.dateHeader?[!0!==f.noDefaultHeaderText?O(e):[],!0!==f.noDefaultHeaderBtn?W(e):[]].flat():"inline"===f.dateHeader?("left"===f.weekdayAlign&&"right"===f.dateAlign||"right"===f.weekdayAlign&&f.dateAlign,vue.h("div",{class:"q-calendar__header--inline"},[!0!==f.noDefaultHeaderText&&O(e),!0!==f.noDefaultHeaderBtn&&W(e)])):"inverted"===f.dateHeader?("left"===f.weekdayAlign&&"right"===f.dateAlign||"right"===f.weekdayAlign&&f.dateAlign,vue.h("div",{class:"q-calendar__header--inline"},[!0!==f.noDefaultHeaderBtn&&W(e),!0!==f.noDefaultHeaderText&&O(e)])):void 0}function he(e,t){const a=h["head-day-event"],n=!0!==f.noActiveDate&&A(e),r={timestamp:e,activeDate:n,droppable:y.value===e.date,disabled:!!f.disabledWeekdays&&f.disabledWeekdays.includes(Number(e.weekday)),columnIndex:t??0},o=!0===k.value?convertToUnit(S.value):F.value,u={width:o,maxWidth:o,minWidth:o};return!0===k.value&&(u.minWidth=o),vue.h("div",{key:"event-"+e.date+(void 0!==t?"-"+t:""),class:{"q-calendar-scheduler__head--day__event":!0,..._(e),"q-active-date":n},style:u},[a&&a({scope:r})])}function O(e){const t=h["head-weekday-label"],a=!0===f.shortWeekdayLabel,n={timestamp:e,shortWeekdayLabel:a},r={class:{"q-calendar-scheduler__head--weekday":!0,["q-calendar__"+f.weekdayAlign]:!0,"q-calendar__ellipsis":!0}};return vue.h("div",r,t&&t({scope:n})||ge(e,a))}function ge(e,t){const a=Z.value(e,t||f.weekdayBreakpoints[0]>0&&S.value<=f.weekdayBreakpoints[0]);return vue.h("span",{class:"q-calendar-scheduler__head--weekday-label q-calendar__ellipsis"},f.weekdayBreakpoints[1]>0&&S.value<=f.weekdayBreakpoints[1]?minCharWidth(a,Number(f.minWeekdayLabel)):a)}function W(e){const t={class:{"q-calendar-scheduler__head--date":!0,["q-calendar__"+f.dateAlign]:!0}};return vue.h("div",t,Te(e))}function Te(a){const e=!0!==f.noActiveDate&&A(a),t=z.value(a,!1),n=h["head-day-label"],r=h["head-day-button"],o={dayLabel:t,timestamp:a,activeDate:e},u={class:{"q-calendar-scheduler__head--day__label":!0,"q-calendar__button":!0,"q-calendar__button--round":"round"===f.dateType,"q-calendar__button--rounded":"rounded"===f.dateType,"q-calendar__button--bordered":!0===a.current,"q-calendar__focusable":!0},disabled:a.disabled,onKeydown:e=>{!0!==a.disabled&&N(e,[13,32])&&(e.stopPropagation(),e.preventDefault())},onKeyup:e=>{!0!==a.disabled&&N(e,[13,32])&&(T.value=a.date,void 0!==w.value.onClickDate)&&g("click-date",{scope:o})},...M("-date",(e,t)=>{return"click-date"!==t&&"contextmenu-date"!==t||(T.value=a.date,"click-date"===t&&e.preventDefault()),{scope:o,event:e}})};return!0!==f.noAria&&(u.ariaLabel=$.value(a,!1)),r?vue.h("div",[r({scope:o})]):renderButton(f,u,n?n({scope:o}):t)}function De(e,t){const a=h["column-header-before"];if(a){const n={timestamp:e,columnIndex:t};return vue.h("div",{class:"q-calendar-scheduler__column-header--before"},[a({scope:n})])}}function we(e,t){const a=h["column-header-after"];if(a){const n={timestamp:e,columnIndex:t};return vue.h("div",{class:"q-calendar-scheduler__column-header--after"},[a({scope:n})])}}function ke(){return vue.h("div",{class:"q-calendar-scheduler__body"},[_e()])}function _e(){return!0===k.value?vue.h("div",{ref:e,class:{"q-calendar-scheduler__scroll-area":!0,"q-calendar__scroll":!0}},[!0!==k.value&&Ne(),Ie()]):!0===f.noScroll?be():vue.h("div",{ref:e,class:{"q-calendar-scheduler__scroll-area":!0,"q-calendar__scroll":!0}},[be()])}function be(){return vue.h("div",{ref:t,class:"q-calendar-scheduler__pane"},[Ie()])}function Ie(){return vue.h("div",{class:"q-calendar-scheduler__day--container"},[!0===k.value&&!0!==f.noHeader&&de(),Se()])}function Se(e=void 0,a=0,n=!0){return void 0===e&&(e=f.modelResources),e.map((e,t)=>{return xe(e,t,a,void 0!==e.children?e.expanded:n)}).flat()}function xe(e,t,a=0,n=!0){const r={},o=(r.height=void 0!==e.height?convertToUnit(parseInt(e.height,10)):C.value?convertToUnit(C.value):"auto",ne.value>0&&(r.minHeight=convertToUnit(ne.value)),vue.h("div",{key:e[f.resourceKey]+"-"+t,class:{"q-calendar-scheduler__resource--row":!0},style:r},[Me(e,t,a,n),Ne(e,t,a,n)]));return void 0!==e.children?[o,vue.h("div",{class:{"q-calendar__child":!0,"q-calendar__child--expanded":!0===n,"q-calendar__child--collapsed":!0!==n}},[Se(e.children,a+1,!1===n?n:e.expanded)])]:[o]}function Me(t,e,a=0,n=!0){const r=h["resource-label"],o=parseInt(String(f.resourceMinHeight),10),u={},i=(u.height=void 0!==t.height?convertToUnit(parseInt(t.height,10)):C.value?convertToUnit(C.value):"auto",o>0&&(u.minHeight=convertToUnit(o)),f.resourceStyle||J),d=t[f.resourceLabel],s=!0===f.focusable&&f.focusType.includes("resource")&&!0===n,l=t[f.resourceKey],c={resource:t,timestamps:I.value,days:I.value,resourceIndex:e,indentLevel:a,label:d,droppable:D.value===l},m="function"===typeof f.resourceClass?f.resourceClass({scope:c}):{};return vue.h("div",{key:t[f.resourceKey]+"-"+e,ref:e=>{null!==e&&(q.value[t[f.resourceKey]]=e)},tabindex:!0===s?0:-1,class:{"q-calendar-scheduler__resource":0===a,"q-calendar-scheduler__resource--section":0!==a,...m,"q-calendar__sticky":!0===k.value,"q-calendar__hoverable":!0===f.hoverable,"q-calendar__focusable":!0===s},style:{...u,...i({scope:c})},onDragenter:e=>{void 0!==f.dragEnterFunc&&"function"===typeof f.dragEnterFunc&&(!0===f.dragEnterFunc(e,"resource",{scope:c})?D.value=l:D.value="")},onDragover:e=>{void 0!==f.dragOverFunc&&"function"===typeof f.dragOverFunc&&(!0===f.dragOverFunc(e,"resource",{scope:c})?D.value=l:D.value="")},onDragleave:e=>{void 0!==f.dragLeaveFunc&&"function"===typeof f.dragLeaveFunc&&(!0===f.dragLeaveFunc(e,"resource",{scope:c})?D.value=l:D.value="")},onDrop:e=>{void 0!==f.dropFunc&&"function"===typeof f.dropFunc&&(!0===f.dropFunc(e,"resource",{scope:c})?D.value=l:D.value="")},onKeydown:e=>{N(e,[13,32])&&(e.stopPropagation(),e.preventDefault())},onKeyup:e=>{N(e,[13,32])&&void 0!==w.value.onClickResource&&g("click-resource",{scope:c,event:e})},...M("-resource",e=>{return{scope:c,event:e}})},[[vue.h("div",{class:{"q-calendar__parent":void 0!==t.children,"q-calendar__parent--expanded":void 0!==t.children&&!0===t.expanded,"q-calendar__parent--collapsed":void 0!==t.children&&!0!==t.expanded},onClick:e=>{e.stopPropagation(),t.expanded=!t.expanded,g("resource-expanded",{expanded:t.expanded,scope:c})}}),vue.h("div",{class:{"q-calendar-scheduler__resource--text":!0,"q-calendar__ellipsis":!0},style:{paddingLeft:10*a+2+"px"}},[r?r({scope:c}):d]),useFocusHelper()]])}function Ne(e,t,a=0,n=!0){const r=h["resource-days"],o=!0===k.value?convertToUnit(S.value):F.value,u={resource:e,resourceIndex:t,indentLevel:a,expanded:n,cellWidth:o,timestamps:I.value,days:I.value},i={},d=(i.height=parseInt(String(f.resourceHeight),10)>0?convertToUnit(parseInt(String(f.resourceHeight),10)):"auto",parseInt(String(f.resourceMinHeight),10)>0&&(i.minHeight=convertToUnit(parseInt(String(f.resourceMinHeight),10))),{class:"q-calendar-scheduler__resource--days",style:i});return vue.h("div",d,[...Ee(e,t,a,n),r&&r({scope:u})])}function Ee(t,a,n=0,r=!0){return 1===I.value.length&&parseInt(String(f.columnCount),10)>0?Array.apply(null,new Array(parseInt(String(f.columnCount),10))).map((e,t)=>t+parseInt(String(f.columnIndexStart),10)).map(e=>Ce(I.value[0],e,t,a,n,r)):I.value.map(e=>Ce(e,0,t,a,n,r))}function Ce(e,t,a,n,r=0,o=!0){const u=h.day,i=f.dayStyle||X,d=!0!==f.noActiveDate&&b.value.date===e.date,s=e.date+":"+a[f.resourceKey]+(void 0!==t?":"+t:""),l=D.value===s,c={timestamp:e,columnIndex:t,resource:a,resourceIndex:n,indentLevel:r,activeDate:d,droppable:l},m=!0===k.value?convertToUnit(S.value):F.value,v={width:m,maxWidth:m,...i({scope:c})},p=(v.height=parseInt(String(f.resourceHeight),10)>0?convertToUnit(parseInt(String(f.resourceHeight),10)):"auto",parseInt(String(f.resourceMinHeight),10)>0&&(v.minHeight=convertToUnit(parseInt(String(f.resourceMinHeight),10))),"function"===typeof f.dayClass?f.dayClass({scope:c}):{}),y=!0===f.focusable&&f.focusType.includes("day")&&!0===o;return vue.h("div",{key:e.date+(void 0!==t?":"+t:""),tabindex:!0===y?0:-1,class:{"q-calendar-scheduler__day":0===r,"q-calendar-scheduler__day--section":0!==r,...p,..._(e),"q-calendar__hoverable":!0===f.hoverable,"q-calendar__focusable":!0===y},style:v,onDragenter:e=>{void 0!==f.dragEnterFunc&&"function"===typeof f.dragEnterFunc&&(!0===f.dragEnterFunc(e,"day",{scope:c})?D.value=s:D.value="")},onDragover:e=>{void 0!==f.dragOverFunc&&"function"===typeof f.dragOverFunc&&(!0===f.dragOverFunc(e,"day",{scope:c})?D.value=s:D.value="")},onDragleave:e=>{void 0!==f.dragLeaveFunc&&"function"===typeof f.dragLeaveFunc&&(!0===f.dragLeaveFunc(e,"day",{scope:c})?D.value=s:D.value="")},onDrop:e=>{void 0!==f.dropFunc&&"function"===typeof f.dropFunc&&(!0===f.dropFunc(e,"day",{scope:c})?D.value=s:D.value="")},onKeydown:e=>{N(e,[13,32])&&(e.stopPropagation(),e.preventDefault())},onKeyup:e=>{N(e,[13,32])&&(T.value=c.timestamp.date,void 0!==w.value.onClickResource)&&g("click-resource",{scope:c,event:e})},...M("-day-resource",e=>{return{scope:c,event:e}})},[u&&u({scope:c}),useFocusHelper()])}function Fe(){return vue.h("div",{},"No resources have been defined")}function Ae(){const{start:e,end:t,maxDays:a}=j.value,n=(d.value===e.date&&s.value===t.date&&l.value===a||(d.value=e.date,s.value=t.date,l.value=a),c.width>0),r=f.modelResources&&f.modelResources.length>0,o=vue.withDirectives(vue.h("div",{key:d.value,class:"q-calendar-scheduler"},[!0===n&&!0===r&&!0!==k.value&&!0!==f.noHeader&&de(),!0===n&&!0===r&&ke(),!1===r&&Fe()]),[[ResizeObserverDirective,ie]]);if(!0!==f.animated)return o;{const u="q-calendar--"+("prev"===i.value?f.transitionPrev:f.transitionNext);return vue.h(vue.Transition,{name:u,appear:!0},()=>o)}}return vue.watch([I],ee,{deep:!0,immediate:!0}),vue.watch(()=>f.modelValue,(e,t)=>{if(T.value!==f.modelValue){if(!0===f.animated){const a=getDayIdentifier(parsed(e)),n=getDayIdentifier(parsed(t));i.value=a>=n?"next":"prev"}T.value=e}v.value=e}),vue.watch(T,(e,t)=>{if(T.value!==f.modelValue){if(!0===f.animated){const a=getDayIdentifier(parsed(e)),n=getDayIdentifier(parsed(t));i.value=a>=n?"next":"prev"}g("update:model-value",e)}}),vue.watch(v,e=>{e&&(a.value=parseTimestamp(e))}),vue.watch(a,()=>{p.value[v.value]?p.value[v.value].focus():te()}),vue.watch(()=>f.maxDays,e=>{l.value=e}),vue.onBeforeUpdate(()=>{p.value={},n.value=void 0,r.value=void 0,q.value={}}),vue.onMounted(()=>{}),R({prev:ue,next:oe,move:x,moveToToday:re,updateCurrent:P}),()=>G()}});const version="4.1.2";exports.DAYS_IN_MONTH=DAYS_IN_MONTH,exports.DAYS_IN_MONTH_LEAP=DAYS_IN_MONTH_LEAP,exports.DAYS_IN_MONTH_MAX=DAYS_IN_MONTH_MAX,exports.DAYS_IN_MONTH_MIN=DAYS_IN_MONTH_MIN,exports.DAY_MIN=DAY_MIN,exports.FIRST_HOUR=FIRST_HOUR,exports.MONTH_MAX=MONTH_MAX,exports.MONTH_MIN=MONTH_MIN,exports.PARSE_DATE=PARSE_DATE,exports.PARSE_DATETIME=PARSE_DATETIME,exports.PARSE_TIME=PARSE_TIME,exports.QCalendarScheduler=QCalendarScheduler,exports.TIME_CONSTANTS=TIME_CONSTANTS,exports.addToDate=addToDate,exports.compareDate=compareDate,exports.compareDateTime=compareDateTime,exports.compareTime=compareTime,exports.compareTimestamps=compareTimestamps,exports.convertToUnit=convertToUnit,exports.copyTimestamp=copyTimestamp,exports.createDayList=createDayList,exports.createIntervalList=createIntervalList,exports.createNativeLocaleFormatter=createNativeLocaleFormatter,exports.daysBetween=daysBetween,exports.daysInMonth=daysInMonth,exports.diffTimestamp=diffTimestamp,exports.findWeekday=findWeekday,exports.getDate=getDate,exports.getDateTime=getDateTime,exports.getDayIdentifier=getDayIdentifier,exports.getDayOfYear=getDayOfYear,exports.getDayTimeIdentifier=getDayTimeIdentifier,exports.getEndOfMonth=getEndOfMonth,exports.getEndOfWeek=getEndOfWeek,exports.getMonthFormatter=getMonthFormatter,exports.getMonthNames=getMonthNames,exports.getStartOfMonth=getStartOfMonth,exports.getStartOfWeek=getStartOfWeek,exports.getTime=getTime,exports.getTimeIdentifier=getTimeIdentifier,exports.getWeekday=getWeekday,exports.getWeekdayFormatter=getWeekdayFormatter,exports.getWeekdayNames=getWeekdayNames,exports.getWorkWeek=getWorkWeek,exports.indexOf=indexOf,exports.isBetweenDates=isBetweenDates,exports.isLeapYear=isLeapYear,exports.isOverlappingDates=isOverlappingDates,exports.isToday=isToday,exports.makeDate=makeDate,exports.makeDateTime=makeDateTime,exports.maxTimestamp=maxTimestamp,exports.minCharWidth=minCharWidth,exports.minTimestamp=minTimestamp,exports.moveRelativeDays=moveRelativeDays,exports.nextDay=nextDay,exports.padNumber=padNumber,exports.parseDate=parseDate,exports.parseTime=parseTime,exports.parseTimestamp=parseTimestamp,exports.parsed=parsed,exports.prevDay=prevDay,exports.relativeDays=relativeDays,exports.today=today,exports.updateDayOfYear=updateDayOfYear,exports.updateDisabled=updateDisabled,exports.updateFormatted=updateFormatted,exports.updateMinutes=updateMinutes,exports.updateRelative=updateRelative,exports.updateWeekday=updateWeekday,exports.updateWorkWeek=updateWorkWeek,exports.validateNumber=validateNumber,exports.validateTimestamp=validateTimestamp,exports.version=version,exports.weeksBetween=weeksBetween;