vue-cal 5.0.1-rc.29 → 5.0.1-rc.30

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 (52) hide show
  1. package/dist/i18n/ar.js +1 -1
  2. package/dist/i18n/bg.js +1 -1
  3. package/dist/i18n/bn.js +1 -1
  4. package/dist/i18n/bs.js +1 -1
  5. package/dist/i18n/ca.js +1 -1
  6. package/dist/i18n/cs.js +1 -1
  7. package/dist/i18n/da.js +1 -1
  8. package/dist/i18n/de.js +1 -1
  9. package/dist/i18n/el.js +1 -1
  10. package/dist/i18n/en-gb.js +1 -1
  11. package/dist/i18n/es.js +1 -1
  12. package/dist/i18n/et.js +1 -1
  13. package/dist/i18n/fa.js +1 -1
  14. package/dist/i18n/fi.js +1 -1
  15. package/dist/i18n/fr.js +1 -1
  16. package/dist/i18n/he.js +1 -1
  17. package/dist/i18n/hr.js +1 -1
  18. package/dist/i18n/hu.js +1 -1
  19. package/dist/i18n/id.js +1 -1
  20. package/dist/i18n/is.js +1 -1
  21. package/dist/i18n/it.js +1 -1
  22. package/dist/i18n/ja.js +1 -1
  23. package/dist/i18n/ka.js +1 -1
  24. package/dist/i18n/kaa.js +1 -1
  25. package/dist/i18n/kk.js +1 -1
  26. package/dist/i18n/ko.js +1 -1
  27. package/dist/i18n/ky.js +1 -1
  28. package/dist/i18n/lt.js +1 -1
  29. package/dist/i18n/mn.js +1 -1
  30. package/dist/i18n/nl.js +1 -1
  31. package/dist/i18n/no.js +1 -1
  32. package/dist/i18n/pl.js +1 -1
  33. package/dist/i18n/pt-br.js +1 -1
  34. package/dist/i18n/pt-pt.js +1 -1
  35. package/dist/i18n/ro.js +1 -1
  36. package/dist/i18n/ru.js +1 -1
  37. package/dist/i18n/sk.js +1 -1
  38. package/dist/i18n/sl.js +1 -1
  39. package/dist/i18n/sq.js +1 -1
  40. package/dist/i18n/sr.js +1 -1
  41. package/dist/i18n/sv.js +1 -1
  42. package/dist/i18n/tr.js +1 -1
  43. package/dist/i18n/uk.js +1 -1
  44. package/dist/i18n/uz-cryl.js +1 -1
  45. package/dist/i18n/uz.js +1 -1
  46. package/dist/i18n/vi.js +1 -1
  47. package/dist/i18n/zh-cn.js +1 -1
  48. package/dist/i18n/zh-hk.js +1 -1
  49. package/dist/vue-cal.css +1 -1
  50. package/dist/vue-cal.es.js +1277 -1259
  51. package/dist/vue-cal.umd.js +3 -3
  52. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
- import { computed as M, reactive as be, watch as he, toRefs as bt, ref as ce, onBeforeUnmount as Ne, nextTick as Ie, inject as He, createElementBlock as H, openBlock as O, renderSlot as V, createCommentVNode as Z, unref as T, Fragment as de, renderList as we, normalizeClass as De, createElementVNode as me, createVNode as Ve, Transition as Je, withCtx as B, createBlock as Se, resolveDynamicComponent as xe, mergeProps as ie, toHandlers as Xe, normalizeProps as se, onMounted as Ze, toDisplayString as ue, createTextVNode as qe, withModifiers as et, normalizeStyle as $e, TransitionGroup as tt, createSlots as Ce, useTemplateRef as Tt, useId as Mt, useAttrs as Et, provide as at, guardReactiveProps as re } from "vue";
1
+ import { computed as b, reactive as be, watch as De, toRefs as bt, ref as ue, onBeforeUnmount as Re, nextTick as Xe, inject as He, createElementBlock as P, openBlock as V, renderSlot as j, createCommentVNode as Q, unref as $, Fragment as de, renderList as we, normalizeClass as pe, createElementVNode as he, createVNode as Oe, Transition as Ue, withCtx as W, createBlock as Se, resolveDynamicComponent as xe, mergeProps as ie, toHandlers as Ie, normalizeProps as se, onMounted as Ze, toDisplayString as ce, createTextVNode as qe, withModifiers as et, normalizeStyle as $e, TransitionGroup as tt, createSlots as Ce, useTemplateRef as Tt, useId as Mt, useAttrs as Et, provide as at, guardReactiveProps as re } from "vue";
2
2
  /**
3
- * vue-cal v5.0.1-rc.29
3
+ * vue-cal v5.0.1-rc.30
4
4
  * (c) 2024-2025 Antoni Andre <antoniandre.web@gmail.com>
5
5
  * @license MIT
6
6
  */
7
- const ye = {
7
+ const fe = {
8
8
  texts: {
9
9
  weekDays: Array(7).fill(""),
10
10
  weekDaysShort: [],
@@ -33,184 +33,187 @@ const ye = {
33
33
  years: { cols: 5, rows: 5 }
34
34
  // Arbitrary range of quarters of century (25y).
35
35
  }
36
- }, Yt = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"], Ge = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"], St = Ge.reduce((h, t, c) => (h[t] = c || 7, h), {}), Ct = (h, t, c) => {
37
- const { dateUtils: r } = h, p = !1, Y = M(() => {
38
- if (z.value[t.view]) return t.view;
39
- const d = t.datePicker ? "month" : "week", i = t.view || d;
40
- return z.value[i] ? i : (console.warn(
41
- `Vue Cal: the provided or default view \`${i}\` is either invalid or not in the list of available views. The first available view will be chosen: \`${Object.keys(z.value)[0]}\`.`
42
- ), Object.keys(z.value)[0]);
43
- }), W = M(() => t.sm && !t.xs), f = M(() => t.xs || t.datePicker), L = M(() => t.clickToNavigate || t.datePicker && t.clickToNavigate !== !1), U = M(() => {
44
- const d = {
36
+ }, Yt = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"], Ge = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"], St = Ge.reduce((y, t, d) => (y[t] = d || 7, y), {}), Ct = (y, t, d) => {
37
+ const { dateUtils: r } = y, h = !1, C = b(() => {
38
+ if (E.value[t.view]) return t.view;
39
+ const c = t.datePicker ? "month" : "week", u = t.view || c;
40
+ return E.value[u] ? u : (console.warn(
41
+ `Vue Cal: the provided or default view \`${u}\` is either invalid or not in the list of available views. The first available view will be chosen: \`${Object.keys(E.value)[0]}\`.`
42
+ ), Object.keys(E.value)[0]);
43
+ }), B = b(() => t.sm && !t.xs), f = b(() => t.xs || t.datePicker), A = b(() => t.clickToNavigate || t.datePicker && t.clickToNavigate !== !1), Z = b(() => {
44
+ const c = {
45
45
  cell: {},
46
46
  // All possible event listeners to attach to cells.
47
47
  event: {}
48
48
  // All possible event listeners to attach to calendar events.
49
- }, i = (k) => k.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
50
- for (const [k, a] of Object.entries(c)) {
51
- const [F, q, K] = k.match(/^on(Cell|Event)(.+)$/) || [];
52
- F && (d[q.toLowerCase()][i(K).replace(/^-+|-+$/g, "")] = a);
49
+ }, u = (p) => p.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
50
+ for (const [p, a] of Object.entries(d)) {
51
+ const [O, X, U] = p.match(/^on(Cell|Event)(.+)$/) || [];
52
+ O && (c[X.toLowerCase()][u(U).replace(/^-+|-+$/g, "")] = a);
53
53
  }
54
- return d;
55
- }), P = M(() => {
56
- var i;
57
- const d = {};
58
- return t.hideWeekends && (d[6] = !0) && (d[7] = !0), (i = t.hideWeekdays) != null && i.length && t.hideWeekdays.forEach((k) => d[St[k]] = !0), d;
59
- }), l = M(() => t.hideWeekends || P.value[6] && P.value[7]), z = M(() => {
60
- const d = t.datePicker;
61
- let i = 0, k = {};
54
+ return c;
55
+ }), L = b(() => {
56
+ var u;
57
+ const c = {};
58
+ return t.hideWeekends && (c[6] = !0) && (c[7] = !0), (u = t.hideWeekdays) != null && u.length && t.hideWeekdays.forEach((p) => c[St[p]] = !0), c;
59
+ }), l = b(() => t.hideWeekends || L.value[6] && L.value[7]), E = b(() => {
60
+ const c = t.datePicker;
61
+ let u = 0, p = {};
62
62
  const a = t.views;
63
- return d && !a ? {
64
- month: { ...ye.availableViews.month },
65
- year: { ...ye.availableViews.year },
66
- years: { ...ye.availableViews.years }
67
- } : (a ? (Array.isArray(a) ? k = a.reduce((F, q) => (typeof q == "string" && ye.availableViews[q] ? F[q] = ye.availableViews[q] : i++, F), {}) : typeof a == "object" && (k = Object.entries(a).reduce((F, [q, K]) => {
68
- const { cols: x, rows: te } = ye.availableViews[q];
69
- return F[q] = { cols: K.cols || x, rows: K.rows || te }, F;
70
- }, {})), i && console.warn("Vue Cal: the provided `views` prop contains invalid views that will be ignored."), Object.keys(k).length || (console.warn("Vue Cal: No valid view in the provided `views` prop. Falling back to default views."), k = { ...ye.availableViews })) : k = { ...ye.availableViews }, k);
71
- }), A = M(() => t.datePicker ? "month" : z.value.week ? "week" : Object.keys(z.value)[0]), m = M(() => {
63
+ return c && !a ? {
64
+ month: { ...fe.availableViews.month },
65
+ year: { ...fe.availableViews.year },
66
+ years: { ...fe.availableViews.years }
67
+ } : t.horizontal && !a ? {
68
+ days: { cols: fe.availableViews.days.rows, rows: fe.availableViews.days.cols },
69
+ week: { cols: fe.availableViews.week.rows, rows: fe.availableViews.week.cols }
70
+ } : (a ? (Array.isArray(a) ? p = a.reduce((O, X) => (typeof X == "string" && fe.availableViews[X] ? O[X] = fe.availableViews[X] : u++, O), {}) : typeof a == "object" && (p = Object.entries(a).reduce((O, [X, U]) => {
71
+ const { cols: K, rows: te } = fe.availableViews[X];
72
+ return O[X] = { cols: U.cols || K, rows: U.rows || te }, O;
73
+ }, {})), u && console.warn("Vue Cal: the provided `views` prop contains invalid views that will be ignored."), Object.keys(p).length || (console.warn("Vue Cal: No valid view in the provided `views` prop. Falling back to default views."), p = { ...fe.availableViews })) : p = { ...fe.availableViews }, p);
74
+ }), F = b(() => t.datePicker ? "month" : E.value.week ? "week" : Object.keys(E.value)[0]), m = b(() => {
72
75
  if (typeof t.selectedDate == "string") return r.stringToDate(t.selectedDate);
73
76
  if (t.selectedDate instanceof Date) return t.selectedDate;
74
77
  t.selectedDate ? console.warn("Vue Cal: The provided selected date is invalid:", t.selectedDate) : console.log("Vue Cal: Info - The provided selected date is undefined.");
75
- }), u = M(() => {
78
+ }), i = b(() => {
76
79
  if (!t.disableDays) return [];
77
- const d = [];
80
+ const c = [];
78
81
  if (Array.isArray(t.disableDays))
79
- for (let i of t.disableDays) {
80
- let k = i;
81
- typeof i == "string" ? k = r.stringToDate(i) : i instanceof Date && (i = r.formatDate(i, "YYYY-MM-DD")), k instanceof Date && !isNaN(k.getTime()) ? d.push(i) : console.warn("Vue Cal: The provided `disableDays` prop contains an invalid date:", i);
82
+ for (let u of t.disableDays) {
83
+ let p = u;
84
+ typeof u == "string" ? p = r.stringToDate(u) : u instanceof Date && (u = r.formatDate(u, "YYYY-MM-DD")), p instanceof Date && !isNaN(p.getTime()) ? c.push(u) : console.warn("Vue Cal: The provided `disableDays` prop contains an invalid date:", u);
82
85
  }
83
86
  else console.warn("Vue Cal: The provided `disableDays` prop is invalid:", t.disableDays);
84
- return d;
85
- }), S = M(() => {
86
- let d = null;
87
- return t.minDate && typeof t.minDate == "string" ? d = r.stringToDate(t.minDate) : t.minDate && t.minDate instanceof Date && (d = t.minDate), (d == null ? void 0 : d.getTime()) || null;
88
- }), n = M(() => {
89
- let d = null;
90
- return t.maxDate && typeof t.maxDate == "string" ? d = r.stringToDate(t.maxDate) : t.maxDate && t.maxDate instanceof Date && (d = t.maxDate), (d == null ? void 0 : d.getTime()) || null;
91
- }), I = M(() => {
92
- var k;
93
- const { view: d } = h;
94
- return t.schedules.length && (d.isDay || d.isDays || d.isWeek) && ((k = t.schedules) == null ? void 0 : k.map((a, F) => ({ ...a, id: a.id ?? F + 1 }))) || void 0;
95
- }), e = M(() => {
96
- const d = {
87
+ return c;
88
+ }), S = b(() => {
89
+ let c = null;
90
+ return t.minDate && typeof t.minDate == "string" ? c = r.stringToDate(t.minDate) : t.minDate && t.minDate instanceof Date && (c = t.minDate), (c == null ? void 0 : c.getTime()) || null;
91
+ }), n = b(() => {
92
+ let c = null;
93
+ return t.maxDate && typeof t.maxDate == "string" ? c = r.stringToDate(t.maxDate) : t.maxDate && t.maxDate instanceof Date && (c = t.maxDate), (c == null ? void 0 : c.getTime()) || null;
94
+ }), I = b(() => {
95
+ var p;
96
+ const { view: c } = y;
97
+ return t.schedules.length && (c.isDay || c.isDays || c.isWeek) && ((p = t.schedules) == null ? void 0 : p.map((a, O) => ({ ...a, id: a.id ?? O + 1 }))) || void 0;
98
+ }), e = b(() => {
99
+ const c = {
97
100
  drag: !0,
98
101
  resize: !0,
99
102
  delete: !0,
100
103
  create: !0
101
104
  };
102
- return t.editableEvents === !0 ? d : t.editableEvents === !1 ? Object.keys(d).map((i) => d[i] = !1) : { ...d, ...t.editableEvents };
103
- }), C = M(() => {
104
- const { view: d } = h, { eventCount: i } = t;
105
- return (Array.isArray(i) ? i.includes(d.id) : i) && (d.isMonth && !t.eventsOnMonthView || d.isYear);
106
- }), j = M(() => t.allDayEvents && t.time !== !1 && !Y.isMonth), y = M(() => t.timeAtCursor && t.time !== !1), v = async (d) => {
107
- var k;
108
- let i = /* @__PURE__ */ Object.assign({ "../i18n/ar.json": () => import("./i18n/ar.js").then((a) => a.default), "../i18n/bg.json": () => import("./i18n/bg.js").then((a) => a.default), "../i18n/bn.json": () => import("./i18n/bn.js").then((a) => a.default), "../i18n/bs.json": () => import("./i18n/bs.js").then((a) => a.default), "../i18n/ca.json": () => import("./i18n/ca.js").then((a) => a.default), "../i18n/cs.json": () => import("./i18n/cs.js").then((a) => a.default), "../i18n/da.json": () => import("./i18n/da.js").then((a) => a.default), "../i18n/de.json": () => import("./i18n/de.js").then((a) => a.default), "../i18n/el.json": () => import("./i18n/el.js").then((a) => a.default), "../i18n/en-gb.json": () => import("./i18n/en-gb.js").then((a) => a.default), "../i18n/en-us.json": () => Promise.resolve().then(() => jt).then((a) => a.default), "../i18n/es.json": () => import("./i18n/es.js").then((a) => a.default), "../i18n/et.json": () => import("./i18n/et.js").then((a) => a.default), "../i18n/fa.json": () => import("./i18n/fa.js").then((a) => a.default), "../i18n/fi.json": () => import("./i18n/fi.js").then((a) => a.default), "../i18n/fr.json": () => import("./i18n/fr.js").then((a) => a.default), "../i18n/he.json": () => import("./i18n/he.js").then((a) => a.default), "../i18n/hr.json": () => import("./i18n/hr.js").then((a) => a.default), "../i18n/hu.json": () => import("./i18n/hu.js").then((a) => a.default), "../i18n/id.json": () => import("./i18n/id.js").then((a) => a.default), "../i18n/is.json": () => import("./i18n/is.js").then((a) => a.default), "../i18n/it.json": () => import("./i18n/it.js").then((a) => a.default), "../i18n/ja.json": () => import("./i18n/ja.js").then((a) => a.default), "../i18n/ka.json": () => import("./i18n/ka.js").then((a) => a.default), "../i18n/kaa.json": () => import("./i18n/kaa.js").then((a) => a.default), "../i18n/kk.json": () => import("./i18n/kk.js").then((a) => a.default), "../i18n/ko.json": () => import("./i18n/ko.js").then((a) => a.default), "../i18n/ky.json": () => import("./i18n/ky.js").then((a) => a.default), "../i18n/lt.json": () => import("./i18n/lt.js").then((a) => a.default), "../i18n/mn.json": () => import("./i18n/mn.js").then((a) => a.default), "../i18n/nl.json": () => import("./i18n/nl.js").then((a) => a.default), "../i18n/no.json": () => import("./i18n/no.js").then((a) => a.default), "../i18n/pl.json": () => import("./i18n/pl.js").then((a) => a.default), "../i18n/pt-br.json": () => import("./i18n/pt-br.js").then((a) => a.default), "../i18n/pt-pt.json": () => import("./i18n/pt-pt.js").then((a) => a.default), "../i18n/ro.json": () => import("./i18n/ro.js").then((a) => a.default), "../i18n/ru.json": () => import("./i18n/ru.js").then((a) => a.default), "../i18n/sk.json": () => import("./i18n/sk.js").then((a) => a.default), "../i18n/sl.json": () => import("./i18n/sl.js").then((a) => a.default), "../i18n/sq.json": () => import("./i18n/sq.js").then((a) => a.default), "../i18n/sr.json": () => import("./i18n/sr.js").then((a) => a.default), "../i18n/sv.json": () => import("./i18n/sv.js").then((a) => a.default), "../i18n/tr.json": () => import("./i18n/tr.js").then((a) => a.default), "../i18n/uk.json": () => import("./i18n/uk.js").then((a) => a.default), "../i18n/uz-cryl.json": () => import("./i18n/uz-cryl.js").then((a) => a.default), "../i18n/uz.json": () => import("./i18n/uz.js").then((a) => a.default), "../i18n/vi.json": () => import("./i18n/vi.js").then((a) => a.default), "../i18n/zh-cn.json": () => import("./i18n/zh-cn.js").then((a) => a.default), "../i18n/zh-hk.json": () => import("./i18n/zh-hk.js").then((a) => a.default) });
105
+ return t.editableEvents === !0 ? c : t.editableEvents === !1 ? Object.keys(c).map((u) => c[u] = !1) : { ...c, ...t.editableEvents };
106
+ }), z = b(() => {
107
+ const { view: c } = y, { eventCount: u } = t;
108
+ return (Array.isArray(u) ? u.includes(c.id) : u) && (c.isMonth && !t.eventsOnMonthView || c.isYear);
109
+ }), H = b(() => t.allDayEvents && t.time !== !1 && !C.isMonth), Y = b(() => t.timeAtCursor && t.time !== !1), _ = async (c) => {
110
+ var p;
111
+ let u = /* @__PURE__ */ Object.assign({ "../i18n/ar.json": () => import("./i18n/ar.js").then((a) => a.default), "../i18n/bg.json": () => import("./i18n/bg.js").then((a) => a.default), "../i18n/bn.json": () => import("./i18n/bn.js").then((a) => a.default), "../i18n/bs.json": () => import("./i18n/bs.js").then((a) => a.default), "../i18n/ca.json": () => import("./i18n/ca.js").then((a) => a.default), "../i18n/cs.json": () => import("./i18n/cs.js").then((a) => a.default), "../i18n/da.json": () => import("./i18n/da.js").then((a) => a.default), "../i18n/de.json": () => import("./i18n/de.js").then((a) => a.default), "../i18n/el.json": () => import("./i18n/el.js").then((a) => a.default), "../i18n/en-gb.json": () => import("./i18n/en-gb.js").then((a) => a.default), "../i18n/en-us.json": () => Promise.resolve().then(() => jt).then((a) => a.default), "../i18n/es.json": () => import("./i18n/es.js").then((a) => a.default), "../i18n/et.json": () => import("./i18n/et.js").then((a) => a.default), "../i18n/fa.json": () => import("./i18n/fa.js").then((a) => a.default), "../i18n/fi.json": () => import("./i18n/fi.js").then((a) => a.default), "../i18n/fr.json": () => import("./i18n/fr.js").then((a) => a.default), "../i18n/he.json": () => import("./i18n/he.js").then((a) => a.default), "../i18n/hr.json": () => import("./i18n/hr.js").then((a) => a.default), "../i18n/hu.json": () => import("./i18n/hu.js").then((a) => a.default), "../i18n/id.json": () => import("./i18n/id.js").then((a) => a.default), "../i18n/is.json": () => import("./i18n/is.js").then((a) => a.default), "../i18n/it.json": () => import("./i18n/it.js").then((a) => a.default), "../i18n/ja.json": () => import("./i18n/ja.js").then((a) => a.default), "../i18n/ka.json": () => import("./i18n/ka.js").then((a) => a.default), "../i18n/kaa.json": () => import("./i18n/kaa.js").then((a) => a.default), "../i18n/kk.json": () => import("./i18n/kk.js").then((a) => a.default), "../i18n/ko.json": () => import("./i18n/ko.js").then((a) => a.default), "../i18n/ky.json": () => import("./i18n/ky.js").then((a) => a.default), "../i18n/lt.json": () => import("./i18n/lt.js").then((a) => a.default), "../i18n/mn.json": () => import("./i18n/mn.js").then((a) => a.default), "../i18n/nl.json": () => import("./i18n/nl.js").then((a) => a.default), "../i18n/no.json": () => import("./i18n/no.js").then((a) => a.default), "../i18n/pl.json": () => import("./i18n/pl.js").then((a) => a.default), "../i18n/pt-br.json": () => import("./i18n/pt-br.js").then((a) => a.default), "../i18n/pt-pt.json": () => import("./i18n/pt-pt.js").then((a) => a.default), "../i18n/ro.json": () => import("./i18n/ro.js").then((a) => a.default), "../i18n/ru.json": () => import("./i18n/ru.js").then((a) => a.default), "../i18n/sk.json": () => import("./i18n/sk.js").then((a) => a.default), "../i18n/sl.json": () => import("./i18n/sl.js").then((a) => a.default), "../i18n/sq.json": () => import("./i18n/sq.js").then((a) => a.default), "../i18n/sr.json": () => import("./i18n/sr.js").then((a) => a.default), "../i18n/sv.json": () => import("./i18n/sv.js").then((a) => a.default), "../i18n/tr.json": () => import("./i18n/tr.js").then((a) => a.default), "../i18n/uk.json": () => import("./i18n/uk.js").then((a) => a.default), "../i18n/uz-cryl.json": () => import("./i18n/uz-cryl.js").then((a) => a.default), "../i18n/uz.json": () => import("./i18n/uz.js").then((a) => a.default), "../i18n/vi.json": () => import("./i18n/vi.js").then((a) => a.default), "../i18n/zh-cn.json": () => import("./i18n/zh-cn.js").then((a) => a.default), "../i18n/zh-hk.json": () => import("./i18n/zh-hk.js").then((a) => a.default) });
109
112
  {
110
- if (!i[`../i18n/${d}.json`]) {
111
- console.warn(`Vue Cal: the locale \`${d}\` does not exist. Falling back to \`en-us\`.`), d = "en-us";
113
+ if (!u[`../i18n/${c}.json`]) {
114
+ console.warn(`Vue Cal: the locale \`${c}\` does not exist. Falling back to \`en-us\`.`), c = "en-us";
112
115
  return;
113
116
  }
114
- i = await ((k = i[`../i18n/${d}.json`]) == null ? void 0 : k.call(i));
117
+ u = await ((p = u[`../i18n/${c}.json`]) == null ? void 0 : p.call(u));
115
118
  }
116
- h.texts = Object.assign(h.texts, Object.assign({ ...ye.texts }, i)), r.updateTexts(h.texts);
117
- }, D = be(t.events || []);
118
- return he(() => t.events, (d) => D.splice(0, D.length, ...d)), he(() => t.locale, (d) => v(d || "en-us")), (t.locale || !h.texts.today) && v(t.locale || "en-us"), {
119
+ y.texts = Object.assign(y.texts, Object.assign({ ...fe.texts }, u)), r.updateTexts(y.texts);
120
+ }, v = be(t.events || []);
121
+ return De(() => t.events, (c) => v.splice(0, v.length, ...c)), De(() => t.locale, (c) => _(c || "en-us")), (t.locale || !y.texts.today) && _(t.locale || "en-us"), {
119
122
  ...bt(t),
120
- events: D,
123
+ events: v,
121
124
  // All the events listeners for cells and events that the end user may have attached to vue-cal.
122
- eventListeners: U,
123
- defaultView: A,
124
- availableViews: z,
125
- disableDays: u,
126
- ready: p,
127
- sm: W,
125
+ eventListeners: Z,
126
+ defaultView: F,
127
+ availableViews: E,
128
+ disableDays: i,
129
+ ready: h,
130
+ sm: B,
128
131
  xs: f,
129
- clickToNavigate: L,
130
- hideWeekdays: P,
132
+ clickToNavigate: A,
133
+ hideWeekdays: L,
131
134
  hideWeekends: l,
132
135
  minTimestamp: S,
133
136
  maxTimestamp: n,
134
137
  schedules: I,
135
138
  selectedDate: m,
136
139
  editableEvents: e,
137
- showCellEventCount: C,
138
- allDayEvents: j,
139
- timeAtCursor: y,
140
- view: Y,
140
+ showCellEventCount: z,
141
+ allDayEvents: H,
142
+ timeAtCursor: Y,
143
+ view: C,
141
144
  // Getters.
142
145
  get hasHiddenDays() {
143
- return Object.keys(P.value).length;
146
+ return Object.keys(L.value).length;
144
147
  },
145
148
  get size() {
146
- return f.value ? "xs" : W.value ? "sm" : "lg";
149
+ return f.value ? "xs" : B.value ? "sm" : "lg";
147
150
  },
148
- loadTexts: v
151
+ loadTexts: _
149
152
  };
150
- }, Oe = (h, t) => {
151
- const c = t.timeTo - t.timeFrom;
152
- return (h - t.timeFrom) * 100 / c;
153
- }, je = (h, t) => {
154
- const c = t.timeTo - t.timeFrom;
155
- return ~~(h * c / 100 + t.timeFrom);
156
- }, Ke = (h, t) => {
157
- const c = t.clientHeight;
158
- return h * 100 / c;
159
- }, We = be({ id: null, date: null });
160
- let nt = !1, Ue = !0;
153
+ }, Ve = (y, t) => {
154
+ const d = t.timeTo - t.timeFrom;
155
+ return (y - t.timeFrom) * 100 / d;
156
+ }, je = (y, t) => {
157
+ const d = t.timeTo - t.timeFrom;
158
+ return ~~(y * d / 100 + t.timeFrom);
159
+ }, Ke = (y, t) => {
160
+ const d = t.clientHeight;
161
+ return y * 100 / d;
162
+ }, Be = be({ id: null, date: null });
163
+ let nt = !1, Je = !0;
161
164
  const _e = be({ el: null, cell: null, timeout: null }), ke = be({
162
165
  eventId: null,
163
166
  fromVueCal: null,
164
167
  toVueCal: null
165
168
  });
166
- function zt(h) {
167
- const { config: t, view: c, eventsManager: r, emit: p, uid: Y, dateUtils: W } = h, f = (S) => {
168
- var v;
169
- const { timeStep: n, timeCellHeight: I, timeFrom: e } = t, C = (((v = S.touches) == null ? void 0 : v[0]) || S).clientY, { top: j } = S.currentTarget.getBoundingClientRect(), y = C - j - ~~S.dataTransfer.getData("cursor-grab-at");
170
- return je(Ke(y, S.currentTarget), t);
171
- }, L = (S, n, I) => {
172
- const e = n.duration || U(n.start, n.end) || t.timeStep;
173
- let C = Math.max(f(S), 0);
169
+ function zt(y) {
170
+ const { config: t, view: d, eventsManager: r, emit: h, uid: C, dateUtils: B } = y, f = (S) => {
171
+ var _;
172
+ const { timeStep: n, timeCellHeight: I, timeFrom: e } = t, z = (((_ = S.touches) == null ? void 0 : _[0]) || S).clientY, { top: H } = S.currentTarget.getBoundingClientRect(), Y = z - H - ~~S.dataTransfer.getData("cursor-grab-at");
173
+ return je(Ke(Y, S.currentTarget), t);
174
+ }, A = (S, n, I) => {
175
+ const e = n.duration || Z(n.start, n.end) || t.timeStep;
176
+ let z = Math.max(f(S), 0);
174
177
  if (t.snapToInterval) {
175
- const D = C + t.snapToInterval / 2;
176
- C = D - D % t.snapToInterval;
178
+ const v = z + t.snapToInterval / 2;
179
+ z = v - v % t.snapToInterval;
177
180
  }
178
- const j = new Date(new Date(I).setMinutes(C)), y = Math.min(C + e, 1440), v = new Date(new Date(I).setMinutes(y));
179
- return { start: j, end: v };
180
- }, U = (S, n) => Math.round((n - S) / 6e4);
181
+ const H = new Date(new Date(I).setMinutes(z)), Y = Math.min(z + e, 1440), _ = new Date(new Date(I).setMinutes(Y));
182
+ return { start: H, end: _ };
183
+ }, Z = (S, n) => Math.round((n - S) / 6e4);
181
184
  return {
182
185
  eventDragStart: (S, n) => {
183
- if (S.target.nodeType === 3 || h.touch.isResizingEvent) return S.preventDefault();
186
+ if (S.target.nodeType === 3 || y.touch.isResizingEvent) return S.preventDefault();
184
187
  S.dataTransfer.effectAllowed = "move", S.dataTransfer.dropEffect = "move";
185
- const I = { ...n, _: { id: n._.id, duration: U(n.start, n.end) } };
188
+ const I = { ...n, _: { id: n._.id, duration: Z(n.start, n.end) } };
186
189
  try {
187
190
  S.dataTransfer.setData("text/plain", ""), S.dataTransfer.setData("event", JSON.stringify(I)), S.dataTransfer.setData("cursor-grab-at", S.offsetY);
188
- } catch (C) {
189
- return console.warn("Vue Cal: Failed to set drag data:", C), S.preventDefault();
191
+ } catch (z) {
192
+ return console.warn("Vue Cal: Failed to set drag data:", z), S.preventDefault();
190
193
  }
191
- ke.eventId = n._.id, ke.fromVueCal = Y, p("event-drag-start", {
194
+ ke.eventId = n._.id, ke.fromVueCal = C, h("event-drag-start", {
192
195
  e: S,
193
196
  event: n
194
197
  });
195
198
  const e = S.target.closest(".vuecal__event");
196
199
  e.classList.add("vuecal__event--dragging-ghost"), setTimeout(() => {
197
200
  e.classList.add("vuecal__event--dragging-original"), e.classList.remove("vuecal__event--dragging-ghost");
198
- }, 0), nt = !1, Object.assign(We, { id: c.id, date: c.firstCellDate }), Ue = !0, h.touch.isDraggingEvent = !0;
201
+ }, 0), nt = !1, Object.assign(Be, { id: d.id, date: d.firstCellDate }), Je = !0, y.touch.isDraggingEvent = !0;
199
202
  },
200
203
  eventDragEnd: (S, n) => {
201
204
  ke.eventId = null, S.target.closest(".vuecal__event").classList.remove("vuecal__event--dragging-original");
202
205
  const { fromVueCal: I, toVueCal: e } = ke;
203
- e && I !== e && r.deleteEvent(n._.id, 3), nt && Ue && We.id && c.switchView(We.id, We.date, !0), p("event-drag-end", {
206
+ e && I !== e && r.deleteEvent(n._.id, 3), nt && Je && Be.id && d.switchView(Be.id, Be.date, !0), h("event-drag-end", {
204
207
  e: S,
205
208
  event: n,
206
- external: ke.fromVueCal !== Y
207
- }), ke.fromVueCal = null, ke.toVueCal = null, h.touch.isDraggingEvent = !1;
209
+ external: ke.fromVueCal !== C
210
+ }), ke.fromVueCal = null, ke.toVueCal = null, y.touch.isDraggingEvent = !1;
208
211
  },
209
212
  cellDragEnter: (S, n) => {
210
213
  const { start: I } = n, e = S.currentTarget;
211
214
  if (!S.currentTarget.contains(S.relatedTarget)) {
212
215
  if (e === _e.el || !e.className.includes("vuecal__cell-content")) return !1;
213
- _e.el && (_e.cell.highlighted = !1), Object.assign(_e, { el: e, cell: n, timeout: clearTimeout(_e.timeout) }), n.highlighted = !0, ["years", "year", "month"].includes(c.id) && (_e.timeout = setTimeout(() => h.switchToNarrowerView(I), 2e3));
216
+ _e.el && (_e.cell.highlighted = !1), Object.assign(_e, { el: e, cell: n, timeout: clearTimeout(_e.timeout) }), n.highlighted = !0, ["years", "year", "month"].includes(d.id) && (_e.timeout = setTimeout(() => y.switchToNarrowerView(I), 2e3));
214
217
  }
215
218
  },
216
219
  cellDragOver: (S, n) => {
@@ -221,62 +224,62 @@ function zt(h) {
221
224
  S.preventDefault(), !S.currentTarget.contains(S.relatedTarget) && (n.highlightedSchedule = !1, _e.cell === n && (clearTimeout(_e.timeout), Object.assign(_e, { el: null, cell: null, timeout: null }), n.highlighted = !1));
222
225
  },
223
226
  cellDragDrop: async (S, n, I = !1) => {
224
- var k, a, F;
227
+ var p, a, O;
225
228
  S.preventDefault(), clearTimeout(_e.timeout), Object.assign(_e, { el: null, cell: null, timeout: null });
226
229
  const e = JSON.parse(S.dataTransfer.getData("event") || "{}");
227
230
  e.start && (e.start = new Date(e.start)), e.end && (e.end = new Date(e.end));
228
- let C, j, y;
229
- I ? (j = new Date(n.start), y = new Date(n.end)) : { start: j, end: y } = L(S, e, n.start);
230
- const { schedule: v } = ((k = S.target.closest("[data-schedule]")) == null ? void 0 : k.dataset) || {};
231
- let D = () => {
231
+ let z, H, Y;
232
+ I ? (H = new Date(n.start), Y = new Date(n.end)) : { start: H, end: Y } = A(S, e, n.start);
233
+ const { schedule: _ } = ((p = S.target.closest("[data-schedule]")) == null ? void 0 : p.dataset) || {};
234
+ let v = () => {
232
235
  };
233
- ke.fromVueCal === Y ? (C = r.getEvent(e._.id), C && (C._.dragging = !1, D = (q) => {
234
- if (C.start = j, C.end = y, C.allDay = I, v !== void 0 && (C.schedule = ~~v), q && typeof q == "object") {
235
- const { _: K, ...x } = q;
236
- Object.assign(C, x);
236
+ ke.fromVueCal === C ? (z = r.getEvent(e._.id), z && (z._.dragging = !1, v = (X) => {
237
+ if (z.start = H, z.end = Y, z.allDay = I, _ !== void 0 && (z.schedule = ~~_), X && typeof X == "object") {
238
+ const { _: U, ...K } = X;
239
+ Object.assign(z, K);
237
240
  }
238
- })) : (C = {
241
+ })) : (z = {
239
242
  ...e,
240
- start: j,
241
- end: y,
242
- ...v !== void 0 && { schedule: ~~v },
243
- _: { id: ((a = e._) == null ? void 0 : a.id) || e.id, duration: U(j, y) },
244
- getOverlappingEvents: () => r.getEventsInRange(j, y, { schedule: ~~v })
245
- }, D = (q) => {
246
- if (C = r.createEvent(C), q && typeof q == "object") {
247
- const { _: K, ...x } = q;
248
- Object.assign(C, x);
243
+ start: H,
244
+ end: Y,
245
+ ..._ !== void 0 && { schedule: ~~_ },
246
+ _: { id: ((a = e._) == null ? void 0 : a.id) || e.id, duration: Z(H, Y) },
247
+ getOverlappingEvents: () => r.getEventsInRange(H, Y, { schedule: ~~_ })
248
+ }, v = (X) => {
249
+ if (z = r.createEvent(z), X && typeof X == "object") {
250
+ const { _: U, ...K } = X;
251
+ Object.assign(z, K);
249
252
  }
250
253
  });
251
- let d = !0;
252
- const { drop: i } = (F = t.eventListeners) == null ? void 0 : F.event;
253
- i && (d = await i({
254
+ let c = !0;
255
+ const { drop: u } = (O = t.eventListeners) == null ? void 0 : O.event;
256
+ u && (c = await u({
254
257
  e: S,
255
- event: { ...C, start: j, end: y, schedule: ~~v },
256
- overlaps: C.getOverlappingEvents({ start: j, end: y, schedule: ~~v }),
258
+ event: { ...z, start: H, end: Y, schedule: ~~_ },
259
+ overlaps: z.getOverlappingEvents({ start: H, end: Y, schedule: ~~_ }),
257
260
  cell: n,
258
- external: ke.fromVueCal !== Y
259
- })), d !== !1 && D(d), n.highlighted = !1, n.highlightedSchedule = null, Ue = !1, ke.toVueCal = Y, p("event-dropped", {
261
+ external: ke.fromVueCal !== C
262
+ })), c !== !1 && v(c), n.highlighted = !1, n.highlightedSchedule = null, Je = !1, ke.toVueCal = C, h("event-dropped", {
260
263
  e: S,
261
264
  cell: n,
262
- event: C,
265
+ event: z,
263
266
  originalEvent: e,
264
- external: ke.fromVueCal !== Y
267
+ external: ke.fromVueCal !== C
265
268
  });
266
269
  }
267
270
  };
268
271
  }
269
- const lt = (h, t) => {
270
- let c, r, p, Y = {}, W = {};
271
- const f = ce(h), L = () => {
272
+ const lt = (y, t) => {
273
+ let d, r, h, C = {}, B = {};
274
+ const f = ue(y), A = () => {
272
275
  f.value.today || (f.value = t), Date.prototype.addDays = function(s) {
273
- return z(this, s || 0);
276
+ return E(this, s || 0);
274
277
  }, Date.prototype.subtractDays = function(s) {
275
- return A(this, s || 0);
278
+ return F(this, s || 0);
276
279
  }, Date.prototype.addHours = function(s) {
277
280
  return m(this, s || 0);
278
281
  }, Date.prototype.subtractHours = function(s) {
279
- return u(this, s || 0);
282
+ return i(this, s || 0);
280
283
  }, Date.prototype.addMinutes = function(s) {
281
284
  return S(this, s || 0);
282
285
  }, Date.prototype.subtractMinutes = function(s) {
@@ -284,121 +287,121 @@ const lt = (h, t) => {
284
287
  }, Date.prototype.getWeek = function() {
285
288
  return e(this);
286
289
  }, Date.prototype.isToday = function() {
287
- return C(this);
290
+ return z(this);
288
291
  }, Date.prototype.isLeapYear = function() {
289
- return v(this);
292
+ return _(this);
290
293
  }, Date.prototype.format = function(s = "YYYY-MM-DD") {
291
- return q(this, s);
294
+ return X(this, s);
292
295
  }, Date.prototype.formatTime = function(s = "HH:mm") {
293
- return x(this, s);
296
+ return K(this, s);
294
297
  };
295
- }, U = () => {
298
+ }, Z = () => {
296
299
  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;
297
- }, P = (s) => {
298
- f.value = s, Date.prototype.subtractDays && L();
299
- }, l = () => (r !== (/* @__PURE__ */ new Date()).getDate() && (c = /* @__PURE__ */ new Date(), r = c.getDate(), p = `${c.getFullYear()}-${c.getMonth()}-${c.getDate()}`), p), z = (s, $) => {
300
- const w = new Date(s.valueOf());
301
- return w.setDate(w.getDate() + $), w;
302
- }, A = (s, $) => {
303
- const w = new Date(s.valueOf());
304
- return w.setDate(w.getDate() - $), w;
305
- }, m = (s, $) => {
306
- const w = new Date(s.valueOf());
307
- return w.setHours(w.getHours() + $), w;
308
- }, u = (s, $) => {
309
- const w = new Date(s.valueOf());
310
- return w.setHours(w.getHours() - $), w;
311
- }, S = (s, $) => {
312
- const w = new Date(s.valueOf());
313
- return w.setMinutes(w.getMinutes() + $), w;
314
- }, n = (s, $) => {
315
- const w = new Date(s.valueOf());
316
- return w.setMinutes(w.getMinutes() - $), w;
317
- }, I = (s, $) => {
318
- const w = (J) => {
319
- const ne = J % $;
320
- return ne !== 0 && (J += ne >= $ / 2 ? $ - ne : -ne), J;
300
+ }, L = (s) => {
301
+ f.value = s, Date.prototype.subtractDays && A();
302
+ }, l = () => (r !== (/* @__PURE__ */ new Date()).getDate() && (d = /* @__PURE__ */ new Date(), r = d.getDate(), h = `${d.getFullYear()}-${d.getMonth()}-${d.getDate()}`), h), E = (s, k) => {
303
+ const D = new Date(s.valueOf());
304
+ return D.setDate(D.getDate() + k), D;
305
+ }, F = (s, k) => {
306
+ const D = new Date(s.valueOf());
307
+ return D.setDate(D.getDate() - k), D;
308
+ }, m = (s, k) => {
309
+ const D = new Date(s.valueOf());
310
+ return D.setHours(D.getHours() + k), D;
311
+ }, i = (s, k) => {
312
+ const D = new Date(s.valueOf());
313
+ return D.setHours(D.getHours() - k), D;
314
+ }, S = (s, k) => {
315
+ const D = new Date(s.valueOf());
316
+ return D.setMinutes(D.getMinutes() + k), D;
317
+ }, n = (s, k) => {
318
+ const D = new Date(s.valueOf());
319
+ return D.setMinutes(D.getMinutes() - k), D;
320
+ }, I = (s, k) => {
321
+ const D = (J) => {
322
+ const ne = J % k;
323
+ return ne !== 0 && (J += ne >= k / 2 ? k - ne : -ne), J;
321
324
  };
322
- if (typeof s == "number") return w(s);
325
+ if (typeof s == "number") return D(s);
323
326
  if (s instanceof Date) {
324
- let J = w(s.getMinutes());
327
+ let J = D(s.getMinutes());
325
328
  J >= 60 && (s.setHours(s.getHours() + 1), J = 0), s.setMinutes(J, 0, 0);
326
329
  }
327
- }, e = (s, $ = !1) => {
328
- const w = new Date(Date.UTC(s.getFullYear(), s.getMonth(), s.getDate())), J = w.getUTCDay() || 7;
329
- w.setUTCDate(w.getUTCDate() + 4 - J);
330
- const ne = new Date(Date.UTC(w.getUTCFullYear(), 0, 1));
331
- return Math.ceil(((w - ne) / 864e5 + 1) / 7) + ($ ? 1 : 0);
332
- }, C = (s) => `${s.getFullYear()}-${s.getMonth()}-${s.getDate()}` === l(), j = (s, $) => {
333
- if (!s || !$) return console.warn(`Vue Cal: missing date${s ? "2" : "1"} parameter for comparison with \`isSameDate(date1, date2)\`.`);
334
- if (F(s)) {
335
- if (!F($)) return console.warn(`Vue Cal: invalid date2 provided for comparison with \`isSameDate(date1, date2)\`: \`${$}\`.`);
330
+ }, e = (s, k = !1) => {
331
+ const D = new Date(Date.UTC(s.getFullYear(), s.getMonth(), s.getDate())), J = D.getUTCDay() || 7;
332
+ D.setUTCDate(D.getUTCDate() + 4 - J);
333
+ const ne = new Date(Date.UTC(D.getUTCFullYear(), 0, 1));
334
+ return Math.ceil(((D - ne) / 864e5 + 1) / 7) + (k ? 1 : 0);
335
+ }, z = (s) => `${s.getFullYear()}-${s.getMonth()}-${s.getDate()}` === l(), H = (s, k) => {
336
+ if (!s || !k) return console.warn(`Vue Cal: missing date${s ? "2" : "1"} parameter for comparison with \`isSameDate(date1, date2)\`.`);
337
+ if (O(s)) {
338
+ if (!O(k)) return console.warn(`Vue Cal: invalid date2 provided for comparison with \`isSameDate(date1, date2)\`: \`${k}\`.`);
336
339
  } else return console.warn(`Vue Cal: invalid date1 provided for comparison with \`isSameDate(date1, date2)\`: \`${s}\`.`);
337
- return s.getFullYear() === $.getFullYear() && s.getMonth() === $.getMonth() && s.getDate() === $.getDate();
338
- }, y = (s, $, w) => F(s) ? s.getTime() >= $ && s.getTime() <= w : console.warn(`Vue Cal: invalid date provided to \`isInRange(date, rangeStart, rangeEnd)\`: \`${s}\`.`), v = (s) => {
339
- const $ = s.getFullYear();
340
- return !($ % 400) || $ % 100 && !($ % 4);
341
- }, D = (s = null, $) => {
342
- const w = s && new Date(s.valueOf()) || /* @__PURE__ */ new Date(), J = $ ? 7 : 6;
343
- return w.setDate(w.getDate() - (w.getDay() + J) % 7), w;
344
- }, d = (s) => s instanceof Date ? s : (s.length === 10 && (s += " 00:00"), new Date(s.replace(/-/g, "/"))), i = (s) => s.getHours() * 60 + s.getMinutes(), k = (s, $) => {
345
- typeof s == "string" && (s = s.replace(/-/g, "/")), typeof $ == "string" && ($ = $.replace(/-/g, "/")), s = new Date(s).setHours(0, 0, 0, 0), $ = new Date($).setHours(0, 0, 1, 0);
346
- const w = (new Date($).getTimezoneOffset() - new Date(s).getTimezoneOffset()) * 60 * 1e3;
347
- return Math.ceil(($ - s - w) / (24 * 3600 * 1e3));
348
- }, a = (s, $, w) => Math.abs(s.getTime() - $.getTime()) <= w * 60 * 1e3, F = (s) => s && s instanceof Date && !isNaN(s), q = (s, $ = "YYYY-MM-DD", w = null) => {
349
- if (w || (w = f.value), $ || ($ = "YYYY-MM-DD"), $ === "YYYY-MM-DD") return K(s);
350
- Y = {}, W = {};
340
+ return s.getFullYear() === k.getFullYear() && s.getMonth() === k.getMonth() && s.getDate() === k.getDate();
341
+ }, Y = (s, k, D) => O(s) ? s.getTime() >= k && s.getTime() <= D : console.warn(`Vue Cal: invalid date provided to \`isInRange(date, rangeStart, rangeEnd)\`: \`${s}\`.`), _ = (s) => {
342
+ const k = s.getFullYear();
343
+ return !(k % 400) || k % 100 && !(k % 4);
344
+ }, v = (s = null, k) => {
345
+ const D = s && new Date(s.valueOf()) || /* @__PURE__ */ new Date(), J = k ? 7 : 6;
346
+ return D.setDate(D.getDate() - (D.getDay() + J) % 7), D;
347
+ }, c = (s) => s instanceof Date ? s : (s.length === 10 && (s += " 00:00"), new Date(s.replace(/-/g, "/"))), u = (s) => s.getHours() * 60 + s.getMinutes(), p = (s, k) => {
348
+ typeof s == "string" && (s = s.replace(/-/g, "/")), typeof k == "string" && (k = k.replace(/-/g, "/")), s = new Date(s).setHours(0, 0, 0, 0), k = new Date(k).setHours(0, 0, 1, 0);
349
+ const D = (new Date(k).getTimezoneOffset() - new Date(s).getTimezoneOffset()) * 60 * 1e3;
350
+ return Math.ceil((k - s - D) / (24 * 3600 * 1e3));
351
+ }, a = (s, k, D) => Math.abs(s.getTime() - k.getTime()) <= D * 60 * 1e3, O = (s) => s && s instanceof Date && !isNaN(s), X = (s, k = "YYYY-MM-DD", D = null) => {
352
+ if (D || (D = f.value), k || (k = "YYYY-MM-DD"), k === "YYYY-MM-DD") return U(s);
353
+ C = {}, B = {};
351
354
  const J = {
352
- YYYY: () => ae(s, w).YYYY,
353
- YY: () => ae(s, w).YY(),
354
- M: () => ae(s, w).M,
355
- MM: () => ae(s, w).MM(),
356
- MMM: () => ae(s, w).MMM(),
357
- MMMM: () => ae(s, w).MMMM(),
358
- MMMMG: () => ae(s, w).MMMMG(),
359
- D: () => ae(s, w).D,
360
- DD: () => ae(s, w).DD(),
361
- S: () => ae(s, w).S(),
362
- d: () => ae(s, w).d,
363
- dd: () => ae(s, w).dd(),
364
- ddd: () => ae(s, w).ddd(),
365
- dddd: () => ae(s, w).dddd(),
366
- HH: () => ve(s, w).HH,
367
- H: () => ve(s, w).H,
368
- hh: () => ve(s, w).hh,
369
- h: () => ve(s, w).h,
370
- am: () => ve(s, w).am,
371
- AM: () => ve(s, w).AM,
372
- mm: () => ve(s, w).mm,
373
- m: () => ve(s, w).m,
374
- s: () => ve(s, w).s
355
+ YYYY: () => ae(s, D).YYYY,
356
+ YY: () => ae(s, D).YY(),
357
+ M: () => ae(s, D).M,
358
+ MM: () => ae(s, D).MM(),
359
+ MMM: () => ae(s, D).MMM(),
360
+ MMMM: () => ae(s, D).MMMM(),
361
+ MMMMG: () => ae(s, D).MMMMG(),
362
+ D: () => ae(s, D).D,
363
+ DD: () => ae(s, D).DD(),
364
+ S: () => ae(s, D).S(),
365
+ d: () => ae(s, D).d,
366
+ dd: () => ae(s, D).dd(),
367
+ ddd: () => ae(s, D).ddd(),
368
+ dddd: () => ae(s, D).dddd(),
369
+ HH: () => ve(s, D).HH,
370
+ H: () => ve(s, D).H,
371
+ hh: () => ve(s, D).hh,
372
+ h: () => ve(s, D).h,
373
+ am: () => ve(s, D).am,
374
+ AM: () => ve(s, D).AM,
375
+ mm: () => ve(s, D).mm,
376
+ m: () => ve(s, D).m,
377
+ s: () => ve(s, D).s
375
378
  };
376
- return $.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (ne, fe) => {
377
- const o = J[fe.replace(/\{|\}/g, "")];
378
- return o !== void 0 ? o() : fe;
379
+ return k.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (ne, me) => {
380
+ const o = J[me.replace(/\{|\}/g, "")];
381
+ return o !== void 0 ? o() : me;
379
382
  });
380
- }, K = (s) => {
381
- const $ = s.getMonth() + 1, w = s.getDate();
382
- return `${s.getFullYear()}-${$ < 10 ? "0" : ""}${$}-${w < 10 ? "0" : ""}${w}`;
383
- }, x = (s, $ = "HH:mm", w = null, J = !1) => {
383
+ }, U = (s) => {
384
+ const k = s.getMonth() + 1, D = s.getDate();
385
+ return `${s.getFullYear()}-${k < 10 ? "0" : ""}${k}-${D < 10 ? "0" : ""}${D}`;
386
+ }, K = (s, k = "HH:mm", D = null, J = !1) => {
384
387
  let ne = !1;
385
388
  if (J) {
386
- const [b, E, _] = [s.getHours(), s.getMinutes(), s.getSeconds()];
387
- b + E + _ === 141 && (ne = !0);
389
+ const [T, M, w] = [s.getHours(), s.getMinutes(), s.getSeconds()];
390
+ T + M + w === 141 && (ne = !0);
388
391
  }
389
- if (s instanceof Date && $ === "HH:mm") return ne ? "24:00" : te(s);
390
- W = {}, w || (w = f.value);
391
- const fe = ve(s, w), o = $.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (b, E) => {
392
- const _ = fe[E.replace(/\{|\}/g, "")];
393
- return _ !== void 0 ? _ : E;
392
+ if (s instanceof Date && k === "HH:mm") return ne ? "24:00" : te(s);
393
+ B = {}, D || (D = f.value);
394
+ const me = ve(s, D), o = k.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (T, M) => {
395
+ const w = me[M.replace(/\{|\}/g, "")];
396
+ return w !== void 0 ? w : M;
394
397
  });
395
398
  return ne ? o.replace("23:59", "24:00") : o;
396
399
  }, te = (s) => {
397
- const $ = s.getHours(), w = s.getMinutes();
398
- return `${($ < 10 ? "0" : "") + $}:${(w < 10 ? "0" : "") + w}`;
399
- }, X = (s) => {
400
- const $ = Math.floor(s / 60).toString().padStart(2, 0), w = (s % 60).toString().padStart(2, 0);
401
- return `${$}:${w}`;
400
+ const k = s.getHours(), D = s.getMinutes();
401
+ return `${(k < 10 ? "0" : "") + k}:${(D < 10 ? "0" : "") + D}`;
402
+ }, q = (s) => {
403
+ const k = Math.floor(s / 60).toString().padStart(2, 0), D = (s % 60).toString().padStart(2, 0);
404
+ return `${k}:${D}`;
402
405
  }, le = (s) => {
403
406
  if (s > 3 && s < 21) return "th";
404
407
  switch (s % 10) {
@@ -411,25 +414,25 @@ const lt = (h, t) => {
411
414
  default:
412
415
  return "th";
413
416
  }
414
- }, ae = (s, $) => {
415
- if (Y.D) return Y;
416
- const w = s.getFullYear(), J = s.getMonth() + 1, ne = s.getDate(), o = (s.getDay() - 1 + 7) % 7;
417
- return Y = {
417
+ }, ae = (s, k) => {
418
+ if (C.D) return C;
419
+ const D = s.getFullYear(), J = s.getMonth() + 1, ne = s.getDate(), o = (s.getDay() - 1 + 7) % 7;
420
+ return C = {
418
421
  // Year.
419
- YYYY: w,
422
+ YYYY: D,
420
423
  // 2024.
421
- YY: () => w.toString().substring(2),
424
+ YY: () => D.toString().substring(2),
422
425
  // 24.
423
426
  // Month.
424
427
  M: J,
425
428
  // 1 to 12.
426
429
  MM: () => J.toString().padStart(2, 0),
427
430
  // 01 to 12.
428
- MMM: () => $.months[J - 1].substring(0, 3),
431
+ MMM: () => k.months[J - 1].substring(0, 3),
429
432
  // Jan to Dec.
430
- MMMM: () => $.months[J - 1],
433
+ MMMM: () => k.months[J - 1],
431
434
  // January to December.
432
- MMMMG: () => ($.monthsGenitive || $.months)[J - 1],
435
+ MMMMG: () => (k.monthsGenitive || k.months)[J - 1],
433
436
  // January to December in genitive form (Greek...)
434
437
  // Day.
435
438
  D: ne,
@@ -442,63 +445,63 @@ const lt = (h, t) => {
442
445
  d: o + 1,
443
446
  // 1 to 7 with 7 = Sunday.
444
447
  // Some locales have same start for all the days, so they have specific abbrev in weekDaysShort.
445
- dd: () => $.weekDaysShort.length ? $.weekDaysShort[o] : $.weekDays[o][0],
448
+ dd: () => k.weekDaysShort.length ? k.weekDaysShort[o] : k.weekDays[o][0],
446
449
  // M to S.
447
- ddd: () => $.weekDaysShort.length ? $.weekDaysShort[o] : $.weekDays[o].substr(0, 3),
450
+ ddd: () => k.weekDaysShort.length ? k.weekDaysShort[o] : k.weekDays[o].substr(0, 3),
448
451
  // Mon to Sun.
449
- dddd: () => $.weekDays[o]
452
+ dddd: () => k.weekDays[o]
450
453
  // Monday to Sunday.
451
- }, Y;
452
- }, ve = (s, $) => {
453
- if (W.am) return W;
454
- let w, J, ne;
455
- s instanceof Date ? (w = s.getHours(), J = s.getMinutes(), ne = s.getSeconds()) : (w = Math.floor(s / 60), J = Math.floor(s % 60));
456
- const fe = w % 12 ? w % 12 : 12, o = ($ || { am: "am", pm: "pm" })[w === 24 || w < 12 ? "am" : "pm"];
457
- return W = {
458
- H: w,
459
- h: fe,
460
- HH: w.toString().padStart(2, 0),
461
- hh: fe.toString().padStart(2, 0),
454
+ }, C;
455
+ }, ve = (s, k) => {
456
+ if (B.am) return B;
457
+ let D, J, ne;
458
+ s instanceof Date ? (D = s.getHours(), J = s.getMinutes(), ne = s.getSeconds()) : (D = Math.floor(s / 60), J = Math.floor(s % 60));
459
+ const me = D % 12 ? D % 12 : 12, o = (k || { am: "am", pm: "pm" })[D === 24 || D < 12 ? "am" : "pm"];
460
+ return B = {
461
+ H: D,
462
+ h: me,
463
+ HH: D.toString().padStart(2, 0),
464
+ hh: me.toString().padStart(2, 0),
462
465
  am: o,
463
466
  AM: o.toUpperCase(),
464
467
  m: J,
465
468
  mm: J.toString().padStart(2, 0),
466
469
  s: ne
467
- }, W;
470
+ }, B;
468
471
  };
469
472
  return {
470
- addDatePrototypes: L,
471
- removeDatePrototypes: U,
472
- updateTexts: P,
473
- addDays: z,
474
- subtractDays: A,
473
+ addDatePrototypes: A,
474
+ removeDatePrototypes: Z,
475
+ updateTexts: L,
476
+ addDays: E,
477
+ subtractDays: F,
475
478
  addHours: m,
476
- subtractHours: u,
479
+ subtractHours: i,
477
480
  addMinutes: S,
478
481
  subtractMinutes: n,
479
482
  snapToInterval: I,
480
483
  getWeek: e,
481
- isToday: C,
482
- isSameDate: j,
483
- isInRange: y,
484
- isLeapYear: v,
485
- getPreviousFirstDayOfWeek: D,
486
- stringToDate: d,
487
- dateToMinutes: i,
488
- countDays: k,
484
+ isToday: z,
485
+ isSameDate: H,
486
+ isInRange: Y,
487
+ isLeapYear: _,
488
+ getPreviousFirstDayOfWeek: v,
489
+ stringToDate: c,
490
+ dateToMinutes: u,
491
+ countDays: p,
489
492
  datesInSameTimeStep: a,
490
- isValid: F,
491
- formatDate: q,
492
- formatDateLite: K,
493
- formatTime: x,
493
+ isValid: O,
494
+ formatDate: X,
495
+ formatDateLite: U,
496
+ formatTime: K,
494
497
  formatTimeLite: te,
495
- formatMinutes: X
498
+ formatMinutes: q
496
499
  };
497
- }, Ot = (h) => {
498
- const { dateUtils: t, config: c } = h;
500
+ }, Vt = (y) => {
501
+ const { dateUtils: t, config: d } = y;
499
502
  let r = 0;
500
- const p = M(() => {
501
- var j, y, v, D, d;
503
+ const h = b(() => {
504
+ var H, Y, _, v, c;
502
505
  const e = {
503
506
  // A map of events indexed by { YYYY: { MM: { DD: [] } } }.
504
507
  // Each year contains a map of 12 months starting from 1, each containing a map of days starting from 1, each containing an array of event IDs.
@@ -511,153 +514,153 @@ const lt = (h, t) => {
511
514
  // An array of events IDs that are multiday.
512
515
  byId: {}
513
516
  // A map of all the events indexed by ID for fast lookup. Each event is the original full event object.
514
- }, C = c.events.slice().sort((i, k) => i.start - k.start < 0 ? -1 : 1);
515
- for (let i of C) {
516
- const k = typeof i.start == "string" || typeof i.end == "string", a = !((j = i._) != null && j.register) || !i.isOverlapping || !i.delete;
517
- let F = !1;
518
- if (!k && ((y = i._) != null && y.cachedStart) && ((v = i._) != null && v.cachedEnd) && (F = i.start.getTime() !== ((D = i._) == null ? void 0 : D.cachedStart) || i.end.getTime() !== ((d = i._) == null ? void 0 : d.cachedEnd)), k || a || F) {
519
- if (!Y(i)) continue;
520
- W(i), i._.cachedStart = i.start.getTime(), i._.cachedEnd = i.end.getTime();
517
+ }, z = d.events.slice().sort((u, p) => u.start - p.start < 0 ? -1 : 1);
518
+ for (let u of z) {
519
+ const p = typeof u.start == "string" || typeof u.end == "string", a = !((H = u._) != null && H.register) || !u.isOverlapping || !u.delete;
520
+ let O = !1;
521
+ if (!p && ((Y = u._) != null && Y.cachedStart) && ((_ = u._) != null && _.cachedEnd) && (O = u.start.getTime() !== ((v = u._) == null ? void 0 : v.cachedStart) || u.end.getTime() !== ((c = u._) == null ? void 0 : c.cachedEnd)), p || a || O) {
522
+ if (!C(u)) continue;
523
+ B(u), u._.cachedStart = u.start.getTime(), u._.cachedEnd = u.end.getTime();
521
524
  }
522
- if (e.byId[i._.id] = i, i.recurring)
523
- e.recurring.push(i._.id);
524
- else if (!t.isSameDate(i.start, new Date(i.end.getTime() - 1)))
525
- i._.multiday = c.multidayEvents, c.multidayEvents ? e.multiday.push(i._.id) : (console.info("Vue Cal: Multi-day events provided without being enabled. Truncating event end to next midnight."), i.end = new Date(new Date(i.start).setHours(23, 59, 59, 999)), W(i)), e.byDate[i._.startFormatted] || (e.byDate[i._.startFormatted] = []), e.byDate[i._.startFormatted].push(i._.id);
525
+ if (e.byId[u._.id] = u, u.recurring)
526
+ e.recurring.push(u._.id);
527
+ else if (!t.isSameDate(u.start, new Date(u.end.getTime() - 1)))
528
+ u._.multiday = d.multidayEvents, d.multidayEvents ? e.multiday.push(u._.id) : (console.info("Vue Cal: Multi-day events provided without being enabled. Truncating event end to next midnight."), u.end = new Date(new Date(u.start).setHours(23, 59, 59, 999)), B(u)), e.byDate[u._.startFormatted] || (e.byDate[u._.startFormatted] = []), e.byDate[u._.startFormatted].push(u._.id);
526
529
  else {
527
- e.byDate[i._.startFormatted] || (e.byDate[i._.startFormatted] = []), e.byDate[i._.startFormatted].push(i._.id);
528
- const q = i._.startFormatted.substring(0, 4), K = i._.startFormatted.substring(5, 7), x = i._.startFormatted.substring(8, 10);
529
- e.byYear[q] || (e.byYear[q] = {}), e.byYear[q][K] || (e.byYear[q][K] = {}), e.byYear[q][K][x] || (e.byYear[q][K][x] = []), e.byYear[q][K][x].push(i._.id);
530
+ e.byDate[u._.startFormatted] || (e.byDate[u._.startFormatted] = []), e.byDate[u._.startFormatted].push(u._.id);
531
+ const X = u._.startFormatted.substring(0, 4), U = u._.startFormatted.substring(5, 7), K = u._.startFormatted.substring(8, 10);
532
+ e.byYear[X] || (e.byYear[X] = {}), e.byYear[X][U] || (e.byYear[X][U] = {}), e.byYear[X][U][K] || (e.byYear[X][U][K] = []), e.byYear[X][U][K].push(u._.id);
530
533
  }
531
534
  }
532
535
  return e;
533
- }), Y = (e) => !e.start || !e.end ? (console.error("Vue Cal: Event is missing start or end date", e), !1) : (typeof e.start == "string" && (e.start = t.stringToDate(e.start)), typeof e.end == "string" && (e.end = t.stringToDate(e.end)), e.start.setSeconds(0, 0), e.end.getSeconds() === 59 ? e.end.setMinutes(e.end.getMinutes() + 1, 0, 0) : e.end.setSeconds(0, 0), isNaN(e.start) || isNaN(e.end) || e.end.getTime() < e.start.getTime() ? (isNaN(e.start) ? console.error(`Vue Cal: invalid start date for event "${e.title}".`, e.start) : isNaN(e.end) ? console.error(`Vue Cal: invalid end date for event "${e.title}".`, e.end) : console.error(`Vue Cal: invalid event dates for event "${e.title}". The event ends before it starts.`, e.start, e.end), !1) : !0), W = (e) => {
536
+ }), C = (e) => !e.start || !e.end ? (console.error("Vue Cal: Event is missing start or end date", e), !1) : (typeof e.start == "string" && (e.start = t.stringToDate(e.start)), typeof e.end == "string" && (e.end = t.stringToDate(e.end)), e.start.setSeconds(0, 0), e.end.getSeconds() === 59 ? e.end.setMinutes(e.end.getMinutes() + 1, 0, 0) : e.end.setSeconds(0, 0), isNaN(e.start) || isNaN(e.end) || e.end.getTime() < e.start.getTime() ? (isNaN(e.start) ? console.error(`Vue Cal: invalid start date for event "${e.title}".`, e.start) : isNaN(e.end) ? console.error(`Vue Cal: invalid end date for event "${e.title}".`, e.end) : console.error(`Vue Cal: invalid event dates for event "${e.title}". The event ends before it starts.`, e.start, e.end), !1) : !0), B = (e) => {
534
537
  e._ || (e._ = {}), e._.id = e._.id || ++r, e._.multiday = !t.isSameDate(e.start, new Date(e.end.getTime() - 1)), e._.startFormatted = t.formatDate(e.start), e._.endFormatted = t.formatDate(e.end), e._.startMinutes = ~~t.dateToMinutes(e.start), e._.endMinutes = ~~t.dateToMinutes(e.end);
535
- const C = e.start.getHours(), j = e.start.getMinutes().toString().padStart(2, 0), y = e.end.getHours(), v = e.end.getMinutes().toString().padStart(2, 0);
536
- e._.startTimeFormatted24 = `${C.toString().padStart(2, 0)}:${j}`, e._.startTimeFormatted12 = `${C % 12 || 12}${j ? `:${j}` : ""} ${C < 12 ? "AM" : "PM"}`, e._.endTimeFormatted24 = `${y.toString().padStart(2, 0)}:${v}`, e._.endTimeFormatted12 = `${y % 12 || 12}${v ? `:${v}` : ""} ${y < 12 ? "AM" : "PM"}`, e._.duration = Math.abs(~~((e.end - e.start) / 6e4)), e.delete || (e.delete = function(D) {
537
- return P(this._.id, D);
538
- }), e._.deleting === void 0 && (e._.deleting = !1), e._.deleted === void 0 && (e._.deleted = !1), e.isOverlapping || (e.isOverlapping = function(D = null) {
539
- return this.getOverlappingEvents(D).length;
540
- }), e.getOverlappingEvents || (e.getOverlappingEvents = function(D = null) {
538
+ const z = e.start.getHours(), H = e.start.getMinutes().toString().padStart(2, 0), Y = e.end.getHours(), _ = e.end.getMinutes().toString().padStart(2, 0);
539
+ e._.startTimeFormatted24 = `${z.toString().padStart(2, 0)}:${H}`, e._.startTimeFormatted12 = `${z % 12 || 12}${H ? `:${H}` : ""} ${z < 12 ? "AM" : "PM"}`, e._.endTimeFormatted24 = `${Y.toString().padStart(2, 0)}:${_}`, e._.endTimeFormatted12 = `${Y % 12 || 12}${_ ? `:${_}` : ""} ${Y < 12 ? "AM" : "PM"}`, e._.duration = Math.abs(~~((e.end - e.start) / 6e4)), e.delete || (e.delete = function(v) {
540
+ return L(this._.id, v);
541
+ }), e._.deleting === void 0 && (e._.deleting = !1), e._.deleted === void 0 && (e._.deleted = !1), e.isOverlapping || (e.isOverlapping = function(v = null) {
542
+ return this.getOverlappingEvents(v).length;
543
+ }), e.getOverlappingEvents || (e.getOverlappingEvents = function(v = null) {
541
544
  var a;
542
- const d = (D == null ? void 0 : D.start) || this.start, i = (D == null ? void 0 : D.end) || this.end, k = (a = c.schedules) != null && a.length ? ~~((D == null ? void 0 : D.schedule) || this.schedule) : null;
543
- return z(d, i, { excludeIds: [this._.id], schedule: k });
544
- }), e._.register || (e._.register = (D) => {
545
- e._.$el = D, e._.fireCreated && (h.emit("event-created", e), delete e._.fireCreated);
545
+ const c = (v == null ? void 0 : v.start) || this.start, u = (v == null ? void 0 : v.end) || this.end, p = (a = d.schedules) != null && a.length ? ~~((v == null ? void 0 : v.schedule) || this.schedule) : null;
546
+ return E(c, u, { excludeIds: [this._.id], schedule: p });
547
+ }), e._.register || (e._.register = (v) => {
548
+ e._.$el = v, e._.fireCreated && (y.emit("event-created", e), delete e._.fireCreated);
546
549
  }), e._.unregister || (e._.unregister = () => {
547
550
  e._.$el = null, e._.register = null, e.isOverlapping = null, e.getOverlappingEvents = null, e.delete = null;
548
551
  });
549
- }, f = (e) => p.value.byId[e], L = (e) => {
550
- const C = [];
551
- for (const { start: j, end: y } of e) {
552
- const v = z(j, y);
553
- v.length && C.push(...v);
552
+ }, f = (e) => h.value.byId[e], A = (e) => {
553
+ const z = [];
554
+ for (const { start: H, end: Y } of e) {
555
+ const _ = E(H, Y);
556
+ _.length && z.push(..._);
554
557
  }
555
- return C;
556
- }, U = (e) => {
558
+ return z;
559
+ }, Z = (e) => {
557
560
  if (!e.start || !e.end) {
558
561
  console.error("Vue Cal: Cannot create an event without valid start and end dates.");
559
562
  return;
560
563
  }
561
- return c.snapToInterval && (t.snapToInterval(e.start, c.snapToInterval), t.snapToInterval(e.end, c.snapToInterval)), e = { ...e }, e._ || (e._ = {}), e._.id = ++r, e._.fireCreated = !0, c.events.push(e), e;
562
- }, P = async (e, C = 0) => {
563
- var d, i;
564
+ return d.snapToInterval && (t.snapToInterval(e.start, d.snapToInterval), t.snapToInterval(e.end, d.snapToInterval)), e = { ...e }, e._ || (e._ = {}), e._.id = ++r, e._.fireCreated = !0, d.events.push(e), e;
565
+ }, L = async (e, z = 0) => {
566
+ var c, u;
564
567
  if (!e) return console.warn("Vue Cal: Cannot delete event without its ID or criteria.");
565
- let j = typeof e == "string" || !isNaN(e) ? e : null;
566
- const y = typeof e == "object" ? Object.entries(e) : null;
567
- if (y) {
568
- const [k, a] = y[0];
569
- j = (d = c.events.find((F) => F[k] === a)) == null ? void 0 : d._.id;
568
+ let H = typeof e == "string" || !isNaN(e) ? e : null;
569
+ const Y = typeof e == "object" ? Object.entries(e) : null;
570
+ if (Y) {
571
+ const [p, a] = Y[0];
572
+ H = (c = d.events.find((O) => O[p] === a)) == null ? void 0 : c._.id;
570
573
  }
571
- if (!c.editableEvents.delete)
574
+ if (!d.editableEvents.delete)
572
575
  return console.info("Vue Cal: Event deletion is disabled. Enable it with the `editable-events` props.");
573
- if (!j) return console.warn("Vue Cal: Cannot delete event without its ID.");
574
- const v = c.events.findIndex((k) => k._.id === j);
575
- if (v === -1) return console.warn(`Vue Cal: Cannot delete unknown event \`${j}\`.`);
576
- const D = c.events[v];
577
- if (D.deletable === !1) return console.warn(`Vue Cal: Can't delete event \`${j}\` since it was explicitely set to \`delete: false\`.`);
578
- switch (C) {
576
+ if (!H) return console.warn("Vue Cal: Cannot delete event without its ID.");
577
+ const _ = d.events.findIndex((p) => p._.id === H);
578
+ if (_ === -1) return console.warn(`Vue Cal: Cannot delete unknown event \`${H}\`.`);
579
+ const v = d.events[_];
580
+ if (v.deletable === !1) return console.warn(`Vue Cal: Can't delete event \`${H}\` since it was explicitely set to \`delete: false\`.`);
581
+ switch (z) {
579
582
  case 0:
580
- D._.deleting ? c.events.splice(v, 1) : D._.deleting = !0;
583
+ v._.deleting ? d.events.splice(_, 1) : v._.deleting = !0;
581
584
  break;
582
585
  // Display the delete button.
583
586
  case 1:
584
- D._.deleting = !0;
587
+ v._.deleting = !0;
585
588
  break;
586
589
  // Visual deletion + external DOM event firing.
587
590
  // When explicitly using this stage, the event will be visually deleted but still present in the
588
591
  // source of truth until the cell is unmounted (by navigating away).
589
592
  case 2:
590
- D._.deleted = !0, c.events[v]._.deleted = !0, (i = D._.$el) == null || i.dispatchEvent(new CustomEvent("event-deleted", { detail: D._.id }));
593
+ v._.deleted = !0, d.events[_]._.deleted = !0, (u = v._.$el) == null || u.dispatchEvent(new CustomEvent("event-deleted", { detail: v._.id }));
591
594
  break;
592
595
  // Effective deletion from the source of truth (by default, when unmounting the cell).
593
596
  case 3:
594
- c.events.splice(v, 1), h.emit("update:events", c.events), h.emit("event-delete", D);
597
+ d.events.splice(_, 1), y.emit("update:events", d.events), y.emit("event-delete", v);
595
598
  break;
596
599
  }
597
600
  return !0;
598
- }, l = (e, C, j) => {
599
- const y = c.allDayEvents ? { allDay: j } : {}, v = z(e, C, { background: !1, ...y });
600
- if (!v.length) return { cellOverlaps: {}, longestStreak: 0 };
601
- const D = {};
602
- let d = [], i = 0;
603
- v.sort((k, a) => k.start - a.start || k.end - k.start - (a.end - a.start));
604
- for (const k of v) {
605
- const a = k._.id;
606
- D[a] || (D[a] = { overlaps: /* @__PURE__ */ new Set(), maxConcurrent: 1, position: 0 }), d = d.filter((te) => te.end > k.start);
607
- const F = d.filter((te) => {
601
+ }, l = (e, z, H) => {
602
+ const Y = d.allDayEvents ? { allDay: H } : {}, _ = E(e, z, { background: !1, ...Y });
603
+ if (!_.length) return { cellOverlaps: {}, longestStreak: 0 };
604
+ const v = {};
605
+ let c = [], u = 0;
606
+ _.sort((p, a) => p.start - a.start || p.end - p.start - (a.end - a.start));
607
+ for (const p of _) {
608
+ const a = p._.id;
609
+ v[a] || (v[a] = { overlaps: /* @__PURE__ */ new Set(), maxConcurrent: 1, position: 0 }), c = c.filter((te) => te.end > p.start);
610
+ const O = c.filter((te) => {
608
611
  var le;
609
- return (!((le = c.schedules) != null && le.length) || k.schedule === te.schedule) && te.start < k.end;
610
- }), q = new Set(F.map((te) => {
611
- var X;
612
- return ((X = D[te._.id]) == null ? void 0 : X.position) ?? 0;
612
+ return (!((le = d.schedules) != null && le.length) || p.schedule === te.schedule) && te.start < p.end;
613
+ }), X = new Set(O.map((te) => {
614
+ var q;
615
+ return ((q = v[te._.id]) == null ? void 0 : q.position) ?? 0;
613
616
  }));
614
- let K = 0;
615
- for (; q.has(K); ) K++;
616
- D[a].position = K, d.push(k);
617
- const x = Math.max(1, ...F.map((te) => {
618
- var X;
619
- return ((X = D[te._.id]) == null ? void 0 : X.maxConcurrent) ?? 1;
617
+ let U = 0;
618
+ for (; X.has(U); ) U++;
619
+ v[a].position = U, c.push(p);
620
+ const K = Math.max(1, ...O.map((te) => {
621
+ var q;
622
+ return ((q = v[te._.id]) == null ? void 0 : q.maxConcurrent) ?? 1;
620
623
  }));
621
- D[a].maxConcurrent = Math.max(F.length + 1, x);
622
- for (const te of F)
623
- D[te._.id].overlaps.add(a), D[a].overlaps.add(te._.id), D[te._.id].maxConcurrent = D[a].maxConcurrent;
624
- i = Math.max(i, D[a].maxConcurrent);
624
+ v[a].maxConcurrent = Math.max(O.length + 1, K);
625
+ for (const te of O)
626
+ v[te._.id].overlaps.add(a), v[a].overlaps.add(te._.id), v[te._.id].maxConcurrent = v[a].maxConcurrent;
627
+ u = Math.max(u, v[a].maxConcurrent);
625
628
  }
626
- for (const k in D) D[k].overlaps = [...D[k].overlaps];
627
- return { cellOverlaps: D, longestStreak: i };
628
- }, z = (e, C, { excludeIds: j = [], schedule: y = null, background: v = !0, allDay: D = !1 } = {}) => {
629
- if (!Object.keys(p.value.byId).length) return [];
630
- const d = e.getFullYear(), i = C.getFullYear(), k = e.getMonth() + 1, a = C.getMonth() + 1, F = e.getDate(), q = C.getDate();
631
- e.getTime(), C.getTime();
632
- const K = e.setHours(0, 0, 0, 0), x = C.setHours(23, 59, 59, 999), te = new Set(j), X = [];
633
- if (Object.keys(p.value.byId).length <= 100) {
634
- for (const le of Object.values(p.value.byId))
635
- !le || te.has(le._.id) || y !== null && y !== le.schedule || v === !1 && le.background || c.allDayEvents && (D && !le.allDay || !D && le.allDay) || le.start.getTime() < x && le.end.getTime() > K && X.push(le);
636
- return X;
629
+ for (const p in v) v[p].overlaps = [...v[p].overlaps];
630
+ return { cellOverlaps: v, longestStreak: u };
631
+ }, E = (e, z, { excludeIds: H = [], schedule: Y = null, background: _ = !0, allDay: v = !1 } = {}) => {
632
+ if (!Object.keys(h.value.byId).length) return [];
633
+ const c = e.getFullYear(), u = z.getFullYear(), p = e.getMonth() + 1, a = z.getMonth() + 1, O = e.getDate(), X = z.getDate();
634
+ e.getTime(), z.getTime();
635
+ const U = new Date(e).setHours(0, 0, 0, 0), K = new Date(z).setHours(23, 59, 59, 999), te = new Set(H), q = [];
636
+ if (Object.keys(h.value.byId).length <= 100) {
637
+ for (const le of Object.values(h.value.byId))
638
+ !le || te.has(le._.id) || Y !== null && Y !== le.schedule || _ === !1 && le.background || d.allDayEvents && (v && !le.allDay || !v && le.allDay) || le.start.getTime() < K && le.end.getTime() > U && q.push(le);
639
+ return q;
637
640
  }
638
- for (let le = d; le <= i; le++) {
639
- const ae = `${le}`, ve = p.value.byYear[ae];
641
+ for (let le = c; le <= u; le++) {
642
+ const ae = `${le}`, ve = h.value.byYear[ae];
640
643
  if (!ve) continue;
641
- const s = le === d ? k : 1, $ = le === i ? a : 12;
642
- for (let w = s; w <= $; w++) {
643
- const J = String(w).padStart(2, "0"), ne = ve[J];
644
+ const s = le === c ? p : 1, k = le === u ? a : 12;
645
+ for (let D = s; D <= k; D++) {
646
+ const J = String(D).padStart(2, "0"), ne = ve[J];
644
647
  if (ne)
645
- for (const fe in ne) {
646
- const o = +fe;
647
- if (o > q || o < F) continue;
648
- const b = ne[fe];
649
- if (b != null && b.length)
650
- for (let E = 0; E < b.length; E++) {
651
- const _ = p.value.byId[b[E]];
652
- !_ || te.has(_._.id) || y !== null && y !== _.schedule || v === !1 && _.background || c.allDayEvents && (D && !_.allDay || !D && _.allDay) || _.start.getTime() < x && _.end.getTime() > K && X.push(_);
648
+ for (const me in ne) {
649
+ const o = +me;
650
+ if (o > X || o < O) continue;
651
+ const T = ne[me];
652
+ if (T != null && T.length)
653
+ for (let M = 0; M < T.length; M++) {
654
+ const w = h.value.byId[T[M]];
655
+ !w || te.has(w._.id) || Y !== null && Y !== w.schedule || _ === !1 && w.background || d.allDayEvents && (v && !w.allDay || !v && w.allDay) || w.start.getTime() < K && w.end.getTime() > U && q.push(w);
653
656
  }
654
657
  }
655
658
  }
656
659
  }
657
- return X;
658
- }, A = (e, C, j) => {
659
- const y = e.allDay || !c.time, v = y ? new Date(e.start).setHours(0, 0, 0, 0) : e.start.getTime(), D = y ? new Date(e.end).setHours(23, 59, 59, 999) : e.end.getTime(), d = y ? new Date(C).setHours(0, 0, 0, 0) : C.getTime(), i = y ? new Date(j).setHours(23, 59, 59, 999) : j.getTime();
660
- return D > d && v < i;
660
+ return q;
661
+ }, F = (e, z, H) => {
662
+ const Y = e.allDay || !d.time, _ = Y ? new Date(e.start).setHours(0, 0, 0, 0) : e.start.getTime(), v = Y ? new Date(e.end).setHours(23, 59, 59, 999) : e.end.getTime(), c = Y ? new Date(z).setHours(0, 0, 0, 0) : z.getTime(), u = Y ? new Date(H).setHours(23, 59, 59, 999) : H.getTime();
663
+ return v > c && _ < u;
661
664
  }, m = be({
662
665
  isResizing: !1,
663
666
  fromResizer: !1,
@@ -677,203 +680,203 @@ const lt = (h, t) => {
677
680
  resizeStartDate: null,
678
681
  cellEl: null,
679
682
  schedule: null
680
- }), u = (e, C) => {
681
- var D;
682
- let j = je(m.movePercentageY, c);
683
- if (j = Math.max(0, Math.min(j, 1440)), c.snapToInterval) {
684
- const d = j + c.snapToInterval / 2;
685
- j = d - d % c.snapToInterval;
683
+ }), i = (e, z) => {
684
+ var v;
685
+ let H = je(m.movePercentageY, d);
686
+ if (H = Math.max(0, Math.min(H, 1440)), d.snapToInterval) {
687
+ const c = H + d.snapToInterval / 2;
688
+ H = c - c % d.snapToInterval;
686
689
  }
687
- let y = e.start, v = new Date(C.getTime() + j * 6e4);
688
- return m.moveX && ((D = h.touch) != null && D.currentHoveredCell) && m.cellEl && new Date(h.touch.currentHoveredCell.__vueParentComponent.props.start), v < m.resizeStartDate && (y = v, v = m.resizeStartDate), { newStart: y, newEnd: v };
690
+ let Y = e.start, _ = new Date(z.getTime() + H * 6e4);
691
+ return m.moveX && ((v = y.touch) != null && v.currentHoveredCell) && m.cellEl && new Date(y.touch.currentHoveredCell.__vueParentComponent.props.start), _ < m.resizeStartDate && (Y = _, _ = m.resizeStartDate), { newStart: Y, newEnd: _ };
689
692
  }, S = async (e) => {
690
- var y, v, D, d, i;
691
- const { clientX: C, clientY: j } = ((y = e.touches) == null ? void 0 : y[0]) || e;
692
- if (m.fromResizer && !((v = h.touch) != null && v.isResizingEvent)) {
693
- m.resizingOriginalEvent = { ...m.resizingEvent, _: { ...m.resizingEvent._ } }, h.touch.isResizingEvent = !0;
694
- const k = ((D = c.eventListeners) == null ? void 0 : D.event) || {};
695
- (d = k["resize-start"]) == null || d.call(k, { e, event: m.resizingEvent });
693
+ var Y, _, v, c, u;
694
+ const { clientX: z, clientY: H } = ((Y = e.touches) == null ? void 0 : Y[0]) || e;
695
+ if (m.fromResizer && !((_ = y.touch) != null && _.isResizingEvent)) {
696
+ m.resizingOriginalEvent = { ...m.resizingEvent, _: { ...m.resizingEvent._ } }, y.touch.isResizingEvent = !0;
697
+ const p = ((v = d.eventListeners) == null ? void 0 : v.event) || {};
698
+ (c = p["resize-start"]) == null || c.call(p, { e, event: m.resizingEvent });
696
699
  }
697
700
  if (m.cellEl) {
698
- const { top: k, left: a, width: F, height: q } = m.cellEl.getBoundingClientRect();
699
- m.moveX = C - a, m.moveY = j - k, m.movePercentageX = m.moveX * 100 / F, m.movePercentageY = m.moveY * 100 / q;
701
+ const { top: p, left: a, width: O, height: X } = m.cellEl.getBoundingClientRect();
702
+ m.moveX = z - a, m.moveY = H - p, m.movePercentageX = m.moveX * 100 / O, m.movePercentageY = m.moveY * 100 / X;
700
703
  }
701
- if (m.documentMouseX = C, m.documentMouseY = j, m.fromResizer && m.resizingEvent) {
702
- const k = m.cellEl.__vueParentComponent.props.start, { newStart: a, newEnd: F } = u(m.resizingEvent, k);
703
- let q = !0;
704
- const { resize: K } = ((i = c.eventListeners) == null ? void 0 : i.event) || {};
705
- K && (q = await K({
704
+ if (m.documentMouseX = z, m.documentMouseY = H, m.fromResizer && m.resizingEvent) {
705
+ const p = m.cellEl.__vueParentComponent.props.start, { newStart: a, newEnd: O } = i(m.resizingEvent, p);
706
+ let X = !0;
707
+ const { resize: U } = ((u = d.eventListeners) == null ? void 0 : u.event) || {};
708
+ U && (X = await U({
706
709
  e,
707
- event: { ...m.resizingEvent, start: a, end: F },
708
- overlaps: m.resizingEvent.getOverlappingEvents({ start: a, end: F })
709
- })), q !== !1 ? (m.resizingEvent.start = a, m.resizingEvent.end = F, m.resizingLastAcceptedEvent && (m.resizingLastAcceptedEvent = null), e.preventDefault()) : K && (m.resizingLastAcceptedEvent = { ...m.resizingEvent, _: { ...m.resizingEvent._ } });
710
+ event: { ...m.resizingEvent, start: a, end: O },
711
+ overlaps: m.resizingEvent.getOverlappingEvents({ start: a, end: O })
712
+ })), X !== !1 ? (m.resizingEvent.start = a, m.resizingEvent.end = O, m.resizingLastAcceptedEvent && (m.resizingLastAcceptedEvent = null), e.preventDefault()) : U && (m.resizingLastAcceptedEvent = { ...m.resizingEvent, _: { ...m.resizingEvent._ } });
710
713
  }
711
714
  }, n = async (e) => {
712
- var C, j, y, v;
713
- if ((C = h.touch) != null && C.isResizingEvent && m.resizingEvent) {
714
- const D = m.cellEl.__vueParentComponent.props.start, { newStart: d, newEnd: i } = u(m.resizingEvent, D);
715
- let k = !0;
716
- const F = (((j = c.eventListeners) == null ? void 0 : j.event) || {})["resize-end"];
717
- F && (k = await F({
715
+ var z, H, Y, _;
716
+ if ((z = y.touch) != null && z.isResizingEvent && m.resizingEvent) {
717
+ const v = m.cellEl.__vueParentComponent.props.start, { newStart: c, newEnd: u } = i(m.resizingEvent, v);
718
+ let p = !0;
719
+ const O = (((H = d.eventListeners) == null ? void 0 : H.event) || {})["resize-end"];
720
+ O && (p = await O({
718
721
  e,
719
722
  event: m.resizingEvent,
720
723
  original: m.resizingOriginalEvent,
721
724
  // Original event details before resizing.
722
- overlaps: m.resizingEvent.getOverlappingEvents({ start: d, end: i })
723
- })), m.resizingEvent.start = k === !1 ? (m.resizingLastAcceptedEvent || m.resizingOriginalEvent).start : ((y = m.resizingLastAcceptedEvent) == null ? void 0 : y.start) || d, m.resizingEvent.end = k === !1 ? (m.resizingLastAcceptedEvent || m.resizingOriginalEvent).end : ((v = m.resizingLastAcceptedEvent) == null ? void 0 : v.end) || i, m.resizingEvent._.duration < 1 && (m.resizingEvent.start = m.resizingOriginalEvent.start, m.resizingEvent.end = m.resizingOriginalEvent.end), h.touch.isResizingEvent = !1, h.touch.currentHoveredCell = null;
725
+ overlaps: m.resizingEvent.getOverlappingEvents({ start: c, end: u })
726
+ })), m.resizingEvent.start = p === !1 ? (m.resizingLastAcceptedEvent || m.resizingOriginalEvent).start : ((Y = m.resizingLastAcceptedEvent) == null ? void 0 : Y.start) || c, m.resizingEvent.end = p === !1 ? (m.resizingLastAcceptedEvent || m.resizingOriginalEvent).end : ((_ = m.resizingLastAcceptedEvent) == null ? void 0 : _.end) || u, m.resizingEvent._.duration < 1 && (m.resizingEvent.start = m.resizingOriginalEvent.start, m.resizingEvent.end = m.resizingOriginalEvent.end), y.touch.isResizingEvent = !1, y.touch.currentHoveredCell = null;
724
727
  }
725
- document.removeEventListener(e.type === "touchend" ? "touchmove" : "mousemove", S, { passive: !m.fromResizer }), h.touch.isResizingEvent = !1, m.fromResizer = !1, m.resizingEvent = null, m.resizingOriginalEvent = null, m.resizingLastAcceptedEvent = null, m.startX = 0, m.startY = 0, m.moveX = 0, m.moveY = 0, m.startPercentageX = 0, m.startPercentageY = 0, m.movePercentageX = 0, m.movePercentageY = 0, m.documentMouseX = 0, m.documentMouseY = 0, m.cellEl = null, m.resizeStartDate = null, m.schedule = null;
728
+ document.removeEventListener(e.type === "touchend" ? "touchmove" : "mousemove", S, { passive: !m.fromResizer }), y.touch.isResizingEvent = !1, m.fromResizer = !1, m.resizingEvent = null, m.resizingOriginalEvent = null, m.resizingLastAcceptedEvent = null, m.startX = 0, m.startY = 0, m.moveX = 0, m.moveY = 0, m.startPercentageX = 0, m.startPercentageY = 0, m.movePercentageX = 0, m.movePercentageY = 0, m.documentMouseX = 0, m.documentMouseY = 0, m.cellEl = null, m.resizeStartDate = null, m.schedule = null;
726
729
  };
727
730
  return {
728
- events: p,
731
+ events: h,
729
732
  resizeState: m,
730
733
  getEvent: f,
731
- getViewEvents: L,
734
+ getViewEvents: A,
732
735
  getCellOverlappingEvents: l,
733
- getEventsInRange: z,
734
- createEvent: U,
735
- deleteEvent: P,
736
- isEventInRange: A,
737
- handleEventResize: (e, C, j) => {
738
- var v;
739
- const y = ((v = e.touches) == null ? void 0 : v[0]) || e;
740
- if (m.fromResizer = !!y.target.closest(".vuecal__event-resizer"), m.fromResizer) {
741
- const D = j.getBoundingClientRect();
742
- m.startX = y.clientX - D.left, m.startY = y.clientY - D.top, m.startPercentageX = m.startX * 100 / D.width, m.startPercentageY = m.startY * 100 / D.height, m.cellEl = j.closest(".vuecal__cell"), m.resizeStartDate = C.start, m.resizingEvent = C, document.addEventListener(e.type === "touchstart" ? "touchmove" : "mousemove", S, { passive: !m.fromResizer }), document.addEventListener(e.type === "touchstart" ? "touchend" : "mouseup", n, { once: !0 });
736
+ getEventsInRange: E,
737
+ createEvent: Z,
738
+ deleteEvent: L,
739
+ isEventInRange: F,
740
+ handleEventResize: (e, z, H) => {
741
+ var _;
742
+ const Y = ((_ = e.touches) == null ? void 0 : _[0]) || e;
743
+ if (m.fromResizer = !!Y.target.closest(".vuecal__event-resizer"), m.fromResizer) {
744
+ const v = H.getBoundingClientRect();
745
+ m.startX = Y.clientX - v.left, m.startY = Y.clientY - v.top, m.startPercentageX = m.startX * 100 / v.width, m.startPercentageY = m.startY * 100 / v.height, m.cellEl = H.closest(".vuecal__cell"), m.resizeStartDate = z.start, m.resizingEvent = z, document.addEventListener(e.type === "touchstart" ? "touchmove" : "mousemove", S, { passive: !m.fromResizer }), document.addEventListener(e.type === "touchstart" ? "touchend" : "mouseup", n, { once: !0 });
743
746
  }
744
747
  }
745
748
  };
746
- }, Vt = ({ config: h, dateUtils: t, emit: c, texts: r, eventsManager: p }, Y) => {
747
- const { availableViews: W } = h, f = ce(h.view && W[h.view] ? h.view : h.defaultView), L = ce(h.selectedDate || null), U = ce(/* @__PURE__ */ new Date()), P = ce(new Date(h.viewDate || U.value));
748
- P.value.setHours(0, 0, 0, 0);
749
- const l = ce(new Date(P));
750
- let z = null;
751
- const A = M(() => f.value === "month" ? l.value : v.value), m = M(() => f.value === "month" ? new Date(l.value.getFullYear(), l.value.getMonth() + 1, 0, 23, 59, 59, 999) : d.value), u = M(() => f.value === "week" ? t.getPreviousFirstDayOfWeek(v.value, h.startWeekOnSunday) : f.value === "month" ? v.value : A.value), S = M(() => {
749
+ }, Ot = ({ config: y, dateUtils: t, emit: d, texts: r, eventsManager: h }, C) => {
750
+ const { availableViews: B } = y, f = ue(y.view && B[y.view] ? y.view : y.defaultView), A = ue(y.selectedDate || null), Z = ue(/* @__PURE__ */ new Date()), L = ue(new Date(y.viewDate || Z.value));
751
+ L.value.setHours(0, 0, 0, 0);
752
+ const l = ue(new Date(L));
753
+ let E = null;
754
+ const F = b(() => f.value === "month" ? l.value : _.value), m = b(() => f.value === "month" ? new Date(l.value.getFullYear(), l.value.getMonth() + 1, 0, 23, 59, 59, 999) : c.value), i = b(() => f.value === "week" ? t.getPreviousFirstDayOfWeek(_.value, y.startWeekOnSunday) : f.value === "month" ? _.value : F.value), S = b(() => {
752
755
  if (f.value === "week") {
753
- const g = t.addDays(u.value, 7);
756
+ const g = t.addDays(i.value, 7);
754
757
  return g.setMilliseconds(-1), g;
755
758
  }
756
- return f.value === "month" ? d.value : m.value;
757
- }), n = M(() => {
758
- const g = U.value.getTime();
759
+ return f.value === "month" ? c.value : m.value;
760
+ }), n = b(() => {
761
+ const g = Z.value.getTime();
759
762
  if (f.value === "week")
760
- return u.value.getTime() <= g && g <= S.value.getTime();
761
- const R = v.value.getTime(), ee = d.value.getTime();
762
- return R <= g && g <= ee;
763
+ return i.value.getTime() <= g && g <= S.value.getTime();
764
+ const N = _.value.getTime(), ee = c.value.getTime();
765
+ return N <= g && g <= ee;
763
766
  });
764
767
  function I() {
765
- U.value = /* @__PURE__ */ new Date(), z = setTimeout(I, 60 * 1e3);
768
+ Z.value = /* @__PURE__ */ new Date(), E = setTimeout(I, 60 * 1e3);
766
769
  }
767
770
  function e() {
768
- z = setTimeout(I, (60 - (/* @__PURE__ */ new Date()).getSeconds()) * 1e3), I();
771
+ E = setTimeout(I, (60 - (/* @__PURE__ */ new Date()).getSeconds()) * 1e3), I();
769
772
  }
770
- const C = M(() => {
771
- if (!h.availableViews[f.value]) return 1;
772
- let g = h.availableViews[f.value].cols;
773
- return h.hasHiddenDays && ["week", "month"].includes(f.value) && (g -= h.hasHiddenDays), g;
774
- }), j = M(() => {
773
+ const z = b(() => {
774
+ if (!y.availableViews[f.value]) return 1;
775
+ let g = y.availableViews[f.value].cols;
776
+ return y.hasHiddenDays && ["week", "month"].includes(f.value) && (g -= y.hasHiddenDays), g;
777
+ }), H = b(() => {
775
778
  var g;
776
- return ((g = h.availableViews[f.value]) == null ? void 0 : g.rows) || 1;
777
- }), y = M(() => C.value * j.value), v = M(() => {
779
+ return ((g = y.availableViews[f.value]) == null ? void 0 : g.rows) || 1;
780
+ }), Y = b(() => z.value * H.value), _ = b(() => {
778
781
  if (f.value === "month") {
779
782
  let g = l.value.getDay() || 7;
780
- return h.startWeekOnSunday && !h.hideWeekdays[7] && (g += 1), h.viewDayOffset && (g -= h.viewDayOffset), t.subtractDays(l.value, g - 1);
783
+ return y.startWeekOnSunday && !y.hideWeekdays[7] && (g += 1), y.viewDayOffset && (g -= y.viewDayOffset), t.subtractDays(l.value, g - 1);
781
784
  }
782
785
  if (f.value === "week") {
783
- const g = "1234567".split("").filter((ee) => !Object.keys(h.hideWeekdays).includes(ee));
784
- let R = Math.min(...g);
785
- return h.startWeekOnSunday && !h.hideWeekdays[7] && (R = 1), h.viewDayOffset && (R += h.viewDayOffset), t.addDays(l.value, R - 1);
786
+ const g = "1234567".split("").filter((ee) => !Object.keys(y.hideWeekdays).includes(ee));
787
+ let N = Math.min(...g);
788
+ return y.startWeekOnSunday && !y.hideWeekdays[7] && (N = 1), y.viewDayOffset && (N += y.viewDayOffset), t.addDays(l.value, N - 1);
786
789
  }
787
790
  return l.value;
788
- }), D = M(() => {
789
- const g = [], R = ["days", "week", "month"].includes(f.value);
791
+ }), v = b(() => {
792
+ const g = [], N = ["days", "week", "month"].includes(f.value);
790
793
  let ee = 0;
791
- for (let Q = 0; Q < y.value + ee; Q++)
794
+ for (let x = 0; x < Y.value + ee; x++)
792
795
  switch (f.value) {
793
796
  case "day":
794
797
  case "days":
795
798
  case "week":
796
799
  case "month": {
797
- const ge = t.addDays(v.value, Q), Re = ge.getDay() || 7;
798
- if (R && h.hasHiddenDays && h.hideWeekdays[Re]) {
800
+ const ye = t.addDays(_.value, x), Ne = ye.getDay() || 7;
801
+ if (N && y.hasHiddenDays && y.hideWeekdays[Ne]) {
799
802
  ee++;
800
803
  continue;
801
804
  }
802
- const ze = new Date(ge);
803
- ze.setHours(23, 59, 59, 999), g.push({ start: ge, startFormatted: t.formatDate(ge), end: ze });
805
+ const ze = new Date(ye);
806
+ ze.setHours(23, 59, 59, 999), g.push({ start: ye, startFormatted: t.formatDate(ye), end: ze });
804
807
  break;
805
808
  }
806
809
  case "year":
807
810
  g.push({
808
- start: new Date(v.value.getFullYear(), Q, 1, 0, 0, 0, 0),
809
- end: new Date(v.value.getFullYear(), Q + 1, 0, 23, 59, 59, 999)
811
+ start: new Date(_.value.getFullYear(), x, 1, 0, 0, 0, 0),
812
+ end: new Date(_.value.getFullYear(), x + 1, 0, 23, 59, 59, 999)
810
813
  });
811
814
  break;
812
815
  case "years":
813
816
  g.push({
814
- start: new Date(v.value.getFullYear() + Q, 0, 1, 0, 0, 0, 0),
815
- end: new Date(v.value.getFullYear() + Q + 1, 0, 0, 23, 59, 59, 999)
817
+ start: new Date(_.value.getFullYear() + x, 0, 1, 0, 0, 0, 0),
818
+ end: new Date(_.value.getFullYear() + x + 1, 0, 0, 23, 59, 59, 999)
816
819
  });
817
820
  break;
818
821
  }
819
822
  return g;
820
- }), d = M(() => D.value[D.value.length - 1].end), i = ce("right"), k = M(() => {
821
- const g = Object.keys(h.availableViews);
823
+ }), c = b(() => v.value[v.value.length - 1].end), u = ue("right"), p = b(() => {
824
+ const g = Object.keys(y.availableViews);
822
825
  return g[g.indexOf(f.value) + 1];
823
- }), a = M(() => {
824
- const g = Object.keys(h.availableViews);
826
+ }), a = b(() => {
827
+ const g = Object.keys(y.availableViews);
825
828
  return g[g.indexOf(f.value) - 1];
826
829
  });
827
- function F(g, R, ee = !1) {
828
- if (!R || !R[g]) return g + 1;
829
- const Q = R[g];
830
- return ee && typeof Q == "string" ? Q.substring(0, 3) : Q;
830
+ function O(g, N, ee = !1) {
831
+ if (!N || !N[g]) return g + 1;
832
+ const x = N[g];
833
+ return ee && typeof x == "string" ? x.substring(0, 3) : x;
831
834
  }
832
- function q(g, R, ee) {
833
- const { monthsArray: Q, monthBeforeDay: ge, canTruncate: Re, xs: ze } = ee, Me = g.getMonth(), Ee = g.getFullYear(), Ye = R.getMonth(), Pe = R.getFullYear(), Be = Me !== Ye, $t = Ee !== Pe, Te = Re && (ze || Be), Le = g.getDate(), Fe = R.getDate();
834
- return $t ? ge ? `${F(Me, Q, Te)} ${Le}, ${Ee} - ${F(Ye, Q, Te)} ${Fe}, ${Pe}` : `${Le} ${F(Me, Q, Te)} ${Ee} - ${Fe} ${F(Ye, Q, Te)} ${Pe}` : Be ? ge ? `${F(Me, Q, Te)} ${Le} - ${F(Ye, Q, Te)} ${Fe}, ${Ee}` : `${Le} ${F(Me, Q, Te)} - ${Fe} ${F(Ye, Q, Te)} ${Ee}` : ge ? `${F(Me, Q, Te)} ${Le}-${Fe}, ${Ee}` : `${Le}-${Fe} ${F(Me, Q, Te)} ${Ee}`;
835
+ function X(g, N, ee) {
836
+ const { monthsArray: x, monthBeforeDay: ye, canTruncate: Ne, xs: ze } = ee, Me = g.getMonth(), Ee = g.getFullYear(), Ye = N.getMonth(), Pe = N.getFullYear(), We = Me !== Ye, $t = Ee !== Pe, Te = Ne && (ze || We), Le = g.getDate(), Ae = N.getDate();
837
+ return $t ? ye ? `${O(Me, x, Te)} ${Le}, ${Ee} - ${O(Ye, x, Te)} ${Ae}, ${Pe}` : `${Le} ${O(Me, x, Te)} ${Ee} - ${Ae} ${O(Ye, x, Te)} ${Pe}` : We ? ye ? `${O(Me, x, Te)} ${Le} - ${O(Ye, x, Te)} ${Ae}, ${Ee}` : `${Le} ${O(Me, x, Te)} - ${Ae} ${O(Ye, x, Te)} ${Ee}` : ye ? `${O(Me, x, Te)} ${Le}-${Ae}, ${Ee}` : `${Le}-${Ae} ${O(Me, x, Te)} ${Ee}`;
835
838
  }
836
- const K = M(() => {
837
- const { dateFormat: g, months: R, monthsGenitive: ee, week: Q, truncations: ge } = r, Re = h.locale, ze = ge !== !1, Me = g.indexOf("M") < g.indexOf("D"), Ee = ee && Re === "el" ? ee : R;
839
+ const U = b(() => {
840
+ const { dateFormat: g, months: N, monthsGenitive: ee, week: x, truncations: ye } = r, Ne = y.locale, ze = ye !== !1, Me = g.indexOf("M") < g.indexOf("D"), Ee = ee && Ne === "el" ? ee : N;
838
841
  switch (f.value) {
839
842
  case "day":
840
- return t.formatDate(v.value, g);
843
+ return t.formatDate(_.value, g);
841
844
  case "days":
842
845
  case "week": {
843
846
  const Ye = {
844
847
  monthsArray: Ee,
845
848
  monthBeforeDay: Me,
846
849
  canTruncate: ze,
847
- xs: h.xs
850
+ xs: y.xs
848
851
  };
849
- let Pe = q(v.value, d.value, Ye);
852
+ let Pe = X(_.value, c.value, Ye);
850
853
  if (f.value === "week") {
851
- const Be = t.getWeek(
852
- v.value,
853
- h.startWeekOnSunday && !h.hideWeekdays[7]
854
+ const We = t.getWeek(
855
+ _.value,
856
+ y.startWeekOnSunday && !y.hideWeekdays[7]
854
857
  );
855
- Pe += ` <small>${Q} ${Be}</small>`;
858
+ Pe += ` <small>${x} ${We}</small>`;
856
859
  }
857
860
  return Pe;
858
861
  }
859
862
  case "month": {
860
- const Ye = `${h.xs && ze ? "MMM" : "MMMM"} YYYY`;
861
- return t.formatDate(A.value, Ye);
863
+ const Ye = `${y.xs && ze ? "MMM" : "MMMM"} YYYY`;
864
+ return t.formatDate(F.value, Ye);
862
865
  }
863
866
  case "year":
864
- return v.value.getFullYear();
867
+ return _.value.getFullYear();
865
868
  case "years":
866
- return `${v.value.getFullYear()} - ${m.value.getFullYear()}`;
869
+ return `${_.value.getFullYear()} - ${m.value.getFullYear()}`;
867
870
  }
868
871
  });
869
- async function x() {
870
- switch (l.value = new Date(P.value || U.value), l.value.setHours(0, 0, 0, 0), f.value) {
872
+ async function K() {
873
+ switch (l.value = new Date(L.value || Z.value), l.value.setHours(0, 0, 0, 0), f.value) {
871
874
  case "day":
872
875
  break;
873
876
  case "days":
874
877
  break;
875
878
  case "week":
876
- l.value = t.getPreviousFirstDayOfWeek(l.value, h.startWeekOnSunday && !h.hideWeekdays[7]);
879
+ l.value = t.getPreviousFirstDayOfWeek(l.value, y.startWeekOnSunday && !y.hideWeekdays[7]);
877
880
  break;
878
881
  case "month":
879
882
  l.value = new Date(l.value.getFullYear(), l.value.getMonth(), 1, 0, 0, 0, 0);
@@ -882,149 +885,149 @@ const lt = (h, t) => {
882
885
  l.value = new Date(l.value.getFullYear(), 0, 1, 0, 0, 0, 0);
883
886
  break;
884
887
  case "years":
885
- l.value = new Date(l.value.getFullYear() - l.value.getFullYear() % y.value, 0, 1, 0, 0, 0, 0);
888
+ l.value = new Date(l.value.getFullYear() - l.value.getFullYear() % Y.value, 0, 1, 0, 0, 0, 0);
886
889
  break;
887
890
  }
888
- U.value = /* @__PURE__ */ new Date(), h.ready && (await Ie(), c("view-change", {
891
+ Z.value = /* @__PURE__ */ new Date(), y.ready && (await Xe(), d("view-change", {
889
892
  id: f.value,
890
- title: K.value,
891
- start: A.value,
893
+ title: U.value,
894
+ start: F.value,
892
895
  end: m.value,
893
- extendedStart: u.value,
896
+ extendedStart: i.value,
894
897
  extendedEnd: S.value,
895
- cellDates: D.value,
898
+ cellDates: v.value,
896
899
  containsToday: n.value,
897
900
  events: G.value
898
901
  }));
899
902
  }
900
903
  function te(g) {
901
- const R = f.value, ee = h.availableViews[R];
902
- g[R] && JSON.stringify(g[R]) === JSON.stringify(ee) || x();
904
+ const N = f.value, ee = y.availableViews[N];
905
+ g[N] && JSON.stringify(g[N]) === JSON.stringify(ee) || K();
903
906
  }
904
- function X(g, R = !0) {
905
- const ee = Object.keys(h.availableViews);
906
- f.value !== g && (ee.includes(g) ? (i.value = ee.indexOf(g) < ee.indexOf(f.value) ? "left" : "right", f.value = g, R && c("update:view", g), x()) : console.warn(`Vue Cal: the \`${g}\` view is not available.`));
907
+ function q(g, N = !0) {
908
+ const ee = Object.keys(y.availableViews);
909
+ f.value !== g && (ee.includes(g) ? (u.value = ee.indexOf(g) < ee.indexOf(f.value) ? "left" : "right", f.value = g, N && d("update:view", g), K()) : console.warn(`Vue Cal: the \`${g}\` view is not available.`));
907
910
  }
908
911
  function le() {
909
- k.value ? X(k.value) : console.warn("Vue Cal: no broader view is available.");
912
+ p.value ? q(p.value) : console.warn("Vue Cal: no broader view is available.");
910
913
  }
911
914
  function ae() {
912
- a.value ? X(a.value) : console.warn("Vue Cal: no narrower view is available.");
915
+ a.value ? q(a.value) : console.warn("Vue Cal: no narrower view is available.");
913
916
  }
914
917
  function ve() {
915
- $(!1);
918
+ k(!1);
916
919
  }
917
920
  function s() {
918
- $(!0);
921
+ k(!0);
919
922
  }
920
- function $(g = !0) {
921
- let R = new Date(P.value);
923
+ function k(g = !0) {
924
+ let N = new Date(L.value);
922
925
  switch (f.value) {
923
926
  case "day":
924
927
  case "days":
925
- g ? R = t.addDays(d.value, 1) : R = t.subtractDays(v.value, y.value);
928
+ g ? N = t.addDays(c.value, 1) : N = t.subtractDays(_.value, Y.value);
926
929
  break;
927
930
  case "week": {
928
- g ? (R = t.addDays(S.value, 1), R.setHours(0, 0, 0, 0)) : R = t.subtractDays(u.value, y.value);
931
+ g ? (N = t.addDays(S.value, 1), N.setHours(0, 0, 0, 0)) : N = t.subtractDays(i.value, Y.value);
929
932
  break;
930
933
  }
931
934
  case "month": {
932
935
  const ee = g ? 1 : -1;
933
- R = new Date(R.getFullYear(), R.getMonth() + ee, 1, 0, 0, 0, 0);
936
+ N = new Date(N.getFullYear(), N.getMonth() + ee, 1, 0, 0, 0, 0);
934
937
  break;
935
938
  }
936
939
  case "year": {
937
940
  const ee = g ? 1 : -1;
938
- R = new Date(R.getFullYear() + ee, 1, 1, 0, 0, 0, 0);
941
+ N = new Date(N.getFullYear() + ee, 1, 1, 0, 0, 0, 0);
939
942
  break;
940
943
  }
941
944
  case "years": {
942
- const ee = g ? y.value : -y.value;
943
- R = new Date(R.getFullYear() + ee, 1, 1, 0, 0, 0, 0);
945
+ const ee = g ? Y.value : -Y.value;
946
+ N = new Date(N.getFullYear() + ee, 1, 1, 0, 0, 0, 0);
944
947
  break;
945
948
  }
946
949
  }
947
- J(R);
950
+ J(N);
948
951
  }
949
- function w() {
952
+ function D() {
950
953
  const g = /* @__PURE__ */ new Date();
951
954
  g.setHours(0, 0, 0, 0), J(g);
952
955
  }
953
- function J(g, R = !0, ee = !1) {
956
+ function J(g, N = !0, ee = !1) {
954
957
  if (!t.isValid(g)) return console.warn("Vue Cal: can't navigate to the given date: invalid date provided to `updateViewDate(date)`.");
955
- let [Q, ge] = [v.value, d.value];
956
- f.value === "month" && ([Q, ge] = [A.value, m.value]), (!t.isInRange(g, Q, ge) || ee) && (g.setHours(0, 0, 0, 0), i.value = g.getTime() < Q.getTime() ? "left" : "right", P.value = g, R && c("update:viewDate", g), x());
958
+ let [x, ye] = [_.value, c.value];
959
+ f.value === "month" && ([x, ye] = [F.value, m.value]), (!t.isInRange(g, x, ye) || ee) && (g.setHours(0, 0, 0, 0), u.value = g.getTime() < x.getTime() ? "left" : "right", L.value = g, N && d("update:viewDate", g), K());
957
960
  }
958
- function ne(g, R = !0) {
961
+ function ne(g, N = !0) {
959
962
  if (!t.isValid(g)) return console.warn("Vue Cal: can't update the selected date: invalid date provided to `updateSelectedDate(date)`.");
960
- const { isValid: ee, isSameDate: Q } = t;
961
- (!L.value || !ee(L.value) || !Q(g, L.value)) && (g.setHours(0, 0, 0, 0), L.value = g, R && c("update:selectedDate", g));
963
+ const { isValid: ee, isSameDate: x } = t;
964
+ (!A.value || !ee(A.value) || !x(g, A.value)) && (g.setHours(0, 0, 0, 0), A.value = g, N && d("update:selectedDate", g));
962
965
  }
963
- function fe(g) {
964
- !g && !l.value.getDay() ? J(t.addDays(l.value, 1), !0, !0) : (i.value = "left", x());
966
+ function me(g) {
967
+ !g && !l.value.getDay() ? J(t.addDays(l.value, 1), !0, !0) : (u.value = "left", K());
965
968
  }
966
969
  function o(g) {
967
- g && h.startWeekOnSunday && !l.value.getDay() ? J(t.addDays(l.value, 1), !0, !0) : !g && h.startWeekOnSunday && l.value.getDay() === 1 && J(t.subtractDays(l.value, 1), !0, !0);
970
+ g && y.startWeekOnSunday && !l.value.getDay() ? J(t.addDays(l.value, 1), !0, !0) : !g && y.startWeekOnSunday && l.value.getDay() === 1 && J(t.subtractDays(l.value, 1), !0, !0);
968
971
  }
969
- function b() {
970
- console.log("toggling weekdays", h.hideWeekdays), x();
972
+ function T() {
973
+ console.log("toggling weekdays", y.hideWeekdays), K();
971
974
  }
972
- function E(g) {
973
- var Q;
974
- const R = (Q = Y.value) == null ? void 0 : Q.querySelector(".vuecal__scrollable"), ee = g ? g * h.timeCellHeight / h.timeStep : 0;
975
- R == null || R.scrollTo({ top: ee, behavior: "smooth" });
975
+ function M(g) {
976
+ var x;
977
+ const N = (x = C.value) == null ? void 0 : x.querySelector(".vuecal__scrollable"), ee = g ? g * y.timeCellHeight / y.timeStep : 0;
978
+ N == null || N.scrollTo({ top: ee, behavior: "smooth" });
976
979
  }
977
- function _() {
980
+ function w() {
978
981
  const g = /* @__PURE__ */ new Date();
979
- E(g.getHours() * 60 + g.getMinutes());
982
+ M(g.getHours() * 60 + g.getMinutes());
980
983
  }
981
- function N() {
982
- E(0);
984
+ function R() {
985
+ M(0);
983
986
  }
984
- const G = M(() => p.getViewEvents(D.value)), oe = p.createEvent, pe = p.deleteEvent;
985
- return he(() => h.view, (g) => X(g, !1)), he(() => h.availableViews, te), he(() => h.datePicker, () => X("month")), he(() => h.viewDate, (g) => J(g, !1)), he(() => h.selectedDate, (g) => ne(g, !1)), he(() => h.startWeekOnSunday, (g) => fe(g)), he(() => h.hideWeekends, (g) => o(g)), he(() => h.hideWeekdays, b), he(() => y.value, () => {
986
- y.value > 90 && console.warn("Vue Cal: high cell count detected. Performance may degrade when interactions are enabled.");
987
- }), he(() => h.watchRealTime, (g) => {
988
- g && h.time ? e() : z = clearTimeout(z);
989
- }), x(), h.time && h.watchRealTime && e(), Ne(() => z = clearTimeout(z)), {
990
- now: U,
987
+ const G = b(() => h.getViewEvents(v.value)), oe = h.createEvent, ge = h.deleteEvent;
988
+ return De(() => y.view, (g) => q(g, !1)), De(() => y.availableViews, te), De(() => y.datePicker, () => q("month")), De(() => y.viewDate, (g) => J(g, !1)), De(() => y.selectedDate, (g) => ne(g, !1)), De(() => y.startWeekOnSunday, (g) => me(g)), De(() => y.hideWeekends, (g) => o(g)), De(() => y.hideWeekdays, T), De(() => Y.value, () => {
989
+ Y.value > 90 && console.warn("Vue Cal: high cell count detected. Performance may degrade when interactions are enabled.");
990
+ }), De(() => y.watchRealTime, (g) => {
991
+ g && y.time ? e() : E = clearTimeout(E);
992
+ }), K(), y.time && y.watchRealTime && e(), Re(() => E = clearTimeout(E)), {
993
+ now: Z,
991
994
  id: f,
992
- broaderView: k,
995
+ broaderView: p,
993
996
  narrowerView: a,
994
- title: K,
995
- viewDate: P,
996
- start: A,
997
+ title: U,
998
+ viewDate: L,
999
+ start: F,
997
1000
  end: m,
998
- extendedStart: u,
1001
+ extendedStart: i,
999
1002
  // Full range, including out of scope month days, and hidden leading/trailing days.
1000
1003
  extendedEnd: S,
1001
1004
  // Full range, including out of scope month days, and hidden leading/trailing days.
1002
- firstCellDate: v,
1003
- lastCellDate: d,
1005
+ firstCellDate: _,
1006
+ lastCellDate: c,
1004
1007
  containsToday: n,
1005
- selectedDate: L,
1006
- cellDates: D,
1007
- cols: C,
1008
- rows: j,
1008
+ selectedDate: A,
1009
+ cellDates: v,
1010
+ cols: z,
1011
+ rows: H,
1009
1012
  // All the events are stored and indexed in the events object of the eventsManager.
1010
1013
  // The following events array is only a subset of visible ones, plus any potential recurring
1011
1014
  // and multi-day events.
1012
1015
  events: G,
1013
- transitionDirection: i,
1014
- switch: X,
1016
+ transitionDirection: u,
1017
+ switch: q,
1015
1018
  broader: le,
1016
1019
  narrower: ae,
1017
1020
  previous: ve,
1018
1021
  next: s,
1019
- navigate: $,
1020
- goToToday: w,
1022
+ navigate: k,
1023
+ goToToday: D,
1021
1024
  updateViewDate: J,
1022
1025
  updateSelectedDate: ne,
1023
- scrollToCurrentTime: _,
1024
- scrollToTime: E,
1025
- scrollTop: N,
1026
+ scrollToCurrentTime: w,
1027
+ scrollToTime: M,
1028
+ scrollTop: R,
1026
1029
  createEvent: oe,
1027
- deleteEvent: pe,
1030
+ deleteEvent: ge,
1028
1031
  // Getters.
1029
1032
  get isDay() {
1030
1033
  return f.value === "day";
@@ -1081,22 +1084,22 @@ const lt = (h, t) => {
1081
1084
  weekDays: rt,
1082
1085
  year: ut,
1083
1086
  years: it
1084
- }, Symbol.toStringTag, { value: "Module" })), Ae = be({
1085
- texts: { ...ye.texts },
1087
+ }, Symbol.toStringTag, { value: "Module" })), Fe = be({
1088
+ texts: { ...fe.texts },
1086
1089
  // Make texts reactive before a locale is loaded.
1087
- dateUtils: lt(ye.texts, Qe)
1090
+ dateUtils: lt(fe.texts, Qe)
1088
1091
  // Some Date utils functions need localized texts.
1089
- }), Ht = ({ props: h, emit: t, attrs: c, vuecalEl: r, uid: p }) => {
1090
- const Y = be({
1091
- uid: p,
1092
+ }), Ht = ({ props: y, emit: t, attrs: d, vuecalEl: r, uid: h }) => {
1093
+ const C = be({
1094
+ uid: h,
1092
1095
  // The Vuecal instance unique ID, used for dnd source-target identification.
1093
1096
  emit: t,
1094
- texts: { ...Ae.texts },
1097
+ texts: { ...Fe.texts },
1095
1098
  // Make texts reactive before a locale is loaded.
1096
1099
  // The date utils composable.
1097
1100
  // A class/composable is needed in order to access the user locale in all the methods, and
1098
1101
  // independently of other potential Vue Cal instances on the same page.
1099
- dateUtils: { ...Ae.dateUtils },
1102
+ dateUtils: { ...Fe.dateUtils },
1100
1103
  now: /* @__PURE__ */ new Date(),
1101
1104
  config: {},
1102
1105
  eventsManager: {},
@@ -1113,7 +1116,7 @@ const lt = (h, t) => {
1113
1116
  // Track the cell currently being hovered during event resizing.
1114
1117
  }
1115
1118
  });
1116
- return Y.dateUtils = lt(Object.assign(ye.texts, Y.texts), Qe), Y.config = Ct(Y, h, c), Y.eventsManager = Ot(Y), Y.view = Vt(Y, r), Y.dnd = zt(Y), Y;
1119
+ return C.dateUtils = lt(Object.assign(fe.texts, C.texts), Qe), C.config = Ct(C, y, d), C.eventsManager = Vt(C), C.view = Ot(C, r), C.dnd = zt(C), C;
1117
1120
  }, Pt = 1440, Lt = {
1118
1121
  allDayEvents: { type: Boolean, default: !1 },
1119
1122
  // Display all-day events in a fixed top bar on the day, days & week views.
@@ -1208,107 +1211,109 @@ const lt = (h, t) => {
1208
1211
  // Show the weeks numbers in a column on month view.
1209
1212
  xs: { type: Boolean, default: !1 }
1210
1213
  // Extra small size for date pickers (truncates texts + specific styles).
1214
+ // Temporarily disabled until fully implemented.
1215
+ // horizontal: { type: Boolean, default: false } // Show the calendar timeline horizontally.
1211
1216
  // TODO:
1212
1217
  // minEventWidth: { type: Number, default: 0 },
1213
1218
  // minScheduleWidth: { type: Number, default: 0 },
1214
1219
  // overlapsPerTimeStep: { type: Boolean, default: false },
1215
- }, Ft = { class: "vuecal__header" }, At = {
1220
+ }, At = { class: "vuecal__header" }, Ft = {
1216
1221
  key: 0,
1217
1222
  class: "vuecal__views-bar"
1218
- }, Nt = ["onClick", "innerHTML"], Rt = {
1223
+ }, Rt = ["onClick", "innerHTML"], Nt = {
1219
1224
  key: 1,
1220
1225
  class: "vuecal__title-bar"
1221
- }, Bt = { class: "vuecal__transition-wrap" }, Wt = ["disabled", "innerHTML"], It = {
1226
+ }, Wt = { class: "vuecal__transition-wrap" }, Bt = ["disabled", "innerHTML"], Xt = {
1222
1227
  __name: "header",
1223
- setup(h) {
1224
- const t = He("vuecal"), { view: c, config: r } = t, p = () => {
1225
- r.clickToNavigate && c.broader();
1226
- }, Y = M(() => r.clickToNavigate ? { click: p } : {});
1227
- return (W, f) => (O(), H("div", Ft, [
1228
- V(W.$slots, "header", {
1229
- view: T(c),
1230
- availableViews: T(r).availableViews,
1231
- vuecal: T(t)
1228
+ setup(y) {
1229
+ const t = He("vuecal"), { view: d, config: r } = t, h = () => {
1230
+ r.clickToNavigate && d.broader();
1231
+ }, C = b(() => r.clickToNavigate ? { click: h } : {});
1232
+ return (B, f) => (V(), P("div", At, [
1233
+ j(B.$slots, "header", {
1234
+ view: $(d),
1235
+ availableViews: $(r).availableViews,
1236
+ vuecal: $(t)
1232
1237
  }),
1233
- W.$slots.header ? Z("", !0) : (O(), H(de, { key: 0 }, [
1234
- T(r).viewsBar ? (O(), H("div", At, [
1235
- (O(!0), H(de, null, we(T(r).availableViews, (L, U) => (O(), H("button", {
1236
- class: De(["vuecal__view-button", { "vuecal__view-button--active": T(c).id === U }]),
1237
- onClick: (P) => T(c).switch(U),
1238
- innerHTML: T(t).texts[U],
1238
+ B.$slots.header ? Q("", !0) : (V(), P(de, { key: 0 }, [
1239
+ $(r).viewsBar ? (V(), P("div", Ft, [
1240
+ (V(!0), P(de, null, we($(r).availableViews, (A, Z) => (V(), P("button", {
1241
+ class: pe(["vuecal__view-button", { "vuecal__view-button--active": $(d).id === Z }]),
1242
+ onClick: (L) => $(d).switch(Z),
1243
+ innerHTML: $(t).texts[Z],
1239
1244
  type: "button"
1240
- }, null, 10, Nt))), 256))
1241
- ])) : Z("", !0),
1242
- T(r).titleBar ? (O(), H("nav", Rt, [
1243
- me("button", {
1244
- class: De(["vuecal__nav vuecal__nav--prev", { "vuecal__nav--default": !W.$slots["previous-button"] }]),
1245
- onClick: f[0] || (f[0] = (...L) => T(c).previous && T(c).previous(...L)),
1245
+ }, null, 10, Rt))), 256))
1246
+ ])) : Q("", !0),
1247
+ $(r).titleBar ? (V(), P("nav", Nt, [
1248
+ he("button", {
1249
+ class: pe(["vuecal__nav vuecal__nav--prev", { "vuecal__nav--default": !B.$slots["previous-button"] }]),
1250
+ onClick: f[0] || (f[0] = (...A) => $(d).previous && $(d).previous(...A)),
1246
1251
  type: "button"
1247
1252
  }, [
1248
- V(W.$slots, "previous-button")
1253
+ j(B.$slots, "previous-button")
1249
1254
  ], 2),
1250
- me("div", Bt, [
1251
- Ve(Je, {
1252
- name: `vuecal-slide-fade--${T(c).transitionDirection}`
1255
+ he("div", Wt, [
1256
+ Oe(Ue, {
1257
+ name: `vuecal-slide-fade--${$(d).transitionDirection}`
1253
1258
  }, {
1254
- default: B(() => [
1255
- (O(), H("div", {
1256
- key: T(c).id + T(c).start.getTime()
1259
+ default: W(() => [
1260
+ (V(), P("div", {
1261
+ key: $(d).id + $(d).start.getTime()
1257
1262
  }, [
1258
- W.$slots.title || W.$slots[`title.${T(c).id}`] ? (O(), Se(xe(T(r).clickToNavigate && T(c).broaderView ? "button" : "div"), ie({
1263
+ B.$slots.title || B.$slots[`title.${$(d).id}`] ? (V(), Se(xe($(r).clickToNavigate && $(d).broaderView ? "button" : "div"), ie({
1259
1264
  key: 0,
1260
1265
  class: "vuecal__title"
1261
- }, Xe(Y.value)), {
1262
- default: B(() => [
1263
- W.$slots[`title.${T(c).id}`] ? V(W.$slots, `title.${T(c).id}`, se(ie({ key: 0 }, T(c)))) : V(W.$slots, "title", se(ie({ key: 1 }, T(c))))
1266
+ }, Ie(C.value)), {
1267
+ default: W(() => [
1268
+ B.$slots[`title.${$(d).id}`] ? j(B.$slots, `title.${$(d).id}`, se(ie({ key: 0 }, $(d)))) : j(B.$slots, "title", se(ie({ key: 1 }, $(d))))
1264
1269
  ]),
1265
1270
  _: 3
1266
- }, 16)) : (O(), Se(xe(T(r).clickToNavigate && T(c).broaderView ? "button" : "div"), ie({
1271
+ }, 16)) : (V(), Se(xe($(r).clickToNavigate && $(d).broaderView ? "button" : "div"), ie({
1267
1272
  key: 1,
1268
1273
  class: "vuecal__title"
1269
- }, Xe(Y.value), {
1270
- innerHTML: T(c).title
1274
+ }, Ie(C.value), {
1275
+ innerHTML: $(d).title
1271
1276
  }), null, 16, ["innerHTML"]))
1272
1277
  ]))
1273
1278
  ]),
1274
1279
  _: 3
1275
1280
  }, 8, ["name"])
1276
1281
  ]),
1277
- T(r).todayButton ? (O(), H(de, { key: 0 }, [
1278
- W.$slots["today-button"] ? V(W.$slots, "today-button", {
1282
+ $(r).todayButton ? (V(), P(de, { key: 0 }, [
1283
+ B.$slots["today-button"] ? j(B.$slots, "today-button", {
1279
1284
  key: 0,
1280
- navigate: () => !T(c).containsToday && T(c).goToToday(),
1281
- active: T(c).containsToday
1282
- }) : (O(), H("button", {
1285
+ navigate: () => !$(d).containsToday && $(d).goToToday(),
1286
+ active: $(d).containsToday
1287
+ }) : (V(), P("button", {
1283
1288
  key: 1,
1284
- class: De(["vuecal__nav vuecal__nav--today vuecal__nav--default", { "vuecal__nav--active": T(c).containsToday }]),
1285
- onClick: f[1] || (f[1] = (L) => !T(c).containsToday && T(c).goToToday()),
1286
- disabled: !!T(c).containsToday,
1289
+ class: pe(["vuecal__nav vuecal__nav--today vuecal__nav--default", { "vuecal__nav--active": $(d).containsToday }]),
1290
+ onClick: f[1] || (f[1] = (A) => !$(d).containsToday && $(d).goToToday()),
1291
+ disabled: !!$(d).containsToday,
1287
1292
  type: "button",
1288
- innerHTML: T(t).texts.today
1289
- }, null, 10, Wt))
1290
- ], 64)) : Z("", !0),
1291
- me("button", {
1292
- class: De(["vuecal__nav vuecal__nav--next", { "vuecal__nav--default": !W.$slots["next-button"] }]),
1293
- onClick: f[2] || (f[2] = (...L) => T(c).next && T(c).next(...L)),
1293
+ innerHTML: $(t).texts.today
1294
+ }, null, 10, Bt))
1295
+ ], 64)) : Q("", !0),
1296
+ he("button", {
1297
+ class: pe(["vuecal__nav vuecal__nav--next", { "vuecal__nav--default": !B.$slots["next-button"] }]),
1298
+ onClick: f[2] || (f[2] = (...A) => $(d).next && $(d).next(...A)),
1294
1299
  type: "button"
1295
1300
  }, [
1296
- V(W.$slots, "next-button")
1301
+ j(B.$slots, "next-button")
1297
1302
  ], 2)
1298
- ])) : Z("", !0)
1303
+ ])) : Q("", !0)
1299
1304
  ], 64))
1300
1305
  ]));
1301
1306
  }
1302
- }, Xt = ["draggable"], qt = { class: "vuecal__event-details" }, Gt = { class: "vuecal__event-title" }, Jt = {
1307
+ }, It = ["draggable"], qt = { class: "vuecal__event-details" }, Gt = { class: "vuecal__event-title" }, Ut = {
1303
1308
  key: 0,
1304
1309
  class: "vuecal__event-time"
1305
- }, Ut = {
1310
+ }, Jt = {
1306
1311
  key: 0,
1307
1312
  class: "vuecal__event-comma"
1308
1313
  }, Zt = { class: "vuecal__event-start" }, Kt = {
1309
1314
  key: 1,
1310
1315
  class: "vuecal__event-end"
1311
- }, Qt = { key: 0 }, xt = ["innerHTML"], st = {
1316
+ }, Qt = { key: 0 }, xt = ["innerHTML"], ea = 16, st = {
1312
1317
  __name: "event",
1313
1318
  props: {
1314
1319
  event: { type: Object, required: !0 },
@@ -1317,8 +1322,8 @@ const lt = (h, t) => {
1317
1322
  cellEnd: { type: Date, required: !0 }
1318
1323
  },
1319
1324
  emits: ["event-drag-start", "event-drag-end", "event-resize-start", "event-resize-end"],
1320
- setup(h, { emit: t }) {
1321
- const c = h, { config: r, view: p, dnd: Y, touch: W, dateUtils: f, eventsManager: L } = He("vuecal"), { handleEventResize: U } = L, P = ce(null), l = be(c.event), z = be({
1325
+ setup(y, { emit: t }) {
1326
+ const d = y, { config: r, view: h, dnd: C, touch: B, dateUtils: f, eventsManager: A } = He("vuecal"), { handleEventResize: Z } = A, L = ue(null), l = be(d.event), E = be({
1322
1327
  dragging: !1,
1323
1328
  fromResizer: !1,
1324
1329
  // If the drag originates from the resizer element.
@@ -1359,19 +1364,20 @@ const lt = (h, t) => {
1359
1364
  cellEl: null,
1360
1365
  // Store the cell DOM node for a more efficient resizing calc in mousemove/touchmove.
1361
1366
  schedule: null
1362
- }), A = M(() => r.editableEvents.drag && l.draggable !== !1 && !l.background && z.canTouchAndDrag !== !1), m = M(() => p.isMonth || p.isYear || p.isYears || c.inAllDayBar || l._.multiday && !n.value ? !1 : r.time && r.editableEvents.resize && l.resizable !== !1 && !l.background);
1363
- M(() => r.editableEvents.delete && l.deletable !== !1 && !l.background);
1364
- const u = M(() => {
1365
- var y, v, D, d, i;
1367
+ }), F = b(() => r.editableEvents.drag && l.draggable !== !1 && !l.background && E.canTouchAndDrag !== !1), m = b(() => h.isMonth || h.isYear || h.isYears || d.inAllDayBar || l._.multiday && !n.value ? !1 : r.time && r.editableEvents.resize && l.resizable !== !1 && !l.background);
1368
+ b(() => r.editableEvents.delete && l.deletable !== !1 && !l.background);
1369
+ const i = b(() => {
1370
+ var c, u, p, a, O;
1371
+ const v = !!((c = l._) != null && c.multiday);
1366
1372
  return {
1367
1373
  [`vuecal__event--${l._.id}`]: !0,
1368
1374
  [l.class]: !!l.class,
1369
1375
  "vuecal__event--recurring": !!l.recurring,
1370
1376
  "vuecal__event--background": !!l.background,
1371
- "vuecal__event--all-day": l.allDay || ((y = l._) == null ? void 0 : y.startMinutes) === 0 && ((v = l._) == null ? void 0 : v.duration) === 1440,
1372
- "vuecal__event--multiday": !!((D = l._) != null && D.multiday),
1373
- "vuecal__event--cut-top": !c.inAllDayBar && (((d = l._) == null ? void 0 : d.startMinutes) < r.timeFrom || l._.multiday && !S.value),
1374
- "vuecal__event--cut-bottom": !c.inAllDayBar && (((i = l._) == null ? void 0 : i.endMinutes) > r.timeTo || l._.multiday && !n.value),
1377
+ "vuecal__event--all-day": l.allDay || ((u = l._) == null ? void 0 : u.startMinutes) === 0 && ((p = l._) == null ? void 0 : p.duration) === 1440,
1378
+ "vuecal__event--multiday": v,
1379
+ "vuecal__event--cut-top": !d.inAllDayBar && (((a = l._) == null ? void 0 : a.startMinutes) < r.timeFrom || v && !S.value),
1380
+ "vuecal__event--cut-bottom": !d.inAllDayBar && (((O = l._) == null ? void 0 : O.endMinutes) > r.timeTo || v && !n.value),
1375
1381
  // Only apply the dragging class on the event copy that is being dragged.
1376
1382
  "vuecal__event--dragging": !l._.draggingGhost && l._.dragging,
1377
1383
  // Only apply the dragging-ghost class on the event original that remains fixed while a copy is being
@@ -1381,139 +1387,143 @@ const lt = (h, t) => {
1381
1387
  // after event deletion (event._.dragging is already false) so the event ghost does not flash in before
1382
1388
  // deletion.
1383
1389
  "vuecal__event--dragging-ghost": l._.draggingGhost,
1384
- "vuecal__event--resizing": W.isResizingEvent
1390
+ "vuecal__event--resizing": B.isResizingEvent
1385
1391
  };
1386
- }), S = M(() => l._.multiday ? new Date(l.start).setHours(0, 0, 0, 0) === c.cellStart.getTime() : !0), n = M(() => l._.multiday ? f.isSameDate(new Date(new Date(l.end).setMilliseconds(-1)), c.cellEnd) : !0), I = M(() => {
1387
- const y = new Date(l.start).setHours(0, 0, 0, 0), v = new Date(l.end).setHours(0, 0, 0, 0);
1388
- return Math.ceil((v - y) / (1e3 * 60 * 60 * 24));
1389
- }), e = M(() => {
1390
- const y = (p.isDay || p.isDays || p.isWeek) && r.time && !c.inAllDayBar;
1391
- if (!y && !l.backgroundColor && !l.color) return !1;
1392
- const v = {
1392
+ }), S = b(() => l._.multiday ? new Date(l.start).setHours(0, 0, 0, 0) === d.cellStart.getTime() : !0), n = b(() => l._.multiday ? f.isSameDate(new Date(new Date(l.end).setMilliseconds(-1)), d.cellEnd) : !0), I = b(() => {
1393
+ const v = new Date(l.start).setHours(0, 0, 0, 0), c = new Date(l.end).setHours(0, 0, 0, 0);
1394
+ return Math.ceil((c - v) / (1e3 * 60 * 60 * 24));
1395
+ }), e = b(() => {
1396
+ const v = (h.isDay || h.isDays || h.isWeek) && r.time && !d.inAllDayBar, c = r.horizontal;
1397
+ if (!v && !l.backgroundColor && !l.color) return !1;
1398
+ const u = {
1393
1399
  backgroundColor: l.backgroundColor || null,
1394
1400
  color: l.color || null
1395
1401
  };
1396
- if (y) {
1397
- let D = l._.startMinutes, d = l._.endMinutes;
1398
- l._.multiday && (S.value || (D = 0), n.value || (d = 1440));
1399
- const i = Math.max(r.timeFrom, D), k = Math.min(r.timeTo, d) + (l._.duration && !d ? 1440 : 0), a = Oe(i, r), F = Oe(k, r) - a;
1400
- v.top = `${a}%`, v.height = `${F}%`;
1402
+ if (v) {
1403
+ let p = l._.startMinutes, a = l._.endMinutes;
1404
+ l._.multiday && (S.value || (p = 0), n.value || (a = 1440));
1405
+ const O = Math.max(r.timeFrom, p), X = Math.min(r.timeTo, a) + (l._.duration && !a ? 1440 : 0), U = Ve(O, r), K = Ve(X, r) - U;
1406
+ u[c ? "left" : "top"] = `${U}%`, u[c ? "width" : "height"] = `${K}%`;
1401
1407
  }
1402
- return v;
1403
- }), C = M(() => {
1404
- const y = { ...r.eventListeners.event };
1405
- for (const [d, i] of Object.entries(y))
1406
- ["resize-end"].includes(d) || (y[d] = (k) => {
1407
- k.type !== "drop" && i(k.type ? { e: k, event: l } : k);
1408
+ return u;
1409
+ }), z = b(() => {
1410
+ const v = { ...r.eventListeners.event };
1411
+ for (const [p, a] of Object.entries(v))
1412
+ ["resize-end"].includes(p) || (v[p] = (O) => {
1413
+ O.type !== "drop" && a(O.type ? { e: O, event: l } : O);
1408
1414
  });
1409
- const v = { ...y };
1410
- y.touchstart = (d) => {
1411
- var i;
1412
- d.stopPropagation(), z.touchAndDragTimer = setTimeout(() => {
1413
- z.canTouchAndDrag = !0;
1414
- }, 500), j(d), (i = v.touchstart) == null || i.call(v, { e: d, event: l });
1415
- }, y.mousedown = (d) => {
1416
- var i;
1417
- d.stopPropagation(), j(d), (i = v.mousedown) == null || i.call(v, { e: d, event: l });
1415
+ const c = { ...v };
1416
+ v.touchstart = (p) => {
1417
+ var a;
1418
+ p.stopPropagation(), E.touchAndDragTimer = setTimeout(() => {
1419
+ E.canTouchAndDrag = !0;
1420
+ }, 500), _(p), (a = c.touchstart) == null || a.call(c, { e: p, event: l });
1421
+ }, v.mousedown = (p) => {
1422
+ var a;
1423
+ p.stopPropagation(), _(p), (a = c.mousedown) == null || a.call(c, { e: p, event: l });
1418
1424
  };
1419
- let D = null;
1420
- return y.click = (d) => {
1421
- var i;
1422
- (i = v.click) == null || i.call(v, { e: d, event: l }), D ? D = clearTimeout(D) : D = setTimeout(() => {
1423
- var k;
1424
- D = null, (k = v["delayed-click"]) == null || k.call(v, { e: d, event: l });
1425
+ let u = null;
1426
+ return v.click = (p) => {
1427
+ var a;
1428
+ (a = c.click) == null || a.call(c, { e: p, event: l }), u ? u = clearTimeout(u) : u = setTimeout(() => {
1429
+ var O;
1430
+ u = null, (O = c["delayed-click"]) == null || O.call(c, { e: p, event: l });
1425
1431
  }, 400);
1426
- }, y.dblclick = (d) => {
1427
- v.dblclick ? v.dblclick({ e: d, event: l }) : l.delete(1);
1428
- }, y;
1429
- }), j = (y) => {
1430
- var d, i, k;
1431
- const v = ((d = y.touches) == null ? void 0 : d[0]) || y;
1432
- z.fromResizer = v.target.matches(".vuecal__event-resizer, .vuecal__event-resizer *");
1433
- const D = P.value.getBoundingClientRect();
1434
- z.startX = (((i = y.touches) == null ? void 0 : i[0]) || y).clientX - D.left, z.startY = (((k = y.touches) == null ? void 0 : k[0]) || y).clientY - D.top, z.startPercentageX = z.startX * 100 / D.width, z.startPercentageY = z.startY * 100 / D.height, z.cellEl = P.value.closest(".vuecal__cell"), z.resizeStartDate = l.start, z.fromResizer && U(y, l, P.value), z.holdTimer = setTimeout(() => {
1435
- var a, F;
1436
- z.holding = !0, (F = (a = C.value).hold) == null || F.call(a, { e: y, event: l });
1432
+ }, v.dblclick = (p) => {
1433
+ c.dblclick ? c.dblclick({ e: p, event: l }) : l.delete(1);
1434
+ }, v;
1435
+ });
1436
+ let H = null, Y = 0;
1437
+ const _ = (v) => {
1438
+ var a, O, X;
1439
+ const c = ((a = v.touches) == null ? void 0 : a[0]) || v;
1440
+ E.fromResizer = c.target.closest(".vuecal__event-resizer");
1441
+ const u = Date.now();
1442
+ (!H || u - Y > ea) && (H = L.value.getBoundingClientRect(), Y = u);
1443
+ const p = H;
1444
+ E.startX = (((O = v.touches) == null ? void 0 : O[0]) || v).clientX - p.left, E.startY = (((X = v.touches) == null ? void 0 : X[0]) || v).clientY - p.top, E.startPercentageX = E.startX * 100 / p.width, E.startPercentageY = E.startY * 100 / p.height, E.cellEl = L.value.closest(".vuecal__cell"), E.resizeStartDate = l.start, E.fromResizer && Z(v, l, L.value), E.holdTimer = setTimeout(() => {
1445
+ var U, K;
1446
+ E.holding = !0, (K = (U = z.value).hold) == null || K.call(U, { e: v, event: l });
1437
1447
  }, 1e3);
1438
1448
  };
1439
- return Ze(() => l._.register(P.value)), Ne(() => {
1440
- l._.unregister();
1441
- }), (y, v) => (O(), H("div", ie({ class: "vuecal__event" }, Xe(C.value, !0), {
1449
+ return Ze(() => l._.register(L.value)), Re(() => {
1450
+ E.holdTimer && (E.holdTimer = clearTimeout(E.holdTimer)), E.touchAndDragTimer && (E.touchAndDragTimer = clearTimeout(E.touchAndDragTimer)), l._.unregister();
1451
+ }), (v, c) => (V(), P("div", ie({ class: "vuecal__event" }, Ie(z.value, !0), {
1442
1452
  ref_key: "eventEl",
1443
- ref: P,
1444
- class: u.value,
1453
+ ref: L,
1454
+ class: i.value,
1445
1455
  style: e.value,
1446
- draggable: A.value ? "true" : void 0,
1447
- onDragstart: v[2] || (v[2] = (D) => A.value && T(Y).eventDragStart(D, l)),
1448
- onDragend: v[3] || (v[3] = (D) => A.value && T(Y).eventDragEnd(D, l))
1456
+ draggable: F.value ? "true" : void 0,
1457
+ onDragstart: c[2] || (c[2] = (u) => F.value && $(C).eventDragStart(u, l)),
1458
+ onDragend: c[3] || (c[3] = (u) => F.value && $(C).eventDragEnd(u, l))
1449
1459
  }), [
1450
- me("div", qt, [
1451
- y.$slots["event.all-day"] ? V(y.$slots, "event.all-day", {
1460
+ he("div", qt, [
1461
+ v.$slots["event.all-day"] ? j(v.$slots, "event.all-day", {
1452
1462
  key: 0,
1453
1463
  event: l
1454
- }) : y.$slots[`event.${T(p).id}`] ? V(y.$slots, `event.${T(p).id}`, {
1464
+ }) : v.$slots[`event.${$(h).id}`] ? j(v.$slots, `event.${$(h).id}`, {
1455
1465
  key: 1,
1456
1466
  event: l
1457
- }) : V(y.$slots, "event", {
1467
+ }) : j(v.$slots, "event", {
1458
1468
  key: 2,
1459
1469
  event: l
1460
1470
  }, () => [
1461
- me("div", Gt, ue(l.title), 1),
1462
- T(r).time && !h.inAllDayBar && !(l._.multiday && !S.value) ? (O(), H("div", Jt, [
1463
- T(p).isMonth ? (O(), H("span", Ut, ",")) : Z("", !0),
1464
- me("span", Zt, ue(l._[`startTimeFormatted${T(r).twelveHour ? 12 : 24}`]), 1),
1465
- T(p).isMonth ? Z("", !0) : (O(), H("span", Kt, [
1466
- qe(" - " + ue(l._[`endTimeFormatted${T(r).twelveHour ? 12 : 24}`]), 1),
1467
- l._.multiday && S.value ? (O(), H("span", Qt, "+" + ue(I.value) + "d", 1)) : Z("", !0)
1471
+ he("div", Gt, ce(l.title), 1),
1472
+ $(r).time && !y.inAllDayBar && !(l._.multiday && !S.value) ? (V(), P("div", Ut, [
1473
+ $(h).isMonth ? (V(), P("span", Jt, ",")) : Q("", !0),
1474
+ he("span", Zt, ce(l._[`startTimeFormatted${$(r).twelveHour ? 12 : 24}`]), 1),
1475
+ $(h).isMonth ? Q("", !0) : (V(), P("span", Kt, [
1476
+ qe(" - " + ce(l._[`endTimeFormatted${$(r).twelveHour ? 12 : 24}`]), 1),
1477
+ l._.multiday && S.value ? (V(), P("span", Qt, "+" + ce(I.value) + "d", 1)) : Q("", !0)
1468
1478
  ]))
1469
- ])) : Z("", !0),
1470
- h.inAllDayBar ? Z("", !0) : (O(), H("div", {
1479
+ ])) : Q("", !0),
1480
+ y.inAllDayBar ? Q("", !0) : (V(), P("div", {
1471
1481
  key: 1,
1472
1482
  class: "vuecal__event-content",
1473
1483
  innerHTML: l.content
1474
1484
  }, null, 8, xt))
1475
1485
  ])
1476
1486
  ]),
1477
- m.value ? (O(), H("div", {
1487
+ m.value ? (V(), P("div", {
1478
1488
  key: 0,
1479
1489
  class: "vuecal__event-resizer",
1480
- onDragstart: v[0] || (v[0] = et(() => {
1490
+ onDragstart: c[0] || (c[0] = et(() => {
1481
1491
  }, ["prevent", "stop"]))
1482
- }, null, 32)) : Z("", !0),
1483
- Ve(Je, { name: "vuecal-delete-btn" }, {
1484
- default: B(() => [
1485
- l._.deleting ? (O(), H("div", {
1492
+ }, null, 32)) : Q("", !0),
1493
+ Oe(Ue, { name: "vuecal-delete-btn" }, {
1494
+ default: W(() => [
1495
+ l._.deleting ? (V(), P("div", {
1486
1496
  key: 0,
1487
1497
  class: "vuecal__event-delete",
1488
- onClick: v[1] || (v[1] = et((D) => l.delete(3), ["stop"]))
1489
- }, "Delete")) : Z("", !0)
1498
+ onClick: c[1] || (c[1] = et((u) => l.delete(3), ["stop"]))
1499
+ }, "Delete")) : Q("", !0)
1490
1500
  ]),
1491
1501
  _: 1
1492
1502
  })
1493
- ], 16, Xt));
1503
+ ], 16, It));
1494
1504
  }
1495
- }, ea = ["innerHTML"], ta = ["data-schedule"], aa = {
1505
+ }, ta = ["innerHTML"], aa = ["data-schedule"], na = {
1496
1506
  key: 1,
1497
1507
  class: "vuecal__cell-date"
1498
- }, na = {
1508
+ }, sa = {
1499
1509
  key: 2,
1500
1510
  class: "vuecal__cell-content"
1501
- }, sa = {
1511
+ }, la = {
1502
1512
  key: 3,
1503
1513
  class: "vuecal__cell-events"
1504
- }, la = {
1514
+ }, ra = {
1505
1515
  key: 1,
1506
1516
  class: "vuecal__cell-date"
1507
- }, ra = {
1517
+ }, oa = {
1508
1518
  key: 2,
1509
1519
  class: "vuecal__cell-content"
1510
- }, oa = {
1520
+ }, ia = {
1511
1521
  key: 3,
1512
1522
  class: "vuecal__cell-events"
1513
- }, ia = {
1523
+ }, ua = {
1514
1524
  key: 5,
1515
1525
  class: "vuecal__cell-events-count"
1516
- }, ua = ["title"], kt = {
1526
+ }, ca = ["title"], kt = {
1517
1527
  __name: "cell",
1518
1528
  props: {
1519
1529
  // Even with time=false, the date of the cell will still be provided in order to attach
@@ -1524,10 +1534,10 @@ const lt = (h, t) => {
1524
1534
  allDay: { type: Boolean, default: !1 }
1525
1535
  // True when the cell is an all-day cell.
1526
1536
  },
1527
- setup(h) {
1528
- const t = h, c = He("vuecal"), { view: r, config: p, dateUtils: Y, eventsManager: W, dnd: f, touch: L } = c, U = M(() => Y.isToday(t.start)), P = ce(null), l = ce([]), z = ce(!1), A = (o) => {
1529
- l.value.push(o.detail), z.value = !0;
1530
- }, m = () => setTimeout(() => z.value = !1, 300), u = be({
1537
+ setup(y) {
1538
+ const t = y, d = He("vuecal"), { view: r, config: h, dateUtils: C, eventsManager: B, dnd: f, touch: A } = d, Z = b(() => C.isToday(t.start)), L = ue(null), l = ue([]), E = ue(!1), F = (o) => {
1539
+ l.value.push(o.detail), E.value = !0;
1540
+ }, m = () => setTimeout(() => E.value = !1, 300), i = be({
1531
1541
  dragging: !1,
1532
1542
  holding: !1,
1533
1543
  // When the cell is clicked and hold for a certain amount of time.
@@ -1552,679 +1562,686 @@ const lt = (h, t) => {
1552
1562
  movePercentageX: 0,
1553
1563
  movePercentageY: 0,
1554
1564
  schedule: null
1555
- }), S = ce(!1), n = ce({ cellOverlaps: {}, longestStreak: 0 }), I = M(() => {
1556
- let o = Math.min(u.startPercentageY, u.movePercentageY), b = Math.max(u.startPercentageY, u.movePercentageY), E = je(o, p), _ = je(b, p);
1557
- return p.snapToInterval && (E = Y.snapToInterval(E, p.snapToInterval), _ = Y.snapToInterval(_, p.snapToInterval), o = Oe(E, p), b = Oe(_, p)), {
1565
+ }), S = ue(!1), n = ue({ cellOverlaps: {}, longestStreak: 0 }), I = b(() => {
1566
+ let o = Math.min(i.startPercentageY, i.movePercentageY), T = Math.max(i.startPercentageY, i.movePercentageY), M = je(o, h), w = je(T, h);
1567
+ return h.snapToInterval && (M = C.snapToInterval(M, h.snapToInterval), w = C.snapToInterval(w, h.snapToInterval), o = Ve(M, h), T = Ve(w, h)), {
1558
1568
  style: {
1559
1569
  top: `${o}%`,
1560
- height: `${Math.abs(b - o)}%`
1570
+ height: `${Math.abs(T - o)}%`
1561
1571
  },
1562
- startMinutes: E,
1563
- endMinutes: _,
1564
- start: Y.formatMinutes(E),
1565
- end: Y.formatMinutes(_),
1566
- ...u.schedule ? { schedule: u.schedule } : {}
1572
+ startMinutes: M,
1573
+ endMinutes: w,
1574
+ start: C.formatMinutes(M),
1575
+ end: C.formatMinutes(w),
1576
+ ...i.schedule ? { schedule: i.schedule } : {}
1567
1577
  };
1568
- }), e = M(() => {
1569
- const o = p.editableEvents.create && (u.dragging || S.value), b = p.eventCreateMinDrag && u.thresholdPassed || !p.eventCreateMinDrag, E = u.canTouchAndDrag !== !1;
1570
- return o && b && E;
1571
- }), C = M(() => {
1578
+ }), e = b(() => {
1579
+ const o = h.editableEvents.create && (i.dragging || S.value), T = h.eventCreateMinDrag && i.thresholdPassed || !h.eventCreateMinDrag, M = i.canTouchAndDrag !== !1;
1580
+ return o && T && M;
1581
+ }), z = b(() => {
1572
1582
  var oe;
1573
- const o = /* @__PURE__ */ new Date(), b = r.start.getFullYear(), E = r.start.getMonth(), _ = t.start.getFullYear(), N = t.start.getMonth();
1583
+ const o = /* @__PURE__ */ new Date(), T = r.start.getFullYear(), M = r.start.getMonth(), w = t.start.getFullYear(), R = t.start.getMonth();
1574
1584
  return {
1575
1585
  [`vuecal__cell--${Ge[t.start.getDay()]}`]: r.isDay || r.isDays || r.isWeek || r.isMonth,
1576
- [`vuecal__cell--${Yt[N]}`]: r.isYear,
1577
- [`vuecal__cell--${_}`]: r.isYears,
1578
- "vuecal__cell--today": U.value,
1579
- "vuecal__cell--current-month": r.isYear && _ === o.getFullYear() && N === o.getMonth(),
1580
- "vuecal__cell--current-year": r.isYears && _ === o.getFullYear(),
1581
- "vuecal__cell--out-of-range": r.isMonth && (_ !== b || N !== E),
1582
- "vuecal__cell--before-min": K.value && F.value,
1583
- "vuecal__cell--after-max": K.value && q.value,
1584
- "vuecal__cell--disabled": K.value,
1586
+ [`vuecal__cell--${Yt[R]}`]: r.isYear,
1587
+ [`vuecal__cell--${w}`]: r.isYears,
1588
+ "vuecal__cell--today": Z.value,
1589
+ "vuecal__cell--current-month": r.isYear && w === o.getFullYear() && R === o.getMonth(),
1590
+ "vuecal__cell--current-year": r.isYears && w === o.getFullYear(),
1591
+ "vuecal__cell--out-of-range": r.isMonth && (w !== T || R !== M),
1592
+ "vuecal__cell--before-min": U.value && O.value,
1593
+ "vuecal__cell--after-max": U.value && X.value,
1594
+ "vuecal__cell--disabled": U.value,
1585
1595
  "vuecal__cell--selected": r.selectedDate && r.selectedDate.getTime() >= t.start.getTime() && r.selectedDate.getTime() <= t.end.getTime(),
1586
- "vuecal__cell--has-schedules": (oe = p.schedules) == null ? void 0 : oe.length,
1587
- "vuecal__cell--dragging": u.dragging,
1588
- "vuecal__cell--has-events": y.value.length
1596
+ "vuecal__cell--has-schedules": (oe = h.schedules) == null ? void 0 : oe.length,
1597
+ "vuecal__cell--dragging": i.dragging,
1598
+ "vuecal__cell--has-events": Y.value.length
1589
1599
  };
1590
1600
  });
1591
- M(() => Y.formatDate(t.start));
1592
- const j = M(() => {
1601
+ b(() => C.formatDate(t.start));
1602
+ const H = b(() => {
1593
1603
  switch (r.id) {
1594
1604
  case "day":
1595
1605
  return "";
1596
1606
  case "days":
1597
- return p.availableViews.days.rows > 1 && Y.formatDate(t.start, "D"), "";
1607
+ return h.availableViews.days.rows > 1 && C.formatDate(t.start, "D"), "";
1598
1608
  case "week":
1599
1609
  return "";
1600
1610
  case "month":
1601
- return Y.formatDate(t.start, "D");
1611
+ return C.formatDate(t.start, "D");
1602
1612
  case "year":
1603
- return Y.formatDate(t.start, p.xs ? "MMM" : "MMMM");
1613
+ return C.formatDate(t.start, h.xs ? "MMM" : "MMMM");
1604
1614
  case "years":
1605
- return Y.formatDate(t.start, "YYYY");
1615
+ return C.formatDate(t.start, "YYYY");
1606
1616
  }
1607
- }), y = M(() => p.datePicker ? [] : W.getEventsInRange(
1617
+ }), Y = b(() => h.datePicker ? [] : B.getEventsInRange(
1608
1618
  t.start,
1609
1619
  t.end,
1610
- { excludeIds: l.value, ...p.allDayEvents ? { allDay: t.allDay } : {} }
1611
- )), v = M(() => y.value.filter((o) => !o.background)), D = M(() => {
1620
+ { excludeIds: l.value, ...h.allDayEvents ? { allDay: t.allDay } : {} }
1621
+ )), _ = b(() => Y.value.filter((o) => !o.background)), v = b(() => {
1612
1622
  var o;
1613
- return (o = p.schedules) == null ? void 0 : o.reduce((b, E) => (b[E.id] = y.value.filter((_) => _.schedule === E.id), b), {});
1614
- }), d = M(() => {
1623
+ return (o = h.schedules) == null ? void 0 : o.reduce((T, M) => (T[M.id] = Y.value.filter((w) => w.schedule === M.id), T), {});
1624
+ }), c = b(() => {
1615
1625
  if (r.isMonth || r.isYear || r.isYears || t.allDay) return {};
1616
- const o = typeof document < "u" && document.documentElement.getAttribute("dir") === "rtl", b = {};
1617
- for (const E of y.value) {
1618
- const _ = E._.id, { maxConcurrent: N = 1, position: G = 0 } = n.value.cellOverlaps[_] || {}, oe = o ? "right" : "left";
1619
- b[_] = { [oe]: `${100 / N * G}%` }, p.stackEvents ? b[_].width = `${100 / N + (G === N - 1 ? 0 : 15)}%` : b[_].width = `${100 / N}%`;
1626
+ const o = typeof document < "u" && document.documentElement.getAttribute("dir") === "rtl", T = h.horizontal, M = {};
1627
+ for (const w of Y.value) {
1628
+ const R = w._.id, { maxConcurrent: G = 1, position: oe = 0 } = n.value.cellOverlaps[R] || {}, ge = o ? "right" : "left", g = T ? "height" : "width";
1629
+ M[R] = { [T ? "top" : ge]: `${100 / G * oe}%` }, h.stackEvents ? M[R][g] = `${100 / G + (oe === G - 1 ? 0 : 15)}%` : M[R][g] = `${100 / G}%`;
1620
1630
  }
1621
- return b;
1622
- }), i = M(() => {
1631
+ return M;
1632
+ }), u = b(() => {
1623
1633
  const o = {};
1624
- for (const b of y.value) {
1625
- const E = b._.id, { maxConcurrent: _ = 1, position: N = 0 } = n.value.cellOverlaps[E] || {};
1626
- o[E] = `vuecal__event--stack-${N + 1}-${_}`;
1634
+ for (const T of Y.value) {
1635
+ const M = T._.id, { maxConcurrent: w = 1, position: R = 0 } = n.value.cellOverlaps[M] || {};
1636
+ o[M] = `vuecal__event--stack-${R + 1}-${w}`;
1627
1637
  }
1628
1638
  return o;
1629
- }), k = M(() => p.showCellEventCount && v.value.length), a = M(() => {
1630
- var E;
1631
- if (!p.specialHours || r.isMonth || r.isYear || r.isYears || t.allDay) return;
1639
+ }), p = b(() => h.showCellEventCount && _.value.length), a = b(() => {
1640
+ var M;
1641
+ if (!h.specialHours || r.isMonth || r.isYear || r.isYears || t.allDay) return;
1632
1642
  const o = Ge[t.start.getDay()];
1633
- let b = (E = p.specialHours) == null ? void 0 : E[o];
1634
- if (b)
1635
- return Array.isArray(b) || (b = [b]), b.map((_) => {
1636
- let { from: N, to: G, class: oe, label: pe } = _;
1637
- if (isNaN(N) || isNaN(G) || p.timeFrom >= G || p.timeTo <= N) return;
1638
- N = Math.max(p.timeFrom, N), G = Math.min(p.timeTo, G);
1639
- const g = Oe(N, p), R = Oe(G, p) - g;
1643
+ let T = (M = h.specialHours) == null ? void 0 : M[o];
1644
+ if (T)
1645
+ return Array.isArray(T) || (T = [T]), T.map((w) => {
1646
+ let { from: R, to: G, class: oe, label: ge } = w;
1647
+ if (isNaN(R) || isNaN(G) || h.timeFrom >= G || h.timeTo <= R) return;
1648
+ R = Math.max(h.timeFrom, R), G = Math.min(h.timeTo, G);
1649
+ const g = Ve(R, h), N = Ve(G, h) - g;
1640
1650
  return {
1641
- style: { top: `${g}%`, height: `${R}%` },
1642
- label: pe,
1651
+ style: { top: `${g}%`, height: `${N}%` },
1652
+ label: ge,
1643
1653
  class: oe
1644
1654
  };
1645
- }).filter((_) => !!_);
1646
- }), F = M(() => p.minTimestamp !== null && p.minTimestamp > t.end.getTime()), q = M(() => p.maxTimestamp && p.maxTimestamp < t.start.getTime()), K = M(() => {
1647
- const { disableDays: o } = p, b = r.isYear || r.isYears;
1648
- return o.length && o.includes(Y.formatDate(t.start)) && !b ? !0 : F.value || q.value;
1649
- }), x = be({
1650
- show: M(() => {
1651
- if (!(!r.isDay && !r.isDays && !r.isWeek) && !(!U.value || !p.time || t.allDay) && !(p.timeFrom > Y.dateToMinutes(r.now)) && !(Y.dateToMinutes(r.now) > p.timeTo))
1655
+ }).filter((w) => !!w);
1656
+ }), O = b(() => h.minTimestamp !== null && h.minTimestamp > t.end.getTime()), X = b(() => h.maxTimestamp && h.maxTimestamp < t.start.getTime()), U = b(() => {
1657
+ const { disableDays: o } = h, T = r.isYear || r.isYears;
1658
+ return o.length && o.includes(C.formatDate(t.start)) && !T ? !0 : O.value || X.value;
1659
+ }), K = be({
1660
+ show: b(() => {
1661
+ if (!(!r.isDay && !r.isDays && !r.isWeek) && !(!Z.value || !h.time || t.allDay) && !(h.timeFrom > C.dateToMinutes(r.now)) && !(C.dateToMinutes(r.now) > h.timeTo))
1652
1662
  return !0;
1653
1663
  }),
1654
- nowInMinutes: M(() => Y.dateToMinutes(r.now)),
1655
- todaysTimePosition: M(() => Oe(x.nowInMinutes, p)),
1656
- style: M(() => `top: ${x.todaysTimePosition}%`),
1657
- currentTime: M(() => Y.formatTime(r.now))
1658
- }), te = M(() => {
1659
- if (K.value) return {};
1660
- const o = { ...p.eventListeners.cell };
1661
- for (const [_, N] of Object.entries(o))
1662
- o[_] = (G) => {
1663
- var oe, pe, g;
1664
- (g = (pe = G.target || ((oe = G.e) == null ? void 0 : oe.target)).closest) != null && g.call(pe, ".vuecal__event") || N(G.type ? { e: G, cell: X.value, cursor: ae.value } : G);
1664
+ nowInMinutes: b(() => C.dateToMinutes(r.now)),
1665
+ todaysTimePosition: b(() => Ve(K.nowInMinutes, h)),
1666
+ style: b(() => `${h.horizontal ? "left" : "top"}: ${K.todaysTimePosition}%`),
1667
+ currentTime: b(() => C.formatTime(r.now))
1668
+ }), te = b(() => {
1669
+ if (U.value) return {};
1670
+ const o = { ...h.eventListeners.cell };
1671
+ for (const [w, R] of Object.entries(o))
1672
+ o[w] = (G) => {
1673
+ var oe, ge, g;
1674
+ (g = (ge = G.target || ((oe = G.e) == null ? void 0 : oe.target)).closest) != null && g.call(ge, ".vuecal__event") || R(G.type ? { e: G, cell: q.value, cursor: ae.value } : G);
1665
1675
  };
1666
- const b = { ...o };
1667
- let E = null;
1668
- return o.click = (_) => {
1676
+ const T = { ...o };
1677
+ let M = null;
1678
+ return o.click = (w) => {
1669
1679
  var G;
1670
1680
  ve();
1671
- const N = le(_);
1672
- (G = b.click) == null || G.call(b, { e: _, cell: X.value, cursor: N }), E ? E = clearTimeout(E) : E = setTimeout(() => {
1681
+ const R = le(w);
1682
+ (G = T.click) == null || G.call(T, { e: w, cell: q.value, cursor: R }), M ? M = clearTimeout(M) : M = setTimeout(() => {
1673
1683
  var oe;
1674
- E = null, (oe = b["delayed-click"]) == null || oe.call(b, { e: _, cell: X.value, cursor: N });
1684
+ M = null, (oe = T["delayed-click"]) == null || oe.call(T, { e: w, cell: q.value, cursor: R });
1675
1685
  }, 400);
1676
- }, (p.time && r.isDay || r.isDays || r.isWeek) && (o.touchstart = (_) => {
1677
- var N;
1678
- s(_.e || _), (N = b.touchstart) == null || N.call(b, { e: _, cell: X.value, cursor: ae.value });
1679
- }, o.mousedown = (_) => {
1680
- var N;
1681
- s(_.e || _), (N = b.mousedown) == null || N.call(b, { e: _, cell: X.value, cursor: ae.value });
1682
- }), b.dblclick && (o.dblclick = (_) => {
1683
- var N;
1684
- (N = b.dblclick) == null || N.call(b, { e: _, cell: X.value, cursor: le(_) });
1685
- }), p.editableEvents.drag && (o.dragenter = (_) => f.cellDragEnter(_, X.value), o.dragover = (_) => {
1686
- _.preventDefault(), f.cellDragOver(_, X.value);
1687
- }, o.dragleave = (_) => f.cellDragLeave(_, X.value), o.drop = (_) => f.cellDragDrop(_, X.value, t.allDay)), o;
1688
- }), X = M(() => ({
1686
+ }, (h.time && r.isDay || r.isDays || r.isWeek) && (o.touchstart = (w) => {
1687
+ var R;
1688
+ s(w.e || w), (R = T.touchstart) == null || R.call(T, { e: w, cell: q.value, cursor: ae.value });
1689
+ }, o.mousedown = (w) => {
1690
+ var R;
1691
+ s(w.e || w), (R = T.mousedown) == null || R.call(T, { e: w, cell: q.value, cursor: ae.value });
1692
+ }), T.dblclick && (o.dblclick = (w) => {
1693
+ var R;
1694
+ (R = T.dblclick) == null || R.call(T, { e: w, cell: q.value, cursor: le(w) });
1695
+ }), h.editableEvents.drag && (o.dragenter = (w) => f.cellDragEnter(w, q.value), o.dragover = (w) => {
1696
+ w.preventDefault(), f.cellDragOver(w, q.value);
1697
+ }, o.dragleave = (w) => f.cellDragLeave(w, q.value), o.drop = (w) => f.cellDragDrop(w, q.value, t.allDay)), o;
1698
+ }), q = b(() => ({
1689
1699
  start: t.start,
1690
1700
  end: t.end,
1691
- events: y,
1692
- ...u.schedule ? { schedule: u.schedule } : {},
1701
+ events: Y,
1702
+ ...i.schedule ? { schedule: i.schedule } : {},
1693
1703
  goNarrower: () => r.narrower(),
1694
1704
  goBroader: () => r.broader(),
1695
1705
  broader: r.broaderView,
1696
1706
  narrower: r.narrowerView
1697
1707
  })), le = (o) => {
1698
1708
  var G;
1699
- const b = (((G = o.touches) == null ? void 0 : G[0]) || o).clientY, { top: E } = P.value.getBoundingClientRect(), _ = Ke(b - E, P.value), N = new Date(t.start);
1700
- return N.setMinutes(je(_, p)), { y: _, date: N };
1701
- }, ae = M(() => {
1702
- const o = je(u.movePercentageY || u.startPercentageY, p), b = new Date(t.start);
1703
- return b.setMinutes(o), {
1704
- x: u.movePercentageX || u.startPercentageX,
1705
- y: u.movePercentageY || u.startPercentageY,
1706
- date: b
1709
+ const T = (((G = o.touches) == null ? void 0 : G[0]) || o).clientY, { top: M } = L.value.getBoundingClientRect(), w = Ke(T - M, L.value), R = new Date(t.start);
1710
+ return R.setMinutes(je(w, h)), { y: w, date: R };
1711
+ }, ae = b(() => {
1712
+ const o = je(i.movePercentageY || i.startPercentageY, h), T = new Date(t.start);
1713
+ return T.setMinutes(o), {
1714
+ x: i.movePercentageX || i.startPercentageX,
1715
+ y: i.movePercentageY || i.startPercentageY,
1716
+ date: T
1707
1717
  };
1708
1718
  }), ve = () => {
1709
- r.updateSelectedDate(t.start), p.clickToNavigate && ((r.isMonth || r.isDays || r.isWeek) && p.availableViews.day ? r.switch("day") : r.isYear && p.availableViews.month ? r.switch("month") : r.isYears && p.availableViews.year && r.switch("year")), r.updateViewDate(t.start);
1719
+ r.updateSelectedDate(t.start), h.clickToNavigate && ((r.isMonth || r.isDays || r.isWeek) && h.availableViews.day ? r.switch("day") : r.isYear && h.availableViews.month ? r.switch("month") : r.isYears && h.availableViews.year && r.switch("year")), r.updateViewDate(t.start);
1710
1720
  }, s = (o) => {
1711
- var _, N;
1712
- const b = o.type === "touchstart";
1713
- b ? (u.canTouchAndDrag = !1, u.touchAndDragTimer = setTimeout(() => {
1714
- u.canTouchAndDrag = !0, (u.holding || u.dragging) && o.preventDefault();
1715
- }, 500)) : u.canTouchAndDrag = !0, u.schedule = ~~o.target.dataset.schedule;
1716
- const E = P.value.getBoundingClientRect();
1717
- u.startX = (((_ = o.touches) == null ? void 0 : _[0]) || o).clientX - E.left, u.startY = (((N = o.touches) == null ? void 0 : N[0]) || o).clientY - E.top, u.startPercentageX = u.startX * 100 / E.width, u.startPercentageY = u.startY * 100 / E.height, u.thresholdPassed = !1, document.addEventListener(b ? "touchmove" : "mousemove", $, { passive: !b }), document.addEventListener(b ? "touchend" : "mouseup", w, { once: !0 }), u.holdTimer = setTimeout(() => {
1721
+ var w, R;
1722
+ const T = o.type === "touchstart";
1723
+ T ? (i.canTouchAndDrag = !1, i.touchAndDragTimer = setTimeout(() => {
1724
+ i.canTouchAndDrag = !0, (i.holding || i.dragging) && o.preventDefault();
1725
+ }, 500)) : i.canTouchAndDrag = !0, i.schedule = ~~o.target.dataset.schedule;
1726
+ const M = L.value.getBoundingClientRect();
1727
+ i.startX = (((w = o.touches) == null ? void 0 : w[0]) || o).clientX - M.left, i.startY = (((R = o.touches) == null ? void 0 : R[0]) || o).clientY - M.top, i.startPercentageX = i.startX * 100 / M.width, i.startPercentageY = i.startY * 100 / M.height, i.thresholdPassed = !1, document.addEventListener(T ? "touchmove" : "mousemove", k, { passive: !T }), document.addEventListener(T ? "touchend" : "mouseup", D, { once: !0 }), i.holdTimer = setTimeout(() => {
1718
1728
  var G, oe;
1719
- u.holding = !0, (oe = (G = te.value).hold) == null || oe.call(G, { e: o, cell: X.value, cursor: ae.value });
1729
+ i.holding = !0, (oe = (G = te.value).hold) == null || oe.call(G, { e: o, cell: q.value, cursor: ae.value });
1720
1730
  }, 1e3);
1721
- }, $ = (o) => {
1722
- var _, N, G, oe, pe, g;
1723
- const b = o.type === "touchmove";
1724
- if (b && !u.canTouchAndDrag) {
1725
- u.touchAndDragTimer && (clearTimeout(u.touchAndDragTimer), u.touchAndDragTimer = null), w(o);
1731
+ }, k = (o) => {
1732
+ var w, R, G, oe, ge, g;
1733
+ const T = o.type === "touchmove";
1734
+ if (T && !i.canTouchAndDrag) {
1735
+ i.touchAndDragTimer && (clearTimeout(i.touchAndDragTimer), i.touchAndDragTimer = null), D(o);
1726
1736
  return;
1727
1737
  }
1728
- b && o.preventDefault(), u.dragging || (L.isDraggingCell = !0, (N = (_ = te.value)["drag-start"]) == null || N.call(_, { e: o, cell: X.value, cursor: ae.value })), u.dragging = !0, u.holdTimer = clearTimeout(u.holdTimer), u.holding = !1;
1729
- const E = P.value.getBoundingClientRect();
1730
- u.moveX = (((G = o.touches) == null ? void 0 : G[0]) || o).clientX - E.left, u.moveY = (((oe = o.touches) == null ? void 0 : oe[0]) || o).clientY - E.top, u.movePercentageX = u.moveX * 100 / E.width, u.movePercentageY = u.moveY * 100 / E.height, p.eventCreateMinDrag && Math.abs(u.startY - u.moveY) > p.eventCreateMinDrag && (u.thresholdPassed = !0), (g = (pe = te.value).drag) == null || g.call(pe, { e: o, cell: X.value, cursor: ae.value });
1731
- }, w = async (o) => {
1732
- var E, _;
1733
- const b = o.type === "touchend";
1734
- document.removeEventListener(b ? "touchmove" : "mousemove", $, { passive: !1 }), u.touchAndDragTimer && (clearTimeout(u.touchAndDragTimer), u.touchAndDragTimer = null), u.dragging && ((_ = (E = te.value)["drag-end"]) == null || _.call(E, { e: o, cell: X.value, cursor: ae.value }), L.isDraggingCell = !1, p.editableEvents.create && u.canTouchAndDrag && (S.value = !0, await J(o), S.value = !1)), u.holdTimer = clearTimeout(u.holdTimer), u.holding = !1, u.dragging = !1, u.startX = 0, u.startY = 0, u.moveX = 0, u.moveY = 0, u.startPercentageX = 0, u.startPercentageY = 0, u.movePercentageX = 0, u.movePercentageY = 0, u.thresholdPassed = !1, u.schedule = null, u.canTouchAndDrag = null;
1738
+ T && o.preventDefault(), i.dragging || (A.isDraggingCell = !0, (R = (w = te.value)["drag-start"]) == null || R.call(w, { e: o, cell: q.value, cursor: ae.value })), i.dragging = !0, i.holdTimer = clearTimeout(i.holdTimer), i.holding = !1;
1739
+ const M = L.value.getBoundingClientRect();
1740
+ i.moveX = (((G = o.touches) == null ? void 0 : G[0]) || o).clientX - M.left, i.moveY = (((oe = o.touches) == null ? void 0 : oe[0]) || o).clientY - M.top, i.movePercentageX = i.moveX * 100 / M.width, i.movePercentageY = i.moveY * 100 / M.height, h.eventCreateMinDrag && Math.abs(i.startY - i.moveY) > h.eventCreateMinDrag && (i.thresholdPassed = !0), (g = (ge = te.value).drag) == null || g.call(ge, { e: o, cell: q.value, cursor: ae.value });
1741
+ }, D = async (o) => {
1742
+ var M, w;
1743
+ const T = o.type === "touchend";
1744
+ document.removeEventListener(T ? "touchmove" : "mousemove", k, { passive: !1 }), i.touchAndDragTimer && (clearTimeout(i.touchAndDragTimer), i.touchAndDragTimer = null), i.dragging && ((w = (M = te.value)["drag-end"]) == null || w.call(M, { e: o, cell: q.value, cursor: ae.value }), A.isDraggingCell = !1, h.editableEvents.create && i.canTouchAndDrag && (S.value = !0, await J(o), S.value = !1)), i.holdTimer = clearTimeout(i.holdTimer), i.holding = !1, i.dragging = !1, i.startX = 0, i.startY = 0, i.moveX = 0, i.moveY = 0, i.startPercentageX = 0, i.startPercentageY = 0, i.movePercentageX = 0, i.movePercentageY = 0, i.thresholdPassed = !1, i.schedule = null, i.canTouchAndDrag = null;
1735
1745
  }, J = async (o) => {
1736
- var pe;
1746
+ var ge;
1737
1747
  if (!e.value) return;
1738
- let { start: b, end: E, startMinutes: _, endMinutes: N } = I.value;
1739
- b = new Date(t.start), b.setMinutes(_), E = new Date(t.start), E.setMinutes(N);
1740
- let G = { ...I.value, start: b, end: E };
1741
- const { create: oe } = p.eventListeners.event;
1748
+ let { start: T, end: M, startMinutes: w, endMinutes: R } = I.value;
1749
+ T = new Date(t.start), T.setMinutes(w), M = new Date(t.start), M.setMinutes(R);
1750
+ let G = { ...I.value, start: T, end: M };
1751
+ const { create: oe } = h.eventListeners.event;
1742
1752
  if (typeof oe == "function") {
1743
1753
  const g = G;
1744
- G = await new Promise((R) => oe({ e: o, event: G, cell: X.value, resolve: R, cursor: ae.value })), G && typeof G == "object" && r.createEvent(G), G && typeof G == "boolean" && r.createEvent(g);
1754
+ G = await new Promise((N) => oe({ e: o, event: G, cell: q.value, resolve: N, cursor: ae.value })), G && typeof G == "object" && r.createEvent(G), G && typeof G == "boolean" && r.createEvent(g);
1745
1755
  } else r.createEvent(G);
1746
- (pe = navigator.vibrate) == null || pe.call(navigator, 200);
1756
+ (ge = navigator.vibrate) == null || ge.call(navigator, 200);
1747
1757
  }, ne = () => {
1748
1758
  var o;
1749
- for (const b of Object.keys(te.value))
1750
- (o = P.value) == null || o.removeEventListener(b, te.value[b]);
1751
- }, fe = () => {
1752
- n.value = W.getCellOverlappingEvents(t.start, t.end, t.allDay);
1759
+ for (const T of Object.keys(te.value))
1760
+ (o = L.value) == null || o.removeEventListener(T, te.value[T]);
1761
+ }, me = () => {
1762
+ n.value = B.getCellOverlappingEvents(t.start, t.end, t.allDay);
1753
1763
  };
1754
- return he(
1764
+ return De(
1755
1765
  // Watch event IDs and start/end dates (only) to detect event resizing/dnd.
1756
- () => !r.isYears && !r.isYear && v.value.map((o) => `${o._.id}${o.start.getTime()}${o.end.getTime()}`).join(),
1766
+ () => !r.isYears && !r.isYear && _.value.map((o) => `${o._.id}${o.start.getTime()}${o.end.getTime()}`).join(),
1757
1767
  async () => {
1758
- await Ie(), fe();
1768
+ await Xe(), me();
1759
1769
  },
1760
1770
  { immediate: !0, flush: "post" }
1761
1771
  // Use flush: 'post' to prevent infinite updates.
1762
- ), Ne(async () => {
1763
- for (const o of l.value) W.deleteEvent(o, 3);
1764
- ne(), await Ie();
1765
- }), (o, b) => (O(), H("div", ie({
1766
- class: ["vuecal__cell", C.value],
1772
+ ), Re(async () => {
1773
+ for (const o of l.value) B.deleteEvent(o, 3);
1774
+ ne(), await Xe();
1775
+ }), (o, T) => (V(), P("div", ie({
1776
+ class: ["vuecal__cell", z.value],
1767
1777
  ref_key: "cellEl",
1768
- ref: P
1769
- }, Xe(te.value, !0)), [
1770
- o.$slots.cell ? V(o.$slots, "cell", {
1778
+ ref: L
1779
+ }, Ie(te.value, !0)), [
1780
+ o.$slots.cell ? j(o.$slots, "cell", {
1771
1781
  key: 0,
1772
- cell: X.value
1773
- }) : Z("", !0),
1774
- a.value ? (O(!0), H(de, { key: 1 }, we(a.value, (E, _) => (O(), H("div", {
1775
- class: De(["vuecal__special-hours", E.class]),
1776
- style: $e(E.style),
1777
- innerHTML: E.label || ""
1778
- }, null, 14, ea))), 256)) : Z("", !0),
1779
- !o.$slots.cell && T(p).schedules ? (O(!0), H(de, { key: 2 }, we(T(p).schedules, (E) => (O(), H("div", {
1780
- class: De(["vuecal__schedule vuecal__schedule--cell", E.class]),
1781
- key: E.id,
1782
- style: $e(E.style || null),
1783
- "data-schedule": E.id
1782
+ cell: q.value
1783
+ }) : Q("", !0),
1784
+ a.value ? (V(!0), P(de, { key: 1 }, we(a.value, (M, w) => (V(), P("div", {
1785
+ class: pe(["vuecal__special-hours", M.class]),
1786
+ style: $e(M.style),
1787
+ innerHTML: M.label || ""
1788
+ }, null, 14, ta))), 256)) : Q("", !0),
1789
+ !o.$slots.cell && $(h).schedules ? (V(!0), P(de, { key: 2 }, we($(h).schedules, (M) => (V(), P("div", {
1790
+ class: pe(["vuecal__schedule vuecal__schedule--cell", M.class]),
1791
+ key: M.id,
1792
+ style: $e(M.style || null),
1793
+ "data-schedule": M.id
1784
1794
  }, [
1785
- o.$slots["cell-events"] ? V(o.$slots, "cell-events", {
1795
+ o.$slots["cell-events"] ? j(o.$slots, "cell-events", {
1786
1796
  key: 0,
1787
- cell: X.value
1788
- }) : Z("", !0),
1789
- j.value || o.$slots["cell-date"] ? (O(), H("div", aa, [
1790
- V(o.$slots, "cell-date", { cell: X.value }, () => [
1791
- qe(ue(j.value), 1)
1797
+ cell: q.value
1798
+ }) : Q("", !0),
1799
+ H.value || o.$slots["cell-date"] ? (V(), P("div", na, [
1800
+ j(o.$slots, "cell-date", { cell: q.value }, () => [
1801
+ qe(ce(H.value), 1)
1792
1802
  ])
1793
- ])) : Z("", !0),
1794
- o.$slots["cell-content"] ? (O(), H("div", na, [
1795
- V(o.$slots, "cell-content", { cell: X.value })
1796
- ])) : Z("", !0),
1797
- o.$slots["cell-events"] && y.value.length ? (O(), H("div", sa, [
1798
- V(o.$slots, "cell-events", { cell: X.value })
1799
- ])) : y.value.length || z.value ? (O(), Se(tt, {
1803
+ ])) : Q("", !0),
1804
+ o.$slots["cell-content"] ? (V(), P("div", sa, [
1805
+ j(o.$slots, "cell-content", { cell: q.value })
1806
+ ])) : Q("", !0),
1807
+ o.$slots["cell-events"] && Y.value.length ? (V(), P("div", la, [
1808
+ j(o.$slots, "cell-events", { cell: q.value })
1809
+ ])) : Y.value.length || E.value ? (V(), Se(tt, {
1800
1810
  key: 4,
1801
1811
  class: "vuecal__cell-events",
1802
1812
  name: "vuecal-event-delete",
1803
- onBeforeLeave: b[0] || (b[0] = (_) => z.value = !0),
1813
+ onBeforeLeave: T[0] || (T[0] = (w) => E.value = !0),
1804
1814
  onAfterLeave: m,
1805
1815
  tag: "div"
1806
1816
  }, {
1807
- default: B(() => [
1808
- (O(!0), H(de, null, we(D.value[E.id], (_) => (O(), Se(st, {
1809
- key: _._.id,
1810
- event: _,
1811
- onEventDeleted: A,
1817
+ default: W(() => [
1818
+ (V(!0), P(de, null, we(v.value[M.id], (w) => (V(), Se(st, {
1819
+ key: w._.id,
1820
+ event: w,
1821
+ onEventDeleted: F,
1812
1822
  "in-all-day-bar": t.allDay,
1813
1823
  "cell-start": t.start,
1814
1824
  "cell-end": t.end,
1815
- style: $e(d.value[_._.id])
1825
+ style: $e(c.value[w._.id])
1816
1826
  }, Ce({ _: 2 }, [
1817
1827
  o.$slots["event.all-day"] && t.allDay ? {
1818
1828
  name: "event.all-day",
1819
- fn: B((N) => [
1820
- V(o.$slots, "event.all-day", ie({ ref_for: !0 }, N))
1829
+ fn: W((R) => [
1830
+ j(o.$slots, "event.all-day", ie({ ref_for: !0 }, R))
1821
1831
  ]),
1822
1832
  key: "0"
1823
1833
  } : void 0,
1824
- o.$slots[`event.${T(r).id}`] ? {
1825
- name: `event.${T(r).id}`,
1826
- fn: B((N) => [
1827
- V(o.$slots, `event.${T(r).id}`, ie({ ref_for: !0 }, N))
1834
+ o.$slots[`event.${$(r).id}`] ? {
1835
+ name: `event.${$(r).id}`,
1836
+ fn: W((R) => [
1837
+ j(o.$slots, `event.${$(r).id}`, ie({ ref_for: !0 }, R))
1828
1838
  ]),
1829
1839
  key: "1"
1830
1840
  } : void 0,
1831
1841
  o.$slots.event ? {
1832
1842
  name: "event",
1833
- fn: B((N) => [
1834
- V(o.$slots, "event", ie({ ref_for: !0 }, N))
1843
+ fn: W((R) => [
1844
+ j(o.$slots, "event", ie({ ref_for: !0 }, R))
1835
1845
  ]),
1836
1846
  key: "2"
1837
1847
  } : void 0
1838
1848
  ]), 1032, ["event", "in-all-day-bar", "cell-start", "cell-end", "style"]))), 128))
1839
1849
  ]),
1840
1850
  _: 2
1841
- }, 1024)) : Z("", !0),
1842
- e.value && u.schedule === E.id && !t.allDay ? (O(), H("div", {
1851
+ }, 1024)) : Q("", !0),
1852
+ e.value && i.schedule === M.id && !t.allDay ? (V(), P("div", {
1843
1853
  key: 5,
1844
1854
  class: "vuecal__event-placeholder",
1845
1855
  style: $e(I.value.style)
1846
- }, ue(I.value.start) + " - " + ue(I.value.end), 5)) : Z("", !0)
1847
- ], 14, ta))), 128)) : Z("", !0),
1848
- !o.$slots.cell && !T(p).schedules ? (O(), H(de, { key: 3 }, [
1849
- o.$slots["cell-events"] ? V(o.$slots, "cell-events", {
1856
+ }, ce(I.value.start) + " - " + ce(I.value.end), 5)) : Q("", !0)
1857
+ ], 14, aa))), 128)) : Q("", !0),
1858
+ !o.$slots.cell && !$(h).schedules ? (V(), P(de, { key: 3 }, [
1859
+ o.$slots["cell-events"] ? j(o.$slots, "cell-events", {
1850
1860
  key: 0,
1851
- cell: X.value
1852
- }) : Z("", !0),
1853
- j.value || o.$slots["cell-date"] ? (O(), H("div", la, [
1854
- V(o.$slots, "cell-date", { cell: X.value }, () => [
1855
- qe(ue(j.value), 1)
1861
+ cell: q.value
1862
+ }) : Q("", !0),
1863
+ H.value || o.$slots["cell-date"] ? (V(), P("div", ra, [
1864
+ j(o.$slots, "cell-date", { cell: q.value }, () => [
1865
+ qe(ce(H.value), 1)
1856
1866
  ])
1857
- ])) : Z("", !0),
1858
- o.$slots["cell-content"] ? (O(), H("div", ra, [
1859
- V(o.$slots, "cell-content", { cell: X.value })
1860
- ])) : Z("", !0),
1861
- o.$slots["cell-events"] && y.value.length ? (O(), H("div", oa, [
1862
- V(o.$slots, "cell-events", { cell: X.value })
1863
- ])) : !(T(r).isMonth && !T(p).eventsOnMonthView) && !T(r).isYear && !T(r).isYears && (y.value.length || z.value) ? (O(), Se(tt, {
1867
+ ])) : Q("", !0),
1868
+ o.$slots["cell-content"] ? (V(), P("div", oa, [
1869
+ j(o.$slots, "cell-content", { cell: q.value })
1870
+ ])) : Q("", !0),
1871
+ o.$slots["cell-events"] && Y.value.length ? (V(), P("div", ia, [
1872
+ j(o.$slots, "cell-events", { cell: q.value })
1873
+ ])) : !($(r).isMonth && !$(h).eventsOnMonthView) && !$(r).isYear && !$(r).isYears && (Y.value.length || E.value) ? (V(), Se(tt, {
1864
1874
  key: 4,
1865
1875
  class: "vuecal__cell-events",
1866
1876
  name: "vuecal-event-delete",
1867
- onBeforeLeave: b[1] || (b[1] = (E) => z.value = !0),
1877
+ onBeforeLeave: T[1] || (T[1] = (M) => E.value = !0),
1868
1878
  onAfterLeave: m,
1869
1879
  tag: "div"
1870
1880
  }, {
1871
- default: B(() => [
1872
- (O(!0), H(de, null, we(y.value, (E) => (O(), Se(st, {
1873
- key: E._.id,
1874
- event: E,
1875
- onEventDeleted: A,
1881
+ default: W(() => [
1882
+ (V(!0), P(de, null, we(Y.value, (M) => (V(), Se(st, {
1883
+ key: M._.id,
1884
+ event: M,
1885
+ onEventDeleted: F,
1876
1886
  "in-all-day-bar": t.allDay,
1877
1887
  "cell-start": t.start,
1878
1888
  "cell-end": t.end,
1879
- class: De(i.value[E._.id]),
1880
- style: $e(d.value[E._.id])
1889
+ class: pe(u.value[M._.id]),
1890
+ style: $e(c.value[M._.id])
1881
1891
  }, Ce({ _: 2 }, [
1882
1892
  o.$slots["event.all-day"] && t.allDay ? {
1883
1893
  name: "event.all-day",
1884
- fn: B((_) => [
1885
- V(o.$slots, "event.all-day", ie({ ref_for: !0 }, _))
1894
+ fn: W((w) => [
1895
+ j(o.$slots, "event.all-day", ie({ ref_for: !0 }, w))
1886
1896
  ]),
1887
1897
  key: "0"
1888
1898
  } : void 0,
1889
- o.$slots[`event.${T(r).id}`] ? {
1890
- name: `event.${T(r).id}`,
1891
- fn: B((_) => [
1892
- V(o.$slots, `event.${T(r).id}`, ie({ ref_for: !0 }, _))
1899
+ o.$slots[`event.${$(r).id}`] ? {
1900
+ name: `event.${$(r).id}`,
1901
+ fn: W((w) => [
1902
+ j(o.$slots, `event.${$(r).id}`, ie({ ref_for: !0 }, w))
1893
1903
  ]),
1894
1904
  key: "1"
1895
1905
  } : void 0,
1896
1906
  o.$slots.event ? {
1897
1907
  name: "event",
1898
- fn: B((_) => [
1899
- V(o.$slots, "event", ie({ ref_for: !0 }, _))
1908
+ fn: W((w) => [
1909
+ j(o.$slots, "event", ie({ ref_for: !0 }, w))
1900
1910
  ]),
1901
1911
  key: "2"
1902
1912
  } : void 0
1903
1913
  ]), 1032, ["event", "in-all-day-bar", "cell-start", "cell-end", "class", "style"]))), 128))
1904
1914
  ]),
1905
1915
  _: 3
1906
- })) : Z("", !0),
1907
- e.value ? (O(), H("div", {
1916
+ })) : Q("", !0),
1917
+ e.value ? (V(), P("div", {
1908
1918
  key: 5,
1909
1919
  class: "vuecal__event-placeholder",
1910
1920
  style: $e(I.value.style)
1911
- }, ue(I.value.start) + " - " + ue(I.value.end), 5)) : Z("", !0)
1912
- ], 64)) : Z("", !0),
1913
- o.$slots["event-count"] ? V(o.$slots, "event-count", {
1921
+ }, ce(I.value.start) + " - " + ce(I.value.end), 5)) : Q("", !0)
1922
+ ], 64)) : Q("", !0),
1923
+ o.$slots["event-count"] ? j(o.$slots, "event-count", {
1914
1924
  key: 4,
1915
- events: v.value
1916
- }) : k.value ? (O(), H("div", ia, ue(v.value.length), 1)) : Z("", !0),
1917
- x.show ? (O(), H("div", {
1925
+ events: _.value
1926
+ }) : p.value ? (V(), P("div", ua, ce(_.value.length), 1)) : Q("", !0),
1927
+ K.show ? (V(), P("div", {
1918
1928
  key: 6,
1919
1929
  class: "vuecal__now-line",
1920
- style: $e(x.style),
1921
- title: x.currentTime
1930
+ style: $e(K.style),
1931
+ title: K.currentTime
1922
1932
  }, [
1923
- me("span", null, ue(x.currentTime), 1)
1924
- ], 12, ua)) : Z("", !0)
1933
+ he("span", null, ce(K.currentTime), 1)
1934
+ ], 12, ca)) : Q("", !0)
1925
1935
  ], 16));
1926
1936
  }
1927
- }, ca = {
1937
+ }, da = {
1928
1938
  key: 0,
1929
1939
  class: "vuecal__headings"
1930
- }, da = {
1940
+ }, va = {
1931
1941
  key: 0,
1932
1942
  class: "vuecal__weekdays-headings"
1933
- }, va = ["onClick"], fa = { class: "vuecal__weekday-day" }, ma = {
1943
+ }, fa = ["onClick"], ma = { class: "vuecal__weekday-day" }, ga = {
1934
1944
  key: 0,
1935
1945
  class: "vuecal__weekday-date"
1936
- }, ga = {
1946
+ }, ha = {
1937
1947
  key: 1,
1938
1948
  class: "vuecal__schedules-headings w-flex grow"
1939
- }, ha = ["innerHTML"], ya = {
1949
+ }, ya = ["innerHTML"], Da = {
1940
1950
  key: 2,
1941
1951
  class: "vuecal__all-day w-flex grow"
1942
- }, Da = {
1952
+ }, pa = {
1943
1953
  __name: "headings-bar",
1944
- setup(h) {
1945
- const t = He("vuecal"), c = He("$vuecalEl"), { view: r, config: p, dateUtils: Y } = t, W = M(() => p.xs ? "day-xs" : p.sm || r.isDays || r.isMonth ? "day-sm" : "day"), f = M(() => (r.isDay || r.isDays || r.isWeek || r.isMonth) && !(r.isDay && !p.schedules && !p.allDayEvents)), L = M(() => r.cellDates.slice(0, r.cols).map(({ start: l }) => ({
1954
+ setup(y) {
1955
+ const t = He("vuecal"), d = He("$vuecalEl"), { view: r, config: h, dateUtils: C } = t, B = b(() => h.xs ? "day-xs" : h.sm || r.isDays || r.isMonth ? "day-sm" : "day"), f = b(() => (r.isDay || r.isDays || r.isWeek || r.isMonth) && !(r.isDay && !h.schedules && !h.allDayEvents)), A = b(() => r.cellDates.slice(0, h.horizontal ? r.rows : r.cols).map(({ start: l }) => ({
1946
1956
  id: Ge[l.getDay()],
1947
1957
  date: l,
1948
1958
  dateNumber: l.getDate(),
1949
- day: Y.formatDate(l, "dddd"),
1950
- "day-sm": Y.formatDate(l, "ddd"),
1951
- "day-xs": Y.formatDate(l, "dd"),
1952
- isToday: Y.isToday(l)
1953
- }))), U = {
1959
+ day: C.formatDate(l, "dddd"),
1960
+ "day-sm": C.formatDate(l, "ddd"),
1961
+ "day-xs": C.formatDate(l, "dd"),
1962
+ isToday: C.isToday(l)
1963
+ }))), Z = {
1954
1964
  click: (l) => {
1955
1965
  (r.isDays || r.isWeek) && r.updateSelectedDate(l);
1956
1966
  }
1957
- }, P = {
1958
- isResizing: ce(!1),
1959
- startY: ce(0),
1960
- initialHeight: ce(0),
1967
+ }, L = {
1968
+ isResizing: ue(!1),
1969
+ startY: ue(0),
1970
+ initialHeight: ue(0),
1961
1971
  defaultHeight: 25,
1962
1972
  // Default height in pixels.
1973
+ // Or in the case of horizontal layout.
1974
+ startX: ue(0),
1975
+ initialWidth: ue(0),
1976
+ defaultWidth: 25,
1977
+ // Default width in pixels.
1963
1978
  // Cleanup event listeners.
1964
1979
  cleanup() {
1965
- typeof document < "u" && (document.removeEventListener("mousemove", P.handleMouseMove), document.removeEventListener("mouseup", P.cleanup), document.removeEventListener("touchmove", P.handleTouchMove, { passive: !1 }), document.removeEventListener("touchend", P.cleanup)), P.isResizing.value = !1;
1980
+ typeof document < "u" && (document.removeEventListener("mousemove", L.handleMouseMove), document.removeEventListener("mouseup", L.cleanup), document.removeEventListener("touchmove", L.handleTouchMove, { passive: !1 }), document.removeEventListener("touchend", L.cleanup)), L.isResizing.value = !1;
1966
1981
  },
1967
- startResize(l) {
1968
- var A;
1969
- this.isResizing.value = !0, this.startY.value = l;
1970
- const z = (A = c.value) == null ? void 0 : A.querySelector(".vuecal__all-day");
1971
- z && (this.initialHeight.value = z.offsetHeight), document.addEventListener("mousemove", P.handleMouseMove), document.addEventListener("mouseup", P.cleanup), document.addEventListener("touchmove", P.handleTouchMove, { passive: !1 }), document.addEventListener("touchend", P.cleanup);
1982
+ startResize(l, E) {
1983
+ var i;
1984
+ this.isResizing.value = !0;
1985
+ const F = h.horizontal;
1986
+ this[F ? "startX" : "startY"].value = F ? l : E;
1987
+ const m = (i = d.value) == null ? void 0 : i.querySelector(".vuecal__all-day");
1988
+ m && (this[F ? "initialWidth" : "initialHeight"].value = m[F ? "offsetWidth" : "offsetHeight"]), document.addEventListener("mousemove", L.handleMouseMove), document.addEventListener("mouseup", L.cleanup), document.addEventListener("touchmove", L.handleTouchMove, { passive: !1 }), document.addEventListener("touchend", L.cleanup);
1972
1989
  },
1973
- // Update height based on mouse/touch movement.
1974
- updateHeight(l) {
1975
- var m;
1990
+ // Update height/width based on mouse/touch movement.
1991
+ updateSize(l, E) {
1992
+ var S;
1976
1993
  if (!this.isResizing.value) return;
1977
- const z = l - this.startY.value, A = Math.max(20, this.initialHeight.value + z);
1978
- (m = c.value) == null || m.style.setProperty("--vuecal-all-day-bar-height", `${A}px`);
1994
+ const F = h.horizontal, m = F ? l - this.startX.value : E - this.startY.value, i = Math.max(20, this[F ? "initialWidth" : "initialHeight"].value + m);
1995
+ (S = d.value) == null || S.style.setProperty("--vuecal-all-day-bar-height", `${i}px`);
1979
1996
  },
1980
1997
  // Mouse event handlers.
1981
1998
  handleMouseDown(l) {
1982
- this.startResize(l.clientY);
1999
+ this.startResize(l.clientX, l.clientY);
1983
2000
  },
1984
2001
  handleMouseMove(l) {
1985
- P.updateHeight(l.clientY);
2002
+ L.updateSize(l.clientX, l.clientY);
1986
2003
  },
1987
2004
  // Touch event handlers.
1988
2005
  handleTouchStart(l) {
1989
- var z;
1990
- (z = l.touches) != null && z[0] && this.startResize(l.touches[0].clientY);
2006
+ var E;
2007
+ (E = l.touches) != null && E[0] && this.startResize(l.touches[0].clientX, l.touches[0].clientY);
1991
2008
  },
1992
2009
  handleTouchMove(l) {
1993
- var z;
1994
- (z = l.touches) != null && z[0] && (P.updateHeight(l.touches[0].clientY), l.preventDefault());
2010
+ var E;
2011
+ (E = l.touches) != null && E[0] && (L.updateSize(l.touches[0].clientX, l.touches[0].clientY), l.preventDefault());
1995
2012
  }
1996
2013
  };
1997
- return Ne(() => {
1998
- P.cleanup();
1999
- }), (l, z) => f.value ? (O(), H("div", ca, [
2000
- T(r).isDay ? Z("", !0) : (O(), H("div", da, [
2001
- (O(!0), H(de, null, we(L.value, (A, m) => (O(), H("div", {
2002
- class: De(["vuecal__weekday", { "vuecal__weekday--today": A.isToday }]),
2014
+ return Re(() => {
2015
+ L.cleanup();
2016
+ }), (l, E) => f.value ? (V(), P("div", da, [
2017
+ $(r).isDay ? Q("", !0) : (V(), P("div", va, [
2018
+ (V(!0), P(de, null, we(A.value, (F, m) => (V(), P("div", {
2019
+ class: pe(["vuecal__weekday", { "vuecal__weekday--today": F.isToday }]),
2003
2020
  key: m,
2004
- onClick: (u) => U.click(A.date)
2021
+ onClick: (i) => Z.click(F.date)
2005
2022
  }, [
2006
- V(l.$slots, "weekday-heading", {
2007
- label: A[W.value],
2008
- id: A.id,
2009
- date: A.date
2023
+ j(l.$slots, "weekday-heading", {
2024
+ label: F[B.value],
2025
+ id: F.id,
2026
+ date: F.date
2010
2027
  }, () => [
2011
- me("span", fa, ue(A[W.value]), 1),
2012
- T(r).isMonth ? Z("", !0) : (O(), H("strong", ma, ue(A.dateNumber), 1))
2028
+ he("span", ma, ce(F[B.value]), 1),
2029
+ $(r).isMonth ? Q("", !0) : (V(), P("strong", ga, ce(F.dateNumber), 1))
2013
2030
  ])
2014
- ], 10, va))), 128))
2031
+ ], 10, fa))), 128))
2015
2032
  ])),
2016
- T(p).schedules ? (O(), H("div", ga, [
2017
- (O(!0), H(de, null, we(L.value, (A, m) => (O(), H(de, { key: m }, [
2018
- (O(!0), H(de, null, we(T(p).schedules, (u, S) => (O(), H(de, { key: S }, [
2019
- l.$slots["schedule-heading"] ? (O(), H("div", {
2033
+ $(h).schedules ? (V(), P("div", ha, [
2034
+ (V(!0), P(de, null, we(A.value, (F, m) => (V(), P(de, { key: m }, [
2035
+ (V(!0), P(de, null, we($(h).schedules, (i, S) => (V(), P(de, { key: S }, [
2036
+ l.$slots["schedule-heading"] ? (V(), P("div", {
2020
2037
  key: 0,
2021
- class: De(["vuecal__schedule vuecal__schedule--heading", u.class])
2038
+ class: pe(["vuecal__schedule vuecal__schedule--heading", i.class])
2022
2039
  }, [
2023
- V(l.$slots, "schedule-heading", {
2024
- schedule: u,
2025
- view: T(r)
2040
+ j(l.$slots, "schedule-heading", {
2041
+ schedule: i,
2042
+ view: $(r)
2026
2043
  })
2027
- ], 2)) : (O(), H("div", {
2044
+ ], 2)) : (V(), P("div", {
2028
2045
  key: 1,
2029
- class: De(["vuecal__schedule vuecal__schedule--heading", u.class]),
2030
- innerHTML: u.label
2031
- }, null, 10, ha))
2046
+ class: pe(["vuecal__schedule vuecal__schedule--heading", i.class]),
2047
+ innerHTML: i.label
2048
+ }, null, 10, ya))
2032
2049
  ], 64))), 128))
2033
2050
  ], 64))), 128))
2034
- ])) : Z("", !0),
2035
- T(p).allDayEvents ? (O(), H("div", ya, [
2036
- (O(!0), H(de, null, we(L.value, (A, m) => (O(), Se(kt, {
2037
- class: De(["vuecal__all-day-cell", { "vuecal__weekday--today": A.isToday }]),
2051
+ ])) : Q("", !0),
2052
+ $(h).allDayEvents ? (V(), P("div", Da, [
2053
+ (V(!0), P(de, null, we(A.value, (F, m) => (V(), Se(kt, {
2054
+ class: pe(["vuecal__all-day-cell", { "vuecal__weekday--today": F.isToday }]),
2038
2055
  key: m,
2039
- start: A.date,
2040
- end: new Date(A.date.getTime() + 1440 * 60 * 1e3 - 1),
2056
+ start: F.date,
2057
+ end: new Date(F.date.getTime() + 1440 * 60 * 1e3 - 1),
2041
2058
  index: m,
2042
2059
  "all-day": ""
2043
2060
  }, Ce({ _: 2 }, [
2044
2061
  l.$slots["event.all-day"] ? {
2045
2062
  name: "event.all-day",
2046
- fn: B((u) => [
2047
- V(l.$slots, "event.all-day", ie({ ref_for: !0 }, u))
2063
+ fn: W((i) => [
2064
+ j(l.$slots, "event.all-day", ie({ ref_for: !0 }, i))
2048
2065
  ]),
2049
2066
  key: "0"
2050
2067
  } : {
2051
2068
  name: "event",
2052
- fn: B((u) => [
2053
- V(l.$slots, "event", ie({ ref_for: !0 }, u))
2069
+ fn: W((i) => [
2070
+ j(l.$slots, "event", ie({ ref_for: !0 }, i))
2054
2071
  ]),
2055
2072
  key: "1"
2056
2073
  }
2057
2074
  ]), 1032, ["class", "start", "end", "index"]))), 128)),
2058
- me("div", {
2075
+ he("div", {
2059
2076
  class: "vuecal__all-day-resizer",
2060
- onMousedown: z[0] || (z[0] = (...A) => P.handleMouseDown && P.handleMouseDown(...A)),
2061
- onTouchstart: z[1] || (z[1] = (...A) => P.handleTouchStart && P.handleTouchStart(...A))
2077
+ onMousedown: E[0] || (E[0] = (...F) => L.handleMouseDown && L.handleMouseDown(...F)),
2078
+ onTouchstart: E[1] || (E[1] = (...F) => L.handleTouchStart && L.handleTouchStart(...F))
2062
2079
  }, null, 32)
2063
- ])) : Z("", !0)
2064
- ])) : Z("", !0);
2080
+ ])) : Q("", !0)
2081
+ ])) : Q("", !0);
2065
2082
  }
2066
- }, pa = { class: "vuecal__time-column" }, wa = {
2083
+ }, wa = { class: "vuecal__time-column" }, _a = {
2067
2084
  key: 0,
2068
2085
  class: "vuecal__all-day-label"
2069
- }, _a = {
2086
+ }, ka = {
2070
2087
  __name: "time-column",
2071
- setup(h) {
2072
- const t = He("vuecal"), { config: c, texts: r } = t, p = M(() => {
2073
- const Y = [];
2074
- for (let f = c.timeFrom; f < c.timeTo; f += c.timeStep) {
2075
- const L = f + c.timeStep > c.timeTo, U = ~~(f / 60), P = f % 60, l = r[f < 720 ? "am" : "pm"];
2076
- let z = null;
2077
- L && (z = `calc(var(--vuecal-time-cell-height) * ${(c.timeTo - f) / c.timeStep})`), Y.push({
2088
+ setup(y) {
2089
+ const t = He("vuecal"), { config: d, texts: r } = t, h = b(() => {
2090
+ const C = [];
2091
+ for (let f = d.timeFrom; f < d.timeTo; f += d.timeStep) {
2092
+ const A = f + d.timeStep > d.timeTo, Z = ~~(f / 60), L = f % 60, l = r[f < 720 ? "am" : "pm"];
2093
+ let E = null;
2094
+ A && (E = `calc(var(--vuecal-time-cell-height) * ${(d.timeTo - f) / d.timeStep})`), C.push({
2078
2095
  minutesSum: f,
2079
2096
  // The sum of hours + minutes in minutes.
2080
- hours: U,
2081
- minutes: P,
2082
- formatted12: `${U % 12 ? U % 12 : 12}${P ? `:${P.toString().padStart(2, 0)}` : ""}${l}`,
2083
- formatted24: `${U.toString().padStart(2, 0)}:${P.toString().padStart(2, 0)}`,
2084
- height: z
2097
+ hours: Z,
2098
+ minutes: L,
2099
+ formatted12: `${Z % 12 ? Z % 12 : 12}${L ? `:${L.toString().padStart(2, 0)}` : ""}${l}`,
2100
+ formatted24: `${Z.toString().padStart(2, 0)}:${L.toString().padStart(2, 0)}`,
2101
+ height: E
2085
2102
  });
2086
2103
  }
2087
- return Y;
2104
+ return C;
2088
2105
  });
2089
- return (Y, W) => (O(), H("div", pa, [
2090
- T(c).allDayEvents ? (O(), H("div", wa, [
2091
- V(Y.$slots, "all-day-label", {}, () => [
2092
- qe(ue(T(t).texts.allDay), 1)
2106
+ return (C, B) => (V(), P("div", wa, [
2107
+ $(d).allDayEvents ? (V(), P("div", _a, [
2108
+ j(C.$slots, "all-day-label", {}, () => [
2109
+ qe(ce($(t).texts.allDay), 1)
2093
2110
  ])
2094
- ])) : Z("", !0),
2095
- (O(!0), H(de, null, we(p.value, (f, L) => (O(), H("div", {
2111
+ ])) : Q("", !0),
2112
+ (V(!0), P(de, null, we(h.value, (f, A) => (V(), P("div", {
2096
2113
  class: "vuecal__time-cell",
2097
- key: L,
2114
+ key: A,
2098
2115
  style: $e({ height: f.height || null })
2099
2116
  }, [
2100
- V(Y.$slots, "time-cell", {
2101
- index: L,
2117
+ j(C.$slots, "time-cell", {
2118
+ index: A,
2102
2119
  minutes: f.minutes,
2103
2120
  hours: f.hours,
2104
2121
  minutesSum: f.minutesSum,
2105
2122
  format12: f.formatted12,
2106
2123
  format24: f.formatted24
2107
2124
  }, () => [
2108
- me("label", null, ue(T(c).twelveHour ? f.formatted12 : f.formatted24), 1)
2125
+ he("label", null, ce($(d).twelveHour ? f.formatted12 : f.formatted24), 1)
2109
2126
  ])
2110
2127
  ], 4))), 128))
2111
2128
  ]));
2112
2129
  }
2113
- }, ka = {
2130
+ }, $a = {
2114
2131
  __name: "body",
2115
- setup(h) {
2116
- const t = He("vuecal"), { view: c, config: r, dateUtils: p, touch: Y, eventsManager: W } = t, f = ce(null), L = ce(null), { resizeState: U } = W, P = M(() => ({
2117
- "--vuecal-grid-columns": c.cols,
2118
- "--vuecal-grid-rows": c.rows,
2132
+ setup(y) {
2133
+ const t = He("vuecal"), { view: d, config: r, dateUtils: h, touch: C, eventsManager: B } = t, f = ue(null), A = ue(null), { resizeState: Z } = B, L = b(() => ({
2134
+ "--vuecal-grid-columns": d.cols,
2135
+ "--vuecal-grid-rows": d.rows,
2119
2136
  "--vuecal-body-max-height": r.time ? `${r.timeCellHeight * (r.timeTo - r.timeFrom) / r.timeStep}px` : null
2120
- })), l = M(() => {
2121
- const u = p.formatTime(je(L.value, r));
2137
+ })), l = b(() => {
2138
+ const i = h.formatTime(je(A.value, r));
2122
2139
  return {
2123
- style: { top: `${L.value}%` },
2124
- time: u
2140
+ style: { top: `${A.value}%` },
2141
+ time: i
2125
2142
  };
2126
- }), z = (u) => {
2127
- var C;
2128
- if (c.isMonth || c.isYear || c.isYears) return;
2129
- const S = ((C = u.touches) == null ? void 0 : C[0]) || u, { clientX: n, clientY: I } = S, { top: e } = f.value.getBoundingClientRect();
2130
- L.value = Ke(I - e, f.value), Y.isResizingEvent && r.editableEvents.resizeX && (U.cellEl = m(n, I));
2131
- }, A = () => {
2132
- L.value = null;
2133
- }, m = (u, S) => {
2134
- const n = document.elementFromPoint(u, S);
2143
+ }), E = (i) => {
2144
+ var z;
2145
+ if (d.isMonth || d.isYear || d.isYears) return;
2146
+ const S = ((z = i.touches) == null ? void 0 : z[0]) || i, { clientX: n, clientY: I } = S, { top: e } = f.value.getBoundingClientRect();
2147
+ A.value = Ke(I - e, f.value), C.isResizingEvent && r.editableEvents.resizeX && (Z.cellEl = m(n, I));
2148
+ }, F = () => {
2149
+ A.value = null;
2150
+ }, m = (i, S) => {
2151
+ const n = document.elementFromPoint(i, S);
2135
2152
  return console.log(n == null ? void 0 : n.closest(".vuecal__cell")), (n == null ? void 0 : n.closest(".vuecal__cell")) || null;
2136
2153
  };
2137
2154
  return Ze(() => {
2138
- f.value.addEventListener("mousemove", z), f.value.addEventListener("touchmove", z), f.value.addEventListener("mouseleave", A), f.value.addEventListener("touchend", A);
2139
- }), Ne(() => {
2140
- f.value && (f.value.removeEventListener("mousemove", z), f.value.removeEventListener("touchmove", z), f.value.removeEventListener("mouseleave", A), f.value.removeEventListener("touchend", A));
2141
- }), (u, S) => (O(), H("div", {
2155
+ f.value.addEventListener("mousemove", E), f.value.addEventListener("touchmove", E), f.value.addEventListener("mouseleave", F), f.value.addEventListener("touchend", F);
2156
+ }), Re(() => {
2157
+ f.value && (f.value.removeEventListener("mousemove", E), f.value.removeEventListener("touchmove", E), f.value.removeEventListener("mouseleave", F), f.value.removeEventListener("touchend", F));
2158
+ }), (i, S) => (V(), P("div", {
2142
2159
  class: "vuecal__body",
2143
2160
  ref_key: "bodyEl",
2144
2161
  ref: f,
2145
- style: $e(P.value)
2162
+ style: $e(L.value)
2146
2163
  }, [
2147
- Ve(Je, { name: "vuecal-shrink" }, {
2148
- default: B(() => [
2149
- T(r).timeAtCursor && L.value !== null ? (O(), H("div", {
2164
+ Oe(Ue, { name: "vuecal-shrink" }, {
2165
+ default: W(() => [
2166
+ $(r).timeAtCursor && A.value !== null ? (V(), P("div", {
2150
2167
  key: 0,
2151
2168
  class: "vuecal__time-at-cursor",
2152
2169
  style: $e(l.value.style)
2153
2170
  }, [
2154
- me("label", null, ue(l.value.time), 1)
2155
- ], 4)) : Z("", !0)
2171
+ he("label", null, ce(l.value.time), 1)
2172
+ ], 4)) : Q("", !0)
2156
2173
  ]),
2157
2174
  _: 1
2158
2175
  }),
2159
- (O(!0), H(de, null, we(T(c).cellDates, (n, I) => (O(), Se(kt, {
2176
+ (V(!0), P(de, null, we($(d).cellDates, (n, I) => (V(), Se(kt, {
2160
2177
  key: I,
2161
2178
  start: n.start,
2162
2179
  end: n.end,
2163
2180
  index: I
2164
2181
  }, Ce({ _: 2 }, [
2165
- u.$slots.cell ? {
2182
+ i.$slots.cell ? {
2166
2183
  name: "cell",
2167
- fn: B((e) => [
2168
- V(u.$slots, "cell", ie({ ref_for: !0 }, e))
2184
+ fn: W((e) => [
2185
+ j(i.$slots, "cell", ie({ ref_for: !0 }, e))
2169
2186
  ]),
2170
2187
  key: "0"
2171
2188
  } : void 0,
2172
- u.$slots["cell-date"] ? {
2189
+ i.$slots["cell-date"] ? {
2173
2190
  name: "cell-date",
2174
- fn: B((e) => [
2175
- V(u.$slots, "cell-date", ie({ ref_for: !0 }, e))
2191
+ fn: W((e) => [
2192
+ j(i.$slots, "cell-date", ie({ ref_for: !0 }, e))
2176
2193
  ]),
2177
2194
  key: "1"
2178
2195
  } : void 0,
2179
- u.$slots["cell-content"] ? {
2196
+ i.$slots["cell-content"] ? {
2180
2197
  name: "cell-content",
2181
- fn: B((e) => [
2182
- V(u.$slots, "cell-content", ie({ ref_for: !0 }, e))
2198
+ fn: W((e) => [
2199
+ j(i.$slots, "cell-content", ie({ ref_for: !0 }, e))
2183
2200
  ]),
2184
2201
  key: "2"
2185
2202
  } : void 0,
2186
- u.$slots["cell-events"] ? {
2203
+ i.$slots["cell-events"] ? {
2187
2204
  name: "cell-events",
2188
- fn: B((e) => [
2189
- V(u.$slots, "cell-events", ie({ ref_for: !0 }, e))
2205
+ fn: W((e) => [
2206
+ j(i.$slots, "cell-events", ie({ ref_for: !0 }, e))
2190
2207
  ]),
2191
2208
  key: "3"
2192
2209
  } : void 0,
2193
- u.$slots[`event.${T(c).id}`] ? {
2194
- name: `event.${T(c).id}`,
2195
- fn: B((e) => [
2196
- V(u.$slots, `event.${T(c).id}`, ie({ ref_for: !0 }, e))
2210
+ i.$slots[`event.${$(d).id}`] ? {
2211
+ name: `event.${$(d).id}`,
2212
+ fn: W((e) => [
2213
+ j(i.$slots, `event.${$(d).id}`, ie({ ref_for: !0 }, e))
2197
2214
  ]),
2198
2215
  key: "4"
2199
2216
  } : void 0,
2200
- u.$slots["event.all-day"] ? {
2217
+ i.$slots["event.all-day"] ? {
2201
2218
  name: "event.all-day",
2202
- fn: B((e) => [
2203
- V(u.$slots, "event.all-day", ie({ ref_for: !0 }, e))
2219
+ fn: W((e) => [
2220
+ j(i.$slots, "event.all-day", ie({ ref_for: !0 }, e))
2204
2221
  ]),
2205
2222
  key: "5"
2206
2223
  } : void 0,
2207
- u.$slots.event ? {
2224
+ i.$slots.event ? {
2208
2225
  name: "event",
2209
- fn: B((e) => [
2210
- V(u.$slots, "event", ie({ ref_for: !0 }, e))
2226
+ fn: W((e) => [
2227
+ j(i.$slots, "event", ie({ ref_for: !0 }, e))
2211
2228
  ]),
2212
2229
  key: "6"
2213
2230
  } : void 0,
2214
- u.$slots["event-count"] ? {
2231
+ i.$slots["event-count"] ? {
2215
2232
  name: "event-count",
2216
- fn: B((e) => [
2217
- V(u.$slots, "event-count", ie({ ref_for: !0 }, e))
2233
+ fn: W((e) => [
2234
+ j(i.$slots, "event-count", ie({ ref_for: !0 }, e))
2218
2235
  ]),
2219
2236
  key: "7"
2220
2237
  } : void 0
2221
2238
  ]), 1032, ["start", "end", "index"]))), 128))
2222
2239
  ], 4));
2223
2240
  }
2224
- }, $a = ["data-locale"], ba = { class: "vuecal__scrollable-wrap" }, Ta = {
2241
+ }, ba = ["data-locale"], Ta = { class: "vuecal__scrollable-wrap" }, Ma = {
2225
2242
  key: 1,
2226
2243
  class: "vuecal__week-numbers"
2227
- }, Ma = { class: "vuecal__week-number" }, Ea = { class: "vuecal__body-wrap" }, Sa = {
2244
+ }, Ea = { class: "vuecal__week-number" }, Ya = { class: "vuecal__body-wrap" }, Ca = {
2228
2245
  __name: "index",
2229
2246
  props: Lt,
2230
2247
  emits: [
@@ -2240,8 +2257,8 @@ const lt = (h, t) => {
2240
2257
  "event-drag-start",
2241
2258
  "event-drag-end"
2242
2259
  ],
2243
- setup(h, { expose: t, emit: c }) {
2244
- const r = h, p = c, Y = Tt("vuecal-el"), W = Ht({ props: r, emit: p, attrs: Et(), vuecalEl: Y, uid: Mt() }), { config: f, view: L, dateUtils: U, touch: P } = W, l = M(() => f.time && (L.isDay || L.isDays || L.isWeek)), z = M(() => Array(L.rows).fill().map((n, I) => U.getWeek(U.addDays(L.firstCellDate, 7 * I)))), A = M(() => {
2260
+ setup(y, { expose: t, emit: d }) {
2261
+ const r = y, h = d, C = Tt("vuecal-el"), B = Ht({ props: r, emit: h, attrs: Et(), vuecalEl: C, uid: Mt() }), { config: f, view: A, dateUtils: Z, touch: L } = B, l = b(() => f.time && (A.isDay || A.isDays || A.isWeek)), E = b(() => Array(A.rows).fill().map((n, I) => Z.getWeek(Z.addDays(A.firstCellDate, 7 * I)))), F = b(() => {
2245
2262
  var n;
2246
2263
  return {
2247
2264
  "vuecal--ready": f.ready,
@@ -2250,22 +2267,23 @@ const lt = (h, t) => {
2250
2267
  "vuecal--date-picker": f.datePicker,
2251
2268
  "vuecal--dark": f.dark,
2252
2269
  "vuecal--light": !f.dark,
2253
- [`vuecal--${L.id}-view`]: !0,
2270
+ [`vuecal--${A.id}-view`]: !0,
2254
2271
  "vuecal--view-has-time": l.value,
2255
2272
  "vuecal--timeless": !f.time,
2256
- "vuecal--dragging-cell": P.isDraggingCell,
2257
- "vuecal--dragging-event": P.isDraggingEvent,
2258
- "vuecal--resizing-event": P.isResizingEvent,
2259
- "vuecal--has-schedules": (n = f.schedules) == null ? void 0 : n.length
2273
+ "vuecal--dragging-cell": L.isDraggingCell,
2274
+ "vuecal--dragging-event": L.isDraggingEvent,
2275
+ "vuecal--resizing-event": L.isResizingEvent,
2276
+ "vuecal--has-schedules": (n = f.schedules) == null ? void 0 : n.length,
2277
+ "vuecal--horizontal": f.horizontal
2260
2278
  };
2261
- }), m = M(() => ({
2279
+ }), m = b(() => ({
2262
2280
  "--vuecal-time-cell-height": f.timeCellHeight && `${f.timeCellHeight}px`
2263
- })), u = M(() => {
2281
+ })), i = b(() => {
2264
2282
  var n, I;
2265
2283
  return {
2266
- "vuecal__scrollable--row": l.value || f.weekNumbers && L.isMonth,
2284
+ "vuecal__scrollable--row": l.value || f.weekNumbers && A.isMonth,
2267
2285
  // Keep the states inside the Vue transition wrapper for smooth CSS transitions.
2268
- [`vuecal__scrollable--${L.id}-view`]: !0,
2286
+ [`vuecal__scrollable--${A.id}-view`]: !0,
2269
2287
  "vuecal__scrollable--has-schedules": (n = f.schedules) == null ? void 0 : n.length,
2270
2288
  "vuecal__scrollable--no-schedules": !((I = f.schedules) != null && I.length),
2271
2289
  "vuecal__scrollable--no-all-day-bar": !f.allDayEvents,
@@ -2275,216 +2293,216 @@ const lt = (h, t) => {
2275
2293
  n.target.closest(".vuecal__cell") && n.preventDefault();
2276
2294
  };
2277
2295
  return Ze(async () => {
2278
- typeof window < "u" && window.hasOwnProperty("ontouchstart") && Y.value.addEventListener("contextmenu", S), await Ie(), f.ready = !0, p("ready", { config: f, view: L });
2279
- }), Ne(() => {
2296
+ typeof window < "u" && window.hasOwnProperty("ontouchstart") && C.value.addEventListener("contextmenu", S), await Xe(), f.ready = !0, h("ready", { config: f, view: A });
2297
+ }), Re(() => {
2280
2298
  var n;
2281
- (n = Y == null ? void 0 : Y.value) == null || n.removeEventListener("contextmenu", S);
2282
- }), at("vuecal", W), at("$vuecalEl", Y), t({ view: W.view }), (n, I) => (O(), H("div", {
2283
- class: De(["vuecal", A.value]),
2299
+ (n = C == null ? void 0 : C.value) == null || n.removeEventListener("contextmenu", S);
2300
+ }), at("vuecal", B), at("$vuecalEl", C), t({ view: B.view }), (n, I) => (V(), P("div", {
2301
+ class: pe(["vuecal", F.value]),
2284
2302
  ref: "vuecal-el",
2285
2303
  "data-locale": n.locale,
2286
2304
  style: $e(m.value)
2287
2305
  }, [
2288
- n.$slots.diy ? V(n.$slots, "diy", {
2306
+ n.$slots.diy ? j(n.$slots, "diy", {
2289
2307
  key: 0,
2290
- vuecal: T(W)
2291
- }) : (O(), H(de, { key: 1 }, [
2292
- Ve(It, null, Ce({ _: 2 }, [
2308
+ vuecal: $(B)
2309
+ }) : (V(), P(de, { key: 1 }, [
2310
+ Oe(Xt, null, Ce({ _: 2 }, [
2293
2311
  n.$slots.header ? {
2294
2312
  name: "header",
2295
- fn: B((e) => [
2296
- V(n.$slots, "header", se(re(e)))
2313
+ fn: W((e) => [
2314
+ j(n.$slots, "header", se(re(e)))
2297
2315
  ]),
2298
2316
  key: "0"
2299
2317
  } : void 0,
2300
2318
  !n.$slots.header && n.$slots["previous-button"] ? {
2301
2319
  name: "previous-button",
2302
- fn: B((e) => [
2303
- V(n.$slots, "previous-button", se(re(e)))
2320
+ fn: W((e) => [
2321
+ j(n.$slots, "previous-button", se(re(e)))
2304
2322
  ]),
2305
2323
  key: "1"
2306
2324
  } : void 0,
2307
2325
  !n.$slots.header && n.$slots["next-button"] ? {
2308
2326
  name: "next-button",
2309
- fn: B((e) => [
2310
- V(n.$slots, "next-button", se(re(e)))
2327
+ fn: W((e) => [
2328
+ j(n.$slots, "next-button", se(re(e)))
2311
2329
  ]),
2312
2330
  key: "2"
2313
2331
  } : void 0,
2314
2332
  !n.$slots.header && n.$slots["today-button"] ? {
2315
2333
  name: "today-button",
2316
- fn: B((e) => [
2317
- V(n.$slots, "today-button", se(re(e)))
2334
+ fn: W((e) => [
2335
+ j(n.$slots, "today-button", se(re(e)))
2318
2336
  ]),
2319
2337
  key: "3"
2320
2338
  } : void 0,
2321
2339
  !n.$slots.header && n.$slots.title ? {
2322
2340
  name: "title",
2323
- fn: B((e) => [
2324
- V(n.$slots, "title", se(re(e)))
2341
+ fn: W((e) => [
2342
+ j(n.$slots, "title", se(re(e)))
2325
2343
  ]),
2326
2344
  key: "4"
2327
2345
  } : void 0,
2328
2346
  !n.$slots.header && n.$slots["title.day"] ? {
2329
2347
  name: "title.day",
2330
- fn: B((e) => [
2331
- V(n.$slots, "title.day", se(re(e)))
2348
+ fn: W((e) => [
2349
+ j(n.$slots, "title.day", se(re(e)))
2332
2350
  ]),
2333
2351
  key: "5"
2334
2352
  } : void 0,
2335
2353
  !n.$slots.header && n.$slots["title.days"] ? {
2336
2354
  name: "title.days",
2337
- fn: B((e) => [
2338
- V(n.$slots, "title.days", se(re(e)))
2355
+ fn: W((e) => [
2356
+ j(n.$slots, "title.days", se(re(e)))
2339
2357
  ]),
2340
2358
  key: "6"
2341
2359
  } : void 0,
2342
2360
  !n.$slots.header && n.$slots["title.week"] ? {
2343
2361
  name: "title.week",
2344
- fn: B((e) => [
2345
- V(n.$slots, "title.week", se(re(e)))
2362
+ fn: W((e) => [
2363
+ j(n.$slots, "title.week", se(re(e)))
2346
2364
  ]),
2347
2365
  key: "7"
2348
2366
  } : void 0,
2349
2367
  !n.$slots.header && n.$slots["title.month"] ? {
2350
2368
  name: "title.month",
2351
- fn: B((e) => [
2352
- V(n.$slots, "title.month", se(re(e)))
2369
+ fn: W((e) => [
2370
+ j(n.$slots, "title.month", se(re(e)))
2353
2371
  ]),
2354
2372
  key: "8"
2355
2373
  } : void 0,
2356
2374
  !n.$slots.header && n.$slots["title.year"] ? {
2357
2375
  name: "title.year",
2358
- fn: B((e) => [
2359
- V(n.$slots, "title.year", se(re(e)))
2376
+ fn: W((e) => [
2377
+ j(n.$slots, "title.year", se(re(e)))
2360
2378
  ]),
2361
2379
  key: "9"
2362
2380
  } : void 0,
2363
2381
  !n.$slots.header && n.$slots["title.years"] ? {
2364
2382
  name: "title.years",
2365
- fn: B((e) => [
2366
- V(n.$slots, "title.years", se(re(e)))
2383
+ fn: W((e) => [
2384
+ j(n.$slots, "title.years", se(re(e)))
2367
2385
  ]),
2368
2386
  key: "10"
2369
2387
  } : void 0,
2370
2388
  !n.$slots.header && n.$slots["schedule-heading"] ? {
2371
2389
  name: "schedule-heading",
2372
- fn: B((e) => [
2373
- V(n.$slots, "schedule-heading", se(re(e)))
2390
+ fn: W((e) => [
2391
+ j(n.$slots, "schedule-heading", se(re(e)))
2374
2392
  ]),
2375
2393
  key: "11"
2376
2394
  } : void 0
2377
2395
  ]), 1024),
2378
- me("div", ba, [
2379
- Ve(Je, {
2380
- name: `vuecal-slide-fade--${T(L).transitionDirection}`
2396
+ he("div", Ta, [
2397
+ Oe(Ue, {
2398
+ name: `vuecal-slide-fade--${$(A).transitionDirection}`
2381
2399
  }, {
2382
- default: B(() => [
2383
- (O(), H("div", {
2384
- class: De(["vuecal__scrollable", u.value]),
2385
- key: T(L).id + T(L).start.getTime()
2400
+ default: W(() => [
2401
+ (V(), P("div", {
2402
+ class: pe(["vuecal__scrollable", i.value]),
2403
+ key: $(A).id + $(A).start.getTime()
2386
2404
  }, [
2387
- l.value ? (O(), Se(_a, { key: 0 }, Ce({ _: 2 }, [
2405
+ l.value ? (V(), Se(ka, { key: 0 }, Ce({ _: 2 }, [
2388
2406
  n.$slots["time-cell"] ? {
2389
2407
  name: "time-cell",
2390
- fn: B((e) => [
2391
- V(n.$slots, "time-cell", se(re(e)))
2408
+ fn: W((e) => [
2409
+ j(n.$slots, "time-cell", se(re(e)))
2392
2410
  ]),
2393
2411
  key: "0"
2394
2412
  } : void 0
2395
- ]), 1024)) : Z("", !0),
2396
- T(f).weekNumbers && T(L).isMonth ? (O(), H("div", Ta, [
2397
- (O(!0), H(de, null, we(z.value, (e) => (O(), H("div", Ma, [
2398
- V(n.$slots, "week-number", {}, () => [
2399
- me("small", null, ue(e), 1)
2413
+ ]), 1024)) : Q("", !0),
2414
+ $(f).weekNumbers && $(A).isMonth ? (V(), P("div", Ma, [
2415
+ (V(!0), P(de, null, we(E.value, (e) => (V(), P("div", Ea, [
2416
+ j(n.$slots, "week-number", {}, () => [
2417
+ he("small", null, ce(e), 1)
2400
2418
  ])
2401
2419
  ]))), 256))
2402
- ])) : Z("", !0),
2403
- me("div", Ea, [
2404
- Ve(Da, null, Ce({ _: 2 }, [
2420
+ ])) : Q("", !0),
2421
+ he("div", Ya, [
2422
+ Oe(pa, null, Ce({ _: 2 }, [
2405
2423
  n.$slots["weekday-heading"] ? {
2406
2424
  name: "weekday-heading",
2407
- fn: B((e) => [
2408
- V(n.$slots, "weekday-heading", se(re(e)))
2425
+ fn: W((e) => [
2426
+ j(n.$slots, "weekday-heading", se(re(e)))
2409
2427
  ]),
2410
2428
  key: "0"
2411
2429
  } : void 0,
2412
2430
  n.$slots["schedule-heading"] ? {
2413
2431
  name: "schedule-heading",
2414
- fn: B((e) => [
2415
- V(n.$slots, "schedule-heading", se(re(e)))
2432
+ fn: W((e) => [
2433
+ j(n.$slots, "schedule-heading", se(re(e)))
2416
2434
  ]),
2417
2435
  key: "1"
2418
2436
  } : void 0,
2419
2437
  n.$slots["event.all-day"] ? {
2420
2438
  name: "event.all-day",
2421
- fn: B((e) => [
2422
- V(n.$slots, "event.all-day", se(re(e)))
2439
+ fn: W((e) => [
2440
+ j(n.$slots, "event.all-day", se(re(e)))
2423
2441
  ]),
2424
2442
  key: "2"
2425
2443
  } : void 0,
2426
2444
  n.$slots.event ? {
2427
2445
  name: "event",
2428
- fn: B((e) => [
2429
- V(n.$slots, "event", se(re(e)))
2446
+ fn: W((e) => [
2447
+ j(n.$slots, "event", se(re(e)))
2430
2448
  ]),
2431
2449
  key: "3"
2432
2450
  } : void 0
2433
2451
  ]), 1024),
2434
- Ve(ka, null, Ce({ _: 2 }, [
2452
+ Oe($a, null, Ce({ _: 2 }, [
2435
2453
  n.$slots.cell ? {
2436
2454
  name: "cell",
2437
- fn: B((e) => [
2438
- V(n.$slots, "cell", se(re(e)))
2455
+ fn: W((e) => [
2456
+ j(n.$slots, "cell", se(re(e)))
2439
2457
  ]),
2440
2458
  key: "0"
2441
2459
  } : void 0,
2442
2460
  !n.$slots.cell && n.$slots["cell-date"] ? {
2443
2461
  name: "cell-date",
2444
- fn: B((e) => [
2445
- V(n.$slots, "cell-date", se(re(e)))
2462
+ fn: W((e) => [
2463
+ j(n.$slots, "cell-date", se(re(e)))
2446
2464
  ]),
2447
2465
  key: "1"
2448
2466
  } : void 0,
2449
2467
  !n.$slots.cell && n.$slots["cell-content"] ? {
2450
2468
  name: "cell-content",
2451
- fn: B((e) => [
2452
- V(n.$slots, "cell-content", se(re(e)))
2469
+ fn: W((e) => [
2470
+ j(n.$slots, "cell-content", se(re(e)))
2453
2471
  ]),
2454
2472
  key: "2"
2455
2473
  } : void 0,
2456
2474
  !n.$slots.cell && n.$slots["cell-events"] ? {
2457
2475
  name: "cell-events",
2458
- fn: B((e) => [
2459
- V(n.$slots, "cell-events", se(re(e)))
2476
+ fn: W((e) => [
2477
+ j(n.$slots, "cell-events", se(re(e)))
2460
2478
  ]),
2461
2479
  key: "3"
2462
2480
  } : void 0,
2463
2481
  !n.$slots.cell && !n.$slots["cell-events"] && n.$slots["event.all-day"] ? {
2464
2482
  name: "event.all-day",
2465
- fn: B((e) => [
2466
- V(n.$slots, "event.all-day", se(re(e)))
2483
+ fn: W((e) => [
2484
+ j(n.$slots, "event.all-day", se(re(e)))
2467
2485
  ]),
2468
2486
  key: "4"
2469
2487
  } : void 0,
2470
- !n.$slots.cell && !n.$slots["cell-events"] && n.$slots[`event.${T(L).id}`] ? {
2471
- name: `event.${T(L).id}`,
2472
- fn: B((e) => [
2473
- V(n.$slots, `event.${T(L).id}`, se(re(e)))
2488
+ !n.$slots.cell && !n.$slots["cell-events"] && n.$slots[`event.${$(A).id}`] ? {
2489
+ name: `event.${$(A).id}`,
2490
+ fn: W((e) => [
2491
+ j(n.$slots, `event.${$(A).id}`, se(re(e)))
2474
2492
  ]),
2475
2493
  key: "5"
2476
2494
  } : void 0,
2477
2495
  !n.$slots.cell && !n.$slots["cell-events"] && n.$slots.event ? {
2478
2496
  name: "event",
2479
- fn: B((e) => [
2480
- V(n.$slots, "event", se(re(e)))
2497
+ fn: W((e) => [
2498
+ j(n.$slots, "event", se(re(e)))
2481
2499
  ]),
2482
2500
  key: "6"
2483
2501
  } : void 0,
2484
2502
  !n.$slots.cell && n.$slots["event-count"] ? {
2485
2503
  name: "event-count",
2486
- fn: B((e) => [
2487
- V(n.$slots, "event-count", se(re(e)))
2504
+ fn: W((e) => [
2505
+ j(n.$slots, "event-count", se(re(e)))
2488
2506
  ]),
2489
2507
  key: "7"
2490
2508
  } : void 0
@@ -2496,63 +2514,63 @@ const lt = (h, t) => {
2496
2514
  }, 8, ["name"])
2497
2515
  ])
2498
2516
  ], 64))
2499
- ], 14, $a));
2517
+ ], 14, ba));
2500
2518
  }
2501
- }, Ca = (h) => {
2502
- Ae.texts = { ...ye.texts, ...h }, Ae.dateUtils.updateTexts(Ae.texts);
2519
+ }, za = (y) => {
2520
+ Fe.texts = { ...fe.texts, ...y }, Fe.dateUtils.updateTexts(Fe.texts);
2503
2521
  }, {
2504
- addDatePrototypes: za,
2522
+ addDatePrototypes: Va,
2505
2523
  removeDatePrototypes: Oa,
2506
- updateTexts: Va,
2507
- addDays: ja,
2508
- subtractDays: Ha,
2509
- addHours: Pa,
2510
- subtractHours: La,
2524
+ updateTexts: ja,
2525
+ addDays: Ha,
2526
+ subtractDays: Pa,
2527
+ addHours: La,
2528
+ subtractHours: Aa,
2511
2529
  addMinutes: Fa,
2512
- subtractMinutes: Aa,
2530
+ subtractMinutes: Ra,
2513
2531
  getWeek: Na,
2514
- isToday: Ra,
2532
+ isToday: Wa,
2515
2533
  isSameDate: Ba,
2516
- isInRange: Wa,
2534
+ isInRange: Xa,
2517
2535
  isLeapYear: Ia,
2518
- getPreviousFirstDayOfWeek: Xa,
2519
- stringToDate: qa,
2520
- dateToMinutes: Ga,
2536
+ getPreviousFirstDayOfWeek: qa,
2537
+ stringToDate: Ga,
2538
+ dateToMinutes: Ua,
2521
2539
  countDays: Ja,
2522
- datesInSameTimeStep: Ua,
2523
- isValid: Za,
2524
- formatDate: Ka,
2525
- formatDateLite: Qa,
2526
- formatTime: xa,
2527
- formatTimeLite: en,
2528
- formatMinutes: tn
2529
- } = Ae.dateUtils;
2540
+ datesInSameTimeStep: Za,
2541
+ isValid: Ka,
2542
+ formatDate: Qa,
2543
+ formatDateLite: xa,
2544
+ formatTime: en,
2545
+ formatTimeLite: tn,
2546
+ formatMinutes: an
2547
+ } = Fe.dateUtils;
2530
2548
  export {
2531
- Sa as VueCal,
2532
- za as addDatePrototypes,
2533
- ja as addDays,
2534
- Pa as addHours,
2549
+ Ca as VueCal,
2550
+ Va as addDatePrototypes,
2551
+ Ha as addDays,
2552
+ La as addHours,
2535
2553
  Fa as addMinutes,
2536
2554
  Ja as countDays,
2537
- Ga as dateToMinutes,
2538
- Ua as datesInSameTimeStep,
2539
- Ka as formatDate,
2540
- Qa as formatDateLite,
2541
- tn as formatMinutes,
2542
- xa as formatTime,
2543
- en as formatTimeLite,
2544
- Xa as getPreviousFirstDayOfWeek,
2555
+ Ua as dateToMinutes,
2556
+ Za as datesInSameTimeStep,
2557
+ Qa as formatDate,
2558
+ xa as formatDateLite,
2559
+ an as formatMinutes,
2560
+ en as formatTime,
2561
+ tn as formatTimeLite,
2562
+ qa as getPreviousFirstDayOfWeek,
2545
2563
  Na as getWeek,
2546
- Wa as isInRange,
2564
+ Xa as isInRange,
2547
2565
  Ia as isLeapYear,
2548
2566
  Ba as isSameDate,
2549
- Ra as isToday,
2550
- Za as isValidDate,
2567
+ Wa as isToday,
2568
+ Ka as isValidDate,
2551
2569
  Oa as removeDatePrototypes,
2552
- qa as stringToDate,
2553
- Ha as subtractDays,
2554
- La as subtractHours,
2555
- Aa as subtractMinutes,
2556
- Va as updateTexts,
2557
- Ca as useLocale
2570
+ Ga as stringToDate,
2571
+ Pa as subtractDays,
2572
+ Aa as subtractHours,
2573
+ Ra as subtractMinutes,
2574
+ ja as updateTexts,
2575
+ za as useLocale
2558
2576
  };