@innosolutions/inno-calendar 1.0.57 → 1.0.59
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/AGENT.md +1721 -1610
- package/README.md +235 -235
- package/dist/agenda-widget-BxZU4eGL.cjs +2 -0
- package/dist/agenda-widget-BxZU4eGL.cjs.map +1 -0
- package/dist/{agenda-widget-1kak6FM9.js → agenda-widget-wrZfO67A.js} +1308 -1223
- package/dist/agenda-widget-wrZfO67A.js.map +1 -0
- package/dist/components/event/event-card.d.ts.map +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.mjs +2 -2
- package/dist/components/primitives/scroll-navigator.d.ts +1 -1
- package/dist/components/primitives/scroll-navigator.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +200 -200
- package/dist/presets/index.cjs +1 -1
- package/dist/presets/index.mjs +1 -1
- package/dist/{tailwind-calendar-DjtOowce.js → tailwind-calendar-CVuxWXLY.js} +2 -2
- package/dist/{tailwind-calendar-DjtOowce.js.map → tailwind-calendar-CVuxWXLY.js.map} +1 -1
- package/dist/{tailwind-calendar-DpEkgg5k.cjs → tailwind-calendar-DoG6s3PJ.cjs} +2 -2
- package/dist/{tailwind-calendar-DpEkgg5k.cjs.map → tailwind-calendar-DoG6s3PJ.cjs.map} +1 -1
- package/dist/week-view-Bzpbti1B.cjs +11 -0
- package/dist/week-view-Bzpbti1B.cjs.map +1 -0
- package/dist/{week-view-CKx6bJdJ.js → week-view-C1FxF_nk.js} +880 -867
- package/dist/week-view-C1FxF_nk.js.map +1 -0
- package/package.json +138 -138
- package/dist/agenda-widget-1kak6FM9.js.map +0 -1
- package/dist/agenda-widget-C8CFFI1c.cjs +0 -2
- package/dist/agenda-widget-C8CFFI1c.cjs.map +0 -1
- package/dist/week-view-CKx6bJdJ.js.map +0 -1
- package/dist/week-view-DXlwhFjn.cjs +0 -11
- package/dist/week-view-DXlwhFjn.cjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as e, jsxs as r, Fragment as
|
|
1
|
+
import { jsx as e, jsxs as r, Fragment as we } from "react/jsx-runtime";
|
|
2
2
|
import { g as it, u as pt, C as xt } from "./use-calendar-Clo9DFK4.js";
|
|
3
|
-
import { useCallback as
|
|
4
|
-
import { c as
|
|
5
|
-
import { P as lt, p as ct, o as dt, z as
|
|
6
|
-
import { j as Lt, D as Tt, I as Ht, e as
|
|
7
|
-
import { isToday as
|
|
8
|
-
function
|
|
3
|
+
import { useCallback as F, useState as ie, useEffect as de, forwardRef as Ae, useRef as ae, useMemo as Q, useLayoutEffect as vt, useImperativeHandle as wt } from "react";
|
|
4
|
+
import { c as g } from "./index-DtaLkIY8.js";
|
|
5
|
+
import { P as lt, p as ct, o as dt, z as me, I as bt, J as yt, B as Ce, K as kt, L as Ue, x as fe, F as ge, y as pe, k as Nt, C as Ct, M as Ve, A as Dt, W as Mt, c as St, N as Et } from "./week-view-C1FxF_nk.js";
|
|
6
|
+
import { j as Lt, D as Tt, I as Ht, e as zt, S as It } from "./slot-selection-context-BwghpxKA.js";
|
|
7
|
+
import { isToday as ce, startOfDay as Pe, endOfDay as ut, getYearMonths as jt, generateMonthGrid as At, getEventsForDay as Pt, addDays as ht, formatDateISO as Wt } from "./utils.mjs";
|
|
8
|
+
function Ft({ view: t, className: n = "" }) {
|
|
9
9
|
return /* @__PURE__ */ e(
|
|
10
10
|
"div",
|
|
11
11
|
{
|
|
@@ -30,48 +30,48 @@ function $t({ view: t, className: n = "" }) {
|
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
function Ye({ view: t, className: n }) {
|
|
33
|
-
return /* @__PURE__ */ e(
|
|
33
|
+
return /* @__PURE__ */ e(Ft, { view: t, className: n });
|
|
34
34
|
}
|
|
35
35
|
function kr(t) {
|
|
36
36
|
const {
|
|
37
37
|
events: n,
|
|
38
38
|
resources: o,
|
|
39
|
-
scheduleTypes:
|
|
40
|
-
initialView:
|
|
41
|
-
initialDate:
|
|
42
|
-
initialFilters:
|
|
39
|
+
scheduleTypes: a,
|
|
40
|
+
initialView: i = "week",
|
|
41
|
+
initialDate: l,
|
|
42
|
+
initialFilters: p,
|
|
43
43
|
preferences: h,
|
|
44
44
|
locale: d,
|
|
45
|
-
slots:
|
|
46
|
-
renderEvent:
|
|
47
|
-
onViewChange:
|
|
48
|
-
onDateChange:
|
|
49
|
-
onEventClick:
|
|
45
|
+
slots: v,
|
|
46
|
+
renderEvent: b,
|
|
47
|
+
onViewChange: w,
|
|
48
|
+
onDateChange: A,
|
|
49
|
+
onEventClick: $,
|
|
50
50
|
onSlotSelect: P,
|
|
51
51
|
onFiltersChange: W,
|
|
52
|
-
className:
|
|
52
|
+
className: T,
|
|
53
53
|
children: y
|
|
54
|
-
} = t,
|
|
55
|
-
if (
|
|
56
|
-
return /* @__PURE__ */ e("div", { className:
|
|
54
|
+
} = t, z = it();
|
|
55
|
+
if (z)
|
|
56
|
+
return /* @__PURE__ */ e("div", { className: T, style: { position: "relative" }, children: y ?? /* @__PURE__ */ e(Ye, { view: z.view, className: T }) });
|
|
57
57
|
const O = pt({
|
|
58
58
|
events: n,
|
|
59
59
|
resources: o,
|
|
60
|
-
scheduleTypes:
|
|
61
|
-
initialView:
|
|
62
|
-
initialDate:
|
|
63
|
-
initialFilters:
|
|
60
|
+
scheduleTypes: a,
|
|
61
|
+
initialView: i,
|
|
62
|
+
initialDate: l,
|
|
63
|
+
initialFilters: p,
|
|
64
64
|
preferences: h,
|
|
65
65
|
locale: d,
|
|
66
|
-
onViewChange:
|
|
67
|
-
onDateChange:
|
|
68
|
-
onEventClick:
|
|
66
|
+
onViewChange: w,
|
|
67
|
+
onDateChange: A,
|
|
68
|
+
onEventClick: $,
|
|
69
69
|
onSlotSelect: P,
|
|
70
70
|
onFiltersChange: W
|
|
71
71
|
});
|
|
72
|
-
return /* @__PURE__ */ e(xt, { value: O, children: /* @__PURE__ */ e("div", { className:
|
|
72
|
+
return /* @__PURE__ */ e(xt, { value: O, children: /* @__PURE__ */ e("div", { className: T, style: { position: "relative" }, children: y ?? /* @__PURE__ */ e(Ye, { view: O.view, className: T }) }) });
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function $t({ className: t }) {
|
|
75
75
|
return /* @__PURE__ */ r(
|
|
76
76
|
"svg",
|
|
77
77
|
{
|
|
@@ -284,7 +284,7 @@ function Yt({ className: t }) {
|
|
|
284
284
|
}
|
|
285
285
|
);
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function Me({ className: t }) {
|
|
288
288
|
return /* @__PURE__ */ e(
|
|
289
289
|
"svg",
|
|
290
290
|
{
|
|
@@ -295,7 +295,7 @@ function De({ className: t }) {
|
|
|
295
295
|
strokeWidth: "2",
|
|
296
296
|
strokeLinecap: "round",
|
|
297
297
|
strokeLinejoin: "round",
|
|
298
|
-
className:
|
|
298
|
+
className: g("animate-spin", t),
|
|
299
299
|
children: /* @__PURE__ */ e("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
|
|
300
300
|
}
|
|
301
301
|
);
|
|
@@ -326,51 +326,51 @@ const Kt = {
|
|
|
326
326
|
deleteConfirmTitle: "Delete Event",
|
|
327
327
|
deleteConfirmDescription: "Are you sure you want to delete this event? This action cannot be undone."
|
|
328
328
|
}, He = Ae(
|
|
329
|
-
({ onClick: t, label: n, children: o, className:
|
|
330
|
-
/* @__PURE__ */ e(
|
|
329
|
+
({ onClick: t, label: n, children: o, className: a, variant: i = "ghost", ...l }, p) => /* @__PURE__ */ r(fe, { children: [
|
|
330
|
+
/* @__PURE__ */ e(ge, { asChild: !0, children: /* @__PURE__ */ e(
|
|
331
331
|
"button",
|
|
332
332
|
{
|
|
333
333
|
type: "button",
|
|
334
|
-
ref:
|
|
334
|
+
ref: p,
|
|
335
335
|
onClick: t,
|
|
336
|
-
className:
|
|
336
|
+
className: g(
|
|
337
337
|
"h-8 w-8 rounded-full flex items-center justify-center transition-colors",
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
338
|
+
i === "ghost" && "hover:bg-zinc-100 dark:hover:bg-zinc-800 text-zinc-600 dark:text-zinc-400",
|
|
339
|
+
i === "destructive" && "hover:bg-red-50 dark:hover:bg-red-950/30 text-zinc-600 dark:text-zinc-400 hover:text-red-600",
|
|
340
|
+
a
|
|
341
341
|
),
|
|
342
342
|
"aria-label": n,
|
|
343
|
-
...
|
|
343
|
+
...l,
|
|
344
344
|
children: o
|
|
345
345
|
}
|
|
346
346
|
) }),
|
|
347
|
-
/* @__PURE__ */ e(
|
|
347
|
+
/* @__PURE__ */ e(pe, { side: "bottom", className: "text-xs", children: n })
|
|
348
348
|
] })
|
|
349
349
|
);
|
|
350
350
|
He.displayName = "IconButton";
|
|
351
|
-
function Gt({ src: t, alt: n, initials: o, className:
|
|
352
|
-
const [
|
|
351
|
+
function Gt({ src: t, alt: n, initials: o, className: a, isClient: i }) {
|
|
352
|
+
const [l, p] = ie(!1);
|
|
353
353
|
return /* @__PURE__ */ e(
|
|
354
354
|
"div",
|
|
355
355
|
{
|
|
356
|
-
className:
|
|
356
|
+
className: g(
|
|
357
357
|
"relative h-7 w-7 rounded-full overflow-hidden shrink-0",
|
|
358
|
-
|
|
358
|
+
a
|
|
359
359
|
),
|
|
360
|
-
children: t && !
|
|
360
|
+
children: t && !l ? /* @__PURE__ */ e(
|
|
361
361
|
"img",
|
|
362
362
|
{
|
|
363
363
|
src: t,
|
|
364
364
|
alt: n,
|
|
365
365
|
className: "h-full w-full object-cover",
|
|
366
|
-
onError: () =>
|
|
366
|
+
onError: () => p(!0)
|
|
367
367
|
}
|
|
368
368
|
) : /* @__PURE__ */ e(
|
|
369
369
|
"div",
|
|
370
370
|
{
|
|
371
|
-
className:
|
|
371
|
+
className: g(
|
|
372
372
|
"h-full w-full flex items-center justify-center text-[10px] font-medium",
|
|
373
|
-
|
|
373
|
+
i ? "bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300" : "bg-zinc-200 dark:bg-zinc-700 text-zinc-700 dark:text-zinc-300"
|
|
374
374
|
),
|
|
375
375
|
children: o
|
|
376
376
|
}
|
|
@@ -383,41 +383,41 @@ function Ke({
|
|
|
383
383
|
isEventCanceled: n = !1,
|
|
384
384
|
labels: o
|
|
385
385
|
}) {
|
|
386
|
-
const
|
|
386
|
+
const a = t.name || "Unknown", i = a.split(" ").map((A) => A[0]).join("").toUpperCase().slice(0, 2), l = t.isOrganizer ?? !1, p = t.isConfirmed, h = p === !0, d = p === !1, v = t.isClient ?? !1, b = t.profilePicture || t.avatar, w = n;
|
|
387
387
|
return /* @__PURE__ */ r(
|
|
388
388
|
"div",
|
|
389
389
|
{
|
|
390
|
-
className:
|
|
390
|
+
className: g(
|
|
391
391
|
"flex items-center gap-3 py-0",
|
|
392
|
-
|
|
392
|
+
w && "opacity-60"
|
|
393
393
|
),
|
|
394
394
|
children: [
|
|
395
395
|
/* @__PURE__ */ r("div", { className: "relative", children: [
|
|
396
396
|
/* @__PURE__ */ e(
|
|
397
397
|
Gt,
|
|
398
398
|
{
|
|
399
|
-
src:
|
|
400
|
-
alt:
|
|
401
|
-
initials:
|
|
402
|
-
isClient:
|
|
403
|
-
className:
|
|
399
|
+
src: b,
|
|
400
|
+
alt: a,
|
|
401
|
+
initials: i,
|
|
402
|
+
isClient: v,
|
|
403
|
+
className: g(w && "grayscale")
|
|
404
404
|
}
|
|
405
405
|
),
|
|
406
|
-
|
|
406
|
+
w || d ? /* @__PURE__ */ e("div", { className: "absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-white dark:bg-zinc-900 flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "h-3 w-3 rounded-full bg-red-100 dark:bg-red-900/50 flex items-center justify-center", children: /* @__PURE__ */ e(je, { className: "h-2 w-2 text-red-600 dark:text-red-400 stroke-[3]" }) }) }) : h ? /* @__PURE__ */ e("div", { className: "absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-white dark:bg-zinc-900 flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "h-3 w-3 rounded-full bg-green-100 dark:bg-green-900/50 flex items-center justify-center", children: /* @__PURE__ */ e(Te, { className: "h-2 w-2 text-green-600 dark:text-green-400 stroke-[3]" }) }) }) : null
|
|
407
407
|
] }),
|
|
408
408
|
/* @__PURE__ */ r("div", { className: "!h-fit min-w-0 gap-0", children: [
|
|
409
409
|
/* @__PURE__ */ e("div", { className: "gap-0", children: /* @__PURE__ */ e(
|
|
410
410
|
"span",
|
|
411
411
|
{
|
|
412
|
-
className:
|
|
412
|
+
className: g(
|
|
413
413
|
"text-sm text-zinc-900 dark:text-zinc-100 truncate",
|
|
414
|
-
|
|
414
|
+
w && "line-through text-zinc-500 dark:text-zinc-500"
|
|
415
415
|
),
|
|
416
|
-
children:
|
|
416
|
+
children: a
|
|
417
417
|
}
|
|
418
418
|
) }),
|
|
419
|
-
|
|
420
|
-
|
|
419
|
+
v && /* @__PURE__ */ e("div", { className: "text-[10px] px-1.5 w-fit py-0.5 rounded bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300 font-medium", children: o.client }),
|
|
420
|
+
l && !w && /* @__PURE__ */ e("div", { className: "text-xs text-zinc-500", children: o.organizer })
|
|
421
421
|
] })
|
|
422
422
|
]
|
|
423
423
|
}
|
|
@@ -427,15 +427,15 @@ function Jt({
|
|
|
427
427
|
open: t,
|
|
428
428
|
onOpenChange: n,
|
|
429
429
|
title: o,
|
|
430
|
-
children:
|
|
430
|
+
children: a
|
|
431
431
|
}) {
|
|
432
|
-
return
|
|
432
|
+
return de(() => {
|
|
433
433
|
if (!t) return;
|
|
434
|
-
const
|
|
435
|
-
|
|
434
|
+
const i = (l) => {
|
|
435
|
+
l.key === "Escape" && n(!1);
|
|
436
436
|
};
|
|
437
|
-
return document.addEventListener("keydown",
|
|
438
|
-
}, [t, n]),
|
|
437
|
+
return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
|
|
438
|
+
}, [t, n]), de(() => (t ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
439
439
|
document.body.style.overflow = "";
|
|
440
440
|
}), [t]), t ? /* @__PURE__ */ r("div", { className: "fixed inset-0 z-50", children: [
|
|
441
441
|
/* @__PURE__ */ e(
|
|
@@ -443,14 +443,14 @@ function Jt({
|
|
|
443
443
|
{
|
|
444
444
|
className: "fixed inset-0 bg-black/50 backdrop-blur-sm",
|
|
445
445
|
onClick: () => n(!1),
|
|
446
|
-
onKeyDown: (
|
|
447
|
-
(
|
|
446
|
+
onKeyDown: (i) => {
|
|
447
|
+
(i.key === "Enter" || i.key === " ") && n(!1);
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
450
|
),
|
|
451
451
|
/* @__PURE__ */ e("div", { className: "fixed inset-x-4 top-[50%] translate-y-[-50%] max-w-md mx-auto", children: /* @__PURE__ */ r("div", { className: "bg-white dark:bg-zinc-900 rounded-2xl shadow-xl overflow-hidden", children: [
|
|
452
452
|
o && /* @__PURE__ */ e("div", { className: "sr-only", children: o }),
|
|
453
|
-
|
|
453
|
+
a
|
|
454
454
|
] }) })
|
|
455
455
|
] }) : null;
|
|
456
456
|
}
|
|
@@ -458,10 +458,10 @@ function qt({
|
|
|
458
458
|
open: t,
|
|
459
459
|
onOpenChange: n,
|
|
460
460
|
title: o,
|
|
461
|
-
description:
|
|
462
|
-
cancelLabel:
|
|
463
|
-
confirmLabel:
|
|
464
|
-
onConfirm:
|
|
461
|
+
description: a,
|
|
462
|
+
cancelLabel: i,
|
|
463
|
+
confirmLabel: l,
|
|
464
|
+
onConfirm: p,
|
|
465
465
|
isLoading: h
|
|
466
466
|
}) {
|
|
467
467
|
return t ? /* @__PURE__ */ r("div", { className: "fixed inset-0 z-[60]", children: [
|
|
@@ -477,28 +477,28 @@ function qt({
|
|
|
477
477
|
),
|
|
478
478
|
/* @__PURE__ */ e("div", { className: "fixed inset-x-4 top-[50%] translate-y-[-50%] max-w-md mx-auto", children: /* @__PURE__ */ r("div", { className: "bg-white dark:bg-zinc-900 rounded-lg shadow-xl p-6", children: [
|
|
479
479
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-zinc-900 dark:text-zinc-100", children: o }),
|
|
480
|
-
/* @__PURE__ */ e("p", { className: "mt-2 text-sm text-zinc-600 dark:text-zinc-400", children:
|
|
480
|
+
/* @__PURE__ */ e("p", { className: "mt-2 text-sm text-zinc-600 dark:text-zinc-400", children: a }),
|
|
481
481
|
/* @__PURE__ */ r("div", { className: "mt-4 flex justify-end gap-3", children: [
|
|
482
482
|
/* @__PURE__ */ e(
|
|
483
|
-
|
|
483
|
+
Ce,
|
|
484
484
|
{
|
|
485
485
|
variant: "outline",
|
|
486
486
|
size: "sm",
|
|
487
487
|
onClick: () => n(!1),
|
|
488
|
-
children:
|
|
488
|
+
children: i
|
|
489
489
|
}
|
|
490
490
|
),
|
|
491
491
|
/* @__PURE__ */ r(
|
|
492
|
-
|
|
492
|
+
Ce,
|
|
493
493
|
{
|
|
494
494
|
variant: "destructive",
|
|
495
495
|
size: "sm",
|
|
496
|
-
onClick:
|
|
496
|
+
onClick: p,
|
|
497
497
|
disabled: h,
|
|
498
498
|
children: [
|
|
499
|
-
h && /* @__PURE__ */ e(
|
|
499
|
+
h && /* @__PURE__ */ e(Me, { className: "h-4 w-4 mr-2" }),
|
|
500
500
|
/* @__PURE__ */ e(mt, { className: "h-4 w-4 mr-2" }),
|
|
501
|
-
|
|
501
|
+
l
|
|
502
502
|
]
|
|
503
503
|
}
|
|
504
504
|
)
|
|
@@ -531,72 +531,72 @@ function Zt(t) {
|
|
|
531
531
|
});
|
|
532
532
|
}
|
|
533
533
|
function en(t) {
|
|
534
|
-
const [n, o] =
|
|
535
|
-
return
|
|
534
|
+
const [n, o] = ie(() => typeof window < "u" ? window.matchMedia(t).matches : !1);
|
|
535
|
+
return de(() => {
|
|
536
536
|
if (typeof window > "u") return;
|
|
537
|
-
const
|
|
538
|
-
return
|
|
537
|
+
const a = window.matchMedia(t), i = (l) => o(l.matches);
|
|
538
|
+
return a.addEventListener("change", i), () => a.removeEventListener("change", i);
|
|
539
539
|
}, [t]), n;
|
|
540
540
|
}
|
|
541
541
|
function Ge({
|
|
542
542
|
event: t,
|
|
543
543
|
labels: n,
|
|
544
544
|
isLoading: o,
|
|
545
|
-
onClose:
|
|
546
|
-
onEdit:
|
|
547
|
-
onDelete:
|
|
548
|
-
onCancel:
|
|
545
|
+
onClose: a,
|
|
546
|
+
onEdit: i,
|
|
547
|
+
onDelete: l,
|
|
548
|
+
onCancel: p,
|
|
549
549
|
onAccept: h,
|
|
550
550
|
onDecline: d,
|
|
551
|
-
onConfirmMeeting:
|
|
552
|
-
canEdit:
|
|
553
|
-
canDelete:
|
|
554
|
-
canCancel:
|
|
555
|
-
isCurrentUserParticipant:
|
|
551
|
+
onConfirmMeeting: v,
|
|
552
|
+
canEdit: b = !0,
|
|
553
|
+
canDelete: w = !1,
|
|
554
|
+
canCancel: A = !0,
|
|
555
|
+
isCurrentUserParticipant: $ = !1,
|
|
556
556
|
isCurrentUserClient: P = !1,
|
|
557
557
|
currentUserAcceptStatus: W,
|
|
558
|
-
isAcceptLoading:
|
|
558
|
+
isAcceptLoading: T = !1,
|
|
559
559
|
isDeclineLoading: y = !1,
|
|
560
|
-
isConfirmLoading:
|
|
560
|
+
isConfirmLoading: z = !1,
|
|
561
561
|
isDeleteLoading: O = !1,
|
|
562
|
-
renderParticipant:
|
|
563
|
-
renderHeaderActions:
|
|
564
|
-
renderCancelReason:
|
|
565
|
-
renderDeleteConfirmation:
|
|
566
|
-
formatDate:
|
|
562
|
+
renderParticipant: _,
|
|
563
|
+
renderHeaderActions: D,
|
|
564
|
+
renderCancelReason: K,
|
|
565
|
+
renderDeleteConfirmation: E,
|
|
566
|
+
formatDate: H = Xt,
|
|
567
567
|
formatTimeRange: V = Qt
|
|
568
568
|
}) {
|
|
569
|
-
const [
|
|
570
|
-
|
|
571
|
-
},
|
|
572
|
-
|
|
573
|
-
},
|
|
574
|
-
|
|
575
|
-
},
|
|
576
|
-
|
|
569
|
+
const [J, G] = ie(!1), B = !(t.isCanceled || t.meetingTookPlace), s = t.isRecurring ?? !1, m = t.participantDetails, N = t.participantsNames || [], L = m && m.length > 0, S = W === !0, Y = W === !1, R = $ && !P && B, se = L ? m.filter((M) => M.isConfirmed).length : t.isAccepted ? N.length : 0, ee = L ? m.length : N.length, Z = t.scheduleTypeColor || t.hexColor || "#039BE5", ve = F(() => t.startDate ? H(t.startDate) : n.noDateProvided, [t.startDate, H, n.noDateProvided]), ne = F(() => t.startDate && t.endDate ? V(t.startDate, t.endDate) : null, [t.startDate, t.endDate, V]), le = () => {
|
|
570
|
+
a(), i?.(t);
|
|
571
|
+
}, be = () => {
|
|
572
|
+
a(), p?.(t);
|
|
573
|
+
}, ue = () => {
|
|
574
|
+
G(!0);
|
|
575
|
+
}, f = () => {
|
|
576
|
+
l?.(t), G(!1);
|
|
577
577
|
};
|
|
578
|
-
return o ? /* @__PURE__ */ e("div", { className: "flex h-48 items-center justify-center", children: /* @__PURE__ */ e(
|
|
578
|
+
return o ? /* @__PURE__ */ e("div", { className: "flex h-48 items-center justify-center", children: /* @__PURE__ */ e(Me, { className: "h-6 w-6 text-zinc-400" }) }) : /* @__PURE__ */ r(me, { delayDuration: 300, children: [
|
|
579
579
|
/* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5 p-3", children: [
|
|
580
|
-
/* @__PURE__ */ e("div", { className: "flex items-start justify-end gap-0.5", children:
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
580
|
+
/* @__PURE__ */ e("div", { className: "flex items-start justify-end gap-0.5", children: D ? D({ onClose: a }) : /* @__PURE__ */ r(we, { children: [
|
|
581
|
+
B && b && i && /* @__PURE__ */ e(He, { onClick: le, label: n.edit, children: /* @__PURE__ */ e($t, { className: "h-[18px] w-[18px]" }) }),
|
|
582
|
+
B && A && p && /* @__PURE__ */ e(He, { onClick: be, label: n.cancel, children: /* @__PURE__ */ e(Ot, { className: "h-[18px] w-[18px]" }) }),
|
|
583
|
+
w && l && /* @__PURE__ */ e(
|
|
584
584
|
He,
|
|
585
585
|
{
|
|
586
|
-
onClick:
|
|
586
|
+
onClick: ue,
|
|
587
587
|
label: n.delete,
|
|
588
588
|
variant: "destructive",
|
|
589
589
|
children: /* @__PURE__ */ e(mt, { className: "h-[18px] w-[18px]" })
|
|
590
590
|
}
|
|
591
591
|
),
|
|
592
|
-
/* @__PURE__ */ e(He, { onClick:
|
|
592
|
+
/* @__PURE__ */ e(He, { onClick: a, label: n.close, children: /* @__PURE__ */ e(je, { className: "h-[18px] w-[18px]" }) })
|
|
593
593
|
] }) }),
|
|
594
594
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ r("div", { className: "flex items-start gap-2", children: [
|
|
595
595
|
/* @__PURE__ */ e(
|
|
596
596
|
"div",
|
|
597
597
|
{
|
|
598
598
|
className: "w-4 h-4 rounded mt-1 shrink-0",
|
|
599
|
-
style: { backgroundColor:
|
|
599
|
+
style: { backgroundColor: Z }
|
|
600
600
|
}
|
|
601
601
|
),
|
|
602
602
|
/* @__PURE__ */ r("div", { className: "flex-1 min-w-0", children: [
|
|
@@ -604,7 +604,7 @@ function Ge({
|
|
|
604
604
|
/* @__PURE__ */ e(
|
|
605
605
|
"h2",
|
|
606
606
|
{
|
|
607
|
-
className:
|
|
607
|
+
className: g(
|
|
608
608
|
"text-[22px] font-normal text-zinc-900 dark:text-zinc-100 leading-tight",
|
|
609
609
|
t.isCanceled && "line-through opacity-60"
|
|
610
610
|
),
|
|
@@ -621,16 +621,16 @@ function Ge({
|
|
|
621
621
|
] })
|
|
622
622
|
] }),
|
|
623
623
|
/* @__PURE__ */ r("div", { className: "mt-1 text-sm text-zinc-600 dark:text-zinc-400", children: [
|
|
624
|
-
/* @__PURE__ */ e("span", { children:
|
|
625
|
-
|
|
624
|
+
/* @__PURE__ */ e("span", { children: ve() }),
|
|
625
|
+
ne() && /* @__PURE__ */ r(we, { children: [
|
|
626
626
|
/* @__PURE__ */ e("span", { className: "mx-1.5", children: "·" }),
|
|
627
|
-
/* @__PURE__ */ e("span", { children:
|
|
627
|
+
/* @__PURE__ */ e("span", { children: ne() })
|
|
628
628
|
] })
|
|
629
629
|
] }),
|
|
630
|
-
|
|
630
|
+
s && t.recurrenceSummary && /* @__PURE__ */ e("div", { className: "text-sm text-zinc-500 dark:text-zinc-500", children: t.recurrenceSummary })
|
|
631
631
|
] })
|
|
632
632
|
] }) }),
|
|
633
|
-
t.isCanceled && /* @__PURE__ */ e("div", { className: "mx-4 p-3 rounded-lg bg-red-50 dark:bg-red-950/30", children:
|
|
633
|
+
t.isCanceled && /* @__PURE__ */ e("div", { className: "mx-4 p-3 rounded-lg bg-red-50 dark:bg-red-950/30", children: K ? K(t) : /* @__PURE__ */ e("div", { className: "flex items-start gap-0", children: /* @__PURE__ */ r("div", { className: "flex-1 min-w-0", children: [
|
|
634
634
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-red-700 dark:text-red-400", children: n.cancellationNote }),
|
|
635
635
|
t.cancelReason && /* @__PURE__ */ r("div", { className: "mt-1 text-sm text-red-600/80 dark:text-red-400/80 italic", children: [
|
|
636
636
|
'"',
|
|
@@ -648,7 +648,7 @@ function Ge({
|
|
|
648
648
|
/* @__PURE__ */ e(Ut, { className: "h-5 w-5 text-zinc-400 mt-0.5 shrink-0" }),
|
|
649
649
|
/* @__PURE__ */ e("span", { className: "text-sm text-zinc-700 dark:text-zinc-300", children: t.address })
|
|
650
650
|
] }),
|
|
651
|
-
(
|
|
651
|
+
(L || N.length > 0) && /* @__PURE__ */ r("div", { className: "flex items-start gap-2 py-0", children: [
|
|
652
652
|
/* @__PURE__ */ e(Rt, { className: "h-5 w-5 text-zinc-400 mt-0.5 shrink-0" }),
|
|
653
653
|
/* @__PURE__ */ r("div", { className: "flex-1", children: [
|
|
654
654
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-0", children: [
|
|
@@ -659,15 +659,15 @@ function Ge({
|
|
|
659
659
|
] }),
|
|
660
660
|
ee > 0 && /* @__PURE__ */ r("span", { className: "text-xs text-zinc-500", children: [
|
|
661
661
|
"(",
|
|
662
|
-
|
|
662
|
+
se,
|
|
663
663
|
" ",
|
|
664
664
|
n.confirmed,
|
|
665
665
|
")"
|
|
666
666
|
] })
|
|
667
667
|
] }),
|
|
668
668
|
/* @__PURE__ */ r("div", { className: "mt-2 space-y-2", children: [
|
|
669
|
-
|
|
670
|
-
(M, U) =>
|
|
669
|
+
L ? m.slice(0, 6).map(
|
|
670
|
+
(M, U) => _ ? _(M, U) : /* @__PURE__ */ e(
|
|
671
671
|
Ke,
|
|
672
672
|
{
|
|
673
673
|
participant: M,
|
|
@@ -676,8 +676,8 @@ function Ge({
|
|
|
676
676
|
},
|
|
677
677
|
M.id
|
|
678
678
|
)
|
|
679
|
-
) :
|
|
680
|
-
const
|
|
679
|
+
) : N.slice(0, 6).map((M, U) => {
|
|
680
|
+
const re = {
|
|
681
681
|
id: String(U),
|
|
682
682
|
name: M,
|
|
683
683
|
email: "",
|
|
@@ -685,10 +685,10 @@ function Ge({
|
|
|
685
685
|
isOrganizer: U === 0,
|
|
686
686
|
isClient: !1
|
|
687
687
|
};
|
|
688
|
-
return
|
|
688
|
+
return _ ? _(re, U) : /* @__PURE__ */ e(
|
|
689
689
|
Ke,
|
|
690
690
|
{
|
|
691
|
-
participant:
|
|
691
|
+
participant: re,
|
|
692
692
|
isEventCanceled: t.isCanceled,
|
|
693
693
|
labels: n
|
|
694
694
|
},
|
|
@@ -710,37 +710,37 @@ function Ge({
|
|
|
710
710
|
] }),
|
|
711
711
|
/* @__PURE__ */ r("div", { className: "flex items-start gap-2", children: [
|
|
712
712
|
/* @__PURE__ */ e(Vt, { className: "h-5 w-5 text-zinc-400 mt-0.5 shrink-0" }),
|
|
713
|
-
/* @__PURE__ */ e("div", { className: "text-sm text-zinc-700 dark:text-zinc-300", children:
|
|
713
|
+
/* @__PURE__ */ e("div", { className: "text-sm text-zinc-700 dark:text-zinc-300", children: L && m.find((M) => M.isOrganizer)?.name || N[0] || "Calendar" })
|
|
714
714
|
] })
|
|
715
715
|
] }),
|
|
716
|
-
|
|
717
|
-
|
|
716
|
+
R && h && d && /* @__PURE__ */ e("div", { className: "border-t border-zinc-100 dark:border-zinc-800 mt-3 py-3", children: /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
717
|
+
s ? /* @__PURE__ */ r(bt, { children: [
|
|
718
718
|
/* @__PURE__ */ e(yt, { asChild: !0, children: /* @__PURE__ */ r("div", { className: "flex", children: [
|
|
719
719
|
/* @__PURE__ */ e(
|
|
720
|
-
|
|
720
|
+
Ce,
|
|
721
721
|
{
|
|
722
722
|
size: "sm",
|
|
723
723
|
variant: "outline",
|
|
724
|
-
className:
|
|
724
|
+
className: g(
|
|
725
725
|
"rounded-r-none gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",
|
|
726
726
|
S && "!bg-green-700 !text-white hover:!bg-green-700"
|
|
727
727
|
),
|
|
728
728
|
onClick: (M) => {
|
|
729
729
|
M.stopPropagation(), S || h(t);
|
|
730
730
|
},
|
|
731
|
-
disabled:
|
|
732
|
-
children:
|
|
731
|
+
disabled: T,
|
|
732
|
+
children: T ? /* @__PURE__ */ e(Me, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(we, { children: [
|
|
733
733
|
S && /* @__PURE__ */ e(Te, { className: "h-3.5 w-3.5" }),
|
|
734
734
|
n.going
|
|
735
735
|
] })
|
|
736
736
|
}
|
|
737
737
|
),
|
|
738
738
|
/* @__PURE__ */ e(
|
|
739
|
-
|
|
739
|
+
Ce,
|
|
740
740
|
{
|
|
741
741
|
size: "sm",
|
|
742
742
|
variant: "outline",
|
|
743
|
-
className:
|
|
743
|
+
className: g(
|
|
744
744
|
"rounded-l-none px-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",
|
|
745
745
|
S && "!bg-green-700 !text-white hover:!bg-green-700"
|
|
746
746
|
),
|
|
@@ -752,7 +752,7 @@ function Ge({
|
|
|
752
752
|
/* @__PURE__ */ r(
|
|
753
753
|
Ue,
|
|
754
754
|
{
|
|
755
|
-
className:
|
|
755
|
+
className: g(
|
|
756
756
|
"gap-1.5 h-8 !border-none !bg-green-50 text-green-800 hover:!bg-green-100",
|
|
757
757
|
S && "!bg-green-700 !text-white hover:!bg-green-700"
|
|
758
758
|
),
|
|
@@ -769,73 +769,73 @@ function Ge({
|
|
|
769
769
|
] })
|
|
770
770
|
] })
|
|
771
771
|
] }) : /* @__PURE__ */ e(
|
|
772
|
-
|
|
772
|
+
Ce,
|
|
773
773
|
{
|
|
774
774
|
size: "sm",
|
|
775
775
|
variant: "outline",
|
|
776
|
-
className:
|
|
776
|
+
className: g(
|
|
777
777
|
"gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",
|
|
778
778
|
S && "!bg-green-700 !text-white hover:!bg-green-700"
|
|
779
779
|
),
|
|
780
780
|
onClick: () => {
|
|
781
781
|
S || h(t);
|
|
782
782
|
},
|
|
783
|
-
disabled:
|
|
784
|
-
children:
|
|
783
|
+
disabled: T,
|
|
784
|
+
children: T ? /* @__PURE__ */ e(Me, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(we, { children: [
|
|
785
785
|
S && /* @__PURE__ */ e(Te, { className: "h-3.5 w-3.5" }),
|
|
786
786
|
n.going
|
|
787
787
|
] })
|
|
788
788
|
}
|
|
789
789
|
),
|
|
790
790
|
/* @__PURE__ */ e(
|
|
791
|
-
|
|
791
|
+
Ce,
|
|
792
792
|
{
|
|
793
793
|
size: "sm",
|
|
794
794
|
variant: "outline",
|
|
795
|
-
className:
|
|
795
|
+
className: g(
|
|
796
796
|
"gap-1.5 h-8 !border-none !bg-rose-100 text-rose-800 hover:!bg-rose-200",
|
|
797
|
-
|
|
797
|
+
Y && "!bg-rose-700 !text-white hover:!bg-rose-700"
|
|
798
798
|
),
|
|
799
799
|
onClick: () => {
|
|
800
|
-
|
|
800
|
+
Y || d(t);
|
|
801
801
|
},
|
|
802
802
|
disabled: y,
|
|
803
|
-
children: y ? /* @__PURE__ */ e(
|
|
804
|
-
|
|
803
|
+
children: y ? /* @__PURE__ */ e(Me, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(we, { children: [
|
|
804
|
+
Y && /* @__PURE__ */ e(je, { className: "h-3.5 w-3.5" }),
|
|
805
805
|
n.notGoing
|
|
806
806
|
] })
|
|
807
807
|
}
|
|
808
808
|
)
|
|
809
809
|
] }) }),
|
|
810
|
-
|
|
811
|
-
|
|
810
|
+
$ && S && !t.meetingTookPlace && !t.isCanceled && v && /* @__PURE__ */ e("div", { className: "border-t border-zinc-100 dark:border-zinc-800 py-3", children: /* @__PURE__ */ r(
|
|
811
|
+
Ce,
|
|
812
812
|
{
|
|
813
813
|
size: "sm",
|
|
814
814
|
variant: "outline",
|
|
815
815
|
className: "w-full h-9 hover:!bg-green-100 hover:text-green-700 text-green-700 !bg-green-100 !border-none dark:text-green-400 dark:hover:bg-green-950/30",
|
|
816
|
-
onClick: () =>
|
|
817
|
-
disabled:
|
|
816
|
+
onClick: () => v(t),
|
|
817
|
+
disabled: z,
|
|
818
818
|
children: [
|
|
819
|
-
|
|
819
|
+
z && /* @__PURE__ */ e(Me, { className: "h-4 w-4 mr-2" }),
|
|
820
820
|
n.confirmMeeting
|
|
821
821
|
]
|
|
822
822
|
}
|
|
823
823
|
) })
|
|
824
824
|
] }),
|
|
825
|
-
|
|
826
|
-
onConfirm:
|
|
827
|
-
onCancel: () =>
|
|
825
|
+
E ? J && E({
|
|
826
|
+
onConfirm: f,
|
|
827
|
+
onCancel: () => G(!1),
|
|
828
828
|
isLoading: O
|
|
829
829
|
}) : /* @__PURE__ */ e(
|
|
830
830
|
qt,
|
|
831
831
|
{
|
|
832
|
-
open:
|
|
833
|
-
onOpenChange:
|
|
832
|
+
open: J,
|
|
833
|
+
onOpenChange: G,
|
|
834
834
|
title: n.deleteConfirmTitle,
|
|
835
835
|
description: n.deleteConfirmDescription,
|
|
836
836
|
cancelLabel: n.cancel,
|
|
837
837
|
confirmLabel: n.delete,
|
|
838
|
-
onConfirm:
|
|
838
|
+
onConfirm: f,
|
|
839
839
|
isLoading: O
|
|
840
840
|
}
|
|
841
841
|
)
|
|
@@ -845,88 +845,88 @@ function Nr({
|
|
|
845
845
|
event: t,
|
|
846
846
|
children: n,
|
|
847
847
|
open: o,
|
|
848
|
-
onOpenChange:
|
|
849
|
-
isLoading:
|
|
850
|
-
labels:
|
|
851
|
-
onEdit:
|
|
848
|
+
onOpenChange: a,
|
|
849
|
+
isLoading: i,
|
|
850
|
+
labels: l,
|
|
851
|
+
onEdit: p,
|
|
852
852
|
onDelete: h,
|
|
853
853
|
onCancel: d,
|
|
854
|
-
onAccept:
|
|
855
|
-
onDecline:
|
|
856
|
-
onConfirmMeeting:
|
|
857
|
-
canEdit:
|
|
858
|
-
canDelete:
|
|
854
|
+
onAccept: v,
|
|
855
|
+
onDecline: b,
|
|
856
|
+
onConfirmMeeting: w,
|
|
857
|
+
canEdit: A = !0,
|
|
858
|
+
canDelete: $ = !1,
|
|
859
859
|
canCancel: P = !0,
|
|
860
860
|
isCurrentUserParticipant: W,
|
|
861
|
-
isCurrentUserClient:
|
|
861
|
+
isCurrentUserClient: T,
|
|
862
862
|
currentUserAcceptStatus: y,
|
|
863
|
-
isAcceptLoading:
|
|
863
|
+
isAcceptLoading: z,
|
|
864
864
|
isDeclineLoading: O,
|
|
865
|
-
isConfirmLoading:
|
|
866
|
-
isDeleteLoading:
|
|
867
|
-
renderParticipant:
|
|
868
|
-
renderHeaderActions:
|
|
869
|
-
renderCancelReason:
|
|
865
|
+
isConfirmLoading: _,
|
|
866
|
+
isDeleteLoading: D,
|
|
867
|
+
renderParticipant: K,
|
|
868
|
+
renderHeaderActions: E,
|
|
869
|
+
renderCancelReason: H,
|
|
870
870
|
renderDeleteConfirmation: V,
|
|
871
|
-
formatDate:
|
|
872
|
-
formatTimeRange:
|
|
873
|
-
className:
|
|
874
|
-
width:
|
|
871
|
+
formatDate: J,
|
|
872
|
+
formatTimeRange: G,
|
|
873
|
+
className: B,
|
|
874
|
+
width: s = 360
|
|
875
875
|
}) {
|
|
876
|
-
const
|
|
877
|
-
|
|
878
|
-
}, [
|
|
876
|
+
const m = en("(min-width: 768px)"), N = { ...Kt, ...l }, L = F(() => {
|
|
877
|
+
a?.(!1);
|
|
878
|
+
}, [a]), S = {
|
|
879
879
|
event: t,
|
|
880
|
-
labels:
|
|
881
|
-
isLoading:
|
|
882
|
-
onClose:
|
|
883
|
-
onEdit:
|
|
880
|
+
labels: N,
|
|
881
|
+
isLoading: i,
|
|
882
|
+
onClose: L,
|
|
883
|
+
onEdit: p,
|
|
884
884
|
onDelete: h,
|
|
885
885
|
onCancel: d,
|
|
886
|
-
onAccept:
|
|
887
|
-
onDecline:
|
|
888
|
-
onConfirmMeeting:
|
|
889
|
-
canEdit:
|
|
890
|
-
canDelete:
|
|
886
|
+
onAccept: v,
|
|
887
|
+
onDecline: b,
|
|
888
|
+
onConfirmMeeting: w,
|
|
889
|
+
canEdit: A,
|
|
890
|
+
canDelete: $,
|
|
891
891
|
canCancel: P,
|
|
892
892
|
isCurrentUserParticipant: W,
|
|
893
|
-
isCurrentUserClient:
|
|
893
|
+
isCurrentUserClient: T,
|
|
894
894
|
currentUserAcceptStatus: y,
|
|
895
|
-
isAcceptLoading:
|
|
895
|
+
isAcceptLoading: z,
|
|
896
896
|
isDeclineLoading: O,
|
|
897
|
-
isConfirmLoading:
|
|
898
|
-
isDeleteLoading:
|
|
899
|
-
renderParticipant:
|
|
900
|
-
renderHeaderActions:
|
|
901
|
-
renderCancelReason:
|
|
897
|
+
isConfirmLoading: _,
|
|
898
|
+
isDeleteLoading: D,
|
|
899
|
+
renderParticipant: K,
|
|
900
|
+
renderHeaderActions: E,
|
|
901
|
+
renderCancelReason: H,
|
|
902
902
|
renderDeleteConfirmation: V,
|
|
903
|
-
formatDate:
|
|
904
|
-
formatTimeRange:
|
|
903
|
+
formatDate: J,
|
|
904
|
+
formatTimeRange: G
|
|
905
905
|
};
|
|
906
|
-
return
|
|
906
|
+
return m ? /* @__PURE__ */ r(lt, { open: o ?? !1, onOpenChange: a ?? (() => {
|
|
907
907
|
}), children: [
|
|
908
908
|
/* @__PURE__ */ e(ct, { asChild: !0, children: n }),
|
|
909
909
|
/* @__PURE__ */ e(
|
|
910
910
|
dt,
|
|
911
911
|
{
|
|
912
|
-
className:
|
|
912
|
+
className: g(
|
|
913
913
|
"p-0 shadow-lg !rounded-2xl bg-white dark:bg-zinc-900 overflow-hidden border z-50",
|
|
914
|
-
|
|
914
|
+
B
|
|
915
915
|
),
|
|
916
|
-
style: { width:
|
|
916
|
+
style: { width: s },
|
|
917
917
|
align: "center",
|
|
918
918
|
side: "bottom",
|
|
919
919
|
sideOffset: 4,
|
|
920
920
|
children: /* @__PURE__ */ e(Ge, { ...S })
|
|
921
921
|
}
|
|
922
922
|
)
|
|
923
|
-
] }) : /* @__PURE__ */ r(
|
|
923
|
+
] }) : /* @__PURE__ */ r(we, { children: [
|
|
924
924
|
n,
|
|
925
925
|
/* @__PURE__ */ e(
|
|
926
926
|
Jt,
|
|
927
927
|
{
|
|
928
928
|
open: o ?? !1,
|
|
929
|
-
onOpenChange:
|
|
929
|
+
onOpenChange: a ?? (() => {
|
|
930
930
|
}),
|
|
931
931
|
title: t.title,
|
|
932
932
|
children: /* @__PURE__ */ e(Ge, { ...S })
|
|
@@ -934,26 +934,26 @@ function Nr({
|
|
|
934
934
|
)
|
|
935
935
|
] });
|
|
936
936
|
}
|
|
937
|
-
const We = 44, Je = 4, tn = 56, qe = 8,
|
|
937
|
+
const We = 44, Je = 4, tn = 56, qe = 8, ze = 80, Ee = 140, Xe = 100, Qe = 2, nn = 8, rn = 18;
|
|
938
938
|
function on(t) {
|
|
939
939
|
return t.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2);
|
|
940
940
|
}
|
|
941
941
|
function sn(t, n) {
|
|
942
942
|
const o = [];
|
|
943
|
-
for (let
|
|
944
|
-
const
|
|
945
|
-
|
|
943
|
+
for (let a = 0; a < n; a++) {
|
|
944
|
+
const i = new Date(t);
|
|
945
|
+
i.setDate(i.getDate() + a), o.push(i);
|
|
946
946
|
}
|
|
947
947
|
return o;
|
|
948
948
|
}
|
|
949
949
|
function an(t, n, o) {
|
|
950
|
-
const
|
|
951
|
-
return t.forEach((
|
|
952
|
-
for (let
|
|
953
|
-
|
|
954
|
-
}),
|
|
950
|
+
const a = [];
|
|
951
|
+
return t.forEach((i, l) => {
|
|
952
|
+
for (let p = n; p < o; p++)
|
|
953
|
+
a.push({ hour: p, dayIndex: l, date: i });
|
|
954
|
+
}), a;
|
|
955
955
|
}
|
|
956
|
-
function
|
|
956
|
+
function Fe(t) {
|
|
957
957
|
return `${t.toString().padStart(2, "0")}:00`;
|
|
958
958
|
}
|
|
959
959
|
function ln(t) {
|
|
@@ -964,25 +964,25 @@ function ln(t) {
|
|
|
964
964
|
});
|
|
965
965
|
}
|
|
966
966
|
function Ze(t) {
|
|
967
|
-
const n = [...t].sort((
|
|
968
|
-
for (const
|
|
969
|
-
let
|
|
970
|
-
for (;
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
...
|
|
974
|
-
stackIndex:
|
|
967
|
+
const n = [...t].sort((i, l) => i.startCol !== l.startCol ? i.startCol - l.startCol : l.spanCols - i.spanCols), o = [], a = [];
|
|
968
|
+
for (const i of n) {
|
|
969
|
+
let l = 0;
|
|
970
|
+
for (; a[l] !== void 0 && a[l] > i.startCol; )
|
|
971
|
+
l++;
|
|
972
|
+
a[l] = i.startCol + i.spanCols, o.push({
|
|
973
|
+
...i,
|
|
974
|
+
stackIndex: l
|
|
975
975
|
});
|
|
976
976
|
}
|
|
977
977
|
return o;
|
|
978
978
|
}
|
|
979
|
-
function cn({ src: t, alt: n, fallback: o, className:
|
|
979
|
+
function cn({ src: t, alt: n, fallback: o, className: a }) {
|
|
980
980
|
return /* @__PURE__ */ e(
|
|
981
981
|
"div",
|
|
982
982
|
{
|
|
983
|
-
className:
|
|
983
|
+
className: g(
|
|
984
984
|
"relative flex shrink-0 overflow-hidden rounded-sm border bg-muted",
|
|
985
|
-
|
|
985
|
+
a
|
|
986
986
|
),
|
|
987
987
|
children: t ? /* @__PURE__ */ e(
|
|
988
988
|
"img",
|
|
@@ -1000,97 +1000,97 @@ function Le({
|
|
|
1000
1000
|
daysToShow: t = dn,
|
|
1001
1001
|
events: n,
|
|
1002
1002
|
users: o = [],
|
|
1003
|
-
selectedDate:
|
|
1004
|
-
onDateChange:
|
|
1005
|
-
onEventClick:
|
|
1006
|
-
onSlotClick:
|
|
1003
|
+
selectedDate: a,
|
|
1004
|
+
onDateChange: i,
|
|
1005
|
+
onEventClick: l,
|
|
1006
|
+
onSlotClick: p,
|
|
1007
1007
|
onSlotSelect: h,
|
|
1008
1008
|
visibleHours: d,
|
|
1009
|
-
className:
|
|
1010
|
-
getEventUserId:
|
|
1011
|
-
renderPopover:
|
|
1012
|
-
slots:
|
|
1013
|
-
classNames:
|
|
1009
|
+
className: v,
|
|
1010
|
+
getEventUserId: b,
|
|
1011
|
+
renderPopover: w,
|
|
1012
|
+
slots: A,
|
|
1013
|
+
classNames: $,
|
|
1014
1014
|
enableDrag: P = !0
|
|
1015
1015
|
}) {
|
|
1016
|
-
const W = ae(null),
|
|
1017
|
-
const
|
|
1016
|
+
const W = ae(null), T = Lt(), [y, z] = ie(null), O = ae(!1), [_, D] = ie(null), K = a ?? /* @__PURE__ */ new Date(), E = !0, H = d?.from ?? nn, V = d?.to ?? rn, J = V - H, G = Q(() => {
|
|
1017
|
+
const c = new Date(K);
|
|
1018
1018
|
if (t === 1 || t === 3)
|
|
1019
|
-
return
|
|
1020
|
-
const u =
|
|
1021
|
-
return
|
|
1022
|
-
}, [
|
|
1023
|
-
() => sn(
|
|
1024
|
-
[
|
|
1025
|
-
),
|
|
1026
|
-
() => an(
|
|
1027
|
-
[
|
|
1028
|
-
),
|
|
1029
|
-
if (
|
|
1030
|
-
const u =
|
|
1019
|
+
return c.setHours(0, 0, 0, 0), c;
|
|
1020
|
+
const u = c.getDay(), x = u === 0 ? -6 : 1 - u;
|
|
1021
|
+
return c.setDate(c.getDate() + x), c.setHours(0, 0, 0, 0), c;
|
|
1022
|
+
}, [K, t]), B = Q(
|
|
1023
|
+
() => sn(G, t),
|
|
1024
|
+
[G, t]
|
|
1025
|
+
), s = Q(
|
|
1026
|
+
() => an(B, H, V),
|
|
1027
|
+
[E, B, H, V]
|
|
1028
|
+
), N = b ?? ((c) => {
|
|
1029
|
+
if (c.resourceId) return c.resourceId;
|
|
1030
|
+
const u = c.data;
|
|
1031
1031
|
if (u?.userId) return String(u.userId);
|
|
1032
1032
|
if (u?.user && typeof u.user == "object" && u.user.id)
|
|
1033
1033
|
return String(u.user.id);
|
|
1034
|
-
if (
|
|
1035
|
-
if (
|
|
1036
|
-
}),
|
|
1037
|
-
const
|
|
1034
|
+
if (c.user?.id) return c.user.id;
|
|
1035
|
+
if (c.participants?.[0]?.id) return c.participants[0].id;
|
|
1036
|
+
}), L = Q(() => {
|
|
1037
|
+
const c = /* @__PURE__ */ new Map();
|
|
1038
1038
|
for (const u of o)
|
|
1039
|
-
|
|
1039
|
+
c.set(u.id, {
|
|
1040
1040
|
id: u.id,
|
|
1041
1041
|
name: u.name,
|
|
1042
1042
|
avatar: u.avatar ?? void 0,
|
|
1043
1043
|
email: u.email
|
|
1044
1044
|
});
|
|
1045
1045
|
for (const u of n) {
|
|
1046
|
-
const
|
|
1047
|
-
|
|
1048
|
-
id:
|
|
1049
|
-
name:
|
|
1050
|
-
avatar:
|
|
1051
|
-
email:
|
|
1052
|
-
}), u.user?.id && !
|
|
1046
|
+
const k = u.data?.user;
|
|
1047
|
+
k?.id && !c.has(k.id) && c.set(k.id, {
|
|
1048
|
+
id: k.id,
|
|
1049
|
+
name: k.name ?? "",
|
|
1050
|
+
avatar: k.avatar ?? void 0,
|
|
1051
|
+
email: k.email
|
|
1052
|
+
}), u.user?.id && !c.has(u.user.id) && c.set(u.user.id, {
|
|
1053
1053
|
id: u.user.id,
|
|
1054
1054
|
name: u.user.name,
|
|
1055
1055
|
avatar: u.user.avatar ?? void 0,
|
|
1056
1056
|
email: u.user.email
|
|
1057
1057
|
});
|
|
1058
|
-
for (const
|
|
1059
|
-
|
|
1060
|
-
id:
|
|
1061
|
-
name:
|
|
1062
|
-
avatar:
|
|
1063
|
-
email:
|
|
1058
|
+
for (const C of u.participants || [])
|
|
1059
|
+
C.id && !c.has(C.id) && c.set(C.id, {
|
|
1060
|
+
id: C.id,
|
|
1061
|
+
name: C.name,
|
|
1062
|
+
avatar: C.avatar ?? void 0,
|
|
1063
|
+
email: C.email
|
|
1064
1064
|
});
|
|
1065
1065
|
}
|
|
1066
|
-
return Array.from(
|
|
1067
|
-
}, [o, n]), S =
|
|
1068
|
-
const
|
|
1069
|
-
for (const
|
|
1070
|
-
u.set(
|
|
1066
|
+
return Array.from(c.values());
|
|
1067
|
+
}, [o, n]), S = Q(() => {
|
|
1068
|
+
const c = [], u = /* @__PURE__ */ new Map();
|
|
1069
|
+
for (const C of L)
|
|
1070
|
+
u.set(C.id, []);
|
|
1071
1071
|
u.set("unassigned", []);
|
|
1072
|
-
for (const
|
|
1073
|
-
const
|
|
1074
|
-
(u.get(
|
|
1072
|
+
for (const C of n) {
|
|
1073
|
+
const I = N(C) ?? "unassigned";
|
|
1074
|
+
(u.get(I) ?? u.get("unassigned")).push(C);
|
|
1075
1075
|
}
|
|
1076
|
-
const
|
|
1077
|
-
const
|
|
1078
|
-
for (const
|
|
1079
|
-
const
|
|
1080
|
-
for (let
|
|
1081
|
-
const
|
|
1082
|
-
if (
|
|
1083
|
-
let
|
|
1084
|
-
if (
|
|
1085
|
-
|
|
1086
|
-
Math.min(V,
|
|
1076
|
+
const x = (C) => {
|
|
1077
|
+
const I = [];
|
|
1078
|
+
for (const j of C) {
|
|
1079
|
+
const q = j.startDate.getHours() + j.startDate.getMinutes() / 60, te = j.endDate.getHours() + j.endDate.getMinutes() / 60;
|
|
1080
|
+
for (let X = 0; X < B.length; X++) {
|
|
1081
|
+
const oe = B[X], ye = Pe(oe), ke = ut(oe);
|
|
1082
|
+
if (j.startDate <= ke && j.endDate >= ye) {
|
|
1083
|
+
let Ne = H, Se = V;
|
|
1084
|
+
if (j.startDate >= ye && (Ne = Math.max(H, q)), j.endDate <= ke && (Se = Math.min(V, te)), Ne = Math.max(
|
|
1085
|
+
H,
|
|
1086
|
+
Math.min(V, Ne)
|
|
1087
1087
|
), Se = Math.max(
|
|
1088
|
-
|
|
1088
|
+
H,
|
|
1089
1089
|
Math.min(V, Se)
|
|
1090
|
-
), Se >
|
|
1091
|
-
const Re =
|
|
1092
|
-
|
|
1093
|
-
event:
|
|
1090
|
+
), Se > Ne) {
|
|
1091
|
+
const Re = X * J + Math.floor(Ne - H), gt = X * J + Math.ceil(Se - H);
|
|
1092
|
+
I.push({
|
|
1093
|
+
event: j,
|
|
1094
1094
|
startCol: Re,
|
|
1095
1095
|
spanCols: Math.max(1, gt - Re)
|
|
1096
1096
|
});
|
|
@@ -1098,105 +1098,105 @@ function Le({
|
|
|
1098
1098
|
}
|
|
1099
1099
|
}
|
|
1100
1100
|
}
|
|
1101
|
-
return
|
|
1101
|
+
return I;
|
|
1102
1102
|
};
|
|
1103
|
-
for (const
|
|
1104
|
-
const
|
|
1105
|
-
(
|
|
1103
|
+
for (const C of L) {
|
|
1104
|
+
const I = u.get(C.id) ?? [], j = x(I), q = Ze(j), te = q.reduce(
|
|
1105
|
+
(X, oe) => Math.max(X, oe.stackIndex + 1),
|
|
1106
1106
|
0
|
|
1107
1107
|
);
|
|
1108
|
-
|
|
1109
|
-
user:
|
|
1110
|
-
events:
|
|
1111
|
-
maxStack: Math.max(
|
|
1108
|
+
c.push({
|
|
1109
|
+
user: C,
|
|
1110
|
+
events: q,
|
|
1111
|
+
maxStack: Math.max(te, 1)
|
|
1112
1112
|
});
|
|
1113
1113
|
}
|
|
1114
|
-
const
|
|
1115
|
-
if (
|
|
1116
|
-
const
|
|
1117
|
-
(
|
|
1114
|
+
const k = u.get("unassigned") ?? [];
|
|
1115
|
+
if (k.length > 0) {
|
|
1116
|
+
const C = x(k), I = Ze(C), j = I.reduce(
|
|
1117
|
+
(q, te) => Math.max(q, te.stackIndex + 1),
|
|
1118
1118
|
0
|
|
1119
1119
|
);
|
|
1120
|
-
|
|
1120
|
+
c.push({
|
|
1121
1121
|
user: {
|
|
1122
1122
|
id: "unassigned",
|
|
1123
1123
|
name: "Unassigned",
|
|
1124
1124
|
avatar: void 0,
|
|
1125
1125
|
email: void 0
|
|
1126
1126
|
},
|
|
1127
|
-
events:
|
|
1128
|
-
maxStack: Math.max(
|
|
1127
|
+
events: I,
|
|
1128
|
+
maxStack: Math.max(j, 1)
|
|
1129
1129
|
});
|
|
1130
1130
|
}
|
|
1131
|
-
return
|
|
1131
|
+
return c.filter((C) => C.events.length > 0);
|
|
1132
1132
|
}, [
|
|
1133
|
-
|
|
1133
|
+
L,
|
|
1134
1134
|
n,
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1135
|
+
B,
|
|
1136
|
+
E,
|
|
1137
|
+
J,
|
|
1138
|
+
H,
|
|
1139
1139
|
V,
|
|
1140
|
-
|
|
1141
|
-
]),
|
|
1142
|
-
const
|
|
1140
|
+
N
|
|
1141
|
+
]), Y = Q(() => {
|
|
1142
|
+
const c = /* @__PURE__ */ new Map();
|
|
1143
1143
|
for (const u of S)
|
|
1144
|
-
for (const
|
|
1145
|
-
if (
|
|
1146
|
-
const
|
|
1147
|
-
|
|
1144
|
+
for (const x of u.events)
|
|
1145
|
+
if (x.spanCols === 1) {
|
|
1146
|
+
const k = c.get(x.startCol) ?? 0;
|
|
1147
|
+
c.set(x.startCol, k + 1);
|
|
1148
1148
|
}
|
|
1149
|
-
return
|
|
1150
|
-
}, [S]),
|
|
1151
|
-
const
|
|
1152
|
-
for (let
|
|
1153
|
-
const
|
|
1154
|
-
|
|
1155
|
-
Xe + (
|
|
1156
|
-
) :
|
|
1149
|
+
return c;
|
|
1150
|
+
}, [S]), R = Q(() => {
|
|
1151
|
+
const c = s.length, u = ze, x = [];
|
|
1152
|
+
for (let k = 0; k < c; k++) {
|
|
1153
|
+
const C = Y.get(k) ?? 0;
|
|
1154
|
+
C > Qe ? x.push(
|
|
1155
|
+
Xe + (C - Qe) * 20
|
|
1156
|
+
) : C > 0 ? x.push(Math.max(u, Xe)) : x.push(u);
|
|
1157
1157
|
}
|
|
1158
|
-
return
|
|
1158
|
+
return x;
|
|
1159
1159
|
}, [
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
]),
|
|
1160
|
+
E,
|
|
1161
|
+
s.length,
|
|
1162
|
+
B.length,
|
|
1163
|
+
Y
|
|
1164
|
+
]), se = (c) => Math.max(
|
|
1165
1165
|
tn,
|
|
1166
|
-
|
|
1167
|
-
), ee = Ee +
|
|
1168
|
-
const
|
|
1169
|
-
for (let u = 0; u <
|
|
1170
|
-
|
|
1171
|
-
return
|
|
1172
|
-
}, [
|
|
1166
|
+
c * (We + Je) + qe * 2
|
|
1167
|
+
), ee = Ee + R.reduce((c, u) => c + u, 0), Z = Q(() => {
|
|
1168
|
+
const c = [0];
|
|
1169
|
+
for (let u = 0; u < R.length; u++)
|
|
1170
|
+
c.push(c[u] + R[u]);
|
|
1171
|
+
return c;
|
|
1172
|
+
}, [R]);
|
|
1173
1173
|
vt(() => {
|
|
1174
|
-
const
|
|
1175
|
-
if (!
|
|
1174
|
+
const c = W.current;
|
|
1175
|
+
if (!c) return;
|
|
1176
1176
|
const u = () => {
|
|
1177
|
-
let
|
|
1178
|
-
const
|
|
1177
|
+
let x = -1;
|
|
1178
|
+
const C = (/* @__PURE__ */ new Date()).getHours();
|
|
1179
1179
|
{
|
|
1180
|
-
for (let
|
|
1181
|
-
const
|
|
1182
|
-
if (
|
|
1183
|
-
|
|
1180
|
+
for (let I = 0; I < s.length; I++) {
|
|
1181
|
+
const j = s[I];
|
|
1182
|
+
if (j && ce(j.date) && j.hour <= C && j.hour + 1 > C) {
|
|
1183
|
+
x = I;
|
|
1184
1184
|
break;
|
|
1185
1185
|
}
|
|
1186
1186
|
}
|
|
1187
|
-
if (
|
|
1188
|
-
for (let
|
|
1189
|
-
const
|
|
1190
|
-
if (
|
|
1191
|
-
|
|
1187
|
+
if (x === -1)
|
|
1188
|
+
for (let I = 0; I < s.length; I++) {
|
|
1189
|
+
const j = s[I];
|
|
1190
|
+
if (j && ce(j.date)) {
|
|
1191
|
+
x = I;
|
|
1192
1192
|
break;
|
|
1193
1193
|
}
|
|
1194
1194
|
}
|
|
1195
1195
|
}
|
|
1196
|
-
if (
|
|
1197
|
-
const
|
|
1198
|
-
|
|
1199
|
-
left:
|
|
1196
|
+
if (x !== -1) {
|
|
1197
|
+
const I = (Z[x] ?? 0) + Ee, j = c.clientWidth, q = Math.max(0, I - j / 3);
|
|
1198
|
+
c.scrollTo({
|
|
1199
|
+
left: q,
|
|
1200
1200
|
behavior: "instant"
|
|
1201
1201
|
});
|
|
1202
1202
|
}
|
|
@@ -1204,104 +1204,104 @@ function Le({
|
|
|
1204
1204
|
requestAnimationFrame(() => {
|
|
1205
1205
|
requestAnimationFrame(u);
|
|
1206
1206
|
});
|
|
1207
|
-
}, [
|
|
1208
|
-
const
|
|
1209
|
-
(
|
|
1210
|
-
const
|
|
1211
|
-
for (let
|
|
1212
|
-
const
|
|
1213
|
-
if (
|
|
1214
|
-
const
|
|
1215
|
-
return { colIndex:
|
|
1207
|
+
}, [K, s, B, Z, E]);
|
|
1208
|
+
const ve = F(
|
|
1209
|
+
(c, u) => {
|
|
1210
|
+
const x = u.getBoundingClientRect(), k = c - x.left + u.scrollLeft;
|
|
1211
|
+
for (let C = 0; C < Z.length - 1; C++) {
|
|
1212
|
+
const I = Z[C], j = Z[C + 1];
|
|
1213
|
+
if (k >= I && k < j) {
|
|
1214
|
+
const q = (k - I) / (j - I), te = Math.floor(q * 60), X = Math.round(te / 15) * 15;
|
|
1215
|
+
return { colIndex: C, minute: Math.min(X, 45) };
|
|
1216
1216
|
}
|
|
1217
1217
|
}
|
|
1218
1218
|
return null;
|
|
1219
1219
|
},
|
|
1220
|
-
[
|
|
1221
|
-
),
|
|
1222
|
-
(
|
|
1223
|
-
if (c
|
|
1224
|
-
const
|
|
1225
|
-
return
|
|
1220
|
+
[Z]
|
|
1221
|
+
), ne = F(
|
|
1222
|
+
(c, u) => {
|
|
1223
|
+
if (s[c]) {
|
|
1224
|
+
const x = s[c], k = new Date(x.date);
|
|
1225
|
+
return k.setHours(x.hour, u ?? 0, 0, 0), { date: k, hour: x.hour };
|
|
1226
1226
|
}
|
|
1227
1227
|
return { date: /* @__PURE__ */ new Date() };
|
|
1228
1228
|
},
|
|
1229
|
-
[
|
|
1230
|
-
), le =
|
|
1231
|
-
(
|
|
1232
|
-
if (
|
|
1233
|
-
const
|
|
1234
|
-
if (!
|
|
1235
|
-
const { colIndex:
|
|
1236
|
-
|
|
1237
|
-
const { originalStartDate:
|
|
1238
|
-
let
|
|
1229
|
+
[E, s, B]
|
|
1230
|
+
), le = F(
|
|
1231
|
+
(c, u) => {
|
|
1232
|
+
if (c.preventDefault(), c.dataTransfer.dropEffect = "move", !T?.isDragging || !T.dragState) return;
|
|
1233
|
+
const x = c.currentTarget, k = ve(c.clientX, x);
|
|
1234
|
+
if (!k) return;
|
|
1235
|
+
const { colIndex: C, minute: I } = k, { date: j, hour: q } = ne(C, I);
|
|
1236
|
+
T.updateDragPreview(j, q, I, u);
|
|
1237
|
+
const { originalStartDate: te, originalEndDate: X } = T.dragState, oe = X.getTime() - te.getTime(), ye = s.length;
|
|
1238
|
+
let ke;
|
|
1239
1239
|
{
|
|
1240
|
-
const
|
|
1241
|
-
|
|
1240
|
+
const Ne = oe / 36e5;
|
|
1241
|
+
ke = Math.max(1, Math.ceil(Ne));
|
|
1242
1242
|
}
|
|
1243
|
-
|
|
1243
|
+
ke = Math.min(ke, ye - C), D({ resourceId: u, colIndex: C, spanCols: ke });
|
|
1244
1244
|
},
|
|
1245
|
-
[
|
|
1246
|
-
),
|
|
1247
|
-
(
|
|
1248
|
-
const u =
|
|
1249
|
-
|
|
1245
|
+
[T, ve, ne, E, s.length, B.length]
|
|
1246
|
+
), be = F(
|
|
1247
|
+
(c) => {
|
|
1248
|
+
const u = c.relatedTarget;
|
|
1249
|
+
c.currentTarget.contains(u) || D(null);
|
|
1250
1250
|
},
|
|
1251
1251
|
[]
|
|
1252
|
-
),
|
|
1253
|
-
(
|
|
1254
|
-
|
|
1252
|
+
), ue = F(
|
|
1253
|
+
(c, u) => {
|
|
1254
|
+
c.preventDefault(), D(null), T?.isDragging && T.endDrag();
|
|
1255
1255
|
},
|
|
1256
|
-
[
|
|
1257
|
-
),
|
|
1258
|
-
(
|
|
1259
|
-
if (!y || y.resourceId !==
|
|
1260
|
-
const
|
|
1261
|
-
return u >=
|
|
1256
|
+
[T]
|
|
1257
|
+
), f = F(
|
|
1258
|
+
(c, u) => {
|
|
1259
|
+
if (!y || y.resourceId !== c) return !1;
|
|
1260
|
+
const x = Math.min(y.startCol, y.endCol), k = Math.max(y.startCol, y.endCol);
|
|
1261
|
+
return u >= x && u <= k;
|
|
1262
1262
|
},
|
|
1263
1263
|
[y]
|
|
1264
|
-
), M =
|
|
1265
|
-
(
|
|
1266
|
-
[
|
|
1267
|
-
), U =
|
|
1268
|
-
(
|
|
1269
|
-
|
|
1264
|
+
), M = F(
|
|
1265
|
+
(c, u) => !_ || _.resourceId !== c ? !1 : u >= _.colIndex && u < _.colIndex + _.spanCols,
|
|
1266
|
+
[_]
|
|
1267
|
+
), U = F(
|
|
1268
|
+
(c, u, x) => {
|
|
1269
|
+
x.button !== 0 && x.pointerType === "mouse" || (h || p) && (x.preventDefault(), O.current = !0, z({ resourceId: c, startCol: u, endCol: u, isSelecting: !0 }));
|
|
1270
1270
|
},
|
|
1271
|
-
[h,
|
|
1272
|
-
),
|
|
1273
|
-
(
|
|
1274
|
-
if (O.current && !(!y || y.resourceId !==
|
|
1275
|
-
if (
|
|
1271
|
+
[h, p]
|
|
1272
|
+
), re = F(
|
|
1273
|
+
(c, u, x) => {
|
|
1274
|
+
if (O.current && !(!y || y.resourceId !== c)) {
|
|
1275
|
+
if (x.buttons === 0) {
|
|
1276
1276
|
O.current = !1;
|
|
1277
1277
|
return;
|
|
1278
1278
|
}
|
|
1279
|
-
|
|
1279
|
+
z((k) => k ? { ...k, endCol: u } : null);
|
|
1280
1280
|
}
|
|
1281
1281
|
},
|
|
1282
1282
|
[y]
|
|
1283
|
-
),
|
|
1283
|
+
), De = F(() => {
|
|
1284
1284
|
if (!O.current || !y) return;
|
|
1285
1285
|
O.current = !1;
|
|
1286
|
-
const
|
|
1287
|
-
|
|
1288
|
-
const
|
|
1289
|
-
startDate:
|
|
1290
|
-
endDate:
|
|
1286
|
+
const c = Math.min(y.startCol, y.endCol), u = Math.max(y.startCol, y.endCol), x = ne(c), k = ne(u), C = new Date(x.date), I = new Date(k.date);
|
|
1287
|
+
k.hour !== void 0 && I.setHours(k.hour + 1, 0, 0, 0);
|
|
1288
|
+
const j = {
|
|
1289
|
+
startDate: C,
|
|
1290
|
+
endDate: I,
|
|
1291
1291
|
resourceId: y.resourceId
|
|
1292
1292
|
};
|
|
1293
|
-
|
|
1294
|
-
}, [y,
|
|
1295
|
-
return
|
|
1296
|
-
const
|
|
1297
|
-
O.current &&
|
|
1293
|
+
c === u && p && p(x.date, x.hour, y.resourceId), h?.(j), z((q) => q ? { ...q, isSelecting: !1 } : null), setTimeout(() => z(null), 150);
|
|
1294
|
+
}, [y, ne, E, p, h]);
|
|
1295
|
+
return de(() => {
|
|
1296
|
+
const c = () => {
|
|
1297
|
+
O.current && De();
|
|
1298
1298
|
};
|
|
1299
|
-
return window.addEventListener("pointerup",
|
|
1300
|
-
window.removeEventListener("pointerup",
|
|
1299
|
+
return window.addEventListener("pointerup", c), window.addEventListener("pointercancel", c), () => {
|
|
1300
|
+
window.removeEventListener("pointerup", c), window.removeEventListener("pointercancel", c);
|
|
1301
1301
|
};
|
|
1302
|
-
}, [
|
|
1303
|
-
|
|
1304
|
-
}, [
|
|
1302
|
+
}, [De]), de(() => {
|
|
1303
|
+
T?.isDragging || D(null);
|
|
1304
|
+
}, [T?.isDragging]), /* @__PURE__ */ e("div", { className: g("flex h-full flex-col", v), children: /* @__PURE__ */ e("div", { className: "ic-timeline-scroll-container flex-1", ref: W, children: /* @__PURE__ */ r("div", { className: "relative", style: { minWidth: ee }, children: [
|
|
1305
1305
|
// Hour mode: Day headers + Hour sub-headers - sticky wrapper with flex child (sticky + flex breaks sticky)
|
|
1306
1306
|
/* @__PURE__ */ e("div", { className: "ic-timeline-header sticky top-0 z-20 border-b bg-background", children: t > 1 ? (
|
|
1307
1307
|
// Multi-day: Resources cell spans both day-header + hour-header rows
|
|
@@ -1315,35 +1315,35 @@ function Le({
|
|
|
1315
1315
|
}
|
|
1316
1316
|
),
|
|
1317
1317
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 flex-col", children: [
|
|
1318
|
-
/* @__PURE__ */ e("div", { className: "flex border-b", children:
|
|
1319
|
-
const
|
|
1318
|
+
/* @__PURE__ */ e("div", { className: "flex border-b", children: B.map((c, u) => {
|
|
1319
|
+
const x = ce(c), k = u * J, C = R.slice(k, k + J).reduce((I, j) => I + j, 0);
|
|
1320
1320
|
return /* @__PURE__ */ e(
|
|
1321
1321
|
"div",
|
|
1322
1322
|
{
|
|
1323
|
-
className:
|
|
1323
|
+
className: g(
|
|
1324
1324
|
"flex shrink-0 items-center justify-center border-r py-1.5 font-medium",
|
|
1325
|
-
|
|
1325
|
+
x ? "bg-primary/10 text-primary" : "bg-muted/30"
|
|
1326
1326
|
),
|
|
1327
|
-
style: { width:
|
|
1328
|
-
children: /* @__PURE__ */ e("span", { className: "text-xs", children: ln(
|
|
1327
|
+
style: { width: C },
|
|
1328
|
+
children: /* @__PURE__ */ e("span", { className: "text-xs", children: ln(c) })
|
|
1329
1329
|
},
|
|
1330
|
-
`day-${
|
|
1330
|
+
`day-${c.toISOString()}`
|
|
1331
1331
|
);
|
|
1332
1332
|
}) }),
|
|
1333
|
-
/* @__PURE__ */ e("div", { className: "flex", children:
|
|
1334
|
-
const
|
|
1333
|
+
/* @__PURE__ */ e("div", { className: "flex", children: s.map((c, u) => {
|
|
1334
|
+
const x = c.hour === H, k = ce(c.date), C = R[u] ?? ze;
|
|
1335
1335
|
return /* @__PURE__ */ e(
|
|
1336
1336
|
"div",
|
|
1337
1337
|
{
|
|
1338
|
-
className:
|
|
1338
|
+
className: g(
|
|
1339
1339
|
"flex shrink-0 items-center justify-center py-1.5 text-[10px] text-muted-foreground",
|
|
1340
|
-
|
|
1341
|
-
|
|
1340
|
+
x && u > 0 ? "border-l-2 border-l-border" : "border-r border-r-border/50",
|
|
1341
|
+
k && "bg-primary/5"
|
|
1342
1342
|
),
|
|
1343
|
-
style: { width:
|
|
1344
|
-
children:
|
|
1343
|
+
style: { width: C },
|
|
1344
|
+
children: Fe(c.hour)
|
|
1345
1345
|
},
|
|
1346
|
-
`hour-${
|
|
1346
|
+
`hour-${c.dayIndex}-${c.hour}`
|
|
1347
1347
|
);
|
|
1348
1348
|
}) })
|
|
1349
1349
|
] })
|
|
@@ -1359,32 +1359,32 @@ function Le({
|
|
|
1359
1359
|
children: /* @__PURE__ */ e("span", { className: "text-[10px] font-medium uppercase text-muted-foreground", children: "Resources" })
|
|
1360
1360
|
}
|
|
1361
1361
|
),
|
|
1362
|
-
|
|
1363
|
-
const
|
|
1362
|
+
s.map((c, u) => {
|
|
1363
|
+
const x = c.hour === H, k = ce(c.date), C = R[u] ?? ze;
|
|
1364
1364
|
return /* @__PURE__ */ e(
|
|
1365
1365
|
"div",
|
|
1366
1366
|
{
|
|
1367
|
-
className:
|
|
1367
|
+
className: g(
|
|
1368
1368
|
"flex shrink-0 items-center justify-center py-1.5 text-[10px] text-muted-foreground",
|
|
1369
|
-
|
|
1370
|
-
|
|
1369
|
+
x && u > 0 ? "border-l-2 border-l-border" : "border-r border-r-border/50",
|
|
1370
|
+
k && "bg-primary/5"
|
|
1371
1371
|
),
|
|
1372
|
-
style: { width:
|
|
1373
|
-
children:
|
|
1372
|
+
style: { width: C },
|
|
1373
|
+
children: Fe(c.hour)
|
|
1374
1374
|
},
|
|
1375
|
-
`hour-${
|
|
1375
|
+
`hour-${c.dayIndex}-${c.hour}`
|
|
1376
1376
|
);
|
|
1377
1377
|
})
|
|
1378
1378
|
] })
|
|
1379
1379
|
) }),
|
|
1380
|
-
S.map((
|
|
1381
|
-
const u =
|
|
1380
|
+
S.map((c) => {
|
|
1381
|
+
const u = se(c.maxStack);
|
|
1382
1382
|
return /* @__PURE__ */ r(
|
|
1383
1383
|
"div",
|
|
1384
1384
|
{
|
|
1385
|
-
className:
|
|
1385
|
+
className: g(
|
|
1386
1386
|
"relative flex border-b",
|
|
1387
|
-
|
|
1387
|
+
$?.resourceRow
|
|
1388
1388
|
),
|
|
1389
1389
|
style: { height: u },
|
|
1390
1390
|
children: [
|
|
@@ -1396,21 +1396,21 @@ function Le({
|
|
|
1396
1396
|
children: /* @__PURE__ */ r(
|
|
1397
1397
|
"div",
|
|
1398
1398
|
{
|
|
1399
|
-
className:
|
|
1399
|
+
className: g(
|
|
1400
1400
|
"flex h-full items-center gap-2 sm:gap-3 border-r bg-background px-2 sm:px-4",
|
|
1401
|
-
|
|
1401
|
+
$?.resourceHeader
|
|
1402
1402
|
),
|
|
1403
1403
|
children: [
|
|
1404
1404
|
/* @__PURE__ */ e(
|
|
1405
1405
|
cn,
|
|
1406
1406
|
{
|
|
1407
1407
|
className: "size-7",
|
|
1408
|
-
src:
|
|
1409
|
-
alt:
|
|
1410
|
-
fallback: on(
|
|
1408
|
+
src: c.user.avatar,
|
|
1409
|
+
alt: c.user.name,
|
|
1410
|
+
fallback: on(c.user.name)
|
|
1411
1411
|
}
|
|
1412
1412
|
),
|
|
1413
|
-
/* @__PURE__ */ e("span", { className: "truncate text-xs sm:text-sm font-medium", children:
|
|
1413
|
+
/* @__PURE__ */ e("span", { className: "truncate text-xs sm:text-sm font-medium", children: c.user.name })
|
|
1414
1414
|
]
|
|
1415
1415
|
}
|
|
1416
1416
|
)
|
|
@@ -1420,82 +1420,82 @@ function Le({
|
|
|
1420
1420
|
"div",
|
|
1421
1421
|
{
|
|
1422
1422
|
className: "ic-timeline-grid relative flex",
|
|
1423
|
-
onDragOver: (
|
|
1424
|
-
onDragLeave:
|
|
1425
|
-
onDrop: (
|
|
1423
|
+
onDragOver: (x) => le(x, c.user.id),
|
|
1424
|
+
onDragLeave: be,
|
|
1425
|
+
onDrop: (x) => ue(x, c.user.id),
|
|
1426
1426
|
children: [
|
|
1427
1427
|
// Hour mode cells — interactive buttons for slot selection
|
|
1428
|
-
|
|
1429
|
-
const
|
|
1428
|
+
s.map((x, k) => {
|
|
1429
|
+
const C = x.hour === H && k > 0, I = R[k] ?? ze, j = f(c.user.id, k), q = M(c.user.id, k), te = !!(h || p);
|
|
1430
1430
|
return /* @__PURE__ */ e(
|
|
1431
1431
|
"div",
|
|
1432
1432
|
{
|
|
1433
|
-
role:
|
|
1434
|
-
tabIndex:
|
|
1435
|
-
"aria-label":
|
|
1436
|
-
onPointerDown: (
|
|
1437
|
-
onPointerEnter: (
|
|
1438
|
-
onPointerUp:
|
|
1439
|
-
onKeyDown: (
|
|
1440
|
-
if (
|
|
1441
|
-
|
|
1442
|
-
const
|
|
1443
|
-
|
|
1444
|
-
startDate:
|
|
1433
|
+
role: te ? "button" : void 0,
|
|
1434
|
+
tabIndex: te ? 0 : void 0,
|
|
1435
|
+
"aria-label": te ? `Select ${Fe(x.hour)} on ${x.date.toLocaleDateString()} for ${c.user.name}` : void 0,
|
|
1436
|
+
onPointerDown: (X) => U(c.user.id, k, X),
|
|
1437
|
+
onPointerEnter: (X) => re(c.user.id, k, X),
|
|
1438
|
+
onPointerUp: De,
|
|
1439
|
+
onKeyDown: (X) => {
|
|
1440
|
+
if (te && (X.key === "Enter" || X.key === " ")) {
|
|
1441
|
+
X.preventDefault();
|
|
1442
|
+
const oe = ne(k);
|
|
1443
|
+
p?.(oe.date, oe.hour, c.user.id), h?.({
|
|
1444
|
+
startDate: oe.date,
|
|
1445
1445
|
endDate: (() => {
|
|
1446
|
-
const
|
|
1447
|
-
return
|
|
1446
|
+
const ye = new Date(oe.date);
|
|
1447
|
+
return oe.hour !== void 0 && ye.setHours(oe.hour + 1, 0, 0, 0), ye;
|
|
1448
1448
|
})(),
|
|
1449
|
-
resourceId:
|
|
1449
|
+
resourceId: c.user.id
|
|
1450
1450
|
});
|
|
1451
1451
|
}
|
|
1452
1452
|
},
|
|
1453
|
-
className:
|
|
1453
|
+
className: g(
|
|
1454
1454
|
"shrink-0 select-none touch-none transition-colors",
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1455
|
+
te && "cursor-pointer",
|
|
1456
|
+
C ? "border-l-2 border-l-border" : "border-r border-r-border/50",
|
|
1457
|
+
ce(x.date) && "bg-primary/5",
|
|
1458
1458
|
// Hover — subtle feedback (only when not selecting or dragging)
|
|
1459
|
-
|
|
1459
|
+
te && !y?.isSelecting && !T?.isDragging && "hover:bg-blue-50/60",
|
|
1460
1460
|
// Slot selection highlight
|
|
1461
|
-
|
|
1461
|
+
j && "bg-blue-100/70",
|
|
1462
1462
|
// Drop target highlight
|
|
1463
|
-
|
|
1463
|
+
q && "bg-primary/20 ring-2 ring-primary ring-inset"
|
|
1464
1464
|
),
|
|
1465
|
-
style: { width:
|
|
1465
|
+
style: { width: I }
|
|
1466
1466
|
},
|
|
1467
|
-
`cell-${
|
|
1467
|
+
`cell-${x.dayIndex}-${x.hour}`
|
|
1468
1468
|
);
|
|
1469
1469
|
}),
|
|
1470
|
-
|
|
1471
|
-
const
|
|
1470
|
+
c.events.map((x) => {
|
|
1471
|
+
const k = (Z[x.startCol] ?? 0) + 2, C = Z[x.startCol + x.spanCols] ?? Z[Z.length - 1] ?? 0, I = Z[x.startCol] ?? 0, j = C - I - 4, q = qe + x.stackIndex * (We + Je);
|
|
1472
1472
|
return /* @__PURE__ */ e(
|
|
1473
1473
|
"div",
|
|
1474
1474
|
{
|
|
1475
1475
|
className: "absolute",
|
|
1476
1476
|
style: {
|
|
1477
|
-
left:
|
|
1478
|
-
width: Math.max(
|
|
1477
|
+
left: k,
|
|
1478
|
+
width: Math.max(j, 0),
|
|
1479
1479
|
// No forced minimum - columns are guaranteed wide enough
|
|
1480
|
-
top:
|
|
1480
|
+
top: q,
|
|
1481
1481
|
height: We
|
|
1482
1482
|
},
|
|
1483
1483
|
children: /* @__PURE__ */ e(
|
|
1484
1484
|
Nt,
|
|
1485
1485
|
{
|
|
1486
|
-
event:
|
|
1486
|
+
event: x.event,
|
|
1487
1487
|
variant: "compact",
|
|
1488
1488
|
enableDrag: P,
|
|
1489
|
-
onClick:
|
|
1490
|
-
renderPopover:
|
|
1491
|
-
className:
|
|
1489
|
+
onClick: l,
|
|
1490
|
+
renderPopover: w,
|
|
1491
|
+
className: g(
|
|
1492
1492
|
"h-full w-full",
|
|
1493
|
-
|
|
1493
|
+
$?.eventCardCompact
|
|
1494
1494
|
)
|
|
1495
1495
|
}
|
|
1496
1496
|
)
|
|
1497
1497
|
},
|
|
1498
|
-
|
|
1498
|
+
x.event.id
|
|
1499
1499
|
);
|
|
1500
1500
|
})
|
|
1501
1501
|
]
|
|
@@ -1503,7 +1503,7 @@ function Le({
|
|
|
1503
1503
|
)
|
|
1504
1504
|
]
|
|
1505
1505
|
},
|
|
1506
|
-
|
|
1506
|
+
c.user.id
|
|
1507
1507
|
);
|
|
1508
1508
|
}),
|
|
1509
1509
|
S.length === 0 && /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-20 text-muted-foreground", children: "No users or events to display" })
|
|
@@ -1527,39 +1527,39 @@ function et(t) {
|
|
|
1527
1527
|
const n = t.hexColor;
|
|
1528
1528
|
return n ? { backgroundColor: n } : {};
|
|
1529
1529
|
}
|
|
1530
|
-
function mn({ day: t, date: n, events: o, isCurrentMonth:
|
|
1531
|
-
const
|
|
1530
|
+
function mn({ day: t, date: n, events: o, isCurrentMonth: a, onDayClick: i }) {
|
|
1531
|
+
const l = ce(n), p = 3, h = o.length;
|
|
1532
1532
|
return /* @__PURE__ */ r(
|
|
1533
1533
|
"button",
|
|
1534
1534
|
{
|
|
1535
1535
|
type: "button",
|
|
1536
|
-
onClick: () =>
|
|
1537
|
-
className:
|
|
1536
|
+
onClick: () => i?.(n),
|
|
1537
|
+
className: g(
|
|
1538
1538
|
"flex h-9 sm:h-11 flex-1 flex-col items-center justify-start gap-0.5 rounded-md pt-0.5 sm:pt-1",
|
|
1539
1539
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
1540
1540
|
"transition-colors",
|
|
1541
|
-
!
|
|
1541
|
+
!a && "opacity-40"
|
|
1542
1542
|
),
|
|
1543
1543
|
children: [
|
|
1544
1544
|
/* @__PURE__ */ e(
|
|
1545
1545
|
"div",
|
|
1546
1546
|
{
|
|
1547
|
-
className:
|
|
1547
|
+
className: g(
|
|
1548
1548
|
"flex size-5 sm:size-6 items-center justify-center rounded-full text-[10px] sm:text-xs font-medium",
|
|
1549
|
-
|
|
1549
|
+
l && "bg-primary font-semibold text-primary-foreground"
|
|
1550
1550
|
),
|
|
1551
1551
|
children: t
|
|
1552
1552
|
}
|
|
1553
1553
|
),
|
|
1554
|
-
h > 0 && /* @__PURE__ */ e("div", { className: "mt-0.5 flex items-center gap-0.5", children: h <=
|
|
1554
|
+
h > 0 && /* @__PURE__ */ e("div", { className: "mt-0.5 flex items-center gap-0.5", children: h <= p ? o.map((d) => /* @__PURE__ */ e(
|
|
1555
1555
|
"div",
|
|
1556
1556
|
{
|
|
1557
1557
|
className: "size-1 sm:size-1.5 rounded-full bg-primary",
|
|
1558
1558
|
style: et(d)
|
|
1559
1559
|
},
|
|
1560
1560
|
d.id
|
|
1561
|
-
)) : /* @__PURE__ */ r(
|
|
1562
|
-
o.slice(0,
|
|
1561
|
+
)) : /* @__PURE__ */ r(we, { children: [
|
|
1562
|
+
o.slice(0, p).map((d) => /* @__PURE__ */ e(
|
|
1563
1563
|
"div",
|
|
1564
1564
|
{
|
|
1565
1565
|
className: "size-1 sm:size-1.5 rounded-full bg-primary",
|
|
@@ -1569,7 +1569,7 @@ function mn({ day: t, date: n, events: o, isCurrentMonth: s, onDayClick: a }) {
|
|
|
1569
1569
|
)),
|
|
1570
1570
|
/* @__PURE__ */ r("span", { className: "text-[6px] sm:text-[7px] font-medium text-muted-foreground", children: [
|
|
1571
1571
|
"+",
|
|
1572
|
-
h -
|
|
1572
|
+
h - p
|
|
1573
1573
|
] })
|
|
1574
1574
|
] }) })
|
|
1575
1575
|
]
|
|
@@ -1580,16 +1580,16 @@ function fn({
|
|
|
1580
1580
|
date: t,
|
|
1581
1581
|
events: n,
|
|
1582
1582
|
onMonthClick: o,
|
|
1583
|
-
onDayClick:
|
|
1583
|
+
onDayClick: a
|
|
1584
1584
|
}) {
|
|
1585
|
-
const
|
|
1585
|
+
const i = Q(() => At(t, 0), [t]);
|
|
1586
1586
|
return /* @__PURE__ */ r("div", { className: "flex flex-col", children: [
|
|
1587
1587
|
/* @__PURE__ */ e(
|
|
1588
1588
|
"button",
|
|
1589
1589
|
{
|
|
1590
1590
|
type: "button",
|
|
1591
1591
|
onClick: () => o?.(t),
|
|
1592
|
-
className:
|
|
1592
|
+
className: g(
|
|
1593
1593
|
"w-full rounded-t-lg border px-2 sm:px-3 py-1.5 sm:py-2 text-xs sm:text-sm font-semibold",
|
|
1594
1594
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
1595
1595
|
"transition-colors"
|
|
@@ -1598,22 +1598,22 @@ function fn({
|
|
|
1598
1598
|
}
|
|
1599
1599
|
),
|
|
1600
1600
|
/* @__PURE__ */ r("div", { className: "flex-1 space-y-1.5 sm:space-y-2 rounded-b-lg border border-t-0 p-2 sm:p-3", children: [
|
|
1601
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 text-center", children: un.map((
|
|
1602
|
-
/* @__PURE__ */ e("span", { className: "sm:hidden", children:
|
|
1603
|
-
/* @__PURE__ */ e("span", { className: "hidden sm:inline", children:
|
|
1604
|
-
] },
|
|
1605
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 gap-y-1", children:
|
|
1606
|
-
const h = Pt(n,
|
|
1601
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 text-center", children: un.map((l, p) => /* @__PURE__ */ r("div", { className: "text-[9px] sm:text-xs font-medium text-muted-foreground", children: [
|
|
1602
|
+
/* @__PURE__ */ e("span", { className: "sm:hidden", children: l[0] }),
|
|
1603
|
+
/* @__PURE__ */ e("span", { className: "hidden sm:inline", children: l })
|
|
1604
|
+
] }, p)) }),
|
|
1605
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 gap-y-1", children: i.map((l, p) => {
|
|
1606
|
+
const h = Pt(n, l.date);
|
|
1607
1607
|
return /* @__PURE__ */ e(
|
|
1608
1608
|
mn,
|
|
1609
1609
|
{
|
|
1610
|
-
day:
|
|
1611
|
-
date:
|
|
1610
|
+
day: l.date.getDate(),
|
|
1611
|
+
date: l.date,
|
|
1612
1612
|
events: h,
|
|
1613
|
-
isCurrentMonth:
|
|
1614
|
-
onDayClick:
|
|
1613
|
+
isCurrentMonth: l.isCurrentMonth,
|
|
1614
|
+
onDayClick: a
|
|
1615
1615
|
},
|
|
1616
|
-
`${
|
|
1616
|
+
`${p + 1}-${l.date.toISOString()}`
|
|
1617
1617
|
);
|
|
1618
1618
|
}) })
|
|
1619
1619
|
] })
|
|
@@ -1623,13 +1623,13 @@ function gn({
|
|
|
1623
1623
|
events: t,
|
|
1624
1624
|
year: n,
|
|
1625
1625
|
onMonthClick: o,
|
|
1626
|
-
onDayClick:
|
|
1627
|
-
className:
|
|
1628
|
-
slots:
|
|
1629
|
-
classNames:
|
|
1626
|
+
onDayClick: a,
|
|
1627
|
+
className: i,
|
|
1628
|
+
slots: l,
|
|
1629
|
+
classNames: p
|
|
1630
1630
|
}) {
|
|
1631
|
-
const h =
|
|
1632
|
-
return /* @__PURE__ */ r("div", { className:
|
|
1631
|
+
const h = Q(() => jt(n), [n]);
|
|
1632
|
+
return /* @__PURE__ */ r("div", { className: g("flex flex-col h-full", i), children: [
|
|
1633
1633
|
/* @__PURE__ */ e("div", { className: "flex items-center justify-center border-b px-4 py-3", children: /* @__PURE__ */ e("h2", { className: "text-lg font-semibold", children: n }) }),
|
|
1634
1634
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto p-4", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4", children: h.map((d) => /* @__PURE__ */ e(
|
|
1635
1635
|
fn,
|
|
@@ -1637,155 +1637,240 @@ function gn({
|
|
|
1637
1637
|
date: d,
|
|
1638
1638
|
events: t,
|
|
1639
1639
|
onMonthClick: o,
|
|
1640
|
-
onDayClick:
|
|
1640
|
+
onDayClick: a
|
|
1641
1641
|
},
|
|
1642
1642
|
d.getMonth()
|
|
1643
1643
|
)) }) })
|
|
1644
1644
|
] });
|
|
1645
1645
|
}
|
|
1646
|
-
const
|
|
1646
|
+
const Ie = 200, pn = 60, xn = 300, vn = 7, tt = 2, $e = 40, wn = 18;
|
|
1647
1647
|
function bn() {
|
|
1648
|
-
return /* @__PURE__ */ e(
|
|
1648
|
+
return /* @__PURE__ */ e(
|
|
1649
|
+
"svg",
|
|
1650
|
+
{
|
|
1651
|
+
width: "12",
|
|
1652
|
+
height: "12",
|
|
1653
|
+
viewBox: "0 0 24 24",
|
|
1654
|
+
fill: "none",
|
|
1655
|
+
stroke: "currentColor",
|
|
1656
|
+
strokeWidth: "2.5",
|
|
1657
|
+
strokeLinecap: "round",
|
|
1658
|
+
strokeLinejoin: "round",
|
|
1659
|
+
"aria-hidden": "true",
|
|
1660
|
+
children: /* @__PURE__ */ e("path", { d: "m18 15-6-6-6 6" })
|
|
1661
|
+
}
|
|
1662
|
+
);
|
|
1649
1663
|
}
|
|
1650
1664
|
function yn() {
|
|
1651
|
-
return /* @__PURE__ */ e(
|
|
1665
|
+
return /* @__PURE__ */ e(
|
|
1666
|
+
"svg",
|
|
1667
|
+
{
|
|
1668
|
+
width: "12",
|
|
1669
|
+
height: "12",
|
|
1670
|
+
viewBox: "0 0 24 24",
|
|
1671
|
+
fill: "none",
|
|
1672
|
+
stroke: "currentColor",
|
|
1673
|
+
strokeWidth: "2.5",
|
|
1674
|
+
strokeLinecap: "round",
|
|
1675
|
+
strokeLinejoin: "round",
|
|
1676
|
+
"aria-hidden": "true",
|
|
1677
|
+
children: /* @__PURE__ */ e("path", { d: "m6 9 6 6 6-6" })
|
|
1678
|
+
}
|
|
1679
|
+
);
|
|
1652
1680
|
}
|
|
1653
1681
|
function kn() {
|
|
1654
|
-
return /* @__PURE__ */ e(
|
|
1682
|
+
return /* @__PURE__ */ e(
|
|
1683
|
+
"svg",
|
|
1684
|
+
{
|
|
1685
|
+
width: "12",
|
|
1686
|
+
height: "12",
|
|
1687
|
+
viewBox: "0 0 24 24",
|
|
1688
|
+
fill: "none",
|
|
1689
|
+
stroke: "currentColor",
|
|
1690
|
+
strokeWidth: "2.5",
|
|
1691
|
+
strokeLinecap: "round",
|
|
1692
|
+
strokeLinejoin: "round",
|
|
1693
|
+
"aria-hidden": "true",
|
|
1694
|
+
children: /* @__PURE__ */ e("path", { d: "m15 18-6-6 6-6" })
|
|
1695
|
+
}
|
|
1696
|
+
);
|
|
1655
1697
|
}
|
|
1656
1698
|
function Nn() {
|
|
1657
|
-
return /* @__PURE__ */ e(
|
|
1699
|
+
return /* @__PURE__ */ e(
|
|
1700
|
+
"svg",
|
|
1701
|
+
{
|
|
1702
|
+
width: "12",
|
|
1703
|
+
height: "12",
|
|
1704
|
+
viewBox: "0 0 24 24",
|
|
1705
|
+
fill: "none",
|
|
1706
|
+
stroke: "currentColor",
|
|
1707
|
+
strokeWidth: "2.5",
|
|
1708
|
+
strokeLinecap: "round",
|
|
1709
|
+
strokeLinejoin: "round",
|
|
1710
|
+
"aria-hidden": "true",
|
|
1711
|
+
children: /* @__PURE__ */ e("path", { d: "m9 18 6-6-6-6" })
|
|
1712
|
+
}
|
|
1713
|
+
);
|
|
1658
1714
|
}
|
|
1659
|
-
function
|
|
1660
|
-
|
|
1715
|
+
function Cn({
|
|
1716
|
+
containerRef: t,
|
|
1717
|
+
className: n
|
|
1718
|
+
}) {
|
|
1719
|
+
const [o, a] = ie({
|
|
1661
1720
|
canUp: !1,
|
|
1662
1721
|
canDown: !1,
|
|
1663
1722
|
canLeft: !1,
|
|
1664
1723
|
canRight: !1
|
|
1665
|
-
}), [
|
|
1666
|
-
const
|
|
1667
|
-
if (!
|
|
1668
|
-
const
|
|
1669
|
-
|
|
1670
|
-
canUp:
|
|
1671
|
-
canDown:
|
|
1672
|
-
canLeft:
|
|
1673
|
-
canRight:
|
|
1724
|
+
}), [i, l] = ie({ x: 0, y: 0 }), [p, h] = ie(!1), d = o.canUp || o.canDown || o.canLeft || o.canRight, v = ae(null), b = ae(null), w = ae(null), A = ae(!1), $ = ae({ x: 0, y: 0 }), P = ae({ x: 0, y: 0 }), W = ae(0), T = ae(null), y = F(() => {
|
|
1725
|
+
const s = t.current;
|
|
1726
|
+
if (!s) return;
|
|
1727
|
+
const m = 4;
|
|
1728
|
+
a({
|
|
1729
|
+
canUp: s.scrollTop > m,
|
|
1730
|
+
canDown: s.scrollTop + s.clientHeight < s.scrollHeight - m,
|
|
1731
|
+
canLeft: s.scrollLeft > m,
|
|
1732
|
+
canRight: s.scrollLeft + s.clientWidth < s.scrollWidth - m
|
|
1674
1733
|
});
|
|
1675
1734
|
}, [t]);
|
|
1676
|
-
|
|
1677
|
-
const
|
|
1678
|
-
if (!
|
|
1679
|
-
|
|
1680
|
-
const
|
|
1681
|
-
|
|
1682
|
-
const
|
|
1683
|
-
return
|
|
1684
|
-
|
|
1735
|
+
de(() => {
|
|
1736
|
+
const s = t.current;
|
|
1737
|
+
if (!s) return;
|
|
1738
|
+
y(), s.addEventListener("scroll", y, { passive: !0 });
|
|
1739
|
+
const m = new ResizeObserver(y);
|
|
1740
|
+
m.observe(s);
|
|
1741
|
+
const N = new MutationObserver(y);
|
|
1742
|
+
return N.observe(s, { childList: !0, subtree: !0 }), () => {
|
|
1743
|
+
s.removeEventListener("scroll", y), m.disconnect(), N.disconnect();
|
|
1685
1744
|
};
|
|
1686
|
-
}, [t,
|
|
1687
|
-
const
|
|
1688
|
-
(
|
|
1689
|
-
t.current?.scrollBy({ left:
|
|
1745
|
+
}, [t, y]);
|
|
1746
|
+
const z = F(
|
|
1747
|
+
(s, m) => {
|
|
1748
|
+
t.current?.scrollBy({ left: s, top: m, behavior: "smooth" });
|
|
1690
1749
|
},
|
|
1691
1750
|
[t]
|
|
1692
|
-
),
|
|
1693
|
-
|
|
1694
|
-
}, []),
|
|
1695
|
-
(
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
const L = g.target.tagName;
|
|
1708
|
-
if (!(L === "INPUT" || L === "TEXTAREA" || g.target.isContentEditable))
|
|
1709
|
-
switch (g.key) {
|
|
1751
|
+
), O = F(() => z(0, -Ie), [z]), _ = F(() => z(0, Ie), [z]), D = F(() => z(-Ie, 0), [z]), K = F(() => z(Ie, 0), [z]), E = F(() => {
|
|
1752
|
+
v.current && (clearTimeout(v.current), v.current = null), b.current && (clearInterval(b.current), b.current = null);
|
|
1753
|
+
}, []), H = F((s) => {
|
|
1754
|
+
s(), v.current = setTimeout(() => {
|
|
1755
|
+
b.current = setInterval(s, pn);
|
|
1756
|
+
}, xn);
|
|
1757
|
+
}, []);
|
|
1758
|
+
de(() => E, [E]), de(() => {
|
|
1759
|
+
const s = t.current;
|
|
1760
|
+
if (!s) return;
|
|
1761
|
+
const m = (N) => {
|
|
1762
|
+
if (N.ctrlKey || N.metaKey || N.altKey) return;
|
|
1763
|
+
const L = N.target.tagName;
|
|
1764
|
+
if (!(L === "INPUT" || L === "TEXTAREA" || N.target.isContentEditable))
|
|
1765
|
+
switch (N.key) {
|
|
1710
1766
|
case "ArrowUp":
|
|
1711
|
-
|
|
1767
|
+
N.preventDefault(), O();
|
|
1712
1768
|
break;
|
|
1713
1769
|
case "ArrowDown":
|
|
1714
|
-
|
|
1770
|
+
N.preventDefault(), _();
|
|
1715
1771
|
break;
|
|
1716
1772
|
case "ArrowLeft":
|
|
1717
|
-
|
|
1773
|
+
N.preventDefault(), D();
|
|
1718
1774
|
break;
|
|
1719
1775
|
case "ArrowRight":
|
|
1720
|
-
|
|
1776
|
+
N.preventDefault(), K();
|
|
1721
1777
|
break;
|
|
1722
1778
|
}
|
|
1723
1779
|
};
|
|
1724
|
-
return
|
|
1725
|
-
}, [t,
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
const
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1780
|
+
return s.addEventListener("keydown", m), () => s.removeEventListener("keydown", m);
|
|
1781
|
+
}, [t, O, _, D, K]), de(() => {
|
|
1782
|
+
if (!d) return;
|
|
1783
|
+
const s = T.current;
|
|
1784
|
+
if (!s) return;
|
|
1785
|
+
let m = 0;
|
|
1786
|
+
const N = () => {
|
|
1787
|
+
const R = s.offsetParent;
|
|
1788
|
+
if (!R) return;
|
|
1789
|
+
const se = R.getBoundingClientRect(), ee = window.innerHeight;
|
|
1790
|
+
if (se.height <= ee) {
|
|
1791
|
+
s.style.removeProperty("top"), s.style.removeProperty("bottom");
|
|
1792
|
+
return;
|
|
1793
|
+
}
|
|
1794
|
+
const ve = Math.min(se.bottom, ee) - se.top, ne = s.offsetHeight, le = ve - ne - 12, be = 12, ue = R.clientHeight - ne - 12, f = Math.max(be, Math.min(le, ue));
|
|
1795
|
+
s.style.top = `${f}px`, s.style.bottom = "auto";
|
|
1796
|
+
}, L = () => {
|
|
1797
|
+
cancelAnimationFrame(m), m = requestAnimationFrame(N);
|
|
1798
|
+
}, S = [window];
|
|
1799
|
+
let Y = s.parentElement;
|
|
1800
|
+
for (; Y; ) {
|
|
1801
|
+
const R = getComputedStyle(Y);
|
|
1802
|
+
/(auto|scroll)/.test(R.overflow + R.overflowY) && S.push(Y), Y = Y.parentElement;
|
|
1803
|
+
}
|
|
1804
|
+
for (const R of S)
|
|
1805
|
+
R.addEventListener("scroll", L, { passive: !0 });
|
|
1806
|
+
return window.addEventListener("resize", L, { passive: !0 }), N(), () => {
|
|
1807
|
+
cancelAnimationFrame(m);
|
|
1808
|
+
for (const R of S)
|
|
1809
|
+
R.removeEventListener("scroll", L);
|
|
1810
|
+
window.removeEventListener("resize", L);
|
|
1811
|
+
};
|
|
1812
|
+
}, [d]);
|
|
1813
|
+
const V = F(() => {
|
|
1814
|
+
A.current = !1, h(!1), l({ x: 0, y: 0 }), P.current = { x: 0, y: 0 }, W.current && cancelAnimationFrame(W.current);
|
|
1815
|
+
}, []), J = F(
|
|
1816
|
+
(s) => {
|
|
1817
|
+
s.preventDefault(), A.current = !0, h(!0), $.current = { x: s.clientX, y: s.clientY }, P.current = { x: 0, y: 0 }, s.target.setPointerCapture(s.pointerId);
|
|
1818
|
+
const m = () => {
|
|
1819
|
+
if (!A.current) return;
|
|
1820
|
+
const N = t.current;
|
|
1821
|
+
if (N) {
|
|
1822
|
+
const { x: L, y: S } = P.current, Y = Math.sqrt(L * L + S * S);
|
|
1823
|
+
if (Y > tt) {
|
|
1824
|
+
const se = Math.min(Y / $e, 1) * wn;
|
|
1825
|
+
N.scrollLeft += L / Y * se, N.scrollTop += S / Y * se;
|
|
1739
1826
|
}
|
|
1740
1827
|
}
|
|
1741
|
-
W.current = requestAnimationFrame(
|
|
1828
|
+
W.current = requestAnimationFrame(m);
|
|
1742
1829
|
};
|
|
1743
|
-
W.current = requestAnimationFrame(
|
|
1830
|
+
W.current = requestAnimationFrame(m);
|
|
1744
1831
|
},
|
|
1745
1832
|
[t]
|
|
1746
|
-
),
|
|
1747
|
-
(
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
), Y = $(
|
|
1764
|
-
(x) => {
|
|
1765
|
-
switch (x.key) {
|
|
1833
|
+
), G = F((s) => {
|
|
1834
|
+
if (!A.current) return;
|
|
1835
|
+
const m = s.clientX - $.current.x, N = s.clientY - $.current.y;
|
|
1836
|
+
P.current = { x: m, y: N };
|
|
1837
|
+
const L = Math.sqrt(m * m + N * N);
|
|
1838
|
+
if (L < tt)
|
|
1839
|
+
l({ x: 0, y: 0 });
|
|
1840
|
+
else {
|
|
1841
|
+
const Y = Math.min(L, $e) / $e * vn;
|
|
1842
|
+
l({
|
|
1843
|
+
x: m / L * Y,
|
|
1844
|
+
y: N / L * Y
|
|
1845
|
+
});
|
|
1846
|
+
}
|
|
1847
|
+
}, []), B = F(
|
|
1848
|
+
(s) => {
|
|
1849
|
+
switch (s.key) {
|
|
1766
1850
|
case "ArrowUp":
|
|
1767
|
-
|
|
1851
|
+
s.preventDefault(), O();
|
|
1768
1852
|
break;
|
|
1769
1853
|
case "ArrowDown":
|
|
1770
|
-
|
|
1854
|
+
s.preventDefault(), _();
|
|
1771
1855
|
break;
|
|
1772
1856
|
case "ArrowLeft":
|
|
1773
|
-
|
|
1857
|
+
s.preventDefault(), D();
|
|
1774
1858
|
break;
|
|
1775
1859
|
case "ArrowRight":
|
|
1776
|
-
|
|
1860
|
+
s.preventDefault(), K();
|
|
1777
1861
|
break;
|
|
1778
1862
|
}
|
|
1779
1863
|
},
|
|
1780
|
-
[
|
|
1864
|
+
[O, _, D, K]
|
|
1781
1865
|
);
|
|
1782
1866
|
return d ? /* @__PURE__ */ r(
|
|
1783
1867
|
"div",
|
|
1784
1868
|
{
|
|
1869
|
+
ref: T,
|
|
1785
1870
|
className: `inno-scroll-nav ${n ?? ""}`,
|
|
1786
1871
|
role: "toolbar",
|
|
1787
1872
|
"aria-label": "Scroll navigation",
|
|
1788
|
-
onKeyDown:
|
|
1873
|
+
onKeyDown: B,
|
|
1789
1874
|
children: [
|
|
1790
1875
|
/* @__PURE__ */ e(
|
|
1791
1876
|
"button",
|
|
@@ -1794,9 +1879,9 @@ function Dn({ containerRef: t, className: n }) {
|
|
|
1794
1879
|
className: `inno-scroll-nav-btn inno-scroll-nav-up ${o.canUp ? "" : "inno-scroll-nav-btn-disabled"}`,
|
|
1795
1880
|
"aria-label": "Scroll up",
|
|
1796
1881
|
disabled: !o.canUp,
|
|
1797
|
-
onPointerDown: () =>
|
|
1798
|
-
onPointerUp:
|
|
1799
|
-
onPointerLeave:
|
|
1882
|
+
onPointerDown: () => H(O),
|
|
1883
|
+
onPointerUp: E,
|
|
1884
|
+
onPointerLeave: E,
|
|
1800
1885
|
tabIndex: o.canUp ? 0 : -1,
|
|
1801
1886
|
children: /* @__PURE__ */ e(bn, {})
|
|
1802
1887
|
}
|
|
@@ -1808,9 +1893,9 @@ function Dn({ containerRef: t, className: n }) {
|
|
|
1808
1893
|
className: `inno-scroll-nav-btn inno-scroll-nav-left ${o.canLeft ? "" : "inno-scroll-nav-btn-disabled"}`,
|
|
1809
1894
|
"aria-label": "Scroll left",
|
|
1810
1895
|
disabled: !o.canLeft,
|
|
1811
|
-
onPointerDown: () =>
|
|
1812
|
-
onPointerUp:
|
|
1813
|
-
onPointerLeave:
|
|
1896
|
+
onPointerDown: () => H(D),
|
|
1897
|
+
onPointerUp: E,
|
|
1898
|
+
onPointerLeave: E,
|
|
1814
1899
|
tabIndex: o.canLeft ? 0 : -1,
|
|
1815
1900
|
children: /* @__PURE__ */ e(kn, {})
|
|
1816
1901
|
}
|
|
@@ -1818,21 +1903,21 @@ function Dn({ containerRef: t, className: n }) {
|
|
|
1818
1903
|
/* @__PURE__ */ e(
|
|
1819
1904
|
"button",
|
|
1820
1905
|
{
|
|
1821
|
-
ref:
|
|
1906
|
+
ref: w,
|
|
1822
1907
|
type: "button",
|
|
1823
|
-
className: `inno-scroll-nav-joystick ${
|
|
1908
|
+
className: `inno-scroll-nav-joystick ${p ? "inno-scroll-nav-joystick-active" : ""}`,
|
|
1824
1909
|
"aria-label": "Drag to scroll freely",
|
|
1825
|
-
onPointerDown:
|
|
1826
|
-
onPointerMove:
|
|
1827
|
-
onPointerUp:
|
|
1828
|
-
onPointerCancel:
|
|
1910
|
+
onPointerDown: J,
|
|
1911
|
+
onPointerMove: G,
|
|
1912
|
+
onPointerUp: V,
|
|
1913
|
+
onPointerCancel: V,
|
|
1829
1914
|
tabIndex: 0,
|
|
1830
1915
|
children: /* @__PURE__ */ e(
|
|
1831
1916
|
"span",
|
|
1832
1917
|
{
|
|
1833
1918
|
className: "inno-scroll-nav-joystick-dot",
|
|
1834
1919
|
style: {
|
|
1835
|
-
transform: `translate(${
|
|
1920
|
+
transform: `translate(${i.x}px, ${i.y}px)`
|
|
1836
1921
|
}
|
|
1837
1922
|
}
|
|
1838
1923
|
)
|
|
@@ -1845,9 +1930,9 @@ function Dn({ containerRef: t, className: n }) {
|
|
|
1845
1930
|
className: `inno-scroll-nav-btn inno-scroll-nav-right ${o.canRight ? "" : "inno-scroll-nav-btn-disabled"}`,
|
|
1846
1931
|
"aria-label": "Scroll right",
|
|
1847
1932
|
disabled: !o.canRight,
|
|
1848
|
-
onPointerDown: () =>
|
|
1849
|
-
onPointerUp:
|
|
1850
|
-
onPointerLeave:
|
|
1933
|
+
onPointerDown: () => H(K),
|
|
1934
|
+
onPointerUp: E,
|
|
1935
|
+
onPointerLeave: E,
|
|
1851
1936
|
tabIndex: o.canRight ? 0 : -1,
|
|
1852
1937
|
children: /* @__PURE__ */ e(Nn, {})
|
|
1853
1938
|
}
|
|
@@ -1859,9 +1944,9 @@ function Dn({ containerRef: t, className: n }) {
|
|
|
1859
1944
|
className: `inno-scroll-nav-btn inno-scroll-nav-down ${o.canDown ? "" : "inno-scroll-nav-btn-disabled"}`,
|
|
1860
1945
|
"aria-label": "Scroll down",
|
|
1861
1946
|
disabled: !o.canDown,
|
|
1862
|
-
onPointerDown: () =>
|
|
1863
|
-
onPointerUp:
|
|
1864
|
-
onPointerLeave:
|
|
1947
|
+
onPointerDown: () => H(_),
|
|
1948
|
+
onPointerUp: E,
|
|
1949
|
+
onPointerLeave: E,
|
|
1865
1950
|
tabIndex: o.canDown ? 0 : -1,
|
|
1866
1951
|
children: /* @__PURE__ */ e(yn, {})
|
|
1867
1952
|
}
|
|
@@ -1870,7 +1955,7 @@ function Dn({ containerRef: t, className: n }) {
|
|
|
1870
1955
|
}
|
|
1871
1956
|
) : null;
|
|
1872
1957
|
}
|
|
1873
|
-
function
|
|
1958
|
+
function Dn(t) {
|
|
1874
1959
|
switch (t) {
|
|
1875
1960
|
case "day":
|
|
1876
1961
|
case "week":
|
|
@@ -1883,67 +1968,67 @@ function Mn({
|
|
|
1883
1968
|
onEventClick: t,
|
|
1884
1969
|
onSlotClick: n,
|
|
1885
1970
|
onSlotSelect: o,
|
|
1886
|
-
onAddEvent:
|
|
1887
|
-
className:
|
|
1888
|
-
showHeader:
|
|
1889
|
-
minSelectionMinutes:
|
|
1971
|
+
onAddEvent: a,
|
|
1972
|
+
className: i,
|
|
1973
|
+
showHeader: l = !0,
|
|
1974
|
+
minSelectionMinutes: p = 30,
|
|
1890
1975
|
showMoreMode: h,
|
|
1891
1976
|
showMoreEventsInPopover: d = !1,
|
|
1892
|
-
isLoading:
|
|
1893
|
-
slots:
|
|
1894
|
-
classNames:
|
|
1895
|
-
settingsContent:
|
|
1896
|
-
filterContent:
|
|
1977
|
+
isLoading: v = !1,
|
|
1978
|
+
slots: b,
|
|
1979
|
+
classNames: w,
|
|
1980
|
+
settingsContent: A,
|
|
1981
|
+
filterContent: $,
|
|
1897
1982
|
headerActions: P,
|
|
1898
1983
|
renderPopover: W,
|
|
1899
|
-
calendarRef:
|
|
1984
|
+
calendarRef: T,
|
|
1900
1985
|
headerConfig: y,
|
|
1901
|
-
eventDetailMode:
|
|
1986
|
+
eventDetailMode: z,
|
|
1902
1987
|
renderEventDetail: O
|
|
1903
1988
|
}) {
|
|
1904
|
-
const
|
|
1905
|
-
view:
|
|
1906
|
-
setView:
|
|
1907
|
-
selectedDate:
|
|
1908
|
-
setSelectedDate:
|
|
1989
|
+
const _ = h ?? (d ? "popover" : "expand"), {
|
|
1990
|
+
view: D,
|
|
1991
|
+
setView: K,
|
|
1992
|
+
selectedDate: E,
|
|
1993
|
+
setSelectedDate: H,
|
|
1909
1994
|
slotDuration: V,
|
|
1910
|
-
filteredEvents:
|
|
1911
|
-
users:
|
|
1912
|
-
visibleHours:
|
|
1913
|
-
workingHours:
|
|
1914
|
-
badgeVariant:
|
|
1915
|
-
showWorkingHoursOnly:
|
|
1916
|
-
clearFocusEventId:
|
|
1917
|
-
} =
|
|
1918
|
-
if (!
|
|
1995
|
+
filteredEvents: J,
|
|
1996
|
+
users: G,
|
|
1997
|
+
visibleHours: B,
|
|
1998
|
+
workingHours: s,
|
|
1999
|
+
badgeVariant: m,
|
|
2000
|
+
showWorkingHoursOnly: N,
|
|
2001
|
+
clearFocusEventId: L
|
|
2002
|
+
} = zt(), S = Q(() => {
|
|
2003
|
+
if (!N || !s)
|
|
1919
2004
|
return {
|
|
1920
|
-
startHour:
|
|
1921
|
-
endHour:
|
|
2005
|
+
startHour: B.start,
|
|
2006
|
+
endHour: B.end
|
|
1922
2007
|
};
|
|
1923
|
-
let
|
|
1924
|
-
for (const U of Object.keys(
|
|
1925
|
-
const
|
|
1926
|
-
!
|
|
2008
|
+
let f = 24, M = 0;
|
|
2009
|
+
for (const U of Object.keys(s)) {
|
|
2010
|
+
const re = s[Number(U)];
|
|
2011
|
+
!re || re.enabled === !1 || (re.from < f && (f = re.from), re.to > M && (M = re.to));
|
|
1927
2012
|
}
|
|
1928
|
-
return
|
|
1929
|
-
startHour:
|
|
1930
|
-
endHour:
|
|
1931
|
-
} : { startHour:
|
|
1932
|
-
}, [
|
|
2013
|
+
return f >= M ? {
|
|
2014
|
+
startHour: B.start,
|
|
2015
|
+
endHour: B.end
|
|
2016
|
+
} : { startHour: f, endHour: M };
|
|
2017
|
+
}, [N, s, B]), Y = S, R = ae(null);
|
|
1933
2018
|
wt(
|
|
1934
|
-
|
|
2019
|
+
T,
|
|
1935
2020
|
() => ({
|
|
1936
2021
|
scrollToToday: () => {
|
|
1937
|
-
const
|
|
1938
|
-
|
|
2022
|
+
const f = /* @__PURE__ */ new Date();
|
|
2023
|
+
H(f, D), requestAnimationFrame(() => {
|
|
1939
2024
|
requestAnimationFrame(() => {
|
|
1940
|
-
const M =
|
|
2025
|
+
const M = R.current?.querySelector(
|
|
1941
2026
|
".ic-timeline-scroll-container, [class*='overflow-auto']"
|
|
1942
2027
|
);
|
|
1943
2028
|
if (!M) return;
|
|
1944
|
-
const
|
|
1945
|
-
|
|
1946
|
-
top: Math.max(0,
|
|
2029
|
+
const De = (f.getHours() - S.startHour) * 96;
|
|
2030
|
+
De > 0 && M.scrollTo({
|
|
2031
|
+
top: Math.max(0, De - 100),
|
|
1947
2032
|
// Offset to show some context
|
|
1948
2033
|
behavior: "smooth"
|
|
1949
2034
|
});
|
|
@@ -1951,149 +2036,149 @@ function Mn({
|
|
|
1951
2036
|
});
|
|
1952
2037
|
},
|
|
1953
2038
|
scrollToWorkingHours: () => {
|
|
1954
|
-
let
|
|
1955
|
-
if (
|
|
1956
|
-
for (const M of Object.keys(
|
|
1957
|
-
const U =
|
|
1958
|
-
U?.enabled && U.from <
|
|
2039
|
+
let f = 8;
|
|
2040
|
+
if (s)
|
|
2041
|
+
for (const M of Object.keys(s)) {
|
|
2042
|
+
const U = s[Number(M)];
|
|
2043
|
+
U?.enabled && U.from < f && (f = Math.max(U.from - 1, 0));
|
|
1959
2044
|
}
|
|
1960
2045
|
requestAnimationFrame(() => {
|
|
1961
2046
|
requestAnimationFrame(() => {
|
|
1962
|
-
const M =
|
|
2047
|
+
const M = R.current?.querySelector(
|
|
1963
2048
|
".ic-timeline-scroll-container, [class*='overflow-auto']"
|
|
1964
2049
|
);
|
|
1965
2050
|
if (!M) return;
|
|
1966
|
-
const
|
|
2051
|
+
const re = (f - S.startHour) * 96;
|
|
1967
2052
|
M.scrollTo({
|
|
1968
|
-
top: Math.max(0,
|
|
2053
|
+
top: Math.max(0, re),
|
|
1969
2054
|
behavior: "smooth"
|
|
1970
2055
|
});
|
|
1971
2056
|
});
|
|
1972
2057
|
});
|
|
1973
2058
|
},
|
|
1974
|
-
getViewRect: () =>
|
|
1975
|
-
focusEvent: (
|
|
1976
|
-
|
|
1977
|
-
|
|
2059
|
+
getViewRect: () => R.current?.getBoundingClientRect() ?? null,
|
|
2060
|
+
focusEvent: (f) => {
|
|
2061
|
+
L(), requestAnimationFrame(() => {
|
|
2062
|
+
L();
|
|
1978
2063
|
});
|
|
1979
|
-
const M =
|
|
1980
|
-
`[data-event-id="${
|
|
2064
|
+
const M = R.current?.querySelector(
|
|
2065
|
+
`[data-event-id="${f}"]`
|
|
1981
2066
|
);
|
|
1982
2067
|
M && setTimeout(() => M.click(), 150);
|
|
1983
2068
|
}
|
|
1984
2069
|
}),
|
|
1985
2070
|
[
|
|
1986
|
-
|
|
1987
|
-
|
|
2071
|
+
H,
|
|
2072
|
+
D,
|
|
1988
2073
|
S,
|
|
1989
|
-
|
|
1990
|
-
|
|
2074
|
+
s,
|
|
2075
|
+
L
|
|
1991
2076
|
]
|
|
1992
2077
|
);
|
|
1993
|
-
const
|
|
1994
|
-
(
|
|
2078
|
+
const se = Q(() => Dn(D), [D]), ee = F(
|
|
2079
|
+
(f) => {
|
|
1995
2080
|
if (o) {
|
|
1996
|
-
o(
|
|
2081
|
+
o(f);
|
|
1997
2082
|
return;
|
|
1998
2083
|
}
|
|
1999
2084
|
if (n) {
|
|
2000
|
-
const M =
|
|
2001
|
-
n(
|
|
2085
|
+
const M = f.startDate.getHours();
|
|
2086
|
+
n(f.startDate, M);
|
|
2002
2087
|
}
|
|
2003
2088
|
},
|
|
2004
2089
|
[o, n]
|
|
2005
|
-
),
|
|
2006
|
-
(
|
|
2007
|
-
|
|
2090
|
+
), Z = F(
|
|
2091
|
+
(f) => {
|
|
2092
|
+
K("day"), H(f, "day");
|
|
2008
2093
|
},
|
|
2009
|
-
[
|
|
2010
|
-
),
|
|
2011
|
-
(
|
|
2012
|
-
|
|
2094
|
+
[H, K]
|
|
2095
|
+
), ve = F(
|
|
2096
|
+
(f) => {
|
|
2097
|
+
K("month"), H(f, "month");
|
|
2013
2098
|
},
|
|
2014
|
-
[
|
|
2015
|
-
),
|
|
2016
|
-
(
|
|
2017
|
-
t?.(
|
|
2099
|
+
[H, K]
|
|
2100
|
+
), ne = F(
|
|
2101
|
+
(f) => {
|
|
2102
|
+
t?.(f);
|
|
2018
2103
|
},
|
|
2019
2104
|
[t]
|
|
2020
|
-
), le =
|
|
2021
|
-
(
|
|
2022
|
-
n?.(
|
|
2105
|
+
), le = F(
|
|
2106
|
+
(f, M, U) => {
|
|
2107
|
+
n?.(f, M);
|
|
2023
2108
|
},
|
|
2024
2109
|
[n]
|
|
2025
|
-
),
|
|
2026
|
-
const
|
|
2027
|
-
switch (
|
|
2110
|
+
), be = () => {
|
|
2111
|
+
const f = J, M = ne, U = W;
|
|
2112
|
+
switch (D) {
|
|
2028
2113
|
case "day":
|
|
2029
2114
|
return /* @__PURE__ */ e(
|
|
2030
2115
|
St,
|
|
2031
2116
|
{
|
|
2032
|
-
events:
|
|
2033
|
-
date:
|
|
2034
|
-
visibleHours:
|
|
2035
|
-
workingHours:
|
|
2117
|
+
events: f,
|
|
2118
|
+
date: E,
|
|
2119
|
+
visibleHours: Y,
|
|
2120
|
+
workingHours: s,
|
|
2036
2121
|
slotDuration: V,
|
|
2037
|
-
badgeVariant:
|
|
2122
|
+
badgeVariant: m,
|
|
2038
2123
|
onEventClick: M,
|
|
2039
2124
|
renderPopover: U,
|
|
2040
|
-
...
|
|
2041
|
-
...
|
|
2125
|
+
...b && { slots: b },
|
|
2126
|
+
...w && { classNames: w }
|
|
2042
2127
|
}
|
|
2043
2128
|
);
|
|
2044
2129
|
case "week":
|
|
2045
2130
|
return /* @__PURE__ */ e(
|
|
2046
2131
|
Mt,
|
|
2047
2132
|
{
|
|
2048
|
-
events:
|
|
2049
|
-
date:
|
|
2050
|
-
visibleHours:
|
|
2051
|
-
workingHours:
|
|
2133
|
+
events: f,
|
|
2134
|
+
date: E,
|
|
2135
|
+
visibleHours: Y,
|
|
2136
|
+
workingHours: s,
|
|
2052
2137
|
slotDuration: V,
|
|
2053
|
-
badgeVariant:
|
|
2138
|
+
badgeVariant: m,
|
|
2054
2139
|
onEventClick: M,
|
|
2055
2140
|
renderPopover: U,
|
|
2056
|
-
...
|
|
2057
|
-
...
|
|
2141
|
+
...b && { slots: b },
|
|
2142
|
+
...w && { classNames: w }
|
|
2058
2143
|
}
|
|
2059
2144
|
);
|
|
2060
2145
|
case "month":
|
|
2061
2146
|
return /* @__PURE__ */ e(
|
|
2062
2147
|
Ve,
|
|
2063
2148
|
{
|
|
2064
|
-
events:
|
|
2065
|
-
date:
|
|
2066
|
-
badgeVariant:
|
|
2149
|
+
events: f,
|
|
2150
|
+
date: E,
|
|
2151
|
+
badgeVariant: m,
|
|
2067
2152
|
onEventClick: M,
|
|
2068
|
-
onDayClick:
|
|
2153
|
+
onDayClick: Z,
|
|
2069
2154
|
renderPopover: U,
|
|
2070
|
-
showMoreMode:
|
|
2071
|
-
...
|
|
2072
|
-
...
|
|
2155
|
+
showMoreMode: _,
|
|
2156
|
+
...b && { slots: b },
|
|
2157
|
+
...w && { classNames: w }
|
|
2073
2158
|
}
|
|
2074
2159
|
);
|
|
2075
2160
|
case "year":
|
|
2076
2161
|
return /* @__PURE__ */ e(
|
|
2077
2162
|
gn,
|
|
2078
2163
|
{
|
|
2079
|
-
events:
|
|
2080
|
-
year:
|
|
2081
|
-
onMonthClick:
|
|
2082
|
-
onDayClick:
|
|
2083
|
-
...
|
|
2084
|
-
...
|
|
2164
|
+
events: f,
|
|
2165
|
+
year: E.getFullYear(),
|
|
2166
|
+
onMonthClick: ve,
|
|
2167
|
+
onDayClick: Z,
|
|
2168
|
+
...b && { slots: b },
|
|
2169
|
+
...w && { classNames: w }
|
|
2085
2170
|
}
|
|
2086
2171
|
);
|
|
2087
2172
|
case "agenda":
|
|
2088
2173
|
return /* @__PURE__ */ e(
|
|
2089
|
-
|
|
2174
|
+
Dt,
|
|
2090
2175
|
{
|
|
2091
|
-
events:
|
|
2092
|
-
date:
|
|
2176
|
+
events: f,
|
|
2177
|
+
date: E,
|
|
2093
2178
|
onEventClick: M,
|
|
2094
2179
|
renderPopover: U,
|
|
2095
|
-
...
|
|
2096
|
-
...
|
|
2180
|
+
...b && { slots: b },
|
|
2181
|
+
...w && { classNames: w }
|
|
2097
2182
|
}
|
|
2098
2183
|
);
|
|
2099
2184
|
// Resource views — delegate to TimelineView with matching day count
|
|
@@ -2102,9 +2187,9 @@ function Mn({
|
|
|
2102
2187
|
Le,
|
|
2103
2188
|
{
|
|
2104
2189
|
daysToShow: 1,
|
|
2105
|
-
events:
|
|
2106
|
-
users:
|
|
2107
|
-
selectedDate:
|
|
2190
|
+
events: f,
|
|
2191
|
+
users: G,
|
|
2192
|
+
selectedDate: E,
|
|
2108
2193
|
visibleHours: {
|
|
2109
2194
|
from: S.startHour,
|
|
2110
2195
|
to: S.endHour
|
|
@@ -2113,8 +2198,8 @@ function Mn({
|
|
|
2113
2198
|
onSlotSelect: ee,
|
|
2114
2199
|
onSlotClick: le,
|
|
2115
2200
|
renderPopover: U,
|
|
2116
|
-
...
|
|
2117
|
-
...
|
|
2201
|
+
...b && { slots: b },
|
|
2202
|
+
...w && { classNames: w }
|
|
2118
2203
|
}
|
|
2119
2204
|
);
|
|
2120
2205
|
case "resource-week":
|
|
@@ -2122,9 +2207,9 @@ function Mn({
|
|
|
2122
2207
|
Le,
|
|
2123
2208
|
{
|
|
2124
2209
|
daysToShow: 7,
|
|
2125
|
-
events:
|
|
2126
|
-
users:
|
|
2127
|
-
selectedDate:
|
|
2210
|
+
events: f,
|
|
2211
|
+
users: G,
|
|
2212
|
+
selectedDate: E,
|
|
2128
2213
|
visibleHours: {
|
|
2129
2214
|
from: S.startHour,
|
|
2130
2215
|
to: S.endHour
|
|
@@ -2133,8 +2218,8 @@ function Mn({
|
|
|
2133
2218
|
onSlotSelect: ee,
|
|
2134
2219
|
onSlotClick: le,
|
|
2135
2220
|
renderPopover: U,
|
|
2136
|
-
...
|
|
2137
|
-
...
|
|
2221
|
+
...b && { slots: b },
|
|
2222
|
+
...w && { classNames: w }
|
|
2138
2223
|
}
|
|
2139
2224
|
);
|
|
2140
2225
|
// Timeline views
|
|
@@ -2143,9 +2228,9 @@ function Mn({
|
|
|
2143
2228
|
Le,
|
|
2144
2229
|
{
|
|
2145
2230
|
daysToShow: 1,
|
|
2146
|
-
events:
|
|
2147
|
-
users:
|
|
2148
|
-
selectedDate:
|
|
2231
|
+
events: f,
|
|
2232
|
+
users: G,
|
|
2233
|
+
selectedDate: E,
|
|
2149
2234
|
visibleHours: {
|
|
2150
2235
|
from: S.startHour,
|
|
2151
2236
|
to: S.endHour
|
|
@@ -2154,8 +2239,8 @@ function Mn({
|
|
|
2154
2239
|
onSlotSelect: ee,
|
|
2155
2240
|
onSlotClick: le,
|
|
2156
2241
|
renderPopover: U,
|
|
2157
|
-
...
|
|
2158
|
-
...
|
|
2242
|
+
...b && { slots: b },
|
|
2243
|
+
...w && { classNames: w }
|
|
2159
2244
|
}
|
|
2160
2245
|
);
|
|
2161
2246
|
case "timeline-3day":
|
|
@@ -2163,9 +2248,9 @@ function Mn({
|
|
|
2163
2248
|
Le,
|
|
2164
2249
|
{
|
|
2165
2250
|
daysToShow: 3,
|
|
2166
|
-
events:
|
|
2167
|
-
users:
|
|
2168
|
-
selectedDate:
|
|
2251
|
+
events: f,
|
|
2252
|
+
users: G,
|
|
2253
|
+
selectedDate: E,
|
|
2169
2254
|
visibleHours: {
|
|
2170
2255
|
from: S.startHour,
|
|
2171
2256
|
to: S.endHour
|
|
@@ -2174,8 +2259,8 @@ function Mn({
|
|
|
2174
2259
|
onSlotSelect: ee,
|
|
2175
2260
|
onSlotClick: le,
|
|
2176
2261
|
renderPopover: U,
|
|
2177
|
-
...
|
|
2178
|
-
...
|
|
2262
|
+
...b && { slots: b },
|
|
2263
|
+
...w && { classNames: w }
|
|
2179
2264
|
}
|
|
2180
2265
|
);
|
|
2181
2266
|
case "timeline-week":
|
|
@@ -2183,9 +2268,9 @@ function Mn({
|
|
|
2183
2268
|
Le,
|
|
2184
2269
|
{
|
|
2185
2270
|
daysToShow: 7,
|
|
2186
|
-
events:
|
|
2187
|
-
users:
|
|
2188
|
-
selectedDate:
|
|
2271
|
+
events: f,
|
|
2272
|
+
users: G,
|
|
2273
|
+
selectedDate: E,
|
|
2189
2274
|
visibleHours: {
|
|
2190
2275
|
from: S.startHour,
|
|
2191
2276
|
to: S.endHour
|
|
@@ -2194,59 +2279,59 @@ function Mn({
|
|
|
2194
2279
|
onSlotSelect: ee,
|
|
2195
2280
|
onSlotClick: le,
|
|
2196
2281
|
renderPopover: U,
|
|
2197
|
-
...
|
|
2198
|
-
...
|
|
2282
|
+
...b && { slots: b },
|
|
2283
|
+
...w && { classNames: w }
|
|
2199
2284
|
}
|
|
2200
2285
|
);
|
|
2201
2286
|
default:
|
|
2202
2287
|
return /* @__PURE__ */ e(
|
|
2203
2288
|
Ve,
|
|
2204
2289
|
{
|
|
2205
|
-
events:
|
|
2206
|
-
date:
|
|
2207
|
-
badgeVariant:
|
|
2290
|
+
events: f,
|
|
2291
|
+
date: E,
|
|
2292
|
+
badgeVariant: m,
|
|
2208
2293
|
onEventClick: M,
|
|
2209
|
-
onDayClick:
|
|
2210
|
-
...
|
|
2211
|
-
...
|
|
2294
|
+
onDayClick: Z,
|
|
2295
|
+
...b && { slots: b },
|
|
2296
|
+
...w && { classNames: w }
|
|
2212
2297
|
}
|
|
2213
2298
|
);
|
|
2214
2299
|
}
|
|
2215
|
-
},
|
|
2216
|
-
return
|
|
2217
|
-
|
|
2300
|
+
}, ue = ae(null);
|
|
2301
|
+
return de(() => {
|
|
2302
|
+
R.current = ue.current;
|
|
2218
2303
|
}), /* @__PURE__ */ e(
|
|
2219
|
-
|
|
2304
|
+
It,
|
|
2220
2305
|
{
|
|
2221
|
-
mode:
|
|
2306
|
+
mode: se,
|
|
2222
2307
|
onSelect: ee,
|
|
2223
|
-
minDurationMinutes:
|
|
2308
|
+
minDurationMinutes: p,
|
|
2224
2309
|
slotDurationMinutes: V,
|
|
2225
2310
|
enabled: !!(o || n),
|
|
2226
2311
|
children: /* @__PURE__ */ r(
|
|
2227
2312
|
"div",
|
|
2228
2313
|
{
|
|
2229
|
-
className:
|
|
2314
|
+
className: g(
|
|
2230
2315
|
"inno-calendar-root flex flex-col h-full p-4",
|
|
2231
|
-
|
|
2232
|
-
|
|
2316
|
+
w?.root,
|
|
2317
|
+
i
|
|
2233
2318
|
),
|
|
2234
2319
|
children: [
|
|
2235
|
-
|
|
2236
|
-
|
|
2320
|
+
l && /* @__PURE__ */ e(
|
|
2321
|
+
Ct,
|
|
2237
2322
|
{
|
|
2238
|
-
currentDate:
|
|
2239
|
-
view:
|
|
2240
|
-
events:
|
|
2241
|
-
onViewChange:
|
|
2242
|
-
onNavigateToday: () =>
|
|
2323
|
+
currentDate: E,
|
|
2324
|
+
view: D,
|
|
2325
|
+
events: J,
|
|
2326
|
+
onViewChange: K,
|
|
2327
|
+
onNavigateToday: () => H(/* @__PURE__ */ new Date(), D),
|
|
2243
2328
|
onNavigatePrev: () => {
|
|
2244
|
-
const
|
|
2245
|
-
|
|
2329
|
+
const f = new Date(E);
|
|
2330
|
+
D === "day" || D === "timeline-day" || D === "resource-day" ? f.setDate(f.getDate() - 1) : D === "timeline-3day" ? f.setDate(f.getDate() - 3) : D === "week" || D === "timeline-week" || D === "resource-week" ? f.setDate(f.getDate() - 7) : D === "month" ? f.setMonth(f.getMonth() - 1) : D === "year" ? f.setFullYear(f.getFullYear() - 1) : f.setDate(f.getDate() - 7), H(f, D);
|
|
2246
2331
|
},
|
|
2247
2332
|
onNavigateNext: () => {
|
|
2248
|
-
const
|
|
2249
|
-
|
|
2333
|
+
const f = new Date(E);
|
|
2334
|
+
D === "day" || D === "timeline-day" || D === "resource-day" ? f.setDate(f.getDate() + 1) : D === "timeline-3day" ? f.setDate(f.getDate() + 3) : D === "week" || D === "timeline-week" || D === "resource-week" ? f.setDate(f.getDate() + 7) : D === "month" ? f.setMonth(f.getMonth() + 1) : D === "year" ? f.setFullYear(f.getFullYear() + 1) : f.setDate(f.getDate() + 7), H(f, D);
|
|
2250
2335
|
},
|
|
2251
2336
|
availableViews: [
|
|
2252
2337
|
"day",
|
|
@@ -2256,11 +2341,11 @@ function Mn({
|
|
|
2256
2341
|
"agenda"
|
|
2257
2342
|
],
|
|
2258
2343
|
showTimelineViews: !0,
|
|
2259
|
-
showSettings: !!
|
|
2260
|
-
...!P &&
|
|
2344
|
+
showSettings: !!A,
|
|
2345
|
+
...!P && a && { onAddEvent: a },
|
|
2261
2346
|
actions: P,
|
|
2262
|
-
settingsContent:
|
|
2263
|
-
filterContent:
|
|
2347
|
+
settingsContent: A,
|
|
2348
|
+
filterContent: $,
|
|
2264
2349
|
...y && { headerConfig: y }
|
|
2265
2350
|
}
|
|
2266
2351
|
),
|
|
@@ -2268,16 +2353,16 @@ function Mn({
|
|
|
2268
2353
|
/* @__PURE__ */ e(
|
|
2269
2354
|
"div",
|
|
2270
2355
|
{
|
|
2271
|
-
ref:
|
|
2272
|
-
className:
|
|
2356
|
+
ref: ue,
|
|
2357
|
+
className: g(
|
|
2273
2358
|
"h-full border rounded-lg bg-white overflow-x-auto",
|
|
2274
|
-
|
|
2359
|
+
w?.viewContainer
|
|
2275
2360
|
),
|
|
2276
|
-
children:
|
|
2361
|
+
children: be()
|
|
2277
2362
|
}
|
|
2278
2363
|
),
|
|
2279
|
-
|
|
2280
|
-
/* @__PURE__ */ e(
|
|
2364
|
+
v && /* @__PURE__ */ e("div", { className: "inno-calendar-loading-overlay", children: /* @__PURE__ */ e("div", { className: "inno-calendar-spinner" }) }),
|
|
2365
|
+
/* @__PURE__ */ e(Cn, { containerRef: ue })
|
|
2281
2366
|
] })
|
|
2282
2367
|
]
|
|
2283
2368
|
}
|
|
@@ -2289,89 +2374,89 @@ function Sn({
|
|
|
2289
2374
|
events: t,
|
|
2290
2375
|
users: n = [],
|
|
2291
2376
|
scheduleTypes: o = [],
|
|
2292
|
-
initialView:
|
|
2293
|
-
initialDate:
|
|
2294
|
-
initialSelectedUserId:
|
|
2295
|
-
initialScheduleTypeIds:
|
|
2377
|
+
initialView: a = "week",
|
|
2378
|
+
initialDate: i,
|
|
2379
|
+
initialSelectedUserId: l,
|
|
2380
|
+
initialScheduleTypeIds: p,
|
|
2296
2381
|
initialParticipantIds: h,
|
|
2297
2382
|
initialWorkingHoursView: d,
|
|
2298
|
-
initialSearchQuery:
|
|
2299
|
-
preferencesConfig:
|
|
2300
|
-
onEventClick:
|
|
2301
|
-
onSlotClick:
|
|
2302
|
-
onSlotSelect:
|
|
2383
|
+
initialSearchQuery: v,
|
|
2384
|
+
preferencesConfig: b,
|
|
2385
|
+
onEventClick: w,
|
|
2386
|
+
onSlotClick: A,
|
|
2387
|
+
onSlotSelect: $,
|
|
2303
2388
|
onAddEvent: P,
|
|
2304
2389
|
onEventDrop: W,
|
|
2305
|
-
onDateChange:
|
|
2390
|
+
onDateChange: T,
|
|
2306
2391
|
onViewChange: y,
|
|
2307
|
-
className:
|
|
2392
|
+
className: z,
|
|
2308
2393
|
showHeader: O = !0,
|
|
2309
|
-
minSelectionMinutes:
|
|
2310
|
-
showMoreMode:
|
|
2311
|
-
showMoreEventsInPopover:
|
|
2312
|
-
isLoading:
|
|
2313
|
-
renderPopover:
|
|
2394
|
+
minSelectionMinutes: _ = 30,
|
|
2395
|
+
showMoreMode: D,
|
|
2396
|
+
showMoreEventsInPopover: K = !1,
|
|
2397
|
+
isLoading: E = !1,
|
|
2398
|
+
renderPopover: H,
|
|
2314
2399
|
slots: V,
|
|
2315
|
-
classNames:
|
|
2316
|
-
settingsContent:
|
|
2317
|
-
filterContent:
|
|
2318
|
-
headerActions:
|
|
2319
|
-
focusEventId:
|
|
2320
|
-
headerConfig:
|
|
2321
|
-
eventDetailMode:
|
|
2400
|
+
classNames: J,
|
|
2401
|
+
settingsContent: G,
|
|
2402
|
+
filterContent: B,
|
|
2403
|
+
headerActions: s,
|
|
2404
|
+
focusEventId: m,
|
|
2405
|
+
headerConfig: N,
|
|
2406
|
+
eventDetailMode: L,
|
|
2322
2407
|
renderEventDetail: S
|
|
2323
|
-
},
|
|
2408
|
+
}, Y) {
|
|
2324
2409
|
return /* @__PURE__ */ e(Tt, { ...W && { onEventDrop: W }, children: /* @__PURE__ */ e(
|
|
2325
2410
|
Ht,
|
|
2326
2411
|
{
|
|
2327
2412
|
initialEvents: t,
|
|
2328
2413
|
initialUsers: n,
|
|
2329
2414
|
initialScheduleTypes: o,
|
|
2330
|
-
initialView:
|
|
2331
|
-
...
|
|
2332
|
-
...
|
|
2333
|
-
...
|
|
2415
|
+
initialView: a,
|
|
2416
|
+
...i && { initialDate: i },
|
|
2417
|
+
...l && { initialSelectedUserId: l },
|
|
2418
|
+
...p && { initialScheduleTypeIds: p },
|
|
2334
2419
|
...h && { initialParticipantIds: h },
|
|
2335
2420
|
...d && { initialWorkingHoursView: d },
|
|
2336
|
-
...
|
|
2337
|
-
...
|
|
2338
|
-
...
|
|
2421
|
+
...v && { initialSearchQuery: v },
|
|
2422
|
+
...b && { preferencesConfig: b },
|
|
2423
|
+
...T && { onDateChange: T },
|
|
2339
2424
|
...y && { onViewChange: y },
|
|
2340
|
-
...
|
|
2425
|
+
...m && { initialFocusEventId: m },
|
|
2341
2426
|
children: /* @__PURE__ */ e(
|
|
2342
2427
|
Mn,
|
|
2343
2428
|
{
|
|
2344
|
-
...
|
|
2345
|
-
...
|
|
2346
|
-
|
|
2429
|
+
...w && { onEventClick: w },
|
|
2430
|
+
...A && { onSlotClick: A },
|
|
2431
|
+
...$ && { onSlotSelect: $ },
|
|
2347
2432
|
...P && { onAddEvent: P },
|
|
2348
|
-
...
|
|
2349
|
-
className:
|
|
2433
|
+
...H && { renderPopover: H },
|
|
2434
|
+
className: z,
|
|
2350
2435
|
showHeader: O,
|
|
2351
|
-
minSelectionMinutes:
|
|
2352
|
-
...
|
|
2353
|
-
showMoreEventsInPopover:
|
|
2354
|
-
isLoading:
|
|
2436
|
+
minSelectionMinutes: _,
|
|
2437
|
+
...D && { showMoreMode: D },
|
|
2438
|
+
showMoreEventsInPopover: K,
|
|
2439
|
+
isLoading: E,
|
|
2355
2440
|
...V && { slots: V },
|
|
2356
|
-
...
|
|
2357
|
-
settingsContent:
|
|
2358
|
-
filterContent:
|
|
2359
|
-
headerActions:
|
|
2360
|
-
calendarRef:
|
|
2361
|
-
...
|
|
2362
|
-
...
|
|
2441
|
+
...J && { classNames: J },
|
|
2442
|
+
settingsContent: G,
|
|
2443
|
+
filterContent: B,
|
|
2444
|
+
headerActions: s,
|
|
2445
|
+
calendarRef: Y,
|
|
2446
|
+
...N && { headerConfig: N },
|
|
2447
|
+
...L && { eventDetailMode: L },
|
|
2363
2448
|
...S && { renderEventDetail: S }
|
|
2364
2449
|
}
|
|
2365
2450
|
)
|
|
2366
2451
|
}
|
|
2367
2452
|
) });
|
|
2368
2453
|
}
|
|
2369
|
-
const
|
|
2370
|
-
({ className: t, children: n, ...o },
|
|
2454
|
+
const Cr = Ae(Sn), xe = Ae(
|
|
2455
|
+
({ className: t, children: n, ...o }, a) => /* @__PURE__ */ e(
|
|
2371
2456
|
"select",
|
|
2372
2457
|
{
|
|
2373
|
-
ref:
|
|
2374
|
-
className:
|
|
2458
|
+
ref: a,
|
|
2459
|
+
className: g(
|
|
2375
2460
|
"flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm",
|
|
2376
2461
|
"ring-offset-background",
|
|
2377
2462
|
"focus:outline-none focus:ring-1 focus:ring-ring",
|
|
@@ -2384,19 +2469,19 @@ const Dr = Ae(Sn), ge = Ae(
|
|
|
2384
2469
|
}
|
|
2385
2470
|
)
|
|
2386
2471
|
);
|
|
2387
|
-
|
|
2388
|
-
const
|
|
2472
|
+
xe.displayName = "Select";
|
|
2473
|
+
const he = Ae(({ className: t, ...n }, o) => /* @__PURE__ */ e(
|
|
2389
2474
|
"label",
|
|
2390
2475
|
{
|
|
2391
2476
|
ref: o,
|
|
2392
|
-
className:
|
|
2477
|
+
className: g(
|
|
2393
2478
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
2394
2479
|
t
|
|
2395
2480
|
),
|
|
2396
2481
|
...n
|
|
2397
2482
|
}
|
|
2398
2483
|
));
|
|
2399
|
-
|
|
2484
|
+
he.displayName = "Label";
|
|
2400
2485
|
function En({ className: t }) {
|
|
2401
2486
|
return /* @__PURE__ */ r(
|
|
2402
2487
|
"svg",
|
|
@@ -2445,37 +2530,37 @@ const Tn = [
|
|
|
2445
2530
|
{ value: 30, label: "30 minutes" },
|
|
2446
2531
|
{ value: 60, label: "1 hour" }
|
|
2447
2532
|
];
|
|
2448
|
-
function
|
|
2533
|
+
function Dr({
|
|
2449
2534
|
value: t,
|
|
2450
2535
|
onChange: n,
|
|
2451
2536
|
isLocked: o = !1,
|
|
2452
|
-
className:
|
|
2453
|
-
labels:
|
|
2537
|
+
className: a,
|
|
2538
|
+
labels: i = {}
|
|
2454
2539
|
}) {
|
|
2455
|
-
const
|
|
2540
|
+
const l = {
|
|
2456
2541
|
title: "Slot duration",
|
|
2457
2542
|
lockedMessage: "This setting is locked by the administrator",
|
|
2458
2543
|
infoMessage: "Set the time slot duration for day and week calendar views.",
|
|
2459
|
-
...
|
|
2460
|
-
},
|
|
2544
|
+
...i
|
|
2545
|
+
}, p = (h) => {
|
|
2461
2546
|
o || n(Number(h.target.value));
|
|
2462
2547
|
};
|
|
2463
|
-
return /* @__PURE__ */ r("div", { className:
|
|
2548
|
+
return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-3", a), children: [
|
|
2464
2549
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
2465
|
-
/* @__PURE__ */ e(
|
|
2466
|
-
o ? /* @__PURE__ */ e(
|
|
2467
|
-
/* @__PURE__ */ e(
|
|
2468
|
-
/* @__PURE__ */ e(
|
|
2469
|
-
] }) }) : /* @__PURE__ */ e(
|
|
2470
|
-
/* @__PURE__ */ e(
|
|
2471
|
-
/* @__PURE__ */ e(
|
|
2550
|
+
/* @__PURE__ */ e(he, { className: "text-sm font-semibold", children: l.title }),
|
|
2551
|
+
o ? /* @__PURE__ */ e(me, { delayDuration: 100, children: /* @__PURE__ */ r(fe, { children: [
|
|
2552
|
+
/* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(Ln, { className: "size-3 text-muted-foreground" }) }),
|
|
2553
|
+
/* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e("p", { children: l.lockedMessage }) })
|
|
2554
|
+
] }) }) : /* @__PURE__ */ e(me, { delayDuration: 100, children: /* @__PURE__ */ r(fe, { children: [
|
|
2555
|
+
/* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(En, { className: "size-3 text-muted-foreground" }) }),
|
|
2556
|
+
/* @__PURE__ */ e(pe, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: l.infoMessage }) })
|
|
2472
2557
|
] }) })
|
|
2473
2558
|
] }),
|
|
2474
2559
|
/* @__PURE__ */ e(
|
|
2475
|
-
|
|
2560
|
+
xe,
|
|
2476
2561
|
{
|
|
2477
2562
|
value: t.toString(),
|
|
2478
|
-
onChange:
|
|
2563
|
+
onChange: p,
|
|
2479
2564
|
disabled: o,
|
|
2480
2565
|
className: "h-9 w-[128px] text-sm",
|
|
2481
2566
|
children: Tn.map((h) => /* @__PURE__ */ e("option", { value: h.value.toString(), children: h.label }, h.value))
|
|
@@ -2505,7 +2590,7 @@ function Hn({ className: t }) {
|
|
|
2505
2590
|
}
|
|
2506
2591
|
);
|
|
2507
2592
|
}
|
|
2508
|
-
function
|
|
2593
|
+
function zn({ className: t }) {
|
|
2509
2594
|
return /* @__PURE__ */ r(
|
|
2510
2595
|
"svg",
|
|
2511
2596
|
{
|
|
@@ -2526,7 +2611,7 @@ function In({ className: t }) {
|
|
|
2526
2611
|
}
|
|
2527
2612
|
);
|
|
2528
2613
|
}
|
|
2529
|
-
const
|
|
2614
|
+
const In = [
|
|
2530
2615
|
{ value: "dot", label: "Dot indicator" },
|
|
2531
2616
|
{ value: "colored", label: "Full color" },
|
|
2532
2617
|
{ value: "mixed", label: "Mixed" }
|
|
@@ -2535,10 +2620,10 @@ function Mr({
|
|
|
2535
2620
|
value: t,
|
|
2536
2621
|
onChange: n,
|
|
2537
2622
|
isLocked: o = !1,
|
|
2538
|
-
className:
|
|
2539
|
-
labels:
|
|
2623
|
+
className: a,
|
|
2624
|
+
labels: i = {}
|
|
2540
2625
|
}) {
|
|
2541
|
-
const
|
|
2626
|
+
const l = {
|
|
2542
2627
|
title: "Event display",
|
|
2543
2628
|
lockedMessage: "This setting is locked by the administrator",
|
|
2544
2629
|
infoMessage: "Choose how events are displayed. Dot shows a small indicator, colored fills the entire event, mixed uses both.",
|
|
@@ -2547,29 +2632,29 @@ function Mr({
|
|
|
2547
2632
|
colored: "Full color",
|
|
2548
2633
|
mixed: "Mixed"
|
|
2549
2634
|
},
|
|
2550
|
-
...
|
|
2551
|
-
},
|
|
2635
|
+
...i
|
|
2636
|
+
}, p = (d) => l.options?.[d] ?? d, h = (d) => {
|
|
2552
2637
|
o || n(d.target.value);
|
|
2553
2638
|
};
|
|
2554
|
-
return /* @__PURE__ */ r("div", { className:
|
|
2639
|
+
return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-3", a), children: [
|
|
2555
2640
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
2556
|
-
/* @__PURE__ */ e(
|
|
2557
|
-
o ? /* @__PURE__ */ e(
|
|
2558
|
-
/* @__PURE__ */ e(
|
|
2559
|
-
/* @__PURE__ */ e(
|
|
2560
|
-
] }) }) : /* @__PURE__ */ e(
|
|
2561
|
-
/* @__PURE__ */ e(
|
|
2562
|
-
/* @__PURE__ */ e(
|
|
2641
|
+
/* @__PURE__ */ e(he, { className: "text-sm font-semibold", children: l.title }),
|
|
2642
|
+
o ? /* @__PURE__ */ e(me, { delayDuration: 100, children: /* @__PURE__ */ r(fe, { children: [
|
|
2643
|
+
/* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(zn, { className: "size-3 text-muted-foreground" }) }),
|
|
2644
|
+
/* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e("p", { children: l.lockedMessage }) })
|
|
2645
|
+
] }) }) : /* @__PURE__ */ e(me, { delayDuration: 100, children: /* @__PURE__ */ r(fe, { children: [
|
|
2646
|
+
/* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(Hn, { className: "size-3 text-muted-foreground" }) }),
|
|
2647
|
+
/* @__PURE__ */ e(pe, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: l.infoMessage }) })
|
|
2563
2648
|
] }) })
|
|
2564
2649
|
] }),
|
|
2565
2650
|
/* @__PURE__ */ e(
|
|
2566
|
-
|
|
2651
|
+
xe,
|
|
2567
2652
|
{
|
|
2568
2653
|
value: t,
|
|
2569
2654
|
onChange: h,
|
|
2570
2655
|
disabled: o,
|
|
2571
2656
|
className: "h-9 w-[128px] text-sm",
|
|
2572
|
-
children:
|
|
2657
|
+
children: In.map((d) => /* @__PURE__ */ e("option", { value: d.value, children: p(d.value) }, d.value))
|
|
2573
2658
|
}
|
|
2574
2659
|
)
|
|
2575
2660
|
] });
|
|
@@ -2627,76 +2712,76 @@ function Sr({
|
|
|
2627
2712
|
value: t,
|
|
2628
2713
|
onChange: n,
|
|
2629
2714
|
isLocked: o = !1,
|
|
2630
|
-
className:
|
|
2631
|
-
labels:
|
|
2715
|
+
className: a,
|
|
2716
|
+
labels: i = {}
|
|
2632
2717
|
}) {
|
|
2633
|
-
const
|
|
2718
|
+
const l = {
|
|
2634
2719
|
title: "Visible hours",
|
|
2635
2720
|
from: "From",
|
|
2636
2721
|
to: "To",
|
|
2637
2722
|
lockedMessage: "This setting is locked by the administrator",
|
|
2638
2723
|
infoMessage: "Set the visible hour range for day and week views. Hours outside this range will be hidden.",
|
|
2639
|
-
...
|
|
2640
|
-
},
|
|
2724
|
+
...i
|
|
2725
|
+
}, p = Pn(), h = (v) => {
|
|
2641
2726
|
if (o) return;
|
|
2642
|
-
const
|
|
2643
|
-
|
|
2644
|
-
}, d = (
|
|
2727
|
+
const b = Number(v.target.value);
|
|
2728
|
+
b < t.endHour && n({ ...t, startHour: b });
|
|
2729
|
+
}, d = (v) => {
|
|
2645
2730
|
if (o) return;
|
|
2646
|
-
const
|
|
2647
|
-
|
|
2731
|
+
const b = Number(v.target.value);
|
|
2732
|
+
b > t.startHour && n({ ...t, endHour: b });
|
|
2648
2733
|
};
|
|
2649
|
-
return /* @__PURE__ */ r("div", { className:
|
|
2734
|
+
return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-3", a), children: [
|
|
2650
2735
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
2651
|
-
/* @__PURE__ */ e(
|
|
2652
|
-
o ? /* @__PURE__ */ e(
|
|
2653
|
-
/* @__PURE__ */ e(
|
|
2654
|
-
/* @__PURE__ */ e(
|
|
2655
|
-
] }) }) : /* @__PURE__ */ e(
|
|
2656
|
-
/* @__PURE__ */ e(
|
|
2657
|
-
/* @__PURE__ */ e(
|
|
2736
|
+
/* @__PURE__ */ e(he, { className: "text-sm font-semibold", children: l.title }),
|
|
2737
|
+
o ? /* @__PURE__ */ e(me, { delayDuration: 100, children: /* @__PURE__ */ r(fe, { children: [
|
|
2738
|
+
/* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(An, { className: "size-3 text-muted-foreground" }) }),
|
|
2739
|
+
/* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e("p", { children: l.lockedMessage }) })
|
|
2740
|
+
] }) }) : /* @__PURE__ */ e(me, { delayDuration: 100, children: /* @__PURE__ */ r(fe, { children: [
|
|
2741
|
+
/* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(jn, { className: "size-3 text-muted-foreground" }) }),
|
|
2742
|
+
/* @__PURE__ */ e(pe, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: l.infoMessage }) })
|
|
2658
2743
|
] }) })
|
|
2659
2744
|
] }),
|
|
2660
2745
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
2661
2746
|
/* @__PURE__ */ r("div", { className: "flex flex-col gap-1", children: [
|
|
2662
|
-
/* @__PURE__ */ e(
|
|
2747
|
+
/* @__PURE__ */ e(he, { className: "text-xs text-muted-foreground", children: l.from }),
|
|
2663
2748
|
/* @__PURE__ */ e(
|
|
2664
|
-
|
|
2749
|
+
xe,
|
|
2665
2750
|
{
|
|
2666
2751
|
value: t.startHour.toString(),
|
|
2667
2752
|
onChange: h,
|
|
2668
2753
|
disabled: o,
|
|
2669
2754
|
className: "h-9 w-[88px] text-sm",
|
|
2670
|
-
children:
|
|
2755
|
+
children: p.map((v) => /* @__PURE__ */ e(
|
|
2671
2756
|
"option",
|
|
2672
2757
|
{
|
|
2673
|
-
value:
|
|
2674
|
-
disabled:
|
|
2675
|
-
children:
|
|
2758
|
+
value: v.value.toString(),
|
|
2759
|
+
disabled: v.value >= t.endHour,
|
|
2760
|
+
children: v.label
|
|
2676
2761
|
},
|
|
2677
|
-
|
|
2762
|
+
v.value
|
|
2678
2763
|
))
|
|
2679
2764
|
}
|
|
2680
2765
|
)
|
|
2681
2766
|
] }),
|
|
2682
2767
|
/* @__PURE__ */ e("span", { className: "mt-5 text-muted-foreground", children: "—" }),
|
|
2683
2768
|
/* @__PURE__ */ r("div", { className: "flex flex-col gap-1", children: [
|
|
2684
|
-
/* @__PURE__ */ e(
|
|
2769
|
+
/* @__PURE__ */ e(he, { className: "text-xs text-muted-foreground", children: l.to }),
|
|
2685
2770
|
/* @__PURE__ */ e(
|
|
2686
|
-
|
|
2771
|
+
xe,
|
|
2687
2772
|
{
|
|
2688
2773
|
value: t.endHour.toString(),
|
|
2689
2774
|
onChange: d,
|
|
2690
2775
|
disabled: o,
|
|
2691
2776
|
className: "h-9 w-[88px] text-sm",
|
|
2692
|
-
children:
|
|
2777
|
+
children: p.map((v) => /* @__PURE__ */ e(
|
|
2693
2778
|
"option",
|
|
2694
2779
|
{
|
|
2695
|
-
value:
|
|
2696
|
-
disabled:
|
|
2697
|
-
children:
|
|
2780
|
+
value: v.value.toString(),
|
|
2781
|
+
disabled: v.value <= t.startHour,
|
|
2782
|
+
children: v.label
|
|
2698
2783
|
},
|
|
2699
|
-
|
|
2784
|
+
v.value
|
|
2700
2785
|
))
|
|
2701
2786
|
}
|
|
2702
2787
|
)
|
|
@@ -2726,7 +2811,7 @@ function Wn({ className: t }) {
|
|
|
2726
2811
|
}
|
|
2727
2812
|
);
|
|
2728
2813
|
}
|
|
2729
|
-
function
|
|
2814
|
+
function Fn({ className: t }) {
|
|
2730
2815
|
return /* @__PURE__ */ r(
|
|
2731
2816
|
"svg",
|
|
2732
2817
|
{
|
|
@@ -2747,7 +2832,7 @@ function $n({ className: t }) {
|
|
|
2747
2832
|
}
|
|
2748
2833
|
);
|
|
2749
2834
|
}
|
|
2750
|
-
function
|
|
2835
|
+
function $n({ className: t }) {
|
|
2751
2836
|
return /* @__PURE__ */ e(
|
|
2752
2837
|
"svg",
|
|
2753
2838
|
{
|
|
@@ -2789,17 +2874,17 @@ const nt = {
|
|
|
2789
2874
|
friday: "Fri",
|
|
2790
2875
|
saturday: "Sat"
|
|
2791
2876
|
};
|
|
2792
|
-
function Bn({ dayLabel: t, config: n, onChange: o, disabled:
|
|
2793
|
-
const
|
|
2794
|
-
|
|
2795
|
-
},
|
|
2796
|
-
if (
|
|
2797
|
-
const
|
|
2798
|
-
|
|
2877
|
+
function Bn({ dayLabel: t, config: n, onChange: o, disabled: a, hourOptions: i }) {
|
|
2878
|
+
const l = () => {
|
|
2879
|
+
a || o({ ...n, enabled: !n.enabled });
|
|
2880
|
+
}, p = (d) => {
|
|
2881
|
+
if (a) return;
|
|
2882
|
+
const v = Number(d.target.value);
|
|
2883
|
+
v < n.to && o({ ...n, from: v });
|
|
2799
2884
|
}, h = (d) => {
|
|
2800
|
-
if (
|
|
2801
|
-
const
|
|
2802
|
-
|
|
2885
|
+
if (a) return;
|
|
2886
|
+
const v = Number(d.target.value);
|
|
2887
|
+
v > n.from && o({ ...n, to: v });
|
|
2803
2888
|
};
|
|
2804
2889
|
return /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
2805
2890
|
/* @__PURE__ */ e(
|
|
@@ -2809,36 +2894,36 @@ function Bn({ dayLabel: t, config: n, onChange: o, disabled: s, hourOptions: a }
|
|
|
2809
2894
|
role: "checkbox",
|
|
2810
2895
|
"aria-checked": n.enabled,
|
|
2811
2896
|
"aria-label": `Enable ${t}`,
|
|
2812
|
-
onClick:
|
|
2813
|
-
disabled:
|
|
2814
|
-
className:
|
|
2897
|
+
onClick: l,
|
|
2898
|
+
disabled: a,
|
|
2899
|
+
className: g(
|
|
2815
2900
|
"flex size-5 shrink-0 items-center justify-center rounded border transition-colors",
|
|
2816
2901
|
n.enabled ? "border-primary bg-primary text-primary-foreground" : "border-input bg-background",
|
|
2817
|
-
|
|
2902
|
+
a && "cursor-not-allowed opacity-50"
|
|
2818
2903
|
),
|
|
2819
|
-
children: n.enabled && /* @__PURE__ */ e(
|
|
2904
|
+
children: n.enabled && /* @__PURE__ */ e($n, { className: "size-3" })
|
|
2820
2905
|
}
|
|
2821
2906
|
),
|
|
2822
|
-
/* @__PURE__ */ e("span", { className:
|
|
2907
|
+
/* @__PURE__ */ e("span", { className: g("w-10 text-sm", !n.enabled && "text-muted-foreground"), children: t }),
|
|
2823
2908
|
/* @__PURE__ */ e(
|
|
2824
|
-
|
|
2909
|
+
xe,
|
|
2825
2910
|
{
|
|
2826
2911
|
value: n.from.toString(),
|
|
2827
|
-
onChange:
|
|
2828
|
-
disabled:
|
|
2912
|
+
onChange: p,
|
|
2913
|
+
disabled: a || !n.enabled,
|
|
2829
2914
|
className: "h-8 w-[76px] text-xs",
|
|
2830
|
-
children:
|
|
2915
|
+
children: i.map((d) => /* @__PURE__ */ e("option", { value: d.value.toString(), disabled: d.value >= n.to, children: d.label }, d.value))
|
|
2831
2916
|
}
|
|
2832
2917
|
),
|
|
2833
2918
|
/* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "—" }),
|
|
2834
2919
|
/* @__PURE__ */ e(
|
|
2835
|
-
|
|
2920
|
+
xe,
|
|
2836
2921
|
{
|
|
2837
2922
|
value: n.to.toString(),
|
|
2838
2923
|
onChange: h,
|
|
2839
|
-
disabled:
|
|
2924
|
+
disabled: a || !n.enabled,
|
|
2840
2925
|
className: "h-8 w-[76px] text-xs",
|
|
2841
|
-
children:
|
|
2926
|
+
children: i.map((d) => /* @__PURE__ */ e("option", { value: d.value.toString(), disabled: d.value <= n.from, children: d.label }, d.value))
|
|
2842
2927
|
}
|
|
2843
2928
|
)
|
|
2844
2929
|
] });
|
|
@@ -2847,37 +2932,37 @@ function Er({
|
|
|
2847
2932
|
value: t,
|
|
2848
2933
|
onChange: n,
|
|
2849
2934
|
isLocked: o = !1,
|
|
2850
|
-
className:
|
|
2851
|
-
labels:
|
|
2935
|
+
className: a,
|
|
2936
|
+
labels: i = {}
|
|
2852
2937
|
}) {
|
|
2853
|
-
const
|
|
2938
|
+
const l = {
|
|
2854
2939
|
title: "Working hours",
|
|
2855
2940
|
lockedMessage: "This setting is locked by the administrator",
|
|
2856
2941
|
infoMessage: "Configure working hours for each day of the week. Non-working hours will be grayed out in day and week views.",
|
|
2857
2942
|
days: nt,
|
|
2858
|
-
...
|
|
2859
|
-
},
|
|
2860
|
-
o || n({ ...t, [d]:
|
|
2943
|
+
...i
|
|
2944
|
+
}, p = _n(), h = (d, v) => {
|
|
2945
|
+
o || n({ ...t, [d]: v });
|
|
2861
2946
|
};
|
|
2862
|
-
return /* @__PURE__ */ r("div", { className:
|
|
2947
|
+
return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-3", a), children: [
|
|
2863
2948
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
2864
|
-
/* @__PURE__ */ e(
|
|
2865
|
-
o ? /* @__PURE__ */ e(
|
|
2866
|
-
/* @__PURE__ */ e(
|
|
2867
|
-
/* @__PURE__ */ e(
|
|
2868
|
-
] }) }) : /* @__PURE__ */ e(
|
|
2869
|
-
/* @__PURE__ */ e(
|
|
2870
|
-
/* @__PURE__ */ e(
|
|
2949
|
+
/* @__PURE__ */ e(he, { className: "text-sm font-semibold", children: l.title }),
|
|
2950
|
+
o ? /* @__PURE__ */ e(me, { delayDuration: 100, children: /* @__PURE__ */ r(fe, { children: [
|
|
2951
|
+
/* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(Fn, { className: "size-3 text-muted-foreground" }) }),
|
|
2952
|
+
/* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e("p", { children: l.lockedMessage }) })
|
|
2953
|
+
] }) }) : /* @__PURE__ */ e(me, { delayDuration: 100, children: /* @__PURE__ */ r(fe, { children: [
|
|
2954
|
+
/* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(Wn, { className: "size-3 text-muted-foreground" }) }),
|
|
2955
|
+
/* @__PURE__ */ e(pe, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: l.infoMessage }) })
|
|
2871
2956
|
] }) })
|
|
2872
2957
|
] }),
|
|
2873
2958
|
/* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: On.map((d) => /* @__PURE__ */ e(
|
|
2874
2959
|
Bn,
|
|
2875
2960
|
{
|
|
2876
|
-
dayLabel:
|
|
2961
|
+
dayLabel: l.days?.[d] ?? nt[d],
|
|
2877
2962
|
config: t[d],
|
|
2878
|
-
onChange: (
|
|
2963
|
+
onChange: (v) => h(d, v),
|
|
2879
2964
|
disabled: o,
|
|
2880
|
-
hourOptions:
|
|
2965
|
+
hourOptions: p
|
|
2881
2966
|
},
|
|
2882
2967
|
d
|
|
2883
2968
|
)) })
|
|
@@ -2946,7 +3031,7 @@ function Un({ className: t }) {
|
|
|
2946
3031
|
}
|
|
2947
3032
|
);
|
|
2948
3033
|
}
|
|
2949
|
-
function _e({ checked: t, onCheckedChange: n, className: o, children:
|
|
3034
|
+
function _e({ checked: t, onCheckedChange: n, className: o, children: a }) {
|
|
2950
3035
|
return /* @__PURE__ */ e(
|
|
2951
3036
|
"button",
|
|
2952
3037
|
{
|
|
@@ -2955,18 +3040,18 @@ function _e({ checked: t, onCheckedChange: n, className: o, children: s }) {
|
|
|
2955
3040
|
"aria-checked": t,
|
|
2956
3041
|
onClick: () => n(!t),
|
|
2957
3042
|
className: o,
|
|
2958
|
-
children:
|
|
3043
|
+
children: a
|
|
2959
3044
|
}
|
|
2960
3045
|
);
|
|
2961
3046
|
}
|
|
2962
|
-
function Vn({ src: t, alt: n, fallback: o, className:
|
|
2963
|
-
const [
|
|
2964
|
-
return !t ||
|
|
3047
|
+
function Vn({ src: t, alt: n, fallback: o, className: a }) {
|
|
3048
|
+
const [i, l] = ie(!1);
|
|
3049
|
+
return !t || i ? /* @__PURE__ */ e(
|
|
2965
3050
|
"div",
|
|
2966
3051
|
{
|
|
2967
|
-
className:
|
|
3052
|
+
className: g(
|
|
2968
3053
|
"flex items-center justify-center bg-zinc-200 text-zinc-600 font-medium text-sm",
|
|
2969
|
-
|
|
3054
|
+
a
|
|
2970
3055
|
),
|
|
2971
3056
|
children: o || "?"
|
|
2972
3057
|
}
|
|
@@ -2975,30 +3060,30 @@ function Vn({ src: t, alt: n, fallback: o, className: s }) {
|
|
|
2975
3060
|
{
|
|
2976
3061
|
src: t,
|
|
2977
3062
|
alt: n || "",
|
|
2978
|
-
className:
|
|
2979
|
-
onError: () =>
|
|
3063
|
+
className: g("object-cover", a),
|
|
3064
|
+
onError: () => l(!0)
|
|
2980
3065
|
}
|
|
2981
3066
|
);
|
|
2982
3067
|
}
|
|
2983
|
-
function rt({ value: t, onChange: n, placeholder: o, className:
|
|
2984
|
-
return /* @__PURE__ */ r("div", { className:
|
|
3068
|
+
function rt({ value: t, onChange: n, placeholder: o, className: a }) {
|
|
3069
|
+
return /* @__PURE__ */ r("div", { className: g("relative", a), children: [
|
|
2985
3070
|
/* @__PURE__ */ e(Rn, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
2986
3071
|
/* @__PURE__ */ e(
|
|
2987
3072
|
"input",
|
|
2988
3073
|
{
|
|
2989
3074
|
type: "text",
|
|
2990
3075
|
value: t,
|
|
2991
|
-
onChange: (
|
|
3076
|
+
onChange: (i) => n(i.target.value),
|
|
2992
3077
|
placeholder: o,
|
|
2993
3078
|
className: "h-9 w-full rounded-lg border border-border bg-white pl-9 pr-3 text-sm placeholder:text-muted-foreground focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary"
|
|
2994
3079
|
}
|
|
2995
3080
|
)
|
|
2996
3081
|
] });
|
|
2997
3082
|
}
|
|
2998
|
-
function ot(t, n, o,
|
|
3083
|
+
function ot(t, n, o, a = 0.3) {
|
|
2999
3084
|
if (!n.trim()) return t;
|
|
3000
|
-
const
|
|
3001
|
-
return t.filter((
|
|
3085
|
+
const i = n.toLowerCase();
|
|
3086
|
+
return t.filter((l) => o(l).some((h) => h ? h.toLowerCase().includes(i) : !1));
|
|
3002
3087
|
}
|
|
3003
3088
|
const Yn = {
|
|
3004
3089
|
title: "Filters",
|
|
@@ -3017,69 +3102,69 @@ function Tr({
|
|
|
3017
3102
|
scheduleTypes: t,
|
|
3018
3103
|
users: n,
|
|
3019
3104
|
selectedScheduleTypeIds: o,
|
|
3020
|
-
onScheduleTypeChange:
|
|
3021
|
-
selectedUserIds:
|
|
3022
|
-
onUserChange:
|
|
3023
|
-
onClearAll:
|
|
3105
|
+
onScheduleTypeChange: a,
|
|
3106
|
+
selectedUserIds: i,
|
|
3107
|
+
onUserChange: l,
|
|
3108
|
+
onClearAll: p,
|
|
3024
3109
|
className: h,
|
|
3025
3110
|
scheduleTypesLoading: d = !1,
|
|
3026
|
-
usersLoading:
|
|
3027
|
-
labels:
|
|
3028
|
-
getScheduleTypeName:
|
|
3111
|
+
usersLoading: v = !1,
|
|
3112
|
+
labels: b,
|
|
3113
|
+
getScheduleTypeName: w
|
|
3029
3114
|
}) {
|
|
3030
|
-
const
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
]) : t, [t,
|
|
3034
|
-
const
|
|
3035
|
-
|
|
3036
|
-
},
|
|
3115
|
+
const A = { ...Yn, ...b }, [$, P] = ie(""), [W, T] = ie(""), y = Q(() => $.trim() ? ot(t, $, (s) => [
|
|
3116
|
+
s.name,
|
|
3117
|
+
w?.(s) || s.name
|
|
3118
|
+
]) : t, [t, $, w]), z = Q(() => W.trim() ? ot(n, W, (s) => [s.name, s.email || ""]) : n, [n, W]), O = y.length > 0 && y.every((s) => o.includes(s.id)), _ = z.length > 0 && z.every((s) => i.includes(s.id)), D = o.length + i.length, K = (s, m) => {
|
|
3119
|
+
const N = m ? [...o, s] : o.filter((L) => L !== s);
|
|
3120
|
+
a(N);
|
|
3121
|
+
}, E = () => {
|
|
3037
3122
|
if (O) {
|
|
3038
|
-
const
|
|
3039
|
-
|
|
3123
|
+
const s = new Set(y.map((m) => m.id));
|
|
3124
|
+
a(o.filter((m) => !s.has(m)));
|
|
3040
3125
|
} else {
|
|
3041
|
-
const
|
|
3126
|
+
const s = /* @__PURE__ */ new Set([
|
|
3042
3127
|
...o,
|
|
3043
|
-
...y.map((
|
|
3128
|
+
...y.map((m) => m.id)
|
|
3044
3129
|
]);
|
|
3045
|
-
|
|
3130
|
+
a(Array.from(s));
|
|
3046
3131
|
}
|
|
3047
|
-
},
|
|
3048
|
-
const
|
|
3049
|
-
|
|
3132
|
+
}, H = (s, m) => {
|
|
3133
|
+
const N = m ? [...i, s] : i.filter((L) => L !== s);
|
|
3134
|
+
l(N);
|
|
3050
3135
|
}, V = () => {
|
|
3051
|
-
if (
|
|
3052
|
-
const
|
|
3053
|
-
i
|
|
3136
|
+
if (_) {
|
|
3137
|
+
const s = new Set(z.map((m) => m.id));
|
|
3138
|
+
l(i.filter((m) => !s.has(m)));
|
|
3054
3139
|
} else {
|
|
3055
|
-
const
|
|
3056
|
-
|
|
3140
|
+
const s = /* @__PURE__ */ new Set([...i, ...z.map((m) => m.id)]);
|
|
3141
|
+
l(Array.from(s));
|
|
3057
3142
|
}
|
|
3058
|
-
},
|
|
3059
|
-
|
|
3060
|
-
},
|
|
3143
|
+
}, J = () => {
|
|
3144
|
+
a([]), l([]), p?.();
|
|
3145
|
+
}, G = (s) => w ? w(s) : s.name, B = (s) => s.colorHex || s.color || "#069AD7";
|
|
3061
3146
|
return /* @__PURE__ */ r(
|
|
3062
3147
|
"div",
|
|
3063
3148
|
{
|
|
3064
|
-
className:
|
|
3149
|
+
className: g(
|
|
3065
3150
|
"flex min-w-72 max-w-72 flex-col rounded-lg border bg-white shadow-sm",
|
|
3066
3151
|
h
|
|
3067
3152
|
),
|
|
3068
3153
|
children: [
|
|
3069
3154
|
/* @__PURE__ */ r("header", { className: "flex items-start justify-between gap-2 px-4 pb-2 pt-4", children: [
|
|
3070
3155
|
/* @__PURE__ */ r("div", { className: "flex flex-col", children: [
|
|
3071
|
-
/* @__PURE__ */ e("h3", { className: "text-base font-semibold text-foreground", children:
|
|
3072
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children:
|
|
3156
|
+
/* @__PURE__ */ e("h3", { className: "text-base font-semibold text-foreground", children: A.title }),
|
|
3157
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: A.subtitle })
|
|
3073
3158
|
] }),
|
|
3074
|
-
|
|
3159
|
+
D > 0 && /* @__PURE__ */ r(
|
|
3075
3160
|
"button",
|
|
3076
3161
|
{
|
|
3077
3162
|
type: "button",
|
|
3078
|
-
onClick:
|
|
3163
|
+
onClick: J,
|
|
3079
3164
|
className: "flex h-auto items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-destructive transition-colors hover:bg-destructive/10",
|
|
3080
3165
|
children: [
|
|
3081
3166
|
/* @__PURE__ */ e(Un, { className: "h-3.5 w-3.5" }),
|
|
3082
|
-
|
|
3167
|
+
A.clearAll
|
|
3083
3168
|
]
|
|
3084
3169
|
}
|
|
3085
3170
|
)
|
|
@@ -3087,29 +3172,29 @@ function Tr({
|
|
|
3087
3172
|
/* @__PURE__ */ e("div", { className: "h-px w-full bg-border/60" }),
|
|
3088
3173
|
/* @__PURE__ */ r("section", { className: "flex flex-col", children: [
|
|
3089
3174
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between px-4 py-3", children: [
|
|
3090
|
-
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-foreground", children:
|
|
3175
|
+
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-foreground", children: A.scheduleTypes }),
|
|
3091
3176
|
/* @__PURE__ */ e(
|
|
3092
3177
|
"button",
|
|
3093
3178
|
{
|
|
3094
3179
|
type: "button",
|
|
3095
|
-
onClick:
|
|
3180
|
+
onClick: E,
|
|
3096
3181
|
className: "text-xs font-medium text-primary transition-colors hover:text-primary/80",
|
|
3097
|
-
children: O ?
|
|
3182
|
+
children: O ? A.unselectAll : A.selectAll
|
|
3098
3183
|
}
|
|
3099
3184
|
)
|
|
3100
3185
|
] }),
|
|
3101
3186
|
t.length > 6 && /* @__PURE__ */ e("div", { className: "px-4 pb-3", children: /* @__PURE__ */ e(
|
|
3102
3187
|
rt,
|
|
3103
3188
|
{
|
|
3104
|
-
value:
|
|
3189
|
+
value: $,
|
|
3105
3190
|
onChange: P,
|
|
3106
|
-
placeholder:
|
|
3191
|
+
placeholder: A.searchScheduleTypes
|
|
3107
3192
|
}
|
|
3108
3193
|
) }),
|
|
3109
3194
|
/* @__PURE__ */ r("div", { className: "flex max-h-[220px] flex-col gap-2 overflow-y-auto px-4 pb-2 scrollbar-thin", children: [
|
|
3110
3195
|
d ? (
|
|
3111
3196
|
// Loading skeletons
|
|
3112
|
-
Array.from({ length: 4 }).map((
|
|
3197
|
+
Array.from({ length: 4 }).map((s, m) => /* @__PURE__ */ r(
|
|
3113
3198
|
"div",
|
|
3114
3199
|
{
|
|
3115
3200
|
className: "flex animate-pulse items-center gap-2 rounded-md border border-border/60 bg-muted/40 p-2",
|
|
@@ -3118,65 +3203,65 @@ function Tr({
|
|
|
3118
3203
|
/* @__PURE__ */ e("div", { className: "h-3 w-24 rounded bg-muted-foreground/20" })
|
|
3119
3204
|
]
|
|
3120
3205
|
},
|
|
3121
|
-
`skeleton-${
|
|
3206
|
+
`skeleton-${m}`
|
|
3122
3207
|
))
|
|
3123
|
-
) : y.map((
|
|
3124
|
-
const
|
|
3208
|
+
) : y.map((s) => {
|
|
3209
|
+
const m = o.includes(s.id), N = B(s);
|
|
3125
3210
|
return /* @__PURE__ */ r(
|
|
3126
3211
|
_e,
|
|
3127
3212
|
{
|
|
3128
|
-
checked:
|
|
3129
|
-
onCheckedChange: (
|
|
3130
|
-
className:
|
|
3213
|
+
checked: m,
|
|
3214
|
+
onCheckedChange: (L) => K(s.id, L),
|
|
3215
|
+
className: g(
|
|
3131
3216
|
"relative flex w-full cursor-pointer items-center justify-between gap-3 rounded-md border border-border bg-white px-3 py-2 transition-colors hover:border-primary/50",
|
|
3132
|
-
|
|
3217
|
+
m && "border-primary bg-primary/5"
|
|
3133
3218
|
),
|
|
3134
3219
|
children: [
|
|
3135
3220
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
3136
3221
|
/* @__PURE__ */ e(
|
|
3137
3222
|
"span",
|
|
3138
3223
|
{
|
|
3139
|
-
className:
|
|
3224
|
+
className: g(
|
|
3140
3225
|
"flex h-4 w-4 items-center justify-center rounded border border-border text-xs transition-colors",
|
|
3141
|
-
|
|
3226
|
+
m && "border-primary bg-primary text-primary-foreground"
|
|
3142
3227
|
),
|
|
3143
|
-
children:
|
|
3228
|
+
children: m && /* @__PURE__ */ e(Oe, { className: "h-3 w-3" })
|
|
3144
3229
|
}
|
|
3145
3230
|
),
|
|
3146
|
-
/* @__PURE__ */ e("span", { className: "text-sm font-medium text-foreground", children:
|
|
3231
|
+
/* @__PURE__ */ e("span", { className: "text-sm font-medium text-foreground", children: G(s) })
|
|
3147
3232
|
] }),
|
|
3148
3233
|
/* @__PURE__ */ e(
|
|
3149
3234
|
"div",
|
|
3150
3235
|
{
|
|
3151
3236
|
className: "h-4 w-4 rounded-full border",
|
|
3152
3237
|
style: {
|
|
3153
|
-
backgroundColor:
|
|
3154
|
-
borderColor:
|
|
3238
|
+
backgroundColor: N,
|
|
3239
|
+
borderColor: N
|
|
3155
3240
|
}
|
|
3156
3241
|
}
|
|
3157
3242
|
)
|
|
3158
3243
|
]
|
|
3159
3244
|
},
|
|
3160
|
-
|
|
3245
|
+
s.id
|
|
3161
3246
|
);
|
|
3162
3247
|
}),
|
|
3163
|
-
!d && y.length === 0 && /* @__PURE__ */ e("p", { className: "px-2 py-1 text-xs text-muted-foreground", children:
|
|
3248
|
+
!d && y.length === 0 && /* @__PURE__ */ e("p", { className: "px-2 py-1 text-xs text-muted-foreground", children: A.noScheduleTypes })
|
|
3164
3249
|
] })
|
|
3165
3250
|
] }),
|
|
3166
3251
|
/* @__PURE__ */ e("div", { className: "h-px w-full bg-border/60" }),
|
|
3167
3252
|
/* @__PURE__ */ r("section", { className: "flex flex-col", children: [
|
|
3168
3253
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between px-4 py-3", children: [
|
|
3169
|
-
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-foreground", children:
|
|
3254
|
+
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-foreground", children: A.participants }),
|
|
3170
3255
|
/* @__PURE__ */ e(
|
|
3171
3256
|
_e,
|
|
3172
3257
|
{
|
|
3173
|
-
checked:
|
|
3258
|
+
checked: _,
|
|
3174
3259
|
onCheckedChange: () => V(),
|
|
3175
|
-
className:
|
|
3260
|
+
className: g(
|
|
3176
3261
|
"flex h-5 w-5 items-center justify-center rounded border border-border bg-white transition-colors hover:border-primary/50",
|
|
3177
|
-
|
|
3262
|
+
_ && "border-primary bg-primary text-primary-foreground"
|
|
3178
3263
|
),
|
|
3179
|
-
children:
|
|
3264
|
+
children: _ && /* @__PURE__ */ e(Oe, { className: "h-3.5 w-3.5" })
|
|
3180
3265
|
}
|
|
3181
3266
|
)
|
|
3182
3267
|
] }),
|
|
@@ -3184,14 +3269,14 @@ function Tr({
|
|
|
3184
3269
|
rt,
|
|
3185
3270
|
{
|
|
3186
3271
|
value: W,
|
|
3187
|
-
onChange:
|
|
3188
|
-
placeholder:
|
|
3272
|
+
onChange: T,
|
|
3273
|
+
placeholder: A.searchParticipants
|
|
3189
3274
|
}
|
|
3190
3275
|
) }),
|
|
3191
3276
|
/* @__PURE__ */ r("div", { className: "flex max-h-[400px] flex-col gap-2 overflow-y-auto px-4 pb-4 scrollbar-thin", children: [
|
|
3192
|
-
|
|
3277
|
+
v ? (
|
|
3193
3278
|
// Loading skeletons
|
|
3194
|
-
Array.from({ length: 4 }).map((
|
|
3279
|
+
Array.from({ length: 4 }).map((s, m) => /* @__PURE__ */ r(
|
|
3195
3280
|
"div",
|
|
3196
3281
|
{
|
|
3197
3282
|
className: "flex animate-pulse items-center gap-3 rounded-md border border-border/60 bg-muted/40 p-3",
|
|
@@ -3204,58 +3289,58 @@ function Tr({
|
|
|
3204
3289
|
] })
|
|
3205
3290
|
]
|
|
3206
3291
|
},
|
|
3207
|
-
`p-skeleton-${
|
|
3292
|
+
`p-skeleton-${m}`
|
|
3208
3293
|
))
|
|
3209
|
-
) :
|
|
3210
|
-
const
|
|
3294
|
+
) : z.map((s) => {
|
|
3295
|
+
const m = i.includes(s.id);
|
|
3211
3296
|
return /* @__PURE__ */ r(
|
|
3212
3297
|
_e,
|
|
3213
3298
|
{
|
|
3214
|
-
checked:
|
|
3215
|
-
onCheckedChange: (
|
|
3216
|
-
className:
|
|
3299
|
+
checked: m,
|
|
3300
|
+
onCheckedChange: (N) => H(s.id, N),
|
|
3301
|
+
className: g(
|
|
3217
3302
|
"relative flex w-full cursor-pointer items-start gap-2 rounded-lg border border-border bg-white p-2 transition-colors hover:border-primary/50",
|
|
3218
|
-
|
|
3303
|
+
m && "border-primary bg-zinc-50"
|
|
3219
3304
|
),
|
|
3220
3305
|
children: [
|
|
3221
3306
|
/* @__PURE__ */ e(
|
|
3222
3307
|
"span",
|
|
3223
3308
|
{
|
|
3224
|
-
className:
|
|
3309
|
+
className: g(
|
|
3225
3310
|
"flex h-4 w-4 flex-shrink-0 items-center justify-center rounded border border-border transition-colors",
|
|
3226
|
-
|
|
3311
|
+
m && "border-primary bg-primary text-primary-foreground"
|
|
3227
3312
|
),
|
|
3228
|
-
children:
|
|
3313
|
+
children: m && /* @__PURE__ */ e(Oe, { className: "h-2.5 w-2.5" })
|
|
3229
3314
|
}
|
|
3230
3315
|
),
|
|
3231
3316
|
/* @__PURE__ */ r("div", { className: "flex flex-1 items-start gap-2", children: [
|
|
3232
3317
|
/* @__PURE__ */ e(
|
|
3233
3318
|
Vn,
|
|
3234
3319
|
{
|
|
3235
|
-
src:
|
|
3236
|
-
alt:
|
|
3237
|
-
fallback:
|
|
3320
|
+
src: s.avatar ?? null,
|
|
3321
|
+
alt: s.name,
|
|
3322
|
+
fallback: s.name?.[0]?.toUpperCase() ?? "?",
|
|
3238
3323
|
className: "h-10 w-10 rounded-lg"
|
|
3239
3324
|
}
|
|
3240
3325
|
),
|
|
3241
3326
|
/* @__PURE__ */ r("div", { className: "flex max-w-[140px] flex-col gap-0.5 overflow-hidden", children: [
|
|
3242
|
-
/* @__PURE__ */ e("span", { className: "line-clamp-1 text-sm font-medium text-foreground", children:
|
|
3327
|
+
/* @__PURE__ */ e("span", { className: "line-clamp-1 text-sm font-medium text-foreground", children: s.name }),
|
|
3243
3328
|
/* @__PURE__ */ e(
|
|
3244
3329
|
"span",
|
|
3245
3330
|
{
|
|
3246
3331
|
className: "truncate text-[11px] text-muted-foreground",
|
|
3247
|
-
title:
|
|
3248
|
-
children:
|
|
3332
|
+
title: s.email,
|
|
3333
|
+
children: s.email
|
|
3249
3334
|
}
|
|
3250
3335
|
)
|
|
3251
3336
|
] })
|
|
3252
3337
|
] })
|
|
3253
3338
|
]
|
|
3254
3339
|
},
|
|
3255
|
-
|
|
3340
|
+
s.id
|
|
3256
3341
|
);
|
|
3257
3342
|
}),
|
|
3258
|
-
!
|
|
3343
|
+
!v && z.length === 0 && /* @__PURE__ */ e("p", { className: "px-4 text-xs text-muted-foreground", children: A.noParticipants })
|
|
3259
3344
|
] })
|
|
3260
3345
|
] })
|
|
3261
3346
|
]
|
|
@@ -3287,15 +3372,15 @@ function Hr({
|
|
|
3287
3372
|
scheduleTypes: t,
|
|
3288
3373
|
value: n,
|
|
3289
3374
|
onChange: o,
|
|
3290
|
-
allLabel:
|
|
3291
|
-
className:
|
|
3292
|
-
label:
|
|
3375
|
+
allLabel: a = "All types",
|
|
3376
|
+
className: i,
|
|
3377
|
+
label: l
|
|
3293
3378
|
}) {
|
|
3294
|
-
const
|
|
3379
|
+
const p = (d) => {
|
|
3295
3380
|
o(d.target.value);
|
|
3296
3381
|
}, h = t.find((d) => String(d.id) === n);
|
|
3297
|
-
return /* @__PURE__ */ r("div", { className:
|
|
3298
|
-
|
|
3382
|
+
return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-1", i), children: [
|
|
3383
|
+
l && /* @__PURE__ */ e(he, { className: "text-xs text-muted-foreground", children: l }),
|
|
3299
3384
|
/* @__PURE__ */ r("div", { className: "relative", children: [
|
|
3300
3385
|
h ? /* @__PURE__ */ e(
|
|
3301
3386
|
"span",
|
|
@@ -3305,13 +3390,13 @@ function Hr({
|
|
|
3305
3390
|
}
|
|
3306
3391
|
) : /* @__PURE__ */ e(Kn, { className: "pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }),
|
|
3307
3392
|
/* @__PURE__ */ r(
|
|
3308
|
-
|
|
3393
|
+
xe,
|
|
3309
3394
|
{
|
|
3310
3395
|
value: n,
|
|
3311
|
-
onChange:
|
|
3396
|
+
onChange: p,
|
|
3312
3397
|
className: "h-9 w-full min-w-[140px] pl-8 pr-8 text-sm",
|
|
3313
3398
|
children: [
|
|
3314
|
-
/* @__PURE__ */ e("option", { value: "all", children:
|
|
3399
|
+
/* @__PURE__ */ e("option", { value: "all", children: a }),
|
|
3315
3400
|
t.map((d) => /* @__PURE__ */ e("option", { value: String(d.id), children: d.label }, d.id))
|
|
3316
3401
|
]
|
|
3317
3402
|
}
|
|
@@ -3342,29 +3427,29 @@ function Gn({ className: t }) {
|
|
|
3342
3427
|
}
|
|
3343
3428
|
);
|
|
3344
3429
|
}
|
|
3345
|
-
function
|
|
3430
|
+
function zr({
|
|
3346
3431
|
users: t,
|
|
3347
3432
|
value: n,
|
|
3348
3433
|
onChange: o,
|
|
3349
|
-
allLabel:
|
|
3350
|
-
className:
|
|
3351
|
-
label:
|
|
3434
|
+
allLabel: a = "All users",
|
|
3435
|
+
className: i,
|
|
3436
|
+
label: l
|
|
3352
3437
|
}) {
|
|
3353
|
-
const
|
|
3438
|
+
const p = (h) => {
|
|
3354
3439
|
o(h.target.value);
|
|
3355
3440
|
};
|
|
3356
|
-
return /* @__PURE__ */ r("div", { className:
|
|
3357
|
-
|
|
3441
|
+
return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-1", i), children: [
|
|
3442
|
+
l && /* @__PURE__ */ e(he, { className: "text-xs text-muted-foreground", children: l }),
|
|
3358
3443
|
/* @__PURE__ */ r("div", { className: "relative", children: [
|
|
3359
3444
|
/* @__PURE__ */ e(Gn, { className: "pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }),
|
|
3360
3445
|
/* @__PURE__ */ r(
|
|
3361
|
-
|
|
3446
|
+
xe,
|
|
3362
3447
|
{
|
|
3363
3448
|
value: n,
|
|
3364
|
-
onChange:
|
|
3449
|
+
onChange: p,
|
|
3365
3450
|
className: "h-9 w-full min-w-[120px] pl-8 pr-8 text-sm",
|
|
3366
3451
|
children: [
|
|
3367
|
-
/* @__PURE__ */ e("option", { value: "all", children:
|
|
3452
|
+
/* @__PURE__ */ e("option", { value: "all", children: a }),
|
|
3368
3453
|
t.map((h) => /* @__PURE__ */ e("option", { value: h.id, children: h.name }, h.id))
|
|
3369
3454
|
]
|
|
3370
3455
|
}
|
|
@@ -3459,12 +3544,12 @@ function Qn({ className: t }) {
|
|
|
3459
3544
|
);
|
|
3460
3545
|
}
|
|
3461
3546
|
function Zn(t) {
|
|
3462
|
-
const n = t.getFullYear(), o = String(t.getMonth() + 1).padStart(2, "0"),
|
|
3463
|
-
return `${n}-${o}-${
|
|
3547
|
+
const n = t.getFullYear(), o = String(t.getMonth() + 1).padStart(2, "0"), a = String(t.getDate()).padStart(2, "0");
|
|
3548
|
+
return `${n}-${o}-${a}`;
|
|
3464
3549
|
}
|
|
3465
3550
|
function st(t) {
|
|
3466
|
-
const n = t.getHours(), o = t.getMinutes(),
|
|
3467
|
-
return `${
|
|
3551
|
+
const n = t.getHours(), o = t.getMinutes(), a = n >= 12 ? "PM" : "AM", i = n % 12 || 12, l = String(o).padStart(2, "0");
|
|
3552
|
+
return `${i}:${l} ${a}`;
|
|
3468
3553
|
}
|
|
3469
3554
|
function er(t) {
|
|
3470
3555
|
const n = st(t.startDate), o = st(t.endDate);
|
|
@@ -3475,7 +3560,7 @@ function tr(t) {
|
|
|
3475
3560
|
return t.getFullYear() === n.getFullYear() && t.getMonth() === n.getMonth() && t.getDate() === n.getDate();
|
|
3476
3561
|
}
|
|
3477
3562
|
function nr(t) {
|
|
3478
|
-
if (
|
|
3563
|
+
if (ce(t)) return "Today";
|
|
3479
3564
|
if (tr(t)) return "Tomorrow";
|
|
3480
3565
|
const n = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], o = [
|
|
3481
3566
|
"Jan",
|
|
@@ -3490,33 +3575,33 @@ function nr(t) {
|
|
|
3490
3575
|
"Oct",
|
|
3491
3576
|
"Nov",
|
|
3492
3577
|
"Dec"
|
|
3493
|
-
],
|
|
3494
|
-
return `${
|
|
3578
|
+
], a = n[t.getDay()], i = o[t.getMonth()], l = t.getDate();
|
|
3579
|
+
return `${a}, ${i} ${l}`;
|
|
3495
3580
|
}
|
|
3496
3581
|
function rr(t, n) {
|
|
3497
3582
|
const o = /* @__PURE__ */ new Map();
|
|
3498
|
-
for (const
|
|
3499
|
-
const
|
|
3500
|
-
|
|
3583
|
+
for (const a of t) {
|
|
3584
|
+
const i = Zn(a.startDate), l = o.get(i) ?? [];
|
|
3585
|
+
l.push(a), o.set(i, l);
|
|
3501
3586
|
}
|
|
3502
|
-
return Array.from(o.entries()).map(([
|
|
3503
|
-
const
|
|
3587
|
+
return Array.from(o.entries()).map(([a, i]) => {
|
|
3588
|
+
const l = [...i].sort(
|
|
3504
3589
|
(h, d) => h.startDate.getTime() - d.startDate.getTime()
|
|
3505
|
-
),
|
|
3590
|
+
), p = n > 0 ? l.slice(0, n) : l;
|
|
3506
3591
|
return {
|
|
3507
|
-
date: new Date(
|
|
3508
|
-
dateKey:
|
|
3509
|
-
events:
|
|
3510
|
-
hasMore: n > 0 &&
|
|
3592
|
+
date: new Date(a),
|
|
3593
|
+
dateKey: a,
|
|
3594
|
+
events: p,
|
|
3595
|
+
hasMore: n > 0 && l.length > n
|
|
3511
3596
|
};
|
|
3512
|
-
}).sort((
|
|
3597
|
+
}).sort((a, i) => a.date.getTime() - i.date.getTime());
|
|
3513
3598
|
}
|
|
3514
3599
|
function or(t) {
|
|
3515
3600
|
const n = Pe(/* @__PURE__ */ new Date()), o = ut(/* @__PURE__ */ new Date());
|
|
3516
|
-
return t.filter((
|
|
3601
|
+
return t.filter((a) => a.startDate >= n && a.startDate <= o).length;
|
|
3517
3602
|
}
|
|
3518
3603
|
function Be({ className: t }) {
|
|
3519
|
-
return /* @__PURE__ */ e("div", { className:
|
|
3604
|
+
return /* @__PURE__ */ e("div", { className: g("animate-pulse rounded-md bg-muted", t) });
|
|
3520
3605
|
}
|
|
3521
3606
|
function sr({ event: t, onClick: n }) {
|
|
3522
3607
|
return /* @__PURE__ */ r(
|
|
@@ -3524,7 +3609,7 @@ function sr({ event: t, onClick: n }) {
|
|
|
3524
3609
|
{
|
|
3525
3610
|
type: "button",
|
|
3526
3611
|
onClick: () => n?.(t),
|
|
3527
|
-
className:
|
|
3612
|
+
className: g(
|
|
3528
3613
|
"w-full text-left rounded-lg transition-colors",
|
|
3529
3614
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3530
3615
|
"flex items-start gap-3 p-2"
|
|
@@ -3549,7 +3634,7 @@ function sr({ event: t, onClick: n }) {
|
|
|
3549
3634
|
function ar({ group: t, onEventClick: n }) {
|
|
3550
3635
|
return /* @__PURE__ */ r("div", { className: "space-y-1", children: [
|
|
3551
3636
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between px-2 py-1.5", children: [
|
|
3552
|
-
/* @__PURE__ */ e("h3", { className:
|
|
3637
|
+
/* @__PURE__ */ e("h3", { className: g("text-xs font-semibold", ce(t.date) && "text-primary"), children: nr(t.date) }),
|
|
3553
3638
|
t.hasMore && /* @__PURE__ */ r("span", { className: "text-[10px] text-muted-foreground", children: [
|
|
3554
3639
|
"+",
|
|
3555
3640
|
t.events.length,
|
|
@@ -3559,42 +3644,42 @@ function ar({ group: t, onEventClick: n }) {
|
|
|
3559
3644
|
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((o) => /* @__PURE__ */ e(sr, { event: o, onClick: n }, o.id)) })
|
|
3560
3645
|
] });
|
|
3561
3646
|
}
|
|
3562
|
-
function
|
|
3647
|
+
function Ir({
|
|
3563
3648
|
events: t,
|
|
3564
3649
|
isLoading: n = !1,
|
|
3565
3650
|
className: o,
|
|
3566
|
-
daysAhead:
|
|
3567
|
-
maxEventsPerDay:
|
|
3568
|
-
onEventClick:
|
|
3569
|
-
onNavigateToAgenda:
|
|
3651
|
+
daysAhead: a = 7,
|
|
3652
|
+
maxEventsPerDay: i = 3,
|
|
3653
|
+
onEventClick: l,
|
|
3654
|
+
onNavigateToAgenda: p
|
|
3570
3655
|
}) {
|
|
3571
|
-
const [h, d] =
|
|
3572
|
-
const P = Pe(/* @__PURE__ */ new Date()), W = ht(P,
|
|
3573
|
-
return t.filter((
|
|
3574
|
-
}, [t,
|
|
3575
|
-
() => rr(
|
|
3576
|
-
[
|
|
3577
|
-
),
|
|
3578
|
-
d(!1),
|
|
3579
|
-
},
|
|
3580
|
-
d(!1),
|
|
3656
|
+
const [h, d] = ie(!1), v = Q(() => {
|
|
3657
|
+
const P = Pe(/* @__PURE__ */ new Date()), W = ht(P, a);
|
|
3658
|
+
return t.filter((T) => T.endDate >= P && T.startDate < W);
|
|
3659
|
+
}, [t, a]), b = Q(
|
|
3660
|
+
() => rr(v, i),
|
|
3661
|
+
[v, i]
|
|
3662
|
+
), w = Q(() => or(t), [t]), A = (P) => {
|
|
3663
|
+
d(!1), l?.(P);
|
|
3664
|
+
}, $ = () => {
|
|
3665
|
+
d(!1), p?.();
|
|
3581
3666
|
};
|
|
3582
3667
|
return /* @__PURE__ */ r(lt, { open: h, onOpenChange: d, children: [
|
|
3583
3668
|
/* @__PURE__ */ r(
|
|
3584
3669
|
ct,
|
|
3585
3670
|
{
|
|
3586
|
-
className:
|
|
3671
|
+
className: g(
|
|
3587
3672
|
"relative rounded-xl hover:text-zinc-700 hover:!bg-zinc-300 !bg-zinc-200 text-zinc-600 shadow-none !px-2.5 p-2 max-h-10",
|
|
3588
3673
|
o
|
|
3589
3674
|
),
|
|
3590
3675
|
children: [
|
|
3591
3676
|
/* @__PURE__ */ e(Jn, { className: "h-4 w-4" }),
|
|
3592
|
-
|
|
3677
|
+
w > 0 && /* @__PURE__ */ e(
|
|
3593
3678
|
Et,
|
|
3594
3679
|
{
|
|
3595
3680
|
variant: "destructive",
|
|
3596
3681
|
className: "absolute -right-4 -top-4 m-3 flex h-5 w-5 items-center justify-center rounded-full bg-primary p-0 text-[10px] font-medium hover:bg-primary",
|
|
3597
|
-
children:
|
|
3682
|
+
children: w > 99 ? "99+" : w
|
|
3598
3683
|
}
|
|
3599
3684
|
)
|
|
3600
3685
|
]
|
|
@@ -3604,13 +3689,13 @@ function zr({
|
|
|
3604
3689
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between border-b p-4", children: [
|
|
3605
3690
|
/* @__PURE__ */ r("div", { children: [
|
|
3606
3691
|
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold", children: "Upcoming" }),
|
|
3607
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children:
|
|
3692
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: w > 0 ? `${w} event${w > 1 ? "s" : ""} today` : "No events today" })
|
|
3608
3693
|
] }),
|
|
3609
|
-
|
|
3694
|
+
p && /* @__PURE__ */ r(
|
|
3610
3695
|
"button",
|
|
3611
3696
|
{
|
|
3612
3697
|
type: "button",
|
|
3613
|
-
onClick:
|
|
3698
|
+
onClick: $,
|
|
3614
3699
|
className: "text-xs text-primary hover:underline flex items-center gap-1",
|
|
3615
3700
|
children: [
|
|
3616
3701
|
"View all",
|
|
@@ -3625,19 +3710,19 @@ function zr({
|
|
|
3625
3710
|
/* @__PURE__ */ e(Be, { className: "h-4 w-full" }),
|
|
3626
3711
|
/* @__PURE__ */ e(Be, { className: "h-3 w-3/4" })
|
|
3627
3712
|
] })
|
|
3628
|
-
] }, W)) }) :
|
|
3713
|
+
] }, W)) }) : b.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-8 text-center", children: [
|
|
3629
3714
|
/* @__PURE__ */ e(qn, { className: "mb-2 h-8 w-8 text-muted-foreground/50" }),
|
|
3630
3715
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "No upcoming events" }),
|
|
3631
3716
|
/* @__PURE__ */ r("p", { className: "text-xs text-muted-foreground/70", children: [
|
|
3632
3717
|
"Your schedule is clear for the next ",
|
|
3633
|
-
|
|
3718
|
+
a,
|
|
3634
3719
|
" days"
|
|
3635
3720
|
] })
|
|
3636
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-3 divide-y", children:
|
|
3721
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-3 divide-y", children: b.map((P) => /* @__PURE__ */ e(
|
|
3637
3722
|
ar,
|
|
3638
3723
|
{
|
|
3639
3724
|
group: P,
|
|
3640
|
-
onEventClick:
|
|
3725
|
+
onEventClick: A
|
|
3641
3726
|
},
|
|
3642
3727
|
P.dateKey
|
|
3643
3728
|
)) }) })
|
|
@@ -3692,8 +3777,8 @@ function lr(t) {
|
|
|
3692
3777
|
return n.setDate(n.getDate() + 1), t.getFullYear() === n.getFullYear() && t.getMonth() === n.getMonth() && t.getDate() === n.getDate();
|
|
3693
3778
|
}
|
|
3694
3779
|
function at(t) {
|
|
3695
|
-
const n = t.getHours(), o = t.getMinutes(),
|
|
3696
|
-
return `${n % 12 || 12}:${o.toString().padStart(2, "0")} ${
|
|
3780
|
+
const n = t.getHours(), o = t.getMinutes(), a = n >= 12 ? "PM" : "AM";
|
|
3781
|
+
return `${n % 12 || 12}:${o.toString().padStart(2, "0")} ${a}`;
|
|
3697
3782
|
}
|
|
3698
3783
|
function cr(t) {
|
|
3699
3784
|
return new Intl.DateTimeFormat("en-US", {
|
|
@@ -3707,25 +3792,25 @@ function dr(t) {
|
|
|
3707
3792
|
return `${n} - ${o}`;
|
|
3708
3793
|
}
|
|
3709
3794
|
function ur(t) {
|
|
3710
|
-
return
|
|
3795
|
+
return ce(t) ? "Today" : lr(t) ? "Tomorrow" : cr(t);
|
|
3711
3796
|
}
|
|
3712
3797
|
function hr(t, n) {
|
|
3713
3798
|
const o = /* @__PURE__ */ new Map();
|
|
3714
|
-
for (const
|
|
3715
|
-
const
|
|
3716
|
-
|
|
3799
|
+
for (const a of t) {
|
|
3800
|
+
const i = Wt(a.startDate), l = o.get(i) ?? [];
|
|
3801
|
+
l.push(a), o.set(i, l);
|
|
3717
3802
|
}
|
|
3718
|
-
return Array.from(o.entries()).map(([
|
|
3719
|
-
const
|
|
3803
|
+
return Array.from(o.entries()).map(([a, i]) => {
|
|
3804
|
+
const l = [...i].sort(
|
|
3720
3805
|
(h, d) => h.startDate.getTime() - d.startDate.getTime()
|
|
3721
|
-
),
|
|
3806
|
+
), p = n > 0 ? l.slice(0, n) : l;
|
|
3722
3807
|
return {
|
|
3723
|
-
date: new Date(
|
|
3724
|
-
dateKey:
|
|
3725
|
-
events:
|
|
3726
|
-
hasMore: n > 0 &&
|
|
3808
|
+
date: new Date(a),
|
|
3809
|
+
dateKey: a,
|
|
3810
|
+
events: p,
|
|
3811
|
+
hasMore: n > 0 && l.length > n
|
|
3727
3812
|
};
|
|
3728
|
-
}).sort((
|
|
3813
|
+
}).sort((a, i) => a.date.getTime() - i.date.getTime());
|
|
3729
3814
|
}
|
|
3730
3815
|
function mr({ event: t, onClick: n, compact: o }) {
|
|
3731
3816
|
return /* @__PURE__ */ r(
|
|
@@ -3733,7 +3818,7 @@ function mr({ event: t, onClick: n, compact: o }) {
|
|
|
3733
3818
|
{
|
|
3734
3819
|
type: "button",
|
|
3735
3820
|
onClick: () => n?.(t),
|
|
3736
|
-
className:
|
|
3821
|
+
className: g(
|
|
3737
3822
|
"w-full text-left rounded-lg transition-colors",
|
|
3738
3823
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3739
3824
|
"flex items-start gap-3",
|
|
@@ -3743,18 +3828,18 @@ function mr({ event: t, onClick: n, compact: o }) {
|
|
|
3743
3828
|
/* @__PURE__ */ e(
|
|
3744
3829
|
"div",
|
|
3745
3830
|
{
|
|
3746
|
-
className:
|
|
3831
|
+
className: g("shrink-0 rounded-full mt-1", o ? "size-2" : "size-2.5"),
|
|
3747
3832
|
style: { backgroundColor: t.color ?? "#3b82f6" }
|
|
3748
3833
|
}
|
|
3749
3834
|
),
|
|
3750
3835
|
/* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
|
|
3751
|
-
/* @__PURE__ */ e("p", { className:
|
|
3752
|
-
/* @__PURE__ */ e("p", { className:
|
|
3836
|
+
/* @__PURE__ */ e("p", { className: g("font-medium truncate", o ? "text-xs" : "text-sm"), children: t.title }),
|
|
3837
|
+
/* @__PURE__ */ e("p", { className: g("text-muted-foreground truncate", o ? "text-[10px]" : "text-xs"), children: dr(t) })
|
|
3753
3838
|
] }),
|
|
3754
3839
|
n && /* @__PURE__ */ e(
|
|
3755
3840
|
ft,
|
|
3756
3841
|
{
|
|
3757
|
-
className:
|
|
3842
|
+
className: g("shrink-0 text-muted-foreground/50", o ? "size-3" : "size-4")
|
|
3758
3843
|
}
|
|
3759
3844
|
)
|
|
3760
3845
|
]
|
|
@@ -3765,17 +3850,17 @@ function fr({
|
|
|
3765
3850
|
group: t,
|
|
3766
3851
|
onEventClick: n,
|
|
3767
3852
|
onViewMore: o,
|
|
3768
|
-
compact:
|
|
3853
|
+
compact: a
|
|
3769
3854
|
}) {
|
|
3770
3855
|
return /* @__PURE__ */ r("div", { className: "space-y-1", children: [
|
|
3771
|
-
/* @__PURE__ */ r("div", { className:
|
|
3856
|
+
/* @__PURE__ */ r("div", { className: g("flex items-center justify-between px-2", a ? "py-1" : "py-1.5"), children: [
|
|
3772
3857
|
/* @__PURE__ */ e(
|
|
3773
3858
|
"h3",
|
|
3774
3859
|
{
|
|
3775
|
-
className:
|
|
3860
|
+
className: g(
|
|
3776
3861
|
"font-semibold",
|
|
3777
|
-
|
|
3778
|
-
|
|
3862
|
+
a ? "text-xs" : "text-sm",
|
|
3863
|
+
ce(t.date) && "text-primary"
|
|
3779
3864
|
),
|
|
3780
3865
|
children: ur(t.date)
|
|
3781
3866
|
}
|
|
@@ -3785,92 +3870,92 @@ function fr({
|
|
|
3785
3870
|
{
|
|
3786
3871
|
type: "button",
|
|
3787
3872
|
onClick: () => o(t.date),
|
|
3788
|
-
className:
|
|
3873
|
+
className: g("text-primary hover:underline", a ? "text-[10px]" : "text-xs"),
|
|
3789
3874
|
children: "+more"
|
|
3790
3875
|
}
|
|
3791
3876
|
)
|
|
3792
3877
|
] }),
|
|
3793
|
-
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((
|
|
3878
|
+
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((i) => /* @__PURE__ */ e(mr, { event: i, onClick: n, compact: a }, i.id)) })
|
|
3794
3879
|
] });
|
|
3795
3880
|
}
|
|
3796
3881
|
function jr({
|
|
3797
3882
|
events: t,
|
|
3798
3883
|
daysAhead: n = 7,
|
|
3799
3884
|
maxEventsPerDay: o = 3,
|
|
3800
|
-
onEventClick:
|
|
3801
|
-
onViewAll:
|
|
3802
|
-
className:
|
|
3803
|
-
emptyState:
|
|
3885
|
+
onEventClick: a,
|
|
3886
|
+
onViewAll: i,
|
|
3887
|
+
className: l,
|
|
3888
|
+
emptyState: p,
|
|
3804
3889
|
title: h = "Upcoming",
|
|
3805
3890
|
showHeader: d = !0,
|
|
3806
|
-
compact:
|
|
3891
|
+
compact: v = !1
|
|
3807
3892
|
}) {
|
|
3808
|
-
const
|
|
3809
|
-
const y = Pe(
|
|
3810
|
-
return
|
|
3811
|
-
}, [
|
|
3893
|
+
const b = it(), w = b?.filteredEvents, A = b?.currentDate ?? /* @__PURE__ */ new Date(), $ = t ?? w ?? [], P = Q(() => {
|
|
3894
|
+
const y = Pe(A), z = new Date(y);
|
|
3895
|
+
return z.setDate(z.getDate() + n), $.filter((O) => O.endDate >= y && O.startDate < z);
|
|
3896
|
+
}, [$, n, A]), W = Q(
|
|
3812
3897
|
() => hr(P, o),
|
|
3813
3898
|
[P, o]
|
|
3814
|
-
),
|
|
3815
|
-
return W.length === 0 ? /* @__PURE__ */ r("div", { className:
|
|
3899
|
+
), T = P.length;
|
|
3900
|
+
return W.length === 0 ? /* @__PURE__ */ r("div", { className: g("rounded-lg border bg-card", l), children: [
|
|
3816
3901
|
d && /* @__PURE__ */ e(
|
|
3817
3902
|
"div",
|
|
3818
3903
|
{
|
|
3819
|
-
className:
|
|
3904
|
+
className: g(
|
|
3820
3905
|
"border-b px-4 flex items-center justify-between",
|
|
3821
|
-
|
|
3906
|
+
v ? "py-2" : "py-3"
|
|
3822
3907
|
),
|
|
3823
|
-
children: /* @__PURE__ */ e("h2", { className:
|
|
3908
|
+
children: /* @__PURE__ */ e("h2", { className: g("font-semibold", v ? "text-sm" : "text-base"), children: h })
|
|
3824
3909
|
}
|
|
3825
3910
|
),
|
|
3826
3911
|
/* @__PURE__ */ e(
|
|
3827
3912
|
"div",
|
|
3828
3913
|
{
|
|
3829
|
-
className:
|
|
3914
|
+
className: g(
|
|
3830
3915
|
"flex flex-col items-center justify-center text-center",
|
|
3831
|
-
|
|
3916
|
+
v ? "py-6 px-4" : "py-10 px-6"
|
|
3832
3917
|
),
|
|
3833
|
-
children:
|
|
3918
|
+
children: p ?? /* @__PURE__ */ r(we, { children: [
|
|
3834
3919
|
/* @__PURE__ */ e(
|
|
3835
3920
|
ir,
|
|
3836
3921
|
{
|
|
3837
|
-
className:
|
|
3922
|
+
className: g("text-muted-foreground/50 mb-2", v ? "size-8" : "size-10")
|
|
3838
3923
|
}
|
|
3839
3924
|
),
|
|
3840
|
-
/* @__PURE__ */ e("p", { className:
|
|
3925
|
+
/* @__PURE__ */ e("p", { className: g("text-muted-foreground", v ? "text-xs" : "text-sm"), children: "No upcoming events" })
|
|
3841
3926
|
] })
|
|
3842
3927
|
}
|
|
3843
3928
|
)
|
|
3844
|
-
] }) : /* @__PURE__ */ r("div", { className:
|
|
3929
|
+
] }) : /* @__PURE__ */ r("div", { className: g("rounded-lg border bg-card overflow-hidden", l), children: [
|
|
3845
3930
|
d && /* @__PURE__ */ r(
|
|
3846
3931
|
"div",
|
|
3847
3932
|
{
|
|
3848
|
-
className:
|
|
3933
|
+
className: g(
|
|
3849
3934
|
"border-b px-4 flex items-center justify-between",
|
|
3850
|
-
|
|
3935
|
+
v ? "py-2" : "py-3"
|
|
3851
3936
|
),
|
|
3852
3937
|
children: [
|
|
3853
3938
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
3854
|
-
/* @__PURE__ */ e("h2", { className:
|
|
3939
|
+
/* @__PURE__ */ e("h2", { className: g("font-semibold", v ? "text-sm" : "text-base"), children: h }),
|
|
3855
3940
|
/* @__PURE__ */ e(
|
|
3856
3941
|
"span",
|
|
3857
3942
|
{
|
|
3858
|
-
className:
|
|
3943
|
+
className: g(
|
|
3859
3944
|
"text-muted-foreground bg-muted rounded-full px-2",
|
|
3860
|
-
|
|
3945
|
+
v ? "text-[10px] py-0" : "text-xs py-0.5"
|
|
3861
3946
|
),
|
|
3862
|
-
children:
|
|
3947
|
+
children: T
|
|
3863
3948
|
}
|
|
3864
3949
|
)
|
|
3865
3950
|
] }),
|
|
3866
|
-
|
|
3951
|
+
i && /* @__PURE__ */ r(
|
|
3867
3952
|
"button",
|
|
3868
3953
|
{
|
|
3869
3954
|
type: "button",
|
|
3870
|
-
onClick: () =>
|
|
3871
|
-
className:
|
|
3955
|
+
onClick: () => i(),
|
|
3956
|
+
className: g(
|
|
3872
3957
|
"text-primary hover:underline flex items-center gap-0.5",
|
|
3873
|
-
|
|
3958
|
+
v ? "text-xs" : "text-sm"
|
|
3874
3959
|
),
|
|
3875
3960
|
children: [
|
|
3876
3961
|
"View all",
|
|
@@ -3884,17 +3969,17 @@ function jr({
|
|
|
3884
3969
|
/* @__PURE__ */ e(
|
|
3885
3970
|
"div",
|
|
3886
3971
|
{
|
|
3887
|
-
className:
|
|
3972
|
+
className: g(
|
|
3888
3973
|
"divide-y overflow-auto",
|
|
3889
|
-
|
|
3974
|
+
v ? "p-2 max-h-[280px]" : "p-3 max-h-[400px]"
|
|
3890
3975
|
),
|
|
3891
3976
|
children: W.map((y) => /* @__PURE__ */ e(
|
|
3892
3977
|
fr,
|
|
3893
3978
|
{
|
|
3894
3979
|
group: y,
|
|
3895
|
-
onEventClick:
|
|
3896
|
-
onViewMore:
|
|
3897
|
-
compact:
|
|
3980
|
+
onEventClick: a,
|
|
3981
|
+
onViewMore: i ? (z) => i(z) : void 0,
|
|
3982
|
+
compact: v
|
|
3898
3983
|
},
|
|
3899
3984
|
y.dateKey
|
|
3900
3985
|
))
|
|
@@ -3903,20 +3988,20 @@ function jr({
|
|
|
3903
3988
|
] });
|
|
3904
3989
|
}
|
|
3905
3990
|
export {
|
|
3906
|
-
|
|
3991
|
+
Ir as A,
|
|
3907
3992
|
Mr as B,
|
|
3908
3993
|
kr as C,
|
|
3909
3994
|
Lr as D,
|
|
3910
3995
|
Nr as E,
|
|
3911
|
-
|
|
3996
|
+
Cr as I,
|
|
3912
3997
|
Hr as S,
|
|
3913
3998
|
Le as T,
|
|
3914
|
-
|
|
3999
|
+
zr as U,
|
|
3915
4000
|
Sr as V,
|
|
3916
4001
|
Er as W,
|
|
3917
4002
|
gn as Y,
|
|
3918
4003
|
jr as a,
|
|
3919
4004
|
Tr as b,
|
|
3920
|
-
|
|
4005
|
+
Dr as c
|
|
3921
4006
|
};
|
|
3922
|
-
//# sourceMappingURL=agenda-widget-
|
|
4007
|
+
//# sourceMappingURL=agenda-widget-wrZfO67A.js.map
|