@sbh321/qcalendar
Version:
A forked version of Jeff Galbraith's fork of Quasar UI QCalendar
6 lines • 128 kB
JavaScript
/*!
* @subhambhandari/qcalendar v4.0.0-beta.19
* (c) 2024 Subham Bhandari <bhandarimaiya65@gmail.com>
* Released under the MIT License.
*/
"use strict";var vue=require("vue");const PARSE_REGEX=/^(\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],DAYS_IN_MONTH_MIN=28,DAYS_IN_MONTH_MAX=31,MONTH_MAX=12,MONTH_MIN=1,DAY_MIN=1,DAYS_IN_WEEK=7,MINUTES_IN_HOUR=60,HOURS_IN_DAY=24,FIRST_HOUR=0,MILLISECONDS_IN_MINUTE=6e4,MILLISECONDS_IN_HOUR=36e5,MILLISECONDS_IN_DAY=864e5,MILLISECONDS_IN_WEEK=6048e5,Timestamp={date:"",time:"",year:0,month:0,day:0,weekday:0,hour:0,minute:0,doy:0,workweek:0,hasDay:!1,hasTime:!1,past:!1,current:!1,future:!1,disabled:!1,currentWeekday:!1},TimeObject={hour:0,minute:0};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 getStartOfWeek(e,a,t){let n=copyTimestamp(e);if(1===n.day||0===n.weekday)while(!a.includes(n.weekday))n=nextDay(n);return n=findWeekday(n,a[0],prevDay),n=updateFormatted(n),t&&(n=updateRelative(n,t,n.hasTime)),n}function getEndOfWeek(e,a,t){let n=copyTimestamp(e);const r=daysInMonth(n.year,n.month);if(r===n.day||6===n.weekday)while(!a.includes(n.weekday))n=prevDay(n);return n=findWeekday(n,a[a.length-1],nextDay),n=updateFormatted(n),t&&(n=updateRelative(n,t,n.hasTime)),n}function getStartOfMonth(e){const a=copyTimestamp(e);return a.day=DAY_MIN,updateFormatted(a),a}function getEndOfMonth(e){const a=copyTimestamp(e);return a.day=daysInMonth(a.year,a.month),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"number"!==typeof e.hour||"number"!==typeof e.minute?!1:60*e.hour+e.minute}return!1}function validateTimestamp(e){return!!PARSE_REGEX.exec(e)}function compareTimestamps(e,a){return JSON.stringify(e)===JSON.stringify(a)}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 parsed(e){const a=PARSE_REGEX.exec(e);return a?{date:e,time:padNumber(parseInt(a[6],10)||0,2)+":"+padNumber(parseInt(a[8],10)||0,2),year:parseInt(a[1],10),month:parseInt(a[2],10),day:parseInt(a[4],10)||1,hour:isNaN(parseInt(a[6],10))?0:parseInt(a[6],10),minute:isNaN(parseInt(a[8],10))?0:parseInt(a[8],10),weekday:0,doy:0,workweek:0,hasDay:!!a[4],hasTime:!0,past:!1,current:!1,future:!1,disabled:!1}:null}function parseTimestamp(e,a){let t=parsed(e);return null===t?null:(t=updateFormatted(t),a&&updateRelative(t,a,t.hasTime),t)}function parseDate(e,a=!1){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 getDayIdentifier(e){return 1e8*e.year+1e6*e.month+1e4*e.day}function getTimeIdentifier(e){return 100*e.hour+e.minute}function getDayTimeIdentifier(e){return getDayIdentifier(e)+getTimeIdentifier(e)}function diffTimestamp(e,a,t){const n=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute),r=Date.UTC(a.year,a.month-1,a.day,a.hour,a.minute);return!0===t&&r<n?0:r-n}function updateRelative(e,a,t=!1){let n=getDayIdentifier(a),r=getDayIdentifier(e),u=n===r;return e.hasTime&&t&&u&&(n=getTimeIdentifier(a),r=getTimeIdentifier(e),u=n===r),e.past=r<n,e.current=u,e.future=r>n,e.currentWeekday=e.weekday===a.weekday,e}function updateMinutes(e,a,t){return e.hasTime=!0,e.hour=Math.floor(a/MINUTES_IN_HOUR),e.minute=a%MINUTES_IN_HOUR,e.time=getTime(e),t&&updateRelative(e,t,!0),e}function updateWeekday(e){return e.weekday=getWeekday(e),e}function updateDayOfYear(e){return e.doy=getDayOfYear(e),e}function updateWorkWeek(e){return e.workweek=getWorkWeek(e),e}function updateDisabled(e,a,t,n,r){const u=getDayIdentifier(e);if(void 0!==a){const o=getDayIdentifier(parsed(a));u<=o&&(e.disabled=!0)}if(!0!==e.disabled&&void 0!==t){const d=getDayIdentifier(parsed(t));u>=d&&(e.disabled=!0)}if(!0!==e.disabled&&Array.isArray(n)&&n.length>0)for(const l in n)if(n[l]===e.weekday){e.disabled=!0;break}if(!0!==e.disabled&&Array.isArray(r)&&r.length>0)for(const i in r)if(Array.isArray(r[i])&&2===r[i].length){const s=parsed(r[i][0]),c=parsed(r[i][1]);if(isBetweenDates(e,s,c)){e.disabled=!0;break}}else{const v=getDayIdentifier(parseTimestamp(r[i]+" 00:00"));if(v===u){e.disabled=!0;break}}return e}function updateFormatted(e){return e.hasTime=!0,e.time=getTime(e),e.date=getDate(e),e.weekday=getWeekday(e),e.doy=getDayOfYear(e),e.workweek=getWorkWeek(e),e}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){0===e.year&&(e=parseTimestamp(today()));const a=makeDate(e);if(isNaN(a))return 0;const t=new Date(a.getFullYear(),a.getMonth(),a.getDate()),n=(t.setDate(t.getDate()-(t.getDay()+6)%7+3),new Date(t.getFullYear(),0,4)),r=(n.setDate(n.getDate()-(n.getDay()+6)%7+3),t.getTimezoneOffset()-n.getTimezoneOffset()),u=(t.setHours(t.getHours()-r),(t-n)/MILLISECONDS_IN_WEEK);return 1+Math.floor(u)}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}function isLeapYear(e){return 1===(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 copyTimestamp(e){return{...e}}function padNumber(e,a){let t=String(e);while(t.length<a)t="0"+t;return t}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 nextDay(e){return++e.day,e.weekday=(e.weekday+1)%DAYS_IN_WEEK,e.day>DAYS_IN_MONTH_MIN&&e.day>daysInMonth(e.year,e.month)&&(e.day=DAY_MIN,++e.month,e.month>MONTH_MAX)&&(e.month=MONTH_MIN,++e.year),e}function prevDay(e){return e.day--,e.weekday=(e.weekday+6)%DAYS_IN_WEEK,e.day<DAY_MIN&&(e.month--,e.month<MONTH_MIN&&(e.year--,e.month=MONTH_MAX),e.day=daysInMonth(e.year,e.month)),e}function moveRelativeDays(e,a=nextDay,t=1,n=[0,1,2,3,4,5,6]){return relativeDays(e,a,t,n)}function relativeDays(e,a=nextDay,t=1,n=[0,1,2,3,4,5,6]){n.includes(e.weekday)||0!==e.weekday||a!==nextDay||++t;while(--t>=0)e=a(e),n.length<7&&!n.includes(e.weekday)&&++t;return e}function findWeekday(e,a,t=nextDay,n=6){while(e.weekday!==a&&--n>=0)e=t(e);return e}function getWeekdaySkips(a){const e=[1,1,1,1,1,1,1],n=[0,0,0,0,0,0,0];for(let e=0;e<a.length;++e)n[a[e]]=1;for(let t=0;t<DAYS_IN_WEEK;++t){let a=1;for(let e=1;e<DAYS_IN_WEEK;++e){const r=(t+e)%DAYS_IN_WEEK;if(n[r])break;++a}e[t]=n[t]*a}return e}function createDayList(e,a,t,n,r,u,o=[],d=[],l=42,i=0){const s=getDayIdentifier(a),c=[];let v=copyTimestamp(e),p=0,m=p===s;if(!(s<getDayIdentifier(e)))while((!m||c.length<i)&&c.length<l){if(p=getDayIdentifier(v),m=m||p>s&&c.length>=i,m)break;if(0===n[v.weekday]);else{const y=copyTimestamp(v);updateFormatted(y),updateRelative(y,t),updateDisabled(y,r,u,o,d),c.push(y)}v=relativeDays(v,nextDay)}return c}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 u=(e,a)=>"";return"undefined"===typeof Intl||"undefined"===typeof Intl.DateTimeFormat?u:(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)),u}}}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(parseInt(e,10))}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){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 n=copyTimestamp(e);let r;return __forEachObject(a,(e,a)=>{if(void 0!==n[a]){n[a]+=parseInt(e,10);const t=NORMALIZE_TYPES.indexOf(a);-1!==t&&(r=void 0===r?t:Math.min(t,r))}}),void 0!==r&&__normalize(n,NORMALIZE_TYPES[r]),updateFormatted(n),n}const NORMALIZE_TYPES=["minute","hour","day","month"];function __forEachObject(a,t){Object.keys(a).forEach(e=>t(a[e],e))}function __normalizeMinute(e){if(e.minute>=MINUTES_IN_HOUR||e.minute<0){const a=Math.floor(e.minute/MINUTES_IN_HOUR);e.minute-=a*MINUTES_IN_HOUR,e.hour+=a,__normalizeHour(e)}return e}function __normalizeHour(e){if(e.hour>=HOURS_IN_DAY||e.hour<0){const a=Math.floor(e.hour/HOURS_IN_DAY);e.hour-=a*HOURS_IN_DAY,e.day+=a,__normalizeDay(e)}return e}function __normalizeDay(a){__normalizeMonth(a);let t=daysInMonth(a.year,a.month);if(a.day>t){++a.month,a.month>MONTH_MAX&&__normalizeMonth(a);let e=a.day-t;t=daysInMonth(a.year,a.month);do{e>t&&(++a.month,a.month>MONTH_MAX&&__normalizeMonth(a),e-=t,t=daysInMonth(a.year,a.month))}while(e>t);a.day=e}else if(a.day<=0){let e=-1*a.day;--a.month,a.month<=0&&__normalizeMonth(a),t=daysInMonth(a.year,a.month);do{e>t&&(e-=t,--a.month,a.month<=0&&__normalizeMonth(a),t=daysInMonth(a.year,a.month))}while(e>t);a.day=t-e}return a}function __normalizeMonth(e){if(e.month>MONTH_MAX){const a=Math.floor(e.month/MONTH_MAX);e.month=e.month%MONTH_MAX,e.year+=a}else e.month<MONTH_MIN&&(e.month+=MONTH_MAX,--e.year);return e}function __normalize(e,a){switch(a){case"minute":return __normalizeMinute(e);case"hour":return __normalizeHour(e);case"day":return __normalizeDay(e);case"month":return __normalizeMonth(e)}}function daysBetween(e,a){const t=diffTimestamp(e,a,!0);return Math.floor(t/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)/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 r=(e,a)=>"",u={long:{timeZone:"UTC",weekday:"long"},short:{timeZone:"UTC",weekday:"short"},narrow:{timeZone:"UTC",weekday:"narrow"}};return"undefined"===typeof Intl||"undefined"===typeof Intl.DateTimeFormat?r:e;function e(a,e,t){try{const n=new Intl.DateTimeFormat(t||void 0,u[e]||u["long"]);return n.format(weekdayDateMap[a])}catch(e){return console.error(`Intl.DateTimeFormat: ${e.message} -> day of week: `+a),r}}}function getWeekdayNames(a,t){const e=Object.keys(weekdayDateMap),n=getWeekdayFormatter();return e.map(e=>n(e,a,t))}function getMonthFormatter(){const u=(e,a)=>"",o={long:{timeZone:"UTC",month:"long"},short:{timeZone:"UTC",month:"short"},narrow:{timeZone:"UTC",month:"narrow"}};return"undefined"===typeof Intl||"undefined"===typeof Intl.DateTimeFormat?u:e;function e(a,e,t){try{const n=new Intl.DateTimeFormat(t||void 0,o[e]||o["long"]),r=new Date;return r.setDate(1),r.setMonth(a),n.format(r)}catch(e){return console.error(`Intl.DateTimeFormat: ${e.message} -> month: `+a),u}}}function getMonthNames(a,t){const n=getMonthFormatter();return[...Array(12).keys()].map(e=>n(e,a,t))}function convertToUnit(e,a="px"){if(null!=e&&""!==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)}var ResizeObserver$1={name:"ResizeObserver",mounted(e,{value:a}){if(a){const t={};t.callback=a,t.size={width:0,height:0},t.observer=new ResizeObserver(e=>{const a=e[0].contentRect;a.width===t.size.width&&a.height===t.size.height||(t.size.width=a.width,t.size.height=a.height,t.callback(t.size))}),t.observer.observe(e),e.__onResizeObserver=t}},beforeUnmount(e){if(e.__onResizeObserver){const a=e.__onResizeObserver["observer"];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()]),[[ResizeObserver$1,o]])}return{rootRef:u,scrollWidth:d,__initCalendar:l,__renderCalendar:i}}const 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:{type:Function},dragOverFunc:{type:Function},dragLeaveFunc:{type:Function},dropFunc:{type:Function},selectedDates:{type:Array,default:()=>[]},selectedStartEndDates:{type:Array,default:()=>[]},hoverable:Boolean,focusable:Boolean,focusType:{type:Array,default:["date"],validator:e=>{let a=!0;e.forEach(e=>{!0!==["day","date","weekday","interval","time","resource","task"].includes(e)&&(a=!1)});return a}}};function useCommon(r,{startDate:e,endDate:a,times:t}){const n=vue.computed(()=>getWeekdaySkips(r.weekdays)),u=vue.computed(()=>parseTimestamp(e.value)),o=vue.computed(()=>{if("0000-00-00"===a.value)return m(u.value);return parseTimestamp(a.value)}),d=vue.computed(()=>{const t={timeZone:"UTC",day:"numeric"};return createNativeLocaleFormatter(r.locale,(e,a)=>t)}),l=vue.computed(()=>{const t={timeZone:"UTC",weekday:"long"};const n={timeZone:"UTC",weekday:"short"};return createNativeLocaleFormatter(r.locale,(e,a)=>a?n:t)}),i=vue.computed(()=>{const a={timeZone:"UTC",dateStyle:"full"};return createNativeLocaleFormatter(r.locale,e=>a)});function s(e,a){return e&&e.length>0&&e.includes(a.date)}function c(e,a){const t={firstDay:!1,betweenDays:!1,lastDay:!1};if(e&&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 v(e,a=!1,t=[],n=[],r=!1){const u=s(t,e),{firstDay:o,lastDay:d,betweenDays:l}=c(n,e);return{"q-past-day":!0!==o&&!0!==l&&!0!==d&&!0!==u&&!0!==a&&e.past,"q-future-day":!0!==o&&!0!==l&&!0!==d&&!0!==u&&!0!==a&&e.future,"q-outside":a,"q-current-day":e.current,"q-selected":u,"q-range-first":!0===o,"q-range":!0===l,"q-range-last":!0===d,"q-range-hover":!0===r&&(!0===o||!0===d||!0===l),"q-disabled-day disabled":!0===e.disabled}}function p(e){return getStartOfWeek(e,r.weekdays,t.today)}function m(e){return getEndOfWeek(e,r.weekdays,t.today)}function y(e){}return{weekdaySkips:n,parsedStart:u,parsedEnd:o,dayFormatter:d,weekdayFormatter:l,ariaDateFormatter:i,arrayHasDate:s,checkDays:c,getRelativeClasses:v,startOfWeek:p,endOfWeek:m,dayStyleDefault:y}}function scrollTo(e,a){e===window?window.scrollTo(window.pageXOffset||window.scrollX||document.body.scrollLeft||0,a):e.scrollTop=a}function scrollToHorizontal(e,a){e===window?window.scrollTo(a,window.pageYOffset||window.scrollY||document.body.scrollTop||0):e.scrollLeft=a}function getVerticalScrollPosition(e){return e===window?window.pageYOffset||window.scrollY||document.body.scrollTop||0:e.scrollTop}function getHorizontalScrollPosition(e){return e===window?window.pageXOffset||window.scrollX||document.body.scrollLeft||0:e.scrollLeft}function animVerticalScrollTo(n,r,u=0){const o=void 0===arguments[3]?performance.now():arguments[3],d=getVerticalScrollPosition(n);u<=0?d!==r&&scrollTo(n,r):requestAnimationFrame(e=>{const a=e-o;const t=d+(r-d)/Math.max(a,u)*a;scrollTo(n,t);t!==r&&animVerticalScrollTo(n,r,u-a,e)})}function animHorizontalScrollTo(n,r,u=0){const o=void 0===arguments[3]?performance.now():arguments[3],d=getHorizontalScrollPosition(n);u<=0?d!==r&&scrollToHorizontal(n,r):requestAnimationFrame(e=>{const a=e-o;const t=d+(r-d)/Math.max(a,u)*a;setHorizontalScroll(n,t);t!==r&&animHorizontalScrollTo(n,r,u-a,e)})}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,Number],default:"id"},resourceLabel:{type:[String,Number],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,Number],default:"id"},resourceLabel:{type:[String,Number],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,{weekdaySkips:e,times:a,scrollArea:n,parsedStart:t,parsedEnd:r,maxDays:o,size:d,headerColumnRef:l}){const i=vue.computed(()=>parseInt(u.intervalStart,10)),v=vue.computed(()=>parseInt(u.intervalMinutes,10)),s=vue.computed(()=>parseInt(u.intervalCount,10)),p=vue.computed(()=>parseFloat(u.intervalHeight)),m=vue.computed(()=>{let e=0;u.cellWidth?e=u.cellWidth:d.width>0&&l.value&&(e=l.value.offsetWidth/(u.columnCount>1?u.columnCount:o.value));return e}),c=vue.computed(()=>i.value*v.value),y=vue.computed(()=>s.value*p.value),h=vue.computed(()=>s.value*m.value),f=vue.computed(()=>w(t.value)),g=vue.computed(()=>D(r.value)),_=vue.computed(()=>{return createDayList(t.value,r.value,a.today,e.value,u.disabledBefore,u.disabledAfter,u.disabledWeekdays,u.disabledDays,o.value)}),k=vue.computed(()=>{return _.value.map(e=>createIntervalList(e,i.value,v.value,s.value,a.now))});function w(e){return getStartOfWeek(e,u.weekdays,a.today)}function D(e){return getEndOfWeek(e,u.weekdays,a.today)}function b(e,a){return e&&e.length>0&&e.includes(getDateTime(a))}function T(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 I(e,a=[],t=[]){const n=b(a,e),{firstDay:r,lastDay:u,betweenDays:o}=T(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 x(e,a=0,t){return[]}const C=vue.computed(()=>{const t={timeZone:"UTC",hour12:!u.hour24Format,hour:"2-digit",minute:"2-digit"};const n={timeZone:"UTC",hour12:!u.hour24Format,hour:"numeric",minute:"2-digit"};const r={timeZone:"UTC",hour12:!u.hour24Format,hour:"numeric"};return createNativeLocaleFormatter(u.locale,(e,a)=>a?0===e.minute?r:n:t)}),S=vue.computed(()=>{const a={timeZone:"UTC",dateStyle:"full",timeStyle:"short"};return createNativeLocaleFormatter(u.locale,e=>a)});function F(e){const a=k.value[0][0],t=a.hour===e.hour&&a.minute===e.minute;return!t&&0===e.minute}function M(e){}function q(e){}function A(e,a,t=!1,n=void 0){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&&updateRelative(r,n,!0),r}function H(e,a,t=!1,n=void 0){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&&updateRelative(r,n,!0),r}function R(e,a,t=!1,n=void 0){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).clientX,s=(i-u.left)/m.value,c=Math.floor((t?Math.floor(s):s)*v.value);return 0!==c&&(r=addToDate(r,{minute:c})),n&&updateRelative(r,n,!0),r}function L(e,a){const t={timestamp:e};return t.timeStartPos=N,t.timeDurationHeight=E,void 0!==a&&(t.columnIndex=a),t}function P(e,a){const t={timestamp:copyTimestamp(e)};return t.timeStartPosX=O,t.timeDurationWidth=W,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 U(e,a=0){const t=O(e);return!(!1===t||!n.value)&&(animHorizontalScrollTo(n.value,t,a),!0)}function E(e){return e/v.value*p.value}function W(e){return e/v.value*m.value}function B(e){return parseInt(e,10)*v.value/p.value}function K(e){return parseInt(e,10)*v.value/m.value}function N(e,a=!0){const t=parseTime(e);if(!1===t)return!1;const n=c.value,r=s.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}function O(e,a=!0){const t=parseTime(e);if(!1===t)return!1;const n=c.value,r=s.value*v.value,u=(t-n)/r;let o=u*h.value;return a&&(o<0&&(o=0),o>h.value)&&(o=h.value),o}return{parsedIntervalStart:i,parsedIntervalMinutes:v,parsedIntervalCount:s,parsedIntervalHeight:p,parsedCellWidth:m,parsedStartMinute:c,bodyHeight:y,bodyWidth:h,parsedWeekStart:f,parsedWeekEnd:g,days:_,intervals:k,intervalFormatter:C,ariaDateTimeFormatter:S,arrayHasDateTime:b,checkIntervals:T,getIntervalClasses:I,getResourceClasses:x,showIntervalLabelDefault:F,showResourceLabelDefault:M,styleDefault:q,getTimestampAtEventInterval:A,getTimestampAtEvent:H,getTimestampAtEventX:R,getScopeForSlot:L,getScopeForSlotX:P,scrollToTime:V,scrollToTimeX:U,timeDurationHeight:E,timeDurationWidth:W,heightToMinutes:B,widthToMinutes:K,timeStartPos:N,timeStartPosX:O}}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.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,e=>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;let t=e;let 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),updateFormatted(n);break;case"month-interval":case"month-scheduler":case"month-agenda":t=getStartOfMonth(e),n=getEndOfMonth(e),updateFormatted(n),a=daysInMonth(t.year,t.month);break;case"resource":a=1,n=moveRelativeDays(copyTimestamp(n),nextDay,a,r.weekdays),updateFormatted(n);break}return{start:t,end:n,maxDays:a}});return{renderValues:e}}const toCamelCase=e=>e.replace(/(-\w)/g,e=>e[1].toUpperCase());let $listeners,$emit;function getMouseEventHandlers(e,t){const a={};for(const n in e){const r=e[n],u=toCamelCase("on-"+n);if(void 0===$listeners)return void console.warn("$listeners has not been set up");if(void 0!==$listeners.value[u]){const o="on"+r.event.charAt(0).toUpperCase()+r.event.slice(1),d=e=>{const a=e;(void 0===r.button||a.buttons>0&&a.button===r.button)&&(r.prevent&&a.preventDefault(),r.stop&&a.stopPropagation(),$emit(n,t(a,n)));return r.result};o in a?Array.isArray(a[o])?a[o].push(d):a[o]=[a[o],d]:a[o]=d}}return a}function getDefaultMouseEventHandlers(e,a){return getMouseEventHandlers(getMouseEventName(e),a)}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 useMouse(e,a){return $emit=e,$listeners=a,{getMouseEventHandlers:getMouseEventHandlers,getDefaultMouseEventHandlers:getDefaultMouseEventHandlers,getMouseEventName:getMouseEventName,getRawMouseEvents:getRawMouseEvents}}const useMoveEmits=["moved"];function useMove(d,{parsedView:l,parsedValue:i,weekdaySkips: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(i.value);const n=t>0,r=n?nextDay:prevDay,u=n?DAYS_IN_MONTH_MAX:DAY_MIN;let a=n?t:-t;c.value=n?"next":"prev";const o=s.value.filter(e=>0!==e).length;while(--a>=0)switch(l.value){case"month":e.day=u,r(e),updateWeekday(e);while(0===s.value[e.weekday])e=addToDate(e,{day:!0===n?1:-1});break;case"week":case"week-agenda":case"week-scheduler":relativeDays(e,r,o,d.weekdays);break;case"day":case"scheduler":case"agenda":relativeDays(e,r,v.value,d.weekdays);break;case"month-interval":case"month-agenda":case"month-scheduler":e.day=u,r(e);break;case"resource":relativeDays(e,r,v.value,d.weekdays);break}updateWeekday(e),updateFormatted(e),updateDayOfYear(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={};e.vnode&&e.vnode.props&&Object.keys(e.vnode.props).forEach(e=>{listenerRE.test(e)&&(a[e]=!0)});return a})}}function useFocusHelper(){const e={"aria-hidden":"true",class:"q-calendar__focus-helper"};return[vue.h("span",e)]}function useButton({focusable:e,focusType:a},t,n){const r=e&&a.includes("date");return vue.h("button",{...t,tabindex:r?0:-1},[n,r&&useFocusHelper()])}const useCellWidthProps={cellWidth:[Number,String]};function useCellWidth(e){const a=vue.computed(()=>void 0!==e.cellWidth);return{isSticky:a}}const useCheckChangeEmits=["change"];function useCheckChange(t,{days:n,lastStart:r,lastEnd:u}){function e(){if(n.value&&n.value.length>0){const e=n.value[0].date,a=n.value[n.value.length-1].date;if(null===r.value||null===u.value||e!==r.value||a!==u.value)return r.value=e,u.value=a,t("change",{start:e,end:a,days:n.value}),!0}return!1}return{checkChange:e}}function useEvents(){function e(a,{bubbles:t=!1,cancelable:n=!1}={}){try{return new CustomEvent(a,{bubbles:t,cancelable:n})}catch(e){const r=document.createEvent("Event");return r.initEvent(a,t,n),r}}function a(e,a){return[].concat(a).includes(e.keyCode)}return{createEvent:e,isKeyCode:a}}const isKeyCode=useEvents()["isKeyCode"],useNavigationProps={useNavigation:Boolean};function useKeyboard(t,{rootRef:n,focusRef:r,focusValue:u,datesRef:o,parsedView:d,emittedValue:l,weekdaySkips:i,direction:s,times:c}){let e=!1;function a(){!0!==e&&document&&(e=!0,document.addEventListener("keyup",h),document.addEventListener("keydown",y))}function v(){document&&(document.removeEventListener("keyup",h),document.removeEventListener("keydown",y),e=!1)}function p(e){if(void 0!==e&&document){const a=document.activeElement;if(a!==document.body&&!0===n.value.contains(a))return!0}return!1}function m(){let e=0;const a=setInterval(()=>{o.value[r.value]&&(o.value[r.value].focus(),50!==++e)&&document.activeElement!==o.value[r.value]||clearInterval(a)},250)}function y(e){p(e)&&isKeyCode(e,[33,34,35,36,37,38,39,40])&&(e.stopPropagation(),e.preventDefault())}function h(e){if(p(e)&&isKeyCode(e,[33,34,35,36,37,38,39,40]))switch(e.keyCode){case 33:w();break;case 34:D();break;case 35:T();break;case 36:b();break;case 37:_();break;case 38:f();break;case 39:k();break;case 40:g();break}}function f(e){let a=copyTimestamp(u.value);if("month"===d.value){if(a=addToDate(a,{day:-7}),u.value.month!==a.month)return s.value="prev",void(l.value=a.date)}else"day"!==d.value&&"week"!==d.value&&"month-interval"!==d.value||(a=addToDate(a,{minute:parseInt(t.intervalMinutes)}));s.value="prev",r.value=a.date}function g(e){let a=copyTimestamp(u.value);if("month"===d.value){if(a=addToDate(a,{day:7}),u.value.month!==a.month)return s.value="next",void(l.value=a.date)}else"day"!==d.value&&"week"!==d.value&&"month-interval"!==d.value||(a=addToDate(a,{minute:parseInt(t.intervalMinutes)}));s.value="next",r.value=a.date}function _(e){let a=copyTimestamp(u.value);s.value="prev";do{a=addToDate(a,{day:-1})}while(0===i.value[a.weekday]);if("month"===d.value||"month-interval"===d.value){if(u.value.month!==a.month)return void(l.value=a.date)}else if("week"===d.value){if(a.weekday>u.value.weekday)return void(l.value=a.date)}else if("day"===d.value)return void(l.value=a.date);r.value=a.date}function k(e){let a=copyTimestamp(u.value);s.value="next";do{a=addToDate(a,{day:1})}while(0===i.value[a.weekday]);if("month"===d.value||"month-interval"===d.value){if(u.value.month!==a.month)return void(l.value=a.date)}else if("week"===d.value){if(a.weekday<u.value.weekday)return void(l.value=a.date)}else if("day"===d.value)return void(l.value=a.date);r.value=a.date}function w(e){let a=copyTimestamp(u.value);if("month"===d.value||"month-interval"===d.value){a=addToDate(a,{month:-1});const t=a.day<=15?1:-1;while(0===i.value[a.weekday])a=addToDate(a,{day:t})}else"day"===d.value?a=addToDate(a,{day:-1}):"week"===d.value&&(a=addToDate(a,{day:-7}));s.value="prev",r.value=a.date}function D(e){let a=copyTimestamp(u.value);if("month"===d.value||"month-interval"===d.value){a=addToDate(a,{month:1});const t=a.day<=15?1:-1;while(0===i.value[a.weekday])a=addToDate(a,{day:t})}else"day"===d.value?a=addToDate(a,{day:1}):"week"===d.value&&(a=addToDate(a,{day:7}));s.value="next",r.value=a.date}function b(e){let a=copyTimestamp(u.value);"month"===d.value||"month-interval"===d.value?a=getStartOfMonth(a):"week"===d.value&&(a=getStartOfWeek(a,t.weekdays,c.today));while(0===i.value[a.weekday])a=addToDate(a,{day:-1});r.value=a.date}function T(e){let a=copyTimestamp(u.value);"month"===d.value||"month-interval"===d.value?a=getEndOfMonth(a):"week"===d.value&&(a=getEndOfWeek(a,t.weekdays,c.today));while(0===i.value[a.weekday])a=addToDate(a,{day:-1});r.value=a.date}return vue.onBeforeUnmount(()=>{v()}),vue.watch(()=>t.useNavigation,e=>{(!0===e?a:v)()}),!0===t.useNavigation&&a(),{startNavigation:a,endNavigation:v,tryFocus:m}}var QCalendarAgenda=vue.defineComponent({name:"QCalendarAgenda",directives:[ResizeObserver$1],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:A}){const e=vue.ref(null),H=vue.ref(null),R=vue.ref(null),m=vue.ref(null),a=vue.ref(null),y=vue.ref({}),t=vue.ref({}),n=vue.ref({}),o=vue.ref("next"),l=vue.ref(today()),i=vue.ref("0000-00-00"),s=vue.ref(0),c=vue.ref(v.modelValue),h=vue.reactive({width:0,height:0}),f=vue.ref(!1),L=vue.ref(null),P=vue.ref(null),r=(vue.watch(()=>v.view,()=>{s.value=0}),vue.computed(()=>{if("month"===v.view)return"month-interval";return v.view})),V=vue.getCurrentInstance();if(null===V)throw new Error("current instance is null");const U=useEmitListeners(V)["emitListeners"],g=useCellWidth(v)["isSticky"],{times:u,setCurrent:B,updateCurrent:K}=(vue.watch(g,e=>{}),useTimes(v)),{weekdaySkips:_,parsedStart:Y,parsedEnd:z,dayFormatter:X,weekdayFormatter:$,ariaDateFormatter:Q,dayStyleDefault:Z,getRelativeClasses:k}=(K(),B(),useCommon(v,{startDate:l,endDate:i,times:u})),w=vue.computed(()=>{return parseTimestamp(v.modelValue,u.now)||Y.value||u.today}),j=(a.value=w.value,m.value=w.value.date,useRenderValues(v,{parsedView:r,parsedValue:w,times:u}))["renderValues"],{rootRef:D,scrollWidth:G,__initCalendar:J,__renderCalendar:ee}=useCalendar(v,Ce,{scrollArea:e,pane:H}),{days:b,parsedCellWidth:ae,getScopeForSlot:T}=useInterval(v,{weekdaySkips:_,times:u,scrollArea:e,parsedStart:Y,parsedEnd:z,maxDays:s,size:h,headerColumnRef:R}),I=useMove(v,{parsedView:r,parsedValue:w,weekdaySkips:_,direction:o,maxDays:s,times:u,emittedValue:c,emit:d})["move"],x=useMouse(d,U)["getDefaultMouseEventHandlers"],te=useCheckChange(d,{days:b,lastStart:L,lastEnd:P})["checkChange"],ne=useEvents()["isKeyCode"],re=useKeyboard(v,{rootRef:D,focusRef:m,focusValue:a,datesRef:y,days:b,parsedView:r,parsedValue:w,emittedValue:c,weekdaySkips:_,direction:o,times:u})["tryFocus"],C=vue.computed(()=>{return b.value.length+(!0===S.value?v.leftColumnOptions.length:0)+(!0===F.value?v.rightColumnOptions.length:0)+b.value.length===1&&parseInt(v.columnCount,10)>0?parseInt(v.columnCount,10):0}),S=vue.computed(()=>{return void 0!==v.leftColumnOptions&&Array.isArray(v.leftColumnOptions)}),F=vue.computed(()=>{return void 0!==v.rightColumnOptions&&Array.isArray(v.rightColumnOptions)}),M=vue.computed(()=>{if(D.value){const e=h.width||D.value.getBoundingClientRect().width;if(e&&C.value)return(e-G.value)/C.value+"px"}return 100/C.value+"%"});function ue(){c.value=today()}function oe(e=1){I(e)}function de(e=1){I(-e)}function le({width:e,height:a}){h.width=e,h.height=a}function q(e){return e.date===c.value}function E(t,n){const e=p["head-column"],a={column:t,index:n,days:b.value},r=!0===g.value?v.cellWidth:M.value,u=!0===v.focusable&&v.focusType.includes("weekday"),o=void 0!==v.columnOptionsId?t[v.columnOptionsId]:void 0,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",a)?f.value=o:f.value="")},onDragover:e=>{void 0!==v.dragOverFunc&&"function"===typeof v.dragOverFunc&&(!0===v.dragOverFunc(e,"head-column",a)?f.value=o:f.value="")},onDragleave:e=>{void 0!==v.dragLeaveFunc&&"function"===typeof v.dragLeaveFunc&&(!0===v.dragLeaveFunc(e,"head-column",a)?f.value=o:f.value="")},onDrop:e=>{void 0!==v.dropFunc&&"function"===typeof v.dropFunc&&(!0===v.dropFunc(e,"head-column",a)?f.value=o:f.value="")},...x("-head-column",(e,a)=>{return{scope:{column:t,index:n},event:e}})},[!0!==v.noDefaultHeaderText&&ie(t),e&&e(a),useFocusHelper()])}function ie(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 se(){return vue.h("div",{roll:"presentation",class:{"q-calendar-agenda__head":!0,"q-calendar__sticky":!0===g.value},style:{marginRight:G.value+"px"}},[ce()])}function ce(){return vue.h("div",{ref:R,class:{"q-calendar-agenda__head--days__column":!0}},[ve(),pe()])}function ve(){return vue.h("div",{class:{"q-calendar-agenda__head--days__weekdays":!0}},[...me()])}function pe(){const e=p["head-days-events"];return vue.nextTick(()=>{if(n.value&&0===v.columnCount&&window)try{const e=window.getComputedStyle(n.value);t.value.parentElement.style.height=e.height,t.value.style.height=e.height}catch(e){}}),vue.h("div",{class:{"q-calendar-agenda__head--days__event":!0}},[e&&vue.h("div",{ref:t,style:{position:"absolute",left:0,top:0,right:0,overflow:"hidden",zIndex:1}},[e({scope:{days:b.value,ref:n}})]),...ye()])}function me(){return 1===b.value.length&&parseInt(v.columnCount,10)>0?[!0===S.value&&v.leftColumnOptions.map((e,a)=>E(e,a)),Array.apply(null,new Array(parseInt(v.columnCount,10))).map((e,a)=>a+parseInt(v.columnIndexStart,10)).map(e=>he(b.value[0],e)),!0===F.value&&v.rightColumnOptions.map((e,a)=>E(e,a))]:[!0===S.value&&v.leftColumnOptions.map((e,a)=>E(e,a)),b.value.map(e=>he(e)),!0===F.value&&v.rightColumnOptions.map((e,a)=>E(e,a))]}function ye(){return 1===b.value.length&&parseInt(v.columnCount,10)>0?[Array.apply(null,new Array(parseInt(v.columnCount,10))).map((e,a)=>a+parseInt(v.columnIndexStart,10)).map(e=>ge(b.value[0],e))]:b.value.map(e=>ge(e))}function he(a,e){const t=p["head-day"],n=p["head-date"],r=!0!==v.noActiveDate&&q(a),u=T(a,e),o=(u.activeDate=r,u.droppable=f.value===a.date,u.disabled=!!v.disabledWeekdays&&v.disabledWeekdays.includes(a.weekday),!0===g.value?v.cellWidth:M.value),d=v.weekdayStyle||Z,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",u)?f.value=a.date:f.value="")},onDragover:e=>{void 0!==v.dragOverFunc&&"function"===typeof v.dragOverFunc&&(!0===v.dragOverFunc(e,"head-day",u)?f.value=a.date:f.value="")},onDragleave:e=>{void 0!==v.dragLeaveFunc&&"function"===typeof v.dragLeaveFunc&&(!0===v.dragLeaveFunc(e,"head-day",u)?f.value=a.date:f.value="")},onDrop:e=>{void 0!==v.dropFunc&&"function"===typeof v.dropFunc&&(!0===v.dropFunc(e,"head-day",u)?f.value=a.date:f.value="")},onFocus:e=>{!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&&fe(a),void 0===t&&n&&n({scope:u}),useFocusHelper()])}function fe(e){return"stacked"===v.dateHeader?[!0!==v.noDefaultHeaderText&&W(e),!0!==v.noDefaultHeaderBtn&&N(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 ge(e,a){const t=p["head-day-event"],n=!0!==v.noActiveDate&&q(e),r=T(e,a),u=(r.activeDate=n,r.disabled=!!v.disabledWeekdays&&v.disabledWeekdays.includes(e.weekday),!0===g.value?v.cellWidth:M.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),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})||_e(e,v.shortWeekdayLabel))}function _e(e,a){const t=$.value(e,a||v.weekdayBreakpoints[0]>0&&ae.value<=v.weekdayBreakpoints[0]);return vue.h("span",{class:"q-calendar__ellipsis"},v.weekdayBreakpoints[1]>0&&ae.value<=v.weekdayBreakpoints[1]?minCharWidth(t,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,ke(e))}function ke(t){const e=!0!==v.noActiveDate&&q(t),a=X.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(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&&ne(e,[13,32])&&(e.stopPropagation(),e.preventDefault())},onKeyup:e=>{!0!==t.disabled&&ne(e,[13,32])&&(c.value=t.date,void 0!==U.value.onClickDate)&&d("click-date",{scope:u})},...x("-date",(e,a)=>{"click-date"!==a&&"contextmenu-date"!==a||(c.value=t.date,"click-date"===a&&e.preventDefault());return{scope:u,event:e}})};return!0!==v.noAria&&(o.ariaLabel=Q.value(t)),r?r({scope:u}):useButton(v,o,n?n({scope:u}):a)}function we(){return vue.h("div",{class:"q-calendar-agenda__body"},[De()])}function De(){return!0===g.value?vue.h("div",{ref:e,class:{"q-calendar-agenda__scroll-area":!0,"q-calendar__scroll":!0}},[Te()]):!0===v.noScroll?be():vue.h("div",{ref:e,class:{"q-calendar-agenda__scroll-area":!0,"q-calendar__scroll":!0}},[be()])}function be(){return vue.h("div",{ref:H,class:"q-calendar-agenda__pane"},[Te()])}function Te(){const e=p["day-container"];return vue.h("div",{class:"q-calendar-agenda__day-container"},[!0===g.value&&!0!==v.noHeader&&se(),vue.h("div",{style:{display:"flex",flexDirection:"row",height:"100%"}},[...Ie()]),e&&e({scope:{days:b.value}})])}function Ie(){return 1===b.value.length&&parseInt(v.columnCount,10)>0?[!0===S.value&&v.leftColumnOptions.map((e,a)=>O(e,a)),Array.apply(null,new Array(parseInt(v.columnCount,10))).map((e,a)=>a+parseInt(v.columnIndexStart,10)).map(e=>xe(b.value[0],0,e)),!0===F.value&&v.rightColumnOptions.map((e,a)=>O(e,a))]:[!0===S.value&&v.leftColumnOptions.map((e,a)=>O(e,a)),b.value.map((e,a)=>xe(e)),!0===F.value&&v.rightColumnOptions.map((e,a)=>O(e,a))]}function O(e,a){const t=p.column,n={column:e,days:b.value,index:a},r=!0===g.value?v.cellWidth:M.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",n)?f.value=o:f.value="")},onDragover:e=>{void 0!==v.dragOverFunc&&"function"===typeof v.dragOverFunc&&(!0===v.dragOverFunc(e,"column",n)?f.value=o:f.value="")},onDragleave:e=>{void 0!==v.dragLeaveFunc&&"function"===typeof v.dragLeaveFunc&&(!0===v.dragLeaveFunc(e,"column",n)?f.value=o:f.value="")},onDrop:e=>{void 0!==v.dropFunc&&"function"===typeof v.dropFunc&&(!0===v.dropFunc(e,"column",n)?f.value=o:f.value="")},...x("-column",(e,a)=>{return{scope:n,event:e}})},[t&&t({scope:n})])}function xe(e,a,t){const n=p.day,r=T(e,t),u=!0===g.value?v.cellWidth:M.value,o={width:u,maxWidth:u};return!0===g.value&&(o.minWidth=u),o.height=parseInt(v.dayHeight,10)>0?convertToUnit(parseInt(v.dayHeight,10)):"auto",parseInt(v.dayMinHeight,10)>0&&(o.minHeight=convertToUnit(parseInt(v.dayMinHeight,10))),vue.h("div",{key:e.date+(void 0!==t?":"+t:""),class:{"q-calendar-agenda__day":!0,...k(e)},style:o},[n&&n({scope:r})])}function Ce(){const{start:e,end:a,maxDays:t}=j.value,n=(l.value===e.date&&i.value===a.date&&s.value===t||(l.value=e.date,i.value=a.date,s.value=t),h.width>0),r=vue.withDirectives(vue.h("div",{class:"q-calendar-agenda",key:l.value},[!0===n&&!0!==g.value&&!0!==v.noHeader&&se(),!0===n&&we()]),[[ResizeObserver$1,le]]);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],te,{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&&(a.value=parseTimestamp(e))}),vue.watch(a,e=>{y.value[m.value]?y.value[m.value].focus():re()}),vue.watch(()=>v.maxDays,e=>{s.value=e}),vue.onBeforeUpdate(()=>{y.value={}}),vue.onMounted(()=>{J()}),A({prev:de,next:oe,move:I,moveToToday:ue,updateCurrent:K}),()=>ee()}}),QCalendarDay=vue.defineComponent({name:"QCalendarDay",directives:[ResizeObserver$1],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:c,expose:A}){const e=vue.ref(null),H=vue.ref(null),R=vue.ref(null),y=vue.ref(null),a=vue.ref(null),h=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),f=vue.ref(p.modelValue),s=vue.reactive({width:0,height:0}),g=vue.ref(!1),v=vue.ref(!1),L=vue.ref(null),P=vue.ref(null),r=(vue.watch(()=>p.view,()=>{i.value=0}),vue.computed(()=>{if("month"===p.view)return"month-interval";return p.view})),V=vue.getCurrentInstance();if(null===V)throw new Error("current instance is null");const _=useEmitListeners(V)["emitListeners"],k=useCellWidth(p)["isSticky"],{times:w,setCurrent:U,updateCurrent:B}=useTimes(p),{weekdaySkips:u,parsedStart:D,parsedEnd:K,dayFormatter:Y,weekdayFormatter:z,ariaDateFormatter:X,dayStyleDefault:$,getRelativeClasses:b}=(B(),U(),useCommon(p,{startDate:d,endDate:l,times:w})),T=vue.computed(()=>{return parseTimestamp(p.modelValue,w.now)||D.value||w.today}),Q=(a.value=T.value,y.value=T.value.date,useRenderValues