vue-cal 4.3.1 → 4.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/README.md +3 -3
  2. package/dist/drag-and-drop.amd.js +3 -3
  3. package/dist/drag-and-drop.cjs.js +3 -3
  4. package/dist/drag-and-drop.es.js +11 -40
  5. package/dist/i18n/ar.amd.js +2 -2
  6. package/dist/i18n/ar.cjs.js +2 -2
  7. package/dist/i18n/ar.es.js +2 -2
  8. package/dist/i18n/bg.amd.js +2 -2
  9. package/dist/i18n/bg.cjs.js +2 -2
  10. package/dist/i18n/bg.es.js +2 -2
  11. package/dist/i18n/bn.amd.js +2 -2
  12. package/dist/i18n/bn.cjs.js +2 -2
  13. package/dist/i18n/bn.es.js +2 -2
  14. package/dist/i18n/bs.amd.js +2 -2
  15. package/dist/i18n/bs.cjs.js +2 -2
  16. package/dist/i18n/bs.es.js +2 -2
  17. package/dist/i18n/ca.amd.js +2 -2
  18. package/dist/i18n/ca.cjs.js +2 -2
  19. package/dist/i18n/ca.es.js +2 -2
  20. package/dist/i18n/cs.amd.js +2 -2
  21. package/dist/i18n/cs.cjs.js +2 -2
  22. package/dist/i18n/cs.es.js +2 -2
  23. package/dist/i18n/da.amd.js +2 -2
  24. package/dist/i18n/da.cjs.js +2 -2
  25. package/dist/i18n/da.es.js +2 -2
  26. package/dist/i18n/de.amd.js +2 -2
  27. package/dist/i18n/de.cjs.js +2 -2
  28. package/dist/i18n/de.es.js +2 -2
  29. package/dist/i18n/el.amd.js +2 -2
  30. package/dist/i18n/el.cjs.js +2 -2
  31. package/dist/i18n/el.es.js +2 -2
  32. package/dist/i18n/en.amd.js +2 -2
  33. package/dist/i18n/en.cjs.js +2 -2
  34. package/dist/i18n/en.es.js +2 -2
  35. package/dist/i18n/es.amd.js +2 -2
  36. package/dist/i18n/es.cjs.js +2 -2
  37. package/dist/i18n/es.es.js +2 -2
  38. package/dist/i18n/fa.amd.js +2 -2
  39. package/dist/i18n/fa.cjs.js +2 -2
  40. package/dist/i18n/fa.es.js +2 -2
  41. package/dist/i18n/fr.amd.js +2 -2
  42. package/dist/i18n/fr.cjs.js +2 -2
  43. package/dist/i18n/fr.es.js +2 -2
  44. package/dist/i18n/he.amd.js +2 -2
  45. package/dist/i18n/he.cjs.js +2 -2
  46. package/dist/i18n/he.es.js +2 -2
  47. package/dist/i18n/hr.amd.js +2 -2
  48. package/dist/i18n/hr.cjs.js +2 -2
  49. package/dist/i18n/hr.es.js +2 -2
  50. package/dist/i18n/hu.amd.js +2 -2
  51. package/dist/i18n/hu.cjs.js +2 -2
  52. package/dist/i18n/hu.es.js +2 -2
  53. package/dist/i18n/id.amd.js +2 -2
  54. package/dist/i18n/id.cjs.js +2 -2
  55. package/dist/i18n/id.es.js +2 -2
  56. package/dist/i18n/is.amd.js +2 -2
  57. package/dist/i18n/is.cjs.js +2 -2
  58. package/dist/i18n/is.es.js +2 -2
  59. package/dist/i18n/it.amd.js +2 -2
  60. package/dist/i18n/it.cjs.js +2 -2
  61. package/dist/i18n/it.es.js +2 -2
  62. package/dist/i18n/ja.amd.js +2 -2
  63. package/dist/i18n/ja.cjs.js +2 -2
  64. package/dist/i18n/ja.es.js +2 -2
  65. package/dist/i18n/ka.amd.js +2 -2
  66. package/dist/i18n/ka.cjs.js +2 -2
  67. package/dist/i18n/ka.es.js +2 -2
  68. package/dist/i18n/ko.amd.js +2 -2
  69. package/dist/i18n/ko.cjs.js +2 -2
  70. package/dist/i18n/ko.es.js +2 -2
  71. package/dist/i18n/lt.amd.js +2 -2
  72. package/dist/i18n/lt.cjs.js +2 -2
  73. package/dist/i18n/lt.es.js +2 -2
  74. package/dist/i18n/mn.amd.js +2 -2
  75. package/dist/i18n/mn.cjs.js +2 -2
  76. package/dist/i18n/mn.es.js +2 -2
  77. package/dist/i18n/nl.amd.js +2 -2
  78. package/dist/i18n/nl.cjs.js +2 -2
  79. package/dist/i18n/nl.es.js +2 -2
  80. package/dist/i18n/no.amd.js +2 -2
  81. package/dist/i18n/no.cjs.js +2 -2
  82. package/dist/i18n/no.es.js +2 -2
  83. package/dist/i18n/pl.amd.js +2 -2
  84. package/dist/i18n/pl.cjs.js +2 -2
  85. package/dist/i18n/pl.es.js +2 -2
  86. package/dist/i18n/pt-br.amd.js +2 -2
  87. package/dist/i18n/pt-br.cjs.js +2 -2
  88. package/dist/i18n/pt-br.es.js +2 -2
  89. package/dist/i18n/ro.amd.js +2 -2
  90. package/dist/i18n/ro.cjs.js +2 -2
  91. package/dist/i18n/ro.es.js +2 -2
  92. package/dist/i18n/ru.amd.js +2 -2
  93. package/dist/i18n/ru.cjs.js +2 -2
  94. package/dist/i18n/ru.es.js +2 -2
  95. package/dist/i18n/sk.amd.js +2 -2
  96. package/dist/i18n/sk.cjs.js +2 -2
  97. package/dist/i18n/sk.es.js +2 -2
  98. package/dist/i18n/sl.amd.js +2 -2
  99. package/dist/i18n/sl.cjs.js +2 -2
  100. package/dist/i18n/sl.es.js +2 -2
  101. package/dist/i18n/sq.amd.js +2 -2
  102. package/dist/i18n/sq.cjs.js +2 -2
  103. package/dist/i18n/sq.es.js +2 -2
  104. package/dist/i18n/sr.amd.js +2 -2
  105. package/dist/i18n/sr.cjs.js +2 -2
  106. package/dist/i18n/sr.es.js +2 -2
  107. package/dist/i18n/sv.amd.js +2 -2
  108. package/dist/i18n/sv.cjs.js +2 -2
  109. package/dist/i18n/sv.es.js +2 -2
  110. package/dist/i18n/tr.amd.js +2 -2
  111. package/dist/i18n/tr.cjs.js +2 -2
  112. package/dist/i18n/tr.es.js +2 -2
  113. package/dist/i18n/uk.amd.js +2 -2
  114. package/dist/i18n/uk.cjs.js +2 -2
  115. package/dist/i18n/uk.es.js +2 -2
  116. package/dist/i18n/vi.amd.js +2 -2
  117. package/dist/i18n/vi.cjs.js +2 -2
  118. package/dist/i18n/vi.es.js +2 -2
  119. package/dist/i18n/zh-cn.amd.js +2 -2
  120. package/dist/i18n/zh-cn.cjs.js +2 -2
  121. package/dist/i18n/zh-cn.es.js +2 -2
  122. package/dist/i18n/zh-hk.amd.js +2 -2
  123. package/dist/i18n/zh-hk.cjs.js +2 -2
  124. package/dist/i18n/zh-hk.es.js +2 -2
  125. package/dist/vue-cal.amd.js +4 -4
  126. package/dist/vue-cal.cjs.js +4 -4
  127. package/dist/vue-cal.es.js +76 -93
  128. package/dist/vue-cal.iife.js +2 -6
  129. package/dist/vuecal.css +1 -0
  130. package/package.json +35 -25
  131. package/dist/vue-cal.css +0 -1
@@ -1,6 +1,6 @@
1
- "use strict";var U=Object.defineProperty,R=Object.defineProperties;var K=Object.getOwnPropertyDescriptors;var x=Object.getOwnPropertySymbols;var X=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var W=(t,e,s)=>e in t?U(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,w=(t,e)=>{for(var s in e||(e={}))X.call(e,s)&&W(t,s,e[s]);if(x)for(var s of x(e))G.call(e,s)&&W(t,s,e[s]);return t},_=(t,e)=>R(t,K(e));var E=(t,e,s)=>(W(t,typeof e!="symbol"?e+"":e,s),s);/*!
2
- * vue-cal v4.3.1
1
+ "use strict";var z=Object.defineProperty;var P=(t,e,s)=>e in t?z(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var k=(t,e,s)=>(P(t,typeof e!="symbol"?e+"":e,s),s);/**
2
+ * vue-cal v4.3.4
3
3
  * (c) 2022 Antoni Andre <antoniandre.web@gmail.com>
4
4
  * @license MIT
5
- */var i=require("vue");let V,L,F,p,B={},M={};class Z{constructor(e,s=!1){E(this,"texts",{});E(this,"dateToMinutes",e=>e.getHours()*60+e.getMinutes());p=this,this._texts=e,!s&&Date&&!Date.prototype.addDays&&this._initDatePrototypes()}_initDatePrototypes(){Date.prototype.addDays=function(e){return p.addDays(this,e)},Date.prototype.subtractDays=function(e){return p.subtractDays(this,e)},Date.prototype.addHours=function(e){return p.addHours(this,e)},Date.prototype.subtractHours=function(e){return p.subtractHours(this,e)},Date.prototype.addMinutes=function(e){return p.addMinutes(this,e)},Date.prototype.subtractMinutes=function(e){return p.subtractMinutes(this,e)},Date.prototype.getWeek=function(){return p.getWeek(this)},Date.prototype.isToday=function(){return p.isToday(this)},Date.prototype.isLeapYear=function(){return p.isLeapYear(this)},Date.prototype.format=function(e="YYYY-MM-DD"){return p.formatDate(this,e)},Date.prototype.formatTime=function(e="HH:mm"){return p.formatTime(this,e)}}removePrototypes(){delete Date.prototype.addDays,delete Date.prototype.subtractDays,delete Date.prototype.addHours,delete Date.prototype.subtractHours,delete Date.prototype.addMinutes,delete Date.prototype.subtractMinutes,delete Date.prototype.getWeek,delete Date.prototype.isToday,delete Date.prototype.isLeapYear,delete Date.prototype.format,delete Date.prototype.formatTime}updateTexts(e){this._texts=e}_todayFormatted(){return L!==new Date().getDate()&&(V=new Date,L=V.getDate(),F=`${V.getFullYear()}-${V.getMonth()}-${V.getDate()}`),F}addDays(e,s){const l=new Date(e.valueOf());return l.setDate(l.getDate()+s),l}subtractDays(e,s){const l=new Date(e.valueOf());return l.setDate(l.getDate()-s),l}addHours(e,s){const l=new Date(e.valueOf());return l.setHours(l.getHours()+s),l}subtractHours(e,s){const l=new Date(e.valueOf());return l.setHours(l.getHours()-s),l}addMinutes(e,s){const l=new Date(e.valueOf());return l.setMinutes(l.getMinutes()+s),l}subtractMinutes(e,s){const l=new Date(e.valueOf());return l.setMinutes(l.getMinutes()-s),l}getWeek(e){const s=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())),l=s.getUTCDay()||7;s.setUTCDate(s.getUTCDate()+4-l);const r=new Date(Date.UTC(s.getUTCFullYear(),0,1));return Math.ceil(((s-r)/864e5+1)/7)}isToday(e){return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`===this._todayFormatted()}isLeapYear(e){const s=e.getFullYear();return!(s%400)||s%100&&!(s%4)}getPreviousFirstDayOfWeek(e=null,s){const l=e&&new Date(e.valueOf())||new Date,r=s?7:6;return l.setDate(l.getDate()-(l.getDay()+r)%7),l}stringToDate(e){return e instanceof Date?e:(e.length===10&&(e+=" 00:00"),new Date(e.replace(/-/g,"/")))}countDays(e,s){typeof e=="string"&&(e=e.replace(/-/g,"/")),typeof s=="string"&&(s=s.replace(/-/g,"/")),e=new Date(e).setHours(0,0,0,0),s=new Date(s).setHours(0,0,1,0);const l=(new Date(s).getTimezoneOffset()-new Date(e).getTimezoneOffset())*60*1e3;return Math.ceil((s-e-l)/(24*3600*1e3))}datesInSameTimeStep(e,s,l){return Math.abs(e.getTime()-s.getTime())<=l*60*1e3}formatDate(e,s="YYYY-MM-DD",l=null){if(l||(l=this._texts),s||(s="YYYY-MM-DD"),s==="YYYY-MM-DD")return this.formatDateLite(e);B={},M={};const r={YYYY:()=>this._hydrateDateObject(e,l).YYYY,YY:()=>this._hydrateDateObject(e,l).YY(),M:()=>this._hydrateDateObject(e,l).M,MM:()=>this._hydrateDateObject(e,l).MM(),MMM:()=>this._hydrateDateObject(e,l).MMM(),MMMM:()=>this._hydrateDateObject(e,l).MMMM(),MMMMG:()=>this._hydrateDateObject(e,l).MMMMG(),D:()=>this._hydrateDateObject(e,l).D,DD:()=>this._hydrateDateObject(e,l).DD(),S:()=>this._hydrateDateObject(e,l).S(),d:()=>this._hydrateDateObject(e,l).d,dd:()=>this._hydrateDateObject(e,l).dd(),ddd:()=>this._hydrateDateObject(e,l).ddd(),dddd:()=>this._hydrateDateObject(e,l).dddd(),HH:()=>this._hydrateTimeObject(e,l).HH,H:()=>this._hydrateTimeObject(e,l).H,hh:()=>this._hydrateTimeObject(e,l).hh,h:()=>this._hydrateTimeObject(e,l).h,am:()=>this._hydrateTimeObject(e,l).am,AM:()=>this._hydrateTimeObject(e,l).AM,mm:()=>this._hydrateTimeObject(e,l).mm,m:()=>this._hydrateTimeObject(e,l).m};return s.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g,(n,o)=>{const a=r[o.replace(/\{|\}/g,"")];return a!==void 0?a():o})}formatDateLite(e){const s=e.getMonth()+1,l=e.getDate();return`${e.getFullYear()}-${s<10?"0":""}${s}-${l<10?"0":""}${l}`}formatTime(e,s="HH:mm",l=null,r=!1){let n=!1;if(r){const[u,d,c]=[e.getHours(),e.getMinutes(),e.getSeconds()];u+d+c===23+59+59&&(n=!0)}if(e instanceof Date&&s==="HH:mm")return n?"24:00":this.formatTimeLite(e);M={},l||(l=this._texts);const o=this._hydrateTimeObject(e,l),a=s.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g,(u,d)=>{const c=o[d.replace(/\{|\}/g,"")];return c!==void 0?c:d});return n?a.replace("23:59","24:00"):a}formatTimeLite(e){const s=e.getHours(),l=e.getMinutes();return`${(s<10?"0":"")+s}:${(l<10?"0":"")+l}`}_nth(e){if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}_hydrateDateObject(e,s){if(B.D)return B;const l=e.getFullYear(),r=e.getMonth()+1,n=e.getDate(),a=(e.getDay()-1+7)%7;return B={YYYY:l,YY:()=>l.toString().substring(2),M:r,MM:()=>(r<10?"0":"")+r,MMM:()=>s.months[r-1].substring(0,3),MMMM:()=>s.months[r-1],MMMMG:()=>(s.monthsGenitive||s.months)[r-1],D:n,DD:()=>(n<10?"0":"")+n,S:()=>this._nth(n),d:a+1,dd:()=>s.weekDays[a][0],ddd:()=>s.weekDays[a].substr(0,3),dddd:()=>s.weekDays[a]},B}_hydrateTimeObject(e,s){if(M.am)return M;let l,r;e instanceof Date?(l=e.getHours(),r=e.getMinutes()):(l=Math.floor(e/60),r=Math.floor(e%60));const n=l%12?l%12:12,o=(s||{am:"am",pm:"pm"})[l===24||l<12?"am":"pm"];return M={H:l,h:n,HH:(l<10?"0":"")+l,hh:(n<10?"0":"")+n,am:o,AM:o.toUpperCase(),m:r,mm:(r<10?"0":"")+r},M}}const J=24*60;class Q{constructor(e){E(this,"_vuecal",null);E(this,"selectCell",(e=!1,s,l)=>{this._vuecal.$emit("cell-click",l?{date:s,split:l}:s),this._vuecal.clickToNavigate||e?this._vuecal.switchToNarrowerView():this._vuecal.dblclickToNavigate&&"ontouchstart"in window&&(this._vuecal.domEvents.dblTapACell.taps++,setTimeout(()=>this._vuecal.domEvents.dblTapACell.taps=0,this._vuecal.domEvents.dblTapACell.timeout),this._vuecal.domEvents.dblTapACell.taps>=2&&(this._vuecal.domEvents.dblTapACell.taps=0,this._vuecal.switchToNarrowerView(),this._vuecal.$emit("cell-dblclick",l?{date:s,split:l}:s)))});E(this,"keyPressEnterCell",(e,s)=>{this._vuecal.$emit("cell-keypress-enter",s?{date:e,split:s}:e),this._vuecal.switchToNarrowerView()});E(this,"getPosition",e=>{const{left:s,top:l}=this._vuecal.cellsEl.getBoundingClientRect(),{clientX:r,clientY:n}="ontouchstart"in window&&e.touches?e.touches[0]:e;return{x:r-s,y:n-l}});E(this,"minutesAtCursor",e=>{let s=0,l={x:0,y:0};const{timeStep:r,timeCellHeight:n,timeFrom:o}=this._vuecal.$props;return typeof e=="number"?s=e:typeof e=="object"&&(l=this.getPosition(e),s=Math.round(l.y*r/parseInt(n)+o)),{minutes:Math.max(Math.min(s,J),0),cursorCoords:l}});this._vuecal=e}}const $=2,H=24*60;let f,y,A;class ee{constructor(e,s){E(this,"_vuecal",null);E(this,"eventDefaults",{_eid:null,start:"",startTimeMinutes:0,end:"",endTimeMinutes:0,title:"",content:"",background:!1,allDay:!1,segments:null,repeat:null,daysCount:1,deletable:!0,deleting:!1,titleEditable:!0,resizable:!0,resizing:!1,draggable:!0,dragging:!1,draggingStatic:!1,focused:!1,class:""});this._vuecal=e,f=s}createAnEvent(e,s,l){if(typeof e=="string"&&(e=f.stringToDate(e)),!(e instanceof Date))return!1;const r=f.dateToMinutes(e);s=s*1||$*60;const n=r+s,o=f.addMinutes(new Date(e),s);l.end&&(typeof l.end=="string"&&(l.end=f.stringToDate(l.end)),l.endTimeMinutes=f.dateToMinutes(l.end));const a=w(_(w({},this.eventDefaults),{_eid:`${this._vuecal._.uid}_${this._vuecal.eventIdIncrement++}`,start:e,startTimeMinutes:r,end:o,endTimeMinutes:n,segments:null}),l);if(!(typeof this._vuecal.onEventCreate=="function"&&!this._vuecal.onEventCreate(a,()=>this.deleteAnEvent(a))))return a.startDateF!==a.endDateF&&(a.daysCount=f.countDays(a.start,a.end)),this._vuecal.mutableEvents.push(a),this._vuecal.addEventsToView([a]),this._vuecal.emitWithEvent("event-create",a),this._vuecal.$emit("event-change",{event:this._vuecal.cleanupEvent(a),originalEvent:null}),a}addEventSegment(e){e.segments||(e.segments={},e.segments[f.formatDateLite(e.start)]={start:e.start,startTimeMinutes:e.startTimeMinutes,endTimeMinutes:H,isFirstDay:!0,isLastDay:!1});const s=e.segments[f.formatDateLite(e.end)];s&&(s.isLastDay=!1,s.endTimeMinutes=H);const l=f.addDays(e.end,1),r=f.formatDateLite(l);return l.setHours(0,0,0,0),e.segments[r]={start:l,startTimeMinutes:0,endTimeMinutes:e.endTimeMinutes,isFirstDay:!1,isLastDay:!0},e.end=f.addMinutes(l,e.endTimeMinutes),e.daysCount=Object.keys(e.segments).length,r}removeEventSegment(e){let s=Object.keys(e.segments).length;if(s<=1)return f.formatDateLite(e.end);delete e.segments[f.formatDateLite(e.end)],s--;const l=f.subtractDays(e.end,1),r=f.formatDateLite(l),n=e.segments[r];return s?n&&(n.isLastDay=!0,n.endTimeMinutes=e.endTimeMinutes):e.segments=null,e.daysCount=s||1,e.end=l,r}createEventSegments(e,s,l){const r=s.getTime(),n=l.getTime();let o=e.start.getTime(),a=e.end.getTime(),u=!1,d,c,v;for(!e.end.getHours()&&!e.end.getMinutes()&&(a-=1e3),e.segments={},e.repeat?(d=r,c=Math.min(n,e.repeat.until?f.stringToDate(e.repeat.until).getTime():n)):(d=Math.max(r,o),c=Math.min(n,a));d<=c;){let h=!1;const D=f.addDays(new Date(d),1).setHours(0,0,0,0);let m,k,C,g;if(e.repeat){const T=new Date(d),b=f.formatDateLite(T);(u||e.occurrences&&e.occurrences[b])&&(u||(o=e.occurrences[b].start,v=new Date(o).setHours(0,0,0,0),a=e.occurrences[b].end),u=!0,h=!0),m=d===v,k=b===f.formatDateLite(new Date(a)),C=new Date(m?o:d),g=f.formatDateLite(C),k&&(u=!1)}else h=!0,m=d===o,k=c===a&&D>c,C=m?e.start:new Date(d),g=f.formatDateLite(m?e.start:C);h&&(e.segments[g]={start:C,startTimeMinutes:m?e.startTimeMinutes:0,endTimeMinutes:k?e.endTimeMinutes:H,isFirstDay:m,isLastDay:k}),d=D}return e}deleteAnEvent(e){this._vuecal.emitWithEvent("event-delete",e),this._vuecal.mutableEvents=this._vuecal.mutableEvents.filter(s=>s._eid!==e._eid),this._vuecal.view.events=this._vuecal.view.events.filter(s=>s._eid!==e._eid)}checkCellOverlappingEvents(e,s){A=e.slice(0),y={},e.forEach(r=>{A.shift(),y[r._eid]||(y[r._eid]={overlaps:[],start:r.start,position:0}),y[r._eid].position=0,A.forEach(n=>{y[n._eid]||(y[n._eid]={overlaps:[],start:n.start,position:0});const o=this.eventInRange(n,r.start,r.end),a=s.overlapsPerTimeStep?f.datesInSameTimeStep(r.start,n.start,s.timeStep):1;if(!r.background&&!r.allDay&&!n.background&&!n.allDay&&o&&a)y[r._eid].overlaps.push(n._eid),y[r._eid].overlaps=[...new Set(y[r._eid].overlaps)],y[n._eid].overlaps.push(r._eid),y[n._eid].overlaps=[...new Set(y[n._eid].overlaps)],y[n._eid].position++;else{let u,d;(u=(y[r._eid]||{overlaps:[]}).overlaps.indexOf(n._eid))>-1&&y[r._eid].overlaps.splice(u,1),(d=(y[n._eid]||{overlaps:[]}).overlaps.indexOf(r._eid))>-1&&y[n._eid].overlaps.splice(d,1),y[n._eid].position--}})});let l=0;for(const r in y){const n=y[r],o=n.overlaps.map(a=>({id:a,start:y[a].start}));o.push({id:r,start:n.start}),o.sort((a,u)=>a.start<u.start?-1:a.start>u.start?1:a.id>u.id?-1:1),n.position=o.findIndex(a=>a.id===r),l=Math.max(this.getOverlapsStreak(n,y),l)}return[y,l]}getOverlapsStreak(e,s={}){let l=e.overlaps.length+1,r=[];return e.overlaps.forEach(n=>{r.includes(n)||e.overlaps.filter(a=>a!==n).forEach(a=>{s[a].overlaps.includes(n)||r.push(a)})}),r=[...new Set(r)],l-=r.length,l}eventInRange(e,s,l){if(e.allDay||!this._vuecal.time){const o=new Date(e.start).setHours(0,0,0,0);return new Date(e.end).setHours(23,59,0,0)>=new Date(s).setHours(0,0,0,0)&&o<=new Date(l).setHours(0,0,0,0)}const r=e.start.getTime(),n=e.end.getTime();return r<l.getTime()&&n>s.getTime()}}const te={class:"vuecal__flex vuecal__weekdays-headings"},se=["onClick"],ie={class:"vuecal__flex weekday-label",grow:""},ne={class:"full"},le={class:"small"},ae={class:"xsmall"},re={key:0},oe={key:0,class:"vuecal__flex vuecal__split-days-headers",grow:""};function de(t,e,s,l,r,n){return i.openBlock(),i.createElementBlock("div",te,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.headings,(o,a)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:a},[o.hide?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["vuecal__flex vuecal__heading",{today:o.today,clickable:n.cellHeadingsClickable}]),style:i.normalizeStyle(n.weekdayCellStyles),onClick:u=>n.view.id==="week"&&n.selectCell(o.date,u),onDblclick:e[0]||(e[0]=u=>n.view.id==="week"&&n.vuecal.dblclickToNavigate&&s.switchToNarrowerView())},[i.createVNode(i.Transition,{name:`slide-fade--${s.transitionDirection}`,appear:n.vuecal.transitions},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("div",{class:"vuecal__flex",column:"",key:n.vuecal.transitions?`${a}-${o.dayOfMonth}`:!1},[i.createElementVNode("div",ie,[i.renderSlot(t.$slots,"weekday-heading",{heading:n.cleanupHeading(o),view:n.view},()=>[i.createElementVNode("span",ne,i.toDisplayString(o.full),1),i.createElementVNode("span",le,i.toDisplayString(o.small),1),i.createElementVNode("span",ae,i.toDisplayString(o.xsmall),1),o.dayOfMonth?(i.openBlock(),i.createElementBlock("span",re,"\xA0"+i.toDisplayString(o.dayOfMonth),1)):i.createCommentVNode("",!0)])]),n.vuecal.hasSplits&&n.vuecal.stickySplitLabels?(i.openBlock(),i.createElementBlock("div",oe,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.vuecal.daySplits,(u,d)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["day-split-header",u.class||!1]),key:d},[i.renderSlot(t.$slots,"split-label",{split:u,view:n.view},()=>[i.createTextVNode(i.toDisplayString(u.label),1)])],2))),128))])):i.createCommentVNode("",!0)]))]),_:2},1032,["name","appear"])],46,se))],64))),128))])}var S=(t,e)=>{const s=t.__vccOpts||t;for(const[l,r]of e)s[l]=r;return s};const ue={inject:["vuecal","utils","view"],props:{transitionDirection:{type:String,default:"right"},weekDays:{type:Array,default:()=>[]},switchToNarrowerView:{type:Function,default:()=>{}}},methods:{selectCell(t,e){t.getTime()!==this.view.selectedDate.getTime()&&(this.view.selectedDate=t),this.utils.cell.selectCell(!1,t,e)},cleanupHeading:t=>w({label:t.full,date:t.date},t.today?{today:t.today}:{})},computed:{headings(){if(!["month","week"].includes(this.view.id))return[];let t=!1;return this.weekDays.map((s,l)=>{const r=this.utils.date.addDays(this.view.startDate,l);return w({hide:s.hide,full:s.label,small:s.short||s.label.substr(0,3),xsmall:s.short||s.label.substr(0,1)},this.view.id==="week"?{dayOfMonth:r.getDate(),date:r,today:!t&&this.utils.date.isToday(r)&&!t++}:{})})},cellWidth(){return 100/(7-this.weekDays.reduce((t,e)=>t+e.hide,0))},weekdayCellStyles(){return w({},this.vuecal.hideWeekdays.length?{width:`${this.cellWidth}%`}:{})},cellHeadingsClickable(){return this.view.id==="week"&&(this.vuecal.clickToNavigate||this.vuecal.dblclickToNavigate)}}};var P=S(ue,[["render",de]]);const ce={class:"vuecal__header"},he={key:0,class:"vuecal__flex vuecal__menu",role:"tablist","aria-label":"Calendar views navigation"},ve=["onDragenter","onDragleave","onClick","aria-label"],me={key:1,class:"vuecal__title-bar"},fe=["aria-label"],ye={class:"vuecal__flex vuecal__title",grow:""},we=["aria-label"],De={key:0,class:"vuecal__flex vuecal__split-days-headers"};function ge(t,e,s,l,r,n){const o=i.resolveComponent("weekdays-headings");return i.openBlock(),i.createElementBlock("div",ce,[s.options.hideViewSelector?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",he,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.viewProps.views,(a,u)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:u},[a.enabled?(i.openBlock(),i.createElementBlock("button",{key:0,class:i.normalizeClass(["vuecal__view-btn",{"vuecal__view-btn--active":n.view.id===u,"vuecal__view-btn--highlighted":t.highlightedControl===u}]),type:"button",onDragenter:d=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragEnter(d,u,t.$data),onDragleave:d=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragLeave(d,u,t.$data),onClick:d=>n.switchView(u,null,!0),"aria-label":`${a.label} view`},i.toDisplayString(a.label),43,ve)):i.createCommentVNode("",!0)],64))),128))])),s.options.hideTitleBar?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",me,[i.createElementVNode("button",{class:i.normalizeClass(["vuecal__arrow vuecal__arrow--prev",{"vuecal__arrow--highlighted":t.highlightedControl==="previous"}]),type:"button",onClick:e[0]||(e[0]=(...a)=>n.previous&&n.previous(...a)),onDragenter:e[1]||(e[1]=a=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragEnter(a,"previous",t.$data)),onDragleave:e[2]||(e[2]=a=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragLeave(a,"previous",t.$data)),"aria-label":`Previous ${n.view.id}`},[i.renderSlot(t.$slots,"arrow-prev")],42,fe),i.createElementVNode("div",ye,[i.createVNode(i.Transition,{name:s.options.transitions?`slide-fade--${n.transitionDirection}`:""},{default:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.broaderView?"button":"span"),{type:!!n.broaderView&&"button",key:`${n.view.id}${n.view.startDate.toString()}`,onClick:e[3]||(e[3]=a=>!!n.broaderView&&n.switchToBroaderView()),"aria-label":!!n.broaderView&&`Go to ${n.broaderView} view`},{default:i.withCtx(()=>[i.renderSlot(t.$slots,"title")]),_:3},8,["type","aria-label"]))]),_:3},8,["name"])]),s.options.todayButton?(i.openBlock(),i.createElementBlock("button",{key:0,class:i.normalizeClass(["vuecal__today-btn",{"vuecal__today-btn--highlighted":t.highlightedControl==="today"}]),type:"button",onClick:e[4]||(e[4]=(...a)=>n.goToToday&&n.goToToday(...a)),onDragenter:e[5]||(e[5]=a=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragEnter(a,"today",t.$data)),onDragleave:e[6]||(e[6]=a=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragLeave(a,"today",t.$data)),"aria-label":"Today"},[i.renderSlot(t.$slots,"today-button")],34)):i.createCommentVNode("",!0),i.createElementVNode("button",{class:i.normalizeClass(["vuecal__arrow vuecal__arrow--next",{"vuecal__arrow--highlighted":t.highlightedControl==="next"}]),type:"button",onClick:e[7]||(e[7]=(...a)=>n.next&&n.next(...a)),onDragenter:e[8]||(e[8]=a=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragEnter(a,"next",t.$data)),onDragleave:e[9]||(e[9]=a=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragLeave(a,"next",t.$data)),"aria-label":`Next ${n.view.id}`},[i.renderSlot(t.$slots,"arrow-next")],42,we)])),s.viewProps.weekDaysInHeader?(i.openBlock(),i.createBlock(o,{key:2,"week-days":s.weekDays,"transition-direction":n.transitionDirection,"switch-to-narrower-view":s.switchToNarrowerView},i.createSlots({_:2},[t.$slots["weekday-heading"]?{name:"weekday-heading",fn:i.withCtx(({heading:a,view:u})=>[i.renderSlot(t.$slots,"weekday-heading",{heading:a,view:u})])}:void 0,t.$slots["split-label"]?{name:"split-label",fn:i.withCtx(({split:a})=>[i.renderSlot(t.$slots,"split-label",{split:a,view:n.view})])}:void 0]),1032,["week-days","transition-direction","switch-to-narrower-view"])):i.createCommentVNode("",!0),i.createVNode(i.Transition,{name:`slide-fade--${n.transitionDirection}`},{default:i.withCtx(()=>[n.showDaySplits?(i.openBlock(),i.createElementBlock("div",De,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.daySplits,(a,u)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["day-split-header",a.class||!1]),key:u},[i.renderSlot(t.$slots,"split-label",{split:a,view:n.view.id},()=>[i.createTextVNode(i.toDisplayString(a.label),1)])],2))),128))])):i.createCommentVNode("",!0)]),_:3},8,["name"])])}const pe={inject:["vuecal","previous","next","switchView","updateSelectedDate","modules","view"],components:{WeekdaysHeadings:P},props:{options:{type:Object,default:()=>({})},editEvents:{type:Object,required:!0},hasSplits:{type:[Boolean,Number],default:!1},daySplits:{type:Array,default:()=>[]},viewProps:{type:Object,default:()=>({})},weekDays:{type:Array,default:()=>[]},switchToNarrowerView:{type:Function,default:()=>{}}},data:()=>({highlightedControl:null}),methods:{goToToday(){this.updateSelectedDate(new Date(new Date().setHours(0,0,0,0)))},switchToBroaderView(){this.transitionDirection="left",this.broaderView&&this.switchView(this.broaderView)}},computed:{transitionDirection:{get(){return this.vuecal.transitionDirection},set(t){this.vuecal.transitionDirection=t}},broaderView(){const{enabledViews:t}=this.vuecal;return t[t.indexOf(this.view.id)-1]},showDaySplits(){return this.view.id==="day"&&this.hasSplits&&this.options.stickySplitLabels&&!this.options.minSplitWidth},dnd(){return this.modules.dnd}}};var ke=S(pe,[["render",ge]]);const _e=["draggable"];function Ee(t,e,s,l,r,n){return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["vuecal__event",n.eventClasses]),style:i.normalizeStyle(n.eventStyles),tabindex:"0",onFocus:e[4]||(e[4]=(...o)=>n.focusEvent&&n.focusEvent(...o)),onKeypress:e[5]||(e[5]=i.withKeys(i.withModifiers((...o)=>n.onEnterKeypress&&n.onEnterKeypress(...o),["stop"]),["enter"])),onMouseenter:e[6]||(e[6]=(...o)=>n.onMouseEnter&&n.onMouseEnter(...o)),onMouseleave:e[7]||(e[7]=(...o)=>n.onMouseLeave&&n.onMouseLeave(...o)),onTouchstart:e[8]||(e[8]=i.withModifiers((...o)=>n.onTouchStart&&n.onTouchStart(...o),["stop"])),onMousedown:e[9]||(e[9]=o=>n.onMouseDown(o)),onMouseup:e[10]||(e[10]=(...o)=>n.onMouseUp&&n.onMouseUp(...o)),onTouchend:e[11]||(e[11]=(...o)=>n.onMouseUp&&n.onMouseUp(...o)),onTouchmove:e[12]||(e[12]=(...o)=>n.onTouchMove&&n.onTouchMove(...o)),onDblclick:e[13]||(e[13]=(...o)=>n.onDblClick&&n.onDblClick(...o)),draggable:n.draggable,onDragstart:e[14]||(e[14]=o=>n.draggable&&n.onDragStart(o)),onDragend:e[15]||(e[15]=o=>n.draggable&&n.onDragEnd())},[n.vuecal.editEvents.delete&&s.event.deletable?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__event-delete",onClick:e[0]||(e[0]=i.withModifiers((...o)=>n.deleteEvent&&n.deleteEvent(...o),["stop"])),onTouchstart:e[1]||(e[1]=i.withModifiers((...o)=>n.touchDeleteEvent&&n.touchDeleteEvent(...o),["stop"]))},i.toDisplayString(n.vuecal.texts.deleteEvent),33)):i.createCommentVNode("",!0),i.renderSlot(t.$slots,"event",{event:s.event,view:n.view.id}),n.resizable?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__event-resize-handle",contenteditable:"false",onMousedown:e[2]||(e[2]=i.withModifiers((...o)=>n.onResizeHandleMouseDown&&n.onResizeHandleMouseDown(...o),["stop","prevent"])),onTouchstart:e[3]||(e[3]=i.withModifiers((...o)=>n.onResizeHandleMouseDown&&n.onResizeHandleMouseDown(...o),["stop","prevent"]))},null,32)):i.createCommentVNode("",!0)],46,_e)}const Ce={inject:["vuecal","utils","modules","view","domEvents","editEvents"],props:{cellFormattedDate:{type:String,default:""},event:{type:Object,default:()=>({})},cellEvents:{type:Array,default:()=>[]},overlaps:{type:Array,default:()=>[]},eventPosition:{type:Number,default:0},overlapsStreak:{type:Number,default:0},allDay:{type:Boolean,default:!1}},data:()=>({touch:{dragThreshold:30,startX:0,startY:0,dragged:!1}}),methods:{onMouseDown(t,e=!1){if("ontouchstart"in window&&!e)return!1;const{clickHoldAnEvent:s,focusAnEvent:l,resizeAnEvent:r,dragAnEvent:n}=this.domEvents;if(l._eid===this.event._eid&&s._eid===this.event._eid)return!0;this.focusEvent(),s._eid=null,this.vuecal.editEvents.delete&&this.event.deletable&&(s.timeoutId=setTimeout(()=>{!r._eid&&!n._eid&&(s._eid=this.event._eid,this.event.deleting=!0)},s.timeout))},onMouseUp(t){this.domEvents.focusAnEvent._eid===this.event._eid&&!this.touch.dragged&&(this.domEvents.focusAnEvent.mousedUp=!0),this.touch.dragged=!1},onMouseEnter(t){t.preventDefault(),this.vuecal.emitWithEvent("event-mouse-enter",this.event)},onMouseLeave(t){t.preventDefault(),this.vuecal.emitWithEvent("event-mouse-leave",this.event)},onTouchMove(t){if(typeof this.vuecal.onEventClick!="function")return;const{clientX:e,clientY:s}=t.touches[0],{startX:l,startY:r,dragThreshold:n}=this.touch;(Math.abs(e-l)>n||Math.abs(s-r)>n)&&(this.touch.dragged=!0)},onTouchStart(t){this.touch.startX=t.touches[0].clientX,this.touch.startY=t.touches[0].clientY,this.onMouseDown(t,!0)},onEnterKeypress(t){if(typeof this.vuecal.onEventClick=="function")return this.vuecal.onEventClick(this.event,t)},onDblClick(t){if(typeof this.vuecal.onEventDblclick=="function")return this.vuecal.onEventDblclick(this.event,t)},onDragStart(t){this.dnd&&this.dnd.eventDragStart(t,this.event)},onDragEnd(){this.dnd&&this.dnd.eventDragEnd(this.event)},onResizeHandleMouseDown(){this.focusEvent(),this.domEvents.dragAnEvent._eid=null,this.domEvents.resizeAnEvent=Object.assign(this.domEvents.resizeAnEvent,{_eid:this.event._eid,start:(this.segment||this.event).start,split:this.event.split||null,segment:!!this.segment&&this.utils.date.formatDateLite(this.segment.start),originalEnd:new Date((this.segment||this.event).end),originalEndTimeMinutes:this.event.endTimeMinutes}),this.event.resizing=!0},deleteEvent(t=!1){if("ontouchstart"in window&&!t)return!1;this.utils.event.deleteAnEvent(this.event)},touchDeleteEvent(t){this.deleteEvent(!0)},cancelDeleteEvent(){this.event.deleting=!1},focusEvent(){const{focusAnEvent:t}=this.domEvents,e=t._eid;if(e!==this.event._eid){if(e){const s=this.view.events.find(l=>l._eid===e);s&&(s.focused=!1)}this.vuecal.cancelDelete(),this.vuecal.emitWithEvent("event-focus",this.event),t._eid=this.event._eid,this.event.focused=!0}}},computed:{eventDimensions(){const{startTimeMinutes:t,endTimeMinutes:e}=this.segment||this.event;let s=t-this.vuecal.timeFrom;const l=Math.max(Math.round(s*this.vuecal.timeCellHeight/this.vuecal.timeStep),0);s=Math.min(e,this.vuecal.timeTo)-this.vuecal.timeFrom;const r=Math.round(s*this.vuecal.timeCellHeight/this.vuecal.timeStep),n=Math.max(r-l,5);return{top:l,height:n}},eventStyles(){if(this.event.allDay||!this.vuecal.time||!this.event.endTimeMinutes||this.view.id==="month"||this.allDay)return{};let t=100/Math.min(this.overlaps.length+1,this.overlapsStreak),e=100/(this.overlaps.length+1)*this.eventPosition;this.vuecal.minEventWidth&&t<this.vuecal.minEventWidth&&(t=this.vuecal.minEventWidth,e=(100-this.vuecal.minEventWidth)/this.overlaps.length*this.eventPosition);const{top:s,height:l}=this.eventDimensions;return{top:`${s}px`,height:`${l}px`,width:`${t}%`,left:this.event.left&&`${this.event.left}px`||`${e}%`}},eventClasses(){const{isFirstDay:t,isLastDay:e}=this.segment||{};return{[this.event.class]:!!this.event.class,"vuecal__event--focus":this.event.focused,"vuecal__event--resizing":this.event.resizing,"vuecal__event--background":this.event.background,"vuecal__event--deletable":this.event.deleting,"vuecal__event--all-day":this.event.allDay,"vuecal__event--dragging":!this.event.draggingStatic&&this.event.dragging,"vuecal__event--static":this.event.dragging&&this.event.draggingStatic,"vuecal__event--multiple-days":!!this.segment,"event-start":this.segment&&t&&!e,"event-middle":this.segment&&!t&&!e,"event-end":this.segment&&e&&!t}},segment(){return this.event.segments&&this.event.segments[this.cellFormattedDate]||null},draggable(){const{draggable:t,background:e,daysCount:s}=this.event;return this.vuecal.editEvents.drag&&t&&!e&&s===1},resizable(){const{editEvents:t,time:e}=this.vuecal;return t.resize&&this.event.resizable&&e&&!this.allDay&&(!this.segment||this.segment&&this.segment.isLastDay)&&this.view.id!=="month"},dnd(){return this.modules.dnd}}};var be=S(Ce,[["render",Ee]]);const Te=["data-split","aria-label","onTouchstart","onMousedown","onDragover","onDrop"],Me={key:1,class:"vuecal__cell-events"},Se=["title"];function Ve(t,e,s,l,r,n){const o=i.resolveComponent("event");return i.openBlock(),i.createBlock(i.TransitionGroup,{class:i.normalizeClass(["vuecal__cell",n.cellClasses]),name:`slide-fade--${n.transitionDirection}`,tag:"div",appear:s.options.transitions,style:i.normalizeStyle(n.cellStyles)},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.splitsCount?n.splits:1,(a,u)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["vuecal__flex vuecal__cell-content",n.splitsCount&&n.splitClasses(a)]),key:s.options.transitions?`${n.view.id}-${s.data.content}-${u}`:u,"data-split":n.splitsCount?a.id:!1,column:"",tabindex:"0","aria-label":s.data.content,onFocus:e[0]||(e[0]=d=>n.onCellFocus(d)),onKeypress:e[1]||(e[1]=i.withKeys(d=>n.onCellkeyPressEnter(d),["enter"])),onTouchstart:d=>!n.isDisabled&&n.onCellTouchStart(d,n.splitsCount?a.id:null),onMousedown:d=>!n.isDisabled&&n.onCellMouseDown(d,n.splitsCount?a.id:null),onClick:e[2]||(e[2]=d=>!n.isDisabled&&n.onCellClick(d)),onDblclick:e[3]||(e[3]=d=>!n.isDisabled&&n.onCellDblClick(d)),onContextmenu:e[4]||(e[4]=d=>!n.isDisabled&&s.options.cellContextmenu&&n.onCellContextMenu(d)),onDragenter:e[5]||(e[5]=d=>!n.isDisabled&&s.editEvents.drag&&n.dnd&&n.dnd.cellDragEnter(d,t.$data,s.data.startDate)),onDragover:d=>!n.isDisabled&&s.editEvents.drag&&n.dnd&&n.dnd.cellDragOver(d,t.$data,s.data.startDate,n.splitsCount?a.id:null),onDragleave:e[6]||(e[6]=d=>!n.isDisabled&&s.editEvents.drag&&n.dnd&&n.dnd.cellDragLeave(d,t.$data,s.data.startDate)),onDrop:d=>!n.isDisabled&&s.editEvents.drag&&n.dnd&&n.dnd.cellDragDrop(d,t.$data,s.data.startDate,n.splitsCount?a.id:null)},[n.isWeekOrDayView&&!s.allDay&&n.specialHours.length?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(n.specialHours,(d,c)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["vuecal__special-hours",`vuecal__special-hours--day${d.day} ${d.class}`]),style:i.normalizeStyle(`height: ${d.height}px;top: ${d.top}px`)},null,6))),256)):i.createCommentVNode("",!0),i.renderSlot(t.$slots,"cell-content",{events:n.events,selectCell:d=>n.selectCell(d,!0),split:n.splitsCount?a:!1}),n.eventsCount&&(n.isWeekOrDayView||n.view.id==="month"&&s.options.eventsOnMonthView)?(i.openBlock(),i.createElementBlock("div",Me,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.splitsCount?a.events:n.events,(d,c)=>(i.openBlock(),i.createBlock(o,{key:c,"cell-formatted-date":s.data.formattedDate,event:d,"all-day":s.allDay,"cell-events":n.splitsCount?a.events:n.events,overlaps:((n.splitsCount?a.overlaps[d._eid]:t.cellOverlaps[d._eid])||[]).overlaps,"event-position":((n.splitsCount?a.overlaps[d._eid]:t.cellOverlaps[d._eid])||[]).position,"overlaps-streak":n.splitsCount?a.overlapsStreak:t.cellOverlapsStreak},{event:i.withCtx(({event:v,view:h})=>[i.renderSlot(t.$slots,"event",{view:h,event:v})]),_:2},1032,["cell-formatted-date","event","all-day","cell-events","overlaps","event-position","overlaps-streak"]))),128))])):i.createCommentVNode("",!0)],42,Te))),128)),n.timelineVisible?(i.openBlock(),i.createElementBlock("div",{class:"vuecal__now-line",style:i.normalizeStyle(`top: ${n.todaysTimePosition}px`),key:s.options.transitions?`${n.view.id}-now-line`:"now-line",title:n.utils.date.formatTime(n.vuecal.now)},null,12,Se)):i.createCommentVNode("",!0)]),_:3},8,["class","name","appear","style"])}const Be={inject:["vuecal","utils","modules","view","domEvents"],components:{Event:be},props:{options:{type:Object,default:()=>({})},editEvents:{type:Object,required:!0},data:{type:Object,required:!0},cellSplits:{type:Array,default:()=>[]},minTimestamp:{type:[Number,null],default:null},maxTimestamp:{type:[Number,null],default:null},cellWidth:{type:[Number,Boolean],default:!1},allDay:{type:Boolean,default:!1}},data:()=>({cellOverlaps:{},cellOverlapsStreak:1,timeAtCursor:null,highlighted:!1,highlightedSplit:null}),methods:{getSplitAtCursor({target:t}){let s=t.classList.contains("vuecal__cell-split")?t:this.vuecal.findAncestor(t,"vuecal__cell-split");return s&&(s=s.attributes["data-split"].value,parseInt(s).toString()===s.toString()&&(s=parseInt(s))),s||null},splitClasses(t){return{"vuecal__cell-split":!0,"vuecal__cell-split--highlighted":this.highlightedSplit===t.id,[t.class]:!!t.class}},checkCellOverlappingEvents(){this.options.time&&this.eventsCount&&!this.splitsCount&&(this.eventsCount===1?(this.cellOverlaps=[],this.cellOverlapsStreak=1):[this.cellOverlaps,this.cellOverlapsStreak]=this.utils.event.checkCellOverlappingEvents(this.events,this.options))},isDOMElementAnEvent(t){return this.vuecal.isDOMElementAnEvent(t)},selectCell(t,e=!1){const s=this.splitsCount?this.getSplitAtCursor(t):null;this.utils.cell.selectCell(e,this.timeAtCursor,s),this.timeAtCursor=null},onCellkeyPressEnter(t){this.isSelected||this.onCellFocus(t);const e=this.splitsCount?this.getSplitAtCursor(t):null;this.utils.cell.keyPressEnterCell(this.timeAtCursor,e),this.timeAtCursor=null},onCellFocus(t){if(!this.isSelected&&!this.isDisabled){this.isSelected=this.data.startDate;const e=this.splitsCount?this.getSplitAtCursor(t):null,s=this.timeAtCursor||this.data.startDate;this.vuecal.$emit("cell-focus",e?{date:s,split:e}:s)}},onCellMouseDown(t,e=null,s=!1){if("ontouchstart"in window&&!s)return!1;this.isSelected||this.onCellFocus(t);const{clickHoldACell:l,focusAnEvent:r}=this.domEvents;this.domEvents.cancelClickEventCreation=!1,l.eventCreated=!1,this.timeAtCursor=new Date(this.data.startDate);const{minutes:n,cursorCoords:{y:o}}=this.vuecal.minutesAtCursor(t);this.timeAtCursor.setMinutes(n);const a=this.isDOMElementAnEvent(t.target);!a&&r._eid&&((this.view.events.find(u=>u._eid===r._eid)||{}).focused=!1),this.editEvents.create&&!a&&this.setUpEventCreation(t,o)},setUpEventCreation(t,e){if(this.options.dragToCreateEvent&&["week","day"].includes(this.view.id)){const{dragCreateAnEvent:s}=this.domEvents;if(s.startCursorY=e,s.split=this.splitsCount?this.getSplitAtCursor(t):null,s.start=this.timeAtCursor,this.options.snapToTime){let l=this.timeAtCursor.getHours()*60+this.timeAtCursor.getMinutes();const r=l+this.options.snapToTime/2;l=r-r%this.options.snapToTime,s.start.setHours(0,l,0,0)}}else this.options.cellClickHold&&["month","week","day"].includes(this.view.id)&&this.setUpCellHoldTimer(t)},setUpCellHoldTimer(t){const{clickHoldACell:e}=this.domEvents;e.cellId=`${this.vuecal._.uid}_${this.data.formattedDate}`,e.split=this.splitsCount?this.getSplitAtCursor(t):null,e.timeoutId=setTimeout(()=>{if(e.cellId&&!this.domEvents.cancelClickEventCreation){const{_eid:s}=this.utils.event.createAnEvent(this.timeAtCursor,null,e.split?{split:e.split}:{});e.eventCreated=s}},e.timeout)},onCellTouchStart(t,e=null){this.onCellMouseDown(t,e,!0)},onCellClick(t){this.isDOMElementAnEvent(t.target)||this.selectCell(t)},onCellDblClick(t){const e=new Date(this.data.startDate);e.setMinutes(this.vuecal.minutesAtCursor(t).minutes);const s=this.splitsCount?this.getSplitAtCursor(t):null;this.vuecal.$emit("cell-dblclick",s?{date:e,split:s}:e),this.options.dblclickToNavigate&&this.vuecal.switchToNarrowerView()},onCellContextMenu(t){t.stopPropagation(),t.preventDefault();const e=new Date(this.data.startDate),{cursorCoords:s,minutes:l}=this.vuecal.minutesAtCursor(t);e.setMinutes(l);const r=this.splitsCount?this.getSplitAtCursor(t):null;this.vuecal.$emit("cell-contextmenu",_(w(w({date:e},s),r||{}),{e:t}))}},computed:{dnd(){return this.modules.dnd},nowInMinutes(){return this.utils.date.dateToMinutes(this.vuecal.now)},isBeforeMinDate(){return this.minTimestamp!==null&&this.minTimestamp>this.data.endDate.getTime()},isAfterMaxDate(){return this.maxTimestamp&&this.maxTimestamp<this.data.startDate.getTime()},isDisabled(){const{disableDays:t}=this.options,{isYearsOrYearView:e}=this.vuecal;return t.length&&t.includes(this.data.formattedDate)&&!e?!0:this.isBeforeMinDate||this.isAfterMaxDate},isSelected:{get(){let t=!1;const{selectedDate:e}=this.view;return this.view.id==="years"?t=e.getFullYear()===this.data.startDate.getFullYear():this.view.id==="year"?t=e.getFullYear()===this.data.startDate.getFullYear()&&e.getMonth()===this.data.startDate.getMonth():t=e.getTime()===this.data.startDate.getTime(),t},set(t){this.view.selectedDate=t}},isWeekOrDayView(){return["week","day"].includes(this.view.id)},transitionDirection(){return this.vuecal.transitionDirection},specialHours(){return this.data.specialHours.map(t=>{let{from:e,to:s}=t;return e=Math.max(e,this.options.timeFrom),s=Math.min(s,this.options.timeTo),_(w({},t),{height:(s-e)*this.timeScale,top:(e-this.options.timeFrom)*this.timeScale})})},events(){const{startDate:t,endDate:e}=this.data;let s=[];if(!(["years","year"].includes(this.view.id)&&!this.options.eventsCountOnYearView)){if(s=this.view.events.slice(0),this.view.id==="month"&&s.push(...this.view.outOfScopeEvents),s=s.filter(l=>this.utils.event.eventInRange(l,t,e)),this.options.showAllDayEvents&&this.view.id!=="month"&&(s=s.filter(l=>!!l.allDay===this.allDay)),this.options.time&&this.isWeekOrDayView&&!this.allDay){const{timeFrom:l,timeTo:r}=this.options;s=s.filter(n=>{const o=n.daysCount>1&&n.segments[this.data.formattedDate]||{},a=n.daysCount===1&&n.startTimeMinutes<r&&n.endTimeMinutes>l,u=n.daysCount>1&&o.startTimeMinutes<r&&o.endTimeMinutes>l,d=!1;return n.allDay||a||u||d})}this.options.time&&this.isWeekOrDayView&&!(this.options.showAllDayEvents&&this.allDay)&&s.sort((l,r)=>l.start<r.start?-1:1),this.cellSplits.length||this.$nextTick(this.checkCellOverlappingEvents)}return s},eventsCount(){return this.events.length},splits(){return this.cellSplits.map((t,e)=>{const s=this.events.filter(n=>n.split===t.id),[l,r]=this.utils.event.checkCellOverlappingEvents(s.filter(n=>!n.background&&!n.allDay),this.options);return _(w({},t),{overlaps:l,overlapsStreak:r,events:s})})},splitsCount(){return this.splits.length},cellClasses(){return{[this.data.class]:!!this.data.class,"vuecal__cell--current":this.data.current,"vuecal__cell--today":this.data.today,"vuecal__cell--out-of-scope":this.data.outOfScope,"vuecal__cell--before-min":this.isDisabled&&this.isBeforeMinDate,"vuecal__cell--after-max":this.isDisabled&&this.isAfterMaxDate,"vuecal__cell--disabled":this.isDisabled,"vuecal__cell--selected":this.isSelected,"vuecal__cell--highlighted":this.highlighted,"vuecal__cell--has-splits":this.splitsCount,"vuecal__cell--has-events":this.eventsCount}},cellStyles(){return w({},this.cellWidth?{width:`${this.cellWidth}%`}:{})},timelineVisible(){const{time:t,timeTo:e}=this.options;return this.data.today&&this.isWeekOrDayView&&t&&!this.allDay&&this.nowInMinutes<=e},todaysTimePosition(){if(!this.data.today||!this.options.time)return;const t=this.nowInMinutes-this.options.timeFrom;return Math.round(t*this.timeScale)},timeScale(){return this.options.timeCellHeight/this.options.timeStep}}};var I=S(Be,[["render",Ve]]);const je={key:0,class:"vuecal__all-day-text",style:{width:"3em"}};function Oe(t,e,s,l,r,n){const o=i.resolveComponent("vuecal-cell");return i.openBlock(),i.createElementBlock("div",{class:"vuecal__flex vuecal__all-day",style:i.normalizeStyle(s.cellOrSplitMinWidth&&{height:s.height})},[s.cellOrSplitMinWidth?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",je,[i.createElementVNode("span",null,i.toDisplayString(s.label),1)])),i.createElementVNode("div",{class:i.normalizeClass(["vuecal__flex vuecal__cells",`${n.view.id}-view`]),grow:"",style:i.normalizeStyle(s.cellOrSplitMinWidth?`min-width: ${s.cellOrSplitMinWidth}px`:"")},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.cells,(a,u)=>(i.openBlock(),i.createBlock(o,{key:u,options:s.options,"edit-events":n.editEvents,data:a,"all-day":!0,"cell-width":s.options.hideWeekdays.length&&(n.vuecal.isWeekView||n.vuecal.isMonthView)&&n.vuecal.cellWidth,"min-timestamp":s.options.minTimestamp,"max-timestamp":s.options.maxTimestamp,"cell-splits":s.daySplits},{event:i.withCtx(({event:d,view:c})=>[i.renderSlot(t.$slots,"event",{view:c,event:d})]),_:2},1032,["options","edit-events","data","cell-width","min-timestamp","max-timestamp","cell-splits"]))),128))],6)],4)}const We={inject:["vuecal","view","editEvents"],components:{"vuecal-cell":I},props:{options:{type:Object,required:!0},cells:{type:Array,required:!0},label:{type:String,required:!0},daySplits:{type:Array,default:()=>[]},shortEvents:{type:Boolean,default:!0},height:{type:String,default:""},cellOrSplitMinWidth:{type:Number,default:null}},computed:{hasCellOrSplitWidth(){return!!(this.options.minCellWidth||this.daySplits.length&&this.options.minSplitWidth)}}};var He=S(We,[["render",Oe]]);const Ae=["lang"],Ne=i.createTextVNode("\xA0"),xe=i.createElementVNode("i",{class:"angle"},null,-1),Le=i.createTextVNode("\xA0"),Fe=i.createTextVNode("\xA0"),Ye=i.createElementVNode("i",{class:"angle"},null,-1),ze=i.createTextVNode("\xA0"),Pe={class:"default"},Ie={key:0,class:"vuecal__flex vuecal__body",grow:""},qe=["onBlur","innerHTML"],Ue=["innerHTML"],Re=["innerHTML"],Ke={class:"vuecal__flex",row:"",grow:""},Xe={key:0,class:"vuecal__time-column"},Ge=i.createElementVNode("span",{class:"vuecal__time-cell-line"},null,-1),Ze={class:"vuecal__time-cell-label"},Je={key:1,class:"vuecal__flex vuecal__week-numbers",column:""},Qe=["wrap","column"],$e=["onBlur","innerHTML"],et=["innerHTML"],tt=["innerHTML"],st=["wrap"],it=["innerHTML"],nt=["innerHTML"],lt={key:2,class:"vuecal__cell-events-count"},at={key:3,class:"vuecal__no-event"},rt=["onBlur","innerHTML"],ot=["innerHTML"],dt={key:2,class:"vuecal__event-time"},ut={key:0},ct={key:1,class:"days-to-end"},ht=["innerHTML"],vt={key:0,class:"vuecal__scrollbar-check"},mt=i.createElementVNode("div",null,null,-1),ft=[mt];function yt(t,e,s,l,r,n){const o=i.resolveComponent("vuecal-header"),a=i.resolveComponent("all-day-bar"),u=i.resolveComponent("weekdays-headings"),d=i.resolveComponent("vuecal-cell");return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["vuecal__flex vuecal",n.cssClasses]),column:"",ref:"vuecal",lang:s.locale},[i.createVNode(o,{options:t.$props,"edit-events":n.editEvents,"view-props":{views:n.views,weekDaysInHeader:n.weekDaysInHeader},"week-days":n.weekDays,"has-splits":n.hasSplits,"day-splits":n.daySplits,"switch-to-narrower-view":n.switchToNarrowerView},i.createSlots({"arrow-prev":i.withCtx(()=>[i.renderSlot(t.$slots,"arrow-prev",{},()=>[Ne,xe,Le])]),"arrow-next":i.withCtx(()=>[i.renderSlot(t.$slots,"arrow-next",{},()=>[Fe,Ye,ze])]),"today-button":i.withCtx(()=>[i.renderSlot(t.$slots,"today-button",{},()=>[i.createElementVNode("span",Pe,i.toDisplayString(r.texts.today),1)])]),title:i.withCtx(()=>[i.renderSlot(t.$slots,"title",{title:n.viewTitle,view:r.view},()=>[i.createTextVNode(i.toDisplayString(n.viewTitle),1)])]),_:2},[t.$slots["weekday-heading"]?{name:"weekday-heading",fn:i.withCtx(({heading:c,view:v})=>[i.renderSlot(t.$slots,"weekday-heading",{heading:c,view:v})])}:void 0,t.$slots["split-label"]?{name:"split-label",fn:i.withCtx(({split:c})=>[i.renderSlot(t.$slots,"split-label",{split:c,view:r.view.id})])}:void 0]),1032,["options","edit-events","view-props","week-days","has-splits","day-splits","switch-to-narrower-view"]),s.hideBody?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Ie,[i.createVNode(i.Transition,{name:`slide-fade--${r.transitionDirection}`,appear:s.transitions},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("div",{class:"vuecal__flex",style:{"min-width":"100%"},key:s.transitions?r.view.id:!1,column:""},[s.showAllDayEvents&&n.hasTimeColumn&&(!n.cellOrSplitMinWidth||n.isDayView&&!s.minSplitWidth)?(i.openBlock(),i.createBlock(a,i.normalizeProps(i.mergeProps({key:0},n.allDayBar)),{event:i.withCtx(({event:c,view:v})=>[i.renderSlot(t.$slots,"event",{view:v,event:c},()=>[n.editEvents.title&&c.titleEditable?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__event-title vuecal__event-title--edit",contenteditable:"",onBlur:h=>n.onEventTitleBlur(h,c),innerHTML:c.title},null,40,qe)):c.title?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__event-title",innerHTML:c.title},null,8,Ue)):i.createCommentVNode("",!0),c.content&&!n.hasShortEvents&&!n.isShortMonthView?(i.openBlock(),i.createElementBlock("div",{key:2,class:"vuecal__event-content",innerHTML:c.content},null,8,Re)):i.createCommentVNode("",!0)])]),_:3},16)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["vuecal__bg",{vuecal__flex:!n.hasTimeColumn}]),column:""},[i.createElementVNode("div",Ke,[n.hasTimeColumn?(i.openBlock(),i.createElementBlock("div",Xe,[s.showAllDayEvents&&n.cellOrSplitMinWidth&&!(n.isDayView&&!s.minSplitWidth)?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__all-day-text",style:i.normalizeStyle({height:n.allDayBar.height})},[i.createElementVNode("span",null,i.toDisplayString(r.texts.allDay),1)],4)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.timeCells,(c,v)=>(i.openBlock(),i.createElementBlock("div",{class:"vuecal__time-cell",key:v,style:i.normalizeStyle(`height: ${s.timeCellHeight}px`)},[i.renderSlot(t.$slots,"time-cell",{hours:c.hours,minutes:c.minutes},()=>[Ge,i.createElementVNode("span",Ze,i.toDisplayString(c.label),1)])],4))),128))])):i.createCommentVNode("",!0),s.showWeekNumbers&&n.isMonthView?(i.openBlock(),i.createElementBlock("div",Je,[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(6,c=>i.createElementVNode("div",{class:"vuecal__flex vuecal__week-number-cell",key:c,grow:""},[i.renderSlot(t.$slots,"week-number-cell",{week:n.getWeekNumber(c-1)},()=>[i.createTextVNode(i.toDisplayString(n.getWeekNumber(c-1)),1)])])),64))])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["vuecal__flex vuecal__cells",`${r.view.id}-view`]),grow:"",wrap:!n.cellOrSplitMinWidth||!n.isWeekView,column:!!n.cellOrSplitMinWidth},[n.cellOrSplitMinWidth&&n.isWeekView?(i.openBlock(),i.createBlock(u,{key:0,"transition-direction":r.transitionDirection,"week-days":n.weekDays,"switch-to-narrower-view":n.switchToNarrowerView,style:i.normalizeStyle(n.cellOrSplitMinWidth?`min-width: ${n.cellOrSplitMinWidth}px`:"")},i.createSlots({_:2},[t.$slots["weekday-heading"]?{name:"weekday-heading",fn:i.withCtx(({heading:c,view:v})=>[i.renderSlot(t.$slots,"weekday-heading",{heading:c,view:v})])}:void 0,t.$slots["split-label"]?{name:"split-label",fn:i.withCtx(({split:c})=>[i.renderSlot(t.$slots,"split-label",{split:c,view:r.view.id})])}:void 0]),1032,["transition-direction","week-days","switch-to-narrower-view","style"])):n.hasSplits&&s.stickySplitLabels&&s.minSplitWidth?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__flex vuecal__split-days-headers",style:i.normalizeStyle(n.cellOrSplitMinWidth?`min-width: ${n.cellOrSplitMinWidth}px`:"")},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.daySplits,(c,v)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["day-split-header",c.class||!1]),key:v},[i.renderSlot(t.$slots,"split-label",{split:c,view:r.view.id},()=>[i.createTextVNode(i.toDisplayString(c.label),1)])],2))),128))],4)):i.createCommentVNode("",!0),s.showAllDayEvents&&n.hasTimeColumn&&(n.isWeekView&&n.cellOrSplitMinWidth||n.isDayView&&n.hasSplits&&s.minSplitWidth)?(i.openBlock(),i.createBlock(a,i.normalizeProps(i.mergeProps({key:2},n.allDayBar)),{event:i.withCtx(({event:c,view:v})=>[i.renderSlot(t.$slots,"event",{view:v,event:c},()=>[n.editEvents.title&&c.titleEditable?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__event-title vuecal__event-title--edit",contenteditable:"",onBlur:h=>n.onEventTitleBlur(h,c),innerHTML:c.title},null,40,$e)):c.title?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__event-title",innerHTML:c.title},null,8,et)):i.createCommentVNode("",!0),c.content&&!n.hasShortEvents&&!n.isShortMonthView?(i.openBlock(),i.createElementBlock("div",{key:2,class:"vuecal__event-content",innerHTML:c.content},null,8,tt)):i.createCommentVNode("",!0)])]),_:3},16)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:"vuecal__flex",ref:c=>r.cellsEl=c,grow:"",wrap:!n.cellOrSplitMinWidth||!n.isWeekView,style:i.normalizeStyle(n.cellOrSplitMinWidth?`min-width: ${n.cellOrSplitMinWidth}px`:"")},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.viewCells,(c,v)=>(i.openBlock(),i.createBlock(d,{key:v,options:t.$props,"edit-events":n.editEvents,data:c,"cell-width":s.hideWeekdays.length&&(n.isWeekView||n.isMonthView)&&n.cellWidth,"min-timestamp":n.minTimestamp,"max-timestamp":n.maxTimestamp,"cell-splits":n.hasSplits&&n.daySplits||[]},{"cell-content":i.withCtx(({events:h,split:D,selectCell:m})=>[i.renderSlot(t.$slots,"cell-content",{cell:c,view:r.view,goNarrower:m,events:h},()=>[D&&!s.stickySplitLabels?(i.openBlock(),i.createElementBlock("div",{key:0,class:"split-label",innerHTML:D.label},null,8,it)):i.createCommentVNode("",!0),c.content?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__cell-date",innerHTML:c.content},null,8,nt)):i.createCommentVNode("",!0),(n.isMonthView&&!s.eventsOnMonthView||n.isYearsOrYearView&&s.eventsCountOnYearView)&&h.length?(i.openBlock(),i.createElementBlock("div",lt,[i.renderSlot(t.$slots,"events-count",{view:r.view,events:h},()=>[i.createTextVNode(i.toDisplayString(h.length),1)])])):i.createCommentVNode("",!0),!n.cellOrSplitHasEvents(h,D)&&n.isWeekOrDayView?(i.openBlock(),i.createElementBlock("div",at,[i.renderSlot(t.$slots,"no-event",{},()=>[i.createTextVNode(i.toDisplayString(r.texts.noEvent),1)])])):i.createCommentVNode("",!0)])]),event:i.withCtx(({event:h,view:D})=>[i.renderSlot(t.$slots,"event",{view:D,event:h},()=>[n.editEvents.title&&h.titleEditable?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__event-title vuecal__event-title--edit",contenteditable:"",onBlur:m=>n.onEventTitleBlur(m,h),innerHTML:h.title},null,40,rt)):h.title?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__event-title",innerHTML:h.title},null,8,ot)):i.createCommentVNode("",!0),s.time&&!h.allDay&&!(n.isMonthView&&(h.allDay||s.showAllDayEvents==="short"))&&!n.isShortMonthView?(i.openBlock(),i.createElementBlock("div",dt,[i.createTextVNode(i.toDisplayString(r.utils.date.formatTime(h.start,n.TimeFormat)),1),h.endTimeMinutes?(i.openBlock(),i.createElementBlock("span",ut,"\xA0- "+i.toDisplayString(r.utils.date.formatTime(h.end,n.TimeFormat,null,!0)),1)):i.createCommentVNode("",!0),h.daysCount>1&&(h.segments[c.formattedDate]||{}).isFirstDay?(i.openBlock(),i.createElementBlock("small",ct,"\xA0+"+i.toDisplayString(h.daysCount-1)+i.toDisplayString((r.texts.day[0]||"").toLowerCase()),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),h.content&&!(n.isMonthView&&h.allDay&&s.showAllDayEvents==="short")&&!n.isShortMonthView?(i.openBlock(),i.createElementBlock("div",{key:3,class:"vuecal__event-content",innerHTML:h.content},null,8,ht)):i.createCommentVNode("",!0)])]),"no-event":i.withCtx(()=>[i.renderSlot(t.$slots,"no-event",{},()=>[i.createTextVNode(i.toDisplayString(r.texts.noEvent),1)])]),_:2},1032,["options","edit-events","data","cell-width","min-timestamp","max-timestamp","cell-splits"]))),128))],12,st)],10,Qe)])],2)]))]),_:3},8,["name","appear"]),r.ready?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",vt,ft))]))],10,Ae)}function wt(t){switch(t){case"./i18n/ar.json":return Promise.resolve().then(function(){return require("./i18n/ar.cjs.js")});case"./i18n/bg.json":return Promise.resolve().then(function(){return require("./i18n/bg.cjs.js")});case"./i18n/bn.json":return Promise.resolve().then(function(){return require("./i18n/bn.cjs.js")});case"./i18n/bs.json":return Promise.resolve().then(function(){return require("./i18n/bs.cjs.js")});case"./i18n/ca.json":return Promise.resolve().then(function(){return require("./i18n/ca.cjs.js")});case"./i18n/cs.json":return Promise.resolve().then(function(){return require("./i18n/cs.cjs.js")});case"./i18n/da.json":return Promise.resolve().then(function(){return require("./i18n/da.cjs.js")});case"./i18n/de.json":return Promise.resolve().then(function(){return require("./i18n/de.cjs.js")});case"./i18n/el.json":return Promise.resolve().then(function(){return require("./i18n/el.cjs.js")});case"./i18n/en.json":return Promise.resolve().then(function(){return require("./i18n/en.cjs.js")});case"./i18n/es.json":return Promise.resolve().then(function(){return require("./i18n/es.cjs.js")});case"./i18n/fa.json":return Promise.resolve().then(function(){return require("./i18n/fa.cjs.js")});case"./i18n/fr.json":return Promise.resolve().then(function(){return require("./i18n/fr.cjs.js")});case"./i18n/he.json":return Promise.resolve().then(function(){return require("./i18n/he.cjs.js")});case"./i18n/hr.json":return Promise.resolve().then(function(){return require("./i18n/hr.cjs.js")});case"./i18n/hu.json":return Promise.resolve().then(function(){return require("./i18n/hu.cjs.js")});case"./i18n/id.json":return Promise.resolve().then(function(){return require("./i18n/id.cjs.js")});case"./i18n/is.json":return Promise.resolve().then(function(){return require("./i18n/is.cjs.js")});case"./i18n/it.json":return Promise.resolve().then(function(){return require("./i18n/it.cjs.js")});case"./i18n/ja.json":return Promise.resolve().then(function(){return require("./i18n/ja.cjs.js")});case"./i18n/ka.json":return Promise.resolve().then(function(){return require("./i18n/ka.cjs.js")});case"./i18n/ko.json":return Promise.resolve().then(function(){return require("./i18n/ko.cjs.js")});case"./i18n/lt.json":return Promise.resolve().then(function(){return require("./i18n/lt.cjs.js")});case"./i18n/mn.json":return Promise.resolve().then(function(){return require("./i18n/mn.cjs.js")});case"./i18n/nl.json":return Promise.resolve().then(function(){return require("./i18n/nl.cjs.js")});case"./i18n/no.json":return Promise.resolve().then(function(){return require("./i18n/no.cjs.js")});case"./i18n/pl.json":return Promise.resolve().then(function(){return require("./i18n/pl.cjs.js")});case"./i18n/pt-br.json":return Promise.resolve().then(function(){return require("./i18n/pt-br.cjs.js")});case"./i18n/ro.json":return Promise.resolve().then(function(){return require("./i18n/ro.cjs.js")});case"./i18n/ru.json":return Promise.resolve().then(function(){return require("./i18n/ru.cjs.js")});case"./i18n/sk.json":return Promise.resolve().then(function(){return require("./i18n/sk.cjs.js")});case"./i18n/sl.json":return Promise.resolve().then(function(){return require("./i18n/sl.cjs.js")});case"./i18n/sq.json":return Promise.resolve().then(function(){return require("./i18n/sq.cjs.js")});case"./i18n/sr.json":return Promise.resolve().then(function(){return require("./i18n/sr.cjs.js")});case"./i18n/sv.json":return Promise.resolve().then(function(){return require("./i18n/sv.cjs.js")});case"./i18n/tr.json":return Promise.resolve().then(function(){return require("./i18n/tr.cjs.js")});case"./i18n/uk.json":return Promise.resolve().then(function(){return require("./i18n/uk.cjs.js")});case"./i18n/vi.json":return Promise.resolve().then(function(){return require("./i18n/vi.cjs.js")});case"./i18n/zh-cn.json":return Promise.resolve().then(function(){return require("./i18n/zh-cn.cjs.js")});case"./i18n/zh-hk.json":return Promise.resolve().then(function(){return require("./i18n/zh-hk.cjs.js")});default:return new Promise(function(e,s){(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+t)))})}}const j=24*60,O={weekDays:Array(7).fill(""),weekDaysShort:[],months:Array(12).fill(""),years:"",year:"",month:"",week:"",day:"",today:"",noEvent:"",allDay:"",deleteEvent:"",createEvent:"",dateFormat:"dddd MMMM D, YYYY",am:"am",pm:"pm"},Y=["years","year","month","week","day"],z=new Z(O),Dt={name:"vue-cal",components:{"vuecal-cell":I,"vuecal-header":ke,WeekdaysHeadings:P,AllDayBar:He},provide(){return{vuecal:this,utils:this.utils,modules:this.modules,previous:this.previous,next:this.next,switchView:this.switchView,updateSelectedDate:this.updateSelectedDate,editEvents:this.editEvents,view:this.view,domEvents:this.domEvents}},props:{activeView:{type:String,default:"week"},allDayBarHeight:{type:[String,Number],default:"25px"},cellClickHold:{type:Boolean,default:!0},cellContextmenu:{type:Boolean,default:!1},clickToNavigate:{type:Boolean,default:!1},dblclickToNavigate:{type:Boolean,default:!0},disableDatePrototypes:{type:Boolean,default:!1},disableDays:{type:Array,default:()=>[]},disableViews:{type:Array,default:()=>[]},dragToCreateEvent:{type:Boolean,default:!0},dragToCreateThreshold:{type:Number,default:15},editableEvents:{type:[Boolean,Object],default:!1},events:{type:Array,default:()=>[]},eventsCountOnYearView:{type:Boolean,default:!1},eventsOnMonthView:{type:[Boolean,String],default:!1},hideBody:{type:Boolean,default:!1},hideTitleBar:{type:Boolean,default:!1},hideViewSelector:{type:Boolean,default:!1},hideWeekdays:{type:Array,default:()=>[]},hideWeekends:{type:Boolean,default:!1},locale:{type:[String,Object],default:"en"},maxDate:{type:[String,Date],default:""},minCellWidth:{type:Number,default:0},minDate:{type:[String,Date],default:""},minEventWidth:{type:Number,default:0},minSplitWidth:{type:Number,default:0},onEventClick:{type:[Function,null],default:null},onEventCreate:{type:[Function,null],default:null},onEventDblclick:{type:[Function,null],default:null},overlapsPerTimeStep:{type:Boolean,default:!1},resizeX:{type:Boolean,default:!1},selectedDate:{type:[String,Date],default:""},showAllDayEvents:{type:[Boolean,String],default:!1},showWeekNumbers:{type:[Boolean,String],default:!1},snapToTime:{type:Number,default:0},small:{type:Boolean,default:!1},specialHours:{type:Object,default:()=>({})},splitDays:{type:Array,default:()=>[]},startWeekOnSunday:{type:Boolean,default:!1},stickySplitLabels:{type:Boolean,default:!1},time:{type:Boolean,default:!0},timeCellHeight:{type:Number,default:40},timeFormat:{type:String,default:""},timeFrom:{type:Number,default:0},timeStep:{type:Number,default:60},timeTo:{type:Number,default:j},todayButton:{type:Boolean,default:!1},transitions:{type:Boolean,default:!0},twelveHour:{type:Boolean,default:!1},watchRealTime:{type:Boolean,default:!1},xsmall:{type:Boolean,default:!1}},data(){return{ready:!1,texts:w({},O),utils:{date:(this.disableDatePrototypes?z.removePrototypes():!1)||z,cell:null,event:null},modules:{dnd:null},cellsEl:null,view:{id:"",title:"",startDate:null,endDate:null,firstCellDate:null,lastCellDate:null,selectedDate:null,events:[]},eventIdIncrement:1,now:new Date,timeTickerIds:[null,null],domEvents:{resizeAnEvent:{_eid:null,start:null,split:null,segment:null,originalEndTimeMinutes:0,originalEnd:null,end:null,startCell:null,endCell:null},dragAnEvent:{_eid:null},dragCreateAnEvent:{startCursorY:null,start:null,split:null,event:null},focusAnEvent:{_eid:null,mousedUp:!1},clickHoldAnEvent:{_eid:null,timeout:1200,timeoutId:null},dblTapACell:{taps:0,timeout:500},clickHoldACell:{cellId:null,split:null,timeout:1200,timeoutId:null,eventCreated:!1},cancelClickEventCreation:!1},mutableEvents:[],transitionDirection:"right"}},methods:{async loadLocale(t){if(typeof this.locale=="object"){this.texts=Object.assign({},O,t),this.utils.date.updateTexts(this.texts);return}if(this.locale==="en"){const e=await Promise.resolve().then(function(){return require("./i18n/en.cjs.js")});this.texts=Object.assign({},O,e)}else wt(`./i18n/${t}.json`).then(e=>{this.texts=Object.assign({},O,e.default),this.utils.date.updateTexts(this.texts)})},loadDragAndDrop(){Promise.resolve().then(function(){return require("./drag-and-drop.cjs.js")}).then(t=>{const{DragAndDrop:e}=t;this.modules.dnd=new e(this)}).catch(()=>console.warn("Vue Cal: Missing drag & drop module."))},validateView(t){return Y.includes(t)||(console.error(`Vue Cal: invalid active-view parameter provided: "${t}".
6
- A valid view must be one of: ${Y.join(", ")}.`),t="week"),this.enabledViews.includes(t)||(console.warn(`Vue Cal: the provided active-view "${t}" is disabled. Using the "${this.enabledViews[0]}" view instead.`),t=this.enabledViews[0]),t},switchToNarrowerView(t=null){this.transitionDirection="right";const e=this.enabledViews[this.enabledViews.indexOf(this.view.id)+1];e&&this.switchView(e,t)},switchView(t,e=null,s=!1){t=this.validateView(t);const l=this.utils.date,r=this.view.startDate&&this.view.startDate.getTime();if(this.transitions&&s){if(this.view.id===t)return;const a=this.enabledViews;this.transitionDirection=a.indexOf(this.view.id)>a.indexOf(t)?"left":"right"}const n=this.view.id;switch(this.view.events=[],this.view.id=t,this.view.firstCellDate=null,this.view.lastCellDate=null,e||(e=this.view.selectedDate||this.view.startDate),t){case"years":{this.view.startDate=new Date(Math.floor(e.getFullYear()/25)*25||2e3,0,1),this.view.endDate=new Date(this.view.startDate.getFullYear()+25,0,1),this.view.endDate.setSeconds(-1);break}case"year":{this.view.startDate=new Date(e.getFullYear(),0,1),this.view.endDate=new Date(e.getFullYear()+1,0,1),this.view.endDate.setSeconds(-1);break}case"month":{this.view.startDate=new Date(e.getFullYear(),e.getMonth(),1),this.view.endDate=new Date(e.getFullYear(),e.getMonth()+1,1),this.view.endDate.setSeconds(-1);let a=new Date(this.view.startDate);if(a.getDay()!==(this.startWeekOnSunday?0:1)&&(a=l.getPreviousFirstDayOfWeek(a,this.startWeekOnSunday)),this.view.firstCellDate=a,this.view.lastCellDate=l.addDays(a,41),this.view.lastCellDate.setHours(23,59,59,0),this.hideWeekends){if([0,6].includes(this.view.firstCellDate.getDay())){const u=this.view.firstCellDate.getDay()===6&&!this.startWeekOnSunday?2:1;this.view.firstCellDate=l.addDays(this.view.firstCellDate,u)}if([0,6].includes(this.view.startDate.getDay())){const u=this.view.startDate.getDay()===6?2:1;this.view.startDate=l.addDays(this.view.startDate,u)}if([0,6].includes(this.view.lastCellDate.getDay())){const u=this.view.lastCellDate.getDay()===0&&!this.startWeekOnSunday?2:1;this.view.lastCellDate=l.subtractDays(this.view.lastCellDate,u)}if([0,6].includes(this.view.endDate.getDay())){const u=this.view.endDate.getDay()===0?2:1;this.view.endDate=l.subtractDays(this.view.endDate,u)}}break}case"week":{e=l.getPreviousFirstDayOfWeek(e,this.startWeekOnSunday);const a=this.hideWeekends?5:7;this.view.startDate=this.hideWeekends&&this.startWeekOnSunday?l.addDays(e,1):e,this.view.startDate.setHours(0,0,0,0),this.view.endDate=l.addDays(e,a),this.view.endDate.setSeconds(-1);break}case"day":{this.view.startDate=e,this.view.startDate.setHours(0,0,0,0),this.view.endDate=new Date(e),this.view.endDate.setHours(23,59,59,0);break}}this.addEventsToView();const o=this.view.startDate&&this.view.startDate.getTime();if(!(n===t&&o===r)&&(this.$emit("update:activeView",t),this.ready)){const a=this.view.startDate,u=w(_(w({view:t,startDate:a,endDate:this.view.endDate},this.isMonthView?{firstCellDate:this.view.firstCellDate,lastCellDate:this.view.lastCellDate,outOfScopeEvents:this.view.outOfScopeEvents.map(this.cleanupEvent)}:{}),{events:this.view.events.map(this.cleanupEvent)}),this.isWeekView?{week:l.getWeek(this.startWeekOnSunday?l.addDays(a,1):a)}:{});this.$emit("view-change",u)}},previous(){this.previousNext(!1)},next(){this.previousNext()},previousNext(t=!0){const e=this.utils.date;this.transitionDirection=t?"right":"left";const s=t?1:-1;let l=null;const{startDate:r,id:n}=this.view;switch(n){case"years":l=new Date(r.getFullYear()+25*s,0,1);break;case"year":l=new Date(r.getFullYear()+1*s,1,1);break;case"month":l=new Date(r.getFullYear(),r.getMonth()+1*s,1);break;case"week":l=e[t?"addDays":"subtractDays"](e.getPreviousFirstDayOfWeek(r,this.startWeekOnSunday),7);break;case"day":l=e[t?"addDays":"subtractDays"](r,1);break}l&&this.switchView(n,l)},addEventsToView(t=[]){const e=this.utils.event,{startDate:s,endDate:l,firstCellDate:r,lastCellDate:n}=this.view;if(t.length||(this.view.events=[]),t=t.length?t:[...this.mutableEvents],!t||this.isYearsOrYearView&&!this.eventsCountOnYearView)return;let o=t.filter(a=>e.eventInRange(a,s,l));!this.isYearsOrYearView&&!(this.isMonthView&&!this.eventsOnMonthView)&&(o=o.map(a=>a.daysCount>1?e.createEventSegments(a,r||s,n||l):a)),this.view.events.push(...o),this.isMonthView&&(this.view.outOfScopeEvents=[],t.forEach(a=>{(e.eventInRange(a,r,s)||e.eventInRange(a,l,n))&&(this.view.events.some(u=>u._eid===a._eid)||this.view.outOfScopeEvents.push(a))}))},findAncestor(t,e){for(;(t=t.parentElement)&&!t.classList.contains(e););return t},isDOMElementAnEvent(t){return t.classList.contains("vuecal__event")||this.findAncestor(t,"vuecal__event")},onMouseMove(t){const{resizeAnEvent:e,dragAnEvent:s,dragCreateAnEvent:l}=this.domEvents;e._eid===null&&s._eid===null&&!l.start||(t.preventDefault(),e._eid?this.eventResizing(t):this.dragToCreateEvent&&l.start&&this.eventDragCreation(t))},onMouseUp(t){const{focusAnEvent:e,resizeAnEvent:s,clickHoldAnEvent:l,clickHoldACell:r,dragCreateAnEvent:n}=this.domEvents,{_eid:o}=l,{_eid:a}=s;let u=!1;const{event:d,start:c}=n,v=this.isDOMElementAnEvent(t.target),h=e.mousedUp;if(e.mousedUp=!1,v&&(this.domEvents.cancelClickEventCreation=!0),r.eventCreated)return;if(a){const{originalEnd:m,originalEndTimeMinutes:k,endTimeMinutes:C}=s,g=this.view.events.find(T=>T._eid===s._eid);if(u=C&&C!==k,g&&g.end.getTime()!==m.getTime()){const T=this.mutableEvents.find(q=>q._eid===s._eid);T.endTimeMinutes=g.endTimeMinutes,T.end=g.end;const b=this.cleanupEvent(g),N=_(w({},this.cleanupEvent(g)),{end:m,endTimeMinutes:g.originalEndTimeMinutes});this.$emit("event-duration-change",{event:b,oldDate:s.originalEnd,originalEvent:N}),this.$emit("event-change",{event:b,originalEvent:N})}g&&(g.resizing=!1),s._eid=null,s.start=null,s.split=null,s.segment=null,s.originalEndTimeMinutes=null,s.originalEnd=null,s.endTimeMinutes=null,s.startCell=null,s.endCell=null}else c&&(d&&(this.emitWithEvent("event-drag-create",d),n.event.resizing=!1),n.start=null,n.split=null,n.event=null);!v&&!a&&this.unfocusEvent(),l.timeoutId&&!o&&(clearTimeout(l.timeoutId),l.timeoutId=null),r.timeoutId&&(clearTimeout(r.timeoutId),r.timeoutId=null);const D=typeof this.onEventClick=="function";if(h&&!u&&!o&&!d&&D){let m=this.view.events.find(k=>k._eid===e._eid);return!m&&this.isMonthView&&(m=this.view.outOfScopeEvents.find(k=>k._eid===e._eid)),m&&this.onEventClick(m,t)}},onKeyUp(t){t.keyCode===27&&this.cancelDelete()},eventResizing(t){const{resizeAnEvent:e}=this.domEvents,s=this.view.events.find(d=>d._eid===e._eid)||{segments:{}},{minutes:l,cursorCoords:r}=this.minutesAtCursor(t),n=s.segments&&s.segments[e.segment],{date:o,event:a}=this.utils,u=Math.max(l,this.timeFrom+1,(n||s).startTimeMinutes+1);if(s.endTimeMinutes=e.endTimeMinutes=u,this.snapToTime){const d=s.endTimeMinutes+this.snapToTime/2;s.endTimeMinutes=d-d%this.snapToTime}if(n&&(n.endTimeMinutes=s.endTimeMinutes),s.end.setHours(0,s.endTimeMinutes,s.endTimeMinutes===j?-1:0,0),this.resizeX&&this.isWeekView){s.daysCount=o.countDays(s.start,s.end);const d=this.cellsEl,c=d.offsetWidth/d.childElementCount,v=Math.floor(r.x/c);if(e.startCell===null&&(e.startCell=v-(s.daysCount-1)),e.endCell!==v){e.endCell=v;const h=o.addDays(s.start,v-e.startCell),D=Math.max(o.countDays(s.start,h),1);if(D!==s.daysCount){let m=null;D>s.daysCount?m=a.addEventSegment(s):m=a.removeEventSegment(s),e.segment=m,s.endTimeMinutes+=.001}}}this.$emit("event-resizing",{_eid:s._eid,end:s.end,endTimeMinutes:s.endTimeMinutes})},eventDragCreation(t){const{dragCreateAnEvent:e}=this.domEvents,{start:s,startCursorY:l,split:r}=e,n=new Date(s),{minutes:o,cursorCoords:{y:a}}=this.minutesAtCursor(t);if(!(!e.event&&Math.abs(l-a)<this.dragToCreateThreshold))if(e.event){if(n.setHours(0,o,o===j?-1:0,0),this.snapToTime){let c=n.getHours()*60+n.getMinutes();const v=c+this.snapToTime/2;c=v-v%this.snapToTime,n.setHours(0,c,0,0)}const u=s<n,{event:d}=e;d.start=u?s:n,d.end=u?n:s,d.startTimeMinutes=d.start.getHours()*60+d.start.getMinutes(),d.endTimeMinutes=d.end.getHours()*60+d.end.getMinutes()}else{if(e.event=this.utils.event.createAnEvent(s,1,{split:r}),!e.event){e.start=null,e.split=null,e.event=null;return}e.event.resizing=!0}},unfocusEvent(){const{focusAnEvent:t,clickHoldAnEvent:e}=this.domEvents,s=this.view.events.find(l=>l._eid===(t._eid||e._eid));t._eid=null,e._eid=null,s&&(s.focused=!1,s.deleting=!1)},cancelDelete(){const{clickHoldAnEvent:t}=this.domEvents;if(t._eid){const e=this.view.events.find(s=>s._eid===t._eid);e&&(e.deleting=!1),t._eid=null,t.timeoutId=null}},onEventTitleBlur(t,e){if(e.title===t.target.innerHTML)return;const s=e.title;e.title=t.target.innerHTML;const l=this.cleanupEvent(e);this.$emit("event-title-change",{event:l,oldTitle:s}),this.$emit("event-change",{event:l,originalEvent:_(w({},l),{title:s})})},updateMutableEvents(){const t=this.utils.date;this.mutableEvents=[],this.events.forEach(e=>{const s=typeof e.start=="string"?t.stringToDate(e.start):e.start,l=t.formatDateLite(s),r=t.dateToMinutes(s);let n=null;typeof e.end=="string"&&e.end.includes("24:00")?(n=new Date(e.end.replace(" 24:00","")),n.setHours(23,59,59,0)):n=typeof e.end=="string"?t.stringToDate(e.end):e.end;let o=t.formatDateLite(n),a=t.dateToMinutes(n);(!a||a===j)&&(!this.time||typeof e.end=="string"&&e.end.length===10?n.setHours(23,59,59,0):n.setSeconds(n.getSeconds()-1),o=t.formatDateLite(n),a=j);const u=l!==o;e=Object.assign(w({},this.utils.event.eventDefaults),e,{_eid:`${this._.uid}_${this.eventIdIncrement++}`,segments:u?{}:null,start:s,startTimeMinutes:r,end:n,endTimeMinutes:a,daysCount:u?t.countDays(s,n):1,class:e.class}),this.mutableEvents.push(e)})},minutesAtCursor(t){return this.utils.cell.minutesAtCursor(t)},createEvent(t,e,s={}){return this.utils.event.createAnEvent(t,e,s)},cleanupEvent(t){return t=w({},t),["segments","deletable","deleting","titleEditable","resizable","resizing","draggable","dragging","draggingStatic","focused"].forEach(s=>{s in t&&delete t[s]}),t.repeat||delete t.repeat,t},emitWithEvent(t,e){this.$emit(t,this.cleanupEvent(e))},updateSelectedDate(t){if(t&&typeof t=="string"?t=this.utils.date.stringToDate(t):t=new Date(t),t&&t instanceof Date){const{selectedDate:e}=this.view;e&&(this.transitionDirection=e.getTime()>t.getTime()?"left":"right"),t.setHours(0,0,0,0),(!e||e.getTime()!==t.getTime())&&(this.view.selectedDate=t),this.switchView(this.view.id)}},getWeekNumber(t){const e=this.utils.date,l=this.firstCellDateWeekNumber+t,r=this.startWeekOnSunday?1:0;return l>52?e.getWeek(e.addDays(this.view.firstCellDate,7*t+r)):l},timeTick(){this.now=new Date,this.timeTickerIds[1]=setTimeout(this.timeTick,60*1e3)},updateDateTexts(){this.utils.date.updateTexts(this.texts)},alignWithScrollbar(){if(document.getElementById("vuecal-align-with-scrollbar"))return;const t=this.$refs.vuecal.getElementsByClassName("vuecal__scrollbar-check")[0],e=t.offsetWidth-t.children[0].offsetWidth;if(e){const s=document.createElement("style");s.id="vuecal-align-with-scrollbar",s.type="text/css",s.innerHTML=`.vuecal__weekdays-headings,.vuecal__all-day {padding-right: ${e}px}`,document.head.appendChild(s)}},cellOrSplitHasEvents(t,e=null){return t.length&&(!e&&t.length||e&&t.some(s=>s.split===e.id))}},created(){this.utils.cell=new Q(this),this.utils.event=new ee(this,this.utils.date),this.loadLocale(this.locale),this.editEvents.drag&&this.loadDragAndDrop(),this.updateMutableEvents(this.events),this.view.id=this.currentView,this.selectedDate?this.updateSelectedDate(this.selectedDate):(this.view.selectedDate=new Date,this.switchView(this.currentView)),this.time&&this.watchRealTime&&(this.timeTickerIds[0]=setTimeout(this.timeTick,(60-this.now.getSeconds())*1e3))},mounted(){const t=this.utils.date,e="ontouchstart"in window,{resize:s,drag:l,create:r,delete:n,title:o}=this.editEvents,a=this.onEventClick&&typeof this.onEventClick=="function";(s||l||r||n||o||a)&&window.addEventListener(e?"touchend":"mouseup",this.onMouseUp),(s||l||r&&this.dragToCreateEvent)&&window.addEventListener(e?"touchmove":"mousemove",this.onMouseMove,{passive:!1}),o&&window.addEventListener("keyup",this.onKeyUp),e&&(this.$refs.vuecal.oncontextmenu=function(c){c.preventDefault(),c.stopPropagation()}),this.hideBody||this.alignWithScrollbar();const u=this.view.startDate,d=w(_(w({view:this.view.id,startDate:u,endDate:this.view.endDate},this.isMonthView?{firstCellDate:this.view.firstCellDate,lastCellDate:this.view.lastCellDate}:{}),{events:this.view.events.map(this.cleanupEvent)}),this.isWeekView?{week:t.getWeek(this.startWeekOnSunday?t.addDays(u,1):u)}:{});this.$emit("ready",d),this.ready=!0},beforeUnmount(){const t="ontouchstart"in window;window.removeEventListener(t?"touchmove":"mousemove",this.onMouseMove,{passive:!1}),window.removeEventListener(t?"touchend":"mouseup",this.onMouseUp),window.removeEventListener("keyup",this.onKeyUp),this.timeTickerIds[0]&&clearTimeout(this.timeTickerIds[0]),this.timeTickerIds[1]&&clearTimeout(this.timeTickerIds[1]),this.timeTickerIds=[null,null]},computed:{editEvents(){return this.editableEvents&&typeof this.editableEvents=="object"?{title:!!this.editableEvents.title,drag:!!this.editableEvents.drag,resize:!!this.editableEvents.resize,create:!!this.editableEvents.create,delete:!!this.editableEvents.delete}:{title:!!this.editableEvents,drag:!!this.editableEvents,resize:!!this.editableEvents,create:!!this.editableEvents,delete:!!this.editableEvents}},views(){return{years:{label:this.texts.years,enabled:!this.disableViews.includes("years")},year:{label:this.texts.year,enabled:!this.disableViews.includes("year")},month:{label:this.texts.month,enabled:!this.disableViews.includes("month")},week:{label:this.texts.week,enabled:!this.disableViews.includes("week")},day:{label:this.texts.day,enabled:!this.disableViews.includes("day")}}},currentView(){return this.validateView(this.activeView)},enabledViews(){return Object.keys(this.views).filter(t=>this.views[t].enabled)},hasTimeColumn(){return this.time&&this.isWeekOrDayView},isShortMonthView(){return this.isMonthView&&this.eventsOnMonthView==="short"},firstCellDateWeekNumber(){const t=this.utils.date,e=this.view.firstCellDate;return t.getWeek(this.startWeekOnSunday?t.addDays(e,1):e)},timeCells(){const t=[];for(let e=this.timeFrom,s=this.timeTo;e<s;e+=this.timeStep)t.push({hours:Math.floor(e/60),minutes:e%60,label:this.utils.date.formatTime(e,this.TimeFormat),value:e});return t},TimeFormat(){return this.timeFormat||(this.twelveHour?"h:mm{am}":"HH:mm")},daySplits(){return(this.splitDays.filter(t=>!t.hide)||[]).map((t,e)=>_(w({},t),{id:t.id||e+1}))},hasSplits(){return this.daySplits.length&&this.isWeekOrDayView},hasShortEvents(){return this.showAllDayEvents==="short"},cellOrSplitMinWidth(){let t=null;return this.hasSplits&&this.minSplitWidth?t=this.visibleDaysCount*this.minSplitWidth*this.daySplits.length:this.minCellWidth&&this.isWeekView&&(t=this.visibleDaysCount*this.minCellWidth),t},allDayBar(){let t=this.allDayBarHeight||null;return t&&!isNaN(t)&&(t+="px"),{cells:this.viewCells,options:this.$props,label:this.texts.allDay,shortEvents:this.hasShortEvents,daySplits:this.hasSplits&&this.daySplits||[],cellOrSplitMinWidth:this.cellOrSplitMinWidth,height:t}},minTimestamp(){let t=null;return this.minDate&&typeof this.minDate=="string"?t=this.utils.date.stringToDate(this.minDate):this.minDate&&this.minDate instanceof Date&&(t=this.minDate),t?t.getTime():null},maxTimestamp(){let t=null;return this.maxDate&&typeof this.maxDate=="string"?t=this.utils.date.stringToDate(this.maxDate):this.maxDate&&this.minDate instanceof Date&&(t=this.maxDate),t?t.getTime():null},weekDays(){let{weekDays:t,weekDaysShort:e=[]}=this.texts;return t=t.slice(0).map((s,l)=>_(w({label:s},e.length?{short:e[l]}:{}),{hide:this.hideWeekends&&l>=5||this.hideWeekdays.length&&this.hideWeekdays.includes(l+1)})),this.startWeekOnSunday&&t.unshift(t.pop()),t},weekDaysInHeader(){return this.isMonthView||this.isWeekView&&!this.minCellWidth&&!(this.hasSplits&&this.minSplitWidth)},months(){return this.texts.months.map(t=>({label:t}))},specialDayHours(){return!this.specialHours||!Object.keys(this.specialHours).length?{}:Array(7).fill("").map((t,e)=>{let s=this.specialHours[e+1]||[];return Array.isArray(s)||(s=[s]),t=[],s.forEach(({from:l,to:r,class:n},o)=>{t[o]={day:e+1,from:[null,void 0].includes(l)?null:l*1,to:[null,void 0].includes(r)?null:r*1,class:n||""}}),t})},viewTitle(){const t=this.utils.date;let e="";const s=this.view.startDate,l=s.getFullYear(),r=s.getMonth();switch(this.view.id){case"years":{e=this.texts.years;break}case"year":{e=l;break}case"month":{e=`${this.months[r].label} ${l}`;break}case"week":{const n=this.view.endDate,o=s.getFullYear();let a=this.texts.months[s.getMonth()];this.xsmall&&(a=a.substring(0,3));let u=`${a} ${o}`;if(n.getMonth()!==s.getMonth()){const d=n.getFullYear();let c=this.texts.months[n.getMonth()];this.xsmall&&(c=c.substring(0,3)),o===d?u=`${a} - ${c} ${o}`:this.small?u=`${a.substring(0,3)} ${o} - ${c.substring(0,3)} ${d}`:u=`${a} ${o} - ${c} ${d}`}e=`${this.texts.week} ${t.getWeek(this.startWeekOnSunday?t.addDays(s,1):s)} (${u})`;break}case"day":{e=this.utils.date.formatDate(s,this.texts.dateFormat,this.texts);break}}return e},viewCells(){const t=this.utils.date;let e=[],s=null,l=!1;this.watchRealTime||(this.now=new Date);const r=this.now;switch(this.view.id){case"years":{s=this.view.startDate.getFullYear(),e=Array.apply(null,Array(25)).map((n,o)=>{const a=new Date(s+o,0,1),u=new Date(s+o+1,0,1);return u.setSeconds(-1),{startDate:a,formattedDate:t.formatDateLite(a),endDate:u,content:s+o,current:s+o===r.getFullYear()}});break}case"year":{s=this.view.startDate.getFullYear(),e=Array.apply(null,Array(12)).map((n,o)=>{const a=new Date(s,o,1),u=new Date(s,o+1,1);return u.setSeconds(-1),{startDate:a,formattedDate:t.formatDateLite(a),endDate:u,content:this.xsmall?this.months[o].label.substr(0,3):this.months[o].label,current:o===r.getMonth()&&s===r.getFullYear()}});break}case"month":{const n=this.view.startDate.getMonth(),o=new Date(this.view.firstCellDate);l=!1,e=Array.apply(null,Array(42)).map((a,u)=>{const d=t.addDays(o,u),c=new Date(d);c.setHours(23,59,59,0);const v=!l&&t.isToday(d)&&!l++;return{startDate:d,formattedDate:t.formatDateLite(d),endDate:c,content:d.getDate(),today:v,outOfScope:d.getMonth()!==n,class:`vuecal__cell--day${d.getDay()||7}`}}),(this.hideWeekends||this.hideWeekdays.length)&&(e=e.filter(a=>{const u=a.startDate.getDay()||7;return!(this.hideWeekends&&u>=6||this.hideWeekdays.length&&this.hideWeekdays.includes(u))}));break}case"week":{l=!1;const n=this.view.startDate,o=this.weekDays;e=o.map((a,u)=>{const d=t.addDays(n,u),c=new Date(d);c.setHours(23,59,59,0);const v=(d.getDay()||7)-1;return{startDate:d,formattedDate:t.formatDateLite(d),endDate:c,today:!l&&t.isToday(d)&&!l++,specialHours:this.specialDayHours[v]||[]}}).filter((a,u)=>!o[u].hide);break}case"day":{const n=this.view.startDate,o=new Date(this.view.startDate);o.setHours(23,59,59,0);const a=(n.getDay()||7)-1;e=[{startDate:n,formattedDate:t.formatDateLite(n),endDate:o,today:t.isToday(n),specialHours:this.specialDayHours[a]||[]}];break}}return e},visibleDaysCount(){return this.isDayView?1:7-this.weekDays.reduce((t,e)=>t+e.hide,0)},cellWidth(){return 100/this.visibleDaysCount},cssClasses(){const{resizeAnEvent:t,dragAnEvent:e,dragCreateAnEvent:s}=this.domEvents;return{[`vuecal--${this.view.id}-view`]:!0,[`vuecal--${this.locale}`]:this.locale,"vuecal--no-time":!this.time,"vuecal--view-with-time":this.hasTimeColumn,"vuecal--week-numbers":this.showWeekNumbers&&this.isMonthView,"vuecal--twelve-hour":this.twelveHour,"vuecal--click-to-navigate":this.clickToNavigate,"vuecal--hide-weekends":this.hideWeekends,"vuecal--split-days":this.hasSplits,"vuecal--sticky-split-labels":this.hasSplits&&this.stickySplitLabels,"vuecal--overflow-x":this.minCellWidth&&this.isWeekView||this.hasSplits&&this.minSplitWidth,"vuecal--small":this.small,"vuecal--xsmall":this.xsmall,"vuecal--resizing-event":t._eid,"vuecal--drag-creating-event":s.event,"vuecal--dragging-event":e._eid,"vuecal--events-on-month-view":this.eventsOnMonthView,"vuecal--short-events":this.isMonthView&&this.eventsOnMonthView==="short","vuecal--has-touch":typeof window!="undefined"&&"ontouchstart"in window}},isYearsOrYearView(){return["years","year"].includes(this.view.id)},isYearsView(){return this.view.id==="years"},isYearView(){return this.view.id==="year"},isMonthView(){return this.view.id==="month"},isWeekOrDayView(){return["week","day"].includes(this.view.id)},isWeekView(){return this.view.id==="week"},isDayView(){return this.view.id==="day"}},watch:{events:{handler(t,e){this.updateMutableEvents(t),this.addEventsToView()},deep:!0},locale(t){this.loadLocale(t)},selectedDate(t){this.updateSelectedDate(t)},activeView(t){this.switchView(t)}}};var gt=S(Dt,[["render",yt]]);module.exports=gt;
5
+ */var i=require("vue");let M,H,A,g,S={},b={};class I{constructor(e,s=!1){k(this,"texts",{});k(this,"dateToMinutes",e=>e.getHours()*60+e.getMinutes());g=this,this._texts=e,!s&&Date&&!Date.prototype.addDays&&this._initDatePrototypes()}_initDatePrototypes(){Date.prototype.addDays=function(e){return g.addDays(this,e)},Date.prototype.subtractDays=function(e){return g.subtractDays(this,e)},Date.prototype.addHours=function(e){return g.addHours(this,e)},Date.prototype.subtractHours=function(e){return g.subtractHours(this,e)},Date.prototype.addMinutes=function(e){return g.addMinutes(this,e)},Date.prototype.subtractMinutes=function(e){return g.subtractMinutes(this,e)},Date.prototype.getWeek=function(){return g.getWeek(this)},Date.prototype.isToday=function(){return g.isToday(this)},Date.prototype.isLeapYear=function(){return g.isLeapYear(this)},Date.prototype.format=function(e="YYYY-MM-DD"){return g.formatDate(this,e)},Date.prototype.formatTime=function(e="HH:mm"){return g.formatTime(this,e)}}removePrototypes(){delete Date.prototype.addDays,delete Date.prototype.subtractDays,delete Date.prototype.addHours,delete Date.prototype.subtractHours,delete Date.prototype.addMinutes,delete Date.prototype.subtractMinutes,delete Date.prototype.getWeek,delete Date.prototype.isToday,delete Date.prototype.isLeapYear,delete Date.prototype.format,delete Date.prototype.formatTime}updateTexts(e){this._texts=e}_todayFormatted(){return H!==new Date().getDate()&&(M=new Date,H=M.getDate(),A=`${M.getFullYear()}-${M.getMonth()}-${M.getDate()}`),A}addDays(e,s){const l=new Date(e.valueOf());return l.setDate(l.getDate()+s),l}subtractDays(e,s){const l=new Date(e.valueOf());return l.setDate(l.getDate()-s),l}addHours(e,s){const l=new Date(e.valueOf());return l.setHours(l.getHours()+s),l}subtractHours(e,s){const l=new Date(e.valueOf());return l.setHours(l.getHours()-s),l}addMinutes(e,s){const l=new Date(e.valueOf());return l.setMinutes(l.getMinutes()+s),l}subtractMinutes(e,s){const l=new Date(e.valueOf());return l.setMinutes(l.getMinutes()-s),l}getWeek(e){const s=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())),l=s.getUTCDay()||7;s.setUTCDate(s.getUTCDate()+4-l);const r=new Date(Date.UTC(s.getUTCFullYear(),0,1));return Math.ceil(((s-r)/864e5+1)/7)}isToday(e){return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`===this._todayFormatted()}isLeapYear(e){const s=e.getFullYear();return!(s%400)||s%100&&!(s%4)}getPreviousFirstDayOfWeek(e=null,s){const l=e&&new Date(e.valueOf())||new Date,r=s?7:6;return l.setDate(l.getDate()-(l.getDay()+r)%7),l}stringToDate(e){return e instanceof Date?e:(e.length===10&&(e+=" 00:00"),new Date(e.replace(/-/g,"/")))}countDays(e,s){typeof e=="string"&&(e=e.replace(/-/g,"/")),typeof s=="string"&&(s=s.replace(/-/g,"/")),e=new Date(e).setHours(0,0,0,0),s=new Date(s).setHours(0,0,1,0);const l=(new Date(s).getTimezoneOffset()-new Date(e).getTimezoneOffset())*60*1e3;return Math.ceil((s-e-l)/(24*3600*1e3))}datesInSameTimeStep(e,s,l){return Math.abs(e.getTime()-s.getTime())<=l*60*1e3}formatDate(e,s="YYYY-MM-DD",l=null){if(l||(l=this._texts),s||(s="YYYY-MM-DD"),s==="YYYY-MM-DD")return this.formatDateLite(e);S={},b={};const r={YYYY:()=>this._hydrateDateObject(e,l).YYYY,YY:()=>this._hydrateDateObject(e,l).YY(),M:()=>this._hydrateDateObject(e,l).M,MM:()=>this._hydrateDateObject(e,l).MM(),MMM:()=>this._hydrateDateObject(e,l).MMM(),MMMM:()=>this._hydrateDateObject(e,l).MMMM(),MMMMG:()=>this._hydrateDateObject(e,l).MMMMG(),D:()=>this._hydrateDateObject(e,l).D,DD:()=>this._hydrateDateObject(e,l).DD(),S:()=>this._hydrateDateObject(e,l).S(),d:()=>this._hydrateDateObject(e,l).d,dd:()=>this._hydrateDateObject(e,l).dd(),ddd:()=>this._hydrateDateObject(e,l).ddd(),dddd:()=>this._hydrateDateObject(e,l).dddd(),HH:()=>this._hydrateTimeObject(e,l).HH,H:()=>this._hydrateTimeObject(e,l).H,hh:()=>this._hydrateTimeObject(e,l).hh,h:()=>this._hydrateTimeObject(e,l).h,am:()=>this._hydrateTimeObject(e,l).am,AM:()=>this._hydrateTimeObject(e,l).AM,mm:()=>this._hydrateTimeObject(e,l).mm,m:()=>this._hydrateTimeObject(e,l).m};return s.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g,(n,o)=>{const a=r[o.replace(/\{|\}/g,"")];return a!==void 0?a():o})}formatDateLite(e){const s=e.getMonth()+1,l=e.getDate();return`${e.getFullYear()}-${s<10?"0":""}${s}-${l<10?"0":""}${l}`}formatTime(e,s="HH:mm",l=null,r=!1){let n=!1;if(r){const[u,d,c]=[e.getHours(),e.getMinutes(),e.getSeconds()];u+d+c===23+59+59&&(n=!0)}if(e instanceof Date&&s==="HH:mm")return n?"24:00":this.formatTimeLite(e);b={},l||(l=this._texts);const o=this._hydrateTimeObject(e,l),a=s.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g,(u,d)=>{const c=o[d.replace(/\{|\}/g,"")];return c!==void 0?c:d});return n?a.replace("23:59","24:00"):a}formatTimeLite(e){const s=e.getHours(),l=e.getMinutes();return`${(s<10?"0":"")+s}:${(l<10?"0":"")+l}`}_nth(e){if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}_hydrateDateObject(e,s){if(S.D)return S;const l=e.getFullYear(),r=e.getMonth()+1,n=e.getDate(),a=(e.getDay()-1+7)%7;return S={YYYY:l,YY:()=>l.toString().substring(2),M:r,MM:()=>(r<10?"0":"")+r,MMM:()=>s.months[r-1].substring(0,3),MMMM:()=>s.months[r-1],MMMMG:()=>(s.monthsGenitive||s.months)[r-1],D:n,DD:()=>(n<10?"0":"")+n,S:()=>this._nth(n),d:a+1,dd:()=>s.weekDays[a][0],ddd:()=>s.weekDays[a].substr(0,3),dddd:()=>s.weekDays[a]},S}_hydrateTimeObject(e,s){if(b.am)return b;let l,r;e instanceof Date?(l=e.getHours(),r=e.getMinutes()):(l=Math.floor(e/60),r=Math.floor(e%60));const n=l%12?l%12:12,o=(s||{am:"am",pm:"pm"})[l===24||l<12?"am":"pm"];return b={H:l,h:n,HH:(l<10?"0":"")+l,hh:(n<10?"0":"")+n,am:o,AM:o.toUpperCase(),m:r,mm:(r<10?"0":"")+r},b}}const q=24*60;class U{constructor(e){k(this,"_vuecal",null);k(this,"selectCell",(e=!1,s,l)=>{this._vuecal.$emit("cell-click",l?{date:s,split:l}:s),this._vuecal.clickToNavigate||e?this._vuecal.switchToNarrowerView():this._vuecal.dblclickToNavigate&&"ontouchstart"in window&&(this._vuecal.domEvents.dblTapACell.taps++,setTimeout(()=>this._vuecal.domEvents.dblTapACell.taps=0,this._vuecal.domEvents.dblTapACell.timeout),this._vuecal.domEvents.dblTapACell.taps>=2&&(this._vuecal.domEvents.dblTapACell.taps=0,this._vuecal.switchToNarrowerView(),this._vuecal.$emit("cell-dblclick",l?{date:s,split:l}:s)))});k(this,"keyPressEnterCell",(e,s)=>{this._vuecal.$emit("cell-keypress-enter",s?{date:e,split:s}:e),this._vuecal.switchToNarrowerView()});k(this,"getPosition",e=>{const{left:s,top:l}=this._vuecal.cellsEl.getBoundingClientRect(),{clientX:r,clientY:n}="ontouchstart"in window&&e.touches?e.touches[0]:e;return{x:r-s,y:n-l}});k(this,"minutesAtCursor",e=>{let s=0,l={x:0,y:0};const{timeStep:r,timeCellHeight:n,timeFrom:o}=this._vuecal.$props;return typeof e=="number"?s=e:typeof e=="object"&&(l=this.getPosition(e),s=Math.round(l.y*r/parseInt(n)+o)),{minutes:Math.max(Math.min(s,q),0),cursorCoords:l}});this._vuecal=e}}const R=2,j=24*60;let f,y,O;class K{constructor(e,s){k(this,"_vuecal",null);k(this,"eventDefaults",{_eid:null,start:"",startTimeMinutes:0,end:"",endTimeMinutes:0,title:"",content:"",background:!1,allDay:!1,segments:null,repeat:null,daysCount:1,deletable:!0,deleting:!1,titleEditable:!0,resizable:!0,resizing:!1,draggable:!0,dragging:!1,draggingStatic:!1,focused:!1,class:""});this._vuecal=e,f=s}createAnEvent(e,s,l){if(typeof e=="string"&&(e=f.stringToDate(e)),!(e instanceof Date))return!1;const r=f.dateToMinutes(e);s=s*1||R*60;const n=r+s,o=f.addMinutes(new Date(e),s);l.end&&(typeof l.end=="string"&&(l.end=f.stringToDate(l.end)),l.endTimeMinutes=f.dateToMinutes(l.end));const a={...this.eventDefaults,_eid:`${this._vuecal._.uid}_${this._vuecal.eventIdIncrement++}`,start:e,startTimeMinutes:r,end:o,endTimeMinutes:n,segments:null,...l};if(!(typeof this._vuecal.onEventCreate=="function"&&!this._vuecal.onEventCreate(a,()=>this.deleteAnEvent(a))))return a.startDateF!==a.endDateF&&(a.daysCount=f.countDays(a.start,a.end)),this._vuecal.mutableEvents.push(a),this._vuecal.addEventsToView([a]),this._vuecal.emitWithEvent("event-create",a),this._vuecal.$emit("event-change",{event:this._vuecal.cleanupEvent(a),originalEvent:null}),a}addEventSegment(e){e.segments||(e.segments={},e.segments[f.formatDateLite(e.start)]={start:e.start,startTimeMinutes:e.startTimeMinutes,endTimeMinutes:j,isFirstDay:!0,isLastDay:!1});const s=e.segments[f.formatDateLite(e.end)];s&&(s.isLastDay=!1,s.endTimeMinutes=j);const l=f.addDays(e.end,1),r=f.formatDateLite(l);return l.setHours(0,0,0,0),e.segments[r]={start:l,startTimeMinutes:0,endTimeMinutes:e.endTimeMinutes,isFirstDay:!1,isLastDay:!0},e.end=f.addMinutes(l,e.endTimeMinutes),e.daysCount=Object.keys(e.segments).length,r}removeEventSegment(e){let s=Object.keys(e.segments).length;if(s<=1)return f.formatDateLite(e.end);delete e.segments[f.formatDateLite(e.end)],s--;const l=f.subtractDays(e.end,1),r=f.formatDateLite(l),n=e.segments[r];return s?n&&(n.isLastDay=!0,n.endTimeMinutes=e.endTimeMinutes):e.segments=null,e.daysCount=s||1,e.end=l,r}createEventSegments(e,s,l){const r=s.getTime(),n=l.getTime();let o=e.start.getTime(),a=e.end.getTime(),u=!1,d,c,v;for(!e.end.getHours()&&!e.end.getMinutes()&&(a-=1e3),e.segments={},e.repeat?(d=r,c=Math.min(n,e.repeat.until?f.stringToDate(e.repeat.until).getTime():n)):(d=Math.max(r,o),c=Math.min(n,a));d<=c;){let h=!1;const w=f.addDays(new Date(d),1).setHours(0,0,0,0);let m,p,_,D;if(e.repeat){const C=new Date(d),E=f.formatDateLite(C);(u||e.occurrences&&e.occurrences[E])&&(u||(o=e.occurrences[E].start,v=new Date(o).setHours(0,0,0,0),a=e.occurrences[E].end),u=!0,h=!0),m=d===v,p=E===f.formatDateLite(new Date(a)),_=new Date(m?o:d),D=f.formatDateLite(_),p&&(u=!1)}else h=!0,m=d===o,p=c===a&&w>c,_=m?e.start:new Date(d),D=f.formatDateLite(m?e.start:_);h&&(e.segments[D]={start:_,startTimeMinutes:m?e.startTimeMinutes:0,endTimeMinutes:p?e.endTimeMinutes:j,isFirstDay:m,isLastDay:p}),d=w}return e}deleteAnEvent(e){this._vuecal.emitWithEvent("event-delete",e),this._vuecal.mutableEvents=this._vuecal.mutableEvents.filter(s=>s._eid!==e._eid),this._vuecal.view.events=this._vuecal.view.events.filter(s=>s._eid!==e._eid)}checkCellOverlappingEvents(e,s){O=e.slice(0),y={},e.forEach(r=>{O.shift(),y[r._eid]||(y[r._eid]={overlaps:[],start:r.start,position:0}),y[r._eid].position=0,O.forEach(n=>{y[n._eid]||(y[n._eid]={overlaps:[],start:n.start,position:0});const o=this.eventInRange(n,r.start,r.end),a=s.overlapsPerTimeStep?f.datesInSameTimeStep(r.start,n.start,s.timeStep):1;if(!r.background&&!r.allDay&&!n.background&&!n.allDay&&o&&a)y[r._eid].overlaps.push(n._eid),y[r._eid].overlaps=[...new Set(y[r._eid].overlaps)],y[n._eid].overlaps.push(r._eid),y[n._eid].overlaps=[...new Set(y[n._eid].overlaps)],y[n._eid].position++;else{let u,d;(u=(y[r._eid]||{overlaps:[]}).overlaps.indexOf(n._eid))>-1&&y[r._eid].overlaps.splice(u,1),(d=(y[n._eid]||{overlaps:[]}).overlaps.indexOf(r._eid))>-1&&y[n._eid].overlaps.splice(d,1),y[n._eid].position--}})});let l=0;for(const r in y){const n=y[r],o=n.overlaps.map(a=>({id:a,start:y[a].start}));o.push({id:r,start:n.start}),o.sort((a,u)=>a.start<u.start?-1:a.start>u.start?1:a.id>u.id?-1:1),n.position=o.findIndex(a=>a.id===r),l=Math.max(this.getOverlapsStreak(n,y),l)}return[y,l]}getOverlapsStreak(e,s={}){let l=e.overlaps.length+1,r=[];return e.overlaps.forEach(n=>{r.includes(n)||e.overlaps.filter(a=>a!==n).forEach(a=>{s[a].overlaps.includes(n)||r.push(a)})}),r=[...new Set(r)],l-=r.length,l}eventInRange(e,s,l){if(e.allDay||!this._vuecal.time){const o=new Date(e.start).setHours(0,0,0,0);return new Date(e.end).setHours(23,59,0,0)>=new Date(s).setHours(0,0,0,0)&&o<=new Date(l).setHours(0,0,0,0)}const r=e.start.getTime(),n=e.end.getTime();return r<l.getTime()&&n>s.getTime()}}const X={class:"vuecal__flex vuecal__weekdays-headings"},G=["onClick"],Z={class:"vuecal__flex weekday-label",grow:""},J={class:"full"},Q={class:"small"},$={class:"xsmall"},ee={key:0},te={key:0,class:"vuecal__flex vuecal__split-days-headers",grow:""};function se(t,e,s,l,r,n){return i.openBlock(),i.createElementBlock("div",X,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.headings,(o,a)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:a},[o.hide?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["vuecal__flex vuecal__heading",{today:o.today,clickable:n.cellHeadingsClickable}]),style:i.normalizeStyle(n.weekdayCellStyles),onClick:u=>n.view.id==="week"&&n.selectCell(o.date,u),onDblclick:e[0]||(e[0]=u=>n.view.id==="week"&&n.vuecal.dblclickToNavigate&&s.switchToNarrowerView())},[i.createVNode(i.Transition,{name:`slide-fade--${s.transitionDirection}`,appear:n.vuecal.transitions},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("div",{class:"vuecal__flex",column:"",key:n.vuecal.transitions?`${a}-${o.dayOfMonth}`:!1},[i.createElementVNode("div",Z,[i.renderSlot(t.$slots,"weekday-heading",{heading:n.cleanupHeading(o),view:n.view},()=>[i.createElementVNode("span",J,i.toDisplayString(o.full),1),i.createElementVNode("span",Q,i.toDisplayString(o.small),1),i.createElementVNode("span",$,i.toDisplayString(o.xsmall),1),o.dayOfMonth?(i.openBlock(),i.createElementBlock("span",ee,"\xA0"+i.toDisplayString(o.dayOfMonth),1)):i.createCommentVNode("",!0)])]),n.vuecal.hasSplits&&n.vuecal.stickySplitLabels?(i.openBlock(),i.createElementBlock("div",te,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.vuecal.daySplits,(u,d)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["day-split-header",u.class||!1]),key:d},[i.renderSlot(t.$slots,"split-label",{split:u,view:n.view},()=>[i.createTextVNode(i.toDisplayString(u.label),1)])],2))),128))])):i.createCommentVNode("",!0)]))]),_:2},1032,["name","appear"])],46,G))],64))),128))])}var T=(t,e)=>{const s=t.__vccOpts||t;for(const[l,r]of e)s[l]=r;return s};const ie={inject:["vuecal","utils","view"],props:{transitionDirection:{type:String,default:"right"},weekDays:{type:Array,default:()=>[]},switchToNarrowerView:{type:Function,default:()=>{}}},methods:{selectCell(t,e){t.getTime()!==this.view.selectedDate.getTime()&&(this.view.selectedDate=t),this.utils.cell.selectCell(!1,t,e)},cleanupHeading:t=>({label:t.full,date:t.date,...t.today?{today:t.today}:{}})},computed:{headings(){if(!["month","week"].includes(this.view.id))return[];let t=!1;return this.weekDays.map((s,l)=>{const r=this.utils.date.addDays(this.view.startDate,l);return{hide:s.hide,full:s.label,small:s.short||s.label.substr(0,3),xsmall:s.short||s.label.substr(0,1),...this.view.id==="week"?{dayOfMonth:r.getDate(),date:r,today:!t&&this.utils.date.isToday(r)&&!t++}:{}}})},cellWidth(){return 100/(7-this.weekDays.reduce((t,e)=>t+e.hide,0))},weekdayCellStyles(){return{...this.vuecal.hideWeekdays.length?{width:`${this.cellWidth}%`}:{}}},cellHeadingsClickable(){return this.view.id==="week"&&(this.vuecal.clickToNavigate||this.vuecal.dblclickToNavigate)}}};var L=T(ie,[["render",se]]);const ne={class:"vuecal__header"},le={key:0,class:"vuecal__flex vuecal__menu",role:"tablist","aria-label":"Calendar views navigation"},ae=["onDragenter","onDragleave","onClick","aria-label"],re={key:1,class:"vuecal__title-bar"},oe=["aria-label"],de={class:"vuecal__flex vuecal__title",grow:""},ue=["aria-label"],ce={key:0,class:"vuecal__flex vuecal__split-days-headers"};function he(t,e,s,l,r,n){const o=i.resolveComponent("weekdays-headings");return i.openBlock(),i.createElementBlock("div",ne,[s.options.hideViewSelector?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",le,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.viewProps.views,(a,u)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:u},[a.enabled?(i.openBlock(),i.createElementBlock("button",{key:0,class:i.normalizeClass(["vuecal__view-btn",{"vuecal__view-btn--active":n.view.id===u,"vuecal__view-btn--highlighted":t.highlightedControl===u}]),type:"button",onDragenter:d=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragEnter(d,u,t.$data),onDragleave:d=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragLeave(d,u,t.$data),onClick:d=>n.switchView(u,null,!0),"aria-label":`${a.label} view`},i.toDisplayString(a.label),43,ae)):i.createCommentVNode("",!0)],64))),128))])),s.options.hideTitleBar?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",re,[i.createElementVNode("button",{class:i.normalizeClass(["vuecal__arrow vuecal__arrow--prev",{"vuecal__arrow--highlighted":t.highlightedControl==="previous"}]),type:"button",onClick:e[0]||(e[0]=(...a)=>n.previous&&n.previous(...a)),onDragenter:e[1]||(e[1]=a=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragEnter(a,"previous",t.$data)),onDragleave:e[2]||(e[2]=a=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragLeave(a,"previous",t.$data)),"aria-label":`Previous ${n.view.id}`},[i.renderSlot(t.$slots,"arrow-prev")],42,oe),i.createElementVNode("div",de,[i.createVNode(i.Transition,{name:s.options.transitions?`slide-fade--${n.transitionDirection}`:""},{default:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.broaderView?"button":"span"),{type:!!n.broaderView&&"button",key:`${n.view.id}${n.view.startDate.toString()}`,onClick:e[3]||(e[3]=a=>!!n.broaderView&&n.switchToBroaderView()),"aria-label":!!n.broaderView&&`Go to ${n.broaderView} view`},{default:i.withCtx(()=>[i.renderSlot(t.$slots,"title")]),_:3},8,["type","aria-label"]))]),_:3},8,["name"])]),s.options.todayButton?(i.openBlock(),i.createElementBlock("button",{key:0,class:i.normalizeClass(["vuecal__today-btn",{"vuecal__today-btn--highlighted":t.highlightedControl==="today"}]),type:"button",onClick:e[4]||(e[4]=(...a)=>n.goToToday&&n.goToToday(...a)),onDragenter:e[5]||(e[5]=a=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragEnter(a,"today",t.$data)),onDragleave:e[6]||(e[6]=a=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragLeave(a,"today",t.$data)),"aria-label":"Today"},[i.renderSlot(t.$slots,"today-button")],34)):i.createCommentVNode("",!0),i.createElementVNode("button",{class:i.normalizeClass(["vuecal__arrow vuecal__arrow--next",{"vuecal__arrow--highlighted":t.highlightedControl==="next"}]),type:"button",onClick:e[7]||(e[7]=(...a)=>n.next&&n.next(...a)),onDragenter:e[8]||(e[8]=a=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragEnter(a,"next",t.$data)),onDragleave:e[9]||(e[9]=a=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragLeave(a,"next",t.$data)),"aria-label":`Next ${n.view.id}`},[i.renderSlot(t.$slots,"arrow-next")],42,ue)])),s.viewProps.weekDaysInHeader?(i.openBlock(),i.createBlock(o,{key:2,"week-days":s.weekDays,"transition-direction":n.transitionDirection,"switch-to-narrower-view":s.switchToNarrowerView},i.createSlots({_:2},[t.$slots["weekday-heading"]?{name:"weekday-heading",fn:i.withCtx(({heading:a,view:u})=>[i.renderSlot(t.$slots,"weekday-heading",{heading:a,view:u})])}:void 0,t.$slots["split-label"]?{name:"split-label",fn:i.withCtx(({split:a})=>[i.renderSlot(t.$slots,"split-label",{split:a,view:n.view})])}:void 0]),1032,["week-days","transition-direction","switch-to-narrower-view"])):i.createCommentVNode("",!0),i.createVNode(i.Transition,{name:`slide-fade--${n.transitionDirection}`},{default:i.withCtx(()=>[n.showDaySplits?(i.openBlock(),i.createElementBlock("div",ce,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.daySplits,(a,u)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["day-split-header",a.class||!1]),key:u},[i.renderSlot(t.$slots,"split-label",{split:a,view:n.view.id},()=>[i.createTextVNode(i.toDisplayString(a.label),1)])],2))),128))])):i.createCommentVNode("",!0)]),_:3},8,["name"])])}const ve={inject:["vuecal","previous","next","switchView","updateSelectedDate","modules","view"],components:{WeekdaysHeadings:L},props:{options:{type:Object,default:()=>({})},editEvents:{type:Object,required:!0},hasSplits:{type:[Boolean,Number],default:!1},daySplits:{type:Array,default:()=>[]},viewProps:{type:Object,default:()=>({})},weekDays:{type:Array,default:()=>[]},switchToNarrowerView:{type:Function,default:()=>{}}},data:()=>({highlightedControl:null}),methods:{goToToday(){this.updateSelectedDate(new Date(new Date().setHours(0,0,0,0)))},switchToBroaderView(){this.transitionDirection="left",this.broaderView&&this.switchView(this.broaderView)}},computed:{transitionDirection:{get(){return this.vuecal.transitionDirection},set(t){this.vuecal.transitionDirection=t}},broaderView(){const{enabledViews:t}=this.vuecal;return t[t.indexOf(this.view.id)-1]},showDaySplits(){return this.view.id==="day"&&this.hasSplits&&this.options.stickySplitLabels&&!this.options.minSplitWidth},dnd(){return this.modules.dnd}}};var me=T(ve,[["render",he]]);const fe=["draggable"];function ye(t,e,s,l,r,n){return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["vuecal__event",n.eventClasses]),style:i.normalizeStyle(n.eventStyles),tabindex:"0",onFocus:e[4]||(e[4]=(...o)=>n.focusEvent&&n.focusEvent(...o)),onKeypress:e[5]||(e[5]=i.withKeys(i.withModifiers((...o)=>n.onEnterKeypress&&n.onEnterKeypress(...o),["stop"]),["enter"])),onMouseenter:e[6]||(e[6]=(...o)=>n.onMouseEnter&&n.onMouseEnter(...o)),onMouseleave:e[7]||(e[7]=(...o)=>n.onMouseLeave&&n.onMouseLeave(...o)),onTouchstart:e[8]||(e[8]=i.withModifiers((...o)=>n.onTouchStart&&n.onTouchStart(...o),["stop"])),onMousedown:e[9]||(e[9]=o=>n.onMouseDown(o)),onMouseup:e[10]||(e[10]=(...o)=>n.onMouseUp&&n.onMouseUp(...o)),onTouchend:e[11]||(e[11]=(...o)=>n.onMouseUp&&n.onMouseUp(...o)),onTouchmove:e[12]||(e[12]=(...o)=>n.onTouchMove&&n.onTouchMove(...o)),onDblclick:e[13]||(e[13]=(...o)=>n.onDblClick&&n.onDblClick(...o)),draggable:n.draggable,onDragstart:e[14]||(e[14]=o=>n.draggable&&n.onDragStart(o)),onDragend:e[15]||(e[15]=o=>n.draggable&&n.onDragEnd())},[n.vuecal.editEvents.delete&&s.event.deletable?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__event-delete",onClick:e[0]||(e[0]=i.withModifiers((...o)=>n.deleteEvent&&n.deleteEvent(...o),["stop"])),onTouchstart:e[1]||(e[1]=i.withModifiers((...o)=>n.touchDeleteEvent&&n.touchDeleteEvent(...o),["stop"]))},i.toDisplayString(n.vuecal.texts.deleteEvent),33)):i.createCommentVNode("",!0),i.renderSlot(t.$slots,"event",{event:s.event,view:n.view.id}),n.resizable?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__event-resize-handle",contenteditable:"false",onMousedown:e[2]||(e[2]=i.withModifiers((...o)=>n.onResizeHandleMouseDown&&n.onResizeHandleMouseDown(...o),["stop","prevent"])),onTouchstart:e[3]||(e[3]=i.withModifiers((...o)=>n.onResizeHandleMouseDown&&n.onResizeHandleMouseDown(...o),["stop","prevent"]))},null,32)):i.createCommentVNode("",!0)],46,fe)}const we={inject:["vuecal","utils","modules","view","domEvents","editEvents"],props:{cellFormattedDate:{type:String,default:""},event:{type:Object,default:()=>({})},cellEvents:{type:Array,default:()=>[]},overlaps:{type:Array,default:()=>[]},eventPosition:{type:Number,default:0},overlapsStreak:{type:Number,default:0},allDay:{type:Boolean,default:!1}},data:()=>({touch:{dragThreshold:30,startX:0,startY:0,dragged:!1}}),methods:{onMouseDown(t,e=!1){if("ontouchstart"in window&&!e)return!1;const{clickHoldAnEvent:s,focusAnEvent:l,resizeAnEvent:r,dragAnEvent:n}=this.domEvents;if(l._eid===this.event._eid&&s._eid===this.event._eid)return!0;this.focusEvent(),s._eid=null,this.vuecal.editEvents.delete&&this.event.deletable&&(s.timeoutId=setTimeout(()=>{!r._eid&&!n._eid&&(s._eid=this.event._eid,this.event.deleting=!0)},s.timeout))},onMouseUp(t){this.domEvents.focusAnEvent._eid===this.event._eid&&!this.touch.dragged&&(this.domEvents.focusAnEvent.mousedUp=!0),this.touch.dragged=!1},onMouseEnter(t){t.preventDefault(),this.vuecal.emitWithEvent("event-mouse-enter",this.event)},onMouseLeave(t){t.preventDefault(),this.vuecal.emitWithEvent("event-mouse-leave",this.event)},onTouchMove(t){if(typeof this.vuecal.onEventClick!="function")return;const{clientX:e,clientY:s}=t.touches[0],{startX:l,startY:r,dragThreshold:n}=this.touch;(Math.abs(e-l)>n||Math.abs(s-r)>n)&&(this.touch.dragged=!0)},onTouchStart(t){this.touch.startX=t.touches[0].clientX,this.touch.startY=t.touches[0].clientY,this.onMouseDown(t,!0)},onEnterKeypress(t){if(typeof this.vuecal.onEventClick=="function")return this.vuecal.onEventClick(this.event,t)},onDblClick(t){if(typeof this.vuecal.onEventDblclick=="function")return this.vuecal.onEventDblclick(this.event,t)},onDragStart(t){this.dnd&&this.dnd.eventDragStart(t,this.event)},onDragEnd(){this.dnd&&this.dnd.eventDragEnd(this.event)},onResizeHandleMouseDown(){this.focusEvent(),this.domEvents.dragAnEvent._eid=null,this.domEvents.resizeAnEvent=Object.assign(this.domEvents.resizeAnEvent,{_eid:this.event._eid,start:(this.segment||this.event).start,split:this.event.split||null,segment:!!this.segment&&this.utils.date.formatDateLite(this.segment.start),originalEnd:new Date((this.segment||this.event).end),originalEndTimeMinutes:this.event.endTimeMinutes}),this.event.resizing=!0},deleteEvent(t=!1){if("ontouchstart"in window&&!t)return!1;this.utils.event.deleteAnEvent(this.event)},touchDeleteEvent(t){this.deleteEvent(!0)},cancelDeleteEvent(){this.event.deleting=!1},focusEvent(){const{focusAnEvent:t}=this.domEvents,e=t._eid;if(e!==this.event._eid){if(e){const s=this.view.events.find(l=>l._eid===e);s&&(s.focused=!1)}this.vuecal.cancelDelete(),this.vuecal.emitWithEvent("event-focus",this.event),t._eid=this.event._eid,this.event.focused=!0}}},computed:{eventDimensions(){const{startTimeMinutes:t,endTimeMinutes:e}=this.segment||this.event;let s=t-this.vuecal.timeFrom;const l=Math.max(Math.round(s*this.vuecal.timeCellHeight/this.vuecal.timeStep),0);s=Math.min(e,this.vuecal.timeTo)-this.vuecal.timeFrom;const r=Math.round(s*this.vuecal.timeCellHeight/this.vuecal.timeStep),n=Math.max(r-l,5);return{top:l,height:n}},eventStyles(){if(this.event.allDay||!this.vuecal.time||!this.event.endTimeMinutes||this.view.id==="month"||this.allDay)return{};let t=100/Math.min(this.overlaps.length+1,this.overlapsStreak),e=100/(this.overlaps.length+1)*this.eventPosition;this.vuecal.minEventWidth&&t<this.vuecal.minEventWidth&&(t=this.vuecal.minEventWidth,e=(100-this.vuecal.minEventWidth)/this.overlaps.length*this.eventPosition);const{top:s,height:l}=this.eventDimensions;return{top:`${s}px`,height:`${l}px`,width:`${t}%`,left:this.event.left&&`${this.event.left}px`||`${e}%`}},eventClasses(){const{isFirstDay:t,isLastDay:e}=this.segment||{};return{[this.event.class]:!!this.event.class,"vuecal__event--focus":this.event.focused,"vuecal__event--resizing":this.event.resizing,"vuecal__event--background":this.event.background,"vuecal__event--deletable":this.event.deleting,"vuecal__event--all-day":this.event.allDay,"vuecal__event--dragging":!this.event.draggingStatic&&this.event.dragging,"vuecal__event--static":this.event.dragging&&this.event.draggingStatic,"vuecal__event--multiple-days":!!this.segment,"event-start":this.segment&&t&&!e,"event-middle":this.segment&&!t&&!e,"event-end":this.segment&&e&&!t}},segment(){return this.event.segments&&this.event.segments[this.cellFormattedDate]||null},draggable(){const{draggable:t,background:e,daysCount:s}=this.event;return this.vuecal.editEvents.drag&&t&&!e&&s===1},resizable(){const{editEvents:t,time:e}=this.vuecal;return t.resize&&this.event.resizable&&e&&!this.allDay&&(!this.segment||this.segment&&this.segment.isLastDay)&&this.view.id!=="month"},dnd(){return this.modules.dnd}}};var De=T(we,[["render",ye]]);const ge=["data-split","aria-label","onTouchstart","onMousedown","onDragover","onDrop"],pe={key:1,class:"vuecal__cell-events"},ke=["title"];function _e(t,e,s,l,r,n){const o=i.resolveComponent("event");return i.openBlock(),i.createBlock(i.TransitionGroup,{class:i.normalizeClass(["vuecal__cell",n.cellClasses]),name:`slide-fade--${n.transitionDirection}`,tag:"div",appear:s.options.transitions,style:i.normalizeStyle(n.cellStyles)},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.splitsCount?n.splits:1,(a,u)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["vuecal__flex vuecal__cell-content",n.splitsCount&&n.splitClasses(a)]),key:s.options.transitions?`${n.view.id}-${s.data.content}-${u}`:u,"data-split":n.splitsCount?a.id:!1,column:"",tabindex:"0","aria-label":s.data.content,onFocus:e[0]||(e[0]=d=>n.onCellFocus(d)),onKeypress:e[1]||(e[1]=i.withKeys(d=>n.onCellkeyPressEnter(d),["enter"])),onTouchstart:d=>!n.isDisabled&&n.onCellTouchStart(d,n.splitsCount?a.id:null),onMousedown:d=>!n.isDisabled&&n.onCellMouseDown(d,n.splitsCount?a.id:null),onClick:e[2]||(e[2]=d=>!n.isDisabled&&n.onCellClick(d)),onDblclick:e[3]||(e[3]=d=>!n.isDisabled&&n.onCellDblClick(d)),onContextmenu:e[4]||(e[4]=d=>!n.isDisabled&&s.options.cellContextmenu&&n.onCellContextMenu(d)),onDragenter:e[5]||(e[5]=d=>!n.isDisabled&&s.editEvents.drag&&n.dnd&&n.dnd.cellDragEnter(d,t.$data,s.data.startDate)),onDragover:d=>!n.isDisabled&&s.editEvents.drag&&n.dnd&&n.dnd.cellDragOver(d,t.$data,s.data.startDate,n.splitsCount?a.id:null),onDragleave:e[6]||(e[6]=d=>!n.isDisabled&&s.editEvents.drag&&n.dnd&&n.dnd.cellDragLeave(d,t.$data,s.data.startDate)),onDrop:d=>!n.isDisabled&&s.editEvents.drag&&n.dnd&&n.dnd.cellDragDrop(d,t.$data,s.data.startDate,n.splitsCount?a.id:null)},[n.isWeekOrDayView&&!s.allDay&&n.specialHours.length?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(n.specialHours,(d,c)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["vuecal__special-hours",`vuecal__special-hours--day${d.day} ${d.class}`]),style:i.normalizeStyle(`height: ${d.height}px;top: ${d.top}px`)},null,6))),256)):i.createCommentVNode("",!0),i.renderSlot(t.$slots,"cell-content",{events:n.events,selectCell:d=>n.selectCell(d,!0),split:n.splitsCount?a:!1}),n.eventsCount&&(n.isWeekOrDayView||n.view.id==="month"&&s.options.eventsOnMonthView)?(i.openBlock(),i.createElementBlock("div",pe,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.splitsCount?a.events:n.events,(d,c)=>(i.openBlock(),i.createBlock(o,{key:c,"cell-formatted-date":s.data.formattedDate,event:d,"all-day":s.allDay,"cell-events":n.splitsCount?a.events:n.events,overlaps:((n.splitsCount?a.overlaps[d._eid]:t.cellOverlaps[d._eid])||[]).overlaps,"event-position":((n.splitsCount?a.overlaps[d._eid]:t.cellOverlaps[d._eid])||[]).position,"overlaps-streak":n.splitsCount?a.overlapsStreak:t.cellOverlapsStreak},{event:i.withCtx(({event:v,view:h})=>[i.renderSlot(t.$slots,"event",{view:h,event:v})]),_:2},1032,["cell-formatted-date","event","all-day","cell-events","overlaps","event-position","overlaps-streak"]))),128))])):i.createCommentVNode("",!0)],42,ge))),128)),n.timelineVisible?(i.openBlock(),i.createElementBlock("div",{class:"vuecal__now-line",style:i.normalizeStyle(`top: ${n.todaysTimePosition}px`),key:s.options.transitions?`${n.view.id}-now-line`:"now-line",title:n.utils.date.formatTime(n.vuecal.now)},null,12,ke)):i.createCommentVNode("",!0)]),_:3},8,["class","name","appear","style"])}const Ee={inject:["vuecal","utils","modules","view","domEvents"],components:{Event:De},props:{options:{type:Object,default:()=>({})},editEvents:{type:Object,required:!0},data:{type:Object,required:!0},cellSplits:{type:Array,default:()=>[]},minTimestamp:{type:[Number,null],default:null},maxTimestamp:{type:[Number,null],default:null},cellWidth:{type:[Number,Boolean],default:!1},allDay:{type:Boolean,default:!1}},data:()=>({cellOverlaps:{},cellOverlapsStreak:1,timeAtCursor:null,highlighted:!1,highlightedSplit:null}),methods:{getSplitAtCursor({target:t}){let s=t.classList.contains("vuecal__cell-split")?t:this.vuecal.findAncestor(t,"vuecal__cell-split");return s&&(s=s.attributes["data-split"].value,parseInt(s).toString()===s.toString()&&(s=parseInt(s))),s||null},splitClasses(t){return{"vuecal__cell-split":!0,"vuecal__cell-split--highlighted":this.highlightedSplit===t.id,[t.class]:!!t.class}},checkCellOverlappingEvents(){this.options.time&&this.eventsCount&&!this.splitsCount&&(this.eventsCount===1?(this.cellOverlaps=[],this.cellOverlapsStreak=1):[this.cellOverlaps,this.cellOverlapsStreak]=this.utils.event.checkCellOverlappingEvents(this.events,this.options))},isDOMElementAnEvent(t){return this.vuecal.isDOMElementAnEvent(t)},selectCell(t,e=!1){const s=this.splitsCount?this.getSplitAtCursor(t):null;this.utils.cell.selectCell(e,this.timeAtCursor,s),this.timeAtCursor=null},onCellkeyPressEnter(t){this.isSelected||this.onCellFocus(t);const e=this.splitsCount?this.getSplitAtCursor(t):null;this.utils.cell.keyPressEnterCell(this.timeAtCursor,e),this.timeAtCursor=null},onCellFocus(t){if(!this.isSelected&&!this.isDisabled){this.isSelected=this.data.startDate;const e=this.splitsCount?this.getSplitAtCursor(t):null,s=this.timeAtCursor||this.data.startDate;this.vuecal.$emit("cell-focus",e?{date:s,split:e}:s)}},onCellMouseDown(t,e=null,s=!1){if("ontouchstart"in window&&!s)return!1;this.isSelected||this.onCellFocus(t);const{clickHoldACell:l,focusAnEvent:r}=this.domEvents;this.domEvents.cancelClickEventCreation=!1,l.eventCreated=!1,this.timeAtCursor=new Date(this.data.startDate);const{minutes:n,cursorCoords:{y:o}}=this.vuecal.minutesAtCursor(t);this.timeAtCursor.setMinutes(n);const a=this.isDOMElementAnEvent(t.target);!a&&r._eid&&((this.view.events.find(u=>u._eid===r._eid)||{}).focused=!1),this.editEvents.create&&!a&&this.setUpEventCreation(t,o)},setUpEventCreation(t,e){if(this.options.dragToCreateEvent&&["week","day"].includes(this.view.id)){const{dragCreateAnEvent:s}=this.domEvents;if(s.startCursorY=e,s.split=this.splitsCount?this.getSplitAtCursor(t):null,s.start=this.timeAtCursor,this.options.snapToTime){let l=this.timeAtCursor.getHours()*60+this.timeAtCursor.getMinutes();const r=l+this.options.snapToTime/2;l=r-r%this.options.snapToTime,s.start.setHours(0,l,0,0)}}else this.options.cellClickHold&&["month","week","day"].includes(this.view.id)&&this.setUpCellHoldTimer(t)},setUpCellHoldTimer(t){const{clickHoldACell:e}=this.domEvents;e.cellId=`${this.vuecal._.uid}_${this.data.formattedDate}`,e.split=this.splitsCount?this.getSplitAtCursor(t):null,e.timeoutId=setTimeout(()=>{if(e.cellId&&!this.domEvents.cancelClickEventCreation){const{_eid:s}=this.utils.event.createAnEvent(this.timeAtCursor,null,e.split?{split:e.split}:{});e.eventCreated=s}},e.timeout)},onCellTouchStart(t,e=null){this.onCellMouseDown(t,e,!0)},onCellClick(t){this.isDOMElementAnEvent(t.target)||this.selectCell(t)},onCellDblClick(t){const e=new Date(this.data.startDate);e.setMinutes(this.vuecal.minutesAtCursor(t).minutes);const s=this.splitsCount?this.getSplitAtCursor(t):null;this.vuecal.$emit("cell-dblclick",s?{date:e,split:s}:e),this.options.dblclickToNavigate&&this.vuecal.switchToNarrowerView()},onCellContextMenu(t){t.stopPropagation(),t.preventDefault();const e=new Date(this.data.startDate),{cursorCoords:s,minutes:l}=this.vuecal.minutesAtCursor(t);e.setMinutes(l);const r=this.splitsCount?this.getSplitAtCursor(t):null;this.vuecal.$emit("cell-contextmenu",{date:e,...s,...r||{},e:t})}},computed:{dnd(){return this.modules.dnd},nowInMinutes(){return this.utils.date.dateToMinutes(this.vuecal.now)},isBeforeMinDate(){return this.minTimestamp!==null&&this.minTimestamp>this.data.endDate.getTime()},isAfterMaxDate(){return this.maxTimestamp&&this.maxTimestamp<this.data.startDate.getTime()},isDisabled(){const{disableDays:t}=this.options,{isYearsOrYearView:e}=this.vuecal;return t.length&&t.includes(this.data.formattedDate)&&!e?!0:this.isBeforeMinDate||this.isAfterMaxDate},isSelected:{get(){let t=!1;const{selectedDate:e}=this.view;return this.view.id==="years"?t=e.getFullYear()===this.data.startDate.getFullYear():this.view.id==="year"?t=e.getFullYear()===this.data.startDate.getFullYear()&&e.getMonth()===this.data.startDate.getMonth():t=e.getTime()===this.data.startDate.getTime(),t},set(t){this.view.selectedDate=t}},isWeekOrDayView(){return["week","day"].includes(this.view.id)},transitionDirection(){return this.vuecal.transitionDirection},specialHours(){return this.data.specialHours.map(t=>{let{from:e,to:s}=t;return e=Math.max(e,this.options.timeFrom),s=Math.min(s,this.options.timeTo),{...t,height:(s-e)*this.timeScale,top:(e-this.options.timeFrom)*this.timeScale}})},events(){const{startDate:t,endDate:e}=this.data;let s=[];if(!(["years","year"].includes(this.view.id)&&!this.options.eventsCountOnYearView)){if(s=this.view.events.slice(0),this.view.id==="month"&&s.push(...this.view.outOfScopeEvents),s=s.filter(l=>this.utils.event.eventInRange(l,t,e)),this.options.showAllDayEvents&&this.view.id!=="month"&&(s=s.filter(l=>!!l.allDay===this.allDay)),this.options.time&&this.isWeekOrDayView&&!this.allDay){const{timeFrom:l,timeTo:r}=this.options;s=s.filter(n=>{const o=n.daysCount>1&&n.segments[this.data.formattedDate]||{},a=n.daysCount===1&&n.startTimeMinutes<r&&n.endTimeMinutes>l,u=n.daysCount>1&&o.startTimeMinutes<r&&o.endTimeMinutes>l,d=!1;return n.allDay||a||u||d})}this.options.time&&this.isWeekOrDayView&&!(this.options.showAllDayEvents&&this.allDay)&&s.sort((l,r)=>l.start<r.start?-1:1),this.cellSplits.length||this.$nextTick(this.checkCellOverlappingEvents)}return s},eventsCount(){return this.events.length},splits(){return this.cellSplits.map((t,e)=>{const s=this.events.filter(n=>n.split===t.id),[l,r]=this.utils.event.checkCellOverlappingEvents(s.filter(n=>!n.background&&!n.allDay),this.options);return{...t,overlaps:l,overlapsStreak:r,events:s}})},splitsCount(){return this.splits.length},cellClasses(){return{[this.data.class]:!!this.data.class,"vuecal__cell--current":this.data.current,"vuecal__cell--today":this.data.today,"vuecal__cell--out-of-scope":this.data.outOfScope,"vuecal__cell--before-min":this.isDisabled&&this.isBeforeMinDate,"vuecal__cell--after-max":this.isDisabled&&this.isAfterMaxDate,"vuecal__cell--disabled":this.isDisabled,"vuecal__cell--selected":this.isSelected,"vuecal__cell--highlighted":this.highlighted,"vuecal__cell--has-splits":this.splitsCount,"vuecal__cell--has-events":this.eventsCount}},cellStyles(){return{...this.cellWidth?{width:`${this.cellWidth}%`}:{}}},timelineVisible(){const{time:t,timeTo:e}=this.options;return this.data.today&&this.isWeekOrDayView&&t&&!this.allDay&&this.nowInMinutes<=e},todaysTimePosition(){if(!this.data.today||!this.options.time)return;const t=this.nowInMinutes-this.options.timeFrom;return Math.round(t*this.timeScale)},timeScale(){return this.options.timeCellHeight/this.options.timeStep}}};var F=T(Ee,[["render",_e]]);const Ce={key:0,class:"vuecal__all-day-text",style:{width:"3em"}};function be(t,e,s,l,r,n){const o=i.resolveComponent("vuecal-cell");return i.openBlock(),i.createElementBlock("div",{class:"vuecal__flex vuecal__all-day",style:i.normalizeStyle(s.cellOrSplitMinWidth&&{height:s.height})},[s.cellOrSplitMinWidth?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Ce,[i.createElementVNode("span",null,i.toDisplayString(s.label),1)])),i.createElementVNode("div",{class:i.normalizeClass(["vuecal__flex vuecal__cells",`${n.view.id}-view`]),grow:"",style:i.normalizeStyle(s.cellOrSplitMinWidth?`min-width: ${s.cellOrSplitMinWidth}px`:"")},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.cells,(a,u)=>(i.openBlock(),i.createBlock(o,{key:u,options:s.options,"edit-events":n.editEvents,data:a,"all-day":!0,"cell-width":s.options.hideWeekdays.length&&(n.vuecal.isWeekView||n.vuecal.isMonthView)&&n.vuecal.cellWidth,"min-timestamp":s.options.minTimestamp,"max-timestamp":s.options.maxTimestamp,"cell-splits":s.daySplits},{event:i.withCtx(({event:d,view:c})=>[i.renderSlot(t.$slots,"event",{view:c,event:d})]),_:2},1032,["options","edit-events","data","cell-width","min-timestamp","max-timestamp","cell-splits"]))),128))],6)],4)}const Te={inject:["vuecal","view","editEvents"],components:{"vuecal-cell":F},props:{options:{type:Object,required:!0},cells:{type:Array,required:!0},label:{type:String,required:!0},daySplits:{type:Array,default:()=>[]},shortEvents:{type:Boolean,default:!0},height:{type:String,default:""},cellOrSplitMinWidth:{type:Number,default:null}},computed:{hasCellOrSplitWidth(){return!!(this.options.minCellWidth||this.daySplits.length&&this.options.minSplitWidth)}}};var Me=T(Te,[["render",be]]);const Se=["lang"],Ve=i.createTextVNode("\xA0"),Be=i.createElementVNode("i",{class:"angle"},null,-1),je=i.createTextVNode("\xA0"),Oe=i.createTextVNode("\xA0"),We=i.createElementVNode("i",{class:"angle"},null,-1),He=i.createTextVNode("\xA0"),Ae={class:"default"},Ne={key:0,class:"vuecal__flex vuecal__body",grow:""},xe=["onBlur","innerHTML"],Le=["innerHTML"],Fe=["innerHTML"],Ye={class:"vuecal__flex",row:"",grow:""},ze={key:0,class:"vuecal__time-column"},Pe=i.createElementVNode("span",{class:"vuecal__time-cell-line"},null,-1),Ie={class:"vuecal__time-cell-label"},qe={key:1,class:"vuecal__flex vuecal__week-numbers",column:""},Ue=["wrap","column"],Re=["onBlur","innerHTML"],Ke=["innerHTML"],Xe=["innerHTML"],Ge=["wrap"],Ze=["innerHTML"],Je=["innerHTML"],Qe={key:2,class:"vuecal__cell-events-count"},$e={key:3,class:"vuecal__no-event"},et=["onBlur","innerHTML"],tt=["innerHTML"],st={key:2,class:"vuecal__event-time"},it={key:0},nt={key:1,class:"days-to-end"},lt=["innerHTML"],at={key:0,class:"vuecal__scrollbar-check"},rt=i.createElementVNode("div",null,null,-1),ot=[rt];function dt(t,e,s,l,r,n){const o=i.resolveComponent("vuecal-header"),a=i.resolveComponent("all-day-bar"),u=i.resolveComponent("weekdays-headings"),d=i.resolveComponent("vuecal-cell");return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["vuecal__flex vuecal",n.cssClasses]),column:"",ref:"vuecal",lang:s.locale},[i.createVNode(o,{options:t.$props,"edit-events":n.editEvents,"view-props":{views:n.views,weekDaysInHeader:n.weekDaysInHeader},"week-days":n.weekDays,"has-splits":n.hasSplits,"day-splits":n.daySplits,"switch-to-narrower-view":n.switchToNarrowerView},i.createSlots({"arrow-prev":i.withCtx(()=>[i.renderSlot(t.$slots,"arrow-prev",{},()=>[Ve,Be,je])]),"arrow-next":i.withCtx(()=>[i.renderSlot(t.$slots,"arrow-next",{},()=>[Oe,We,He])]),"today-button":i.withCtx(()=>[i.renderSlot(t.$slots,"today-button",{},()=>[i.createElementVNode("span",Ae,i.toDisplayString(r.texts.today),1)])]),title:i.withCtx(()=>[i.renderSlot(t.$slots,"title",{title:n.viewTitle,view:r.view},()=>[i.createTextVNode(i.toDisplayString(n.viewTitle),1)])]),_:2},[t.$slots["weekday-heading"]?{name:"weekday-heading",fn:i.withCtx(({heading:c,view:v})=>[i.renderSlot(t.$slots,"weekday-heading",{heading:c,view:v})])}:void 0,t.$slots["split-label"]?{name:"split-label",fn:i.withCtx(({split:c})=>[i.renderSlot(t.$slots,"split-label",{split:c,view:r.view.id})])}:void 0]),1032,["options","edit-events","view-props","week-days","has-splits","day-splits","switch-to-narrower-view"]),s.hideBody?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Ne,[i.createVNode(i.Transition,{name:`slide-fade--${r.transitionDirection}`,appear:s.transitions},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("div",{class:"vuecal__flex",style:{"min-width":"100%"},key:s.transitions?r.view.id:!1,column:""},[s.showAllDayEvents&&n.hasTimeColumn&&(!n.cellOrSplitMinWidth||n.isDayView&&!s.minSplitWidth)?(i.openBlock(),i.createBlock(a,i.normalizeProps(i.mergeProps({key:0},n.allDayBar)),{event:i.withCtx(({event:c,view:v})=>[i.renderSlot(t.$slots,"event",{view:v,event:c},()=>[n.editEvents.title&&c.titleEditable?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__event-title vuecal__event-title--edit",contenteditable:"",onBlur:h=>n.onEventTitleBlur(h,c),innerHTML:c.title},null,40,xe)):c.title?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__event-title",innerHTML:c.title},null,8,Le)):i.createCommentVNode("",!0),c.content&&!n.hasShortEvents&&!n.isShortMonthView?(i.openBlock(),i.createElementBlock("div",{key:2,class:"vuecal__event-content",innerHTML:c.content},null,8,Fe)):i.createCommentVNode("",!0)])]),_:3},16)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["vuecal__bg",{vuecal__flex:!n.hasTimeColumn}]),column:""},[i.createElementVNode("div",Ye,[n.hasTimeColumn?(i.openBlock(),i.createElementBlock("div",ze,[s.showAllDayEvents&&n.cellOrSplitMinWidth&&!(n.isDayView&&!s.minSplitWidth)?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__all-day-text",style:i.normalizeStyle({height:n.allDayBar.height})},[i.createElementVNode("span",null,i.toDisplayString(r.texts.allDay),1)],4)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.timeCells,(c,v)=>(i.openBlock(),i.createElementBlock("div",{class:"vuecal__time-cell",key:v,style:i.normalizeStyle(`height: ${s.timeCellHeight}px`)},[i.renderSlot(t.$slots,"time-cell",{hours:c.hours,minutes:c.minutes},()=>[Pe,i.createElementVNode("span",Ie,i.toDisplayString(c.label),1)])],4))),128))])):i.createCommentVNode("",!0),s.showWeekNumbers&&n.isMonthView?(i.openBlock(),i.createElementBlock("div",qe,[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(6,c=>i.createElementVNode("div",{class:"vuecal__flex vuecal__week-number-cell",key:c,grow:""},[i.renderSlot(t.$slots,"week-number-cell",{week:n.getWeekNumber(c-1)},()=>[i.createTextVNode(i.toDisplayString(n.getWeekNumber(c-1)),1)])])),64))])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["vuecal__flex vuecal__cells",`${r.view.id}-view`]),grow:"",wrap:!n.cellOrSplitMinWidth||!n.isWeekView,column:!!n.cellOrSplitMinWidth},[n.cellOrSplitMinWidth&&n.isWeekView?(i.openBlock(),i.createBlock(u,{key:0,"transition-direction":r.transitionDirection,"week-days":n.weekDays,"switch-to-narrower-view":n.switchToNarrowerView,style:i.normalizeStyle(n.cellOrSplitMinWidth?`min-width: ${n.cellOrSplitMinWidth}px`:"")},i.createSlots({_:2},[t.$slots["weekday-heading"]?{name:"weekday-heading",fn:i.withCtx(({heading:c,view:v})=>[i.renderSlot(t.$slots,"weekday-heading",{heading:c,view:v})])}:void 0,t.$slots["split-label"]?{name:"split-label",fn:i.withCtx(({split:c})=>[i.renderSlot(t.$slots,"split-label",{split:c,view:r.view.id})])}:void 0]),1032,["transition-direction","week-days","switch-to-narrower-view","style"])):n.hasSplits&&s.stickySplitLabels&&s.minSplitWidth?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__flex vuecal__split-days-headers",style:i.normalizeStyle(n.cellOrSplitMinWidth?`min-width: ${n.cellOrSplitMinWidth}px`:"")},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.daySplits,(c,v)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["day-split-header",c.class||!1]),key:v},[i.renderSlot(t.$slots,"split-label",{split:c,view:r.view.id},()=>[i.createTextVNode(i.toDisplayString(c.label),1)])],2))),128))],4)):i.createCommentVNode("",!0),s.showAllDayEvents&&n.hasTimeColumn&&(n.isWeekView&&n.cellOrSplitMinWidth||n.isDayView&&n.hasSplits&&s.minSplitWidth)?(i.openBlock(),i.createBlock(a,i.normalizeProps(i.mergeProps({key:2},n.allDayBar)),{event:i.withCtx(({event:c,view:v})=>[i.renderSlot(t.$slots,"event",{view:v,event:c},()=>[n.editEvents.title&&c.titleEditable?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__event-title vuecal__event-title--edit",contenteditable:"",onBlur:h=>n.onEventTitleBlur(h,c),innerHTML:c.title},null,40,Re)):c.title?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__event-title",innerHTML:c.title},null,8,Ke)):i.createCommentVNode("",!0),c.content&&!n.hasShortEvents&&!n.isShortMonthView?(i.openBlock(),i.createElementBlock("div",{key:2,class:"vuecal__event-content",innerHTML:c.content},null,8,Xe)):i.createCommentVNode("",!0)])]),_:3},16)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:"vuecal__flex",ref:c=>r.cellsEl=c,grow:"",wrap:!n.cellOrSplitMinWidth||!n.isWeekView,style:i.normalizeStyle(n.cellOrSplitMinWidth?`min-width: ${n.cellOrSplitMinWidth}px`:"")},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.viewCells,(c,v)=>(i.openBlock(),i.createBlock(d,{key:v,options:t.$props,"edit-events":n.editEvents,data:c,"cell-width":s.hideWeekdays.length&&(n.isWeekView||n.isMonthView)&&n.cellWidth,"min-timestamp":n.minTimestamp,"max-timestamp":n.maxTimestamp,"cell-splits":n.hasSplits&&n.daySplits||[]},{"cell-content":i.withCtx(({events:h,split:w,selectCell:m})=>[i.renderSlot(t.$slots,"cell-content",{cell:c,view:r.view,goNarrower:m,events:h},()=>[w&&!s.stickySplitLabels?(i.openBlock(),i.createElementBlock("div",{key:0,class:"split-label",innerHTML:w.label},null,8,Ze)):i.createCommentVNode("",!0),c.content?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__cell-date",innerHTML:c.content},null,8,Je)):i.createCommentVNode("",!0),(n.isMonthView&&!s.eventsOnMonthView||n.isYearsOrYearView&&s.eventsCountOnYearView)&&h.length?(i.openBlock(),i.createElementBlock("div",Qe,[i.renderSlot(t.$slots,"events-count",{view:r.view,events:h},()=>[i.createTextVNode(i.toDisplayString(h.length),1)])])):i.createCommentVNode("",!0),!n.cellOrSplitHasEvents(h,w)&&n.isWeekOrDayView?(i.openBlock(),i.createElementBlock("div",$e,[i.renderSlot(t.$slots,"no-event",{},()=>[i.createTextVNode(i.toDisplayString(r.texts.noEvent),1)])])):i.createCommentVNode("",!0)])]),event:i.withCtx(({event:h,view:w})=>[i.renderSlot(t.$slots,"event",{view:w,event:h},()=>[n.editEvents.title&&h.titleEditable?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__event-title vuecal__event-title--edit",contenteditable:"",onBlur:m=>n.onEventTitleBlur(m,h),innerHTML:h.title},null,40,et)):h.title?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__event-title",innerHTML:h.title},null,8,tt)):i.createCommentVNode("",!0),s.time&&!h.allDay&&!(n.isMonthView&&(h.allDay||s.showAllDayEvents==="short"))&&!n.isShortMonthView?(i.openBlock(),i.createElementBlock("div",st,[i.createTextVNode(i.toDisplayString(r.utils.date.formatTime(h.start,n.TimeFormat)),1),h.endTimeMinutes?(i.openBlock(),i.createElementBlock("span",it,"\xA0- "+i.toDisplayString(r.utils.date.formatTime(h.end,n.TimeFormat,null,!0)),1)):i.createCommentVNode("",!0),h.daysCount>1&&(h.segments[c.formattedDate]||{}).isFirstDay?(i.openBlock(),i.createElementBlock("small",nt,"\xA0+"+i.toDisplayString(h.daysCount-1)+i.toDisplayString((r.texts.day[0]||"").toLowerCase()),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),h.content&&!(n.isMonthView&&h.allDay&&s.showAllDayEvents==="short")&&!n.isShortMonthView?(i.openBlock(),i.createElementBlock("div",{key:3,class:"vuecal__event-content",innerHTML:h.content},null,8,lt)):i.createCommentVNode("",!0)])]),"no-event":i.withCtx(()=>[i.renderSlot(t.$slots,"no-event",{},()=>[i.createTextVNode(i.toDisplayString(r.texts.noEvent),1)])]),_:2},1032,["options","edit-events","data","cell-width","min-timestamp","max-timestamp","cell-splits"]))),128))],12,Ge)],10,Ue)])],2)]))]),_:3},8,["name","appear"]),r.ready?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",at,ot))]))],10,Se)}function ut(t){switch(t){case"./i18n/ar.json":return Promise.resolve().then(function(){return require("./i18n/ar.cjs.js")});case"./i18n/bg.json":return Promise.resolve().then(function(){return require("./i18n/bg.cjs.js")});case"./i18n/bn.json":return Promise.resolve().then(function(){return require("./i18n/bn.cjs.js")});case"./i18n/bs.json":return Promise.resolve().then(function(){return require("./i18n/bs.cjs.js")});case"./i18n/ca.json":return Promise.resolve().then(function(){return require("./i18n/ca.cjs.js")});case"./i18n/cs.json":return Promise.resolve().then(function(){return require("./i18n/cs.cjs.js")});case"./i18n/da.json":return Promise.resolve().then(function(){return require("./i18n/da.cjs.js")});case"./i18n/de.json":return Promise.resolve().then(function(){return require("./i18n/de.cjs.js")});case"./i18n/el.json":return Promise.resolve().then(function(){return require("./i18n/el.cjs.js")});case"./i18n/en.json":return Promise.resolve().then(function(){return require("./i18n/en.cjs.js")});case"./i18n/es.json":return Promise.resolve().then(function(){return require("./i18n/es.cjs.js")});case"./i18n/fa.json":return Promise.resolve().then(function(){return require("./i18n/fa.cjs.js")});case"./i18n/fr.json":return Promise.resolve().then(function(){return require("./i18n/fr.cjs.js")});case"./i18n/he.json":return Promise.resolve().then(function(){return require("./i18n/he.cjs.js")});case"./i18n/hr.json":return Promise.resolve().then(function(){return require("./i18n/hr.cjs.js")});case"./i18n/hu.json":return Promise.resolve().then(function(){return require("./i18n/hu.cjs.js")});case"./i18n/id.json":return Promise.resolve().then(function(){return require("./i18n/id.cjs.js")});case"./i18n/is.json":return Promise.resolve().then(function(){return require("./i18n/is.cjs.js")});case"./i18n/it.json":return Promise.resolve().then(function(){return require("./i18n/it.cjs.js")});case"./i18n/ja.json":return Promise.resolve().then(function(){return require("./i18n/ja.cjs.js")});case"./i18n/ka.json":return Promise.resolve().then(function(){return require("./i18n/ka.cjs.js")});case"./i18n/ko.json":return Promise.resolve().then(function(){return require("./i18n/ko.cjs.js")});case"./i18n/lt.json":return Promise.resolve().then(function(){return require("./i18n/lt.cjs.js")});case"./i18n/mn.json":return Promise.resolve().then(function(){return require("./i18n/mn.cjs.js")});case"./i18n/nl.json":return Promise.resolve().then(function(){return require("./i18n/nl.cjs.js")});case"./i18n/no.json":return Promise.resolve().then(function(){return require("./i18n/no.cjs.js")});case"./i18n/pl.json":return Promise.resolve().then(function(){return require("./i18n/pl.cjs.js")});case"./i18n/pt-br.json":return Promise.resolve().then(function(){return require("./i18n/pt-br.cjs.js")});case"./i18n/ro.json":return Promise.resolve().then(function(){return require("./i18n/ro.cjs.js")});case"./i18n/ru.json":return Promise.resolve().then(function(){return require("./i18n/ru.cjs.js")});case"./i18n/sk.json":return Promise.resolve().then(function(){return require("./i18n/sk.cjs.js")});case"./i18n/sl.json":return Promise.resolve().then(function(){return require("./i18n/sl.cjs.js")});case"./i18n/sq.json":return Promise.resolve().then(function(){return require("./i18n/sq.cjs.js")});case"./i18n/sr.json":return Promise.resolve().then(function(){return require("./i18n/sr.cjs.js")});case"./i18n/sv.json":return Promise.resolve().then(function(){return require("./i18n/sv.cjs.js")});case"./i18n/tr.json":return Promise.resolve().then(function(){return require("./i18n/tr.cjs.js")});case"./i18n/uk.json":return Promise.resolve().then(function(){return require("./i18n/uk.cjs.js")});case"./i18n/vi.json":return Promise.resolve().then(function(){return require("./i18n/vi.cjs.js")});case"./i18n/zh-cn.json":return Promise.resolve().then(function(){return require("./i18n/zh-cn.cjs.js")});case"./i18n/zh-hk.json":return Promise.resolve().then(function(){return require("./i18n/zh-hk.cjs.js")});default:return new Promise(function(e,s){(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+t)))})}}const V=24*60,B={weekDays:Array(7).fill(""),weekDaysShort:[],months:Array(12).fill(""),years:"",year:"",month:"",week:"",day:"",today:"",noEvent:"",allDay:"",deleteEvent:"",createEvent:"",dateFormat:"dddd MMMM D, YYYY",am:"am",pm:"pm"},N=["years","year","month","week","day"],x=new I(B),ct={name:"vue-cal",components:{"vuecal-cell":F,"vuecal-header":me,WeekdaysHeadings:L,AllDayBar:Me},provide(){return{vuecal:this,utils:this.utils,modules:this.modules,previous:this.previous,next:this.next,switchView:this.switchView,updateSelectedDate:this.updateSelectedDate,editEvents:this.editEvents,view:this.view,domEvents:this.domEvents}},props:{activeView:{type:String,default:"week"},allDayBarHeight:{type:[String,Number],default:"25px"},cellClickHold:{type:Boolean,default:!0},cellContextmenu:{type:Boolean,default:!1},clickToNavigate:{type:Boolean,default:!1},dblclickToNavigate:{type:Boolean,default:!0},disableDatePrototypes:{type:Boolean,default:!1},disableDays:{type:Array,default:()=>[]},disableViews:{type:Array,default:()=>[]},dragToCreateEvent:{type:Boolean,default:!0},dragToCreateThreshold:{type:Number,default:15},editableEvents:{type:[Boolean,Object],default:!1},events:{type:Array,default:()=>[]},eventsCountOnYearView:{type:Boolean,default:!1},eventsOnMonthView:{type:[Boolean,String],default:!1},hideBody:{type:Boolean,default:!1},hideTitleBar:{type:Boolean,default:!1},hideViewSelector:{type:Boolean,default:!1},hideWeekdays:{type:Array,default:()=>[]},hideWeekends:{type:Boolean,default:!1},locale:{type:[String,Object],default:"en"},maxDate:{type:[String,Date],default:""},minCellWidth:{type:Number,default:0},minDate:{type:[String,Date],default:""},minEventWidth:{type:Number,default:0},minSplitWidth:{type:Number,default:0},onEventClick:{type:[Function,null],default:null},onEventCreate:{type:[Function,null],default:null},onEventDblclick:{type:[Function,null],default:null},overlapsPerTimeStep:{type:Boolean,default:!1},resizeX:{type:Boolean,default:!1},selectedDate:{type:[String,Date],default:""},showAllDayEvents:{type:[Boolean,String],default:!1},showWeekNumbers:{type:[Boolean,String],default:!1},snapToTime:{type:Number,default:0},small:{type:Boolean,default:!1},specialHours:{type:Object,default:()=>({})},splitDays:{type:Array,default:()=>[]},startWeekOnSunday:{type:Boolean,default:!1},stickySplitLabels:{type:Boolean,default:!1},time:{type:Boolean,default:!0},timeCellHeight:{type:Number,default:40},timeFormat:{type:String,default:""},timeFrom:{type:Number,default:0},timeStep:{type:Number,default:60},timeTo:{type:Number,default:V},todayButton:{type:Boolean,default:!1},transitions:{type:Boolean,default:!0},twelveHour:{type:Boolean,default:!1},watchRealTime:{type:Boolean,default:!1},xsmall:{type:Boolean,default:!1}},data(){return{ready:!1,texts:{...B},utils:{date:(this.disableDatePrototypes?x.removePrototypes():!1)||x,cell:null,event:null},modules:{dnd:null},cellsEl:null,view:{id:"",title:"",startDate:null,endDate:null,firstCellDate:null,lastCellDate:null,selectedDate:null,events:[]},eventIdIncrement:1,now:new Date,timeTickerIds:[null,null],domEvents:{resizeAnEvent:{_eid:null,start:null,split:null,segment:null,originalEndTimeMinutes:0,originalEnd:null,end:null,startCell:null,endCell:null},dragAnEvent:{_eid:null},dragCreateAnEvent:{startCursorY:null,start:null,split:null,event:null},focusAnEvent:{_eid:null,mousedUp:!1},clickHoldAnEvent:{_eid:null,timeout:1200,timeoutId:null},dblTapACell:{taps:0,timeout:500},clickHoldACell:{cellId:null,split:null,timeout:1200,timeoutId:null,eventCreated:!1},cancelClickEventCreation:!1},mutableEvents:[],transitionDirection:"right"}},methods:{async loadLocale(t){if(typeof this.locale=="object"){this.texts=Object.assign({},B,t),this.utils.date.updateTexts(this.texts);return}if(this.locale==="en"){const e=await Promise.resolve().then(function(){return require("./i18n/en.cjs.js")});this.texts=Object.assign({},B,e)}else ut(`./i18n/${t}.json`).then(e=>{this.texts=Object.assign({},B,e.default),this.utils.date.updateTexts(this.texts)})},loadDragAndDrop(){Promise.resolve().then(function(){return require("./drag-and-drop.cjs.js")}).then(t=>{const{DragAndDrop:e}=t;this.modules.dnd=new e(this)}).catch(()=>console.warn("Vue Cal: Missing drag & drop module."))},validateView(t){return N.includes(t)||(console.error(`Vue Cal: invalid active-view parameter provided: "${t}".
6
+ A valid view must be one of: ${N.join(", ")}.`),t="week"),this.enabledViews.includes(t)||(console.warn(`Vue Cal: the provided active-view "${t}" is disabled. Using the "${this.enabledViews[0]}" view instead.`),t=this.enabledViews[0]),t},switchToNarrowerView(t=null){this.transitionDirection="right";const e=this.enabledViews[this.enabledViews.indexOf(this.view.id)+1];e&&this.switchView(e,t)},switchView(t,e=null,s=!1){t=this.validateView(t);const l=this.utils.date,r=this.view.startDate&&this.view.startDate.getTime();if(this.transitions&&s){if(this.view.id===t)return;const a=this.enabledViews;this.transitionDirection=a.indexOf(this.view.id)>a.indexOf(t)?"left":"right"}const n=this.view.id;switch(this.view.events=[],this.view.id=t,this.view.firstCellDate=null,this.view.lastCellDate=null,e||(e=this.view.selectedDate||this.view.startDate),t){case"years":{this.view.startDate=new Date(Math.floor(e.getFullYear()/25)*25||2e3,0,1),this.view.endDate=new Date(this.view.startDate.getFullYear()+25,0,1),this.view.endDate.setSeconds(-1);break}case"year":{this.view.startDate=new Date(e.getFullYear(),0,1),this.view.endDate=new Date(e.getFullYear()+1,0,1),this.view.endDate.setSeconds(-1);break}case"month":{this.view.startDate=new Date(e.getFullYear(),e.getMonth(),1),this.view.endDate=new Date(e.getFullYear(),e.getMonth()+1,1),this.view.endDate.setSeconds(-1);let a=new Date(this.view.startDate);if(a.getDay()!==(this.startWeekOnSunday?0:1)&&(a=l.getPreviousFirstDayOfWeek(a,this.startWeekOnSunday)),this.view.firstCellDate=a,this.view.lastCellDate=l.addDays(a,41),this.view.lastCellDate.setHours(23,59,59,0),this.hideWeekends){if([0,6].includes(this.view.firstCellDate.getDay())){const u=this.view.firstCellDate.getDay()===6&&!this.startWeekOnSunday?2:1;this.view.firstCellDate=l.addDays(this.view.firstCellDate,u)}if([0,6].includes(this.view.startDate.getDay())){const u=this.view.startDate.getDay()===6?2:1;this.view.startDate=l.addDays(this.view.startDate,u)}if([0,6].includes(this.view.lastCellDate.getDay())){const u=this.view.lastCellDate.getDay()===0&&!this.startWeekOnSunday?2:1;this.view.lastCellDate=l.subtractDays(this.view.lastCellDate,u)}if([0,6].includes(this.view.endDate.getDay())){const u=this.view.endDate.getDay()===0?2:1;this.view.endDate=l.subtractDays(this.view.endDate,u)}}break}case"week":{e=l.getPreviousFirstDayOfWeek(e,this.startWeekOnSunday);const a=this.hideWeekends?5:7;this.view.startDate=this.hideWeekends&&this.startWeekOnSunday?l.addDays(e,1):e,this.view.startDate.setHours(0,0,0,0),this.view.endDate=l.addDays(e,a),this.view.endDate.setSeconds(-1);break}case"day":{this.view.startDate=e,this.view.startDate.setHours(0,0,0,0),this.view.endDate=new Date(e),this.view.endDate.setHours(23,59,59,0);break}}this.addEventsToView();const o=this.view.startDate&&this.view.startDate.getTime();if(!(n===t&&o===r)&&(this.$emit("update:activeView",t),this.ready)){const a=this.view.startDate,u={view:t,startDate:a,endDate:this.view.endDate,...this.isMonthView?{firstCellDate:this.view.firstCellDate,lastCellDate:this.view.lastCellDate,outOfScopeEvents:this.view.outOfScopeEvents.map(this.cleanupEvent)}:{},events:this.view.events.map(this.cleanupEvent),...this.isWeekView?{week:l.getWeek(this.startWeekOnSunday?l.addDays(a,1):a)}:{}};this.$emit("view-change",u)}},previous(){this.previousNext(!1)},next(){this.previousNext()},previousNext(t=!0){const e=this.utils.date;this.transitionDirection=t?"right":"left";const s=t?1:-1;let l=null;const{startDate:r,id:n}=this.view;switch(n){case"years":l=new Date(r.getFullYear()+25*s,0,1);break;case"year":l=new Date(r.getFullYear()+1*s,1,1);break;case"month":l=new Date(r.getFullYear(),r.getMonth()+1*s,1);break;case"week":l=e[t?"addDays":"subtractDays"](e.getPreviousFirstDayOfWeek(r,this.startWeekOnSunday),7);break;case"day":l=e[t?"addDays":"subtractDays"](r,1);break}l&&this.switchView(n,l)},addEventsToView(t=[]){const e=this.utils.event,{startDate:s,endDate:l,firstCellDate:r,lastCellDate:n}=this.view;if(t.length||(this.view.events=[]),t=t.length?t:[...this.mutableEvents],!t||this.isYearsOrYearView&&!this.eventsCountOnYearView)return;let o=t.filter(a=>e.eventInRange(a,s,l));!this.isYearsOrYearView&&!(this.isMonthView&&!this.eventsOnMonthView)&&(o=o.map(a=>a.daysCount>1?e.createEventSegments(a,r||s,n||l):a)),this.view.events.push(...o),this.isMonthView&&(this.view.outOfScopeEvents=[],t.forEach(a=>{(e.eventInRange(a,r,s)||e.eventInRange(a,l,n))&&(this.view.events.some(u=>u._eid===a._eid)||this.view.outOfScopeEvents.push(a))}))},findAncestor(t,e){for(;(t=t.parentElement)&&!t.classList.contains(e););return t},isDOMElementAnEvent(t){return t.classList.contains("vuecal__event")||this.findAncestor(t,"vuecal__event")},onMouseMove(t){const{resizeAnEvent:e,dragAnEvent:s,dragCreateAnEvent:l}=this.domEvents;e._eid===null&&s._eid===null&&!l.start||(t.preventDefault(),e._eid?this.eventResizing(t):this.dragToCreateEvent&&l.start&&this.eventDragCreation(t))},onMouseUp(t){const{focusAnEvent:e,resizeAnEvent:s,clickHoldAnEvent:l,clickHoldACell:r,dragCreateAnEvent:n}=this.domEvents,{_eid:o}=l,{_eid:a}=s;let u=!1;const{event:d,start:c}=n,v=this.isDOMElementAnEvent(t.target),h=e.mousedUp;if(e.mousedUp=!1,v&&(this.domEvents.cancelClickEventCreation=!0),r.eventCreated)return;if(a){const{originalEnd:m,originalEndTimeMinutes:p,endTimeMinutes:_}=s,D=this.view.events.find(C=>C._eid===s._eid);if(u=_&&_!==p,D&&D.end.getTime()!==m.getTime()){const C=this.mutableEvents.find(Y=>Y._eid===s._eid);C.endTimeMinutes=D.endTimeMinutes,C.end=D.end;const E=this.cleanupEvent(D),W={...this.cleanupEvent(D),end:m,endTimeMinutes:D.originalEndTimeMinutes};this.$emit("event-duration-change",{event:E,oldDate:s.originalEnd,originalEvent:W}),this.$emit("event-change",{event:E,originalEvent:W})}D&&(D.resizing=!1),s._eid=null,s.start=null,s.split=null,s.segment=null,s.originalEndTimeMinutes=null,s.originalEnd=null,s.endTimeMinutes=null,s.startCell=null,s.endCell=null}else c&&(d&&(this.emitWithEvent("event-drag-create",d),n.event.resizing=!1),n.start=null,n.split=null,n.event=null);!v&&!a&&this.unfocusEvent(),l.timeoutId&&!o&&(clearTimeout(l.timeoutId),l.timeoutId=null),r.timeoutId&&(clearTimeout(r.timeoutId),r.timeoutId=null);const w=typeof this.onEventClick=="function";if(h&&!u&&!o&&!d&&w){let m=this.view.events.find(p=>p._eid===e._eid);return!m&&this.isMonthView&&(m=this.view.outOfScopeEvents.find(p=>p._eid===e._eid)),m&&this.onEventClick(m,t)}},onKeyUp(t){t.keyCode===27&&this.cancelDelete()},eventResizing(t){const{resizeAnEvent:e}=this.domEvents,s=this.view.events.find(d=>d._eid===e._eid)||{segments:{}},{minutes:l,cursorCoords:r}=this.minutesAtCursor(t),n=s.segments&&s.segments[e.segment],{date:o,event:a}=this.utils,u=Math.max(l,this.timeFrom+1,(n||s).startTimeMinutes+1);if(s.endTimeMinutes=e.endTimeMinutes=u,this.snapToTime){const d=s.endTimeMinutes+this.snapToTime/2;s.endTimeMinutes=d-d%this.snapToTime}if(n&&(n.endTimeMinutes=s.endTimeMinutes),s.end.setHours(0,s.endTimeMinutes,s.endTimeMinutes===V?-1:0,0),this.resizeX&&this.isWeekView){s.daysCount=o.countDays(s.start,s.end);const d=this.cellsEl,c=d.offsetWidth/d.childElementCount,v=Math.floor(r.x/c);if(e.startCell===null&&(e.startCell=v-(s.daysCount-1)),e.endCell!==v){e.endCell=v;const h=o.addDays(s.start,v-e.startCell),w=Math.max(o.countDays(s.start,h),1);if(w!==s.daysCount){let m=null;w>s.daysCount?m=a.addEventSegment(s):m=a.removeEventSegment(s),e.segment=m,s.endTimeMinutes+=.001}}}this.$emit("event-resizing",{_eid:s._eid,end:s.end,endTimeMinutes:s.endTimeMinutes})},eventDragCreation(t){const{dragCreateAnEvent:e}=this.domEvents,{start:s,startCursorY:l,split:r}=e,n=new Date(s),{minutes:o,cursorCoords:{y:a}}=this.minutesAtCursor(t);if(!(!e.event&&Math.abs(l-a)<this.dragToCreateThreshold))if(e.event){if(n.setHours(0,o,o===V?-1:0,0),this.snapToTime){let c=n.getHours()*60+n.getMinutes();const v=c+this.snapToTime/2;c=v-v%this.snapToTime,n.setHours(0,c,0,0)}const u=s<n,{event:d}=e;d.start=u?s:n,d.end=u?n:s,d.startTimeMinutes=d.start.getHours()*60+d.start.getMinutes(),d.endTimeMinutes=d.end.getHours()*60+d.end.getMinutes()}else{if(e.event=this.utils.event.createAnEvent(s,1,{split:r}),!e.event){e.start=null,e.split=null,e.event=null;return}e.event.resizing=!0}},unfocusEvent(){const{focusAnEvent:t,clickHoldAnEvent:e}=this.domEvents,s=this.view.events.find(l=>l._eid===(t._eid||e._eid));t._eid=null,e._eid=null,s&&(s.focused=!1,s.deleting=!1)},cancelDelete(){const{clickHoldAnEvent:t}=this.domEvents;if(t._eid){const e=this.view.events.find(s=>s._eid===t._eid);e&&(e.deleting=!1),t._eid=null,t.timeoutId=null}},onEventTitleBlur(t,e){if(e.title===t.target.innerHTML)return;const s=e.title;e.title=t.target.innerHTML;const l=this.cleanupEvent(e);this.$emit("event-title-change",{event:l,oldTitle:s}),this.$emit("event-change",{event:l,originalEvent:{...l,title:s}})},updateMutableEvents(){const t=this.utils.date;this.mutableEvents=[],this.events.forEach(e=>{const s=typeof e.start=="string"?t.stringToDate(e.start):e.start,l=t.formatDateLite(s),r=t.dateToMinutes(s);let n=null;typeof e.end=="string"&&e.end.includes("24:00")?(n=new Date(e.end.replace(" 24:00","")),n.setHours(23,59,59,0)):n=typeof e.end=="string"?t.stringToDate(e.end):e.end;let o=t.formatDateLite(n),a=t.dateToMinutes(n);(!a||a===V)&&(!this.time||typeof e.end=="string"&&e.end.length===10?n.setHours(23,59,59,0):n.setSeconds(n.getSeconds()-1),o=t.formatDateLite(n),a=V);const u=l!==o;e=Object.assign({...this.utils.event.eventDefaults},e,{_eid:`${this._.uid}_${this.eventIdIncrement++}`,segments:u?{}:null,start:s,startTimeMinutes:r,end:n,endTimeMinutes:a,daysCount:u?t.countDays(s,n):1,class:e.class}),this.mutableEvents.push(e)})},minutesAtCursor(t){return this.utils.cell.minutesAtCursor(t)},createEvent(t,e,s={}){return this.utils.event.createAnEvent(t,e,s)},cleanupEvent(t){return t={...t},["segments","deletable","deleting","titleEditable","resizable","resizing","draggable","dragging","draggingStatic","focused"].forEach(s=>{s in t&&delete t[s]}),t.repeat||delete t.repeat,t},emitWithEvent(t,e){this.$emit(t,this.cleanupEvent(e))},updateSelectedDate(t){if(t&&typeof t=="string"?t=this.utils.date.stringToDate(t):t=new Date(t),t&&t instanceof Date){const{selectedDate:e}=this.view;e&&(this.transitionDirection=e.getTime()>t.getTime()?"left":"right"),t.setHours(0,0,0,0),(!e||e.getTime()!==t.getTime())&&(this.view.selectedDate=t),this.switchView(this.view.id)}},getWeekNumber(t){const e=this.utils.date,l=this.firstCellDateWeekNumber+t,r=this.startWeekOnSunday?1:0;return l>52?e.getWeek(e.addDays(this.view.firstCellDate,7*t+r)):l},timeTick(){this.now=new Date,this.timeTickerIds[1]=setTimeout(this.timeTick,60*1e3)},updateDateTexts(){this.utils.date.updateTexts(this.texts)},alignWithScrollbar(){if(document.getElementById("vuecal-align-with-scrollbar"))return;const t=this.$refs.vuecal.getElementsByClassName("vuecal__scrollbar-check")[0],e=t.offsetWidth-t.children[0].offsetWidth;if(e){const s=document.createElement("style");s.id="vuecal-align-with-scrollbar",s.type="text/css",s.innerHTML=`.vuecal__weekdays-headings,.vuecal__all-day {padding-right: ${e}px}`,document.head.appendChild(s)}},cellOrSplitHasEvents(t,e=null){return t.length&&(!e&&t.length||e&&t.some(s=>s.split===e.id))}},created(){this.utils.cell=new U(this),this.utils.event=new K(this,this.utils.date),this.loadLocale(this.locale),this.editEvents.drag&&this.loadDragAndDrop(),this.updateMutableEvents(this.events),this.view.id=this.currentView,this.selectedDate?this.updateSelectedDate(this.selectedDate):(this.view.selectedDate=new Date,this.switchView(this.currentView)),this.time&&this.watchRealTime&&(this.timeTickerIds[0]=setTimeout(this.timeTick,(60-this.now.getSeconds())*1e3))},mounted(){const t=this.utils.date,e="ontouchstart"in window,{resize:s,drag:l,create:r,delete:n,title:o}=this.editEvents,a=this.onEventClick&&typeof this.onEventClick=="function";(s||l||r||n||o||a)&&window.addEventListener(e?"touchend":"mouseup",this.onMouseUp),(s||l||r&&this.dragToCreateEvent)&&window.addEventListener(e?"touchmove":"mousemove",this.onMouseMove,{passive:!1}),o&&window.addEventListener("keyup",this.onKeyUp),e&&(this.$refs.vuecal.oncontextmenu=function(c){c.preventDefault(),c.stopPropagation()}),this.hideBody||this.alignWithScrollbar();const u=this.view.startDate,d={view:this.view.id,startDate:u,endDate:this.view.endDate,...this.isMonthView?{firstCellDate:this.view.firstCellDate,lastCellDate:this.view.lastCellDate}:{},events:this.view.events.map(this.cleanupEvent),...this.isWeekView?{week:t.getWeek(this.startWeekOnSunday?t.addDays(u,1):u)}:{}};this.$emit("ready",d),this.ready=!0},beforeUnmount(){const t="ontouchstart"in window;window.removeEventListener(t?"touchmove":"mousemove",this.onMouseMove,{passive:!1}),window.removeEventListener(t?"touchend":"mouseup",this.onMouseUp),window.removeEventListener("keyup",this.onKeyUp),this.timeTickerIds[0]&&clearTimeout(this.timeTickerIds[0]),this.timeTickerIds[1]&&clearTimeout(this.timeTickerIds[1]),this.timeTickerIds=[null,null]},computed:{editEvents(){return this.editableEvents&&typeof this.editableEvents=="object"?{title:!!this.editableEvents.title,drag:!!this.editableEvents.drag,resize:!!this.editableEvents.resize,create:!!this.editableEvents.create,delete:!!this.editableEvents.delete}:{title:!!this.editableEvents,drag:!!this.editableEvents,resize:!!this.editableEvents,create:!!this.editableEvents,delete:!!this.editableEvents}},views(){return{years:{label:this.texts.years,enabled:!this.disableViews.includes("years")},year:{label:this.texts.year,enabled:!this.disableViews.includes("year")},month:{label:this.texts.month,enabled:!this.disableViews.includes("month")},week:{label:this.texts.week,enabled:!this.disableViews.includes("week")},day:{label:this.texts.day,enabled:!this.disableViews.includes("day")}}},currentView(){return this.validateView(this.activeView)},enabledViews(){return Object.keys(this.views).filter(t=>this.views[t].enabled)},hasTimeColumn(){return this.time&&this.isWeekOrDayView},isShortMonthView(){return this.isMonthView&&this.eventsOnMonthView==="short"},firstCellDateWeekNumber(){const t=this.utils.date,e=this.view.firstCellDate;return t.getWeek(this.startWeekOnSunday?t.addDays(e,1):e)},timeCells(){const t=[];for(let e=this.timeFrom,s=this.timeTo;e<s;e+=this.timeStep)t.push({hours:Math.floor(e/60),minutes:e%60,label:this.utils.date.formatTime(e,this.TimeFormat),value:e});return t},TimeFormat(){return this.timeFormat||(this.twelveHour?"h:mm{am}":"HH:mm")},daySplits(){return(this.splitDays.filter(t=>!t.hide)||[]).map((t,e)=>({...t,id:t.id||e+1}))},hasSplits(){return this.daySplits.length&&this.isWeekOrDayView},hasShortEvents(){return this.showAllDayEvents==="short"},cellOrSplitMinWidth(){let t=null;return this.hasSplits&&this.minSplitWidth?t=this.visibleDaysCount*this.minSplitWidth*this.daySplits.length:this.minCellWidth&&this.isWeekView&&(t=this.visibleDaysCount*this.minCellWidth),t},allDayBar(){let t=this.allDayBarHeight||null;return t&&!isNaN(t)&&(t+="px"),{cells:this.viewCells,options:this.$props,label:this.texts.allDay,shortEvents:this.hasShortEvents,daySplits:this.hasSplits&&this.daySplits||[],cellOrSplitMinWidth:this.cellOrSplitMinWidth,height:t}},minTimestamp(){let t=null;return this.minDate&&typeof this.minDate=="string"?t=this.utils.date.stringToDate(this.minDate):this.minDate&&this.minDate instanceof Date&&(t=this.minDate),t?t.getTime():null},maxTimestamp(){let t=null;return this.maxDate&&typeof this.maxDate=="string"?t=this.utils.date.stringToDate(this.maxDate):this.maxDate&&this.minDate instanceof Date&&(t=this.maxDate),t?t.getTime():null},weekDays(){let{weekDays:t,weekDaysShort:e=[]}=this.texts;return t=t.slice(0).map((s,l)=>({label:s,...e.length?{short:e[l]}:{},hide:this.hideWeekends&&l>=5||this.hideWeekdays.length&&this.hideWeekdays.includes(l+1)})),this.startWeekOnSunday&&t.unshift(t.pop()),t},weekDaysInHeader(){return this.isMonthView||this.isWeekView&&!this.minCellWidth&&!(this.hasSplits&&this.minSplitWidth)},months(){return this.texts.months.map(t=>({label:t}))},specialDayHours(){return!this.specialHours||!Object.keys(this.specialHours).length?{}:Array(7).fill("").map((t,e)=>{let s=this.specialHours[e+1]||[];return Array.isArray(s)||(s=[s]),t=[],s.forEach(({from:l,to:r,class:n},o)=>{t[o]={day:e+1,from:[null,void 0].includes(l)?null:l*1,to:[null,void 0].includes(r)?null:r*1,class:n||""}}),t})},viewTitle(){const t=this.utils.date;let e="";const s=this.view.startDate,l=s.getFullYear(),r=s.getMonth();switch(this.view.id){case"years":{e=this.texts.years;break}case"year":{e=l;break}case"month":{e=`${this.months[r].label} ${l}`;break}case"week":{const n=this.view.endDate,o=s.getFullYear();let a=this.texts.months[s.getMonth()];this.xsmall&&(a=a.substring(0,3));let u=`${a} ${o}`;if(n.getMonth()!==s.getMonth()){const d=n.getFullYear();let c=this.texts.months[n.getMonth()];this.xsmall&&(c=c.substring(0,3)),o===d?u=`${a} - ${c} ${o}`:this.small?u=`${a.substring(0,3)} ${o} - ${c.substring(0,3)} ${d}`:u=`${a} ${o} - ${c} ${d}`}e=`${this.texts.week} ${t.getWeek(this.startWeekOnSunday?t.addDays(s,1):s)} (${u})`;break}case"day":{e=this.utils.date.formatDate(s,this.texts.dateFormat,this.texts);break}}return e},viewCells(){const t=this.utils.date;let e=[],s=null,l=!1;this.watchRealTime||(this.now=new Date);const r=this.now;switch(this.view.id){case"years":{s=this.view.startDate.getFullYear(),e=Array.apply(null,Array(25)).map((n,o)=>{const a=new Date(s+o,0,1),u=new Date(s+o+1,0,1);return u.setSeconds(-1),{startDate:a,formattedDate:t.formatDateLite(a),endDate:u,content:s+o,current:s+o===r.getFullYear()}});break}case"year":{s=this.view.startDate.getFullYear(),e=Array.apply(null,Array(12)).map((n,o)=>{const a=new Date(s,o,1),u=new Date(s,o+1,1);return u.setSeconds(-1),{startDate:a,formattedDate:t.formatDateLite(a),endDate:u,content:this.xsmall?this.months[o].label.substr(0,3):this.months[o].label,current:o===r.getMonth()&&s===r.getFullYear()}});break}case"month":{const n=this.view.startDate.getMonth(),o=new Date(this.view.firstCellDate);l=!1,e=Array.apply(null,Array(42)).map((a,u)=>{const d=t.addDays(o,u),c=new Date(d);c.setHours(23,59,59,0);const v=!l&&t.isToday(d)&&!l++;return{startDate:d,formattedDate:t.formatDateLite(d),endDate:c,content:d.getDate(),today:v,outOfScope:d.getMonth()!==n,class:`vuecal__cell--day${d.getDay()||7}`}}),(this.hideWeekends||this.hideWeekdays.length)&&(e=e.filter(a=>{const u=a.startDate.getDay()||7;return!(this.hideWeekends&&u>=6||this.hideWeekdays.length&&this.hideWeekdays.includes(u))}));break}case"week":{l=!1;const n=this.view.startDate,o=this.weekDays;e=o.map((a,u)=>{const d=t.addDays(n,u),c=new Date(d);c.setHours(23,59,59,0);const v=(d.getDay()||7)-1;return{startDate:d,formattedDate:t.formatDateLite(d),endDate:c,today:!l&&t.isToday(d)&&!l++,specialHours:this.specialDayHours[v]||[]}}).filter((a,u)=>!o[u].hide);break}case"day":{const n=this.view.startDate,o=new Date(this.view.startDate);o.setHours(23,59,59,0);const a=(n.getDay()||7)-1;e=[{startDate:n,formattedDate:t.formatDateLite(n),endDate:o,today:t.isToday(n),specialHours:this.specialDayHours[a]||[]}];break}}return e},visibleDaysCount(){return this.isDayView?1:7-this.weekDays.reduce((t,e)=>t+e.hide,0)},cellWidth(){return 100/this.visibleDaysCount},cssClasses(){const{resizeAnEvent:t,dragAnEvent:e,dragCreateAnEvent:s}=this.domEvents;return{[`vuecal--${this.view.id}-view`]:!0,[`vuecal--${this.locale}`]:this.locale,"vuecal--no-time":!this.time,"vuecal--view-with-time":this.hasTimeColumn,"vuecal--week-numbers":this.showWeekNumbers&&this.isMonthView,"vuecal--twelve-hour":this.twelveHour,"vuecal--click-to-navigate":this.clickToNavigate,"vuecal--hide-weekends":this.hideWeekends,"vuecal--split-days":this.hasSplits,"vuecal--sticky-split-labels":this.hasSplits&&this.stickySplitLabels,"vuecal--overflow-x":this.minCellWidth&&this.isWeekView||this.hasSplits&&this.minSplitWidth,"vuecal--small":this.small,"vuecal--xsmall":this.xsmall,"vuecal--resizing-event":t._eid,"vuecal--drag-creating-event":s.event,"vuecal--dragging-event":e._eid,"vuecal--events-on-month-view":this.eventsOnMonthView,"vuecal--short-events":this.isMonthView&&this.eventsOnMonthView==="short","vuecal--has-touch":typeof window!="undefined"&&"ontouchstart"in window}},isYearsOrYearView(){return["years","year"].includes(this.view.id)},isYearsView(){return this.view.id==="years"},isYearView(){return this.view.id==="year"},isMonthView(){return this.view.id==="month"},isWeekOrDayView(){return["week","day"].includes(this.view.id)},isWeekView(){return this.view.id==="week"},isDayView(){return this.view.id==="day"}},watch:{events:{handler(t,e){this.updateMutableEvents(t),this.addEventsToView()},deep:!0},locale(t){this.loadLocale(t)},selectedDate(t){this.updateSelectedDate(t)},activeView(t){this.switchView(t)}}};var ht=T(ct,[["render",dt]]);module.exports=ht;