vue-cal 5.0.1-rc.7 → 5.0.1-rc.9

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.
@@ -1,7 +1,7 @@
1
- import { computed as T, reactive as $e, watch as me, toRefs as rt, ref as oe, onBeforeUnmount as Xe, inject as Ne, createElementBlock as j, openBlock as Y, renderSlot as F, createCommentVNode as U, unref as S, Fragment as te, renderList as pe, normalizeClass as ke, createElementVNode as ge, createVNode as Oe, Transition as Ge, withCtx as Z, createBlock as Se, resolveDynamicComponent as Ke, mergeProps as De, toHandlers as Ie, normalizeProps as se, guardReactiveProps as ne, toDisplayString as le, onMounted as Ze, withModifiers as Qe, nextTick as Ue, normalizeStyle as Te, createTextVNode as xe, TransitionGroup as et, createSlots as je, useTemplateRef as it, useId as ot, useAttrs as ut, provide as ct } from "vue";
2
- import st from "./i18n/en-us.json";
1
+ import { computed as T, reactive as $e, watch as me, toRefs as rt, ref as ie, onBeforeUnmount as Xe, inject as Ne, createElementBlock as j, openBlock as E, renderSlot as F, createCommentVNode as Z, unref as O, Fragment as te, renderList as we, normalizeClass as _e, createElementVNode as ge, createVNode as Oe, Transition as Ge, withCtx as J, createBlock as Se, resolveDynamicComponent as Ke, mergeProps as De, toHandlers as Ie, normalizeProps as ne, guardReactiveProps as se, toDisplayString as le, onMounted as Ze, withModifiers as Qe, nextTick as Ue, normalizeStyle as Te, createTextVNode as xe, TransitionGroup as et, createSlots as je, useTemplateRef as ot, useId as it, useAttrs as ut, provide as ct } from "vue";
2
+ import nt from "./i18n/en-us.json";
3
3
  /**
4
- * vue-cal v5.0.1-rc.7
4
+ * vue-cal v5.0.1-rc.9
5
5
  * (c) 2024-2025 Antoni Andre <antoniandre.web@gmail.com>
6
6
  * @license MIT
7
7
  */
@@ -34,301 +34,305 @@ const fe = {
34
34
  years: { cols: 5, rows: 5 }
35
35
  // Arbitrary range of quarters of century (25y).
36
36
  }
37
- }, dt = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"], Re = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"], vt = Re.reduce((u, s, r) => (u[s] = r || 7, u), {}), mt = (u, s, r) => {
38
- const { dateUtils: D } = u, w = !1, b = T(() => {
39
- if (W.value[s.view]) return s.view;
40
- {
41
- const l = s.datePicker ? "month" : "week", n = s.view || l;
42
- return W.value[n] ? n : (console.warn(
43
- `Vue Cal: the provided or default view \`${n}\` is either invalid or not in the list of available views. The first available view will be chosen: \`${Object.keys(W.value)[0]}\`.`
44
- ), Object.keys(W.value)[0]);
45
- }
46
- }), H = T(() => s.sm && !s.xs), m = T(() => s.xs || s.datePicker), C = T(() => s.clickToNavigate || s.datePicker && s.clickToNavigate !== !1), i = T(() => {
47
- const l = {
37
+ }, dt = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"], Re = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"], vt = Re.reduce((D, n, r) => (D[n] = r || 7, D), {}), mt = (D, n, r) => {
38
+ const { dateUtils: g } = D, p = !1, b = T(() => {
39
+ if (W.value[n.view]) return n.view;
40
+ const s = n.datePicker ? "month" : "week", l = n.view || s;
41
+ return W.value[l] ? l : (console.warn(
42
+ `Vue Cal: the provided or default view \`${l}\` is either invalid or not in the list of available views. The first available view will be chosen: \`${Object.keys(W.value)[0]}\`.`
43
+ ), Object.keys(W.value)[0]);
44
+ }), L = T(() => n.sm && !n.xs), v = T(() => n.xs || n.datePicker), C = T(() => n.clickToNavigate || n.datePicker && n.clickToNavigate !== !1), o = T(() => {
45
+ const s = {
48
46
  cell: {},
49
47
  // All possible event listeners to attach to cells.
50
48
  event: {}
51
49
  // All possible event listeners to attach to calendar events.
52
- }, n = (_) => _.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
53
- return Object.entries(r).forEach(([_, t]) => {
54
- const [O, P, q] = _.match(/^on(Cell|Event)(.+)$/) || [];
55
- O && (l[P.toLowerCase()][n(q).replace(/^-+|-+$/g, "")] = t);
56
- }), l;
57
- }), f = T(() => {
58
- var n;
59
- const l = {};
60
- return s.hideWeekends && (l[6] = !0) && (l[7] = !0), (n = s.hideWeekdays) != null && n.length && s.hideWeekdays.forEach((_) => l[vt[_]] = !0), l;
61
- }), $ = T(() => s.hideWeekends || f.value[6] && f.value[7]), W = T(() => {
62
- const l = s.datePicker;
63
- let n = 0, _ = {};
64
- const t = s.views;
65
- return l && !t ? {
50
+ }, l = (k) => k.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
51
+ for (const [k, t] of Object.entries(r)) {
52
+ const [V, H, U] = k.match(/^on(Cell|Event)(.+)$/) || [];
53
+ V && (s[H.toLowerCase()][l(U).replace(/^-+|-+$/g, "")] = t);
54
+ }
55
+ return s;
56
+ }), m = T(() => {
57
+ var l;
58
+ const s = {};
59
+ return n.hideWeekends && (s[6] = !0) && (s[7] = !0), (l = n.hideWeekdays) != null && l.length && n.hideWeekdays.forEach((k) => s[vt[k]] = !0), s;
60
+ }), $ = T(() => n.hideWeekends || m.value[6] && m.value[7]), W = T(() => {
61
+ const s = n.datePicker;
62
+ let l = 0, k = {};
63
+ const t = n.views;
64
+ return s && !t ? {
66
65
  month: { ...fe.availableViews.month },
67
66
  year: { ...fe.availableViews.year },
68
67
  years: { ...fe.availableViews.years }
69
- } : (t ? (Array.isArray(t) ? _ = t.reduce((O, P) => (typeof P == "string" && fe.availableViews[P] ? O[P] = fe.availableViews[P] : n++, O), {}) : typeof t == "object" && (_ = Object.entries(t).reduce((O, [P, q]) => {
70
- const { cols: J, rows: ue } = fe.availableViews[P];
71
- return O[P] = { cols: q.cols || J, rows: q.rows || ue }, O;
72
- }, {})), n && console.warn("Vue Cal: the provided `views` prop contains invalid views that will be ignored."), Object.keys(_).length || (console.warn("Vue Cal: No valid view in the provided `views` prop. Falling back to default views."), _ = { ...fe.availableViews })) : _ = { ...fe.availableViews }, _);
73
- }), G = T(() => s.datePicker ? "month" : W.value.week ? "week" : Object.keys(W.value)[0]), o = T(() => {
74
- if (typeof s.selectedDate == "string") return D.stringToDate(s.selectedDate);
75
- if (s.selectedDate instanceof Date) return s.selectedDate;
76
- s.selectedDate ? console.warn("Vue Cal: The provided selected date is invalid:", s.selectedDate) : console.log("Vue Cal: Info - The provided selected date is undefined.");
77
- }), c = T(() => {
78
- if (!s.disableDays) return [];
79
- const l = [];
80
- return Array.isArray(s.disableDays) ? s.disableDays.forEach((n) => {
81
- let _ = n;
82
- if (typeof n == "string" ? _ = D.stringToDate(n) : n instanceof Date && (n = D.formatDate(n, "YYYY-MM-DD")), _ instanceof Date && !isNaN(_.getTime())) {
83
- l.push(n);
84
- return;
85
- } else console.warn("Vue Cal: The provided `disableDays` prop contains an invalid date:", n);
86
- }) : console.warn("Vue Cal: The provided `disableDays` prop is invalid:", s.disableDays), l;
68
+ } : (t ? (Array.isArray(t) ? k = t.reduce((V, H) => (typeof H == "string" && fe.availableViews[H] ? V[H] = fe.availableViews[H] : l++, V), {}) : typeof t == "object" && (k = Object.entries(t).reduce((V, [H, U]) => {
69
+ const { cols: K, rows: ue } = fe.availableViews[H];
70
+ return V[H] = { cols: U.cols || K, rows: U.rows || ue }, V;
71
+ }, {})), l && 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 = { ...fe.availableViews })) : k = { ...fe.availableViews }, k);
72
+ }), G = T(() => n.datePicker ? "month" : W.value.week ? "week" : Object.keys(W.value)[0]), i = T(() => {
73
+ if (typeof n.selectedDate == "string") return g.stringToDate(n.selectedDate);
74
+ if (n.selectedDate instanceof Date) return n.selectedDate;
75
+ n.selectedDate ? console.warn("Vue Cal: The provided selected date is invalid:", n.selectedDate) : console.log("Vue Cal: Info - The provided selected date is undefined.");
76
+ }), u = T(() => {
77
+ if (!n.disableDays) return [];
78
+ const s = [];
79
+ if (Array.isArray(n.disableDays))
80
+ for (let l of n.disableDays) {
81
+ let k = l;
82
+ typeof l == "string" ? k = g.stringToDate(l) : l instanceof Date && (l = g.formatDate(l, "YYYY-MM-DD")), k instanceof Date && !isNaN(k.getTime()) ? s.push(l) : console.warn("Vue Cal: The provided `disableDays` prop contains an invalid date:", l);
83
+ }
84
+ else console.warn("Vue Cal: The provided `disableDays` prop is invalid:", n.disableDays);
85
+ return s;
87
86
  }), e = T(() => {
88
- let l = null;
89
- return s.minDate && typeof s.minDate == "string" ? l = D.stringToDate(s.minDate) : s.minDate && s.minDate instanceof Date && (l = s.minDate), (l == null ? void 0 : l.getTime()) || null;
90
- }), v = T(() => {
91
- let l = null;
92
- return s.maxDate && typeof s.maxDate == "string" ? l = D.stringToDate(s.maxDate) : s.maxDate && s.maxDate instanceof Date && (l = s.maxDate), (l == null ? void 0 : l.getTime()) || null;
87
+ let s = null;
88
+ return n.minDate && typeof n.minDate == "string" ? s = g.stringToDate(n.minDate) : n.minDate && n.minDate instanceof Date && (s = n.minDate), (s == null ? void 0 : s.getTime()) || null;
89
+ }), d = T(() => {
90
+ let s = null;
91
+ return n.maxDate && typeof n.maxDate == "string" ? s = g.stringToDate(n.maxDate) : n.maxDate && n.maxDate instanceof Date && (s = n.maxDate), (s == null ? void 0 : s.getTime()) || null;
93
92
  }), h = T(() => {
94
- var _;
95
- const { view: l } = u;
96
- return s.schedules.length && (l.isDay || l.isDays || l.isWeek) && ((_ = s.schedules) == null ? void 0 : _.map((t, O) => ({ ...t, id: t.id ?? O + 1 }))) || void 0;
97
- }), E = T(() => {
98
- const l = {
93
+ var k;
94
+ const { view: s } = D;
95
+ return n.schedules.length && (s.isDay || s.isDays || s.isWeek) && ((k = n.schedules) == null ? void 0 : k.map((t, V) => ({ ...t, id: t.id ?? V + 1 }))) || void 0;
96
+ }), Y = T(() => {
97
+ const s = {
99
98
  drag: !0,
100
99
  resize: !0,
101
100
  delete: !0,
102
101
  create: !0
103
102
  };
104
- return s.editableEvents === !0 ? l : s.editableEvents === !1 ? Object.keys(l).map((n) => l[n] = !1) : { ...l, ...s.editableEvents };
105
- }), L = async (l) => {
106
- var _;
107
- let n = /* @__PURE__ */ Object.assign({ "../i18n/ar.json": () => import("./i18n/ar.json").then((t) => t.default), "../i18n/bg.json": () => import("./i18n/bg.json").then((t) => t.default), "../i18n/bn.json": () => import("./i18n/bn.json").then((t) => t.default), "../i18n/bs.json": () => import("./i18n/bs.json").then((t) => t.default), "../i18n/ca.json": () => import("./i18n/ca.json").then((t) => t.default), "../i18n/cs.json": () => import("./i18n/cs.json").then((t) => t.default), "../i18n/da.json": () => import("./i18n/da.json").then((t) => t.default), "../i18n/de.json": () => import("./i18n/de.json").then((t) => t.default), "../i18n/el.json": () => import("./i18n/el.json").then((t) => t.default), "../i18n/en-gb.json": () => import("./i18n/en-gb.json").then((t) => t.default), "../i18n/en-us.json": () => import("./i18n/en-us.json").then((t) => t.default), "../i18n/es.json": () => import("./i18n/es.json").then((t) => t.default), "../i18n/et.json": () => import("./i18n/et.json").then((t) => t.default), "../i18n/fa.json": () => import("./i18n/fa.json").then((t) => t.default), "../i18n/fi.json": () => import("./i18n/fi.json").then((t) => t.default), "../i18n/fr.json": () => import("./i18n/fr.json").then((t) => t.default), "../i18n/he.json": () => import("./i18n/he.json").then((t) => t.default), "../i18n/hr.json": () => import("./i18n/hr.json").then((t) => t.default), "../i18n/hu.json": () => import("./i18n/hu.json").then((t) => t.default), "../i18n/id.json": () => import("./i18n/id.json").then((t) => t.default), "../i18n/is.json": () => import("./i18n/is.json").then((t) => t.default), "../i18n/it.json": () => import("./i18n/it.json").then((t) => t.default), "../i18n/ja.json": () => import("./i18n/ja.json").then((t) => t.default), "../i18n/ka.json": () => import("./i18n/ka.json").then((t) => t.default), "../i18n/ko.json": () => import("./i18n/ko.json").then((t) => t.default), "../i18n/lt.json": () => import("./i18n/lt.json").then((t) => t.default), "../i18n/mn.json": () => import("./i18n/mn.json").then((t) => t.default), "../i18n/nl.json": () => import("./i18n/nl.json").then((t) => t.default), "../i18n/no.json": () => import("./i18n/no.json").then((t) => t.default), "../i18n/pl.json": () => import("./i18n/pl.json").then((t) => t.default), "../i18n/pt-br.json": () => import("./i18n/pt-br.json").then((t) => t.default), "../i18n/pt-pt.json": () => import("./i18n/pt-pt.json").then((t) => t.default), "../i18n/ro.json": () => import("./i18n/ro.json").then((t) => t.default), "../i18n/ru.json": () => import("./i18n/ru.json").then((t) => t.default), "../i18n/sk.json": () => import("./i18n/sk.json").then((t) => t.default), "../i18n/sl.json": () => import("./i18n/sl.json").then((t) => t.default), "../i18n/sq.json": () => import("./i18n/sq.json").then((t) => t.default), "../i18n/sr.json": () => import("./i18n/sr.json").then((t) => t.default), "../i18n/sv.json": () => import("./i18n/sv.json").then((t) => t.default), "../i18n/tr.json": () => import("./i18n/tr.json").then((t) => t.default), "../i18n/uk.json": () => import("./i18n/uk.json").then((t) => t.default), "../i18n/vi.json": () => import("./i18n/vi.json").then((t) => t.default), "../i18n/zh-cn.json": () => import("./i18n/zh-cn.json").then((t) => t.default), "../i18n/zh-hk.json": () => import("./i18n/zh-hk.json").then((t) => t.default) });
103
+ return n.editableEvents === !0 ? s : n.editableEvents === !1 ? Object.keys(s).map((l) => s[l] = !1) : { ...s, ...n.editableEvents };
104
+ }), P = async (s) => {
105
+ var k;
106
+ let l = /* @__PURE__ */ Object.assign({ "../i18n/ar.json": () => import("./i18n/ar.json").then((t) => t.default), "../i18n/bg.json": () => import("./i18n/bg.json").then((t) => t.default), "../i18n/bn.json": () => import("./i18n/bn.json").then((t) => t.default), "../i18n/bs.json": () => import("./i18n/bs.json").then((t) => t.default), "../i18n/ca.json": () => import("./i18n/ca.json").then((t) => t.default), "../i18n/cs.json": () => import("./i18n/cs.json").then((t) => t.default), "../i18n/da.json": () => import("./i18n/da.json").then((t) => t.default), "../i18n/de.json": () => import("./i18n/de.json").then((t) => t.default), "../i18n/el.json": () => import("./i18n/el.json").then((t) => t.default), "../i18n/en-gb.json": () => import("./i18n/en-gb.json").then((t) => t.default), "../i18n/en-us.json": () => import("./i18n/en-us.json").then((t) => t.default), "../i18n/es.json": () => import("./i18n/es.json").then((t) => t.default), "../i18n/et.json": () => import("./i18n/et.json").then((t) => t.default), "../i18n/fa.json": () => import("./i18n/fa.json").then((t) => t.default), "../i18n/fi.json": () => import("./i18n/fi.json").then((t) => t.default), "../i18n/fr.json": () => import("./i18n/fr.json").then((t) => t.default), "../i18n/he.json": () => import("./i18n/he.json").then((t) => t.default), "../i18n/hr.json": () => import("./i18n/hr.json").then((t) => t.default), "../i18n/hu.json": () => import("./i18n/hu.json").then((t) => t.default), "../i18n/id.json": () => import("./i18n/id.json").then((t) => t.default), "../i18n/is.json": () => import("./i18n/is.json").then((t) => t.default), "../i18n/it.json": () => import("./i18n/it.json").then((t) => t.default), "../i18n/ja.json": () => import("./i18n/ja.json").then((t) => t.default), "../i18n/ka.json": () => import("./i18n/ka.json").then((t) => t.default), "../i18n/ko.json": () => import("./i18n/ko.json").then((t) => t.default), "../i18n/lt.json": () => import("./i18n/lt.json").then((t) => t.default), "../i18n/mn.json": () => import("./i18n/mn.json").then((t) => t.default), "../i18n/nl.json": () => import("./i18n/nl.json").then((t) => t.default), "../i18n/no.json": () => import("./i18n/no.json").then((t) => t.default), "../i18n/pl.json": () => import("./i18n/pl.json").then((t) => t.default), "../i18n/pt-br.json": () => import("./i18n/pt-br.json").then((t) => t.default), "../i18n/pt-pt.json": () => import("./i18n/pt-pt.json").then((t) => t.default), "../i18n/ro.json": () => import("./i18n/ro.json").then((t) => t.default), "../i18n/ru.json": () => import("./i18n/ru.json").then((t) => t.default), "../i18n/sk.json": () => import("./i18n/sk.json").then((t) => t.default), "../i18n/sl.json": () => import("./i18n/sl.json").then((t) => t.default), "../i18n/sq.json": () => import("./i18n/sq.json").then((t) => t.default), "../i18n/sr.json": () => import("./i18n/sr.json").then((t) => t.default), "../i18n/sv.json": () => import("./i18n/sv.json").then((t) => t.default), "../i18n/tr.json": () => import("./i18n/tr.json").then((t) => t.default), "../i18n/uk.json": () => import("./i18n/uk.json").then((t) => t.default), "../i18n/vi.json": () => import("./i18n/vi.json").then((t) => t.default), "../i18n/zh-cn.json": () => import("./i18n/zh-cn.json").then((t) => t.default), "../i18n/zh-hk.json": () => import("./i18n/zh-hk.json").then((t) => t.default) });
108
107
  {
109
- if (!n[`../i18n/${l}.json`]) {
110
- console.warn(`Vue Cal: the locale \`${l}\` does not exist. Falling back to \`en-us\`.`), l = "en-us";
108
+ if (!l[`../i18n/${s}.json`]) {
109
+ console.warn(`Vue Cal: the locale \`${s}\` does not exist. Falling back to \`en-us\`.`), s = "en-us";
111
110
  return;
112
111
  }
113
- n = await ((_ = n[`../i18n/${l}.json`]) == null ? void 0 : _.call(n));
112
+ l = await ((k = l[`../i18n/${s}.json`]) == null ? void 0 : k.call(l));
114
113
  }
115
- u.texts = Object.assign(u.texts, Object.assign({ ...fe.texts }, n)), D.updateTexts(u.texts);
116
- }, A = $e(s.events || []);
117
- return me(() => s.events, (l) => A.splice(0, A.length, ...l)), me(() => s.locale, (l) => L(l || "en-us")), (s.locale || !u.texts.today) && L(s.locale || "en-us"), {
118
- ...rt(s),
114
+ D.texts = Object.assign(D.texts, Object.assign({ ...fe.texts }, l)), g.updateTexts(D.texts);
115
+ }, A = $e(n.events || []);
116
+ return me(() => n.events, (s) => A.splice(0, A.length, ...s)), me(() => n.locale, (s) => P(s || "en-us")), (n.locale || !D.texts.today) && P(n.locale || "en-us"), {
117
+ ...rt(n),
119
118
  events: A,
120
119
  // All the events listeners for cells and events that the end user may have attached to vue-cal.
121
- eventListeners: i,
120
+ eventListeners: o,
122
121
  defaultView: G,
123
122
  availableViews: W,
124
- disableDays: c,
125
- ready: w,
126
- sm: H,
127
- xs: m,
123
+ disableDays: u,
124
+ ready: p,
125
+ sm: L,
126
+ xs: v,
128
127
  clickToNavigate: C,
129
- hideWeekdays: f,
128
+ hideWeekdays: m,
130
129
  hideWeekends: $,
131
130
  minTimestamp: e,
132
- maxTimestamp: v,
131
+ maxTimestamp: d,
133
132
  schedules: h,
134
- selectedDate: o,
135
- editableEvents: E,
133
+ selectedDate: i,
134
+ editableEvents: Y,
136
135
  view: b,
137
136
  // Getters.
138
137
  get hasHiddenDays() {
139
- return Object.keys(f.value).length;
138
+ return Object.keys(m.value).length;
140
139
  },
141
140
  get size() {
142
- return m.value ? "xs" : H.value ? "sm" : "lg";
141
+ return v.value ? "xs" : L.value ? "sm" : "lg";
143
142
  },
144
- loadTexts: L
143
+ loadTexts: P
145
144
  };
146
- }, Ve = (u, s) => {
147
- const r = s.timeTo - s.timeFrom;
148
- return (u - s.timeFrom) * 100 / r;
149
- }, Pe = (u, s) => {
150
- const r = s.timeTo - s.timeFrom;
151
- return ~~(u * r / 100 + s.timeFrom);
152
- }, Je = (u, s) => {
153
- const r = s.clientHeight;
154
- return u * 100 / r;
145
+ }, Ve = (D, n) => {
146
+ const r = n.timeTo - n.timeFrom;
147
+ return (D - n.timeFrom) * 100 / r;
148
+ }, Pe = (D, n) => {
149
+ const r = n.timeTo - n.timeFrom;
150
+ return ~~(D * r / 100 + n.timeFrom);
151
+ }, Je = (D, n) => {
152
+ const r = n.clientHeight;
153
+ return D * 100 / r;
155
154
  }, Ae = $e({ id: null, date: null });
156
155
  let tt = !1, qe = !0;
157
- const we = $e({ el: null, cell: null, timeout: null }), be = $e({
156
+ const pe = $e({ el: null, cell: null, timeout: null }), be = $e({
158
157
  eventId: null,
159
158
  fromVueCal: null,
160
159
  toVueCal: null
161
160
  });
162
- function ft(u) {
163
- const { config: s, view: r, eventsManager: D, emit: w, uid: b, dateUtils: H } = u, m = (e) => {
164
- var n;
165
- const { timeStep: v, timeCellHeight: h, timeFrom: E } = s, L = (((n = e.touches) == null ? void 0 : n[0]) || e).clientY, { top: A } = e.currentTarget.getBoundingClientRect(), l = L - A - ~~e.dataTransfer.getData("cursor-grab-at");
166
- return Pe(Je(l, e.currentTarget), s);
167
- }, C = (e, v, h) => {
168
- const E = v.duration || i(v.start, v.end) || s.timeStep;
169
- let L = Math.max(m(e), 0);
170
- if (s.snapToInterval) {
171
- const _ = L + s.snapToInterval / 2;
172
- L = _ - _ % s.snapToInterval;
161
+ function ft(D) {
162
+ const { config: n, view: r, eventsManager: g, emit: p, uid: b, dateUtils: L } = D, v = (e) => {
163
+ var l;
164
+ const { timeStep: d, timeCellHeight: h, timeFrom: Y } = n, P = (((l = e.touches) == null ? void 0 : l[0]) || e).clientY, { top: A } = e.currentTarget.getBoundingClientRect(), s = P - A - ~~e.dataTransfer.getData("cursor-grab-at");
165
+ return Pe(Je(s, e.currentTarget), n);
166
+ }, C = (e, d, h) => {
167
+ const Y = d.duration || o(d.start, d.end) || n.timeStep;
168
+ let P = Math.max(v(e), 0);
169
+ if (n.snapToInterval) {
170
+ const k = P + n.snapToInterval / 2;
171
+ P = k - k % n.snapToInterval;
173
172
  }
174
- const A = new Date(new Date(h).setMinutes(L)), l = Math.min(L + E, 24 * 60), n = new Date(new Date(h).setMinutes(l));
175
- return { start: A, end: n };
176
- }, i = (e, v) => Math.round((v - e) / 6e4);
173
+ const A = new Date(new Date(h).setMinutes(P)), s = Math.min(P + Y, 24 * 60), l = new Date(new Date(h).setMinutes(s));
174
+ return { start: A, end: l };
175
+ }, o = (e, d) => Math.round((d - e) / 6e4);
177
176
  return {
178
- eventDragStart: (e, v) => {
179
- if (e.target.nodeType === 3 || u.touch.isResizingEvent) return e.preventDefault();
180
- e.dataTransfer.dropEffect = "move";
181
- const h = { ...v, _: { id: v._.id, duration: i(v.start, v.end) } };
182
- e.dataTransfer.setData("event", JSON.stringify(h)), e.dataTransfer.setData("cursor-grab-at", e.offsetY), be.eventId = v._.id, be.fromVueCal = b;
183
- const E = e.target.closest(".vuecal__event");
184
- E.classList.add("vuecal__event--dragging-ghost"), setTimeout(() => {
185
- E.classList.add("vuecal__event--dragging-original"), E.classList.remove("vuecal__event--dragging-ghost");
186
- }, 0), tt = !1, Object.assign(Ae, { id: r.id, date: r.firstCellDate }), qe = !0, u.touch.isDraggingEvent = !0;
177
+ eventDragStart: (e, d) => {
178
+ if (e.target.nodeType === 3 || D.touch.isResizingEvent) return e.preventDefault();
179
+ e.dataTransfer.effectAllowed = "move", e.dataTransfer.dropEffect = "move";
180
+ const h = { ...d, _: { id: d._.id, duration: o(d.start, d.end) } };
181
+ try {
182
+ e.dataTransfer.setData("text/plain", ""), e.dataTransfer.setData("event", JSON.stringify(h)), e.dataTransfer.setData("cursor-grab-at", e.offsetY);
183
+ } catch (P) {
184
+ return console.warn("Vue Cal: Failed to set drag data:", P), e.preventDefault();
185
+ }
186
+ be.eventId = d._.id, be.fromVueCal = b;
187
+ const Y = e.target.closest(".vuecal__event");
188
+ Y.classList.add("vuecal__event--dragging-ghost"), setTimeout(() => {
189
+ Y.classList.add("vuecal__event--dragging-original"), Y.classList.remove("vuecal__event--dragging-ghost");
190
+ }, 0), tt = !1, Object.assign(Ae, { id: r.id, date: r.firstCellDate }), qe = !0, D.touch.isDraggingEvent = !0;
187
191
  },
188
- eventDragEnd: (e, v) => {
192
+ eventDragEnd: (e, d) => {
189
193
  be.eventId = null, e.target.closest(".vuecal__event").classList.remove("vuecal__event--dragging-original");
190
- const { fromVueCal: h, toVueCal: E } = be;
191
- E && h !== E && D.deleteEvent(v._.id, 3), be.fromVueCal = null, be.toVueCal = null, tt && qe && Ae.id && r.switchView(Ae.id, Ae.date, !0), u.touch.isDraggingEvent = !1;
194
+ const { fromVueCal: h, toVueCal: Y } = be;
195
+ Y && h !== Y && g.deleteEvent(d._.id, 3), be.fromVueCal = null, be.toVueCal = null, tt && qe && Ae.id && r.switchView(Ae.id, Ae.date, !0), D.touch.isDraggingEvent = !1;
192
196
  },
193
- cellDragEnter: (e, v) => {
194
- const { start: h } = v, E = e.currentTarget;
197
+ cellDragEnter: (e, d) => {
198
+ const { start: h } = d, Y = e.currentTarget;
195
199
  if (!e.currentTarget.contains(e.relatedTarget)) {
196
- if (E === we.el || !E.className.includes("vuecal__cell-content")) return !1;
197
- we.el && (we.cell.highlighted = !1), Object.assign(we, { el: E, cell: v, timeout: clearTimeout(we.timeout) }), v.highlighted = !0, ["years", "year", "month"].includes(r.id) && (we.timeout = setTimeout(() => u.switchToNarrowerView(h), 2e3));
200
+ if (Y === pe.el || !Y.className.includes("vuecal__cell-content")) return !1;
201
+ pe.el && (pe.cell.highlighted = !1), Object.assign(pe, { el: Y, cell: d, timeout: clearTimeout(pe.timeout) }), d.highlighted = !0, ["years", "year", "month"].includes(r.id) && (pe.timeout = setTimeout(() => D.switchToNarrowerView(h), 2e3));
198
202
  }
199
203
  },
200
- cellDragOver: (e, v) => {
201
- const { start: h, schedule: E } = v;
202
- e.preventDefault(), v.highlighted = !0, (E || E === 0) && (v.highlightedSchedule = E);
204
+ cellDragOver: (e, d) => {
205
+ const { start: h, schedule: Y } = d;
206
+ e.preventDefault(), d.highlighted = !0, (Y || Y === 0) && (d.highlightedSchedule = Y);
203
207
  },
204
- cellDragLeave: (e, v) => {
205
- e.preventDefault(), !e.currentTarget.contains(e.relatedTarget) && (v.highlightedSchedule = !1, we.cell === v && (clearTimeout(we.timeout), Object.assign(we, { el: null, cell: null, timeout: null }), v.highlighted = !1));
208
+ cellDragLeave: (e, d) => {
209
+ e.preventDefault(), !e.currentTarget.contains(e.relatedTarget) && (d.highlightedSchedule = !1, pe.cell === d && (clearTimeout(pe.timeout), Object.assign(pe, { el: null, cell: null, timeout: null }), d.highlighted = !1));
206
210
  },
207
- cellDragDrop: async (e, v) => {
208
- var O, P, q;
209
- e.preventDefault(), clearTimeout(we.timeout), Object.assign(we, { el: null, cell: null, timeout: null });
211
+ cellDragDrop: async (e, d) => {
212
+ var V, H, U;
213
+ e.preventDefault(), clearTimeout(pe.timeout), Object.assign(pe, { el: null, cell: null, timeout: null });
210
214
  const h = JSON.parse(e.dataTransfer.getData("event") || "{}");
211
215
  h.start && (h.start = new Date(h.start)), h.end && (h.end = new Date(h.end));
212
- let E;
213
- const { start: L, end: A } = C(e, h, v.start), { schedule: l } = ((O = e.target.closest("[data-schedule]")) == null ? void 0 : O.dataset) || {};
214
- let n = () => {
216
+ let Y;
217
+ const { start: P, end: A } = C(e, h, d.start), { schedule: s } = ((V = e.target.closest("[data-schedule]")) == null ? void 0 : V.dataset) || {};
218
+ let l = () => {
215
219
  };
216
- be.fromVueCal === b ? (E = D.getEvent(h._.id), E && (E._.dragging = !1, n = () => {
217
- E.start = L, E.end = A, l !== void 0 && (E.schedule = ~~l);
218
- })) : (E = {
220
+ be.fromVueCal === b ? (Y = g.getEvent(h._.id), Y && (Y._.dragging = !1, l = () => {
221
+ Y.start = P, Y.end = A, s !== void 0 && (Y.schedule = ~~s);
222
+ })) : (Y = {
219
223
  ...h,
220
- start: L,
224
+ start: P,
221
225
  end: A,
222
- ...l !== void 0 && { schedule: ~~l },
223
- _: { id: ((P = h._) == null ? void 0 : P.id) || h.id, duration: i(L, A) },
224
- getOverlappingEvents: () => D.getEventsInRange(
225
- D.getEventsByDate(H.formatDate(L), !0),
226
- { start: L, end: A },
227
- { schedule: ~~l }
226
+ ...s !== void 0 && { schedule: ~~s },
227
+ _: { id: ((H = h._) == null ? void 0 : H.id) || h.id, duration: o(P, A) },
228
+ getOverlappingEvents: () => g.getEventsInRange(
229
+ g.getEventsByDate(L.formatDate(P), !0),
230
+ { start: P, end: A },
231
+ { schedule: ~~s }
228
232
  )
229
- }, n = () => {
230
- E = D.createEvent(E);
233
+ }, l = () => {
234
+ Y = g.createEvent(Y);
231
235
  });
232
- let _ = !0;
233
- const { drop: t } = (q = s.eventListeners) == null ? void 0 : q.event;
234
- t && (_ = await t({
236
+ let k = !0;
237
+ const { drop: t } = (U = n.eventListeners) == null ? void 0 : U.event;
238
+ t && (k = await t({
235
239
  e,
236
- event: { ...E, start: L, end: A, schedule: ~~l },
237
- overlaps: E.getOverlappingEvents({ start: L, end: A, schedule: ~~l }),
238
- cell: v,
240
+ event: { ...Y, start: P, end: A, schedule: ~~s },
241
+ overlaps: Y.getOverlappingEvents({ start: P, end: A, schedule: ~~s }),
242
+ cell: d,
239
243
  external: be.fromVueCal !== b
240
- })), _ !== !1 && n(), v.highlighted = !1, v.highlightedSchedule = null, qe = !1, be.toVueCal = b, w("event-dropped", {
244
+ })), k !== !1 && l(), d.highlighted = !1, d.highlightedSchedule = null, qe = !1, be.toVueCal = b, p("event-dropped", {
241
245
  e,
242
- cell: v,
243
- event: E,
246
+ cell: d,
247
+ event: Y,
244
248
  originalEvent: h,
245
249
  external: be.fromVueCal !== b
246
250
  });
247
251
  }
248
252
  };
249
253
  }
250
- const nt = (u, s) => {
251
- let r, D, w, b = {}, H = {};
252
- const m = oe(u), C = () => {
253
- m.value.today || (m.value = s), Date.prototype.addDays = function(a) {
254
+ const st = (D, n) => {
255
+ let r, g, p, b = {}, L = {};
256
+ const v = ie(D), C = () => {
257
+ v.value.today || (v.value = n), Date.prototype.addDays = function(a) {
254
258
  return W(this, a || 0);
255
259
  }, Date.prototype.subtractDays = function(a) {
256
260
  return G(this, a || 0);
257
261
  }, Date.prototype.addHours = function(a) {
258
- return o(this, a || 0);
262
+ return i(this, a || 0);
259
263
  }, Date.prototype.subtractHours = function(a) {
260
- return c(this, a || 0);
264
+ return u(this, a || 0);
261
265
  }, Date.prototype.addMinutes = function(a) {
262
266
  return e(this, a || 0);
263
267
  }, Date.prototype.subtractMinutes = function(a) {
264
- return v(this, a || 0);
268
+ return d(this, a || 0);
265
269
  }, Date.prototype.getWeek = function() {
266
- return E(this);
270
+ return Y(this);
267
271
  }, Date.prototype.isToday = function() {
268
- return L(this);
272
+ return P(this);
269
273
  }, Date.prototype.isLeapYear = function() {
270
- return n(this);
274
+ return l(this);
271
275
  }, Date.prototype.format = function(a = "YYYY-MM-DD") {
272
276
  return ue(this, a);
273
277
  }, Date.prototype.formatTime = function(a = "HH:mm") {
274
278
  return re(this, a);
275
279
  };
276
- }, i = () => {
280
+ }, o = () => {
277
281
  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;
278
- }, f = (a) => {
279
- m.value = a, Date.prototype.subtractDays && C();
280
- }, $ = () => (D !== (/* @__PURE__ */ new Date()).getDate() && (r = /* @__PURE__ */ new Date(), D = r.getDate(), w = `${r.getFullYear()}-${r.getMonth()}-${r.getDate()}`), w), W = (a, k) => {
282
+ }, m = (a) => {
283
+ v.value = a, Date.prototype.subtractDays && C();
284
+ }, $ = () => (g !== (/* @__PURE__ */ new Date()).getDate() && (r = /* @__PURE__ */ new Date(), g = r.getDate(), p = `${r.getFullYear()}-${r.getMonth()}-${r.getDate()}`), p), W = (a, _) => {
281
285
  const y = new Date(a.valueOf());
282
- return y.setDate(y.getDate() + k), y;
283
- }, G = (a, k) => {
286
+ return y.setDate(y.getDate() + _), y;
287
+ }, G = (a, _) => {
284
288
  const y = new Date(a.valueOf());
285
- return y.setDate(y.getDate() - k), y;
286
- }, o = (a, k) => {
289
+ return y.setDate(y.getDate() - _), y;
290
+ }, i = (a, _) => {
287
291
  const y = new Date(a.valueOf());
288
- return y.setHours(y.getHours() + k), y;
289
- }, c = (a, k) => {
292
+ return y.setHours(y.getHours() + _), y;
293
+ }, u = (a, _) => {
290
294
  const y = new Date(a.valueOf());
291
- return y.setHours(y.getHours() - k), y;
292
- }, e = (a, k) => {
295
+ return y.setHours(y.getHours() - _), y;
296
+ }, e = (a, _) => {
293
297
  const y = new Date(a.valueOf());
294
- return y.setMinutes(y.getMinutes() + k), y;
295
- }, v = (a, k) => {
298
+ return y.setMinutes(y.getMinutes() + _), y;
299
+ }, d = (a, _) => {
296
300
  const y = new Date(a.valueOf());
297
- return y.setMinutes(y.getMinutes() - k), y;
298
- }, h = (a, k) => {
301
+ return y.setMinutes(y.getMinutes() - _), y;
302
+ }, h = (a, _) => {
299
303
  const y = (B) => {
300
- const Q = B % k;
301
- return Q !== 0 && (B += Q >= k / 2 ? k - Q : -Q), B;
304
+ const Q = B % _;
305
+ return Q !== 0 && (B += Q >= _ / 2 ? _ - Q : -Q), B;
302
306
  };
303
307
  if (typeof a == "number") return y(a);
304
308
  if (a instanceof Date) {
305
309
  let B = y(a.getMinutes());
306
310
  B >= 60 && (a.setHours(a.getHours() + 1), B = 0), a.setMinutes(B, 0, 0);
307
311
  }
308
- }, E = (a, k = !1) => {
312
+ }, Y = (a, _ = !1) => {
309
313
  const y = new Date(Date.UTC(a.getFullYear(), a.getMonth(), a.getDate())), B = y.getUTCDay() || 7;
310
314
  y.setUTCDate(y.getUTCDate() + 4 - B);
311
315
  const Q = new Date(Date.UTC(y.getUTCFullYear(), 0, 1));
312
- return Math.ceil(((y - Q) / 864e5 + 1) / 7) + (k ? 1 : 0);
313
- }, L = (a) => `${a.getFullYear()}-${a.getMonth()}-${a.getDate()}` === $(), A = (a, k) => {
314
- if (!a || !k) return console.warn(`Vue Cal: missing date${a ? "2" : "1"} parameter for comparison with \`isSameDate(date1, date2)\`.`);
315
- if (J(a)) {
316
- if (!J(k)) return console.warn(`Vue Cal: invalid date2 provided for comparison with \`isSameDate(date1, date2)\`: \`${k}\`.`);
316
+ return Math.ceil(((y - Q) / 864e5 + 1) / 7) + (_ ? 1 : 0);
317
+ }, P = (a) => `${a.getFullYear()}-${a.getMonth()}-${a.getDate()}` === $(), A = (a, _) => {
318
+ if (!a || !_) return console.warn(`Vue Cal: missing date${a ? "2" : "1"} parameter for comparison with \`isSameDate(date1, date2)\`.`);
319
+ if (K(a)) {
320
+ if (!K(_)) return console.warn(`Vue Cal: invalid date2 provided for comparison with \`isSameDate(date1, date2)\`: \`${_}\`.`);
317
321
  } else return console.warn(`Vue Cal: invalid date1 provided for comparison with \`isSameDate(date1, date2)\`: \`${a}\`.`);
318
- return a.getFullYear() === k.getFullYear() && a.getMonth() === k.getMonth() && a.getDate() === k.getDate();
319
- }, l = (a, k, y) => J(a) ? a.getTime() >= k && a.getTime() <= y : console.warn(`Vue Cal: invalid date provided to \`isInRange(date, rangeStart, rangeEnd)\`: \`${a}\`.`), n = (a) => {
320
- const k = a.getFullYear();
321
- return !(k % 400) || k % 100 && !(k % 4);
322
- }, _ = (a = null, k) => {
323
- const y = a && new Date(a.valueOf()) || /* @__PURE__ */ new Date(), B = k ? 7 : 6;
322
+ return a.getFullYear() === _.getFullYear() && a.getMonth() === _.getMonth() && a.getDate() === _.getDate();
323
+ }, s = (a, _, y) => K(a) ? a.getTime() >= _ && a.getTime() <= y : console.warn(`Vue Cal: invalid date provided to \`isInRange(date, rangeStart, rangeEnd)\`: \`${a}\`.`), l = (a) => {
324
+ const _ = a.getFullYear();
325
+ return !(_ % 400) || _ % 100 && !(_ % 4);
326
+ }, k = (a = null, _) => {
327
+ const y = a && new Date(a.valueOf()) || /* @__PURE__ */ new Date(), B = _ ? 7 : 6;
324
328
  return y.setDate(y.getDate() - (y.getDay() + B) % 7), y;
325
- }, t = (a) => a instanceof Date ? a : (a.length === 10 && (a += " 00:00"), new Date(a.replace(/-/g, "/"))), O = (a) => a.getHours() * 60 + a.getMinutes(), P = (a, k) => {
326
- typeof a == "string" && (a = a.replace(/-/g, "/")), typeof k == "string" && (k = k.replace(/-/g, "/")), a = new Date(a).setHours(0, 0, 0, 0), k = new Date(k).setHours(0, 0, 1, 0);
327
- const y = (new Date(k).getTimezoneOffset() - new Date(a).getTimezoneOffset()) * 60 * 1e3;
328
- return Math.ceil((k - a - y) / (24 * 3600 * 1e3));
329
- }, q = (a, k, y) => Math.abs(a.getTime() - k.getTime()) <= y * 60 * 1e3, J = (a) => a && a instanceof Date && !isNaN(a), ue = (a, k = "YYYY-MM-DD", y = null) => {
330
- if (y || (y = m.value), k || (k = "YYYY-MM-DD"), k === "YYYY-MM-DD") return ae(a);
331
- b = {}, H = {};
329
+ }, t = (a) => a instanceof Date ? a : (a.length === 10 && (a += " 00:00"), new Date(a.replace(/-/g, "/"))), V = (a) => a.getHours() * 60 + a.getMinutes(), H = (a, _) => {
330
+ typeof a == "string" && (a = a.replace(/-/g, "/")), typeof _ == "string" && (_ = _.replace(/-/g, "/")), a = new Date(a).setHours(0, 0, 0, 0), _ = new Date(_).setHours(0, 0, 1, 0);
331
+ const y = (new Date(_).getTimezoneOffset() - new Date(a).getTimezoneOffset()) * 60 * 1e3;
332
+ return Math.ceil((_ - a - y) / (24 * 3600 * 1e3));
333
+ }, U = (a, _, y) => Math.abs(a.getTime() - _.getTime()) <= y * 60 * 1e3, K = (a) => a && a instanceof Date && !isNaN(a), ue = (a, _ = "YYYY-MM-DD", y = null) => {
334
+ if (y || (y = v.value), _ || (_ = "YYYY-MM-DD"), _ === "YYYY-MM-DD") return ae(a);
335
+ b = {}, L = {};
332
336
  const B = {
333
337
  YYYY: () => ee(a, y).YYYY,
334
338
  YY: () => ee(a, y).YY(),
@@ -344,42 +348,42 @@ const nt = (u, s) => {
344
348
  dd: () => ee(a, y).dd(),
345
349
  ddd: () => ee(a, y).ddd(),
346
350
  dddd: () => ee(a, y).dddd(),
347
- HH: () => ie(a, y).HH,
348
- H: () => ie(a, y).H,
349
- hh: () => ie(a, y).hh,
350
- h: () => ie(a, y).h,
351
- am: () => ie(a, y).am,
352
- AM: () => ie(a, y).AM,
353
- mm: () => ie(a, y).mm,
354
- m: () => ie(a, y).m,
355
- s: () => ie(a, y).s
351
+ HH: () => oe(a, y).HH,
352
+ H: () => oe(a, y).H,
353
+ hh: () => oe(a, y).hh,
354
+ h: () => oe(a, y).h,
355
+ am: () => oe(a, y).am,
356
+ AM: () => oe(a, y).AM,
357
+ mm: () => oe(a, y).mm,
358
+ m: () => oe(a, y).m,
359
+ s: () => oe(a, y).s
356
360
  };
357
- return k.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (Q, d) => {
358
- const p = B[d.replace(/\{|\}/g, "")];
359
- return p !== void 0 ? p() : d;
361
+ return _.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (Q, c) => {
362
+ const w = B[c.replace(/\{|\}/g, "")];
363
+ return w !== void 0 ? w() : c;
360
364
  });
361
365
  }, ae = (a) => {
362
- const k = a.getMonth() + 1, y = a.getDate();
363
- return `${a.getFullYear()}-${k < 10 ? "0" : ""}${k}-${y < 10 ? "0" : ""}${y}`;
364
- }, re = (a, k = "HH:mm", y = null, B = !1) => {
366
+ const _ = a.getMonth() + 1, y = a.getDate();
367
+ return `${a.getFullYear()}-${_ < 10 ? "0" : ""}${_}-${y < 10 ? "0" : ""}${y}`;
368
+ }, re = (a, _ = "HH:mm", y = null, B = !1) => {
365
369
  let Q = !1;
366
370
  if (B) {
367
- const [V, M, N] = [a.getHours(), a.getMinutes(), a.getSeconds()];
368
- V + M + N === 141 && (Q = !0);
371
+ const [S, M, N] = [a.getHours(), a.getMinutes(), a.getSeconds()];
372
+ S + M + N === 141 && (Q = !0);
369
373
  }
370
- if (a instanceof Date && k === "HH:mm") return Q ? "24:00" : he(a);
371
- H = {}, y || (y = m.value);
372
- const d = ie(a, y), p = k.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (V, M) => {
373
- const N = d[M.replace(/\{|\}/g, "")];
374
+ if (a instanceof Date && _ === "HH:mm") return Q ? "24:00" : he(a);
375
+ L = {}, y || (y = v.value);
376
+ const c = oe(a, y), w = _.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (S, M) => {
377
+ const N = c[M.replace(/\{|\}/g, "")];
374
378
  return N !== void 0 ? N : M;
375
379
  });
376
- return Q ? p.replace("23:59", "24:00") : p;
380
+ return Q ? w.replace("23:59", "24:00") : w;
377
381
  }, he = (a) => {
378
- const k = a.getHours(), y = a.getMinutes();
379
- return `${(k < 10 ? "0" : "") + k}:${(y < 10 ? "0" : "") + y}`;
380
- }, K = (a) => {
381
- const k = Math.floor(a / 60).toString().padStart(2, 0), y = (a % 60).toString().padStart(2, 0);
382
- return `${k}:${y}`;
382
+ const _ = a.getHours(), y = a.getMinutes();
383
+ return `${(_ < 10 ? "0" : "") + _}:${(y < 10 ? "0" : "") + y}`;
384
+ }, q = (a) => {
385
+ const _ = Math.floor(a / 60).toString().padStart(2, 0), y = (a % 60).toString().padStart(2, 0);
386
+ return `${_}:${y}`;
383
387
  }, ce = (a) => {
384
388
  if (a > 3 && a < 21) return "th";
385
389
  switch (a % 10) {
@@ -392,9 +396,9 @@ const nt = (u, s) => {
392
396
  default:
393
397
  return "th";
394
398
  }
395
- }, ee = (a, k) => {
399
+ }, ee = (a, _) => {
396
400
  if (b.D) return b;
397
- const y = a.getFullYear(), B = a.getMonth() + 1, Q = a.getDate(), p = (a.getDay() - 1 + 7) % 7;
401
+ const y = a.getFullYear(), B = a.getMonth() + 1, Q = a.getDate(), w = (a.getDay() - 1 + 7) % 7;
398
402
  return b = {
399
403
  // Year.
400
404
  YYYY: y,
@@ -406,11 +410,11 @@ const nt = (u, s) => {
406
410
  // 1 to 12.
407
411
  MM: () => B.toString().padStart(2, 0),
408
412
  // 01 to 12.
409
- MMM: () => k.months[B - 1].substring(0, 3),
413
+ MMM: () => _.months[B - 1].substring(0, 3),
410
414
  // Jan to Dec.
411
- MMMM: () => k.months[B - 1],
415
+ MMMM: () => _.months[B - 1],
412
416
  // January to December.
413
- MMMMG: () => (k.monthsGenitive || k.months)[B - 1],
417
+ MMMMG: () => (_.monthsGenitive || _.months)[B - 1],
414
418
  // January to December in genitive form (Greek...)
415
419
  // Day.
416
420
  D: Q,
@@ -420,66 +424,66 @@ const nt = (u, s) => {
420
424
  S: () => ce(Q),
421
425
  // st, nd, rd, th.
422
426
  // Day of the week.
423
- d: p + 1,
427
+ d: w + 1,
424
428
  // 1 to 7 with 7 = Sunday.
425
429
  // Some locales have same start for all the days, so they have specific abbrev in weekDaysShort.
426
- dd: () => k.weekDaysShort.length ? k.weekDaysShort[p] : k.weekDays[p][0],
430
+ dd: () => _.weekDaysShort.length ? _.weekDaysShort[w] : _.weekDays[w][0],
427
431
  // M to S.
428
- ddd: () => k.weekDaysShort.length ? k.weekDaysShort[p] : k.weekDays[p].substr(0, 3),
432
+ ddd: () => _.weekDaysShort.length ? _.weekDaysShort[w] : _.weekDays[w].substr(0, 3),
429
433
  // Mon to Sun.
430
- dddd: () => k.weekDays[p]
434
+ dddd: () => _.weekDays[w]
431
435
  // Monday to Sunday.
432
436
  }, b;
433
- }, ie = (a, k) => {
434
- if (H.am) return H;
437
+ }, oe = (a, _) => {
438
+ if (L.am) return L;
435
439
  let y, B, Q;
436
440
  a instanceof Date ? (y = a.getHours(), B = a.getMinutes(), Q = a.getSeconds()) : (y = Math.floor(a / 60), B = Math.floor(a % 60));
437
- const d = y % 12 ? y % 12 : 12, p = (k || { am: "am", pm: "pm" })[y === 24 || y < 12 ? "am" : "pm"];
438
- return H = {
441
+ const c = y % 12 ? y % 12 : 12, w = (_ || { am: "am", pm: "pm" })[y === 24 || y < 12 ? "am" : "pm"];
442
+ return L = {
439
443
  H: y,
440
- h: d,
444
+ h: c,
441
445
  HH: y.toString().padStart(2, 0),
442
- hh: d.toString().padStart(2, 0),
443
- am: p,
444
- AM: p.toUpperCase(),
446
+ hh: c.toString().padStart(2, 0),
447
+ am: w,
448
+ AM: w.toUpperCase(),
445
449
  m: B,
446
450
  mm: B.toString().padStart(2, 0),
447
451
  s: Q
448
- }, H;
452
+ }, L;
449
453
  };
450
454
  return {
451
455
  addDatePrototypes: C,
452
- removeDatePrototypes: i,
453
- updateTexts: f,
456
+ removeDatePrototypes: o,
457
+ updateTexts: m,
454
458
  addDays: W,
455
459
  subtractDays: G,
456
- addHours: o,
457
- subtractHours: c,
460
+ addHours: i,
461
+ subtractHours: u,
458
462
  addMinutes: e,
459
- subtractMinutes: v,
463
+ subtractMinutes: d,
460
464
  snapToInterval: h,
461
- getWeek: E,
462
- isToday: L,
465
+ getWeek: Y,
466
+ isToday: P,
463
467
  isSameDate: A,
464
- isInRange: l,
465
- isLeapYear: n,
466
- getPreviousFirstDayOfWeek: _,
468
+ isInRange: s,
469
+ isLeapYear: l,
470
+ getPreviousFirstDayOfWeek: k,
467
471
  stringToDate: t,
468
- dateToMinutes: O,
469
- countDays: P,
470
- datesInSameTimeStep: q,
471
- isValid: J,
472
+ dateToMinutes: V,
473
+ countDays: H,
474
+ datesInSameTimeStep: U,
475
+ isValid: K,
472
476
  formatDate: ue,
473
477
  formatDateLite: ae,
474
478
  formatTime: re,
475
479
  formatTimeLite: he,
476
- formatMinutes: K
480
+ formatMinutes: q
477
481
  };
478
- }, gt = (u) => {
479
- const { dateUtils: s, config: r } = u;
480
- let D = 0;
481
- const w = T(() => {
482
- const o = {
482
+ }, gt = (D) => {
483
+ const { dateUtils: n, config: r } = D;
484
+ let g = 0;
485
+ const p = T(() => {
486
+ const i = {
483
487
  byDate: {},
484
488
  // A map of single-day events indexed by date.
485
489
  recurring: [],
@@ -488,254 +492,256 @@ const nt = (u, s) => {
488
492
  // An array of events IDs that are multiday.
489
493
  byId: {}
490
494
  // A map of all the events indexed by ID for fast lookup.
491
- };
492
- return r.events.sort((e, v) => e.start - v.start < 0 ? -1 : 1).forEach((e) => {
493
- b(e), e._ || (e._ = {}), e._.id = e._.id || ++D, e.delete || (e.delete = (v) => f(e._.id, v)), e._.deleting = !1, e._.deleted = !1, e.isOverlapping = (v = null) => e.getOverlappingEvents(v).length, e.getOverlappingEvents = (v = null) => {
495
+ }, u = r.events.sort((e, d) => e.start - d.start < 0 ? -1 : 1);
496
+ for (const e of u)
497
+ b(e), e._ || (e._ = {}), e._.id = e._.id || ++g, e.delete || (e.delete = (d) => m(e._.id, d)), e._.deleting = !1, e._.deleted = !1, e.isOverlapping = (d = null) => e.getOverlappingEvents(d).length, e.getOverlappingEvents = (d = null) => {
494
498
  var h;
495
499
  return W(
496
- m(s.formatDate((v == null ? void 0 : v.start) || e.start), !0),
497
- { start: (v == null ? void 0 : v.start) || e.start, end: (v == null ? void 0 : v.end) || e.end },
498
- { excludeIds: [e._.id], schedule: (h = r.schedules) != null && h.length ? ~~((v == null ? void 0 : v.schedule) || e.schedule) : null }
500
+ v(n.formatDate((d == null ? void 0 : d.start) || e.start), !0),
501
+ { start: (d == null ? void 0 : d.start) || e.start, end: (d == null ? void 0 : d.end) || e.end },
502
+ { excludeIds: [e._.id], schedule: (h = r.schedules) != null && h.length ? ~~((d == null ? void 0 : d.schedule) || e.schedule) : null }
499
503
  );
500
- }, e._.register = (v) => {
501
- e._.$el = v, e._.fireCreated && (u.emit("event-created", e), delete e._.fireCreated);
504
+ }, e._.register = (d) => {
505
+ e._.$el = d, e._.fireCreated && (D.emit("event-created", e), delete e._.fireCreated);
502
506
  }, e._.unregister = () => {
503
507
  e._.$el = null, e._.register = null, e.isOverlapping = null, e.getOverlappingEvents = null, e.delete = null;
504
- }, o.byId[e._.id] = e, e.recurring ? o.recurring.push(e._.id) : e._.multiday ? (o.multiday.push(e._.id), o.byDate[e._.startFormatted] || (o.byDate[e._.startFormatted] = []), o.byDate[e._.startFormatted].push(e._.id)) : (o.byDate[e._.startFormatted] || (o.byDate[e._.startFormatted] = []), o.byDate[e._.startFormatted].push(e._.id));
505
- }), o;
506
- }), b = (o) => {
507
- if (typeof o.start == "string" && (o.start = s.stringToDate(o.start)), typeof o.end == "string" && (o.end = s.stringToDate(o.end)), o.start.setSeconds(0, 0), o.end.setSeconds(0, 0), isNaN(o.start) || isNaN(o.end)) {
508
- isNaN(o.start) ? console.error(`Vue Cal: invalid start date for event "${o.title}".`, o.start) : console.error(`Vue Cal: invalid end date for event "${o.title}".`, o.end);
508
+ }, i.byId[e._.id] = e, e.recurring ? i.recurring.push(e._.id) : e._.multiday ? (i.multiday.push(e._.id), i.byDate[e._.startFormatted] || (i.byDate[e._.startFormatted] = []), i.byDate[e._.startFormatted].push(e._.id)) : (i.byDate[e._.startFormatted] || (i.byDate[e._.startFormatted] = []), i.byDate[e._.startFormatted].push(e._.id));
509
+ return i;
510
+ }), b = (i) => {
511
+ if (typeof i.start == "string" && (i.start = n.stringToDate(i.start)), typeof i.end == "string" && (i.end = n.stringToDate(i.end)), i.start.setSeconds(0, 0), i.end.setSeconds(0, 0), isNaN(i.start) || isNaN(i.end)) {
512
+ isNaN(i.start) ? console.error(`Vue Cal: invalid start date for event "${i.title}".`, i.start) : console.error(`Vue Cal: invalid end date for event "${i.title}".`, i.end);
509
513
  return;
510
- } else o.end.getTime() < o.start.getTime() && console.error(`Vue Cal: invalid event dates for event "${o.title}". The event ends before it starts.`, o.start, o.end);
511
- o._ || (o._ = {}), o._.multiday = !s.isSameDate(o.start, new Date(o.end.getTime() - 1)), o._.startFormatted = s.formatDate(o.start), o._.startMinutes = ~~s.dateToMinutes(o.start), o._.endMinutes = ~~s.dateToMinutes(o.end);
512
- const c = o.start.getHours(), e = o.start.getMinutes().toString().padStart(2, 0), v = o.end.getHours(), h = o.end.getMinutes().toString().padStart(2, 0);
513
- o._.startTimeFormatted24 = `${c.toString().padStart(2, 0)}:${e}`, o._.startTimeFormatted12 = `${c % 12 || 12}${e ? `:${e}` : ""} ${c < 12 ? "AM" : "PM"}`, o._.endTimeFormatted24 = `${v.toString().padStart(2, 0)}:${h}`, o._.endTimeFormatted12 = `${v % 12 || 12}${h ? `:${h}` : ""} ${v < 12 ? "AM" : "PM"}`, o._.duration = Math.abs(~~((o.end - o.start) / 6e4));
514
- }, H = (o) => w.value.byId[o], m = (o, c = !1, e = !1) => {
515
- let v = w.value.byDate[o] || [];
516
- return v = c || e ? v.map(H) : v, e || (v = v.filter((h) => !h.background), c || (v = v.map((h) => h._.id))), v;
517
- }, C = (o) => {
518
- const c = {};
519
- return o.forEach(({ startFormatted: e }) => {
520
- c[e] = [];
521
- const v = m(e, !1, !0);
522
- v.length && c[e].push(...v);
523
- }), c;
524
- }, i = (o) => {
525
- if (!o.start || !o.end) {
514
+ } else i.end.getTime() < i.start.getTime() && console.error(`Vue Cal: invalid event dates for event "${i.title}". The event ends before it starts.`, i.start, i.end);
515
+ i._ || (i._ = {}), i._.multiday = !n.isSameDate(i.start, new Date(i.end.getTime() - 1)), i._.startFormatted = n.formatDate(i.start), i._.startMinutes = ~~n.dateToMinutes(i.start), i._.endMinutes = ~~n.dateToMinutes(i.end);
516
+ const u = i.start.getHours(), e = i.start.getMinutes().toString().padStart(2, 0), d = i.end.getHours(), h = i.end.getMinutes().toString().padStart(2, 0);
517
+ i._.startTimeFormatted24 = `${u.toString().padStart(2, 0)}:${e}`, i._.startTimeFormatted12 = `${u % 12 || 12}${e ? `:${e}` : ""} ${u < 12 ? "AM" : "PM"}`, i._.endTimeFormatted24 = `${d.toString().padStart(2, 0)}:${h}`, i._.endTimeFormatted12 = `${d % 12 || 12}${h ? `:${h}` : ""} ${d < 12 ? "AM" : "PM"}`, i._.duration = Math.abs(~~((i.end - i.start) / 6e4));
518
+ }, L = (i) => p.value.byId[i], v = (i, u = !1, e = !1) => {
519
+ let d = p.value.byDate[i] || [];
520
+ return d = u || e ? d.map(L) : d, e || (d = d.filter((h) => !h.background), u || (d = d.map((h) => h._.id))), d;
521
+ }, C = (i) => {
522
+ const u = {};
523
+ for (const { startFormatted: e } of i) {
524
+ u[e] = [];
525
+ const d = v(e, !1, !0);
526
+ d.length && u[e].push(...d);
527
+ }
528
+ return u;
529
+ }, o = (i) => {
530
+ if (!i.start || !i.end) {
526
531
  console.error("Vue Cal: Cannot create an event without valid start and end dates.");
527
532
  return;
528
533
  }
529
- return r.snapToInterval && (s.snapToInterval(o.start, r.snapToInterval), s.snapToInterval(o.end, r.snapToInterval)), o = { ...o }, o._ || (o._ = {}), o._.id = ++D, o._.fireCreated = !0, r.events.push(o), o;
530
- }, f = (o, c = 0) => {
534
+ return r.snapToInterval && (n.snapToInterval(i.start, r.snapToInterval), n.snapToInterval(i.end, r.snapToInterval)), i = { ...i }, i._ || (i._ = {}), i._.id = ++g, i._.fireCreated = !0, r.events.push(i), i;
535
+ }, m = (i, u = 0) => {
531
536
  var h;
532
537
  if (!r.editableEvents.delete)
533
538
  return console.info("Vue Cal: Event deletion is disabled. Enable it with the `editable-events` props.");
534
- if (!o) return console.warn("Vue Cal: Cannot delete event without its ID.");
535
- const e = r.events.findIndex((E) => E._.id === o);
536
- if (e === -1) return console.warn(`Vue Cal: Cannot delete unknown event \`${o}\`.`);
537
- const v = r.events[e];
538
- if (v.deletable === !1) return console.warn(`Vue Cal: Can't delete event \`${o}\` since it was explicitely set to \`delete: false\`.`);
539
- switch (c) {
539
+ if (!i) return console.warn("Vue Cal: Cannot delete event without its ID.");
540
+ const e = r.events.findIndex((Y) => Y._.id === i);
541
+ if (e === -1) return console.warn(`Vue Cal: Cannot delete unknown event \`${i}\`.`);
542
+ const d = r.events[e];
543
+ if (d.deletable === !1) return console.warn(`Vue Cal: Can't delete event \`${i}\` since it was explicitely set to \`delete: false\`.`);
544
+ switch (u) {
540
545
  case 0:
541
- v._.deleting ? r.events.splice(e, 1) : v._.deleting = !0;
546
+ d._.deleting ? r.events.splice(e, 1) : d._.deleting = !0;
542
547
  break;
543
548
  // Display the delete button.
544
549
  case 1:
545
- v._.deleting = !0;
550
+ d._.deleting = !0;
546
551
  break;
547
552
  // Visual deletion + external DOM event firing.
548
553
  // When explicitly using this stage, the event will be visually deleted but still present in the
549
554
  // source of truth until the cell is unmounted (by navigating away).
550
555
  case 2:
551
- v._.deleted = !0, r.events[e]._.deleted = !0, (h = v._.$el) == null || h.dispatchEvent(new CustomEvent("event-deleted", { detail: v._.id }));
556
+ d._.deleted = !0, r.events[e]._.deleted = !0, (h = d._.$el) == null || h.dispatchEvent(new CustomEvent("event-deleted", { detail: d._.id }));
552
557
  break;
553
558
  // Effective deletion from the source of truth (by default, when unmounting the cell).
554
559
  case 3:
555
- r.events.splice(e, 1), u.emit("update:events", r.events), u.emit("event-delete", v);
560
+ r.events.splice(e, 1), D.emit("update:events", r.events), D.emit("event-delete", d);
556
561
  break;
557
562
  }
558
563
  return !0;
559
- }, $ = (o) => {
560
- const c = m(o, !0);
561
- if (!c.length) return { cellOverlaps: {}, longestStreak: 0 };
562
- let e = {}, v = [], h = 0;
563
- c.sort((E, L) => E.start - L.start || E.end - E.start - (L.end - L.start));
564
- for (const E of c) {
565
- const L = E._.id;
566
- e[L] || (e[L] = { overlaps: /* @__PURE__ */ new Set(), maxConcurrent: 1, position: 0 }), v = v.filter((t) => t.end > E.start);
567
- let A = v.filter((t) => {
568
- var P;
569
- return (!((P = r.schedules) != null && P.length) || E.schedule === t.schedule) && t.start < E.end;
570
- }), l = new Set(A.map((t) => {
571
- var O;
572
- return ((O = e[t._.id]) == null ? void 0 : O.position) ?? 0;
573
- })), n = 0;
574
- for (; l.has(n); ) n++;
575
- e[L].position = n, v.push(E);
576
- let _ = Math.max(1, ...A.map((t) => {
577
- var O;
578
- return ((O = e[t._.id]) == null ? void 0 : O.maxConcurrent) ?? 1;
564
+ }, $ = (i) => {
565
+ const u = v(i, !0);
566
+ if (!u.length) return { cellOverlaps: {}, longestStreak: 0 };
567
+ const e = {};
568
+ let d = [], h = 0;
569
+ u.sort((Y, P) => Y.start - P.start || Y.end - Y.start - (P.end - P.start));
570
+ for (const Y of u) {
571
+ const P = Y._.id;
572
+ e[P] || (e[P] = { overlaps: /* @__PURE__ */ new Set(), maxConcurrent: 1, position: 0 }), d = d.filter((t) => t.end > Y.start);
573
+ let A = d.filter((t) => {
574
+ var H;
575
+ return (!((H = r.schedules) != null && H.length) || Y.schedule === t.schedule) && t.start < Y.end;
576
+ }), s = new Set(A.map((t) => {
577
+ var V;
578
+ return ((V = e[t._.id]) == null ? void 0 : V.position) ?? 0;
579
+ })), l = 0;
580
+ for (; s.has(l); ) l++;
581
+ e[P].position = l, d.push(Y);
582
+ let k = Math.max(1, ...A.map((t) => {
583
+ var V;
584
+ return ((V = e[t._.id]) == null ? void 0 : V.maxConcurrent) ?? 1;
579
585
  }));
580
- e[L].maxConcurrent = Math.max(A.length + 1, _);
586
+ e[P].maxConcurrent = Math.max(A.length + 1, k);
581
587
  for (const t of A)
582
- e[t._.id].overlaps.add(L), e[L].overlaps.add(t._.id), e[t._.id].maxConcurrent = e[L].maxConcurrent;
583
- h = Math.max(h, e[L].maxConcurrent);
588
+ e[t._.id].overlaps.add(P), e[P].overlaps.add(t._.id), e[t._.id].maxConcurrent = e[P].maxConcurrent;
589
+ h = Math.max(h, e[P].maxConcurrent);
584
590
  }
585
- for (const E in e) e[E].overlaps = [...e[E].overlaps];
591
+ for (const Y in e) e[Y].overlaps = [...e[Y].overlaps];
586
592
  return { cellOverlaps: e, longestStreak: h };
587
- }, W = (o = [], { start: c, end: e }, { excludeIds: v = [], schedule: h = null }) => {
593
+ }, W = (i = [], { start: u, end: e }, { excludeIds: d = [], schedule: h = null }) => {
588
594
  var A;
589
- const E = new Set(v), L = [];
590
- for (const l of o)
591
- !E.has((A = l._) == null ? void 0 : A.id) && (h === null || h === l.schedule) && G(l, c, e) && L.push(l);
592
- return L;
593
- }, G = (o, c, e) => {
594
- const v = o.allDay || !r.time, h = v ? new Date(o.start).setHours(0, 0, 0, 0) : o.start.getTime(), E = v ? new Date(o.end).setHours(23, 59, 59, 999) : o.end.getTime(), L = v ? new Date(c).setHours(0, 0, 0, 0) : c.getTime(), A = v ? new Date(e).setHours(23, 59, 59, 999) : e.getTime();
595
- return E > L && h < A;
595
+ const Y = new Set(d), P = [];
596
+ for (const s of i)
597
+ !Y.has((A = s._) == null ? void 0 : A.id) && (h === null || h === s.schedule) && G(s, u, e) && P.push(s);
598
+ return P;
599
+ }, G = (i, u, e) => {
600
+ const d = i.allDay || !r.time, h = d ? new Date(i.start).setHours(0, 0, 0, 0) : i.start.getTime(), Y = d ? new Date(i.end).setHours(23, 59, 59, 999) : i.end.getTime(), P = d ? new Date(u).setHours(0, 0, 0, 0) : u.getTime(), A = d ? new Date(e).setHours(23, 59, 59, 999) : e.getTime();
601
+ return Y > P && h < A;
596
602
  };
597
603
  return {
598
- events: w,
599
- getEvent: H,
600
- getEventsByDate: m,
604
+ events: p,
605
+ getEvent: L,
606
+ getEventsByDate: v,
601
607
  getViewEvents: C,
602
608
  getCellOverlappingEvents: $,
603
609
  getEventsInRange: W,
604
- createEvent: i,
605
- deleteEvent: f,
610
+ createEvent: o,
611
+ deleteEvent: m,
606
612
  isEventInRange: G
607
613
  };
608
- }, ht = ({ config: u, dateUtils: s, emit: r, texts: D, eventsManager: w }, b) => {
609
- const { availableViews: H } = u, m = oe(u.view && H[u.view] ? u.view : u.defaultView), C = oe(u.selectedDate || null);
610
- let i = oe(/* @__PURE__ */ new Date());
611
- const f = oe(new Date(u.viewDate || i.value));
612
- f.value.setHours(0, 0, 0, 0);
613
- const $ = oe(new Date(f));
614
+ }, ht = ({ config: D, dateUtils: n, emit: r, texts: g, eventsManager: p }, b) => {
615
+ const { availableViews: L } = D, v = ie(D.view && L[D.view] ? D.view : D.defaultView), C = ie(D.selectedDate || null), o = ie(/* @__PURE__ */ new Date()), m = ie(new Date(D.viewDate || o.value));
616
+ m.value.setHours(0, 0, 0, 0);
617
+ const $ = ie(new Date(m));
614
618
  let W = null;
615
- const G = T(() => m.value === "month" ? $.value : n.value), o = T(() => m.value === "month" ? new Date($.value.getFullYear(), $.value.getMonth() + 1, 0, 23, 59, 59, 999) : t.value), c = T(() => m.value === "week" ? s.getPreviousFirstDayOfWeek(n.value, u.startWeekOnSunday) : m.value === "month" ? n.value : G.value), e = T(() => {
616
- if (m.value === "week") {
617
- const g = s.addDays(c.value, 7);
618
- return g.setMilliseconds(-1), g;
619
- } else if (m.value === "month") return t.value;
620
- return o.value;
621
- }), v = T(() => {
622
- const g = i.value.getTime();
623
- if (m.value === "week")
624
- return c.value.getTime() <= g && g <= e.value.getTime();
625
- const z = n.value.getTime(), R = t.value.getTime();
626
- return z <= g && g <= R;
619
+ const G = T(() => v.value === "month" ? $.value : l.value), i = T(() => v.value === "month" ? new Date($.value.getFullYear(), $.value.getMonth() + 1, 0, 23, 59, 59, 999) : t.value), u = T(() => v.value === "week" ? n.getPreviousFirstDayOfWeek(l.value, D.startWeekOnSunday) : v.value === "month" ? l.value : G.value), e = T(() => {
620
+ if (v.value === "week") {
621
+ const f = n.addDays(u.value, 7);
622
+ return f.setMilliseconds(-1), f;
623
+ }
624
+ return v.value === "month" ? t.value : i.value;
625
+ }), d = T(() => {
626
+ const f = o.value.getTime();
627
+ if (v.value === "week")
628
+ return u.value.getTime() <= f && f <= e.value.getTime();
629
+ const z = l.value.getTime(), R = t.value.getTime();
630
+ return z <= f && f <= R;
627
631
  });
628
632
  function h() {
629
- i.value = /* @__PURE__ */ new Date(), W = setTimeout(h, 60 * 1e3);
633
+ o.value = /* @__PURE__ */ new Date(), W = setTimeout(h, 60 * 1e3);
630
634
  }
631
- function E() {
635
+ function Y() {
632
636
  W = setTimeout(h, (60 - (/* @__PURE__ */ new Date()).getSeconds()) * 1e3), h();
633
637
  }
634
- const L = T(() => {
635
- if (!u.availableViews[m.value]) return 1;
636
- let g = u.availableViews[m.value].cols;
637
- return u.hasHiddenDays && ["week", "month"].includes(m.value) && (g -= u.hasHiddenDays), g;
638
+ const P = T(() => {
639
+ if (!D.availableViews[v.value]) return 1;
640
+ let f = D.availableViews[v.value].cols;
641
+ return D.hasHiddenDays && ["week", "month"].includes(v.value) && (f -= D.hasHiddenDays), f;
638
642
  }), A = T(() => {
639
- var g;
640
- return ((g = u.availableViews[m.value]) == null ? void 0 : g.rows) || 1;
641
- }), l = T(() => L.value * A.value), n = T(() => {
642
- if (m.value === "month") {
643
- let g = $.value.getDay() || 7;
644
- return u.startWeekOnSunday && !u.hideWeekdays[7] && (g += 1), u.viewDayOffset && (g -= u.viewDayOffset), s.subtractDays($.value, g - 1);
645
- } else if (m.value === "week") {
646
- const g = "1234567".split("").filter((R) => !Object.keys(u.hideWeekdays).includes(R));
647
- let z = Math.min(...g);
648
- return u.startWeekOnSunday && !u.hideWeekdays[7] && (z = 1), u.viewDayOffset && (z += u.viewDayOffset), s.addDays($.value, z - 1);
649
- } else return $.value;
650
- }), _ = T(() => {
651
- const g = [], z = ["days", "week", "month"].includes(m.value);
643
+ var f;
644
+ return ((f = D.availableViews[v.value]) == null ? void 0 : f.rows) || 1;
645
+ }), s = T(() => P.value * A.value), l = T(() => {
646
+ if (v.value === "month") {
647
+ let f = $.value.getDay() || 7;
648
+ return D.startWeekOnSunday && !D.hideWeekdays[7] && (f += 1), D.viewDayOffset && (f -= D.viewDayOffset), n.subtractDays($.value, f - 1);
649
+ }
650
+ if (v.value === "week") {
651
+ const f = "1234567".split("").filter((R) => !Object.keys(D.hideWeekdays).includes(R));
652
+ let z = Math.min(...f);
653
+ return D.startWeekOnSunday && !D.hideWeekdays[7] && (z = 1), D.viewDayOffset && (z += D.viewDayOffset), n.addDays($.value, z - 1);
654
+ }
655
+ return $.value;
656
+ }), k = T(() => {
657
+ const f = [], z = ["days", "week", "month"].includes(v.value);
652
658
  let R = 0;
653
- for (let X = 0; X < l.value + R; X++)
654
- switch (m.value) {
659
+ for (let X = 0; X < s.value + R; X++)
660
+ switch (v.value) {
655
661
  case "day":
656
662
  case "days":
657
663
  case "week":
658
664
  case "month": {
659
- const ve = s.addDays(n.value, X), We = ve.getDay() || 7;
660
- if (z && u.hasHiddenDays && u.hideWeekdays[We]) {
665
+ const ve = n.addDays(l.value, X), We = ve.getDay() || 7;
666
+ if (z && D.hasHiddenDays && D.hideWeekdays[We]) {
661
667
  R++;
662
668
  continue;
663
669
  }
664
670
  const Ce = new Date(ve);
665
- Ce.setHours(23, 59, 59, 999), g.push({ start: ve, startFormatted: s.formatDate(ve), end: Ce });
671
+ Ce.setHours(23, 59, 59, 999), f.push({ start: ve, startFormatted: n.formatDate(ve), end: Ce });
666
672
  break;
667
673
  }
668
674
  case "year":
669
- g.push({
670
- start: new Date(n.value.getFullYear(), X, 1, 0, 0, 0, 0),
671
- end: new Date(n.value.getFullYear(), X + 1, 0, 23, 59, 59, 999)
675
+ f.push({
676
+ start: new Date(l.value.getFullYear(), X, 1, 0, 0, 0, 0),
677
+ end: new Date(l.value.getFullYear(), X + 1, 0, 23, 59, 59, 999)
672
678
  });
673
679
  break;
674
680
  case "years":
675
- g.push({
676
- start: new Date(n.value.getFullYear() + X, 0, 1, 0, 0, 0, 0),
677
- end: new Date(n.value.getFullYear() + X + 1, 0, 0, 23, 59, 59, 999)
681
+ f.push({
682
+ start: new Date(l.value.getFullYear() + X, 0, 1, 0, 0, 0, 0),
683
+ end: new Date(l.value.getFullYear() + X + 1, 0, 0, 23, 59, 59, 999)
678
684
  });
679
685
  break;
680
686
  }
681
- return g;
682
- }), t = T(() => _.value[_.value.length - 1].end), O = oe("right"), P = T(() => {
683
- const g = Object.keys(u.availableViews);
684
- return g[g.indexOf(m.value) + 1];
685
- }), q = T(() => {
686
- const g = Object.keys(u.availableViews);
687
- return g[g.indexOf(m.value) - 1];
687
+ return f;
688
+ }), t = T(() => k.value[k.value.length - 1].end), V = ie("right"), H = T(() => {
689
+ const f = Object.keys(D.availableViews);
690
+ return f[f.indexOf(v.value) + 1];
691
+ }), U = T(() => {
692
+ const f = Object.keys(D.availableViews);
693
+ return f[f.indexOf(v.value) - 1];
688
694
  });
689
- function J(g, z, R = !1) {
690
- if (!z || !z[g]) return g + 1;
691
- const X = z[g];
695
+ function K(f, z, R = !1) {
696
+ if (!z || !z[f]) return f + 1;
697
+ const X = z[f];
692
698
  return R && typeof X == "string" ? X.substring(0, 3) : X;
693
699
  }
694
- function ue(g, z, R) {
695
- const { monthsArray: X, monthBeforeDay: ve, canTruncate: We, xs: Ce } = R, Me = g.getMonth(), Ee = g.getFullYear(), Ye = z.getMonth(), He = z.getFullYear(), Be = Me !== Ye, lt = Ee !== He, _e = We && (Ce || Be), Le = g.getDate(), ze = z.getDate();
696
- return lt ? ve ? `${J(Me, X, _e)} ${Le}, ${Ee} - ${J(Ye, X, _e)} ${ze}, ${He}` : `${Le} ${J(Me, X, _e)} ${Ee} - ${ze} ${J(Ye, X, _e)} ${He}` : Be ? ve ? `${J(Me, X, _e)} ${Le} - ${J(Ye, X, _e)} ${ze}, ${Ee}` : `${Le} ${J(Me, X, _e)} - ${ze} ${J(Ye, X, _e)} ${Ee}` : ve ? `${J(Me, X, _e)} ${Le}-${ze}, ${Ee}` : `${Le}-${ze} ${J(Me, X, _e)} ${Ee}`;
700
+ function ue(f, z, R) {
701
+ const { monthsArray: X, monthBeforeDay: ve, canTruncate: We, xs: Ce } = R, Me = f.getMonth(), Ye = f.getFullYear(), Ee = z.getMonth(), He = z.getFullYear(), Be = Me !== Ee, lt = Ye !== He, ke = We && (Ce || Be), Le = f.getDate(), ze = z.getDate();
702
+ return lt ? ve ? `${K(Me, X, ke)} ${Le}, ${Ye} - ${K(Ee, X, ke)} ${ze}, ${He}` : `${Le} ${K(Me, X, ke)} ${Ye} - ${ze} ${K(Ee, X, ke)} ${He}` : Be ? ve ? `${K(Me, X, ke)} ${Le} - ${K(Ee, X, ke)} ${ze}, ${Ye}` : `${Le} ${K(Me, X, ke)} - ${ze} ${K(Ee, X, ke)} ${Ye}` : ve ? `${K(Me, X, ke)} ${Le}-${ze}, ${Ye}` : `${Le}-${ze} ${K(Me, X, ke)} ${Ye}`;
697
703
  }
698
704
  const ae = T(() => {
699
- const { dateFormat: g, months: z, monthsGenitive: R, week: X, truncations: ve } = D, We = u.locale, Ce = ve !== !1, Me = g.indexOf("M") < g.indexOf("D"), Ee = R && We === "el" ? R : z;
700
- switch (m.value) {
705
+ const { dateFormat: f, months: z, monthsGenitive: R, week: X, truncations: ve } = g, We = D.locale, Ce = ve !== !1, Me = f.indexOf("M") < f.indexOf("D"), Ye = R && We === "el" ? R : z;
706
+ switch (v.value) {
701
707
  case "day":
702
- return s.formatDate(n.value, g);
708
+ return n.formatDate(l.value, f);
703
709
  case "days":
704
710
  case "week": {
705
- const Ye = {
706
- monthsArray: Ee,
711
+ const Ee = {
712
+ monthsArray: Ye,
707
713
  monthBeforeDay: Me,
708
714
  canTruncate: Ce,
709
- xs: u.xs
715
+ xs: D.xs
710
716
  };
711
- let He = ue(n.value, t.value, Ye);
712
- if (m.value === "week") {
713
- const Be = s.getWeek(
714
- n.value,
715
- u.startWeekOnSunday && !u.hideWeekdays[7]
717
+ let He = ue(l.value, t.value, Ee);
718
+ if (v.value === "week") {
719
+ const Be = n.getWeek(
720
+ l.value,
721
+ D.startWeekOnSunday && !D.hideWeekdays[7]
716
722
  );
717
723
  He += ` <small>${X} ${Be}</small>`;
718
724
  }
719
725
  return He;
720
726
  }
721
727
  case "month": {
722
- const Ye = `${u.xs && Ce ? "MMM" : "MMMM"} YYYY`;
723
- return s.formatDate(G.value, Ye);
728
+ const Ee = `${D.xs && Ce ? "MMM" : "MMMM"} YYYY`;
729
+ return n.formatDate(G.value, Ee);
724
730
  }
725
731
  case "year":
726
- return n.value.getFullYear();
732
+ return l.value.getFullYear();
727
733
  case "years":
728
- return `${n.value.getFullYear()} - ${o.value.getFullYear()}`;
734
+ return `${l.value.getFullYear()} - ${i.value.getFullYear()}`;
729
735
  }
730
736
  });
731
737
  function re() {
732
- switch ($.value = new Date(f.value || i.value), $.value.setHours(0, 0, 0, 0), m.value) {
738
+ switch ($.value = new Date(m.value || o.value), $.value.setHours(0, 0, 0, 0), v.value) {
733
739
  case "day":
734
740
  break;
735
741
  case "days":
736
742
  break;
737
743
  case "week":
738
- $.value = s.getPreviousFirstDayOfWeek($.value, u.startWeekOnSunday && !u.hideWeekdays[7]);
744
+ $.value = n.getPreviousFirstDayOfWeek($.value, D.startWeekOnSunday && !D.hideWeekdays[7]);
739
745
  break;
740
746
  case "month":
741
747
  $.value = new Date($.value.getFullYear(), $.value.getMonth(), 1, 0, 0, 0, 0);
@@ -744,64 +750,64 @@ const nt = (u, s) => {
744
750
  $.value = new Date($.value.getFullYear(), 0, 1, 0, 0, 0, 0);
745
751
  break;
746
752
  case "years":
747
- $.value = new Date($.value.getFullYear() - $.value.getFullYear() % l.value, 0, 1, 0, 0, 0, 0);
753
+ $.value = new Date($.value.getFullYear() - $.value.getFullYear() % s.value, 0, 1, 0, 0, 0, 0);
748
754
  break;
749
755
  }
750
- u.ready && r("view-change", {
751
- id: m.value,
756
+ D.ready && r("view-change", {
757
+ id: v.value,
752
758
  title: ae.value,
753
759
  start: G.value,
754
- end: o.value,
755
- extendedStart: c.value,
760
+ end: i.value,
761
+ extendedStart: u.value,
756
762
  extendedEnd: e.value,
757
- cellDates: _.value,
758
- containsToday: v.value,
763
+ cellDates: k.value,
764
+ containsToday: d.value,
759
765
  events: x.value
760
- }), i.value = /* @__PURE__ */ new Date();
766
+ }), o.value = /* @__PURE__ */ new Date();
761
767
  }
762
- function he(g) {
763
- const z = m.value, R = u.availableViews[z];
764
- g[z] && JSON.stringify(g[z]) === JSON.stringify(R) || re();
768
+ function he(f) {
769
+ const z = v.value, R = D.availableViews[z];
770
+ f[z] && JSON.stringify(f[z]) === JSON.stringify(R) || re();
765
771
  }
766
- function K(g, z = !0) {
767
- const R = Object.keys(u.availableViews);
768
- m.value !== g && (R.includes(g) ? (O.value = R.indexOf(g) < R.indexOf(m.value) ? "left" : "right", m.value = g, r("update:view", g), re()) : console.warn(`Vue Cal: the \`${g}\` view is not available.`));
772
+ function q(f, z = !0) {
773
+ const R = Object.keys(D.availableViews);
774
+ v.value !== f && (R.includes(f) ? (V.value = R.indexOf(f) < R.indexOf(v.value) ? "left" : "right", v.value = f, r("update:view", f), re()) : console.warn(`Vue Cal: the \`${f}\` view is not available.`));
769
775
  }
770
776
  function ce() {
771
- P.value ? K(P.value) : console.warn("Vue Cal: no broader view is available.");
777
+ H.value ? q(H.value) : console.warn("Vue Cal: no broader view is available.");
772
778
  }
773
779
  function ee() {
774
- q.value ? K(q.value) : console.warn("Vue Cal: no narrower view is available.");
780
+ U.value ? q(U.value) : console.warn("Vue Cal: no narrower view is available.");
775
781
  }
776
- function ie() {
777
- k(!1);
782
+ function oe() {
783
+ _(!1);
778
784
  }
779
785
  function a() {
780
- k(!0);
786
+ _(!0);
781
787
  }
782
- function k(g = !0) {
783
- let z = new Date(f.value);
784
- switch (m.value) {
788
+ function _(f = !0) {
789
+ let z = new Date(m.value);
790
+ switch (v.value) {
785
791
  case "day":
786
792
  case "days":
787
- g ? z = s.addDays(t.value, 1) : z = s.subtractDays(n.value, l.value);
793
+ f ? z = n.addDays(t.value, 1) : z = n.subtractDays(l.value, s.value);
788
794
  break;
789
795
  case "week": {
790
- g ? (z = s.addDays(e.value, 1), z.setHours(0, 0, 0, 0)) : z = s.subtractDays(c.value, l.value);
796
+ f ? (z = n.addDays(e.value, 1), z.setHours(0, 0, 0, 0)) : z = n.subtractDays(u.value, s.value);
791
797
  break;
792
798
  }
793
799
  case "month": {
794
- const R = g ? 1 : -1;
800
+ const R = f ? 1 : -1;
795
801
  z = new Date(z.getFullYear(), z.getMonth() + R, 1, 0, 0, 0, 0);
796
802
  break;
797
803
  }
798
804
  case "year": {
799
- const R = g ? 1 : -1;
805
+ const R = f ? 1 : -1;
800
806
  z = new Date(z.getFullYear() + R, 1, 1, 0, 0, 0, 0);
801
807
  break;
802
808
  }
803
809
  case "years": {
804
- const R = g ? l.value : -l.value;
810
+ const R = f ? s.value : -s.value;
805
811
  z = new Date(z.getFullYear() + R, 1, 1, 0, 0, 0, 0);
806
812
  break;
807
813
  }
@@ -809,78 +815,76 @@ const nt = (u, s) => {
809
815
  B(z);
810
816
  }
811
817
  function y() {
812
- const g = /* @__PURE__ */ new Date();
813
- g.setHours(0, 0, 0, 0), B(g);
818
+ const f = /* @__PURE__ */ new Date();
819
+ f.setHours(0, 0, 0, 0), B(f);
814
820
  }
815
- function B(g, z = !0, R = !1) {
816
- if (!s.isValid(g)) return console.warn("Vue Cal: can't navigate to the given date: invalid date provided to `updateViewDate(date)`.");
817
- let [X, ve] = [n.value, t.value];
818
- m.value === "month" && ([X, ve] = [G.value, o.value]), (!s.isInRange(g, X, ve) || R) && (g.setHours(0, 0, 0, 0), O.value = g.getTime() < X.getTime() ? "left" : "right", f.value = g, z && r("update:viewDate", g), re());
821
+ function B(f, z = !0, R = !1) {
822
+ if (!n.isValid(f)) return console.warn("Vue Cal: can't navigate to the given date: invalid date provided to `updateViewDate(date)`.");
823
+ let [X, ve] = [l.value, t.value];
824
+ v.value === "month" && ([X, ve] = [G.value, i.value]), (!n.isInRange(f, X, ve) || R) && (f.setHours(0, 0, 0, 0), V.value = f.getTime() < X.getTime() ? "left" : "right", m.value = f, z && r("update:viewDate", f), re());
819
825
  }
820
- function Q(g, z = !0) {
821
- if (s.isValid(g)) {
822
- const { isValid: R, isSameDate: X } = s;
823
- (!C.value || !R(C.value) || !X(g, C.value)) && (g.setHours(0, 0, 0, 0), C.value = g, z && r("update:selectedDate", g));
824
- } else
825
- return console.warn("Vue Cal: can't update the selected date: invalid date provided to `updateSelectedDate(date)`.");
826
+ function Q(f, z = !0) {
827
+ if (!n.isValid(f)) return console.warn("Vue Cal: can't update the selected date: invalid date provided to `updateSelectedDate(date)`.");
828
+ const { isValid: R, isSameDate: X } = n;
829
+ (!C.value || !R(C.value) || !X(f, C.value)) && (f.setHours(0, 0, 0, 0), C.value = f, z && r("update:selectedDate", f));
826
830
  }
827
- function d(g) {
828
- !g && !$.value.getDay() ? B(s.addDays($.value, 1), !0, !0) : (O.value = "left", re());
831
+ function c(f) {
832
+ !f && !$.value.getDay() ? B(n.addDays($.value, 1), !0, !0) : (V.value = "left", re());
829
833
  }
830
- function p(g) {
831
- g && u.startWeekOnSunday && !$.value.getDay() ? B(s.addDays($.value, 1), !0, !0) : !g && u.startWeekOnSunday && $.value.getDay() === 1 && B(s.subtractDays($.value, 1), !0, !0);
834
+ function w(f) {
835
+ f && D.startWeekOnSunday && !$.value.getDay() ? B(n.addDays($.value, 1), !0, !0) : !f && D.startWeekOnSunday && $.value.getDay() === 1 && B(n.subtractDays($.value, 1), !0, !0);
832
836
  }
833
- function V() {
834
- console.log("toggling weekdays", u.hideWeekdays);
837
+ function S() {
838
+ console.log("toggling weekdays", D.hideWeekdays);
835
839
  }
836
- function M(g) {
840
+ function M(f) {
837
841
  var X;
838
- const z = (X = b.value) == null ? void 0 : X.querySelector(".vuecal__scrollable"), R = g ? g * u.timeCellHeight / u.timeStep : 0;
842
+ const z = (X = b.value) == null ? void 0 : X.querySelector(".vuecal__scrollable"), R = f ? f * D.timeCellHeight / D.timeStep : 0;
839
843
  z == null || z.scrollTo({ top: R, behavior: "smooth" });
840
844
  }
841
845
  function N() {
842
- const g = /* @__PURE__ */ new Date();
843
- M(g.getHours() * 60 + g.getMinutes());
846
+ const f = /* @__PURE__ */ new Date();
847
+ M(f.getHours() * 60 + f.getMinutes());
844
848
  }
845
849
  function I() {
846
850
  M(0);
847
851
  }
848
- const x = T(() => w.getViewEvents(_.value)), de = w.createEvent, ye = w.deleteEvent;
849
- return me(() => u.view, (g) => K(g, !1)), me(() => u.availableViews, he), me(() => u.datePicker, () => K("month", !1)), me(() => u.viewDate, (g) => B(g, !1)), me(() => u.selectedDate, (g) => Q(g, !1)), me(() => u.startWeekOnSunday, (g) => d(g)), me(() => u.hideWeekends, (g) => p(g)), me(() => u.hideWeekdays, V), me(() => l.value, () => {
850
- l.value > 90 && console.warn("Vue Cal: high cell count detected. Performance may degrade when interactions are enabled.");
851
- }), me(() => u.watchRealTime, (g) => {
852
- g && u.time ? E() : W = clearTimeout(W);
853
- }), re(), u.time && u.watchRealTime && E(), Xe(() => W = clearTimeout(W)), {
854
- now: i,
855
- id: m,
856
- broaderView: P,
857
- narrowerView: q,
852
+ const x = T(() => p.getViewEvents(k.value)), de = p.createEvent, ye = p.deleteEvent;
853
+ return me(() => D.view, (f) => q(f, !1)), me(() => D.availableViews, he), me(() => D.datePicker, () => q("month", !1)), me(() => D.viewDate, (f) => B(f, !1)), me(() => D.selectedDate, (f) => Q(f, !1)), me(() => D.startWeekOnSunday, (f) => c(f)), me(() => D.hideWeekends, (f) => w(f)), me(() => D.hideWeekdays, S), me(() => s.value, () => {
854
+ s.value > 90 && console.warn("Vue Cal: high cell count detected. Performance may degrade when interactions are enabled.");
855
+ }), me(() => D.watchRealTime, (f) => {
856
+ f && D.time ? Y() : W = clearTimeout(W);
857
+ }), re(), D.time && D.watchRealTime && Y(), Xe(() => W = clearTimeout(W)), {
858
+ now: o,
859
+ id: v,
860
+ broaderView: H,
861
+ narrowerView: U,
858
862
  title: ae,
859
- viewDate: f,
863
+ viewDate: m,
860
864
  start: G,
861
- end: o,
862
- extendedStart: c,
865
+ end: i,
866
+ extendedStart: u,
863
867
  // Full range, including out of scope month days, and hidden leading/trailing days.
864
868
  extendedEnd: e,
865
869
  // Full range, including out of scope month days, and hidden leading/trailing days.
866
- firstCellDate: n,
870
+ firstCellDate: l,
867
871
  lastCellDate: t,
868
- containsToday: v,
872
+ containsToday: d,
869
873
  selectedDate: C,
870
- cellDates: _,
871
- cols: L,
874
+ cellDates: k,
875
+ cols: P,
872
876
  rows: A,
873
877
  // All the events are stored and indexed in the events object of the eventsManager.
874
878
  // The following events array is only a subset of visible ones, plus any potential recurring
875
879
  // and multi-day events.
876
880
  events: x,
877
- transitionDirection: O,
878
- switch: K,
881
+ transitionDirection: V,
882
+ switch: q,
879
883
  broader: ce,
880
884
  narrower: ee,
881
- previous: ie,
885
+ previous: oe,
882
886
  next: a,
883
- navigate: k,
887
+ navigate: _,
884
888
  goToToday: y,
885
889
  updateViewDate: B,
886
890
  updateSelectedDate: Q,
@@ -891,34 +895,34 @@ const nt = (u, s) => {
891
895
  deleteEvent: ye,
892
896
  // Getters.
893
897
  get isDay() {
894
- return m.value === "day";
898
+ return v.value === "day";
895
899
  },
896
900
  get isDays() {
897
- return m.value === "days";
901
+ return v.value === "days";
898
902
  },
899
903
  get isWeek() {
900
- return m.value === "week";
904
+ return v.value === "week";
901
905
  },
902
906
  get isMonth() {
903
- return m.value === "month";
907
+ return v.value === "month";
904
908
  },
905
909
  get isYear() {
906
- return m.value === "year";
910
+ return v.value === "year";
907
911
  },
908
912
  get isYears() {
909
- return m.value === "years";
913
+ return v.value === "years";
910
914
  }
911
915
  };
912
916
  }, Fe = $e({
913
917
  texts: { ...fe.texts },
914
918
  // Make texts reactive before a locale is loaded.
915
- dateUtils: nt(fe.texts, st)
919
+ dateUtils: st(fe.texts, nt)
916
920
  // Some Date utils functions need localized texts.
917
- }), yt = ({ props: u, emit: s, attrs: r, vuecalEl: D, uid: w }) => {
921
+ }), yt = ({ props: D, emit: n, attrs: r, vuecalEl: g, uid: p }) => {
918
922
  const b = $e({
919
- uid: w,
923
+ uid: p,
920
924
  // The Vuecal instance unique ID, used for dnd source-target identification.
921
- emit: s,
925
+ emit: n,
922
926
  texts: { ...Fe.texts },
923
927
  // Make texts reactive before a locale is loaded.
924
928
  // The date utils composable.
@@ -939,8 +943,8 @@ const nt = (u, s) => {
939
943
  isResizingEvent: !1
940
944
  }
941
945
  });
942
- return b.dateUtils = nt(Object.assign(fe.texts, b.texts), st), b.config = mt(b, u, r), b.eventsManager = gt(b), b.view = ht(b, D), b.dnd = ft(b), b;
943
- }, Dt = 24 * 60, wt = {
946
+ return b.dateUtils = st(Object.assign(fe.texts, b.texts), nt), b.config = mt(b, D, r), b.eventsManager = gt(b), b.view = ht(b, g), b.dnd = ft(b), b;
947
+ }, Dt = 24 * 60, pt = {
944
948
  allDayEvents: { type: [Boolean, String], default: !1 },
945
949
  // Coming soon.
946
950
  // avoidEventOverlap: { type: Boolean, default: undefined }, // Coming soon.
@@ -1036,97 +1040,97 @@ const nt = (u, s) => {
1036
1040
  // minScheduleWidth: { type: Number, default: 0 },
1037
1041
  // overlapsPerTimeStep: { type: Boolean, default: false },
1038
1042
  // resizeX: { type: Boolean, default: false },
1039
- }, pt = { class: "vuecal__header" }, kt = {
1043
+ }, wt = { class: "vuecal__header" }, _t = {
1040
1044
  key: 0,
1041
1045
  class: "vuecal__views-bar"
1042
- }, _t = ["onClick", "innerHTML"], bt = {
1046
+ }, kt = ["onClick", "innerHTML"], bt = {
1043
1047
  key: 1,
1044
1048
  class: "vuecal__title-bar"
1045
1049
  }, Tt = { class: "vuecal__transition-wrap" }, $t = ["disabled", "innerHTML"], Mt = {
1046
1050
  __name: "header",
1047
- setup(u) {
1048
- const s = Ne("vuecal"), { view: r, config: D } = s, w = () => {
1049
- D.clickToNavigate && r.broader();
1050
- }, b = T(() => D.clickToNavigate ? { click: w } : {});
1051
- return (H, m) => (Y(), j("div", pt, [
1052
- F(H.$slots, "header", {
1053
- view: S(r),
1054
- availableViews: S(D).availableViews,
1055
- vuecal: S(s)
1051
+ setup(D) {
1052
+ const n = Ne("vuecal"), { view: r, config: g } = n, p = () => {
1053
+ g.clickToNavigate && r.broader();
1054
+ }, b = T(() => g.clickToNavigate ? { click: p } : {});
1055
+ return (L, v) => (E(), j("div", wt, [
1056
+ F(L.$slots, "header", {
1057
+ view: O(r),
1058
+ availableViews: O(g).availableViews,
1059
+ vuecal: O(n)
1056
1060
  }),
1057
- H.$slots.header ? U("", !0) : (Y(), j(te, { key: 0 }, [
1058
- S(D).viewsBar ? (Y(), j("div", kt, [
1059
- (Y(!0), j(te, null, pe(S(D).availableViews, (C, i) => (Y(), j("button", {
1060
- class: ke(["vuecal__view-button", { "vuecal__view-button--active": S(r).id === i }]),
1061
- onClick: (f) => S(r).switch(i),
1062
- innerHTML: S(s).texts[i],
1061
+ L.$slots.header ? Z("", !0) : (E(), j(te, { key: 0 }, [
1062
+ O(g).viewsBar ? (E(), j("div", _t, [
1063
+ (E(!0), j(te, null, we(O(g).availableViews, (C, o) => (E(), j("button", {
1064
+ class: _e(["vuecal__view-button", { "vuecal__view-button--active": O(r).id === o }]),
1065
+ onClick: (m) => O(r).switch(o),
1066
+ innerHTML: O(n).texts[o],
1063
1067
  type: "button"
1064
- }, null, 10, _t))), 256))
1065
- ])) : U("", !0),
1066
- S(D).titleBar ? (Y(), j("nav", bt, [
1068
+ }, null, 10, kt))), 256))
1069
+ ])) : Z("", !0),
1070
+ O(g).titleBar ? (E(), j("nav", bt, [
1067
1071
  ge("button", {
1068
- class: ke(["vuecal__nav vuecal__nav--prev", { "vuecal__nav--default": !H.$slots["previous-button"] }]),
1069
- onClick: m[0] || (m[0] = (...C) => S(r).previous && S(r).previous(...C)),
1072
+ class: _e(["vuecal__nav vuecal__nav--prev", { "vuecal__nav--default": !L.$slots["previous-button"] }]),
1073
+ onClick: v[0] || (v[0] = (...C) => O(r).previous && O(r).previous(...C)),
1070
1074
  type: "button"
1071
1075
  }, [
1072
- F(H.$slots, "previous-button")
1076
+ F(L.$slots, "previous-button")
1073
1077
  ], 2),
1074
1078
  ge("div", Tt, [
1075
1079
  Oe(Ge, {
1076
- name: `vuecal-slide-fade--${S(r).transitionDirection}`
1080
+ name: `vuecal-slide-fade--${O(r).transitionDirection}`
1077
1081
  }, {
1078
- default: Z(() => [
1079
- (Y(), j("div", {
1080
- key: S(r).id + S(r).start.getTime()
1082
+ default: J(() => [
1083
+ (E(), j("div", {
1084
+ key: O(r).id + O(r).start.getTime()
1081
1085
  }, [
1082
- H.$slots.title ? (Y(), Se(Ke(S(D).clickToNavigate && S(r).broaderView ? "button" : "div"), De({
1086
+ L.$slots.title ? (E(), Se(Ke(O(g).clickToNavigate && O(r).broaderView ? "button" : "div"), De({
1083
1087
  key: 0,
1084
1088
  class: "vuecal__title"
1085
1089
  }, Ie(b.value)), {
1086
- default: Z(() => [
1087
- F(H.$slots, "title", se(ne(S(r))))
1090
+ default: J(() => [
1091
+ F(L.$slots, "title", ne(se(O(r))))
1088
1092
  ]),
1089
1093
  _: 3
1090
- }, 16)) : (Y(), Se(Ke(S(D).clickToNavigate && S(r).broaderView ? "button" : "div"), De({
1094
+ }, 16)) : (E(), Se(Ke(O(g).clickToNavigate && O(r).broaderView ? "button" : "div"), De({
1091
1095
  key: 1,
1092
1096
  class: "vuecal__title"
1093
1097
  }, Ie(b.value), {
1094
- innerHTML: S(r).title
1098
+ innerHTML: O(r).title
1095
1099
  }), null, 16, ["innerHTML"]))
1096
1100
  ]))
1097
1101
  ]),
1098
1102
  _: 3
1099
1103
  }, 8, ["name"])
1100
1104
  ]),
1101
- S(D).todayButton ? (Y(), j(te, { key: 0 }, [
1102
- H.$slots["today-button"] ? F(H.$slots, "today-button", {
1105
+ O(g).todayButton ? (E(), j(te, { key: 0 }, [
1106
+ L.$slots["today-button"] ? F(L.$slots, "today-button", {
1103
1107
  key: 0,
1104
- navigate: () => !S(r).containsToday && S(r).goToToday(),
1105
- active: S(r).containsToday
1106
- }) : (Y(), j("button", {
1108
+ navigate: () => !O(r).containsToday && O(r).goToToday(),
1109
+ active: O(r).containsToday
1110
+ }) : (E(), j("button", {
1107
1111
  key: 1,
1108
- class: ke(["vuecal__nav vuecal__nav--today vuecal__nav--default", { "vuecal__nav--active": S(r).containsToday }]),
1109
- onClick: m[1] || (m[1] = (C) => !S(r).containsToday && S(r).goToToday()),
1110
- disabled: !!S(r).containsToday,
1112
+ class: _e(["vuecal__nav vuecal__nav--today vuecal__nav--default", { "vuecal__nav--active": O(r).containsToday }]),
1113
+ onClick: v[1] || (v[1] = (C) => !O(r).containsToday && O(r).goToToday()),
1114
+ disabled: !!O(r).containsToday,
1111
1115
  type: "button",
1112
- innerHTML: S(s).texts.today
1116
+ innerHTML: O(n).texts.today
1113
1117
  }, null, 10, $t))
1114
- ], 64)) : U("", !0),
1118
+ ], 64)) : Z("", !0),
1115
1119
  ge("button", {
1116
- class: ke(["vuecal__nav vuecal__nav--next", { "vuecal__nav--default": !H.$slots["next-button"] }]),
1117
- onClick: m[2] || (m[2] = (...C) => S(r).next && S(r).next(...C)),
1120
+ class: _e(["vuecal__nav vuecal__nav--next", { "vuecal__nav--default": !L.$slots["next-button"] }]),
1121
+ onClick: v[2] || (v[2] = (...C) => O(r).next && O(r).next(...C)),
1118
1122
  type: "button"
1119
1123
  }, [
1120
- F(H.$slots, "next-button")
1124
+ F(L.$slots, "next-button")
1121
1125
  ], 2)
1122
- ])) : U("", !0)
1126
+ ])) : Z("", !0)
1123
1127
  ], 64))
1124
1128
  ]));
1125
1129
  }
1126
- }, Et = {
1130
+ }, Yt = {
1127
1131
  key: 0,
1128
1132
  class: "vuecal__headings"
1129
- }, Yt = {
1133
+ }, Et = {
1130
1134
  key: 0,
1131
1135
  class: "vuecal__weekdays-headings"
1132
1136
  }, St = ["onClick"], Ct = { class: "vuecal__weekday-day" }, Vt = {
@@ -1137,90 +1141,90 @@ const nt = (u, s) => {
1137
1141
  class: "vuecal__schedules-headings w-flex grow"
1138
1142
  }, jt = ["innerHTML"], Pt = {
1139
1143
  __name: "headings-bar",
1140
- setup(u) {
1141
- const s = Ne("vuecal"), { view: r, config: D, dateUtils: w } = s, b = T(() => D.xs ? "day-xs" : D.sm || r.isDays || r.isMonth ? "day-sm" : "day"), H = T(() => (r.isDay || r.isDays || r.isWeek || r.isMonth) && !(r.isDay && !D.schedules)), m = T(() => r.cellDates.slice(0, r.cols).map(({ start: i }) => ({
1142
- id: Re[i.getDay()],
1143
- date: i,
1144
- dateNumber: i.getDate(),
1145
- day: w.formatDate(i, "dddd"),
1146
- "day-sm": w.formatDate(i, "ddd"),
1147
- "day-xs": w.formatDate(i, "dd"),
1148
- isToday: w.isToday(i)
1144
+ setup(D) {
1145
+ const n = Ne("vuecal"), { view: r, config: g, dateUtils: p } = n, b = T(() => g.xs ? "day-xs" : g.sm || r.isDays || r.isMonth ? "day-sm" : "day"), L = T(() => (r.isDay || r.isDays || r.isWeek || r.isMonth) && !(r.isDay && !g.schedules)), v = T(() => r.cellDates.slice(0, r.cols).map(({ start: o }) => ({
1146
+ id: Re[o.getDay()],
1147
+ date: o,
1148
+ dateNumber: o.getDate(),
1149
+ day: p.formatDate(o, "dddd"),
1150
+ "day-sm": p.formatDate(o, "ddd"),
1151
+ "day-xs": p.formatDate(o, "dd"),
1152
+ isToday: p.isToday(o)
1149
1153
  }))), C = {
1150
- click: (i) => {
1151
- (r.isDays || r.isWeek) && r.updateSelectedDate(i);
1154
+ click: (o) => {
1155
+ (r.isDays || r.isWeek) && r.updateSelectedDate(o);
1152
1156
  }
1153
1157
  };
1154
- return (i, f) => H.value ? (Y(), j("div", Et, [
1155
- S(r).isDay ? U("", !0) : (Y(), j("div", Yt, [
1156
- (Y(!0), j(te, null, pe(m.value, ($, W) => (Y(), j("div", {
1157
- class: ke(["vuecal__weekday", { "vuecal__weekday--today": $.isToday }]),
1158
+ return (o, m) => L.value ? (E(), j("div", Yt, [
1159
+ O(r).isDay ? Z("", !0) : (E(), j("div", Et, [
1160
+ (E(!0), j(te, null, we(v.value, ($, W) => (E(), j("div", {
1161
+ class: _e(["vuecal__weekday", { "vuecal__weekday--today": $.isToday }]),
1158
1162
  key: W,
1159
1163
  onClick: (G) => C.click($.date)
1160
1164
  }, [
1161
- F(i.$slots, "weekday-heading", {
1165
+ F(o.$slots, "weekday-heading", {
1162
1166
  label: $[b.value],
1163
1167
  id: $.id,
1164
1168
  date: $.date
1165
1169
  }, () => [
1166
1170
  ge("span", Ct, le($[b.value]), 1),
1167
- S(r).isMonth ? U("", !0) : (Y(), j("strong", Vt, le($.dateNumber), 1))
1171
+ O(r).isMonth ? Z("", !0) : (E(), j("strong", Vt, le($.dateNumber), 1))
1168
1172
  ])
1169
1173
  ], 10, St))), 128))
1170
1174
  ])),
1171
- S(D).schedules ? (Y(), j("div", Ot, [
1172
- (Y(!0), j(te, null, pe(m.value, ($, W) => (Y(), j(te, { key: W }, [
1173
- (Y(!0), j(te, null, pe(S(D).schedules, (G, o) => (Y(), j(te, { key: o }, [
1174
- i.$slots["schedule-heading"] ? (Y(), j("div", {
1175
+ O(g).schedules ? (E(), j("div", Ot, [
1176
+ (E(!0), j(te, null, we(v.value, ($, W) => (E(), j(te, { key: W }, [
1177
+ (E(!0), j(te, null, we(O(g).schedules, (G, i) => (E(), j(te, { key: i }, [
1178
+ o.$slots["schedule-heading"] ? (E(), j("div", {
1175
1179
  key: 0,
1176
- class: ke(["vuecal__schedule vuecal__schedule--heading", G.class])
1180
+ class: _e(["vuecal__schedule vuecal__schedule--heading", G.class])
1177
1181
  }, [
1178
- F(i.$slots, "schedule-heading", {
1182
+ F(o.$slots, "schedule-heading", {
1179
1183
  schedule: G,
1180
- view: S(r)
1184
+ view: O(r)
1181
1185
  })
1182
- ], 2)) : (Y(), j("div", {
1186
+ ], 2)) : (E(), j("div", {
1183
1187
  key: 1,
1184
- class: ke(["vuecal__schedule vuecal__schedule--heading", G.class]),
1188
+ class: _e(["vuecal__schedule vuecal__schedule--heading", G.class]),
1185
1189
  innerHTML: G.label
1186
1190
  }, null, 10, jt))
1187
1191
  ], 64))), 128))
1188
1192
  ], 64))), 128))
1189
- ])) : U("", !0)
1190
- ])) : U("", !0);
1193
+ ])) : Z("", !0)
1194
+ ])) : Z("", !0);
1191
1195
  }
1192
1196
  }, Ht = { class: "vuecal__time-column" }, Lt = {
1193
1197
  __name: "time-column",
1194
- setup(u) {
1195
- const s = Ne("vuecal"), { config: r, texts: D } = s, w = T(() => {
1198
+ setup(D) {
1199
+ const n = Ne("vuecal"), { config: r, texts: g } = n, p = T(() => {
1196
1200
  const b = [];
1197
- for (let m = r.timeFrom; m < r.timeTo; m += r.timeStep) {
1198
- const C = ~~(m / 60), i = m % 60, f = D[m < 720 ? "am" : "pm"];
1201
+ for (let v = r.timeFrom; v < r.timeTo; v += r.timeStep) {
1202
+ const C = ~~(v / 60), o = v % 60, m = g[v < 720 ? "am" : "pm"];
1199
1203
  b.push({
1200
- minutesSum: m,
1204
+ minutesSum: v,
1201
1205
  // The sum of hours + minutes in minutes.
1202
1206
  hours: C,
1203
- minutes: i,
1204
- formatted12: `${C % 12 ? C % 12 : 12}${i ? ":" + i.toString().padStart(2, 0) : ""}${f}`,
1205
- formatted24: `${C.toString().padStart(2, 0)}:${i.toString().padStart(2, 0)}`
1207
+ minutes: o,
1208
+ formatted12: `${C % 12 ? C % 12 : 12}${o ? ":" + o.toString().padStart(2, 0) : ""}${m}`,
1209
+ formatted24: `${C.toString().padStart(2, 0)}:${o.toString().padStart(2, 0)}`
1206
1210
  });
1207
1211
  }
1208
1212
  return b;
1209
1213
  });
1210
- return (b, H) => (Y(), j("div", Ht, [
1211
- (Y(!0), j(te, null, pe(w.value, (m, C) => (Y(), j("div", {
1214
+ return (b, L) => (E(), j("div", Ht, [
1215
+ (E(!0), j(te, null, we(p.value, (v, C) => (E(), j("div", {
1212
1216
  class: "vuecal__time-cell",
1213
1217
  key: C
1214
1218
  }, [
1215
1219
  F(b.$slots, "time-cell", {
1216
1220
  index: C,
1217
- minutes: m.minutes,
1218
- hours: m.hours,
1219
- minutesSum: m.minutesSum,
1220
- format12: m.formatted12,
1221
- format24: m.formatted24
1221
+ minutes: v.minutes,
1222
+ hours: v.hours,
1223
+ minutesSum: v.minutesSum,
1224
+ format12: v.formatted12,
1225
+ format24: v.formatted24
1222
1226
  }, () => [
1223
- ge("label", null, le(S(r).twelveHour ? m.formatted12 : m.formatted24), 1)
1227
+ ge("label", null, le(O(r).twelveHour ? v.formatted12 : v.formatted24), 1)
1224
1228
  ])
1225
1229
  ]))), 128))
1226
1230
  ]));
@@ -1234,8 +1238,8 @@ const nt = (u, s) => {
1234
1238
  event: { type: Object, required: !0 }
1235
1239
  },
1236
1240
  emits: ["event-drag-start", "event-drag-end", "event-resize-start", "event-resize-end"],
1237
- setup(u, { emit: s }) {
1238
- const { config: r, view: D, dnd: w, touch: b, dateUtils: H } = Ne("vuecal"), m = u, C = oe(null), i = $e(m.event), f = $e({
1241
+ setup(D, { emit: n }) {
1242
+ const { config: r, view: g, dnd: p, touch: b, dateUtils: L } = Ne("vuecal"), v = D, C = ie(null), o = $e(v.event), m = $e({
1239
1243
  dragging: !1,
1240
1244
  resizing: !1,
1241
1245
  fromResizer: !1,
@@ -1269,159 +1273,159 @@ const nt = (u, s) => {
1269
1273
  cellEl: null,
1270
1274
  // Store the cell DOM node for a more efficient resizing calc in mousemove/touchmove.
1271
1275
  schedule: null
1272
- }), $ = T(() => r.editableEvents.drag && i.draggable !== !1 && !i.background), W = T(() => r.time && r.editableEvents.resize && i.resizable !== !1 && !i.background);
1273
- T(() => r.editableEvents.delete && i.deletable !== !1 && !i.background);
1276
+ }), $ = T(() => r.editableEvents.drag && o.draggable !== !1 && !o.background), W = T(() => r.time && r.editableEvents.resize && o.resizable !== !1 && !o.background);
1277
+ T(() => r.editableEvents.delete && o.deletable !== !1 && !o.background);
1274
1278
  const G = T(() => {
1275
- var l, n, _;
1279
+ var s, l, k;
1276
1280
  return {
1277
- [`vuecal__event--${i._.id}`]: !0,
1278
- [i.class]: !!i.class,
1279
- "vuecal__event--recurring": !!i.recurring,
1280
- "vuecal__event--background": !!i.background,
1281
- "vuecal__event--multiday": !!((l = i._) != null && l.multiday),
1282
- "vuecal__event--cut-top": ((n = i._) == null ? void 0 : n.startMinutes) < r.timeFrom,
1283
- "vuecal__event--cut-bottom": ((_ = i._) == null ? void 0 : _.endMinutes) > r.timeTo || i.end.getDate() !== i.start.getDate(),
1281
+ [`vuecal__event--${o._.id}`]: !0,
1282
+ [o.class]: !!o.class,
1283
+ "vuecal__event--recurring": !!o.recurring,
1284
+ "vuecal__event--background": !!o.background,
1285
+ "vuecal__event--multiday": !!((s = o._) != null && s.multiday),
1286
+ "vuecal__event--cut-top": ((l = o._) == null ? void 0 : l.startMinutes) < r.timeFrom,
1287
+ "vuecal__event--cut-bottom": ((k = o._) == null ? void 0 : k.endMinutes) > r.timeTo || o.end.getDate() !== o.start.getDate(),
1284
1288
  // Only apply the dragging class on the event copy that is being dragged.
1285
- "vuecal__event--dragging": !i._.draggingGhost && i._.dragging,
1289
+ "vuecal__event--dragging": !o._.draggingGhost && o._.dragging,
1286
1290
  // Only apply the dragging-ghost class on the event original that remains fixed while a copy is being
1287
1291
  // dragged. Sometimes when dragging fast the dragging-ghost class would get stuck and events stays
1288
1292
  // invisible, so if dragging is false, disable the dragging-ghost class as well.
1289
1293
  // On event drop, if the new position of the event is approved, only remove the dragging-ghost class
1290
1294
  // after event deletion (event._.dragging is already false) so the event ghost does not flash in before
1291
1295
  // deletion.
1292
- "vuecal__event--dragging-ghost": i._.draggingGhost,
1293
- "vuecal__event--resizing": f.resizing
1296
+ "vuecal__event--dragging-ghost": o._.draggingGhost,
1297
+ "vuecal__event--resizing": m.resizing
1294
1298
  };
1295
- }), o = T(() => {
1296
- const l = (D.isDay || D.isDays || D.isWeek) && r.time;
1297
- if (!l && !i.backgroundColor && !i.color) return !1;
1298
- const n = {
1299
- backgroundColor: i.backgroundColor || null,
1300
- color: i.color || null
1299
+ }), i = T(() => {
1300
+ const s = (g.isDay || g.isDays || g.isWeek) && r.time;
1301
+ if (!s && !o.backgroundColor && !o.color) return !1;
1302
+ const l = {
1303
+ backgroundColor: o.backgroundColor || null,
1304
+ color: o.color || null
1301
1305
  };
1302
- if (l) {
1303
- const _ = Math.max(r.timeFrom, i._.startMinutes), t = Math.min(r.timeTo, i._.endMinutes), O = Ve(_, r), P = Ve(t, r) - O;
1304
- n.top = `${O}%`, n.height = `${P}%`;
1306
+ if (s) {
1307
+ const k = Math.max(r.timeFrom, o._.startMinutes), t = Math.min(r.timeTo, o._.endMinutes), V = Ve(k, r), H = Ve(t, r) - V;
1308
+ l.top = `${V}%`, l.height = `${H}%`;
1305
1309
  }
1306
- return n;
1307
- }), c = T(() => {
1308
- const l = { ...r.eventListeners.event };
1309
- Object.entries(l).forEach(([t, O]) => {
1310
- ["resize-end"].includes(t) || (l[t] = (P) => {
1311
- P.type !== "drop" && O(P.type ? { e: P, event: i } : P);
1310
+ return l;
1311
+ }), u = T(() => {
1312
+ const s = { ...r.eventListeners.event };
1313
+ Object.entries(s).forEach(([t, V]) => {
1314
+ ["resize-end"].includes(t) || (s[t] = (H) => {
1315
+ H.type !== "drop" && V(H.type ? { e: H, event: o } : H);
1312
1316
  });
1313
1317
  });
1314
- const n = { ...l };
1315
- l.touchstart = (t) => {
1316
- var O;
1317
- t.stopPropagation(), e(t), (O = n.touchstart) == null || O.call(n, { e: t, event: i });
1318
- }, l.mousedown = (t) => {
1319
- var O;
1320
- t.stopPropagation(), e(t), (O = n.mousedown) == null || O.call(n, { e: t, event: i });
1318
+ const l = { ...s };
1319
+ s.touchstart = (t) => {
1320
+ var V;
1321
+ t.stopPropagation(), e(t), (V = l.touchstart) == null || V.call(l, { e: t, event: o });
1322
+ }, s.mousedown = (t) => {
1323
+ var V;
1324
+ t.stopPropagation(), e(t), (V = l.mousedown) == null || V.call(l, { e: t, event: o });
1321
1325
  };
1322
- let _ = null;
1323
- return l.click = (t) => {
1324
- var O;
1325
- (O = n.click) == null || O.call(n, { e: t, event: i }), _ ? _ = clearTimeout(_) : _ = setTimeout(() => {
1326
- var P;
1327
- _ = null, (P = n["delayed-click"]) == null || P.call(n, { e: t, event: i });
1326
+ let k = null;
1327
+ return s.click = (t) => {
1328
+ var V;
1329
+ (V = l.click) == null || V.call(l, { e: t, event: o }), k ? k = clearTimeout(k) : k = setTimeout(() => {
1330
+ var H;
1331
+ k = null, (H = l["delayed-click"]) == null || H.call(l, { e: t, event: o });
1328
1332
  }, 400);
1329
- }, l.dblclick = (t) => {
1330
- n.dblclick ? n.dblclick({ e: t, event: i }) : i.delete(1);
1331
- }, l;
1332
- }), e = (l) => {
1333
- var t, O, P;
1334
- const n = ((t = l.touches) == null ? void 0 : t[0]) || l;
1335
- f.fromResizer = n.target.matches(".vuecal__event-resizer, .vuecal__event-resizer *");
1336
- const _ = C.value.getBoundingClientRect();
1337
- f.startX = (((O = l.touches) == null ? void 0 : O[0]) || l).clientX - _.left, f.startY = (((P = l.touches) == null ? void 0 : P[0]) || l).clientY - _.top, f.startPercentageX = f.startX * 100 / _.width, f.startPercentageY = f.startY * 100 / _.height, f.cellEl = C.value.closest(".vuecal__cell"), f.resizeStartDate = i.start, A(l.type === "touchstart" ? "touchmove" : "mousemove", v), A(l.type === "touchstart" ? "touchend" : "mouseup", h, { once: !0 }), f.holdTimer = setTimeout(() => {
1338
- var q, J;
1339
- f.holding = !0, (J = (q = c.value).hold) == null || J.call(q, { e: l, event: i });
1333
+ }, s.dblclick = (t) => {
1334
+ l.dblclick ? l.dblclick({ e: t, event: o }) : o.delete(1);
1335
+ }, s;
1336
+ }), e = (s) => {
1337
+ var t, V, H;
1338
+ const l = ((t = s.touches) == null ? void 0 : t[0]) || s;
1339
+ m.fromResizer = l.target.matches(".vuecal__event-resizer, .vuecal__event-resizer *");
1340
+ const k = C.value.getBoundingClientRect();
1341
+ m.startX = (((V = s.touches) == null ? void 0 : V[0]) || s).clientX - k.left, m.startY = (((H = s.touches) == null ? void 0 : H[0]) || s).clientY - k.top, m.startPercentageX = m.startX * 100 / k.width, m.startPercentageY = m.startY * 100 / k.height, m.cellEl = C.value.closest(".vuecal__cell"), m.resizeStartDate = o.start, A(s.type === "touchstart" ? "touchmove" : "mousemove", d), A(s.type === "touchstart" ? "touchend" : "mouseup", h, { once: !0 }), m.holdTimer = setTimeout(() => {
1342
+ var U, K;
1343
+ m.holding = !0, (K = (U = u.value).hold) == null || K.call(U, { e: s, event: o });
1340
1344
  }, 1e3);
1341
- }, v = async (l) => {
1342
- var _, t, O, P;
1343
- const n = ((_ = l.touches) == null ? void 0 : _[0]) || l;
1344
- if (f.fromResizer && !f.resizing && (f.resizing = !0, f.resizingOriginalEvent = { ...i, _: { ...i._ } }, b.isResizingEvent = !0, (O = (t = c.value).resizeStart) == null || O.call(t, { e: l, event: i })), f.holdTimer = clearTimeout(f.holdTimer), f.holding = !1, f.cellEl) {
1345
- const { top: q, left: J, width: ue, height: ae } = f.cellEl.getBoundingClientRect();
1346
- f.moveX = n.clientX - J, f.moveY = n.clientY - q, f.movePercentageX = f.moveX * 100 / ue, f.movePercentageY = f.moveY * 100 / ae;
1345
+ }, d = async (s) => {
1346
+ var k, t, V, H;
1347
+ const l = ((k = s.touches) == null ? void 0 : k[0]) || s;
1348
+ if (m.fromResizer && !m.resizing && (m.resizing = !0, m.resizingOriginalEvent = { ...o, _: { ...o._ } }, b.isResizingEvent = !0, (V = (t = u.value).resizeStart) == null || V.call(t, { e: s, event: o })), m.holdTimer = clearTimeout(m.holdTimer), m.holding = !1, m.cellEl) {
1349
+ const { top: U, left: K, width: ue, height: ae } = m.cellEl.getBoundingClientRect();
1350
+ m.moveX = l.clientX - K, m.moveY = l.clientY - U, m.movePercentageX = m.moveX * 100 / ue, m.movePercentageY = m.moveY * 100 / ae;
1347
1351
  }
1348
- if (f.fromResizer) {
1349
- const { newStart: q, newEnd: J } = E(i);
1352
+ if (m.fromResizer) {
1353
+ const { newStart: U, newEnd: K } = Y(o);
1350
1354
  let ue = !0;
1351
- const { resize: ae } = (P = r.eventListeners) == null ? void 0 : P.event;
1355
+ const { resize: ae } = (H = r.eventListeners) == null ? void 0 : H.event;
1352
1356
  ae && (ue = await ae({
1353
- e: l,
1354
- event: { ...i, start: q, end: J },
1355
- overlaps: i.getOverlappingEvents({ start: q, end: J })
1356
- })), ue !== !1 ? (i.start = q, i.end = J, f.resizingLastAcceptedEvent && (f.resizingLastAcceptedEvent = null)) : ae && (f.resizingLastAcceptedEvent = { ...i, _: { ...i._ } });
1357
+ e: s,
1358
+ event: { ...o, start: U, end: K },
1359
+ overlaps: o.getOverlappingEvents({ start: U, end: K })
1360
+ })), ue !== !1 ? (o.start = U, o.end = K, m.resizingLastAcceptedEvent && (m.resizingLastAcceptedEvent = null)) : ae && (m.resizingLastAcceptedEvent = { ...o, _: { ...o._ } });
1357
1361
  }
1358
- }, h = async (l) => {
1359
- var n, _;
1360
- if (f.holdTimer = clearTimeout(f.holdTimer), f.holding = !1, f.resizing) {
1361
- const { newStart: t, newEnd: O } = E(i);
1362
- let P = !0;
1363
- const q = c.value["resize-end"];
1364
- q && (P = await q({
1365
- e: l,
1366
- event: i,
1367
- original: f.resizingOriginalEvent,
1362
+ }, h = async (s) => {
1363
+ var l, k;
1364
+ if (m.holdTimer = clearTimeout(m.holdTimer), m.holding = !1, m.resizing) {
1365
+ const { newStart: t, newEnd: V } = Y(o);
1366
+ let H = !0;
1367
+ const U = u.value["resize-end"];
1368
+ U && (H = await U({
1369
+ e: s,
1370
+ event: o,
1371
+ original: m.resizingOriginalEvent,
1368
1372
  // Original event details before resizing.
1369
- overlaps: i.getOverlappingEvents({ start: t, end: O })
1370
- })), i.start = P === !1 ? (f.resizingLastAcceptedEvent || f.resizingOriginalEvent).start : ((n = f.resizingLastAcceptedEvent) == null ? void 0 : n.start) || t, i.end = P === !1 ? (f.resizingLastAcceptedEvent || f.resizingOriginalEvent).end : ((_ = f.resizingLastAcceptedEvent) == null ? void 0 : _.end) || O, i._.duration < 1 && (i.start = f.resizingOriginalEvent.start, i.end = f.resizingOriginalEvent.end), b.isResizingEvent = !1;
1373
+ overlaps: o.getOverlappingEvents({ start: t, end: V })
1374
+ })), o.start = H === !1 ? (m.resizingLastAcceptedEvent || m.resizingOriginalEvent).start : ((l = m.resizingLastAcceptedEvent) == null ? void 0 : l.start) || t, o.end = H === !1 ? (m.resizingLastAcceptedEvent || m.resizingOriginalEvent).end : ((k = m.resizingLastAcceptedEvent) == null ? void 0 : k.end) || V, o._.duration < 1 && (o.start = m.resizingOriginalEvent.start, o.end = m.resizingOriginalEvent.end), b.isResizingEvent = !1;
1371
1375
  }
1372
- document.removeEventListener(l.type === "touchend" ? "touchmove" : "mousemove", v), f.resizing = !1, f.fromResizer = !1, f.dragging = !1, f.startX = 0, f.startY = 0, f.moveX = 0, f.moveY = 0, f.startPercentageX = 0, f.startPercentageY = 0, f.movePercentageX = 0, f.movePercentageY = 0, f.cellEl = null, f.resizeStartDate = null, f.resizingOriginalEvent = null, f.resizingLastAcceptedEvent = null, f.schedule = null;
1373
- }, E = (l) => {
1374
- const n = new Date(l.start.getFullYear(), l.start.getMonth(), l.start.getDate());
1375
- new Date(n).setDate(n.getDate() + 1);
1376
- let t = Pe(f.movePercentageY, r);
1376
+ document.removeEventListener(s.type === "touchend" ? "touchmove" : "mousemove", d), m.resizing = !1, m.fromResizer = !1, m.dragging = !1, 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.cellEl = null, m.resizeStartDate = null, m.resizingOriginalEvent = null, m.resizingLastAcceptedEvent = null, m.schedule = null;
1377
+ }, Y = (s) => {
1378
+ const l = new Date(s.start.getFullYear(), s.start.getMonth(), s.start.getDate());
1379
+ new Date(l).setDate(l.getDate() + 1);
1380
+ let t = Pe(m.movePercentageY, r);
1377
1381
  if (t = Math.max(0, Math.min(t, 24 * 60)), r.snapToInterval) {
1378
- const q = t + r.snapToInterval / 2;
1379
- t = q - q % r.snapToInterval;
1382
+ const U = t + r.snapToInterval / 2;
1383
+ t = U - U % r.snapToInterval;
1380
1384
  }
1381
- let O = l.start, P = new Date(n.getTime() + t * 6e4);
1382
- return P < f.resizeStartDate && (O = P, P = f.resizeStartDate), { newStart: O, newEnd: P };
1385
+ let V = s.start, H = new Date(l.getTime() + t * 6e4);
1386
+ return H < m.resizeStartDate && (V = H, H = m.resizeStartDate), { newStart: V, newEnd: H };
1383
1387
  };
1384
- Ze(() => i._.register(C.value));
1385
- const L = [], A = (l, n, _) => {
1386
- document.addEventListener(l, n, _), L.push({ event: l, handler: n, options: _ });
1388
+ Ze(() => o._.register(C.value));
1389
+ const P = [], A = (s, l, k) => {
1390
+ document.addEventListener(s, l, k), P.push({ event: s, handler: l, options: k });
1387
1391
  };
1388
1392
  return Xe(() => {
1389
- i._.unregister(), L.forEach(({ event: l, handler: n, options: _ }) => {
1390
- document.removeEventListener(l, n, _);
1393
+ o._.unregister(), P.forEach(({ event: s, handler: l, options: k }) => {
1394
+ document.removeEventListener(s, l, k);
1391
1395
  });
1392
- }), (l, n) => (Y(), j("div", De({ class: "vuecal__event" }, Ie(c.value, !0), {
1396
+ }), (s, l) => (E(), j("div", De({ class: "vuecal__event" }, Ie(u.value, !0), {
1393
1397
  ref_key: "eventEl",
1394
1398
  ref: C,
1395
1399
  class: G.value,
1396
- style: o.value,
1400
+ style: i.value,
1397
1401
  draggable: $.value ? "true" : void 0,
1398
- onDragstart: n[2] || (n[2] = (_) => $.value && S(w).eventDragStart(_, i)),
1399
- onDragend: n[3] || (n[3] = (_) => $.value && S(w).eventDragEnd(_, i))
1402
+ onDragstart: l[2] || (l[2] = (k) => $.value && O(p).eventDragStart(k, o)),
1403
+ onDragend: l[3] || (l[3] = (k) => $.value && O(p).eventDragEnd(k, o))
1400
1404
  }), [
1401
1405
  ge("div", Ft, [
1402
- F(l.$slots, "event", { event: i }, () => [
1403
- ge("div", Nt, le(i.title), 1),
1404
- S(r).time ? (Y(), j("div", Wt, le(i._[`startTimeFormatted${S(r).twelveHour ? 12 : 24}`]) + `
1405
- - ` + le(i._[`endTimeFormatted${S(r).twelveHour ? 12 : 24}`]), 1)) : U("", !0),
1406
+ F(s.$slots, "event", { event: o }, () => [
1407
+ ge("div", Nt, le(o.title), 1),
1408
+ O(r).time ? (E(), j("div", Wt, le(o._[`startTimeFormatted${O(r).twelveHour ? 12 : 24}`]) + `
1409
+ - ` + le(o._[`endTimeFormatted${O(r).twelveHour ? 12 : 24}`]), 1)) : Z("", !0),
1406
1410
  ge("div", {
1407
1411
  class: "vuecal__event-content",
1408
- innerHTML: i.content
1412
+ innerHTML: o.content
1409
1413
  }, null, 8, Bt)
1410
1414
  ])
1411
1415
  ]),
1412
- W.value ? (Y(), j("div", {
1416
+ W.value ? (E(), j("div", {
1413
1417
  key: 0,
1414
1418
  class: "vuecal__event-resizer",
1415
- onDragstart: n[0] || (n[0] = Qe(() => {
1419
+ onDragstart: l[0] || (l[0] = Qe(() => {
1416
1420
  }, ["prevent", "stop"]))
1417
- }, null, 32)) : U("", !0),
1421
+ }, null, 32)) : Z("", !0),
1418
1422
  Oe(Ge, { name: "vuecal-delete-btn" }, {
1419
- default: Z(() => [
1420
- i._.deleting ? (Y(), j("div", {
1423
+ default: J(() => [
1424
+ o._.deleting ? (E(), j("div", {
1421
1425
  key: 0,
1422
1426
  class: "vuecal__event-delete",
1423
- onClick: n[1] || (n[1] = Qe((_) => i.delete(3), ["stop"]))
1424
- }, "Delete")) : U("", !0)
1427
+ onClick: l[1] || (l[1] = Qe((k) => o.delete(3), ["stop"]))
1428
+ }, "Delete")) : Z("", !0)
1425
1429
  ]),
1426
1430
  _: 1
1427
1431
  })
@@ -1457,10 +1461,10 @@ const nt = (u, s) => {
1457
1461
  end: { type: Date, required: !0 },
1458
1462
  index: { type: Number, required: !0 }
1459
1463
  },
1460
- setup(u) {
1461
- const s = u, r = Ne("vuecal"), { view: D, config: w, dateUtils: b, eventsManager: H, dnd: m, touch: C } = r, i = T(() => b.isToday(s.start)), f = oe(null), $ = oe([]), W = oe(!1), G = (d) => {
1462
- $.value.push(d.detail), W.value = !0;
1463
- }, o = () => setTimeout(() => W.value = !1, 300), c = $e({
1464
+ setup(D) {
1465
+ const n = D, r = Ne("vuecal"), { view: g, config: p, dateUtils: b, eventsManager: L, dnd: v, touch: C } = r, o = T(() => b.isToday(n.start)), m = ie(null), $ = ie([]), W = ie(!1), G = (c) => {
1466
+ $.value.push(c.detail), W.value = !0;
1467
+ }, i = () => setTimeout(() => W.value = !1, 300), u = $e({
1464
1468
  dragging: !1,
1465
1469
  holding: !1,
1466
1470
  // When the cell is clicked and hold for a certain amount of time.
@@ -1481,431 +1485,407 @@ const nt = (u, s) => {
1481
1485
  movePercentageX: 0,
1482
1486
  movePercentageY: 0,
1483
1487
  schedule: null
1484
- }), e = oe(!1), v = oe({ cellOverlaps: {}, longestStreak: 0 }), h = T(() => {
1485
- let d = Math.min(c.startPercentageY, c.movePercentageY), p = Math.max(c.startPercentageY, c.movePercentageY), V = Pe(d, w), M = Pe(p, w);
1486
- return w.snapToInterval && (V = b.snapToInterval(V, w.snapToInterval), M = b.snapToInterval(M, w.snapToInterval), d = Ve(V, w), p = Ve(M, w)), {
1488
+ }), e = ie(!1), d = ie({ cellOverlaps: {}, longestStreak: 0 }), h = T(() => {
1489
+ let c = Math.min(u.startPercentageY, u.movePercentageY), w = Math.max(u.startPercentageY, u.movePercentageY), S = Pe(c, p), M = Pe(w, p);
1490
+ return p.snapToInterval && (S = b.snapToInterval(S, p.snapToInterval), M = b.snapToInterval(M, p.snapToInterval), c = Ve(S, p), w = Ve(M, p)), {
1487
1491
  style: {
1488
- top: d + "%",
1489
- height: Math.abs(p - d) + "%"
1492
+ top: c + "%",
1493
+ height: Math.abs(w - c) + "%"
1490
1494
  },
1491
- startMinutes: V,
1495
+ startMinutes: S,
1492
1496
  endMinutes: M,
1493
- start: b.formatMinutes(V),
1497
+ start: b.formatMinutes(S),
1494
1498
  end: b.formatMinutes(M),
1495
- ...c.schedule ? { schedule: c.schedule } : {}
1499
+ ...u.schedule ? { schedule: u.schedule } : {}
1496
1500
  };
1497
- }), E = T(() => {
1498
- const d = w.editableEvents.create && (c.dragging || e.value), p = w.eventCreateMinDrag && c.thresholdPassed || !w.eventCreateMinDrag;
1499
- return d && p;
1500
- }), L = T(() => {
1501
+ }), Y = T(() => {
1502
+ const c = p.editableEvents.create && (u.dragging || e.value), w = p.eventCreateMinDrag && u.thresholdPassed || !p.eventCreateMinDrag;
1503
+ return c && w;
1504
+ }), P = T(() => {
1501
1505
  var x;
1502
- const d = /* @__PURE__ */ new Date(), p = D.start.getFullYear(), V = D.start.getMonth(), M = s.start.getFullYear(), N = s.start.getMonth();
1506
+ const c = /* @__PURE__ */ new Date(), w = g.start.getFullYear(), S = g.start.getMonth(), M = n.start.getFullYear(), N = n.start.getMonth();
1503
1507
  return {
1504
- [`vuecal__cell--${Re[s.start.getDay()]}`]: D.isDay || D.isDays || D.isWeek || D.isMonth,
1505
- [`vuecal__cell--${dt[N]}`]: D.isYear,
1506
- [`vuecal__cell--${M}`]: D.isYears,
1507
- "vuecal__cell--today": i.value,
1508
- "vuecal__cell--current-month": D.isYear && M === d.getFullYear() && N === d.getMonth(),
1509
- "vuecal__cell--current-year": D.isYears && M === d.getFullYear(),
1510
- "vuecal__cell--out-of-range": D.isMonth && (M !== p || N !== V),
1511
- "vuecal__cell--before-min": ae.value && J.value,
1508
+ [`vuecal__cell--${Re[n.start.getDay()]}`]: g.isDay || g.isDays || g.isWeek || g.isMonth,
1509
+ [`vuecal__cell--${dt[N]}`]: g.isYear,
1510
+ [`vuecal__cell--${M}`]: g.isYears,
1511
+ "vuecal__cell--today": o.value,
1512
+ "vuecal__cell--current-month": g.isYear && M === c.getFullYear() && N === c.getMonth(),
1513
+ "vuecal__cell--current-year": g.isYears && M === c.getFullYear(),
1514
+ "vuecal__cell--out-of-range": g.isMonth && (M !== w || N !== S),
1515
+ "vuecal__cell--before-min": ae.value && K.value,
1512
1516
  "vuecal__cell--after-max": ae.value && ue.value,
1513
1517
  "vuecal__cell--disabled": ae.value,
1514
- "vuecal__cell--selected": D.selectedDate && D.selectedDate.getTime() >= s.start.getTime() && D.selectedDate.getTime() <= s.end.getTime(),
1515
- "vuecal__cell--has-schedules": (x = w.schedules) == null ? void 0 : x.length,
1516
- "vuecal__cell--dragging": c.dragging,
1517
- "vuecal__cell--has-events": n.value.length
1518
+ "vuecal__cell--selected": g.selectedDate && g.selectedDate.getTime() >= n.start.getTime() && g.selectedDate.getTime() <= n.end.getTime(),
1519
+ "vuecal__cell--has-schedules": (x = p.schedules) == null ? void 0 : x.length,
1520
+ "vuecal__cell--dragging": u.dragging,
1521
+ "vuecal__cell--has-events": l.value.length
1518
1522
  };
1519
- }), A = T(() => b.formatDate(s.start)), l = T(() => {
1520
- switch (D.id) {
1523
+ }), A = T(() => b.formatDate(n.start)), s = T(() => {
1524
+ switch (g.id) {
1521
1525
  case "day":
1522
1526
  return "";
1523
1527
  case "days":
1524
- return w.availableViews.days.rows > 1 && b.formatDate(s.start, "D"), "";
1528
+ return p.availableViews.days.rows > 1 && b.formatDate(n.start, "D"), "";
1525
1529
  case "week":
1526
1530
  return "";
1527
1531
  case "month":
1528
- return b.formatDate(s.start, "D");
1532
+ return b.formatDate(n.start, "D");
1529
1533
  case "year":
1530
- return b.formatDate(s.start, w.xs ? "MMM" : "MMMM");
1534
+ return b.formatDate(n.start, p.xs ? "MMM" : "MMMM");
1531
1535
  case "years":
1532
- return b.formatDate(s.start, "YYYY");
1536
+ return b.formatDate(n.start, "YYYY");
1533
1537
  }
1534
- }), n = T(() => w.datePicker ? [] : H.getEventsByDate(A.value, !0, !0).filter((d) => !$.value.includes(d._.id))), _ = T(() => n.value.filter((d) => !d.background)), t = T(() => {
1535
- var d;
1536
- return (d = w.schedules) == null ? void 0 : d.reduce((p, V) => (p[V.id] = n.value.filter((M) => M.schedule === V.id), p), {});
1537
- }), O = T(() => {
1538
- const d = {};
1539
- for (const p of n.value) {
1540
- const V = p._.id, { maxConcurrent: M = 1, position: N = 0 } = v.value.cellOverlaps[V] || {};
1541
- d[V] = {
1538
+ }), l = T(() => p.datePicker ? [] : L.getEventsByDate(A.value, !0, !0).filter((c) => !$.value.includes(c._.id))), k = T(() => l.value.filter((c) => !c.background)), t = T(() => {
1539
+ var c;
1540
+ return (c = p.schedules) == null ? void 0 : c.reduce((w, S) => (w[S.id] = l.value.filter((M) => M.schedule === S.id), w), {});
1541
+ }), V = T(() => {
1542
+ const c = {};
1543
+ for (const w of l.value) {
1544
+ const S = w._.id, { maxConcurrent: M = 1, position: N = 0 } = d.value.cellOverlaps[S] || {};
1545
+ c[S] = {
1542
1546
  width: `${100 / M}%`,
1543
1547
  left: `${100 / M * N}%`
1544
1548
  };
1545
1549
  }
1546
- return d;
1547
- }), P = T(() => D.isMonth && w.eventCount && !w.eventsOnMonthView && _.value.length), q = T(() => {
1548
- var V;
1549
- if (!w.specialHours || D.isMonth || D.isYear || D.isYears) return;
1550
- const d = Re[s.start.getDay()];
1551
- let p = (V = w.specialHours) == null ? void 0 : V[d];
1552
- if (p)
1553
- return Array.isArray(p) || (p = [p]), p.map((M) => {
1550
+ return c;
1551
+ }), H = T(() => g.isMonth && p.eventCount && !p.eventsOnMonthView && k.value.length), U = T(() => {
1552
+ var S;
1553
+ if (!p.specialHours || g.isMonth || g.isYear || g.isYears) return;
1554
+ const c = Re[n.start.getDay()];
1555
+ let w = (S = p.specialHours) == null ? void 0 : S[c];
1556
+ if (w)
1557
+ return Array.isArray(w) || (w = [w]), w.map((M) => {
1554
1558
  let { from: N, to: I, class: x, label: de } = M;
1555
- if (isNaN(N) || isNaN(I) || w.timeFrom >= I || w.timeTo <= N) return;
1556
- N = Math.max(w.timeFrom, N), I = Math.min(w.timeTo, I);
1557
- const ye = Ve(N, w), g = Ve(I, w) - ye;
1559
+ if (isNaN(N) || isNaN(I) || p.timeFrom >= I || p.timeTo <= N) return;
1560
+ N = Math.max(p.timeFrom, N), I = Math.min(p.timeTo, I);
1561
+ const ye = Ve(N, p), f = Ve(I, p) - ye;
1558
1562
  return {
1559
- style: { top: `${ye}%`, height: `${g}%` },
1563
+ style: { top: `${ye}%`, height: `${f}%` },
1560
1564
  label: de,
1561
1565
  class: x
1562
1566
  };
1563
1567
  }).filter((M) => !!M);
1564
- }), J = T(() => w.minTimestamp !== null && w.minTimestamp > s.end.getTime()), ue = T(() => w.maxTimestamp && w.maxTimestamp < s.start.getTime()), ae = T(() => {
1565
- const { disableDays: d } = w, p = D.isYear || D.isYears;
1566
- return d.length && d.includes(b.formatDate(s.start)) && !p ? !0 : J.value || ue.value;
1568
+ }), K = T(() => p.minTimestamp !== null && p.minTimestamp > n.end.getTime()), ue = T(() => p.maxTimestamp && p.maxTimestamp < n.start.getTime()), ae = T(() => {
1569
+ const { disableDays: c } = p, w = g.isYear || g.isYears;
1570
+ return c.length && c.includes(b.formatDate(n.start)) && !w ? !0 : K.value || ue.value;
1567
1571
  }), re = $e({
1568
1572
  show: T(() => {
1569
- if (!(!D.isDay && !D.isDays && !D.isWeek) && !(!i.value || !w.time) && !(w.timeFrom > b.dateToMinutes(D.now)) && !(b.dateToMinutes(D.now) > w.timeTo))
1573
+ if (!(!g.isDay && !g.isDays && !g.isWeek) && !(!o.value || !p.time) && !(p.timeFrom > b.dateToMinutes(g.now)) && !(b.dateToMinutes(g.now) > p.timeTo))
1570
1574
  return !0;
1571
1575
  }),
1572
- nowInMinutes: T(() => b.dateToMinutes(D.now)),
1573
- todaysTimePosition: T(() => Ve(re.nowInMinutes, w)),
1576
+ nowInMinutes: T(() => b.dateToMinutes(g.now)),
1577
+ todaysTimePosition: T(() => Ve(re.nowInMinutes, p)),
1574
1578
  style: T(() => `top: ${re.todaysTimePosition}%`),
1575
- currentTime: T(() => b.formatTime(D.now))
1579
+ currentTime: T(() => b.formatTime(g.now))
1576
1580
  }), he = T(() => {
1577
1581
  if (ae.value) return {};
1578
- const d = { ...w.eventListeners.cell };
1579
- Object.entries(d).forEach(([M, N]) => {
1580
- d[M] = (I) => {
1582
+ const c = { ...p.eventListeners.cell };
1583
+ Object.entries(c).forEach(([M, N]) => {
1584
+ c[M] = (I) => {
1581
1585
  var x, de, ye;
1582
- (ye = (de = I.target || ((x = I.e) == null ? void 0 : x.target)).closest) != null && ye.call(de, ".vuecal__event") || N(I.type ? { e: I, cell: K.value, cursor: ce.value } : I);
1586
+ (ye = (de = I.target || ((x = I.e) == null ? void 0 : x.target)).closest) != null && ye.call(de, ".vuecal__event") || N(I.type ? { e: I, cell: q.value, cursor: ce.value } : I);
1583
1587
  };
1584
1588
  });
1585
- const p = { ...d };
1586
- let V = null;
1587
- return d.click = (M) => {
1589
+ const w = { ...c };
1590
+ let S = null;
1591
+ return c.click = (M) => {
1588
1592
  var N;
1589
- ee(), (N = p.click) == null || N.call(p, { e: M, cell: K.value, cursor: ce.value }), V ? V = clearTimeout(V) : V = setTimeout(() => {
1593
+ ee(), (N = w.click) == null || N.call(w, { e: M, cell: q.value, cursor: ce.value }), S ? S = clearTimeout(S) : S = setTimeout(() => {
1590
1594
  var I;
1591
- V = null, (I = p["delayed-click"]) == null || I.call(p, { e: M, cell: K.value, cursor: ce.value });
1595
+ S = null, (I = w["delayed-click"]) == null || I.call(w, { e: M, cell: q.value, cursor: ce.value });
1592
1596
  }, 400);
1593
- }, (w.time && D.isDay || D.isDays || D.isWeek) && (d.touchstart = (M) => {
1597
+ }, (p.time && g.isDay || g.isDays || g.isWeek) && (c.touchstart = (M) => {
1594
1598
  var N;
1595
- ie(M.e || M), (N = p.touchstart) == null || N.call(p, { e: M, cell: K.value, cursor: ce.value });
1596
- }, d.mousedown = (M) => {
1599
+ oe(M.e || M), (N = w.touchstart) == null || N.call(w, { e: M, cell: q.value, cursor: ce.value });
1600
+ }, c.mousedown = (M) => {
1597
1601
  var N;
1598
- ie(M.e || M), (N = p.mousedown) == null || N.call(p, { e: M, cell: K.value, cursor: ce.value });
1599
- }), p.dblclick && (d.dblclick = (M) => {
1602
+ oe(M.e || M), (N = w.mousedown) == null || N.call(w, { e: M, cell: q.value, cursor: ce.value });
1603
+ }), w.dblclick && (c.dblclick = (M) => {
1600
1604
  var z, R;
1601
- const N = (((z = M.touches) == null ? void 0 : z[0]) || M).clientY, { top: I } = f.value.getBoundingClientRect(), x = Je(N - I, f.value), de = Pe(x, w), ye = new Date(s.start);
1605
+ const N = (((z = M.touches) == null ? void 0 : z[0]) || M).clientY, { top: I } = m.value.getBoundingClientRect(), x = Je(N - I, m.value), de = Pe(x, p), ye = new Date(n.start);
1602
1606
  ye.setMinutes(de);
1603
- const g = {
1607
+ const f = {
1604
1608
  y: x,
1605
1609
  date: ye
1606
1610
  };
1607
- (R = p.dblclick) == null || R.call(p, { e: M, cell: K.value, cursor: g });
1608
- }), w.editableEvents.drag && (d.dragenter = (M) => m.cellDragEnter(M, K.value), d.dragover = (M) => {
1609
- M.preventDefault(), m.cellDragOver(M, K.value);
1610
- }, d.dragleave = (M) => m.cellDragLeave(M, K.value), d.drop = (M) => m.cellDragDrop(M, K.value)), d;
1611
- }), K = T(() => ({
1612
- start: s.start,
1613
- end: s.end,
1614
- events: n,
1615
- ...c.schedule ? { schedule: c.schedule } : {}
1611
+ (R = w.dblclick) == null || R.call(w, { e: M, cell: q.value, cursor: f });
1612
+ }), p.editableEvents.drag && (c.dragenter = (M) => v.cellDragEnter(M, q.value), c.dragover = (M) => {
1613
+ M.preventDefault(), v.cellDragOver(M, q.value);
1614
+ }, c.dragleave = (M) => v.cellDragLeave(M, q.value), c.drop = (M) => v.cellDragDrop(M, q.value)), c;
1615
+ }), q = T(() => ({
1616
+ start: n.start,
1617
+ end: n.end,
1618
+ events: l,
1619
+ ...u.schedule ? { schedule: u.schedule } : {},
1620
+ goNarrower: () => g.narrower(),
1621
+ goBroader: () => g.broader(),
1622
+ broader: g.broaderView,
1623
+ narrower: g.narrowerView
1616
1624
  })), ce = T(() => {
1617
- const d = Pe(c.movePercentageY || c.startPercentageY, w), p = new Date(s.start);
1618
- return p.setMinutes(d), {
1619
- x: c.movePercentageX || c.startPercentageX,
1620
- y: c.movePercentageY || c.startPercentageY,
1621
- date: p
1625
+ const c = Pe(u.movePercentageY || u.startPercentageY, p), w = new Date(n.start);
1626
+ return w.setMinutes(c), {
1627
+ x: u.movePercentageX || u.startPercentageX,
1628
+ y: u.movePercentageY || u.startPercentageY,
1629
+ date: w
1622
1630
  };
1623
1631
  }), ee = () => {
1624
- D.updateSelectedDate(s.start), w.clickToNavigate && ((D.isMonth || D.isDays || D.isWeek) && w.availableViews.day ? D.switch("day") : D.isYear && w.availableViews.month ? D.switch("month") : D.isYears && w.availableViews.year && D.switch("year")), D.updateViewDate(s.start);
1625
- }, ie = (d) => {
1626
- var V, M;
1627
- c.schedule = ~~d.target.dataset.schedule;
1628
- const p = f.value.getBoundingClientRect();
1629
- c.startX = (((V = d.touches) == null ? void 0 : V[0]) || d).clientX - p.left, c.startY = (((M = d.touches) == null ? void 0 : M[0]) || d).clientY - p.top, c.startPercentageX = c.startX * 100 / p.width, c.startPercentageY = c.startY * 100 / p.height, c.thresholdPassed = !1, document.addEventListener(d.type === "touchstart" ? "touchmove" : "mousemove", a), document.addEventListener(d.type === "touchstart" ? "touchend" : "mouseup", k, { once: !0 }), c.holdTimer = setTimeout(() => {
1632
+ g.updateSelectedDate(n.start), p.clickToNavigate && ((g.isMonth || g.isDays || g.isWeek) && p.availableViews.day ? g.switch("day") : g.isYear && p.availableViews.month ? g.switch("month") : g.isYears && p.availableViews.year && g.switch("year")), g.updateViewDate(n.start);
1633
+ }, oe = (c) => {
1634
+ var S, M;
1635
+ u.schedule = ~~c.target.dataset.schedule;
1636
+ const w = m.value.getBoundingClientRect();
1637
+ u.startX = (((S = c.touches) == null ? void 0 : S[0]) || c).clientX - w.left, u.startY = (((M = c.touches) == null ? void 0 : M[0]) || c).clientY - w.top, u.startPercentageX = u.startX * 100 / w.width, u.startPercentageY = u.startY * 100 / w.height, u.thresholdPassed = !1, document.addEventListener(c.type === "touchstart" ? "touchmove" : "mousemove", a), document.addEventListener(c.type === "touchstart" ? "touchend" : "mouseup", _, { once: !0 }), u.holdTimer = setTimeout(() => {
1630
1638
  var N, I;
1631
- c.holding = !0, (I = (N = he.value).hold) == null || I.call(N, { e: d, cell: K.value, cursor: ce.value });
1639
+ u.holding = !0, (I = (N = he.value).hold) == null || I.call(N, { e: c, cell: q.value, cursor: ce.value });
1632
1640
  }, 1e3);
1633
- }, a = (d) => {
1634
- var V, M, N, I, x, de;
1635
- c.dragging || (C.isDraggingCell = !0, (M = (V = he.value).dragStart) == null || M.call(V, { e: d, cell: K.value, cursor: ce.value })), c.dragging = !0, c.holdTimer = clearTimeout(c.holdTimer), c.holding = !1;
1636
- const p = f.value.getBoundingClientRect();
1637
- c.moveX = (((N = d.touches) == null ? void 0 : N[0]) || d).clientX - p.left, c.moveY = (((I = d.touches) == null ? void 0 : I[0]) || d).clientY - p.top, c.movePercentageX = c.moveX * 100 / p.width, c.movePercentageY = c.moveY * 100 / p.height, w.eventCreateMinDrag && Math.abs(c.startY - c.moveY) > w.eventCreateMinDrag && (c.thresholdPassed = !0), (de = (x = he.value).drag) == null || de.call(x, { e: d, cell: K.value, cursor: ce.value });
1638
- }, k = async (d) => {
1639
- var p, V;
1640
- document.removeEventListener(d.type === "touchend" ? "touchmove" : "mousemove", a, { passive: !1 }), c.dragging && ((V = (p = he.value).dragEnd) == null || V.call(p, { e: d, cell: K.value, cursor: ce.value }), C.isDraggingCell = !1, w.editableEvents.create && (e.value = !0, await y(d), e.value = !1)), c.holdTimer = clearTimeout(c.holdTimer), c.holding = !1, c.dragging = !1, c.startX = 0, c.startY = 0, c.moveX = 0, c.moveY = 0, c.startPercentageX = 0, c.startPercentageY = 0, c.movePercentageX = 0, c.movePercentageY = 0, c.thresholdPassed = !1, c.schedule = null;
1641
- }, y = async (d) => {
1642
- if (!E.value) return;
1643
- let { start: p, end: V, startMinutes: M, endMinutes: N } = h.value;
1644
- p = new Date(s.start), p.setMinutes(M), V = new Date(s.start), V.setMinutes(N);
1645
- let I = { ...h.value, start: p, end: V };
1646
- const { create: x } = w.eventListeners.event;
1641
+ }, a = (c) => {
1642
+ var S, M, N, I, x, de;
1643
+ u.dragging || (C.isDraggingCell = !0, (M = (S = he.value).dragStart) == null || M.call(S, { e: c, cell: q.value, cursor: ce.value })), u.dragging = !0, u.holdTimer = clearTimeout(u.holdTimer), u.holding = !1;
1644
+ const w = m.value.getBoundingClientRect();
1645
+ u.moveX = (((N = c.touches) == null ? void 0 : N[0]) || c).clientX - w.left, u.moveY = (((I = c.touches) == null ? void 0 : I[0]) || c).clientY - w.top, u.movePercentageX = u.moveX * 100 / w.width, u.movePercentageY = u.moveY * 100 / w.height, p.eventCreateMinDrag && Math.abs(u.startY - u.moveY) > p.eventCreateMinDrag && (u.thresholdPassed = !0), (de = (x = he.value).drag) == null || de.call(x, { e: c, cell: q.value, cursor: ce.value });
1646
+ }, _ = async (c) => {
1647
+ var w, S;
1648
+ document.removeEventListener(c.type === "touchend" ? "touchmove" : "mousemove", a, { passive: !1 }), u.dragging && ((S = (w = he.value).dragEnd) == null || S.call(w, { e: c, cell: q.value, cursor: ce.value }), C.isDraggingCell = !1, p.editableEvents.create && (e.value = !0, await y(c), e.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;
1649
+ }, y = async (c) => {
1650
+ if (!Y.value) return;
1651
+ let { start: w, end: S, startMinutes: M, endMinutes: N } = h.value;
1652
+ w = new Date(n.start), w.setMinutes(M), S = new Date(n.start), S.setMinutes(N);
1653
+ let I = { ...h.value, start: w, end: S };
1654
+ const { create: x } = p.eventListeners.event;
1647
1655
  if (typeof x == "function") {
1648
1656
  const de = I;
1649
- I = await new Promise((ye) => x({ e: d, event: I, cell: K.value, resolve: ye, cursor: ce.value })), I && typeof I == "object" && D.createEvent(I), I && typeof I == "boolean" && D.createEvent(de);
1650
- } else D.createEvent(I);
1657
+ I = await new Promise((ye) => x({ e: c, event: I, cell: q.value, resolve: ye, cursor: ce.value })), I && typeof I == "object" && g.createEvent(I), I && typeof I == "boolean" && g.createEvent(de);
1658
+ } else g.createEvent(I);
1651
1659
  }, B = () => {
1652
- Object.keys(he.value).forEach((d) => {
1653
- var p;
1654
- (p = f.value) == null || p.removeEventListener(d, he.value[d]);
1660
+ Object.keys(he.value).forEach((c) => {
1661
+ var w;
1662
+ (w = m.value) == null || w.removeEventListener(c, he.value[c]);
1655
1663
  });
1656
1664
  }, Q = () => {
1657
- v.value = H.getCellOverlappingEvents(A.value);
1665
+ d.value = L.getCellOverlappingEvents(A.value);
1658
1666
  };
1659
1667
  return me(
1660
1668
  // Watch event IDs and start/end dates (only) to detect event resizing/dnd.
1661
- () => _.value.map((d) => `${d._.id}${d.start.getTime()}${d.end.getTime()}`).join(),
1669
+ () => k.value.map((c) => `${c._.id}${c.start.getTime()}${c.end.getTime()}`).join(),
1662
1670
  async () => {
1663
1671
  await Ue(), Q();
1664
1672
  },
1665
1673
  { immediate: !0, flush: "post" }
1666
1674
  // Use flush: 'post' to prevent infinite updates.
1667
1675
  ), Xe(async () => {
1668
- $.value.forEach((d) => H.deleteEvent(d, 3)), B(), await Ue();
1669
- }), (d, p) => (Y(), j("div", De({
1670
- class: ["vuecal__cell", L.value],
1676
+ $.value.forEach((c) => L.deleteEvent(c, 3)), B(), await Ue();
1677
+ }), (c, w) => (E(), j("div", De({
1678
+ class: ["vuecal__cell", P.value],
1671
1679
  ref_key: "cellEl",
1672
- ref: f
1680
+ ref: m
1673
1681
  }, Ie(he.value, !0)), [
1674
- d.$slots.cell ? F(d.$slots, "cell", {
1682
+ c.$slots.cell ? F(c.$slots, "cell", {
1675
1683
  key: 0,
1676
- start: u.start,
1677
- end: u.end,
1678
- index: u.index,
1679
- events: n.value
1680
- }) : U("", !0),
1681
- q.value ? (Y(!0), j(te, { key: 1 }, pe(q.value, (V, M) => (Y(), j("div", {
1682
- class: ke(["vuecal__special-hours", V.class]),
1683
- style: Te(V.style),
1684
- innerHTML: V.label || ""
1685
- }, null, 14, At))), 256)) : U("", !0),
1686
- !d.$slots.cell && S(w).schedules ? (Y(!0), j(te, { key: 2 }, pe(S(w).schedules, (V) => (Y(), j("div", {
1687
- class: ke(["vuecal__schedule vuecal__schedule--cell", V.class]),
1688
- key: V.id,
1689
- style: Te(V.style || null),
1690
- "data-schedule": V.id
1684
+ cell: q.value
1685
+ }) : Z("", !0),
1686
+ U.value ? (E(!0), j(te, { key: 1 }, we(U.value, (S, M) => (E(), j("div", {
1687
+ class: _e(["vuecal__special-hours", S.class]),
1688
+ style: Te(S.style),
1689
+ innerHTML: S.label || ""
1690
+ }, null, 14, At))), 256)) : Z("", !0),
1691
+ !c.$slots.cell && O(p).schedules ? (E(!0), j(te, { key: 2 }, we(O(p).schedules, (S) => (E(), j("div", {
1692
+ class: _e(["vuecal__schedule vuecal__schedule--cell", S.class]),
1693
+ key: S.id,
1694
+ style: Te(S.style || null),
1695
+ "data-schedule": S.id
1691
1696
  }, [
1692
- d.$slots["cell-events"] ? F(d.$slots, "cell-events", {
1697
+ c.$slots["cell-events"] ? F(c.$slots, "cell-events", {
1693
1698
  key: 0,
1694
- start: u.start,
1695
- end: u.end,
1696
- events: n.value
1697
- }) : U("", !0),
1698
- l.value || d.$slots["cell-date"] ? (Y(), j("div", Rt, [
1699
- F(d.$slots, "cell-date", {
1700
- start: u.start,
1701
- end: u.end,
1702
- events: n.value
1703
- }, () => [
1704
- xe(le(l.value), 1)
1699
+ cell: q.value
1700
+ }) : Z("", !0),
1701
+ s.value || c.$slots["cell-date"] ? (E(), j("div", Rt, [
1702
+ F(c.$slots, "cell-date", { cell: q.value }, () => [
1703
+ xe(le(s.value), 1)
1705
1704
  ])
1706
- ])) : U("", !0),
1707
- d.$slots["cell-content"] ? (Y(), j("div", Xt, [
1708
- F(d.$slots, "cell-content", {
1709
- start: u.start,
1710
- end: u.end,
1711
- events: n.value
1712
- })
1713
- ])) : U("", !0),
1714
- d.$slots["cell-events"] && n.value.length ? (Y(), j("div", Gt, [
1715
- F(d.$slots, "cell-events", {
1716
- start: u.start,
1717
- end: u.end,
1718
- events: n.value
1719
- })
1720
- ])) : n.value.length || W.value ? (Y(), Se(et, {
1705
+ ])) : Z("", !0),
1706
+ c.$slots["cell-content"] ? (E(), j("div", Xt, [
1707
+ F(c.$slots, "cell-content", { cell: q.value })
1708
+ ])) : Z("", !0),
1709
+ c.$slots["cell-events"] && l.value.length ? (E(), j("div", Gt, [
1710
+ F(c.$slots, "cell-events", { cell: q.value })
1711
+ ])) : l.value.length || W.value ? (E(), Se(et, {
1721
1712
  key: 4,
1722
1713
  class: "vuecal__cell-events",
1723
1714
  name: "vuecal-event-delete",
1724
- onBeforeLeave: p[0] || (p[0] = (M) => W.value = !0),
1725
- onAfterLeave: o,
1715
+ onBeforeLeave: w[0] || (w[0] = (M) => W.value = !0),
1716
+ onAfterLeave: i,
1726
1717
  tag: "div"
1727
1718
  }, {
1728
- default: Z(() => [
1729
- (Y(!0), j(te, null, pe(t.value[V.id], (M) => (Y(), Se(at, {
1719
+ default: J(() => [
1720
+ (E(!0), j(te, null, we(t.value[S.id], (M) => (E(), Se(at, {
1730
1721
  key: M._.id,
1731
1722
  event: M,
1732
1723
  onEventDeleted: G,
1733
- style: Te(O.value[M._.id])
1724
+ style: Te(V.value[M._.id])
1734
1725
  }, je({ _: 2 }, [
1735
- d.$slots.event ? {
1726
+ c.$slots.event ? {
1736
1727
  name: "event",
1737
- fn: Z((N) => [
1738
- F(d.$slots, "event", De({ ref_for: !0 }, N))
1728
+ fn: J((N) => [
1729
+ F(c.$slots, "event", De({ ref_for: !0 }, N))
1739
1730
  ]),
1740
1731
  key: "0"
1741
1732
  } : void 0
1742
1733
  ]), 1032, ["event", "style"]))), 128))
1743
1734
  ]),
1744
1735
  _: 2
1745
- }, 1024)) : U("", !0),
1746
- E.value && c.schedule === V.id ? (Y(), j("div", {
1736
+ }, 1024)) : Z("", !0),
1737
+ Y.value && u.schedule === S.id ? (E(), j("div", {
1747
1738
  key: 5,
1748
1739
  class: "vuecal__event-placeholder",
1749
1740
  style: Te(h.value.style)
1750
- }, le(h.value.start) + " - " + le(h.value.end), 5)) : U("", !0)
1751
- ], 14, It))), 128)) : U("", !0),
1752
- !d.$slots.cell && !S(w).schedules ? (Y(), j(te, { key: 3 }, [
1753
- d.$slots["cell-events"] ? F(d.$slots, "cell-events", { key: 0 }) : U("", !0),
1754
- l.value || d.$slots["cell-date"] ? (Y(), j("div", qt, [
1755
- F(d.$slots, "cell-date", {
1756
- start: u.start,
1757
- end: u.end,
1758
- events: n.value
1759
- }, () => [
1760
- xe(le(l.value), 1)
1741
+ }, le(h.value.start) + " - " + le(h.value.end), 5)) : Z("", !0)
1742
+ ], 14, It))), 128)) : Z("", !0),
1743
+ !c.$slots.cell && !O(p).schedules ? (E(), j(te, { key: 3 }, [
1744
+ c.$slots["cell-events"] ? F(c.$slots, "cell-events", {
1745
+ key: 0,
1746
+ cell: q.value
1747
+ }) : Z("", !0),
1748
+ s.value || c.$slots["cell-date"] ? (E(), j("div", qt, [
1749
+ F(c.$slots, "cell-date", { cell: q.value }, () => [
1750
+ xe(le(s.value), 1)
1761
1751
  ])
1762
- ])) : U("", !0),
1763
- d.$slots["cell-content"] ? (Y(), j("div", Ut, [
1764
- F(d.$slots, "cell-content", {
1765
- start: u.start,
1766
- end: u.end,
1767
- events: n.value
1768
- })
1769
- ])) : U("", !0),
1770
- d.$slots["cell-events"] && n.value.length ? (Y(), j("div", Zt, [
1771
- F(d.$slots, "cell-events", {
1772
- start: u.start,
1773
- end: u.end,
1774
- events: n.value
1775
- })
1776
- ])) : (n.value.length || W.value) && !(S(D).isMonth && !S(w).eventsOnMonthView) ? (Y(), Se(et, {
1752
+ ])) : Z("", !0),
1753
+ c.$slots["cell-content"] ? (E(), j("div", Ut, [
1754
+ F(c.$slots, "cell-content", { cell: q.value })
1755
+ ])) : Z("", !0),
1756
+ c.$slots["cell-events"] && l.value.length ? (E(), j("div", Zt, [
1757
+ F(c.$slots, "cell-events", { cell: q.value })
1758
+ ])) : (l.value.length || W.value) && !(O(g).isMonth && !O(p).eventsOnMonthView) ? (E(), Se(et, {
1777
1759
  key: 4,
1778
1760
  class: "vuecal__cell-events",
1779
1761
  name: "vuecal-event-delete",
1780
- onBeforeLeave: p[1] || (p[1] = (V) => W.value = !0),
1781
- onAfterLeave: o,
1762
+ onBeforeLeave: w[1] || (w[1] = (S) => W.value = !0),
1763
+ onAfterLeave: i,
1782
1764
  tag: "div"
1783
1765
  }, {
1784
- default: Z(() => [
1785
- (Y(!0), j(te, null, pe(n.value, (V) => (Y(), Se(at, {
1786
- key: V._.id,
1787
- event: V,
1766
+ default: J(() => [
1767
+ (E(!0), j(te, null, we(l.value, (S) => (E(), Se(at, {
1768
+ key: S._.id,
1769
+ event: S,
1788
1770
  onEventDeleted: G,
1789
- style: Te(O.value[V._.id])
1771
+ style: Te(V.value[S._.id])
1790
1772
  }, je({ _: 2 }, [
1791
- d.$slots.event ? {
1773
+ c.$slots.event ? {
1792
1774
  name: "event",
1793
- fn: Z((M) => [
1794
- F(d.$slots, "event", De({ ref_for: !0 }, M))
1775
+ fn: J((M) => [
1776
+ F(c.$slots, "event", De({ ref_for: !0 }, M))
1795
1777
  ]),
1796
1778
  key: "0"
1797
1779
  } : void 0
1798
1780
  ]), 1032, ["event", "style"]))), 128))
1799
1781
  ]),
1800
1782
  _: 3
1801
- })) : U("", !0),
1802
- E.value ? (Y(), j("div", {
1783
+ })) : Z("", !0),
1784
+ Y.value ? (E(), j("div", {
1803
1785
  key: 5,
1804
1786
  class: "vuecal__event-placeholder",
1805
1787
  style: Te(h.value.style)
1806
- }, le(h.value.start) + " - " + le(h.value.end), 5)) : U("", !0)
1807
- ], 64)) : U("", !0),
1808
- d.$slots["event-count"] ? F(d.$slots, "event-count", {
1788
+ }, le(h.value.start) + " - " + le(h.value.end), 5)) : Z("", !0)
1789
+ ], 64)) : Z("", !0),
1790
+ c.$slots["event-count"] ? F(c.$slots, "event-count", {
1809
1791
  key: 4,
1810
- events: _.value
1811
- }) : P.value ? (Y(), j("div", Jt, le(_.value.length), 1)) : U("", !0),
1812
- re.show ? (Y(), j("div", {
1792
+ events: k.value
1793
+ }) : H.value ? (E(), j("div", Jt, le(k.value.length), 1)) : Z("", !0),
1794
+ re.show ? (E(), j("div", {
1813
1795
  key: 6,
1814
1796
  class: "vuecal__now-line",
1815
1797
  style: Te(re.style),
1816
1798
  title: re.currentTime
1817
1799
  }, [
1818
1800
  ge("span", null, le(re.currentTime), 1)
1819
- ], 12, Kt)) : U("", !0)
1801
+ ], 12, Kt)) : Z("", !0)
1820
1802
  ], 16));
1821
1803
  }
1822
1804
  }, xt = {
1823
1805
  __name: "body",
1824
- setup(u) {
1825
- const s = Ne("vuecal");
1826
- let { view: r, config: D, dateUtils: w } = s;
1827
- const b = oe(null), H = oe(null), m = T(() => ({
1806
+ setup(D) {
1807
+ const n = Ne("vuecal"), { view: r, config: g, dateUtils: p } = n, b = ie(null), L = ie(null), v = T(() => ({
1828
1808
  "--vuecal-grid-columns": r.cols,
1829
1809
  "--vuecal-grid-rows": r.rows
1830
1810
  })), C = T(() => {
1831
- const $ = w.formatTime(Pe(H.value, D));
1811
+ const $ = p.formatTime(Pe(L.value, g));
1832
1812
  return {
1833
- style: { top: H.value + "%" },
1813
+ style: { top: `${L.value}%` },
1834
1814
  time: $
1835
1815
  };
1836
- }), i = ($) => {
1837
- var o;
1816
+ }), o = ($) => {
1817
+ var i;
1838
1818
  if (r.isMonth || r.isYear || r.isYears) return;
1839
- const W = (((o = $.touches) == null ? void 0 : o[0]) || $).clientY, { top: G } = b.value.getBoundingClientRect();
1840
- H.value = Je(W - G, b.value);
1841
- }, f = () => {
1842
- H.value = null;
1819
+ const W = (((i = $.touches) == null ? void 0 : i[0]) || $).clientY, { top: G } = b.value.getBoundingClientRect();
1820
+ L.value = Je(W - G, b.value);
1821
+ }, m = () => {
1822
+ L.value = null;
1843
1823
  };
1844
1824
  return Ze(() => {
1845
- b.value.addEventListener("mousemove", i), b.value.addEventListener("touchmove", i), b.value.addEventListener("mouseleave", f), b.value.addEventListener("touchend", f);
1825
+ b.value.addEventListener("mousemove", o), b.value.addEventListener("touchmove", o), b.value.addEventListener("mouseleave", m), b.value.addEventListener("touchend", m);
1846
1826
  }), Xe(() => {
1847
- b.value && (b.value.removeEventListener("mousemove", i), b.value.removeEventListener("touchmove", i), b.value.removeEventListener("mouseleave", f), b.value.removeEventListener("touchend", f));
1848
- }), ($, W) => (Y(), j("div", {
1827
+ b.value && (b.value.removeEventListener("mousemove", o), b.value.removeEventListener("touchmove", o), b.value.removeEventListener("mouseleave", m), b.value.removeEventListener("touchend", m));
1828
+ }), ($, W) => (E(), j("div", {
1849
1829
  class: "vuecal__body",
1850
1830
  ref_key: "bodyEl",
1851
1831
  ref: b,
1852
- style: Te(m.value)
1832
+ style: Te(v.value)
1853
1833
  }, [
1854
1834
  Oe(Ge, { name: "vuecal-shrink" }, {
1855
- default: Z(() => [
1856
- S(D).timeAtCursor && H.value !== null ? (Y(), j("div", {
1835
+ default: J(() => [
1836
+ O(g).timeAtCursor && L.value !== null ? (E(), j("div", {
1857
1837
  key: 0,
1858
1838
  class: "vuecal__time-at-cursor",
1859
1839
  style: Te(C.value.style)
1860
1840
  }, [
1861
1841
  ge("label", null, le(C.value.time), 1)
1862
- ], 4)) : U("", !0)
1842
+ ], 4)) : Z("", !0)
1863
1843
  ]),
1864
1844
  _: 1
1865
1845
  }),
1866
- (Y(!0), j(te, null, pe(S(r).cellDates, (G, o) => (Y(), Se(Qt, {
1867
- key: o,
1846
+ (E(!0), j(te, null, we(O(r).cellDates, (G, i) => (E(), Se(Qt, {
1847
+ key: i,
1868
1848
  start: G.start,
1869
1849
  end: G.end,
1870
- index: o
1850
+ index: i
1871
1851
  }, je({ _: 2 }, [
1872
1852
  $.$slots.cell ? {
1873
1853
  name: "cell",
1874
- fn: Z((c) => [
1875
- F($.$slots, "cell", De({ ref_for: !0 }, c))
1854
+ fn: J((u) => [
1855
+ F($.$slots, "cell", De({ ref_for: !0 }, u))
1876
1856
  ]),
1877
1857
  key: "0"
1878
1858
  } : void 0,
1879
1859
  $.$slots["cell-date"] ? {
1880
1860
  name: "cell-date",
1881
- fn: Z((c) => [
1882
- F($.$slots, "cell-date", De({ ref_for: !0 }, c))
1861
+ fn: J((u) => [
1862
+ F($.$slots, "cell-date", De({ ref_for: !0 }, u))
1883
1863
  ]),
1884
1864
  key: "1"
1885
1865
  } : void 0,
1886
1866
  $.$slots["cell-content"] ? {
1887
1867
  name: "cell-content",
1888
- fn: Z((c) => [
1889
- F($.$slots, "cell-content", De({ ref_for: !0 }, c))
1868
+ fn: J((u) => [
1869
+ F($.$slots, "cell-content", De({ ref_for: !0 }, u))
1890
1870
  ]),
1891
1871
  key: "2"
1892
1872
  } : void 0,
1893
1873
  $.$slots["cell-events"] ? {
1894
1874
  name: "cell-events",
1895
- fn: Z((c) => [
1896
- F($.$slots, "cell-events", De({ ref_for: !0 }, c))
1875
+ fn: J((u) => [
1876
+ F($.$slots, "cell-events", De({ ref_for: !0 }, u))
1897
1877
  ]),
1898
1878
  key: "3"
1899
1879
  } : $.$slots.event ? {
1900
1880
  name: "event",
1901
- fn: Z((c) => [
1902
- F($.$slots, "event", De({ ref_for: !0 }, c))
1881
+ fn: J((u) => [
1882
+ F($.$slots, "event", De({ ref_for: !0 }, u))
1903
1883
  ]),
1904
1884
  key: "4"
1905
1885
  } : $.$slots["event-count"] ? {
1906
1886
  name: "event-count",
1907
- fn: Z((c) => [
1908
- F($.$slots, "event-count", De({ ref_for: !0 }, c))
1887
+ fn: J((u) => [
1888
+ F($.$slots, "event-count", De({ ref_for: !0 }, u))
1909
1889
  ]),
1910
1890
  key: "5"
1911
1891
  } : void 0
@@ -1915,9 +1895,9 @@ const nt = (u, s) => {
1915
1895
  }, ea = ["data-locale"], ta = { class: "vuecal__scrollable-wrap" }, aa = {
1916
1896
  key: 1,
1917
1897
  class: "vuecal__week-numbers"
1918
- }, sa = { class: "vuecal__week-number" }, na = { class: "vuecal__body-wrap" }, ia = {
1898
+ }, na = { class: "vuecal__week-number" }, sa = { class: "vuecal__body-wrap" }, oa = {
1919
1899
  __name: "index",
1920
- props: wt,
1900
+ props: pt,
1921
1901
  emits: [
1922
1902
  "ready",
1923
1903
  "view-change",
@@ -1929,132 +1909,130 @@ const nt = (u, s) => {
1929
1909
  "event-created",
1930
1910
  "event-dropped"
1931
1911
  ],
1932
- setup(u, { expose: s, emit: r }) {
1933
- const D = u, w = r, b = it("vuecal-el"), H = yt({ props: D, emit: w, attrs: ut(), vuecalEl: b, uid: ot() }), { config: m, view: C, dateUtils: i, touch: f } = H, $ = T(() => m.time && (C.isDay || C.isDays || C.isWeek)), W = T(() => Array(C.rows).fill().map((e, v) => i.getWeek(i.addDays(C.firstCellDate, 7 * v)))), G = T(() => {
1912
+ setup(D, { expose: n, emit: r }) {
1913
+ const g = D, p = r, b = ot("vuecal-el"), L = yt({ props: g, emit: p, attrs: ut(), vuecalEl: b, uid: it() }), { config: v, view: C, dateUtils: o, touch: m } = L, $ = T(() => v.time && (C.isDay || C.isDays || C.isWeek)), W = T(() => Array(C.rows).fill().map((e, d) => o.getWeek(o.addDays(C.firstCellDate, 7 * d)))), G = T(() => {
1934
1914
  var e;
1935
1915
  return {
1936
- "vuecal--ready": m.ready,
1937
- [`vuecal--${m.theme}-theme`]: m.theme,
1938
- [`vuecal--${m.size}`]: !0,
1939
- "vuecal--date-picker": m.datePicker,
1940
- "vuecal--dark": m.dark,
1941
- "vuecal--light": !m.dark,
1916
+ "vuecal--ready": v.ready,
1917
+ [`vuecal--${v.theme}-theme`]: v.theme,
1918
+ [`vuecal--${v.size}`]: !0,
1919
+ "vuecal--date-picker": v.datePicker,
1920
+ "vuecal--dark": v.dark,
1921
+ "vuecal--light": !v.dark,
1942
1922
  [`vuecal--${C.id}-view`]: !0,
1943
1923
  "vuecal--view-has-time": $.value,
1944
- "vuecal--timeless": !m.time,
1945
- "vuecal--dragging-cell": f.isDraggingCell,
1946
- "vuecal--dragging-event": f.isDraggingEvent,
1947
- "vuecal--resizing-event": f.isResizingEvent,
1948
- "vuecal--has-schedules": (e = m.schedules) == null ? void 0 : e.length
1924
+ "vuecal--timeless": !v.time,
1925
+ "vuecal--dragging-cell": m.isDraggingCell,
1926
+ "vuecal--dragging-event": m.isDraggingEvent,
1927
+ "vuecal--resizing-event": m.isResizingEvent,
1928
+ "vuecal--has-schedules": (e = v.schedules) == null ? void 0 : e.length
1949
1929
  };
1950
- }), o = T(() => ({
1951
- "--vuecal-time-cell-height": m.timeCellHeight && `${m.timeCellHeight}px`
1952
- })), c = T(() => {
1953
- var e, v;
1930
+ }), i = T(() => ({
1931
+ "--vuecal-time-cell-height": v.timeCellHeight && `${v.timeCellHeight}px`
1932
+ })), u = T(() => {
1933
+ var e, d;
1954
1934
  return {
1955
- "vuecal__scrollable--row": $.value || m.weekNumbers && C.isMonth,
1935
+ "vuecal__scrollable--row": $.value || v.weekNumbers && C.isMonth,
1956
1936
  // Keep the states inside the Vue transition wrapper for smooth CSS transitions.
1957
1937
  [`vuecal__scrollable--${C.id}-view`]: !0,
1958
- "vuecal__scrollable--has-schedules": (e = m.schedules) == null ? void 0 : e.length,
1959
- "vuecal__scrollable--no-schedules": !((v = m.schedules) != null && v.length)
1938
+ "vuecal__scrollable--has-schedules": (e = v.schedules) == null ? void 0 : e.length,
1939
+ "vuecal__scrollable--no-schedules": !((d = v.schedules) != null && d.length)
1960
1940
  };
1961
1941
  });
1962
1942
  return Ze(async () => {
1963
- await Ue(), m.ready = !0, w("ready", { config: m, view: C });
1964
- }), ct("vuecal", H), s({ view: H.view }), (e, v) => (Y(), j("div", {
1965
- class: ke(["vuecal", G.value]),
1943
+ await Ue(), v.ready = !0, p("ready", { config: v, view: C });
1944
+ }), ct("vuecal", L), n({ view: L.view }), (e, d) => (E(), j("div", {
1945
+ class: _e(["vuecal", G.value]),
1966
1946
  ref: "vuecal-el",
1967
1947
  "data-locale": e.locale,
1968
- style: Te(o.value)
1948
+ style: Te(i.value)
1969
1949
  }, [
1970
1950
  e.$slots.diy ? F(e.$slots, "diy", {
1971
1951
  key: 0,
1972
- vuecal: S(H),
1973
- view: S(C),
1974
- availableViews: S(m).availableViews
1975
- }) : (Y(), j(te, { key: 1 }, [
1952
+ vuecal: O(L)
1953
+ }) : (E(), j(te, { key: 1 }, [
1976
1954
  Oe(Mt, null, je({ _: 2 }, [
1977
1955
  e.$slots.header ? {
1978
1956
  name: "header",
1979
- fn: Z((h) => [
1980
- F(e.$slots, "header", se(ne(h)))
1957
+ fn: J((h) => [
1958
+ F(e.$slots, "header", ne(se(h)))
1981
1959
  ]),
1982
1960
  key: "0"
1983
1961
  } : void 0,
1984
1962
  !e.$slots.header && e.$slots["previous-button"] ? {
1985
1963
  name: "previous-button",
1986
- fn: Z((h) => [
1987
- F(e.$slots, "previous-button", se(ne(h)))
1964
+ fn: J((h) => [
1965
+ F(e.$slots, "previous-button", ne(se(h)))
1988
1966
  ]),
1989
1967
  key: "1"
1990
1968
  } : void 0,
1991
1969
  !e.$slots.header && e.$slots["next-button"] ? {
1992
1970
  name: "next-button",
1993
- fn: Z((h) => [
1994
- F(e.$slots, "next-button", se(ne(h)))
1971
+ fn: J((h) => [
1972
+ F(e.$slots, "next-button", ne(se(h)))
1995
1973
  ]),
1996
1974
  key: "2"
1997
1975
  } : void 0,
1998
1976
  !e.$slots.header && e.$slots["today-button"] ? {
1999
1977
  name: "today-button",
2000
- fn: Z((h) => [
2001
- F(e.$slots, "today-button", se(ne(h)))
1978
+ fn: J((h) => [
1979
+ F(e.$slots, "today-button", ne(se(h)))
2002
1980
  ]),
2003
1981
  key: "3"
2004
1982
  } : void 0,
2005
1983
  !e.$slots.header && e.$slots.title ? {
2006
1984
  name: "title",
2007
- fn: Z((h) => [
2008
- F(e.$slots, "title", se(ne(h)))
1985
+ fn: J((h) => [
1986
+ F(e.$slots, "title", ne(se(h)))
2009
1987
  ]),
2010
1988
  key: "4"
2011
1989
  } : void 0,
2012
1990
  !e.$slots.header && e.$slots["schedule-heading"] ? {
2013
1991
  name: "schedule-heading",
2014
- fn: Z((h) => [
2015
- F(e.$slots, "schedule-heading", se(ne(h)))
1992
+ fn: J((h) => [
1993
+ F(e.$slots, "schedule-heading", ne(se(h)))
2016
1994
  ]),
2017
1995
  key: "5"
2018
1996
  } : void 0
2019
1997
  ]), 1024),
2020
1998
  ge("div", ta, [
2021
1999
  Oe(Ge, {
2022
- name: `vuecal-slide-fade--${S(C).transitionDirection}`
2000
+ name: `vuecal-slide-fade--${O(C).transitionDirection}`
2023
2001
  }, {
2024
- default: Z(() => [
2025
- (Y(), j("div", {
2026
- class: ke(["vuecal__scrollable", c.value]),
2027
- key: S(C).id + S(C).start.getTime()
2002
+ default: J(() => [
2003
+ (E(), j("div", {
2004
+ class: _e(["vuecal__scrollable", u.value]),
2005
+ key: O(C).id + O(C).start.getTime()
2028
2006
  }, [
2029
- $.value ? (Y(), Se(Lt, { key: 0 }, je({ _: 2 }, [
2007
+ $.value ? (E(), Se(Lt, { key: 0 }, je({ _: 2 }, [
2030
2008
  e.$slots["time-cell"] ? {
2031
2009
  name: "time-cell",
2032
- fn: Z((h) => [
2033
- F(e.$slots, "time-cell", se(ne(h)))
2010
+ fn: J((h) => [
2011
+ F(e.$slots, "time-cell", ne(se(h)))
2034
2012
  ]),
2035
2013
  key: "0"
2036
2014
  } : void 0
2037
- ]), 1024)) : U("", !0),
2038
- S(m).weekNumbers && S(C).isMonth ? (Y(), j("div", aa, [
2039
- (Y(!0), j(te, null, pe(W.value, (h) => (Y(), j("div", sa, [
2015
+ ]), 1024)) : Z("", !0),
2016
+ O(v).weekNumbers && O(C).isMonth ? (E(), j("div", aa, [
2017
+ (E(!0), j(te, null, we(W.value, (h) => (E(), j("div", na, [
2040
2018
  F(e.$slots, "week-number", {}, () => [
2041
2019
  ge("small", null, le(h), 1)
2042
2020
  ])
2043
2021
  ]))), 256))
2044
- ])) : U("", !0),
2045
- ge("div", na, [
2022
+ ])) : Z("", !0),
2023
+ ge("div", sa, [
2046
2024
  Oe(Pt, null, je({ _: 2 }, [
2047
2025
  e.$slots["weekday-heading"] ? {
2048
2026
  name: "weekday-heading",
2049
- fn: Z((h) => [
2050
- F(e.$slots, "weekday-heading", se(ne(h)))
2027
+ fn: J((h) => [
2028
+ F(e.$slots, "weekday-heading", ne(se(h)))
2051
2029
  ]),
2052
2030
  key: "0"
2053
2031
  } : void 0,
2054
2032
  e.$slots["schedule-heading"] ? {
2055
2033
  name: "schedule-heading",
2056
- fn: Z((h) => [
2057
- F(e.$slots, "schedule-heading", se(ne(h)))
2034
+ fn: J((h) => [
2035
+ F(e.$slots, "schedule-heading", ne(se(h)))
2058
2036
  ]),
2059
2037
  key: "1"
2060
2038
  } : void 0
@@ -2062,43 +2040,43 @@ const nt = (u, s) => {
2062
2040
  Oe(xt, null, je({ _: 2 }, [
2063
2041
  e.$slots.cell ? {
2064
2042
  name: "cell",
2065
- fn: Z((h) => [
2066
- F(e.$slots, "cell", se(ne(h)))
2043
+ fn: J((h) => [
2044
+ F(e.$slots, "cell", ne(se(h)))
2067
2045
  ]),
2068
2046
  key: "0"
2069
2047
  } : void 0,
2070
2048
  !e.$slots.cell && e.$slots["cell-date"] ? {
2071
2049
  name: "cell-date",
2072
- fn: Z((h) => [
2073
- F(e.$slots, "cell-date", se(ne(h)))
2050
+ fn: J((h) => [
2051
+ F(e.$slots, "cell-date", ne(se(h)))
2074
2052
  ]),
2075
2053
  key: "1"
2076
2054
  } : void 0,
2077
2055
  !e.$slots.cell && e.$slots["cell-content"] ? {
2078
2056
  name: "cell-content",
2079
- fn: Z((h) => [
2080
- F(e.$slots, "cell-content", se(ne(h)))
2057
+ fn: J((h) => [
2058
+ F(e.$slots, "cell-content", ne(se(h)))
2081
2059
  ]),
2082
2060
  key: "2"
2083
2061
  } : void 0,
2084
2062
  !e.$slots.cell && e.$slots["cell-events"] ? {
2085
2063
  name: "cell-events",
2086
- fn: Z((h) => [
2087
- F(e.$slots, "cell-events", se(ne(h)))
2064
+ fn: J((h) => [
2065
+ F(e.$slots, "cell-events", ne(se(h)))
2088
2066
  ]),
2089
2067
  key: "3"
2090
2068
  } : void 0,
2091
2069
  !e.$slots.cell && e.$slots.event ? {
2092
2070
  name: "event",
2093
- fn: Z((h) => [
2094
- F(e.$slots, "event", se(ne(h)))
2071
+ fn: J((h) => [
2072
+ F(e.$slots, "event", ne(se(h)))
2095
2073
  ]),
2096
2074
  key: "4"
2097
2075
  } : void 0,
2098
2076
  !e.$slots.cell && e.$slots["event-count"] ? {
2099
2077
  name: "event-count",
2100
- fn: Z((h) => [
2101
- F(e.$slots, "event-count", se(ne(h)))
2078
+ fn: J((h) => [
2079
+ F(e.$slots, "event-count", ne(se(h)))
2102
2080
  ]),
2103
2081
  key: "5"
2104
2082
  } : void 0
@@ -2112,8 +2090,8 @@ const nt = (u, s) => {
2112
2090
  ], 64))
2113
2091
  ], 14, ea));
2114
2092
  }
2115
- }, oa = (u) => {
2116
- Fe.texts = { ...fe.texts, ...u }, Fe.dateUtils.updateTexts(Fe.texts);
2093
+ }, ia = (D) => {
2094
+ Fe.texts = { ...fe.texts, ...D }, Fe.dateUtils.updateTexts(Fe.texts);
2117
2095
  }, {
2118
2096
  addDatePrototypes: ua,
2119
2097
  removeDatePrototypes: ca,
@@ -2125,16 +2103,16 @@ const nt = (u, s) => {
2125
2103
  addMinutes: ha,
2126
2104
  subtractMinutes: ya,
2127
2105
  getWeek: Da,
2128
- isToday: wa,
2129
- isSameDate: pa,
2130
- isInRange: ka,
2131
- isLeapYear: _a,
2106
+ isToday: pa,
2107
+ isSameDate: wa,
2108
+ isInRange: _a,
2109
+ isLeapYear: ka,
2132
2110
  getPreviousFirstDayOfWeek: ba,
2133
2111
  stringToDate: Ta,
2134
2112
  dateToMinutes: $a,
2135
2113
  countDays: Ma,
2136
- datesInSameTimeStep: Ea,
2137
- isValid: Ya,
2114
+ datesInSameTimeStep: Ya,
2115
+ isValid: Ea,
2138
2116
  formatDate: Sa,
2139
2117
  formatDateLite: Ca,
2140
2118
  formatTime: Va,
@@ -2142,14 +2120,14 @@ const nt = (u, s) => {
2142
2120
  formatMinutes: ja
2143
2121
  } = Fe.dateUtils;
2144
2122
  export {
2145
- ia as VueCal,
2123
+ oa as VueCal,
2146
2124
  ua as addDatePrototypes,
2147
2125
  va as addDays,
2148
2126
  fa as addHours,
2149
2127
  ha as addMinutes,
2150
2128
  Ma as countDays,
2151
2129
  $a as dateToMinutes,
2152
- Ea as datesInSameTimeStep,
2130
+ Ya as datesInSameTimeStep,
2153
2131
  Sa as formatDate,
2154
2132
  Ca as formatDateLite,
2155
2133
  ja as formatMinutes,
@@ -2157,16 +2135,16 @@ export {
2157
2135
  Oa as formatTimeLite,
2158
2136
  ba as getPreviousFirstDayOfWeek,
2159
2137
  Da as getWeek,
2160
- ka as isInRange,
2161
- _a as isLeapYear,
2162
- pa as isSameDate,
2163
- wa as isToday,
2164
- Ya as isValidDate,
2138
+ _a as isInRange,
2139
+ ka as isLeapYear,
2140
+ wa as isSameDate,
2141
+ pa as isToday,
2142
+ Ea as isValidDate,
2165
2143
  ca as removeDatePrototypes,
2166
2144
  Ta as stringToDate,
2167
2145
  ma as subtractDays,
2168
2146
  ga as subtractHours,
2169
2147
  ya as subtractMinutes,
2170
2148
  da as updateTexts,
2171
- oa as useLocale
2149
+ ia as useLocale
2172
2150
  };