UNPKG

@sbh321/qcalendar

Version:

A forked version of Jeff Galbraith's fork of Quasar UI QCalendar

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