@cocoar/vue-calendar 3.2.0 → 3.3.0-beta.8

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,124 +1,7 @@
1
- import { o as e, s as t } from "./move-math-BFP9Tfuo.js";
2
- import { Temporal as n, Temporal as r } from "@js-temporal/polyfill";
3
- //#region src/core/temporal.ts
4
- function i(e) {
5
- return e % 7;
6
- }
7
- var a = !1;
8
- function o(e) {
9
- try {
10
- let t = new Intl.Locale(e), n = t.getWeekInfo?.() ?? t.weekInfo;
11
- if (n && typeof n.firstDay == "number") return i(n.firstDay);
12
- } catch {}
13
- return !a && typeof console < "u" && (a = !0, console.warn(`[@cocoar/vue-calendar] Intl.Locale.weekInfo is not available on this runtime — falling back to Monday for locale '${e}'. Article 9: defaults are not decisions. Pass \`.firstDayOfWeek(0)\` (Sunday) / \`.firstDayOfWeek(6)\` (Saturday) etc. explicitly so the week-start is deterministic across browsers.`)), 1;
14
- }
15
- function s(e) {
16
- try {
17
- return new Intl.DateTimeFormat(e, { hour: "numeric" }).resolvedOptions().hour12 ?? !1;
18
- } catch {
19
- return !1;
20
- }
21
- }
22
- var c = !1;
23
- function l() {
24
- try {
25
- let e = Intl.DateTimeFormat().resolvedOptions().timeZone;
26
- if (e) return e;
27
- } catch {}
28
- return !c && typeof console < "u" && (c = !0, console.warn("[@cocoar/vue-calendar] detectBrowserTimezone() couldn't read Intl.DateTimeFormat — falling back to 'UTC'. This is the Article-4 anti-pattern: human-meaningful times will render at the wrong wall-clock for users not in UTC. Pass an explicit IANA zone to `builder.timezone(...)` (e.g. 'Europe/Vienna'). If your app really does run in UTC, pass 'UTC' explicitly to silence this warning.")), "UTC";
29
- }
30
- function u(e, t) {
31
- if (!t) return e;
32
- let n = { ...e };
33
- return t.hour12 !== void 0 && (n.hour12 = t.hour12), (t.dateStyle !== void 0 || t.timeStyle !== void 0) && (delete n.weekday, delete n.era, delete n.year, delete n.month, delete n.day, delete n.dayPeriod, delete n.hour, delete n.minute, delete n.second, delete n.fractionalSecondDigits, delete n.timeZoneName), t.dateStyle !== void 0 && (n.dateStyle = t.dateStyle), t.timeStyle !== void 0 && (n.timeStyle = t.timeStyle), n;
34
- }
35
- function d(e, t) {
36
- let n = (i(e.dayOfWeek) - t + 7) % 7;
37
- return n === 0 ? e : e.subtract({ days: n });
38
- }
39
- function f(e, t) {
40
- return d(e, t).add({ days: 6 });
41
- }
42
- function p(e) {
43
- return e.with({ day: 1 });
44
- }
45
- function m(e) {
46
- return e.with({ day: e.daysInMonth });
47
- }
48
- function h(e) {
49
- let t = e.dayOfWeek, n = e.add({ days: 4 - t }), r = n.with({
50
- month: 1,
51
- day: 1
52
- }), i = (4 - r.dayOfWeek + 7) % 7, a = r.add({ days: i }), o = n.since(a, { largestUnit: "days" }).days;
53
- return Math.floor(o / 7) + 1;
54
- }
55
- function g(e, t) {
56
- let n = d(e, t), r = Array(7);
57
- for (let e = 0; e < 7; e++) r[e] = n.add({ days: e });
58
- return r;
59
- }
60
- function _(e, t, n) {
61
- if (n.length === 0) return [];
62
- let r = new Set(n);
63
- return g(e, t).filter((e) => r.has(i(e.dayOfWeek)));
64
- }
65
- function v(e, t) {
66
- let n = d(e.toPlainDate({ day: 1 }), t), r = Array(42);
67
- for (let e = 0; e < 42; e++) r[e] = n.add({ days: e });
68
- return r;
69
- }
70
- function y(e, t, n = "short") {
71
- let r = new Intl.DateTimeFormat(e, { weekday: n }), i = new Date(Date.UTC(2024, 0, 7)), a = Array(7);
72
- for (let e = 0; e < 7; e++) {
73
- let n = (t + e) % 7, o = new Date(i.getTime());
74
- o.setUTCDate(o.getUTCDate() + n), a[e] = r.format(o);
75
- }
76
- return a;
77
- }
78
- function b(e) {
79
- return e.toString();
80
- }
81
- function x(e, t) {
82
- return e instanceof r.PlainDate ? e : e.withTimeZone(t).toPlainDate();
83
- }
84
- function S(e) {
85
- return r.Now.plainDateISO(e);
86
- }
87
- function ee(e) {
88
- return r.Now.zonedDateTimeISO(e);
89
- }
90
- function te(e) {
91
- let { local: t, timeZoneId: n, dstPolicy: i = "compatible" } = e, a;
92
- try {
93
- a = r.PlainDateTime.from(t);
94
- } catch (e) {
95
- throw RangeError(`[parseScheduledTime] local='${t}' is not a parseable ISO-8601 datetime (${e.message}). Expected format: 'YYYY-MM-DDTHH:MM[:SS]'.`, { cause: e });
96
- }
97
- let o;
98
- try {
99
- o = a.toZonedDateTime(n, { disambiguation: i });
100
- } catch (e) {
101
- let r = e.message;
102
- throw TypeError(i === "reject" ? `[parseScheduledTime] local='${t}' in '${n}' could not be resolved (${r}). Likely cause: dstPolicy='reject' on a DST gap (e.g. 02:30 on the spring-forward day). Use 'earlier' / 'later' / 'compatible' if you want the engine to resolve, or pick a different time.` : `[parseScheduledTime] timeZoneId='${n}' is not a recognised IANA zone (${r}). Use a real name like 'Europe/Vienna' / 'America/Los_Angeles' — abbreviations like 'CET' / 'EST' are ambiguous and intentionally rejected.`, { cause: e });
103
- }
104
- return o;
105
- }
106
- function ne(e) {
107
- try {
108
- return r.PlainDate.from(e);
109
- } catch (t) {
110
- throw RangeError(`[parsePlainDate] iso='${e}' is not a parseable ISO-8601 date (${t.message}). Expected format: 'YYYY-MM-DD'.`, { cause: t });
111
- }
112
- }
113
- function C(e) {
114
- return {
115
- local: e.toPlainDateTime().toString(),
116
- timeZoneId: e.timeZoneId
117
- };
118
- }
119
- //#endregion
1
+ import { A as e, T as t, c as n, h as r, k as i, m as a, o, s, w as c, y as l } from "./move-math-C9mwvFPJ.js";
2
+ import { Temporal as u } from "@js-temporal/polyfill";
120
3
  //#region src/core/timeGridRange.ts
121
- var w = {
4
+ var d = {
122
5
  daySingle: {
123
6
  anchor: "cursor",
124
7
  span: 1,
@@ -144,110 +27,110 @@ var w = {
144
27
  step: 7
145
28
  }
146
29
  };
147
- function T(e, t = {}) {
148
- return e === "week" ? w.week : e === "workWeek" ? w.workWeek : t.explicit ? t.explicit : t.dayMode === "multiDay" ? w.dayMulti : w.daySingle;
30
+ function f(e, t = {}) {
31
+ return e === "week" ? d.week : e === "workWeek" ? d.workWeek : t.explicit ? t.explicit : t.dayMode === "multiDay" ? d.dayMulti : d.daySingle;
149
32
  }
150
- function E(e) {
151
- let { spec: t, cursor: n, firstDayOfWeek: r, workDays: a } = e, o = t.anchor === "weekStart" ? d(n, r) : n, s = D(t, e.responsiveColumns), c = Array.from({ length: s }, (e, t) => o.add({ days: t }));
33
+ function p(e) {
34
+ let { spec: n, cursor: r, firstDayOfWeek: i, workDays: a } = e, o = n.anchor === "weekStart" ? c(r, i) : r, s = m(n, e.responsiveColumns), l = Array.from({ length: s }, (e, t) => o.add({ days: t }));
152
35
  return {
153
36
  start: o,
154
37
  spanDays: s,
155
- days: t.filter === "workDays" ? c.filter((e) => a.includes(i(e.dayOfWeek))) : c,
156
- stepDays: O(t, s)
38
+ days: n.filter === "workDays" ? l.filter((e) => a.includes(t(e.dayOfWeek))) : l,
39
+ stepDays: h(n, s)
157
40
  };
158
41
  }
159
- function D(e, t) {
42
+ function m(e, t) {
160
43
  return e.span === "responsive" ? Math.max(1, Math.floor(t)) : Math.max(1, Math.floor(e.span));
161
44
  }
162
- function O(e, t) {
45
+ function h(e, t) {
163
46
  return e.step === "span" ? Math.max(1, t) : Math.max(1, Math.floor(e.step));
164
47
  }
165
48
  //#endregion
166
49
  //#region src/core/viewWindow.ts
167
- var re = [
50
+ var g = [
168
51
  1,
169
52
  2,
170
53
  3,
171
54
  4,
172
55
  5
173
56
  ];
174
- function ie(e) {
175
- let { view: t, cursor: r, firstDayOfWeek: i, timezone: a } = e;
57
+ function _(e) {
58
+ let { view: t, cursor: n, firstDayOfWeek: r, timezone: i } = e;
176
59
  switch (t) {
177
60
  case "day":
178
61
  case "week":
179
62
  case "workWeek": {
180
- let n = E({
181
- spec: T(t, {
63
+ let a = p({
64
+ spec: f(t, {
182
65
  dayMode: "multiDay",
183
66
  explicit: t === "day" ? e.timeGridRange ?? null : null
184
67
  }),
185
- cursor: r,
186
- firstDayOfWeek: i,
68
+ cursor: n,
69
+ firstDayOfWeek: r,
187
70
  workDays: [],
188
71
  responsiveColumns: e.dayColumnCount ?? 1
189
72
  });
190
73
  return {
191
74
  view: t,
192
- start: n.start.toString(),
193
- end: n.start.add({ days: n.spanDays }).toString(),
194
- timezone: a
75
+ start: a.start.toString(),
76
+ end: a.start.add({ days: a.spanDays }).toString(),
77
+ timezone: i
195
78
  };
196
79
  }
197
80
  case "dayAgenda": {
198
- let e = d(r, i);
81
+ let e = c(n, r);
199
82
  return {
200
83
  view: t,
201
84
  start: e.toString(),
202
85
  end: e.add({ days: 7 }).toString(),
203
- timezone: a
86
+ timezone: i
204
87
  };
205
88
  }
206
89
  case "month": {
207
- let o = Math.max(0, Math.floor(e.monthBuffer ?? 0)), s = n.PlainYearMonth.from({
208
- year: r.year,
209
- month: r.month
210
- }), c = v(s.subtract({ months: o }), i), l = v(s.add({ months: o }), i);
90
+ let a = Math.max(0, Math.floor(e.monthBuffer ?? 0)), o = u.PlainYearMonth.from({
91
+ year: n.year,
92
+ month: n.month
93
+ }), s = l(o.subtract({ months: a }), r), c = l(o.add({ months: a }), r);
211
94
  return {
212
95
  view: t,
213
- start: c[0].toString(),
214
- end: l[41].add({ days: 1 }).toString(),
215
- timezone: a
96
+ start: s[0].toString(),
97
+ end: c[41].add({ days: 1 }).toString(),
98
+ timezone: i
216
99
  };
217
100
  }
218
101
  case "monthList": {
219
- let e = v(n.PlainYearMonth.from({
220
- year: r.year,
221
- month: r.month
222
- }), i);
102
+ let e = l(u.PlainYearMonth.from({
103
+ year: n.year,
104
+ month: n.month
105
+ }), r);
223
106
  return {
224
107
  view: t,
225
108
  start: e[0].toString(),
226
109
  end: e[41].add({ days: 1 }).toString(),
227
- timezone: a
110
+ timezone: i
228
111
  };
229
112
  }
230
113
  case "agenda": {
231
- let n = e.agendaLengthDays ?? 30;
114
+ let r = e.agendaLengthDays ?? 30;
232
115
  return {
233
116
  view: t,
234
- start: r.toString(),
235
- end: r.add({ days: n }).toString(),
236
- timezone: a
117
+ start: n.toString(),
118
+ end: n.add({ days: r }).toString(),
119
+ timezone: i
237
120
  };
238
121
  }
239
122
  case "timeline": {
240
- let n = e.timelineRangeDays ?? 60;
123
+ let r = e.timelineRangeDays ?? 60;
241
124
  return {
242
125
  view: t,
243
- start: r.toString(),
244
- end: r.add({ days: n }).toString(),
245
- timezone: a
126
+ start: n.toString(),
127
+ end: n.add({ days: r }).toString(),
128
+ timezone: i
246
129
  };
247
130
  }
248
131
  case "year": {
249
- let e = n.PlainDate.from({
250
- year: r.year,
132
+ let e = u.PlainDate.from({
133
+ year: n.year,
251
134
  month: 1,
252
135
  day: 1
253
136
  });
@@ -255,25 +138,25 @@ function ie(e) {
255
138
  view: t,
256
139
  start: e.toString(),
257
140
  end: e.add({ years: 1 }).toString(),
258
- timezone: a
141
+ timezone: i
259
142
  };
260
143
  }
261
144
  default: throw Error(`Unsupported view: ${String(t)}`);
262
145
  }
263
146
  }
264
- function* ae(e) {
265
- let t = n.PlainDate.from(e.start), r = n.PlainDate.from(e.end);
266
- for (; n.PlainDate.compare(t, r) < 0;) yield t, t = t.add({ days: 1 });
147
+ function* v(e) {
148
+ let t = u.PlainDate.from(e.start), n = u.PlainDate.from(e.end);
149
+ for (; u.PlainDate.compare(t, n) < 0;) yield t, t = t.add({ days: 1 });
267
150
  }
268
- function oe(e) {
269
- let t = n.PlainDate.from(e.start);
270
- return n.PlainDate.from(e.end).since(t, { largestUnit: "days" }).days;
151
+ function y(e) {
152
+ let t = u.PlainDate.from(e.start);
153
+ return u.PlainDate.from(e.end).since(t, { largestUnit: "days" }).days;
271
154
  }
272
- function k(e, t) {
273
- let r = n.PlainDate.from(e.start), i = n.PlainDate.from(e.end);
274
- return n.PlainDate.compare(t, r) >= 0 && n.PlainDate.compare(t, i) < 0;
155
+ function b(e, t) {
156
+ let n = u.PlainDate.from(e.start), r = u.PlainDate.from(e.end);
157
+ return u.PlainDate.compare(t, n) >= 0 && u.PlainDate.compare(t, r) < 0;
275
158
  }
276
- function A(e, t, n, r = 30, i = 60, a = 1) {
159
+ function ee(e, t, n, r = 30, i = 60, a = 1) {
277
160
  let o = n === "next" ? 1 : -1;
278
161
  switch (e) {
279
162
  case "day": return t.add({ days: Math.max(1, a) * o });
@@ -290,7 +173,7 @@ function A(e, t, n, r = 30, i = 60, a = 1) {
290
173
  }
291
174
  //#endregion
292
175
  //#region src/core/dayColumns.ts
293
- function se(e, t = 1, n = 220, r = 64, i = 7) {
176
+ function te(e, t = 1, n = 220, r = 64, i = 7) {
294
177
  let a = Math.max(1, Math.round(t));
295
178
  if (!Number.isFinite(e) || e <= 0) return a;
296
179
  let o = Math.max(120, Number.isFinite(n) ? n : 220), s = Math.floor(Math.max(0, e - Math.max(0, r)) / o);
@@ -298,55 +181,55 @@ function se(e, t = 1, n = 220, r = 64, i = 7) {
298
181
  }
299
182
  //#endregion
300
183
  //#region src/core/rangeLabel.ts
301
- var ce = {
184
+ var ne = {
302
185
  month: "short",
303
186
  day: "numeric",
304
187
  year: "numeric",
305
188
  timeZone: "UTC"
306
- }, j = {
189
+ }, x = {
307
190
  weekday: "long",
308
191
  day: "numeric",
309
192
  month: "long",
310
193
  year: "numeric",
311
194
  timeZone: "UTC"
312
- }, le = {
195
+ }, re = {
313
196
  year: "numeric",
314
197
  month: "long",
315
198
  timeZone: "UTC"
316
199
  };
317
- function M(e) {
200
+ function S(e) {
318
201
  return new Date(Date.UTC(e.year, e.month - 1, e.day));
319
202
  }
320
- function ue(e) {
321
- let { view: t, window: r, cursor: i, locale: a } = e, o = {
203
+ function ie(e) {
204
+ let { view: t, window: n, cursor: r, locale: i } = e, a = {
322
205
  dateStyle: e.dateStyle,
323
206
  timeStyle: e.timeStyle,
324
207
  hour12: e.hour12
325
- }, s = n.PlainDate.from(r.start), c = n.PlainDate.from(r.end).subtract({ days: 1 }), l = () => new Intl.DateTimeFormat(a, u(ce, o)).formatRange(M(s), M(c)), d = (e) => new Intl.DateTimeFormat(a, u(e, o)).format(M(i));
208
+ }, o = u.PlainDate.from(n.start), c = u.PlainDate.from(n.end).subtract({ days: 1 }), l = () => new Intl.DateTimeFormat(i, s(ne, a)).formatRange(S(o), S(c)), d = (e) => new Intl.DateTimeFormat(i, s(e, a)).format(S(r));
326
209
  switch (t) {
327
- case "day": return s.until(c, { largestUnit: "day" }).days > 0 ? l() : d(j);
328
- case "dayAgenda": return d(j);
210
+ case "day": return o.until(c, { largestUnit: "day" }).days > 0 ? l() : d(x);
211
+ case "dayAgenda": return d(x);
329
212
  case "week":
330
213
  case "workWeek": return l();
331
214
  case "month":
332
- case "monthList": return d(le);
215
+ case "monthList": return d(re);
333
216
  case "agenda":
334
217
  case "timeline": return l();
335
- case "year": return String(i.year);
218
+ case "year": return String(r.year);
336
219
  default: return "";
337
220
  }
338
221
  }
339
222
  //#endregion
340
223
  //#region src/core/timedCardAnatomy.ts
341
- var de = 112, fe = Object.freeze({
224
+ var ae = 112, C = Object.freeze({
342
225
  compact: !0,
343
226
  titleLines: 1,
344
227
  showLocation: !1,
345
228
  showTime: !1
346
229
  });
347
- function pe(e) {
230
+ function w(e) {
348
231
  let { durationMinutes: t, visibleWidthPx: n, detailMinWidth: r, overlapped: i, hasLocation: a } = e;
349
- return i && r > 0 && n !== null && n < r ? fe : {
232
+ return i && r > 0 && n !== null && n < r ? C : {
350
233
  compact: !1,
351
234
  titleLines: t >= 70 ? 2 : 1,
352
235
  showLocation: a && t >= 34,
@@ -355,8 +238,8 @@ function pe(e) {
355
238
  }
356
239
  //#endregion
357
240
  //#region src/core/allDayBandCap.ts
358
- var me = 3;
359
- function he(e, { maxVisibleLanes: t, expanded: n, columnCount: r }) {
241
+ var T = 3;
242
+ function oe(e, { maxVisibleLanes: t, expanded: n, columnCount: r }) {
360
243
  let i = e.length === 0 ? 0 : e[0].laneCount, a = t === null ? null : Math.max(1, Math.floor(t)), o = a !== null && i > a;
361
244
  if (!o || n) return {
362
245
  bars: [...e],
@@ -385,7 +268,7 @@ function he(e, { maxVisibleLanes: t, expanded: n, columnCount: r }) {
385
268
  exceedsCap: o
386
269
  };
387
270
  }
388
- function ge(e, t, n) {
271
+ function se(e, t, n) {
389
272
  switch (t) {
390
273
  case "alwaysOneLane": return Math.max(1, e);
391
274
  case "reservesCap": return Math.max(n ?? 0, e);
@@ -394,7 +277,7 @@ function ge(e, t, n) {
394
277
  }
395
278
  //#endregion
396
279
  //#region src/core/cascadeLayout.ts
397
- function N(e, t = 100, n = 1.5, r = 18) {
280
+ function ce(e, t = 100, n = 1.5, r = 18) {
398
281
  let i = /* @__PURE__ */ new Map();
399
282
  if (!Number.isFinite(t) || t <= 0 || e.length === 0) return i;
400
283
  let a = Number.isFinite(n) ? Math.min(t / 2, Math.max(0, n)) : 0, o = Math.max(0, t - 2 * a), s = Number.isFinite(r) ? Math.max(0, r) : 0, c = e.map((e, t) => ({
@@ -433,26 +316,26 @@ function N(e, t = 100, n = 1.5, r = 18) {
433
316
  }
434
317
  return i;
435
318
  }
436
- var P = "#ffffff", F = "#000000", I = "var(--coar-text-base, #1a1c1f)";
437
- function L(e, t = {}) {
438
- let n = typeof t == "string" ? { fallback: t } : t, r = be(e);
439
- return r ? (n.policy ?? "wcag") === "apca" ? ye(r) : ve(r) : n.fallback ?? I;
319
+ var E = "#ffffff", D = "#000000", le = "var(--coar-text-base, #1a1c1f)";
320
+ function O(e, t = {}) {
321
+ let n = typeof t == "string" ? { fallback: t } : t, r = P(e);
322
+ return r ? (n.policy ?? "wcag") === "apca" ? N(r) : de(r) : n.fallback ?? le;
440
323
  }
441
- function _e({ background: e, textColor: t, policy: n, fallback: r }) {
442
- return typeof t == "string" && t.trim() !== "" ? t : L(e, {
324
+ function ue({ background: e, textColor: t, policy: n, fallback: r }) {
325
+ return typeof t == "string" && t.trim() !== "" ? t : O(e, {
443
326
  policy: n,
444
327
  fallback: r
445
328
  });
446
329
  }
447
- function ve(e) {
448
- let t = .2126 * R(e[0]) + .7152 * R(e[1]) + .0722 * R(e[2]);
449
- return 1.05 / (t + .05) >= (t + .05) / .05 ? P : F;
330
+ function de(e) {
331
+ let t = .2126 * k(e[0]) + .7152 * k(e[1]) + .0722 * k(e[2]);
332
+ return 1.05 / (t + .05) >= (t + .05) / .05 ? E : D;
450
333
  }
451
- function R(e) {
334
+ function k(e) {
452
335
  let t = e / 255;
453
336
  return t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
454
337
  }
455
- var z = {
338
+ var A = {
456
339
  exponent: 2.4,
457
340
  blackThreshold: .022,
458
341
  blackClamp: 1.414,
@@ -464,31 +347,31 @@ var z = {
464
347
  loClip: .1,
465
348
  loOffset: .027
466
349
  };
467
- function B(e) {
468
- let t = (e) => (e / 255) ** z.exponent, n = .2126729 * t(e[0]) + .7151522 * t(e[1]) + .072175 * t(e[2]);
469
- return n < z.blackThreshold ? n + (z.blackThreshold - n) ** z.blackClamp : n;
350
+ function j(e) {
351
+ let t = (e) => (e / 255) ** A.exponent, n = .2126729 * t(e[0]) + .7151522 * t(e[1]) + .072175 * t(e[2]);
352
+ return n < A.blackThreshold ? n + (A.blackThreshold - n) ** A.blackClamp : n;
470
353
  }
471
- function V(e, t) {
472
- let n = B(e), r = B(t);
354
+ function M(e, t) {
355
+ let n = j(e), r = j(t);
473
356
  if (r > n) {
474
- let e = (r ** z.normBg - n ** z.normText) * z.scale;
475
- return e < z.loClip ? 0 : (e - z.loOffset) * 100;
357
+ let e = (r ** A.normBg - n ** A.normText) * A.scale;
358
+ return e < A.loClip ? 0 : (e - A.loOffset) * 100;
476
359
  }
477
- let i = (r ** z.revBg - n ** z.revText) * z.scale;
478
- return i > -z.loClip ? 0 : (i + z.loOffset) * 100;
360
+ let i = (r ** A.revBg - n ** A.revText) * A.scale;
361
+ return i > -A.loClip ? 0 : (i + A.loOffset) * 100;
479
362
  }
480
- function ye(e) {
481
- return Math.abs(V([
363
+ function N(e) {
364
+ return Math.abs(M([
482
365
  255,
483
366
  255,
484
367
  255
485
- ], e)) >= Math.abs(V([
368
+ ], e)) >= Math.abs(M([
486
369
  0,
487
370
  0,
488
371
  0
489
- ], e)) ? P : F;
372
+ ], e)) ? E : D;
490
373
  }
491
- function be(e) {
374
+ function P(e) {
492
375
  let t = e.trim().match(/^#([\da-f]{3}|[\da-f]{6})$/i);
493
376
  if (!t) return null;
494
377
  let n = t[1].length === 3 ? [...t[1]].map((e) => e + e).join("") : t[1];
@@ -500,7 +383,7 @@ function be(e) {
500
383
  }
501
384
  //#endregion
502
385
  //#region src/core/overlapLayout.ts
503
- function xe(e, t) {
386
+ function F(e, t) {
504
387
  e.push(t);
505
388
  let n = e.length - 1;
506
389
  for (; n > 0;) {
@@ -509,7 +392,7 @@ function xe(e, t) {
509
392
  [e[t], e[n]] = [e[n], e[t]], n = t;
510
393
  }
511
394
  }
512
- function Se(e) {
395
+ function I(e) {
513
396
  let t = e[0], n = e.pop();
514
397
  if (e.length > 0) {
515
398
  e[0] = n;
@@ -522,7 +405,7 @@ function Se(e) {
522
405
  }
523
406
  return t;
524
407
  }
525
- function Ce(e, t, n, r) {
408
+ function L(e, t, n, r) {
526
409
  e.push(n), t.push(r);
527
410
  let i = e.length - 1;
528
411
  for (; i > 0;) {
@@ -531,10 +414,10 @@ function Ce(e, t, n, r) {
531
414
  [e[n], e[i]] = [e[i], e[n]], [t[n], t[i]] = [t[i], t[n]], i = n;
532
415
  }
533
416
  }
534
- function we(e) {
417
+ function R(e) {
535
418
  return e.length > 0 ? e[0] : Infinity;
536
419
  }
537
- function Te(e, t) {
420
+ function z(e, t) {
538
421
  let n = {
539
422
  end: e[0],
540
423
  lane: t[0]
@@ -550,7 +433,7 @@ function Te(e, t) {
550
433
  }
551
434
  return n;
552
435
  }
553
- function H(e) {
436
+ function B(e) {
554
437
  let t = e.length;
555
438
  if (t === 0) return {
556
439
  bars: [],
@@ -566,12 +449,12 @@ function H(e) {
566
449
  let r = [], i = [], a = [], o = 0, s = Array(t);
567
450
  for (let e = 0; e < t; e++) {
568
451
  let t = n[e];
569
- for (; we(r) < t.start;) {
570
- let { lane: e } = Te(r, i);
571
- xe(a, e);
452
+ for (; R(r) < t.start;) {
453
+ let { lane: e } = z(r, i);
454
+ F(a, e);
572
455
  }
573
456
  let c;
574
- c = a.length > 0 ? Se(a) : o++, Ce(r, i, t.end, c), s[e] = {
457
+ c = a.length > 0 ? I(a) : o++, L(r, i, t.end, c), s[e] = {
575
458
  id: t.id,
576
459
  lane: c,
577
460
  start: t.start,
@@ -585,19 +468,19 @@ function H(e) {
585
468
  }
586
469
  //#endregion
587
470
  //#region src/core/timeGridLayout.ts
588
- function U(e, n) {
471
+ function V(t, n) {
589
472
  let { day: r, timeRange: i, timezone: a } = n, [o, s] = i, c = o * 60, l = s * 60;
590
473
  if (l - c <= 0) return [];
591
474
  let u = [], d = /* @__PURE__ */ new Set();
592
- for (let n of e) {
593
- if (d.has(n.id) || (d.add(n.id), !t(n))) continue;
594
- let e = W(n.start, r, a), i;
595
- if (n.end) i = W(n.end, r, a);
475
+ for (let n of t) {
476
+ if (d.has(n.id) || (d.add(n.id), !e(n))) continue;
477
+ let t = U(n.start, r, a), i;
478
+ if (n.end) i = U(n.end, r, a);
596
479
  else {
597
- if (e < 0) continue;
598
- i = e + 30;
480
+ if (t < 0) continue;
481
+ i = t + 30;
599
482
  }
600
- let o = e, s = i, f = Math.max(o, c), p = Math.min(s, l);
483
+ let o = t, s = i, f = Math.max(o, c), p = Math.min(s, l);
601
484
  p > 1440 && (p = Math.min(p, 1440)), f < 0 && (f = 0), !(p <= f) && (p <= c || f >= l || u.push({
602
485
  event: n,
603
486
  startMinutes: f - c,
@@ -615,7 +498,7 @@ function U(e, n) {
615
498
  m.length > 0 && p.push(m);
616
499
  let g = /* @__PURE__ */ new Map();
617
500
  for (let e of p) {
618
- let t = H(e.map((e) => ({
501
+ let t = B(e.map((e) => ({
619
502
  id: e.event.id,
620
503
  start: e.startMinutes,
621
504
  end: Math.max(e.startMinutes, e.endMinutes - 1)
@@ -651,69 +534,69 @@ function U(e, n) {
651
534
  };
652
535
  });
653
536
  }
654
- function Ee(t, n) {
655
- let { days: i } = n;
656
- if (n.timezone, i.length === 0) return [];
537
+ function H(e, t) {
538
+ let { days: r } = t;
539
+ if (t.timezone, r.length === 0) return [];
657
540
  let a = /* @__PURE__ */ new Map();
658
- for (let e = 0; e < i.length; e++) a.set(b(i[e]), e);
659
- b(i[i.length - 1]);
660
- let o = [], s = /* @__PURE__ */ new Set();
661
- for (let n of t) {
662
- if (s.has(n.id) || (s.add(n.id), !e(n))) continue;
663
- let t = n.start, c;
664
- n.end ? (c = n.end.subtract({ days: 1 }), r.PlainDate.compare(c, t) < 0 && (c = t)) : c = t;
665
- let l = i[0], u = i[i.length - 1];
666
- if (r.PlainDate.compare(c, l) < 0 || r.PlainDate.compare(t, u) > 0) continue;
667
- let d = r.PlainDate.compare(t, l) < 0 ? l : t, f = r.PlainDate.compare(c, u) > 0 ? u : c, p = a.get(b(d)), m = a.get(b(f));
668
- p === void 0 || m === void 0 || o.push({
669
- event: n,
670
- startCol: p,
671
- endCol: m,
672
- clippedStart: r.PlainDate.compare(t, l) < 0,
673
- clippedEnd: r.PlainDate.compare(c, u) > 0
541
+ for (let e = 0; e < r.length; e++) a.set(n(r[e]), e);
542
+ n(r[r.length - 1]);
543
+ let s = [], c = /* @__PURE__ */ new Set();
544
+ for (let t of e) {
545
+ if (c.has(t.id) || (c.add(t.id), !i(t))) continue;
546
+ let e = t.start, l;
547
+ t.end ? (l = t.end.subtract({ days: 1 }), o.PlainDate.compare(l, e) < 0 && (l = e)) : l = e;
548
+ let u = r[0], d = r[r.length - 1];
549
+ if (o.PlainDate.compare(l, u) < 0 || o.PlainDate.compare(e, d) > 0) continue;
550
+ let f = o.PlainDate.compare(e, u) < 0 ? u : e, p = o.PlainDate.compare(l, d) > 0 ? d : l, m = a.get(n(f)), h = a.get(n(p));
551
+ m === void 0 || h === void 0 || s.push({
552
+ event: t,
553
+ startCol: m,
554
+ endCol: h,
555
+ clippedStart: o.PlainDate.compare(e, u) < 0,
556
+ clippedEnd: o.PlainDate.compare(l, d) > 0
674
557
  });
675
558
  }
676
- if (o.length === 0) return [];
677
- let c = H(o.map((e) => ({
559
+ if (s.length === 0) return [];
560
+ let l = B(s.map((e) => ({
678
561
  id: e.event.id,
679
562
  start: e.startCol,
680
563
  end: e.endCol
681
- }))), l = /* @__PURE__ */ new Map();
682
- for (let e of c.bars) l.set(e.id, e.lane);
683
- return o.map((e) => ({
564
+ }))), u = /* @__PURE__ */ new Map();
565
+ for (let e of l.bars) u.set(e.id, e.lane);
566
+ return s.map((e) => ({
684
567
  event: e.event,
685
- lane: l.get(e.event.id) ?? 0,
686
- laneCount: c.laneCount,
568
+ lane: u.get(e.event.id) ?? 0,
569
+ laneCount: l.laneCount,
687
570
  startCol: e.startCol,
688
571
  endCol: e.endCol,
689
572
  clippedStart: e.clippedStart,
690
573
  clippedEnd: e.clippedEnd
691
574
  }));
692
575
  }
693
- function W(e, t, n) {
694
- let i = e.withTimeZone(n), a = r.PlainDateTime.from({
576
+ function U(e, t, n) {
577
+ let r = e.withTimeZone(n), i = o.PlainDateTime.from({
695
578
  year: t.year,
696
579
  month: t.month,
697
580
  day: t.day,
698
581
  hour: 0,
699
582
  minute: 0
700
- }).toZonedDateTime(n, { disambiguation: "compatible" }), o = a.add({ days: 1 });
701
- return r.ZonedDateTime.compare(i, a) < 0 ? -1 : r.ZonedDateTime.compare(i, o) >= 0 ? 1441 : i.hour * 60 + i.minute + i.second / 60;
583
+ }).toZonedDateTime(n, { disambiguation: "compatible" }), a = i.add({ days: 1 });
584
+ return o.ZonedDateTime.compare(r, i) < 0 ? -1 : o.ZonedDateTime.compare(r, a) >= 0 ? 1441 : r.hour * 60 + r.minute + r.second / 60;
702
585
  }
703
586
  //#endregion
704
587
  //#region src/core/timeSelection.ts
705
- var G = 1440, De = {
588
+ var W = 1440, fe = {
706
589
  start: 0,
707
- end: G
590
+ end: W
708
591
  };
709
- function K(e, t) {
592
+ function G(e, t) {
710
593
  return t <= 0 ? e : Math.round(e / t) * t;
711
594
  }
712
- function q(e, t) {
595
+ function K(e, t) {
713
596
  return Math.min(t.end, Math.max(t.start, e));
714
597
  }
715
- function Oe(e, t, n) {
716
- return U(e, {
598
+ function pe(e, t, n) {
599
+ return V(e, {
717
600
  day: t,
718
601
  timeRange: [0, 24],
719
602
  timezone: n
@@ -723,8 +606,8 @@ function Oe(e, t, n) {
723
606
  event: e.event
724
607
  })).sort((e, t) => e.start - t.start || e.end - t.end);
725
608
  }
726
- function J(e, t, n = De) {
727
- let r = q(t, n), i = n.start, a = n.end;
609
+ function q(e, t, n = fe) {
610
+ let r = K(t, n), i = n.start, a = n.end;
728
611
  for (let t of e) if (!(t.end <= t.start)) {
729
612
  if (r >= t.start && r < t.end) return null;
730
613
  t.end <= r ? i = Math.max(i, t.end) : a = Math.min(a, t.start);
@@ -734,31 +617,31 @@ function J(e, t, n = De) {
734
617
  end: a
735
618
  } : null;
736
619
  }
737
- function Y() {
620
+ function J() {
738
621
  return (e) => {
739
622
  let t = e.slotDuration;
740
623
  if (e.phase === "drag") {
741
- let n = q(K(e.anchorMinute ?? e.minute, t), e.bounds), r = q(K(e.minute, t), e.bounds), i = {
624
+ let n = K(G(e.anchorMinute ?? e.minute, t), e.bounds), r = K(G(e.minute, t), e.bounds), i = {
742
625
  start: Math.min(n, r),
743
626
  end: Math.max(n, r)
744
627
  };
745
628
  return i.end > i.start ? i : null;
746
629
  }
747
- let n = q(Math.floor(e.minute / t) * t, e.bounds), r = Math.min(e.bounds.end, n + t);
630
+ let n = K(Math.floor(e.minute / t) * t, e.bounds), r = Math.min(e.bounds.end, n + t);
748
631
  return r > n ? {
749
632
  start: n,
750
633
  end: r
751
634
  } : null;
752
635
  };
753
636
  }
754
- function ke(e) {
755
- let t = Math.max(1, e.minutes), n = Y();
637
+ function me(e) {
638
+ let t = Math.max(1, e.minutes), n = J();
756
639
  return (r) => {
757
640
  let i = r.slotDuration, a = r.bounds;
758
641
  if (e.overlap) {
759
642
  if (r.phase === "drag") return n(r);
760
- let e = q(K(r.minute, i), a);
761
- e >= a.end && (e = q(Math.floor(r.minute / i) * i, a));
643
+ let e = K(G(r.minute, i), a);
644
+ e >= a.end && (e = K(Math.floor(r.minute / i) * i, a));
762
645
  let o = Math.min(a.end, e + t);
763
646
  return o > e ? {
764
647
  start: e,
@@ -766,19 +649,19 @@ function ke(e) {
766
649
  } : null;
767
650
  }
768
651
  if (r.phase === "drag") {
769
- let e = r.anchorMinute ?? r.minute, t = J(r.busy, e, a);
652
+ let e = r.anchorMinute ?? r.minute, t = q(r.busy, e, a);
770
653
  if (!t) return null;
771
- let n = q(K(e, i), t), o = q(K(r.minute, i), t), s = {
654
+ let n = K(G(e, i), t), o = K(G(r.minute, i), t), s = {
772
655
  start: Math.min(n, o),
773
656
  end: Math.max(n, o)
774
657
  };
775
658
  return s.end > s.start ? s : null;
776
659
  }
777
- let o = J(r.busy, r.minute, a);
660
+ let o = q(r.busy, r.minute, a);
778
661
  if (!o) return null;
779
662
  let s = r.busy.some((e) => e.end === o.start), c = r.busy.some((e) => e.start === o.end);
780
663
  if (s && c) return o;
781
- let l = K(r.minute, i);
664
+ let l = G(r.minute, i);
782
665
  l >= o.end && (l = Math.floor(r.minute / i) * i), l = Math.max(o.start, l), s && l - o.start < i && (l = o.start);
783
666
  let u = Math.min(o.end, l + t);
784
667
  return u > l ? {
@@ -787,28 +670,28 @@ function ke(e) {
787
670
  } : null;
788
671
  };
789
672
  }
790
- function Ae(e, t, n, i = "compatible") {
791
- let a = Math.round(t), o = a >= G ? e.add({ days: Math.floor(a / G) }) : e, s = a >= G ? a % G : Math.max(0, a), c = o.toPlainDateTime(r.PlainTime.from({
673
+ function he(e, t, n, r = "compatible") {
674
+ let i = Math.round(t), a = i >= W ? e.add({ days: Math.floor(i / W) }) : e, s = i >= W ? i % W : Math.max(0, i), c = a.toPlainDateTime(o.PlainTime.from({
792
675
  hour: Math.floor(s / 60),
793
676
  minute: s % 60
794
677
  }));
795
678
  try {
796
- return c.toZonedDateTime(n, { disambiguation: i });
679
+ return c.toZonedDateTime(n, { disambiguation: r });
797
680
  } catch {
798
681
  return null;
799
682
  }
800
683
  }
801
684
  //#endregion
802
685
  //#region src/core/monthGridLayout.ts
803
- var je = 2, Me = 6;
804
- function Ne(e, t) {
686
+ var ge = 2, _e = 6;
687
+ function ve(e, t) {
805
688
  switch (e) {
806
689
  case "compact": return 6;
807
690
  case "stacked": return 2;
808
691
  default: return t;
809
692
  }
810
693
  }
811
- function Pe(e, t) {
694
+ function ye(e, t) {
812
695
  if (!Number.isFinite(t) || t < 0) return {
813
696
  visible: e,
814
697
  hidden: 0
@@ -822,8 +705,8 @@ function Pe(e, t) {
822
705
  hidden: e.length - n
823
706
  };
824
707
  }
825
- var Fe = 2;
826
- function Ie(e, t) {
708
+ var be = 2;
709
+ function xe(e, t) {
827
710
  let n = e.length ? e[0].laneCount : 0, r = t === null || !Number.isFinite(t) || t < 0 ? n : Math.floor(t);
828
711
  if (n <= r) return {
829
712
  visible: e,
@@ -863,73 +746,73 @@ function Ie(e, t) {
863
746
  laneCount: r
864
747
  };
865
748
  }
866
- function Le(e, t) {
867
- let { gridDates: n, timezone: i } = t;
868
- if (n.length < 7 || n.length % 7 != 0) throw RangeError(`gridDates must contain complete seven-day rows (got ${n.length})`);
749
+ function Se(e, t) {
750
+ let { gridDates: r, timezone: i } = t;
751
+ if (r.length < 7 || r.length % 7 != 0) throw RangeError(`gridDates must contain complete seven-day rows (got ${r.length})`);
869
752
  let a = [];
870
- for (let e = 0; e < n.length / 7; e++) {
871
- let t = n.slice(e * 7, e * 7 + 7), r = /* @__PURE__ */ new Map();
872
- for (let e = 0; e < 7; e++) r.set(b(t[e]), e);
753
+ for (let e = 0; e < r.length / 7; e++) {
754
+ let t = r.slice(e * 7, e * 7 + 7), i = /* @__PURE__ */ new Map();
755
+ for (let e = 0; e < 7; e++) i.set(n(t[e]), e);
873
756
  a.push({
874
757
  rowIndex: e,
875
758
  days: t,
876
- dayKeyToCol: r,
759
+ dayKeyToCol: i,
877
760
  weekStart: t[0],
878
761
  weekEnd: t[6]
879
762
  });
880
763
  }
881
- let o = /* @__PURE__ */ new Set(), s = [], c = /* @__PURE__ */ new Map(), l = X(n[0]), u = X(n[n.length - 1]), d = t.visibleStart ? X(t.visibleStart) : -Infinity, f = t.visibleEnd ? X(t.visibleEnd) : Infinity;
764
+ let s = /* @__PURE__ */ new Set(), c = [], l = /* @__PURE__ */ new Map(), u = Y(r[0]), d = Y(r[r.length - 1]), f = t.visibleStart ? Y(t.visibleStart) : -Infinity, p = t.visibleEnd ? Y(t.visibleEnd) : Infinity;
882
765
  for (let t of e) {
883
- if (o.has(t.id)) continue;
884
- o.add(t.id);
885
- let e = Re(t, i);
886
- if (e.lastOrd < l || e.firstOrd > u) continue;
766
+ if (s.has(t.id)) continue;
767
+ s.add(t.id);
768
+ let e = Ce(t, i);
769
+ if (e.lastOrd < u || e.firstOrd > d) continue;
887
770
  let { firstDay: n, lastDayInclusive: r, isMultiDay: a } = e;
888
- if (a) s.push({
771
+ if (a) c.push({
889
772
  event: t,
890
773
  firstDay: n,
891
774
  lastDayInclusive: r
892
775
  });
893
- else if (e.firstOrd >= d && e.firstOrd <= f) {
894
- let n = e.firstKey, r = c.get(n), i = {
776
+ else if (e.firstOrd >= f && e.firstOrd <= p) {
777
+ let n = e.firstKey, r = l.get(n), i = {
895
778
  event: t,
896
779
  order: r ? r.length : 0
897
780
  };
898
- r ? r.push(i) : c.set(n, [i]);
781
+ r ? r.push(i) : l.set(n, [i]);
899
782
  }
900
783
  }
901
784
  return { weekRows: a.map((e) => {
902
- let n = [];
903
- for (let i of s) {
904
- if (r.PlainDate.compare(i.lastDayInclusive, e.weekStart) < 0 || r.PlainDate.compare(i.firstDay, e.weekEnd) > 0) continue;
785
+ let r = [];
786
+ for (let i of c) {
787
+ if (o.PlainDate.compare(i.lastDayInclusive, e.weekStart) < 0 || o.PlainDate.compare(i.firstDay, e.weekEnd) > 0) continue;
905
788
  let a = [
906
789
  i.firstDay,
907
790
  e.weekStart,
908
791
  t.visibleStart
909
- ].filter((e) => e !== void 0).reduce((e, t) => r.PlainDate.compare(t, e) > 0 ? t : e), o = [
792
+ ].filter((e) => e !== void 0).reduce((e, t) => o.PlainDate.compare(t, e) > 0 ? t : e), s = [
910
793
  i.lastDayInclusive,
911
794
  e.weekEnd,
912
795
  t.visibleEnd
913
- ].filter((e) => e !== void 0).reduce((e, t) => r.PlainDate.compare(t, e) < 0 ? t : e);
914
- if (r.PlainDate.compare(a, o) > 0) continue;
915
- let s = e.dayKeyToCol.get(b(a)), c = e.dayKeyToCol.get(b(o));
916
- s === void 0 || c === void 0 || n.push({
796
+ ].filter((e) => e !== void 0).reduce((e, t) => o.PlainDate.compare(t, e) < 0 ? t : e);
797
+ if (o.PlainDate.compare(a, s) > 0) continue;
798
+ let c = e.dayKeyToCol.get(n(a)), l = e.dayKeyToCol.get(n(s));
799
+ c === void 0 || l === void 0 || r.push({
917
800
  ...i,
918
- startCol: s,
919
- endCol: c,
920
- clippedStart: r.PlainDate.compare(i.firstDay, e.weekStart) < 0,
921
- clippedEnd: r.PlainDate.compare(i.lastDayInclusive, e.weekEnd) > 0
801
+ startCol: c,
802
+ endCol: l,
803
+ clippedStart: o.PlainDate.compare(i.firstDay, a) < 0,
804
+ clippedEnd: o.PlainDate.compare(i.lastDayInclusive, s) > 0
922
805
  });
923
806
  }
924
807
  let i = [];
925
- if (n.length > 0) {
926
- let e = H(n.map((e) => ({
808
+ if (r.length > 0) {
809
+ let e = B(r.map((e) => ({
927
810
  id: e.event.id,
928
811
  start: e.startCol,
929
812
  end: e.endCol
930
813
  }))), t = /* @__PURE__ */ new Map();
931
814
  for (let n of e.bars) t.set(n.id, n.lane);
932
- i = n.map((n) => ({
815
+ i = r.map((n) => ({
933
816
  event: n.event,
934
817
  lane: t.get(n.event.id) ?? 0,
935
818
  laneCount: e.laneCount,
@@ -940,9 +823,9 @@ function Le(e, t) {
940
823
  }));
941
824
  }
942
825
  let a = /* @__PURE__ */ new Map();
943
- for (let n of e.days) {
944
- if (t.visibleStart && r.PlainDate.compare(n, t.visibleStart) < 0 || t.visibleEnd && r.PlainDate.compare(n, t.visibleEnd) > 0) continue;
945
- let e = b(n), i = c.get(e);
826
+ for (let r of e.days) {
827
+ if (t.visibleStart && o.PlainDate.compare(r, t.visibleStart) < 0 || t.visibleEnd && o.PlainDate.compare(r, t.visibleEnd) > 0) continue;
828
+ let e = n(r), i = l.get(e);
946
829
  i && a.set(e, i);
947
830
  }
948
831
  return {
@@ -954,91 +837,95 @@ function Le(e, t) {
954
837
  };
955
838
  }) };
956
839
  }
957
- function X(e) {
840
+ function Y(e) {
958
841
  return e.year * 1e4 + e.month * 100 + e.day;
959
842
  }
960
- var Z = /* @__PURE__ */ new WeakMap();
961
- function Re(e, t) {
962
- let n = Z.get(e);
963
- if (n && n.start === e.start && n.end === e.end && n.timezone === t) return n.bounds;
964
- let { firstDay: r, lastDayInclusive: i, isMultiDay: a } = ze(e, t), o = {
965
- firstDay: r,
966
- lastDayInclusive: i,
967
- isMultiDay: a,
968
- firstOrd: X(r),
969
- lastOrd: X(i),
970
- firstKey: b(r)
843
+ var X = /* @__PURE__ */ new WeakMap();
844
+ function Ce(e, t) {
845
+ let r = X.get(e);
846
+ if (r && r.start === e.start && r.end === e.end && r.timezone === t) return r.bounds;
847
+ let { firstDay: i, lastDayInclusive: a, isMultiDay: o } = we(e, t), s = {
848
+ firstDay: i,
849
+ lastDayInclusive: a,
850
+ isMultiDay: o,
851
+ firstOrd: Y(i),
852
+ lastOrd: Y(a),
853
+ firstKey: n(i)
971
854
  };
972
- return Z.set(e, {
855
+ return X.set(e, {
973
856
  start: e.start,
974
857
  end: e.end,
975
858
  timezone: t,
976
- bounds: o
977
- }), o;
978
- }
979
- function ze(t, n) {
980
- if (e(t)) {
981
- let e = t.start, n;
982
- return t.end ? (n = t.end.subtract({ days: 1 }), r.PlainDate.compare(n, e) < 0 && (n = e)) : n = e, {
983
- firstDay: e,
859
+ bounds: s
860
+ }), s;
861
+ }
862
+ function we(e, t) {
863
+ if (i(e)) {
864
+ let t = e.start, n;
865
+ return e.end ? (n = e.end.subtract({ days: 1 }), o.PlainDate.compare(n, t) < 0 && (n = t)) : n = t, {
866
+ firstDay: t,
984
867
  lastDayInclusive: n,
985
- isMultiDay: r.PlainDate.compare(n, e) > 0
868
+ isMultiDay: o.PlainDate.compare(n, t) > 0
986
869
  };
987
870
  }
988
- let i = x(t.start, n);
871
+ let n = r(e.start, t), s = n;
872
+ if (e.end instanceof o.ZonedDateTime) {
873
+ let r = e.end.withTimeZone(t), i = r.toPlainDate();
874
+ s = a(r) ? i.subtract({ days: 1 }) : i, o.PlainDate.compare(s, n) < 0 && (s = n);
875
+ }
989
876
  return {
990
- firstDay: i,
991
- lastDayInclusive: i,
992
- isMultiDay: !1
877
+ firstDay: n,
878
+ lastDayInclusive: s,
879
+ isMultiDay: o.PlainDate.compare(s, n) > 0
993
880
  };
994
881
  }
995
882
  //#endregion
996
883
  //#region src/core/agendaLayout.ts
997
- function Be(t, n) {
998
- let { rangeStart: i, rangeEnd: a, timezone: o, showEmptyDays: s = !1 } = n, c = r.PlainDate.from(i), l = r.PlainDate.from(a);
999
- if (r.PlainDate.compare(l, c) <= 0) return [];
1000
- let u = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Set();
1001
- function f(e) {
1002
- let t = u.get(e);
884
+ function Te(e, t) {
885
+ let { rangeStart: r, rangeEnd: a, timezone: s, showEmptyDays: c = !1 } = t, l = o.PlainDate.from(r), u = o.PlainDate.from(a);
886
+ if (o.PlainDate.compare(u, l) <= 0) return [];
887
+ let d = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Set();
888
+ function p(e) {
889
+ let t = d.get(e);
1003
890
  return t || (t = {
1004
891
  allDay: [],
1005
892
  timed: []
1006
- }, u.set(e, t)), t;
893
+ }, d.set(e, t)), t;
1007
894
  }
1008
- for (let n of t) {
1009
- if (d.has(n.id)) continue;
1010
- d.add(n.id);
1011
- let t = e(n), { firstDay: i, lastDayInclusive: a } = Ve(n, o), s = r.PlainDate.compare(i, c) < 0 ? c : i, u = l.subtract({ days: 1 }), p = r.PlainDate.compare(a, u) > 0 ? u : a;
1012
- if (r.PlainDate.compare(p, s) < 0) continue;
1013
- let m = s, h = !0;
1014
- for (; r.PlainDate.compare(m, p) <= 0;) {
1015
- let e = f(b(m)), a = r.PlainDate.compare(m, i) > 0 || !h;
1016
- if (t) e.allDay.push({
1017
- event: n,
895
+ for (let t of e) {
896
+ if (f.has(t.id)) continue;
897
+ f.add(t.id);
898
+ let e = i(t), { firstDay: r, lastDayInclusive: a } = Ee(t, s), c = o.PlainDate.compare(r, l) < 0 ? l : r, d = u.subtract({ days: 1 }), m = o.PlainDate.compare(a, d) > 0 ? d : a;
899
+ if (o.PlainDate.compare(m, c) < 0) continue;
900
+ let h = c, g = !0;
901
+ for (; o.PlainDate.compare(h, m) <= 0;) {
902
+ let i = p(n(h)), a = o.PlainDate.compare(h, r) > 0 || !g;
903
+ if (e) i.allDay.push({
904
+ event: t,
1018
905
  isContinuation: a
1019
906
  });
1020
907
  else {
1021
- let t = a ? -Infinity : He(n, o);
1022
- e.timed.push({
1023
- event: n,
1024
- startMs: t,
908
+ let e = a ? -Infinity : De(t, s);
909
+ i.timed.push({
910
+ event: t,
911
+ startMs: e,
1025
912
  isContinuation: a
1026
913
  });
1027
914
  }
1028
- h = !1, m = m.add({ days: 1 });
915
+ g = !1, h = h.add({ days: 1 });
1029
916
  }
1030
917
  }
1031
- let p = [], m = c;
1032
- for (; r.PlainDate.compare(m, l) < 0;) {
1033
- let e = b(m), t = u.get(e), n = !!t && (t.allDay.length > 0 || t.timed.length > 0);
1034
- if ((n || s) && (p.push({
918
+ let m = [], h = l;
919
+ for (; o.PlainDate.compare(h, u) < 0;) {
920
+ let e = n(h), t = d.get(e), r = !!t && (t.allDay.length > 0 || t.timed.length > 0);
921
+ if ((r || c) && (m.push({
1035
922
  kind: "header",
1036
923
  date: e,
1037
- isEmpty: !n,
924
+ isEmpty: !r,
1038
925
  key: `h-${e}`
1039
926
  }), t)) {
1040
927
  t.allDay.sort((e, t) => e.event.id < t.event.id ? -1 : +(e.event.id > t.event.id));
1041
- for (let n of t.allDay) p.push({
928
+ for (let n of t.allDay) m.push({
1042
929
  kind: "event",
1043
930
  date: e,
1044
931
  event: n.event,
@@ -1046,7 +933,7 @@ function Be(t, n) {
1046
933
  key: `e-${e}-${n.event.id}`
1047
934
  });
1048
935
  t.timed.sort((e, t) => e.startMs === t.startMs ? e.event.id < t.event.id ? -1 : +(e.event.id > t.event.id) : e.startMs - t.startMs);
1049
- for (let n of t.timed) p.push({
936
+ for (let n of t.timed) m.push({
1050
937
  kind: "event",
1051
938
  date: e,
1052
939
  event: n.event,
@@ -1054,102 +941,102 @@ function Be(t, n) {
1054
941
  key: `e-${e}-${n.event.id}`
1055
942
  });
1056
943
  }
1057
- m = m.add({ days: 1 });
944
+ h = h.add({ days: 1 });
1058
945
  }
1059
- return p;
946
+ return m;
1060
947
  }
1061
- function Ve(t, n) {
1062
- if (e(t)) {
1063
- let e = t.start, n;
1064
- return t.end ? (n = t.end.subtract({ days: 1 }), r.PlainDate.compare(n, e) < 0 && (n = e)) : n = e, {
1065
- firstDay: e,
948
+ function Ee(e, t) {
949
+ if (i(e)) {
950
+ let t = e.start, n;
951
+ return e.end ? (n = e.end.subtract({ days: 1 }), o.PlainDate.compare(n, t) < 0 && (n = t)) : n = t, {
952
+ firstDay: t,
1066
953
  lastDayInclusive: n
1067
954
  };
1068
955
  }
1069
- let i = x(t.start, n), a = i;
1070
- if (t.end) {
1071
- let e = t.end.withTimeZone(n), o = e.toPlainDate();
1072
- e.hour === 0 && e.minute === 0 && e.second === 0 && e.millisecond === 0 && e.microsecond === 0 && e.nanosecond === 0 ? (a = o.subtract({ days: 1 }), r.PlainDate.compare(a, i) < 0 && (a = i)) : a = o;
956
+ let n = r(e.start, t), a = n;
957
+ if (e.end) {
958
+ let r = e.end.withTimeZone(t), i = r.toPlainDate();
959
+ r.hour === 0 && r.minute === 0 && r.second === 0 && r.millisecond === 0 && r.microsecond === 0 && r.nanosecond === 0 ? (a = i.subtract({ days: 1 }), o.PlainDate.compare(a, n) < 0 && (a = n)) : a = i;
1073
960
  }
1074
961
  return {
1075
- firstDay: i,
962
+ firstDay: n,
1076
963
  lastDayInclusive: a
1077
964
  };
1078
965
  }
1079
- function He(t, n) {
1080
- return e(t) ? t.start.toZonedDateTime({ timeZone: n }).epochMilliseconds : t.start.epochMilliseconds;
966
+ function De(e, t) {
967
+ return i(e) ? e.start.toZonedDateTime({ timeZone: t }).epochMilliseconds : e.start.epochMilliseconds;
1081
968
  }
1082
969
  //#endregion
1083
970
  //#region src/core/timelineLayout.ts
1084
- function Ue(e, t) {
1085
- let { windowStart: r, windowEnd: i, pixelsPerDay: a, rowHeight: o, displayZone: s } = t, c = r.until(i, { largestUnit: "days" }).days * a, l = /* @__PURE__ */ new Map();
971
+ function Oe(e, t) {
972
+ let { windowStart: n, windowEnd: r, pixelsPerDay: i, rowHeight: a, displayZone: o } = t, s = n.until(r, { largestUnit: "days" }).days * i, c = /* @__PURE__ */ new Map();
1086
973
  for (let t of e) {
1087
- let e = We(t), n = Q(t) !== null, r = l.get(e);
974
+ let e = Q(t), n = Z(t) !== null, r = c.get(e);
1088
975
  r || (r = {
1089
976
  events: [],
1090
977
  isRecurring: n
1091
- }, l.set(e, r)), r.events.push(t);
978
+ }, c.set(e, r)), r.events.push(t);
1092
979
  }
1093
- let u = [];
1094
- for (let [e, t] of l) {
1095
- let o = [];
980
+ let l = [];
981
+ for (let [e, t] of c) {
982
+ let a = [];
1096
983
  for (let e of t.events) {
1097
- let { startDate: t, endDate: c } = Ge(e, s);
1098
- if (n.PlainDate.compare(c, r) <= 0 || n.PlainDate.compare(t, i) >= 0) continue;
1099
- let l = n.PlainDate.compare(t, r) < 0, u = n.PlainDate.compare(c, i) > 0, d = l ? r : t, f = u ? i : c, p = r.until(d, { largestUnit: "days" }).days, m = d.until(f, { largestUnit: "days" }).days;
1100
- o.push({
984
+ let { startDate: t, endDate: s } = ke(e, o);
985
+ if (u.PlainDate.compare(s, n) <= 0 || u.PlainDate.compare(t, r) >= 0) continue;
986
+ let c = u.PlainDate.compare(t, n) < 0, l = u.PlainDate.compare(s, r) > 0, d = c ? n : t, f = l ? r : s, p = n.until(d, { largestUnit: "days" }).days, m = d.until(f, { largestUnit: "days" }).days;
987
+ a.push({
1101
988
  event: e,
1102
- left: p * a,
1103
- width: Math.max(1, m) * a,
1104
- clippedStart: l,
1105
- clippedEnd: u
989
+ left: p * i,
990
+ width: Math.max(1, m) * i,
991
+ clippedStart: c,
992
+ clippedEnd: l
1106
993
  });
1107
994
  }
1108
- o.length !== 0 && (o.sort((e, t) => e.left - t.left), u.push({
995
+ a.length !== 0 && (a.sort((e, t) => e.left - t.left), l.push({
1109
996
  id: e,
1110
997
  isRecurring: t.isRecurring,
1111
- bars: o,
1112
- firstLeft: o[0].left
998
+ bars: a,
999
+ firstLeft: a[0].left
1113
1000
  }));
1114
1001
  }
1115
- u.sort((e, t) => e.firstLeft === t.firstLeft ? e.id < t.id ? -1 : +(e.id > t.id) : e.firstLeft - t.firstLeft);
1116
- let d = u.map((e, t) => ({
1002
+ l.sort((e, t) => e.firstLeft === t.firstLeft ? e.id < t.id ? -1 : +(e.id > t.id) : e.firstLeft - t.firstLeft);
1003
+ let d = l.map((e, t) => ({
1117
1004
  id: e.id,
1118
- top: t * o,
1119
- height: o,
1005
+ top: t * a,
1006
+ height: a,
1120
1007
  isRecurring: e.isRecurring,
1121
1008
  bars: e.bars
1122
1009
  }));
1123
1010
  return {
1124
1011
  rows: d,
1125
- totalWidth: c,
1126
- totalHeight: d.length * o
1012
+ totalWidth: s,
1013
+ totalHeight: d.length * a
1127
1014
  };
1128
1015
  }
1129
- function Q(e) {
1016
+ function Z(e) {
1130
1017
  let t = e.meta?.__recurrence?.seriesId;
1131
1018
  return typeof t == "string" ? t : null;
1132
1019
  }
1133
- function We(e) {
1134
- return Q(e) ?? e.id;
1020
+ function Q(e) {
1021
+ return Z(e) ?? e.id;
1135
1022
  }
1136
- function Ge(e, t) {
1137
- if (e.start instanceof n.PlainDate) {
1023
+ function ke(e, t) {
1024
+ if (e.start instanceof u.PlainDate) {
1138
1025
  let t = e.start;
1139
1026
  return {
1140
1027
  startDate: t,
1141
- endDate: e.end instanceof n.PlainDate ? e.end : t.add({ days: 1 })
1028
+ endDate: e.end instanceof u.PlainDate ? e.end : t.add({ days: 1 })
1142
1029
  };
1143
1030
  }
1144
- let r = e.start.withTimeZone(t), i = e.end instanceof n.ZonedDateTime ? e.end.withTimeZone(t) : r.add({ minutes: 30 });
1031
+ let n = e.start.withTimeZone(t), r = e.end instanceof u.ZonedDateTime ? e.end.withTimeZone(t) : n.add({ minutes: 30 });
1145
1032
  return {
1146
- startDate: r.toPlainDate(),
1147
- endDate: i.toPlainDate().add({ days: 1 })
1033
+ startDate: n.toPlainDate(),
1034
+ endDate: r.toPlainDate().add({ days: 1 })
1148
1035
  };
1149
1036
  }
1150
1037
  //#endregion
1151
1038
  //#region src/core/measurementCache.ts
1152
- var Ke = class {
1039
+ var Ae = class {
1153
1040
  _itemCount;
1154
1041
  _estimatedSize;
1155
1042
  _measured;
@@ -1248,20 +1135,20 @@ function $(e, t, n, r = 3) {
1248
1135
  totalSize: i
1249
1136
  };
1250
1137
  }
1251
- function qe(e, t, n, r, i, a, o = 3, s = 3) {
1138
+ function je(e, t, n, r, i, a, o = 3, s = 3) {
1252
1139
  return {
1253
1140
  x: $(e, n, i, o),
1254
1141
  y: $(t, r, a, s)
1255
1142
  };
1256
1143
  }
1257
- function Je(e, t, n) {
1144
+ function Me(e, t, n) {
1258
1145
  if (n < 0) throw RangeError(`anchorIndex must be non-negative, got ${n}`);
1259
1146
  let r = e.prefixSum(n);
1260
1147
  return t.prefixSum(n) - r;
1261
1148
  }
1262
1149
  //#endregion
1263
1150
  //#region src/core/dragHitTest.ts
1264
- function Ye(e, t, n, r, i) {
1151
+ function Ne(e, t, n, r, i) {
1265
1152
  if (r.itemCount === 0) return {
1266
1153
  itemIndex: -1,
1267
1154
  ratio: NaN,
@@ -1292,7 +1179,7 @@ function Ye(e, t, n, r, i) {
1292
1179
  pixelInItem: u
1293
1180
  };
1294
1181
  }
1295
- function Xe(e, t, n, r = {}) {
1182
+ function Pe(e, t, n, r = {}) {
1296
1183
  let i = r.hotZone ?? 30, a = r.maxVelocity ?? 24, o = r.curve ?? "linear";
1297
1184
  if (i <= 0 || a <= 0) return {
1298
1185
  velocityX: 0,
@@ -1316,4 +1203,4 @@ function Xe(e, t, n, r = {}) {
1316
1203
  };
1317
1204
  }
1318
1205
  //#endregion
1319
- export { f as $, he as A, oe as B, U as C, N as D, L as E, re as F, O as G, D as H, ie as I, b as J, r as K, ae as L, pe as M, ue as N, me as O, se as P, m as Q, A as R, Ee as S, _e as T, E as U, w as V, T as W, o as X, l as Y, s as Z, Y as _, qe as a, ee as at, Ae as b, Be as c, p as ct, je as d, g as dt, x as et, Pe as f, _ as ft, Oe as g, Ne as h, $ as i, v as it, de as j, ge as k, Me as l, d as lt, Le as m, Ye as n, h as nt, Ke as o, ne as ot, Ie as p, u as q, Je as r, y as rt, Ue as s, te as st, Xe as t, C as tt, Fe as u, S as ut, J as v, H as w, K as x, ke as y, k as z };
1206
+ export { oe as A, y as B, V as C, ce as D, O as E, g as F, h as G, m as H, _ as I, v as L, w as M, ie as N, T as O, te as P, ee as R, H as S, ue as T, p as U, d as V, f as W, J as _, je as a, he as b, Te as c, ge as d, ye as f, pe as g, ve as h, $ as i, ae as j, se as k, _e as l, Se as m, Ne as n, Ae as o, xe as p, Me as r, Oe as s, Pe as t, be as u, q as v, B as w, G as x, me as y, b as z };