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 125 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 a=PARSE_DATETIME.exec(e);if(!a||!a[1]||!a[2])return null;const t=parseInt(a[1],10),n=parseInt(a[2],10),r=parseInt(a[4]||"1",10),u=parseInt(a[6]||"0",10),o=parseInt(a[8]||"0",10);return{date:e,time:u.toString().padStart(2,"0")+":"+o.toString().padStart(2,"0"),year:t,month:n,day:r,hour:u,minute:o,hasDay:!!a[4],hasTime:!0,past:!1,current:!1,future:!1,disabled:!1,weekday:0,doy:0,workweek:0}}function parseDate(e,a=!1){if(!(e instanceof Date))return null;const t=a?"UTC":"";return updateFormatted({date:padNumber(e[`get${t}FullYear`](),4)+"-"+padNumber(e[`get${t}Month`]()+1,2)+"-"+padNumber(e[`get${t}Date`](),2),time:padNumber(e[`get${t}Hours`]()||0,2)+":"+padNumber(e[`get${t}Minutes`]()||0,2),year:e[`get${t}FullYear`](),month:e[`get${t}Month`]()+1,day:e[`get${t}Date`](),hour:e[`get${t}Hours`](),minute:e[`get${t}Minutes`](),weekday:0,doy:0,workweek:0,hasDay:!0,hasTime:!0,past:!1,current:!1,future:!1,disabled:!1})}function padNumber(e,a){let t=String(e);while(t.length<a)t="0"+t;return t}function isLeapYear(e){return e%4===0&&e%100!==0||e%400===0}function daysInMonth(e,a){return(isLeapYear(e)?DAYS_IN_MONTH_LEAP:DAYS_IN_MONTH)[a]}function nextDay(e){const a=new Date(e.year,e.month-1,e.day+1);return updateFormatted(normalizeTimestamp({...e,year:a.getFullYear(),month:a.getMonth()+1,day:a.getDate()}))}function prevDay(e){const a=new Date(e.year,e.month-1,e.day-1);return updateFormatted(normalizeTimestamp({...e,year:a.getFullYear(),month:a.getMonth()+1,day:a.getDate()}))}function today(){const e=new Date,a=e.getMonth()+1,t=e.getDate(),n=e.getFullYear();return[n,padNumber(a,2),padNumber(t,2)].join("-")}function isToday(e){return e===today()}function getStartOfWeek(e,a,t){let n=copyTimestamp(e);if(a){if(1===n.day||0===n.weekday)while(!a.includes(Number(n.weekday)))n=nextDay(n);n=findWeekday(n,a[0],prevDay),n=updateFormatted(n),t&&(n=updateRelative(n,t,n.hasTime))}return n}function getEndOfWeek(e,a,t){let n=copyTimestamp(e);if(a&&Array.isArray(a)){const r=daysInMonth(n.year,n.month);if(r===n.day||n.weekday===a[a.length-1])while(!a.includes(Number(n.weekday)))n=prevDay(n);n=findWeekday(n,a[a.length-1],nextDay),n=updateFormatted(n),t&&(n=updateRelative(n,t,n.hasTime))}return n}function getStartOfMonth(e){let a=copyTimestamp(e);return a.day=DAY_MIN,a=updateFormatted(a),a}function getEndOfMonth(e){let a=copyTimestamp(e);return a.day=daysInMonth(a.year,a.month),a=updateFormatted(a),a}function parseTime(e){const a=Object.prototype.toString.call(e);switch(a){case"[object Number]":return e;case"[object String]":{const t=PARSE_TIME.exec(e);return t?60*parseInt(t[1],10)+parseInt(t[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,a){return!(!e||!a)&&e.year===a.year&&e.month===a.month&&e.day===a.day&&e.hour===a.hour&&e.minute===a.minute}function compareDate(e,a){return getDate(e)===getDate(a)}function compareTime(e,a){return getTime(e)===getTime(a)}function compareDateTime(e,a){return getDateTime(e)===getDateTime(a)}function parseTimestamp(e,a=null){let t=parsed(e);return t?(t=updateFormatted(t),a&&(t=updateRelative(t,a,t.hasTime)),t):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,a,t=!1){const n=Date.UTC(e.year??0,(e.month??1)-1,e.day??1,e.hour??0,e.minute??0),r=Date.UTC(a.year??0,(a.month??1)-1,a.day??1,a.hour??0,a.minute??0);return!0===t&&r<n?0:r-n}function updateRelative(e,a,t=!1){let n=copyTimestamp(e),r=getDayIdentifier(a),u=getDayIdentifier(n),o=r===u;return n.hasTime&&t&&o&&(r=getTimeIdentifier(a),u=getTimeIdentifier(n),o=r===u),n.past=u<r,n.current=o,n.future=u>r,n.currentWeekday=n.weekday===a.weekday,n}function updateMinutes(e,a,t=null){let n=copyTimestamp(e);return n.hasTime=!0,n.hour=Math.floor(a/TIME_CONSTANTS.MINUTES_IN.HOUR),n.minute=a%TIME_CONSTANTS.MINUTES_IN.HOUR,n.time=getTime(n),t&&(n=updateRelative(n,t,!0)),n}function updateWeekday(e){let a=copyTimestamp(e);return a.weekday=getWeekday(a),a}function updateDayOfYear(e){let a=copyTimestamp(e);return a.doy=getDayOfYear(a)||0,a}function updateWorkWeek(e){let a=copyTimestamp(e);return a.workweek=getWorkWeek(a),a}function updateDisabled(e,a,t,n,r){let u=copyTimestamp(e);const o=getDayIdentifier(u);if(void 0!==a){const s=parsed(a);if(s){const c=getDayIdentifier(s);o<=c&&(u.disabled=!0)}}if(!0!==u.disabled&&void 0!==t){const v=parsed(t);if(v){const p=getDayIdentifier(v);o>=p&&(u.disabled=!0)}}if(!0!==u.disabled&&Array.isArray(n)&&n.length>0)for(var d in n)if(n[d]===u.weekday){u.disabled=!0;break}if(!0!==u.disabled&&Array.isArray(r)&&r.length>0)for(var l in r)if(Array.isArray(r[l])&&2===r[l].length&&r[l][0]&&r[l][1]){const m=parsed(r[l][0]),y=parsed(r[l][1]);if(m&&y&&isBetweenDates(u,m,y)){u.disabled=!0;break}}else{const f=r[l];if(Array.isArray(f))for(var i of f){const h=parseTimestamp(i);if(h){const g=getDayIdentifier(h);if(g===o){u.disabled=!0;break}}}else if(f){const _=parseTimestamp(f);if(_){const k=getDayIdentifier(_);k===o&&(u.disabled=!0)}}}return u}function updateFormatted(e){let a=copyTimestamp(e);return a.hasTime=!0,a.time=getTime(a),a.date=getDate(a),a.weekday=getWeekday(a),a.doy=getDayOfYear(a)||0,a.workweek=getWorkWeek(a),a}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 a=copyTimestamp(e);if(0===a.year){const r=parseTimestamp(today());r&&(a=r)}const t=new Date(Date.UTC(a.year,a.month-1,a.day)),n=4;t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+6)%7+n),t.setUTCDate(t.getUTCDate()+n-(t.getUTCDay()||7));e=new Date(Date.UTC(t.getUTCFullYear(),0,1)),e=Math.ceil(((t.valueOf()-e.valueOf())/864e5+1)/7);return e}function getWeekday(e){let a=e.weekday;if(e.hasDay){const t=Math.floor,n=e.day,r=(e.month+9)%MONTH_MAX+1,u=t(e.year/100),o=e.year%100-(e.month<=2?1:0);a=((n+t(2.6*r-.2)-2*u+o+t(o/4)+t(u/4))%7+7)%7}return a??0}function copyTimestamp(e){return{...e}}function getDate(e){let a=padNumber(e.year,4)+"-"+padNumber(e.month,2);return e.hasDay&&(a+="-"+padNumber(e.day,2)),a}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,a=nextDay,t=1,n=[0,1,2,3,4,5,6]){const r=copyTimestamp(e);return relativeDays(r,a,t,n)}function relativeDays(e,a=nextDay,t=1,n=[0,1,2,3,4,5,6]){let r=copyTimestamp(e);n.includes(Number(r.weekday))||0!==r.weekday||a!==nextDay||++t;while(--t>=0)r=a(r),n.length<7&&!n.includes(Number(r.weekday))&&++t;return r}function findWeekday(e,a,t=nextDay,n=6){let r=copyTimestamp(e);while(r.weekday!==a&&--n>=0)r=t(r);return r}function createDayList(e,a,t,n=[0,1,2,3,4,5,6],r=void 0,u=void 0,o=[],d=[],l=42,i=0){const s=getDayIdentifier(e),c=getDayIdentifier(a),v=[];let p=copyTimestamp(e),m=0,y=m===c;if(!(c<s))while((!y||v.length<i)&&v.length<l){if(m=getDayIdentifier(p),y=y||m>c&&v.length>=i,y)break;if(n.includes(Number(p.weekday))){let e=copyTimestamp(p);e=updateFormatted(e),e=updateRelative(e,t),e=updateDisabled(e,r,u,o,d),v.push(e)}p=relativeDays(p,nextDay)}return v}function createIntervalList(a,t,n,r,u){const o=[];for(let e=0;e<r;++e){const d=(t+e)*n,l=copyTimestamp(a);o.push(updateMinutes(l,d,u))}return o}function createNativeLocaleFormatter(n,r){const e=()=>"";return"undefined"===typeof Intl||"undefined"===typeof Intl.DateTimeFormat?e:(a,e)=>{try{const t=new Intl.DateTimeFormat(n||void 0,r(a,e));return t.format(makeDateTime(a))}catch(e){return console.error(`Intl.DateTimeFormat: ${e.message} -> `+getDateTime(a)),""}}}function makeDate(e,a=!0){return a?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,a=!0){return a?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,a=!1){const t=!0===a?getDayTimeIdentifier:getDayIdentifier;return e.reduce((e,a)=>{return Math.max(t(e),t(a))===t(e)?e:a})}function minTimestamp(e,a=!1){const t=!0===a?getDayTimeIdentifier:getDayIdentifier;return e.reduce((e,a)=>{return Math.min(t(e),t(a))===t(e)?e:a})}function isBetweenDates(e,a,t,n=!1){const r=getDayIdentifier(e)+(!0===n?getTimeIdentifier(e):0),u=getDayIdentifier(a)+(!0===n?getTimeIdentifier(a):0),o=getDayIdentifier(t)+(!0===n?getTimeIdentifier(t):0);return r>=u&&r<=o}function isOverlappingDates(e,a,t,n){const r=getDayIdentifier(e),u=getDayIdentifier(a),o=getDayIdentifier(t),d=getDayIdentifier(n);return r>=o&&r<=d||u>=o&&u<=d||o>=r&&u>=d}function addToDate(e,a){const t=copyTimestamp(e);return a.year&&(t.year+=a.year),a.month&&(t.month+=a.month),a.day&&(t.day+=a.day),a.hour&&(t.hour+=a.hour),a.minute&&(t.minute+=a.minute),updateFormatted(normalizeTimestamp(t))}function normalizeTimestamp(e){const a=new Date(e.year,e.month-1,e.day,e.hour,e.minute);return{...e,year:a.getFullYear(),month:a.getMonth()+1,day:a.getDate(),hour:a.getHours(),minute:a.getMinutes()}}function daysBetween(e,a){const t=diffTimestamp(e,a,!0);return Math.floor(t/TIME_CONSTANTS.MILLISECONDS_IN.DAY)}function weeksBetween(e,a){let t=copyTimestamp(e),n=copyTimestamp(a);return t=findWeekday(t,0),n=findWeekday(n,6),Math.ceil(daysBetween(t,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:a;function a(a,e,t){try{const n=new Intl.DateTimeFormat(t||void 0,r[e]||r["long"]);return n.format(weekdayDateMap[a])}catch(e){return e instanceof Error&&console.error(`Intl.DateTimeFormat: ${e.message} -> day of week: `+a),""}}}function getWeekdayNames(a,t){const e=Object.keys(weekdayDateMap),n=getWeekdayFormatter();return e.map(e=>String(n(e,a,t)))}function getMonthFormatter(){const e=()=>"",u={long:{timeZone:"UTC",month:"long"},short:{timeZone:"UTC",month:"short"},narrow:{timeZone:"UTC",month:"narrow"}};return"undefined"===typeof Intl||"undefined"===typeof Intl.DateTimeFormat?e:a;function a(a,e,t){try{const n=new Intl.DateTimeFormat(t||void 0,u[e]||u["long"]),r=new Date;return r.setDate(1),r.setMonth(a),n.format(r)}catch(e){return e instanceof Error&&console.error(`Intl.DateTimeFormat: ${e.message} -> month: `+a),""}}}function getMonthNames(a,t){const n=getMonthFormatter();return[...Array(12).keys()].map(e=>n(e,a,t))}function convertToUnit(e,a="px"){if(e)return isNaN(e)?String(e):"auto"===e?e:""+Number(e)+a}function indexOf(a,t){for(let e=0;e<a.length;e++)if(!0===t(a[e],e))return e;return-1}function minCharWidth(e,a){return 0===a?e:e.slice(0,a)}const ResizeObserverDirective={mounted(e,a){if("function"===typeof a.value){const t=a.value,n={callback:t,size:{width:0,height:0},observer:new ResizeObserver(e=>{const a=e[0].contentRect;a.width===n.size.width&&a.height===n.size.height||(n.size.width=a.width,n.size.height=a.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:a,debounceTimeout:t}=e.__onResizeObserver;t&&clearTimeout(t),a.unobserve(e),delete e.__onResizeObserver}}};function useCalendar(a,t,{scrollArea:e,pane:n}){if(!t){const s="[error: renderCalendar] no renderFunc has been supplied to useCalendar";throw console.error(s),new Error(s)}const r=vue.reactive({width:0,height:0}),u=vue.ref(null);function o({width:e,height:a}){r.width=e,r.height=a}const d=vue.computed(()=>{return!0!==a.noScroll&&e.value&&n.value&&r.height?e.value.offsetWidth-n.value.offsetWidth:0});function l(){}function i(){const e={ref:u,role:"complementary",lang:a.locale,class:`q-calendar ${a.dark?"q-calendar--dark":""} `+(a.bordered?"q-calendar__bordered":"")};return vue.withDirectives(vue.h("div",{...e},[t()]),[[ResizeObserverDirective,o]])}return{rootRef:u,scrollWidth:d,__initCalendar:l,__renderCalendar:i}}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(a,{startDate:e,endDate:t,times:n}){const r=vue.computed(()=>parseTimestamp(e.value)),u=vue.computed(()=>{return"0000-00-00"===t.value?getEndOfWeek(r.value,a.weekdays,n.today):parseTimestamp(t.value)||r.value}),o=vue.computed(()=>createNativeLocaleFormatter(a.locale,()=>({timeZone:"UTC",day:"numeric"}))),d=vue.computed(()=>createNativeLocaleFormatter(a.locale,(e,a)=>({timeZone:"UTC",weekday:a?"short":"long"}))),l=vue.computed(()=>createNativeLocaleFormatter(a.locale,()=>({timeZone:"UTC",dateStyle:"full"})));function i(e,a){return e&&e.length>0&&e.includes(a.date)}function s(e,a){const t={firstDay:!1,betweenDays:!1,lastDay:!1};if(2===e.length){const n=getDayIdentifier(a),r=getDayIdentifier(parsed(e[0])),u=getDayIdentifier(parsed(e[1]));t.firstDay=r===n,t.lastDay=u===n,t.betweenDays=r<n&&u>n}return t}function c(e,a=!1,t=[],n=[],r=!1){const u=i(t,e),{firstDay:o,lastDay:d,betweenDays:l}=s(n,e);return{"q-past-day":!o&&!l&&!d&&!u&&!a&&!!e.past,"q-future-day":!o&&!l&&!d&&!u&&!a&&!!e.future,"q-outside":a,"q-current-day":!!e.current,"q-selected":u,"q-range-first":o,"q-range":l,"q-range-last":d,"q-range-hover":r&&(o||d||l),"q-disabled-day disabled":!0===e.disabled}}function v(e){return getStartOfWeek(e,a.weekdays,n.today)}function p(e){return getEndOfWeek(e,a.weekdays,n.today)}function m(){return{}}return{parsedStart:r,parsedEnd:u,dayFormatter:o,weekdayFormatter:d,ariaDateFormatter:l,arrayHasDate:i,checkDays:s,getRelativeClasses:c,startOfWeek:v,endOfWeek:p,dayStyleDefault:m}}function scrollTo(e,a){e instanceof Window?e.scrollTo({top:a,behavior:"instant"}):e.scrollTop=a}function getVerticalScrollPosition(e){return e instanceof Window?e.scrollY:e.scrollTop}function animVerticalScrollTo(u,o,d=500,l=performance.now(),i=getVerticalScrollPosition(u)){d<=0||i===o?scrollTo(u,o):requestAnimationFrame(e=>{const a=e-l,t=Math.min(a/d,1),n=e=>e<.5?2*e*e:(4-2*e)*e-1,r=i+(o-i)*n(t);scrollTo(u,r),t<1&&animVerticalScrollTo(u,o,d,l,i)})}function animHorizontalScrollTo(r,e,u=500){const o=r.scrollLeft,d=e-o;let l=null;function i(e){null===l&&(l=e);const a=e-l,t=Math.min(a/u,1),n=e=>e<.5?2*e*e:(4-2*e)*e-1;r.scrollLeft=o+d*n(t),a<u&&requestAnimationFrame(i)}requestAnimationFrame(i)}const useIntervalProps={view:{type:String,validator:e=>["day","week","month","month-interval"].includes(e),default:"day"},shortIntervalLabel:Boolean,intervalHeight:{type:[Number,String],default:40,validator:validateNumber},intervalMinutes:{type:[Number,String],default:60,validator:validateNumber},intervalStart:{type:[Number,String],default:0,validator:validateNumber},intervalCount:{type:[Number,String],default:24,validator:validateNumber},intervalStyle:{type:Function,default:null},intervalClass:{type:Function,default:null},weekdayStyle:{type:Function,default:null},weekdayClass:{type:Function,default:null},showIntervalLabel:{type:Function,default:null},hour24Format:Boolean,timeClicksClamped:Boolean,dateHeader:{type:String,default:"stacked",validator:e=>["stacked","inline","inverted"].includes(e)}},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)}},useAgendaProps={view:{type:String,validator:e=>["day","week","month","month-interval"].includes(e),default:"day"},leftColumnOptions:{type:Array},rightColumnOptions:{type:Array},columnOptionsId:{type:String},columnOptionsLabel:{type:String},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)},dayHeight:{type:[Number,String],default:0,validator:validateNumber},dayMinHeight:{type:[Number,String],default:40,validator:validateNumber}},useResourceProps={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},cellWidth:{type:[Number,String],default:100},intervalHeaderHeight:{type:[Number,String],default:20,validator:validateNumber},noSticky:Boolean};function useInterval(u,{times:a,scrollArea:n,parsedStart:e,parsedEnd:t,maxDays:r,size:o,headerColumnRef:d}){const l=vue.computed(()=>parseInt(String(u.intervalStart),10)),v=vue.computed(()=>parseInt(String(u.intervalMinutes),10)),i=vue.computed(()=>parseInt(String(u.intervalCount),10)),p=vue.computed(()=>parseFloat(String(u.intervalHeight))),m=vue.computed(()=>{let e=0;const a=Number(u.columnCount);return u.cellWidth?e=Number(u.cellWidth):o.width>0&&d.value&&(e=d.value.offsetWidth/(a>1?a:r.value)),e}),s=vue.computed(()=>l.value*v.value),c=vue.computed(()=>i.value*p.value),y=vue.computed(()=>i.value*m.value),f=vue.computed(()=>k(e.value)),h=vue.computed(()=>w(t.value)),g=vue.computed(()=>{return createDayList(e.value,t.value,a.today,u.weekdays,u.disabledBefore,u.disabledAfter,u.disabledWeekdays,u.disabledDays,r.value)}),_=vue.computed(()=>{return g.value.map(e=>createIntervalList(e,l.value,v.value,i.value,a.now))});function k(e){return getStartOfWeek(e,u.weekdays,a.today)}function w(e){return getEndOfWeek(e,u.weekdays,a.today)}function D(e,a){return e&&e.length>0&&e.includes(getDateTime(a))}function b(e,a){const t={firstDay:!1,betweenDays:!1,lastDay:!1};if(e&&2===e.length){const n=getDayTimeIdentifier(a),r=getDayTimeIdentifier(parsed(e[0])),u=getDayTimeIdentifier(parsed(e[1]));t.firstDay=r===n,t.lastDay=u===n,t.betweenDays=r<n&&u>n}return t}function T(e,a=[],t=[]){const n=D(a,e),{firstDay:r,lastDay:u,betweenDays:o}=b(t,e);return{"q-selected":n,"q-range-first":!0===r,"q-range":!0===o,"q-range-last":!0===u,"q-disabled-interval disabled":!0===e.disabled}}function C(e,a,t){return[]}const x=vue.computed(()=>{const t={timeZone:"UTC",hour12:!u.hour24Format,hour:"2-digit",minute:"2-digit"},n={timeZone:"UTC",hour12:!u.hour24Format,hour:"numeric",minute:"2-digit"},r={timeZone:"UTC",hour12:!u.hour24Format,hour:"numeric"};return createNativeLocaleFormatter(u.locale,(e,a)=>a?0===e.minute?r:n:t)}),F=vue.computed(()=>{const e={timeZone:"UTC",dateStyle:"full",timeStyle:"short"};return createNativeLocaleFormatter(u.locale,()=>e)});function S(e){const a=_.value[0][0],t=a.hour===e.hour&&a.minute===e.minute;return!t&&0===e.minute}function q(e){}function I(e){return{}}function E(e,a,t=!1,n){let r=copyTimestamp(a);if(e.currentTarget){const u=e.currentTarget.getBoundingClientRect(),o=e,d=e,l=o.changedTouches||o.touches,i=(l&&l[0]?l[0]:d).clientY,s=(i-u.top)/p.value,c=Math.floor((t?Math.floor(s):s)*v.value);0!==c&&(r=addToDate(r,{minute:c})),n&&(r=updateRelative(r,n,!0))}return r}function O(e,a,t=!1,n){let r=copyTimestamp(a);const u=e.currentTarget.getBoundingClientRect(),o=e,d=e,l=o.changedTouches||o.touches,i=(l&&l[0]?l[0]:d).clientY,s=(i-u.top)/p.value,c=Math.floor((t?Math.floor(s):s)*v.value);return 0!==c&&(r=addToDate(r,{minute:c})),n&&(r=updateRelative(r,n,!0)),r}function H(e,a,t=!1,n){let r=copyTimestamp(a);if(e.currentTarget){const u=e.currentTarget.getBoundingClientRect(),o=e,d=e,l=o.changedTouches||o.touches,i=(l&&l[0]?l[0]:d).clientX,s=(i-u.left)/m.value,c=Math.floor((t?Math.floor(s):s)*v.value);0!==c&&(r=addToDate(r,{minute:c})),n&&(r=updateRelative(r,n,!0))}return r}function R(e,a){const t={timestamp:e,timeStartPos:N,timeDurationHeight:M};return void 0!==a&&(t.columnIndex=a),t}function L(e,a){const t={timestamp:copyTimestamp(e),timeStartPosX:A,timeDurationWidth:W};return void 0!==a&&(t.index=a),t}function V(e,a=0){const t=N(e);return!(!1===t||!n.value)&&(animVerticalScrollTo(n.value,t,a),!0)}function P(e,a=0){const t=A(e);return!(!1===t||!n.value)&&(animHorizontalScrollTo(n.value,t,a),!0)}function M(e){return e/v.value*p.value}function W(e){return e/v.value*m.value}function B(e){return e*v.value/p.value}function U(e){return e*v.value/m.value}function N(e,a=!0){const t=parseTime(e);if(!1===t)return!1;const n=s.value,r=i.value*v.value,u=(t-n)/r;let o=u*c.value;return a&&(o<0&&(o=0),o>c.value)&&(o=c.value),o}function A(e,a=!0){const t=parseTime(e);if(!1===t)return!1;const n=s.value,r=i.value*v.value,u=(t-n)/r;let o=u*y.value;return a&&(o<0&&(o=0),o>y.value)&&(o=y.value),o}return{parsedIntervalStart:l,parsedIntervalMinutes:v,parsedIntervalCount:i,parsedIntervalHeight:p,parsedCellWidth:m,parsedStartMinute:s,bodyHeight:c,bodyWidth:y,parsedWeekStart:f,parsedWeekEnd:h,days:g,intervals:_,intervalFormatter:x,ariaDateTimeFormatter:F,arrayHasDateTime:D,checkIntervals:b,getIntervalClasses:T,getResourceClasses:C,showIntervalLabelDefault:S,showResourceLabelDefault:q,styleDefault:I,getTimestampAtEventInterval:E,getTimestampAtEvent:O,getTimestampAtEventX:H,getScopeForSlot:R,getScopeForSlotX:L,scrollToTime:V,scrollToTimeX:P,timeDurationHeight:M,timeDurationWidth:W,heightToMinutes:B,widthToMinutes:U,timeStartPos:N,timeStartPosX:A}}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 a=vue.reactive({now:parseTimestamp("0000-00-00 00:00"),today:parseTimestamp("0000-00-00")}),t=vue.computed(()=>e.now?parseTimestamp(e.now):u());function n(){a.now&&a.today&&(a.now.current=a.today.current=!0,a.now.past=a.today.past=!1,a.now.future=a.today.future=!1)}function r(){const e=t.value||u();o(e,a.now),d(e,a.now),o(e,a.today)}function u(){return parseDate(new Date)}function o(e,a){e.date!==a.date&&(a.year=e.year,a.month=e.month,a.day=e.day,a.weekday=e.weekday,a.date=e.date)}function d(e,a){e.time!==a.time&&(a.hour=e.hour,a.minute=e.minute,a.time=e.time)}return vue.watch(t,()=>r()),{times:a,parsedNow:t,setCurrent:n,updateCurrent:r,getNow:u,updateDay:o,updateTime:d}}function useRenderValues(r,{parsedView:u,parsedValue:o,times:d}){const e=vue.computed(()=>{const e=o.value;let a=r.maxDays,t=e,n=e;switch(u.value){case"month":t=getStartOfMonth(e),n=getEndOfMonth(e),a=daysInMonth(t.year,t.month);break;case"week":case"week-agenda":case"week-scheduler":t=getStartOfWeek(e,r.weekdays,d.today),n=getEndOfWeek(t,r.weekdays,d.today),a=r.weekdays.length;break;case"day":case"scheduler":case"agenda":n=moveRelativeDays(copyTimestamp(n),nextDay,a>1?a-1:a,r.weekdays),n=updateFormatted(n);break;case"month-interval":case"month-scheduler":case"month-agenda":t=getStartOfMonth(e),n=getEndOfMonth(e),n=updateFormatted(n),a=daysInMonth(t.year,t.month);break;case"resource":a=1,n=moveRelativeDays(copyTimestamp(n),nextDay,a,r.weekdays),n=updateFormatted(n);break}return{start:t,end:n,maxDays:a}});return{renderValues:e}}const toCamelCase=e=>e.replace(/(-\w)/g,e=>e[1].toUpperCase());function getMouseEventHandlers(a,e,t,n){const r={};for(const u in t){const o=t[u],d=toCamelCase("on-"+u);if(!e.value)return console.warn("$listeners has not been set up"),{};if(void 0!==e.value[d]){const l="on"+o.event.charAt(0).toUpperCase()+o.event.slice(1),i=e=>{return(void 0===o.button||"buttons"in e&&e.buttons>0&&e.button===o.button)&&(o.prevent&&e.preventDefault(),o.stop&&e.stopPropagation(),a(u,n(e,u))),o.result};l in r?Array.isArray(r[l])?r[l].push(i):r[l]=[r[l],i]:r[l]=i}}return r}function getDefaultMouseEventHandlers(e,a,t,n){return getMouseEventHandlers(e,a,getMouseEventName(t),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(t,n){return{getMouseEventHandlers:(e,a)=>getMouseEventHandlers(t,n,e,a),getDefaultMouseEventHandlers:(e,a)=>getDefaultMouseEventHandlers(t,n,e,a),getMouseEventName:getMouseEventName,getRawMouseEvents:getRawMouseEvents}}const useMoveEmits=["moved"];function useMove(l,{parsedView:i,parsedValue:s,direction:c,maxDays:v,times:p,emittedValue:m,emit:y}){function e(t=1){if(0===t)m.value=today();else{let e=copyTimestamp(s.value);const n=getEndOfMonth(e),r=t>0,u=r?nextDay:prevDay,o=r?n.day:1;let a=r?t:-t;c.value=r?"next":"prev";const d=l.weekdays.length;while(--a>=0)switch(i.value){case"month":e.day=o,e=u(e),e=updateWeekday(e);while(!l.weekdays.includes(Number(e.weekday)))e=addToDate(e,{day:r?1:-1});break;case"week":case"week-agenda":case"week-scheduler":e=relativeDays(e,u,d,l.weekdays);break;case"day":case"scheduler":case"agenda":e=relativeDays(e,u,v.value,l.weekdays);break;case"month-interval":case"month-agenda":case"month-scheduler":e.day=o,e=u(e);break;case"resource":e=relativeDays(e,u,v.value,l.weekdays);break}e=updateWeekday(e),e=updateFormatted(e),e=updateDayOfYear(e),e=updateRelative(e,p.now),m.value=e.date,y("moved",e)}}return{move:e}}const listenerRE=/^on[A-Z]/;function useEmitListeners(e=vue.getCurrentInstance()){return{emitListeners:vue.computed(()=>{const a={};return e?.vnode?.props&&Object.keys(e.vnode.props).forEach(e=>{listenerRE.test(e)&&(a[e]=!0)}),a})}}function useFocusHelper(){const e={"aria-hidden":"true",class:"q-calendar__focus-helper"};return[vue.h("span",e)]}function useButton(){function e({focusable:e,focusType:a},t,n){const r=e&&a.includes("date");return vue.h("button",{...t,tabindex:r?0:-1},[n,r&&useFocusHelper()])}return{renderButton:e}}const useCellWidthProps={cellWidth:[Number,String]};function useCellWidth(e){const a=vue.computed(()=>void 0!==e.cellWidth);return{isSticky:a}}const useCheckChangeEmits=["change"];function useCheckChange(n,{days:r,lastStart:u,lastEnd:o}){function e(){const e=r.value;if(0===e.length)return!1;const a=e[0].date,t=e[e.length-1].date;return(!u.value||!o.value||a!==u.value||t!==o.value)&&(u.value=a,o.value=t,n("change",{start:a,end:t,days:e}),!0)}return{checkChange:e}}function useEventUtils(){function e(e,a){return(Array.isArray(a)?a:[a]).includes(e.keyCode)}return{isKeyCode:e}}const isKeyCode=useEventUtils().isKeyCode,useNavigationProps={useNavigation:Boolean};function useNavigation(a,{rootRef:t,focusRef:n,focusValue:r,datesRef:u,parsedView:o,emittedValue:d,direction:l,times:i}){let e=!1;function s(){e||document&&(e=!0,document.addEventListener("keyup",y),document.addEventListener("keydown",m))}function c(){document&&(document.removeEventListener("keyup",y),document.removeEventListener("keydown",m),e=!1)}function v(e){if(e&&document){const a=document.activeElement;if(a!==document.body&&t.value?.contains(a))return!0}return!1}function p(){let a=0;const t=window.setInterval(()=>{const e=u.value[n.value];e&&(e.focus(),50!==++a)&&document.activeElement!==e||window.clearInterval(t)},250)}function m(e){v(e)&&isKeyCode(e,[33,34,35,36,37,38,39,40])&&(e.stopPropagation(),e.preventDefault())}function y(e){if(v(e)&&isKeyCode(e,[33,34,35,36,37,38,39,40])){const a={33:k,34:w,35:b,36:D,37:g,38:f,39:_,40:h};a[e.keyCode]?.()}}function f(){let e=copyTimestamp(r.value);if("month"===o.value){if(e=addToDate(e,{day:-7}),r.value.month!==e.month)return l.value="prev",void(d.value=e.date)}else e=addToDate(e,{minute:Number(a.intervalMinutes)});l.value="prev",n.value=e.date}function h(){let e=copyTimestamp(r.value);if("month"===o.value){if(e=addToDate(e,{day:7}),r.value.month!==e.month)return l.value="next",void(d.value=e.date)}else e=addToDate(e,{minute:Number(a.intervalMinutes)});l.value="next",n.value=e.date}function g(){let e=copyTimestamp(r.value);l.value="prev";do{e=addToDate(e,{day:-1})}while(!a.weekdays.includes(Number(e.weekday)));n.value=e.date}function _(){let e=copyTimestamp(r.value);l.value="next";do{e=addToDate(e,{day:1})}while(!a.weekdays.includes(Number(e.weekday)));n.value=e.date}function k(){let e=copyTimestamp(r.value);e="month"===o.value?addToDate(e,{month:-1}):addToDate(e,{day:-7}),l.value="prev",n.value=e.date}function w(){let e=copyTimestamp(r.value);e="month"===o.value?addToDate(e,{month:1}):addToDate(e,{day:7}),l.value="next",n.value=e.date}function D(){let e=copyTimestamp(r.value);e="month"===o.value?getStartOfMonth(e):getStartOfWeek(e,a.weekdays||[],i.today);while(!a.weekdays.includes(Number(e.weekday)))e=addToDate(e,{day:-1});n.value=e.date}function b(){let e=copyTimestamp(r.value);e="month"===o.value?getEndOfMonth(e):getEndOfWeek(e,a.weekdays||[],i.today);while(!a.weekdays.includes(Number(e.weekday)))e=addToDate(e,{day:-1});n.value=e.date}return vue.onBeforeUnmount(()=>{c()}),vue.watch(()=>a.useNavigation,e=>{(!0===e?s:c)()}),!0===a.useNavigation&&s(),{startNavigation:s,endNavigation:c,tryFocus:p}}const renderButton$4=useButton().renderButton;var QCalendarAgenda=vue.defineComponent({name:"QCalendarAgenda",directives:{ResizeObserver:ResizeObserverDirective},props:{...useCommonProps,...useAgendaProps,...useColumnProps,...useMaxDaysProps,...useTimesProps,...useCellWidthProps,...useNavigationProps},emits:["update:model-value",...useCheckChangeEmits,...useMoveEmits,...getRawMouseEvents("-date"),...getRawMouseEvents("-head-day"),...getRawMouseEvents("-time")],setup(v,{slots:p,emit:d,expose:O}){const e=vue.ref(null),a=vue.ref(null),H=vue.ref(null),m=vue.ref(v.modelValue||today()),t=vue.ref(parsed(v.modelValue||today())),y=vue.ref({}),n=vue.ref(),r=vue.ref(),o=vue.ref("next"),l=vue.ref(v.modelValue||today()),i=vue.ref("0000-00-00"),s=vue.ref(0),c=vue.ref(v.modelValue),f=vue.reactive({width:0,height:0}),h=vue.ref(""),R=vue.ref(null),L=vue.ref(null),u=(vue.watch(()=>v.view,()=>{s.value=0}),vue.computed(()=>{return"month"===v.view?"month-interval":v.view})),V=vue.getCurrentInstance();if(null===V)throw new Error("current instance is null");const P=useEmitListeners(V).emitListeners,g=useCellWidth(v).isSticky,{times:_,setCurrent:B,updateCurrent:U}=(vue.watch(g,()=>{}),useTimes(v)),{parsedStart:K,parsedEnd:z,dayFormatter:Y,weekdayFormatter:Q,ariaDateFormatter:$,dayStyleDefault:X,getRelativeClasses:k}=(U(),B(),useCommon(v,{startDate:l,endDate:i,times:_})),w=vue.computed(()=>{return parseTimestamp(v.modelValue,_.now)||K.value||_.today}),Z=(t.value=w.value,m.value=w.value.date,useRenderValues(v,{parsedView:u,parsedValue:w,times:_})).renderValues,{rootRef:D,scrollWidth:j,__renderCalendar:G}=useCalendar(v,Ce,{scrollArea:e,pane:a}),{days:b,parsedCellWidth:J,getScopeForSlot:T}=useInterval(v,{times:_,scrollArea:e,parsedStart:K,parsedEnd:z,maxDays:s,size:f,headerColumnRef:H}),C=useMove(v,{parsedView:u,parsedValue:w,direction:o,maxDays:s,times:_,emittedValue:c,emit:d}).move,x=useMouseEvents(d,P).getDefaultMouseEventHandlers,ee=useCheckChange(d,{days:b,lastStart:R,lastEnd:L}).checkChange,ae=useEventUtils().isKeyCode,te=useNavigation(v,{rootRef:D,focusRef:m,focusValue:t,datesRef:y,parsedView:u,emittedValue:c,direction:o,times:_}).tryFocus,F=vue.computed(()=>{return b.value.length+(!0===S.value?v.leftColumnOptions.length:0)+(!0===q.value?v.rightColumnOptions.length:0)+b.value.length===1&&parseInt(String(v.columnCount),10)>0?parseInt(String(v.columnCount),10):0}),S=vue.computed(()=>{return void 0!==v.leftColumnOptions&&Array.isArray(v.leftColumnOptions)}),q=vue.computed(()=>{return void 0!==v.rightColumnOptions&&Array.isArray(v.rightColumnOptions)}),I=vue.computed(()=>{if(D.value){const e=f.width||D.value.getBoundingClientRect().width;if(e&&F.value)return(e-j.value)/F.value+"px"}return 100/F.value+"%"});function ne(){c.value=today()}function re(e=1){C(e)}function ue(e=1){C(-e)}function oe({width:e,height:a}){f.width=e,f.height=a}function E(e){return e.date===c.value}function M(a,t){const e=p["head-column"],n={column:a,index:t,days:b.value},r=!0===g.value?v.cellWidth:I.value,u=!0===v.focusable&&v.focusType.includes("weekday"),o=void 0!==v.columnOptionsId?a[v.columnOptionsId]:"id",d={maxWidth:r,width:r};return vue.h("div",{key:o,tabindex:!0===u?0:-1,class:{"q-calendar-agenda__head--day":!0,"q-column-day":!0,"q-calendar__hoverable":!0===v.hoverable,"q-calendar__focusable":!0===u},style:d,onDragenter:e=>{void 0!==v.dragEnterFunc&&"function"===typeof v.dragEnterFunc&&(!0===v.dragEnterFunc(e,"head-column",{scope:n})?h.value=o:h.value="")},onDragover:e=>{void 0!==v.dragOverFunc&&"function"===typeof v.dragOverFunc&&(!0===v.dragOverFunc(e,"head-column",{scope:n})?h.value=o:h.value="")},onDragleave:e=>{void 0!==v.dragLeaveFunc&&"function"===typeof v.dragLeaveFunc&&(!0===v.dragLeaveFunc(e,"head-column",{scope:n})?h.value=o:h.value="")},onDrop:e=>{void 0!==v.dropFunc&&"function"===typeof v.dropFunc&&(!0===v.dropFunc(e,"head-column",{scope:n})?h.value=o:h.value="")},...x("-head-column",e=>{return{scope:{column:a,index:t},event:e}})},[!0!==v.noDefaultHeaderText&&de(a),e&&e(n),useFocusHelper()])}function de(e){const a=p["head-column-label"],t={column:e},n=void 0!==v.columnOptionsLabel?e[v.columnOptionsLabel]:e.label,r=vue.h("div",{class:{"q-calendar-agenda__head--weekday":!0,["q-calendar__"+v.weekdayAlign]:!0,ellipsis:!0},style:{alignSelf:"center"}},[a&&a({scope:t}),!a&&vue.h("span",{class:"ellipsis"},n)]);return"stacked"===v.dateHeader?r:vue.h("div",{class:"q-calendar__header--inline",style:{height:"100%"}},[r])}function le(){return vue.h("div",{roll:"presentation",class:{"q-calendar-agenda__head":!0,"q-calendar__sticky":!0===g.value},style:{marginRight:j.value+"px"}},[ie()])}function ie(){return vue.h("div",{ref:H,class:{"q-calendar-agenda__head--days__column":!0}},[se(),ce()])}function se(){return vue.h("div",{class:{"q-calendar-agenda__head--days__weekdays":!0}},ve())}function ce(){const e=p["head-days-events"];return vue.nextTick(()=>{if(r.value&&0===v.columnCount&&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-agenda__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:{days:b.value,ref:r}})]),...pe()])}function ve(){const e=parseInt(String(v.columnCount),10),t=parseInt(String(v.columnIndexStart),10);return(1===b.value.length&&e>0?[!0===S.value?v.leftColumnOptions.map((e,a)=>M(e,a)):[],...Array.apply(null,new Array(e)).map((e,a)=>a+t).map(e=>me(b.value[0],e)),!0===q.value?v.rightColumnOptions.map((e,a)=>M(e,a)):[]]:[!0===S.value?v.leftColumnOptions.map((e,a)=>M(e,a)):[],...b.value.map(e=>me(e)),!0===q.value?v.rightColumnOptions.map((e,a)=>M(e,a)):[]]).flat()}function pe(){const t=parseInt(String(v.columnCount),10);return 1===b.value.length&&t>0?[...Array.apply(null,new Array(parseInt(String(v.columnCount),10))).map((e,a)=>a+t).map(e=>fe(b.value[0],e))]:b.value.map(e=>fe(e,0))}function me(a,e){const t=p["head-day"],n=p["head-date"],r=!0!==v.noActiveDate&&E(a),u=T(a,e??0),o=(u.activeDate=r,u.droppable=h.value===a.date,u.disabled=!!v.disabledWeekdays&&v.disabledWeekdays.includes(Number(a.weekday)),!0===g.value?v.cellWidth:I.value),d=v.weekdayStyle||X,l={width:o,maxWidth:o,...d({scope:u})},i=(!0===g.value&&(l.minWidth=o),"function"===typeof v.weekdayClass?v.weekdayClass({scope:u}):{}),s=!0===v.focusable&&v.focusType.includes("weekday"),c={key:a.date+(void 0!==e?"-"+e:""),ref:e=>{y.value[a.date]=e},tabindex:!0===s?0:-1,class:{"q-calendar-agenda__head--day":!0,...i,...k(a),"q-active-date":r,"q-calendar__hoverable":!0===v.hoverable,"q-calendar__focusable":!0===s},style:l,onDragenter:e=>{void 0!==v.dragEnterFunc&&"function"===typeof v.dragEnterFunc&&(!0===v.dragEnterFunc(e,"head-day",{scope:u})?h.value=a.date:h.value="")},onDragover:e=>{void 0!==v.dragOverFunc&&"function"===typeof v.dragOverFunc&&(!0===v.dragOverFunc(e,"head-day",{scope:u})?h.value=a.date:h.value="")},onDragleave:e=>{void 0!==v.dragLeaveFunc&&"function"===typeof v.dragLeaveFunc&&(!0===v.dragLeaveFunc(e,"head-day",{scope:u})?h.value=a.date:h.value="")},onDrop:e=>{void 0!==v.dropFunc&&"function"===typeof v.dropFunc&&(!0===v.dropFunc(e,"head-day",{scope:u})?h.value=a.date:h.value="")},onFocus:()=>{!0===s&&(m.value=a.date)},...x("-head-day",e=>{return{scope:u,event:e}})};return vue.h("div",c,[void 0!==t&&t({scope:u}),void 0===t&&ye(a),void 0===t&&n&&n({scope:u}),useFocusHelper()])}function ye(e){return"stacked"===v.dateHeader?[!0!==v.noDefaultHeaderText&&W(e),!0!==v.noDefaultHeaderBtn&&N(e)].filter(e=>!1!==e):"inline"===v.dateHeader?("left"===v.weekdayAlign&&"right"===v.dateAlign||"right"===v.weekdayAlign&&v.dateAlign,vue.h("div",{class:"q-calendar__header--inline"},[!0!==v.noDefaultHeaderText&&W(e),!0!==v.noDefaultHeaderBtn&&N(e)])):"inverted"===v.dateHeader?("left"===v.weekdayAlign&&"right"===v.dateAlign||"right"===v.weekdayAlign&&v.dateAlign,vue.h("div",{class:"q-calendar__header--inline"},[!0!==v.noDefaultHeaderBtn&&N(e),!0!==v.noDefaultHeaderText&&W(e)])):void 0}function fe(e,a){const t=p["head-day-event"],n=!0!==v.noActiveDate&&E(e),r=T(e,a),u=(r.activeDate=n,r.disabled=!!v.disabledWeekdays&&v.disabledWeekdays.includes(Number(e.weekday)),!0===g.value?v.cellWidth:I.value),o={width:u,maxWidth:u};return!0===g.value&&(o.minWidth=u),vue.h("div",{key:"event-"+e.date+(void 0!==a?"-"+a:""),class:{"q-calendar-agenda__head--day__event":!0,...k(e),"q-active-date":n},style:o},[t&&t({scope:r})])}function W(e){const a=p["head-weekday-label"],t=T(e,0),n=(t.shortWeekdayLabel=v.shortWeekdayLabel,{class:{"q-calendar-agenda__head--weekday":!0,["q-calendar__"+v.weekdayAlign]:!0,"q-calendar__ellipsis":!0}});return vue.h("div",n,a&&a({scope:t})||he(e,v.shortWeekdayLabel))}function he(e,a){const t=Q.value(e,a||v.weekdayBreakpoints[0]>0&&J.value<=v.weekdayBreakpoints[0]);return vue.h("span",{class:"q-calendar__ellipsis"},v.weekdayBreakpoints[1]>0&&J.value<=v.weekdayBreakpoints[1]?minCharWidth(t,Number(v.minWeekdayLabel)):t)}function N(e){const a={class:{"q-calendar-agenda__head--date":!0,["q-calendar__"+v.dateAlign]:!0}};return vue.h("div",a,ge(e))}function ge(t){const e=!0!==v.noActiveDate&&E(t),a=Y.value(t,!1),n=p["head-day-label"],r=p["head-day-button"],u={dayLabel:a,timestamp:t,activeDate:e,disabled:!!v.disabledWeekdays&&v.disabledWeekdays.includes(Number(t.weekday))},o={class:{"q-calendar-agenda__head--day__label":!0,"q-calendar__button":!0,"q-calendar__button--round":"round"===v.dateType,"q-calendar__button--rounded":"rounded"===v.dateType,"q-calendar__button--bordered":!0===t.current,"q-calendar__focusable":!0},disabled:t.disabled,onKeydown:e=>{!0!==t.disabled&&ae(e,[13,32])&&(e.stopPropagation(),e.preventDefault())},onKeyup:e=>{!0!==t.disabled&&ae(e,[13,32])&&(c.value=t.date,void 0!==P.value.onClickDate)&&d("click-date",{scope:u})},...x("-date",(e,a)=>{return"click-date"!==a&&"contextmenu-date"!==a||(c.value=t.date,"click-date"===a&&e.preventDefault()),{scope:u,event:e}})};return!0!==v.noAria&&(o.ariaLabel=$.value(t,!1)),r?r({scope:u}):renderButton$4(v,o,n?n({scope:u}):a)}function _e(){return vue.h("div",{class:"q-calendar-agenda__body"},[ke()])}function ke(){return!0===g.value?vue.h("div",{ref:e,class:{"q-calendar-agenda__scroll-area":!0,"q-calendar__scroll":!0}},[De()]):!0===v.noScroll?we():vue.h("div",{ref:e,class:{"q-calendar-agenda__scroll-area":!0,"q-calendar__scroll":!0}},[we()])}function we(){return vue.h("div",{ref:a,class:"q-calendar-agenda__pane"},[De()])}function De(){const e=p["day-container"];return vue.h("div",{class:"q-calendar-agenda__day-container"},[!0===g.value&&!0!==v.noHeader&&le(),vue.h("div",{style:{display:"flex",flexDirection:"row",height:"100%"}},[...be()||[]].flat()),e&&e({scope:{days:b.value}})])}function be(){const e=parseInt(String(v.columnCount),10),t=parseInt(String(v.columnIndexStart),10);return(1===b.value.length&&e>0?[!0===S.value?v.leftColumnOptions.map((e,a)=>A(e,a)):[],...Array.apply(null,new Array(e)).map((e,a)=>a+t).map(e=>Te(b.value[0],0,e)),!0===q.value?v.rightColumnOptions.map((e,a)=>A(e,a)):[]]:[!0===S.value?v.leftColumnOptions.map((e,a)=>A(e,a)):[],...b.value.map((e,a)=>Te(e,a,0)),!0===q.value?v.rightColumnOptions.map((e,a)=>A(e,a)):[]]).flat()}function A(e,a){const t=p.column,n={column:e,days:b.value,index:a},r=!0===g.value?v.cellWidth:I.value,u=!0===v.focusable&&v.focusType.includes("day"),o=void 0!==v.columnOptionsId?e[v.columnOptionsId]:void 0;return vue.h("div",{key:o,tabindex:!0===u?0:-1,class:{"q-calendar-agenda__day":!0,"q-column-day":!0,"q-calendar__hoverable":!0===v.hoverable,"q-calendar__focusable":!0===u},style:{maxWidth:r,width:r},onDragenter:e=>{void 0!==v.dragEnterFunc&&"function"===typeof v.dragEnterFunc&&(!0===v.dragEnterFunc(e,"column",{scope:n})?h.value=o:h.value="")},onDragover:e=>{void 0!==v.dragOverFunc&&"function"===typeof v.dragOverFunc&&(!0===v.dragOverFunc(e,"column",{scope:n})?h.value=o:h.value="")},onDragleave:e=>{void 0!==v.dragLeaveFunc&&"function"===typeof v.dragLeaveFunc&&(!0===v.dragLeaveFunc(e,"column",{scope:n})?h.value=o:h.value="")},onDrop:e=>{void 0!==v.dropFunc&&"function"===typeof v.dropFunc&&(!0===v.dropFunc(e,"column",{scope:n})?h.value=o:h.value="")},...x("-column",e=>{return{scope:n,event:e}})},[t&&t({scope:n})])}function Te(e,a,t){const n=parseInt(String(v.dayHeight),10),r=parseInt(String(v.dayMinHeight),10),u=p.day,o=T(e,t),d=!0===g.value?v.cellWidth:I.value,l={width:d,maxWidth:d};return!0===g.value&&(l.minWidth=d),l.height=n>0?convertToUnit(n):"auto",r>0&&(l.minHeight=convertToUnit(r)),vue.h("div",{key:e.date+(void 0!==t?":"+t:""),class:{"q-calendar-agenda__day":!0,...k(e)},style:l},[u&&u({scope:o})])}function Ce(){const{start:e,end:a,maxDays:t}=Z.value,n=(l.value===e.date&&i.value===a.date&&s.value===t||(l.value=e.date,i.value=a.date,s.value=t),f.width>0),r=vue.withDirectives(vue.h("div",{class:"q-calendar-agenda",key:l.value},[!0===n&&!0!==g.value&&!0!==v.noHeader&&le(),!0===n&&_e()]),[[ResizeObserverDirective,oe]]);if(!0!==v.animated)return r;{const u="q-calendar--"+("prev"===o.value?v.transitionPrev:v.transitionNext);return vue.h(vue.Transition,{name:u,appear:!0},()=>r)}}return vue.watch([b],ee,{deep:!0,immediate:!0}),vue.watch(()=>v.modelValue,(e,a)=>{if(c.value!==e){if(!0===v.animated){const t=getDayIdentifier(parsed(e)),n=getDayIdentifier(parsed(a));o.value=t>=n?"next":"prev"}c.value=e}m.value=e}),vue.watch(c,(e,a)=>{if(c.value!==v.modelValue){if(!0===v.animated){const t=getDayIdentifier(parsed(e)),n=getDayIdentifier(parsed(a));o.value=t>=n?"next":"prev"}d("update:model-value",e)}}),vue.watch(m,e=>{e&&(t.value=parseTimestamp(e))}),vue.watch(t,()=>{m.value&&y.value[m.value]?y.value[m.value].focus():te()}),vue.watch(()=>v.maxDays,e=>{s.value=e}),vue.onBeforeUpdate(()=>{y.value={}}),vue.onMounted(()=>{}),O({prev:ue,next:re,move:C,moveToToday:ne,updateCurrent:U}),()=>G()}});const renderButton$3=useButton().renderButton;var QCalendarDay=vue.defineComponent({name:"QCalendarDay",directives:{ResizeObserver:ResizeObserverDirective},props:{...useCommonProps,...useIntervalProps,...useColumnProps,...useMaxDaysProps,...useTimesProps,...useCellWidthProps,...useNavigationProps},emits:["update:model-value",...useCheckChangeEmits,...useMoveEmits,...getRawMouseEvents("-date"),...getRawMouseEvents("-interval"),...getRawMouseEvents("-head-intervals"),...getRawMouseEvents("-head-day"),...getRawMouseEvents("-time")],setup(p,{slots:m,emit:v,expose:O}){const e=vue.ref(null),H=vue.ref(null),R=vue.ref(null),y=vue.ref(p.modelValue||today()),a=vue.ref(parsed(p.modelValue||today())),f=vue.ref({}),t=vue.ref(),n=vue.ref(),o=vue.ref("next"),d=vue.ref(p.modelValue||today()),l=vue.ref("0000-00-00"),i=vue.ref(0),h=vue.ref(p.modelValue||today()),s=vue.reactive({width:0,height:0}),g=vue.ref(""),_=vue.ref(0),L=vue.ref(null),V=vue.ref(null),r=(vue.watch(()=>p.view,()=>{i.value=0}),vue.computed(()=>{return"month"===p.view?"month-interval":p.view})),P=vue.getCurrentInstance();if(null===P)throw new Error("current instance is null");const k=useEmitListeners(P).emitListeners,w=useCellWidth(p).isSticky,{times:D,setCurrent:B,updateCurrent:U}=useTimes(p),{parsedStart:u,parsedEnd:K,dayFormatter:z,weekdayFormatter:Y,ariaDateFormatter:Q,dayStyleDefault:$,getRelativeClasses:b}=(U(),B(),useCommon(p,{startDate:d,endDate:l,times:D})),c=vue.computed(()=>{return parseTimestamp(p.modelValue,D.now)||u.value||D.today}),X=(a.value=c.value,y.value=c.value.date,useRenderValues(p,{parsedView:r,parsedValue:c,times:D})).renderValues,{rootRef:T,scrollWidth:Z,__renderCalendar:j}=useCalendar(p,Be,{scrollArea:e,pane:H}),{days:C,intervals:G,intervalFormatter:J,ariaDateTimeFormatter:ee,parsedCellWidth:x,getIntervalClasses:ae,showIntervalLabelDefault:te,styleDefault:ne,getTimestampAtEventInterval:re,getTimestampAtEvent:ue,getScopeForSlot:F,scrollToTime:oe,heightToMinutes:de,timeDurationHeight:le,timeStartPos:ie}=useInterval(p,{times:D,scrollArea:e,parsedStart:u,parsedEnd:K,maxDays:i,size:s,headerColumnRef:R}),S=useMove(p,{parsedView:r,parsedValue:c,direction:o,maxDays:i,times:D,emittedValue:h,emit:v}).move,q=useMouseEvents(v,k).getDefaultMouseEventHandlers,se=useCheckChange(v,{days:C,lastStart:L,lastEnd:V}).checkChange,I=useEventUtils().isKeyCode,ce=useNavigation(p,{rootRef:T,focusRef:y,focusValue:a,datesRef:f,parsedView:r,emittedValue:h,direction:o,times:D}).tryFocus,E=vue.computed(()=>{const e=parseInt(String(p.columnCount),10);return"day"===r.value&&e>1?e:"day"===r.value&&p.maxDays&&p.maxDays>1?p.maxDays:C.value.length}),ve=vue.computed(()=>{return T.value?parseInt(window.getComputedStyle(T.value).getPropertyValue("--calendar-intervals-width"),10):0}),M=vue.computed(()=>{if(T.value){const e=s.width||T.value.getBoundingClientRect().width;if(e&&ve.value&&E.value)return(e-Z.value-ve.value)/E.value+"px"}return 100/E.value+"%"});function pe(){h.value=today()}function me(e=1){S(e)}function ye(e=1){S(-e)}function fe({width:e,height:a}){s.width=e,s.height=a}function W(e){return e.date===h.value}function he(){return vue.h("div",{roll:"presentation",class:{"q-calendar-day__head":!0,"q-calendar__sticky":!0===w.value},style:{marginRight:Z.value+"px"}},[ge(),_e()])}function ge(){const e=m["head-intervals"],a={timestamps:C.value,days:C.value,date:p.modelValue};return vue.h("div",{class:{"q-calendar-day__head--intervals":!0,"q-calendar__sticky":!0===w.value},...q("-head-intervals",e=>{return{scope:a,event:e}})},[e&&e({scope:a})])}function _e(){return vue.h("div",{ref:R,class:{"q-calendar-day__head--days__column":!0}},[ke(),we()])}function ke(){return vue.h("div",{class:{"q-calendar-day__head--days__weekdays":!0}},[...De()])}f