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