@innosolutions/inno-calendar 1.0.59 → 1.0.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/AGENT.md +1783 -1721
  2. package/README.md +279 -235
  3. package/dist/agenda-widget-D6E-NQK-.cjs +2 -0
  4. package/dist/agenda-widget-D6E-NQK-.cjs.map +1 -0
  5. package/dist/{agenda-widget-wrZfO67A.js → agenda-widget-DVj4CEZE.js} +1297 -1279
  6. package/dist/agenda-widget-DVj4CEZE.js.map +1 -0
  7. package/dist/components/event/event-card.d.ts.map +1 -1
  8. package/dist/components/index.cjs +1 -1
  9. package/dist/components/index.mjs +2 -2
  10. package/dist/components/primitives/scroll-navigator.d.ts +3 -1
  11. package/dist/components/primitives/scroll-navigator.d.ts.map +1 -1
  12. package/dist/components/views/timeline-view.d.ts +1 -1
  13. package/dist/components/views/timeline-view.d.ts.map +1 -1
  14. package/dist/core/context/inno-calendar-provider.d.ts.map +1 -1
  15. package/dist/core/context/slot-selection-context.d.ts +2 -0
  16. package/dist/core/context/slot-selection-context.d.ts.map +1 -1
  17. package/dist/core/index.cjs +1 -1
  18. package/dist/core/index.mjs +115 -114
  19. package/dist/core/types.d.ts +6 -18
  20. package/dist/core/types.d.ts.map +1 -1
  21. package/dist/core/utils/event-utils.d.ts.map +1 -1
  22. package/dist/core/utils/index.d.ts +1 -0
  23. package/dist/core/utils/index.d.ts.map +1 -1
  24. package/dist/core/utils/react-node-utils.d.ts +14 -0
  25. package/dist/core/utils/react-node-utils.d.ts.map +1 -0
  26. package/dist/index.cjs +1 -1
  27. package/dist/index.mjs +207 -206
  28. package/dist/position-utils-BQpbtF6N.cjs +2 -0
  29. package/dist/position-utils-BQpbtF6N.cjs.map +1 -0
  30. package/dist/position-utils-DMVQFywD.js +936 -0
  31. package/dist/position-utils-DMVQFywD.js.map +1 -0
  32. package/dist/presets/index.cjs +1 -1
  33. package/dist/presets/index.mjs +1 -1
  34. package/dist/slot-selection-context-CRstOosL.js +604 -0
  35. package/dist/slot-selection-context-CRstOosL.js.map +1 -0
  36. package/dist/slot-selection-context-DBCZI2Dn.cjs +2 -0
  37. package/dist/slot-selection-context-DBCZI2Dn.cjs.map +1 -0
  38. package/dist/styles/index.css +1 -1
  39. package/dist/{tailwind-calendar-CVuxWXLY.js → tailwind-calendar-CNhXkxzW.js} +80 -80
  40. package/dist/{tailwind-calendar-CVuxWXLY.js.map → tailwind-calendar-CNhXkxzW.js.map} +1 -1
  41. package/dist/tailwind-calendar-VRvPJQwa.cjs +2 -0
  42. package/dist/{tailwind-calendar-DoG6s3PJ.cjs.map → tailwind-calendar-VRvPJQwa.cjs.map} +1 -1
  43. package/dist/{use-calendar-Clo9DFK4.js → use-calendar-D8XaVe44.js} +69 -69
  44. package/dist/{use-calendar-Clo9DFK4.js.map → use-calendar-D8XaVe44.js.map} +1 -1
  45. package/dist/use-calendar-DkT1_V3j.cjs +2 -0
  46. package/dist/{use-calendar-BEuelmSu.cjs.map → use-calendar-DkT1_V3j.cjs.map} +1 -1
  47. package/dist/{use-slot-selection-BCZKnZSM.js → use-slot-selection-CWRk_17s.js} +32 -32
  48. package/dist/{use-slot-selection-BCZKnZSM.js.map → use-slot-selection-CWRk_17s.js.map} +1 -1
  49. package/dist/use-slot-selection-Dj_tWg1O.cjs +2 -0
  50. package/dist/{use-slot-selection-Bwqwjiaq.cjs.map → use-slot-selection-Dj_tWg1O.cjs.map} +1 -1
  51. package/dist/utils.cjs +1 -1
  52. package/dist/utils.cjs.map +1 -1
  53. package/dist/utils.mjs +117 -920
  54. package/dist/utils.mjs.map +1 -1
  55. package/dist/week-view-C1Vu2ErD.cjs +11 -0
  56. package/dist/week-view-C1Vu2ErD.cjs.map +1 -0
  57. package/dist/{week-view-C1FxF_nk.js → week-view-DY167Wok.js} +1084 -1043
  58. package/dist/week-view-DY167Wok.js.map +1 -0
  59. package/package.json +138 -138
  60. package/dist/agenda-widget-BxZU4eGL.cjs +0 -2
  61. package/dist/agenda-widget-BxZU4eGL.cjs.map +0 -1
  62. package/dist/agenda-widget-wrZfO67A.js.map +0 -1
  63. package/dist/slot-selection-context-BwghpxKA.js +0 -597
  64. package/dist/slot-selection-context-BwghpxKA.js.map +0 -1
  65. package/dist/slot-selection-context-CHSaOPWP.cjs +0 -2
  66. package/dist/slot-selection-context-CHSaOPWP.cjs.map +0 -1
  67. package/dist/tailwind-calendar-DoG6s3PJ.cjs +0 -2
  68. package/dist/use-calendar-BEuelmSu.cjs +0 -2
  69. package/dist/use-slot-selection-Bwqwjiaq.cjs +0 -2
  70. package/dist/week-view-Bzpbti1B.cjs +0 -11
  71. package/dist/week-view-Bzpbti1B.cjs.map +0 -1
  72. package/dist/week-view-C1FxF_nk.js.map +0 -1
package/dist/utils.mjs CHANGED
@@ -1,923 +1,120 @@
1
- const et = [
2
- "day",
3
- "week",
4
- "month",
5
- "year",
6
- "agenda",
7
- "resource-day",
8
- "resource-week",
9
- "timeline-day",
10
- "timeline-week"
11
- ], nt = {
12
- startHour: 8,
13
- endHour: 18,
14
- firstDayOfWeek: 1,
15
- // Monday
16
- slotDuration: 30,
17
- showWeekends: !0,
18
- timeFormat: "24h",
19
- badgeVariant: "colored",
20
- showCanceledEvents: !1
21
- }, rt = {
22
- startHour: 0,
23
- endHour: 24
24
- }, ot = {
25
- startHour: 8,
26
- endHour: 18
27
- }, at = {
28
- day: {
29
- type: "day",
30
- slotMinTime: "00:00",
31
- slotMaxTime: "24:00",
32
- slotDuration: "00:30:00",
33
- scrollTime: "08:00:00",
34
- allDaySlot: !0
35
- },
36
- week: {
37
- type: "week",
38
- slotMinTime: "00:00",
39
- slotMaxTime: "24:00",
40
- slotDuration: "00:30:00",
41
- scrollTime: "08:00:00",
42
- dayMaxEventRows: 3,
43
- allDaySlot: !0
44
- },
45
- month: {
46
- type: "month",
47
- dayMaxEventRows: 4,
48
- eventMaxStack: 3,
49
- allDaySlot: !1
50
- },
51
- year: {
52
- type: "year",
53
- dayMaxEventRows: 2,
54
- allDaySlot: !1
55
- },
56
- agenda: {
57
- type: "agenda",
58
- allDaySlot: !1
59
- },
60
- "resource-day": {
61
- type: "resource-day",
62
- slotMinTime: "00:00",
63
- slotMaxTime: "24:00",
64
- slotDuration: "00:30:00",
65
- scrollTime: "08:00:00",
66
- allDaySlot: !0
67
- },
68
- "resource-week": {
69
- type: "resource-week",
70
- slotMinTime: "00:00",
71
- slotMaxTime: "24:00",
72
- slotDuration: "00:30:00",
73
- scrollTime: "08:00:00",
74
- allDaySlot: !0
75
- },
76
- "timeline-day": {
77
- type: "timeline-day",
78
- slotDuration: "01:00:00"
79
- },
80
- "timeline-3day": {
81
- type: "timeline-3day",
82
- slotDuration: "01:00:00"
83
- },
84
- "timeline-week": {
85
- type: "timeline-week",
86
- slotDuration: "01:00:00"
87
- }
88
- }, st = {
89
- blue: "#3b82f6",
90
- green: "#22c55e",
91
- red: "#ef4444",
92
- yellow: "#eab308",
93
- purple: "#a855f7",
94
- orange: "#f97316",
95
- pink: "#ec4899",
96
- teal: "#14b8a6",
97
- gray: "#6b7280",
98
- indigo: "#6366f1"
99
- }, ut = {
100
- blue: { bg: "bg-blue-100", text: "text-blue-800", border: "border-blue-300" },
101
- green: { bg: "bg-green-100", text: "text-green-800", border: "border-green-300" },
102
- red: { bg: "bg-red-100", text: "text-red-800", border: "border-red-300" },
103
- yellow: { bg: "bg-yellow-100", text: "text-yellow-800", border: "border-yellow-300" },
104
- purple: { bg: "bg-purple-100", text: "text-purple-800", border: "border-purple-300" },
105
- orange: { bg: "bg-orange-100", text: "text-orange-800", border: "border-orange-300" },
106
- pink: { bg: "bg-pink-100", text: "text-pink-800", border: "border-pink-300" },
107
- teal: { bg: "bg-teal-100", text: "text-teal-800", border: "border-teal-300" },
108
- gray: { bg: "bg-gray-100", text: "text-gray-800", border: "border-gray-300" },
109
- indigo: { bg: "bg-indigo-100", text: "text-indigo-800", border: "border-indigo-300" }
110
- }, it = {
111
- "#3b82f6": "blue",
112
- "#22c55e": "green",
113
- "#ef4444": "red",
114
- "#eab308": "yellow",
115
- "#a855f7": "purple",
116
- "#f97316": "orange",
117
- "#ec4899": "pink",
118
- "#14b8a6": "teal",
119
- "#6b7280": "gray",
120
- "#6366f1": "indigo"
121
- }, ct = 24, lt = 60, N = 60 * 1e3, V = 60 * N, ft = 24 * V, I = 64, dt = 32, gt = 56, Dt = 200, P = 20;
122
- function g(t) {
123
- const e = new Date(t);
124
- return e.setHours(0, 0, 0, 0), e;
125
- }
126
- function T(t) {
127
- const e = new Date(t);
128
- return e.setHours(23, 59, 59, 999), e;
129
- }
130
- function l(t, e) {
131
- const n = new Date(t);
132
- return n.setDate(n.getDate() + e), n;
133
- }
134
- function mt(t, e) {
135
- return l(t, -e);
136
- }
137
- function p(t, e) {
138
- return t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth() && t.getDate() === e.getDate();
139
- }
140
- function U(t) {
141
- return p(t, /* @__PURE__ */ new Date());
142
- }
143
- function ht(t) {
144
- return t.getDay();
145
- }
146
- function W(t) {
147
- const e = t.getDay();
148
- return e === 0 || e === 6;
149
- }
150
- function D(t, e = 1) {
151
- const n = new Date(t), r = n.getDay(), o = (r < e ? 7 : 0) + r - e;
152
- return n.setDate(n.getDate() - o), n.setHours(0, 0, 0, 0), n;
153
- }
154
- function w(t, e = 1) {
155
- const n = D(t, e);
156
- return n.setDate(n.getDate() + 6), n.setHours(23, 59, 59, 999), n;
157
- }
158
- function k(t, e) {
159
- return l(t, e * 7);
160
- }
161
- function yt(t, e) {
162
- return l(t, -e * 7);
163
- }
164
- function pt(t) {
165
- const e = new Date(Date.UTC(t.getFullYear(), t.getMonth(), t.getDate())), n = e.getUTCDay() || 7;
166
- e.setUTCDate(e.getUTCDate() + 4 - n);
167
- const r = new Date(Date.UTC(e.getUTCFullYear(), 0, 1));
168
- return Math.ceil(((e.getTime() - r.getTime()) / 864e5 + 1) / 7);
169
- }
170
- function Tt(t, e, n = 1) {
171
- const r = D(t, n), o = D(e, n);
172
- return p(r, o);
173
- }
174
- function E(t) {
175
- const e = new Date(t);
176
- return e.setDate(1), e.setHours(0, 0, 0, 0), e;
177
- }
178
- function S(t) {
179
- const e = new Date(t.getFullYear(), t.getMonth() + 1, 0);
180
- return e.setHours(23, 59, 59, 999), e;
181
- }
182
- function x(t, e) {
183
- const n = new Date(t);
184
- return n.setMonth(n.getMonth() + e), n;
185
- }
186
- function wt(t, e) {
187
- return x(t, -e);
188
- }
189
- function Mt(t) {
190
- return new Date(t.getFullYear(), t.getMonth() + 1, 0).getDate();
191
- }
192
- function $(t, e) {
193
- return t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth();
194
- }
195
- function Y(t) {
196
- return new Date(t.getFullYear(), 0, 1, 0, 0, 0, 0);
197
- }
198
- function G(t) {
199
- return new Date(t.getFullYear(), 11, 31, 23, 59, 59, 999);
200
- }
201
- function C(t, e) {
202
- const n = new Date(t);
203
- return n.setFullYear(n.getFullYear() + e), n;
204
- }
205
- function Et(t, e) {
206
- return C(t, -e);
207
- }
208
- function St(t, e) {
209
- return t.getFullYear() === e.getFullYear();
210
- }
211
- function z(t, e) {
212
- const n = new Date(t);
213
- return n.setHours(n.getHours() + e), n;
214
- }
215
- function bt(t, e) {
216
- const n = new Date(t);
217
- return n.setMinutes(n.getMinutes() + e), n;
218
- }
219
- function Ht(t, e, n = 0, r = 0) {
220
- const o = new Date(t);
221
- return o.setHours(e, n, r, 0), o;
222
- }
223
- function kt(t) {
224
- return t.getHours() + t.getMinutes() / 60;
225
- }
226
- function It(t, e) {
227
- return t.getTime() < e.getTime();
228
- }
229
- function xt(t, e) {
230
- return t.getTime() > e.getTime();
231
- }
232
- function Ft(t, e, n) {
233
- const r = t.getTime();
234
- return r >= e.getTime() && r <= n.getTime();
235
- }
236
- function $t(t) {
237
- if (t.length !== 0)
238
- return t.reduce((e, n) => n < e ? n : e);
239
- }
240
- function Ct(t) {
241
- if (t.length !== 0)
242
- return t.reduce((e, n) => n > e ? n : e);
243
- }
244
- function O(t, e) {
245
- return t.getTime() - e.getTime();
246
- }
247
- function Ot(t, e) {
248
- return Math.floor(O(t, e) / 6e4);
249
- }
250
- function _t(t, e) {
251
- return Math.floor(O(t, e) / 36e5);
252
- }
253
- function At(t, e) {
254
- const n = g(t), r = g(e);
255
- return Math.floor(O(n, r) / 864e5);
256
- }
257
- function H(t, e = "24h") {
258
- const n = t.getHours(), r = t.getMinutes();
259
- if (e === "12h") {
260
- const o = n >= 12 ? "PM" : "AM";
261
- return `${n % 12 || 12}:${r.toString().padStart(2, "0")} ${o}`;
262
- }
263
- return `${n.toString().padStart(2, "0")}:${r.toString().padStart(2, "0")}`;
264
- }
265
- function Rt(t) {
266
- const e = t.getFullYear(), n = (t.getMonth() + 1).toString().padStart(2, "0"), r = t.getDate().toString().padStart(2, "0");
267
- return `${e}-${n}-${r}`;
268
- }
269
- function Ut(t) {
270
- return new Date(t);
271
- }
272
- function J(t, e) {
273
- const n = [];
274
- let r = g(t);
275
- const o = g(e);
276
- for (; r <= o; )
277
- n.push(new Date(r)), r = l(r, 1);
278
- return n;
279
- }
280
- function Wt(t, e) {
281
- const n = [];
282
- let r = new Date(t);
283
- for (; r <= e; )
284
- n.push(new Date(r)), r = z(r, 1);
285
- return n;
286
- }
287
- function Yt(t = "en-US", e = "short") {
288
- const n = new Intl.DateTimeFormat(t, { weekday: e }), r = [], o = new Date(2024, 0, 7);
289
- for (let a = 0; a < 7; a++)
290
- r.push(n.format(l(o, a)));
291
- return r;
292
- }
293
- function vt(t = "en-US", e = "long") {
294
- const n = new Intl.DateTimeFormat(t, { month: e }), r = [];
295
- for (let o = 0; o < 12; o++)
296
- r.push(n.format(new Date(2024, o, 1)));
297
- return r;
298
- }
299
- function Lt(t) {
300
- const e = [];
301
- for (let n = t.startHour; n <= t.endHour; n++)
302
- e.push(n);
303
- return e;
304
- }
305
- function Bt(t, e = "24h") {
306
- if (e === "12h") {
307
- const n = t >= 12 ? "PM" : "AM";
308
- return `${t % 12 || 12} ${n}`;
309
- }
310
- return `${String(t).padStart(2, "0")}:00`;
311
- }
312
- function Nt(t, e = 1) {
313
- const n = D(t, e), r = [];
314
- for (let o = 0; o < 7; o++)
315
- r.push(l(n, o));
316
- return r;
317
- }
318
- function Vt(t, e = 1) {
319
- const n = E(t), r = S(t), o = D(n, e), a = w(r, e), s = t.getMonth();
320
- return J(o, a).map((c) => ({
321
- date: c,
322
- isCurrentMonth: c.getMonth() === s,
323
- isWeekend: c.getDay() === 0 || c.getDay() === 6
324
- }));
325
- }
326
- function _(t) {
327
- if (t.isAllDay === !0) return !0;
328
- if (t.isAllDay === !1) return !1;
329
- const e = t.startDate.getHours(), n = t.startDate.getMinutes(), r = t.endDate.getHours(), o = t.endDate.getMinutes(), a = e === 0 && n === 0, s = r === 0 && o === 0 || // midnight next day
330
- r === 23 && o >= 59;
331
- return !!(a && s);
332
- }
333
- function Pt(t) {
334
- const e = [], n = [];
335
- for (const r of t)
336
- _(r) ? n.push(r) : p(r.startDate, r.endDate) ? e.push(r) : n.push(r);
337
- return { singleDay: e, multiDay: n };
338
- }
339
- function Gt(t, e, n) {
340
- return t.filter((r) => r.startDate <= n && r.endDate >= e);
341
- }
342
- function zt(t, e, n) {
343
- if (!n) return !0;
344
- const r = t.getDay(), o = n[r];
345
- return !o || !(o.enabled !== !1) || o.from === o.to ? !1 : e >= o.from && e < o.to;
346
- }
347
- function Jt(t, e) {
348
- const n = t.getDay(), r = e[n];
349
- return !r || !(r.enabled !== !1) || r.from === r.to ? null : { from: r.from, to: r.to };
350
- }
351
- function Kt(t) {
352
- const e = [];
353
- for (let n = 0; n < 12; n++)
354
- e.push(new Date(t, n, 1));
355
- return e;
356
- }
357
- function K(t, e, n) {
358
- const r = g(e), o = T(n);
359
- return t.filter((a) => {
360
- const s = a.startDate, u = a.endDate;
361
- return s <= o && u >= r;
362
- });
363
- }
364
- function X(t, e) {
365
- return e.length === 0 ? t : t.filter(
366
- (n) => n.scheduleTypeId !== void 0 && e.includes(n.scheduleTypeId)
367
- );
368
- }
369
- function j(t, e) {
370
- return e.length === 0 ? t : t.filter(
371
- (n) => n.resourceId !== void 0 && e.includes(n.resourceId)
372
- );
373
- }
374
- function q(t, e) {
375
- if (!e.trim()) return t;
376
- const n = e.toLowerCase();
377
- return t.filter((r) => {
378
- const o = r.title.toLowerCase().includes(n), a = r.description?.toLowerCase().includes(n);
379
- return o || a;
380
- });
381
- }
382
- function Q(t) {
383
- return t.filter((e) => !e.isCanceled);
384
- }
385
- function Xt(t, e) {
386
- let n = [...t];
387
- return e.dateRange && (n = K(
388
- n,
389
- e.dateRange.startDate,
390
- e.dateRange.endDate
391
- )), e.scheduleTypeIds && e.scheduleTypeIds.length > 0 && (n = X(n, e.scheduleTypeIds)), e.resourceIds && e.resourceIds.length > 0 && (n = j(n, e.resourceIds)), e.search && (n = q(n, e.search)), e.showCanceled || (n = Q(n)), n;
392
- }
393
- function jt(t) {
394
- return [...t].sort((e, n) => e.startDate.getTime() - n.startDate.getTime());
395
- }
396
- function qt(t) {
397
- return [...t].sort((e, n) => e.endDate.getTime() - n.endDate.getTime());
398
- }
399
- function Qt(t) {
400
- return [...t].sort((e, n) => {
401
- const r = e.endDate.getTime() - e.startDate.getTime();
402
- return n.endDate.getTime() - n.startDate.getTime() - r;
403
- });
404
- }
405
- function Zt(t) {
406
- const e = /* @__PURE__ */ new Map();
407
- for (const n of t) {
408
- const r = g(n.startDate).toISOString(), o = e.get(r) ?? [];
409
- o.push(n), e.set(r, o);
410
- }
411
- return e;
412
- }
413
- function te(t) {
414
- const e = /* @__PURE__ */ new Map();
415
- for (const n of t) {
416
- const r = e.get(n.scheduleTypeId) ?? [];
417
- r.push(n), e.set(n.scheduleTypeId, r);
418
- }
419
- return e;
420
- }
421
- function ee(t) {
422
- const e = /* @__PURE__ */ new Map();
423
- for (const n of t) {
424
- const r = e.get(n.resourceId) ?? [];
425
- r.push(n), e.set(n.resourceId, r);
426
- }
427
- return e;
428
- }
429
- function ne(t, e) {
430
- return t.filter((n) => {
431
- const r = g(e), o = T(e);
432
- return n.startDate <= o && n.endDate >= r;
433
- });
434
- }
435
- function re(t) {
436
- return t.filter((e) => e.isAllDay);
437
- }
438
- function oe(t) {
439
- return t.filter((e) => !e.isAllDay);
440
- }
441
- function ae(t) {
442
- return t.filter((e) => e.isMultiDay ? !0 : !p(e.startDate, e.endDate));
443
- }
444
- function se(t) {
445
- return t.isMultiDay ? !0 : !p(t.startDate, t.endDate);
446
- }
447
- function ue(t) {
448
- return Math.floor((t.endDate.getTime() - t.startDate.getTime()) / 6e4);
449
- }
450
- function ie(t, e = "blue") {
451
- return t.color ?? e;
452
- }
453
- function ce(t, e, n = "blue") {
454
- if (t.color) return t.color;
455
- if (t.scheduleTypeId !== void 0 && e) {
456
- const r = e.get(t.scheduleTypeId);
457
- if (r) return r;
458
- }
459
- return n;
460
- }
461
- function le(t) {
462
- if (_(t)) {
463
- if (p(t.startDate, t.endDate))
464
- return "All day";
465
- const n = t.startDate.toLocaleDateString(void 0, {
466
- month: "short",
467
- day: "numeric"
468
- }), r = t.endDate.toLocaleDateString(void 0, {
469
- month: "short",
470
- day: "numeric"
471
- });
472
- return `All day · ${n} – ${r}`;
473
- }
474
- if (!p(t.startDate, t.endDate)) {
475
- const n = t.startDate.toLocaleDateString(void 0, {
476
- month: "short",
477
- day: "numeric"
478
- }), r = t.endDate.toLocaleDateString(void 0, {
479
- month: "short",
480
- day: "numeric"
481
- });
482
- return `${n}, ${H(t.startDate)} – ${r}, ${H(t.endDate)}`;
483
- }
484
- return `${H(t.startDate)} - ${H(t.endDate)}`;
485
- }
486
- function fe(t) {
487
- return !_(t);
488
- }
489
- function Z(t, e, n = 1) {
490
- switch (e) {
491
- case "day":
492
- case "resource-day":
493
- case "timeline-day":
494
- return {
495
- startDate: g(t),
496
- endDate: T(t)
497
- };
498
- case "week":
499
- case "resource-week":
500
- case "timeline-week":
501
- return {
502
- startDate: D(t, n),
503
- endDate: w(t, n)
504
- };
505
- case "month": {
506
- const r = E(t), o = S(t);
507
- return {
508
- startDate: D(r, n),
509
- endDate: w(o, n)
510
- };
511
- }
512
- case "timeline-3day":
513
- return {
514
- startDate: g(t),
515
- endDate: T(l(t, 2))
516
- };
517
- case "year":
518
- return {
519
- startDate: Y(t),
520
- endDate: G(t)
521
- };
522
- case "agenda":
523
- return {
524
- startDate: g(t),
525
- endDate: T(l(t, 29))
526
- };
527
- default:
528
- return {
529
- startDate: g(t),
530
- endDate: T(t)
531
- };
532
- }
533
- }
534
- function de(t, e) {
535
- switch (e) {
536
- case "day":
537
- case "resource-day":
538
- case "timeline-day":
539
- return l(t, 1);
540
- case "timeline-3day":
541
- return l(t, 3);
542
- case "week":
543
- case "resource-week":
544
- case "timeline-week":
545
- return k(t, 1);
546
- case "month":
547
- return x(t, 1);
548
- case "year":
549
- return C(t, 1);
550
- case "agenda":
551
- return k(t, 1);
552
- default:
553
- return l(t, 1);
554
- }
555
- }
556
- function ge(t, e) {
557
- switch (e) {
558
- case "day":
559
- case "resource-day":
560
- case "timeline-day":
561
- return l(t, -1);
562
- case "timeline-3day":
563
- return l(t, -3);
564
- case "week":
565
- case "resource-week":
566
- case "timeline-week":
567
- return k(t, -1);
568
- case "month":
569
- return x(t, -1);
570
- case "year":
571
- return C(t, -1);
572
- case "agenda":
573
- return k(t, -1);
574
- default:
575
- return l(t, -1);
576
- }
577
- }
578
- function De() {
579
- return g(/* @__PURE__ */ new Date());
580
- }
581
- function me(t, e = 1) {
582
- const n = E(t), r = S(t), o = D(n, e), a = w(r, e), s = [];
583
- let u = o;
584
- for (; u <= a; )
585
- s.push({
586
- date: new Date(u),
587
- isToday: U(u),
588
- isCurrentMonth: $(u, t),
589
- isWeekend: W(u),
590
- dayOfWeek: u.getDay()
591
- }), u = l(u, 1);
592
- return s;
593
- }
594
- function he(t, e = 1) {
595
- const n = D(t, e), r = [];
596
- for (let o = 0; o < 7; o++) {
597
- const a = l(n, o);
598
- r.push({
599
- date: a,
600
- isToday: U(a),
601
- isCurrentMonth: $(a, t),
602
- isWeekend: W(a),
603
- dayOfWeek: a.getDay()
604
- });
605
- }
606
- return r;
607
- }
608
- function ye(t) {
609
- const e = Y(t), n = [];
610
- for (let r = 0; r < 12; r++) {
611
- const o = x(e, r);
612
- n.push({
613
- date: o,
614
- isToday: $(o, /* @__PURE__ */ new Date()),
615
- isCurrentMonth: !0,
616
- isWeekend: !1,
617
- dayOfWeek: o.getDay()
618
- });
619
- }
620
- return n;
621
- }
622
- function pe(t, e, n = 30) {
623
- const r = [], o = 60 / n;
624
- for (let a = t; a < e; a++)
625
- for (let s = 0; s < o; s++) {
626
- const u = s * n;
627
- r.push({
628
- hour: a,
629
- minute: u,
630
- label: `${a.toString().padStart(2, "0")}:${u.toString().padStart(2, "0")}`
631
- });
632
- }
633
- return r;
634
- }
635
- function Te(t, e, n = "24h") {
636
- const r = [];
637
- for (let o = t; o <= e; o++) {
638
- let a;
639
- if (n === "12h") {
640
- const s = o >= 12 ? "PM" : "AM";
641
- a = `${o % 12 || 12} ${s}`;
642
- } else
643
- a = `${o.toString().padStart(2, "0")}:00`;
644
- r.push({ hour: o, label: a });
645
- }
646
- return r;
647
- }
648
- function we(t, e, n = "en-US") {
649
- const r = new Intl.DateTimeFormat(n, {
650
- weekday: "short",
651
- month: "short",
652
- day: "numeric"
653
- }), o = new Intl.DateTimeFormat(n, { month: "short", day: "numeric" });
654
- switch (e) {
655
- case "day":
656
- case "resource-day":
657
- case "timeline-day":
658
- return r.format(t);
659
- case "timeline-3day": {
660
- const a = g(t), s = l(t, 2);
661
- return `${o.format(a)} - ${o.format(s)}`;
662
- }
663
- case "week":
664
- case "resource-week":
665
- case "timeline-week": {
666
- const a = D(t, 1), s = w(t, 1);
667
- return `${o.format(a)} - ${o.format(s)}`;
668
- }
669
- case "month": {
670
- const a = E(t), s = S(t);
671
- return `${o.format(a)} - ${o.format(s)}`;
672
- }
673
- case "year":
674
- return `Jan 1 - Dec 31, ${t.getFullYear()}`;
675
- case "agenda": {
676
- const a = E(t), s = S(t);
677
- return `${o.format(a)} - ${o.format(s)}`;
678
- }
679
- default:
680
- return "";
681
- }
682
- }
683
- function Me(t, e, n, r = 1) {
684
- const o = Z(e, n, r);
685
- return t.filter((a) => a.startDate <= o.endDate && a.endDate >= o.startDate).length;
686
- }
687
- function Ee(t, e, n = "en-US") {
688
- const r = new Intl.DateTimeFormat(n, { month: "long", year: "numeric" }), o = new Intl.DateTimeFormat(n, {
689
- weekday: "long",
690
- month: "long",
691
- day: "numeric",
692
- year: "numeric"
693
- });
694
- switch (e) {
695
- case "day":
696
- case "resource-day":
697
- case "timeline-day":
698
- return o.format(t);
699
- case "week":
700
- case "resource-week":
701
- case "timeline-week": {
702
- const a = D(t, 1), s = w(t, 1), u = new Intl.DateTimeFormat(n, { month: "short" }).format(a), c = new Intl.DateTimeFormat(n, { month: "short" }).format(s), i = a.getFullYear();
703
- return u === c ? `${u} ${a.getDate()} - ${s.getDate()}, ${i}` : `${u} ${a.getDate()} - ${c} ${s.getDate()}, ${i}`;
704
- }
705
- case "month":
706
- return r.format(t);
707
- case "year":
708
- return t.getFullYear().toString();
709
- case "agenda":
710
- return `Agenda - ${r.format(t)}`;
711
- default:
712
- return r.format(t);
713
- }
714
- }
715
- function Se(t = 1, e = "short", n = "en-US") {
716
- const r = new Intl.DateTimeFormat(n, { weekday: e }), o = [], a = new Date(2024, 0, 7);
717
- for (let s = 0; s < 7; s++) {
718
- const u = (t + s) % 7, c = l(a, u);
719
- o.push({
720
- dayOfWeek: u,
721
- label: r.format(c)
722
- });
723
- }
724
- return o;
725
- }
726
- function tt(t, e, n, r = I) {
727
- const { startHour: o, endHour: a } = n, s = a - o, u = s * r, c = t.startDate.getHours() + t.startDate.getMinutes() / 60, i = t.endDate.getHours() + t.endDate.getMinutes() / 60, d = Math.max(c, o), y = Math.min(i, a), m = (d - o) / s * u, h = (y - o) / s * u, f = Math.max(h - m, P);
728
- return {
729
- top: m,
730
- height: f,
731
- left: 0,
732
- width: 100,
733
- zIndex: 1
734
- };
735
- }
736
- function be(t, e, n, r = I) {
737
- if (t.length === 0) return [];
738
- const o = [...t].sort((i, d) => {
739
- const y = i.startDate.getTime() - d.startDate.getTime();
740
- if (y !== 0) return y;
741
- const m = i.endDate.getTime() - i.startDate.getTime();
742
- return d.endDate.getTime() - d.startDate.getTime() - m;
743
- }), a = [];
744
- let s = [], u = 0;
745
- for (const i of o)
746
- s.length === 0 || i.startDate.getTime() < u ? (s.push(i), u = Math.max(u, i.endDate.getTime())) : (a.push(s), s = [i], u = i.endDate.getTime());
747
- s.length > 0 && a.push(s);
748
- const c = [];
749
- for (const i of a) {
750
- const d = [];
751
- for (const f of i) {
752
- const v = f.startDate.getTime(), L = f.endDate.getTime();
753
- let M = -1;
754
- for (let b = 0; b < d.length; b++) {
755
- const F = d[b];
756
- if (!F) continue;
757
- const R = F[F.length - 1];
758
- if (R && R.endTime <= v) {
759
- M = b;
760
- break;
761
- }
762
- }
763
- M === -1 && (M = d.length, d.push([]));
764
- const A = d[M];
765
- A && A.push({ event: f, endTime: L });
766
- const B = tt(f, e, n, r);
767
- c.push({
768
- event: f,
769
- position: B,
770
- column: M,
771
- columnSpan: 1
772
- });
773
- }
774
- const m = 100 / d.length, h = new Set(i.map((f) => f.id));
775
- for (const f of c)
776
- h.has(f.event.id) && (f.position.left = f.column * m, f.position.width = m * f.columnSpan, f.position.zIndex = f.column + 1);
777
- }
778
- return c;
779
- }
780
- function He(t, e, n, r = I, o = 30) {
781
- const { startHour: a, endHour: s } = n, u = s - a, c = u * r, i = t / c * u, y = (a + i) * 60, m = Math.round(y / o) * o, h = new Date(e);
782
- return h.setHours(0, 0, 0, 0), h.setMinutes(m), h;
783
- }
784
- function ke(t, e, n = I) {
785
- const { startHour: r, endHour: o } = e, a = o - r, s = a * n, u = t.getHours() + t.getMinutes() / 60;
786
- return (Math.max(r, Math.min(u, o)) - r) / a * s;
787
- }
788
- function Ie(t, e) {
789
- return t.startDate < e.endDate && t.endDate > e.startDate;
790
- }
791
- function xe(t) {
792
- if (t.length === 0) return [];
793
- const e = [...t].sort((a, s) => a.startDate.getTime() - s.startDate.getTime()), n = [];
794
- let r = [], o = 0;
795
- for (const a of e)
796
- r.length === 0 || a.startDate.getTime() < o ? (r.push(a), o = Math.max(o, a.endDate.getTime())) : (r.length > 0 && n.push(r), r = [a], o = a.endDate.getTime());
797
- return r.length > 0 && n.push(r), n;
798
- }
799
- function Fe(t, e, n) {
800
- const r = Math.max(0, Math.min(t, e)), o = Math.min(n, Math.max(t, e));
801
- return {
802
- top: r,
803
- height: o - r
804
- };
805
- }
1
+ import { C as s, D as t, a as n, b as r, c as E, d as o, e as i, f as l, g, E as D, h as v, H as y, i as T, M as d, j as u, k as O, l as S, m as _, n as f, o as H, p as I, q as R, r as c, s as m, t as M, u as A, v as N, w as U, x as h, y as p, z as L, A as W, B, F as C, G as k, I as F, J as V, K as Y, L as b, N as G, O as P, P as w, Q as x, R as X, S as j, T as q, U as z, V as J, W as K, X as Q, Y as Z, Z as $, _ as aa, $ as ea, a0 as sa, a1 as ta, a2 as na, a3 as ra, a4 as Ea, a5 as oa, a6 as ia, a7 as la, a8 as ga, a9 as Da, aa as va, ab as ya, ac as Ta, ad as da, ae as ua, af as Oa, ag as Sa, ah as _a, ai as fa, aj as Ha, ak as Ia, al as Ra, am as ca, an as ma, ao as Ma, ap as Aa, aq as Na, ar as Ua, as as ha, at as pa, au as La, av as Wa, aw as Ba, ax as Ca, ay as ka, az as Fa, aA as Va, aB as Ya, aC as ba, aD as Ga, aE as Pa, aF as wa, aG as xa, aH as Xa, aI as ja, aJ as qa, aK as za, aL as Ja, aM as Ka, aN as Qa, aO as Za, aP as $a, aQ as ae, aR as ee, aS as se, aT as te, aU as ne, aV as re, aW as Ee, aX as oe, aY as ie, aZ as le } from "./position-utils-DMVQFywD.js";
806
2
  export {
807
- et as CALENDAR_VIEWS,
808
- ot as DEFAULT_BUSINESS_HOURS,
809
- gt as DEFAULT_HEADER_HEIGHT,
810
- I as DEFAULT_HOUR_HEIGHT,
811
- nt as DEFAULT_PREFERENCES,
812
- Dt as DEFAULT_RESOURCE_WIDTH,
813
- dt as DEFAULT_SLOT_HEIGHT,
814
- at as DEFAULT_VIEW_CONFIGS,
815
- rt as DEFAULT_VISIBLE_HOURS,
816
- st as EVENT_COLORS,
817
- ut as EVENT_COLOR_CLASSES,
818
- it as HEX_TO_EVENT_COLOR,
819
- ct as HOURS_IN_DAY,
820
- lt as MINUTES_IN_HOUR,
821
- P as MIN_EVENT_HEIGHT,
822
- ft as MS_PER_DAY,
823
- V as MS_PER_HOUR,
824
- N as MS_PER_MINUTE,
825
- l as addDays,
826
- z as addHours,
827
- bt as addMinutes,
828
- x as addMonths,
829
- k as addWeeks,
830
- C as addYears,
831
- Xt as applyEventFilters,
832
- tt as calculateEventPosition,
833
- be as calculateOverlappingPositions,
834
- Fe as calculateSelectionOverlay,
835
- _ as detectAllDayEvent,
836
- At as differenceInDays,
837
- _t as differenceInHours,
838
- O as differenceInMilliseconds,
839
- Ot as differenceInMinutes,
840
- J as eachDayOfInterval,
841
- Wt as eachHourOfInterval,
842
- T as endOfDay,
843
- S as endOfMonth,
844
- w as endOfWeek,
845
- G as endOfYear,
846
- Ie as eventsOverlap,
847
- K as filterEventsByDateRange,
848
- j as filterEventsByResource,
849
- X as filterEventsByScheduleType,
850
- q as filterEventsBySearch,
851
- Q as filterOutCanceled,
852
- Rt as formatDateISO,
853
- le as formatEventTimeDisplay,
854
- Bt as formatHourLabel,
855
- H as formatTime,
856
- Te as generateHourLabels,
857
- me as generateMonthCells,
858
- Vt as generateMonthGrid,
859
- pe as generateTimeSlots,
860
- he as generateWeekCells,
861
- ye as generateYearCells,
862
- re as getAllDayEvents,
863
- ht as getDayOfWeek,
864
- Mt as getDaysInMonth,
865
- kt as getDecimalHours,
866
- ie as getEventColor,
867
- ue as getEventDurationMinutes,
868
- Me as getEventsCountInView,
869
- ne as getEventsForDay,
870
- Gt as getEventsInRange,
871
- vt as getMonthNames,
872
- ae as getMultiDayEvents,
873
- xe as getOverlappingGroups,
874
- we as getRangeText,
875
- oe as getTimedEvents,
876
- Z as getViewDateRange,
877
- Ee as getViewTitle,
878
- Lt as getVisibleHoursArray,
879
- Nt as getWeekDays,
880
- pt as getWeekNumber,
881
- Se as getWeekdayHeaders,
882
- Yt as getWeekdayNames,
883
- Jt as getWorkingHoursForDay,
884
- Kt as getYearMonths,
885
- Zt as groupEventsByDate,
886
- ee as groupEventsByResource,
887
- te as groupEventsByScheduleType,
888
- xt as isAfter,
889
- It as isBefore,
890
- Ft as isBetween,
891
- se as isMultiDayEvent,
892
- p as isSameDay,
893
- $ as isSameMonth,
894
- Tt as isSameWeek,
895
- St as isSameYear,
896
- U as isToday,
897
- W as isWeekend,
898
- zt as isWorkingHour,
899
- Ct as maxDate,
900
- $t as minDate,
901
- de as navigateNext,
902
- ge as navigatePrev,
903
- De as navigateToday,
904
- Ut as parseISO,
905
- ce as resolveEventColor,
906
- Pt as separateEventsByDuration,
907
- Ht as setTime,
908
- fe as shouldShowEventTime,
909
- Qt as sortEventsByDuration,
910
- qt as sortEventsByEnd,
911
- jt as sortEventsByStart,
912
- g as startOfDay,
913
- E as startOfMonth,
914
- D as startOfWeek,
915
- Y as startOfYear,
916
- mt as subDays,
917
- wt as subMonths,
918
- yt as subWeeks,
919
- Et as subYears,
920
- ke as timeToY,
921
- He as yToTime
3
+ s as CALENDAR_VIEWS,
4
+ t as DEFAULT_BUSINESS_HOURS,
5
+ n as DEFAULT_HEADER_HEIGHT,
6
+ r as DEFAULT_HOUR_HEIGHT,
7
+ E as DEFAULT_PREFERENCES,
8
+ o as DEFAULT_RESOURCE_WIDTH,
9
+ i as DEFAULT_SLOT_HEIGHT,
10
+ l as DEFAULT_VIEW_CONFIGS,
11
+ g as DEFAULT_VISIBLE_HOURS,
12
+ D as EVENT_COLORS,
13
+ v as EVENT_COLOR_CLASSES,
14
+ y as HEX_TO_EVENT_COLOR,
15
+ T as HOURS_IN_DAY,
16
+ d as MINUTES_IN_HOUR,
17
+ u as MIN_EVENT_HEIGHT,
18
+ O as MS_PER_DAY,
19
+ S as MS_PER_HOUR,
20
+ _ as MS_PER_MINUTE,
21
+ f as addDays,
22
+ H as addHours,
23
+ I as addMinutes,
24
+ R as addMonths,
25
+ c as addWeeks,
26
+ m as addYears,
27
+ M as applyEventFilters,
28
+ A as calculateEventPosition,
29
+ N as calculateOverlappingPositions,
30
+ U as calculateSelectionOverlay,
31
+ h as detectAllDayEvent,
32
+ p as differenceInDays,
33
+ L as differenceInHours,
34
+ W as differenceInMilliseconds,
35
+ B as differenceInMinutes,
36
+ C as eachDayOfInterval,
37
+ k as eachHourOfInterval,
38
+ F as endOfDay,
39
+ V as endOfMonth,
40
+ Y as endOfWeek,
41
+ b as endOfYear,
42
+ G as eventsOverlap,
43
+ P as filterEventsByDateRange,
44
+ w as filterEventsByResource,
45
+ x as filterEventsByScheduleType,
46
+ X as filterEventsBySearch,
47
+ j as filterOutCanceled,
48
+ q as formatDateISO,
49
+ z as formatEventTimeDisplay,
50
+ J as formatHourLabel,
51
+ K as formatTime,
52
+ Q as generateHourLabels,
53
+ Z as generateMonthCells,
54
+ $ as generateMonthGrid,
55
+ aa as generateTimeSlots,
56
+ ea as generateWeekCells,
57
+ sa as generateYearCells,
58
+ ta as getAllDayEvents,
59
+ na as getDayOfWeek,
60
+ ra as getDaysInMonth,
61
+ Ea as getDecimalHours,
62
+ oa as getEventColor,
63
+ ia as getEventDurationMinutes,
64
+ la as getEventsCountInView,
65
+ ga as getEventsForDay,
66
+ Da as getEventsInRange,
67
+ va as getMonthNames,
68
+ ya as getMultiDayEvents,
69
+ Ta as getOverlappingGroups,
70
+ da as getRangeText,
71
+ ua as getTimedEvents,
72
+ Oa as getViewDateRange,
73
+ Sa as getViewTitle,
74
+ _a as getVisibleHoursArray,
75
+ fa as getWeekDays,
76
+ Ha as getWeekNumber,
77
+ Ia as getWeekdayHeaders,
78
+ Ra as getWeekdayNames,
79
+ ca as getWorkingHoursForDay,
80
+ ma as getYearMonths,
81
+ Ma as groupEventsByDate,
82
+ Aa as groupEventsByResource,
83
+ Na as groupEventsByScheduleType,
84
+ Ua as isAfter,
85
+ ha as isBefore,
86
+ pa as isBetween,
87
+ La as isMultiDayEvent,
88
+ Wa as isSameDay,
89
+ Ba as isSameMonth,
90
+ Ca as isSameWeek,
91
+ ka as isSameYear,
92
+ Fa as isToday,
93
+ Va as isWeekend,
94
+ Ya as isWorkingHour,
95
+ ba as maxDate,
96
+ Ga as minDate,
97
+ Pa as navigateNext,
98
+ wa as navigatePrev,
99
+ xa as navigateToday,
100
+ Xa as parseISO,
101
+ ja as reactNodeToText,
102
+ qa as resolveEventColor,
103
+ za as separateEventsByDuration,
104
+ Ja as setTime,
105
+ Ka as shouldShowEventTime,
106
+ Qa as sortEventsByDuration,
107
+ Za as sortEventsByEnd,
108
+ $a as sortEventsByStart,
109
+ ae as startOfDay,
110
+ ee as startOfMonth,
111
+ se as startOfWeek,
112
+ te as startOfYear,
113
+ ne as subDays,
114
+ re as subMonths,
115
+ Ee as subWeeks,
116
+ oe as subYears,
117
+ ie as timeToY,
118
+ le as yToTime
922
119
  };
923
120
  //# sourceMappingURL=utils.mjs.map