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