UNPKG

@sbh321/qcalendar

Version:

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

6 lines 117 kB
/*! * @subhambhandari/qcalendar v4.0.0-beta.19 * (c) 2024 Subham Bhandari <bhandarimaiya65@gmail.com> * Released under the MIT License. */ (function(e,a){"object"===typeof exports&&"undefined"!==typeof module?module.exports=a(require("vue")):"function"===typeof define&&define.amd?define(["vue"],a):(e="undefined"!==typeof globalThis?globalThis:e||self,e.QCalendar=a(e.Vue))})(this,function(ze){"use strict";const y=/^(\d{4})-(\d{1,2})(-(\d{1,2}))?([^\d]+(\d{1,2}))?(:(\d{1,2}))?(:(\d{1,2}))?(.(\d{1,3}))?$/,p=/^(\d{4})-(\d{1,2})(-(\d{1,2}))/,h=/(\d\d?)(:(\d\d?)|)(:(\d\d?)|)/,w=[0,31,28,31,30,31,30,31,31,30,31,30,31],k=[0,31,29,31,30,31,30,31,31,30,31,30,31],_=28,b=31,o=12,D=1,q=1,u=7,n=60,C=24,S=0,T=6e4,I=36e5,W=864e5,A=6048e5,H={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},L={hour:0,minute:0};function Xe(){const e=new Date,a=""+(e.getMonth()+1),t=""+e.getDate(),n=e.getFullYear();return[n,r(a,2),r(t,2)].join("-")}function z(e,a,t){let n=Z(e);if(1===n.day||0===n.weekday)while(!a.includes(n.weekday))n=m(n);return n=oe(n,a[0],de),n=f(n),t&&(n=Y(n,t,n.hasTime)),n}function X(e,a,t){let n=Z(e);const r=s(n.year,n.month);if(r===n.day||6===n.weekday)while(!a.includes(n.weekday))n=de(n);return n=oe(n,a[a.length-1],m),n=f(n),t&&(n=Y(n,t,n.hasTime)),n}function F(e){const a=Z(e);return a.day=q,f(a),a}function x(e){const a=Z(e);return a.day=s(a.year,a.month),f(a),a}function j(e){const a=Object.prototype.toString.call(e);switch(a){case"[object Number]":return e;case"[object String]":{const t=h.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 E(e){return!!y.exec(e)}function O(e,a){return JSON.stringify(e)===JSON.stringify(a)}function M(e,a){return re(e)===re(a)}function V(e,a){return d(e)===d(a)}function B(e,a){return je(e)===je(a)}function Ye(e){const a=y.exec(e);return a?{date:e,time:r(parseInt(a[6],10)||0,2)+":"+r(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 Ze(e,a){let t=Ye(e);return null===t?null:(t=f(t),a&&Y(t,a,t.hasTime),t)}function R(e,a=!1){const t=a?"UTC":"";return f({date:r(e[`get${t}FullYear`](),4)+"-"+r(e[`get${t}Month`]()+1,2)+"-"+r(e[`get${t}Date`](),2),time:r(e[`get${t}Hours`]()||0,2)+":"+r(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 $e(e){return 1e8*e.year+1e6*e.month+1e4*e.day}function i(e){return 100*e.hour+e.minute}function Qe(e){return $e(e)+i(e)}function N(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 Y(e,a,t=!1){let n=$e(a),r=$e(e),d=n===r;return e.hasTime&&t&&d&&(n=i(a),r=i(e),d=n===r),e.past=r<n,e.current=d,e.future=r>n,e.currentWeekday=e.weekday===a.weekday,e}function P(e,a,t){return e.hasTime=!0,e.hour=Math.floor(a/n),e.minute=a%n,e.time=d(e),t&&Y(e,t,!0),e}function K(e){return e.weekday=te(e),e}function U(e){return e.doy=ee(e),e}function G(e){return e.workweek=ae(e),e}function J(e,a,t,n,r){const d=$e(e);if(void 0!==a){const l=$e(Ye(a));d<=l&&(e.disabled=!0)}if(!0!==e.disabled&&void 0!==t){const o=$e(Ye(t));d>=o&&(e.disabled=!0)}if(!0!==e.disabled&&Array.isArray(n)&&n.length>0)for(const u in n)if(n[u]===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=Ye(r[i][0]),c=Ye(r[i][1]);if(he(e,s,c)){e.disabled=!0;break}}else{const v=$e(Ze(r[i]+" 00:00"));if(v===d){e.disabled=!0;break}}return e}function f(e){return e.hasTime=!0,e.time=d(e),e.date=re(e),e.weekday=te(e),e.doy=ee(e),e.workweek=ae(e),e}function ee(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 ae(e){0===e.year&&(e=Ze(Xe()));const a=ce(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()),d=(t.setHours(t.getHours()-r),(t-n)/A);return 1+Math.floor(d)}function te(e){let a=e.weekday;if(e.hasDay){const t=Math.floor,n=e.day,r=(e.month+9)%o+1,d=t(e.year/100),l=e.year%100-(e.month<=2?1:0);a=((n+t(2.6*r-.2)-2*d+l+t(l/4)+t(d/4))%7+7)%7}return a}function ne(e){return 1===(e%4===0^e%100===0^e%400===0)}function s(e,a){return(ne(e)?k:w)[a]}function Z(e){return{...e}}function r(e,a){let t=String(e);while(t.length<a)t="0"+t;return t}function re(e){let a=r(e.year,4)+"-"+r(e.month,2);return e.hasDay&&(a+="-"+r(e.day,2)),a}function d(e){return e.hasTime?r(e.hour,2)+":"+r(e.minute,2):""}function je(e){return re(e)+" "+(e.hasTime?d(e):"00:00")}function m(e){return++e.day,e.weekday=(e.weekday+1)%u,e.day>_&&e.day>s(e.year,e.month)&&(e.day=q,++e.month,e.month>o)&&(e.month=D,++e.year),e}function de(e){return e.day--,e.weekday=(e.weekday+6)%u,e.day<q&&(e.month--,e.month<D&&(e.year--,e.month=o),e.day=s(e.year,e.month)),e}function le(e,a=m,t=1,n=[0,1,2,3,4,5,6]){return g(e,a,t,n)}function g(e,a=m,t=1,n=[0,1,2,3,4,5,6]){n.includes(e.weekday)||0!==e.weekday||a!==m||++t;while(--t>=0)e=a(e),n.length<7&&!n.includes(e.weekday)&&++t;return e}function oe(e,a,t=m,n=6){while(e.weekday!==a&&--n>=0)e=t(e);return e}function ue(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<u;++t){let a=1;for(let e=1;e<u;++e){const r=(t+e)%u;if(n[r])break;++a}e[t]=n[t]*a}return e}function ie(e,a,t,n,r,d,l=[],o=[],u=42,i=0){const s=$e(a),c=[];let v=Z(e),y=0,p=y===s;if(!(s<$e(e)))while((!p||c.length<i)&&c.length<u){if(y=$e(v),p=p||y>s&&c.length>=i,p)break;if(0===n[v.weekday]);else{const h=Z(v);f(h),Y(h,t),J(h,r,d,l,o),c.push(h)}v=g(v,m)}return c}function se(a,t,n,r,d){const l=[];for(let e=0;e<r;++e){const o=(t+e)*n,u=Z(a);l.push(P(u,o,d))}return l}function $(n,r){const d=(e,a)=>"";return"undefined"===typeof Intl||"undefined"===typeof Intl.DateTimeFormat?d:(a,e)=>{try{const t=new Intl.DateTimeFormat(n||void 0,r(a,e));return t.format(ve(a))}catch(e){return console.error(`Intl.DateTimeFormat: ${e.message} -> `+je(a)),d}}}function ce(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 ve(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 a(e){return isFinite(parseInt(e,10))}function ye(e,a=!1){const t=!0===a?Qe:$e;return e.reduce((e,a)=>{return Math.max(t(e),t(a))===t(e)?e:a})}function pe(e,a=!1){const t=!0===a?Qe:$e;return e.reduce((e,a)=>{return Math.min(t(e),t(a))===t(e)?e:a})}function he(e,a,t,n){const r=$e(e)+(!0===n?i(e):0),d=$e(a)+(!0===n?i(a):0),l=$e(t)+(!0===n?i(t):0);return r>=d&&r<=l}function fe(e,a,t,n){const r=$e(e),d=$e(a),l=$e(t),o=$e(n);return r>=l&&r<=o||d>=l&&d<=o||l>=r&&d>=o}function Q(e,a){const n=Z(e);let r;return ge(a,(e,a)=>{if(void 0!==n[a]){n[a]+=parseInt(e,10);const t=me.indexOf(a);-1!==t&&(r=void 0===r?t:Math.min(t,r))}}),void 0!==r&&be(n,me[r]),f(n),n}const me=["minute","hour","day","month"];function ge(a,t){Object.keys(a).forEach(e=>t(a[e],e))}function we(e){if(e.minute>=n||e.minute<0){const a=Math.floor(e.minute/n);e.minute-=a*n,e.hour+=a,ke(e)}return e}function ke(e){if(e.hour>=C||e.hour<0){const a=Math.floor(e.hour/C);e.hour-=a*C,e.day+=a,_e(e)}return e}function _e(a){l(a);let t=s(a.year,a.month);if(a.day>t){++a.month,a.month>o&&l(a);let e=a.day-t;t=s(a.year,a.month);do{e>t&&(++a.month,a.month>o&&l(a),e-=t,t=s(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&&l(a),t=s(a.year,a.month);do{e>t&&(e-=t,--a.month,a.month<=0&&l(a),t=s(a.year,a.month))}while(e>t);a.day=t-e}return a}function l(e){if(e.month>o){const a=Math.floor(e.month/o);e.month=e.month%o,e.year+=a}else e.month<D&&(e.month+=o,--e.year);return e}function be(e,a){switch(a){case"minute":return we(e);case"hour":return ke(e);case"day":return _e(e);case"month":return l(e)}}function De(e,a){const t=N(e,a,!0);return Math.floor(t/W)}function qe(e,a){let t=Z(e),n=Z(a);return t=oe(t,0),n=oe(n,6),Math.ceil(De(t,n)/u)}const Fe={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 xe(){const r=(e,a)=>"",d={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,d[e]||d["long"]);return n.format(Fe[a])}catch(e){return console.error(`Intl.DateTimeFormat: ${e.message} -> day of week: `+a),r}}}function Ce(a,t){const e=Object.keys(Fe),n=xe();return e.map(e=>n(e,a,t))}function Se(){const d=(e,a)=>"",l={long:{timeZone:"UTC",month:"long"},short:{timeZone:"UTC",month:"short"},narrow:{timeZone:"UTC",month:"narrow"}};return"undefined"===typeof Intl||"undefined"===typeof Intl.DateTimeFormat?d:e;function e(a,e,t){try{const n=new Intl.DateTimeFormat(t||void 0,l[e]||l["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),d}}}function Te(a,t){const n=Se();return[...Array(12).keys()].map(e=>n(e,a,t))}function Ge(e,a="px"){if(null!=e&&""!==e)return isNaN(e)?String(e):"auto"===e?e:""+Number(e)+a}function Ie(a,t){for(let e=0;e<a.length;e++)if(!0===t(a[e],e))return e;return-1}function na(e,a){return 0===a?e:e.slice(0,a)}var Je={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 ea(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=ze.reactive({width:0,height:0}),d=ze.ref(null);function l({width:e,height:a}){r.width=e,r.height=a}const o=ze.computed(()=>{return!0!==a.noScroll&&e.value&&n.value&&r.height?e.value.offsetWidth-n.value.offsetWidth:0});function u(){}function i(){const e={ref:d,role:"complementary",lang:a.locale,class:`q-calendar ${a.dark?"q-calendar--dark":""} `+(a.bordered?"q-calendar__bordered":"")};return ze.withDirectives(ze.h("div",{...e},[t()]),[[Je,l]])}return{rootRef:d,scrollWidth:o,__initCalendar:u,__renderCalendar:i}}const e={modelValue:{type:String,default:Xe(),validator:e=>""===e||E(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 ra(r,{startDate:e,endDate:a,times:t}){const n=ze.computed(()=>ue(r.weekdays)),d=ze.computed(()=>Ze(e.value)),l=ze.computed(()=>{if("0000-00-00"===a.value)return p(d.value);return Ze(a.value)}),o=ze.computed(()=>{const t={timeZone:"UTC",day:"numeric"};return $(r.locale,(e,a)=>t)}),u=ze.computed(()=>{const t={timeZone:"UTC",weekday:"long"};const n={timeZone:"UTC",weekday:"short"};return $(r.locale,(e,a)=>a?n:t)}),i=ze.computed(()=>{const a={timeZone:"UTC",dateStyle:"full"};return $(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=$e(a),r=$e(Ye(e[0])),d=$e(Ye(e[1]));t.firstDay=r===n,t.lastDay=d===n,t.betweenDays=r<n&&d>n}return t}function v(e,a=!1,t=[],n=[],r=!1){const d=s(t,e),{firstDay:l,lastDay:o,betweenDays:u}=c(n,e);return{"q-past-day":!0!==l&&!0!==u&&!0!==o&&!0!==d&&!0!==a&&e.past,"q-future-day":!0!==l&&!0!==u&&!0!==o&&!0!==d&&!0!==a&&e.future,"q-outside":a,"q-current-day":e.current,"q-selected":d,"q-range-first":!0===l,"q-range":!0===u,"q-range-last":!0===o,"q-range-hover":!0===r&&(!0===l||!0===o||!0===u),"q-disabled-day disabled":!0===e.disabled}}function y(e){return z(e,r.weekdays,t.today)}function p(e){return X(e,r.weekdays,t.today)}function h(e){}return{weekdaySkips:n,parsedStart:d,parsedEnd:l,dayFormatter:o,weekdayFormatter:u,ariaDateFormatter:i,arrayHasDate:s,checkDays:c,getRelativeClasses:v,startOfWeek:y,endOfWeek:p,dayStyleDefault:h}}function We(e,a){e===window?window.scrollTo(window.pageXOffset||window.scrollX||document.body.scrollLeft||0,a):e.scrollTop=a}function Ae(e,a){e===window?window.scrollTo(a,window.pageYOffset||window.scrollY||document.body.scrollTop||0):e.scrollLeft=a}function He(e){return e===window?window.pageYOffset||window.scrollY||document.body.scrollTop||0:e.scrollTop}function Le(e){return e===window?window.pageXOffset||window.scrollX||document.body.scrollLeft||0:e.scrollLeft}function Ee(n,r,d=0){const l=void 0===arguments[3]?performance.now():arguments[3],o=He(n);d<=0?o!==r&&We(n,r):requestAnimationFrame(e=>{const a=e-l;const t=o+(r-o)/Math.max(a,d)*a;We(n,t);t!==r&&Ee(n,r,d-a,e)})}function Oe(n,r,d=0){const l=void 0===arguments[3]?performance.now():arguments[3],o=Le(n);d<=0?o!==r&&Ae(n,r):requestAnimationFrame(e=>{const a=e-l;const t=o+(r-o)/Math.max(a,d)*a;setHorizontalScroll(n,t);t!==r&&Oe(n,r,d-a,e)})}const Me={view:{type:String,validator:e=>["day","week","month","month-interval"].includes(e),default:"day"},shortIntervalLabel:Boolean,intervalHeight:{type:[Number,String],default:40,validator:a},intervalMinutes:{type:[Number,String],default:60,validator:a},intervalStart:{type:[Number,String],default:0,validator:a},intervalCount:{type:[Number,String],default:24,validator:a},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)}},Ve={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:a},resourceMinHeight:{type:[Number,String],default:70,validator:a},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)}},Be={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:a},dayMinHeight:{type:[Number,String],default:40,validator:a}},Re={modelResources:{type:Array},resourceKey:{type:[String,Number],default:"id"},resourceLabel:{type:[String,Number],default:"label"},resourceHeight:{type:[Number,String],default:0,validator:a},resourceMinHeight:{type:[Number,String],default:70,validator:a},resourceStyle:{type:Function,default:null},resourceClass:{type:Function,default:null},cellWidth:{type:[Number,String],default:100},intervalHeaderHeight:{type:[Number,String],default:20,validator:a},noSticky:Boolean};function da(d,{weekdaySkips:e,times:a,scrollArea:n,parsedStart:t,parsedEnd:r,maxDays:l,size:o,headerColumnRef:u}){const i=ze.computed(()=>parseInt(d.intervalStart,10)),v=ze.computed(()=>parseInt(d.intervalMinutes,10)),s=ze.computed(()=>parseInt(d.intervalCount,10)),y=ze.computed(()=>parseFloat(d.intervalHeight)),p=ze.computed(()=>{let e=0;d.cellWidth?e=d.cellWidth:o.width>0&&u.value&&(e=u.value.offsetWidth/(d.columnCount>1?d.columnCount:l.value));return e}),c=ze.computed(()=>i.value*v.value),h=ze.computed(()=>s.value*y.value),f=ze.computed(()=>s.value*p.value),m=ze.computed(()=>_(t.value)),g=ze.computed(()=>b(r.value)),w=ze.computed(()=>{return ie(t.value,r.value,a.today,e.value,d.disabledBefore,d.disabledAfter,d.disabledWeekdays,d.disabledDays,l.value)}),k=ze.computed(()=>{return w.value.map(e=>se(e,i.value,v.value,s.value,a.now))});function _(e){return z(e,d.weekdays,a.today)}function b(e){return X(e,d.weekdays,a.today)}function D(e,a){return e&&e.length>0&&e.includes(je(a))}function q(e,a){const t={firstDay:!1,betweenDays:!1,lastDay:!1};if(e&&2===e.length){const n=Qe(a),r=Qe(Ye(e[0])),d=Qe(Ye(e[1]));t.firstDay=r===n,t.lastDay=d===n,t.betweenDays=r<n&&d>n}return t}function F(e,a=[],t=[]){const n=D(a,e),{firstDay:r,lastDay:d,betweenDays:l}=q(t,e);return{"q-selected":n,"q-range-first":!0===r,"q-range":!0===l,"q-range-last":!0===d,"q-disabled-interval disabled":!0===e.disabled}}function x(e,a=0,t){return[]}const C=ze.computed(()=>{const t={timeZone:"UTC",hour12:!d.hour24Format,hour:"2-digit",minute:"2-digit"};const n={timeZone:"UTC",hour12:!d.hour24Format,hour:"numeric",minute:"2-digit"};const r={timeZone:"UTC",hour12:!d.hour24Format,hour:"numeric"};return $(d.locale,(e,a)=>a?0===e.minute?r:n:t)}),S=ze.computed(()=>{const a={timeZone:"UTC",dateStyle:"full",timeStyle:"short"};return $(d.locale,e=>a)});function T(e){const a=k.value[0][0],t=a.hour===e.hour&&a.minute===e.minute;return!t&&0===e.minute}function I(e){}function W(e){}function O(e,a,t=!1,n=void 0){let r=Z(a);const d=e.currentTarget.getBoundingClientRect(),l=e,o=e,u=l.changedTouches||l.touches,i=(u&&u[0]?u[0]:o).clientY,s=(i-d.top)/y.value,c=Math.floor((t?Math.floor(s):s)*v.value);return 0!==c&&(r=Q(r,{minute:c})),n&&Y(r,n,!0),r}function M(e,a,t=!1,n=void 0){let r=Z(a);const d=e.currentTarget.getBoundingClientRect(),l=e,o=e,u=l.changedTouches||l.touches,i=(u&&u[0]?u[0]:o).clientY,s=(i-d.top)/y.value,c=Math.floor((t?Math.floor(s):s)*v.value);return 0!==c&&(r=Q(r,{minute:c})),n&&Y(r,n,!0),r}function V(e,a,t=!1,n=void 0){let r=Z(a);const d=e.currentTarget.getBoundingClientRect(),l=e,o=e,u=l.changedTouches||l.touches,i=(u&&u[0]?u[0]:o).clientX,s=(i-d.left)/p.value,c=Math.floor((t?Math.floor(s):s)*v.value);return 0!==c&&(r=Q(r,{minute:c})),n&&Y(r,n,!0),r}function B(e,a){const t={timestamp:e};return t.timeStartPos=L,t.timeDurationHeight=A,void 0!==a&&(t.columnIndex=a),t}function R(e,a){const t={timestamp:Z(e)};return t.timeStartPosX=E,t.timeDurationWidth=H,void 0!==a&&(t.index=a),t}function N(e,a=0){const t=L(e);return!(!1===t||!n.value)&&(Ee(n.value,t,a),!0)}function P(e,a=0){const t=E(e);return!(!1===t||!n.value)&&(Oe(n.value,t,a),!0)}function A(e){return e/v.value*y.value}function H(e){return e/v.value*p.value}function K(e){return parseInt(e,10)*v.value/y.value}function U(e){return parseInt(e,10)*v.value/p.value}function L(e,a=!0){const t=j(e);if(!1===t)return!1;const n=c.value,r=s.value*v.value,d=(t-n)/r;let l=d*h.value;return a&&(l<0&&(l=0),l>h.value)&&(l=h.value),l}function E(e,a=!0){const t=j(e);if(!1===t)return!1;const n=c.value,r=s.value*v.value,d=(t-n)/r;let l=d*f.value;return a&&(l<0&&(l=0),l>f.value)&&(l=f.value),l}return{parsedIntervalStart:i,parsedIntervalMinutes:v,parsedIntervalCount:s,parsedIntervalHeight:y,parsedCellWidth:p,parsedStartMinute:c,bodyHeight:h,bodyWidth:f,parsedWeekStart:m,parsedWeekEnd:g,days:w,intervals:k,intervalFormatter:C,ariaDateTimeFormatter:S,arrayHasDateTime:D,checkIntervals:q,getIntervalClasses:F,getResourceClasses:x,showIntervalLabelDefault:T,showResourceLabelDefault:I,styleDefault:W,getTimestampAtEventInterval:O,getTimestampAtEvent:M,getTimestampAtEventX:V,getScopeForSlot:B,getScopeForSlotX:R,scrollToTime:N,scrollToTimeX:P,timeDurationHeight:A,timeDurationWidth:H,heightToMinutes:K,widthToMinutes:U,timeStartPos:L,timeStartPosX:E}}const Ne={columnCount:{type:[Number,String],default:0,validator:a},columnIndexStart:{type:[Number,String],default:0,validator:a}},Pe={maxDays:{type:Number,default:1}},t={now:{type:String,validator:e=>""===e||E(e),default:""}};function la(e){const a=ze.reactive({now:Ze("0000-00-00 00:00"),today:Ze("0000-00-00")}),t=ze.computed(()=>e.now?Ze(e.now):d());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||d();l(e,a.now),o(e,a.now),l(e,a.today)}function d(){return R(new Date)}function l(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 o(e,a){e.time!==a.time&&(a.hour=e.hour,a.minute=e.minute,a.time=e.time)}return ze.watch(()=>t,e=>r()),{times:a,parsedNow:t,setCurrent:n,updateCurrent:r,getNow:d,updateDay:l,updateTime:o}}function oa(r,{parsedView:d,parsedValue:l,times:o}){const e=ze.computed(()=>{const e=l.value;let a=r.maxDays;let t=e;let n=e;switch(d.value){case"month":t=F(e),n=x(e),a=s(t.year,t.month);break;case"week":case"week-agenda":case"week-scheduler":t=z(e,r.weekdays,o.today),n=X(t,r.weekdays,o.today),a=r.weekdays.length;break;case"day":case"scheduler":case"agenda":n=le(Z(n),m,a>1?a-1:a,r.weekdays),f(n);break;case"month-interval":case"month-scheduler":case"month-agenda":t=F(e),n=x(e),f(n),a=s(t.year,t.month);break;case"resource":a=1,n=le(Z(n),m,a,r.weekdays),f(n);break}return{start:t,end:n,maxDays:a}});return{renderValues:e}}const Ke=e=>e.replace(/(-\w)/g,e=>e[1].toUpperCase());let Ue,ua;function ia(e,t){const a={};for(const n in e){const r=e[n],d=Ke("on-"+n);if(void 0===Ue)return void console.warn("$listeners has not been set up");if(void 0!==Ue.value[d]){const l="on"+r.event.charAt(0).toUpperCase()+r.event.slice(1),o=e=>{const a=e;(void 0===r.button||a.buttons>0&&a.button===r.button)&&(r.prevent&&a.preventDefault(),r.stop&&a.stopPropagation(),ua(n,t(a,n)));return r.result};l in a?Array.isArray(a[l])?a[l].push(o):a[l]=[a[l],o]:a[l]=o}}return a}function sa(e,a){return ia(ca(e),a)}function ca(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 c(e){return Object.keys(ca(e))}function va(e,a){return ua=e,Ue=a,{getMouseEventHandlers:ia,getDefaultMouseEventHandlers:sa,getMouseEventName:ca,getRawMouseEvents:c}}const ya=["moved"];function pa(o,{parsedView:u,parsedValue:i,weekdaySkips:s,direction:c,maxDays:v,times:y,emittedValue:p,emit:h}){function e(t=1){if(0===t)p.value=Xe();else{let e=Z(i.value);const n=t>0,r=n?m:de,d=n?b:q;let a=n?t:-t;c.value=n?"next":"prev";const l=s.value.filter(e=>0!==e).length;while(--a>=0)switch(u.value){case"month":e.day=d,r(e),K(e);while(0===s.value[e.weekday])e=Q(e,{day:!0===n?1:-1});break;case"week":case"week-agenda":case"week-scheduler":g(e,r,l,o.weekdays);break;case"day":case"scheduler":case"agenda":g(e,r,v.value,o.weekdays);break;case"month-interval":case"month-agenda":case"month-scheduler":e.day=d,r(e);break;case"resource":g(e,r,v.value,o.weekdays);break}K(e),f(e),U(e),Y(e,y.now),p.value=e.date,h("moved",e)}}return{move:e}}const ha=/^on[A-Z]/;function fa(e=ze.getCurrentInstance()){return{emitListeners:ze.computed(()=>{const a={};e.vnode&&e.vnode.props&&Object.keys(e.vnode.props).forEach(e=>{ha.test(e)&&(a[e]=!0)});return a})}}function aa(){const e={"aria-hidden":"true",class:"q-calendar__focus-helper"};return[ze.h("span",e)]}function ma({focusable:e,focusType:a},t,n){const r=e&&a.includes("date");return ze.h("button",{...t,tabindex:r?0:-1},[n,r&&aa()])}const ga={cellWidth:[Number,String]};function wa(e){const a=ze.computed(()=>void 0!==e.cellWidth);return{isSticky:a}}const ka=["change"];function _a(t,{days:n,lastStart:r,lastEnd:d}){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===d.value||e!==r.value||a!==d.value)return r.value=e,d.value=a,t("change",{start:e,end:a,days:n.value}),!0}return!1}return{checkChange:e}}function ta(){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 ba=ta()["isKeyCode"],v={useNavigation:Boolean};function Da(t,{rootRef:n,focusRef:r,focusValue:d,datesRef:l,parsedView:o,emittedValue:u,weekdaySkips:i,direction:s,times:c}){let e=!1;function a(){!0!==e&&document&&(e=!0,document.addEventListener("keyup",f),document.addEventListener("keydown",h))}function v(){document&&(document.removeEventListener("keyup",f),document.removeEventListener("keydown",h),e=!1)}function y(e){if(void 0!==e&&document){const a=document.activeElement;if(a!==document.body&&!0===n.value.contains(a))return!0}return!1}function p(){let e=0;const a=setInterval(()=>{l.value[r.value]&&(l.value[r.value].focus(),50!==++e)&&document.activeElement!==l.value[r.value]||clearInterval(a)},250)}function h(e){y(e)&&ba(e,[33,34,35,36,37,38,39,40])&&(e.stopPropagation(),e.preventDefault())}function f(e){if(y(e)&&ba(e,[33,34,35,36,37,38,39,40]))switch(e.keyCode){case 33:_();break;case 34:b();break;case 35:q();break;case 36:D();break;case 37:w();break;case 38:m();break;case 39:k();break;case 40:g();break}}function m(e){let a=Z(d.value);if("month"===o.value){if(a=Q(a,{day:-7}),d.value.month!==a.month)return s.value="prev",void(u.value=a.date)}else"day"!==o.value&&"week"!==o.value&&"month-interval"!==o.value||(a=Q(a,{minute:parseInt(t.intervalMinutes)}));s.value="prev",r.value=a.date}function g(e){let a=Z(d.value);if("month"===o.value){if(a=Q(a,{day:7}),d.value.month!==a.month)return s.value="next",void(u.value=a.date)}else"day"!==o.value&&"week"!==o.value&&"month-interval"!==o.value||(a=Q(a,{minute:parseInt(t.intervalMinutes)}));s.value="next",r.value=a.date}function w(e){let a=Z(d.value);s.value="prev";do{a=Q(a,{day:-1})}while(0===i.value[a.weekday]);if("month"===o.value||"month-interval"===o.value){if(d.value.month!==a.month)return void(u.value=a.date)}else if("week"===o.value){if(a.weekday>d.value.weekday)return void(u.value=a.date)}else if("day"===o.value)return void(u.value=a.date);r.value=a.date}function k(e){let a=Z(d.value);s.value="next";do{a=Q(a,{day:1})}while(0===i.value[a.weekday]);if("month"===o.value||"month-interval"===o.value){if(d.value.month!==a.month)return void(u.value=a.date)}else if("week"===o.value){if(a.weekday<d.value.weekday)return void(u.value=a.date)}else if("day"===o.value)return void(u.value=a.date);r.value=a.date}function _(e){let a=Z(d.value);if("month"===o.value||"month-interval"===o.value){a=Q(a,{month:-1});const t=a.day<=15?1:-1;while(0===i.value[a.weekday])a=Q(a,{day:t})}else"day"===o.value?a=Q(a,{day:-1}):"week"===o.value&&(a=Q(a,{day:-7}));s.value="prev",r.value=a.date}function b(e){let a=Z(d.value);if("month"===o.value||"month-interval"===o.value){a=Q(a,{month:1});const t=a.day<=15?1:-1;while(0===i.value[a.weekday])a=Q(a,{day:t})}else"day"===o.value?a=Q(a,{day:1}):"week"===o.value&&(a=Q(a,{day:7}));s.value="next",r.value=a.date}function D(e){let a=Z(d.value);"month"===o.value||"month-interval"===o.value?a=F(a):"week"===o.value&&(a=z(a,t.weekdays,c.today));while(0===i.value[a.weekday])a=Q(a,{day:-1});r.value=a.date}function q(e){let a=Z(d.value);"month"===o.value||"month-interval"===o.value?a=x(a):"week"===o.value&&(a=X(a,t.weekdays,c.today));while(0===i.value[a.weekday])a=Q(a,{day:-1});r.value=a.date}return ze.onBeforeUnmount(()=>{v()}),ze.watch(()=>t.useNavigation,e=>{(!0===e?a:v)()}),!0===t.useNavigation&&a(),{startNavigation:a,endNavigation:v,tryFocus:p}}var qa=ze.defineComponent({name:"QCalendarAgenda",directives:[Je],props:{...e,...Be,...Ne,...Pe,...t,...ga,...v},emits:["update:model-value",...ka,...ya,...c("-date"),...c("-head-day"),...c("-time")],setup(v,{slots:y,emit:o,expose:O}){const e=ze.ref(null),M=ze.ref(null),V=ze.ref(null),p=ze.ref(null),a=ze.ref(null),h=ze.ref({}),t=ze.ref({}),n=ze.ref({}),l=ze.ref("next"),u=ze.ref(Xe()),i=ze.ref("0000-00-00"),s=ze.ref(0),c=ze.ref(v.modelValue),f=ze.reactive({width:0,height:0}),m=ze.ref(!1),B=ze.ref(null),R=ze.ref(null),r=(ze.watch(()=>v.view,()=>{s.value=0}),ze.computed(()=>{if("month"===v.view)return"month-interval";return v.view})),N=ze.getCurrentInstance();if(null===N)throw new Error("current instance is null");const P=fa(N)["emitListeners"],g=wa(v)["isSticky"],{times:d,setCurrent:K,updateCurrent:U}=(ze.watch(g,e=>{}),la(v)),{weekdaySkips:w,parsedStart:z,parsedEnd:X,dayFormatter:Y,weekdayFormatter:Z,ariaDateFormatter:$,dayStyleDefault:Q,getRelativeClasses:k}=(U(),K(),ra(v,{startDate:u,endDate:i,times:d})),_=ze.computed(()=>{return Ze(v.modelValue,d.now)||z.value||d.today}),j=(a.value=_.value,p.value=_.value.date,oa(v,{parsedView:r,parsedValue:_,times:d}))["renderValues"],{rootRef:b,scrollWidth:G,__initCalendar:J,__renderCalendar:ee}=ea(v,Ce,{scrollArea:e,pane:M}),{days:D,parsedCellWidth:ae,getScopeForSlot:q}=da(v,{weekdaySkips:w,times:d,scrollArea:e,parsedStart:z,parsedEnd:X,maxDays:s,size:f,headerColumnRef:V}),F=pa(v,{parsedView:r,parsedValue:_,weekdaySkips:w,direction:l,maxDays:s,times:d,emittedValue:c,emit:o})["move"],x=va(o,P)["getDefaultMouseEventHandlers"],te=_a(o,{days:D,lastStart:B,lastEnd:R})["checkChange"],ne=ta()["isKeyCode"],re=Da(v,{rootRef:b,focusRef:p,focusValue:a,datesRef:h,days:D,parsedView:r,parsedValue:_,emittedValue:c,weekdaySkips:w,direction:l,times:d})["tryFocus"],C=ze.computed(()=>{return D.value.length+(!0===S.value?v.leftColumnOptions.length:0)+(!0===T.value?v.rightColumnOptions.length:0)+D.value.length===1&&parseInt(v.columnCount,10)>0?parseInt(v.columnCount,10):0}),S=ze.computed(()=>{return void 0!==v.leftColumnOptions&&Array.isArray(v.leftColumnOptions)}),T=ze.computed(()=>{return void 0!==v.rightColumnOptions&&Array.isArray(v.rightColumnOptions)}),I=ze.computed(()=>{if(b.value){const e=f.width||b.value.getBoundingClientRect().width;if(e&&C.value)return(e-G.value)/C.value+"px"}return 100/C.value+"%"});function de(){c.value=Xe()}function le(e=1){F(e)}function oe(e=1){F(-e)}function ue({width:e,height:a}){f.width=e,f.height=a}function W(e){return e.date===c.value}function A(t,n){const e=y["head-column"],a={column:t,index:n,days:D.value},r=!0===g.value?v.cellWidth:I.value,d=!0===v.focusable&&v.focusType.includes("weekday"),l=void 0!==v.columnOptionsId?t[v.columnOptionsId]:void 0,o={maxWidth:r,width:r};return ze.h("div",{key:l,tabindex:!0===d?0:-1,class:{"q-calendar-agenda__head--day":!0,"q-column-day":!0,"q-calendar__hoverable":!0===v.hoverable,"q-calendar__focusable":!0===d},style:o,onDragenter:e=>{void 0!==v.dragEnterFunc&&"function"===typeof v.dragEnterFunc&&(!0===v.dragEnterFunc(e,"head-column",a)?m.value=l:m.value="")},onDragover:e=>{void 0!==v.dragOverFunc&&"function"===typeof v.dragOverFunc&&(!0===v.dragOverFunc(e,"head-column",a)?m.value=l:m.value="")},onDragleave:e=>{void 0!==v.dragLeaveFunc&&"function"===typeof v.dragLeaveFunc&&(!0===v.dragLeaveFunc(e,"head-column",a)?m.value=l:m.value="")},onDrop:e=>{void 0!==v.dropFunc&&"function"===typeof v.dropFunc&&(!0===v.dropFunc(e,"head-column",a)?m.value=l:m.value="")},...x("-head-column",(e,a)=>{return{scope:{column:t,index:n},event:e}})},[!0!==v.noDefaultHeaderText&&ie(t),e&&e(a),aa()])}function ie(e){const a=y["head-column-label"],t={column:e},n=void 0!==v.columnOptionsLabel?e[v.columnOptionsLabel]:e.label,r=ze.h("div",{class:{"q-calendar-agenda__head--weekday":!0,["q-calendar__"+v.weekdayAlign]:!0,ellipsis:!0},style:{alignSelf:"center"}},[a&&a({scope:t}),!a&&ze.h("span",{class:"ellipsis"},n)]);return"stacked"===v.dateHeader?r:ze.h("div",{class:"q-calendar__header--inline",style:{height:"100%"}},[r])}function se(){return ze.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 ze.h("div",{ref:V,class:{"q-calendar-agenda__head--days__column":!0}},[ve(),ye()])}function ve(){return ze.h("div",{class:{"q-calendar-agenda__head--days__weekdays":!0}},[...pe()])}function ye(){const e=y["head-days-events"];return ze.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){}}),ze.h("div",{class:{"q-calendar-agenda__head--days__event":!0}},[e&&ze.h("div",{ref:t,style:{position:"absolute",left:0,top:0,right:0,overflow:"hidden",zIndex:1}},[e({scope:{days:D.value,ref:n}})]),...he()])}function pe(){return 1===D.value.length&&parseInt(v.columnCount,10)>0?[!0===S.value&&v.leftColumnOptions.map((e,a)=>A(e,a)),Array.apply(null,new Array(parseInt(v.columnCount,10))).map((e,a)=>a+parseInt(v.columnIndexStart,10)).map(e=>fe(D.value[0],e)),!0===T.value&&v.rightColumnOptions.map((e,a)=>A(e,a))]:[!0===S.value&&v.leftColumnOptions.map((e,a)=>A(e,a)),D.value.map(e=>fe(e)),!0===T.value&&v.rightColumnOptions.map((e,a)=>A(e,a))]}function he(){return 1===D.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(D.value[0],e))]:D.value.map(e=>ge(e))}function fe(a,e){const t=y["head-day"],n=y["head-date"],r=!0!==v.noActiveDate&&W(a),d=q(a,e),l=(d.activeDate=r,d.droppable=m.value===a.date,d.disabled=!!v.disabledWeekdays&&v.disabledWeekdays.includes(a.weekday),!0===g.value?v.cellWidth:I.value),o=v.weekdayStyle||Q,u={width:l,maxWidth:l,...o({scope:d})},i=(!0===g.value&&(u.minWidth=l),"function"===typeof v.weekdayClass?v.weekdayClass({scope:d}):{}),s=!0===v.focusable&&v.focusType.includes("weekday"),c={key:a.date+(void 0!==e?"-"+e:""),ref:e=>{h.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:u,onDragenter:e=>{void 0!==v.dragEnterFunc&&"function"===typeof v.dragEnterFunc&&(!0===v.dragEnterFunc(e,"head-day",d)?m.value=a.date:m.value="")},onDragover:e=>{void 0!==v.dragOverFunc&&"function"===typeof v.dragOverFunc&&(!0===v.dragOverFunc(e,"head-day",d)?m.value=a.date:m.value="")},onDragleave:e=>{void 0!==v.dragLeaveFunc&&"function"===typeof v.dragLeaveFunc&&(!0===v.dragLeaveFunc(e,"head-day",d)?m.value=a.date:m.value="")},onDrop:e=>{void 0!==v.dropFunc&&"function"===typeof v.dropFunc&&(!0===v.dropFunc(e,"head-day",d)?m.value=a.date:m.value="")},onFocus:e=>{!0===s&&(p.value=a.date)},...x("-head-day",e=>{return{scope:d,event:e}})};return ze.h("div",c,[void 0!==t&&t({scope:d}),void 0===t&&me(a),void 0===t&&n&&n({scope:d}),aa()])}function me(e){return"stacked"===v.dateHeader?[!0!==v.noDefaultHeaderText&&H(e),!0!==v.noDefaultHeaderBtn&&L(e)]:"inline"===v.dateHeader?("left"===v.weekdayAlign&&"right"===v.dateAlign||"right"===v.weekdayAlign&&v.dateAlign,ze.h("div",{class:"q-calendar__header--inline"},[!0!==v.noDefaultHeaderText&&H(e),!0!==v.noDefaultHeaderBtn&&L(e)])):"inverted"===v.dateHeader?("left"===v.weekdayAlign&&"right"===v.dateAlign||"right"===v.weekdayAlign&&v.dateAlign,ze.h("div",{class:"q-calendar__header--inline"},[!0!==v.noDefaultHeaderBtn&&L(e),!0!==v.noDefaultHeaderText&&H(e)])):void 0}function ge(e,a){const t=y["head-day-event"],n=!0!==v.noActiveDate&&W(e),r=q(e,a),d=(r.activeDate=n,r.disabled=!!v.disabledWeekdays&&v.disabledWeekdays.includes(e.weekday),!0===g.value?v.cellWidth:I.value),l={width:d,maxWidth:d};return!0===g.value&&(l.minWidth=d),ze.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:l},[t&&t({scope:r})])}function H(e){const a=y["head-weekday-label"],t=q(e),n=(t.shortWeekdayLabel=v.shortWeekdayLabel,{class:{"q-calendar-agenda__head--weekday":!0,["q-calendar__"+v.weekdayAlign]:!0,"q-calendar__ellipsis":!0}});return ze.h("div",n,a&&a({scope:t})||we(e,v.shortWeekdayLabel))}function we(e,a){const t=Z.value(e,a||v.weekdayBreakpoints[0]>0&&ae.value<=v.weekdayBreakpoints[0]);return ze.h("span",{class:"q-calendar__ellipsis"},v.weekdayBreakpoints[1]>0&&ae.value<=v.weekdayBreakpoints[1]?na(t,v.minWeekdayLabel):t)}function L(e){const a={class:{"q-calendar-agenda__head--date":!0,["q-calendar__"+v.dateAlign]:!0}};return ze.h("div",a,ke(e))}function ke(t){const e=!0!==v.noActiveDate&&W(t),a=Y.value(t,!1),n=y["head-day-label"],r=y["head-day-button"],d={dayLabel:a,timestamp:t,activeDate:e,disabled:!!v.disabledWeekdays&&v.disabledWeekdays.includes(t.weekday)},l={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!==P.value.onClickDate)&&o("click-date",{scope:d})},...x("-date",(e,a)=>{"click-date"!==a&&"contextmenu-date"!==a||(c.value=t.date,"click-date"===a&&e.preventDefault());return{scope:d,event:e}})};return!0!==v.noAria&&(l.ariaLabel=$.value(t)),r?r({scope:d}):ma(v,l,n?n({scope:d}):a)}function _e(){return ze.h("div",{class:"q-calendar-agenda__body"},[be()])}function be(){return!0===g.value?ze.h("div",{ref:e,class:{"q-calendar-agenda__scroll-area":!0,"q-calendar__scroll":!0}},[qe()]):!0===v.noScroll?De():ze.h("div",{ref:e,class:{"q-calendar-agenda__scroll-area":!0,"q-calendar__scroll":!0}},[De()])}function De(){return ze.h("div",{ref:M,class:"q-calendar-agenda__pane"},[qe()])}function qe(){const e=y["day-container"];return ze.h("div",{class:"q-calendar-agenda__day-container"},[!0===g.value&&!0!==v.noHeader&&se(),ze.h("div",{style:{display:"flex",flexDirection:"row",height:"100%"}},[...Fe()]),e&&e({scope:{days:D.value}})])}function Fe(){return 1===D.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=>xe(D.value[0],0,e)),!0===T.value&&v.rightColumnOptions.map((e,a)=>E(e,a))]:[!0===S.value&&v.leftColumnOptions.map((e,a)=>E(e,a)),D.value.map((e,a)=>xe(e)),!0===T.value&&v.rightColumnOptions.map((e,a)=>E(e,a))]}function E(e,a){const t=y.column,n={column:e,days:D.value,index:a},r=!0===g.value?v.cellWidth:I.value,d=!0===v.focusable&&v.focusType.includes("day"),l=void 0!==v.columnOptionsId?e[v.columnOptionsId]:void 0;return ze.h("div",{key:l,tabindex:!0===d?0:-1,class:{"q-calendar-agenda__day":!0,"q-column-day":!0,"q-calendar__hoverable":!0===v.hoverable,"q-calendar__focusable":!0===d},style:{maxWidth:r,width:r},onDragenter:e=>{void 0!==v.dragEnterFunc&&"function"===typeof v.dragEnterFunc&&(!0===v.dragEnterFunc(e,"column",n)?m.value=l:m.value="")},onDragover:e=>{void 0!==v.dragOverFunc&&"function"===typeof v.dragOverFunc&&(!0===v.dragOverFunc(e,"column",n)?m.value=l:m.value="")},onDragleave:e=>{void 0!==v.dragLeaveFunc&&"function"===typeof v.dragLeaveFunc&&(!0===v.dragLeaveFunc(e,"column",n)?m.value=l:m.value="")},onDrop:e=>{void 0!==v.dropFunc&&"function"===typeof v.dropFunc&&(!0===v.dropFunc(e,"column",n)?m.value=l:m.value="")},...x("-column",(e,a)=>{return{scope:n,event:e}})},[t&&t({scope:n})])}function xe(e,a,t){const n=y.day,r=q(e,t),d=!0===g.value?v.cellWidth:I.value,l={width:d,maxWidth:d};return!0===g.value&&(l.minWidth=d),l.height=parseInt(v.dayHeight,10)>0?Ge(parseInt(v.dayHeight,10)):"auto",parseInt(v.dayMinHeight,10)>0&&(l.minHeight=Ge(parseInt(v.dayMinHeight,10))),ze.h("div",{key:e.date+(void 0!==t?":"+t:""),class:{"q-calendar-agenda__day":!0,...k(e)},style:l},[n&&n({scope:r})])}function Ce(){const{start:e,end:a,maxDays:t}=j.value,n=(u.value===e.date&&i.value===a.date&&s.value===t||(u.value=e.date,i.value=a.date,s.value=t),f.width>0),r=ze.withDirectives(ze.h("div",{class:"q-calendar-agenda",key:u.value},[!0===n&&!0!==g.value&&!0!==v.noHeader&&se(),!0===n&&_e()]),[[Je,ue]]);if(!0!==v.animated)return r;{const d="q-calendar--"+("prev"===l.value?v.transitionPrev:v.transitionNext);return ze.h(ze.Transition,{name:d,appear:!0},()=>r)}}return ze.watch([D],te,{deep:!0,immediate:!0}),ze.watch(()=>v.modelValue,(e,a)=>{if(c.value!==e){if(!0===v.animated){const t=$e(Ye(e)),n=$e(Ye(a));l.value=t>=n?"next":"prev"}c.value=e}p.value=e}),ze.watch(c,(e,a)=>{if(c.value!==v.modelValue){if(!0===v.animated){const t=$e(Ye(e)),n=$e(Ye(a));l.value=t>=n?"next":"prev"}o("update:model-value",e)}}),ze.watch(p,e=>{e&&(a.value=Ze(e))}),ze.watch(a,e=>{h.value[p.value]?h.value[p.value].focus():re()}),ze.watch(()=>v.maxDays,e=>{s.value=e}),ze.onBeforeUpdate(()=>{h.value={}}),ze.onMounted(()=>{J()}),O({prev:oe,next:le,move:F,moveToToday:de,updateCurrent:U}),()=>ee()}}),Fa=ze.defineComponent({name:"QCalendarDay",directives:[Je],props:{...e,...Me,...Ne,...Pe,...t,...ga,...v},emits:["update:model-value",...ka,...ya,...c("-date"),...c("-interval"),...c("-head-intervals"),...c("-head-day"),...c("-time")],setup(y,{slots:p,emit:c,expose:O}){const e=ze.ref(null),M=ze.ref(null),V=ze.ref(null),h=ze.ref(null),a=ze.ref(null),f=ze.ref({}),t=ze.ref({}),n=ze.ref({}),l=ze.ref("next"),o=ze.ref(y.modelValue||Xe()),u=ze.ref("0000-00-00"),i=ze.ref(0),m=ze.ref(y.modelValue),s=ze.reactive({width:0,height:0}),g=ze.ref(!1),v=ze.ref(!1),B=ze.ref(null),R=ze.ref(null),r=(ze.watch(()=>y.view,()=>{i.value=0}),ze.computed(()=>{if("month"===y.view)return"month-interval";return y.view})),N=ze.getCurrentInstance();if(null===N)throw new Error("current instance is null");const w=fa(N)["emitListeners"],k=wa(y)["isSticky"],{times:_,setCurrent:P,updateCurrent:K}=la(y),{weekdaySkips:d,parsedStart:b,parsedEnd:U,dayFormatter:z,weekdayFormatter:X,ariaDateFormatter:Y,dayStyleDefault:Z,getRelativeClasses:D}=(K(),P(),ra(y,{startDate:o,endDate:u,times:_})),q=ze.computed(()=>{return Ze(y.modelValue,_.now)||b.value||_.today}),$=(a.value=q.value,h.value=q.value.date,oa(y,{parsedView:r,parsedValue:q,times:_}))["renderValues"],{rootRef:F,scrollWidth:Q,__initCalendar:j,__renderCalendar:G}=ea(y,Ue,{scrollArea:e,pane:M}),{days:x,intervals:J,intervalFormatter:ee,ariaDateTimeFormatter:ae,parsedCellWidth:C,getIntervalClasses:te,showIntervalLabelDefault:ne,styleDefault:re,getTimestampAtEventInterval:de,getTimestampAtEvent:le,getScopeForSlot:S,scrollToTime:oe,heightToMinutes:ue,timeDurationHeight:ie,timeStartPos:se}=da(y,{weekdaySkips:d,times:_,scrollArea:e,parsedStart:b,parsedEnd:U,maxDays:i,size:s,headerColumnRef:V}),T=pa(y,{parsedView:r,parsedValue:q,weekdaySkips:d,direction:l,maxDays:i,times:_,emittedValue:m,emit:c})["move"],I=va(c,w)["getDefaultMouseEventHandlers"],ce=_a(c,{days:x,lastStart:B,lastEnd:R})["checkChange"],W=ta()["isKeyCode"],ve=Da(y,{rootRef:F,focusRef:h,focusValue:a,datesRef:f,days:x,parsedView:r,parsedValue:q,emittedValue:m,weekdaySkips:d,direction:l,times:_})["tryFocus"],A=ze.computed(()=>{{if("day"===r.value&&parseInt(y.columnCount,10)>1)return parseInt(y.columnCount,10);if("day"===r.value&&y.maxDays&&y.maxDays>1)return y.maxDays}return x.value.length}),ye=ze.computed(()=>{if(F.value)return parseInt(getComputedStyle(F.value).getPropertyValue("--calendar-intervals-width"),10);return 0}),H=ze.computed(()=>{if(F.value){const e=s.width||F.value.getBoundingClientRect().width;if(e&&ye.value&&A.value)return(e-Q.value-ye.value)/A.value+"px"}return 100/A.value+"%"});function pe(){m.value=Xe()}function he(e=1){T(e)}function fe(e=1){T(-e)}function me({width:e,height:a}){s.width=e,s.height=a}function L(e){return e.date===m.value}function ge(){return ze.h("div",{roll:"presentation",class:{"q-calendar-day__head":!0,"q-calendar__sticky":!0===k.value},style:{marginRight:Q.value+"px"}},[we(),ke()])}function we(){const e=p["head-intervals"],a={timestamps:x.value,days:x.value,date:y.modelValue};return ze.h("div",{class:{"q-calendar-day__head--intervals":!0,"q-calendar__sticky":!0===k.value},...I("-head-intervals",e=>{return{scope:a,event:e}})},[e&&e({scope:a})])}function ke(){return ze.h("div",{ref:V,class:{"q-calendar-day__head--days__column":!0}},[_e(),be()])}function _e(){return ze.h("div",{class:{"q-calendar-day__head--days__weekdays":!0}},[...De()])}function be(){const e=p["head-days-events"];return ze.nextTick(()=>{if(n.value&&0===parseInt(y.columnCount,10)&&window)try{const e=window.getComputedStyle(n.value);t.value.parentElement.style.height=e.height,t.value.style.height=e.height}catch(e){}}),ze.h("div",{class:{"q-calendar-day__head--days__event":!0}},[e&&ze.h("div",{ref:t,style:{position:"absolute",left:0,top:0,right:0,overflow:"hidden",zIndex:1}},[e({scope:{days:x.value,ref:n}})]),...qe()])}function De(){return 1===x.value.length&&parseInt(y.columnCount,10)>0?Array.apply(null,new Array(parseInt(y.columnCount,10))).map((e,a)=>a+parseInt(y.columnIndexStart,10)).map(e=>Fe(x.value[0],e)):x.value.map(e=>Fe(e))}function qe(){return 1===x.value.length&&parseInt(y.columnCount,10)>0?Array.apply(null,new Array(parseInt(y.columnCount,10))).map((e,a)=>a+parseInt(y.columnIndexStart,10)).map(e=>Ce(x.value[0],e)):x.value.map(e=>Ce(e))}function Fe(a,e){const t=p["head-day"],n=p["head-date"],r=!0!==y.noActiveDate&&L(a),d=S(a,e),l=(d.activeDate=r,d.droppable=g.value===a.date,d.disabled=!!y.disabledWeekdays&&y.disabledWeekdays.includes(a.weekday),!0===k.value?y.cellWidth:H.value),o=y.weekdayStyle||Z,u={width:l,maxWidth:l,minWidth:l,...o({scope:d})},i=(!0===k.value&&(u.minWidth=l),"function"===typeof y.weekdayClass?y.weekdayClass({scope:d}):{}),s=!0===y.focusable&&y.focusType.includes("weekday"),c=a.date+(void 0!==e?"-"+e:""),v={key:c,ref:e=>{f.value[c]=e},tabindex:!0===s?0:-1,class:{"q-calendar-day__head--day":!0,...i,...D(a),"q-active-date":r,"q-calendar__hoverable":!0===y.hoverable,"q-calendar__focusable":!0===s},style:u,onFocus:e=>{!0===s&&(h.value=c)},onKeydown:e=>{!0!==a.disabled&&W(e,[13,32])&&(e.stopPropagation(),e.preventDefault())},onKeyup:e=>{!0!==a.disabled&&W(e,[13,32])&&(m.value=a.date)},...I("-head-day",e=>{return{scope:d,event:e}}),onDragenter:e=>{void 0!==y.dragEnterFunc&&"function"===typeof y.dragEnterFunc&&(!0===y.dragEnterFunc(e,"head-day",d)?g.value=a.date:g.value="")},onDragover:e=>{void 0!==y.dragOverFunc&&"function"===typeof y.dragOverFunc&&(!0===y.dragOverFunc(e,"head-day",d)?g.value=a.date:g.value="")},onDragleave:e=>{void 0!==y.dragLeaveFunc&&"function"===typeof y.dragLeaveFunc&&(!0===y.dragLeaveFunc(e,"head-day",d)?g.value=a.date:g.value="")},onDrop:e=>{void 0!==y.dropFunc&&"function"===typeof y.dropFunc&&(!0===y.dropFunc(e,"head-day",d)?g.value=a.date:g.value="")}};return ze.h("div",v,[void 0!==t&&t({scope:d}),void 0===t&&We(a,e),void 0===t&&xe(a),void 0===t&&n&&n({scope:d}),void 0===t&&Ae(a,e),aa()])}function xe(e){return"stacked"===y.dateHeader?[!0!==y.noDefaultHeaderText&&E(e),!0!==y.noDefaultHeaderBtn&&Te(e)]:"inline"===y.dateHeader?("left"===y.weekdayAlign&&"right"===y.dateAlign||"right"===y.weekdayAlign&&y.dateAlign,ze.h("div",{class:"q-calendar__header--inline"},[!0!==y.noDefaultHeaderText&&E(e),!0!==y.noDefaultHeaderBtn&&Te(e)])):"inverted"===y.dateHeader?("left"===y.weekdayAlign&&"right"===y.dateAlign||"right"===y.weekdayAlign&&y.dateAlign,ze.h("div",{class:"q-calendar__header--inline"},[!0!==y.noDefaultHeaderBtn&&Te(e),!0!==y.noDefaultHeaderText&&E(e)])):void 0}function Ce(e,a){const t=p["head-day-event"],n=!0!==y.noActiveDate&&L(e),r=S(e,a),d=(r.activeDate=n,r.disabled=!!y.disabledWeekdays&&y.disabledWeekdays.includes(e.weekday),!0===k.value?Ge(C.value):H.value),l={width:d,maxWidth:d,minWidth:d};return!0===k.value&&(l.minWidth=d),ze.h("div",{key:"event-"+e.date+(void 0!==a?"-"+a:""),class:{"q-calendar-day__head--day__event":!0,...D(e),"q-active-date":n},style:l},[t&&t({scope:r})])}function E(e){const a=p["head-weekday-label"],t=!0===y.shortWeekdayLabel,n=S(e),r=(n.shortWeekdayLabel=y.shortWeekdayLabel,n.disabled