UNPKG

vue3-calendar-component

Version:

A comprehensive Vue 3 Calendar component with Vuetify 3, TypeScript, and advanced features

1 lines 58.8 kB
(function(v,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vuetify/components"),require("dayjs"),require("vuetify/components/VIcon"),require("vuetify")):typeof define=="function"&&define.amd?define(["exports","vue","vuetify/components","dayjs","vuetify/components/VIcon","vuetify"],e):(v=typeof globalThis<"u"?globalThis:v||self,e(v.Vue3CalendarComponent={},v.Vue,v.components,v.dayjs,v.VIcon,v.Vuetify))})(this,function(v,e,D,O,P,Pe){"use strict";function I(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Q={exports:{}},Je=Q.exports,Ee;function Ue(){return Ee||(Ee=1,function(r,l){(function(n,t){r.exports=t(O)})(Je,function(n){function t(i){return i&&typeof i=="object"&&"default"in i?i:{default:i}}var s=t(n),p={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function f(i,m,g){var w=p[g];return Array.isArray(w)&&(w=w[m?0:1]),w.replace("%d",i)}var V={name:"de",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.".split("_"),ordinal:function(i){return i+"."},weekStart:1,yearStart:4,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s:f,m:f,mm:f,h:f,hh:f,d:f,dd:f,M:f,MM:f,y:f,yy:f}};return s.default.locale(V,null,!0),V})}(Q)),Q.exports}Ue();var X={exports:{}},Ge=X.exports,Se;function Re(){return Se||(Se=1,function(r,l){(function(n,t){r.exports=t()})(Ge,function(){return{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(n){var t=["th","st","nd","rd"],s=n%100;return"["+n+(t[(s-20)%10]||t[s]||t[0])+"]"}}})}(X)),X.exports}Re();const _e={dayJsLocale:"en",status:{open:"Open",planned:"Planned",overdue:"Overdue",completed:"Completed",cancelled:"Cancelled"},views:{agenda:{noEvents:"No events scheduled for this day",buttons:{markEventCompleted:"Mark as Completed",cancelEvent:"Cancel Event"}}},toolbar:{buttons:{month:"Month",week:"Week",day:"Day",agenda:"Agenda",today:"Today",previous:"Previous",next:"Next"},filters:{statusLabel:"Filter by status",filterByCategory:"Filter by category"},searchPlaceholder:"Search events...",clearFilters:"Clear Filters",activeFilters:function(r){return`${r} filter${r>1?"s":""} active`}},formats:{date:"MM/DD/YYYY",time:"HH:mm",day:"dddd, MMMM D, YYYY",startOfWeek:"MMM D",endOfWeek:"MMM D, YYYY",month:"MMMM YYYY",duration(r,l,n){const t=[];return r>0&&t.push(`${r} d`),l>0&&t.push(`${l} h`),n>0&&t.push(`${n} m`),t.join(", ")}}},A=e.ref(_e);function q(){const r=t=>{A.value=t,t.dayJsLocale?O.locale(t.dayJsLocale):O.locale("en"),console.log(O().format("MMMM D, YYYY"))},l=t=>{const s=t?O(t):O();return A.value.dayJsLocale?s.locale(A.value.dayJsLocale):s},n=e.computed(()=>t=>{const s=t?O(t):O();return A.value.dayJsLocale?s.locale(A.value.dayJsLocale):s});return{current:A,setLocale:r,createLocalizedDayjs:l,localizedDayjs:n}}const Ze={class:"calendar-title"},Ke={class:"text-h6"},Qe=e.defineComponent({components:{VBtn:D.VBtn,VIcon:D.VIcon,VToolbar:D.VToolbar,VSpacer:D.VSpacer,VBtnToggle:D.VBtnToggle,VProgressLinear:D.VProgressLinear},__name:"CalendarToolbarButtons",props:{currentDate:{},currentView:{},loading:{type:Boolean,default:!1}},emits:["view-change","date-change","navigate-previous","navigate-next","navigate-today"],setup(r,{emit:l}){const n=q(),{localizedDayjs:t}=n,s=r,p=l,f=e.computed(()=>{const i=t.value(s.currentDate);switch(s.currentView){case"week":{const m=t.value(i.startOf("week")).format(n.current.value.formats.startOfWeek??"MMM D"),g=t.value(i.endOf("week")).format(n.current.value.formats.endOfWeek??"MMM D, YYYY");return`${m} - ${g}`}case"day":case"agenda":return i.format(n.current.value.formats.day??"dddd, MMMM D, YYYY");case"month":default:return i.format(n.current.value.formats.month??"MMMM YYYY")}}),V=i=>{i&&i!==s.currentView&&p("view-change",{oldView:s.currentView,newView:i,currentDate:s.currentDate})};return(i,m)=>(e.openBlock(),e.createBlock(e.unref(D.VToolbar),{density:"compact",class:"calendar-toolbar"},{default:e.withCtx(()=>[e.createVNode(e.unref(D.VBtn),{title:e.unref(n).current.value.toolbar.buttons.previous||"Previous",icon:"",disabled:i.loading,onClick:m[0]||(m[0]=g=>i.$emit("navigate-previous"))},{default:e.withCtx(()=>[e.createVNode(e.unref(D.VIcon),null,{default:e.withCtx(()=>m[3]||(m[3]=[e.createTextVNode("mdi-chevron-left")])),_:1,__:[3]})]),_:1},8,["title","disabled"]),e.createVNode(e.unref(D.VBtn),{title:e.unref(n).current.value.toolbar.buttons.next||"Next",icon:"",disabled:i.loading,onClick:m[1]||(m[1]=g=>i.$emit("navigate-next"))},{default:e.withCtx(()=>[e.createVNode(e.unref(D.VIcon),null,{default:e.withCtx(()=>m[4]||(m[4]=[e.createTextVNode("mdi-chevron-right")])),_:1,__:[4]})]),_:1},8,["title","disabled"]),e.createVNode(e.unref(D.VBtn),{variant:"text",disabled:i.loading,class:"mx-2",onClick:m[2]||(m[2]=g=>i.$emit("navigate-today"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n).current.value.toolbar.buttons.today||"Today"),1)]),_:1},8,["disabled"]),e.createVNode(e.unref(D.VSpacer)),e.createElementVNode("div",Ze,[e.createElementVNode("h2",Ke,e.toDisplayString(f.value),1)]),e.createVNode(e.unref(D.VSpacer)),e.createVNode(e.unref(D.VBtnToggle),{"model-value":i.currentView,mandatory:"",variant:"outlined",divided:"",class:"view-toggle","onUpdate:modelValue":V},{default:e.withCtx(()=>[e.createVNode(e.unref(D.VBtn),{value:"month",size:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n).current.value.toolbar.buttons.month||"Month"),1)]),_:1}),e.createVNode(e.unref(D.VBtn),{value:"week",size:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n).current.value.toolbar.buttons.week||"Week"),1)]),_:1}),e.createVNode(e.unref(D.VBtn),{value:"day",size:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n).current.value.toolbar.buttons.day||"Day"),1)]),_:1}),e.createVNode(e.unref(D.VBtn),{value:"agenda",size:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n).current.value.toolbar.buttons.agenda||"Agenda"),1)]),_:1})]),_:1},8,["model-value"]),i.loading?(e.openBlock(),e.createBlock(e.unref(D.VProgressLinear),{key:0,indeterminate:"",color:"primary",class:"position-absolute",style:{bottom:"0",left:"0",right:"0"}})):e.createCommentVNode("",!0)]),_:1}))}}),F=(r,l)=>{const n=r.__vccOpts||r;for(const[t,s]of l)n[t]=s;return n},j=F(Qe,[["__scopeId","data-v-ce23c6f9"]]);var ee={exports:{}},Xe=ee.exports,Be;function je(){return Be||(Be=1,function(r,l){(function(n,t){r.exports=t()})(Xe,function(){var n,t,s=1e3,p=6e4,f=36e5,V=864e5,i=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m=31536e6,g=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,k={years:m,months:g,days:V,hours:f,minutes:p,seconds:s,milliseconds:1,weeks:6048e5},M=function(B){return B instanceof T},y=function(B,a,c){return new T(B,c,a.$l)},o=function(B){return t.p(B)+"s"},$=function(B){return B<0},C=function(B){return $(B)?Math.ceil(B):Math.floor(B)},b=function(B){return Math.abs(B)},u=function(B,a){return B?$(B)?{negative:!0,format:""+b(B)+a}:{negative:!1,format:""+B+a}:{negative:!1,format:""}},T=function(){function B(c,d,_){var S=this;if(this.$d={},this.$l=_,c===void 0&&(this.$ms=0,this.parseFromMilliseconds()),d)return y(c*k[o(d)],this);if(typeof c=="number")return this.$ms=c,this.parseFromMilliseconds(),this;if(typeof c=="object")return Object.keys(c).forEach(function(x){S.$d[o(x)]=c[x]}),this.calMilliseconds(),this;if(typeof c=="string"){var N=c.match(w);if(N){var z=N.slice(2).map(function(x){return x!=null?Number(x):0});return this.$d.years=z[0],this.$d.months=z[1],this.$d.weeks=z[2],this.$d.days=z[3],this.$d.hours=z[4],this.$d.minutes=z[5],this.$d.seconds=z[6],this.calMilliseconds(),this}}return this}var a=B.prototype;return a.calMilliseconds=function(){var c=this;this.$ms=Object.keys(this.$d).reduce(function(d,_){return d+(c.$d[_]||0)*k[_]},0)},a.parseFromMilliseconds=function(){var c=this.$ms;this.$d.years=C(c/m),c%=m,this.$d.months=C(c/g),c%=g,this.$d.days=C(c/V),c%=V,this.$d.hours=C(c/f),c%=f,this.$d.minutes=C(c/p),c%=p,this.$d.seconds=C(c/s),c%=s,this.$d.milliseconds=c},a.toISOString=function(){var c=u(this.$d.years,"Y"),d=u(this.$d.months,"M"),_=+this.$d.days||0;this.$d.weeks&&(_+=7*this.$d.weeks);var S=u(_,"D"),N=u(this.$d.hours,"H"),z=u(this.$d.minutes,"M"),x=this.$d.seconds||0;this.$d.milliseconds&&(x+=this.$d.milliseconds/1e3,x=Math.round(1e3*x)/1e3);var Z=u(x,"S"),Ce=c.negative||d.negative||S.negative||N.negative||z.negative||Z.negative,Me=N.format||z.format||Z.format?"T":"",K=(Ce?"-":"")+"P"+c.format+d.format+S.format+Me+N.format+z.format+Z.format;return K==="P"||K==="-P"?"P0D":K},a.toJSON=function(){return this.toISOString()},a.format=function(c){var d=c||"YYYY-MM-DDTHH:mm:ss",_={Y:this.$d.years,YY:t.s(this.$d.years,2,"0"),YYYY:t.s(this.$d.years,4,"0"),M:this.$d.months,MM:t.s(this.$d.months,2,"0"),D:this.$d.days,DD:t.s(this.$d.days,2,"0"),H:this.$d.hours,HH:t.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,"0"),SSS:t.s(this.$d.milliseconds,3,"0")};return d.replace(i,function(S,N){return N||String(_[S])})},a.as=function(c){return this.$ms/k[o(c)]},a.get=function(c){var d=this.$ms,_=o(c);return _==="milliseconds"?d%=1e3:d=_==="weeks"?C(d/k[_]):this.$d[_],d||0},a.add=function(c,d,_){var S;return S=d?c*k[o(d)]:M(c)?c.$ms:y(c,this).$ms,y(this.$ms+S*(_?-1:1),this)},a.subtract=function(c,d){return this.add(c,d,!0)},a.locale=function(c){var d=this.clone();return d.$l=c,d},a.clone=function(){return y(this.$ms,this)},a.humanize=function(c){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!c)},a.valueOf=function(){return this.asMilliseconds()},a.milliseconds=function(){return this.get("milliseconds")},a.asMilliseconds=function(){return this.as("milliseconds")},a.seconds=function(){return this.get("seconds")},a.asSeconds=function(){return this.as("seconds")},a.minutes=function(){return this.get("minutes")},a.asMinutes=function(){return this.as("minutes")},a.hours=function(){return this.get("hours")},a.asHours=function(){return this.as("hours")},a.days=function(){return this.get("days")},a.asDays=function(){return this.as("days")},a.weeks=function(){return this.get("weeks")},a.asWeeks=function(){return this.as("weeks")},a.months=function(){return this.get("months")},a.asMonths=function(){return this.as("months")},a.years=function(){return this.get("years")},a.asYears=function(){return this.as("years")},B}(),E=function(B,a,c){return B.add(a.years()*c,"y").add(a.months()*c,"M").add(a.days()*c,"d").add(a.hours()*c,"h").add(a.minutes()*c,"m").add(a.seconds()*c,"s").add(a.milliseconds()*c,"ms")};return function(B,a,c){n=c,t=c().$utils(),c.duration=function(S,N){var z=c.locale();return y(S,{$l:z},N)},c.isDuration=M;var d=a.prototype.add,_=a.prototype.subtract;a.prototype.add=function(S,N){return M(S)?E(this,S,1):d.bind(this)(S,N)},a.prototype.subtract=function(S,N){return M(S)?E(this,S,-1):_.bind(this)(S,N)}}})}(ee)),ee.exports}var et=je();const tt=I(et);var te={exports:{}},nt=te.exports,be;function rt(){return be||(be=1,function(r,l){(function(n,t){r.exports=t()})(nt,function(){var n="day";return function(t,s,p){var f=function(m){return m.add(4-m.isoWeekday(),n)},V=s.prototype;V.isoWeekYear=function(){return f(this).year()},V.isoWeek=function(m){if(!this.$utils().u(m))return this.add(7*(m-this.isoWeek()),n);var g,w,k,M,y=f(this),o=(g=this.isoWeekYear(),w=this.$u,k=(w?p.utc:p)().year(g).startOf("year"),M=4-k.isoWeekday(),k.isoWeekday()>4&&(M+=7),k.add(M,n));return y.diff(o,"week")+1},V.isoWeekday=function(m){return this.$utils().u(m)?this.day()||7:this.day(this.day()%7?m:m-7)};var i=V.startOf;V.startOf=function(m,g){var w=this.$utils(),k=!!w.u(g)||g;return w.p(m)==="isoweek"?k?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):i.bind(this)(m,g)}}})}(te)),te.exports}var at=rt();const ot=I(at);var ne={exports:{}},it=ne.exports,Te;function st(){return Te||(Te=1,function(r,l){(function(n,t){r.exports=t()})(it,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(t,s,p){var f=s.prototype,V=f.format;p.en.formats=n,f.format=function(i){i===void 0&&(i="YYYY-MM-DDTHH:mm:ssZ");var m=this.$locale().formats,g=function(w,k){return w.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(M,y,o){var $=o&&o.toUpperCase();return y||k[o]||n[o]||k[$].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(C,b,u){return b||u.slice(1)})})}(i,m===void 0?{}:m);return V.call(this,g)}}})}(ne)),ne.exports}var lt=st();const ct=I(lt);var re={exports:{}},dt=re.exports,ve;function ut(){return ve||(ve=1,function(r,l){(function(n,t){r.exports=t()})(dt,function(){return function(n,t,s){n=n||{};var p=t.prototype,f={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function V(m,g,w,k){return p.fromToBase(m,g,w,k)}s.en.relativeTime=f,p.fromToBase=function(m,g,w,k,M){for(var y,o,$,C=w.$locale().relativeTime||f,b=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],u=b.length,T=0;T<u;T+=1){var E=b[T];E.d&&(y=k?s(m).diff(w,E.d,!0):w.diff(m,E.d,!0));var B=(n.rounding||Math.round)(Math.abs(y));if($=y>0,B<=E.r||!E.r){B<=1&&T>0&&(E=b[T-1]);var a=C[E.l];M&&(B=M(""+B)),o=typeof a=="string"?a.replace("%d",B):a(B,g,E.l,$);break}}if(g)return o;var c=$?C.future:C.past;return typeof c=="function"?c(o):c.replace("%s",o)},p.to=function(m,g){return V(m,g,this,!0)},p.from=function(m,g){return V(m,g,this)};var i=function(m){return m.$u?s.utc():s()};p.toNow=function(m){return this.to(i(this),m)},p.fromNow=function(m){return this.from(i(this),m)}}})}(re)),re.exports}var mt=ut();const ft=I(mt);var ae={exports:{}},ht=ae.exports,Ne;function pt(){return Ne||(Ne=1,function(r,l){(function(n,t){r.exports=t()})(ht,function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(s,p,f){var V,i=function(k,M,y){y===void 0&&(y={});var o=new Date(k),$=function(C,b){b===void 0&&(b={});var u=b.timeZoneName||"short",T=C+"|"+u,E=t[T];return E||(E=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:C,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:u}),t[T]=E),E}(M,y);return $.formatToParts(o)},m=function(k,M){for(var y=i(k,M),o=[],$=0;$<y.length;$+=1){var C=y[$],b=C.type,u=C.value,T=n[b];T>=0&&(o[T]=parseInt(u,10))}var E=o[3],B=E===24?0:E,a=o[0]+"-"+o[1]+"-"+o[2]+" "+B+":"+o[4]+":"+o[5]+":000",c=+k;return(f.utc(a).valueOf()-(c-=c%1e3))/6e4},g=p.prototype;g.tz=function(k,M){k===void 0&&(k=V);var y,o=this.utcOffset(),$=this.toDate(),C=$.toLocaleString("en-US",{timeZone:k}),b=Math.round(($-new Date(C))/1e3/60),u=15*-Math.round($.getTimezoneOffset()/15)-b;if(!Number(u))y=this.utcOffset(0,M);else if(y=f(C,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(u,!0),M){var T=y.utcOffset();y=y.add(o-T,"minute")}return y.$x.$timezone=k,y},g.offsetName=function(k){var M=this.$x.$timezone||f.tz.guess(),y=i(this.valueOf(),M,{timeZoneName:k}).find(function(o){return o.type.toLowerCase()==="timezonename"});return y&&y.value};var w=g.startOf;g.startOf=function(k,M){if(!this.$x||!this.$x.$timezone)return w.call(this,k,M);var y=f(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return w.call(y,k,M).tz(this.$x.$timezone,!0)},f.tz=function(k,M,y){var o=y&&M,$=y||M||V,C=m(+f(),$);if(typeof k!="string")return f(k).tz($);var b=function(B,a,c){var d=B-60*a*1e3,_=m(d,c);if(a===_)return[d,a];var S=m(d-=60*(_-a)*1e3,c);return _===S?[d,_]:[B-60*Math.min(_,S)*1e3,Math.max(_,S)]}(f.utc(k,o).valueOf(),C,$),u=b[0],T=b[1],E=f(u).utcOffset(T);return E.$x.$timezone=$,E},f.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},f.tz.setDefault=function(k){V=k}}})}(ae)),ae.exports}var gt=pt();const yt=I(gt);var oe={exports:{}},kt=oe.exports,Oe;function Dt(){return Oe||(Oe=1,function(r,l){(function(n,t){r.exports=t()})(kt,function(){var n="minute",t=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(p,f,V){var i=f.prototype;V.utc=function(o){var $={date:o,utc:!0,args:arguments};return new f($)},i.utc=function(o){var $=V(this.toDate(),{locale:this.$L,utc:!0});return o?$.add(this.utcOffset(),n):$},i.local=function(){return V(this.toDate(),{locale:this.$L,utc:!1})};var m=i.parse;i.parse=function(o){o.utc&&(this.$u=!0),this.$utils().u(o.$offset)||(this.$offset=o.$offset),m.call(this,o)};var g=i.init;i.init=function(){if(this.$u){var o=this.$d;this.$y=o.getUTCFullYear(),this.$M=o.getUTCMonth(),this.$D=o.getUTCDate(),this.$W=o.getUTCDay(),this.$H=o.getUTCHours(),this.$m=o.getUTCMinutes(),this.$s=o.getUTCSeconds(),this.$ms=o.getUTCMilliseconds()}else g.call(this)};var w=i.utcOffset;i.utcOffset=function(o,$){var C=this.$utils().u;if(C(o))return this.$u?0:C(this.$offset)?w.call(this):this.$offset;if(typeof o=="string"&&(o=function(E){E===void 0&&(E="");var B=E.match(t);if(!B)return null;var a=(""+B[0]).match(s)||["-",0,0],c=a[0],d=60*+a[1]+ +a[2];return d===0?0:c==="+"?d:-d}(o),o===null))return this;var b=Math.abs(o)<=16?60*o:o,u=this;if($)return u.$offset=b,u.$u=o===0,u;if(o!==0){var T=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(u=this.local().add(b+T,n)).$offset=b,u.$x.$localOffset=T}else u=this.utc();return u};var k=i.format;i.format=function(o){var $=o||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return k.call(this,$)},i.valueOf=function(){var o=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*o},i.isUTC=function(){return!!this.$u},i.toISOString=function(){return this.toDate().toISOString()},i.toString=function(){return this.toDate().toUTCString()};var M=i.toDate;i.toDate=function(o){return o==="s"&&this.$offset?V(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():M.call(this)};var y=i.diff;i.diff=function(o,$,C){if(o&&this.$u===o.$u)return y.call(this,o,$,C);var b=this.local(),u=V(o).local();return y.call(b,u,$,C)}}})}(oe)),oe.exports}var Vt=Dt();const $t=I(Vt);var ie={exports:{}},wt=ie.exports,Ye;function Ct(){return Ye||(Ye=1,function(r,l){(function(n,t){r.exports=t()})(wt,function(){var n="week",t="year";return function(s,p,f){var V=p.prototype;V.week=function(i){if(i===void 0&&(i=null),i!==null)return this.add(7*(i-this.week()),"day");var m=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var g=f(this).startOf(t).add(1,t).date(m),w=f(this).endOf(n);if(g.isBefore(w))return 1}var k=f(this).startOf(t).date(m).startOf(n).subtract(1,"millisecond"),M=this.diff(k,n,!0);return M<0?f(this).startOf("week").week():Math.ceil(M)},V.weeks=function(i){return i===void 0&&(i=null),this.week(i)}}})}(ie)),ie.exports}var Mt=Ct();const Et=I(Mt);O.extend($t),O.extend(yt),O.extend(ot),O.extend(Et),O.extend(tt),O.extend(ft),O.extend(ct);function ze(r){const l=O(r.start),n=r.end?O(r.end):l.add(1,"hour");return{...r,startDate:l,endDate:n,isAllDay:r.allDay||!1}}function pe(r){return r.map(ze)}function ge(r,l,n){return r.filter(t=>t.startDate.isBefore(n)&&t.endDate.isAfter(l))}function J(r,l){const n=l.startOf("day"),t=l.endOf("day");return ge(r,n,t)}function ye(r="00:00",l="24:00",n=60){const t=[],[s,p]=r.split(":").map(Number),[f,V]=l.split(":").map(Number);let i=O().hour(s).minute(p).second(0);const m=O().hour(f).minute(V).second(0);for(;i.isBefore(m);)t.push({hour:i.hour(),minute:i.minute(),label:i.format("HH:mm")}),i=i.add(n,"minute");return t}function ke(r,l="monday"){const n=r.add(-r.get("day"),"d").add(ce(l),"day"),t=[];for(let s=0;s<7;s++)t.push(n.add(s,"day"));return t}function Le(r,l="monday"){const n=ce(l),t=r.startOf("month"),s=r.endOf("month"),p=t.startOf("week").add(n,"day"),f=s.endOf("week").add(n,"day"),V=[];let i=p;for(;i.isBefore(f)||i.isSame(f,"day");){const m=[];for(let g=0;g<7;g++)m.push(i.add(g,"day"));V.push(m),i=i.add(7,"day")}return V}function se(r,l){if(r.isAllDay)return"All day";const n=l||"HH:mm",t=r.startDate.format(n),s=r.endDate.format(n);return`${t} - ${s}`}function xe(r){return r.endDate.diff(r.startDate,"minute")}function St(r,l){return r.startDate.isBefore(l.endDate)&&r.endDate.isAfter(l.startDate)}function Fe(r){return[...r].sort((l,n)=>l.startDate.valueOf()-n.startDate.valueOf())}function W(r){if(r.color)return r.color;if(r.backgroundColor)return r.backgroundColor;switch(r.status){case"completed":return"#4caf50";case"cancelled":return"#f44336";case"overdue":return"#ff5722";case"planned":return"#2196f3";case"open":default:return"#9e9e9e"}}function le(r){if(r.textColor)return r.textColor;const n=W(r).replace("#",""),t=parseInt(n.substr(0,2),16),s=parseInt(n.substr(2,2),16),p=parseInt(n.substr(4,2),16);return(t*299+s*587+p*114)/1e3>128?"#000000":"#ffffff"}function U(r){return r.isSame(O(),"day")}function G(r){const l=r.day();return l===0||l===6}function ce(r){switch(r){case"sunday":return 0;case"monday":return 1;case"tuesday":return 2;case"wednesday":return 3;case"thursday":return 4;case"friday":return 5;case"saturday":return 6;default:return-1}}function He(r,l){let n=[...r];if(l.search){const t=l.search.toLowerCase();n=n.filter(s=>s.title.toLowerCase().indexOf(t)!==-1||s.subtitle&&s.subtitle.toLowerCase().indexOf(t)!==-1||s.description&&s.description.toLowerCase().indexOf(t)!==-1)}if(l.statuses&&l.statuses.length>0&&(n=n.filter(t=>l.statuses.indexOf(t.status||"open")!==-1)),l.dateRange){const{start:t,end:s}=l.dateRange;n=n.filter(p=>p.startDate.isBefore(s)&&p.endDate.isAfter(t))}return l.customFilter&&(n=n.filter(l.customFilter)),n}function Ie(r,l){let n=null;return(...t)=>{n&&clearTimeout(n),n=setTimeout(()=>r(...t),l)}}function _t(r,l){let n;return(...t)=>{n||(r(...t),n=!0,setTimeout(()=>n=!1,l))}}function Bt(){return Math.random().toString(36).substring(2)+Date.now().toString(36)}function De(r){if(r===null||typeof r!="object")return r;if(r instanceof Date)return new Date(r.getTime());if(Array.isArray(r))return r.map(De);const l={};for(const n in r)Object.prototype.hasOwnProperty.call(r,n)&&(l[n]=De(r[n]));return l}const bt={class:"agenda-view"},Tt={class:"agenda-header"},vt={class:"text-h6"},Nt={class:"agenda-content"},Ot={key:0,class:"no-events"},Yt={class:"text-body-1 text-grey"},zt={key:1,class:"events-list"},Lt={class:"event-header d-flex align-center mb-2"},xt={class:"event-title text-h6 flex-grow-1"},Ft={key:0,class:"event-subtitle text-subtitle-1 mb-2"},Ht={class:"event-time d-flex align-center mb-2"},It={class:"text-body-2"},Wt={key:0,class:"ml-2 text-caption text-grey"},At={key:1,class:"event-location d-flex align-center mb-2"},qt={class:"text-body-2"},Pt={key:2,class:"event-description"},Jt={class:"text-body-2 mb-0"},Ut={key:3,class:"event-metadata mt-3"},Gt={class:"d-flex flex-wrap gap-2"},Rt=e.defineComponent({components:{VIcon:P.VIcon,VCard:D.VCard,VCardActions:D.VCardActions,VChip:D.VChip,VSpacer:D.VSpacer,VBtn:D.VBtn},__name:"AgendaView",props:{events:{},currentDate:{},containerHeight:{},config:{},readOnly:{type:Boolean}},emits:["event-click","event-update"],setup(r,{emit:l}){const n=q(),t=r,s=l,p=e.computed(()=>J(t.events,t.currentDate)),f=e.computed(()=>Fe(p.value)),V=e.computed(()=>n.localizedDayjs.value(t.currentDate).format(n.current.value.formats.day)),i=o=>{switch(o){case"completed":return"success";case"cancelled":return"error";case"overdue":return"warning";case"planned":return"info";case"open":default:return"default"}},m=o=>{switch(o){case"completed":return n.current.value.status.completed;case"cancelled":return n.current.value.status.cancelled;case"overdue":return n.current.value.status.overdue;case"planned":return n.current.value.status.planned;case"open":default:return n.current.value.status.open}},g=o=>{const $=xe(o),C=Math.floor($/(24*60)),b=Math.floor($/60),u=$%60;return n.current.value.formats.duration(C,b,u)},w=o=>o.endDate.isBefore(O())&&o.status!=="completed"&&o.status!=="cancelled",k=o=>{s("event-click",o)},M=o=>{s("event-update",o.id,{status:"completed"})},y=o=>{s("event-update",o.id,{status:"cancelled"})};return(o,$)=>{const C=e.resolveComponent("v-divider"),b=e.resolveComponent("v-card-text");return e.openBlock(),e.createElementBlock("div",bt,[e.createElementVNode("div",Tt,[e.createElementVNode("h3",vt,e.toDisplayString(V.value),1),p.value.length>0?(e.openBlock(),e.createBlock(e.unref(D.VChip),{key:0,color:"primary",size:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.value.length)+" event"+e.toDisplayString(p.value.length>1?"s":""),1)]),_:1})):e.createCommentVNode("",!0)]),e.createElementVNode("div",Nt,[p.value.length===0?(e.openBlock(),e.createElementBlock("div",Ot,[e.renderSlot(o.$slots,"no-events",{date:o.currentDate},()=>[e.createVNode(e.unref(P.VIcon),{icon:"mdi-calendar-blank",size:"64",color:"grey-lighten-2",class:"mb-4"}),e.createElementVNode("p",Yt,e.toDisplayString(e.unref(n).current.value.views.agenda.noEvents),1)],!0)])):(e.openBlock(),e.createElementBlock("div",zt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,u=>(e.openBlock(),e.createElementBlock("div",{key:u.id},[e.renderSlot(o.$slots,"event-content",{event:u,date:o.currentDate,handleEventClick:k},()=>[e.createVNode(e.unref(D.VCard),{class:e.normalizeClass(["agenda-event mb-4",{"event-completed":u.status==="completed","event-cancelled":u.status==="cancelled","event-overdue":w(u)}]),style:e.normalizeStyle({borderLeft:`4px solid ${e.unref(W)(u)}`}),elevation:"2",onClick:T=>k({event:u,nativeEvent:T})},{default:e.withCtx(()=>[e.createVNode(b,{class:"pa-4"},{default:e.withCtx(()=>[e.createElementVNode("div",Lt,[u.icon?(e.openBlock(),e.createBlock(e.unref(P.VIcon),{key:0,icon:u.icon,color:e.unref(W)(u),class:"mr-2"},null,8,["icon","color"])):e.createCommentVNode("",!0),e.createElementVNode("h4",xt,e.toDisplayString(u.title),1),e.createVNode(e.unref(D.VChip),{color:i(u.status||"open"),size:"small",variant:"outlined"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m(u.status||"open")),1)]),_:2},1032,["color"])]),u.subtitle?(e.openBlock(),e.createElementBlock("div",Ft,e.toDisplayString(u.subtitle),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Ht,[e.createVNode(e.unref(P.VIcon),{icon:"mdi-clock-outline",size:"small",class:"mr-2"}),e.createElementVNode("span",It,e.toDisplayString(e.unref(se)(u)),1),u.isAllDay?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Wt," ("+e.toDisplayString(g(u))+") ",1))]),u.location?(e.openBlock(),e.createElementBlock("div",At,[e.createVNode(e.unref(P.VIcon),{icon:"mdi-map-marker",size:"small",class:"mr-2"}),e.createElementVNode("span",qt,e.toDisplayString(u.location),1)])):e.createCommentVNode("",!0),u.description?(e.openBlock(),e.createElementBlock("div",Pt,[e.createElementVNode("p",Jt,e.toDisplayString(u.description),1)])):e.createCommentVNode("",!0),u.data&&Object.keys(u.data).length>0?(e.openBlock(),e.createElementBlock("div",Ut,[e.createVNode(C,{class:"mb-2"}),e.createElementVNode("div",Gt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.data,(T,E)=>(e.openBlock(),e.createBlock(e.unref(D.VChip),{key:E,size:"x-small",variant:"outlined"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(E)+": "+e.toDisplayString(T),1)]),_:2},1024))),128))])])):e.createCommentVNode("",!0)]),_:2},1024),e.createVNode(e.unref(D.VCardActions),{class:"pa-4 pt-0"},{default:e.withCtx(()=>[e.createVNode(e.unref(D.VSpacer)),u.status!=="completed"&&u.status!=="cancelled"?(e.openBlock(),e.createBlock(e.unref(D.VBtn),{key:0,disabled:o.readOnly,variant:"text",size:"small",color:"success",onClick:e.withModifiers(T=>M(u),["stop"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n).current.value.views.agenda.buttons.markEventCompleted),1)]),_:2},1032,["disabled","onClick"])):e.createCommentVNode("",!0),u.status!=="cancelled"?(e.openBlock(),e.createBlock(e.unref(D.VBtn),{key:1,disabled:o.readOnly,variant:"text",size:"small",color:"error",onClick:e.withModifiers(T=>y(u),["stop"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n).current.value.views.agenda.buttons.cancelEvent),1)]),_:2},1032,["disabled","onClick"])):e.createCommentVNode("",!0)]),_:2},1024)]),_:2},1032,["style","class","onClick"])],!0)]))),128))]))])])}}}),de=F(Rt,[["__scopeId","data-v-fde84cc6"]]);function ue(r){const l=e.ref(null),n=e.ref(null),t=e.ref(!1),s=e.ref(null),p=(g,w)=>{l.value=g,n.value=w,t.value=!0,w.style.opacity="0.5",w.style.cursor="grabbing"},f=()=>{n.value&&(n.value.style.opacity="1",n.value.style.cursor="grab"),l.value=null,n.value=null,t.value=!1,s.value=null},V=async(g,w)=>{if(!l.value)return;const k=l.value,M=k.startDate,y=k.endDate,o=w||g.add(y.diff(M,"minute"),"minute"),$={event:k,newStart:g.toDate(),newEnd:o.toDate(),oldStart:M.toDate(),oldEnd:y.toDate()};try{r&&await r($)}catch(C){console.error("Failed to drop event:",C)}finally{f()}},i=g=>{s.value=g,g.style.backgroundColor="rgba(25, 118, 210, 0.1)"},m=g=>{s.value===g&&(g.style.backgroundColor="",s.value=null)};return{draggedEvent:e.computed(()=>l.value),isDragging:e.computed(()=>t.value),handleDragStart:p,handleDragEnd:f,handleDrop:V,handleDragOver:i,handleDragLeave:m}}function me(r){return e.computed(()=>{const[n,t]=r.value.split(":").map(Number);return n*60+t})}function Ve(r,l,n,t,s=60){return e.computed(()=>{const f=me(l),V=me(n),i=e.computed(()=>{const w=V.value-f.value;return Math.ceil(w/t.value)}),m=r.value-s;return{height:e.computed(()=>m<=0?30:Math.max(30,Math.floor(m/i.value))).value,numberOfSlots:i.value,minTime:f.value,maxTime:V.value}})}function Zt(){const{mobile:r,width:l,sm:n,md:t,lg:s,xl:p,xxl:f}=Pe.useDisplay(),V=e.computed(()=>n.value||t.value),i=e.computed(()=>s.value||p.value||f.value),m=e.computed(()=>r.value?"agenda":V.value?"week":"month"),g=e.computed(()=>r.value?"compact":V.value?"normal":"detailed"),w=e.computed(()=>i.value),k=e.computed(()=>r.value?40:V.value?50:l.value>1920?80:60),M=e.computed(()=>l.value>1920);return{mobile:r,tablet:V,desktop:i,isWideScreen:M,recommendedView:m,eventDisplayMode:g,showSidebar:w,timeSlotHeight:k}}const Kt=["draggable"],Qt={class:"event-content"},Xt={class:"event-header"},jt={class:"event-title"},en={key:0,class:"event-subtitle"},tn={class:"event-time"},nn={key:1,class:"event-location"},rn={key:2,class:"event-description"},We=F(e.defineComponent({__name:"DayEventView",props:{event:{},day:{},dynamicTimeSlots:{},handleEventClick:{type:Function},handleDragStart:{type:Function},config:{},readOnly:{type:Boolean}},setup(r){e.defineComponent({components:{VIcon:D.VIcon}});const l=r,n=t=>{const[s,p]=(l.config.minTime||"00:00").split(":").map(Number),[f,V]=(l.config.maxTime||"24:00").split(":").map(Number),i=l.day.hour(s).minute(p).second(0),m=l.day.hour(f).minute(V).second(0),g=t.startDate.isBefore(i)?i:t.startDate,w=t.endDate.isAfter(m)?m:t.endDate;if(t.endDate.isBefore(i)||t.startDate.isAfter(m))return{display:"none"};const k=g.diff(i,"minute"),M=w.diff(g,"minute"),y=l.config.timeSlotDuration||60,o=l.dynamicTimeSlots.height,$=Math.max(0,k/y*o),C=Math.max(M/y*o,20);return{position:"absolute",top:`${$}px`,height:`${C}px`,left:"8px",right:"8px",backgroundColor:W(t),color:le(t),zIndex:10}};return(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["day-event",{"event-completed":t.event.status==="completed"}]),style:e.normalizeStyle(n(t.event)),draggable:!t.readOnly,onClick:s[0]||(s[0]=e.withModifiers(p=>t.handleEventClick({event:t.event,nativeEvent:p}),["stop"])),onDragstart:s[1]||(s[1]=p=>t.handleDragStart(t.event,p.target))},[e.createElementVNode("div",Qt,[e.createElementVNode("div",Xt,[t.event.icon?(e.openBlock(),e.createBlock(e.unref(D.VIcon),{key:0,icon:t.event.icon,size:"small",class:"mr-2"},null,8,["icon"])):e.createCommentVNode("",!0),e.createElementVNode("div",jt,e.toDisplayString(t.event.title),1)]),t.event.subtitle?(e.openBlock(),e.createElementBlock("div",en,e.toDisplayString(t.event.subtitle),1)):e.createCommentVNode("",!0),e.createElementVNode("div",tn,e.toDisplayString(e.unref(se)(t.event)),1),t.event.location?(e.openBlock(),e.createElementBlock("div",nn,[e.createVNode(e.unref(D.VIcon),{icon:"mdi-map-marker",size:"x-small",class:"mr-1"}),e.createTextVNode(" "+e.toDisplayString(t.event.location),1)])):e.createCommentVNode("",!0),t.event.description?(e.openBlock(),e.createElementBlock("div",rn,e.toDisplayString(t.event.description),1)):e.createCommentVNode("",!0)])],46,Kt))}}),[["__scopeId","data-v-69ba6863"]]),an={class:"day-view"},on={key:0,class:"time-column-header"},sn={class:"day-name"},ln={key:0,class:"time-column"},cn={class:"time-label"},dn=["onClick","onDrop"],un={key:0},mn={key:1},fe=F(e.defineComponent({__name:"DayView",props:{events:{},currentDate:{},containerHeight:{},config:{},readOnly:{type:Boolean}},emits:["time-slot-click","event-click","event-drop","date-click"],setup(r,{emit:l}){e.defineComponent({components:{VMenu:D.VMenu}});const n=r,t=l,s=e.computed(()=>!n.readOnly),p=e.computed(()=>n.containerHeight||500),f=e.computed(()=>n.config.timeSlotDuration??60),V=e.computed(()=>n.config.minTime||"00:00"),i=e.computed(()=>n.config.maxTime||"24:00"),m=Ve(p,V,i,f,60),{handleDragStart:g,handleDrop:w}=ue(async a=>{t("event-drop",{event:a.event,date:a.date,newEnd:a.newEnd,newStart:a.newStart,oldEnd:a.oldEnd,oldStart:a.oldStart})}),k=e.computed(()=>ye(n.config.minTime,n.config.maxTime,n.config.timeSlotDuration)),M=e.computed(()=>J(n.events,n.currentDate)),y=a=>{t("event-click",a)},o=a=>{t("date-click",a)},$=a=>{const c=n.currentDate.hour(a.hour).minute(a.minute);t("time-slot-click",{date:c,slot:a})},C=(a,c)=>{s.value&&c instanceof HTMLElement&&(c.style.opacity="0.5",c.style.transform="rotate(3deg)",g(a,c))},b=a=>{s.value&&(document.querySelectorAll(".drag-highlight").forEach(c=>{c.classList.remove("drag-highlight")}),document.querySelectorAll('[style*="opacity: 0.5"]').forEach(c=>{const d=c;d.style.opacity="",d.style.transform=""}),w(a))},u=a=>{if(a.preventDefault(),!s.value)return;a.currentTarget.classList.add("drag-highlight")},T=a=>{a.currentTarget.classList.remove("drag-highlight")},E=a=>{if(a.preventDefault(),!s.value)return;a.currentTarget.classList.add("drag-highlight-slot")},B=a=>{a.currentTarget.classList.remove("drag-highlight-slot")};return(a,c)=>(e.openBlock(),e.createElementBlock("div",an,[e.createElementVNode("div",{class:e.normalizeClass(["day-header",{"show-time-grid":a.config.showTimeGrid,"hide-time-grid":!a.config.showTimeGrid}])},[a.config.showTimeGrid?(e.openBlock(),e.createElementBlock("div",on)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["day-header-content",{today:e.unref(U)(a.currentDate),weekend:e.unref(G)(a.currentDate)}]),onClick:c[0]||(c[0]=d=>o({date:a.currentDate,nativeEvent:d}))},[e.createElementVNode("div",sn,e.toDisplayString(a.currentDate.format("dddd")),1)],2)],2),e.createElementVNode("div",{class:e.normalizeClass(["day-body",{"show-time-grid":a.config.showTimeGrid,"hide-time-grid":!a.config.showTimeGrid}]),onDrop:c[1]||(c[1]=d=>b(a.currentDate.startOf("day")))},[a.config.showTimeGrid?(e.openBlock(),e.createElementBlock("div",ln,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,d=>(e.openBlock(),e.createElementBlock("div",{key:`${d.hour}-${d.minute}`,class:"time-slot",style:e.normalizeStyle({height:`${e.unref(m).height}px`})},[e.createElementVNode("span",cn,e.toDisplayString(d.label),1)],4))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"day-content",onDragover:e.withModifiers(u,["prevent"]),onDragleave:T},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,d=>(e.openBlock(),e.createElementBlock("div",{key:`${a.currentDate.format("YYYY-MM-DD")}-${d.hour}-${d.minute}`,class:e.normalizeClass(["time-slot",{"time-grid":a.config.showTimeGrid}]),style:e.normalizeStyle({height:`${e.unref(m).height}px`}),onClick:_=>$(d),onDrop:_=>b(a.currentDate.startOf("day").add(d.hour,"hour").add(d.minute,"minute")),onDragover:e.withModifiers(E,["prevent"]),onDragleave:B},null,46,dn))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,d=>(e.openBlock(),e.createElementBlock("div",{key:d.id},[a.$slots.eventMenu?(e.openBlock(),e.createElementBlock("div",un,[e.createVNode(e.unref(D.VMenu),null,{activator:e.withCtx(({props:_})=>[e.createVNode(We,e.mergeProps({ref_for:!0},_,{config:a.config,"read-only":a.readOnly,event:d,day:a.currentDate,"dynamic-time-slots":e.unref(m),"handle-drag-start":C,"handle-event-click":y}),null,16,["config","read-only","event","day","dynamic-time-slots"])]),default:e.withCtx(()=>[e.renderSlot(a.$slots,"eventMenu",{event:d},void 0,!0)]),_:2},1024)])):(e.openBlock(),e.createElementBlock("div",mn,[e.createVNode(We,{config:a.config,"read-only":a.readOnly,event:d,day:a.currentDate,"dynamic-time-slots":e.unref(m),"handle-drag-start":C,"handle-event-click":y},null,8,["config","read-only","event","day","dynamic-time-slots"])]))]))),128))],32)],34)]))}}),[["__scopeId","data-v-217d3814"]]),fn=["draggable"],hn={class:"event-title"},$e=F(e.defineComponent({__name:"MonthEventView",props:{event:{},day:{},handleEventClick:{type:Function},handleDragStart:{type:Function},config:{},readOnly:{type:Boolean}},setup(r){return e.defineComponent({components:{VIcon:D.VIcon}}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["month-event",{"event-completed":l.event.status==="completed"}]),style:e.normalizeStyle({backgroundColor:e.unref(W)(l.event),color:e.unref(le)(l.event)}),draggable:!l.readOnly,onClick:n[0]||(n[0]=e.withModifiers(t=>l.handleEventClick({event:l.event,nativeEvent:t}),["stop"])),onDragstart:n[1]||(n[1]=t=>l.handleDragStart(l.event,t.target))},[l.event.icon?(e.openBlock(),e.createBlock(e.unref(D.VIcon),{key:0,icon:l.event.icon,size:"x-small",class:"mr-1"},null,8,["icon"])):e.createCommentVNode("",!0),e.createElementVNode("span",hn,e.toDisplayString(l.event.title),1)],46,fn))}}),[["__scopeId","data-v-73ce43ec"]]),pn={class:"month-view"},gn={class:"month-header"},yn={class:"month-grid"},kn=["onClick","onDrop"],Dn={class:"day-number"},Vn={class:"day-events"},$n={key:0},wn={key:1},R=F(e.defineComponent({__name:"MonthView",props:{events:{},currentDate:{},containerHeight:{},config:{},readOnly:{type:Boolean}},emits:["event-click","event-drop","date-click"],setup(r,{emit:l}){e.defineComponent({components:{MonthEventView:$e,VMenu:D.VMenu}});const n=e.computed(()=>s.config.minTime||"00:00"),t=me(n),s=r,p=l,f=e.computed(()=>!s.readOnly),{createLocalizedDayjs:V}=q(),{handleDragStart:i,handleDrop:m}=ue(async u=>{p("event-drop",{event:u.event,date:u.date,newEnd:u.newEnd,newStart:u.newStart,oldEnd:u.oldEnd,oldStart:u.oldStart})}),g=e.computed(()=>ke(s.currentDate,s.config.firstDayOfWeek)),w=e.computed(()=>Le(s.currentDate,s.config.firstDayOfWeek)),k=u=>J(s.events,u).slice(0,3),M=u=>{p("event-click",u)},y=u=>{p("date-click",u)},o=(u,T)=>{f.value&&T instanceof HTMLElement&&(T.style.opacity="0.5",T.style.transform="rotate(3deg)",i(u,T))},$=u=>{f.value&&(document.querySelectorAll(".drag-highlight").forEach(T=>{T.classList.remove("drag-highlight")}),document.querySelectorAll('[style*="opacity: 0.5"]').forEach(T=>{const E=T;E.style.opacity="",E.style.transform=""}),m(u.startOf("day").add(t.value,"minute")))},C=u=>{if(u.preventDefault(),!f.value)return;u.currentTarget.classList.add("drag-highlight")},b=u=>{if(!f.value)return;u.currentTarget.classList.remove("drag-highlight")};return(u,T)=>(e.openBlock(),e.createElementBlock("div",pn,[e.createElementVNode("div",gn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,E=>(e.openBlock(),e.createElementBlock("div",{key:`days-col-header-${E.format("YYYY-MM-DD")}`,class:"month-header-day"},e.toDisplayString(e.unref(V)(E).format("ddd")),1))),128))]),e.createElementVNode("div",yn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(E,B)=>(e.openBlock(),e.createElementBlock("div",{key:B,class:"month-week"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E,a=>(e.openBlock(),e.createElementBlock("div",{key:a.format("YYYY-MM-DD"),class:e.normalizeClass(["month-day",{"current-month":a.month()===u.currentDate.month(),"other-month":a.month()!==u.currentDate.month(),today:e.unref(U)(a),weekend:e.unref(G)(a)}]),onClick:c=>y({date:a,nativeEvent:c}),onDragover:e.withModifiers(C,["prevent"]),onDragleave:b,onDrop:c=>$(a)},[e.createElementVNode("div",Dn,e.toDisplayString(a.date()),1),e.createElementVNode("div",Vn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k(a),c=>(e.openBlock(),e.createElementBlock("div",{key:c.id},[u.$slots.eventMenu?(e.openBlock(),e.createElementBlock("div",$n,[e.createVNode(e.unref(D.VMenu),null,{activator:e.withCtx(({props:d})=>[e.createVNode($e,e.mergeProps({ref_for:!0},d,{config:u.config,"read-only":u.readOnly,event:c,day:a,"handle-event-click":M,"handle-drag-start":o}),null,16,["config","read-only","event","day"])]),default:e.withCtx(()=>[e.renderSlot(u.$slots,"eventMenu",{event:c},void 0,!0)]),_:2},1024)])):(e.openBlock(),e.createElementBlock("div",wn,[e.createVNode($e,{config:u.config,"read-only":u.readOnly,event:c,day:a,"handle-event-click":M,"handle-drag-start":o},null,8,["config","read-only","event","day"])]))]))),128))])],42,kn))),128))]))),128))])]))}}),[["__scopeId","data-v-a30ad79d"]]),Cn=["draggable"],Mn={class:"event-content"},En={class:"event-text"},Sn={key:0},_n={class:"event-title"},Bn={key:1,class:"event-subtitle"},bn={class:"event-time"},we=F(e.defineComponent({__name:"WeekEventView",props:{event:{},day:{},dynamicTimeSlots:{},handleEventClick:{type:Function},handleDragStart:{type:Function},config:{},readOnly:{type:Boolean}},setup(r){e.defineComponent({components:{VIcon:D.VIcon}});const l=r,n=(t,s)=>{const[p,f]=(l.config.minTime||"00:00").split(":").map(Number),[V,i]=(l.config.maxTime||"24:00").split(":").map(Number),m=s.hour(p).minute(f).second(0),g=s.hour(V).minute(i).second(0),w=t.startDate.isBefore(m)?m:t.startDate,k=t.endDate.isAfter(g)?g:t.endDate;if(t.endDate.isBefore(m)||t.startDate.isAfter(g))return{display:"none"};const M=w.diff(m,"minute"),y=k.diff(w,"minute"),o=l.config.timeSlotDuration||60,$=l.dynamicTimeSlots.height,C=Math.max(0,M/o*$),b=Math.max(y/o*$,20);return{position:"absolute",top:`${C}px`,height:`${b}px`,left:"4px",right:"4px",backgroundColor:W(t),color:le(t),zIndex:10}};return(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["week-event",{"event-completed":t.event.status==="completed"}]),style:e.normalizeStyle(n(t.event,t.day)),draggable:!t.readOnly,onClick:s[0]||(s[0]=e.withModifiers(p=>t.handleEventClick({event:t.event,nativeEvent:p}),["stop"])),onDragstart:s[1]||(s[1]=p=>t.handleDragStart(t.event,p.target))},[e.createElementVNode("div",Mn,[e.createElementVNode("div",En,[t.event.icon?(e.openBlock(),e.createElementBlock("span",Sn,[e.createVNode(e.unref(D.VIcon),{icon:t.event.icon,size:"small",class:"mr-1"},null,8,["icon"])])):e.createCommentVNode("",!0),e.createElementVNode("span",_n,e.toDisplayString(t.event.title),1),t.event.subtitle?(e.openBlock(),e.createElementBlock("div",Bn,e.toDisplayString(t.event.subtitle),1)):e.createCommentVNode("",!0),e.createElementVNode("div",bn,e.toDisplayString(e.unref(se)(t.event)),1)])])],46,Cn))}}),[["__scopeId","data-v-13ca397d"]]),Tn={class:"week-view"},vn={key:0,class:"time-column-header"},Nn=["onClick"],On={class:"day-name"},Yn={class:"day-number"},zn={key:0,class:"time-column"},Ln={key:0,class:"time-label"},xn={class:"days-container"},Fn=["onClick"],Hn=["onDrop"],In={key:0},Wn={key:1},he=F(e.defineComponent({__name:"WeekView",props:{events:{},currentDate:{},containerHeight:{},config:{},readOnly:{type:Boolean}},emits:["event-click","event-drop","date-click"],setup(r,{emit:l}){e.defineComponent({components:{WeekEventView:we,VMenu:D.VMenu}});const n=r,t=l,s=e.computed(()=>!n.readOnly),{handleDragStart:p,handleDrop:f}=ue(async d=>{t("event-drop",{event:d.event,date:d.date,newEnd:d.newEnd,newStart:d.newStart,oldEnd:d.oldEnd,oldStart:d.oldStart})}),{createLocalizedDayjs:V}=q(),i=e.computed(()=>ke(n.currentDate,n.config.firstDayOfWeek)),m=e.computed(()=>ye(n.config.minTime,n.config.maxTime,n.config.timeSlotDuration)),g=e.computed(()=>{const d=new Map;return i.value.forEach(_=>{const S=_.format("YYYY-MM-DD");d.set(S,J(n.events,_))}),d}),w=e.computed(()=>n.containerHeight||500),k=e.computed(()=>n.config.timeSlotDuration??60),M=e.computed(()=>n.config.minTime||"00:00"),y=e.computed(()=>n.config.maxTime||"24:00"),o=Ve(w,M,y,k,60),$=d=>{const _=d.format("YYYY-MM-DD");return g.value.get(_)||[]},C=d=>{t("event-click",d)},b=d=>{t("date-click",d)},u=(d,_)=>{s.value&&_ instanceof HTMLElement&&(_.style.opacity="0.5",_.style.transform="rotate(3deg)",p(d,_))},T=d=>{document.querySelectorAll(".drag-highlight, .drag-highlight-slot").forEach(_=>{_.classList.remove("drag-highlight","drag-highlight-slot")}),document.querySelectorAll('[style*="opacity: 0.5"]').forEach(_=>{const S=_;S.style.opacity="",S.style.transform=""}),s.value&&f(d)},E=d=>{if(d.preventDefault(),!s.value)return;d.currentTarget.classList.add("drag-highlight")},B=d=>{d.currentTarget.classList.remove("drag-highlight")},a=d=>{if(d.preventDefault(),!s.value)return;d.currentTarget.classList.add("drag-highlight-slot")},c=d=>{d.currentTarget.classList.remove("drag-highlight-slot")};return(d,_)=>(e.openBlock(),e.createElementBlock("div",Tn,[e.createElementVNode("div",{class:e.normalizeClass(["week-header",{"show-time-grid":d.config.showTimeGrid,"hide-time-grid":!d.config.showTimeGrid}])},[d.config.showTimeGrid?(e.openBlock(),e.createElementBlock("div",vn)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,S=>(e.openBlock(),e.createElementBlock("div",{key:S.format("YYYY-MM-DD"),class:e.normalizeClass(["day-header",{today:e.unref(U)(S),weekend:e.unref(G)(S)}]),onClick:N=>b({date:S,nativeEvent:N})},[e.createElementVNode("div",On,e.toDisplayString(e.unref(V)(S).format("ddd")),1),e.createElementVNode("div",Yn,e.toDisplayString(e.unref(V)(S).format("D")),1)],10,Nn))),128))],2),e.createElementVNode("div",{class:e.normalizeClass(["week-body",{"show-time-grid":d.config.showTimeGrid,"hide-time-grid":!d.config.showTimeGrid}])},[d.config.showTimeGrid?(e.openBlock(),e.createElementBlock("div",zn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,S=>(e.openBlock(),e.createElementBlock("div",{key:`${S.hour}-${S.minute}`,class:"time-slot",style:e.normalizeStyle({height:`${e.unref(o).height}px`,width:d.config.showTimeGrid?"100%":"1px"})},[d.config.showTimeGrid?(e.openBlock(),e.createElementBlock("span",Ln,e.toDisplayString(S.label),1)):e.createCommentVNode("",!0)],4))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",xn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,S=>(e.openBlock(),e.createElementBlock("div",{key:S.format("YYYY-MM-DD"),class:e.normalizeClass(["day-column",{today:e.unref(U)(S),weekend:e.unref(G)(S)}]),onClick:N=>b({date:S,nativeEvent:N}),onDragover:e.withModifiers(E,["prevent"]),onDragleave:B},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,N=>(e.openBlock(),e.createElementBlock("div",{key:`${S.format("YYYY-MM-DD")}-${N.hour}-${N.minute}`,class:e.normalizeClass(["time-slot",{"time-grid":d.config.showTimeGrid}]),style:e.normalizeStyle({height:`${e.unref(o).height}px`}),onDrop:z=>T(S.startOf("day").add(N.hour,"hour").add(N.minute,"minute")),onDragover:e.withModifiers(a,["prevent"]),onDragleave:c},null,46,Hn))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($(S),N=>(e.openBlock(),e.createElementBlock("div",{key:N.id},[d.$slots.eventMenu?(e.openBlock(),e.createElementBlock("div",In,[e.createVNode(e.unref(D.VMenu),null,{activator:e.withCtx(({props:z})=>[e.createVNode(we,e.mergeProps({ref_for:!0},z,{config:d.config,"read-only":d.readOnly,event:N,day:S,"dynamic-time-slots":e.unref(o),"handle-event-click":C,"handle-drag-start":u}),null,16,["config","read-only","event","day","dynamic-time-slots"])]),default:e.withCtx(()=>[e.renderSlot(d.$slots,"eventMenu",{event:N},void 0,!0)]),_:2},1024)])):(e.openBlock(),e.createElementBlock("div",Wn,[e.createVNode(we,{config:d.config,"read-only":d.readOnly,event:N,day:S,"dynamic-time-slots":e.unref(o),"handle-event-click":C,"handle-drag-start":u},null,8,["config","read-only","event","day","dynamic-time-slots"])]))]))),128))],42,Fn))),128))])],2)]))}}),[["__scopeId","data-v-81f49a20"]]),An={class:"calendar-component"},Ae=F(e.defineComponent({__name:"CalendarComponent",props:e.mergeModels({events:{},view:{},currentDate:{},filters:{},lazyLoad:{type:Function},config:{},readOnly:{type:Boolean}},{events:{default:()=>[]},eventsModifiers:{},currentDate:{default:()=>O()},currentDateModifiers:{},currentView:{},currentViewModifiers:{}}),emits:e.mergeModels(["view-change","date-change","event-click","event-drop","