@reservi/preact 1.3.2 → 1.4.0

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.
package/dist/index.js CHANGED
@@ -1,18 +1,58 @@
1
- import { render as X, h as st } from "preact";
2
- import { getLocaleText as E, dl as l, timeStringToMinutes as z, computeDrop as A, pxToSnappedMinutes as lt, computeResize as ct, themeToStyle as vt, CalendarApi as ut, eventsToICS as mt } from "@reservi/core";
3
- import { dayGridPlugin as Kt, definePlugin as Wt, defineTheme as Xt, eventsToICS as zt, listPlugin as qt, multiMonthPlugin as Jt, parseICS as Qt, resourcePlugin as Zt, themeToStyle as te, timeGridPlugin as ee, timelinePlugin as re } from "@reservi/core";
4
- import { jsxs as v, jsx as n, Fragment as ht } from "preact/jsx-runtime";
1
+ import { render as at, h as bt } from "preact";
2
+ import { getLocaleText as R, dl as s, timeStringToMinutes as K, computeDrop as J, pxToSnappedMinutes as wt, computeResize as kt, THEME_TOKEN_VARS as Dt, themeToStyle as pt, CalendarApi as Mt, eventsToICS as St } from "@reservi/core";
3
+ import { dayGridPlugin as ge, definePlugin as ye, defineTheme as fe, eventsToICS as be, listPlugin as we, multiMonthPlugin as ke, parseICS as De, resourcePlugin as pe, themeToStyle as Me, timeGridPlugin as Se, timelinePlugin as Ce } from "@reservi/core";
4
+ import { jsx as d, jsxs as g, Fragment as Ct } from "preact/jsx-runtime";
5
5
  import "@preact/signals";
6
- import { useRef as F, useState as R, useEffect as q } from "preact/hooks";
7
- function x(a, t, r) {
8
- return a ? a(t) : r;
6
+ import { useRef as $, useLayoutEffect as ot, useState as N, useEffect as H } from "preact/hooks";
7
+ function ce(r) {
8
+ return { __rsvHost: !0, node: r };
9
9
  }
10
- function $(...a) {
11
- return a.filter(Boolean).join(" ");
10
+ function Et(r) {
11
+ return typeof r == "object" && r !== null && r.__rsvHost === !0;
12
12
  }
13
- const I = { prev: "‹", next: "›" }, gt = /* @__PURE__ */ new Set(["", "title", "today", "prev", "next"]), yt = /month|year/i, L = (a) => String(a).padStart(2, "0");
14
- function ft() {
15
- return /* @__PURE__ */ v(
13
+ function L(r, t, e, n) {
14
+ if (!r) return e;
15
+ const o = r(t);
16
+ return o === void 0 ? e : Et(o) ? n ? /* @__PURE__ */ d(xt, { bridge: n, node: o.node }) : e : o;
17
+ }
18
+ let Tt = 0;
19
+ function xt({ bridge: r, node: t }) {
20
+ const e = $("");
21
+ e.current || (e.current = `rsv-host-${++Tt}`);
22
+ const n = $(null), o = $(t);
23
+ o.current = t;
24
+ const a = $(!1);
25
+ return ot(() => {
26
+ const h = n.current;
27
+ if (!h) return;
28
+ const u = e.current;
29
+ return a.current = !0, r.mount(u, h, o.current), () => {
30
+ a.current = !1, r.unmount(u);
31
+ };
32
+ }, []), ot(() => {
33
+ a.current && r.update(e.current, t);
34
+ }), /* @__PURE__ */ d("div", { "data-rsv": "host", ref: n });
35
+ }
36
+ function F(...r) {
37
+ return r.filter(Boolean).join(" ");
38
+ }
39
+ const dt = /* @__PURE__ */ new WeakSet();
40
+ function A(r, t, e) {
41
+ if (!r || !t) return;
42
+ const n = r;
43
+ dt.has(n) || (dt.add(n), t(Object.assign(e(), { el: n })));
44
+ }
45
+ function $t(r, t) {
46
+ if (!r.length) return null;
47
+ const e = [...r].sort((o, a) => o.breakpoint - a.breakpoint);
48
+ let n = e[0].view;
49
+ for (const o of e)
50
+ t >= o.breakpoint && (n = o.view);
51
+ return n;
52
+ }
53
+ const G = { prev: "‹", next: "›" }, Pt = /* @__PURE__ */ new Set(["", "title", "today", "prev", "next"]), Ot = /month|year/i, B = (r) => String(r).padStart(2, "0");
54
+ function Lt() {
55
+ return /* @__PURE__ */ g(
16
56
  "svg",
17
57
  {
18
58
  "data-rsv": "title-icon",
@@ -26,158 +66,158 @@ function ft() {
26
66
  "stroke-linejoin": "round",
27
67
  "aria-hidden": "true",
28
68
  children: [
29
- /* @__PURE__ */ n("rect", { x: "1", y: "2.5", width: "12", height: "10.5", rx: "1.5" }),
30
- /* @__PURE__ */ n("line", { x1: "1", y1: "5.5", x2: "13", y2: "5.5" }),
31
- /* @__PURE__ */ n("line", { x1: "4.5", y1: "1", x2: "4.5", y2: "3.5" }),
32
- /* @__PURE__ */ n("line", { x1: "9.5", y1: "1", x2: "9.5", y2: "3.5" })
69
+ /* @__PURE__ */ d("rect", { x: "1", y: "2.5", width: "12", height: "10.5", rx: "1.5" }),
70
+ /* @__PURE__ */ d("line", { x1: "1", y1: "5.5", x2: "13", y2: "5.5" }),
71
+ /* @__PURE__ */ d("line", { x1: "4.5", y1: "1", x2: "4.5", y2: "3.5" }),
72
+ /* @__PURE__ */ d("line", { x1: "9.5", y1: "1", x2: "9.5", y2: "3.5" })
33
73
  ]
34
74
  }
35
75
  );
36
76
  }
37
- function pt(a) {
38
- var r;
39
- if ((r = a.views) != null && r.length) return a.views;
40
- const t = a.headerToolbar;
41
- return t ? [t.start, t.center, t.end].filter((e) => !!e).flatMap((e) => e.split(/\s+/)).flatMap((e) => e.split(",")).filter((e) => !gt.has(e)) : [];
77
+ function Ft(r) {
78
+ var e;
79
+ if ((e = r.views) != null && e.length) return r.views;
80
+ const t = r.headerToolbar;
81
+ return t ? [t.start, t.center, t.end].filter((n) => !!n).flatMap((n) => n.split(/\s+/)).flatMap((n) => n.split(",")).filter((n) => !Pt.has(n)) : [];
42
82
  }
43
- function bt({ api: a, title: t, activeView: r, options: e }) {
44
- var T, _, P, j, U;
45
- const o = E(e.locale), i = (_ = (T = e.slots) == null ? void 0 : T.toolbarStart) == null ? void 0 : _.call(T), u = (j = (P = e.slots) == null ? void 0 : P.toolbarEnd) == null ? void 0 : j.call(P), d = pt(e), s = yt.test(r), c = e.firstDay ?? o.firstDay, h = F(null), [g, f] = R(!1), p = l.toDate(a.getDate()), y = l.toDate(e.now ? l.from(e.now) : l.now()), [w, D] = R(p.getFullYear()), [k, S] = R(p.getMonth()), M = new Intl.DateTimeFormat(e.locale, { month: "short" }), at = new Intl.DateTimeFormat(e.locale, { month: "long" }), nt = new Intl.DateTimeFormat(e.locale, { weekday: "short" }), ot = Array.from(
83
+ function Rt({ api: r, title: t, activeView: e, options: n }) {
84
+ var V, Z, Y, tt, et;
85
+ const o = R(n.locale), a = (Z = (V = n.slots) == null ? void 0 : V.toolbarStart) == null ? void 0 : Z.call(V), h = (tt = (Y = n.slots) == null ? void 0 : Y.toolbarEnd) == null ? void 0 : tt.call(Y), u = Ft(n), v = Ot.test(e), c = n.firstDay ?? o.firstDay, l = $(null), [f, b] = N(!1), k = s.toDate(r.getDate()), w = s.toDate(n.now ? s.from(n.now) : s.now()), [p, m] = N(k.getFullYear()), [S, i] = N(k.getMonth()), D = new Intl.DateTimeFormat(n.locale, { month: "short" }), C = new Intl.DateTimeFormat(n.locale, { month: "long" }), M = new Intl.DateTimeFormat(n.locale, { weekday: "short" }), E = Array.from(
46
86
  { length: 12 },
47
- (m, b) => M.format(new Date(2020, b, 1))
48
- ), N = () => {
49
- const m = l.toDate(a.getDate());
50
- D(m.getFullYear()), S(m.getMonth()), f(!0);
51
- }, H = (m) => {
52
- const b = w * 12 + k + m;
53
- D(Math.floor(b / 12)), S((b % 12 + 12) % 12);
54
- }, V = (m) => {
55
- a.gotoDate(m), f(!1);
87
+ (y, T) => D.format(new Date(2020, T, 1))
88
+ ), x = () => {
89
+ const y = s.toDate(r.getDate());
90
+ m(y.getFullYear()), i(y.getMonth()), b(!0);
91
+ }, I = (y) => {
92
+ const T = p * 12 + S + y;
93
+ m(Math.floor(T / 12)), i((T % 12 + 12) % 12);
94
+ }, P = (y) => {
95
+ r.gotoDate(y), b(!1);
56
96
  };
57
- q(() => {
58
- const m = (C) => {
59
- (C.ctrlKey || C.metaKey) && (C.key === "m" || C.key === "M") ? (C.preventDefault(), N()) : C.key === "Escape" && f(!1);
60
- }, b = (C) => {
61
- h.current && !h.current.contains(C.target) && f(!1);
97
+ H(() => {
98
+ const y = (O) => {
99
+ (O.ctrlKey || O.metaKey) && (O.key === "m" || O.key === "M") ? (O.preventDefault(), x()) : O.key === "Escape" && b(!1);
100
+ }, T = (O) => {
101
+ l.current && !l.current.contains(O.target) && b(!1);
62
102
  };
63
- return document.addEventListener("keydown", m), document.addEventListener("mousedown", b), () => {
64
- document.removeEventListener("keydown", m), document.removeEventListener("mousedown", b);
103
+ return document.addEventListener("keydown", y), document.addEventListener("mousedown", T), () => {
104
+ document.removeEventListener("keydown", y), document.removeEventListener("mousedown", T);
65
105
  };
66
106
  }, []);
67
- const B = (() => {
68
- if (s) return { cells: [], dows: [] };
69
- const m = l.from(`${w}-${L(k + 1)}-01`), b = (l.dayOfWeek(m) - c + 7) % 7, C = l.subtract(m, { days: b }), K = Array.from({ length: 42 }, (W, it) => l.toDate(l.add(C, { days: it }))), dt = K.slice(0, 7).map((W) => nt.format(W));
70
- return { cells: K, dows: dt };
107
+ const Q = (() => {
108
+ if (v) return { cells: [], dows: [] };
109
+ const y = s.from(`${p}-${B(S + 1)}-01`), T = (s.dayOfWeek(y) - c + 7) % 7, O = s.subtract(y, { days: T }), rt = Array.from({ length: 42 }, (nt, ft) => s.toDate(s.add(O, { days: ft }))), yt = rt.slice(0, 7).map((nt) => M.format(nt));
110
+ return { cells: rt, dows: yt };
71
111
  })();
72
- return /* @__PURE__ */ v("div", { "data-rsv": "toolbar-wrap", class: $((U = e.classNames) == null ? void 0 : U.toolbar), ref: h, children: [
73
- /* @__PURE__ */ v("div", { "data-rsv": "toolbar", children: [
74
- /* @__PURE__ */ n("div", { "data-rsv": "toolbar-section", "data-rsv-area": "start", children: i }),
75
- /* @__PURE__ */ v("div", { "data-rsv": "toolbar-section", "data-rsv-area": "nav", children: [
76
- /* @__PURE__ */ n(
112
+ return /* @__PURE__ */ g("div", { "data-rsv": "toolbar-wrap", class: F((et = n.classNames) == null ? void 0 : et.toolbar), ref: l, children: [
113
+ /* @__PURE__ */ g("div", { "data-rsv": "toolbar", children: [
114
+ /* @__PURE__ */ d("div", { "data-rsv": "toolbar-section", "data-rsv-area": "start", children: a }),
115
+ /* @__PURE__ */ g("div", { "data-rsv": "toolbar-section", "data-rsv-area": "nav", children: [
116
+ /* @__PURE__ */ d(
77
117
  "button",
78
118
  {
79
119
  type: "button",
80
120
  "data-rsv": "button",
81
- title: o.today,
82
- "aria-label": o.today,
83
- onClick: () => a.today(),
121
+ title: o.todayHint,
122
+ "aria-label": o.todayHint,
123
+ onClick: () => r.today(),
84
124
  children: o.today
85
125
  }
86
126
  ),
87
- /* @__PURE__ */ n(
127
+ /* @__PURE__ */ d(
88
128
  "button",
89
129
  {
90
130
  type: "button",
91
131
  "data-rsv": "button",
92
132
  "data-rsv-nav": "prev",
93
- title: o.prev,
94
- "aria-label": o.prev,
95
- onClick: () => a.prev(),
96
- children: I.prev
133
+ title: o.prevHint,
134
+ "aria-label": o.prevHint,
135
+ onClick: () => r.prev(),
136
+ children: G.prev
97
137
  }
98
138
  ),
99
- /* @__PURE__ */ v("div", { "data-rsv": "datepicker-anchor", children: [
100
- /* @__PURE__ */ v(
139
+ /* @__PURE__ */ g("div", { "data-rsv": "datepicker-anchor", children: [
140
+ /* @__PURE__ */ g(
101
141
  "button",
102
142
  {
103
143
  type: "button",
104
144
  "data-rsv": "title",
105
145
  "aria-haspopup": "dialog",
106
- "aria-expanded": g,
146
+ "aria-expanded": f,
107
147
  title: `${t} · Ctrl+M`,
108
- onClick: () => g ? f(!1) : N(),
148
+ onClick: () => f ? b(!1) : x(),
109
149
  children: [
110
- /* @__PURE__ */ n(ft, {}),
150
+ /* @__PURE__ */ d(Lt, {}),
111
151
  t
112
152
  ]
113
153
  }
114
154
  ),
115
- g && /* @__PURE__ */ v(
155
+ f && /* @__PURE__ */ g(
116
156
  "div",
117
157
  {
118
158
  "data-rsv": "datepicker",
119
- "data-rsv-mode": s ? "month" : "day",
159
+ "data-rsv-mode": v ? "month" : "day",
120
160
  role: "dialog",
121
161
  "aria-label": t,
122
162
  children: [
123
- /* @__PURE__ */ v("div", { "data-rsv": "dp-head", children: [
124
- /* @__PURE__ */ n(
163
+ /* @__PURE__ */ g("div", { "data-rsv": "dp-head", children: [
164
+ /* @__PURE__ */ d(
125
165
  "button",
126
166
  {
127
167
  type: "button",
128
168
  "data-rsv": "dp-nav",
129
169
  "aria-label": o.prev,
130
- onClick: () => s ? D((m) => m - 1) : H(-1),
131
- children: I.prev
170
+ onClick: () => v ? m((y) => y - 1) : I(-1),
171
+ children: G.prev
132
172
  }
133
173
  ),
134
- /* @__PURE__ */ n("span", { "data-rsv": "dp-label", children: s ? w : `${at.format(new Date(w, k, 1))} ${w}` }),
135
- /* @__PURE__ */ n(
174
+ /* @__PURE__ */ d("span", { "data-rsv": "dp-label", children: v ? p : `${C.format(new Date(p, S, 1))} ${p}` }),
175
+ /* @__PURE__ */ d(
136
176
  "button",
137
177
  {
138
178
  type: "button",
139
179
  "data-rsv": "dp-nav",
140
180
  "aria-label": o.next,
141
- onClick: () => s ? D((m) => m + 1) : H(1),
142
- children: I.next
181
+ onClick: () => v ? m((y) => y + 1) : I(1),
182
+ children: G.next
143
183
  }
144
184
  )
145
185
  ] }),
146
- s ? /* @__PURE__ */ n("div", { "data-rsv": "dp-grid", children: ot.map((m, b) => /* @__PURE__ */ n(
186
+ v ? /* @__PURE__ */ d("div", { "data-rsv": "dp-grid", children: E.map((y, T) => /* @__PURE__ */ d(
147
187
  "button",
148
188
  {
149
189
  type: "button",
150
190
  "data-rsv": "dp-month",
151
191
  "data-active": String(
152
- w === p.getFullYear() && b === p.getMonth()
192
+ p === k.getFullYear() && T === k.getMonth()
153
193
  ),
154
194
  "data-today": String(
155
- w === y.getFullYear() && b === y.getMonth()
195
+ p === w.getFullYear() && T === w.getMonth()
156
196
  ),
157
- onClick: () => V(`${w}-${L(b + 1)}-01`),
158
- children: m
197
+ onClick: () => P(`${p}-${B(T + 1)}-01`),
198
+ children: y
159
199
  },
160
- m
161
- )) }) : /* @__PURE__ */ v("div", { "data-rsv": "dp-days", children: [
162
- B.dows.map((m, b) => /* @__PURE__ */ n("div", { "data-rsv": "dp-dow", children: m }, `dow-${b}`)),
163
- B.cells.map((m) => {
164
- const b = `${m.getFullYear()}-${L(m.getMonth() + 1)}-${L(m.getDate())}`;
165
- return /* @__PURE__ */ n(
200
+ y
201
+ )) }) : /* @__PURE__ */ g("div", { "data-rsv": "dp-days", children: [
202
+ Q.dows.map((y, T) => /* @__PURE__ */ d("div", { "data-rsv": "dp-dow", children: y }, `dow-${T}`)),
203
+ Q.cells.map((y) => {
204
+ const T = `${y.getFullYear()}-${B(y.getMonth() + 1)}-${B(y.getDate())}`;
205
+ return /* @__PURE__ */ d(
166
206
  "button",
167
207
  {
168
208
  type: "button",
169
209
  "data-rsv": "dp-day",
170
- "data-other": String(m.getMonth() !== k),
210
+ "data-other": String(y.getMonth() !== S),
171
211
  "data-active": String(
172
- m.getFullYear() === p.getFullYear() && m.getMonth() === p.getMonth() && m.getDate() === p.getDate()
212
+ y.getFullYear() === k.getFullYear() && y.getMonth() === k.getMonth() && y.getDate() === k.getDate()
173
213
  ),
174
214
  "data-today": String(
175
- m.getFullYear() === y.getFullYear() && m.getMonth() === y.getMonth() && m.getDate() === y.getDate()
215
+ y.getFullYear() === w.getFullYear() && y.getMonth() === w.getMonth() && y.getDate() === w.getDate()
176
216
  ),
177
- onClick: () => V(b),
178
- children: m.getDate()
217
+ onClick: () => P(T),
218
+ children: y.getDate()
179
219
  },
180
- b
220
+ T
181
221
  );
182
222
  })
183
223
  ] })
@@ -185,233 +225,319 @@ function bt({ api: a, title: t, activeView: r, options: e }) {
185
225
  }
186
226
  )
187
227
  ] }),
188
- /* @__PURE__ */ n(
228
+ /* @__PURE__ */ d(
189
229
  "button",
190
230
  {
191
231
  type: "button",
192
232
  "data-rsv": "button",
193
233
  "data-rsv-nav": "next",
194
- title: o.next,
195
- "aria-label": o.next,
196
- onClick: () => a.next(),
197
- children: I.next
234
+ title: o.nextHint,
235
+ "aria-label": o.nextHint,
236
+ onClick: () => r.next(),
237
+ children: G.next
198
238
  }
199
239
  )
200
240
  ] }),
201
- /* @__PURE__ */ v("div", { "data-rsv": "toolbar-section", "data-rsv-area": "end", children: [
202
- u,
203
- e.onAddClick && /* @__PURE__ */ v(
241
+ /* @__PURE__ */ g("div", { "data-rsv": "toolbar-section", "data-rsv-area": "end", children: [
242
+ h,
243
+ n.onAddClick && /* @__PURE__ */ g(
204
244
  "button",
205
245
  {
206
246
  type: "button",
207
247
  "data-rsv": "button",
208
248
  "data-rsv-variant": "primary",
209
- onClick: e.onAddClick,
249
+ onClick: n.onAddClick,
210
250
  children: [
211
- /* @__PURE__ */ n("span", { "data-rsv": "add-icon", "aria-hidden": "true", children: "+" }),
212
- e.addButtonText
251
+ /* @__PURE__ */ d("span", { "data-rsv": "add-icon", "aria-hidden": "true", children: "+" }),
252
+ n.addButtonText
213
253
  ]
214
254
  }
215
255
  )
216
256
  ] })
217
257
  ] }),
218
- d.length > 0 && /* @__PURE__ */ n("div", { "data-rsv": "toolbar-views", role: "tablist", children: d.map((m) => /* @__PURE__ */ n(
258
+ u.length > 0 && /* @__PURE__ */ d("div", { "data-rsv": "toolbar-views", role: "tablist", children: u.map((y) => /* @__PURE__ */ d(
219
259
  "button",
220
260
  {
221
261
  type: "button",
222
262
  "data-rsv": "view-tab",
223
263
  role: "tab",
224
- "aria-selected": m === r,
225
- "data-active": String(m === r),
226
- onClick: () => a.changeView(m),
227
- children: o.views[m] ?? m
264
+ "aria-selected": y === e,
265
+ "data-active": String(y === e),
266
+ title: o.viewHint(o.views[y] ?? y),
267
+ onClick: () => r.changeView(y),
268
+ children: o.views[y] ?? y
228
269
  },
229
- m
270
+ y
230
271
  )) })
231
272
  ] });
232
273
  }
233
- function J(a, t) {
234
- a.trigger("navLinkDay", { date: t });
235
- const r = a.hasView("timeGridDay") ? "timeGridDay" : a.hasView("dayGridDay") ? "dayGridDay" : null;
236
- r && (a.gotoDate(l.toISOString(t)), a.changeView(r));
274
+ function U(r) {
275
+ return r < 10 ? `0${r}` : String(r);
276
+ }
277
+ function It(r) {
278
+ const t = (Math.round(r) % 1440 + 1440) % 1440;
279
+ return `${U(Math.floor(t / 60))}:${U(t % 60)}`;
280
+ }
281
+ function At(r) {
282
+ const t = Math.max(0, Math.round(r));
283
+ return `${U(Math.floor(t / 60))}:${U(t % 60)}:00`;
284
+ }
285
+ function X(r, t) {
286
+ if (!t) return null;
287
+ const e = new Intl.DateTimeFormat(r, t);
288
+ return (n) => e.format(n);
289
+ }
290
+ function W(r, t, e) {
291
+ if (t === !1) return null;
292
+ const n = new Intl.DateTimeFormat(r, t ?? e);
293
+ return (o) => n.format(o);
294
+ }
295
+ function st(r, t) {
296
+ r.trigger("navLinkDay", { date: t });
297
+ const e = r.hasView("timeGridDay") ? "timeGridDay" : r.hasView("dayGridDay") ? "dayGridDay" : null;
298
+ e && (r.gotoDate(s.toISOString(t)), r.changeView(e));
299
+ }
300
+ const _ = 1440, Ht = {
301
+ moveLeft: ["ArrowLeft"],
302
+ moveRight: ["ArrowRight"],
303
+ moveUp: ["ArrowUp"],
304
+ moveDown: ["ArrowDown"],
305
+ activate: ["Enter", " "]
306
+ };
307
+ function Nt(r, t) {
308
+ const e = Object.entries(Ht);
309
+ for (const [n, o] of e)
310
+ if (((t == null ? void 0 : t[n]) ?? o).includes(r)) return n;
311
+ return null;
237
312
  }
238
- const O = 1440;
239
- function Q(a, t) {
240
- const { api: r, event: e, kind: o } = t, i = z(t.snap ?? "00:30");
313
+ function lt(r, t) {
314
+ const { api: e, event: n, kind: o } = t, a = K(t.snap ?? "00:30"), h = Nt(r.key, t.shortcuts);
315
+ if (!h) return;
316
+ if (h === "activate") {
317
+ r.preventDefault(), e.trigger("eventClick", { event: n });
318
+ return;
319
+ }
241
320
  let u = 0;
242
- switch (a.key) {
243
- case "ArrowLeft":
244
- u = -O;
321
+ switch (h) {
322
+ case "moveLeft":
323
+ u = -_;
245
324
  break;
246
- case "ArrowRight":
247
- u = O;
325
+ case "moveRight":
326
+ u = _;
248
327
  break;
249
- case "ArrowUp":
250
- u = o === "timeGrid" ? -i : -O * 7;
328
+ case "moveUp":
329
+ u = o === "timeGrid" ? -a : -_ * 7;
251
330
  break;
252
- case "ArrowDown":
253
- u = o === "timeGrid" ? i : O * 7;
331
+ case "moveDown":
332
+ u = o === "timeGrid" ? a : _ * 7;
254
333
  break;
255
- case "Enter":
256
- case " ":
257
- a.preventDefault(), r.trigger("eventClick", { event: e });
258
- return;
259
- default:
260
- return;
261
334
  }
262
- a.preventDefault();
263
- const d = A(e.start, e.end, u, l);
264
- if (r.moveEvent(e.id, d.start, d.end)) {
265
- const s = r.getEventById(e.id);
266
- s && r.trigger("eventDrop", { event: s });
335
+ r.preventDefault();
336
+ const v = J(n.start, n.end, u, s);
337
+ if (e.moveEvent(n.id, v.start, v.end)) {
338
+ const c = e.getEventById(n.id);
339
+ c && e.trigger("eventDrop", { event: c });
267
340
  }
268
341
  }
269
- const wt = 1440, Dt = 4;
270
- function Z(a, t) {
271
- var e;
272
- const r = document.elementFromPoint(a, t);
273
- return ((e = r == null ? void 0 : r.closest('[data-rsv="day"]')) == null ? void 0 : e.dataset.date) ?? null;
274
- }
275
- function kt(a, t) {
276
- a.stopPropagation();
277
- const { api: r, event: e, sourceDate: o } = t, i = a.clientX, u = a.clientY;
278
- let d = !1;
279
- const s = (h) => {
280
- !d && Math.hypot(h.clientX - i, h.clientY - u) > Dt && (d = !0, document.body.style.cursor = "grabbing");
281
- }, c = (h) => {
282
- var y;
283
- if (document.removeEventListener("pointermove", s), document.removeEventListener("pointerup", c), document.body.style.cursor = "", !d) return;
284
- (y = t.onMoved) == null || y.call(t);
285
- const g = Z(h.clientX, h.clientY);
286
- if (!g) return;
287
- const f = l.diff(l.from(o), l.from(g), "day");
288
- if (f === 0) return;
289
- const p = A(e.start, e.end, f * wt, l);
290
- if (r.moveEvent(e.id, p.start, p.end)) {
291
- const w = r.getEventById(e.id);
292
- w && r.trigger("eventDrop", { event: w });
342
+ const Vt = 1440, Yt = 4;
343
+ function ct(r, t) {
344
+ var n;
345
+ const e = document.elementFromPoint(r, t);
346
+ return ((n = e == null ? void 0 : e.closest('[data-rsv="day"]')) == null ? void 0 : n.dataset.date) ?? null;
347
+ }
348
+ function Gt(r, t) {
349
+ r.stopPropagation();
350
+ const { api: e, event: n, sourceDate: o } = t, a = r.clientX, h = r.clientY;
351
+ let u = !1;
352
+ const v = (l) => {
353
+ !u && Math.hypot(l.clientX - a, l.clientY - h) > Yt && (u = !0, document.body.style.cursor = "grabbing");
354
+ }, c = (l) => {
355
+ var w;
356
+ if (document.removeEventListener("pointermove", v), document.removeEventListener("pointerup", c), document.body.style.cursor = "", !u) return;
357
+ (w = t.onMoved) == null || w.call(t);
358
+ const f = ct(l.clientX, l.clientY);
359
+ if (!f) return;
360
+ const b = s.diff(s.from(o), s.from(f), "day");
361
+ if (b === 0) return;
362
+ const k = J(n.start, n.end, b * Vt, s);
363
+ if (e.moveEvent(n.id, k.start, k.end)) {
364
+ const p = e.getEventById(n.id);
365
+ p && e.trigger("eventDrop", { event: p });
293
366
  }
294
367
  };
295
- document.addEventListener("pointermove", s), document.addEventListener("pointerup", c);
368
+ document.addEventListener("pointermove", v), document.addEventListener("pointerup", c);
296
369
  }
297
- function Ct(a, t) {
298
- if (a.target.closest('[data-rsv="event"], [data-rsv="more-anchor"], [data-nav-link="true"]'))
370
+ function Bt(r, t) {
371
+ if (r.target.closest('[data-rsv="event"], [data-rsv="more-anchor"], [data-nav-link="true"]'))
299
372
  return;
300
- const { api: e } = t;
301
- let o = t.startDate, i = !1;
302
- const u = (s) => {
303
- const c = Z(s.clientX, s.clientY);
304
- c && c !== t.startDate && (i = !0), c && (o = c);
305
- }, d = () => {
306
- var f;
307
- if (document.removeEventListener("pointermove", u), document.removeEventListener("pointerup", d), !i) return;
308
- (f = t.onRangeSelect) == null || f.call(t);
309
- const s = l.from(t.startDate), c = l.from(o), [h, g] = l.isBefore(s, c) ? [s, c] : [c, s];
310
- e.select(l.toISOString(h), l.toISOString(l.add(g, { days: 1 })));
373
+ const { api: n } = t;
374
+ let o = t.startDate, a = !1;
375
+ const h = (v) => {
376
+ const c = ct(v.clientX, v.clientY);
377
+ c && c !== t.startDate && (a = !0), c && (o = c);
378
+ }, u = () => {
379
+ var b;
380
+ if (document.removeEventListener("pointermove", h), document.removeEventListener("pointerup", u), !a) return;
381
+ (b = t.onRangeSelect) == null || b.call(t);
382
+ const v = s.from(t.startDate), c = s.from(o), [l, f] = s.isBefore(v, c) ? [v, c] : [c, v];
383
+ n.select(s.toISOString(l), s.toISOString(s.add(f, { days: 1 })));
311
384
  };
312
- document.addEventListener("pointermove", u), document.addEventListener("pointerup", d);
385
+ document.addEventListener("pointermove", h), document.addEventListener("pointerup", u);
313
386
  }
314
- function tt({ api: a, model: t, options: r }) {
315
- var d;
316
- const e = r.locale ?? "en", o = new Intl.DateTimeFormat(e, { weekday: "short" }), i = ((d = t.weeks[0]) == null ? void 0 : d.days) ?? [], u = r.weekNumbers === !0;
317
- return /* @__PURE__ */ v(
387
+ function ut({ api: r, model: t, options: e }) {
388
+ var v;
389
+ const n = e.locale ?? "en", o = { type: r.getView().type }, a = W(n, e.dayHeaderFormat, { weekday: "short" }), h = ((v = t.weeks[0]) == null ? void 0 : v.days) ?? [], u = e.weekNumbers === !0;
390
+ return /* @__PURE__ */ g(
318
391
  "div",
319
392
  {
320
393
  "data-rsv": "daygrid",
321
394
  "data-weeknumbers": String(u),
322
395
  style: `--rsv-cols:${t.columnCount}`,
323
396
  children: [
324
- /* @__PURE__ */ v("div", { "data-rsv": "daygrid-header", role: "row", children: [
325
- u && /* @__PURE__ */ n("div", { "data-rsv": "daygrid-weeknum-header", role: "columnheader" }),
326
- i.map((s) => {
327
- var g;
328
- const c = l.toDate(s.date), h = o.format(c);
329
- return /* @__PURE__ */ n("div", { "data-rsv": "daygrid-dow", role: "columnheader", children: x((g = r.slots) == null ? void 0 : g.dayHeaderContent, { date: c, text: h }, h) }, s.dayOfWeek);
397
+ /* @__PURE__ */ g("div", { "data-rsv": "daygrid-header", role: "row", children: [
398
+ u && /* @__PURE__ */ d("div", { "data-rsv": "daygrid-weeknum-header", role: "columnheader" }),
399
+ h.map((c) => {
400
+ var k, w;
401
+ const l = s.toDate(c.date), f = a ? a(l) : "", b = {
402
+ date: l,
403
+ text: f,
404
+ dayOfWeek: c.dayOfWeek,
405
+ dayNumber: s.dayOfMonth(c.date),
406
+ isToday: c.isToday,
407
+ view: o
408
+ };
409
+ return /* @__PURE__ */ d(
410
+ "div",
411
+ {
412
+ "data-rsv": "daygrid-dow",
413
+ role: "columnheader",
414
+ "data-dow": String(c.dayOfWeek),
415
+ class: F((k = e.classNames) == null ? void 0 : k.dayHeader),
416
+ ref: (p) => {
417
+ var m;
418
+ return A(p, (m = e.hooks) == null ? void 0 : m.dayHeaderDidMount, () => b);
419
+ },
420
+ children: L((w = e.slots) == null ? void 0 : w.dayHeaderContent, b, f, e.hostBridge)
421
+ },
422
+ c.dayOfWeek
423
+ );
330
424
  })
331
425
  ] }),
332
- t.weeks.map((s, c) => /* @__PURE__ */ v("div", { "data-rsv": "daygrid-week", role: "row", children: [
333
- u && /* @__PURE__ */ n("div", { "data-rsv": "daygrid-weeknum", role: "rowheader", children: s.weekNumber }),
334
- s.days.map((h) => /* @__PURE__ */ n(St, { api: a, cell: h, options: r }, l.toISOString(h.date)))
335
- ] }, c))
426
+ t.weeks.map((c, l) => /* @__PURE__ */ g("div", { "data-rsv": "daygrid-week", role: "row", children: [
427
+ u && /* @__PURE__ */ d("div", { "data-rsv": "daygrid-weeknum", role: "rowheader", children: c.weekNumber }),
428
+ c.days.map((f) => /* @__PURE__ */ d(
429
+ _t,
430
+ {
431
+ api: r,
432
+ cell: f,
433
+ options: e,
434
+ view: o
435
+ },
436
+ s.toISOString(f.date)
437
+ ))
438
+ ] }, l))
336
439
  ]
337
440
  }
338
441
  );
339
442
  }
340
- function St({
341
- api: a,
443
+ function _t({
444
+ api: r,
342
445
  cell: t,
343
- options: r
446
+ options: e,
447
+ view: n
344
448
  }) {
345
- var p;
346
- const e = l.toDate(t.date), o = l.dayOfMonth(t.date), i = r.navLinks ? /* @__PURE__ */ n(
449
+ var p, m, S;
450
+ const o = s.toDate(t.date), a = s.dayOfMonth(t.date), h = e.navLinks ? /* @__PURE__ */ d(
347
451
  "a",
348
452
  {
349
453
  "data-rsv": "day-number",
350
454
  "data-nav-link": "true",
351
455
  role: "link",
352
456
  tabIndex: 0,
353
- onClick: (y) => {
354
- y.stopPropagation(), J(a, t.date);
457
+ title: R(e.locale).navLinkHint(
458
+ new Intl.DateTimeFormat(e.locale, { dateStyle: "long" }).format(o)
459
+ ),
460
+ onClick: (i) => {
461
+ i.stopPropagation(), st(r, t.date);
355
462
  },
356
- children: o
463
+ children: a
357
464
  }
358
- ) : /* @__PURE__ */ n("span", { "data-rsv": "day-number", children: o }), u = x(
359
- (p = r.slots) == null ? void 0 : p.dayCellContent,
360
- { date: e, dayNumber: o, isToday: t.isToday, isOther: t.isOther },
361
- i
362
- ), [d, s] = R(!1), c = l.toISOString(t.date), h = F(!1), g = () => {
363
- if (h.current) {
364
- h.current = !1;
465
+ ) : /* @__PURE__ */ d("span", { "data-rsv": "day-number", children: a }), u = { date: o, dayNumber: a, isToday: t.isToday, isOther: t.isOther, view: n }, v = L(
466
+ (p = e.slots) == null ? void 0 : p.dayCellContent,
467
+ u,
468
+ h,
469
+ e.hostBridge
470
+ ), [c, l] = N(!1), f = s.toISOString(t.date), b = $(!1), k = () => {
471
+ if (b.current) {
472
+ b.current = !1;
365
473
  return;
366
474
  }
367
- a.trigger("dateClick", { date: t.date }), r.selectable && a.select(c, l.toISOString(l.add(t.date, { days: 1 })));
368
- }, f = (y) => {
369
- y.stopPropagation(), s(!0), a.trigger("moreLinkClick", {
475
+ r.trigger("dateClick", { date: t.date }), e.selectable && r.select(f, s.toISOString(s.add(t.date, { days: 1 })));
476
+ }, w = (i) => {
477
+ i.stopPropagation(), l(!0), r.trigger("moreLinkClick", {
370
478
  date: t.date,
371
479
  allEvents: [...t.events, ...t.hiddenEvents],
372
480
  hiddenEvents: t.hiddenEvents
373
481
  });
374
482
  };
375
- return /* @__PURE__ */ v(
483
+ return /* @__PURE__ */ g(
376
484
  "div",
377
485
  {
378
486
  "data-rsv": "day",
379
487
  role: "gridcell",
380
- "data-date": c,
488
+ "data-date": f,
381
489
  "data-today": String(t.isToday),
382
490
  "data-other": String(t.isOther),
383
491
  "data-weekend": String(t.isWeekend),
384
492
  "data-business": String(t.isBusiness),
385
493
  "data-selected": String(t.isSelected),
386
- onClick: g,
387
- onPointerDown: r.selectable ? (y) => Ct(y, {
388
- api: a,
389
- startDate: c,
494
+ class: F((m = e.classNames) == null ? void 0 : m.day),
495
+ ref: (i) => {
496
+ var D;
497
+ return A(i, (D = e.hooks) == null ? void 0 : D.dayCellDidMount, () => u);
498
+ },
499
+ onClick: k,
500
+ onPointerDown: e.selectable ? (i) => Bt(i, {
501
+ api: r,
502
+ startDate: f,
390
503
  onRangeSelect: () => {
391
- h.current = !0;
504
+ b.current = !0;
392
505
  }
393
506
  }) : void 0,
394
507
  children: [
395
- u,
396
- t.events.filter((y) => y.display !== "none").map((y) => /* @__PURE__ */ n(
397
- et,
508
+ v,
509
+ t.events.filter((i) => i.display !== "none").map((i) => /* @__PURE__ */ d(
510
+ vt,
398
511
  {
399
- api: a,
400
- event: y,
401
- options: r,
402
- sourceDate: c
512
+ api: r,
513
+ event: i,
514
+ options: e,
515
+ view: n,
516
+ sourceDate: f
403
517
  },
404
- y.id
518
+ i.id
405
519
  )),
406
- t.moreCount > 0 && /* @__PURE__ */ v("div", { "data-rsv": "more-anchor", children: [
407
- /* @__PURE__ */ n("button", { type: "button", "data-rsv": "more-link", onClick: f, children: E(r.locale).more(t.moreCount) }),
408
- d && /* @__PURE__ */ n(
409
- xt,
520
+ t.moreCount > 0 && /* @__PURE__ */ g("div", { "data-rsv": "more-anchor", children: [
521
+ /* @__PURE__ */ d("button", { type: "button", "data-rsv": "more-link", onClick: w, children: L(
522
+ (S = e.slots) == null ? void 0 : S.moreLinkContent,
410
523
  {
411
- api: a,
524
+ date: o,
525
+ moreCount: t.moreCount,
526
+ allEvents: [...t.events, ...t.hiddenEvents],
527
+ hiddenEvents: t.hiddenEvents,
528
+ view: n
529
+ },
530
+ R(e.locale).more(t.moreCount),
531
+ e.hostBridge
532
+ ) }),
533
+ c && /* @__PURE__ */ d(
534
+ jt,
535
+ {
536
+ api: r,
412
537
  cell: t,
413
- options: r,
414
- onClose: () => s(!1)
538
+ options: e,
539
+ view: n,
540
+ onClose: () => l(!1)
415
541
  }
416
542
  )
417
543
  ] })
@@ -419,287 +545,463 @@ function St({
419
545
  }
420
546
  );
421
547
  }
422
- function xt({
423
- api: a,
548
+ function jt({
549
+ api: r,
424
550
  cell: t,
425
- options: r,
426
- onClose: e
551
+ options: e,
552
+ view: n,
553
+ onClose: o
427
554
  }) {
428
- const o = F(null), i = new Intl.DateTimeFormat(r.locale ?? "en", {
555
+ const a = $(null), h = new Intl.DateTimeFormat(e.locale ?? "en", {
429
556
  weekday: "long",
430
557
  day: "numeric",
431
558
  month: "long"
432
- }), u = [...t.events, ...t.hiddenEvents].filter((d) => d.display !== "none");
433
- return q(() => {
434
- const d = (c) => {
435
- o.current && !o.current.contains(c.target) && e();
436
- }, s = (c) => {
437
- c.key === "Escape" && e();
559
+ }), u = [...t.events, ...t.hiddenEvents].filter((v) => v.display !== "none");
560
+ return H(() => {
561
+ const v = (l) => {
562
+ a.current && !a.current.contains(l.target) && o();
563
+ }, c = (l) => {
564
+ l.key === "Escape" && o();
438
565
  };
439
- return document.addEventListener("mousedown", d), document.addEventListener("keydown", s), () => {
440
- document.removeEventListener("mousedown", d), document.removeEventListener("keydown", s);
566
+ return document.addEventListener("mousedown", v), document.addEventListener("keydown", c), () => {
567
+ document.removeEventListener("mousedown", v), document.removeEventListener("keydown", c);
441
568
  };
442
- }, [e]), /* @__PURE__ */ v("div", { "data-rsv": "more-popover", role: "dialog", ref: o, onClick: (d) => d.stopPropagation(), children: [
443
- /* @__PURE__ */ v("div", { "data-rsv": "more-popover-header", children: [
444
- /* @__PURE__ */ n("span", { "data-rsv": "more-popover-title", children: i.format(l.toDate(t.date)) }),
445
- /* @__PURE__ */ n("button", { type: "button", "data-rsv": "more-popover-close", "aria-label": "✕", onClick: e, children: "✕" })
569
+ }, [o]), /* @__PURE__ */ g("div", { "data-rsv": "more-popover", role: "dialog", ref: a, onClick: (v) => v.stopPropagation(), children: [
570
+ /* @__PURE__ */ g("div", { "data-rsv": "more-popover-header", children: [
571
+ /* @__PURE__ */ d("span", { "data-rsv": "more-popover-title", children: h.format(s.toDate(t.date)) }),
572
+ /* @__PURE__ */ d("button", { type: "button", "data-rsv": "more-popover-close", "aria-label": "✕", onClick: o, children: "✕" })
446
573
  ] }),
447
- /* @__PURE__ */ n("div", { "data-rsv": "more-popover-body", children: u.map((d) => /* @__PURE__ */ n(
448
- et,
574
+ /* @__PURE__ */ d("div", { "data-rsv": "more-popover-body", children: u.map((v) => /* @__PURE__ */ d(
575
+ vt,
449
576
  {
450
- api: a,
451
- event: d,
452
- options: r,
453
- sourceDate: l.toISOString(t.date)
577
+ api: r,
578
+ event: v,
579
+ options: e,
580
+ view: n,
581
+ sourceDate: s.toISOString(t.date)
454
582
  },
455
- d.id
583
+ v.id
456
584
  )) })
457
585
  ] });
458
586
  }
459
- function et({
460
- api: a,
587
+ function vt({
588
+ api: r,
461
589
  event: t,
462
- options: r,
463
- sourceDate: e
590
+ options: e,
591
+ view: n,
592
+ sourceDate: o
464
593
  }) {
465
- var s;
466
- const o = r.editable === !0 && t.editable !== !1, i = F(!1), u = t.allDay ? "" : l.format(t.start, "HH:mm"), d = x(
467
- (s = r.slots) == null ? void 0 : s.eventContent,
468
- { event: t, isAllDay: t.allDay, timeText: u },
469
- /* @__PURE__ */ v("span", { "data-rsv": "event-title", children: [
470
- u ? `${u} ` : "",
594
+ var b, k;
595
+ const a = e.editable === !0 && t.editable !== !1, h = r.selectedEventIds.value.has(t.id), u = $(!1), v = X(e.locale ?? "en", e.eventTimeFormat), c = t.allDay ? "" : v ? v(s.toDate(t.start)) : s.format(t.start, "HH:mm"), l = { event: t, isAllDay: t.allDay, timeText: c, view: n }, f = L(
596
+ (b = e.slots) == null ? void 0 : b.eventContent,
597
+ l,
598
+ /* @__PURE__ */ g("span", { "data-rsv": "event-title", children: [
599
+ c ? `${c} ` : "",
471
600
  t.title
472
- ] })
601
+ ] }),
602
+ e.hostBridge
473
603
  );
474
- return /* @__PURE__ */ n(
604
+ return /* @__PURE__ */ d(
475
605
  "div",
476
606
  {
477
607
  "data-rsv": "event",
478
608
  role: "button",
479
609
  tabIndex: 0,
480
- class: $(...t.classNames),
610
+ class: F((k = e.classNames) == null ? void 0 : k.event, ...t.classNames),
481
611
  "data-all-day": String(t.allDay),
482
612
  "data-display": t.display,
483
613
  "data-event-id": t.id,
484
- "data-editable": String(o),
485
- style: `--rsv-event-bg:${t.backgroundColor};--rsv-event-fg:${t.textColor}`,
486
- onClick: (c) => {
487
- if (c.stopPropagation(), i.current) {
488
- i.current = !1;
614
+ "data-editable": String(a),
615
+ "data-rsv-selected": String(h),
616
+ ref: (w) => {
617
+ var p;
618
+ return A(w, (p = e.hooks) == null ? void 0 : p.eventDidMount, () => l);
619
+ },
620
+ style: `--rsv-event-bg:${t.backgroundColor};--rsv-event-fg:${t.textColor};--rsv-event-border:${t.borderColor}`,
621
+ onClick: (w) => {
622
+ if (w.stopPropagation(), u.current) {
623
+ u.current = !1;
624
+ return;
625
+ }
626
+ if (w.ctrlKey || w.metaKey) {
627
+ r.toggleEventSelection(t.id);
489
628
  return;
490
629
  }
491
- a.trigger("eventClick", { event: t }), t.url && window.open(t.url, "_self");
630
+ r.trigger("eventClick", { event: t, el: w.currentTarget }), t.url && window.open(t.url, "_self");
492
631
  },
493
- onPointerDown: o ? (c) => kt(c, {
494
- api: a,
632
+ onPointerDown: a ? (w) => Gt(w, {
633
+ api: r,
495
634
  event: t,
496
- sourceDate: e,
635
+ sourceDate: o,
497
636
  onMoved: () => {
498
- i.current = !0;
637
+ u.current = !0;
499
638
  }
500
639
  }) : void 0,
501
- onKeyDown: o ? (c) => Q(c, { api: a, event: t, kind: "dayGrid" }) : void 0,
502
- children: d
640
+ onKeyDown: a ? (w) => lt(w, {
641
+ api: r,
642
+ event: t,
643
+ kind: "dayGrid",
644
+ shortcuts: e.keyboardShortcuts
645
+ }) : void 0,
646
+ children: f
503
647
  }
504
648
  );
505
649
  }
506
- function G(a, t) {
507
- a.preventDefault(), a.stopPropagation();
508
- const { api: r, event: e, model: o, columnEl: i, snap: u = "00:15", edge: d } = t, s = i.getBoundingClientRect(), c = o.maxMinutes - o.minMinutes, h = s.height === 0 ? 0 : s.height / c, g = a.clientY, f = (p) => {
509
- document.removeEventListener("pointerup", f);
510
- const y = lt(p.clientY - g, h, u);
511
- if (y === 0) return;
512
- const w = d ? ct(e.start, e.end, d, y, l) : A(e.start, e.end, y, l);
513
- if (r.moveEvent(e.id, w.start, w.end)) {
514
- const D = r.getEventById(e.id);
515
- D && r.trigger(d ? "eventResize" : "eventDrop", { event: D });
650
+ const j = 40, it = 16, Kt = {
651
+ update() {
652
+ },
653
+ getScrolled: () => 0,
654
+ stop() {
655
+ }
656
+ };
657
+ function mt(r) {
658
+ if (!r) return Kt;
659
+ let t = 0, e = 0, n = 0;
660
+ const o = () => {
661
+ const a = r.getBoundingClientRect();
662
+ let h = 0;
663
+ if (t < a.top + j ? h = -it * (1 - Math.max(0, t - a.top) / j) : t > a.bottom - j && (h = it * (1 - Math.max(0, a.bottom - t) / j)), h !== 0) {
664
+ const u = r.scrollTop;
665
+ r.scrollTop += h, e += r.scrollTop - u;
666
+ }
667
+ n = requestAnimationFrame(o);
668
+ };
669
+ return n = requestAnimationFrame(o), {
670
+ update(a) {
671
+ t = a;
672
+ },
673
+ getScrolled: () => e,
674
+ stop() {
675
+ cancelAnimationFrame(n);
676
+ }
677
+ };
678
+ }
679
+ function ht(r) {
680
+ return r.closest('[data-rsv="tg-body"]');
681
+ }
682
+ function q(r, t) {
683
+ r.preventDefault(), r.stopPropagation();
684
+ const { api: e, event: n, model: o, columnEl: a, snap: h = "00:15", edge: u } = t, v = a.getBoundingClientRect(), c = o.maxMinutes - o.minMinutes, l = v.height === 0 ? 0 : v.height / c, f = r.clientY, b = mt(ht(a));
685
+ b.update(r.clientY);
686
+ const k = (p) => {
687
+ b.update(p.clientY);
688
+ }, w = (p) => {
689
+ document.removeEventListener("pointermove", k), document.removeEventListener("pointerup", w), b.stop();
690
+ const m = wt(p.clientY - f + b.getScrolled(), l, h);
691
+ if (m === 0) return;
692
+ const S = u ? kt(n.start, n.end, u, m, s) : J(n.start, n.end, m, s);
693
+ if (e.moveEvent(n.id, S.start, S.end)) {
694
+ const i = e.getEventById(n.id);
695
+ i && e.trigger(u ? "eventResize" : "eventDrop", { event: i });
516
696
  }
517
697
  };
518
- document.addEventListener("pointerup", f);
519
- }
520
- function Mt(a, t) {
521
- if (a.target.closest('[data-rsv="event"]')) return;
522
- const { api: r, date: e, model: o, columnEl: i, snap: u = "00:15" } = t, d = i.getBoundingClientRect(), s = o.maxMinutes - o.minMinutes, c = d.height === 0 ? 0 : d.height / s, h = z(u) || 15, g = (k) => {
523
- const S = o.minMinutes + (c === 0 ? 0 : (k - d.top) / c), M = Math.max(o.minMinutes, Math.min(o.maxMinutes, S));
524
- return Math.round(M / h) * h;
525
- }, f = g(a.clientY);
526
- let p = f, y = !1;
527
- const w = (k) => {
528
- const S = g(k.clientY);
529
- S !== f && (y = !0), p = S;
530
- }, D = () => {
531
- if (document.removeEventListener("pointermove", w), document.removeEventListener("pointerup", D), !y) return;
532
- const k = Math.min(f, p), S = Math.max(f, p), M = l.startOf(e, "day");
533
- r.select(
534
- l.toISOString(l.add(M, { minutes: k })),
535
- l.toISOString(l.add(M, { minutes: S }))
698
+ document.addEventListener("pointermove", k), document.addEventListener("pointerup", w);
699
+ }
700
+ function Ut(r, t) {
701
+ if (r.target.closest('[data-rsv="event"]')) return;
702
+ const { api: e, date: n, model: o, columnEl: a, snap: h = "00:15" } = t, u = o.maxMinutes - o.minMinutes, v = K(h) || 15, c = (m) => {
703
+ const S = a.getBoundingClientRect(), i = S.height === 0 ? 0 : S.height / u, D = o.minMinutes + (i === 0 ? 0 : (m - S.top) / i), C = Math.max(o.minMinutes, Math.min(o.maxMinutes, D));
704
+ return Math.round(C / v) * v;
705
+ }, l = c(r.clientY);
706
+ let f = l, b = !1;
707
+ const k = mt(ht(a));
708
+ k.update(r.clientY);
709
+ const w = (m) => {
710
+ var i;
711
+ k.update(m.clientY);
712
+ const S = c(m.clientY);
713
+ S !== l && (b = !0), f = S, b && ((i = t.onPreview) == null || i.call(t, {
714
+ startMin: Math.min(l, f),
715
+ endMin: Math.max(l, f)
716
+ }));
717
+ }, p = () => {
718
+ var D;
719
+ if (document.removeEventListener("pointermove", w), document.removeEventListener("pointerup", p), k.stop(), (D = t.onPreview) == null || D.call(t, null), !b) return;
720
+ const m = Math.min(l, f), S = Math.max(l, f), i = s.startOf(n, "day");
721
+ e.select(
722
+ s.toISOString(s.add(i, { minutes: m })),
723
+ s.toISOString(s.add(i, { minutes: S }))
536
724
  );
537
725
  };
538
- document.addEventListener("pointermove", w), document.addEventListener("pointerup", D);
539
- }
540
- function Et({ api: a, model: t, options: r }) {
541
- const e = r.locale ?? "en", o = new Intl.DateTimeFormat(e, { weekday: "short", day: "numeric" }), i = r.allDaySlot !== !1, u = `calc(var(--spacing-rsv-slot, 2.5rem) * ${t.slots.length})`;
542
- return /* @__PURE__ */ v("div", { "data-rsv": "timegrid", style: `--rsv-tg-days:${t.days.length}`, children: [
543
- /* @__PURE__ */ v("div", { "data-rsv": "tg-header", role: "row", children: [
544
- /* @__PURE__ */ n("div", { "data-rsv": "tg-axis-corner" }),
545
- t.days.map((d) => /* @__PURE__ */ n(
546
- "div",
547
- {
548
- "data-rsv": "tg-col-header",
549
- role: "columnheader",
550
- "data-today": String(d.isToday),
551
- "data-nav-link": r.navLinks ? "true" : void 0,
552
- onClick: r.navLinks ? () => J(a, d.date) : void 0,
553
- children: o.format(l.toDate(d.date))
554
- },
555
- l.toISOString(d.date)
556
- ))
726
+ document.addEventListener("pointermove", w), document.addEventListener("pointerup", p);
727
+ }
728
+ function Wt({ api: r, model: t, options: e }) {
729
+ const n = e.locale ?? "en", o = { type: r.getView().type }, a = W(n, e.dayHeaderFormat, {
730
+ weekday: "short",
731
+ day: "numeric"
732
+ }), h = X(n, e.slotLabelFormat), u = e.allDaySlot !== !1, v = `calc(var(--spacing-rsv-slot, 2.5rem) * ${t.slots.length})`, c = t.maxMinutes - t.minMinutes, l = K(e.snapDuration ?? e.slotDuration ?? "00:15") || 15, f = $(null), b = $(t);
733
+ b.current = t;
734
+ const [k, w] = N(null);
735
+ H(() => {
736
+ const i = f.current;
737
+ if (!i) return;
738
+ const D = {
739
+ scrollToTime(C) {
740
+ const M = b.current, E = M.maxMinutes - M.minMinutes, x = i.scrollHeight;
741
+ if (E <= 0 || x <= 0) return;
742
+ const P = (Math.max(M.minMinutes, Math.min(M.maxMinutes, K(C))) - M.minMinutes) / E * x;
743
+ i.scrollTop = Math.max(0, Math.min(P, x - i.clientHeight));
744
+ },
745
+ getScrollTime() {
746
+ const C = b.current, M = C.maxMinutes - C.minMinutes, E = i.scrollHeight;
747
+ return M <= 0 || E <= 0 ? null : At(C.minMinutes + i.scrollTop / E * M);
748
+ }
749
+ };
750
+ return r.setViewAdapter(D), () => r.setViewAdapter(null);
751
+ }, [r]);
752
+ const p = e.scrollTime;
753
+ H(() => {
754
+ if (!p) return;
755
+ let i = 0;
756
+ const D = requestAnimationFrame(() => {
757
+ i = requestAnimationFrame(() => r.scrollToTime(p));
758
+ });
759
+ return () => {
760
+ cancelAnimationFrame(D), cancelAnimationFrame(i);
761
+ };
762
+ }, [r]);
763
+ const m = (i, D) => {
764
+ const C = i.getBoundingClientRect();
765
+ if (C.height === 0 || c <= 0) return t.minMinutes;
766
+ const M = (D - C.top) / C.height * c, E = Math.floor(Math.max(0, Math.min(c, M)) / l) * l;
767
+ return t.minMinutes + E;
768
+ }, S = t.days[0];
769
+ return /* @__PURE__ */ g("div", { "data-rsv": "timegrid", style: `--rsv-tg-days:${t.days.length}`, children: [
770
+ /* @__PURE__ */ g("div", { "data-rsv": "tg-header", role: "row", children: [
771
+ /* @__PURE__ */ d("div", { "data-rsv": "tg-axis-corner" }),
772
+ t.days.map((i) => {
773
+ var E, x;
774
+ const D = s.toDate(i.date), C = a ? a(D) : "", M = {
775
+ date: D,
776
+ text: C,
777
+ dayOfWeek: s.dayOfWeek(i.date),
778
+ dayNumber: s.dayOfMonth(i.date),
779
+ isToday: i.isToday,
780
+ view: o
781
+ };
782
+ return /* @__PURE__ */ d(
783
+ "div",
784
+ {
785
+ "data-rsv": "tg-col-header",
786
+ role: "columnheader",
787
+ "data-today": String(i.isToday),
788
+ "data-date": s.toISOString(i.date),
789
+ "data-nav-link": e.navLinks ? "true" : void 0,
790
+ class: F((E = e.classNames) == null ? void 0 : E.dayHeader),
791
+ ref: (I) => {
792
+ var P;
793
+ return A(I, (P = e.hooks) == null ? void 0 : P.dayHeaderDidMount, () => M);
794
+ },
795
+ onClick: e.navLinks ? () => st(r, i.date) : void 0,
796
+ children: L((x = e.slots) == null ? void 0 : x.dayHeaderContent, M, C, e.hostBridge)
797
+ },
798
+ s.toISOString(i.date)
799
+ );
800
+ })
557
801
  ] }),
558
- i && /* @__PURE__ */ v("div", { "data-rsv": "tg-allday", role: "row", children: [
559
- /* @__PURE__ */ n("div", { "data-rsv": "tg-axis-label", children: E(r.locale).allDay }),
560
- t.days.map((d) => /* @__PURE__ */ n("div", { "data-rsv": "tg-allday-cell", children: d.allDayEvents.filter((s) => s.display !== "none").map((s) => /* @__PURE__ */ n(
802
+ u && /* @__PURE__ */ g("div", { "data-rsv": "tg-allday", role: "row", children: [
803
+ /* @__PURE__ */ d("div", { "data-rsv": "tg-axis-label", children: R(e.locale).allDay }),
804
+ t.days.map((i) => /* @__PURE__ */ d(
561
805
  "div",
562
806
  {
563
- "data-rsv": "event",
564
- "data-all-day": "true",
565
- class: $(...s.classNames),
566
- "data-display": s.display,
567
- style: `--rsv-event-bg:${s.backgroundColor}`,
568
- onClick: () => {
569
- a.trigger("eventClick", { event: s }), s.url && window.open(s.url, "_self");
570
- },
571
- children: s.title
807
+ "data-rsv": "tg-allday-cell",
808
+ onClick: () => r.trigger("dateClick", { date: i.date, allDay: !0 }),
809
+ children: i.allDayEvents.filter((D) => D.display !== "none").map((D) => {
810
+ var C, M;
811
+ return /* @__PURE__ */ d(
812
+ "div",
813
+ {
814
+ "data-rsv": "event",
815
+ "data-all-day": "true",
816
+ "data-event-id": D.id,
817
+ class: F((C = e.classNames) == null ? void 0 : C.event, ...D.classNames),
818
+ "data-display": D.display,
819
+ style: `--rsv-event-bg:${D.backgroundColor};--rsv-event-fg:${D.textColor};--rsv-event-border:${D.borderColor}`,
820
+ onClick: (E) => {
821
+ E.stopPropagation(), r.trigger("eventClick", { event: D, el: E.currentTarget }), D.url && window.open(D.url, "_self");
822
+ },
823
+ children: L(
824
+ (M = e.slots) == null ? void 0 : M.eventContent,
825
+ { event: D, isAllDay: !0, timeText: "", view: o },
826
+ D.title,
827
+ e.hostBridge
828
+ )
829
+ },
830
+ D.id
831
+ );
832
+ })
572
833
  },
573
- s.id
574
- )) }, l.toISOString(d.date)))
834
+ s.toISOString(i.date)
835
+ ))
575
836
  ] }),
576
- /* @__PURE__ */ v("div", { "data-rsv": "tg-body", children: [
577
- /* @__PURE__ */ n("div", { "data-rsv": "tg-axis", style: `height:${u}`, children: t.slots.map((d) => {
578
- var s;
579
- return /* @__PURE__ */ n("div", { "data-rsv": "tg-slot", "data-major": String(d.isMajor), children: /* @__PURE__ */ n("span", { "data-rsv": "tg-slot-label", children: x(
580
- (s = r.slots) == null ? void 0 : s.slotLabelContent,
581
- { text: d.label, minutes: d.offsetMin, isMajor: d.isMajor },
582
- d.label
583
- ) }) }, d.offsetMin);
837
+ /* @__PURE__ */ g("div", { "data-rsv": "tg-body", ref: f, children: [
838
+ /* @__PURE__ */ d("div", { "data-rsv": "tg-axis", style: `height:${v}`, children: t.slots.map((i) => {
839
+ var E, x;
840
+ const D = t.minMinutes + i.offsetMin;
841
+ let C = "";
842
+ i.isMajor && (C = h && S ? h(s.toDate(s.add(s.startOf(S.date, "day"), { minutes: D }))) : i.label || It(D));
843
+ const M = { text: C, minutes: D, isMajor: i.isMajor, view: o };
844
+ return /* @__PURE__ */ d("div", { "data-rsv": "tg-slot", "data-major": String(i.isMajor), children: /* @__PURE__ */ d(
845
+ "span",
846
+ {
847
+ "data-rsv": "tg-slot-label",
848
+ class: F((E = e.classNames) == null ? void 0 : E.slotLabel),
849
+ ref: (I) => {
850
+ var P;
851
+ return A(I, (P = e.hooks) == null ? void 0 : P.slotLabelDidMount, () => M);
852
+ },
853
+ children: L((x = e.slots) == null ? void 0 : x.slotLabelContent, M, C, e.hostBridge)
854
+ }
855
+ ) }, i.offsetMin);
584
856
  }) }),
585
- t.days.map((d, s) => {
586
- var c;
587
- return /* @__PURE__ */ v(
857
+ t.days.map((i, D) => {
858
+ var C;
859
+ return /* @__PURE__ */ g(
588
860
  "div",
589
861
  {
590
862
  "data-rsv": "tg-col",
591
- "data-today": String(d.isToday),
592
- style: `height:${u}`,
593
- onClick: () => a.trigger("dateClick", { date: d.date }),
594
- onPointerDown: r.selectable ? (h) => Mt(h, {
595
- api: a,
596
- date: d.date,
863
+ "data-today": String(i.isToday),
864
+ "data-date": s.toISOString(i.date),
865
+ style: `height:${v}`,
866
+ onClick: (M) => {
867
+ const E = m(M.currentTarget, M.clientY);
868
+ r.trigger("dateClick", {
869
+ date: s.add(s.startOf(i.date, "day"), { minutes: E }),
870
+ allDay: !1
871
+ });
872
+ },
873
+ onPointerDown: e.selectable ? (M) => Ut(M, {
874
+ api: r,
875
+ date: i.date,
597
876
  model: t,
598
- columnEl: h.currentTarget,
599
- snap: r.snapDuration ?? r.slotDuration
877
+ columnEl: M.currentTarget,
878
+ snap: e.snapDuration ?? e.slotDuration,
879
+ onPreview: e.selectMirror ? (E) => w(
880
+ E ? { dayIndex: D, startMin: E.startMin, endMin: E.endMin } : null
881
+ ) : void 0
600
882
  }) : void 0,
601
883
  children: [
602
- r.businessHours && !d.businessPct && /* @__PURE__ */ n("div", { "data-rsv": "tg-nonbusiness", style: "top:0;height:100%" }),
603
- d.businessPct && /* @__PURE__ */ v(ht, { children: [
604
- /* @__PURE__ */ n("div", { "data-rsv": "tg-nonbusiness", style: `top:0;height:${d.businessPct.topPct}%` }),
605
- /* @__PURE__ */ n(
884
+ e.businessHours && !i.businessPct && /* @__PURE__ */ d("div", { "data-rsv": "tg-nonbusiness", style: "top:0;height:100%" }),
885
+ i.businessPct && /* @__PURE__ */ g(Ct, { children: [
886
+ /* @__PURE__ */ d("div", { "data-rsv": "tg-nonbusiness", style: `top:0;height:${i.businessPct.topPct}%` }),
887
+ /* @__PURE__ */ d(
606
888
  "div",
607
889
  {
608
890
  "data-rsv": "tg-nonbusiness",
609
- style: `top:${d.businessPct.bottomPct}%;height:${100 - d.businessPct.bottomPct}%`
891
+ style: `top:${i.businessPct.bottomPct}%;height:${100 - i.businessPct.bottomPct}%`
610
892
  }
611
893
  )
612
894
  ] }),
613
- d.timedSegs.filter((h) => h.event.display !== "none").map((h) => /* @__PURE__ */ n(
614
- $t,
895
+ (k == null ? void 0 : k.dayIndex) === D && c > 0 && /* @__PURE__ */ d(
896
+ "div",
897
+ {
898
+ "data-rsv": "select-mirror",
899
+ style: `top:${(k.startMin - t.minMinutes) / c * 100}%;height:${(k.endMin - k.startMin) / c * 100}%`
900
+ }
901
+ ),
902
+ i.timedSegs.filter((M) => M.event.display !== "none").map((M) => /* @__PURE__ */ d(
903
+ Xt,
615
904
  {
616
- api: a,
617
- seg: h,
905
+ api: r,
906
+ seg: M,
618
907
  model: t,
619
- options: r
908
+ options: e,
909
+ view: o
620
910
  },
621
- h.event.id
911
+ M.event.id
622
912
  )),
623
- ((c = t.nowIndicator) == null ? void 0 : c.dayIndex) === s && /* @__PURE__ */ n("div", { "data-rsv": "now-indicator", style: `top:${t.nowIndicator.topPct}%` })
913
+ ((C = t.nowIndicator) == null ? void 0 : C.dayIndex) === D && /* @__PURE__ */ d("div", { "data-rsv": "now-indicator", style: `top:${t.nowIndicator.topPct}%` })
624
914
  ]
625
915
  },
626
- l.toISOString(d.date)
916
+ s.toISOString(i.date)
627
917
  );
628
918
  })
629
919
  ] })
630
920
  ] });
631
921
  }
632
- function $t({
633
- api: a,
922
+ function Xt({
923
+ api: r,
634
924
  seg: t,
635
- model: r,
636
- options: e
925
+ model: e,
926
+ options: n,
927
+ view: o
637
928
  }) {
638
- var h;
639
- const { event: o } = t, i = e.editable === !0 && o.editable !== !1, u = 100 / t.colCount, d = l.format(o.start, "HH:mm"), s = x(
640
- (h = e.slots) == null ? void 0 : h.eventContent,
641
- { event: o, isAllDay: !1, timeText: d },
642
- /* @__PURE__ */ v("span", { "data-rsv": "event-title", children: [
643
- d,
929
+ var w, p;
930
+ const { event: a } = t, h = n.editable === !0 && a.editable !== !1, u = r.selectedEventIds.value.has(a.id), v = 100 / t.colCount, c = X(n.locale ?? "en", n.eventTimeFormat), l = c ? c(s.toDate(a.start)) : s.format(a.start, "HH:mm"), f = { event: a, isAllDay: !1, timeText: l, view: o }, b = L(
931
+ (w = n.slots) == null ? void 0 : w.eventContent,
932
+ f,
933
+ /* @__PURE__ */ g("span", { "data-rsv": "event-title", children: [
934
+ l,
644
935
  " ",
645
- o.title
646
- ] })
647
- ), c = (g) => g.closest('[data-rsv="tg-col"]') ?? g;
648
- return /* @__PURE__ */ v(
936
+ a.title
937
+ ] }),
938
+ n.hostBridge
939
+ ), k = (m) => m.closest('[data-rsv="tg-col"]') ?? m;
940
+ return /* @__PURE__ */ g(
649
941
  "div",
650
942
  {
651
943
  "data-rsv": "event",
652
944
  "data-all-day": "false",
653
- "data-display": o.display,
654
- "data-event-id": o.id,
655
- class: $(...o.classNames),
945
+ "data-display": a.display,
946
+ "data-event-id": a.id,
947
+ "data-rsv-selected": String(u),
948
+ class: F((p = n.classNames) == null ? void 0 : p.event, ...a.classNames),
656
949
  role: "button",
657
950
  tabIndex: 0,
658
- style: `position:absolute;top:${t.topPct}%;height:${t.heightPct}%;left:${t.col * u}%;width:${u}%;--rsv-event-bg:${o.backgroundColor};--rsv-event-fg:${o.textColor}`,
659
- onClick: (g) => {
660
- g.stopPropagation(), a.trigger("eventClick", { event: o }), o.url && window.open(o.url, "_self");
951
+ ref: (m) => {
952
+ var S;
953
+ return A(m, (S = n.hooks) == null ? void 0 : S.eventDidMount, () => f);
661
954
  },
662
- onKeyDown: i ? (g) => Q(g, {
663
- api: a,
664
- event: o,
955
+ style: `position:absolute;top:${t.topPct}%;height:${t.heightPct}%;left:${t.col * v}%;width:${v}%;--rsv-event-bg:${a.backgroundColor};--rsv-event-fg:${a.textColor};--rsv-event-border:${a.borderColor}`,
956
+ onClick: (m) => {
957
+ if (m.stopPropagation(), m.ctrlKey || m.metaKey) {
958
+ r.toggleEventSelection(a.id);
959
+ return;
960
+ }
961
+ r.trigger("eventClick", { event: a, el: m.currentTarget }), a.url && window.open(a.url, "_self");
962
+ },
963
+ onKeyDown: h ? (m) => lt(m, {
964
+ api: r,
965
+ event: a,
665
966
  kind: "timeGrid",
666
- snap: e.snapDuration ?? e.slotDuration
967
+ snap: n.snapDuration ?? n.slotDuration,
968
+ shortcuts: n.keyboardShortcuts
667
969
  }) : void 0,
668
- onPointerDown: i ? (g) => G(g, {
669
- api: a,
670
- event: o,
671
- model: r,
672
- columnEl: c(g.currentTarget),
673
- snap: e.snapDuration
970
+ onPointerDown: h ? (m) => q(m, {
971
+ api: r,
972
+ event: a,
973
+ model: e,
974
+ columnEl: k(m.currentTarget),
975
+ snap: n.snapDuration
674
976
  }) : void 0,
675
977
  children: [
676
- i && /* @__PURE__ */ n(
978
+ h && /* @__PURE__ */ d(
677
979
  "span",
678
980
  {
679
981
  "data-rsv": "resize-handle",
680
982
  "data-edge": "start",
681
- onPointerDown: (g) => G(g, {
682
- api: a,
683
- event: o,
684
- model: r,
685
- columnEl: c(g.currentTarget),
686
- snap: e.snapDuration,
983
+ onPointerDown: (m) => q(m, {
984
+ api: r,
985
+ event: a,
986
+ model: e,
987
+ columnEl: k(m.currentTarget),
988
+ snap: n.snapDuration,
687
989
  edge: "start"
688
990
  })
689
991
  }
690
992
  ),
691
- s,
692
- i && /* @__PURE__ */ n(
993
+ b,
994
+ h && /* @__PURE__ */ d(
693
995
  "span",
694
996
  {
695
997
  "data-rsv": "resize-handle",
696
998
  "data-edge": "end",
697
- onPointerDown: (g) => G(g, {
698
- api: a,
699
- event: o,
700
- model: r,
701
- columnEl: c(g.currentTarget),
702
- snap: e.snapDuration,
999
+ onPointerDown: (m) => q(m, {
1000
+ api: r,
1001
+ event: a,
1002
+ model: e,
1003
+ columnEl: k(m.currentTarget),
1004
+ snap: n.snapDuration,
703
1005
  edge: "end"
704
1006
  })
705
1007
  }
@@ -708,176 +1010,187 @@ function $t({
708
1010
  }
709
1011
  );
710
1012
  }
711
- function Tt({ api: a, model: t, options: r }) {
712
- const e = r.locale ?? "en", o = E(r.locale), i = new Intl.DateTimeFormat(e, {
1013
+ function qt({ api: r, model: t, options: e }) {
1014
+ const n = e.locale ?? "en", o = { type: r.getView().type }, a = R(e.locale), h = W(n, e.listDayFormat, {
713
1015
  weekday: "long",
714
1016
  day: "numeric",
715
1017
  month: "long"
716
- });
717
- return t.isEmpty ? /* @__PURE__ */ n("div", { "data-rsv": "list", children: /* @__PURE__ */ n("div", { "data-rsv": "list-empty", children: o.noEvents }) }) : /* @__PURE__ */ n("div", { "data-rsv": "list", role: "list", children: t.days.map((u) => /* @__PURE__ */ v("div", { "data-rsv": "list-day", "data-today": String(u.isToday), children: [
718
- /* @__PURE__ */ n("div", { "data-rsv": "list-day-header", role: "heading", "aria-level": 3, children: i.format(l.toDate(u.date)) }),
719
- u.events.filter((d) => d.display !== "none").map((d) => {
720
- var c;
721
- const s = d.allDay ? o.allDay : l.format(d.start, "HH:mm");
722
- return /* @__PURE__ */ v(
1018
+ }), u = e.listDaySideFormat ? W(n, e.listDaySideFormat, { month: "short", day: "2-digit" }) : null, v = X(n, e.eventTimeFormat);
1019
+ return t.isEmpty ? /* @__PURE__ */ d("div", { "data-rsv": "list", children: /* @__PURE__ */ d("div", { "data-rsv": "list-empty", children: a.noEvents }) }) : /* @__PURE__ */ d("div", { "data-rsv": "list", role: "list", children: t.days.map((c) => /* @__PURE__ */ g("div", { "data-rsv": "list-day", "data-today": String(c.isToday), children: [
1020
+ /* @__PURE__ */ g("div", { "data-rsv": "list-day-header", role: "heading", "aria-level": 3, children: [
1021
+ /* @__PURE__ */ d("span", { "data-rsv": "list-day-text", children: h ? h(s.toDate(c.date)) : "" }),
1022
+ u && /* @__PURE__ */ d("span", { "data-rsv": "list-day-side-text", children: u(s.toDate(c.date)) })
1023
+ ] }),
1024
+ c.events.filter((l) => l.display !== "none").map((l) => {
1025
+ var k, w;
1026
+ const f = l.allDay ? a.allDay : v ? v(s.toDate(l.start)) : s.format(l.start, "HH:mm"), b = { event: l, isAllDay: l.allDay, timeText: f, view: o };
1027
+ return /* @__PURE__ */ g(
723
1028
  "div",
724
1029
  {
725
1030
  "data-rsv": "list-item",
726
1031
  role: "listitem",
727
1032
  tabIndex: 0,
728
- class: $(...d.classNames),
729
- "data-display": d.display,
730
- onClick: () => {
731
- a.trigger("eventClick", { event: d }), d.url && window.open(d.url, "_self");
1033
+ "data-event-id": l.id,
1034
+ class: F((k = e.classNames) == null ? void 0 : k.event, ...l.classNames),
1035
+ "data-display": l.display,
1036
+ ref: (p) => {
1037
+ var m;
1038
+ return A(p, (m = e.hooks) == null ? void 0 : m.eventDidMount, () => b);
1039
+ },
1040
+ style: `--rsv-event-bg:${l.backgroundColor};--rsv-event-fg:${l.textColor};--rsv-event-border:${l.borderColor}`,
1041
+ onClick: (p) => {
1042
+ r.trigger("eventClick", { event: l, el: p.currentTarget }), l.url && window.open(l.url, "_self");
732
1043
  },
733
1044
  children: [
734
- /* @__PURE__ */ n("span", { "data-rsv": "list-item-time", children: s }),
735
- /* @__PURE__ */ n(
1045
+ /* @__PURE__ */ d("span", { "data-rsv": "list-item-time", children: f }),
1046
+ /* @__PURE__ */ d(
736
1047
  "span",
737
1048
  {
738
1049
  "data-rsv": "list-item-dot",
739
- style: `--rsv-event-bg:${d.backgroundColor}`
1050
+ style: `--rsv-event-bg:${l.backgroundColor}`
740
1051
  }
741
1052
  ),
742
- /* @__PURE__ */ n("span", { "data-rsv": "list-item-title", children: x(
743
- (c = r.slots) == null ? void 0 : c.eventContent,
744
- { event: d, isAllDay: d.allDay, timeText: s },
745
- d.title
1053
+ /* @__PURE__ */ d("div", { "data-rsv": "list-item-title", children: L(
1054
+ (w = e.slots) == null ? void 0 : w.eventContent,
1055
+ b,
1056
+ l.title,
1057
+ e.hostBridge
746
1058
  ) })
747
1059
  ]
748
1060
  },
749
- d.id
1061
+ l.id
750
1062
  );
751
1063
  })
752
- ] }, l.toISOString(u.date))) });
753
- }
754
- function Pt({ api: a, model: t, options: r }) {
755
- const e = r.locale ?? "en", o = new Intl.DateTimeFormat(e, { month: "long" });
756
- return /* @__PURE__ */ n("div", { "data-rsv": "multimonth", children: t.months.map((i) => /* @__PURE__ */ v("section", { "data-rsv": "mm-month", children: [
757
- /* @__PURE__ */ n("header", { "data-rsv": "mm-title", children: o.format(l.toDate(i.date)) }),
758
- /* @__PURE__ */ n(tt, { api: a, model: i.dayGrid, options: r })
759
- ] }, l.toISOString(i.date))) });
760
- }
761
- const Y = 1.6;
762
- function It({ api: a, model: t, options: r }) {
763
- return /* @__PURE__ */ v("div", { "data-rsv": "timeline", children: [
764
- /* @__PURE__ */ n("div", { "data-rsv": "tl-axis", role: "row", children: t.slots.map((e) => /* @__PURE__ */ n("div", { "data-rsv": "tl-slot", style: `left:${e.leftPct}%`, children: e.label }, e.leftPct)) }),
765
- /* @__PURE__ */ n("div", { "data-rsv": "tl-body", style: `height:${t.laneCount * Y + 0.5}rem`, children: t.segs.map((e) => /* @__PURE__ */ n(rt, { api: a, seg: e, options: r }, e.event.id)) })
1064
+ ] }, s.toISOString(c.date))) });
1065
+ }
1066
+ function zt({ api: r, model: t, options: e }) {
1067
+ const n = e.locale ?? "en", o = new Intl.DateTimeFormat(n, { month: "long" });
1068
+ return /* @__PURE__ */ d("div", { "data-rsv": "multimonth", children: t.months.map((a) => /* @__PURE__ */ g("section", { "data-rsv": "mm-month", children: [
1069
+ /* @__PURE__ */ d("header", { "data-rsv": "mm-title", children: o.format(s.toDate(a.date)) }),
1070
+ /* @__PURE__ */ d(ut, { api: r, model: a.dayGrid, options: e })
1071
+ ] }, s.toISOString(a.date))) });
1072
+ }
1073
+ const z = 1.6;
1074
+ function Jt({ api: r, model: t, options: e }) {
1075
+ return /* @__PURE__ */ g("div", { "data-rsv": "timeline", children: [
1076
+ /* @__PURE__ */ d("div", { "data-rsv": "tl-axis", role: "row", children: t.slots.map((n) => /* @__PURE__ */ d("div", { "data-rsv": "tl-slot", style: `left:${n.leftPct}%`, children: n.label }, n.leftPct)) }),
1077
+ /* @__PURE__ */ d("div", { "data-rsv": "tl-body", style: `height:${t.laneCount * z + 0.5}rem`, children: t.segs.map((n) => /* @__PURE__ */ d(gt, { api: r, seg: n, options: e }, n.event.id)) })
766
1078
  ] });
767
1079
  }
768
- function rt({
769
- api: a,
1080
+ function gt({
1081
+ api: r,
770
1082
  seg: t,
771
- options: r
1083
+ options: e
772
1084
  }) {
773
1085
  var o;
774
- const { event: e } = t;
775
- return /* @__PURE__ */ n(
1086
+ const { event: n } = t;
1087
+ return /* @__PURE__ */ d(
776
1088
  "div",
777
1089
  {
778
1090
  "data-rsv": "event",
779
- "data-event-id": e.id,
1091
+ "data-event-id": n.id,
780
1092
  role: "button",
781
1093
  tabIndex: 0,
782
- style: `position:absolute;left:${t.leftPct}%;width:${t.widthPct}%;top:${t.lane * Y}rem;height:${Y - 0.2}rem;--rsv-event-bg:${e.backgroundColor};--rsv-event-fg:${e.textColor}`,
783
- onClick: () => a.trigger("eventClick", { event: e }),
784
- children: x(
785
- (o = r.slots) == null ? void 0 : o.eventContent,
786
- { event: e, isAllDay: e.allDay, timeText: "" },
787
- e.title
1094
+ style: `position:absolute;left:${t.leftPct}%;width:${t.widthPct}%;top:${t.lane * z}rem;height:${z - 0.2}rem;--rsv-event-bg:${n.backgroundColor};--rsv-event-fg:${n.textColor};--rsv-event-border:${n.borderColor}`,
1095
+ onClick: (a) => r.trigger("eventClick", { event: n, el: a.currentTarget }),
1096
+ children: L(
1097
+ (o = e.slots) == null ? void 0 : o.eventContent,
1098
+ { event: n, isAllDay: n.allDay, timeText: "", view: { type: r.getView().type } },
1099
+ n.title,
1100
+ e.hostBridge
788
1101
  )
789
1102
  }
790
1103
  );
791
1104
  }
792
- const Lt = 1.6;
793
- function Ot({ api: a, model: t, options: r }) {
794
- return /* @__PURE__ */ v("div", { "data-rsv": "resource-timeline", children: [
795
- /* @__PURE__ */ v("div", { "data-rsv": "rt-header", role: "row", children: [
796
- /* @__PURE__ */ n("div", { "data-rsv": "resource-area-header", children: r.locale === "es" ? "Recursos" : "Resources" }),
797
- /* @__PURE__ */ n("div", { "data-rsv": "tl-axis", children: t.slots.map((e) => /* @__PURE__ */ n("div", { "data-rsv": "tl-slot", style: `left:${e.leftPct}%`, children: e.label }, e.leftPct)) })
1105
+ const Qt = 1.6;
1106
+ function Zt({ api: r, model: t, options: e }) {
1107
+ return /* @__PURE__ */ g("div", { "data-rsv": "resource-timeline", children: [
1108
+ /* @__PURE__ */ g("div", { "data-rsv": "rt-header", role: "row", children: [
1109
+ /* @__PURE__ */ d("div", { "data-rsv": "resource-area-header", children: e.locale === "es" ? "Recursos" : "Resources" }),
1110
+ /* @__PURE__ */ d("div", { "data-rsv": "tl-axis", children: t.slots.map((n) => /* @__PURE__ */ d("div", { "data-rsv": "tl-slot", style: `left:${n.leftPct}%`, children: n.label }, n.leftPct)) })
798
1111
  ] }),
799
- t.lanes.map((e) => {
800
- const o = e.laneCount * Lt + 0.4;
801
- return /* @__PURE__ */ v("div", { "data-rsv": "resource-row", role: "row", children: [
802
- /* @__PURE__ */ v(
1112
+ t.lanes.map((n) => {
1113
+ const o = n.laneCount * Qt + 0.4;
1114
+ return /* @__PURE__ */ g("div", { "data-rsv": "resource-row", role: "row", children: [
1115
+ /* @__PURE__ */ g(
803
1116
  "div",
804
1117
  {
805
1118
  "data-rsv": "resource-label",
806
- style: `padding-inline-start:${0.5 + e.row.depth * 1}rem`,
1119
+ style: `padding-inline-start:${0.5 + n.row.depth * 1}rem`,
807
1120
  children: [
808
- e.row.hasChildren && /* @__PURE__ */ n(
1121
+ n.row.hasChildren && /* @__PURE__ */ d(
809
1122
  "button",
810
1123
  {
811
1124
  type: "button",
812
1125
  "data-rsv": "resource-toggle",
813
- "aria-expanded": e.row.expanded,
814
- onClick: () => a.toggleResource(e.row.resource.id),
815
- children: e.row.expanded ? "▾" : "▸"
1126
+ "aria-expanded": n.row.expanded,
1127
+ onClick: () => r.toggleResource(n.row.resource.id),
1128
+ children: n.row.expanded ? "▾" : "▸"
816
1129
  }
817
1130
  ),
818
- /* @__PURE__ */ n("span", { "data-rsv": "resource-title", children: e.row.resource.title })
1131
+ /* @__PURE__ */ d("span", { "data-rsv": "resource-title", children: n.row.resource.title })
819
1132
  ]
820
1133
  }
821
1134
  ),
822
- /* @__PURE__ */ n("div", { "data-rsv": "resource-lane", style: `height:${o}rem`, children: e.segs.map((i) => /* @__PURE__ */ n(rt, { api: a, seg: i, options: r }, i.event.id)) })
823
- ] }, e.row.resource.id);
1135
+ /* @__PURE__ */ d("div", { "data-rsv": "resource-lane", style: `height:${o}rem`, children: n.segs.map((a) => /* @__PURE__ */ d(gt, { api: r, seg: a, options: e }, a.event.id)) })
1136
+ ] }, n.row.resource.id);
824
1137
  })
825
1138
  ] });
826
1139
  }
827
- function Rt({ api: a, model: t, options: r }) {
828
- const e = `calc(var(--spacing-rsv-slot, 2.5rem) * ${t.slots.length})`;
829
- return /* @__PURE__ */ v("div", { "data-rsv": "timegrid", style: `--rsv-tg-days:${t.columns.length}`, children: [
830
- /* @__PURE__ */ v("div", { "data-rsv": "tg-header", role: "row", children: [
831
- /* @__PURE__ */ n("div", { "data-rsv": "tg-axis-corner" }),
832
- t.columns.map((o) => /* @__PURE__ */ n("div", { "data-rsv": "tg-col-header", role: "columnheader", children: o.row.resource.title }, o.row.resource.id))
1140
+ function te({ api: r, model: t, options: e }) {
1141
+ const n = `calc(var(--spacing-rsv-slot, 2.5rem) * ${t.slots.length})`;
1142
+ return /* @__PURE__ */ g("div", { "data-rsv": "timegrid", style: `--rsv-tg-days:${t.columns.length}`, children: [
1143
+ /* @__PURE__ */ g("div", { "data-rsv": "tg-header", role: "row", children: [
1144
+ /* @__PURE__ */ d("div", { "data-rsv": "tg-axis-corner" }),
1145
+ t.columns.map((o) => /* @__PURE__ */ d("div", { "data-rsv": "tg-col-header", role: "columnheader", children: o.row.resource.title }, o.row.resource.id))
833
1146
  ] }),
834
- /* @__PURE__ */ v("div", { "data-rsv": "tg-allday", role: "row", children: [
835
- /* @__PURE__ */ n("div", { "data-rsv": "tg-axis-label", children: E(r.locale).allDay }),
836
- t.columns.map((o) => /* @__PURE__ */ n("div", { "data-rsv": "tg-allday-cell", children: o.allDayEvents.map((i) => /* @__PURE__ */ n(
1147
+ /* @__PURE__ */ g("div", { "data-rsv": "tg-allday", role: "row", children: [
1148
+ /* @__PURE__ */ d("div", { "data-rsv": "tg-axis-label", children: R(e.locale).allDay }),
1149
+ t.columns.map((o) => /* @__PURE__ */ d("div", { "data-rsv": "tg-allday-cell", children: o.allDayEvents.map((a) => /* @__PURE__ */ d(
837
1150
  "div",
838
1151
  {
839
1152
  "data-rsv": "event",
840
1153
  "data-all-day": "true",
841
- style: `--rsv-event-bg:${i.backgroundColor}`,
842
- onClick: () => a.trigger("eventClick", { event: i }),
843
- children: i.title
1154
+ style: `--rsv-event-bg:${a.backgroundColor}`,
1155
+ onClick: (h) => r.trigger("eventClick", { event: a, el: h.currentTarget }),
1156
+ children: a.title
844
1157
  },
845
- i.id
1158
+ a.id
846
1159
  )) }, o.row.resource.id))
847
1160
  ] }),
848
- /* @__PURE__ */ v("div", { "data-rsv": "tg-body", children: [
849
- /* @__PURE__ */ n("div", { "data-rsv": "tg-axis", style: `height:${e}`, children: t.slots.map((o) => /* @__PURE__ */ n("div", { "data-rsv": "tg-slot", "data-major": String(o.isMajor), children: /* @__PURE__ */ n("span", { "data-rsv": "tg-slot-label", children: o.label }) }, o.offsetMin)) }),
850
- t.columns.map((o) => /* @__PURE__ */ v(
1161
+ /* @__PURE__ */ g("div", { "data-rsv": "tg-body", children: [
1162
+ /* @__PURE__ */ d("div", { "data-rsv": "tg-axis", style: `height:${n}`, children: t.slots.map((o) => /* @__PURE__ */ d("div", { "data-rsv": "tg-slot", "data-major": String(o.isMajor), children: /* @__PURE__ */ d("span", { "data-rsv": "tg-slot-label", children: o.label }) }, o.offsetMin)) }),
1163
+ t.columns.map((o) => /* @__PURE__ */ g(
851
1164
  "div",
852
1165
  {
853
1166
  "data-rsv": "tg-col",
854
1167
  "data-rsv-resource-id": o.row.resource.id,
855
- style: `height:${e}`,
1168
+ style: `height:${n}`,
856
1169
  children: [
857
- o.timedSegs.map((i) => {
858
- const u = 100 / i.colCount;
859
- return /* @__PURE__ */ v(
1170
+ o.timedSegs.map((a) => {
1171
+ const h = 100 / a.colCount;
1172
+ return /* @__PURE__ */ g(
860
1173
  "div",
861
1174
  {
862
1175
  "data-rsv": "event",
863
1176
  "data-all-day": "false",
864
- "data-event-id": i.event.id,
1177
+ "data-event-id": a.event.id,
865
1178
  role: "button",
866
1179
  tabIndex: 0,
867
- style: `position:absolute;top:${i.topPct}%;height:${i.heightPct}%;left:${i.col * u}%;width:${u}%;--rsv-event-bg:${i.event.backgroundColor};--rsv-event-fg:${i.event.textColor}`,
868
- onClick: (d) => {
869
- d.stopPropagation(), a.trigger("eventClick", { event: i.event });
1180
+ style: `position:absolute;top:${a.topPct}%;height:${a.heightPct}%;left:${a.col * h}%;width:${h}%;--rsv-event-bg:${a.event.backgroundColor};--rsv-event-fg:${a.event.textColor}`,
1181
+ onClick: (u) => {
1182
+ u.stopPropagation(), r.trigger("eventClick", { event: a.event });
870
1183
  },
871
1184
  children: [
872
- l.format(i.event.start, "HH:mm"),
1185
+ s.format(a.event.start, "HH:mm"),
873
1186
  " ",
874
- i.event.title
1187
+ a.event.title
875
1188
  ]
876
1189
  },
877
- i.event.id
1190
+ a.event.id
878
1191
  );
879
1192
  }),
880
- t.nowTopPct != null && /* @__PURE__ */ n("div", { "data-rsv": "now-indicator", style: `top:${t.nowTopPct}%` })
1193
+ t.nowTopPct != null && /* @__PURE__ */ d("div", { "data-rsv": "now-indicator", style: `top:${t.nowTopPct}%` })
881
1194
  ]
882
1195
  },
883
1196
  o.row.resource.id
@@ -885,99 +1198,205 @@ function Rt({ api: a, model: t, options: r }) {
885
1198
  ] })
886
1199
  ] });
887
1200
  }
888
- function Ft({ api: a, model: t }) {
889
- return /* @__PURE__ */ v("div", { "data-rsv": "resource-daygrid", style: `--rsv-rdg-cols:${t.columns.length}`, children: [
890
- /* @__PURE__ */ n("div", { "data-rsv": "rdg-header", role: "row", children: t.columns.map((r) => /* @__PURE__ */ n("div", { "data-rsv": "rdg-col-header", role: "columnheader", children: r.row.resource.title }, r.row.resource.id)) }),
891
- /* @__PURE__ */ n("div", { "data-rsv": "rdg-body", role: "row", children: t.columns.map((r) => /* @__PURE__ */ n(
1201
+ function ee({ api: r, model: t }) {
1202
+ return /* @__PURE__ */ g("div", { "data-rsv": "resource-daygrid", style: `--rsv-rdg-cols:${t.columns.length}`, children: [
1203
+ /* @__PURE__ */ d("div", { "data-rsv": "rdg-header", role: "row", children: t.columns.map((e) => /* @__PURE__ */ d("div", { "data-rsv": "rdg-col-header", role: "columnheader", children: e.row.resource.title }, e.row.resource.id)) }),
1204
+ /* @__PURE__ */ d("div", { "data-rsv": "rdg-body", role: "row", children: t.columns.map((e) => /* @__PURE__ */ d(
892
1205
  "div",
893
1206
  {
894
1207
  "data-rsv": "rdg-col",
895
- "data-rsv-resource-id": r.row.resource.id,
896
- children: r.events.map((e) => /* @__PURE__ */ v(
1208
+ "data-rsv-resource-id": e.row.resource.id,
1209
+ children: e.events.map((n) => /* @__PURE__ */ g(
897
1210
  "div",
898
1211
  {
899
1212
  "data-rsv": "event",
900
- "data-all-day": String(e.allDay),
901
- "data-event-id": e.id,
1213
+ "data-all-day": String(n.allDay),
1214
+ "data-event-id": n.id,
902
1215
  role: "button",
903
1216
  tabIndex: 0,
904
- style: `--rsv-event-bg:${e.backgroundColor};--rsv-event-fg:${e.textColor}`,
905
- onClick: () => a.trigger("eventClick", { event: e }),
1217
+ style: `--rsv-event-bg:${n.backgroundColor};--rsv-event-fg:${n.textColor};--rsv-event-border:${n.borderColor}`,
1218
+ onClick: (o) => r.trigger("eventClick", { event: n, el: o.currentTarget }),
906
1219
  children: [
907
- e.allDay ? "" : l.format(e.start, "HH:mm") + " ",
908
- e.title
1220
+ n.allDay ? "" : s.format(n.start, "HH:mm") + " ",
1221
+ n.title
909
1222
  ]
910
1223
  },
911
- e.id
1224
+ n.id
912
1225
  ))
913
1226
  },
914
- r.row.resource.id
1227
+ e.row.resource.id
915
1228
  )) })
916
1229
  ] });
917
1230
  }
918
- function Gt({ api: a, options: t }) {
919
- var i;
920
- const r = a.viewModel.value, e = t.direction ?? E(t.locale).direction, o = t.themeTokens ? vt(t.themeTokens) : void 0;
921
- return /* @__PURE__ */ v(
1231
+ function re({ api: r, model: t, options: e }) {
1232
+ return /* @__PURE__ */ d("div", { "data-rsv": "resource-daygrid-month", style: `--rsv-rdgm-cols:${t.columnCount}`, children: t.weeks.map((n, o) => /* @__PURE__ */ d("div", { "data-rsv": "rdgm-week", role: "row", children: n.days.map((a) => /* @__PURE__ */ d(
1233
+ ne,
1234
+ {
1235
+ api: r,
1236
+ cell: a,
1237
+ options: e
1238
+ },
1239
+ s.toISOString(a.date)
1240
+ )) }, `week-${o}`)) });
1241
+ }
1242
+ function ne({
1243
+ api: r,
1244
+ cell: t,
1245
+ options: e
1246
+ }) {
1247
+ const n = s.dayOfMonth(t.date);
1248
+ return /* @__PURE__ */ g(
1249
+ "div",
1250
+ {
1251
+ "data-rsv": "day",
1252
+ role: "gridcell",
1253
+ "data-date": s.toISOString(t.date),
1254
+ "data-today": String(t.isToday),
1255
+ "data-other": String(t.isOther),
1256
+ children: [
1257
+ /* @__PURE__ */ d("span", { "data-rsv": "day-number", children: n }),
1258
+ /* @__PURE__ */ d("div", { "data-rsv": "rdgm-columns", children: t.columns.map((o) => /* @__PURE__ */ g("div", { "data-rsv": "rdgm-col", "data-rsv-resource-id": o.row.resource.id, children: [
1259
+ /* @__PURE__ */ d("span", { "data-rsv": "rdgm-col-label", children: o.row.resource.title }),
1260
+ o.events.map((a) => {
1261
+ const h = r.selectedEventIds.value.has(a.id);
1262
+ return /* @__PURE__ */ g(
1263
+ "div",
1264
+ {
1265
+ "data-rsv": "event",
1266
+ "data-all-day": String(a.allDay),
1267
+ "data-event-id": a.id,
1268
+ "data-rsv-selected": String(h),
1269
+ role: "button",
1270
+ tabIndex: 0,
1271
+ style: `--rsv-event-bg:${a.backgroundColor};--rsv-event-fg:${a.textColor};--rsv-event-border:${a.borderColor}`,
1272
+ onClick: (u) => {
1273
+ if (u.stopPropagation(), u.ctrlKey || u.metaKey) {
1274
+ r.toggleEventSelection(a.id);
1275
+ return;
1276
+ }
1277
+ r.trigger("eventClick", { event: a, el: u.currentTarget }), a.url && window.open(a.url, "_self");
1278
+ },
1279
+ children: [
1280
+ a.allDay ? "" : `${s.format(a.start, "HH:mm")} `,
1281
+ a.title
1282
+ ]
1283
+ },
1284
+ a.id
1285
+ );
1286
+ }),
1287
+ o.moreCount > 0 && /* @__PURE__ */ d(
1288
+ "span",
1289
+ {
1290
+ "data-rsv": "rdgm-more",
1291
+ onClick: (a) => {
1292
+ a.stopPropagation(), r.trigger("moreLinkClick", {
1293
+ date: t.date,
1294
+ allEvents: [...o.events, ...o.hiddenEvents],
1295
+ hiddenEvents: o.hiddenEvents
1296
+ });
1297
+ },
1298
+ children: R(e.locale).more(o.moreCount)
1299
+ }
1300
+ )
1301
+ ] }, o.row.resource.id)) })
1302
+ ]
1303
+ }
1304
+ );
1305
+ }
1306
+ function ae({ api: r, options: t }) {
1307
+ var c;
1308
+ const e = r.viewModel.value, n = t.direction ?? R(t.locale).direction, o = r.getEffectiveOption("hourHeight", e.type), a = r.getEffectiveOption("height", e.type), h = [
1309
+ t.themeTokens ? pt(t.themeTokens) : "",
1310
+ o ? `${Dt.slotHeight}:${o}px` : "",
1311
+ a != null && a !== "auto" ? `height:${typeof a == "number" ? `${a}px` : a}` : ""
1312
+ ].filter(Boolean).join(";") || void 0, u = $(null);
1313
+ H(() => (r.setRootEl(u.current), () => r.setRootEl(null)), [r]);
1314
+ const v = $(t.responsiveViews);
1315
+ return v.current = t.responsiveViews, H(() => {
1316
+ const l = u.current;
1317
+ if (!l || typeof ResizeObserver > "u") return;
1318
+ let f = 0;
1319
+ const b = new ResizeObserver((k) => {
1320
+ const w = k[0], p = (w == null ? void 0 : w.contentRect.width) ?? l.clientWidth;
1321
+ cancelAnimationFrame(f), f = requestAnimationFrame(() => {
1322
+ const m = v.current;
1323
+ if (!(m != null && m.length)) return;
1324
+ const S = $t(m, p);
1325
+ S && S !== r.getView().type && r.hasView(S) && r.changeView(S);
1326
+ });
1327
+ });
1328
+ return b.observe(l), () => {
1329
+ cancelAnimationFrame(f), b.disconnect();
1330
+ };
1331
+ }, [r]), /* @__PURE__ */ g(
922
1332
  "div",
923
1333
  {
1334
+ ref: u,
924
1335
  "data-rsv": "root",
925
- dir: e,
1336
+ dir: n,
926
1337
  "data-rsv-theme": t.theme,
927
- style: o,
928
- class: $((i = t.classNames) == null ? void 0 : i.root),
1338
+ "data-rsv-autoheight": a === "auto" ? "true" : void 0,
1339
+ style: h,
1340
+ class: F((c = t.classNames) == null ? void 0 : c.root),
929
1341
  children: [
930
- t.headerToolbar !== !1 && /* @__PURE__ */ n(bt, { api: a, title: r.title, activeView: r.type, options: t }),
931
- /* @__PURE__ */ n("div", { "data-rsv": "view", "data-view": r.type, children: r.dayGrid ? /* @__PURE__ */ n(tt, { api: a, model: r.dayGrid, options: t }) : r.timeGrid ? /* @__PURE__ */ n(Et, { api: a, model: r.timeGrid, options: t }) : r.list ? /* @__PURE__ */ n(Tt, { api: a, model: r.list, options: t }) : r.multiMonth ? /* @__PURE__ */ n(Pt, { api: a, model: r.multiMonth, options: t }) : r.resourceTimeGrid ? /* @__PURE__ */ n(Rt, { api: a, model: r.resourceTimeGrid, options: t }) : r.resourceDayGrid ? /* @__PURE__ */ n(Ft, { api: a, model: r.resourceDayGrid, options: t }) : r.resourceTimeline ? /* @__PURE__ */ n(Ot, { api: a, model: r.resourceTimeline, options: t }) : r.timeline ? /* @__PURE__ */ n(It, { api: a, model: r.timeline, options: t }) : /* @__PURE__ */ v("div", { "data-rsv": "unsupported", children: [
1342
+ t.headerToolbar !== !1 && /* @__PURE__ */ d(Rt, { api: r, title: e.title, activeView: e.type, options: t }),
1343
+ /* @__PURE__ */ d("div", { "data-rsv": "view", "data-view": e.type, children: e.dayGrid ? /* @__PURE__ */ d(ut, { api: r, model: e.dayGrid, options: t }) : e.timeGrid ? /* @__PURE__ */ d(Wt, { api: r, model: e.timeGrid, options: t }) : e.list ? /* @__PURE__ */ d(qt, { api: r, model: e.list, options: t }) : e.multiMonth ? /* @__PURE__ */ d(zt, { api: r, model: e.multiMonth, options: t }) : e.resourceTimeGrid ? /* @__PURE__ */ d(te, { api: r, model: e.resourceTimeGrid, options: t }) : e.resourceDayGrid ? /* @__PURE__ */ d(ee, { api: r, model: e.resourceDayGrid, options: t }) : e.resourceDayGridMonth ? /* @__PURE__ */ d(re, { api: r, model: e.resourceDayGridMonth, options: t }) : e.resourceTimeline ? /* @__PURE__ */ d(Zt, { api: r, model: e.resourceTimeline, options: t }) : e.timeline ? /* @__PURE__ */ d(Jt, { api: r, model: e.timeline, options: t }) : /* @__PURE__ */ g("div", { "data-rsv": "unsupported", children: [
932
1344
  'La vista "',
933
- r.type,
1345
+ e.type,
934
1346
  '" se implementa en una fase posterior.'
935
1347
  ] }) })
936
1348
  ]
937
1349
  }
938
1350
  );
939
1351
  }
940
- function Bt(a, t) {
941
- const r = new ut(t);
942
- return X(st(Gt, { api: r, options: t }), a), {
943
- api: r,
1352
+ function ue(r, t) {
1353
+ const e = new Mt(t);
1354
+ return at(bt(ae, { api: e, options: t }), r), {
1355
+ api: e,
944
1356
  destroy() {
945
- X(null, a), r.destroy();
1357
+ at(null, r), e.destroy();
946
1358
  }
947
1359
  };
948
1360
  }
949
- function _t(a, t = "calendar.ics") {
1361
+ function ve(r, t = "calendar.ics") {
950
1362
  if (typeof document > "u") return;
951
- const r = mt(a), e = new Blob([r], { type: "text/calendar;charset=utf-8" }), o = URL.createObjectURL(e), i = document.createElement("a");
952
- i.href = o, i.download = t, document.body.appendChild(i), i.click(), i.remove(), URL.revokeObjectURL(o);
1363
+ const e = St(r), n = new Blob([e], { type: "text/calendar;charset=utf-8" }), o = URL.createObjectURL(n), a = document.createElement("a");
1364
+ a.href = o, a.download = t, document.body.appendChild(a), a.click(), a.remove(), URL.revokeObjectURL(o);
953
1365
  }
954
1366
  export {
955
- Gt as Calendar,
956
- tt as DayGridView,
957
- Tt as ListView,
958
- Pt as MultiMonthView,
959
- Ft as ResourceDayGridView,
960
- Rt as ResourceTimeGridView,
961
- Ot as ResourceTimelineView,
962
- Et as TimeGridView,
963
- It as TimelineView,
964
- bt as Toolbar,
965
- $ as cx,
966
- Kt as dayGridPlugin,
967
- Wt as definePlugin,
968
- Xt as defineTheme,
969
- _t as downloadICS,
970
- zt as eventsToICS,
971
- Q as handleEventKeydown,
972
- qt as listPlugin,
973
- Bt as mount,
974
- Jt as multiMonthPlugin,
975
- Qt as parseICS,
976
- x as renderSlot,
977
- Zt as resourcePlugin,
978
- G as startEventDrag,
979
- te as themeToStyle,
980
- ee as timeGridPlugin,
981
- re as timelinePlugin
1367
+ ae as Calendar,
1368
+ ut as DayGridView,
1369
+ qt as ListView,
1370
+ zt as MultiMonthView,
1371
+ ee as ResourceDayGridView,
1372
+ te as ResourceTimeGridView,
1373
+ Zt as ResourceTimelineView,
1374
+ Wt as TimeGridView,
1375
+ Jt as TimelineView,
1376
+ Rt as Toolbar,
1377
+ A as callDidMount,
1378
+ F as cx,
1379
+ W as dateFormatter,
1380
+ ge as dayGridPlugin,
1381
+ ye as definePlugin,
1382
+ fe as defineTheme,
1383
+ ve as downloadICS,
1384
+ be as eventsToICS,
1385
+ lt as handleEventKeydown,
1386
+ ce as hostSlot,
1387
+ Et as isHostSlot,
1388
+ we as listPlugin,
1389
+ It as minutesToLabel,
1390
+ At as minutesToTimeString,
1391
+ ue as mount,
1392
+ ke as multiMonthPlugin,
1393
+ De as parseICS,
1394
+ L as renderSlot,
1395
+ pe as resourcePlugin,
1396
+ q as startEventDrag,
1397
+ Me as themeToStyle,
1398
+ X as timeFormatter,
1399
+ Se as timeGridPlugin,
1400
+ Ce as timelinePlugin
982
1401
  };
983
1402
  //# sourceMappingURL=index.js.map