@innosolutions/inno-calendar 1.0.49 → 1.0.50
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 +1288 -359
- package/dist/agenda-widget-WpqvlAJP.cjs +2 -0
- package/dist/agenda-widget-WpqvlAJP.cjs.map +1 -0
- package/dist/{agenda-widget-DhCPt2vI.js → agenda-widget-ssrwyMvF.js} +1245 -1182
- package/dist/agenda-widget-ssrwyMvF.js.map +1 -0
- package/dist/components/event/event-card.d.ts +21 -2
- package/dist/components/event/event-card.d.ts.map +1 -1
- package/dist/components/header/calendar-header.d.ts +10 -2
- package/dist/components/header/calendar-header.d.ts.map +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.mjs +49 -35
- package/dist/components/inno-calendar.d.ts +45 -2
- package/dist/components/inno-calendar.d.ts.map +1 -1
- package/dist/components/ui/dialog.d.ts +35 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/index.d.ts +2 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/sheet.d.ts +35 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/views/timeline-view.d.ts +10 -1
- package/dist/components/views/timeline-view.d.ts.map +1 -1
- package/dist/core/context/drag-drop-context.d.ts +7 -1
- package/dist/core/context/drag-drop-context.d.ts.map +1 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.mjs +1 -1
- package/dist/core/types.d.ts +81 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +206 -192
- package/dist/presets/index.cjs +1 -1
- package/dist/presets/index.mjs +1 -1
- package/dist/{slot-selection-context-D1495hEJ.js → slot-selection-context-BwghpxKA.js} +233 -231
- package/dist/slot-selection-context-BwghpxKA.js.map +1 -0
- package/dist/slot-selection-context-CHSaOPWP.cjs +2 -0
- package/dist/slot-selection-context-CHSaOPWP.cjs.map +1 -0
- package/dist/{tailwind-calendar-BmJa4HhQ.js → tailwind-calendar-Ctfffnbn.js} +2 -2
- package/dist/{tailwind-calendar-BmJa4HhQ.js.map → tailwind-calendar-Ctfffnbn.js.map} +1 -1
- package/dist/{tailwind-calendar-CJmOutn1.cjs → tailwind-calendar-Gy1Uc9ZK.cjs} +2 -2
- package/dist/{tailwind-calendar-CJmOutn1.cjs.map → tailwind-calendar-Gy1Uc9ZK.cjs.map} +1 -1
- package/dist/week-view-ITRsM6y1.cjs +11 -0
- package/dist/week-view-ITRsM6y1.cjs.map +1 -0
- package/dist/{week-view-aRPB2cjn.js → week-view-vnIcmoVr.js} +1564 -1405
- package/dist/week-view-vnIcmoVr.js.map +1 -0
- package/package.json +2 -1
- package/dist/agenda-widget-B-AVTnqM.cjs +0 -2
- package/dist/agenda-widget-B-AVTnqM.cjs.map +0 -1
- package/dist/agenda-widget-DhCPt2vI.js.map +0 -1
- package/dist/slot-selection-context-BCsC7WT7.cjs +0 -2
- package/dist/slot-selection-context-BCsC7WT7.cjs.map +0 -1
- package/dist/slot-selection-context-D1495hEJ.js.map +0 -1
- package/dist/week-view-D19YRBQC.cjs +0 -11
- package/dist/week-view-D19YRBQC.cjs.map +0 -1
- package/dist/week-view-aRPB2cjn.js.map +0 -1
|
@@ -1,39 +1,245 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
4
|
-
import { c, a as
|
|
1
|
+
import { jsxs as o, jsx as e, Fragment as kt } from "react/jsx-runtime";
|
|
2
|
+
import * as Y from "react";
|
|
3
|
+
import { forwardRef as Pe, createElement as $e, useState as Q, useEffect as Ne, useCallback as z, useRef as ne, useMemo as q, useLayoutEffect as je } from "react";
|
|
4
|
+
import { c as l, a as Dt } from "./index-DtaLkIY8.js";
|
|
5
5
|
import * as K from "@radix-ui/react-dropdown-menu";
|
|
6
|
-
import { formatEventTimeDisplay as
|
|
7
|
-
import { j as
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
import { formatEventTimeDisplay as J, getEventsCountInView as Ct, getRangeText as St, groupEventsByDate as Mt, isToday as ce, detectAllDayEvent as Te, isSameDay as se, getEventsForDay as Fe, separateEventsByDuration as it, calculateOverlappingPositions as st, getVisibleHoursArray as lt, isWorkingHour as dt, formatHourLabel as ze, generateMonthGrid as Tt, startOfDay as Ke, getWeekDays as zt } from "./utils.mjs";
|
|
7
|
+
import { j as Ve, k as ct, l as Ge } from "./slot-selection-context-BwghpxKA.js";
|
|
8
|
+
import * as V from "@radix-ui/react-dialog";
|
|
9
|
+
import * as ge from "@radix-ui/react-popover";
|
|
10
|
+
import * as ke from "@radix-ui/react-tooltip";
|
|
11
|
+
const ut = (...t) => t.filter((n, r, a) => !!n && n.trim() !== "" && a.indexOf(n) === r).join(" ").trim();
|
|
12
|
+
const Wt = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
13
|
+
const At = (t) => t.replace(
|
|
14
|
+
/^([A-Z])|[\s-_]+(\w)/g,
|
|
15
|
+
(n, r, a) => a ? a.toUpperCase() : r.toLowerCase()
|
|
16
|
+
);
|
|
17
|
+
const Xe = (t) => {
|
|
18
|
+
const n = At(t);
|
|
19
|
+
return n.charAt(0).toUpperCase() + n.slice(1);
|
|
20
|
+
};
|
|
21
|
+
var Lt = {
|
|
22
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
23
|
+
width: 24,
|
|
24
|
+
height: 24,
|
|
25
|
+
viewBox: "0 0 24 24",
|
|
26
|
+
fill: "none",
|
|
27
|
+
stroke: "currentColor",
|
|
28
|
+
strokeWidth: 2,
|
|
29
|
+
strokeLinecap: "round",
|
|
30
|
+
strokeLinejoin: "round"
|
|
31
|
+
};
|
|
32
|
+
const Et = (t) => {
|
|
33
|
+
for (const n in t)
|
|
34
|
+
if (n.startsWith("aria-") || n === "role" || n === "title")
|
|
35
|
+
return !0;
|
|
36
|
+
return !1;
|
|
37
|
+
};
|
|
38
|
+
const _t = Pe(
|
|
39
|
+
({
|
|
40
|
+
color: t = "currentColor",
|
|
41
|
+
size: n = 24,
|
|
42
|
+
strokeWidth: r = 2,
|
|
43
|
+
absoluteStrokeWidth: a,
|
|
44
|
+
className: i = "",
|
|
45
|
+
children: h,
|
|
46
|
+
iconNode: s,
|
|
47
|
+
...y
|
|
48
|
+
}, k) => $e(
|
|
49
|
+
"svg",
|
|
50
|
+
{
|
|
51
|
+
ref: k,
|
|
52
|
+
...Lt,
|
|
53
|
+
width: n,
|
|
54
|
+
height: n,
|
|
55
|
+
stroke: t,
|
|
56
|
+
strokeWidth: a ? Number(r) * 24 / Number(n) : r,
|
|
57
|
+
className: ut("lucide", i),
|
|
58
|
+
...!h && !Et(y) && { "aria-hidden": "true" },
|
|
59
|
+
...y
|
|
60
|
+
},
|
|
61
|
+
[
|
|
62
|
+
...s.map(([d, b]) => $e(d, b)),
|
|
63
|
+
...Array.isArray(h) ? h : [h]
|
|
64
|
+
]
|
|
65
|
+
)
|
|
66
|
+
);
|
|
67
|
+
const Le = (t, n) => {
|
|
68
|
+
const r = Pe(
|
|
69
|
+
({ className: a, ...i }, h) => $e(_t, {
|
|
70
|
+
ref: h,
|
|
71
|
+
iconNode: n,
|
|
72
|
+
className: ut(
|
|
73
|
+
`lucide-${Wt(Xe(t))}`,
|
|
74
|
+
`lucide-${t}`,
|
|
75
|
+
a
|
|
76
|
+
),
|
|
77
|
+
...i
|
|
78
|
+
})
|
|
79
|
+
);
|
|
80
|
+
return r.displayName = Xe(t), r;
|
|
81
|
+
};
|
|
82
|
+
const It = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], Bt = Le("check", It);
|
|
83
|
+
const $t = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Rt = Le("chevron-right", $t);
|
|
84
|
+
const Ht = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]], Ot = Le("circle", Ht);
|
|
85
|
+
const Pt = [
|
|
86
|
+
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
87
|
+
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
88
|
+
], mt = Le("x", Pt), jt = V.Root, Ft = V.Trigger, Vt = V.Portal, Vn = V.Close, ht = Y.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ e(
|
|
89
|
+
V.Overlay,
|
|
90
|
+
{
|
|
91
|
+
ref: r,
|
|
92
|
+
className: l(
|
|
93
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
94
|
+
t
|
|
95
|
+
),
|
|
96
|
+
...n
|
|
97
|
+
}
|
|
98
|
+
));
|
|
99
|
+
ht.displayName = V.Overlay.displayName;
|
|
100
|
+
const pt = Y.forwardRef(({ className: t, children: n, ...r }, a) => /* @__PURE__ */ o(Vt, { children: [
|
|
101
|
+
/* @__PURE__ */ e(ht, {}),
|
|
102
|
+
/* @__PURE__ */ o(
|
|
103
|
+
V.Content,
|
|
104
|
+
{
|
|
105
|
+
ref: a,
|
|
106
|
+
className: l(
|
|
107
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",
|
|
108
|
+
t
|
|
109
|
+
),
|
|
110
|
+
...r,
|
|
111
|
+
children: [
|
|
112
|
+
n,
|
|
113
|
+
/* @__PURE__ */ o(V.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
114
|
+
/* @__PURE__ */ e(mt, { className: "size-4" }),
|
|
115
|
+
/* @__PURE__ */ e("span", { className: "sr-only", children: "Close" })
|
|
116
|
+
] })
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
] }));
|
|
121
|
+
pt.displayName = V.Content.displayName;
|
|
122
|
+
const Gt = ({
|
|
123
|
+
className: t,
|
|
124
|
+
...n
|
|
125
|
+
}) => /* @__PURE__ */ e(
|
|
126
|
+
"div",
|
|
127
|
+
{
|
|
128
|
+
className: l("flex flex-col space-y-1.5 text-center sm:text-left", t),
|
|
129
|
+
...n
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
Gt.displayName = "DialogHeader";
|
|
133
|
+
const Ut = Y.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ e(
|
|
134
|
+
V.Title,
|
|
135
|
+
{
|
|
136
|
+
ref: r,
|
|
137
|
+
className: l("text-lg font-semibold leading-none tracking-tight", t),
|
|
138
|
+
...n
|
|
139
|
+
}
|
|
140
|
+
));
|
|
141
|
+
Ut.displayName = V.Title.displayName;
|
|
142
|
+
const qt = Y.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ e(
|
|
143
|
+
V.Description,
|
|
144
|
+
{
|
|
145
|
+
ref: r,
|
|
146
|
+
className: l("text-sm text-muted-foreground", t),
|
|
147
|
+
...n
|
|
148
|
+
}
|
|
149
|
+
));
|
|
150
|
+
qt.displayName = V.Description.displayName;
|
|
151
|
+
const ue = ge.Root, me = ge.Trigger, Gn = ge.Anchor, le = Y.forwardRef(({ className: t, align: n = "center", sideOffset: r = 4, ...a }, i) => /* @__PURE__ */ e(ge.Portal, { children: /* @__PURE__ */ e(
|
|
152
|
+
ge.Content,
|
|
12
153
|
{
|
|
13
154
|
ref: i,
|
|
14
155
|
align: n,
|
|
15
|
-
sideOffset:
|
|
16
|
-
className:
|
|
156
|
+
sideOffset: r,
|
|
157
|
+
className: l(
|
|
17
158
|
"z-50 w-72 rounded-xl border bg-white text-popover-foreground outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
18
159
|
t
|
|
19
160
|
),
|
|
20
161
|
...a
|
|
21
162
|
}
|
|
22
163
|
) }));
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
164
|
+
le.displayName = ge.Content.displayName;
|
|
165
|
+
const Kt = V.Root, Xt = V.Trigger, Un = V.Close, Yt = V.Portal, ft = Y.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ e(
|
|
166
|
+
V.Overlay,
|
|
167
|
+
{
|
|
168
|
+
className: l(
|
|
169
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
170
|
+
t
|
|
171
|
+
),
|
|
172
|
+
...n,
|
|
173
|
+
ref: r
|
|
174
|
+
}
|
|
175
|
+
));
|
|
176
|
+
ft.displayName = V.Overlay.displayName;
|
|
177
|
+
const gt = Y.forwardRef(({ className: t, children: n, ...r }, a) => /* @__PURE__ */ o(Yt, { children: [
|
|
178
|
+
/* @__PURE__ */ e(ft, {}),
|
|
179
|
+
/* @__PURE__ */ o(
|
|
180
|
+
V.Content,
|
|
181
|
+
{
|
|
182
|
+
ref: a,
|
|
183
|
+
className: l(
|
|
184
|
+
"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
185
|
+
// Right-side slide
|
|
186
|
+
"inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right",
|
|
187
|
+
t
|
|
188
|
+
),
|
|
189
|
+
...r,
|
|
190
|
+
children: [
|
|
191
|
+
n,
|
|
192
|
+
/* @__PURE__ */ o(V.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
|
|
193
|
+
/* @__PURE__ */ e(mt, { className: "size-4" }),
|
|
194
|
+
/* @__PURE__ */ e("span", { className: "sr-only", children: "Close" })
|
|
195
|
+
] })
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
)
|
|
199
|
+
] }));
|
|
200
|
+
gt.displayName = "SheetContent";
|
|
201
|
+
const Jt = ({
|
|
202
|
+
className: t,
|
|
203
|
+
...n
|
|
204
|
+
}) => /* @__PURE__ */ e(
|
|
205
|
+
"div",
|
|
206
|
+
{
|
|
207
|
+
className: l("flex flex-col space-y-2 text-center sm:text-left", t),
|
|
208
|
+
...n
|
|
209
|
+
}
|
|
210
|
+
);
|
|
211
|
+
Jt.displayName = "SheetHeader";
|
|
212
|
+
const Zt = Y.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ e(
|
|
213
|
+
V.Title,
|
|
214
|
+
{
|
|
215
|
+
ref: r,
|
|
216
|
+
className: l("text-lg font-semibold text-foreground", t),
|
|
217
|
+
...n
|
|
218
|
+
}
|
|
219
|
+
));
|
|
220
|
+
Zt.displayName = V.Title.displayName;
|
|
221
|
+
const Qt = Y.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ e(
|
|
222
|
+
V.Description,
|
|
223
|
+
{
|
|
224
|
+
ref: r,
|
|
225
|
+
className: l("text-sm text-muted-foreground", t),
|
|
226
|
+
...n
|
|
227
|
+
}
|
|
228
|
+
));
|
|
229
|
+
Qt.displayName = V.Description.displayName;
|
|
230
|
+
const qn = ke.Provider, ae = ke.Root, ie = ke.Trigger, re = Y.forwardRef(({ className: t, sideOffset: n = 4, ...r }, a) => /* @__PURE__ */ e(
|
|
231
|
+
ke.Content,
|
|
26
232
|
{
|
|
27
233
|
ref: a,
|
|
28
234
|
sideOffset: n,
|
|
29
|
-
className:
|
|
235
|
+
className: l(
|
|
30
236
|
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
31
237
|
t
|
|
32
238
|
),
|
|
33
|
-
...
|
|
239
|
+
...r
|
|
34
240
|
}
|
|
35
241
|
));
|
|
36
|
-
re.displayName =
|
|
242
|
+
re.displayName = ke.Content.displayName;
|
|
37
243
|
function de(t) {
|
|
38
244
|
return {
|
|
39
245
|
blue: {
|
|
@@ -118,118 +324,139 @@ function de(t) {
|
|
|
118
324
|
}
|
|
119
325
|
}[t ?? "blue"];
|
|
120
326
|
}
|
|
121
|
-
function
|
|
327
|
+
function xt(t) {
|
|
122
328
|
const n = new Date(t);
|
|
123
329
|
return n.setHours(0, 0, 0, 0), n;
|
|
124
330
|
}
|
|
125
|
-
function
|
|
331
|
+
function We({
|
|
126
332
|
event: t,
|
|
127
333
|
variant: n = "full",
|
|
128
|
-
badgeVariant:
|
|
334
|
+
badgeVariant: r = "colored",
|
|
129
335
|
onClick: a,
|
|
130
336
|
className: i,
|
|
131
|
-
showTime:
|
|
337
|
+
showTime: h = !0,
|
|
132
338
|
showDescription: s = !1,
|
|
133
|
-
showParticipants:
|
|
134
|
-
style:
|
|
135
|
-
disablePopover:
|
|
136
|
-
renderPopover:
|
|
137
|
-
enableDrag:
|
|
138
|
-
enablePageTransition:
|
|
139
|
-
pageTransitionDuration: g = 400
|
|
339
|
+
showParticipants: y = !1,
|
|
340
|
+
style: k,
|
|
341
|
+
disablePopover: d = !1,
|
|
342
|
+
renderPopover: b,
|
|
343
|
+
enableDrag: v = !1,
|
|
344
|
+
enablePageTransition: u = !1,
|
|
345
|
+
pageTransitionDuration: g = 400,
|
|
346
|
+
eventDetailMode: p = "popover",
|
|
347
|
+
renderEventDetail: N
|
|
140
348
|
}) {
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
if (!
|
|
144
|
-
const
|
|
145
|
-
|
|
349
|
+
const f = de(t.color), [E, D] = Q(!1), [T, $] = Q(!1), [A, L] = Q(!1), [B, P] = Q(null), I = ne(null), R = Ve(), j = ct();
|
|
350
|
+
Ne(() => {
|
|
351
|
+
if (!d && j?.focusEventId && j.focusEventId === t.id) {
|
|
352
|
+
const X = setTimeout(() => {
|
|
353
|
+
D(!0), j.clearFocusEventId();
|
|
146
354
|
}, 300);
|
|
147
|
-
return () => clearTimeout(
|
|
355
|
+
return () => clearTimeout(X);
|
|
148
356
|
}
|
|
149
|
-
}, [
|
|
150
|
-
const
|
|
151
|
-
if (!
|
|
152
|
-
if (
|
|
357
|
+
}, [j?.focusEventId, t.id, d]);
|
|
358
|
+
const W = t.endDate < xt(/* @__PURE__ */ new Date()), x = t.isCanceled ?? !1, _ = v && R && !x && !W, M = t.data, F = M?.meetingTookPlace ?? t.meetingTookPlace ?? !1, w = x ? /* @__PURE__ */ e(tn, { className: "h-3 w-3 text-zinc-800 dark:text-zinc-200" }) : F ? /* @__PURE__ */ e(en, { className: l("h-3 w-3", f.text) }) : null, c = t.scheduleTypeName || M?.scheduleTypeName || M?.typeName, m = M?.productName, S = M?.nrParticipant, C = M?.siteName, H = M?.siteCity, G = [C, H].filter(Boolean).join(", "), O = z(() => {
|
|
359
|
+
if (!T) {
|
|
360
|
+
if (d && a) {
|
|
153
361
|
a(t);
|
|
154
362
|
return;
|
|
155
363
|
}
|
|
156
|
-
if (
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
} else
|
|
364
|
+
if (u && I.current) {
|
|
365
|
+
const X = I.current.getBoundingClientRect();
|
|
366
|
+
P(X), L(!0);
|
|
367
|
+
} else d || D(!0);
|
|
160
368
|
}
|
|
161
|
-
}, [
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}, [
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
}, []),
|
|
168
|
-
(
|
|
169
|
-
|
|
369
|
+
}, [T, d, a, t, u]);
|
|
370
|
+
z(() => {
|
|
371
|
+
L(!1), P(null), d || D(!0);
|
|
372
|
+
}, [d]);
|
|
373
|
+
const U = z(() => {
|
|
374
|
+
D(!1);
|
|
375
|
+
}, []), oe = z(
|
|
376
|
+
(X) => {
|
|
377
|
+
_ && (X.dataTransfer.effectAllowed = "move", X.dataTransfer.setData("text/plain", t.id), $(!0), R?.startDrag?.(t));
|
|
170
378
|
},
|
|
171
|
-
[
|
|
172
|
-
),
|
|
173
|
-
|
|
174
|
-
}, [
|
|
379
|
+
[_, t, R]
|
|
380
|
+
), Z = z(() => {
|
|
381
|
+
$(!1), R?.isDragging && R.endDrag?.();
|
|
382
|
+
}, [R]), ee = N ? N({ event: t, onClose: U }) : b ? b({ event: t, onClose: U }) : /* @__PURE__ */ e(qe, { event: t, onClose: U }), xe = (X) => {
|
|
383
|
+
switch (p) {
|
|
384
|
+
case "dialog":
|
|
385
|
+
return /* @__PURE__ */ o(jt, { open: E, onOpenChange: D, children: [
|
|
386
|
+
/* @__PURE__ */ e(Ft, { asChild: !0, children: X }),
|
|
387
|
+
/* @__PURE__ */ e(pt, { className: "sm:max-w-md", children: ee })
|
|
388
|
+
] });
|
|
389
|
+
case "sheet":
|
|
390
|
+
return /* @__PURE__ */ o(Kt, { open: E, onOpenChange: D, children: [
|
|
391
|
+
/* @__PURE__ */ e(Xt, { asChild: !0, children: X }),
|
|
392
|
+
/* @__PURE__ */ e(gt, { children: ee })
|
|
393
|
+
] });
|
|
394
|
+
case "custom":
|
|
395
|
+
return X;
|
|
396
|
+
default:
|
|
397
|
+
return /* @__PURE__ */ o(ue, { open: E, onOpenChange: D, children: [
|
|
398
|
+
/* @__PURE__ */ e(me, { asChild: !0, children: X }),
|
|
399
|
+
/* @__PURE__ */ e(le, { className: "w-80", children: ee })
|
|
400
|
+
] });
|
|
401
|
+
}
|
|
402
|
+
};
|
|
175
403
|
if (n === "dot") {
|
|
176
|
-
const
|
|
404
|
+
const X = /* @__PURE__ */ e(
|
|
177
405
|
"button",
|
|
178
406
|
{
|
|
179
407
|
type: "button",
|
|
180
|
-
onClick:
|
|
181
|
-
className:
|
|
408
|
+
onClick: O,
|
|
409
|
+
className: l(
|
|
182
410
|
"size-2 rounded-full cursor-pointer transition-opacity",
|
|
183
|
-
|
|
411
|
+
f.dot,
|
|
184
412
|
t.isCanceled && "opacity-50",
|
|
185
413
|
i
|
|
186
414
|
),
|
|
187
|
-
style:
|
|
415
|
+
style: k,
|
|
188
416
|
"aria-label": t.title
|
|
189
417
|
}
|
|
190
418
|
);
|
|
191
|
-
return
|
|
192
|
-
/* @__PURE__ */ e(
|
|
193
|
-
/* @__PURE__ */ e(re, { children: /* @__PURE__ */
|
|
419
|
+
return d ? /* @__PURE__ */ o(ae, { children: [
|
|
420
|
+
/* @__PURE__ */ e(ie, { asChild: !0, children: X }),
|
|
421
|
+
/* @__PURE__ */ e(re, { children: /* @__PURE__ */ o("div", { className: "flex flex-col gap-0.5", children: [
|
|
194
422
|
/* @__PURE__ */ e("div", { className: "font-medium", children: t.title }),
|
|
195
|
-
/* @__PURE__ */ e("div", { className: "text-xs opacity-80", children:
|
|
423
|
+
/* @__PURE__ */ e("div", { className: "text-xs opacity-80", children: J(t) })
|
|
196
424
|
] }) })
|
|
197
|
-
] }) :
|
|
198
|
-
/* @__PURE__ */
|
|
199
|
-
/* @__PURE__ */ e(
|
|
425
|
+
] }) : xe(
|
|
426
|
+
/* @__PURE__ */ o(ae, { children: [
|
|
427
|
+
/* @__PURE__ */ e(ie, { asChild: !0, children: X }),
|
|
200
428
|
/* @__PURE__ */ e(re, { children: /* @__PURE__ */ e("div", { className: "font-medium", children: t.title }) })
|
|
201
|
-
] })
|
|
202
|
-
|
|
203
|
-
] });
|
|
429
|
+
] })
|
|
430
|
+
);
|
|
204
431
|
}
|
|
205
432
|
if (n === "compact") {
|
|
206
|
-
const
|
|
433
|
+
const X = /* @__PURE__ */ o(
|
|
207
434
|
"div",
|
|
208
435
|
{
|
|
209
436
|
role: "button",
|
|
210
437
|
tabIndex: 0,
|
|
211
|
-
draggable: !!
|
|
212
|
-
onDragStart:
|
|
213
|
-
onDragEnd:
|
|
214
|
-
onClick:
|
|
215
|
-
onKeyDown: (
|
|
216
|
-
(
|
|
438
|
+
draggable: !!_,
|
|
439
|
+
onDragStart: oe,
|
|
440
|
+
onDragEnd: Z,
|
|
441
|
+
onClick: d ? O : void 0,
|
|
442
|
+
onKeyDown: (Ee) => {
|
|
443
|
+
(Ee.key === "Enter" || Ee.key === " ") && (Ee.preventDefault(), O());
|
|
217
444
|
},
|
|
218
|
-
className:
|
|
445
|
+
className: l(
|
|
219
446
|
"group flex w-full relative items-center shadow-[0_0_1px_rgba(0,0,0,0.3)] gap-0 rounded px-1.5 py-1 text-left text-xs transition-colors hover:opacity-80",
|
|
220
|
-
|
|
221
|
-
|
|
447
|
+
_ ? "cursor-grab active:cursor-grabbing" : "cursor-pointer",
|
|
448
|
+
T && "opacity-50",
|
|
222
449
|
// Cancelled events get gray background with strikethrough
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
450
|
+
x ? "bg-zinc-100 dark:bg-zinc-800 text-zinc-500 dark:text-zinc-400 line-through" : [
|
|
451
|
+
r === "colored" && [f.bg, f.text],
|
|
452
|
+
r === "mixed" && [f.bg, f.text],
|
|
453
|
+
r === "dot" && "bg-muted/50"
|
|
227
454
|
],
|
|
228
455
|
i
|
|
229
456
|
),
|
|
230
|
-
style:
|
|
457
|
+
style: k,
|
|
231
458
|
children: [
|
|
232
|
-
["dot", "mixed"].includes(
|
|
459
|
+
["dot", "mixed"].includes(r) && !x && /* @__PURE__ */ e(
|
|
233
460
|
"svg",
|
|
234
461
|
{
|
|
235
462
|
width: "8",
|
|
@@ -238,10 +465,10 @@ function Me({
|
|
|
238
465
|
className: "event-dot absolute -top-1 -left-1 shrink-0",
|
|
239
466
|
"aria-hidden": "true",
|
|
240
467
|
focusable: "false",
|
|
241
|
-
children: /* @__PURE__ */ e("circle", { cx: "4", cy: "4", r: "4", className:
|
|
468
|
+
children: /* @__PURE__ */ e("circle", { cx: "4", cy: "4", r: "4", className: f.dotFill })
|
|
242
469
|
}
|
|
243
470
|
),
|
|
244
|
-
/* @__PURE__ */ e("span", { className: "flex-1 min-w-0 overflow-hidden", children: /* @__PURE__ */
|
|
471
|
+
/* @__PURE__ */ e("span", { className: "flex-1 min-w-0 overflow-hidden", children: /* @__PURE__ */ o("span", { className: "", children: [
|
|
245
472
|
/* @__PURE__ */ e(
|
|
246
473
|
"span",
|
|
247
474
|
{
|
|
@@ -250,7 +477,7 @@ function Me({
|
|
|
250
477
|
maskImage: "linear-gradient(to right, transparent 0, black 8px, black calc(100% - 8px), transparent 100%)",
|
|
251
478
|
WebkitMaskImage: "linear-gradient(to right, transparent 0, black 8px, black calc(100% - 8px), transparent 100%)"
|
|
252
479
|
},
|
|
253
|
-
children: /* @__PURE__ */
|
|
480
|
+
children: /* @__PURE__ */ o("span", { className: "inline-flex event-marquee", children: [
|
|
254
481
|
/* @__PURE__ */ e("span", { className: "shrink-0 px-1", children: t.title }),
|
|
255
482
|
/* @__PURE__ */ e("span", { className: "shrink-0 px-1", children: "•" }),
|
|
256
483
|
/* @__PURE__ */ e("span", { "aria-hidden": "true", className: "shrink-0 px-1", children: t.title }),
|
|
@@ -261,59 +488,56 @@ function Me({
|
|
|
261
488
|
/* @__PURE__ */ e(
|
|
262
489
|
"div",
|
|
263
490
|
{
|
|
264
|
-
className:
|
|
491
|
+
className: l(
|
|
265
492
|
"w-fit mt-0.5 text-[10px] px-1 py-0.5 border border-dashed rounded-full font-medium",
|
|
266
|
-
|
|
493
|
+
f.border
|
|
267
494
|
),
|
|
268
|
-
children:
|
|
495
|
+
children: J(t)
|
|
269
496
|
}
|
|
270
497
|
)
|
|
271
498
|
] }) }),
|
|
272
|
-
/* @__PURE__ */ e("div", { className: "flex gap-0.5", children:
|
|
499
|
+
/* @__PURE__ */ e("div", { className: "flex gap-0.5", children: w })
|
|
273
500
|
]
|
|
274
501
|
}
|
|
275
502
|
);
|
|
276
|
-
return
|
|
277
|
-
/* @__PURE__ */ e(
|
|
278
|
-
/* @__PURE__ */ e(re, { children: /* @__PURE__ */
|
|
503
|
+
return d ? /* @__PURE__ */ o(ae, { children: [
|
|
504
|
+
/* @__PURE__ */ e(ie, { asChild: !0, children: X }),
|
|
505
|
+
/* @__PURE__ */ e(re, { children: /* @__PURE__ */ o("div", { className: "flex flex-col gap-0.5", children: [
|
|
279
506
|
/* @__PURE__ */ e("div", { className: "font-medium", children: t.title }),
|
|
280
|
-
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children:
|
|
507
|
+
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: J(t) })
|
|
281
508
|
] }) })
|
|
282
|
-
] }) :
|
|
283
|
-
/* @__PURE__ */ e(ae, { asChild: !0, children: P }),
|
|
284
|
-
/* @__PURE__ */ e(Q, { className: "w-80", children: y ? y({ event: t, onClose: H }) : /* @__PURE__ */ e(ye, { event: t, onClose: H }) })
|
|
285
|
-
] });
|
|
509
|
+
] }) : xe(X);
|
|
286
510
|
}
|
|
287
|
-
const
|
|
511
|
+
const ye = /* @__PURE__ */ o(
|
|
288
512
|
"button",
|
|
289
513
|
{
|
|
290
514
|
type: "button",
|
|
291
|
-
onClick:
|
|
292
|
-
className:
|
|
515
|
+
onClick: O,
|
|
516
|
+
className: l(
|
|
293
517
|
"group relative flex w-full flex-col gap-1 rounded-md border-l-[3px] px-2 py-1.5 text-left transition-all",
|
|
294
518
|
"shadow-[0_1px_3px_rgba(0,0,0,0.08)] hover:shadow-[0_2px_6px_rgba(0,0,0,0.12)]",
|
|
295
519
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
296
520
|
// Cancelled events get gray background with strikethrough
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
521
|
+
x ? "bg-zinc-100 dark:bg-zinc-800 border-l-zinc-400 dark:border-l-zinc-600 text-zinc-500 dark:text-zinc-400 line-through" : [
|
|
522
|
+
r === "colored" && [
|
|
523
|
+
f.bg,
|
|
524
|
+
f.accentBorder,
|
|
525
|
+
f.text
|
|
302
526
|
],
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
527
|
+
r === "mixed" && [
|
|
528
|
+
f.bg,
|
|
529
|
+
f.accentBorder,
|
|
530
|
+
f.text
|
|
307
531
|
],
|
|
308
|
-
|
|
532
|
+
r === "dot" && "bg-muted/50 border-l-neutral-400 dark:border-l-neutral-600"
|
|
309
533
|
],
|
|
310
534
|
i
|
|
311
535
|
),
|
|
312
|
-
style:
|
|
536
|
+
style: k,
|
|
313
537
|
children: [
|
|
314
|
-
/* @__PURE__ */
|
|
315
|
-
/* @__PURE__ */
|
|
316
|
-
["dot", "mixed"].includes(
|
|
538
|
+
/* @__PURE__ */ o("div", { className: "flex items-start justify-between gap-1", children: [
|
|
539
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-1.5 min-w-0", children: [
|
|
540
|
+
["dot", "mixed"].includes(r) && !x && /* @__PURE__ */ e(
|
|
317
541
|
"svg",
|
|
318
542
|
{
|
|
319
543
|
width: "8",
|
|
@@ -322,68 +546,65 @@ function Me({
|
|
|
322
546
|
className: "event-dot shrink-0",
|
|
323
547
|
"aria-hidden": "true",
|
|
324
548
|
focusable: "false",
|
|
325
|
-
children: /* @__PURE__ */ e("circle", { cx: "4", cy: "4", r: "4", className:
|
|
549
|
+
children: /* @__PURE__ */ e("circle", { cx: "4", cy: "4", r: "4", className: f.dotFill })
|
|
326
550
|
}
|
|
327
551
|
),
|
|
328
|
-
/* @__PURE__ */
|
|
552
|
+
/* @__PURE__ */ o(
|
|
329
553
|
"span",
|
|
330
554
|
{
|
|
331
|
-
className:
|
|
555
|
+
className: l(
|
|
332
556
|
"text-sm font-medium truncate",
|
|
333
|
-
!
|
|
334
|
-
|
|
557
|
+
!x && r !== "dot" && f.text,
|
|
558
|
+
x && "line-through"
|
|
335
559
|
),
|
|
336
560
|
children: [
|
|
337
561
|
t.title,
|
|
338
|
-
|
|
562
|
+
c && /* @__PURE__ */ o("span", { className: "font-normal opacity-75", children: [
|
|
339
563
|
" ",
|
|
340
564
|
"- ",
|
|
341
|
-
|
|
565
|
+
c
|
|
342
566
|
] })
|
|
343
567
|
]
|
|
344
568
|
}
|
|
345
569
|
)
|
|
346
570
|
] }),
|
|
347
|
-
|
|
571
|
+
w
|
|
348
572
|
] }),
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
/* @__PURE__ */ e(
|
|
352
|
-
/* @__PURE__ */
|
|
353
|
-
|
|
573
|
+
m && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground truncate", children: m }),
|
|
574
|
+
S != null && S > 0 && /* @__PURE__ */ o("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
575
|
+
/* @__PURE__ */ e(Re, { className: "h-3 w-3 shrink-0" }),
|
|
576
|
+
/* @__PURE__ */ o("span", { children: [
|
|
577
|
+
S,
|
|
354
578
|
" participant",
|
|
355
|
-
|
|
579
|
+
S !== 1 ? "s" : ""
|
|
356
580
|
] })
|
|
357
581
|
] }),
|
|
358
|
-
|
|
359
|
-
/* @__PURE__ */ e(
|
|
360
|
-
/* @__PURE__ */ e("span", { children:
|
|
582
|
+
h && /* @__PURE__ */ o("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
583
|
+
/* @__PURE__ */ e(Ue, { className: "h-3 w-3 shrink-0" }),
|
|
584
|
+
/* @__PURE__ */ e("span", { children: J(t) })
|
|
361
585
|
] }),
|
|
362
|
-
|
|
363
|
-
/* @__PURE__ */ e(
|
|
364
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
586
|
+
G && /* @__PURE__ */ o("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
587
|
+
/* @__PURE__ */ e(yt, { className: "h-3 w-3 shrink-0" }),
|
|
588
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: G })
|
|
365
589
|
] }),
|
|
366
590
|
s && t.description && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground line-clamp-2", children: t.description }),
|
|
367
|
-
|
|
368
|
-
/* @__PURE__ */ e(
|
|
369
|
-
/* @__PURE__ */ e("span", { className: "truncate", children: t.participants.map((
|
|
591
|
+
y && t.participants && t.participants.length > 0 && /* @__PURE__ */ o("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
592
|
+
/* @__PURE__ */ e(Re, { className: "h-3 w-3 shrink-0" }),
|
|
593
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: t.participants.map((X) => X.name).join(", ") })
|
|
370
594
|
] })
|
|
371
595
|
]
|
|
372
596
|
}
|
|
373
597
|
);
|
|
374
|
-
return
|
|
375
|
-
/* @__PURE__ */ e(
|
|
376
|
-
/* @__PURE__ */ e(re, { children: /* @__PURE__ */
|
|
598
|
+
return d ? /* @__PURE__ */ o(ae, { children: [
|
|
599
|
+
/* @__PURE__ */ e(ie, { asChild: !0, children: ye }),
|
|
600
|
+
/* @__PURE__ */ e(re, { children: /* @__PURE__ */ o("div", { className: "flex flex-col gap-0.5", children: [
|
|
377
601
|
/* @__PURE__ */ e("div", { className: "font-medium", children: t.title }),
|
|
378
|
-
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children:
|
|
602
|
+
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: J(t) })
|
|
379
603
|
] }) })
|
|
380
|
-
] }) :
|
|
381
|
-
/* @__PURE__ */ e(ae, { asChild: !0, children: te }),
|
|
382
|
-
/* @__PURE__ */ e(Q, { className: "w-80", children: y ? y({ event: t, onClose: H }) : /* @__PURE__ */ e(ye, { event: t, onClose: H }) })
|
|
383
|
-
] });
|
|
604
|
+
] }) : xe(ye);
|
|
384
605
|
}
|
|
385
|
-
function
|
|
386
|
-
return /* @__PURE__ */
|
|
606
|
+
function Ue({ className: t }) {
|
|
607
|
+
return /* @__PURE__ */ o(
|
|
387
608
|
"svg",
|
|
388
609
|
{
|
|
389
610
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -401,7 +622,7 @@ function je({ className: t }) {
|
|
|
401
622
|
}
|
|
402
623
|
);
|
|
403
624
|
}
|
|
404
|
-
function
|
|
625
|
+
function en({ className: t }) {
|
|
405
626
|
return /* @__PURE__ */ e(
|
|
406
627
|
"svg",
|
|
407
628
|
{
|
|
@@ -417,8 +638,8 @@ function Nt({ className: t }) {
|
|
|
417
638
|
}
|
|
418
639
|
);
|
|
419
640
|
}
|
|
420
|
-
function
|
|
421
|
-
return /* @__PURE__ */
|
|
641
|
+
function tn({ className: t }) {
|
|
642
|
+
return /* @__PURE__ */ o(
|
|
422
643
|
"svg",
|
|
423
644
|
{
|
|
424
645
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -436,8 +657,8 @@ function kt({ className: t }) {
|
|
|
436
657
|
}
|
|
437
658
|
);
|
|
438
659
|
}
|
|
439
|
-
function
|
|
440
|
-
return /* @__PURE__ */
|
|
660
|
+
function Re({ className: t }) {
|
|
661
|
+
return /* @__PURE__ */ o(
|
|
441
662
|
"svg",
|
|
442
663
|
{
|
|
443
664
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -457,8 +678,8 @@ function ze({ className: t }) {
|
|
|
457
678
|
}
|
|
458
679
|
);
|
|
459
680
|
}
|
|
460
|
-
function
|
|
461
|
-
return /* @__PURE__ */
|
|
681
|
+
function yt({ className: t }) {
|
|
682
|
+
return /* @__PURE__ */ o(
|
|
462
683
|
"svg",
|
|
463
684
|
{
|
|
464
685
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -476,33 +697,33 @@ function lt({ className: t }) {
|
|
|
476
697
|
}
|
|
477
698
|
);
|
|
478
699
|
}
|
|
479
|
-
function
|
|
700
|
+
function qe({
|
|
480
701
|
event: t,
|
|
481
702
|
onClose: n
|
|
482
703
|
}) {
|
|
483
|
-
const
|
|
484
|
-
return /* @__PURE__ */
|
|
485
|
-
/* @__PURE__ */
|
|
486
|
-
/* @__PURE__ */ e("div", { className:
|
|
487
|
-
/* @__PURE__ */
|
|
704
|
+
const r = de(t.color), a = t.isCanceled ?? !1;
|
|
705
|
+
return /* @__PURE__ */ o("div", { className: "space-y-3", children: [
|
|
706
|
+
/* @__PURE__ */ o("div", { className: "flex items-start gap-3", children: [
|
|
707
|
+
/* @__PURE__ */ e("div", { className: l("size-4 rounded shrink-0 mt-0.5", r.dot) }),
|
|
708
|
+
/* @__PURE__ */ o("div", { className: "flex-1 min-w-0", children: [
|
|
488
709
|
/* @__PURE__ */ e(
|
|
489
710
|
"h3",
|
|
490
711
|
{
|
|
491
|
-
className:
|
|
712
|
+
className: l(
|
|
492
713
|
"font-semibold text-lg",
|
|
493
714
|
a && "line-through opacity-50"
|
|
494
715
|
),
|
|
495
716
|
children: t.title
|
|
496
717
|
}
|
|
497
718
|
),
|
|
498
|
-
/* @__PURE__ */
|
|
499
|
-
/* @__PURE__ */ e(
|
|
500
|
-
/* @__PURE__ */ e("span", { className: "tabular-nums", children:
|
|
719
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-1 text-sm text-muted-foreground mt-1", children: [
|
|
720
|
+
/* @__PURE__ */ e(Ue, { className: "h-4 w-4 shrink-0" }),
|
|
721
|
+
/* @__PURE__ */ e("span", { className: "tabular-nums", children: J(t) })
|
|
501
722
|
] })
|
|
502
723
|
] })
|
|
503
724
|
] }),
|
|
504
725
|
t.description && /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: t.description }),
|
|
505
|
-
/* @__PURE__ */
|
|
726
|
+
/* @__PURE__ */ o("div", { className: "flex flex-wrap gap-1.5", children: [
|
|
506
727
|
t.isAllDay && /* @__PURE__ */ e("span", { className: "text-xs bg-muted px-2 py-0.5 rounded-full font-medium", children: "All day" }),
|
|
507
728
|
t.isRecurring && /* @__PURE__ */ e("span", { className: "text-xs bg-muted px-2 py-0.5 rounded-full font-medium", children: "Recurring" }),
|
|
508
729
|
a && /* @__PURE__ */ e("span", { className: "text-xs bg-red-100 dark:bg-red-950/30 text-red-700 dark:text-red-300 px-2 py-0.5 rounded-full font-medium", children: "Canceled" })
|
|
@@ -518,85 +739,81 @@ function ye({
|
|
|
518
739
|
) })
|
|
519
740
|
] });
|
|
520
741
|
}
|
|
521
|
-
function
|
|
742
|
+
function bt({
|
|
522
743
|
event: t,
|
|
523
744
|
position: n,
|
|
524
|
-
hourHeight:
|
|
745
|
+
hourHeight: r = 96,
|
|
525
746
|
badgeVariant: a = "colored",
|
|
526
747
|
onClick: i,
|
|
527
|
-
className:
|
|
748
|
+
className: h,
|
|
528
749
|
disablePopover: s = !1,
|
|
529
|
-
renderPopover:
|
|
530
|
-
enableDrag:
|
|
750
|
+
renderPopover: y,
|
|
751
|
+
enableDrag: k = !0
|
|
531
752
|
}) {
|
|
532
|
-
const
|
|
533
|
-
|
|
534
|
-
if (!s &&
|
|
535
|
-
const
|
|
536
|
-
|
|
753
|
+
const d = de(t.color), [b, v] = Q(!1), [u, g] = Q(!1), p = Ve(), N = ct();
|
|
754
|
+
Ne(() => {
|
|
755
|
+
if (!s && N?.focusEventId && N.focusEventId === t.id) {
|
|
756
|
+
const G = setTimeout(() => {
|
|
757
|
+
v(!0), N.clearFocusEventId();
|
|
537
758
|
}, 300);
|
|
538
|
-
return () => clearTimeout(
|
|
759
|
+
return () => clearTimeout(G);
|
|
539
760
|
}
|
|
540
|
-
}, [
|
|
541
|
-
const
|
|
542
|
-
|
|
543
|
-
}, [
|
|
544
|
-
|
|
545
|
-
}, []),
|
|
546
|
-
(
|
|
761
|
+
}, [N?.focusEventId, t.id, s]);
|
|
762
|
+
const f = (t.endDate.getTime() - t.startDate.getTime()) / (1e3 * 60), E = f / 60 * r - 8, D = t.endDate < xt(/* @__PURE__ */ new Date()), T = t.isCanceled ?? !1, $ = k && p && !T && !D, A = f < 35, L = f > 25, B = f >= 45, P = t.data, I = t.scheduleTypeName || P?.scheduleTypeName || P?.typeName, R = P?.productName, j = P?.nrParticipant, W = P?.siteName, x = P?.siteCity, _ = [W, x].filter(Boolean).join(", "), M = a === "dot", F = z(() => {
|
|
763
|
+
u || (s && i ? i(t) : s || v(!0));
|
|
764
|
+
}, [u, s, i, t]), w = z(() => {
|
|
765
|
+
v(!1);
|
|
766
|
+
}, []), c = z(
|
|
767
|
+
(G) => {
|
|
547
768
|
if (!$) return;
|
|
548
|
-
|
|
549
|
-
const
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
), g(!0),
|
|
769
|
+
G.dataTransfer.effectAllowed = "move", G.dataTransfer.setData("text/plain", t.id);
|
|
770
|
+
const O = G.currentTarget, U = O.getBoundingClientRect();
|
|
771
|
+
G.dataTransfer.setDragImage(
|
|
772
|
+
O,
|
|
773
|
+
G.clientX - U.left,
|
|
774
|
+
G.clientY - U.top
|
|
775
|
+
), g(!0), p?.startDrag?.(t);
|
|
555
776
|
},
|
|
556
|
-
[$, t,
|
|
557
|
-
),
|
|
558
|
-
g(!1),
|
|
559
|
-
}, [
|
|
560
|
-
(
|
|
561
|
-
(
|
|
777
|
+
[$, t, p]
|
|
778
|
+
), m = z(() => {
|
|
779
|
+
g(!1), p?.isDragging && p.endDrag?.();
|
|
780
|
+
}, [p]), S = z(
|
|
781
|
+
(G) => {
|
|
782
|
+
(G.key === "Enter" || G.key === " ") && (G.preventDefault(), F());
|
|
562
783
|
},
|
|
563
|
-
[
|
|
564
|
-
),
|
|
784
|
+
[F]
|
|
785
|
+
), C = /* @__PURE__ */ o(
|
|
565
786
|
"div",
|
|
566
787
|
{
|
|
567
788
|
role: "button",
|
|
568
789
|
tabIndex: 0,
|
|
569
790
|
draggable: !!$,
|
|
570
|
-
onDragStart:
|
|
571
|
-
onDragEnd:
|
|
572
|
-
onKeyDown:
|
|
573
|
-
onClick:
|
|
574
|
-
className:
|
|
791
|
+
onDragStart: c,
|
|
792
|
+
onDragEnd: m,
|
|
793
|
+
onKeyDown: S,
|
|
794
|
+
onClick: u ? void 0 : F,
|
|
795
|
+
className: l(
|
|
575
796
|
"group flex w-full select-none flex-col gap-0.5 overflow-hidden rounded-md border-l-[3px] px-2 py-1.5 text-xs text-left",
|
|
576
797
|
"shadow-[0_1px_3px_rgba(0,0,0,0.08)] hover:shadow-[0_2px_6px_rgba(0,0,0,0.12)]",
|
|
577
798
|
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
578
799
|
"transition-all",
|
|
579
800
|
$ ? "cursor-grab active:cursor-grabbing" : "cursor-pointer",
|
|
580
|
-
|
|
801
|
+
u && "opacity-50",
|
|
581
802
|
// Cancelled events get gray background with strikethrough
|
|
582
|
-
|
|
803
|
+
T ? "bg-zinc-100 dark:bg-zinc-800 border-l-zinc-400 dark:border-l-zinc-600 text-zinc-500 dark:text-zinc-400 line-through" : [
|
|
583
804
|
// Colored/mixed variants
|
|
584
|
-
!
|
|
585
|
-
l.bg,
|
|
586
|
-
l.accentBorder,
|
|
587
|
-
l.text
|
|
588
|
-
],
|
|
805
|
+
!M && [d.bg, d.accentBorder, d.text],
|
|
589
806
|
// Dot variant - neutral background
|
|
590
|
-
|
|
807
|
+
M && "bg-neutral-50 dark:bg-neutral-900 border-l-neutral-400 dark:border-l-neutral-600"
|
|
591
808
|
],
|
|
592
809
|
// Short events center content
|
|
593
|
-
|
|
594
|
-
|
|
810
|
+
A && "py-0 justify-center",
|
|
811
|
+
h
|
|
595
812
|
),
|
|
596
|
-
style: { height: `${Math.max(
|
|
813
|
+
style: { height: `${Math.max(E, 20)}px` },
|
|
597
814
|
children: [
|
|
598
|
-
/* @__PURE__ */
|
|
599
|
-
["mixed", "dot"].includes(a) && !
|
|
815
|
+
/* @__PURE__ */ o("div", { className: "flex items-start gap-1.5 min-w-0", children: [
|
|
816
|
+
["mixed", "dot"].includes(a) && !T && /* @__PURE__ */ e(
|
|
600
817
|
"svg",
|
|
601
818
|
{
|
|
602
819
|
width: "8",
|
|
@@ -605,98 +822,98 @@ function dt({
|
|
|
605
822
|
className: "event-dot shrink-0",
|
|
606
823
|
"aria-hidden": "true",
|
|
607
824
|
focusable: "false",
|
|
608
|
-
children: /* @__PURE__ */ e("circle", { cx: "4", cy: "4", r: "4", className:
|
|
825
|
+
children: /* @__PURE__ */ e("circle", { cx: "4", cy: "4", r: "4", className: d.dotFill })
|
|
609
826
|
}
|
|
610
827
|
),
|
|
611
|
-
/* @__PURE__ */ e("div", { className: "flex-1 min-w-0 overflow-hidden", children: /* @__PURE__ */
|
|
828
|
+
/* @__PURE__ */ e("div", { className: "flex-1 min-w-0 overflow-hidden", children: /* @__PURE__ */ o(
|
|
612
829
|
"p",
|
|
613
830
|
{
|
|
614
|
-
className:
|
|
831
|
+
className: l(
|
|
615
832
|
"font-semibold truncate leading-tight",
|
|
616
|
-
!
|
|
833
|
+
!T && M && "text-foreground"
|
|
617
834
|
),
|
|
618
835
|
children: [
|
|
619
836
|
t.title,
|
|
620
|
-
|
|
837
|
+
I && /* @__PURE__ */ o("span", { className: "font-normal opacity-75", children: [
|
|
621
838
|
" ",
|
|
622
839
|
"- ",
|
|
623
|
-
|
|
840
|
+
I
|
|
624
841
|
] })
|
|
625
842
|
]
|
|
626
843
|
}
|
|
627
844
|
) })
|
|
628
845
|
] }),
|
|
629
|
-
|
|
846
|
+
B && R && /* @__PURE__ */ e(
|
|
630
847
|
"p",
|
|
631
848
|
{
|
|
632
|
-
className:
|
|
849
|
+
className: l(
|
|
633
850
|
"text-[11px] truncate leading-tight",
|
|
634
|
-
|
|
851
|
+
M ? "text-muted-foreground" : "opacity-80"
|
|
635
852
|
),
|
|
636
|
-
children:
|
|
853
|
+
children: R
|
|
637
854
|
}
|
|
638
855
|
),
|
|
639
|
-
|
|
856
|
+
j != null && j > 0 && /* @__PURE__ */ o(
|
|
640
857
|
"div",
|
|
641
858
|
{
|
|
642
|
-
className:
|
|
859
|
+
className: l(
|
|
643
860
|
"flex items-center gap-1 text-[11px] leading-tight",
|
|
644
|
-
|
|
861
|
+
M ? "text-muted-foreground" : "opacity-80"
|
|
645
862
|
),
|
|
646
863
|
children: [
|
|
647
|
-
/* @__PURE__ */ e(
|
|
648
|
-
/* @__PURE__ */
|
|
649
|
-
|
|
864
|
+
/* @__PURE__ */ e(Re, { className: "h-3 w-3 shrink-0" }),
|
|
865
|
+
/* @__PURE__ */ o("span", { children: [
|
|
866
|
+
j,
|
|
650
867
|
" participant",
|
|
651
|
-
|
|
868
|
+
j !== 1 ? "s" : ""
|
|
652
869
|
] })
|
|
653
870
|
]
|
|
654
871
|
}
|
|
655
872
|
),
|
|
656
|
-
|
|
873
|
+
L && /* @__PURE__ */ o(
|
|
657
874
|
"div",
|
|
658
875
|
{
|
|
659
|
-
className:
|
|
876
|
+
className: l(
|
|
660
877
|
"flex items-center gap-1 text-[11px] tabular-nums leading-tight",
|
|
661
|
-
|
|
878
|
+
M ? "text-muted-foreground" : "opacity-90"
|
|
662
879
|
),
|
|
663
880
|
children: [
|
|
664
|
-
/* @__PURE__ */ e(
|
|
665
|
-
/* @__PURE__ */ e("span", { children:
|
|
881
|
+
/* @__PURE__ */ e(Ue, { className: "h-3 w-3 shrink-0" }),
|
|
882
|
+
/* @__PURE__ */ e("span", { children: J(t) })
|
|
666
883
|
]
|
|
667
884
|
}
|
|
668
885
|
),
|
|
669
|
-
|
|
886
|
+
B && _ && /* @__PURE__ */ o(
|
|
670
887
|
"div",
|
|
671
888
|
{
|
|
672
|
-
className:
|
|
889
|
+
className: l(
|
|
673
890
|
"flex items-center gap-1 text-[11px] truncate leading-tight",
|
|
674
|
-
|
|
891
|
+
M ? "text-muted-foreground" : "opacity-80"
|
|
675
892
|
),
|
|
676
893
|
children: [
|
|
677
|
-
/* @__PURE__ */ e(
|
|
894
|
+
/* @__PURE__ */ e(yt, { className: "h-3 w-3 shrink-0" }),
|
|
678
895
|
/* @__PURE__ */ e("span", { className: "truncate", children: _ })
|
|
679
896
|
]
|
|
680
897
|
}
|
|
681
898
|
)
|
|
682
899
|
]
|
|
683
900
|
}
|
|
684
|
-
),
|
|
685
|
-
/* @__PURE__ */
|
|
901
|
+
), H = /* @__PURE__ */ e(re, { children: /* @__PURE__ */ o("div", { className: "flex flex-col gap-0.5", children: [
|
|
902
|
+
/* @__PURE__ */ o("div", { className: "font-medium", children: [
|
|
686
903
|
t.title,
|
|
687
|
-
|
|
904
|
+
I && /* @__PURE__ */ o("span", { className: "font-normal opacity-75", children: [
|
|
688
905
|
" ",
|
|
689
906
|
"- ",
|
|
690
|
-
|
|
907
|
+
I
|
|
691
908
|
] })
|
|
692
909
|
] }),
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
910
|
+
R && /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: R }),
|
|
911
|
+
j != null && /* @__PURE__ */ o("div", { className: "text-xs text-muted-foreground", children: [
|
|
912
|
+
j,
|
|
696
913
|
" participant",
|
|
697
|
-
|
|
914
|
+
j !== 1 ? "s" : ""
|
|
698
915
|
] }),
|
|
699
|
-
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children:
|
|
916
|
+
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: J(t) }),
|
|
700
917
|
_ && /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: _ })
|
|
701
918
|
] }) });
|
|
702
919
|
return s ? /* @__PURE__ */ e(
|
|
@@ -709,9 +926,9 @@ function dt({
|
|
|
709
926
|
width: n.minWidth ? `max(${n.minWidth}px, ${n.width}%)` : `${n.width}%`,
|
|
710
927
|
minWidth: n.minWidth ? `${n.minWidth}px` : void 0
|
|
711
928
|
},
|
|
712
|
-
children: /* @__PURE__ */
|
|
713
|
-
/* @__PURE__ */ e(
|
|
714
|
-
|
|
929
|
+
children: /* @__PURE__ */ o(ae, { children: [
|
|
930
|
+
/* @__PURE__ */ e(ie, { asChild: !0, children: C }),
|
|
931
|
+
H
|
|
715
932
|
] })
|
|
716
933
|
}
|
|
717
934
|
) : /* @__PURE__ */ e(
|
|
@@ -724,55 +941,55 @@ function dt({
|
|
|
724
941
|
width: n.minWidth ? `max(${n.minWidth}px, ${n.width}%)` : `${n.width}%`,
|
|
725
942
|
minWidth: n.minWidth ? `${n.minWidth}px` : void 0
|
|
726
943
|
},
|
|
727
|
-
children: /* @__PURE__ */
|
|
728
|
-
/* @__PURE__ */ e(
|
|
729
|
-
/* @__PURE__ */ e(
|
|
944
|
+
children: /* @__PURE__ */ o(ue, { open: b, onOpenChange: v, children: [
|
|
945
|
+
/* @__PURE__ */ e(me, { asChild: !0, children: C }),
|
|
946
|
+
/* @__PURE__ */ e(le, { className: "w-80", children: y ? y({ event: t, onClose: w }) : /* @__PURE__ */ e(qe, { event: t, onClose: w }) })
|
|
730
947
|
] })
|
|
731
948
|
}
|
|
732
949
|
);
|
|
733
950
|
}
|
|
734
|
-
function
|
|
951
|
+
function Kn({
|
|
735
952
|
event: t,
|
|
736
953
|
spanDays: n,
|
|
737
|
-
isStart:
|
|
954
|
+
isStart: r,
|
|
738
955
|
isEnd: a,
|
|
739
956
|
onClick: i,
|
|
740
|
-
className:
|
|
957
|
+
className: h,
|
|
741
958
|
disablePopover: s = !1,
|
|
742
|
-
renderPopover:
|
|
959
|
+
renderPopover: y
|
|
743
960
|
}) {
|
|
744
|
-
const
|
|
745
|
-
s && i ? i(t) : s ||
|
|
746
|
-
}, [s, i, t]), g =
|
|
747
|
-
|
|
748
|
-
}, []),
|
|
961
|
+
const k = de(t.color), [d, b] = Q(!1), v = t.isCanceled ?? !1, u = z(() => {
|
|
962
|
+
s && i ? i(t) : s || b(!0);
|
|
963
|
+
}, [s, i, t]), g = z(() => {
|
|
964
|
+
b(!1);
|
|
965
|
+
}, []), p = /* @__PURE__ */ e(
|
|
749
966
|
"button",
|
|
750
967
|
{
|
|
751
968
|
type: "button",
|
|
752
|
-
onClick:
|
|
753
|
-
className:
|
|
969
|
+
onClick: u,
|
|
970
|
+
className: l(
|
|
754
971
|
"flex h-5 items-center px-1.5 text-xs font-medium transition-opacity hover:opacity-80",
|
|
755
972
|
// Cancelled events get gray background with strikethrough
|
|
756
|
-
|
|
757
|
-
|
|
973
|
+
v ? "bg-zinc-200 dark:bg-zinc-700 text-zinc-500 dark:text-zinc-400 line-through" : [k.dot, "text-white"],
|
|
974
|
+
r && "rounded-l",
|
|
758
975
|
a && "rounded-r",
|
|
759
|
-
!
|
|
976
|
+
!r && "border-l-0",
|
|
760
977
|
!a && "border-r-0",
|
|
761
|
-
|
|
978
|
+
h
|
|
762
979
|
),
|
|
763
980
|
style: { width: `${n * 100}%` },
|
|
764
|
-
children:
|
|
981
|
+
children: r && /* @__PURE__ */ e("span", { className: "truncate", children: t.title })
|
|
765
982
|
}
|
|
766
|
-
),
|
|
983
|
+
), N = /* @__PURE__ */ e(re, { children: /* @__PURE__ */ o("div", { className: "flex flex-col gap-0.5", children: [
|
|
767
984
|
/* @__PURE__ */ e("div", { className: "font-medium", children: t.title }),
|
|
768
|
-
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children:
|
|
985
|
+
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: J(t) })
|
|
769
986
|
] }) });
|
|
770
|
-
return s ? /* @__PURE__ */
|
|
771
|
-
/* @__PURE__ */ e(
|
|
772
|
-
|
|
773
|
-
] }) : /* @__PURE__ */
|
|
774
|
-
/* @__PURE__ */ e(
|
|
775
|
-
/* @__PURE__ */ e(
|
|
987
|
+
return s ? /* @__PURE__ */ o(ae, { children: [
|
|
988
|
+
/* @__PURE__ */ e(ie, { asChild: !0, children: p }),
|
|
989
|
+
N
|
|
990
|
+
] }) : /* @__PURE__ */ o(ue, { open: d, onOpenChange: b, children: [
|
|
991
|
+
/* @__PURE__ */ e(me, { asChild: !0, children: p }),
|
|
992
|
+
/* @__PURE__ */ e(le, { className: "w-80", children: y ? y({ event: t, onClose: g }) : /* @__PURE__ */ e(qe, { event: t, onClose: g }) })
|
|
776
993
|
] });
|
|
777
994
|
}
|
|
778
995
|
if (typeof window < "u" && !document.getElementById("inno-calendar-event-marquee-style")) {
|
|
@@ -788,36 +1005,36 @@ if (typeof window < "u" && !document.getElementById("inno-calendar-event-marquee
|
|
|
788
1005
|
}
|
|
789
1006
|
`, document.head.appendChild(t);
|
|
790
1007
|
}
|
|
791
|
-
const
|
|
1008
|
+
const Ye = (t) => typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, Je = Dt, wt = (t, n) => (r) => {
|
|
792
1009
|
var a;
|
|
793
|
-
if (n?.variants == null) return
|
|
794
|
-
const { variants: i, defaultVariants:
|
|
795
|
-
const
|
|
796
|
-
if (
|
|
797
|
-
const
|
|
798
|
-
return i[
|
|
799
|
-
}),
|
|
800
|
-
let [
|
|
801
|
-
return
|
|
802
|
-
}, {}),
|
|
803
|
-
let { class:
|
|
804
|
-
return Object.entries(g).every((
|
|
805
|
-
let [
|
|
806
|
-
return Array.isArray(
|
|
807
|
-
...
|
|
808
|
-
...
|
|
809
|
-
}[
|
|
810
|
-
...
|
|
811
|
-
...
|
|
812
|
-
}[
|
|
1010
|
+
if (n?.variants == null) return Je(t, r?.class, r?.className);
|
|
1011
|
+
const { variants: i, defaultVariants: h } = n, s = Object.keys(i).map((d) => {
|
|
1012
|
+
const b = r?.[d], v = h?.[d];
|
|
1013
|
+
if (b === null) return null;
|
|
1014
|
+
const u = Ye(b) || Ye(v);
|
|
1015
|
+
return i[d][u];
|
|
1016
|
+
}), y = r && Object.entries(r).reduce((d, b) => {
|
|
1017
|
+
let [v, u] = b;
|
|
1018
|
+
return u === void 0 || (d[v] = u), d;
|
|
1019
|
+
}, {}), k = n == null || (a = n.compoundVariants) === null || a === void 0 ? void 0 : a.reduce((d, b) => {
|
|
1020
|
+
let { class: v, className: u, ...g } = b;
|
|
1021
|
+
return Object.entries(g).every((p) => {
|
|
1022
|
+
let [N, f] = p;
|
|
1023
|
+
return Array.isArray(f) ? f.includes({
|
|
1024
|
+
...h,
|
|
1025
|
+
...y
|
|
1026
|
+
}[N]) : {
|
|
1027
|
+
...h,
|
|
1028
|
+
...y
|
|
1029
|
+
}[N] === f;
|
|
813
1030
|
}) ? [
|
|
814
|
-
...
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
] :
|
|
1031
|
+
...d,
|
|
1032
|
+
v,
|
|
1033
|
+
u
|
|
1034
|
+
] : d;
|
|
818
1035
|
}, []);
|
|
819
|
-
return
|
|
820
|
-
},
|
|
1036
|
+
return Je(t, s, k, r?.class, r?.className);
|
|
1037
|
+
}, nn = wt(
|
|
821
1038
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
822
1039
|
{
|
|
823
1040
|
variants: {
|
|
@@ -841,16 +1058,16 @@ const Ge = (t) => typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, Ue = gt, c
|
|
|
841
1058
|
size: "default"
|
|
842
1059
|
}
|
|
843
1060
|
}
|
|
844
|
-
),
|
|
845
|
-
({ className: t, variant: n, size:
|
|
1061
|
+
), pe = Pe(
|
|
1062
|
+
({ className: t, variant: n, size: r, loading: a, disabled: i, children: h, ...s }, y) => /* @__PURE__ */ o(
|
|
846
1063
|
"button",
|
|
847
1064
|
{
|
|
848
|
-
className:
|
|
849
|
-
ref:
|
|
1065
|
+
className: l(nn({ variant: n, size: r, className: t })),
|
|
1066
|
+
ref: y,
|
|
850
1067
|
disabled: i || a,
|
|
851
1068
|
...s,
|
|
852
1069
|
children: [
|
|
853
|
-
a && /* @__PURE__ */
|
|
1070
|
+
a && /* @__PURE__ */ o(
|
|
854
1071
|
"svg",
|
|
855
1072
|
{
|
|
856
1073
|
className: "animate-spin -ml-1 mr-2 size-4",
|
|
@@ -880,192 +1097,119 @@ const Ge = (t) => typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, Ue = gt, c
|
|
|
880
1097
|
]
|
|
881
1098
|
}
|
|
882
1099
|
),
|
|
883
|
-
|
|
1100
|
+
h
|
|
884
1101
|
]
|
|
885
1102
|
}
|
|
886
1103
|
)
|
|
887
1104
|
);
|
|
888
|
-
|
|
889
|
-
const
|
|
890
|
-
const Ct = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
891
|
-
const St = (t) => t.replace(
|
|
892
|
-
/^([A-Z])|[\s-_]+(\w)/g,
|
|
893
|
-
(n, o, a) => a ? a.toUpperCase() : o.toLowerCase()
|
|
894
|
-
);
|
|
895
|
-
const qe = (t) => {
|
|
896
|
-
const n = St(t);
|
|
897
|
-
return n.charAt(0).toUpperCase() + n.slice(1);
|
|
898
|
-
};
|
|
899
|
-
var Mt = {
|
|
900
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
901
|
-
width: 24,
|
|
902
|
-
height: 24,
|
|
903
|
-
viewBox: "0 0 24 24",
|
|
904
|
-
fill: "none",
|
|
905
|
-
stroke: "currentColor",
|
|
906
|
-
strokeWidth: 2,
|
|
907
|
-
strokeLinecap: "round",
|
|
908
|
-
strokeLinejoin: "round"
|
|
909
|
-
};
|
|
910
|
-
const Tt = (t) => {
|
|
911
|
-
for (const n in t)
|
|
912
|
-
if (n.startsWith("aria-") || n === "role" || n === "title")
|
|
913
|
-
return !0;
|
|
914
|
-
return !1;
|
|
915
|
-
};
|
|
916
|
-
const Wt = Be(
|
|
917
|
-
({
|
|
918
|
-
color: t = "currentColor",
|
|
919
|
-
size: n = 24,
|
|
920
|
-
strokeWidth: o = 2,
|
|
921
|
-
absoluteStrokeWidth: a,
|
|
922
|
-
className: i = "",
|
|
923
|
-
children: f,
|
|
924
|
-
iconNode: s,
|
|
925
|
-
...x
|
|
926
|
-
}, N) => Ee(
|
|
927
|
-
"svg",
|
|
928
|
-
{
|
|
929
|
-
ref: N,
|
|
930
|
-
...Mt,
|
|
931
|
-
width: n,
|
|
932
|
-
height: n,
|
|
933
|
-
stroke: t,
|
|
934
|
-
strokeWidth: a ? Number(o) * 24 / Number(n) : o,
|
|
935
|
-
className: ut("lucide", i),
|
|
936
|
-
...!f && !Tt(x) && { "aria-hidden": "true" },
|
|
937
|
-
...x
|
|
938
|
-
},
|
|
939
|
-
[
|
|
940
|
-
...s.map(([l, y]) => Ee(l, y)),
|
|
941
|
-
...Array.isArray(f) ? f : [f]
|
|
942
|
-
]
|
|
943
|
-
)
|
|
944
|
-
);
|
|
945
|
-
const Pe = (t, n) => {
|
|
946
|
-
const o = Be(
|
|
947
|
-
({ className: a, ...i }, f) => Ee(Wt, {
|
|
948
|
-
ref: f,
|
|
949
|
-
iconNode: n,
|
|
950
|
-
className: ut(
|
|
951
|
-
`lucide-${Ct(qe(t))}`,
|
|
952
|
-
`lucide-${t}`,
|
|
953
|
-
a
|
|
954
|
-
),
|
|
955
|
-
...i
|
|
956
|
-
})
|
|
957
|
-
);
|
|
958
|
-
return o.displayName = qe(t), o;
|
|
959
|
-
};
|
|
960
|
-
const Lt = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], At = Pe("check", Lt);
|
|
961
|
-
const Et = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], zt = Pe("chevron-right", Et);
|
|
962
|
-
const _t = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]], It = Pe("circle", _t), Ke = K.Root, Xe = K.Trigger, Bt = ee.forwardRef(({ className: t, inset: n, children: o, ...a }, i) => /* @__PURE__ */ r(
|
|
1105
|
+
pe.displayName = "Button";
|
|
1106
|
+
const Ze = K.Root, Qe = K.Trigger, rn = Y.forwardRef(({ className: t, inset: n, children: r, ...a }, i) => /* @__PURE__ */ o(
|
|
963
1107
|
K.SubTrigger,
|
|
964
1108
|
{
|
|
965
1109
|
ref: i,
|
|
966
|
-
className:
|
|
1110
|
+
className: l(
|
|
967
1111
|
"flex cursor-default select-none items-center rounded-lg px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
|
|
968
1112
|
n && "pl-8",
|
|
969
1113
|
t
|
|
970
1114
|
),
|
|
971
1115
|
...a,
|
|
972
1116
|
children: [
|
|
973
|
-
|
|
974
|
-
/* @__PURE__ */ e(
|
|
1117
|
+
r,
|
|
1118
|
+
/* @__PURE__ */ e(Rt, { className: "ml-auto h-4 w-4" })
|
|
975
1119
|
]
|
|
976
1120
|
}
|
|
977
1121
|
));
|
|
978
|
-
|
|
979
|
-
const
|
|
1122
|
+
rn.displayName = K.SubTrigger.displayName;
|
|
1123
|
+
const on = Y.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ e(
|
|
980
1124
|
K.SubContent,
|
|
981
1125
|
{
|
|
982
|
-
ref:
|
|
983
|
-
className:
|
|
1126
|
+
ref: r,
|
|
1127
|
+
className: l(
|
|
984
1128
|
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
985
1129
|
t
|
|
986
1130
|
),
|
|
987
1131
|
...n
|
|
988
1132
|
}
|
|
989
1133
|
));
|
|
990
|
-
|
|
991
|
-
const
|
|
1134
|
+
on.displayName = K.SubContent.displayName;
|
|
1135
|
+
const He = Y.forwardRef(({ className: t, sideOffset: n = 4, ...r }, a) => /* @__PURE__ */ e(K.Portal, { children: /* @__PURE__ */ e(
|
|
992
1136
|
K.Content,
|
|
993
1137
|
{
|
|
994
1138
|
ref: a,
|
|
995
1139
|
sideOffset: n,
|
|
996
|
-
className:
|
|
1140
|
+
className: l(
|
|
997
1141
|
"z-50 rounded-xl border bg-popover p-1 text-popover-foreground shadow-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
998
1142
|
t
|
|
999
1143
|
),
|
|
1000
|
-
...
|
|
1144
|
+
...r
|
|
1001
1145
|
}
|
|
1002
1146
|
) }));
|
|
1003
|
-
|
|
1004
|
-
const
|
|
1147
|
+
He.displayName = K.Content.displayName;
|
|
1148
|
+
const Oe = Y.forwardRef(({ className: t, inset: n, ...r }, a) => /* @__PURE__ */ e(
|
|
1005
1149
|
K.Item,
|
|
1006
1150
|
{
|
|
1007
1151
|
ref: a,
|
|
1008
|
-
className:
|
|
1152
|
+
className: l(
|
|
1009
1153
|
"relative flex cursor-pointer select-none items-center rounded-lg px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1010
1154
|
n && "pl-8",
|
|
1011
1155
|
t
|
|
1012
1156
|
),
|
|
1013
|
-
...
|
|
1157
|
+
...r
|
|
1014
1158
|
}
|
|
1015
1159
|
));
|
|
1016
|
-
|
|
1017
|
-
const
|
|
1160
|
+
Oe.displayName = K.Item.displayName;
|
|
1161
|
+
const an = Y.forwardRef(({ className: t, children: n, checked: r = !1, ...a }, i) => /* @__PURE__ */ o(
|
|
1018
1162
|
K.CheckboxItem,
|
|
1019
1163
|
{
|
|
1020
1164
|
ref: i,
|
|
1021
|
-
className:
|
|
1165
|
+
className: l(
|
|
1022
1166
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1023
1167
|
t
|
|
1024
1168
|
),
|
|
1025
|
-
checked:
|
|
1169
|
+
checked: r,
|
|
1026
1170
|
...a,
|
|
1027
1171
|
children: [
|
|
1028
|
-
/* @__PURE__ */ e("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e(K.ItemIndicator, { children: /* @__PURE__ */ e(
|
|
1172
|
+
/* @__PURE__ */ e("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e(K.ItemIndicator, { children: /* @__PURE__ */ e(Bt, { className: "h-4 w-4" }) }) }),
|
|
1029
1173
|
n
|
|
1030
1174
|
]
|
|
1031
1175
|
}
|
|
1032
1176
|
));
|
|
1033
|
-
|
|
1034
|
-
const
|
|
1177
|
+
an.displayName = K.CheckboxItem.displayName;
|
|
1178
|
+
const sn = Y.forwardRef(({ className: t, children: n, ...r }, a) => /* @__PURE__ */ o(
|
|
1035
1179
|
K.RadioItem,
|
|
1036
1180
|
{
|
|
1037
1181
|
ref: a,
|
|
1038
|
-
className:
|
|
1182
|
+
className: l(
|
|
1039
1183
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1040
1184
|
t
|
|
1041
1185
|
),
|
|
1042
|
-
...
|
|
1186
|
+
...r,
|
|
1043
1187
|
children: [
|
|
1044
|
-
/* @__PURE__ */ e("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e(K.ItemIndicator, { children: /* @__PURE__ */ e(
|
|
1188
|
+
/* @__PURE__ */ e("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e(K.ItemIndicator, { children: /* @__PURE__ */ e(Ot, { className: "h-2 w-2 fill-current" }) }) }),
|
|
1045
1189
|
n
|
|
1046
1190
|
]
|
|
1047
1191
|
}
|
|
1048
1192
|
));
|
|
1049
|
-
|
|
1050
|
-
const
|
|
1193
|
+
sn.displayName = K.RadioItem.displayName;
|
|
1194
|
+
const ln = Y.forwardRef(({ className: t, inset: n, ...r }, a) => /* @__PURE__ */ e(
|
|
1051
1195
|
K.Label,
|
|
1052
1196
|
{
|
|
1053
1197
|
ref: a,
|
|
1054
|
-
className:
|
|
1055
|
-
...
|
|
1198
|
+
className: l("px-2 py-1.5 text-sm font-semibold", n && "pl-8", t),
|
|
1199
|
+
...r
|
|
1056
1200
|
}
|
|
1057
1201
|
));
|
|
1058
|
-
|
|
1059
|
-
const
|
|
1202
|
+
ln.displayName = K.Label.displayName;
|
|
1203
|
+
const dn = Y.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ e(
|
|
1060
1204
|
K.Separator,
|
|
1061
1205
|
{
|
|
1062
|
-
ref:
|
|
1063
|
-
className:
|
|
1206
|
+
ref: r,
|
|
1207
|
+
className: l("-mx-1 my-1 h-px bg-muted", t),
|
|
1064
1208
|
...n
|
|
1065
1209
|
}
|
|
1066
1210
|
));
|
|
1067
|
-
|
|
1068
|
-
const
|
|
1211
|
+
dn.displayName = K.Separator.displayName;
|
|
1212
|
+
const cn = wt(
|
|
1069
1213
|
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
1070
1214
|
{
|
|
1071
1215
|
variants: {
|
|
@@ -1079,10 +1223,10 @@ const Pt = ct(
|
|
|
1079
1223
|
defaultVariants: { variant: "default" }
|
|
1080
1224
|
}
|
|
1081
1225
|
);
|
|
1082
|
-
function
|
|
1083
|
-
return /* @__PURE__ */ e("div", { className:
|
|
1226
|
+
function un({ className: t, variant: n, ...r }) {
|
|
1227
|
+
return /* @__PURE__ */ e("div", { className: l(cn({ variant: n }), t), ...r });
|
|
1084
1228
|
}
|
|
1085
|
-
function
|
|
1229
|
+
function mn({ className: t }) {
|
|
1086
1230
|
return /* @__PURE__ */ e(
|
|
1087
1231
|
"svg",
|
|
1088
1232
|
{
|
|
@@ -1100,7 +1244,7 @@ function Vt({ className: t }) {
|
|
|
1100
1244
|
}
|
|
1101
1245
|
);
|
|
1102
1246
|
}
|
|
1103
|
-
function
|
|
1247
|
+
function hn({ className: t }) {
|
|
1104
1248
|
return /* @__PURE__ */ e(
|
|
1105
1249
|
"svg",
|
|
1106
1250
|
{
|
|
@@ -1118,7 +1262,7 @@ function Gt({ className: t }) {
|
|
|
1118
1262
|
}
|
|
1119
1263
|
);
|
|
1120
1264
|
}
|
|
1121
|
-
const
|
|
1265
|
+
const pn = [
|
|
1122
1266
|
"January",
|
|
1123
1267
|
"February",
|
|
1124
1268
|
"March",
|
|
@@ -1132,52 +1276,52 @@ const Ut = [
|
|
|
1132
1276
|
"November",
|
|
1133
1277
|
"December"
|
|
1134
1278
|
];
|
|
1135
|
-
function
|
|
1279
|
+
function fn({
|
|
1136
1280
|
date: t,
|
|
1137
1281
|
view: n,
|
|
1138
|
-
events:
|
|
1282
|
+
events: r = [],
|
|
1139
1283
|
onNavigatePrev: a,
|
|
1140
1284
|
onNavigateNext: i,
|
|
1141
|
-
weekStartsOn:
|
|
1285
|
+
weekStartsOn: h = 1,
|
|
1142
1286
|
showEventCount: s = !0,
|
|
1143
|
-
className:
|
|
1287
|
+
className: y
|
|
1144
1288
|
}) {
|
|
1145
|
-
const
|
|
1146
|
-
return /* @__PURE__ */
|
|
1147
|
-
/* @__PURE__ */
|
|
1148
|
-
/* @__PURE__ */
|
|
1149
|
-
|
|
1289
|
+
const k = pn[t.getMonth()], d = t.getFullYear(), b = s ? Ct(r, t, n, h) : 0, v = St(t, n);
|
|
1290
|
+
return /* @__PURE__ */ o("div", { className: l("min-w-0 flex-1", y), children: [
|
|
1291
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-1.5 sm:gap-2 flex-wrap", children: [
|
|
1292
|
+
/* @__PURE__ */ o("span", { className: "text-base sm:text-lg font-semibold truncate", children: [
|
|
1293
|
+
k,
|
|
1150
1294
|
" ",
|
|
1151
|
-
|
|
1295
|
+
d
|
|
1152
1296
|
] }),
|
|
1153
|
-
s && /* @__PURE__ */ e(
|
|
1297
|
+
s && /* @__PURE__ */ e(un, { variant: "outline", className: "px-1 sm:px-1.5 text-[10px] sm:text-xs shrink-0", children: b })
|
|
1154
1298
|
] }),
|
|
1155
|
-
/* @__PURE__ */
|
|
1299
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-1.5 sm:gap-2", children: [
|
|
1156
1300
|
/* @__PURE__ */ e(
|
|
1157
|
-
|
|
1301
|
+
pe,
|
|
1158
1302
|
{
|
|
1159
1303
|
variant: "outline",
|
|
1160
1304
|
size: "icon",
|
|
1161
1305
|
className: "size-5 sm:size-6 [&_svg]:size-3 sm:[&_svg]:size-4",
|
|
1162
1306
|
onClick: a,
|
|
1163
|
-
children: /* @__PURE__ */ e(
|
|
1307
|
+
children: /* @__PURE__ */ e(mn, {})
|
|
1164
1308
|
}
|
|
1165
1309
|
),
|
|
1166
|
-
/* @__PURE__ */ e("p", { className: "text-xs sm:text-sm text-muted-foreground truncate", children:
|
|
1310
|
+
/* @__PURE__ */ e("p", { className: "text-xs sm:text-sm text-muted-foreground truncate", children: v }),
|
|
1167
1311
|
/* @__PURE__ */ e(
|
|
1168
|
-
|
|
1312
|
+
pe,
|
|
1169
1313
|
{
|
|
1170
1314
|
variant: "outline",
|
|
1171
1315
|
size: "icon",
|
|
1172
1316
|
className: "size-5 sm:size-6 [&_svg]:size-3 sm:[&_svg]:size-4",
|
|
1173
1317
|
onClick: i,
|
|
1174
|
-
children: /* @__PURE__ */ e(
|
|
1318
|
+
children: /* @__PURE__ */ e(hn, {})
|
|
1175
1319
|
}
|
|
1176
1320
|
)
|
|
1177
1321
|
] })
|
|
1178
1322
|
] });
|
|
1179
1323
|
}
|
|
1180
|
-
const
|
|
1324
|
+
const gn = [
|
|
1181
1325
|
"JAN",
|
|
1182
1326
|
"FEB",
|
|
1183
1327
|
"MAR",
|
|
@@ -1191,13 +1335,13 @@ const Kt = [
|
|
|
1191
1335
|
"NOV",
|
|
1192
1336
|
"DEC"
|
|
1193
1337
|
];
|
|
1194
|
-
function
|
|
1195
|
-
const
|
|
1196
|
-
return /* @__PURE__ */
|
|
1338
|
+
function xn({ onClick: t, className: n }) {
|
|
1339
|
+
const r = /* @__PURE__ */ new Date();
|
|
1340
|
+
return /* @__PURE__ */ o(
|
|
1197
1341
|
"button",
|
|
1198
1342
|
{
|
|
1199
1343
|
type: "button",
|
|
1200
|
-
className:
|
|
1344
|
+
className: l(
|
|
1201
1345
|
"flex size-11 sm:size-14 flex-col items-start overflow-hidden rounded-lg border shrink-0",
|
|
1202
1346
|
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
1203
1347
|
"hover:bg-accent/50 transition-colors",
|
|
@@ -1205,14 +1349,14 @@ function Xt({ onClick: t, className: n }) {
|
|
|
1205
1349
|
),
|
|
1206
1350
|
onClick: t,
|
|
1207
1351
|
children: [
|
|
1208
|
-
/* @__PURE__ */ e("p", { className: "flex h-4 sm:h-6 w-full items-center justify-center bg-primary text-center text-[10px] sm:text-xs font-semibold text-primary-foreground", children:
|
|
1209
|
-
/* @__PURE__ */ e("p", { className: "flex w-full flex-1 items-center justify-center text-sm sm:text-lg font-bold", children:
|
|
1352
|
+
/* @__PURE__ */ e("p", { className: "flex h-4 sm:h-6 w-full items-center justify-center bg-primary text-center text-[10px] sm:text-xs font-semibold text-primary-foreground", children: gn[r.getMonth()] }),
|
|
1353
|
+
/* @__PURE__ */ e("p", { className: "flex w-full flex-1 items-center justify-center text-sm sm:text-lg font-bold", children: r.getDate() })
|
|
1210
1354
|
]
|
|
1211
1355
|
}
|
|
1212
1356
|
);
|
|
1213
1357
|
}
|
|
1214
|
-
function
|
|
1215
|
-
return /* @__PURE__ */
|
|
1358
|
+
function yn({ className: t }) {
|
|
1359
|
+
return /* @__PURE__ */ o(
|
|
1216
1360
|
"svg",
|
|
1217
1361
|
{
|
|
1218
1362
|
className: t,
|
|
@@ -1240,8 +1384,8 @@ function Yt({ className: t }) {
|
|
|
1240
1384
|
}
|
|
1241
1385
|
);
|
|
1242
1386
|
}
|
|
1243
|
-
function
|
|
1244
|
-
return /* @__PURE__ */
|
|
1387
|
+
function fe({ className: t }) {
|
|
1388
|
+
return /* @__PURE__ */ o(
|
|
1245
1389
|
"svg",
|
|
1246
1390
|
{
|
|
1247
1391
|
className: t,
|
|
@@ -1263,7 +1407,7 @@ function he({ className: t }) {
|
|
|
1263
1407
|
}
|
|
1264
1408
|
);
|
|
1265
1409
|
}
|
|
1266
|
-
function
|
|
1410
|
+
function et({ className: t }) {
|
|
1267
1411
|
return /* @__PURE__ */ e(
|
|
1268
1412
|
"svg",
|
|
1269
1413
|
{
|
|
@@ -1281,8 +1425,8 @@ function Ye({ className: t }) {
|
|
|
1281
1425
|
}
|
|
1282
1426
|
);
|
|
1283
1427
|
}
|
|
1284
|
-
function
|
|
1285
|
-
return /* @__PURE__ */
|
|
1428
|
+
function bn({ className: t }) {
|
|
1429
|
+
return /* @__PURE__ */ o(
|
|
1286
1430
|
"svg",
|
|
1287
1431
|
{
|
|
1288
1432
|
className: t,
|
|
@@ -1302,8 +1446,8 @@ function Jt({ className: t }) {
|
|
|
1302
1446
|
}
|
|
1303
1447
|
);
|
|
1304
1448
|
}
|
|
1305
|
-
function
|
|
1306
|
-
return /* @__PURE__ */
|
|
1449
|
+
function tt({ className: t }) {
|
|
1450
|
+
return /* @__PURE__ */ o(
|
|
1307
1451
|
"svg",
|
|
1308
1452
|
{
|
|
1309
1453
|
className: t,
|
|
@@ -1323,8 +1467,8 @@ function Je({ className: t }) {
|
|
|
1323
1467
|
}
|
|
1324
1468
|
);
|
|
1325
1469
|
}
|
|
1326
|
-
function
|
|
1327
|
-
return /* @__PURE__ */
|
|
1470
|
+
function wn({ className: t }) {
|
|
1471
|
+
return /* @__PURE__ */ o(
|
|
1328
1472
|
"svg",
|
|
1329
1473
|
{
|
|
1330
1474
|
className: t,
|
|
@@ -1348,8 +1492,8 @@ function Zt({ className: t }) {
|
|
|
1348
1492
|
}
|
|
1349
1493
|
);
|
|
1350
1494
|
}
|
|
1351
|
-
function
|
|
1352
|
-
return /* @__PURE__ */
|
|
1495
|
+
function vn({ className: t }) {
|
|
1496
|
+
return /* @__PURE__ */ o(
|
|
1353
1497
|
"svg",
|
|
1354
1498
|
{
|
|
1355
1499
|
className: t,
|
|
@@ -1369,8 +1513,8 @@ function Qt({ className: t }) {
|
|
|
1369
1513
|
}
|
|
1370
1514
|
);
|
|
1371
1515
|
}
|
|
1372
|
-
function
|
|
1373
|
-
return /* @__PURE__ */
|
|
1516
|
+
function Nn({ className: t }) {
|
|
1517
|
+
return /* @__PURE__ */ o(
|
|
1374
1518
|
"svg",
|
|
1375
1519
|
{
|
|
1376
1520
|
className: t,
|
|
@@ -1391,8 +1535,8 @@ function en({ className: t }) {
|
|
|
1391
1535
|
}
|
|
1392
1536
|
);
|
|
1393
1537
|
}
|
|
1394
|
-
function
|
|
1395
|
-
return /* @__PURE__ */
|
|
1538
|
+
function kn({ className: t }) {
|
|
1539
|
+
return /* @__PURE__ */ o(
|
|
1396
1540
|
"svg",
|
|
1397
1541
|
{
|
|
1398
1542
|
className: t,
|
|
@@ -1415,355 +1559,356 @@ function tn({ className: t }) {
|
|
|
1415
1559
|
}
|
|
1416
1560
|
);
|
|
1417
1561
|
}
|
|
1418
|
-
const
|
|
1419
|
-
{ value: "day", label: "Day", icon:
|
|
1420
|
-
{ value: "week", label: "Week", icon:
|
|
1421
|
-
{ value: "month", label: "Month", icon:
|
|
1422
|
-
{ value: "year", label: "Year", icon:
|
|
1562
|
+
const Dn = [
|
|
1563
|
+
{ value: "day", label: "Day", icon: wn },
|
|
1564
|
+
{ value: "week", label: "Week", icon: vn },
|
|
1565
|
+
{ value: "month", label: "Month", icon: Nn },
|
|
1566
|
+
{ value: "year", label: "Year", icon: kn }
|
|
1423
1567
|
// { value: 'agenda', label: 'Agenda', icon: ListIcon }, NOTE: Not needed currently
|
|
1424
|
-
],
|
|
1425
|
-
{ value: "timeline-day", label: "1 Day", icon:
|
|
1426
|
-
{ value: "timeline-3day", label: "3 Days", icon:
|
|
1427
|
-
{ value: "timeline-week", label: "7 Days", icon:
|
|
1428
|
-
],
|
|
1429
|
-
{ value: "resource-day", label: "1 Day", icon:
|
|
1430
|
-
{ value: "resource-week", label: "7 Days", icon:
|
|
1568
|
+
], nt = [
|
|
1569
|
+
{ value: "timeline-day", label: "1 Day", icon: fe },
|
|
1570
|
+
{ value: "timeline-3day", label: "3 Days", icon: fe },
|
|
1571
|
+
{ value: "timeline-week", label: "7 Days", icon: fe }
|
|
1572
|
+
], Cn = [
|
|
1573
|
+
{ value: "resource-day", label: "1 Day", icon: fe },
|
|
1574
|
+
{ value: "resource-week", label: "7 Days", icon: fe }
|
|
1431
1575
|
];
|
|
1432
|
-
function
|
|
1576
|
+
function Xn({
|
|
1433
1577
|
currentDate: t,
|
|
1434
1578
|
view: n,
|
|
1435
|
-
events:
|
|
1579
|
+
events: r = [],
|
|
1436
1580
|
onNavigateToday: a,
|
|
1437
1581
|
onNavigatePrev: i,
|
|
1438
|
-
onNavigateNext:
|
|
1582
|
+
onNavigateNext: h,
|
|
1439
1583
|
onNavigate: s,
|
|
1440
|
-
onViewChange:
|
|
1441
|
-
onAddEvent:
|
|
1442
|
-
availableViews:
|
|
1443
|
-
showTimelineViews:
|
|
1444
|
-
timelineViews:
|
|
1445
|
-
settingsContent:
|
|
1584
|
+
onViewChange: y,
|
|
1585
|
+
onAddEvent: k,
|
|
1586
|
+
availableViews: d = ["day", "week", "month", "agenda"],
|
|
1587
|
+
showTimelineViews: b = !1,
|
|
1588
|
+
timelineViews: v,
|
|
1589
|
+
settingsContent: u,
|
|
1446
1590
|
showSettings: g = !1,
|
|
1447
|
-
filterContent:
|
|
1448
|
-
actions:
|
|
1449
|
-
className:
|
|
1450
|
-
weekStartsOn:
|
|
1451
|
-
|
|
1591
|
+
filterContent: p,
|
|
1592
|
+
actions: N,
|
|
1593
|
+
className: f,
|
|
1594
|
+
weekStartsOn: E = 1,
|
|
1595
|
+
headerConfig: D,
|
|
1596
|
+
labels: T = {}
|
|
1452
1597
|
}) {
|
|
1453
|
-
const
|
|
1598
|
+
const $ = D?.showToday ?? !0, A = D?.showDateNavigator ?? !0, L = D?.showCalendarViews ?? !0, B = D?.showResourceViews ?? b, P = D?.showSettings ?? g, I = D?.showAddEvent ?? !0, R = D?.showFilters ?? !0, j = q(
|
|
1454
1599
|
() => ({
|
|
1455
1600
|
today: "Today",
|
|
1456
1601
|
addEvent: "Add Event",
|
|
1457
1602
|
calendarView: "Calendar View",
|
|
1458
1603
|
resourceView: "Resource View",
|
|
1459
|
-
...
|
|
1604
|
+
...T
|
|
1460
1605
|
}),
|
|
1461
|
-
[
|
|
1462
|
-
),
|
|
1606
|
+
[T]
|
|
1607
|
+
), W = () => {
|
|
1463
1608
|
a?.(), s?.("today");
|
|
1464
|
-
},
|
|
1609
|
+
}, x = () => {
|
|
1465
1610
|
i?.(), s?.("prev");
|
|
1466
|
-
},
|
|
1467
|
-
|
|
1468
|
-
},
|
|
1611
|
+
}, _ = () => {
|
|
1612
|
+
h?.(), s?.("next");
|
|
1613
|
+
}, M = ["day", "week", "month", "year", "agenda"].includes(
|
|
1469
1614
|
n
|
|
1470
|
-
),
|
|
1471
|
-
(
|
|
1472
|
-
),
|
|
1473
|
-
return /* @__PURE__ */
|
|
1474
|
-
/* @__PURE__ */
|
|
1475
|
-
/* @__PURE__ */
|
|
1476
|
-
/* @__PURE__ */
|
|
1477
|
-
/* @__PURE__ */ e(
|
|
1478
|
-
/* @__PURE__ */ e(
|
|
1479
|
-
|
|
1615
|
+
), F = n.startsWith("timeline-") || n.startsWith("resource-"), w = Dn.filter(
|
|
1616
|
+
(C) => d.includes(C.value)
|
|
1617
|
+
), c = M ? w.find((C) => C.value === n) : null, m = [...nt, ...Cn], S = F ? m.find((C) => C.value === n) : null;
|
|
1618
|
+
return /* @__PURE__ */ o("div", { className: l("flex flex-col w-full gap-3 mb-2", f), children: [
|
|
1619
|
+
/* @__PURE__ */ o("div", { className: "flex lg:flex-row flex-col w-full justify-between gap-3", children: [
|
|
1620
|
+
/* @__PURE__ */ o("div", { className: "flex items-center justify-between gap-2", children: [
|
|
1621
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-2 sm:gap-3 min-w-0", children: [
|
|
1622
|
+
$ && /* @__PURE__ */ e(xn, { onClick: W }),
|
|
1623
|
+
A && /* @__PURE__ */ e(
|
|
1624
|
+
fn,
|
|
1480
1625
|
{
|
|
1481
1626
|
date: t,
|
|
1482
1627
|
view: n,
|
|
1483
|
-
events:
|
|
1484
|
-
onNavigatePrev:
|
|
1485
|
-
onNavigateNext:
|
|
1486
|
-
weekStartsOn:
|
|
1628
|
+
events: r,
|
|
1629
|
+
onNavigatePrev: x,
|
|
1630
|
+
onNavigateNext: _,
|
|
1631
|
+
weekStartsOn: E
|
|
1487
1632
|
}
|
|
1488
1633
|
)
|
|
1489
1634
|
] }),
|
|
1490
|
-
|
|
1491
|
-
|
|
1635
|
+
I && k && /* @__PURE__ */ e(
|
|
1636
|
+
pe,
|
|
1492
1637
|
{
|
|
1493
1638
|
size: "icon",
|
|
1494
1639
|
className: "shrink-0 lg:hidden",
|
|
1495
|
-
onClick:
|
|
1496
|
-
children: /* @__PURE__ */ e(
|
|
1640
|
+
onClick: k,
|
|
1641
|
+
children: /* @__PURE__ */ e(tt, { className: "size-4" })
|
|
1497
1642
|
}
|
|
1498
1643
|
)
|
|
1499
1644
|
] }),
|
|
1500
|
-
/* @__PURE__ */
|
|
1501
|
-
|
|
1502
|
-
/* @__PURE__ */
|
|
1503
|
-
|
|
1645
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-1.5 sm:gap-2 overflow-x-auto pb-1 -mb-1 scrollbar-none", children: [
|
|
1646
|
+
L && y && w.length > 0 && /* @__PURE__ */ o(Ze, { children: [
|
|
1647
|
+
/* @__PURE__ */ o(
|
|
1648
|
+
Qe,
|
|
1504
1649
|
{
|
|
1505
|
-
className:
|
|
1650
|
+
className: l(
|
|
1506
1651
|
"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors",
|
|
1507
1652
|
"h-10 px-2 sm:px-3 gap-1 sm:gap-1.5 shrink-0",
|
|
1508
|
-
|
|
1653
|
+
M ? "bg-primary text-primary-foreground hover:bg-primary/90" : "border border-input bg-background hover:bg-accent hover:text-accent-foreground"
|
|
1509
1654
|
),
|
|
1510
1655
|
children: [
|
|
1511
|
-
/* @__PURE__ */ e(
|
|
1512
|
-
/* @__PURE__ */ e("span", { className: "text-xs sm:text-sm font-medium", children:
|
|
1513
|
-
/* @__PURE__ */ e(
|
|
1656
|
+
/* @__PURE__ */ e(yn, { className: "size-4" }),
|
|
1657
|
+
/* @__PURE__ */ e("span", { className: "text-xs sm:text-sm font-medium", children: c?.label ?? j.calendarView }),
|
|
1658
|
+
/* @__PURE__ */ e(et, { className: "size-3 opacity-60" })
|
|
1514
1659
|
]
|
|
1515
1660
|
}
|
|
1516
1661
|
),
|
|
1517
|
-
/* @__PURE__ */ e(
|
|
1518
|
-
const
|
|
1519
|
-
return /* @__PURE__ */
|
|
1520
|
-
|
|
1662
|
+
/* @__PURE__ */ e(He, { align: "start", className: "min-w-[120px]", children: w.map((C) => {
|
|
1663
|
+
const H = C.icon;
|
|
1664
|
+
return /* @__PURE__ */ o(
|
|
1665
|
+
Oe,
|
|
1521
1666
|
{
|
|
1522
|
-
onClick: () =>
|
|
1523
|
-
className:
|
|
1667
|
+
onClick: () => y(C.value),
|
|
1668
|
+
className: l(
|
|
1524
1669
|
"gap-2",
|
|
1525
|
-
n ===
|
|
1670
|
+
n === C.value && "bg-accent"
|
|
1526
1671
|
),
|
|
1527
1672
|
children: [
|
|
1528
|
-
/* @__PURE__ */ e(
|
|
1529
|
-
/* @__PURE__ */ e("span", { children:
|
|
1673
|
+
/* @__PURE__ */ e(H, { className: "size-4" }),
|
|
1674
|
+
/* @__PURE__ */ e("span", { children: C.label })
|
|
1530
1675
|
]
|
|
1531
1676
|
},
|
|
1532
|
-
|
|
1677
|
+
C.value
|
|
1533
1678
|
);
|
|
1534
1679
|
}) })
|
|
1535
1680
|
] }),
|
|
1536
|
-
|
|
1537
|
-
/* @__PURE__ */
|
|
1538
|
-
|
|
1681
|
+
B && y && /* @__PURE__ */ o(Ze, { children: [
|
|
1682
|
+
/* @__PURE__ */ o(
|
|
1683
|
+
Qe,
|
|
1539
1684
|
{
|
|
1540
|
-
className:
|
|
1685
|
+
className: l(
|
|
1541
1686
|
"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors",
|
|
1542
1687
|
"h-10 px-2 sm:px-3 gap-1 sm:gap-1.5 shrink-0",
|
|
1543
|
-
|
|
1688
|
+
F ? "bg-primary text-primary-foreground hover:bg-primary/90" : "border border-input bg-white hover:bg-zinc-50 hover:text-accent-foreground"
|
|
1544
1689
|
),
|
|
1545
1690
|
children: [
|
|
1546
|
-
/* @__PURE__ */ e(
|
|
1547
|
-
/* @__PURE__ */ e("span", { className: "text-xs sm:text-sm font-medium", children:
|
|
1548
|
-
/* @__PURE__ */ e(
|
|
1691
|
+
/* @__PURE__ */ e(fe, { className: "size-4" }),
|
|
1692
|
+
/* @__PURE__ */ e("span", { className: "text-xs sm:text-sm font-medium", children: S?.label ?? j.resourceView }),
|
|
1693
|
+
/* @__PURE__ */ e(et, { className: "size-3 opacity-60" })
|
|
1549
1694
|
]
|
|
1550
1695
|
}
|
|
1551
1696
|
),
|
|
1552
|
-
/* @__PURE__ */ e(
|
|
1553
|
-
const
|
|
1554
|
-
return /* @__PURE__ */
|
|
1555
|
-
|
|
1697
|
+
/* @__PURE__ */ e(He, { align: "start", className: "min-w-[120px]", children: nt.map((C) => {
|
|
1698
|
+
const H = C.icon;
|
|
1699
|
+
return /* @__PURE__ */ o(
|
|
1700
|
+
Oe,
|
|
1556
1701
|
{
|
|
1557
|
-
onClick: () =>
|
|
1558
|
-
className:
|
|
1702
|
+
onClick: () => y(C.value),
|
|
1703
|
+
className: l(
|
|
1559
1704
|
"gap-2",
|
|
1560
|
-
n ===
|
|
1705
|
+
n === C.value && "bg-accent"
|
|
1561
1706
|
),
|
|
1562
1707
|
children: [
|
|
1563
|
-
/* @__PURE__ */ e(
|
|
1564
|
-
/* @__PURE__ */ e("span", { children:
|
|
1708
|
+
/* @__PURE__ */ e(H, { className: "size-4" }),
|
|
1709
|
+
/* @__PURE__ */ e("span", { children: C.label })
|
|
1565
1710
|
]
|
|
1566
1711
|
},
|
|
1567
|
-
|
|
1712
|
+
C.value
|
|
1568
1713
|
);
|
|
1569
1714
|
}) })
|
|
1570
1715
|
] }),
|
|
1571
|
-
|
|
1572
|
-
/* @__PURE__ */ e(
|
|
1573
|
-
|
|
1716
|
+
P && u && /* @__PURE__ */ o(ue, { children: [
|
|
1717
|
+
/* @__PURE__ */ e(me, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1718
|
+
pe,
|
|
1574
1719
|
{
|
|
1575
1720
|
variant: "outline",
|
|
1576
1721
|
size: "icon",
|
|
1577
1722
|
className: "min-w-10 min-h-10 shrink-0 mx-0",
|
|
1578
|
-
children: /* @__PURE__ */ e(
|
|
1723
|
+
children: /* @__PURE__ */ e(bn, { className: "size-4 sm:size-5" })
|
|
1579
1724
|
}
|
|
1580
1725
|
) }),
|
|
1581
1726
|
/* @__PURE__ */ e(
|
|
1582
|
-
|
|
1727
|
+
le,
|
|
1583
1728
|
{
|
|
1584
1729
|
className: "w-auto min-w-80 p-0",
|
|
1585
1730
|
align: "end",
|
|
1586
1731
|
sideOffset: 8,
|
|
1587
|
-
children: /* @__PURE__ */ e("div", { className: "max-h-[70vh] overflow-y-auto p-4 space-y-6", children:
|
|
1732
|
+
children: /* @__PURE__ */ e("div", { className: "max-h-[70vh] overflow-y-auto p-4 space-y-6", children: u })
|
|
1588
1733
|
}
|
|
1589
1734
|
)
|
|
1590
1735
|
] }),
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1736
|
+
N,
|
|
1737
|
+
I && k && /* @__PURE__ */ o(
|
|
1738
|
+
pe,
|
|
1594
1739
|
{
|
|
1595
1740
|
className: "hidden lg:flex shrink-0 max-h-10",
|
|
1596
|
-
onClick:
|
|
1741
|
+
onClick: k,
|
|
1597
1742
|
children: [
|
|
1598
|
-
/* @__PURE__ */ e(
|
|
1599
|
-
|
|
1743
|
+
/* @__PURE__ */ e(tt, { className: "size-4" }),
|
|
1744
|
+
j.addEvent
|
|
1600
1745
|
]
|
|
1601
1746
|
}
|
|
1602
1747
|
)
|
|
1603
1748
|
] })
|
|
1604
1749
|
] }),
|
|
1605
|
-
|
|
1750
|
+
R && p && /* @__PURE__ */ e("div", { className: "flex items-center gap-2 pb-1 -mb-1 scrollbar-none", children: p })
|
|
1606
1751
|
] });
|
|
1607
1752
|
}
|
|
1608
|
-
function
|
|
1753
|
+
function Yn({
|
|
1609
1754
|
events: t,
|
|
1610
1755
|
date: n,
|
|
1611
|
-
daysAhead:
|
|
1756
|
+
daysAhead: r = 60,
|
|
1612
1757
|
badgeVariant: a = "colored",
|
|
1613
1758
|
onEventClick: i,
|
|
1614
|
-
className:
|
|
1759
|
+
className: h,
|
|
1615
1760
|
renderEvent: s,
|
|
1616
|
-
renderPopover:
|
|
1617
|
-
slots:
|
|
1618
|
-
classNames:
|
|
1761
|
+
renderPopover: y,
|
|
1762
|
+
slots: k,
|
|
1763
|
+
classNames: d
|
|
1619
1764
|
}) {
|
|
1620
|
-
const
|
|
1621
|
-
const
|
|
1622
|
-
|
|
1623
|
-
const g = new Date(
|
|
1624
|
-
return g.setDate(g.getDate() +
|
|
1625
|
-
}, [t,
|
|
1626
|
-
const
|
|
1627
|
-
for (const [
|
|
1765
|
+
const b = q(() => {
|
|
1766
|
+
const u = new Date(n);
|
|
1767
|
+
u.setHours(0, 0, 0, 0);
|
|
1768
|
+
const g = new Date(u);
|
|
1769
|
+
return g.setDate(g.getDate() + r), t.filter((p) => p.endDate >= u && p.startDate <= g);
|
|
1770
|
+
}, [t, r, n]), v = q(() => {
|
|
1771
|
+
const u = Mt(b), g = [];
|
|
1772
|
+
for (const [p, N] of u)
|
|
1628
1773
|
g.push({
|
|
1629
|
-
date: new Date(
|
|
1630
|
-
dateKey:
|
|
1631
|
-
events:
|
|
1774
|
+
date: new Date(p),
|
|
1775
|
+
dateKey: p,
|
|
1776
|
+
events: N
|
|
1632
1777
|
});
|
|
1633
|
-
return g.sort((
|
|
1634
|
-
}, [
|
|
1635
|
-
return
|
|
1778
|
+
return g.sort((p, N) => p.date.getTime() - N.date.getTime()), g;
|
|
1779
|
+
}, [b]);
|
|
1780
|
+
return v.length === 0 ? /* @__PURE__ */ e("div", { className: l("flex flex-col items-center justify-center h-full py-12", h), children: /* @__PURE__ */ o("div", { className: "text-center", children: [
|
|
1636
1781
|
/* @__PURE__ */ e("p", { className: "text-muted-foreground", children: "No events found" }),
|
|
1637
1782
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground/70", children: "No events scheduled for this period" })
|
|
1638
|
-
] }) }) : /* @__PURE__ */
|
|
1639
|
-
/* @__PURE__ */ e("div", { className: "sticky top-0 z-10 bg-background border-b px-4 py-3", children: /* @__PURE__ */
|
|
1783
|
+
] }) }) : /* @__PURE__ */ o("div", { className: l("flex flex-col h-full overflow-auto", d?.agendaList, h), children: [
|
|
1784
|
+
/* @__PURE__ */ e("div", { className: "sticky top-0 z-10 bg-background border-b px-4 py-3", children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
|
|
1640
1785
|
/* @__PURE__ */ e("h2", { className: "text-lg font-medium", children: "Schedule" }),
|
|
1641
|
-
/* @__PURE__ */
|
|
1642
|
-
|
|
1786
|
+
/* @__PURE__ */ o("span", { className: "text-sm text-muted-foreground", children: [
|
|
1787
|
+
b.length,
|
|
1643
1788
|
" event",
|
|
1644
|
-
|
|
1789
|
+
b.length !== 1 ? "s" : ""
|
|
1645
1790
|
] })
|
|
1646
1791
|
] }) }),
|
|
1647
|
-
/* @__PURE__ */ e("div", { className: "flex-1", children:
|
|
1648
|
-
const
|
|
1649
|
-
return /* @__PURE__ */
|
|
1792
|
+
/* @__PURE__ */ e("div", { className: "flex-1", children: v.map(({ date: u, dateKey: g, events: p }) => {
|
|
1793
|
+
const N = ce(u), f = u.toLocaleDateString([], { weekday: "short" }), E = u.getDate(), D = u.toLocaleDateString([], { month: "short" });
|
|
1794
|
+
return /* @__PURE__ */ o("div", { className: l("", d?.agendaDayGroup), children: [
|
|
1650
1795
|
/* @__PURE__ */ e(
|
|
1651
1796
|
"div",
|
|
1652
1797
|
{
|
|
1653
|
-
className:
|
|
1798
|
+
className: l(
|
|
1654
1799
|
"sticky top-[52px] z-10 bg-background px-4 py-3 border-b",
|
|
1655
|
-
|
|
1800
|
+
d?.agendaDayHeader
|
|
1656
1801
|
),
|
|
1657
|
-
children: /* @__PURE__ */
|
|
1658
|
-
/* @__PURE__ */
|
|
1802
|
+
children: /* @__PURE__ */ o("div", { className: "flex items-center gap-3", children: [
|
|
1803
|
+
/* @__PURE__ */ o("div", { className: "flex flex-col items-center min-w-[40px]", children: [
|
|
1659
1804
|
/* @__PURE__ */ e(
|
|
1660
1805
|
"span",
|
|
1661
1806
|
{
|
|
1662
|
-
className:
|
|
1807
|
+
className: l(
|
|
1663
1808
|
"text-[11px] font-medium uppercase tracking-wide",
|
|
1664
|
-
|
|
1809
|
+
N ? "text-primary" : "text-muted-foreground"
|
|
1665
1810
|
),
|
|
1666
|
-
children:
|
|
1811
|
+
children: f
|
|
1667
1812
|
}
|
|
1668
1813
|
),
|
|
1669
1814
|
/* @__PURE__ */ e(
|
|
1670
1815
|
"span",
|
|
1671
1816
|
{
|
|
1672
|
-
className:
|
|
1817
|
+
className: l(
|
|
1673
1818
|
"flex items-center justify-center rounded-full mt-0.5",
|
|
1674
1819
|
"size-10 text-xl font-normal",
|
|
1675
|
-
|
|
1820
|
+
N ? "bg-primary text-primary-foreground" : "text-foreground"
|
|
1676
1821
|
),
|
|
1677
|
-
children:
|
|
1822
|
+
children: E
|
|
1678
1823
|
}
|
|
1679
1824
|
)
|
|
1680
1825
|
] }),
|
|
1681
|
-
/* @__PURE__ */
|
|
1682
|
-
|
|
1826
|
+
/* @__PURE__ */ o("span", { className: "text-sm text-muted-foreground", children: [
|
|
1827
|
+
D,
|
|
1683
1828
|
" ",
|
|
1684
|
-
|
|
1829
|
+
u.getFullYear()
|
|
1685
1830
|
] })
|
|
1686
1831
|
] })
|
|
1687
1832
|
}
|
|
1688
1833
|
),
|
|
1689
|
-
/* @__PURE__ */ e("div", { className: "px-4 py-3 space-y-2 border-b last:border-b-0", children:
|
|
1690
|
-
(
|
|
1691
|
-
|
|
1834
|
+
/* @__PURE__ */ e("div", { className: "px-4 py-3 space-y-2 border-b last:border-b-0", children: p.map(
|
|
1835
|
+
(T) => s ? /* @__PURE__ */ e("div", { children: s({ event: T, variant: "full" }) }, T.id) : /* @__PURE__ */ e(
|
|
1836
|
+
We,
|
|
1692
1837
|
{
|
|
1693
|
-
event:
|
|
1838
|
+
event: T,
|
|
1694
1839
|
variant: "full",
|
|
1695
1840
|
badgeVariant: a,
|
|
1696
1841
|
onClick: i,
|
|
1697
|
-
disablePopover: !!i && !
|
|
1698
|
-
renderPopover:
|
|
1842
|
+
disablePopover: !!i && !y,
|
|
1843
|
+
renderPopover: y,
|
|
1699
1844
|
showTime: !0,
|
|
1700
1845
|
showDescription: !0,
|
|
1701
1846
|
showParticipants: !0,
|
|
1702
|
-
...
|
|
1847
|
+
...d?.eventCard && { className: d.eventCard }
|
|
1703
1848
|
},
|
|
1704
|
-
|
|
1849
|
+
T.id
|
|
1705
1850
|
)
|
|
1706
1851
|
) })
|
|
1707
1852
|
] }, g);
|
|
1708
1853
|
}) })
|
|
1709
1854
|
] });
|
|
1710
1855
|
}
|
|
1711
|
-
const
|
|
1712
|
-
function
|
|
1856
|
+
const De = 360, Ce = 480, _e = 280;
|
|
1857
|
+
function Sn({
|
|
1713
1858
|
isOpen: t,
|
|
1714
1859
|
onClose: n,
|
|
1715
|
-
date:
|
|
1860
|
+
date: r,
|
|
1716
1861
|
events: a,
|
|
1717
1862
|
anchorRect: i,
|
|
1718
|
-
badgeVariant:
|
|
1863
|
+
badgeVariant: h = "colored",
|
|
1719
1864
|
onEventClick: s,
|
|
1720
|
-
renderEvent:
|
|
1721
|
-
renderPopover:
|
|
1722
|
-
className:
|
|
1865
|
+
renderEvent: y,
|
|
1866
|
+
renderPopover: k,
|
|
1867
|
+
className: d
|
|
1723
1868
|
}) {
|
|
1724
|
-
const
|
|
1725
|
-
() => [...a].sort((
|
|
1869
|
+
const b = ne(null), v = ne(null), [u, g] = Q("closed"), p = q(
|
|
1870
|
+
() => [...a].sort((A, L) => A.startDate.getTime() - L.startDate.getTime()),
|
|
1726
1871
|
[a]
|
|
1727
|
-
),
|
|
1728
|
-
if (!i) return { top: 0, left: 0, width:
|
|
1729
|
-
const
|
|
1730
|
-
let
|
|
1731
|
-
|
|
1732
|
-
const
|
|
1733
|
-
let
|
|
1734
|
-
return
|
|
1872
|
+
), N = q(() => {
|
|
1873
|
+
if (!i) return { top: 0, left: 0, width: De, maxHeight: Ce };
|
|
1874
|
+
const A = typeof window < "u" ? window.innerWidth : 1200, L = typeof window < "u" ? window.innerHeight : 800;
|
|
1875
|
+
let B = i.left + i.width / 2 - De / 2;
|
|
1876
|
+
B = Math.max(16, Math.min(B, A - De - 16));
|
|
1877
|
+
const P = Math.min(a.length * 68 + 80, Ce);
|
|
1878
|
+
let I = i.top + i.height / 2 - P / 2;
|
|
1879
|
+
return I = Math.max(16, Math.min(I, L - P - 16)), { top: I, left: B, width: De, maxHeight: Ce };
|
|
1735
1880
|
}, [i, a.length]);
|
|
1736
|
-
|
|
1881
|
+
je(() => {
|
|
1737
1882
|
if (t && i)
|
|
1738
1883
|
g("entering"), requestAnimationFrame(() => {
|
|
1739
1884
|
requestAnimationFrame(() => {
|
|
1740
1885
|
g("open");
|
|
1741
1886
|
});
|
|
1742
1887
|
});
|
|
1743
|
-
else if (!t &&
|
|
1888
|
+
else if (!t && u === "open") {
|
|
1744
1889
|
g("exiting");
|
|
1745
|
-
const
|
|
1890
|
+
const A = setTimeout(() => {
|
|
1746
1891
|
g("closed");
|
|
1747
|
-
},
|
|
1748
|
-
return () => clearTimeout(
|
|
1892
|
+
}, _e);
|
|
1893
|
+
return () => clearTimeout(A);
|
|
1749
1894
|
}
|
|
1750
|
-
}, [t, i]),
|
|
1751
|
-
if (
|
|
1752
|
-
const
|
|
1753
|
-
|
|
1895
|
+
}, [t, i]), Ne(() => {
|
|
1896
|
+
if (u === "closed") return;
|
|
1897
|
+
const A = (L) => {
|
|
1898
|
+
L.key === "Escape" && (L.stopPropagation(), n());
|
|
1754
1899
|
};
|
|
1755
|
-
return document.addEventListener("keydown",
|
|
1756
|
-
}, [
|
|
1757
|
-
|
|
1758
|
-
}, [
|
|
1759
|
-
const
|
|
1760
|
-
(
|
|
1761
|
-
|
|
1900
|
+
return document.addEventListener("keydown", A), () => document.removeEventListener("keydown", A);
|
|
1901
|
+
}, [u, n]), Ne(() => {
|
|
1902
|
+
u === "open" && v.current && v.current.focus();
|
|
1903
|
+
}, [u]);
|
|
1904
|
+
const f = z(
|
|
1905
|
+
(A) => {
|
|
1906
|
+
A.target === b.current && n();
|
|
1762
1907
|
},
|
|
1763
1908
|
[n]
|
|
1764
1909
|
);
|
|
1765
|
-
if (
|
|
1766
|
-
const
|
|
1910
|
+
if (u === "closed") return null;
|
|
1911
|
+
const E = u === "entering" || u === "exiting", D = E && i ? {
|
|
1767
1912
|
// Collapsed state: match the day cell exactly
|
|
1768
1913
|
position: "fixed",
|
|
1769
1914
|
top: i.top,
|
|
@@ -1771,67 +1916,67 @@ function on({
|
|
|
1771
1916
|
width: i.width,
|
|
1772
1917
|
height: i.height,
|
|
1773
1918
|
maxHeight: i.height,
|
|
1774
|
-
opacity:
|
|
1919
|
+
opacity: u === "entering" ? 0.7 : 0,
|
|
1775
1920
|
transform: "scale(1)",
|
|
1776
1921
|
borderRadius: "8px"
|
|
1777
1922
|
} : {
|
|
1778
1923
|
// Expanded state: full panel
|
|
1779
1924
|
position: "fixed",
|
|
1780
|
-
top:
|
|
1781
|
-
left:
|
|
1782
|
-
width:
|
|
1783
|
-
maxHeight:
|
|
1925
|
+
top: N.top,
|
|
1926
|
+
left: N.left,
|
|
1927
|
+
width: N.width,
|
|
1928
|
+
maxHeight: N.maxHeight,
|
|
1784
1929
|
opacity: 1,
|
|
1785
1930
|
transform: "scale(1)",
|
|
1786
1931
|
borderRadius: "12px"
|
|
1787
|
-
},
|
|
1932
|
+
}, T = E ? 0 : 1, $ = r.toLocaleDateString(void 0, {
|
|
1788
1933
|
weekday: "long",
|
|
1789
1934
|
month: "long",
|
|
1790
1935
|
day: "numeric"
|
|
1791
1936
|
});
|
|
1792
|
-
return /* @__PURE__ */
|
|
1937
|
+
return /* @__PURE__ */ o(kt, { children: [
|
|
1793
1938
|
/* @__PURE__ */ e(
|
|
1794
1939
|
"div",
|
|
1795
1940
|
{
|
|
1796
|
-
ref:
|
|
1941
|
+
ref: b,
|
|
1797
1942
|
role: "presentation",
|
|
1798
|
-
onClick:
|
|
1943
|
+
onClick: f,
|
|
1799
1944
|
className: "ic-expansion-backdrop",
|
|
1800
1945
|
style: {
|
|
1801
1946
|
position: "fixed",
|
|
1802
1947
|
inset: 0,
|
|
1803
1948
|
zIndex: 50,
|
|
1804
1949
|
backgroundColor: "rgba(0, 0, 0, 0.2)",
|
|
1805
|
-
opacity:
|
|
1806
|
-
transition: `opacity ${
|
|
1950
|
+
opacity: T,
|
|
1951
|
+
transition: `opacity ${_e}ms cubic-bezier(0.32, 0.72, 0, 1)`
|
|
1807
1952
|
}
|
|
1808
1953
|
}
|
|
1809
1954
|
),
|
|
1810
|
-
/* @__PURE__ */
|
|
1955
|
+
/* @__PURE__ */ o(
|
|
1811
1956
|
"div",
|
|
1812
1957
|
{
|
|
1813
|
-
ref:
|
|
1958
|
+
ref: v,
|
|
1814
1959
|
role: "dialog",
|
|
1815
1960
|
"aria-modal": "true",
|
|
1816
1961
|
"aria-label": `Events for ${$}`,
|
|
1817
1962
|
tabIndex: -1,
|
|
1818
|
-
className:
|
|
1963
|
+
className: l(
|
|
1819
1964
|
"ic-expansion-panel",
|
|
1820
1965
|
"bg-background border border-border shadow-2xl overflow-hidden",
|
|
1821
1966
|
"focus:outline-none",
|
|
1822
|
-
|
|
1967
|
+
d
|
|
1823
1968
|
),
|
|
1824
1969
|
style: {
|
|
1825
|
-
...
|
|
1970
|
+
...D,
|
|
1826
1971
|
zIndex: 51,
|
|
1827
|
-
transition: `all ${
|
|
1972
|
+
transition: `all ${_e}ms cubic-bezier(0.32, 0.72, 0, 1)`,
|
|
1828
1973
|
willChange: "top, left, width, height, max-height, opacity, border-radius"
|
|
1829
1974
|
},
|
|
1830
1975
|
children: [
|
|
1831
|
-
/* @__PURE__ */
|
|
1832
|
-
/* @__PURE__ */
|
|
1976
|
+
/* @__PURE__ */ o("div", { className: "flex items-center justify-between px-4 py-3 border-b bg-muted/30", children: [
|
|
1977
|
+
/* @__PURE__ */ o("div", { className: "flex flex-col", children: [
|
|
1833
1978
|
/* @__PURE__ */ e("span", { className: "text-sm font-semibold text-foreground", children: $ }),
|
|
1834
|
-
/* @__PURE__ */
|
|
1979
|
+
/* @__PURE__ */ o("span", { className: "text-xs text-muted-foreground", children: [
|
|
1835
1980
|
a.length,
|
|
1836
1981
|
" event",
|
|
1837
1982
|
a.length !== 1 ? "s" : ""
|
|
@@ -1844,7 +1989,7 @@ function on({
|
|
|
1844
1989
|
onClick: n,
|
|
1845
1990
|
className: "flex items-center justify-center size-7 rounded-full hover:bg-muted transition-colors text-muted-foreground hover:text-foreground",
|
|
1846
1991
|
"aria-label": "Close",
|
|
1847
|
-
children: /* @__PURE__ */
|
|
1992
|
+
children: /* @__PURE__ */ o(
|
|
1848
1993
|
"svg",
|
|
1849
1994
|
{
|
|
1850
1995
|
width: "14",
|
|
@@ -1864,32 +2009,32 @@ function on({
|
|
|
1864
2009
|
}
|
|
1865
2010
|
)
|
|
1866
2011
|
] }),
|
|
1867
|
-
/* @__PURE__ */
|
|
2012
|
+
/* @__PURE__ */ o(
|
|
1868
2013
|
"div",
|
|
1869
2014
|
{
|
|
1870
2015
|
className: "overflow-y-auto px-3 py-2 space-y-1.5",
|
|
1871
|
-
style: { maxHeight: `${
|
|
2016
|
+
style: { maxHeight: `${Ce - 64}px` },
|
|
1872
2017
|
children: [
|
|
1873
|
-
|
|
2018
|
+
p.map((A) => /* @__PURE__ */ e(
|
|
1874
2019
|
"div",
|
|
1875
2020
|
{
|
|
1876
|
-
onPointerDown: (
|
|
1877
|
-
children:
|
|
1878
|
-
|
|
2021
|
+
onPointerDown: (L) => L.stopPropagation(),
|
|
2022
|
+
children: y ? y({ event: A, variant: "compact" }) : /* @__PURE__ */ e(
|
|
2023
|
+
We,
|
|
1879
2024
|
{
|
|
1880
|
-
event:
|
|
2025
|
+
event: A,
|
|
1881
2026
|
variant: "compact",
|
|
1882
|
-
badgeVariant:
|
|
1883
|
-
onClick: (
|
|
1884
|
-
n(), s?.(
|
|
2027
|
+
badgeVariant: h,
|
|
2028
|
+
onClick: (L) => {
|
|
2029
|
+
n(), s?.(L);
|
|
1885
2030
|
},
|
|
1886
|
-
disablePopover: !!s && !
|
|
1887
|
-
renderPopover:
|
|
2031
|
+
disablePopover: !!s && !k,
|
|
2032
|
+
renderPopover: k,
|
|
1888
2033
|
showTime: !0
|
|
1889
2034
|
}
|
|
1890
2035
|
)
|
|
1891
2036
|
},
|
|
1892
|
-
|
|
2037
|
+
A.id
|
|
1893
2038
|
)),
|
|
1894
2039
|
a.length === 0 && /* @__PURE__ */ e("div", { className: "py-6 text-center text-sm text-muted-foreground", children: "No events" })
|
|
1895
2040
|
]
|
|
@@ -1900,65 +2045,65 @@ function on({
|
|
|
1900
2045
|
)
|
|
1901
2046
|
] });
|
|
1902
2047
|
}
|
|
1903
|
-
function
|
|
2048
|
+
function Mn({
|
|
1904
2049
|
event: t,
|
|
1905
2050
|
date: n,
|
|
1906
|
-
onEventClick:
|
|
2051
|
+
onEventClick: r,
|
|
1907
2052
|
disablePopover: a,
|
|
1908
2053
|
renderPopover: i
|
|
1909
2054
|
}) {
|
|
1910
|
-
const [
|
|
1911
|
-
a &&
|
|
1912
|
-
}, [a,
|
|
2055
|
+
const [h, s] = Q(!1), y = de(t.color), k = Te(t), d = se(t.startDate, n), b = se(t.endDate, n), v = k && se(t.startDate, t.endDate), u = z(() => {
|
|
2056
|
+
a && r ? r(t) : a || s(!0);
|
|
2057
|
+
}, [a, r, t]), g = z(() => {
|
|
1913
2058
|
s(!1);
|
|
1914
|
-
}, []),
|
|
2059
|
+
}, []), p = /* @__PURE__ */ o(
|
|
1915
2060
|
"button",
|
|
1916
2061
|
{
|
|
1917
2062
|
type: "button",
|
|
1918
|
-
onClick:
|
|
1919
|
-
title:
|
|
1920
|
-
className:
|
|
2063
|
+
onClick: u,
|
|
2064
|
+
title: J(t),
|
|
2065
|
+
className: l(
|
|
1921
2066
|
"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium transition-opacity hover:opacity-80",
|
|
1922
2067
|
"sm:px-2 sm:py-1 sm:text-xs",
|
|
1923
|
-
|
|
1924
|
-
|
|
2068
|
+
y.bg,
|
|
2069
|
+
y.text,
|
|
1925
2070
|
t.isCanceled && "opacity-60 line-through"
|
|
1926
2071
|
),
|
|
1927
2072
|
children: [
|
|
1928
|
-
!
|
|
1929
|
-
!
|
|
1930
|
-
!
|
|
2073
|
+
!v && d && !b && "→ ",
|
|
2074
|
+
!v && !d && b && " ←",
|
|
2075
|
+
!v && !d && !b && "↔ ",
|
|
1931
2076
|
/* @__PURE__ */ e("span", { className: "truncate max-w-24 sm:max-w-32", children: t.title }),
|
|
1932
|
-
|
|
2077
|
+
v && /* @__PURE__ */ e("span", { className: "text-[9px] opacity-70 sm:text-[10px]", children: "All day" })
|
|
1933
2078
|
]
|
|
1934
2079
|
}
|
|
1935
|
-
),
|
|
2080
|
+
), N = /* @__PURE__ */ e(re, { children: /* @__PURE__ */ o("div", { className: "flex flex-col gap-0.5", children: [
|
|
1936
2081
|
/* @__PURE__ */ e("div", { className: "font-medium", children: t.title }),
|
|
1937
|
-
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children:
|
|
2082
|
+
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: J(t) })
|
|
1938
2083
|
] }) });
|
|
1939
|
-
return a ? /* @__PURE__ */
|
|
1940
|
-
/* @__PURE__ */ e(
|
|
1941
|
-
|
|
1942
|
-
] }) : /* @__PURE__ */
|
|
1943
|
-
/* @__PURE__ */ e(
|
|
1944
|
-
/* @__PURE__ */ e(
|
|
2084
|
+
return a ? /* @__PURE__ */ o(ae, { children: [
|
|
2085
|
+
/* @__PURE__ */ e(ie, { asChild: !0, children: p }),
|
|
2086
|
+
N
|
|
2087
|
+
] }) : /* @__PURE__ */ o(ue, { open: h, onOpenChange: s, children: [
|
|
2088
|
+
/* @__PURE__ */ e(me, { asChild: !0, children: p }),
|
|
2089
|
+
/* @__PURE__ */ e(le, { className: "w-80", children: i ? i({ event: t, onClose: g }) : /* @__PURE__ */ e(Tn, { event: t, onClose: g }) })
|
|
1945
2090
|
] });
|
|
1946
2091
|
}
|
|
1947
|
-
function
|
|
2092
|
+
function Tn({
|
|
1948
2093
|
event: t,
|
|
1949
2094
|
onClose: n
|
|
1950
2095
|
}) {
|
|
1951
|
-
const
|
|
1952
|
-
return /* @__PURE__ */
|
|
1953
|
-
/* @__PURE__ */
|
|
1954
|
-
/* @__PURE__ */ e("div", { className:
|
|
1955
|
-
/* @__PURE__ */
|
|
1956
|
-
/* @__PURE__ */ e("h3", { className:
|
|
1957
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-1 text-sm text-muted-foreground mt-1 tabular-nums", children:
|
|
2096
|
+
const r = de(t.color), a = t.isCanceled ?? !1;
|
|
2097
|
+
return /* @__PURE__ */ o("div", { className: "space-y-3", children: [
|
|
2098
|
+
/* @__PURE__ */ o("div", { className: "flex items-start gap-3", children: [
|
|
2099
|
+
/* @__PURE__ */ e("div", { className: l("size-4 rounded shrink-0 mt-0.5", r.dot) }),
|
|
2100
|
+
/* @__PURE__ */ o("div", { className: "flex-1 min-w-0", children: [
|
|
2101
|
+
/* @__PURE__ */ e("h3", { className: l("font-semibold text-lg", a && "line-through opacity-50"), children: t.title }),
|
|
2102
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-1 text-sm text-muted-foreground mt-1 tabular-nums", children: J(t) })
|
|
1958
2103
|
] })
|
|
1959
2104
|
] }),
|
|
1960
2105
|
t.description && /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: t.description }),
|
|
1961
|
-
/* @__PURE__ */
|
|
2106
|
+
/* @__PURE__ */ o("div", { className: "flex flex-wrap gap-1.5", children: [
|
|
1962
2107
|
t.isAllDay && /* @__PURE__ */ e("span", { className: "text-xs bg-muted px-2 py-0.5 rounded-full font-medium", children: "All day" }),
|
|
1963
2108
|
a && /* @__PURE__ */ e("span", { className: "text-xs bg-red-100 dark:bg-red-950/30 text-red-700 dark:text-red-300 px-2 py-0.5 rounded-full font-medium", children: "Canceled" })
|
|
1964
2109
|
] }),
|
|
@@ -1973,236 +2118,236 @@ function sn({
|
|
|
1973
2118
|
) })
|
|
1974
2119
|
] });
|
|
1975
2120
|
}
|
|
1976
|
-
function
|
|
2121
|
+
function zn({
|
|
1977
2122
|
events: t,
|
|
1978
2123
|
date: n,
|
|
1979
|
-
onEventClick:
|
|
2124
|
+
onEventClick: r,
|
|
1980
2125
|
disablePopover: a = !1,
|
|
1981
2126
|
renderPopover: i,
|
|
1982
|
-
className:
|
|
2127
|
+
className: h
|
|
1983
2128
|
}) {
|
|
1984
2129
|
if (t.length === 0) return null;
|
|
1985
|
-
const s = t.some((
|
|
1986
|
-
(
|
|
1987
|
-
),
|
|
1988
|
-
return /* @__PURE__ */
|
|
1989
|
-
/* @__PURE__ */ e("span", { className: "text-[10px] font-medium text-muted-foreground sm:text-xs", children:
|
|
1990
|
-
/* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: t.map((
|
|
1991
|
-
|
|
2130
|
+
const s = t.some((d) => Te(d) && se(d.startDate, d.endDate)), y = t.some(
|
|
2131
|
+
(d) => !se(d.startDate, d.endDate) || Te(d) && !se(d.startDate, d.endDate)
|
|
2132
|
+
), k = s && y ? "All day / Multi-day" : s ? "All day" : "Multi-day";
|
|
2133
|
+
return /* @__PURE__ */ o("div", { className: l("border-b bg-muted/20 px-2 py-1.5 space-y-1", "sm:px-4 sm:py-2", h), children: [
|
|
2134
|
+
/* @__PURE__ */ e("span", { className: "text-[10px] font-medium text-muted-foreground sm:text-xs", children: k }),
|
|
2135
|
+
/* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: t.map((d) => /* @__PURE__ */ e(
|
|
2136
|
+
Mn,
|
|
1992
2137
|
{
|
|
1993
|
-
event:
|
|
2138
|
+
event: d,
|
|
1994
2139
|
date: n,
|
|
1995
|
-
onEventClick:
|
|
2140
|
+
onEventClick: r,
|
|
1996
2141
|
disablePopover: a,
|
|
1997
2142
|
renderPopover: i
|
|
1998
2143
|
},
|
|
1999
|
-
|
|
2144
|
+
d.id
|
|
2000
2145
|
)) })
|
|
2001
2146
|
] });
|
|
2002
2147
|
}
|
|
2003
|
-
const
|
|
2004
|
-
function
|
|
2148
|
+
const Wn = 5;
|
|
2149
|
+
function vt({
|
|
2005
2150
|
slot: t,
|
|
2006
2151
|
onSelectionStart: n,
|
|
2007
|
-
onSelectionMove:
|
|
2152
|
+
onSelectionMove: r,
|
|
2008
2153
|
onSelectionEnd: a,
|
|
2009
2154
|
isSelected: i = !1,
|
|
2010
|
-
isSelecting:
|
|
2155
|
+
isSelecting: h = !1,
|
|
2011
2156
|
disabled: s = !1,
|
|
2012
|
-
ariaLabel:
|
|
2013
|
-
children:
|
|
2014
|
-
className:
|
|
2015
|
-
height:
|
|
2016
|
-
style:
|
|
2017
|
-
dataAttributes:
|
|
2157
|
+
ariaLabel: y,
|
|
2158
|
+
children: k,
|
|
2159
|
+
className: d,
|
|
2160
|
+
height: b,
|
|
2161
|
+
style: v,
|
|
2162
|
+
dataAttributes: u
|
|
2018
2163
|
}) {
|
|
2019
|
-
const g = ne(null),
|
|
2020
|
-
(
|
|
2021
|
-
s ||
|
|
2164
|
+
const g = ne(null), p = ne(!1), N = ne(!1), f = ne(null), [E, D] = Q(!1), T = Ve(), $ = z(
|
|
2165
|
+
(W) => {
|
|
2166
|
+
s || W.button !== 0 && W.pointerType === "mouse" || (W.preventDefault(), g.current = { x: W.clientX, y: W.clientY }, p.current = !1, N.current = !0, n?.(t));
|
|
2022
2167
|
},
|
|
2023
2168
|
[s, t, n]
|
|
2024
|
-
),
|
|
2025
|
-
(
|
|
2026
|
-
if (!(g.current &&
|
|
2027
|
-
const
|
|
2028
|
-
Math.sqrt(
|
|
2169
|
+
), A = z(
|
|
2170
|
+
(W) => {
|
|
2171
|
+
if (!(g.current && N.current && !s)) return;
|
|
2172
|
+
const x = W.clientX - g.current.x, _ = W.clientY - g.current.y;
|
|
2173
|
+
Math.sqrt(x * x + _ * _) >= Wn && (p.current = !0);
|
|
2029
2174
|
},
|
|
2030
2175
|
[s]
|
|
2031
|
-
),
|
|
2032
|
-
(
|
|
2033
|
-
s || (
|
|
2176
|
+
), L = z(
|
|
2177
|
+
(W) => {
|
|
2178
|
+
s || (W.buttons > 0 || h) && r?.(t);
|
|
2034
2179
|
},
|
|
2035
|
-
[s,
|
|
2036
|
-
),
|
|
2037
|
-
s || (a?.(), g.current = null,
|
|
2038
|
-
}, [s, a]),
|
|
2039
|
-
(
|
|
2040
|
-
if (!
|
|
2041
|
-
|
|
2042
|
-
const
|
|
2043
|
-
|
|
2180
|
+
[s, h, t, r]
|
|
2181
|
+
), B = z(() => {
|
|
2182
|
+
s || (a?.(), g.current = null, p.current = !1, N.current = !1);
|
|
2183
|
+
}, [s, a]), P = z(
|
|
2184
|
+
(W) => {
|
|
2185
|
+
if (!T?.isDragging || s) return;
|
|
2186
|
+
W.preventDefault(), W.dataTransfer.dropEffect = "move", D(!0);
|
|
2187
|
+
const x = /* @__PURE__ */ new Date(), _ = t.hour ?? x.getHours(), M = t.minute ?? (x.getMinutes() >= 30 ? 30 : 0);
|
|
2188
|
+
T.updateDragPreview?.(t.date, _, M);
|
|
2044
2189
|
},
|
|
2045
|
-
[
|
|
2046
|
-
),
|
|
2047
|
-
|
|
2048
|
-
}, []),
|
|
2049
|
-
(
|
|
2050
|
-
|
|
2190
|
+
[T, s, t]
|
|
2191
|
+
), I = z(() => {
|
|
2192
|
+
D(!1);
|
|
2193
|
+
}, []), R = z(
|
|
2194
|
+
(W) => {
|
|
2195
|
+
W.preventDefault(), D(!1), !(!T?.isDragging || s) && T.endDrag?.();
|
|
2051
2196
|
},
|
|
2052
|
-
[
|
|
2197
|
+
[T, s]
|
|
2053
2198
|
);
|
|
2054
|
-
|
|
2055
|
-
const
|
|
2056
|
-
|
|
2199
|
+
Ne(() => {
|
|
2200
|
+
const W = () => {
|
|
2201
|
+
N.current && (N.current = !1, g.current = null, p.current = !1);
|
|
2057
2202
|
};
|
|
2058
|
-
return window.addEventListener("pointerup",
|
|
2059
|
-
window.removeEventListener("pointerup",
|
|
2203
|
+
return window.addEventListener("pointerup", W), window.addEventListener("pointercancel", W), () => {
|
|
2204
|
+
window.removeEventListener("pointerup", W), window.removeEventListener("pointercancel", W);
|
|
2060
2205
|
};
|
|
2061
2206
|
}, []);
|
|
2062
|
-
const
|
|
2063
|
-
(
|
|
2064
|
-
s || (
|
|
2207
|
+
const j = z(
|
|
2208
|
+
(W) => {
|
|
2209
|
+
s || (W.key === "Enter" || W.key === " ") && (W.preventDefault(), n?.(t), a?.());
|
|
2065
2210
|
},
|
|
2066
2211
|
[s, t, n, a]
|
|
2067
2212
|
);
|
|
2068
2213
|
return /* @__PURE__ */ e(
|
|
2069
2214
|
"button",
|
|
2070
2215
|
{
|
|
2071
|
-
ref:
|
|
2216
|
+
ref: f,
|
|
2072
2217
|
type: "button",
|
|
2073
|
-
"aria-label":
|
|
2218
|
+
"aria-label": y,
|
|
2074
2219
|
"aria-disabled": s,
|
|
2075
2220
|
"aria-pressed": i,
|
|
2076
2221
|
disabled: s,
|
|
2077
2222
|
onPointerDown: $,
|
|
2078
|
-
onPointerMove:
|
|
2079
|
-
onPointerUp:
|
|
2080
|
-
onPointerEnter:
|
|
2081
|
-
onKeyDown:
|
|
2082
|
-
onDragOver:
|
|
2083
|
-
onDragLeave:
|
|
2084
|
-
onDrop:
|
|
2085
|
-
className:
|
|
2223
|
+
onPointerMove: A,
|
|
2224
|
+
onPointerUp: B,
|
|
2225
|
+
onPointerEnter: L,
|
|
2226
|
+
onKeyDown: j,
|
|
2227
|
+
onDragOver: P,
|
|
2228
|
+
onDragLeave: I,
|
|
2229
|
+
onDrop: R,
|
|
2230
|
+
className: l(
|
|
2086
2231
|
"select-none touch-none cursor-pointer transition-colors",
|
|
2087
2232
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",
|
|
2088
2233
|
// Hover state (only when not in selection)
|
|
2089
|
-
!(
|
|
2234
|
+
!(h || s) && "hover:bg-blue-50/60",
|
|
2090
2235
|
// Selection state — blue tint matching the primary color
|
|
2091
2236
|
i && "bg-blue-100/70",
|
|
2092
2237
|
// Drag over state - visual feedback when event is dragged over
|
|
2093
|
-
|
|
2238
|
+
E && "bg-primary/20 ring-2 ring-primary ring-inset",
|
|
2094
2239
|
// Disabled state
|
|
2095
2240
|
s && "cursor-not-allowed opacity-50",
|
|
2096
|
-
|
|
2241
|
+
d
|
|
2097
2242
|
),
|
|
2098
|
-
style: { height:
|
|
2099
|
-
...
|
|
2100
|
-
children:
|
|
2243
|
+
style: { height: b, ...v },
|
|
2244
|
+
...u,
|
|
2245
|
+
children: k
|
|
2101
2246
|
}
|
|
2102
2247
|
);
|
|
2103
2248
|
}
|
|
2104
|
-
function
|
|
2249
|
+
function Nt({
|
|
2105
2250
|
slot: t,
|
|
2106
2251
|
date: n,
|
|
2107
|
-
hour:
|
|
2252
|
+
hour: r,
|
|
2108
2253
|
minute: a,
|
|
2109
2254
|
ariaLabel: i,
|
|
2110
|
-
...
|
|
2255
|
+
...h
|
|
2111
2256
|
}) {
|
|
2112
|
-
const s = t ?? { date: n, hour:
|
|
2113
|
-
return /* @__PURE__ */ e(
|
|
2257
|
+
const s = t ?? { date: n, hour: r ?? 0, minute: a ?? 0 }, y = i ?? `Add event at ${(s.hour ?? 0).toString().padStart(2, "0")}:${(s.minute ?? 0).toString().padStart(2, "0")} on ${s.date.toLocaleDateString()}`;
|
|
2258
|
+
return /* @__PURE__ */ e(vt, { slot: s, ariaLabel: y, ...h });
|
|
2114
2259
|
}
|
|
2115
|
-
function
|
|
2116
|
-
const i = t ?? { date: n },
|
|
2117
|
-
return /* @__PURE__ */ e(
|
|
2260
|
+
function An({ slot: t, date: n, ariaLabel: r, ...a }) {
|
|
2261
|
+
const i = t ?? { date: n }, h = r ?? `Select ${i.date.toLocaleDateString()}`;
|
|
2262
|
+
return /* @__PURE__ */ e(vt, { slot: i, ariaLabel: h, ...a });
|
|
2118
2263
|
}
|
|
2119
|
-
const
|
|
2120
|
-
function
|
|
2264
|
+
const be = 96, Ie = 72, Be = 80;
|
|
2265
|
+
function Jn({
|
|
2121
2266
|
events: t,
|
|
2122
2267
|
date: n,
|
|
2123
|
-
visibleHours:
|
|
2268
|
+
visibleHours: r = { startHour: 0, endHour: 24 },
|
|
2124
2269
|
workingHours: a,
|
|
2125
2270
|
slotDuration: i = 30,
|
|
2126
|
-
badgeVariant:
|
|
2271
|
+
badgeVariant: h = "colored",
|
|
2127
2272
|
onEventClick: s,
|
|
2128
|
-
onSlotSelect:
|
|
2129
|
-
className:
|
|
2130
|
-
renderEvent:
|
|
2131
|
-
renderPopover:
|
|
2132
|
-
slots:
|
|
2133
|
-
classNames:
|
|
2273
|
+
onSlotSelect: y,
|
|
2274
|
+
className: k,
|
|
2275
|
+
renderEvent: d,
|
|
2276
|
+
renderPopover: b,
|
|
2277
|
+
slots: v,
|
|
2278
|
+
classNames: u
|
|
2134
2279
|
}) {
|
|
2135
|
-
const g = 60 / i,
|
|
2136
|
-
const
|
|
2137
|
-
for (let
|
|
2138
|
-
|
|
2139
|
-
return
|
|
2140
|
-
}, [g, i]),
|
|
2141
|
-
const
|
|
2142
|
-
for (const
|
|
2143
|
-
|
|
2144
|
-
return
|
|
2145
|
-
}, [
|
|
2146
|
-
if (!
|
|
2147
|
-
const
|
|
2148
|
-
return
|
|
2149
|
-
}, [
|
|
2150
|
-
|
|
2151
|
-
const
|
|
2152
|
-
if (!
|
|
2153
|
-
const
|
|
2154
|
-
let
|
|
2155
|
-
if (
|
|
2156
|
-
const
|
|
2157
|
-
|
|
2280
|
+
const g = 60 / i, p = 100 / g, N = q(() => {
|
|
2281
|
+
const w = [];
|
|
2282
|
+
for (let c = 0; c < g; c++)
|
|
2283
|
+
w.push(c * i);
|
|
2284
|
+
return w;
|
|
2285
|
+
}, [g, i]), f = q(() => Fe(t, n), [t, n]), { singleDay: E, multiDay: D } = q(() => it(f), [f]), T = q(() => {
|
|
2286
|
+
const w = st(E, n, r, be), c = /* @__PURE__ */ new Map();
|
|
2287
|
+
for (const m of w)
|
|
2288
|
+
c.set(m.event.id, m.position);
|
|
2289
|
+
return c;
|
|
2290
|
+
}, [E, n, r]), $ = q(() => lt(r), [r]), A = /* @__PURE__ */ new Date(), L = ce(n), B = q(() => {
|
|
2291
|
+
if (!L) return 0;
|
|
2292
|
+
const w = A.getHours() + A.getMinutes() / 60;
|
|
2293
|
+
return w < r.startHour || w > r.endHour ? -1 : (w - r.startHour) * be;
|
|
2294
|
+
}, [L, r, A]), P = ne(null);
|
|
2295
|
+
je(() => {
|
|
2296
|
+
const w = P.current;
|
|
2297
|
+
if (!w) return;
|
|
2298
|
+
const c = () => {
|
|
2299
|
+
let m;
|
|
2300
|
+
if (L) {
|
|
2301
|
+
const C = (/* @__PURE__ */ new Date()).getHours();
|
|
2302
|
+
m = Math.max(C - 1, r.startHour);
|
|
2158
2303
|
} else {
|
|
2159
|
-
const
|
|
2160
|
-
|
|
2304
|
+
const C = n.getDay(), H = a?.[C];
|
|
2305
|
+
H?.enabled && H.from > 0 ? m = Math.max(H.from - 1, r.startHour) : m = Math.max(7, r.startHour);
|
|
2161
2306
|
}
|
|
2162
|
-
const
|
|
2163
|
-
|
|
2164
|
-
top:
|
|
2307
|
+
const S = (m - r.startHour) * be;
|
|
2308
|
+
w.scrollTo({
|
|
2309
|
+
top: S,
|
|
2165
2310
|
behavior: "instant"
|
|
2166
2311
|
});
|
|
2167
2312
|
};
|
|
2168
2313
|
requestAnimationFrame(() => {
|
|
2169
|
-
requestAnimationFrame(
|
|
2314
|
+
requestAnimationFrame(c);
|
|
2170
2315
|
});
|
|
2171
|
-
}, [n, a,
|
|
2172
|
-
const
|
|
2173
|
-
(
|
|
2174
|
-
|
|
2316
|
+
}, [n, a, r, L]);
|
|
2317
|
+
const I = Ge(), R = z(
|
|
2318
|
+
(w) => {
|
|
2319
|
+
I?.startSelection(w);
|
|
2175
2320
|
},
|
|
2176
|
-
[
|
|
2177
|
-
),
|
|
2178
|
-
(
|
|
2179
|
-
|
|
2321
|
+
[I]
|
|
2322
|
+
), j = z(
|
|
2323
|
+
(w) => {
|
|
2324
|
+
I?.updateSelection(w);
|
|
2180
2325
|
},
|
|
2181
|
-
[
|
|
2182
|
-
),
|
|
2183
|
-
|
|
2184
|
-
}, [
|
|
2185
|
-
(
|
|
2186
|
-
s?.(
|
|
2326
|
+
[I]
|
|
2327
|
+
), W = z(() => {
|
|
2328
|
+
I?.endSelection();
|
|
2329
|
+
}, [I]), x = z(
|
|
2330
|
+
(w) => {
|
|
2331
|
+
s?.(w);
|
|
2187
2332
|
},
|
|
2188
2333
|
[s]
|
|
2189
|
-
), _ = n.toLocaleDateString([], { weekday: "short" }),
|
|
2190
|
-
return /* @__PURE__ */
|
|
2334
|
+
), _ = n.toLocaleDateString([], { weekday: "short" }), M = n.getDate(), F = ce(n);
|
|
2335
|
+
return /* @__PURE__ */ o("div", { className: l("flex flex-col h-full", k), children: [
|
|
2191
2336
|
/* @__PURE__ */ e(
|
|
2192
2337
|
"div",
|
|
2193
2338
|
{
|
|
2194
|
-
className:
|
|
2339
|
+
className: l(
|
|
2195
2340
|
"flex items-center gap-3 border-b px-4 py-3",
|
|
2196
|
-
|
|
2197
|
-
|
|
2341
|
+
u?.columnHeader,
|
|
2342
|
+
F && u?.columnHeaderToday
|
|
2198
2343
|
),
|
|
2199
|
-
children: /* @__PURE__ */
|
|
2344
|
+
children: /* @__PURE__ */ o("div", { className: "flex flex-col items-center", children: [
|
|
2200
2345
|
/* @__PURE__ */ e(
|
|
2201
2346
|
"span",
|
|
2202
2347
|
{
|
|
2203
|
-
className:
|
|
2348
|
+
className: l(
|
|
2204
2349
|
"text-[11px] font-medium uppercase tracking-wide",
|
|
2205
|
-
|
|
2350
|
+
F ? "text-primary" : "text-muted-foreground"
|
|
2206
2351
|
),
|
|
2207
2352
|
children: _
|
|
2208
2353
|
}
|
|
@@ -2210,160 +2355,160 @@ function Tn({
|
|
|
2210
2355
|
/* @__PURE__ */ e(
|
|
2211
2356
|
"span",
|
|
2212
2357
|
{
|
|
2213
|
-
className:
|
|
2358
|
+
className: l(
|
|
2214
2359
|
"flex items-center justify-center rounded-full mt-0.5",
|
|
2215
2360
|
"size-12 text-3xl font-normal",
|
|
2216
|
-
|
|
2361
|
+
F ? "bg-primary text-primary-foreground" : "text-foreground"
|
|
2217
2362
|
),
|
|
2218
|
-
children:
|
|
2363
|
+
children: M
|
|
2219
2364
|
}
|
|
2220
2365
|
)
|
|
2221
2366
|
] })
|
|
2222
2367
|
}
|
|
2223
2368
|
),
|
|
2224
|
-
|
|
2225
|
-
|
|
2369
|
+
D.length > 0 && /* @__PURE__ */ e(
|
|
2370
|
+
zn,
|
|
2226
2371
|
{
|
|
2227
|
-
events:
|
|
2372
|
+
events: D,
|
|
2228
2373
|
date: n,
|
|
2229
|
-
onEventClick:
|
|
2230
|
-
disablePopover: !!s && !
|
|
2231
|
-
renderPopover:
|
|
2232
|
-
...
|
|
2374
|
+
onEventClick: x,
|
|
2375
|
+
disablePopover: !!s && !b,
|
|
2376
|
+
renderPopover: b,
|
|
2377
|
+
...u?.multiDayBanner && { className: u.multiDayBanner }
|
|
2233
2378
|
}
|
|
2234
2379
|
),
|
|
2235
2380
|
/* @__PURE__ */ e(
|
|
2236
2381
|
"div",
|
|
2237
2382
|
{
|
|
2238
|
-
ref:
|
|
2239
|
-
className:
|
|
2240
|
-
children: /* @__PURE__ */
|
|
2241
|
-
$.map((
|
|
2242
|
-
const
|
|
2243
|
-
return /* @__PURE__ */
|
|
2383
|
+
ref: P,
|
|
2384
|
+
className: l("flex-1", u?.scrollContainer),
|
|
2385
|
+
children: /* @__PURE__ */ o("div", { className: "relative min-h-full", children: [
|
|
2386
|
+
$.map((w, c) => {
|
|
2387
|
+
const S = !dt(n, w, a);
|
|
2388
|
+
return /* @__PURE__ */ o(
|
|
2244
2389
|
"div",
|
|
2245
2390
|
{
|
|
2246
|
-
className:
|
|
2391
|
+
className: l(
|
|
2247
2392
|
"relative flex",
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2393
|
+
S && "bg-calendar-disabled-hour",
|
|
2394
|
+
u?.timeSlot,
|
|
2395
|
+
S ? u?.timeSlotNonWorking : u?.timeSlotWorking
|
|
2251
2396
|
),
|
|
2252
|
-
style: { height:
|
|
2397
|
+
style: { height: be },
|
|
2253
2398
|
children: [
|
|
2254
2399
|
/* @__PURE__ */ e(
|
|
2255
2400
|
"div",
|
|
2256
2401
|
{
|
|
2257
|
-
className:
|
|
2402
|
+
className: l(
|
|
2258
2403
|
"relative flex-shrink-0 border-r border-border/50 bg-zinc-50 dark:bg-zinc-900",
|
|
2259
|
-
|
|
2404
|
+
u?.timeGutter
|
|
2260
2405
|
),
|
|
2261
|
-
style: { width:
|
|
2262
|
-
children: /* @__PURE__ */ e("div", { className: "absolute -top-2.5 right-1 sm:right-2 flex h-5 items-center", children:
|
|
2406
|
+
style: { width: Ie },
|
|
2407
|
+
children: /* @__PURE__ */ e("div", { className: "absolute -top-2.5 right-1 sm:right-2 flex h-5 items-center", children: c !== 0 && /* @__PURE__ */ e(
|
|
2263
2408
|
"span",
|
|
2264
2409
|
{
|
|
2265
|
-
className:
|
|
2410
|
+
className: l(
|
|
2266
2411
|
"text-[10px] sm:text-xs text-muted-foreground",
|
|
2267
|
-
|
|
2412
|
+
u?.timeGutterLabel
|
|
2268
2413
|
),
|
|
2269
|
-
children:
|
|
2414
|
+
children: ze(w)
|
|
2270
2415
|
}
|
|
2271
2416
|
) })
|
|
2272
2417
|
}
|
|
2273
2418
|
),
|
|
2274
|
-
/* @__PURE__ */
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2419
|
+
/* @__PURE__ */ o("div", { className: "relative flex-1", children: [
|
|
2420
|
+
L && !S && /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-primary/5" }),
|
|
2421
|
+
c !== 0 && /* @__PURE__ */ e("div", { className: "pointer-events-none absolute inset-x-0 top-0 border-b border-border/50" }),
|
|
2422
|
+
N.slice(1).map((C) => /* @__PURE__ */ e(
|
|
2278
2423
|
"div",
|
|
2279
2424
|
{
|
|
2280
2425
|
className: "pointer-events-none absolute inset-x-0 border-b border-dashed border-border/30",
|
|
2281
|
-
style: { top: `${
|
|
2426
|
+
style: { top: `${C / 60 * 100}%` }
|
|
2282
2427
|
},
|
|
2283
|
-
|
|
2428
|
+
C
|
|
2284
2429
|
)),
|
|
2285
|
-
|
|
2286
|
-
const
|
|
2430
|
+
N.map((C, H) => {
|
|
2431
|
+
const G = { date: n, hour: w, minute: C };
|
|
2287
2432
|
return /* @__PURE__ */ e(
|
|
2288
|
-
|
|
2433
|
+
Nt,
|
|
2289
2434
|
{
|
|
2290
|
-
slot:
|
|
2291
|
-
onSelectionStart:
|
|
2292
|
-
onSelectionMove:
|
|
2293
|
-
onSelectionEnd:
|
|
2294
|
-
isSelected:
|
|
2295
|
-
isSelecting:
|
|
2296
|
-
disabled:
|
|
2435
|
+
slot: G,
|
|
2436
|
+
onSelectionStart: R,
|
|
2437
|
+
onSelectionMove: j,
|
|
2438
|
+
onSelectionEnd: W,
|
|
2439
|
+
isSelected: I?.isSlotSelected(G) ?? !1,
|
|
2440
|
+
isSelecting: I?.isSelecting ?? !1,
|
|
2441
|
+
disabled: S,
|
|
2297
2442
|
className: "absolute inset-x-0",
|
|
2298
2443
|
style: {
|
|
2299
|
-
top: `${
|
|
2300
|
-
height: `${
|
|
2444
|
+
top: `${H * p}%`,
|
|
2445
|
+
height: `${p}%`
|
|
2301
2446
|
},
|
|
2302
|
-
ariaLabel: `Add event at ${
|
|
2447
|
+
ariaLabel: `Add event at ${ze(w)}:${String(C).padStart(2, "0")}`
|
|
2303
2448
|
},
|
|
2304
|
-
|
|
2449
|
+
C
|
|
2305
2450
|
);
|
|
2306
2451
|
})
|
|
2307
2452
|
] })
|
|
2308
2453
|
]
|
|
2309
2454
|
},
|
|
2310
|
-
|
|
2455
|
+
w
|
|
2311
2456
|
);
|
|
2312
2457
|
}),
|
|
2313
2458
|
/* @__PURE__ */ e(
|
|
2314
2459
|
"div",
|
|
2315
2460
|
{
|
|
2316
2461
|
className: "absolute top-0 bottom-0 right-0 pointer-events-none",
|
|
2317
|
-
style: { left:
|
|
2318
|
-
children:
|
|
2319
|
-
const
|
|
2320
|
-
if (!
|
|
2321
|
-
const
|
|
2322
|
-
return
|
|
2462
|
+
style: { left: Ie },
|
|
2463
|
+
children: E.map((w) => {
|
|
2464
|
+
const c = T.get(w.id);
|
|
2465
|
+
if (!c) return null;
|
|
2466
|
+
const m = `calc(${c.width}% - 2px)`, S = `max(${Be}px, ${m})`;
|
|
2467
|
+
return d ? /* @__PURE__ */ e(
|
|
2323
2468
|
"div",
|
|
2324
2469
|
{
|
|
2325
2470
|
className: "absolute pointer-events-auto p-0.5",
|
|
2326
2471
|
style: {
|
|
2327
|
-
top: `${
|
|
2328
|
-
left: `${
|
|
2329
|
-
width:
|
|
2330
|
-
minWidth: `${
|
|
2472
|
+
top: `${c.top}px`,
|
|
2473
|
+
left: `${c.left}%`,
|
|
2474
|
+
width: S,
|
|
2475
|
+
minWidth: `${Be}px`
|
|
2331
2476
|
},
|
|
2332
|
-
children:
|
|
2477
|
+
children: d({ event: w, position: c })
|
|
2333
2478
|
},
|
|
2334
|
-
|
|
2479
|
+
w.id
|
|
2335
2480
|
) : /* @__PURE__ */ e(
|
|
2336
|
-
|
|
2481
|
+
bt,
|
|
2337
2482
|
{
|
|
2338
|
-
event:
|
|
2483
|
+
event: w,
|
|
2339
2484
|
position: {
|
|
2340
|
-
top:
|
|
2341
|
-
left:
|
|
2342
|
-
width:
|
|
2343
|
-
minWidth:
|
|
2485
|
+
top: c.top,
|
|
2486
|
+
left: c.left,
|
|
2487
|
+
width: c.width,
|
|
2488
|
+
minWidth: Be
|
|
2344
2489
|
},
|
|
2345
|
-
hourHeight:
|
|
2346
|
-
badgeVariant:
|
|
2490
|
+
hourHeight: be,
|
|
2491
|
+
badgeVariant: h,
|
|
2347
2492
|
onClick: s,
|
|
2348
|
-
disablePopover: !!s && !
|
|
2349
|
-
renderPopover:
|
|
2350
|
-
className:
|
|
2493
|
+
disablePopover: !!s && !b,
|
|
2494
|
+
renderPopover: b,
|
|
2495
|
+
className: l("pointer-events-auto", u?.eventCard)
|
|
2351
2496
|
},
|
|
2352
|
-
|
|
2497
|
+
w.id
|
|
2353
2498
|
);
|
|
2354
2499
|
})
|
|
2355
2500
|
}
|
|
2356
2501
|
),
|
|
2357
|
-
|
|
2502
|
+
L && B >= 0 && /* @__PURE__ */ o(
|
|
2358
2503
|
"div",
|
|
2359
2504
|
{
|
|
2360
|
-
className:
|
|
2505
|
+
className: l(
|
|
2361
2506
|
"absolute left-0 right-0 z-20 flex items-center pointer-events-none",
|
|
2362
|
-
|
|
2507
|
+
u?.currentTimeIndicator
|
|
2363
2508
|
),
|
|
2364
2509
|
style: {
|
|
2365
|
-
top:
|
|
2366
|
-
left:
|
|
2510
|
+
top: B,
|
|
2511
|
+
left: Ie
|
|
2367
2512
|
},
|
|
2368
2513
|
children: [
|
|
2369
2514
|
/* @__PURE__ */ e("div", { className: "h-2.5 w-2.5 -ml-1 rounded-full bg-red-500" }),
|
|
@@ -2376,7 +2521,7 @@ function Tn({
|
|
|
2376
2521
|
)
|
|
2377
2522
|
] });
|
|
2378
2523
|
}
|
|
2379
|
-
const
|
|
2524
|
+
const Ln = [
|
|
2380
2525
|
{ full: "Monday", short: "Mon", tiny: "M" },
|
|
2381
2526
|
{ full: "Tuesday", short: "Tue", tiny: "T" },
|
|
2382
2527
|
{ full: "Wednesday", short: "Wed", tiny: "W" },
|
|
@@ -2384,7 +2529,7 @@ const un = [
|
|
|
2384
2529
|
{ full: "Friday", short: "Fri", tiny: "F" },
|
|
2385
2530
|
{ full: "Saturday", short: "Sat", tiny: "S" },
|
|
2386
2531
|
{ full: "Sunday", short: "Sun", tiny: "S" }
|
|
2387
|
-
],
|
|
2532
|
+
], En = [
|
|
2388
2533
|
{ full: "Sunday", short: "Sun", tiny: "S" },
|
|
2389
2534
|
{ full: "Monday", short: "Mon", tiny: "M" },
|
|
2390
2535
|
{ full: "Tuesday", short: "Tue", tiny: "T" },
|
|
@@ -2392,158 +2537,158 @@ const un = [
|
|
|
2392
2537
|
{ full: "Thursday", short: "Thu", tiny: "T" },
|
|
2393
2538
|
{ full: "Friday", short: "Fri", tiny: "F" },
|
|
2394
2539
|
{ full: "Saturday", short: "Sat", tiny: "S" }
|
|
2395
|
-
],
|
|
2396
|
-
function
|
|
2540
|
+
], we = 3;
|
|
2541
|
+
function Zn({
|
|
2397
2542
|
events: t,
|
|
2398
2543
|
date: n,
|
|
2399
|
-
weekStartsOn:
|
|
2544
|
+
weekStartsOn: r = 1,
|
|
2400
2545
|
badgeVariant: a = "colored",
|
|
2401
2546
|
onEventClick: i,
|
|
2402
|
-
onSlotSelect:
|
|
2547
|
+
onSlotSelect: h,
|
|
2403
2548
|
onDayClick: s,
|
|
2404
|
-
className:
|
|
2405
|
-
renderEvent:
|
|
2406
|
-
renderPopover:
|
|
2407
|
-
showMoreMode:
|
|
2408
|
-
showMoreEventsInPopover:
|
|
2409
|
-
slots:
|
|
2549
|
+
className: y,
|
|
2550
|
+
renderEvent: k,
|
|
2551
|
+
renderPopover: d,
|
|
2552
|
+
showMoreMode: b,
|
|
2553
|
+
showMoreEventsInPopover: v = !1,
|
|
2554
|
+
slots: u,
|
|
2410
2555
|
classNames: g
|
|
2411
2556
|
}) {
|
|
2412
|
-
const
|
|
2413
|
-
const
|
|
2414
|
-
for (const _ of
|
|
2415
|
-
const
|
|
2416
|
-
|
|
2557
|
+
const p = b ?? (v ? "popover" : "expand"), N = u?.dayCellHeader, f = u?.dayCellFooter, [E, D] = Q(null), [T, $] = Q(null), A = q(() => Tt(n, r), [n, r]), L = q(() => {
|
|
2558
|
+
const x = /* @__PURE__ */ new Map();
|
|
2559
|
+
for (const _ of A) {
|
|
2560
|
+
const M = _.date.toDateString(), F = Fe(t, _.date);
|
|
2561
|
+
F.sort((w, c) => w.startDate.getTime() - c.startDate.getTime()), x.set(M, F);
|
|
2417
2562
|
}
|
|
2418
|
-
return
|
|
2419
|
-
}, [
|
|
2420
|
-
(
|
|
2421
|
-
|
|
2563
|
+
return x;
|
|
2564
|
+
}, [A, t]), B = Ge(), P = z(
|
|
2565
|
+
(x) => {
|
|
2566
|
+
B?.startSelection(x);
|
|
2422
2567
|
},
|
|
2423
|
-
[
|
|
2424
|
-
),
|
|
2425
|
-
(
|
|
2426
|
-
|
|
2568
|
+
[B]
|
|
2569
|
+
), I = z(
|
|
2570
|
+
(x) => {
|
|
2571
|
+
B?.updateSelection(x);
|
|
2427
2572
|
},
|
|
2428
|
-
[
|
|
2429
|
-
),
|
|
2430
|
-
|
|
2431
|
-
}, [
|
|
2432
|
-
(
|
|
2433
|
-
s?.(
|
|
2573
|
+
[B]
|
|
2574
|
+
), R = z(() => {
|
|
2575
|
+
B?.endSelection();
|
|
2576
|
+
}, [B]), j = z(
|
|
2577
|
+
(x) => {
|
|
2578
|
+
s?.(x);
|
|
2434
2579
|
},
|
|
2435
2580
|
[s]
|
|
2436
|
-
),
|
|
2437
|
-
return /* @__PURE__ */
|
|
2438
|
-
/* @__PURE__ */ e("div", { className: "flex flex-col flex-1 overflow-auto", children: /* @__PURE__ */
|
|
2581
|
+
), W = r === 0 ? En : Ln;
|
|
2582
|
+
return /* @__PURE__ */ o("div", { className: l("flex flex-col h-full overflow-hidden", y), children: [
|
|
2583
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col flex-1 overflow-auto", children: /* @__PURE__ */ o("div", { className: "flex flex-col flex-1 min-w-[560px] sm:min-w-0", children: [
|
|
2439
2584
|
/* @__PURE__ */ e(
|
|
2440
2585
|
"div",
|
|
2441
2586
|
{
|
|
2442
|
-
className:
|
|
2587
|
+
className: l(
|
|
2443
2588
|
"grid grid-cols-7 border-b !sticky !top-0 bg-background z-10",
|
|
2444
2589
|
g?.weekdayHeader
|
|
2445
2590
|
),
|
|
2446
|
-
children:
|
|
2591
|
+
children: W.map((x, _) => /* @__PURE__ */ o(
|
|
2447
2592
|
"div",
|
|
2448
2593
|
{
|
|
2449
|
-
className:
|
|
2594
|
+
className: l(
|
|
2450
2595
|
"py-2 sm:py-2.5 text-center text-[11px] uppercase font-medium tracking-wide text-muted-foreground",
|
|
2451
2596
|
_ >= 5 && "text-muted-foreground/70",
|
|
2452
2597
|
// Weekend
|
|
2453
2598
|
g?.weekdayLabel
|
|
2454
2599
|
),
|
|
2455
2600
|
children: [
|
|
2456
|
-
/* @__PURE__ */ e("span", { className: "sm:hidden", children:
|
|
2457
|
-
/* @__PURE__ */ e("span", { className: "hidden sm:inline", children:
|
|
2601
|
+
/* @__PURE__ */ e("span", { className: "sm:hidden", children: x.short }),
|
|
2602
|
+
/* @__PURE__ */ e("span", { className: "hidden sm:inline", children: x.short })
|
|
2458
2603
|
]
|
|
2459
2604
|
},
|
|
2460
|
-
|
|
2605
|
+
x.full
|
|
2461
2606
|
))
|
|
2462
2607
|
}
|
|
2463
2608
|
),
|
|
2464
|
-
/* @__PURE__ */ e("div", { className:
|
|
2465
|
-
const _ =
|
|
2466
|
-
return /* @__PURE__ */
|
|
2467
|
-
|
|
2609
|
+
/* @__PURE__ */ e("div", { className: l("grid grid-cols-7 auto-rows-min", g?.monthGrid), children: A.map((x) => {
|
|
2610
|
+
const _ = x.date.toDateString(), M = L.get(_) || [], F = ce(x.date), w = x.date.getDay() === 0 || x.date.getDay() === 6, c = M.length > we;
|
|
2611
|
+
return /* @__PURE__ */ o(
|
|
2612
|
+
An,
|
|
2468
2613
|
{
|
|
2469
|
-
date:
|
|
2614
|
+
date: x.date,
|
|
2470
2615
|
dataAttributes: { "data-day-key": _ },
|
|
2471
|
-
onSelectionStart:
|
|
2472
|
-
onSelectionMove:
|
|
2473
|
-
onSelectionEnd:
|
|
2474
|
-
isSelected:
|
|
2475
|
-
isSelecting:
|
|
2476
|
-
className:
|
|
2616
|
+
onSelectionStart: P,
|
|
2617
|
+
onSelectionMove: I,
|
|
2618
|
+
onSelectionEnd: R,
|
|
2619
|
+
isSelected: B?.isSlotSelected({ date: x.date }) ?? !1,
|
|
2620
|
+
isSelecting: B?.isSelecting ?? !1,
|
|
2621
|
+
className: l(
|
|
2477
2622
|
"relative flex flex-col border-r border-b text-left min-h-[80px] sm:min-h-[100px] overflow-hidden",
|
|
2478
2623
|
"[&:nth-child(7n)]:border-r-0",
|
|
2479
|
-
!
|
|
2480
|
-
|
|
2624
|
+
!x.isCurrentMonth && "bg-muted/20",
|
|
2625
|
+
w && x.isCurrentMonth && "bg-muted/10",
|
|
2481
2626
|
g?.dayCell,
|
|
2482
|
-
|
|
2483
|
-
!
|
|
2484
|
-
|
|
2627
|
+
F && g?.dayCellToday,
|
|
2628
|
+
!x.isCurrentMonth && g?.dayCellOutside,
|
|
2629
|
+
w && g?.dayCellWeekend
|
|
2485
2630
|
),
|
|
2486
|
-
ariaLabel: `${
|
|
2631
|
+
ariaLabel: `${x.date.toLocaleDateString()} - ${M.length} events. Click to create event, double-click to view day.`,
|
|
2487
2632
|
children: [
|
|
2488
2633
|
/* @__PURE__ */ e(
|
|
2489
2634
|
"div",
|
|
2490
2635
|
{
|
|
2491
|
-
className:
|
|
2636
|
+
className: l(
|
|
2492
2637
|
"flex items-center justify-center p-1",
|
|
2493
|
-
!
|
|
2638
|
+
!x.isCurrentMonth && "text-muted-foreground/40",
|
|
2494
2639
|
g?.dayCellNumber
|
|
2495
2640
|
),
|
|
2496
2641
|
children: /* @__PURE__ */ e(
|
|
2497
2642
|
"button",
|
|
2498
2643
|
{
|
|
2499
2644
|
type: "button",
|
|
2500
|
-
onClick: (
|
|
2501
|
-
|
|
2645
|
+
onClick: (m) => {
|
|
2646
|
+
m.stopPropagation(), j(x.date);
|
|
2502
2647
|
},
|
|
2503
|
-
className:
|
|
2648
|
+
className: l(
|
|
2504
2649
|
"flex items-center justify-center rounded-full transition-colors",
|
|
2505
2650
|
"size-7 text-sm font-normal",
|
|
2506
|
-
|
|
2651
|
+
F ? "bg-primary text-primary-foreground" : "hover:bg-muted"
|
|
2507
2652
|
),
|
|
2508
|
-
children:
|
|
2653
|
+
children: x.date.getDate()
|
|
2509
2654
|
}
|
|
2510
2655
|
)
|
|
2511
2656
|
}
|
|
2512
2657
|
),
|
|
2513
|
-
|
|
2514
|
-
|
|
2658
|
+
N && /* @__PURE__ */ e(
|
|
2659
|
+
N,
|
|
2515
2660
|
{
|
|
2516
|
-
date:
|
|
2517
|
-
events:
|
|
2518
|
-
isToday:
|
|
2519
|
-
isCurrentMonth:
|
|
2520
|
-
isWeekend:
|
|
2661
|
+
date: x.date,
|
|
2662
|
+
events: M,
|
|
2663
|
+
isToday: F,
|
|
2664
|
+
isCurrentMonth: x.isCurrentMonth,
|
|
2665
|
+
isWeekend: w,
|
|
2521
2666
|
view: "month"
|
|
2522
2667
|
}
|
|
2523
2668
|
),
|
|
2524
|
-
/* @__PURE__ */
|
|
2669
|
+
/* @__PURE__ */ o(
|
|
2525
2670
|
"div",
|
|
2526
2671
|
{
|
|
2527
|
-
className:
|
|
2672
|
+
className: l(
|
|
2528
2673
|
"flex-1 overflow-hidden px-2 pt-1 pb-1 space-y-1",
|
|
2529
2674
|
g?.dayCellContent
|
|
2530
2675
|
),
|
|
2531
2676
|
children: [
|
|
2532
|
-
|
|
2677
|
+
M.slice(0, we).map((m) => /* @__PURE__ */ e(
|
|
2533
2678
|
"div",
|
|
2534
2679
|
{
|
|
2535
|
-
onPointerDown: (
|
|
2536
|
-
|
|
2680
|
+
onPointerDown: (S) => {
|
|
2681
|
+
S.stopPropagation();
|
|
2537
2682
|
},
|
|
2538
|
-
children:
|
|
2539
|
-
|
|
2683
|
+
children: k ? k({ event: m, variant: "compact" }) : /* @__PURE__ */ e(
|
|
2684
|
+
We,
|
|
2540
2685
|
{
|
|
2541
|
-
event:
|
|
2686
|
+
event: m,
|
|
2542
2687
|
variant: "compact",
|
|
2543
2688
|
badgeVariant: a,
|
|
2544
2689
|
onClick: i,
|
|
2545
|
-
disablePopover: !!i && !
|
|
2546
|
-
renderPopover:
|
|
2690
|
+
disablePopover: !!i && !d,
|
|
2691
|
+
renderPopover: d,
|
|
2547
2692
|
showTime: !1,
|
|
2548
2693
|
enableDrag: !0,
|
|
2549
2694
|
...g?.eventCardCompact && {
|
|
@@ -2552,111 +2697,111 @@ function Wn({
|
|
|
2552
2697
|
}
|
|
2553
2698
|
)
|
|
2554
2699
|
},
|
|
2555
|
-
|
|
2700
|
+
m.id
|
|
2556
2701
|
)),
|
|
2557
|
-
|
|
2702
|
+
c && p === "expand" && /* @__PURE__ */ o(
|
|
2558
2703
|
"button",
|
|
2559
2704
|
{
|
|
2560
2705
|
type: "button",
|
|
2561
|
-
onPointerDown: (
|
|
2562
|
-
onClick: (
|
|
2563
|
-
|
|
2564
|
-
const
|
|
2706
|
+
onPointerDown: (m) => m.stopPropagation(),
|
|
2707
|
+
onClick: (m) => {
|
|
2708
|
+
m.stopPropagation();
|
|
2709
|
+
const S = document.querySelector(`[data-day-key="${_}"]`);
|
|
2565
2710
|
$({
|
|
2566
|
-
date:
|
|
2567
|
-
events:
|
|
2568
|
-
rect:
|
|
2711
|
+
date: x.date,
|
|
2712
|
+
events: M,
|
|
2713
|
+
rect: S?.getBoundingClientRect() ?? new DOMRect(window.innerWidth / 2 - 180, window.innerHeight / 2 - 240, 0, 0)
|
|
2569
2714
|
});
|
|
2570
2715
|
},
|
|
2571
|
-
className:
|
|
2716
|
+
className: l(
|
|
2572
2717
|
"w-full text-left text-xs text-muted-foreground hover:text-foreground hover:underline px-1.5 cursor-pointer",
|
|
2573
2718
|
g?.moreEventsIndicator
|
|
2574
2719
|
),
|
|
2575
2720
|
children: [
|
|
2576
2721
|
"+",
|
|
2577
|
-
|
|
2722
|
+
M.length - we,
|
|
2578
2723
|
" more"
|
|
2579
2724
|
]
|
|
2580
2725
|
}
|
|
2581
2726
|
),
|
|
2582
|
-
|
|
2583
|
-
|
|
2727
|
+
c && p === "popover" && /* @__PURE__ */ o(
|
|
2728
|
+
ue,
|
|
2584
2729
|
{
|
|
2585
|
-
open:
|
|
2586
|
-
onOpenChange: (
|
|
2730
|
+
open: E === _,
|
|
2731
|
+
onOpenChange: (m) => D(m ? _ : null),
|
|
2587
2732
|
children: [
|
|
2588
|
-
/* @__PURE__ */ e(
|
|
2733
|
+
/* @__PURE__ */ e(me, { asChild: !0, children: /* @__PURE__ */ o(
|
|
2589
2734
|
"button",
|
|
2590
2735
|
{
|
|
2591
2736
|
type: "button",
|
|
2592
|
-
onPointerDown: (
|
|
2593
|
-
onClick: (
|
|
2594
|
-
|
|
2737
|
+
onPointerDown: (m) => m.stopPropagation(),
|
|
2738
|
+
onClick: (m) => {
|
|
2739
|
+
m.stopPropagation(), D(_);
|
|
2595
2740
|
},
|
|
2596
|
-
className:
|
|
2741
|
+
className: l(
|
|
2597
2742
|
"w-full text-left text-xs text-muted-foreground hover:text-foreground hover:underline px-1.5 cursor-pointer",
|
|
2598
2743
|
g?.moreEventsIndicator
|
|
2599
2744
|
),
|
|
2600
2745
|
children: [
|
|
2601
2746
|
"+",
|
|
2602
|
-
|
|
2747
|
+
M.length - we,
|
|
2603
2748
|
" more"
|
|
2604
2749
|
]
|
|
2605
2750
|
}
|
|
2606
2751
|
) }),
|
|
2607
|
-
/* @__PURE__ */
|
|
2608
|
-
|
|
2752
|
+
/* @__PURE__ */ o(
|
|
2753
|
+
le,
|
|
2609
2754
|
{
|
|
2610
2755
|
align: "start",
|
|
2611
2756
|
side: "right",
|
|
2612
2757
|
sideOffset: 8,
|
|
2613
2758
|
className: "w-72 max-h-80 overflow-y-auto p-2",
|
|
2614
|
-
onPointerDown: (
|
|
2759
|
+
onPointerDown: (m) => m.stopPropagation(),
|
|
2615
2760
|
children: [
|
|
2616
|
-
/* @__PURE__ */
|
|
2617
|
-
/* @__PURE__ */ e("span", { className: "text-sm font-medium", children:
|
|
2761
|
+
/* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-2 pb-2 border-b", children: [
|
|
2762
|
+
/* @__PURE__ */ e("span", { className: "text-sm font-medium", children: x.date.toLocaleDateString(void 0, {
|
|
2618
2763
|
weekday: "short",
|
|
2619
2764
|
month: "short",
|
|
2620
2765
|
day: "numeric"
|
|
2621
2766
|
}) }),
|
|
2622
|
-
/* @__PURE__ */
|
|
2623
|
-
|
|
2767
|
+
/* @__PURE__ */ o("span", { className: "text-xs text-muted-foreground", children: [
|
|
2768
|
+
M.length,
|
|
2624
2769
|
" events"
|
|
2625
2770
|
] })
|
|
2626
2771
|
] }),
|
|
2627
|
-
/* @__PURE__ */ e("div", { className: "space-y-1.5", children:
|
|
2628
|
-
|
|
2772
|
+
/* @__PURE__ */ e("div", { className: "space-y-1.5", children: M.map((m) => /* @__PURE__ */ e("div", { children: k ? k({ event: m, variant: "compact" }) : /* @__PURE__ */ e(
|
|
2773
|
+
We,
|
|
2629
2774
|
{
|
|
2630
|
-
event:
|
|
2775
|
+
event: m,
|
|
2631
2776
|
variant: "compact",
|
|
2632
2777
|
badgeVariant: a,
|
|
2633
|
-
onClick: (
|
|
2634
|
-
|
|
2778
|
+
onClick: (S) => {
|
|
2779
|
+
D(null), i?.(S);
|
|
2635
2780
|
},
|
|
2636
|
-
disablePopover: !!i && !
|
|
2637
|
-
renderPopover:
|
|
2781
|
+
disablePopover: !!i && !d,
|
|
2782
|
+
renderPopover: d,
|
|
2638
2783
|
showTime: !0
|
|
2639
2784
|
}
|
|
2640
|
-
) },
|
|
2785
|
+
) }, m.id)) })
|
|
2641
2786
|
]
|
|
2642
2787
|
}
|
|
2643
2788
|
)
|
|
2644
2789
|
]
|
|
2645
2790
|
}
|
|
2646
2791
|
),
|
|
2647
|
-
|
|
2792
|
+
c && p === "dayView" && /* @__PURE__ */ o(
|
|
2648
2793
|
"div",
|
|
2649
2794
|
{
|
|
2650
|
-
onPointerDown: (
|
|
2651
|
-
|
|
2795
|
+
onPointerDown: (m) => {
|
|
2796
|
+
m.stopPropagation(), j(x.date);
|
|
2652
2797
|
},
|
|
2653
|
-
className:
|
|
2798
|
+
className: l(
|
|
2654
2799
|
"w-full text-left text-xs text-muted-foreground hover:text-foreground hover:underline px-1.5 cursor-pointer",
|
|
2655
2800
|
g?.moreEventsIndicator
|
|
2656
2801
|
),
|
|
2657
2802
|
children: [
|
|
2658
2803
|
"+",
|
|
2659
|
-
|
|
2804
|
+
M.length - we,
|
|
2660
2805
|
" more"
|
|
2661
2806
|
]
|
|
2662
2807
|
}
|
|
@@ -2664,14 +2809,14 @@ function Wn({
|
|
|
2664
2809
|
]
|
|
2665
2810
|
}
|
|
2666
2811
|
),
|
|
2667
|
-
|
|
2668
|
-
|
|
2812
|
+
f && /* @__PURE__ */ e(
|
|
2813
|
+
f,
|
|
2669
2814
|
{
|
|
2670
|
-
date:
|
|
2671
|
-
events:
|
|
2672
|
-
isToday:
|
|
2673
|
-
isCurrentMonth:
|
|
2674
|
-
isWeekend:
|
|
2815
|
+
date: x.date,
|
|
2816
|
+
events: M,
|
|
2817
|
+
isToday: F,
|
|
2818
|
+
isCurrentMonth: x.isCurrentMonth,
|
|
2819
|
+
isWeekend: w,
|
|
2675
2820
|
view: "month"
|
|
2676
2821
|
}
|
|
2677
2822
|
)
|
|
@@ -2682,76 +2827,76 @@ function Wn({
|
|
|
2682
2827
|
}) })
|
|
2683
2828
|
] }) }),
|
|
2684
2829
|
/* @__PURE__ */ e(
|
|
2685
|
-
|
|
2830
|
+
Sn,
|
|
2686
2831
|
{
|
|
2687
|
-
isOpen:
|
|
2832
|
+
isOpen: T !== null,
|
|
2688
2833
|
onClose: () => $(null),
|
|
2689
|
-
date:
|
|
2690
|
-
events:
|
|
2691
|
-
anchorRect:
|
|
2834
|
+
date: T?.date ?? /* @__PURE__ */ new Date(),
|
|
2835
|
+
events: T?.events ?? [],
|
|
2836
|
+
anchorRect: T?.rect ?? null,
|
|
2692
2837
|
badgeVariant: a,
|
|
2693
2838
|
onEventClick: i,
|
|
2694
|
-
renderEvent:
|
|
2695
|
-
renderPopover:
|
|
2839
|
+
renderEvent: k,
|
|
2840
|
+
renderPopover: d
|
|
2696
2841
|
}
|
|
2697
2842
|
)
|
|
2698
2843
|
] });
|
|
2699
2844
|
}
|
|
2700
|
-
const
|
|
2701
|
-
function
|
|
2702
|
-
const
|
|
2845
|
+
const Ae = 26, rt = 2, Se = 4;
|
|
2846
|
+
function ot(t, n) {
|
|
2847
|
+
const r = Ke(t);
|
|
2703
2848
|
for (let i = 0; i < n.length; i++) {
|
|
2704
|
-
const
|
|
2705
|
-
if (
|
|
2849
|
+
const h = n[i];
|
|
2850
|
+
if (h && se(r, h)) return i;
|
|
2706
2851
|
}
|
|
2707
2852
|
const a = n[0];
|
|
2708
|
-
return a &&
|
|
2853
|
+
return a && r < Ke(a) ? -1 : 7;
|
|
2709
2854
|
}
|
|
2710
|
-
function
|
|
2855
|
+
function _n(t) {
|
|
2711
2856
|
const n = [...t].sort((a, i) => {
|
|
2712
|
-
const
|
|
2713
|
-
return s !==
|
|
2714
|
-
}),
|
|
2857
|
+
const h = a.endCol - a.startCol, s = i.endCol - i.startCol;
|
|
2858
|
+
return s !== h ? s - h : a.startCol - i.startCol;
|
|
2859
|
+
}), r = [];
|
|
2715
2860
|
return n.map((a) => {
|
|
2716
2861
|
let i = -1;
|
|
2717
|
-
for (let s = 0; s <
|
|
2718
|
-
const
|
|
2719
|
-
if (!
|
|
2720
|
-
let
|
|
2721
|
-
for (let
|
|
2722
|
-
if (
|
|
2723
|
-
|
|
2862
|
+
for (let s = 0; s < r.length; s++) {
|
|
2863
|
+
const y = r[s];
|
|
2864
|
+
if (!y) continue;
|
|
2865
|
+
let k = !0;
|
|
2866
|
+
for (let d = a.startCol; d <= a.endCol; d++)
|
|
2867
|
+
if (y[d]) {
|
|
2868
|
+
k = !1;
|
|
2724
2869
|
break;
|
|
2725
2870
|
}
|
|
2726
|
-
if (
|
|
2871
|
+
if (k) {
|
|
2727
2872
|
i = s;
|
|
2728
2873
|
break;
|
|
2729
2874
|
}
|
|
2730
2875
|
}
|
|
2731
|
-
i === -1 && (i =
|
|
2732
|
-
const
|
|
2733
|
-
if (
|
|
2876
|
+
i === -1 && (i = r.length, r.push(new Array(7).fill(!1)));
|
|
2877
|
+
const h = r[i];
|
|
2878
|
+
if (h)
|
|
2734
2879
|
for (let s = a.startCol; s <= a.endCol; s++)
|
|
2735
|
-
|
|
2880
|
+
h[s] = !0;
|
|
2736
2881
|
return { ...a, row: i };
|
|
2737
2882
|
});
|
|
2738
2883
|
}
|
|
2739
|
-
function
|
|
2884
|
+
function In({
|
|
2740
2885
|
pe: t,
|
|
2741
2886
|
onEventClick: n,
|
|
2742
|
-
disablePopover:
|
|
2887
|
+
disablePopover: r,
|
|
2743
2888
|
renderPopover: a
|
|
2744
2889
|
}) {
|
|
2745
|
-
const [i,
|
|
2746
|
-
|
|
2747
|
-
}, [
|
|
2748
|
-
|
|
2749
|
-
}, []),
|
|
2890
|
+
const [i, h] = Q(!1), s = de(t.event.color), y = z(() => {
|
|
2891
|
+
r && n ? n(t.event) : r || h(!0);
|
|
2892
|
+
}, [r, n, t.event]), k = z(() => {
|
|
2893
|
+
h(!1);
|
|
2894
|
+
}, []), d = /* @__PURE__ */ o(
|
|
2750
2895
|
"button",
|
|
2751
2896
|
{
|
|
2752
2897
|
type: "button",
|
|
2753
|
-
onClick:
|
|
2754
|
-
className:
|
|
2898
|
+
onClick: y,
|
|
2899
|
+
className: l(
|
|
2755
2900
|
"inline-flex items-center gap-1 rounded text-[10px] font-medium transition-opacity hover:opacity-80 mx-0.5 overflow-hidden w-full",
|
|
2756
2901
|
"sm:text-xs",
|
|
2757
2902
|
s.bg,
|
|
@@ -2761,8 +2906,8 @@ function pn({
|
|
|
2761
2906
|
t.continuesAfter && "rounded-r-none -mr-0.5 pr-1"
|
|
2762
2907
|
),
|
|
2763
2908
|
style: {
|
|
2764
|
-
height:
|
|
2765
|
-
lineHeight: `${
|
|
2909
|
+
height: Ae,
|
|
2910
|
+
lineHeight: `${Ae}px`,
|
|
2766
2911
|
paddingLeft: t.continuesBefore ? 4 : 6,
|
|
2767
2912
|
paddingRight: t.continuesAfter ? 4 : 6
|
|
2768
2913
|
},
|
|
@@ -2773,45 +2918,45 @@ function pn({
|
|
|
2773
2918
|
t.continuesAfter && /* @__PURE__ */ e("span", { className: "text-[9px] opacity-60 flex-shrink-0", children: "▸" })
|
|
2774
2919
|
]
|
|
2775
2920
|
}
|
|
2776
|
-
),
|
|
2921
|
+
), b = /* @__PURE__ */ e(re, { children: /* @__PURE__ */ o("div", { className: "flex flex-col gap-0.5", children: [
|
|
2777
2922
|
/* @__PURE__ */ e("div", { className: "font-medium", children: t.event.title }),
|
|
2778
|
-
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children:
|
|
2779
|
-
] }) }),
|
|
2923
|
+
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: J(t.event) })
|
|
2924
|
+
] }) }), v = {
|
|
2780
2925
|
gridColumn: `${t.startCol + 2} / ${t.endCol + 3}`,
|
|
2781
2926
|
gridRow: t.row + 1
|
|
2782
2927
|
};
|
|
2783
|
-
return
|
|
2784
|
-
/* @__PURE__ */ e(
|
|
2785
|
-
|
|
2786
|
-
] }) }) : /* @__PURE__ */ e("div", { style:
|
|
2787
|
-
/* @__PURE__ */ e(
|
|
2788
|
-
/* @__PURE__ */ e(
|
|
2928
|
+
return r ? /* @__PURE__ */ e("div", { style: v, children: /* @__PURE__ */ o(ae, { children: [
|
|
2929
|
+
/* @__PURE__ */ e(ie, { asChild: !0, children: d }),
|
|
2930
|
+
b
|
|
2931
|
+
] }) }) : /* @__PURE__ */ e("div", { style: v, children: /* @__PURE__ */ o(ue, { open: i, onOpenChange: h, children: [
|
|
2932
|
+
/* @__PURE__ */ e(me, { asChild: !0, children: d }),
|
|
2933
|
+
/* @__PURE__ */ e(le, { className: "w-80", children: a ? a({ event: t.event, onClose: k }) : /* @__PURE__ */ e(Bn, { event: t.event, onClose: k }) })
|
|
2789
2934
|
] }) });
|
|
2790
2935
|
}
|
|
2791
|
-
function
|
|
2936
|
+
function Bn({
|
|
2792
2937
|
event: t,
|
|
2793
2938
|
onClose: n
|
|
2794
2939
|
}) {
|
|
2795
|
-
const
|
|
2796
|
-
return /* @__PURE__ */
|
|
2797
|
-
/* @__PURE__ */
|
|
2798
|
-
/* @__PURE__ */ e("div", { className:
|
|
2799
|
-
/* @__PURE__ */
|
|
2940
|
+
const r = de(t.color), a = t.isCanceled ?? !1;
|
|
2941
|
+
return /* @__PURE__ */ o("div", { className: "space-y-3", children: [
|
|
2942
|
+
/* @__PURE__ */ o("div", { className: "flex items-start gap-3", children: [
|
|
2943
|
+
/* @__PURE__ */ e("div", { className: l("size-4 rounded shrink-0 mt-0.5", r.dot) }),
|
|
2944
|
+
/* @__PURE__ */ o("div", { className: "flex-1 min-w-0", children: [
|
|
2800
2945
|
/* @__PURE__ */ e(
|
|
2801
2946
|
"h3",
|
|
2802
2947
|
{
|
|
2803
|
-
className:
|
|
2948
|
+
className: l(
|
|
2804
2949
|
"font-semibold text-lg",
|
|
2805
2950
|
a && "line-through opacity-50"
|
|
2806
2951
|
),
|
|
2807
2952
|
children: t.title
|
|
2808
2953
|
}
|
|
2809
2954
|
),
|
|
2810
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-1 text-sm text-muted-foreground mt-1 tabular-nums", children:
|
|
2955
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-1 text-sm text-muted-foreground mt-1 tabular-nums", children: J(t) })
|
|
2811
2956
|
] })
|
|
2812
2957
|
] }),
|
|
2813
2958
|
t.description && /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: t.description }),
|
|
2814
|
-
/* @__PURE__ */
|
|
2959
|
+
/* @__PURE__ */ o("div", { className: "flex flex-wrap gap-1.5", children: [
|
|
2815
2960
|
t.isAllDay && /* @__PURE__ */ e("span", { className: "text-xs bg-muted px-2 py-0.5 rounded-full font-medium", children: "All day" }),
|
|
2816
2961
|
a && /* @__PURE__ */ e("span", { className: "text-xs bg-red-100 dark:bg-red-950/30 text-red-700 dark:text-red-300 px-2 py-0.5 rounded-full font-medium", children: "Canceled" })
|
|
2817
2962
|
] }),
|
|
@@ -2826,54 +2971,54 @@ function fn({
|
|
|
2826
2971
|
) })
|
|
2827
2972
|
] });
|
|
2828
2973
|
}
|
|
2829
|
-
function
|
|
2974
|
+
function $n({
|
|
2830
2975
|
events: t,
|
|
2831
2976
|
weekDays: n,
|
|
2832
|
-
hourColumnWidth:
|
|
2977
|
+
hourColumnWidth: r,
|
|
2833
2978
|
minDayColumnWidth: a,
|
|
2834
2979
|
dayColumnWidths: i,
|
|
2835
|
-
onEventClick:
|
|
2980
|
+
onEventClick: h,
|
|
2836
2981
|
disablePopover: s = !1,
|
|
2837
|
-
renderPopover:
|
|
2838
|
-
className:
|
|
2982
|
+
renderPopover: y,
|
|
2983
|
+
className: k
|
|
2839
2984
|
}) {
|
|
2840
|
-
const
|
|
2985
|
+
const d = q(() => {
|
|
2841
2986
|
if (t.length === 0) return [];
|
|
2842
|
-
const
|
|
2843
|
-
const
|
|
2844
|
-
if ($ > 6 ||
|
|
2845
|
-
const
|
|
2987
|
+
const f = t.map((E) => {
|
|
2988
|
+
const D = ot(E.startDate, n), T = ot(E.endDate, n), $ = Math.max(0, D), A = Math.min(6, T);
|
|
2989
|
+
if ($ > 6 || A < 0) return null;
|
|
2990
|
+
const L = D < 0, B = T > 6, I = Te(E) && se(E.startDate, E.endDate);
|
|
2846
2991
|
return {
|
|
2847
|
-
event:
|
|
2992
|
+
event: E,
|
|
2848
2993
|
startCol: $,
|
|
2849
|
-
endCol:
|
|
2850
|
-
continuesBefore:
|
|
2851
|
-
continuesAfter:
|
|
2852
|
-
isSingleDayAllDay:
|
|
2994
|
+
endCol: A,
|
|
2995
|
+
continuesBefore: L,
|
|
2996
|
+
continuesAfter: B,
|
|
2997
|
+
isSingleDayAllDay: I
|
|
2853
2998
|
};
|
|
2854
2999
|
}).filter(Boolean);
|
|
2855
|
-
return
|
|
3000
|
+
return _n(f);
|
|
2856
3001
|
}, [t, n]);
|
|
2857
|
-
if (
|
|
2858
|
-
const
|
|
2859
|
-
`${
|
|
2860
|
-
...i.map((
|
|
2861
|
-
].join(" "),
|
|
2862
|
-
return /* @__PURE__ */
|
|
3002
|
+
if (d.length === 0) return null;
|
|
3003
|
+
const b = Math.max(...d.map((f) => f.row)) + 1, v = Math.min(b, Se), u = b > Se, g = u ? d.filter((f) => f.row >= Se).length : 0, p = [
|
|
3004
|
+
`${r}px`,
|
|
3005
|
+
...i.map((f) => f > a ? `${f}px` : `minmax(${a}px, 1fr)`)
|
|
3006
|
+
].join(" "), N = v * Ae + (v - 1) * rt + 8;
|
|
3007
|
+
return /* @__PURE__ */ o(
|
|
2863
3008
|
"div",
|
|
2864
3009
|
{
|
|
2865
|
-
className:
|
|
3010
|
+
className: l(
|
|
2866
3011
|
"ic-all-day-row border-b bg-muted/20 relative",
|
|
2867
|
-
|
|
3012
|
+
k
|
|
2868
3013
|
),
|
|
2869
3014
|
style: {
|
|
2870
3015
|
display: "grid",
|
|
2871
|
-
gridTemplateColumns:
|
|
2872
|
-
gridTemplateRows: `repeat(${
|
|
2873
|
-
gap: `${
|
|
3016
|
+
gridTemplateColumns: p,
|
|
3017
|
+
gridTemplateRows: `repeat(${v}, ${Ae}px)`,
|
|
3018
|
+
gap: `${rt}px 0`,
|
|
2874
3019
|
paddingTop: 4,
|
|
2875
3020
|
paddingBottom: 4,
|
|
2876
|
-
minHeight:
|
|
3021
|
+
minHeight: N
|
|
2877
3022
|
},
|
|
2878
3023
|
children: [
|
|
2879
3024
|
/* @__PURE__ */ e(
|
|
@@ -2882,39 +3027,39 @@ function gn({
|
|
|
2882
3027
|
className: "flex items-start justify-center pt-1 text-[10px] font-medium text-muted-foreground",
|
|
2883
3028
|
style: {
|
|
2884
3029
|
gridColumn: 1,
|
|
2885
|
-
gridRow: `1 / span ${
|
|
3030
|
+
gridRow: `1 / span ${v}`
|
|
2886
3031
|
},
|
|
2887
3032
|
children: /* @__PURE__ */ e("span", { className: "hidden sm:inline", children: "All day" })
|
|
2888
3033
|
}
|
|
2889
3034
|
),
|
|
2890
|
-
n.map((
|
|
3035
|
+
n.map((f, E) => /* @__PURE__ */ e(
|
|
2891
3036
|
"div",
|
|
2892
3037
|
{
|
|
2893
3038
|
className: "pointer-events-none border-r last:border-r-0",
|
|
2894
3039
|
style: {
|
|
2895
|
-
gridColumn:
|
|
2896
|
-
gridRow: `1 / span ${
|
|
3040
|
+
gridColumn: E + 2,
|
|
3041
|
+
gridRow: `1 / span ${v}`
|
|
2897
3042
|
}
|
|
2898
3043
|
},
|
|
2899
|
-
|
|
3044
|
+
f.toDateString()
|
|
2900
3045
|
)),
|
|
2901
|
-
|
|
2902
|
-
|
|
3046
|
+
d.filter((f) => f.row < Se).map((f) => /* @__PURE__ */ e(
|
|
3047
|
+
In,
|
|
2903
3048
|
{
|
|
2904
|
-
pe:
|
|
2905
|
-
onEventClick:
|
|
3049
|
+
pe: f,
|
|
3050
|
+
onEventClick: h,
|
|
2906
3051
|
disablePopover: s,
|
|
2907
|
-
renderPopover:
|
|
3052
|
+
renderPopover: y
|
|
2908
3053
|
},
|
|
2909
|
-
|
|
3054
|
+
f.event.id
|
|
2910
3055
|
)),
|
|
2911
|
-
|
|
3056
|
+
u && /* @__PURE__ */ o(
|
|
2912
3057
|
"div",
|
|
2913
3058
|
{
|
|
2914
3059
|
className: "text-[10px] text-muted-foreground font-medium px-2 flex items-center",
|
|
2915
3060
|
style: {
|
|
2916
3061
|
gridColumn: `2 / ${n.length + 2}`,
|
|
2917
|
-
gridRow:
|
|
3062
|
+
gridRow: v
|
|
2918
3063
|
},
|
|
2919
3064
|
children: [
|
|
2920
3065
|
"+",
|
|
@@ -2927,356 +3072,356 @@ function gn({
|
|
|
2927
3072
|
}
|
|
2928
3073
|
);
|
|
2929
3074
|
}
|
|
2930
|
-
const
|
|
2931
|
-
function
|
|
3075
|
+
const he = 96, ve = 56, at = 72, te = 120, Me = 100, Rn = 3;
|
|
3076
|
+
function Qn({
|
|
2932
3077
|
events: t,
|
|
2933
3078
|
date: n,
|
|
2934
|
-
weekStartsOn:
|
|
3079
|
+
weekStartsOn: r = 1,
|
|
2935
3080
|
visibleHours: a = { startHour: 0, endHour: 24 },
|
|
2936
3081
|
workingHours: i,
|
|
2937
|
-
slotDuration:
|
|
3082
|
+
slotDuration: h = 30,
|
|
2938
3083
|
badgeVariant: s = "colored",
|
|
2939
|
-
onEventClick:
|
|
2940
|
-
onSlotSelect:
|
|
2941
|
-
onDayClick:
|
|
2942
|
-
className:
|
|
2943
|
-
renderEvent:
|
|
2944
|
-
renderPopover:
|
|
3084
|
+
onEventClick: y,
|
|
3085
|
+
onSlotSelect: k,
|
|
3086
|
+
onDayClick: d,
|
|
3087
|
+
className: b,
|
|
3088
|
+
renderEvent: v,
|
|
3089
|
+
renderPopover: u,
|
|
2945
3090
|
slots: g,
|
|
2946
|
-
classNames:
|
|
3091
|
+
classNames: p
|
|
2947
3092
|
}) {
|
|
2948
|
-
const
|
|
2949
|
-
const
|
|
2950
|
-
for (let
|
|
2951
|
-
|
|
2952
|
-
return
|
|
2953
|
-
}, [
|
|
2954
|
-
() =>
|
|
2955
|
-
[n,
|
|
2956
|
-
),
|
|
2957
|
-
() =>
|
|
3093
|
+
const N = 60 / h, f = 100 / N, E = q(() => {
|
|
3094
|
+
const c = [];
|
|
3095
|
+
for (let m = 0; m < N; m++)
|
|
3096
|
+
c.push(m * h);
|
|
3097
|
+
return c;
|
|
3098
|
+
}, [N, h]), D = q(
|
|
3099
|
+
() => zt(n, r),
|
|
3100
|
+
[n, r]
|
|
3101
|
+
), T = q(
|
|
3102
|
+
() => lt(a),
|
|
2958
3103
|
[a]
|
|
2959
3104
|
), $ = q(() => {
|
|
2960
|
-
const
|
|
2961
|
-
for (const
|
|
2962
|
-
const
|
|
2963
|
-
|
|
2964
|
-
|
|
3105
|
+
const c = /* @__PURE__ */ new Map();
|
|
3106
|
+
for (const m of D) {
|
|
3107
|
+
const S = m.toDateString(), C = Fe(t, m), { singleDay: H, multiDay: G } = it(C), O = st(
|
|
3108
|
+
H,
|
|
3109
|
+
m,
|
|
2965
3110
|
a,
|
|
2966
|
-
|
|
3111
|
+
he
|
|
2967
3112
|
), U = /* @__PURE__ */ new Map();
|
|
2968
|
-
let
|
|
2969
|
-
for (const
|
|
2970
|
-
if (U.set(
|
|
2971
|
-
const
|
|
2972
|
-
|
|
3113
|
+
let oe = 1;
|
|
3114
|
+
for (const Z of O)
|
|
3115
|
+
if (U.set(Z.event.id, Z.position), Z.position.width > 0) {
|
|
3116
|
+
const ee = Math.round(100 / Z.position.width);
|
|
3117
|
+
oe = Math.max(oe, ee);
|
|
2973
3118
|
}
|
|
2974
|
-
|
|
2975
|
-
singleDay:
|
|
2976
|
-
multiDay:
|
|
3119
|
+
c.set(S, {
|
|
3120
|
+
singleDay: H,
|
|
3121
|
+
multiDay: G,
|
|
2977
3122
|
positions: U,
|
|
2978
|
-
maxOverlapping:
|
|
3123
|
+
maxOverlapping: oe
|
|
2979
3124
|
});
|
|
2980
3125
|
}
|
|
2981
|
-
return
|
|
2982
|
-
}, [
|
|
2983
|
-
const
|
|
2984
|
-
for (const { multiDay:
|
|
2985
|
-
for (const
|
|
2986
|
-
|
|
2987
|
-
return Array.from(
|
|
2988
|
-
}, [$]),
|
|
2989
|
-
if (
|
|
2990
|
-
const
|
|
2991
|
-
return
|
|
2992
|
-
}, [
|
|
2993
|
-
|
|
2994
|
-
const
|
|
2995
|
-
if (!
|
|
2996
|
-
const
|
|
2997
|
-
let
|
|
2998
|
-
if (
|
|
2999
|
-
const
|
|
3000
|
-
|
|
3126
|
+
return c;
|
|
3127
|
+
}, [D, t, a]), A = q(() => {
|
|
3128
|
+
const c = /* @__PURE__ */ new Map();
|
|
3129
|
+
for (const { multiDay: m } of $.values())
|
|
3130
|
+
for (const S of m)
|
|
3131
|
+
c.set(S.id, S);
|
|
3132
|
+
return Array.from(c.values());
|
|
3133
|
+
}, [$]), L = /* @__PURE__ */ new Date(), B = D.findIndex((c) => ce(c)), P = q(() => {
|
|
3134
|
+
if (B < 0) return -1;
|
|
3135
|
+
const c = L.getHours() + L.getMinutes() / 60;
|
|
3136
|
+
return c < a.startHour || c > a.endHour ? -1 : (c - a.startHour) * he;
|
|
3137
|
+
}, [B, a, L]), I = ne(null);
|
|
3138
|
+
je(() => {
|
|
3139
|
+
const c = I.current;
|
|
3140
|
+
if (!c) return;
|
|
3141
|
+
const m = () => {
|
|
3142
|
+
let S;
|
|
3143
|
+
if (B !== -1) {
|
|
3144
|
+
const H = (/* @__PURE__ */ new Date()).getHours();
|
|
3145
|
+
S = Math.max(H - 1, a.startHour);
|
|
3001
3146
|
} else {
|
|
3002
|
-
const
|
|
3003
|
-
let
|
|
3004
|
-
if (!
|
|
3147
|
+
const G = (/* @__PURE__ */ new Date()).getDay();
|
|
3148
|
+
let O = i?.[G];
|
|
3149
|
+
if (!O?.enabled || O.from === 0) {
|
|
3005
3150
|
const U = i?.[1];
|
|
3006
|
-
U?.enabled && (
|
|
3151
|
+
U?.enabled && (O = U);
|
|
3007
3152
|
}
|
|
3008
|
-
|
|
3009
|
-
|
|
3153
|
+
O?.enabled && O.from > 0 ? S = Math.max(
|
|
3154
|
+
O.from - 1,
|
|
3010
3155
|
a.startHour
|
|
3011
|
-
) :
|
|
3156
|
+
) : S = Math.max(7, a.startHour);
|
|
3012
3157
|
}
|
|
3013
|
-
const
|
|
3014
|
-
|
|
3015
|
-
top:
|
|
3158
|
+
const C = (S - a.startHour) * he;
|
|
3159
|
+
c.scrollTo({
|
|
3160
|
+
top: C,
|
|
3016
3161
|
behavior: "instant"
|
|
3017
3162
|
});
|
|
3018
3163
|
};
|
|
3019
3164
|
requestAnimationFrame(() => {
|
|
3020
|
-
requestAnimationFrame(
|
|
3165
|
+
requestAnimationFrame(m);
|
|
3021
3166
|
});
|
|
3022
|
-
}, [n, i, a,
|
|
3023
|
-
const
|
|
3024
|
-
(
|
|
3025
|
-
|
|
3167
|
+
}, [n, i, a, B]);
|
|
3168
|
+
const R = Ge(), j = z(
|
|
3169
|
+
(c) => {
|
|
3170
|
+
R?.startSelection(c);
|
|
3026
3171
|
},
|
|
3027
|
-
[
|
|
3028
|
-
),
|
|
3029
|
-
(
|
|
3030
|
-
|
|
3172
|
+
[R]
|
|
3173
|
+
), W = z(
|
|
3174
|
+
(c) => {
|
|
3175
|
+
R?.updateSelection(c);
|
|
3031
3176
|
},
|
|
3032
|
-
[
|
|
3033
|
-
),
|
|
3034
|
-
|
|
3035
|
-
}, [
|
|
3036
|
-
(
|
|
3037
|
-
|
|
3177
|
+
[R]
|
|
3178
|
+
), x = z(() => {
|
|
3179
|
+
R?.endSelection();
|
|
3180
|
+
}, [R]), _ = z(
|
|
3181
|
+
(c) => {
|
|
3182
|
+
y?.(c);
|
|
3038
3183
|
},
|
|
3039
|
-
[
|
|
3040
|
-
),
|
|
3041
|
-
const
|
|
3042
|
-
for (const
|
|
3043
|
-
const
|
|
3044
|
-
|
|
3045
|
-
Math.max(
|
|
3046
|
-
) :
|
|
3184
|
+
[y]
|
|
3185
|
+
), M = ve + 7 * te, F = q(() => {
|
|
3186
|
+
const c = [];
|
|
3187
|
+
for (const m of D) {
|
|
3188
|
+
const S = m.toDateString(), H = $.get(S)?.maxOverlapping ?? 1;
|
|
3189
|
+
H > Rn ? c.push(
|
|
3190
|
+
Math.max(te, H * Me)
|
|
3191
|
+
) : c.push(te);
|
|
3047
3192
|
}
|
|
3048
|
-
return
|
|
3049
|
-
}, [
|
|
3050
|
-
return /* @__PURE__ */
|
|
3051
|
-
|
|
3052
|
-
|
|
3193
|
+
return c;
|
|
3194
|
+
}, [D, $]), w = ve + F.reduce((c, m) => c + m, 0);
|
|
3195
|
+
return /* @__PURE__ */ o("div", { className: l("ic-week-view flex flex-col h-full", b), children: [
|
|
3196
|
+
A.length > 0 && /* @__PURE__ */ e(
|
|
3197
|
+
$n,
|
|
3053
3198
|
{
|
|
3054
|
-
events:
|
|
3055
|
-
weekDays:
|
|
3056
|
-
hourColumnWidth:
|
|
3057
|
-
minDayColumnWidth:
|
|
3058
|
-
dayColumnWidths:
|
|
3199
|
+
events: A,
|
|
3200
|
+
weekDays: D,
|
|
3201
|
+
hourColumnWidth: ve,
|
|
3202
|
+
minDayColumnWidth: te,
|
|
3203
|
+
dayColumnWidths: F,
|
|
3059
3204
|
onEventClick: _,
|
|
3060
|
-
disablePopover: !!
|
|
3061
|
-
renderPopover:
|
|
3062
|
-
...
|
|
3063
|
-
className:
|
|
3205
|
+
disablePopover: !!y && !u,
|
|
3206
|
+
renderPopover: u,
|
|
3207
|
+
...p?.multiDayBanner && {
|
|
3208
|
+
className: p.multiDayBanner
|
|
3064
3209
|
}
|
|
3065
3210
|
}
|
|
3066
3211
|
),
|
|
3067
3212
|
/* @__PURE__ */ e(
|
|
3068
3213
|
"div",
|
|
3069
3214
|
{
|
|
3070
|
-
ref:
|
|
3071
|
-
className:
|
|
3215
|
+
ref: I,
|
|
3216
|
+
className: l(
|
|
3072
3217
|
"ic-week-scroll-container flex-1",
|
|
3073
|
-
|
|
3218
|
+
p?.scrollContainer
|
|
3074
3219
|
),
|
|
3075
|
-
children: /* @__PURE__ */
|
|
3076
|
-
/* @__PURE__ */ e("div", { className: "ic-week-header sticky top-0 z-20 border-b bg-background", children: /* @__PURE__ */
|
|
3220
|
+
children: /* @__PURE__ */ o("div", { style: { minWidth: Math.max(M, w) }, children: [
|
|
3221
|
+
/* @__PURE__ */ e("div", { className: "ic-week-header sticky top-0 z-20 border-b bg-background", children: /* @__PURE__ */ o("div", { className: "flex", children: [
|
|
3077
3222
|
/* @__PURE__ */ e(
|
|
3078
3223
|
"div",
|
|
3079
3224
|
{
|
|
3080
3225
|
className: "flex-shrink-0 flex items-end justify-center pb-2 text-[10px] text-muted-foreground/70",
|
|
3081
|
-
style: { width:
|
|
3082
|
-
children: /* @__PURE__ */
|
|
3226
|
+
style: { width: ve, height: at },
|
|
3227
|
+
children: /* @__PURE__ */ o("span", { className: "hidden sm:inline", children: [
|
|
3083
3228
|
"GMT",
|
|
3084
3229
|
(() => {
|
|
3085
|
-
const
|
|
3086
|
-
return
|
|
3230
|
+
const c = (/* @__PURE__ */ new Date()).getTimezoneOffset(), m = Math.abs(Math.floor(c / 60)), S = c <= 0 ? "+" : "-";
|
|
3231
|
+
return m > 0 ? `${S}${String(m).padStart(2, "0")}` : "";
|
|
3087
3232
|
})()
|
|
3088
3233
|
] })
|
|
3089
3234
|
}
|
|
3090
3235
|
),
|
|
3091
|
-
|
|
3092
|
-
const
|
|
3093
|
-
return /* @__PURE__ */
|
|
3236
|
+
D.map((c, m) => {
|
|
3237
|
+
const S = ce(c), C = F[m] ?? te, H = C > te;
|
|
3238
|
+
return /* @__PURE__ */ o(
|
|
3094
3239
|
"div",
|
|
3095
3240
|
{
|
|
3096
|
-
className:
|
|
3241
|
+
className: l(
|
|
3097
3242
|
"flex-1 flex flex-col items-center justify-center border-r last:border-r-0 py-2",
|
|
3098
|
-
|
|
3099
|
-
|
|
3243
|
+
p?.columnHeader,
|
|
3244
|
+
S && p?.columnHeaderToday
|
|
3100
3245
|
),
|
|
3101
3246
|
style: {
|
|
3102
|
-
height:
|
|
3103
|
-
minWidth:
|
|
3247
|
+
height: at,
|
|
3248
|
+
minWidth: H ? C : te
|
|
3104
3249
|
},
|
|
3105
3250
|
children: [
|
|
3106
3251
|
/* @__PURE__ */ e(
|
|
3107
3252
|
"span",
|
|
3108
3253
|
{
|
|
3109
|
-
className:
|
|
3254
|
+
className: l(
|
|
3110
3255
|
"text-[11px] font-medium uppercase tracking-wide",
|
|
3111
|
-
|
|
3256
|
+
S ? "text-primary" : "text-muted-foreground"
|
|
3112
3257
|
),
|
|
3113
|
-
children:
|
|
3258
|
+
children: c.toLocaleDateString([], { weekday: "short" })
|
|
3114
3259
|
}
|
|
3115
3260
|
),
|
|
3116
3261
|
/* @__PURE__ */ e(
|
|
3117
3262
|
"button",
|
|
3118
3263
|
{
|
|
3119
3264
|
type: "button",
|
|
3120
|
-
onClick: () =>
|
|
3121
|
-
className:
|
|
3265
|
+
onClick: () => d?.(c),
|
|
3266
|
+
className: l(
|
|
3122
3267
|
"flex items-center justify-center rounded-full transition-colors mt-0.5",
|
|
3123
3268
|
"size-10 text-2xl font-normal",
|
|
3124
|
-
|
|
3269
|
+
S ? "bg-primary text-primary-foreground" : "text-foreground hover:bg-muted"
|
|
3125
3270
|
),
|
|
3126
|
-
children:
|
|
3271
|
+
children: c.getDate()
|
|
3127
3272
|
}
|
|
3128
3273
|
)
|
|
3129
3274
|
]
|
|
3130
3275
|
},
|
|
3131
|
-
|
|
3276
|
+
c.toDateString()
|
|
3132
3277
|
);
|
|
3133
3278
|
})
|
|
3134
3279
|
] }) }),
|
|
3135
|
-
/* @__PURE__ */
|
|
3280
|
+
/* @__PURE__ */ o("div", { className: "relative flex", children: [
|
|
3136
3281
|
/* @__PURE__ */ e(
|
|
3137
3282
|
"div",
|
|
3138
3283
|
{
|
|
3139
|
-
className:
|
|
3284
|
+
className: l(
|
|
3140
3285
|
"ic-hour-column sticky left-0 z-10 bg-zinc-50 border-r",
|
|
3141
|
-
|
|
3286
|
+
p?.timeGutter
|
|
3142
3287
|
),
|
|
3143
|
-
style: { width:
|
|
3144
|
-
children:
|
|
3288
|
+
style: { width: ve },
|
|
3289
|
+
children: T.map((c, m) => /* @__PURE__ */ e(
|
|
3145
3290
|
"div",
|
|
3146
3291
|
{
|
|
3147
3292
|
className: "relative",
|
|
3148
|
-
style: { height:
|
|
3149
|
-
children: /* @__PURE__ */ e("div", { className: "absolute -top-2.5 right-1 sm:right-2 flex h-5 items-center", children:
|
|
3293
|
+
style: { height: he },
|
|
3294
|
+
children: /* @__PURE__ */ e("div", { className: "absolute -top-2.5 right-1 sm:right-2 flex h-5 items-center", children: m !== 0 && /* @__PURE__ */ e(
|
|
3150
3295
|
"span",
|
|
3151
3296
|
{
|
|
3152
|
-
className:
|
|
3297
|
+
className: l(
|
|
3153
3298
|
"text-[10px] sm:text-xs text-muted-foreground",
|
|
3154
|
-
|
|
3299
|
+
p?.timeGutterLabel
|
|
3155
3300
|
),
|
|
3156
|
-
children:
|
|
3301
|
+
children: ze(c)
|
|
3157
3302
|
}
|
|
3158
3303
|
) })
|
|
3159
3304
|
},
|
|
3160
|
-
|
|
3305
|
+
c
|
|
3161
3306
|
))
|
|
3162
3307
|
}
|
|
3163
3308
|
),
|
|
3164
|
-
/* @__PURE__ */ e("div", { className: "ic-week-grid relative flex-1", children: /* @__PURE__ */ e("div", { className: "flex divide-x", children:
|
|
3165
|
-
const
|
|
3166
|
-
return /* @__PURE__ */
|
|
3309
|
+
/* @__PURE__ */ e("div", { className: "ic-week-grid relative flex-1", children: /* @__PURE__ */ e("div", { className: "flex divide-x", children: D.map((c, m) => {
|
|
3310
|
+
const S = c.toDateString(), C = $.get(S), H = F[m] ?? te, G = H > te;
|
|
3311
|
+
return /* @__PURE__ */ o(
|
|
3167
3312
|
"div",
|
|
3168
3313
|
{
|
|
3169
3314
|
className: "ic-day-column relative flex-1",
|
|
3170
3315
|
style: {
|
|
3171
|
-
minWidth:
|
|
3316
|
+
minWidth: G ? H : te
|
|
3172
3317
|
},
|
|
3173
3318
|
children: [
|
|
3174
|
-
|
|
3175
|
-
const
|
|
3176
|
-
|
|
3177
|
-
|
|
3319
|
+
T.map((O, U) => {
|
|
3320
|
+
const Z = !dt(
|
|
3321
|
+
c,
|
|
3322
|
+
O,
|
|
3178
3323
|
i
|
|
3179
3324
|
);
|
|
3180
|
-
return /* @__PURE__ */
|
|
3325
|
+
return /* @__PURE__ */ o(
|
|
3181
3326
|
"div",
|
|
3182
3327
|
{
|
|
3183
|
-
className:
|
|
3328
|
+
className: l(
|
|
3184
3329
|
"relative",
|
|
3185
|
-
|
|
3186
|
-
ce(
|
|
3187
|
-
|
|
3188
|
-
|
|
3330
|
+
Z && "bg-calendar-disabled-hour",
|
|
3331
|
+
ce(c) && !Z && "bg-primary/5",
|
|
3332
|
+
p?.timeSlot,
|
|
3333
|
+
Z ? p?.timeSlotNonWorking : p?.timeSlotWorking
|
|
3189
3334
|
),
|
|
3190
|
-
style: { height:
|
|
3335
|
+
style: { height: he },
|
|
3191
3336
|
children: [
|
|
3192
3337
|
U !== 0 && /* @__PURE__ */ e("div", { className: "pointer-events-none absolute inset-x-0 top-0 border-b border-border/50" }),
|
|
3193
|
-
|
|
3338
|
+
E.slice(1).map((ee) => /* @__PURE__ */ e(
|
|
3194
3339
|
"div",
|
|
3195
3340
|
{
|
|
3196
3341
|
className: "pointer-events-none absolute inset-x-0 border-b border-dashed border-border/30",
|
|
3197
|
-
style: { top: `${
|
|
3342
|
+
style: { top: `${ee / 60 * 100}%` }
|
|
3198
3343
|
},
|
|
3199
|
-
|
|
3344
|
+
ee
|
|
3200
3345
|
)),
|
|
3201
|
-
|
|
3202
|
-
const
|
|
3203
|
-
date:
|
|
3204
|
-
hour:
|
|
3205
|
-
minute:
|
|
3346
|
+
E.map((ee, xe) => {
|
|
3347
|
+
const ye = {
|
|
3348
|
+
date: c,
|
|
3349
|
+
hour: O,
|
|
3350
|
+
minute: ee
|
|
3206
3351
|
};
|
|
3207
3352
|
return /* @__PURE__ */ e(
|
|
3208
|
-
|
|
3353
|
+
Nt,
|
|
3209
3354
|
{
|
|
3210
|
-
slot:
|
|
3211
|
-
onSelectionStart:
|
|
3212
|
-
onSelectionMove:
|
|
3213
|
-
onSelectionEnd:
|
|
3214
|
-
isSelected:
|
|
3215
|
-
isSelecting:
|
|
3216
|
-
disabled:
|
|
3355
|
+
slot: ye,
|
|
3356
|
+
onSelectionStart: j,
|
|
3357
|
+
onSelectionMove: W,
|
|
3358
|
+
onSelectionEnd: x,
|
|
3359
|
+
isSelected: R?.isSlotSelected(ye) ?? !1,
|
|
3360
|
+
isSelecting: R?.isSelecting ?? !1,
|
|
3361
|
+
disabled: Z,
|
|
3217
3362
|
className: "absolute inset-x-0",
|
|
3218
3363
|
style: {
|
|
3219
|
-
top: `${
|
|
3220
|
-
height: `${
|
|
3364
|
+
top: `${xe * f}%`,
|
|
3365
|
+
height: `${f}%`
|
|
3221
3366
|
},
|
|
3222
|
-
ariaLabel: `Add event on ${
|
|
3367
|
+
ariaLabel: `Add event on ${c.toLocaleDateString()} at ${ze(O)}:${String(ee).padStart(2, "0")}`
|
|
3223
3368
|
},
|
|
3224
|
-
|
|
3369
|
+
ee
|
|
3225
3370
|
);
|
|
3226
3371
|
})
|
|
3227
3372
|
]
|
|
3228
3373
|
},
|
|
3229
|
-
|
|
3374
|
+
O
|
|
3230
3375
|
);
|
|
3231
3376
|
}),
|
|
3232
|
-
|
|
3233
|
-
const U =
|
|
3377
|
+
C?.singleDay.map((O) => {
|
|
3378
|
+
const U = C.positions.get(O.id);
|
|
3234
3379
|
if (!U) return null;
|
|
3235
|
-
const
|
|
3236
|
-
return
|
|
3380
|
+
const oe = `calc(${U.width}% - 2px)`, Z = `max(${Me}px, ${oe})`;
|
|
3381
|
+
return v ? /* @__PURE__ */ e(
|
|
3237
3382
|
"div",
|
|
3238
3383
|
{
|
|
3239
3384
|
className: "absolute pointer-events-auto p-0.5",
|
|
3240
3385
|
style: {
|
|
3241
3386
|
top: `${U.top}px`,
|
|
3242
3387
|
left: `${U.left}%`,
|
|
3243
|
-
width:
|
|
3244
|
-
minWidth: `${
|
|
3388
|
+
width: Z,
|
|
3389
|
+
minWidth: `${Me}px`
|
|
3245
3390
|
},
|
|
3246
|
-
children:
|
|
3391
|
+
children: v({ event: O, position: U })
|
|
3247
3392
|
},
|
|
3248
|
-
|
|
3393
|
+
O.id
|
|
3249
3394
|
) : /* @__PURE__ */ e(
|
|
3250
|
-
|
|
3395
|
+
bt,
|
|
3251
3396
|
{
|
|
3252
|
-
event:
|
|
3397
|
+
event: O,
|
|
3253
3398
|
position: {
|
|
3254
3399
|
top: U.top,
|
|
3255
3400
|
left: U.left,
|
|
3256
3401
|
width: U.width,
|
|
3257
|
-
minWidth:
|
|
3402
|
+
minWidth: Me
|
|
3258
3403
|
},
|
|
3259
|
-
hourHeight:
|
|
3404
|
+
hourHeight: he,
|
|
3260
3405
|
badgeVariant: s,
|
|
3261
|
-
onClick:
|
|
3262
|
-
disablePopover: !!
|
|
3263
|
-
renderPopover:
|
|
3264
|
-
className:
|
|
3406
|
+
onClick: y,
|
|
3407
|
+
disablePopover: !!y && !u,
|
|
3408
|
+
renderPopover: u,
|
|
3409
|
+
className: l(
|
|
3265
3410
|
"pointer-events-auto",
|
|
3266
|
-
|
|
3411
|
+
p?.eventCard
|
|
3267
3412
|
)
|
|
3268
3413
|
},
|
|
3269
|
-
|
|
3414
|
+
O.id
|
|
3270
3415
|
);
|
|
3271
3416
|
}),
|
|
3272
|
-
|
|
3417
|
+
m === B && P >= 0 && /* @__PURE__ */ o(
|
|
3273
3418
|
"div",
|
|
3274
3419
|
{
|
|
3275
|
-
className:
|
|
3420
|
+
className: l(
|
|
3276
3421
|
"absolute left-0 right-0 z-20 flex items-center pointer-events-none",
|
|
3277
|
-
|
|
3422
|
+
p?.currentTimeIndicator
|
|
3278
3423
|
),
|
|
3279
|
-
style: { top:
|
|
3424
|
+
style: { top: P },
|
|
3280
3425
|
children: [
|
|
3281
3426
|
/* @__PURE__ */ e("div", { className: "h-2 w-2 -ml-1 rounded-full bg-red-500" }),
|
|
3282
3427
|
/* @__PURE__ */ e("div", { className: "flex-1 h-0.5 bg-red-500" })
|
|
@@ -3285,7 +3430,7 @@ function Ln({
|
|
|
3285
3430
|
)
|
|
3286
3431
|
]
|
|
3287
3432
|
},
|
|
3288
|
-
|
|
3433
|
+
c.toDateString()
|
|
3289
3434
|
);
|
|
3290
3435
|
}) }) })
|
|
3291
3436
|
] })
|
|
@@ -3295,35 +3440,49 @@ function Ln({
|
|
|
3295
3440
|
] });
|
|
3296
3441
|
}
|
|
3297
3442
|
export {
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3443
|
+
Yn as A,
|
|
3444
|
+
pe as B,
|
|
3445
|
+
Xn as C,
|
|
3446
|
+
fn as D,
|
|
3447
|
+
bt as E,
|
|
3448
|
+
ie as F,
|
|
3449
|
+
nn as G,
|
|
3450
|
+
de as H,
|
|
3451
|
+
Ze as I,
|
|
3452
|
+
Qe as J,
|
|
3453
|
+
He as K,
|
|
3454
|
+
Oe as L,
|
|
3455
|
+
Zn as M,
|
|
3456
|
+
un as N,
|
|
3457
|
+
ue as P,
|
|
3458
|
+
Kt as S,
|
|
3459
|
+
Nt as T,
|
|
3460
|
+
Qn as W,
|
|
3461
|
+
Sn as a,
|
|
3462
|
+
An as b,
|
|
3463
|
+
Jn as c,
|
|
3464
|
+
jt as d,
|
|
3465
|
+
Vn as e,
|
|
3466
|
+
pt as f,
|
|
3467
|
+
qt as g,
|
|
3468
|
+
Gt as h,
|
|
3469
|
+
Ut as i,
|
|
3470
|
+
Ft as j,
|
|
3471
|
+
We as k,
|
|
3472
|
+
zn as l,
|
|
3473
|
+
Kn as m,
|
|
3474
|
+
Gn as n,
|
|
3475
|
+
le as o,
|
|
3476
|
+
me as p,
|
|
3477
|
+
Un as q,
|
|
3478
|
+
gt as r,
|
|
3479
|
+
Qt as s,
|
|
3480
|
+
Jt as t,
|
|
3481
|
+
Zt as u,
|
|
3482
|
+
Xt as v,
|
|
3483
|
+
xn as w,
|
|
3484
|
+
ae as x,
|
|
3485
|
+
re as y,
|
|
3486
|
+
qn as z
|
|
3328
3487
|
};
|
|
3329
|
-
//# sourceMappingURL=week-view-
|
|
3488
|
+
//# sourceMappingURL=week-view-vnIcmoVr.js.map
|