@devalok/shilp-sutra-karm 0.8.2 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/chat-panel.js +376 -0
- package/dist/_chunks/daily-brief.js +177 -0
- package/dist/_chunks/kanban-board.js +597 -0
- package/dist/_chunks/project-card.js +121 -0
- package/dist/_chunks/render-adjustment-type.js +3596 -0
- package/dist/{tasks → _chunks}/task-constants.js +3 -3
- package/dist/_chunks/task-detail-panel.js +1305 -0
- package/dist/_chunks/use-composed-ref.js +12 -0
- package/dist/_chunks/vendor.js +11491 -0
- package/dist/admin/index.js +37 -60
- package/dist/board/index.js +3 -5
- package/dist/chat/index.js +6 -10
- package/dist/client/index.js +4 -6
- package/dist/dashboard/index.js +3 -4
- package/dist/index.js +189 -103
- package/dist/tasks/index.js +8 -14
- package/package.json +78 -80
- package/dist/admin/adjustments/approved-adjustments.js +0 -43
- package/dist/admin/break/break-admin-skeleton.js +0 -59
- package/dist/admin/break/break-admin.js +0 -373
- package/dist/admin/break/break-balance.js +0 -42
- package/dist/admin/break/breaks.js +0 -91
- package/dist/admin/break/delete-break.js +0 -55
- package/dist/admin/break/edit-break-balance.js +0 -113
- package/dist/admin/break/edit-break.js +0 -453
- package/dist/admin/break/header.js +0 -231
- package/dist/admin/break/leave-request.js +0 -162
- package/dist/admin/break/use-break-date-picker.js +0 -43
- package/dist/admin/dashboard/admin-dashboard.js +0 -337
- package/dist/admin/dashboard/associate-detail.js +0 -259
- package/dist/admin/dashboard/attendance-overview.js +0 -136
- package/dist/admin/dashboard/break-request.js +0 -176
- package/dist/admin/dashboard/calendar.js +0 -141
- package/dist/admin/dashboard/correction-list.js +0 -102
- package/dist/admin/dashboard/dashboard-header.js +0 -155
- package/dist/admin/dashboard/dashboard-skeleton.js +0 -109
- package/dist/admin/dashboard/leave-requests.js +0 -201
- package/dist/admin/dashboard/render-date.js +0 -144
- package/dist/admin/dashboard/use-calendar-navigation.js +0 -169
- package/dist/admin/dashboard/use-leave-request-interaction.js +0 -34
- package/dist/admin/utils/date-range-utils.js +0 -37
- package/dist/admin/utils/date-utils.js +0 -119
- package/dist/admin/utils/emoji-utils.js +0 -17
- package/dist/admin/utils/render-adjustment-type.js +0 -20
- package/dist/admin/utils/render-status.js +0 -22
- package/dist/board/board-column.js +0 -236
- package/dist/board/kanban-board.js +0 -218
- package/dist/board/task-card.js +0 -168
- package/dist/chat/chat-input.js +0 -54
- package/dist/chat/chat-panel.js +0 -151
- package/dist/chat/conversation-list.js +0 -99
- package/dist/chat/markdown-components.js +0 -35
- package/dist/chat/message-list.js +0 -59
- package/dist/chat/streaming-text.js +0 -17
- package/dist/client/accent-provider.js +0 -22
- package/dist/client/client-portal-header.js +0 -48
- package/dist/client/project-card.js +0 -60
- package/dist/dashboard/attendance-cta.js +0 -115
- package/dist/dashboard/daily-brief.js +0 -68
- package/dist/page-skeletons.js +0 -130
- package/dist/tasks/activity-tab.js +0 -185
- package/dist/tasks/conversation-tab.js +0 -138
- package/dist/tasks/files-tab.js +0 -186
- package/dist/tasks/review-tab.js +0 -170
- package/dist/tasks/subtasks-tab.js +0 -154
- package/dist/tasks/task-detail-panel.js +0 -210
- package/dist/tasks/task-properties.js +0 -324
- package/dist/utils/use-composed-ref.js +0 -12
|
@@ -0,0 +1,3596 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e, jsxs as s, Fragment as V } from "react/jsx-runtime";
|
|
3
|
+
import * as O from "react";
|
|
4
|
+
import ve, { useState as M, useEffect as U, useRef as Be, useCallback as $, Fragment as ht, useReducer as Lt, useMemo as Ye, createContext as bt, useContext as yt } from "react";
|
|
5
|
+
import { g as qt, i as Ut, j as Ie, k as es, l as Z, m as A, n as ts, o as Se, p as ss, q as gt, r as Ve, t as wt, c as as, w as q, x as rs, y as Nt, z as ls, A as lt, B as ds } from "./vendor.js";
|
|
6
|
+
import { cn as S } from "@devalok/shilp-sutra/ui/lib/utils";
|
|
7
|
+
import { Skeleton as R } from "@devalok/shilp-sutra/ui/skeleton";
|
|
8
|
+
import { DropdownMenu as he, DropdownMenuTrigger as be, DropdownMenuContent as ke, DropdownMenuItem as pe } from "@devalok/shilp-sutra/ui/dropdown-menu";
|
|
9
|
+
import { IconButton as X } from "@devalok/shilp-sutra/ui/icon-button";
|
|
10
|
+
import { IconChevronDown as ie, IconChevronLeft as ye, IconChevronRight as ge, IconX as oe, IconUser as vt, IconPencil as Je, IconSend as Dt, IconGripVertical as dt, IconSquareCheck as ns, IconSquare as is, IconPlus as os, IconCheck as Ge, IconTrash as cs, IconArrowRight as ms, IconDotsVertical as us, IconCalendar as xs, IconCalendarEvent as fs } from "@tabler/icons-react";
|
|
11
|
+
import { Button as J } from "@devalok/shilp-sutra/ui/button";
|
|
12
|
+
import { SegmentedControl as Et } from "@devalok/shilp-sutra/ui/segmented-control";
|
|
13
|
+
import { AvatarGroup as nt } from "@devalok/shilp-sutra/composed/avatar-group";
|
|
14
|
+
import { Dialog as ce, DialogTrigger as we, DialogContent as me, DialogHeader as Ne, DialogFooter as He, DialogClose as $e, DialogTitle as ps, DialogDescription as Ze } from "@devalok/shilp-sutra/ui/dialog";
|
|
15
|
+
import { Checkbox as it } from "@devalok/shilp-sutra/ui/checkbox";
|
|
16
|
+
import { Avatar as Xe, AvatarImage as Qe, AvatarFallback as Le } from "@devalok/shilp-sutra/ui/avatar";
|
|
17
|
+
import { Tooltip as ae, TooltipTrigger as re, TooltipContent as le } from "@devalok/shilp-sutra/ui/tooltip";
|
|
18
|
+
import { useIsMobile as hs } from "@devalok/shilp-sutra/hooks/use-mobile";
|
|
19
|
+
import { useToast as je } from "@devalok/shilp-sutra/hooks/use-toast";
|
|
20
|
+
import { Textarea as bs } from "@devalok/shilp-sutra/ui/textarea";
|
|
21
|
+
import { Popover as ys, PopoverTrigger as gs, PopoverContent as ws } from "@devalok/shilp-sutra/ui/popover";
|
|
22
|
+
import { Badge as Ns, Tooltip as vs, TooltipTrigger as Ds, TooltipContent as Es } from "@devalok/shilp-sutra/ui";
|
|
23
|
+
import { NumberInput as ks } from "@devalok/shilp-sutra/ui/number-input";
|
|
24
|
+
const kt = O.forwardRef(
|
|
25
|
+
function(t, n) {
|
|
26
|
+
return /* @__PURE__ */ e("div", { ref: n, className: "flex w-full max-w-layout flex-col items-center justify-center max-md:h-[100%] max-md:justify-start", children: /* @__PURE__ */ s("div", { className: "z-raised flex w-full flex-col items-start justify-start rounded-ds-lg border border-border bg-layer-02 p-ds-05 shadow-05 max-md:flex-1 max-md:min-h-0 max-md:overflow-y-auto max-md:border-0 max-md:px-ds-05 max-md:pb-0 max-md:pt-ds-06", children: [
|
|
27
|
+
/* @__PURE__ */ s("div", { className: "mb-ds-06 flex w-full flex-col items-start justify-between md:flex-row md:items-center", children: [
|
|
28
|
+
/* @__PURE__ */ e(he, { children: /* @__PURE__ */ s(be, { className: "text-ds-xl flex items-center gap-ds-03 text-text-secondary", "aria-label": "Select period", children: [
|
|
29
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-ds-03", children: [
|
|
30
|
+
/* @__PURE__ */ e(R, { className: "h-[25px] w-[50px] rounded-ds-md bg-field" }),
|
|
31
|
+
/* @__PURE__ */ e(R, { className: "h-[25px] w-[50px] rounded-ds-md bg-field" })
|
|
32
|
+
] }),
|
|
33
|
+
/* @__PURE__ */ e(ie, {})
|
|
34
|
+
] }) }),
|
|
35
|
+
/* @__PURE__ */ s("div", { className: "flex w-full items-center justify-between gap-ds-05 md:mt-0 md:w-auto md:justify-start max-md:mt-[17px] max-lg:gap-[0.5rem]", children: [
|
|
36
|
+
/* @__PURE__ */ e("div", { className: "hidden md:flex", children: /* @__PURE__ */ e(R, { className: "h-ds-sm w-[180px] rounded-ds-md" }) }),
|
|
37
|
+
/* @__PURE__ */ s("div", { className: "flex w-[200px] items-center justify-between overflow-clip rounded-ds-full border border-layer-03", children: [
|
|
38
|
+
/* @__PURE__ */ e("div", { className: "flex h-ds-sm w-[100px] items-center justify-center rounded-r-none bg-field", children: /* @__PURE__ */ e(R, { className: "h-[20px] w-[40px] rounded-r-none bg-layer-03" }) }),
|
|
39
|
+
/* @__PURE__ */ e("div", { className: "flex h-ds-sm w-[100px] items-center justify-center", children: /* @__PURE__ */ e(R, { className: "h-[20px] w-[40px] bg-layer-03" }) })
|
|
40
|
+
] }),
|
|
41
|
+
/* @__PURE__ */ s("div", { className: "flex gap-0", children: [
|
|
42
|
+
/* @__PURE__ */ e(X, { icon: /* @__PURE__ */ e(ye, {}), size: "sm", "aria-label": "Previous" }),
|
|
43
|
+
/* @__PURE__ */ e(
|
|
44
|
+
X,
|
|
45
|
+
{
|
|
46
|
+
icon: /* @__PURE__ */ e(ge, {}),
|
|
47
|
+
size: "sm",
|
|
48
|
+
"aria-label": "Next",
|
|
49
|
+
onClick: () => {
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
] })
|
|
54
|
+
] })
|
|
55
|
+
] }),
|
|
56
|
+
/* @__PURE__ */ e("div", { className: "flex w-full items-center", children: Array.from({ length: 7 }).map((a, d) => /* @__PURE__ */ s(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
className: "flex w-full flex-col items-center rounded-t-ds-lg pb-ds-04 pt-ds-05 max-md:rounded-ds-lg",
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ e(R, { className: "mb-ds-03 h-[10px] w-[10px] rounded-ds-lg bg-field" }),
|
|
62
|
+
/* @__PURE__ */ e("div", { className: "mx-ds-02 my-ds-02 flex items-center justify-center", children: /* @__PURE__ */ e(R, { className: "h-ds-md w-ds-md rounded-ds-full bg-field" }) })
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
d
|
|
66
|
+
)) }),
|
|
67
|
+
/* @__PURE__ */ s("div", { className: "flex w-full flex-col rounded-ds-lg bg-layer-02 md:p-ds-06 max-md:bg-transparent", children: [
|
|
68
|
+
/* @__PURE__ */ e("div", { className: "no-scrollbar w-full cursor-grab overflow-x-auto active:cursor-grabbing max-md:pb-ds-05", children: /* @__PURE__ */ e(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
className: "flex items-start justify-start gap-ds-04 px-0 pt-ds-03 md:gap-0 md:px-ds-06 min-w-max",
|
|
72
|
+
children: Array.from({ length: 3 }).map((a, d) => /* @__PURE__ */ s(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
className: S("flex w-full flex-col gap-ds-04 rounded-ds-md bg-layer-02 p-ds-06 md:rounded-ds-lg md:p-ds-05", d !== 2 ? "border-r border-border" : "", "max-md:border-0 max-md:p-ds-05", "min-w-[200px]"),
|
|
76
|
+
children: [
|
|
77
|
+
/* @__PURE__ */ e(R, { className: "h-[20px] w-[120px] rounded-ds-md bg-field" }),
|
|
78
|
+
/* @__PURE__ */ e("div", { className: "flex flex-wrap items-center gap-ds-03", children: Array.from({ length: 4 }).map((m, p) => /* @__PURE__ */ e(
|
|
79
|
+
R,
|
|
80
|
+
{
|
|
81
|
+
className: S("h-ds-md w-ds-md rounded-ds-full bg-field", p > 0 ? "ml-[-5px]" : "")
|
|
82
|
+
},
|
|
83
|
+
p
|
|
84
|
+
)) })
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
d
|
|
88
|
+
))
|
|
89
|
+
}
|
|
90
|
+
) }),
|
|
91
|
+
/* @__PURE__ */ e("div", { className: "w-full p-0 md:p-ds-06", children: /* @__PURE__ */ s("div", { className: "max-md:pt-[16px] flex flex-col items-start overflow-hidden rounded-ds-lg border-0 border-border-subtle bg-layer-01 shadow-01 pt-ds-03 md:border max-md:pb-0", children: [
|
|
92
|
+
/* @__PURE__ */ s("div", { className: "flex w-full items-start border-b-[1px] border-b-border px-ds-06 md:border-b max-md:border-0 max-md:px-0", children: [
|
|
93
|
+
/* @__PURE__ */ e("div", { className: "text-ds-sm font-semibold uppercase tracking-wider cursor-pointer border-b-[1.5px] border-b-interactive-hover px-ds-03 py-ds-04 font-semibold text-text-primary", children: "REQUESTS(1)" }),
|
|
94
|
+
/* @__PURE__ */ e("div", { className: "text-ds-sm font-semibold uppercase tracking-wider cursor-pointer px-ds-03 py-ds-04 text-text-tertiary", children: "ATTENDANCE CORRECTION(1)" })
|
|
95
|
+
] }),
|
|
96
|
+
/* @__PURE__ */ e("div", { className: "flex max-h-[200px] w-full flex-col overflow-y-auto bg-layer-01 px-ds-06 max-md:flex-1 max-md:max-h-none max-md:min-h-[372px] max-md:p-0", children: Array.from({ length: 2 }).map((a, d) => /* @__PURE__ */ s(
|
|
97
|
+
"div",
|
|
98
|
+
{
|
|
99
|
+
className: "flex items-center justify-between px-ds-03 py-ds-04",
|
|
100
|
+
children: [
|
|
101
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-ds-04", children: [
|
|
102
|
+
/* @__PURE__ */ e(R, { className: "h-ds-md w-ds-md rounded-ds-full bg-field" }),
|
|
103
|
+
/* @__PURE__ */ s("div", { className: "flex flex-col gap-ds-02", children: [
|
|
104
|
+
/* @__PURE__ */ e(R, { className: "h-[20px] w-[120px] rounded-ds-md bg-field" }),
|
|
105
|
+
/* @__PURE__ */ e(R, { className: "h-[20px] w-[200px] rounded-ds-md bg-field" })
|
|
106
|
+
] })
|
|
107
|
+
] }),
|
|
108
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-ds-04", children: [
|
|
109
|
+
/* @__PURE__ */ e(R, { className: "h-ds-sm w-ds-sm rounded-ds-full bg-field" }),
|
|
110
|
+
/* @__PURE__ */ e(R, { className: "h-ds-sm w-ds-sm rounded-ds-full bg-field" })
|
|
111
|
+
] })
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
d
|
|
115
|
+
)) })
|
|
116
|
+
] }) })
|
|
117
|
+
] })
|
|
118
|
+
] }) });
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
kt.displayName = "DashboardSkeleton";
|
|
122
|
+
const Ct = O.forwardRef(
|
|
123
|
+
function({
|
|
124
|
+
selectedMonth: t,
|
|
125
|
+
yearsList: n,
|
|
126
|
+
isTodaySelected: a,
|
|
127
|
+
selectedAssociate: d,
|
|
128
|
+
users: m,
|
|
129
|
+
userImages: p,
|
|
130
|
+
activeTimeFrame: r,
|
|
131
|
+
onMonthSelection: o,
|
|
132
|
+
onTodayClick: x,
|
|
133
|
+
onSelectAssociate: u,
|
|
134
|
+
onTimeFrameChange: f,
|
|
135
|
+
onDateChange: y
|
|
136
|
+
}, i) {
|
|
137
|
+
return /* @__PURE__ */ s("div", { ref: i, className: "mb-ds-06 flex w-full flex-col items-start justify-between md:flex-row md:items-center", children: [
|
|
138
|
+
/* @__PURE__ */ s("div", { className: "flex w-full items-center justify-between gap-ds-05 md:w-auto md:justify-start", children: [
|
|
139
|
+
/* @__PURE__ */ s(he, { children: [
|
|
140
|
+
/* @__PURE__ */ s(be, { className: "text-ds-xl flex items-center gap-ds-03 text-text-secondary", children: [
|
|
141
|
+
t,
|
|
142
|
+
/* @__PURE__ */ e(ie, {})
|
|
143
|
+
] }),
|
|
144
|
+
/* @__PURE__ */ e(ke, { className: "custom-scrollbar absolute ml-ds-08 max-h-[300px] overflow-y-auto rounded-ds-md border border-0 border-border p-0 shadow-brand", children: n.map((h, c) => /* @__PURE__ */ e(
|
|
145
|
+
pe,
|
|
146
|
+
{
|
|
147
|
+
onSelect: () => {
|
|
148
|
+
o(h);
|
|
149
|
+
},
|
|
150
|
+
className: S("p-0", c !== n.length - 1 ? "border-b border-b-border" : ""),
|
|
151
|
+
children: /* @__PURE__ */ e(
|
|
152
|
+
"span",
|
|
153
|
+
{
|
|
154
|
+
className: S("w-full py-ds-04 pl-ds-05 pr-ds-06", t === h ? "text-ds-md font-semibold bg-interactive text-text-on-color" : "text-ds-md text-text-secondary hover:bg-layer-02", c === 0 ? "rounded-t-[7px]" : c === n.length - 1 ? "rounded-b-[7px]" : ""),
|
|
155
|
+
children: h.split(" ")[1]
|
|
156
|
+
}
|
|
157
|
+
)
|
|
158
|
+
},
|
|
159
|
+
h
|
|
160
|
+
)) })
|
|
161
|
+
] }),
|
|
162
|
+
!a && /* @__PURE__ */ e(
|
|
163
|
+
J,
|
|
164
|
+
{
|
|
165
|
+
variant: "outline",
|
|
166
|
+
onClick: x,
|
|
167
|
+
children: "Today"
|
|
168
|
+
}
|
|
169
|
+
)
|
|
170
|
+
] }),
|
|
171
|
+
/* @__PURE__ */ s("div", { className: "flex w-full items-center justify-between gap-ds-05 md:mt-0 md:w-auto md:justify-start max-md:mt-[17px] max-lg:gap-[0.5rem]", children: [
|
|
172
|
+
/* @__PURE__ */ e("div", { className: "hidden md:flex", children: d ? /* @__PURE__ */ s("div", { className: "text-ds-md flex items-center justify-start rounded-ds-md bg-interactive px-ds-03 py-ds-02b text-text-on-color", children: [
|
|
173
|
+
/* @__PURE__ */ s("div", { className: "flex items-center justify-start gap-0", children: [
|
|
174
|
+
p[d.id] ? /* @__PURE__ */ e(
|
|
175
|
+
"img",
|
|
176
|
+
{
|
|
177
|
+
src: p[d.id],
|
|
178
|
+
alt: `${d.name}'s avatar`,
|
|
179
|
+
className: "h-ico-md w-ico-md rounded-ds-full"
|
|
180
|
+
}
|
|
181
|
+
) : /* @__PURE__ */ e("div", { className: "flex h-ico-md w-ico-md flex-shrink-0 items-center justify-center rounded-ds-full bg-layer-03", children: /* @__PURE__ */ e("span", { className: "text-interactive", children: d.name.charAt(0) }) }),
|
|
182
|
+
/* @__PURE__ */ e("span", { className: "text-ds-md ml-ds-01 mr-ds-02 text-text-on-color", children: d.name })
|
|
183
|
+
] }),
|
|
184
|
+
/* @__PURE__ */ e(
|
|
185
|
+
"button",
|
|
186
|
+
{
|
|
187
|
+
"aria-label": "Clear filter",
|
|
188
|
+
onClick: () => u(null),
|
|
189
|
+
className: "border-0 bg-transparent p-0",
|
|
190
|
+
children: /* @__PURE__ */ e(oe, { className: "h-ico-sm w-ico-sm text-text-on-color" })
|
|
191
|
+
}
|
|
192
|
+
)
|
|
193
|
+
] }) : /* @__PURE__ */ s(he, { children: [
|
|
194
|
+
/* @__PURE__ */ s(be, { className: "text-ds-md hidden items-center justify-between rounded-ds-md border border-border-subtle bg-layer-01 px-ds-03 py-ds-02b md:flex", children: [
|
|
195
|
+
/* @__PURE__ */ s("div", { className: "flex items-center", children: [
|
|
196
|
+
/* @__PURE__ */ e(vt, { className: "h-ico-md w-ico-md" }),
|
|
197
|
+
/* @__PURE__ */ e("span", { className: "text-ds-md ml-ds-01 mr-ds-02 text-text-secondary max-lg:mx-0 max-lg:text-ds-sm", children: "Associate" })
|
|
198
|
+
] }),
|
|
199
|
+
/* @__PURE__ */ e(ie, { className: "h-ico-sm w-ico-sm" })
|
|
200
|
+
] }),
|
|
201
|
+
/* @__PURE__ */ e(ke, { className: "custom-scrollbar max-h-[400px] w-64 overflow-y-auto p-ds-03", children: (m == null ? void 0 : m.length) === 0 ? /* @__PURE__ */ e(pe, { disabled: !0, children: "No users available" }) : m == null ? void 0 : m.map((h) => /* @__PURE__ */ s(
|
|
202
|
+
pe,
|
|
203
|
+
{
|
|
204
|
+
onSelect: () => {
|
|
205
|
+
const c = {
|
|
206
|
+
...h,
|
|
207
|
+
createdAt: new Date(h.createdAt)
|
|
208
|
+
};
|
|
209
|
+
u(c);
|
|
210
|
+
},
|
|
211
|
+
className: "flex items-center gap-ds-03 p-ds-03",
|
|
212
|
+
children: [
|
|
213
|
+
p[h.id] ? /* @__PURE__ */ e(
|
|
214
|
+
"img",
|
|
215
|
+
{
|
|
216
|
+
src: p[h.id],
|
|
217
|
+
alt: `${h.name}'s avatar`,
|
|
218
|
+
className: "h-ds-xs w-ds-xs rounded-ds-full"
|
|
219
|
+
}
|
|
220
|
+
) : /* @__PURE__ */ e("div", { className: "flex h-ds-xs w-ds-xs items-center justify-center rounded-ds-full bg-layer-03", children: /* @__PURE__ */ e("span", { className: "text-ds-md text-interactive", children: h.name.charAt(0) }) }),
|
|
221
|
+
/* @__PURE__ */ e("span", { className: "text-ds-md text-text-secondary", children: h.name })
|
|
222
|
+
]
|
|
223
|
+
},
|
|
224
|
+
h.id
|
|
225
|
+
)) })
|
|
226
|
+
] }) }),
|
|
227
|
+
/* @__PURE__ */ e(
|
|
228
|
+
Et,
|
|
229
|
+
{
|
|
230
|
+
size: "md",
|
|
231
|
+
variant: "tonal",
|
|
232
|
+
options: [
|
|
233
|
+
{ id: "weekly", text: "Weekly" },
|
|
234
|
+
{ id: "monthly", text: "Monthly" }
|
|
235
|
+
],
|
|
236
|
+
selectedId: r,
|
|
237
|
+
onSelect: f
|
|
238
|
+
}
|
|
239
|
+
),
|
|
240
|
+
/* @__PURE__ */ s("div", { className: "flex gap-0", children: [
|
|
241
|
+
/* @__PURE__ */ e(
|
|
242
|
+
X,
|
|
243
|
+
{
|
|
244
|
+
icon: /* @__PURE__ */ e(ye, {}),
|
|
245
|
+
size: "sm",
|
|
246
|
+
"aria-label": "Previous",
|
|
247
|
+
onClick: () => y("prev")
|
|
248
|
+
}
|
|
249
|
+
),
|
|
250
|
+
/* @__PURE__ */ e(
|
|
251
|
+
X,
|
|
252
|
+
{
|
|
253
|
+
icon: /* @__PURE__ */ e(ge, {}),
|
|
254
|
+
size: "sm",
|
|
255
|
+
"aria-label": "Next",
|
|
256
|
+
onClick: () => y("next")
|
|
257
|
+
}
|
|
258
|
+
)
|
|
259
|
+
] })
|
|
260
|
+
] })
|
|
261
|
+
] });
|
|
262
|
+
}
|
|
263
|
+
);
|
|
264
|
+
Ct.displayName = "DashboardHeader";
|
|
265
|
+
const Oe = "Asia/Kolkata", Pe = "en-IN";
|
|
266
|
+
function na(l, t) {
|
|
267
|
+
return new Date(l).toLocaleDateString(Pe, {
|
|
268
|
+
timeZone: Oe,
|
|
269
|
+
...t
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
function ia(l, t) {
|
|
273
|
+
return new Date(l).toLocaleTimeString(Pe, {
|
|
274
|
+
timeZone: Oe,
|
|
275
|
+
...t
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
function de(l) {
|
|
279
|
+
return (l instanceof Date ? l : new Date(l)).toLocaleDateString(Pe, {
|
|
280
|
+
day: "2-digit",
|
|
281
|
+
month: "short",
|
|
282
|
+
year: "2-digit",
|
|
283
|
+
timeZone: Oe
|
|
284
|
+
}).replace(",", "").replace(/(\d{2})$/, "’$1");
|
|
285
|
+
}
|
|
286
|
+
function ot(l) {
|
|
287
|
+
return l === "-" ? "-" : de(l);
|
|
288
|
+
}
|
|
289
|
+
function Me(l) {
|
|
290
|
+
const t = l.toLocaleString(Pe, {
|
|
291
|
+
weekday: "long",
|
|
292
|
+
timeZone: Oe
|
|
293
|
+
});
|
|
294
|
+
return `${de(l)}, ${t}`;
|
|
295
|
+
}
|
|
296
|
+
function _e(l) {
|
|
297
|
+
if (l >= 11 && l <= 13) return `${l}th`;
|
|
298
|
+
switch (l % 10) {
|
|
299
|
+
case 1:
|
|
300
|
+
return `${l}st`;
|
|
301
|
+
case 2:
|
|
302
|
+
return `${l}nd`;
|
|
303
|
+
case 3:
|
|
304
|
+
return `${l}rd`;
|
|
305
|
+
default:
|
|
306
|
+
return `${l}th`;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
function Q(l, t) {
|
|
310
|
+
return !(l instanceof Date) || !(t instanceof Date) ? !1 : Z(l, t);
|
|
311
|
+
}
|
|
312
|
+
function Tt(l, t) {
|
|
313
|
+
const n = ss(new Date(l), { weekStartsOn: 0 }), a = /* @__PURE__ */ new Date(), d = new Date(t);
|
|
314
|
+
return Array.from({ length: 7 }, (m, p) => {
|
|
315
|
+
const r = gt(n, p);
|
|
316
|
+
return {
|
|
317
|
+
day: A(r, "EEE").toUpperCase(),
|
|
318
|
+
date: r.getDate(),
|
|
319
|
+
fullDate: r,
|
|
320
|
+
isToday: Z(r, a),
|
|
321
|
+
isActive: Z(r, d)
|
|
322
|
+
};
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
function Cs(l, t) {
|
|
326
|
+
const n = new Date(l), a = new Date(t), d = /* @__PURE__ */ new Date(), m = Ut(n), p = m.getDay(), r = Ie(n), o = [], x = es(m), u = Ie(x);
|
|
327
|
+
for (let h = p - 1; h >= 0; h--) {
|
|
328
|
+
const c = u - h, w = new Date(x.getFullYear(), x.getMonth(), c);
|
|
329
|
+
o.push({
|
|
330
|
+
day: A(w, "EEE").toUpperCase(),
|
|
331
|
+
date: w.getDate(),
|
|
332
|
+
fullDate: w,
|
|
333
|
+
isToday: Z(w, d),
|
|
334
|
+
isActive: Z(w, a),
|
|
335
|
+
isPadding: !0
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
for (let h = 1; h <= r; h++) {
|
|
339
|
+
const c = new Date(n.getFullYear(), n.getMonth(), h);
|
|
340
|
+
o.push({
|
|
341
|
+
day: A(c, "EEE").toUpperCase(),
|
|
342
|
+
date: h,
|
|
343
|
+
fullDate: c,
|
|
344
|
+
isToday: Z(c, d),
|
|
345
|
+
isActive: Z(c, a),
|
|
346
|
+
isPadding: !1
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
const y = (7 - o.length % 7) % 7, i = ts(m, 1);
|
|
350
|
+
for (let h = 1; h <= y; h++) {
|
|
351
|
+
const c = new Date(i.getFullYear(), i.getMonth(), h);
|
|
352
|
+
o.push({
|
|
353
|
+
day: A(c, "EEE").toUpperCase(),
|
|
354
|
+
date: h,
|
|
355
|
+
fullDate: c,
|
|
356
|
+
isToday: Z(c, d),
|
|
357
|
+
isActive: Z(c, a),
|
|
358
|
+
isPadding: !0
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
return o;
|
|
362
|
+
}
|
|
363
|
+
function fe(l = /* @__PURE__ */ new Date()) {
|
|
364
|
+
return Se(l);
|
|
365
|
+
}
|
|
366
|
+
function oa(l = /* @__PURE__ */ new Date()) {
|
|
367
|
+
return qt(l);
|
|
368
|
+
}
|
|
369
|
+
const Mt = O.forwardRef(
|
|
370
|
+
function({
|
|
371
|
+
day: t,
|
|
372
|
+
isAdmin: n,
|
|
373
|
+
dateAttendanceMap: a,
|
|
374
|
+
selectedDate: d,
|
|
375
|
+
activeTimeFrame: m
|
|
376
|
+
}, p) {
|
|
377
|
+
const [r, o] = M({
|
|
378
|
+
today: t.isToday,
|
|
379
|
+
isPresent: null,
|
|
380
|
+
isDefault: null,
|
|
381
|
+
isBreak: null,
|
|
382
|
+
isAbsent: null,
|
|
383
|
+
breakStart: null,
|
|
384
|
+
breakMid: null,
|
|
385
|
+
breakEnd: null,
|
|
386
|
+
disabled: null,
|
|
387
|
+
disabledState: !1,
|
|
388
|
+
hover: !1,
|
|
389
|
+
focus: !1,
|
|
390
|
+
pressed: !1,
|
|
391
|
+
selected: t.isActive
|
|
392
|
+
}), x = (E) => {
|
|
393
|
+
const v = /* @__PURE__ */ new Date();
|
|
394
|
+
return fe(E) < fe(v);
|
|
395
|
+
}, u = (E) => {
|
|
396
|
+
const v = A(E, "yyyy-MM-dd"), k = a == null ? void 0 : a.get(v);
|
|
397
|
+
return (k == null ? void 0 : k.status) === "BREAK";
|
|
398
|
+
}, f = (E) => {
|
|
399
|
+
const v = A(E, "yyyy-MM-dd"), k = a == null ? void 0 : a.get(v);
|
|
400
|
+
return x(E) && k && !k.hasCorrectionOrApproval && (k == null ? void 0 : k.status) === "ABSENT";
|
|
401
|
+
}, y = (E) => {
|
|
402
|
+
const v = A(E, "yyyy-MM-dd"), k = a == null ? void 0 : a.get(v);
|
|
403
|
+
return (k == null ? void 0 : k.status) === "PRESENT";
|
|
404
|
+
};
|
|
405
|
+
U(() => {
|
|
406
|
+
var F, b, N, _;
|
|
407
|
+
const E = y(t.fullDate) ?? !1, v = u(t.fullDate) ?? !1, k = f(t.fullDate) ?? !1, D = t.isDisabled || !1, P = !t.isToday && !v && !k && !D;
|
|
408
|
+
let Y = !1, C = !1, B = !1;
|
|
409
|
+
if (v) {
|
|
410
|
+
const j = new Date(t.fullDate);
|
|
411
|
+
j.setDate(j.getDate() - 1);
|
|
412
|
+
const L = A(j, "yyyy-MM-dd"), ee = new Date(t.fullDate);
|
|
413
|
+
ee.setDate(ee.getDate() + 1);
|
|
414
|
+
const te = A(ee, "yyyy-MM-dd"), z = ((F = a == null ? void 0 : a.get(L)) == null ? void 0 : F.status) === "BREAK" && ((b = a == null ? void 0 : a.get(L)) == null ? void 0 : b.isBreakApproved), se = ((N = a == null ? void 0 : a.get(te)) == null ? void 0 : N.status) === "BREAK" && ((_ = a == null ? void 0 : a.get(te)) == null ? void 0 : _.isBreakApproved);
|
|
415
|
+
Y = v && !z && !!se, C = v && !!z && !!se, B = v && !!z && !se, v && !z && !se && (Y = !0, B = !0, C = !1);
|
|
416
|
+
}
|
|
417
|
+
const I = Q(new Date(d), t.fullDate);
|
|
418
|
+
o((j) => ({
|
|
419
|
+
...j,
|
|
420
|
+
isPresent: E,
|
|
421
|
+
isBreak: v,
|
|
422
|
+
isAbsent: k,
|
|
423
|
+
disabled: D,
|
|
424
|
+
isDefault: P,
|
|
425
|
+
breakStart: Y,
|
|
426
|
+
breakMid: C,
|
|
427
|
+
breakEnd: B,
|
|
428
|
+
selected: I
|
|
429
|
+
}));
|
|
430
|
+
}, [t, a, d, n]);
|
|
431
|
+
const i = r.isBreak && m !== "weekly", h = i && r.breakStart && !r.breakEnd, c = i && r.breakEnd && !r.breakStart, w = i && r.breakMid, g = S(
|
|
432
|
+
"flex w-full items-center justify-center p-ds-02",
|
|
433
|
+
h && "rounded-l-ds-2xl",
|
|
434
|
+
c && "rounded-r-ds-2xl",
|
|
435
|
+
w && "bg-interactive-subtle"
|
|
436
|
+
), T = S(
|
|
437
|
+
// Base layout & transitions
|
|
438
|
+
"flex h-ds-md w-ds-md items-center justify-center rounded-ds-full text-ds-base relative overflow-hidden",
|
|
439
|
+
"transition-[background-color,color,border] duration-200",
|
|
440
|
+
"outline-border-strong outline-solid outline-0",
|
|
441
|
+
// Cursor
|
|
442
|
+
r.disabled ? "cursor-default" : "cursor-pointer",
|
|
443
|
+
// ── Base states (mutually exclusive in original if/else) ──
|
|
444
|
+
// Disabled
|
|
445
|
+
r.disabled && "bg-transparent text-text-disabled",
|
|
446
|
+
// Today (not break, not disabled)
|
|
447
|
+
!r.disabled && r.today && !r.isBreak && "bg-interactive text-text-on-color ring-2 ring-inset ring-interactive",
|
|
448
|
+
// Break (not disabled, not today-only)
|
|
449
|
+
!r.disabled && r.isBreak && !w && "bg-interactive-selected text-text-secondary ring-2 ring-inset ring-interactive",
|
|
450
|
+
// Break mid in non-weekly view overrides break base
|
|
451
|
+
!r.disabled && r.isBreak && w && "rounded-ds-none bg-interactive-subtle text-text-secondary shadow-none",
|
|
452
|
+
// Break border-radius overrides for non-weekly
|
|
453
|
+
!r.disabled && r.isBreak && h && "rounded-l-ds-2xl rounded-r-none",
|
|
454
|
+
!r.disabled && r.isBreak && c && "rounded-l-none rounded-r-ds-2xl",
|
|
455
|
+
// Absent (not disabled, not today, not break)
|
|
456
|
+
!r.disabled && !r.today && !r.isBreak && r.isAbsent && "bg-transparent text-error",
|
|
457
|
+
// Present (not disabled, not today, not break, not absent)
|
|
458
|
+
!r.disabled && !r.today && !r.isBreak && !r.isAbsent && r.isPresent && "bg-transparent text-text-primary",
|
|
459
|
+
// Default (not disabled, not today, not break, not absent, not present)
|
|
460
|
+
!r.disabled && r.isDefault && "bg-transparent text-text-secondary",
|
|
461
|
+
// ── Hover overrides ──
|
|
462
|
+
// Hover on today (not break)
|
|
463
|
+
r.hover && !r.disabled && r.today && !r.isBreak && "bg-interactive text-text-on-color ring-2 ring-inset ring-interactive",
|
|
464
|
+
// Hover on present (not today, not break)
|
|
465
|
+
r.hover && !r.disabled && !r.today && !r.isBreak && r.isPresent && "bg-field text-text-primary",
|
|
466
|
+
// Hover on default (not today, not break, not present)
|
|
467
|
+
r.hover && !r.disabled && !r.today && !r.isBreak && !r.isPresent && r.isDefault && "bg-field text-text-secondary",
|
|
468
|
+
// Hover on break (same visual as base break, but re-assert to match original)
|
|
469
|
+
r.hover && !r.disabled && r.isBreak && !w && "bg-interactive-selected text-text-secondary ring-2 ring-inset ring-interactive",
|
|
470
|
+
r.hover && !r.disabled && r.isBreak && w && "rounded-ds-none bg-interactive-subtle text-text-secondary shadow-none",
|
|
471
|
+
// Hover on absent (not today, not break)
|
|
472
|
+
r.hover && !r.disabled && !r.today && !r.isBreak && r.isAbsent && "bg-field text-error",
|
|
473
|
+
// ── Focus ──
|
|
474
|
+
r.focus && !r.pressed && "outline-2",
|
|
475
|
+
// ── Pressed ──
|
|
476
|
+
r.pressed && (r.isPresent || r.isAbsent || r.isDefault || r.disabled) && "bg-error-surface",
|
|
477
|
+
// ── Selected ──
|
|
478
|
+
r.selected && "font-semibold",
|
|
479
|
+
r.selected && m === "monthly" && "text-text-primary",
|
|
480
|
+
// ── DisabledState (visual-only disabled, different from functional disabled) ──
|
|
481
|
+
r.disabledState && "text-text-disabled",
|
|
482
|
+
r.disabledState && r.today && "bg-text-disabled text-text-on-color"
|
|
483
|
+
);
|
|
484
|
+
return /* @__PURE__ */ e("div", { ref: p, className: g, children: /* @__PURE__ */ s(
|
|
485
|
+
"div",
|
|
486
|
+
{
|
|
487
|
+
className: T,
|
|
488
|
+
onMouseEnter: () => o((E) => ({ ...E, hover: !0 })),
|
|
489
|
+
onMouseLeave: () => o((E) => ({ ...E, hover: !1 })),
|
|
490
|
+
onFocus: () => o((E) => ({ ...E, focus: !0 })),
|
|
491
|
+
onBlur: () => o((E) => ({ ...E, focus: !1 })),
|
|
492
|
+
onMouseDown: () => o((E) => ({ ...E, pressed: !0 })),
|
|
493
|
+
onMouseUp: () => o((E) => ({ ...E, pressed: !1 })),
|
|
494
|
+
children: [
|
|
495
|
+
t.date,
|
|
496
|
+
r.isAbsent && /* @__PURE__ */ e("span", { className: "absolute bottom-0 left-1/2 h-ds-02b w-ds-02b -translate-x-1/2 rounded-ds-full bg-error" })
|
|
497
|
+
]
|
|
498
|
+
}
|
|
499
|
+
) });
|
|
500
|
+
}
|
|
501
|
+
);
|
|
502
|
+
Mt.displayName = "RenderDate";
|
|
503
|
+
function Ts(l, t, n) {
|
|
504
|
+
const a = [];
|
|
505
|
+
if (!(l != null && l.length)) return { onBreak: a };
|
|
506
|
+
const d = new Date(n), m = new Date(d);
|
|
507
|
+
m.setHours(0, 0, 0, 0);
|
|
508
|
+
const p = new Date(d);
|
|
509
|
+
p.setHours(23, 59, 59, 999);
|
|
510
|
+
const r = /* @__PURE__ */ new Map();
|
|
511
|
+
return t.forEach((o) => {
|
|
512
|
+
const x = new Date(o.date);
|
|
513
|
+
x >= m && x <= p && r.set(o.userId, o.status);
|
|
514
|
+
}), l.forEach((o) => {
|
|
515
|
+
r.get(o.id) === "BREAK" && a.push(o);
|
|
516
|
+
}), { onBreak: a };
|
|
517
|
+
}
|
|
518
|
+
const St = O.forwardRef(
|
|
519
|
+
function({
|
|
520
|
+
isFutureDate: t,
|
|
521
|
+
users: n,
|
|
522
|
+
groupedAttendance: a,
|
|
523
|
+
userImages: d,
|
|
524
|
+
selectedDate: m
|
|
525
|
+
}, p) {
|
|
526
|
+
var E;
|
|
527
|
+
const r = Be(null), o = $((v) => {
|
|
528
|
+
r.current = v, typeof p == "function" ? p(v) : p && (p.current = v);
|
|
529
|
+
}, [p]), [x, u] = M(!1), [f, y] = M(0), [i, h] = M(0);
|
|
530
|
+
return (
|
|
531
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions -- drag-to-scroll UX enhancement on scrollable container
|
|
532
|
+
/* @__PURE__ */ e(
|
|
533
|
+
"div",
|
|
534
|
+
{
|
|
535
|
+
ref: o,
|
|
536
|
+
className: "hide-scrollbar w-full cursor-grab overflow-x-auto active:cursor-grabbing max-md:pb-ds-05",
|
|
537
|
+
onMouseDown: (v) => {
|
|
538
|
+
var k, D;
|
|
539
|
+
u(!0), y(v.pageX - (((k = r.current) == null ? void 0 : k.offsetLeft) || 0)), h(((D = r.current) == null ? void 0 : D.scrollLeft) || 0);
|
|
540
|
+
},
|
|
541
|
+
onMouseMove: (v) => {
|
|
542
|
+
var P;
|
|
543
|
+
if (!x) return;
|
|
544
|
+
v.preventDefault();
|
|
545
|
+
const D = (v.pageX - (((P = r.current) == null ? void 0 : P.offsetLeft) || 0) - f) * 2;
|
|
546
|
+
r.current && (r.current.scrollLeft = i - D);
|
|
547
|
+
},
|
|
548
|
+
onMouseUp: () => {
|
|
549
|
+
u(!1);
|
|
550
|
+
},
|
|
551
|
+
onMouseLeave: () => {
|
|
552
|
+
u(!1);
|
|
553
|
+
},
|
|
554
|
+
style: {
|
|
555
|
+
scrollbarWidth: "none",
|
|
556
|
+
msOverflowStyle: "none"
|
|
557
|
+
},
|
|
558
|
+
children: /* @__PURE__ */ e(
|
|
559
|
+
"div",
|
|
560
|
+
{
|
|
561
|
+
className: "flex items-start justify-start gap-ds-04 px-0 pt-ds-03 md:gap-0 md:px-ds-06 min-w-max",
|
|
562
|
+
children: t ? /* @__PURE__ */ e("div", { className: "min-h-28", children: n && ((E = Object.entries(
|
|
563
|
+
Ts(
|
|
564
|
+
n,
|
|
565
|
+
[],
|
|
566
|
+
m
|
|
567
|
+
)
|
|
568
|
+
)) == null ? void 0 : E.map(([v, k]) => {
|
|
569
|
+
const D = k;
|
|
570
|
+
return /* @__PURE__ */ s(
|
|
571
|
+
"div",
|
|
572
|
+
{
|
|
573
|
+
className: "flex w-full flex-col gap-ds-04 rounded-ds-md bg-layer-02 p-ds-06 md:rounded-ds-lg",
|
|
574
|
+
children: [
|
|
575
|
+
(D == null ? void 0 : D.length) > 0 && /* @__PURE__ */ e("h2", { className: "text-ds-sm font-semibold uppercase tracking-wider capitalize text-text-tertiary", children: `On Break (${(D == null ? void 0 : D.length) || 0})` }),
|
|
576
|
+
/* @__PURE__ */ e("div", { className: "flex w-full flex-wrap items-center", children: (D == null ? void 0 : D.length) > 0 && /* @__PURE__ */ e(
|
|
577
|
+
nt,
|
|
578
|
+
{
|
|
579
|
+
users: D == null ? void 0 : D.map((P) => ({
|
|
580
|
+
image: d[P.id],
|
|
581
|
+
name: P.name || "User"
|
|
582
|
+
})),
|
|
583
|
+
max: 4,
|
|
584
|
+
showTooltip: !1
|
|
585
|
+
}
|
|
586
|
+
) })
|
|
587
|
+
]
|
|
588
|
+
},
|
|
589
|
+
v
|
|
590
|
+
);
|
|
591
|
+
})) }) : Object.entries(a || {}).map(
|
|
592
|
+
([v, k]) => /* @__PURE__ */ s(
|
|
593
|
+
"div",
|
|
594
|
+
{
|
|
595
|
+
className: S("flex w-full flex-col gap-ds-04 rounded-ds-md bg-layer-02 p-ds-06 md:rounded-ds-lg md:p-ds-05", v !== "yetToMark" ? "border-r border-border" : "", "max-md:border-0 max-md:p-ds-05", "min-w-[200px]"),
|
|
596
|
+
children: [
|
|
597
|
+
/* @__PURE__ */ s("h2", { className: "text-ds-sm font-semibold uppercase tracking-wider capitalize text-text-tertiary", children: [
|
|
598
|
+
v === "yetToMark" ? "Yet to Mark" : v.replace(/([A-Z])/g, " $1").toLowerCase(),
|
|
599
|
+
" ",
|
|
600
|
+
"(",
|
|
601
|
+
k.length,
|
|
602
|
+
")"
|
|
603
|
+
] }),
|
|
604
|
+
/* @__PURE__ */ e("div", { className: "flex cursor-pointer flex-wrap items-center", children: /* @__PURE__ */ e(
|
|
605
|
+
nt,
|
|
606
|
+
{
|
|
607
|
+
users: k.map(
|
|
608
|
+
({ user: D }) => ({
|
|
609
|
+
image: d[D.id],
|
|
610
|
+
name: D.name
|
|
611
|
+
})
|
|
612
|
+
),
|
|
613
|
+
max: 4,
|
|
614
|
+
showTooltip: !1
|
|
615
|
+
}
|
|
616
|
+
) })
|
|
617
|
+
]
|
|
618
|
+
},
|
|
619
|
+
v
|
|
620
|
+
)
|
|
621
|
+
)
|
|
622
|
+
}
|
|
623
|
+
)
|
|
624
|
+
}
|
|
625
|
+
)
|
|
626
|
+
);
|
|
627
|
+
}
|
|
628
|
+
);
|
|
629
|
+
St.displayName = "AttendanceOverview";
|
|
630
|
+
function ca(l) {
|
|
631
|
+
return l.replace(
|
|
632
|
+
/^[\p{Emoji_Presentation}\p{Extended_Pictographic}\u200B-\u200D]+/gu,
|
|
633
|
+
""
|
|
634
|
+
);
|
|
635
|
+
}
|
|
636
|
+
function Re(l) {
|
|
637
|
+
return (l == null ? void 0 : l.replace(
|
|
638
|
+
/[\p{Emoji_Presentation}\p{Extended_Pictographic}\u200B-\u200D]+/gu,
|
|
639
|
+
""
|
|
640
|
+
)) ?? "";
|
|
641
|
+
}
|
|
642
|
+
const ct = {
|
|
643
|
+
APPROVED: { text: "Corrected", color: "accent" },
|
|
644
|
+
PENDING: { text: "Pending", color: "warning" },
|
|
645
|
+
REJECTED: { text: "Denied", color: "error" },
|
|
646
|
+
MISSING: { text: "Missed", color: "error" }
|
|
647
|
+
}, mt = {
|
|
648
|
+
APPROVED: { text: "Approved", color: "success" },
|
|
649
|
+
PENDING: { text: "Pending", color: "warning" },
|
|
650
|
+
REJECTED: { text: "Denied", color: "error" },
|
|
651
|
+
CANCELLED: { text: "Redacted", color: "error" },
|
|
652
|
+
MISSING: { text: "Missed", color: "error" }
|
|
653
|
+
};
|
|
654
|
+
function Rt(l, t) {
|
|
655
|
+
const n = t ? ct : mt, a = t ? ct.REJECTED : mt.REJECTED, { text: d, color: m } = n[l] || a;
|
|
656
|
+
return /* @__PURE__ */ e(Ns, { color: m, size: "sm", children: d });
|
|
657
|
+
}
|
|
658
|
+
const ze = O.forwardRef(
|
|
659
|
+
function({
|
|
660
|
+
selectedDate: t,
|
|
661
|
+
userId: n,
|
|
662
|
+
breakRequest: a,
|
|
663
|
+
assetsBaseUrl: d = "",
|
|
664
|
+
onCancelBreak: m,
|
|
665
|
+
onRefreshAttendance: p,
|
|
666
|
+
onRefreshGroupedAttendance: r
|
|
667
|
+
}, o) {
|
|
668
|
+
const [x, u] = M(!0), [f, y] = M(!1);
|
|
669
|
+
U(() => {
|
|
670
|
+
y(!1);
|
|
671
|
+
}, [t]);
|
|
672
|
+
const i = a && a.numberOfDays === 1, h = () => {
|
|
673
|
+
if (!a) return !1;
|
|
674
|
+
const g = Se(/* @__PURE__ */ new Date()), T = Se(new Date(a.endDate));
|
|
675
|
+
return Z(T, g) || Ve(T, g);
|
|
676
|
+
}, c = async () => {
|
|
677
|
+
!a || !m || (await m({
|
|
678
|
+
requestId: a.id,
|
|
679
|
+
deleteSingleDay: x,
|
|
680
|
+
dateToCancel: t,
|
|
681
|
+
userId: n
|
|
682
|
+
}), y(!1), p == null || p(), r == null || r());
|
|
683
|
+
}, w = (g) => A(new Date(g), "dd/MM/yyyy");
|
|
684
|
+
return !a || a.status === "CANCELLED" ? null : /* @__PURE__ */ s("div", { ref: o, className: "relative flex w-full flex-col gap-ds-06 rounded-ds-lg bg-layer-accent-subtle", children: [
|
|
685
|
+
d && /* @__PURE__ */ e(
|
|
686
|
+
"img",
|
|
687
|
+
{
|
|
688
|
+
src: `${d}/break-background.svg`,
|
|
689
|
+
alt: "Break Background",
|
|
690
|
+
className: "absolute bottom-0 z-0 h-full min-h-[236px] rounded-ds-lg object-cover"
|
|
691
|
+
}
|
|
692
|
+
),
|
|
693
|
+
/* @__PURE__ */ s("div", { className: "relative flex min-h-[236px] flex-col items-center justify-between rounded-ds-lg md:flex-row", children: [
|
|
694
|
+
f && i ? /* @__PURE__ */ e("div", { className: "flex h-full w-full flex-col items-center justify-center px-ds-04 pt-[17px]", children: /* @__PURE__ */ s("div", { className: "w-full gap-ds-05 rounded-ds-md bg-layer-01 shadow-01 px-ds-06 py-ds-07 md:hidden", children: [
|
|
695
|
+
/* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-ds-04", children: [
|
|
696
|
+
/* @__PURE__ */ e("div", { className: "text-ds-lg font-semibold text-center text-text-primary", children: "Cancel this break?" }),
|
|
697
|
+
/* @__PURE__ */ s("div", { className: "text-ds-base max-w-[240px] text-center text-text-tertiary max-md:leading-[100%]", children: [
|
|
698
|
+
"You're about to cancel the break scheduled for",
|
|
699
|
+
" ",
|
|
700
|
+
/* @__PURE__ */ e("span", { className: "font-semibold text-text-secondary", children: w(a.startDate) })
|
|
701
|
+
] })
|
|
702
|
+
] }),
|
|
703
|
+
/* @__PURE__ */ e("div", { className: "mt-ds-05 flex w-full flex-col gap-ds-04", children: /* @__PURE__ */ e(J, { variant: "solid", className: "w-full rounded-ds-full", onClick: c, children: "Yes, cancel" }) }),
|
|
704
|
+
/* @__PURE__ */ e(
|
|
705
|
+
"button",
|
|
706
|
+
{
|
|
707
|
+
"aria-label": "Close cancel form",
|
|
708
|
+
className: "absolute right-ds-05 top-ds-05 rounded-ds-sm p-ds-04 text-icon-secondary transition-colors hover:text-icon-primary hover:bg-field focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus disabled:pointer-events-none",
|
|
709
|
+
onClick: () => y(!1),
|
|
710
|
+
children: /* @__PURE__ */ e(oe, { className: "h-ico-lg w-ico-lg" })
|
|
711
|
+
}
|
|
712
|
+
)
|
|
713
|
+
] }) }) : /* @__PURE__ */ s("div", { className: "flex h-full w-full flex-col items-center justify-center gap-ds-06 p-ds-06 px-ds-06 py-ds-07 md:w-1/2 md:p-ds-07", children: [
|
|
714
|
+
/* @__PURE__ */ s("div", { className: "flex flex-col items-center justify-end gap-ds-05", children: [
|
|
715
|
+
/* @__PURE__ */ e("div", { className: "text-ds-sm font-semibold uppercase tracking-wider text-text-tertiary", children: "Reason" }),
|
|
716
|
+
/* @__PURE__ */ e("div", { className: "text-ds-lg font-semibold text-text-primary", children: Re((a == null ? void 0 : a.reason) || " ") })
|
|
717
|
+
] }),
|
|
718
|
+
/* @__PURE__ */ s("div", { className: "flex flex-col items-center justify-end gap-ds-05", children: [
|
|
719
|
+
/* @__PURE__ */ e("div", { className: "text-ds-sm font-semibold uppercase tracking-wider text-text-tertiary", children: "Break Period" }),
|
|
720
|
+
/* @__PURE__ */ s("div", { className: "text-ds-lg font-semibold text-text-primary", children: [
|
|
721
|
+
de(new Date(a.startDate)),
|
|
722
|
+
" ",
|
|
723
|
+
a.numberOfDays > 1 && /* @__PURE__ */ s(V, { children: [
|
|
724
|
+
"- ",
|
|
725
|
+
de(new Date(a.endDate)),
|
|
726
|
+
" "
|
|
727
|
+
] }),
|
|
728
|
+
/* @__PURE__ */ e("span", { className: "text-ds-lg text-text-placeholder", children: `(${a.numberOfDays} day${a.numberOfDays > 1 ? "s" : ""})` })
|
|
729
|
+
] })
|
|
730
|
+
] })
|
|
731
|
+
] }),
|
|
732
|
+
!f && /* @__PURE__ */ s(V, { children: [
|
|
733
|
+
/* @__PURE__ */ e("div", { className: "h-[1px] w-[329px] bg-border-subtle md:hidden max-md:w-[90%]" }),
|
|
734
|
+
/* @__PURE__ */ e("div", { className: "hidden h-[170px] w-[2px] bg-border-subtle md:block" })
|
|
735
|
+
] }),
|
|
736
|
+
/* @__PURE__ */ s(
|
|
737
|
+
"div",
|
|
738
|
+
{
|
|
739
|
+
className: S("flex w-full flex-col items-center justify-center px-ds-05", f || a.status === "APPROVED" || a.status === "REJECTED" ? "pb-ds-06 pt-[9px]" : "py-ds-06", "md:w-1/2 md:px-ds-06 md:py-ds-05 max-md:pt-[34px]"),
|
|
740
|
+
children: [
|
|
741
|
+
/* @__PURE__ */ e("p", { className: "text-ds-sm font-semibold uppercase tracking-wider mb-ds-06 text-text-tertiary max-md:mb-ds-05", children: "Break Status" }),
|
|
742
|
+
/* @__PURE__ */ s("div", { className: "mb-ds-04 flex w-full flex-col items-center justify-start gap-ds-04 rounded-ds-2xl border border-border-subtle bg-layer-01 shadow-01 px-ds-05 py-ds-04 text-center font-semibold text-text-primary", children: [
|
|
743
|
+
Rt(a.status, !1),
|
|
744
|
+
a.status === "APPROVED" && a.adminComment,
|
|
745
|
+
a.status === "REJECTED" && a.adminComment
|
|
746
|
+
] }),
|
|
747
|
+
i ? /* @__PURE__ */ s(V, { children: [
|
|
748
|
+
h() && m && /* @__PURE__ */ e(
|
|
749
|
+
"button",
|
|
750
|
+
{
|
|
751
|
+
className: "text-ds-sm cursor-pointer border-none bg-transparent text-interactive-hover underline md:hidden",
|
|
752
|
+
onClick: () => y(!f),
|
|
753
|
+
children: "Want to cancel this break?"
|
|
754
|
+
}
|
|
755
|
+
),
|
|
756
|
+
/* @__PURE__ */ s(ce, { children: [
|
|
757
|
+
h() && m && /* @__PURE__ */ e(we, { asChild: !0, children: /* @__PURE__ */ e("button", { className: "text-ds-sm hidden cursor-pointer border-none bg-transparent text-interactive-hover underline md:block", children: "Want to cancel this break?" }) }),
|
|
758
|
+
/* @__PURE__ */ s(me, { className: "max-w-[329px] gap-ds-04 rounded-ds-xl", children: [
|
|
759
|
+
/* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e("div", { className: "text-ds-lg font-semibold text-center text-text-primary", children: "Cancel this break?" }) }),
|
|
760
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-start", children: /* @__PURE__ */ s("div", { className: "text-ds-base max-w-[241px] text-center text-text-tertiary", children: [
|
|
761
|
+
"You're about to cancel the break scheduled for",
|
|
762
|
+
" ",
|
|
763
|
+
/* @__PURE__ */ e("span", { className: "font-semibold text-text-secondary", children: w(a.startDate) })
|
|
764
|
+
] }) }),
|
|
765
|
+
/* @__PURE__ */ e(He, { className: "mt-ds-04 sm:justify-start", children: /* @__PURE__ */ e($e, { asChild: !0, children: /* @__PURE__ */ e(J, { variant: "solid", className: "w-full rounded-ds-full", onClick: c, children: "Yes, cancel" }) }) })
|
|
766
|
+
] })
|
|
767
|
+
] })
|
|
768
|
+
] }) : /* @__PURE__ */ s(ce, { children: [
|
|
769
|
+
h() && m && /* @__PURE__ */ e(we, { asChild: !0, children: /* @__PURE__ */ e("button", { className: "text-ds-sm cursor-pointer border-none bg-transparent text-interactive-hover underline", children: "Want to cancel this break?" }) }),
|
|
770
|
+
/* @__PURE__ */ s(me, { className: "max-w-[329px] gap-ds-04 rounded-ds-xl", children: [
|
|
771
|
+
/* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e("div", { className: "text-ds-lg font-semibold flex text-center text-text-primary", children: "Cancel your break" }) }),
|
|
772
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-start", children: /* @__PURE__ */ s("div", { className: "flex w-full flex-col items-start", children: [
|
|
773
|
+
/* @__PURE__ */ s("label", { className: "breakRequest-checkbox flex items-center space-x-ds-03", children: [
|
|
774
|
+
/* @__PURE__ */ e(
|
|
775
|
+
it,
|
|
776
|
+
{
|
|
777
|
+
checked: x,
|
|
778
|
+
onCheckedChange: (g) => u(g === !0)
|
|
779
|
+
}
|
|
780
|
+
),
|
|
781
|
+
/* @__PURE__ */ s("span", { className: "text-text-secondary", children: [
|
|
782
|
+
_e(new Date(t).getDate()),
|
|
783
|
+
" break only"
|
|
784
|
+
] })
|
|
785
|
+
] }),
|
|
786
|
+
/* @__PURE__ */ s("label", { className: "breakRequest-checkbox mt-ds-03 flex items-center space-x-ds-03", children: [
|
|
787
|
+
/* @__PURE__ */ e(
|
|
788
|
+
it,
|
|
789
|
+
{
|
|
790
|
+
checked: !x,
|
|
791
|
+
onCheckedChange: (g) => u(g !== !0)
|
|
792
|
+
}
|
|
793
|
+
),
|
|
794
|
+
/* @__PURE__ */ s("span", { className: "text-text-secondary", children: [
|
|
795
|
+
_e(
|
|
796
|
+
new Date(a.startDate).getDate()
|
|
797
|
+
),
|
|
798
|
+
" ",
|
|
799
|
+
"to",
|
|
800
|
+
" ",
|
|
801
|
+
_e(new Date(a.endDate).getDate()),
|
|
802
|
+
" ",
|
|
803
|
+
"breaks"
|
|
804
|
+
] })
|
|
805
|
+
] })
|
|
806
|
+
] }) }),
|
|
807
|
+
/* @__PURE__ */ e(He, { className: "mt-ds-04 sm:justify-start", children: /* @__PURE__ */ e($e, { asChild: !0, children: /* @__PURE__ */ e(J, { variant: "solid", className: "w-full rounded-ds-full", onClick: c, children: "Yes, cancel" }) }) })
|
|
808
|
+
] })
|
|
809
|
+
] })
|
|
810
|
+
]
|
|
811
|
+
}
|
|
812
|
+
)
|
|
813
|
+
] })
|
|
814
|
+
] });
|
|
815
|
+
}
|
|
816
|
+
);
|
|
817
|
+
ze.displayName = "BreakRequestCard";
|
|
818
|
+
function Ms({
|
|
819
|
+
selectedUserAttendance: l
|
|
820
|
+
}) {
|
|
821
|
+
const t = (l == null ? void 0 : l.status) || "ABSENT", n = t === "Not_Marked" ? "ABSENT" : t, a = n.charAt(0).toUpperCase() + n.slice(1).toLowerCase(), d = l != null && l.timeIn ? new Date(l.timeIn).toLocaleTimeString() : null;
|
|
822
|
+
return /* @__PURE__ */ s("div", { className: "flex w-full flex-col items-center justify-center px-ds-05 py-ds-07 sm:px-ds-05 sm:py-ds-06 md:px-ds-06 md:py-ds-05 md:pr-0", children: [
|
|
823
|
+
/* @__PURE__ */ e("p", { className: "text-ds-sm font-semibold uppercase tracking-wider mb-ds-06 text-text-tertiary", children: "Attendance status" }),
|
|
824
|
+
/* @__PURE__ */ s("div", { className: "mb-ds-04 flex w-full items-center justify-center gap-ds-03 rounded-ds-3xl border border-border-subtle px-ds-05 py-ds-04 text-center", children: [
|
|
825
|
+
/* @__PURE__ */ e("span", { className: "font-semibold text-interactive", children: a }),
|
|
826
|
+
a === "Absent" && /* @__PURE__ */ e("div", { className: "w-px h-5 opacity-[0.5] bg-border-strong" }),
|
|
827
|
+
!d && t !== "HOLIDAY" && t !== "WEEKEND" && /* @__PURE__ */ e("span", { className: "text-ds-md text-text-tertiary", children: "Not marked" }),
|
|
828
|
+
!!d && t === "ABSENT" && /* @__PURE__ */ e("span", { className: "text-ds-md text-text-tertiary", children: "Removed" })
|
|
829
|
+
] }),
|
|
830
|
+
d && /* @__PURE__ */ s("p", { className: "text-ds-md m-0 text-center text-text-disabled", children: [
|
|
831
|
+
"Marked at ",
|
|
832
|
+
d
|
|
833
|
+
] })
|
|
834
|
+
] });
|
|
835
|
+
}
|
|
836
|
+
function Ss({
|
|
837
|
+
selectedAssociate: l,
|
|
838
|
+
selectedDate: t,
|
|
839
|
+
selectedUserAttendance: n,
|
|
840
|
+
onUpdateAttendanceStatus: a
|
|
841
|
+
}) {
|
|
842
|
+
return /* @__PURE__ */ s(me, { className: "sm:max-w-md", children: [
|
|
843
|
+
/* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ s("div", { className: "text-ds-md text-text-tertiary", children: [
|
|
844
|
+
"Edit attendance of",
|
|
845
|
+
" ",
|
|
846
|
+
/* @__PURE__ */ e("span", { className: "text-ds-md font-semibold text-interactive", children: l.name })
|
|
847
|
+
] }) }),
|
|
848
|
+
/* @__PURE__ */ s("div", { className: "flex flex-col items-center justify-start", children: [
|
|
849
|
+
/* @__PURE__ */ e("div", { className: "text-ds-lg mb-ds-05 text-interactive", children: A(new Date(t), "dd MMMM ''yy") }),
|
|
850
|
+
/* @__PURE__ */ e("div", { className: "mb-ds-04 flex w-full items-center justify-center gap-ds-03 rounded-ds-3xl border border-border-subtle px-ds-05 py-ds-04 text-center font-semibold text-interactive", children: (n == null ? void 0 : n.status) === "PRESENT" ? "PRESENT " : "ABSENT" })
|
|
851
|
+
] }),
|
|
852
|
+
/* @__PURE__ */ e(He, { className: "sm:justify-start", children: /* @__PURE__ */ e($e, { asChild: !0, children: /* @__PURE__ */ e(
|
|
853
|
+
J,
|
|
854
|
+
{
|
|
855
|
+
variant: "solid",
|
|
856
|
+
fullWidth: !0,
|
|
857
|
+
onClick: () => {
|
|
858
|
+
const d = (n == null ? void 0 : n.status) !== "PRESENT";
|
|
859
|
+
a == null || a({
|
|
860
|
+
userId: l.id,
|
|
861
|
+
date: t,
|
|
862
|
+
isPresent: d
|
|
863
|
+
});
|
|
864
|
+
},
|
|
865
|
+
children: `Mark as ${(n == null ? void 0 : n.status) === "PRESENT" ? "absent" : "present"}`
|
|
866
|
+
}
|
|
867
|
+
) }) })
|
|
868
|
+
] });
|
|
869
|
+
}
|
|
870
|
+
const At = O.forwardRef(
|
|
871
|
+
function({
|
|
872
|
+
selectedAssociate: t,
|
|
873
|
+
selectedDate: n,
|
|
874
|
+
selectedUserAttendance: a,
|
|
875
|
+
userTasks: d,
|
|
876
|
+
selectedBreakRequest: m,
|
|
877
|
+
isFutureDate: p,
|
|
878
|
+
assetsBaseUrl: r,
|
|
879
|
+
onUpdateAttendanceStatus: o,
|
|
880
|
+
onToggleTaskStatus: x,
|
|
881
|
+
onAddTask: u,
|
|
882
|
+
onReorderTasks: f,
|
|
883
|
+
onCancelBreak: y,
|
|
884
|
+
onRefreshSelectedUserAttendance: i,
|
|
885
|
+
onRefreshAttendanceData: h
|
|
886
|
+
}, c) {
|
|
887
|
+
const [w, g] = M(""), [T, E] = M(null), [v, k] = M(null), D = async (C) => {
|
|
888
|
+
C.preventDefault(), !(!w.trim() || !t) && (await (u == null ? void 0 : u(w, t.id)), g(""));
|
|
889
|
+
}, P = (C, B) => {
|
|
890
|
+
E(B), C.target.classList.add("dragging");
|
|
891
|
+
}, Y = async (C, B) => {
|
|
892
|
+
if (C.preventDefault(), T !== null && T !== B) {
|
|
893
|
+
const I = d[T], F = d[B];
|
|
894
|
+
await (f == null ? void 0 : f(I.id, F.id));
|
|
895
|
+
}
|
|
896
|
+
E(null), k(null);
|
|
897
|
+
};
|
|
898
|
+
return /* @__PURE__ */ s("div", { ref: c, className: "relative flex items-center justify-between md:items-stretch", children: [
|
|
899
|
+
!p && (a == null ? void 0 : a.status) !== "BREAK" && /* @__PURE__ */ s(ce, { children: [
|
|
900
|
+
/* @__PURE__ */ e(we, { asChild: !0, children: /* @__PURE__ */ e(
|
|
901
|
+
X,
|
|
902
|
+
{
|
|
903
|
+
icon: /* @__PURE__ */ e(Je, {}),
|
|
904
|
+
size: "sm",
|
|
905
|
+
"aria-label": "Edit",
|
|
906
|
+
className: "absolute right-2 top-2"
|
|
907
|
+
}
|
|
908
|
+
) }),
|
|
909
|
+
/* @__PURE__ */ e(
|
|
910
|
+
Ss,
|
|
911
|
+
{
|
|
912
|
+
selectedAssociate: t,
|
|
913
|
+
selectedDate: n,
|
|
914
|
+
selectedUserAttendance: a,
|
|
915
|
+
onUpdateAttendanceStatus: o
|
|
916
|
+
}
|
|
917
|
+
)
|
|
918
|
+
] }),
|
|
919
|
+
p ? /* @__PURE__ */ e(V, { children: (a == null ? void 0 : a.status) === "BREAK" ? /* @__PURE__ */ e(
|
|
920
|
+
ze,
|
|
921
|
+
{
|
|
922
|
+
selectedDate: n,
|
|
923
|
+
userId: t.id,
|
|
924
|
+
breakRequest: m,
|
|
925
|
+
assetsBaseUrl: r,
|
|
926
|
+
onCancelBreak: y,
|
|
927
|
+
onRefreshAttendance: i,
|
|
928
|
+
onRefreshGroupedAttendance: h
|
|
929
|
+
}
|
|
930
|
+
) : /* @__PURE__ */ e("div", { className: "min-h-28" }) }) : (a == null ? void 0 : a.status) === "BREAK" ? /* @__PURE__ */ e(
|
|
931
|
+
ze,
|
|
932
|
+
{
|
|
933
|
+
selectedDate: n,
|
|
934
|
+
userId: t.id,
|
|
935
|
+
breakRequest: m,
|
|
936
|
+
assetsBaseUrl: r,
|
|
937
|
+
onCancelBreak: y,
|
|
938
|
+
onRefreshAttendance: i,
|
|
939
|
+
onRefreshGroupedAttendance: h
|
|
940
|
+
}
|
|
941
|
+
) : (a == null ? void 0 : a.status) === "ABSENT" || (a == null ? void 0 : a.status) === "Not_Marked" && wt(
|
|
942
|
+
new Date(n),
|
|
943
|
+
Se(/* @__PURE__ */ new Date())
|
|
944
|
+
) ? /* @__PURE__ */ s("div", { className: "flex w-full flex-col items-center justify-center p-ds-06", children: [
|
|
945
|
+
/* @__PURE__ */ e("p", { className: "text-ds-sm font-semibold uppercase tracking-wider mb-ds-05 text-text-tertiary", children: "COMMENT" }),
|
|
946
|
+
/* @__PURE__ */ s("div", { className: "flex w-full items-center justify-between rounded-ds-lg border border-border bg-layer-01 px-ds-05 max-md:h-ds-lg", children: [
|
|
947
|
+
/* @__PURE__ */ e(
|
|
948
|
+
"input",
|
|
949
|
+
{
|
|
950
|
+
className: "text-ds-md flex-1 border-none py-ds-03 text-text-primary outline-none",
|
|
951
|
+
defaultValue: "Don't miss next time :)"
|
|
952
|
+
}
|
|
953
|
+
),
|
|
954
|
+
/* @__PURE__ */ e(
|
|
955
|
+
X,
|
|
956
|
+
{
|
|
957
|
+
icon: /* @__PURE__ */ e(Dt, {}),
|
|
958
|
+
size: "sm",
|
|
959
|
+
"aria-label": "Update status",
|
|
960
|
+
onClick: () => {
|
|
961
|
+
const C = (a == null ? void 0 : a.status) !== "PRESENT";
|
|
962
|
+
o == null || o({
|
|
963
|
+
userId: t.id,
|
|
964
|
+
date: n,
|
|
965
|
+
isPresent: C
|
|
966
|
+
});
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
)
|
|
970
|
+
] })
|
|
971
|
+
] }) : /* @__PURE__ */ s("div", { className: "mb-auto flex w-full flex-col md:pr-ds-06", children: [
|
|
972
|
+
/* @__PURE__ */ e("p", { className: "text-ds-sm font-semibold uppercase tracking-wider mb-ds-06 text-interactive", children: "Tasks for the day" }),
|
|
973
|
+
d && /* @__PURE__ */ s(V, { children: [
|
|
974
|
+
/* @__PURE__ */ e("div", { className: "no-scrollbar mb-ds-03 flex max-h-[250px] flex-col gap-ds-03 overflow-y-auto", children: d.map((C, B) => (
|
|
975
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
976
|
+
/* @__PURE__ */ s(
|
|
977
|
+
"div",
|
|
978
|
+
{
|
|
979
|
+
className: S("task-item mb-ds-03 flex items-center gap-ds-02", T === B ? "dragging" : ""),
|
|
980
|
+
draggable: !0,
|
|
981
|
+
onDragStart: (I) => P(I, B),
|
|
982
|
+
onDragOver: (I) => I.preventDefault(),
|
|
983
|
+
onDrop: (I) => Y(I, B),
|
|
984
|
+
onDragEnter: () => k(B),
|
|
985
|
+
onDragLeave: () => k(null),
|
|
986
|
+
onDragEnd: (I) => {
|
|
987
|
+
I.target instanceof HTMLElement && I.target.classList.remove("dragging");
|
|
988
|
+
},
|
|
989
|
+
children: [
|
|
990
|
+
v === B && /* @__PURE__ */ e("div", { className: "drop-indicator" }),
|
|
991
|
+
C.status === "COMPLETED" ? /* @__PURE__ */ e(dt, { className: "" }) : /* @__PURE__ */ e(dt, {}),
|
|
992
|
+
/* @__PURE__ */ e(
|
|
993
|
+
"button",
|
|
994
|
+
{
|
|
995
|
+
type: "button",
|
|
996
|
+
onClick: () => {
|
|
997
|
+
x == null || x(
|
|
998
|
+
C.id,
|
|
999
|
+
C.status === "COMPLETED" ? "TODO" : "COMPLETED"
|
|
1000
|
+
);
|
|
1001
|
+
},
|
|
1002
|
+
"aria-label": C.status === "COMPLETED" ? `Mark "${C.title}" as incomplete` : `Mark "${C.title}" as complete`,
|
|
1003
|
+
className: "cursor-pointer",
|
|
1004
|
+
children: C.status === "COMPLETED" ? /* @__PURE__ */ e(ns, { className: "text-interactive-hover" }) : /* @__PURE__ */ e(is, {})
|
|
1005
|
+
}
|
|
1006
|
+
),
|
|
1007
|
+
/* @__PURE__ */ e(
|
|
1008
|
+
"p",
|
|
1009
|
+
{
|
|
1010
|
+
className: S("text-ds-md flex-1 overflow-hidden hyphens-auto break-all pr-ds-05 break-words min-w-0", C.status === "COMPLETED" ? "text-text-disabled line-through" : "text-text-secondary"),
|
|
1011
|
+
children: C.title
|
|
1012
|
+
}
|
|
1013
|
+
)
|
|
1014
|
+
]
|
|
1015
|
+
},
|
|
1016
|
+
C.id
|
|
1017
|
+
)
|
|
1018
|
+
)) }),
|
|
1019
|
+
Q(new Date(n), /* @__PURE__ */ new Date()) && /* @__PURE__ */ s(
|
|
1020
|
+
"form",
|
|
1021
|
+
{
|
|
1022
|
+
className: "flex items-center gap-ds-02 pb-ds-05",
|
|
1023
|
+
onSubmit: D,
|
|
1024
|
+
children: [
|
|
1025
|
+
/* @__PURE__ */ e("div", { className: "w-ds-06" }),
|
|
1026
|
+
/* @__PURE__ */ e("button", { type: "submit", className: "appearance-none", children: /* @__PURE__ */ e(os, {}) }),
|
|
1027
|
+
/* @__PURE__ */ e(
|
|
1028
|
+
"textarea",
|
|
1029
|
+
{
|
|
1030
|
+
className: "text-ds-md flex w-full resize-none items-center border-none bg-transparent !leading-6 text-text-secondary outline-none placeholder:leading-6",
|
|
1031
|
+
placeholder: "Add a task",
|
|
1032
|
+
value: w,
|
|
1033
|
+
onChange: (C) => g(C.target.value),
|
|
1034
|
+
onKeyDown: (C) => {
|
|
1035
|
+
C.key === "Enter" && !C.shiftKey && (C.preventDefault(), D(C));
|
|
1036
|
+
},
|
|
1037
|
+
rows: 1,
|
|
1038
|
+
style: {
|
|
1039
|
+
minHeight: "24px",
|
|
1040
|
+
height: "auto",
|
|
1041
|
+
overflow: "hidden"
|
|
1042
|
+
},
|
|
1043
|
+
onInput: (C) => {
|
|
1044
|
+
const B = C.target;
|
|
1045
|
+
B.style.height = "auto", B.style.height = B.scrollHeight + "px";
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
)
|
|
1049
|
+
]
|
|
1050
|
+
}
|
|
1051
|
+
)
|
|
1052
|
+
] })
|
|
1053
|
+
] }),
|
|
1054
|
+
!p && (a == null ? void 0 : a.status) !== "BREAK" && /* @__PURE__ */ s(V, { children: [
|
|
1055
|
+
/* @__PURE__ */ e("div", { className: "block h-full w-[2px] bg-border-subtle" }),
|
|
1056
|
+
/* @__PURE__ */ e(Ms, { selectedUserAttendance: a })
|
|
1057
|
+
] })
|
|
1058
|
+
] });
|
|
1059
|
+
}
|
|
1060
|
+
);
|
|
1061
|
+
At.displayName = "AssociateDetail";
|
|
1062
|
+
const Bt = O.forwardRef(
|
|
1063
|
+
function({
|
|
1064
|
+
corrections: t,
|
|
1065
|
+
currentUserId: n,
|
|
1066
|
+
userImages: a,
|
|
1067
|
+
assetsBaseUrl: d,
|
|
1068
|
+
activeTimeFrame: m,
|
|
1069
|
+
onApproveCorrection: p,
|
|
1070
|
+
onRejectCorrection: r
|
|
1071
|
+
}, o) {
|
|
1072
|
+
const x = async (u, f) => {
|
|
1073
|
+
f === "APPROVED" ? await (p == null ? void 0 : p(u.id)) : await (r == null ? void 0 : r(u.id));
|
|
1074
|
+
};
|
|
1075
|
+
return t.length === 0 ? /* @__PURE__ */ e("div", { ref: o, className: "p-ds-05 text-center", children: "No pending corrections" }) : /* @__PURE__ */ e(
|
|
1076
|
+
"div",
|
|
1077
|
+
{
|
|
1078
|
+
ref: o,
|
|
1079
|
+
className: "flex max-h-[200px] w-full flex-col overflow-y-auto bg-layer-01 px-ds-06 max-md:flex-1 max-md:max-h-none max-md:min-h-[372px] max-md:p-0",
|
|
1080
|
+
children: t.map((u) => {
|
|
1081
|
+
var f, y, i, h, c, w, g, T, E, v, k;
|
|
1082
|
+
return /* @__PURE__ */ e(ht, { children: /* @__PURE__ */ s("div", { className: "max-md:border flex items-center justify-between px-ds-03 py-ds-04 max-md:rounded-ds-lg max-md:border-border", children: [
|
|
1083
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-ds-04", children: [
|
|
1084
|
+
/* @__PURE__ */ s(Xe, { className: "h-ds-md w-ds-md border-2 max-md:mb-[auto]", children: [
|
|
1085
|
+
/* @__PURE__ */ e(
|
|
1086
|
+
Qe,
|
|
1087
|
+
{
|
|
1088
|
+
src: a[((f = u == null ? void 0 : u.user) == null ? void 0 : f.id) || ""] || "",
|
|
1089
|
+
alt: `${(y = u == null ? void 0 : u.user) == null ? void 0 : y.name}'s Icon`
|
|
1090
|
+
}
|
|
1091
|
+
),
|
|
1092
|
+
/* @__PURE__ */ e(Le, { children: ((h = (i = u == null ? void 0 : u.user) == null ? void 0 : i.name) == null ? void 0 : h[0]) || "U" })
|
|
1093
|
+
] }),
|
|
1094
|
+
/* @__PURE__ */ s("div", { className: "flex flex-col gap-ds-02", children: [
|
|
1095
|
+
/* @__PURE__ */ e("p", { className: "text-ds-sm text-text-secondary", children: (c = u == null ? void 0 : u.user) == null ? void 0 : c.name }),
|
|
1096
|
+
/* @__PURE__ */ s("div", { className: "flex w-full flex-wrap items-center gap-ds-03", children: [
|
|
1097
|
+
/* @__PURE__ */ e("p", { className: "text-ds-base font-semibold text-text-primary", children: u == null ? void 0 : u.reason }),
|
|
1098
|
+
u != null && u.reason ? /* @__PURE__ */ e("p", { className: "text-ds-base font-semibold text-text-tertiary", children: "•" }) : null,
|
|
1099
|
+
/* @__PURE__ */ e("p", { className: "text-ds-base text-text-tertiary", children: Me(
|
|
1100
|
+
new Date(u == null ? void 0 : u.date)
|
|
1101
|
+
) })
|
|
1102
|
+
] })
|
|
1103
|
+
] })
|
|
1104
|
+
] }),
|
|
1105
|
+
/* @__PURE__ */ s("div", { className: "ml-auto flex items-center gap-ds-04 max-md:flex-col max-md:justify-center max-md:gap-0", children: [
|
|
1106
|
+
/* @__PURE__ */ e("div", { className: "p-ds-02", children: /* @__PURE__ */ s(ae, { delayDuration: 0, children: [
|
|
1107
|
+
/* @__PURE__ */ e(re, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1108
|
+
"button",
|
|
1109
|
+
{
|
|
1110
|
+
"aria-label": "Reject correction",
|
|
1111
|
+
className: S("rounded-ds-full p-ds-03 text-text-tertiary hover:text-text-secondary", ((w = u == null ? void 0 : u.user) == null ? void 0 : w.id) === n ? "cursor-not-allowed opacity-[0.38]" : ""),
|
|
1112
|
+
onClick: () => {
|
|
1113
|
+
var D;
|
|
1114
|
+
return ((D = u == null ? void 0 : u.user) == null ? void 0 : D.id) !== n && x(
|
|
1115
|
+
u,
|
|
1116
|
+
"REJECTED"
|
|
1117
|
+
);
|
|
1118
|
+
},
|
|
1119
|
+
disabled: ((g = u == null ? void 0 : u.user) == null ? void 0 : g.id) === n,
|
|
1120
|
+
children: /* @__PURE__ */ e(oe, { className: "h-ico-lg w-ico-lg" })
|
|
1121
|
+
}
|
|
1122
|
+
) }),
|
|
1123
|
+
((T = u == null ? void 0 : u.user) == null ? void 0 : T.id) === n && /* @__PURE__ */ e(le, { children: /* @__PURE__ */ e("p", { children: "You cannot approve/reject your own correction request" }) })
|
|
1124
|
+
] }) }),
|
|
1125
|
+
/* @__PURE__ */ e("div", { className: "p-ds-02", children: /* @__PURE__ */ s(ae, { delayDuration: 0, children: [
|
|
1126
|
+
/* @__PURE__ */ e(re, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1127
|
+
"button",
|
|
1128
|
+
{
|
|
1129
|
+
"aria-label": "Approve correction",
|
|
1130
|
+
className: S("rounded-ds-full p-ds-03", ((E = u == null ? void 0 : u.user) == null ? void 0 : E.id) === n ? "cursor-not-allowed opacity-[0.38]" : ""),
|
|
1131
|
+
onClick: () => {
|
|
1132
|
+
var D;
|
|
1133
|
+
return ((D = u == null ? void 0 : u.user) == null ? void 0 : D.id) !== n && x(
|
|
1134
|
+
u,
|
|
1135
|
+
"APPROVED"
|
|
1136
|
+
);
|
|
1137
|
+
},
|
|
1138
|
+
disabled: ((v = u == null ? void 0 : u.user) == null ? void 0 : v.id) === n,
|
|
1139
|
+
children: /* @__PURE__ */ e(Ge, { className: "h-ico-lg w-ico-lg text-text-success" })
|
|
1140
|
+
}
|
|
1141
|
+
) }),
|
|
1142
|
+
((k = u == null ? void 0 : u.user) == null ? void 0 : k.id) === n && /* @__PURE__ */ e(le, { children: /* @__PURE__ */ e("p", { children: "You cannot approve/reject your own correction request" }) })
|
|
1143
|
+
] }) })
|
|
1144
|
+
] })
|
|
1145
|
+
] }) }, u.id);
|
|
1146
|
+
})
|
|
1147
|
+
}
|
|
1148
|
+
);
|
|
1149
|
+
}
|
|
1150
|
+
);
|
|
1151
|
+
Bt.displayName = "CorrectionList";
|
|
1152
|
+
function Rs() {
|
|
1153
|
+
const [l, t] = M(!1), [n, a] = M(null), [d, m] = M(null), [p, r] = M(""), [o, x] = M(!1), [u, f] = M(
|
|
1154
|
+
null
|
|
1155
|
+
), [y, i] = M(!1), [h, c] = M(null), w = $(() => {
|
|
1156
|
+
t(!1), a(null), m(null), r(""), x(!1), f(null), i(!1), c(null);
|
|
1157
|
+
}, []);
|
|
1158
|
+
return {
|
|
1159
|
+
// State
|
|
1160
|
+
isProcessing: l,
|
|
1161
|
+
activeRequest: n,
|
|
1162
|
+
activeAction: d,
|
|
1163
|
+
message: p,
|
|
1164
|
+
openComment: o,
|
|
1165
|
+
hoveredRequest: u,
|
|
1166
|
+
isCtrlPressed: y,
|
|
1167
|
+
hoverActionTemp: h,
|
|
1168
|
+
// Setters
|
|
1169
|
+
setIsProcessing: t,
|
|
1170
|
+
setActiveRequest: a,
|
|
1171
|
+
setActiveAction: m,
|
|
1172
|
+
setMessage: r,
|
|
1173
|
+
setOpenComment: x,
|
|
1174
|
+
setHoveredRequest: f,
|
|
1175
|
+
setIsCtrlPressed: i,
|
|
1176
|
+
setHoverActionTemp: c,
|
|
1177
|
+
// Helpers
|
|
1178
|
+
reset: w
|
|
1179
|
+
};
|
|
1180
|
+
}
|
|
1181
|
+
const jt = O.forwardRef(
|
|
1182
|
+
function({
|
|
1183
|
+
requests: t,
|
|
1184
|
+
currentUserId: n,
|
|
1185
|
+
userImages: a = {},
|
|
1186
|
+
activeTimeFrame: d,
|
|
1187
|
+
onApproveBreak: m,
|
|
1188
|
+
onRejectBreak: p
|
|
1189
|
+
}, r) {
|
|
1190
|
+
const o = Rs(), x = hs();
|
|
1191
|
+
U(() => {
|
|
1192
|
+
const i = (c) => {
|
|
1193
|
+
(c.ctrlKey || c.metaKey) && (o.setIsCtrlPressed(!0), o.hoveredRequest ? (o.setActiveAction(o.hoverActionTemp), o.setOpenComment(!0), o.setActiveRequest(o.hoveredRequest)) : (o.setOpenComment(!1), o.setActiveAction(null), o.setActiveRequest(null)));
|
|
1194
|
+
}, h = (c) => {
|
|
1195
|
+
!c.ctrlKey && !c.metaKey && o.setIsCtrlPressed(!1);
|
|
1196
|
+
};
|
|
1197
|
+
return window.addEventListener("keydown", i), window.addEventListener("keyup", h), () => {
|
|
1198
|
+
window.removeEventListener("keydown", i), window.removeEventListener("keyup", h);
|
|
1199
|
+
};
|
|
1200
|
+
}, [o.hoveredRequest, o.isCtrlPressed, o.openComment, o.hoverActionTemp]);
|
|
1201
|
+
const u = (i, h) => {
|
|
1202
|
+
o.setHoverActionTemp(h), o.setHoveredRequest(i);
|
|
1203
|
+
}, f = async (i, h) => {
|
|
1204
|
+
if (!(!i || !h)) {
|
|
1205
|
+
o.setIsProcessing(!0), o.setOpenComment(!1);
|
|
1206
|
+
try {
|
|
1207
|
+
const c = {
|
|
1208
|
+
requestId: i.id,
|
|
1209
|
+
adminComment: o.message,
|
|
1210
|
+
userId: n
|
|
1211
|
+
};
|
|
1212
|
+
h === "approveBreak" ? await (m == null ? void 0 : m(c)) : h === "rejectBreak" && await (p == null ? void 0 : p(c)), o.setActiveRequest(null), o.setActiveAction(null), o.setMessage("");
|
|
1213
|
+
} catch (c) {
|
|
1214
|
+
console.error("Error processing break request:", c);
|
|
1215
|
+
} finally {
|
|
1216
|
+
o.setIsProcessing(!1);
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
}, y = (i) => Z(new Date(i.startDate), new Date(i.endDate));
|
|
1220
|
+
return /* @__PURE__ */ e(
|
|
1221
|
+
"div",
|
|
1222
|
+
{
|
|
1223
|
+
ref: r,
|
|
1224
|
+
className: "no-scrollbar max-h-[230px] w-full overflow-y-auto px-0 md:px-ds-06 max-md:flex-1 max-md:max-h-none max-md:min-h-[407.2px]",
|
|
1225
|
+
children: /* @__PURE__ */ e("div", { className: "flex h-full flex-col gap-ds-03 py-ds-03 max-md:h-[max-content] max-md:gap-ds-05 max-md:py-0 max-md:pb-ds-05", children: t == null ? void 0 : t.map((i) => {
|
|
1226
|
+
var h, c, w, g, T, E, v, k, D, P, Y, C, B, I;
|
|
1227
|
+
return /* @__PURE__ */ s(
|
|
1228
|
+
"div",
|
|
1229
|
+
{
|
|
1230
|
+
className: "flex flex-col justify-start rounded-ds-lg border-b border-border md:gap-ds-05 md:border-b-0 max-md:border-none",
|
|
1231
|
+
children: [
|
|
1232
|
+
/* @__PURE__ */ s("div", { className: "flex flex-col justify-between rounded-t-ds-lg border border-border md:flex-row md:border-0 md:px-ds-03 md:py-ds-04 max-md:border-b-0", children: [
|
|
1233
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-ds-04 border-b border-border p-ds-05 md:border-none md:p-0 max-md:items-start", children: [
|
|
1234
|
+
/* @__PURE__ */ e(
|
|
1235
|
+
"img",
|
|
1236
|
+
{
|
|
1237
|
+
src: a[((h = i.user) == null ? void 0 : h.id) || ""],
|
|
1238
|
+
className: "h-ds-md w-ds-md overflow-hidden rounded-ds-full bg-interactive-subtle",
|
|
1239
|
+
alt: ((w = (c = i.user) == null ? void 0 : c.name) == null ? void 0 : w[0]) || "U"
|
|
1240
|
+
}
|
|
1241
|
+
),
|
|
1242
|
+
/* @__PURE__ */ s("div", { className: "flex max-w-[277px] flex-col items-start gap-ds-02 sm:max-w-none", children: [
|
|
1243
|
+
/* @__PURE__ */ e("div", { className: "flex flex-row gap-ds-02b", children: /* @__PURE__ */ e("div", { className: "flex items-center gap-ds-03", children: /* @__PURE__ */ e("p", { className: "text-ds-sm text-text-secondary", children: (g = i.user) == null ? void 0 : g.name }) }) }),
|
|
1244
|
+
y(i) ? /* @__PURE__ */ s("div", { className: "flex w-full flex-col items-center gap-ds-03 md:flex-row md:flex-wrap max-md:items-start", children: [
|
|
1245
|
+
/* @__PURE__ */ e("p", { className: "text-ds-base font-semibold text-text-primary", children: Re(i.reason) }),
|
|
1246
|
+
/* @__PURE__ */ e("p", { className: "text-ds-base hidden font-semibold text-text-tertiary md:block", children: "•" }),
|
|
1247
|
+
/* @__PURE__ */ e("p", { className: "text-ds-base text-text-tertiary", children: de(new Date(i.startDate)) })
|
|
1248
|
+
] }) : /* @__PURE__ */ s("div", { className: "flex flex-col items-start justify-start gap-ds-03", children: [
|
|
1249
|
+
/* @__PURE__ */ e("p", { className: "text-ds-base font-semibold text-text-primary", children: Re(i.reason) }),
|
|
1250
|
+
/* @__PURE__ */ s("p", { className: "text-ds-base text-text-tertiary", children: [
|
|
1251
|
+
de(new Date(i.startDate)),
|
|
1252
|
+
" to",
|
|
1253
|
+
" ",
|
|
1254
|
+
de(new Date(i.endDate)),
|
|
1255
|
+
/* @__PURE__ */ s("span", { className: "text-interactive-hover", children: [
|
|
1256
|
+
", ",
|
|
1257
|
+
i.numberOfDays,
|
|
1258
|
+
" days"
|
|
1259
|
+
] })
|
|
1260
|
+
] })
|
|
1261
|
+
] })
|
|
1262
|
+
] })
|
|
1263
|
+
] }),
|
|
1264
|
+
/* @__PURE__ */ s("div", { className: "flex h-full w-full items-center justify-between self-stretch sm:w-auto sm:justify-start", children: [
|
|
1265
|
+
/* @__PURE__ */ e("div", { className: "flex w-1/2 justify-center border-r border-border p-ds-02 md:border-r-0", children: /* @__PURE__ */ s(ae, { delayDuration: 0, children: [
|
|
1266
|
+
/* @__PURE__ */ e(re, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1267
|
+
"button",
|
|
1268
|
+
{
|
|
1269
|
+
"aria-label": "Reject request",
|
|
1270
|
+
onMouseEnter: () => {
|
|
1271
|
+
u(i, "rejectBreak");
|
|
1272
|
+
},
|
|
1273
|
+
onMouseLeave: () => {
|
|
1274
|
+
o.setHoverActionTemp(null), o.setHoveredRequest(null);
|
|
1275
|
+
},
|
|
1276
|
+
onClick: () => {
|
|
1277
|
+
var F, b;
|
|
1278
|
+
((F = i == null ? void 0 : i.user) == null ? void 0 : F.id) !== n && (o.setActiveRequest(i), o.setActiveAction("rejectBreak"), ((b = o.activeRequest) == null ? void 0 : b.id) !== i.id && o.setMessage(""), f(i, "rejectBreak"));
|
|
1279
|
+
},
|
|
1280
|
+
disabled: o.isProcessing || ((T = i == null ? void 0 : i.user) == null ? void 0 : T.id) === n,
|
|
1281
|
+
className: S(
|
|
1282
|
+
"rounded-ds-full p-ds-03",
|
|
1283
|
+
((E = o.activeRequest) == null ? void 0 : E.id) === i.id && o.activeAction === "rejectBreak" && "bg-error-surface",
|
|
1284
|
+
((v = i == null ? void 0 : i.user) == null ? void 0 : v.id) === n && "cursor-not-allowed opacity-[0.38]",
|
|
1285
|
+
"max-md:flex max-md:w-full max-md:justify-center"
|
|
1286
|
+
),
|
|
1287
|
+
children: /* @__PURE__ */ e(
|
|
1288
|
+
oe,
|
|
1289
|
+
{
|
|
1290
|
+
className: S(
|
|
1291
|
+
"h-ico-lg w-ico-lg",
|
|
1292
|
+
((k = o.activeRequest) == null ? void 0 : k.id) === i.id && o.activeAction === "rejectBreak" && "text-text-error"
|
|
1293
|
+
)
|
|
1294
|
+
}
|
|
1295
|
+
)
|
|
1296
|
+
}
|
|
1297
|
+
) }),
|
|
1298
|
+
((D = i == null ? void 0 : i.user) == null ? void 0 : D.id) === n && /* @__PURE__ */ e(le, { children: /* @__PURE__ */ e("p", { children: "You cannot approve/reject your own break request" }) })
|
|
1299
|
+
] }) }),
|
|
1300
|
+
/* @__PURE__ */ e("div", { className: "flex w-1/2 justify-center bg-success-surface p-ds-02 md:bg-transparent", children: /* @__PURE__ */ s(ae, { delayDuration: 0, children: [
|
|
1301
|
+
/* @__PURE__ */ e(re, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1302
|
+
"button",
|
|
1303
|
+
{
|
|
1304
|
+
"aria-label": "Approve request",
|
|
1305
|
+
onMouseEnter: () => {
|
|
1306
|
+
u(i, "approveBreak");
|
|
1307
|
+
},
|
|
1308
|
+
onMouseLeave: () => {
|
|
1309
|
+
o.setHoverActionTemp(null), o.setHoveredRequest(null);
|
|
1310
|
+
},
|
|
1311
|
+
onClick: () => {
|
|
1312
|
+
var F, b;
|
|
1313
|
+
((F = i == null ? void 0 : i.user) == null ? void 0 : F.id) !== n && (o.setActiveRequest(i), o.setActiveAction("approveBreak"), ((b = o.activeRequest) == null ? void 0 : b.id) !== i.id && o.setMessage(""), f(i, "approveBreak"));
|
|
1314
|
+
},
|
|
1315
|
+
disabled: o.isProcessing || ((P = i == null ? void 0 : i.user) == null ? void 0 : P.id) === n,
|
|
1316
|
+
className: S(
|
|
1317
|
+
"rounded-ds-full p-ds-03",
|
|
1318
|
+
((Y = o.activeRequest) == null ? void 0 : Y.id) === i.id && o.activeAction === "approveBreak" && "bg-success-surface",
|
|
1319
|
+
((C = i == null ? void 0 : i.user) == null ? void 0 : C.id) === n && "cursor-not-allowed opacity-[0.38]",
|
|
1320
|
+
"max-md:flex max-md:w-full max-md:justify-center"
|
|
1321
|
+
),
|
|
1322
|
+
children: /* @__PURE__ */ e(Ge, { className: "h-ico-lg w-ico-lg" })
|
|
1323
|
+
}
|
|
1324
|
+
) }),
|
|
1325
|
+
((B = i == null ? void 0 : i.user) == null ? void 0 : B.id) === n && /* @__PURE__ */ e(le, { children: /* @__PURE__ */ e("p", { children: "You cannot approve/reject your own break request" }) })
|
|
1326
|
+
] }) })
|
|
1327
|
+
] })
|
|
1328
|
+
] }),
|
|
1329
|
+
(o.openComment && o.activeRequest && ((I = o.activeRequest) == null ? void 0 : I.id) === i.id || x) && /* @__PURE__ */ s("div", { className: "flex flex-row items-start justify-between rounded-ds-lg border-[1px] border-border py-ds-02 max-md:rounded-t-none", children: [
|
|
1330
|
+
/* @__PURE__ */ s("div", { className: "flex w-full flex-col items-start justify-start gap-ds-02 px-ds-05 pb-ds-02 pt-[10px]", children: [
|
|
1331
|
+
/* @__PURE__ */ e("div", { className: "text-ds-xs font-semibold uppercase tracking-wider text-text-placeholder", children: "comment" }),
|
|
1332
|
+
/* @__PURE__ */ e(
|
|
1333
|
+
"input",
|
|
1334
|
+
{
|
|
1335
|
+
type: "text",
|
|
1336
|
+
value: o.message,
|
|
1337
|
+
onChange: (F) => {
|
|
1338
|
+
var b;
|
|
1339
|
+
return o.setMessage((b = F == null ? void 0 : F.target) == null ? void 0 : b.value);
|
|
1340
|
+
},
|
|
1341
|
+
placeholder: "Enter a Comment",
|
|
1342
|
+
className: "text-ds-md w-full text-text-primary outline-none"
|
|
1343
|
+
}
|
|
1344
|
+
)
|
|
1345
|
+
] }),
|
|
1346
|
+
/* @__PURE__ */ e(
|
|
1347
|
+
"button",
|
|
1348
|
+
{
|
|
1349
|
+
"aria-label": "Send comment",
|
|
1350
|
+
disabled: o.isProcessing,
|
|
1351
|
+
onClick: () => f(i, o.activeAction),
|
|
1352
|
+
className: "my-auto flex items-center justify-center rounded-ds-full p-ds-03",
|
|
1353
|
+
children: /* @__PURE__ */ e(Dt, { className: "h-ico-lg w-ico-lg" })
|
|
1354
|
+
}
|
|
1355
|
+
)
|
|
1356
|
+
] })
|
|
1357
|
+
]
|
|
1358
|
+
},
|
|
1359
|
+
i.id
|
|
1360
|
+
);
|
|
1361
|
+
}) })
|
|
1362
|
+
}
|
|
1363
|
+
);
|
|
1364
|
+
}
|
|
1365
|
+
);
|
|
1366
|
+
jt.displayName = "LeaveRequests";
|
|
1367
|
+
const xe = (l) => A(l, "yyyy-MM-dd'T'HH:mm:ssxxx"), ue = (l, t, n) => l === "weekly" ? Tt(t, n) : Cs(t, n), Ee = (l) => `${A(l, "MMMM")} ${A(l, "yyyy")}`;
|
|
1368
|
+
function As(l, t) {
|
|
1369
|
+
const n = /* @__PURE__ */ new Date();
|
|
1370
|
+
switch (t.type) {
|
|
1371
|
+
case "SET_TIME_FRAME": {
|
|
1372
|
+
const a = ue(
|
|
1373
|
+
t.payload,
|
|
1374
|
+
l.currentDate,
|
|
1375
|
+
l.selectedDate
|
|
1376
|
+
);
|
|
1377
|
+
return {
|
|
1378
|
+
...l,
|
|
1379
|
+
activeTimeFrame: t.payload,
|
|
1380
|
+
days: a
|
|
1381
|
+
};
|
|
1382
|
+
}
|
|
1383
|
+
case "SELECT_DATE": {
|
|
1384
|
+
const { index: a, date: d } = t.payload, m = xe(d), p = fe(d) > fe(n), r = Ee(d);
|
|
1385
|
+
return {
|
|
1386
|
+
...l,
|
|
1387
|
+
activeIndex: a,
|
|
1388
|
+
selectedDate: m,
|
|
1389
|
+
isFutureDate: p,
|
|
1390
|
+
selectedMonth: r
|
|
1391
|
+
};
|
|
1392
|
+
}
|
|
1393
|
+
case "SELECT_DAY_MONTHLY": {
|
|
1394
|
+
const { date: a } = t.payload, d = xe(a), m = fe(a) > fe(n), p = Ee(a), r = ue(
|
|
1395
|
+
l.activeTimeFrame,
|
|
1396
|
+
l.currentDate,
|
|
1397
|
+
d
|
|
1398
|
+
);
|
|
1399
|
+
return {
|
|
1400
|
+
...l,
|
|
1401
|
+
selectedDate: d,
|
|
1402
|
+
isFutureDate: m,
|
|
1403
|
+
selectedMonth: p,
|
|
1404
|
+
days: r
|
|
1405
|
+
};
|
|
1406
|
+
}
|
|
1407
|
+
case "NAVIGATE_DATE": {
|
|
1408
|
+
const a = new Date(l.currentDate);
|
|
1409
|
+
if (l.activeTimeFrame === "weekly") {
|
|
1410
|
+
const r = t.payload === "prev" ? -7 : 7;
|
|
1411
|
+
a.setDate(a.getDate() + r);
|
|
1412
|
+
} else {
|
|
1413
|
+
const r = t.payload === "prev" ? -1 : 1;
|
|
1414
|
+
a.setMonth(a.getMonth() + r), a.setDate(1);
|
|
1415
|
+
}
|
|
1416
|
+
const d = xe(a), m = Ee(a), p = ue(l.activeTimeFrame, d, d);
|
|
1417
|
+
return {
|
|
1418
|
+
...l,
|
|
1419
|
+
currentDate: d,
|
|
1420
|
+
selectedDate: d,
|
|
1421
|
+
dateOffset: l.dateOffset + (t.payload === "prev" ? -1 : 1),
|
|
1422
|
+
selectedMonth: m,
|
|
1423
|
+
days: p
|
|
1424
|
+
};
|
|
1425
|
+
}
|
|
1426
|
+
case "SELECT_MONTH": {
|
|
1427
|
+
const [a, d] = t.payload.split(" "), m = new Date(l.selectedDate);
|
|
1428
|
+
m.setMonth((/* @__PURE__ */ new Date(`${a} 1, 2024`)).getMonth()), m.setFullYear(parseInt(d));
|
|
1429
|
+
const p = xe(m), r = Math.floor(
|
|
1430
|
+
(m.getTime() - n.getTime()) / (7 * 24 * 60 * 60 * 1e3)
|
|
1431
|
+
), o = ue(l.activeTimeFrame, p, p);
|
|
1432
|
+
return {
|
|
1433
|
+
...l,
|
|
1434
|
+
currentDate: p,
|
|
1435
|
+
selectedDate: p,
|
|
1436
|
+
selectedMonth: t.payload,
|
|
1437
|
+
dateOffset: r,
|
|
1438
|
+
days: o
|
|
1439
|
+
};
|
|
1440
|
+
}
|
|
1441
|
+
case "GO_TODAY": {
|
|
1442
|
+
const a = xe(n), d = Ee(n), m = Math.floor(
|
|
1443
|
+
(n.getTime() - (/* @__PURE__ */ new Date()).getTime()) / (7 * 24 * 60 * 60 * 1e3)
|
|
1444
|
+
), p = ue(l.activeTimeFrame, a, a), r = p.findIndex(
|
|
1445
|
+
(o) => Q(o.fullDate, n)
|
|
1446
|
+
);
|
|
1447
|
+
return {
|
|
1448
|
+
...l,
|
|
1449
|
+
currentDate: a,
|
|
1450
|
+
selectedDate: a,
|
|
1451
|
+
selectedMonth: d,
|
|
1452
|
+
dateOffset: m,
|
|
1453
|
+
isFutureDate: !1,
|
|
1454
|
+
days: p,
|
|
1455
|
+
activeIndex: r !== -1 ? r : l.activeIndex
|
|
1456
|
+
};
|
|
1457
|
+
}
|
|
1458
|
+
case "UPDATE_DAYS": {
|
|
1459
|
+
const a = ue(
|
|
1460
|
+
l.activeTimeFrame,
|
|
1461
|
+
l.currentDate,
|
|
1462
|
+
l.selectedDate
|
|
1463
|
+
);
|
|
1464
|
+
return { ...l, days: a };
|
|
1465
|
+
}
|
|
1466
|
+
default:
|
|
1467
|
+
return l;
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
function Bs() {
|
|
1471
|
+
const l = /* @__PURE__ */ new Date(), t = xe(l), n = Tt(t, t), a = n.findIndex(
|
|
1472
|
+
(d) => Q(d.fullDate, l)
|
|
1473
|
+
);
|
|
1474
|
+
return {
|
|
1475
|
+
currentDate: t,
|
|
1476
|
+
selectedDate: t,
|
|
1477
|
+
isFutureDate: !1,
|
|
1478
|
+
activeTimeFrame: "weekly",
|
|
1479
|
+
days: n,
|
|
1480
|
+
selectedMonth: Ee(l),
|
|
1481
|
+
activeIndex: a !== -1 ? a : 0,
|
|
1482
|
+
dateOffset: 0
|
|
1483
|
+
};
|
|
1484
|
+
}
|
|
1485
|
+
function Ot() {
|
|
1486
|
+
const [l, t] = Lt(As, null, Bs), n = $((i) => {
|
|
1487
|
+
t({ type: "SET_TIME_FRAME", payload: i });
|
|
1488
|
+
}, []), a = $((i, h) => {
|
|
1489
|
+
t({ type: "SELECT_DATE", payload: { index: i, date: h } });
|
|
1490
|
+
}, []), d = $((i) => {
|
|
1491
|
+
t({ type: "SELECT_DAY_MONTHLY", payload: { date: i } });
|
|
1492
|
+
}, []), m = $((i) => {
|
|
1493
|
+
t({ type: "NAVIGATE_DATE", payload: i });
|
|
1494
|
+
}, []), p = $((i) => {
|
|
1495
|
+
t({ type: "SELECT_MONTH", payload: i });
|
|
1496
|
+
}, []), r = $(() => {
|
|
1497
|
+
t({ type: "GO_TODAY" });
|
|
1498
|
+
}, []), o = $(() => {
|
|
1499
|
+
t({ type: "UPDATE_DAYS" });
|
|
1500
|
+
}, []), x = $(() => Q(new Date(l.selectedDate), /* @__PURE__ */ new Date()), [l.selectedDate]), u = $(() => {
|
|
1501
|
+
const i = [], h = (/* @__PURE__ */ new Date()).getFullYear(), c = A(new Date(l.selectedDate), "MMMM");
|
|
1502
|
+
for (let w = -2; w < 1; w++) {
|
|
1503
|
+
const g = new Date(h + w, 0);
|
|
1504
|
+
i.push(`${c} ${g.getFullYear()}`);
|
|
1505
|
+
}
|
|
1506
|
+
return i;
|
|
1507
|
+
}, [l.selectedDate]), f = $(() => l.days.length > 0 && !!l.days[0].fullDate && Q(l.days[0].fullDate, new Date(l.selectedDate)), [l.days, l.selectedDate]), y = $(() => l.days.length > 0 && !!l.days[l.days.length - 1].fullDate && Q(
|
|
1508
|
+
l.days[l.days.length - 1].fullDate,
|
|
1509
|
+
new Date(l.selectedDate)
|
|
1510
|
+
), [l.days, l.selectedDate]);
|
|
1511
|
+
return {
|
|
1512
|
+
...l,
|
|
1513
|
+
dispatch: t,
|
|
1514
|
+
// Action creators
|
|
1515
|
+
setActiveTimeFrame: n,
|
|
1516
|
+
selectDate: a,
|
|
1517
|
+
selectDayMonthly: d,
|
|
1518
|
+
navigateDate: m,
|
|
1519
|
+
selectMonth: p,
|
|
1520
|
+
goToday: r,
|
|
1521
|
+
updateDays: o,
|
|
1522
|
+
// Computed
|
|
1523
|
+
isTodaySelected: x,
|
|
1524
|
+
getYearsList: u,
|
|
1525
|
+
isFirstDate: f,
|
|
1526
|
+
isLastDate: y
|
|
1527
|
+
};
|
|
1528
|
+
}
|
|
1529
|
+
const Pt = bt(
|
|
1530
|
+
null
|
|
1531
|
+
);
|
|
1532
|
+
function Ce() {
|
|
1533
|
+
const l = yt(Pt);
|
|
1534
|
+
if (!l)
|
|
1535
|
+
throw new Error(
|
|
1536
|
+
"AdminDashboard compound components must be used within <AdminDashboard.Root>"
|
|
1537
|
+
);
|
|
1538
|
+
return l;
|
|
1539
|
+
}
|
|
1540
|
+
const Ke = ve.forwardRef(function({
|
|
1541
|
+
currentUserId: t,
|
|
1542
|
+
currentUserRole: n,
|
|
1543
|
+
currentUser: a,
|
|
1544
|
+
assetsBaseUrl: d = "",
|
|
1545
|
+
userImages: m = {},
|
|
1546
|
+
isLoading: p = !1,
|
|
1547
|
+
onAssociateChange: r,
|
|
1548
|
+
children: o
|
|
1549
|
+
}, x) {
|
|
1550
|
+
const u = Ot(), [f, y] = M("leaveRequest"), [i, h] = M(
|
|
1551
|
+
null
|
|
1552
|
+
), c = $(
|
|
1553
|
+
(g) => {
|
|
1554
|
+
h(g), r == null || r(g);
|
|
1555
|
+
},
|
|
1556
|
+
[r]
|
|
1557
|
+
), w = Ye(
|
|
1558
|
+
() => ({
|
|
1559
|
+
currentUserId: t,
|
|
1560
|
+
currentUserRole: n,
|
|
1561
|
+
currentUser: a,
|
|
1562
|
+
assetsBaseUrl: d,
|
|
1563
|
+
userImages: m,
|
|
1564
|
+
cal: u,
|
|
1565
|
+
activeTab: f,
|
|
1566
|
+
setActiveTab: y,
|
|
1567
|
+
selectedAssociate: i,
|
|
1568
|
+
setSelectedAssociate: c
|
|
1569
|
+
}),
|
|
1570
|
+
[
|
|
1571
|
+
t,
|
|
1572
|
+
n,
|
|
1573
|
+
a,
|
|
1574
|
+
d,
|
|
1575
|
+
m,
|
|
1576
|
+
u,
|
|
1577
|
+
f,
|
|
1578
|
+
i,
|
|
1579
|
+
c
|
|
1580
|
+
]
|
|
1581
|
+
);
|
|
1582
|
+
return p ? /* @__PURE__ */ e(kt, {}) : /* @__PURE__ */ e(Pt.Provider, { value: w, children: /* @__PURE__ */ e(
|
|
1583
|
+
"div",
|
|
1584
|
+
{
|
|
1585
|
+
ref: x,
|
|
1586
|
+
className: "flex w-full max-w-layout flex-col items-center justify-center max-md:h-[100%] max-md:justify-start",
|
|
1587
|
+
children: /* @__PURE__ */ e("div", { className: "z-raised flex w-full flex-col items-start justify-start rounded-ds-lg border border-border bg-layer-02 p-ds-05 shadow-05 max-md:flex-1 max-md:min-h-0 max-md:overflow-y-auto max-md:border-0 max-md:px-ds-05 max-md:pb-0 max-md:pt-ds-06", children: o })
|
|
1588
|
+
}
|
|
1589
|
+
) });
|
|
1590
|
+
});
|
|
1591
|
+
Ke.displayName = "AdminDashboard.Root";
|
|
1592
|
+
const Ft = ve.forwardRef(function({
|
|
1593
|
+
dateAttendanceMap: t = null,
|
|
1594
|
+
onDateChange: n,
|
|
1595
|
+
onTimeFrameChange: a,
|
|
1596
|
+
users: d = [],
|
|
1597
|
+
selectedUserAttendance: m = null
|
|
1598
|
+
}, p) {
|
|
1599
|
+
const { cal: r, selectedAssociate: o, setSelectedAssociate: x, userImages: u, setActiveTab: f } = Ce(), y = () => {
|
|
1600
|
+
r.goToday(), f("leaveRequest");
|
|
1601
|
+
}, i = (g) => {
|
|
1602
|
+
r.navigateDate(g), f("leaveRequest");
|
|
1603
|
+
}, h = (g) => {
|
|
1604
|
+
r.selectMonth(g), f("leaveRequest");
|
|
1605
|
+
}, c = (g) => {
|
|
1606
|
+
const T = r.days[g].fullDate;
|
|
1607
|
+
r.selectDate(g, T), n == null || n(A(T, "yyyy-MM-dd'T'HH:mm:ssxxx"));
|
|
1608
|
+
}, w = (g, T) => {
|
|
1609
|
+
r.activeTimeFrame === "weekly" ? (c(g), f("leaveRequest")) : (r.selectDayMonthly(T), f("leaveRequest"), n == null || n(A(T, "yyyy-MM-dd'T'HH:mm:ssxxx")));
|
|
1610
|
+
};
|
|
1611
|
+
return U(() => {
|
|
1612
|
+
a == null || a(r.activeTimeFrame);
|
|
1613
|
+
}, [r.activeTimeFrame]), U(() => {
|
|
1614
|
+
n == null || n(r.selectedDate);
|
|
1615
|
+
}, [r.selectedDate]), /* @__PURE__ */ s("div", { ref: p, children: [
|
|
1616
|
+
/* @__PURE__ */ e(
|
|
1617
|
+
Ct,
|
|
1618
|
+
{
|
|
1619
|
+
selectedMonth: r.selectedMonth,
|
|
1620
|
+
yearsList: r.getYearsList(),
|
|
1621
|
+
isTodaySelected: r.isTodaySelected(),
|
|
1622
|
+
selectedAssociate: o,
|
|
1623
|
+
users: d,
|
|
1624
|
+
userImages: u,
|
|
1625
|
+
activeTimeFrame: r.activeTimeFrame,
|
|
1626
|
+
onMonthSelection: h,
|
|
1627
|
+
onTodayClick: y,
|
|
1628
|
+
onSelectAssociate: x,
|
|
1629
|
+
onTimeFrameChange: (g) => r.setActiveTimeFrame(g),
|
|
1630
|
+
onDateChange: i
|
|
1631
|
+
}
|
|
1632
|
+
),
|
|
1633
|
+
/* @__PURE__ */ s(
|
|
1634
|
+
"div",
|
|
1635
|
+
{
|
|
1636
|
+
className: S(
|
|
1637
|
+
"calendar",
|
|
1638
|
+
r.activeTimeFrame === "weekly" ? "flex" : "grid grid-cols-7 gap-0",
|
|
1639
|
+
"w-full items-center"
|
|
1640
|
+
),
|
|
1641
|
+
children: [
|
|
1642
|
+
r.activeTimeFrame === "monthly" && ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"].map((g) => /* @__PURE__ */ e("div", { className: "pb-ds-03 pt-ds-05 text-center", children: /* @__PURE__ */ e("span", { className: "text-ds-sm font-semibold uppercase tracking-wider text-text-tertiary", children: g }) }, g)),
|
|
1643
|
+
r.days.map((g, T) => /* @__PURE__ */ s(
|
|
1644
|
+
"button",
|
|
1645
|
+
{
|
|
1646
|
+
type: "button",
|
|
1647
|
+
tabIndex: g.isPadding ? -1 : 0,
|
|
1648
|
+
"aria-label": g.isPadding ? void 0 : A(g.fullDate, "MMMM d, yyyy"),
|
|
1649
|
+
className: S(
|
|
1650
|
+
r.activeTimeFrame === "weekly" ? "w-full rounded-t-ds-lg pb-ds-04 pt-ds-05 max-md:rounded-ds-lg" : "pb-0 pt-0",
|
|
1651
|
+
"flex cursor-pointer flex-col items-center text-center",
|
|
1652
|
+
r.activeTimeFrame === "weekly" && r.activeIndex === T ? (m == null ? void 0 : m.status) === "BREAK" ? "bg-layer-accent-subtle" : "bg-layer-02" : "",
|
|
1653
|
+
g.isPadding && "opacity-[0.5]"
|
|
1654
|
+
),
|
|
1655
|
+
onClick: () => w(T, g.fullDate),
|
|
1656
|
+
children: [
|
|
1657
|
+
r.activeTimeFrame === "weekly" && /* @__PURE__ */ e("span", { className: "text-ds-sm font-semibold uppercase tracking-wider mb-ds-03 text-text-tertiary", children: g.day }),
|
|
1658
|
+
/* @__PURE__ */ e(
|
|
1659
|
+
Mt,
|
|
1660
|
+
{
|
|
1661
|
+
day: g,
|
|
1662
|
+
isAdmin: !0,
|
|
1663
|
+
selectedDate: r.selectedDate,
|
|
1664
|
+
dateAttendanceMap: o ? t : null,
|
|
1665
|
+
activeTimeFrame: r.activeTimeFrame
|
|
1666
|
+
}
|
|
1667
|
+
)
|
|
1668
|
+
]
|
|
1669
|
+
},
|
|
1670
|
+
T
|
|
1671
|
+
))
|
|
1672
|
+
]
|
|
1673
|
+
}
|
|
1674
|
+
)
|
|
1675
|
+
] });
|
|
1676
|
+
});
|
|
1677
|
+
Ft.displayName = "AdminDashboard.Calendar";
|
|
1678
|
+
const _t = ve.forwardRef(function({ groupedAttendance: t = null, users: n = [] }, a) {
|
|
1679
|
+
const { cal: d, selectedAssociate: m, userImages: p } = Ce();
|
|
1680
|
+
return m ? null : /* @__PURE__ */ e("div", { ref: a, children: /* @__PURE__ */ e(
|
|
1681
|
+
St,
|
|
1682
|
+
{
|
|
1683
|
+
isFutureDate: d.isFutureDate,
|
|
1684
|
+
users: n,
|
|
1685
|
+
groupedAttendance: t,
|
|
1686
|
+
userImages: p,
|
|
1687
|
+
selectedDate: d.selectedDate
|
|
1688
|
+
}
|
|
1689
|
+
) });
|
|
1690
|
+
});
|
|
1691
|
+
_t.displayName = "AdminDashboard.AttendanceOverview";
|
|
1692
|
+
const Yt = ve.forwardRef(function({
|
|
1693
|
+
attendance: t = null,
|
|
1694
|
+
tasks: n = [],
|
|
1695
|
+
breakRequest: a = null,
|
|
1696
|
+
onUpdateAttendanceStatus: d,
|
|
1697
|
+
onToggleTaskStatus: m,
|
|
1698
|
+
onAddTask: p,
|
|
1699
|
+
onReorderTasks: r,
|
|
1700
|
+
onCancelBreak: o,
|
|
1701
|
+
onRefreshSelectedUserAttendance: x,
|
|
1702
|
+
onRefreshAttendanceData: u
|
|
1703
|
+
}, f) {
|
|
1704
|
+
const { cal: y, selectedAssociate: i, assetsBaseUrl: h } = Ce();
|
|
1705
|
+
return i ? /* @__PURE__ */ e("div", { ref: f, children: /* @__PURE__ */ e(
|
|
1706
|
+
At,
|
|
1707
|
+
{
|
|
1708
|
+
selectedAssociate: i,
|
|
1709
|
+
selectedDate: y.selectedDate,
|
|
1710
|
+
selectedUserAttendance: t,
|
|
1711
|
+
userTasks: n,
|
|
1712
|
+
selectedBreakRequest: a,
|
|
1713
|
+
isFutureDate: y.isFutureDate,
|
|
1714
|
+
assetsBaseUrl: h,
|
|
1715
|
+
onUpdateAttendanceStatus: d,
|
|
1716
|
+
onToggleTaskStatus: m,
|
|
1717
|
+
onAddTask: p,
|
|
1718
|
+
onReorderTasks: r,
|
|
1719
|
+
onCancelBreak: o,
|
|
1720
|
+
onRefreshSelectedUserAttendance: x,
|
|
1721
|
+
onRefreshAttendanceData: u
|
|
1722
|
+
}
|
|
1723
|
+
) }) : null;
|
|
1724
|
+
});
|
|
1725
|
+
Yt.displayName = "AdminDashboard.AssociateDetail";
|
|
1726
|
+
const ut = as(
|
|
1727
|
+
"text-ds-sm font-semibold uppercase tracking-wider cursor-pointer px-ds-03 py-ds-04",
|
|
1728
|
+
{
|
|
1729
|
+
variants: {
|
|
1730
|
+
active: {
|
|
1731
|
+
true: "border-b-[1px] border-b-interactive-hover text-text-primary",
|
|
1732
|
+
false: "text-text-tertiary"
|
|
1733
|
+
}
|
|
1734
|
+
},
|
|
1735
|
+
defaultVariants: {
|
|
1736
|
+
active: !1
|
|
1737
|
+
}
|
|
1738
|
+
}
|
|
1739
|
+
), It = ve.forwardRef(function({
|
|
1740
|
+
requests: t = [],
|
|
1741
|
+
corrections: n = [],
|
|
1742
|
+
onApproveBreak: a,
|
|
1743
|
+
onRejectBreak: d,
|
|
1744
|
+
onApproveCorrection: m,
|
|
1745
|
+
onRejectCorrection: p
|
|
1746
|
+
}, r) {
|
|
1747
|
+
const { currentUserId: o, userImages: x, cal: u, activeTab: f, setActiveTab: y, assetsBaseUrl: i } = Ce(), h = n.filter(
|
|
1748
|
+
(w) => w.correctionStatus === "PENDING"
|
|
1749
|
+
);
|
|
1750
|
+
U(() => {
|
|
1751
|
+
t.length > 0 ? y("leaveRequest") : h.length > 0 && y("attendanceRequest");
|
|
1752
|
+
}, [t.length, h.length, y]);
|
|
1753
|
+
const c = (w) => {
|
|
1754
|
+
y(w);
|
|
1755
|
+
};
|
|
1756
|
+
return h.length === 0 && t.length === 0 ? null : /* @__PURE__ */ e("div", { ref: r, className: "w-full p-0 md:p-ds-06", children: /* @__PURE__ */ s("div", { className: "max-md:pt-[16px] flex flex-col items-start overflow-hidden rounded-ds-lg border-0 border-border-subtle bg-layer-01 shadow-01 pt-ds-03 md:border max-md:pb-0", children: [
|
|
1757
|
+
/* @__PURE__ */ s("div", { className: "flex w-full items-start border-b-[1px] border-b-border px-ds-06 md:border-b max-md:border-0 max-md:px-0", children: [
|
|
1758
|
+
t.length > 0 && /* @__PURE__ */ s(
|
|
1759
|
+
"button",
|
|
1760
|
+
{
|
|
1761
|
+
type: "button",
|
|
1762
|
+
onClick: () => c("leaveRequest"),
|
|
1763
|
+
"aria-current": f === "leaveRequest" ? "true" : void 0,
|
|
1764
|
+
className: ut({ active: f === "leaveRequest" }),
|
|
1765
|
+
children: [
|
|
1766
|
+
/* @__PURE__ */ e("span", { className: "hidden sm:inline", children: "break " }),
|
|
1767
|
+
"Requests",
|
|
1768
|
+
/* @__PURE__ */ s("span", { className: "text-interactive-hover", children: [
|
|
1769
|
+
"(",
|
|
1770
|
+
t.length,
|
|
1771
|
+
")"
|
|
1772
|
+
] })
|
|
1773
|
+
]
|
|
1774
|
+
}
|
|
1775
|
+
),
|
|
1776
|
+
h.length > 0 && /* @__PURE__ */ s(
|
|
1777
|
+
"button",
|
|
1778
|
+
{
|
|
1779
|
+
type: "button",
|
|
1780
|
+
onClick: () => c("attendanceRequest"),
|
|
1781
|
+
"aria-current": f === "attendanceRequest" ? "true" : void 0,
|
|
1782
|
+
className: ut({ active: f === "attendanceRequest" }),
|
|
1783
|
+
children: [
|
|
1784
|
+
"Attendance Correction",
|
|
1785
|
+
" ",
|
|
1786
|
+
/* @__PURE__ */ s("span", { className: "text-interactive-hover", children: [
|
|
1787
|
+
"(",
|
|
1788
|
+
h.length,
|
|
1789
|
+
")"
|
|
1790
|
+
] })
|
|
1791
|
+
]
|
|
1792
|
+
}
|
|
1793
|
+
)
|
|
1794
|
+
] }),
|
|
1795
|
+
f === "attendanceRequest" && h.length > 0 && /* @__PURE__ */ e(
|
|
1796
|
+
Bt,
|
|
1797
|
+
{
|
|
1798
|
+
corrections: h,
|
|
1799
|
+
currentUserId: o,
|
|
1800
|
+
userImages: x,
|
|
1801
|
+
assetsBaseUrl: i,
|
|
1802
|
+
activeTimeFrame: u.activeTimeFrame,
|
|
1803
|
+
onApproveCorrection: m,
|
|
1804
|
+
onRejectCorrection: p
|
|
1805
|
+
}
|
|
1806
|
+
),
|
|
1807
|
+
f === "leaveRequest" && t.length > 0 && /* @__PURE__ */ e(
|
|
1808
|
+
jt,
|
|
1809
|
+
{
|
|
1810
|
+
requests: t,
|
|
1811
|
+
currentUserId: o,
|
|
1812
|
+
userImages: x,
|
|
1813
|
+
activeTimeFrame: u.activeTimeFrame,
|
|
1814
|
+
onApproveBreak: a,
|
|
1815
|
+
onRejectBreak: d
|
|
1816
|
+
}
|
|
1817
|
+
)
|
|
1818
|
+
] }) });
|
|
1819
|
+
});
|
|
1820
|
+
It.displayName = "AdminDashboard.LeaveRequests";
|
|
1821
|
+
const Ht = ve.forwardRef(function({ children: t }, n) {
|
|
1822
|
+
const { cal: a } = Ce(), d = a.isFirstDate(), m = a.isLastDate();
|
|
1823
|
+
return /* @__PURE__ */ e(
|
|
1824
|
+
"div",
|
|
1825
|
+
{
|
|
1826
|
+
ref: n,
|
|
1827
|
+
className: S(
|
|
1828
|
+
"flex w-full flex-col rounded-ds-lg bg-layer-02 md:p-ds-06 max-md:bg-transparent",
|
|
1829
|
+
{
|
|
1830
|
+
"rounded-ds-lg": !d && !m,
|
|
1831
|
+
"rounded-ds-lg rounded-tl-none": d && !m,
|
|
1832
|
+
"rounded-b-ds-lg rounded-tr-none": !d && m,
|
|
1833
|
+
"rounded-ds-none": d && m
|
|
1834
|
+
}
|
|
1835
|
+
),
|
|
1836
|
+
children: t
|
|
1837
|
+
}
|
|
1838
|
+
);
|
|
1839
|
+
});
|
|
1840
|
+
Ht.displayName = "AdminDashboard.Content";
|
|
1841
|
+
const ma = Object.assign(Ke, {
|
|
1842
|
+
Root: Ke,
|
|
1843
|
+
Calendar: Ft,
|
|
1844
|
+
AttendanceOverview: _t,
|
|
1845
|
+
AssociateDetail: Yt,
|
|
1846
|
+
LeaveRequests: It,
|
|
1847
|
+
Content: Ht
|
|
1848
|
+
}), js = O.forwardRef(
|
|
1849
|
+
function({ onDateSelect: t, hasCorrection: n }, a) {
|
|
1850
|
+
const d = Ot(), m = (x) => {
|
|
1851
|
+
d.navigateDate(x);
|
|
1852
|
+
}, p = (x) => {
|
|
1853
|
+
d.selectMonth(x);
|
|
1854
|
+
}, r = () => {
|
|
1855
|
+
const x = [], f = new Date(d.currentDate).getFullYear();
|
|
1856
|
+
for (let y = 0; y < 12; y++) {
|
|
1857
|
+
const i = new Date(f, y, 1);
|
|
1858
|
+
x.push(`${A(i, "MMMM")} ${f}`);
|
|
1859
|
+
}
|
|
1860
|
+
return x;
|
|
1861
|
+
}, o = (x, u) => {
|
|
1862
|
+
d.activeTimeFrame === "weekly" ? d.selectDate(x, u) : d.selectDayMonthly(u), t(u);
|
|
1863
|
+
};
|
|
1864
|
+
return /* @__PURE__ */ s("div", { ref: a, className: "w-full", children: [
|
|
1865
|
+
/* @__PURE__ */ s("div", { className: "mb-ds-06 flex w-full items-center justify-start", children: [
|
|
1866
|
+
/* @__PURE__ */ s(he, { children: [
|
|
1867
|
+
/* @__PURE__ */ s(be, { className: "text-ds-xl flex items-center gap-ds-03 text-text-secondary", children: [
|
|
1868
|
+
d.selectedMonth,
|
|
1869
|
+
/* @__PURE__ */ e(ie, {})
|
|
1870
|
+
] }),
|
|
1871
|
+
/* @__PURE__ */ e(ke, { children: r().map((x) => /* @__PURE__ */ e(
|
|
1872
|
+
pe,
|
|
1873
|
+
{
|
|
1874
|
+
onSelect: () => p(x),
|
|
1875
|
+
children: x
|
|
1876
|
+
},
|
|
1877
|
+
x
|
|
1878
|
+
)) })
|
|
1879
|
+
] }),
|
|
1880
|
+
/* @__PURE__ */ s("div", { className: "ml-auto flex items-center gap-ds-05", children: [
|
|
1881
|
+
/* @__PURE__ */ e(
|
|
1882
|
+
Et,
|
|
1883
|
+
{
|
|
1884
|
+
size: "md",
|
|
1885
|
+
variant: "tonal",
|
|
1886
|
+
options: [
|
|
1887
|
+
{ id: "weekly", text: "Weekly" },
|
|
1888
|
+
{ id: "monthly", text: "Monthly" }
|
|
1889
|
+
],
|
|
1890
|
+
selectedId: d.activeTimeFrame,
|
|
1891
|
+
onSelect: (x) => d.setActiveTimeFrame(x)
|
|
1892
|
+
}
|
|
1893
|
+
),
|
|
1894
|
+
/* @__PURE__ */ s("div", { className: "flex gap-0", children: [
|
|
1895
|
+
/* @__PURE__ */ e(
|
|
1896
|
+
"button",
|
|
1897
|
+
{
|
|
1898
|
+
"aria-label": "Previous",
|
|
1899
|
+
onClick: () => m("prev"),
|
|
1900
|
+
className: "rounded-ds-full p-ds-02 hover:bg-layer-02",
|
|
1901
|
+
children: /* @__PURE__ */ e(ye, { className: "h-ico-md w-ico-md text-text-secondary" })
|
|
1902
|
+
}
|
|
1903
|
+
),
|
|
1904
|
+
/* @__PURE__ */ e(
|
|
1905
|
+
"button",
|
|
1906
|
+
{
|
|
1907
|
+
"aria-label": "Next",
|
|
1908
|
+
onClick: () => m("next"),
|
|
1909
|
+
className: "rounded-ds-full p-ds-02 hover:bg-layer-02",
|
|
1910
|
+
children: /* @__PURE__ */ e(ge, { className: "h-ico-md w-ico-md text-text-secondary" })
|
|
1911
|
+
}
|
|
1912
|
+
)
|
|
1913
|
+
] })
|
|
1914
|
+
] })
|
|
1915
|
+
] }),
|
|
1916
|
+
/* @__PURE__ */ s(
|
|
1917
|
+
"div",
|
|
1918
|
+
{
|
|
1919
|
+
className: S(
|
|
1920
|
+
"calendar",
|
|
1921
|
+
d.activeTimeFrame === "weekly" ? "flex" : "grid grid-cols-7 gap-0",
|
|
1922
|
+
"w-full items-center overflow-hidden"
|
|
1923
|
+
),
|
|
1924
|
+
children: [
|
|
1925
|
+
d.activeTimeFrame === "monthly" && ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"].map((x) => /* @__PURE__ */ e("div", { className: "pb-ds-03 pt-ds-05 text-center", children: /* @__PURE__ */ e("span", { className: "text-ds-sm font-semibold uppercase tracking-wider text-text-tertiary", children: x }) }, x)),
|
|
1926
|
+
d.days.map((x, u) => /* @__PURE__ */ s(
|
|
1927
|
+
"button",
|
|
1928
|
+
{
|
|
1929
|
+
type: "button",
|
|
1930
|
+
tabIndex: x.isPadding ? -1 : 0,
|
|
1931
|
+
"aria-label": x.isPadding ? void 0 : A(x.fullDate, "MMMM d, yyyy"),
|
|
1932
|
+
className: S(
|
|
1933
|
+
d.activeTimeFrame === "weekly" ? "w-full rounded-t-ds-lg pb-ds-04 pt-ds-05" : "pb-0 pt-0",
|
|
1934
|
+
"flex cursor-pointer flex-col items-center text-center",
|
|
1935
|
+
d.activeTimeFrame === "weekly" && d.activeIndex === u && "bg-layer-02",
|
|
1936
|
+
x.isPadding && "opacity-[0.5]"
|
|
1937
|
+
),
|
|
1938
|
+
onClick: () => o(u, x.fullDate),
|
|
1939
|
+
children: [
|
|
1940
|
+
d.activeTimeFrame === "weekly" && /* @__PURE__ */ e("span", { className: "text-ds-sm font-semibold uppercase tracking-wider mb-ds-03 text-text-tertiary", children: x.day }),
|
|
1941
|
+
/* @__PURE__ */ s(
|
|
1942
|
+
"div",
|
|
1943
|
+
{
|
|
1944
|
+
className: S(
|
|
1945
|
+
"mx-ds-02 my-ds-02 flex-col",
|
|
1946
|
+
"flex h-ds-md w-ds-md items-center justify-center",
|
|
1947
|
+
d.activeTimeFrame === "monthly" && Q(x.fullDate, new Date(d.selectedDate)) && "rounded-ds-full bg-interactive-subtle ring-2 ring-inset ring-interactive"
|
|
1948
|
+
),
|
|
1949
|
+
children: [
|
|
1950
|
+
/* @__PURE__ */ e(
|
|
1951
|
+
"span",
|
|
1952
|
+
{
|
|
1953
|
+
className: S(
|
|
1954
|
+
"text-ds-base flex h-ds-md w-ds-md items-center justify-center rounded-ds-full",
|
|
1955
|
+
x.isToday ? "bg-interactive-hover p-ds-03 text-text-on-color" : "text-text-secondary",
|
|
1956
|
+
x.isActive && !x.isToday && "bg-field"
|
|
1957
|
+
),
|
|
1958
|
+
children: x.date
|
|
1959
|
+
}
|
|
1960
|
+
),
|
|
1961
|
+
n && n(x.fullDate) && /* @__PURE__ */ e("div", { className: "absolute z-raised mt-ds-06 h-ds-02b w-ds-02b translate-y-[5px] rounded-ds-full bg-text-error" })
|
|
1962
|
+
]
|
|
1963
|
+
}
|
|
1964
|
+
)
|
|
1965
|
+
]
|
|
1966
|
+
},
|
|
1967
|
+
u
|
|
1968
|
+
))
|
|
1969
|
+
]
|
|
1970
|
+
}
|
|
1971
|
+
)
|
|
1972
|
+
] });
|
|
1973
|
+
}
|
|
1974
|
+
);
|
|
1975
|
+
js.displayName = "Calendar";
|
|
1976
|
+
const $t = O.forwardRef(
|
|
1977
|
+
function({
|
|
1978
|
+
breakBalanceData: t,
|
|
1979
|
+
userImages: n,
|
|
1980
|
+
onSaveBalance: a
|
|
1981
|
+
}, d) {
|
|
1982
|
+
return /* @__PURE__ */ s("div", { ref: d, className: "m-0 flex h-[400px] flex-col items-start justify-start p-0 max-md:h-auto", children: [
|
|
1983
|
+
/* @__PURE__ */ s("div", { className: "m-0 mx-[4%] mb-ds-05 mt-ds-04 flex w-[92%] items-start justify-start gap-ds-03 p-0 text-text-placeholder", children: [
|
|
1984
|
+
/* @__PURE__ */ e("div", { className: "text-ds-sm font-semibold uppercase tracking-wider w-[16.4%] min-w-[120px] px-ds-04 py-ds-03 text-text-tertiary", children: "NAME" }),
|
|
1985
|
+
/* @__PURE__ */ e("div", { className: "text-ds-sm font-semibold uppercase tracking-wider w-[16.4%] px-ds-04 py-ds-03 text-text-tertiary", children: "Total Balance" })
|
|
1986
|
+
] }),
|
|
1987
|
+
/* @__PURE__ */ e("div", { className: "no-scrollbar mx-[4%] flex w-[92%] flex-col gap-ds-05 overflow-y-auto max-md:h-[calc(100dvh-373px)]", children: t.map((m) => {
|
|
1988
|
+
var p, r, o, x, u, f;
|
|
1989
|
+
return /* @__PURE__ */ s(
|
|
1990
|
+
"div",
|
|
1991
|
+
{
|
|
1992
|
+
className: "flex w-full flex-row items-center justify-start gap-ds-03 !border-0 text-left hover:bg-field",
|
|
1993
|
+
children: [
|
|
1994
|
+
/* @__PURE__ */ s("div", { className: "flex w-1/6 min-w-[120px] items-center gap-ds-03 p-ds-04", children: [
|
|
1995
|
+
/* @__PURE__ */ s(Xe, { className: "h-ds-xs-plus w-ds-xs-plus", children: [
|
|
1996
|
+
/* @__PURE__ */ e(Qe, { src: n[m.userId], alt: ((p = m.user) == null ? void 0 : p.name) || "" }),
|
|
1997
|
+
/* @__PURE__ */ e(Le, { children: ((o = (r = m.user) == null ? void 0 : r.name) == null ? void 0 : o[0]) || "U" })
|
|
1998
|
+
] }),
|
|
1999
|
+
/* @__PURE__ */ e("div", { className: "w-[calc(100%-36px)]", children: /* @__PURE__ */ e("span", { className: "text-ds-md block w-full cursor-default truncate text-text-primary", children: ((x = m.user) == null ? void 0 : x.firstName) ?? ((f = (u = m.user) == null ? void 0 : u.name) == null ? void 0 : f.split(" ")[0]) }) })
|
|
2000
|
+
] }),
|
|
2001
|
+
/* @__PURE__ */ e("div", { className: "text-ds-md w-[16.4%] p-ds-04 px-ds-04 text-interactive", children: m.totalDays })
|
|
2002
|
+
]
|
|
2003
|
+
},
|
|
2004
|
+
m.id
|
|
2005
|
+
);
|
|
2006
|
+
}) })
|
|
2007
|
+
] });
|
|
2008
|
+
}
|
|
2009
|
+
);
|
|
2010
|
+
$t.displayName = "BreakBalance";
|
|
2011
|
+
const zt = O.forwardRef(function({
|
|
2012
|
+
request: t,
|
|
2013
|
+
userImages: n,
|
|
2014
|
+
handleRejectRequest: a,
|
|
2015
|
+
handleApproveRequest: d,
|
|
2016
|
+
commentBoxOpen: m,
|
|
2017
|
+
onCommentBoxClose: p,
|
|
2018
|
+
clickedAction: r,
|
|
2019
|
+
userId: o
|
|
2020
|
+
}, x) {
|
|
2021
|
+
var c, w, g, T, E, v, k, D, P;
|
|
2022
|
+
const [u, f] = M(""), y = new Date(t.startDate), i = new Date(t.endDate), h = Z(y, i);
|
|
2023
|
+
return /* @__PURE__ */ s(V, { children: [
|
|
2024
|
+
/* @__PURE__ */ s(
|
|
2025
|
+
"div",
|
|
2026
|
+
{
|
|
2027
|
+
ref: x,
|
|
2028
|
+
className: "flex justify-between border-b border-border px-ds-03 py-ds-04 last:border-b-0",
|
|
2029
|
+
children: [
|
|
2030
|
+
/* @__PURE__ */ s("div", { className: "flex w-full items-center gap-ds-04", children: [
|
|
2031
|
+
/* @__PURE__ */ s(Xe, { className: "h-ds-md w-ds-md", children: [
|
|
2032
|
+
/* @__PURE__ */ e(Qe, { src: n[((c = t.user) == null ? void 0 : c.id) || ""], alt: ((w = t.user) == null ? void 0 : w.name) || "" }),
|
|
2033
|
+
/* @__PURE__ */ e(Le, { children: (((g = t.user) == null ? void 0 : g.name) || "?")[0] })
|
|
2034
|
+
] }),
|
|
2035
|
+
/* @__PURE__ */ s("div", { className: "flex w-auto max-w-[75%] flex-col items-start gap-ds-02b", children: [
|
|
2036
|
+
/* @__PURE__ */ e("div", { className: "flex flex-row gap-ds-02b", children: /* @__PURE__ */ s("div", { className: "flex items-center gap-ds-03", children: [
|
|
2037
|
+
/* @__PURE__ */ e("p", { className: "text-ds-sm text-text-secondary", children: (T = t.user) == null ? void 0 : T.name }),
|
|
2038
|
+
t.correction && /* @__PURE__ */ s(V, { children: [
|
|
2039
|
+
/* @__PURE__ */ e("div", { className: "block h-3 w-[1px] bg-border-subtle" }),
|
|
2040
|
+
" ",
|
|
2041
|
+
/* @__PURE__ */ e("p", { className: "text-ds-sm text-interactive", children: "Attendance Corrections" }),
|
|
2042
|
+
" "
|
|
2043
|
+
] })
|
|
2044
|
+
] }) }),
|
|
2045
|
+
/* @__PURE__ */ e("div", { className: "flex w-full flex-wrap items-center gap-ds-04", children: h ? /* @__PURE__ */ s("div", { className: "flex w-full flex-wrap items-center gap-ds-03", children: [
|
|
2046
|
+
/* @__PURE__ */ s(ae, { children: [
|
|
2047
|
+
/* @__PURE__ */ e(re, { asChild: !0, children: /* @__PURE__ */ e("p", { className: "text-ds-base font-semibold line-clamp-2 cursor-default text-text-primary", children: t.reason }) }),
|
|
2048
|
+
/* @__PURE__ */ e(le, { children: t.reason })
|
|
2049
|
+
] }),
|
|
2050
|
+
/* @__PURE__ */ s("p", { className: "text-ds-base text-text-tertiary", children: [
|
|
2051
|
+
"• ",
|
|
2052
|
+
Me(y)
|
|
2053
|
+
] })
|
|
2054
|
+
] }) : /* @__PURE__ */ s(V, { children: [
|
|
2055
|
+
/* @__PURE__ */ s(ae, { children: [
|
|
2056
|
+
/* @__PURE__ */ e(re, { asChild: !0, children: /* @__PURE__ */ e("p", { className: "text-ds-base font-semibold line-clamp-2 cursor-default text-text-primary", children: t.reason }) }),
|
|
2057
|
+
/* @__PURE__ */ e(le, { children: t.reason })
|
|
2058
|
+
] }),
|
|
2059
|
+
/* @__PURE__ */ s("p", { className: "text-ds-base text-text-tertiary", children: [
|
|
2060
|
+
Me(y),
|
|
2061
|
+
" to",
|
|
2062
|
+
" ",
|
|
2063
|
+
Me(i),
|
|
2064
|
+
",",
|
|
2065
|
+
/* @__PURE__ */ s("span", { className: "text-interactive-hover", children: [
|
|
2066
|
+
" ",
|
|
2067
|
+
t.numberOfDays,
|
|
2068
|
+
" days"
|
|
2069
|
+
] })
|
|
2070
|
+
] })
|
|
2071
|
+
] }) })
|
|
2072
|
+
] })
|
|
2073
|
+
] }),
|
|
2074
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-ds-04", children: [
|
|
2075
|
+
/* @__PURE__ */ s(ae, { delayDuration: 0, children: [
|
|
2076
|
+
/* @__PURE__ */ e(re, { asChild: !0, children: /* @__PURE__ */ e(
|
|
2077
|
+
J,
|
|
2078
|
+
{
|
|
2079
|
+
variant: "ghost",
|
|
2080
|
+
size: "icon-sm",
|
|
2081
|
+
onClick: (Y) => {
|
|
2082
|
+
var C;
|
|
2083
|
+
return ((C = t.user) == null ? void 0 : C.id) !== o && a(Y, t.id);
|
|
2084
|
+
},
|
|
2085
|
+
disabled: ((E = t.user) == null ? void 0 : E.id) === o,
|
|
2086
|
+
"aria-label": "Reject break request",
|
|
2087
|
+
children: /* @__PURE__ */ e(oe, { className: "h-ico-lg w-ico-lg" })
|
|
2088
|
+
}
|
|
2089
|
+
) }),
|
|
2090
|
+
((v = t.user) == null ? void 0 : v.id) === o && /* @__PURE__ */ e(le, { children: /* @__PURE__ */ e("p", { children: "You cannot approve/reject your own break request" }) })
|
|
2091
|
+
] }),
|
|
2092
|
+
/* @__PURE__ */ s(ae, { delayDuration: 0, children: [
|
|
2093
|
+
/* @__PURE__ */ e(re, { asChild: !0, children: /* @__PURE__ */ e(
|
|
2094
|
+
J,
|
|
2095
|
+
{
|
|
2096
|
+
variant: "ghost",
|
|
2097
|
+
size: "icon-sm",
|
|
2098
|
+
onClick: (Y) => {
|
|
2099
|
+
var C;
|
|
2100
|
+
return ((C = t.user) == null ? void 0 : C.id) !== o && d(Y, t.id);
|
|
2101
|
+
},
|
|
2102
|
+
disabled: ((k = t.user) == null ? void 0 : k.id) === o,
|
|
2103
|
+
"aria-label": "Approve break request",
|
|
2104
|
+
children: /* @__PURE__ */ e(Ge, { className: "h-ico-lg w-ico-lg" })
|
|
2105
|
+
}
|
|
2106
|
+
) }),
|
|
2107
|
+
((D = t.user) == null ? void 0 : D.id) === o && /* @__PURE__ */ e(le, { children: /* @__PURE__ */ e("p", { children: "You cannot approve/reject your own break request" }) })
|
|
2108
|
+
] })
|
|
2109
|
+
] })
|
|
2110
|
+
]
|
|
2111
|
+
},
|
|
2112
|
+
t.id
|
|
2113
|
+
),
|
|
2114
|
+
/* @__PURE__ */ e(
|
|
2115
|
+
ce,
|
|
2116
|
+
{
|
|
2117
|
+
open: m,
|
|
2118
|
+
onOpenChange: () => {
|
|
2119
|
+
p(), f("");
|
|
2120
|
+
},
|
|
2121
|
+
children: /* @__PURE__ */ s(me, { children: [
|
|
2122
|
+
/* @__PURE__ */ s(Ne, { children: [
|
|
2123
|
+
/* @__PURE__ */ e(ps, { className: "text-ds-xl", children: (P = t.user) == null ? void 0 : P.name }),
|
|
2124
|
+
/* @__PURE__ */ e(Ze, { className: "text-ds-lg", children: t.reason })
|
|
2125
|
+
] }),
|
|
2126
|
+
/* @__PURE__ */ s("div", { className: "flex flex-col", children: [
|
|
2127
|
+
/* @__PURE__ */ s("div", { className: "text-ds-md flex flex-col items-start justify-center gap-ds-03 rounded-ds-lg border border-border-subtle bg-layer-01 shadow-01 px-ds-05 pb-ds-01 pt-ds-03 text-text-primary", children: [
|
|
2128
|
+
/* @__PURE__ */ e("label", { className: "text-ds-xs font-semibold uppercase tracking-wider text-text-helper", htmlFor: "comment", children: "Comment" }),
|
|
2129
|
+
/* @__PURE__ */ e(
|
|
2130
|
+
bs,
|
|
2131
|
+
{
|
|
2132
|
+
id: "comment",
|
|
2133
|
+
defaultValue: u,
|
|
2134
|
+
onChange: (Y) => f(Y.target.value),
|
|
2135
|
+
placeholder: "Enjoy your break",
|
|
2136
|
+
className: "resize-none border-none px-0 shadow-none placeholder:font-accent"
|
|
2137
|
+
}
|
|
2138
|
+
)
|
|
2139
|
+
] }),
|
|
2140
|
+
/* @__PURE__ */ e(
|
|
2141
|
+
J,
|
|
2142
|
+
{
|
|
2143
|
+
className: "mt-ds-06",
|
|
2144
|
+
variant: "solid",
|
|
2145
|
+
onClick: () => {
|
|
2146
|
+
r === "approve" ? d(void 0, t.id, u) : r === "reject" && a(void 0, t.id, u);
|
|
2147
|
+
},
|
|
2148
|
+
children: r === "approve" ? "Approve" : "Reject"
|
|
2149
|
+
}
|
|
2150
|
+
)
|
|
2151
|
+
] })
|
|
2152
|
+
] })
|
|
2153
|
+
}
|
|
2154
|
+
)
|
|
2155
|
+
] });
|
|
2156
|
+
});
|
|
2157
|
+
zt.displayName = "LeaveRequest";
|
|
2158
|
+
const Kt = O.forwardRef(function({ id: t, userId: n, onDelete: a }, d) {
|
|
2159
|
+
const [m, p] = M(!1), { toast: r } = je(), [o, x] = M(!1), u = Be(null);
|
|
2160
|
+
return /* @__PURE__ */ s(ce, { open: o, onOpenChange: x, children: [
|
|
2161
|
+
/* @__PURE__ */ e(we, { asChild: !0, children: /* @__PURE__ */ e(X, { icon: /* @__PURE__ */ e(cs, {}), size: "md", "aria-label": "Delete break" }) }),
|
|
2162
|
+
/* @__PURE__ */ s(me, { className: "flex w-[335px] flex-col items-center gap-ds-06 p-ds-06 max-md:w-[90%] max-md:rounded-ds-lg", children: [
|
|
2163
|
+
/* @__PURE__ */ s("div", { className: "flex w-full max-w-[240px] flex-col items-center gap-ds-04 text-center", children: [
|
|
2164
|
+
/* @__PURE__ */ e("p", { className: "text-ds-lg font-semibold text-center text-text-primary", children: "Delete this break?" }),
|
|
2165
|
+
/* @__PURE__ */ e("p", { className: "text-ds-base text-text-tertiary", children: "This will be permanently deleted and can not undo" })
|
|
2166
|
+
] }),
|
|
2167
|
+
/* @__PURE__ */ e("form", { ref: u, onSubmit: async (y) => {
|
|
2168
|
+
var i;
|
|
2169
|
+
y.preventDefault(), (i = y.stopPropagation) == null || i.call(y), p(!0);
|
|
2170
|
+
try {
|
|
2171
|
+
a && a(), r({
|
|
2172
|
+
description: "Break request deleted successfully",
|
|
2173
|
+
color: "neutral"
|
|
2174
|
+
}), x(!1);
|
|
2175
|
+
} catch (h) {
|
|
2176
|
+
console.error("Error deleting break request:", h), r({
|
|
2177
|
+
title: "Error",
|
|
2178
|
+
description: "Failed to delete break request",
|
|
2179
|
+
color: "error"
|
|
2180
|
+
});
|
|
2181
|
+
} finally {
|
|
2182
|
+
p(!1);
|
|
2183
|
+
}
|
|
2184
|
+
}, className: "w-full", children: /* @__PURE__ */ e(
|
|
2185
|
+
J,
|
|
2186
|
+
{
|
|
2187
|
+
className: "w-full",
|
|
2188
|
+
variant: "solid",
|
|
2189
|
+
onClick: () => {
|
|
2190
|
+
var y;
|
|
2191
|
+
return (y = u.current) == null ? void 0 : y.requestSubmit();
|
|
2192
|
+
},
|
|
2193
|
+
disabled: m,
|
|
2194
|
+
children: "Yes, Delete"
|
|
2195
|
+
}
|
|
2196
|
+
) })
|
|
2197
|
+
] })
|
|
2198
|
+
] });
|
|
2199
|
+
});
|
|
2200
|
+
Kt.displayName = "DeleteBreak";
|
|
2201
|
+
function Ae(l, t, n) {
|
|
2202
|
+
const a = q(l), d = q(t), m = q(n);
|
|
2203
|
+
return rs(a, { start: d, end: m });
|
|
2204
|
+
}
|
|
2205
|
+
function Os(l, t) {
|
|
2206
|
+
const n = q(l), a = q(t);
|
|
2207
|
+
return wt(n, a) || Nt(n, a);
|
|
2208
|
+
}
|
|
2209
|
+
function Wt(l, t) {
|
|
2210
|
+
const n = q(l), a = q(t);
|
|
2211
|
+
return Ve(n, a) || Nt(n, a);
|
|
2212
|
+
}
|
|
2213
|
+
function Ps(l, t) {
|
|
2214
|
+
return Ve(q(l), q(t));
|
|
2215
|
+
}
|
|
2216
|
+
function xt(l, t, n, a) {
|
|
2217
|
+
return n.some((d) => {
|
|
2218
|
+
const m = A(new Date(d.startDate), "yyyy-MM-dd"), p = A(new Date(d.endDate), "yyyy-MM-dd"), r = Ae(l, m, p), o = Ae(t, m, p), x = Os(l, m) && Wt(t, p);
|
|
2219
|
+
return d.id !== a && (r || o || x);
|
|
2220
|
+
});
|
|
2221
|
+
}
|
|
2222
|
+
function ft(l, t, n) {
|
|
2223
|
+
return t.some((a) => {
|
|
2224
|
+
const d = A(new Date(a.startDate), "yyyy-MM-dd"), m = A(new Date(a.endDate), "yyyy-MM-dd");
|
|
2225
|
+
return a.id !== n && Ae(l, d, m);
|
|
2226
|
+
});
|
|
2227
|
+
}
|
|
2228
|
+
function Fs() {
|
|
2229
|
+
const [l, t] = M(!1), [n, a] = M(null), [d, m] = M((/* @__PURE__ */ new Date()).getMonth()), [p, r] = M((/* @__PURE__ */ new Date()).getFullYear()), [o, x] = M(
|
|
2230
|
+
null
|
|
2231
|
+
), [u, f] = M(null), y = $(
|
|
2232
|
+
(h) => {
|
|
2233
|
+
const c = d, w = p;
|
|
2234
|
+
if (h === "next") {
|
|
2235
|
+
const g = c === 11 ? 0 : c + 1, T = c === 11 ? w + 1 : w;
|
|
2236
|
+
m(g), r(T);
|
|
2237
|
+
} else {
|
|
2238
|
+
const g = c === 0 ? 11 : c - 1, T = c === 0 ? w - 1 : w;
|
|
2239
|
+
m(g), r(T);
|
|
2240
|
+
}
|
|
2241
|
+
},
|
|
2242
|
+
[d, p]
|
|
2243
|
+
), i = $(() => {
|
|
2244
|
+
t(!1), a(null), x(null), f(null);
|
|
2245
|
+
}, []);
|
|
2246
|
+
return {
|
|
2247
|
+
// State
|
|
2248
|
+
showCalendar: l,
|
|
2249
|
+
activeDate: n,
|
|
2250
|
+
currentMonth: d,
|
|
2251
|
+
currentYear: p,
|
|
2252
|
+
selectedStartDate: o,
|
|
2253
|
+
selectedEndDate: u,
|
|
2254
|
+
// Setters (for cases needing direct access)
|
|
2255
|
+
setShowCalendar: t,
|
|
2256
|
+
setActiveDate: a,
|
|
2257
|
+
setCurrentMonth: m,
|
|
2258
|
+
setCurrentYear: r,
|
|
2259
|
+
setSelectedStartDate: x,
|
|
2260
|
+
setSelectedEndDate: f,
|
|
2261
|
+
// Helpers
|
|
2262
|
+
navigateMonth: y,
|
|
2263
|
+
resetDates: i
|
|
2264
|
+
};
|
|
2265
|
+
}
|
|
2266
|
+
const Vt = O.forwardRef(function({
|
|
2267
|
+
selectedLeave: t,
|
|
2268
|
+
existingBreaks: n,
|
|
2269
|
+
onFetchMonthBreaks: a,
|
|
2270
|
+
onSave: d,
|
|
2271
|
+
onDelete: m
|
|
2272
|
+
}, p) {
|
|
2273
|
+
var F;
|
|
2274
|
+
const [r, o] = M(!1), [x, u] = M(
|
|
2275
|
+
n || []
|
|
2276
|
+
), [f, y] = M(!1), [i, h] = M({
|
|
2277
|
+
status: (t == null ? void 0 : t.status) || "",
|
|
2278
|
+
comment: (t == null ? void 0 : t.adminComment) || "",
|
|
2279
|
+
startDate: (t == null ? void 0 : t.startDate) || "",
|
|
2280
|
+
endDate: (t == null ? void 0 : t.endDate) || ""
|
|
2281
|
+
}), c = Fs(), w = Be(null), { toast: g } = je();
|
|
2282
|
+
U(() => {
|
|
2283
|
+
if (t) {
|
|
2284
|
+
const b = (N) => N ? A(new Date(N), "yyyy-MM-dd") : "";
|
|
2285
|
+
h({
|
|
2286
|
+
status: (t == null ? void 0 : t.status) || "",
|
|
2287
|
+
comment: (t == null ? void 0 : t.adminComment) || "",
|
|
2288
|
+
startDate: b(t == null ? void 0 : t.startDate),
|
|
2289
|
+
endDate: b(t == null ? void 0 : t.endDate)
|
|
2290
|
+
}), c.setSelectedStartDate(b(t == null ? void 0 : t.startDate)), c.setSelectedEndDate(b(t == null ? void 0 : t.endDate));
|
|
2291
|
+
}
|
|
2292
|
+
}, [t]), U(() => {
|
|
2293
|
+
if (n) {
|
|
2294
|
+
u(n);
|
|
2295
|
+
return;
|
|
2296
|
+
}
|
|
2297
|
+
a && a(c.currentMonth, c.currentYear).then((b) => {
|
|
2298
|
+
b && u(
|
|
2299
|
+
b.map((N) => ({
|
|
2300
|
+
...N,
|
|
2301
|
+
startDate: new Date(N.startDate).toISOString(),
|
|
2302
|
+
endDate: new Date(N.endDate).toISOString()
|
|
2303
|
+
}))
|
|
2304
|
+
);
|
|
2305
|
+
}).catch((b) => {
|
|
2306
|
+
console.error("Error fetching breaks:", b);
|
|
2307
|
+
});
|
|
2308
|
+
}, [c.currentMonth, c.currentYear, n, a]);
|
|
2309
|
+
const T = (b) => {
|
|
2310
|
+
const { name: N, value: _ } = b.target;
|
|
2311
|
+
h((j) => ({
|
|
2312
|
+
...j,
|
|
2313
|
+
[N]: _
|
|
2314
|
+
}));
|
|
2315
|
+
}, E = (b) => {
|
|
2316
|
+
h((N) => ({
|
|
2317
|
+
...N,
|
|
2318
|
+
status: b
|
|
2319
|
+
})), o(!1);
|
|
2320
|
+
}, v = (b) => {
|
|
2321
|
+
if (c.setActiveDate(b), b === "start" && i.startDate) {
|
|
2322
|
+
const N = new Date(i.startDate);
|
|
2323
|
+
c.setCurrentMonth(N.getMonth()), c.setCurrentYear(N.getFullYear());
|
|
2324
|
+
} else if (b === "end" && i.endDate) {
|
|
2325
|
+
const N = new Date(i.endDate);
|
|
2326
|
+
c.setCurrentMonth(N.getMonth()), c.setCurrentYear(N.getFullYear());
|
|
2327
|
+
}
|
|
2328
|
+
c.setShowCalendar(!0);
|
|
2329
|
+
}, k = async (b) => {
|
|
2330
|
+
if (b.preventDefault(), i.status === "PENDING") {
|
|
2331
|
+
g({
|
|
2332
|
+
title: "Action Required",
|
|
2333
|
+
description: "Please update the status",
|
|
2334
|
+
color: "neutral"
|
|
2335
|
+
});
|
|
2336
|
+
return;
|
|
2337
|
+
}
|
|
2338
|
+
y(!0);
|
|
2339
|
+
try {
|
|
2340
|
+
d && d({
|
|
2341
|
+
requestId: t.id,
|
|
2342
|
+
userId: t.userId,
|
|
2343
|
+
status: i.status,
|
|
2344
|
+
adminComment: i.comment,
|
|
2345
|
+
startDate: new Date(i.startDate).toISOString(),
|
|
2346
|
+
endDate: new Date(i.endDate).toISOString(),
|
|
2347
|
+
isEditing: !0
|
|
2348
|
+
}), g({
|
|
2349
|
+
description: "Break request updated successfully",
|
|
2350
|
+
color: "neutral"
|
|
2351
|
+
});
|
|
2352
|
+
} catch (N) {
|
|
2353
|
+
console.error("Error updating break request:", N), g({
|
|
2354
|
+
title: "Error",
|
|
2355
|
+
description: "Failed to update break request",
|
|
2356
|
+
color: "error"
|
|
2357
|
+
});
|
|
2358
|
+
} finally {
|
|
2359
|
+
y(!1);
|
|
2360
|
+
}
|
|
2361
|
+
}, D = (b) => {
|
|
2362
|
+
const N = {
|
|
2363
|
+
APPROVED: {
|
|
2364
|
+
text: "Approved",
|
|
2365
|
+
className: "bg-success-surface text-text-success"
|
|
2366
|
+
},
|
|
2367
|
+
PENDING: {
|
|
2368
|
+
text: "Pending",
|
|
2369
|
+
className: "bg-warning-surface text-text-warning"
|
|
2370
|
+
},
|
|
2371
|
+
REJECTED: {
|
|
2372
|
+
text: "Deny",
|
|
2373
|
+
className: "bg-error-surface text-text-error"
|
|
2374
|
+
},
|
|
2375
|
+
CANCELLED: {
|
|
2376
|
+
text: "Redacted",
|
|
2377
|
+
className: "bg-error-surface text-text-error"
|
|
2378
|
+
}
|
|
2379
|
+
}, { text: _, className: j } = N[b] || N.REJECTED;
|
|
2380
|
+
return /* @__PURE__ */ e(
|
|
2381
|
+
"div",
|
|
2382
|
+
{
|
|
2383
|
+
className: S("text-ds-sm w-fit rounded-ds-2xl px-ds-02b py-ds-02 capitalize", j),
|
|
2384
|
+
children: _
|
|
2385
|
+
}
|
|
2386
|
+
);
|
|
2387
|
+
}, P = (b) => b ? A(new Date(b), "EEEE, MMMM d") : "", Y = (b, N) => {
|
|
2388
|
+
const _ = [], j = new Date(N, b, 1), L = ls(j), ee = lt(j), te = 6 - lt(L), z = /* @__PURE__ */ new Date();
|
|
2389
|
+
for (let K = ee - 1; K >= 0; K--) {
|
|
2390
|
+
const G = ds(j, K + 1);
|
|
2391
|
+
_.push({
|
|
2392
|
+
date: G.getDate(),
|
|
2393
|
+
fullDate: A(G, "yyyy-MM-dd"),
|
|
2394
|
+
isPadding: !0,
|
|
2395
|
+
isToday: Q(G, z),
|
|
2396
|
+
isWeekend: !1
|
|
2397
|
+
});
|
|
2398
|
+
}
|
|
2399
|
+
const se = Ie(j);
|
|
2400
|
+
for (let K = 1; K <= se; K++) {
|
|
2401
|
+
const G = new Date(N, b, K);
|
|
2402
|
+
_.push({
|
|
2403
|
+
date: K,
|
|
2404
|
+
fullDate: A(G, "yyyy-MM-dd"),
|
|
2405
|
+
isPadding: !1,
|
|
2406
|
+
isToday: Q(G, z),
|
|
2407
|
+
isWeekend: !1
|
|
2408
|
+
});
|
|
2409
|
+
}
|
|
2410
|
+
for (let K = 1; K <= te; K++) {
|
|
2411
|
+
const G = gt(L, K);
|
|
2412
|
+
_.push({
|
|
2413
|
+
date: G.getDate(),
|
|
2414
|
+
fullDate: A(G, "yyyy-MM-dd"),
|
|
2415
|
+
isPadding: !0,
|
|
2416
|
+
isToday: Q(G, z),
|
|
2417
|
+
isWeekend: !1
|
|
2418
|
+
});
|
|
2419
|
+
}
|
|
2420
|
+
return _;
|
|
2421
|
+
}, C = (b) => {
|
|
2422
|
+
if (ft(b.fullDate, x, t.id)) {
|
|
2423
|
+
g({
|
|
2424
|
+
title: "Error",
|
|
2425
|
+
description: "This date is already part of another break request.",
|
|
2426
|
+
color: "error"
|
|
2427
|
+
});
|
|
2428
|
+
return;
|
|
2429
|
+
}
|
|
2430
|
+
if (!b.isPadding) {
|
|
2431
|
+
if (c.activeDate === "start") {
|
|
2432
|
+
const N = b.fullDate, _ = c.selectedEndDate || N;
|
|
2433
|
+
if (xt(N, _, x, t.id)) {
|
|
2434
|
+
g({
|
|
2435
|
+
title: "Error",
|
|
2436
|
+
description: "The selected date range overlaps with an existing break request.",
|
|
2437
|
+
color: "error"
|
|
2438
|
+
});
|
|
2439
|
+
return;
|
|
2440
|
+
}
|
|
2441
|
+
c.setSelectedStartDate(N), h((j) => ({
|
|
2442
|
+
...j,
|
|
2443
|
+
startDate: N
|
|
2444
|
+
})), c.selectedEndDate && Ps(N, c.selectedEndDate) && (c.setSelectedEndDate(N), h((j) => ({
|
|
2445
|
+
...j,
|
|
2446
|
+
endDate: N
|
|
2447
|
+
})));
|
|
2448
|
+
} else if (c.activeDate === "end") {
|
|
2449
|
+
const N = b.fullDate, _ = c.selectedStartDate || N;
|
|
2450
|
+
if (xt(_, N, x, t.id)) {
|
|
2451
|
+
g({
|
|
2452
|
+
title: "Error",
|
|
2453
|
+
description: "The selected date range overlaps with an existing break request.",
|
|
2454
|
+
color: "error"
|
|
2455
|
+
});
|
|
2456
|
+
return;
|
|
2457
|
+
}
|
|
2458
|
+
c.selectedStartDate && Wt(N, c.selectedStartDate) ? (c.setSelectedEndDate(N), h((j) => ({
|
|
2459
|
+
...j,
|
|
2460
|
+
endDate: N
|
|
2461
|
+
}))) : c.selectedStartDate || (c.setSelectedStartDate(N), c.setSelectedEndDate(N), h((j) => ({
|
|
2462
|
+
...j,
|
|
2463
|
+
startDate: N,
|
|
2464
|
+
endDate: N
|
|
2465
|
+
})));
|
|
2466
|
+
}
|
|
2467
|
+
c.setShowCalendar(!1);
|
|
2468
|
+
}
|
|
2469
|
+
}, B = (b) => !c.selectedStartDate || !c.selectedEndDate ? !!(c.showCalendar && (c.activeDate === "start" && i.startDate === b || c.activeDate === "end" && i.endDate === b)) : Ae(b, c.selectedStartDate, c.selectedEndDate), I = Y(c.currentMonth, c.currentYear);
|
|
2470
|
+
return /* @__PURE__ */ s(ce, { children: [
|
|
2471
|
+
/* @__PURE__ */ e(we, { asChild: !0, children: /* @__PURE__ */ s(
|
|
2472
|
+
J,
|
|
2473
|
+
{
|
|
2474
|
+
variant: "outline",
|
|
2475
|
+
className: "text-ds-base border-border bg-layer-01 px-ds-05 py-ds-04 pr-ds-06 text-text-secondary shadow-02",
|
|
2476
|
+
children: [
|
|
2477
|
+
/* @__PURE__ */ e(Je, {}),
|
|
2478
|
+
/* @__PURE__ */ e("span", { children: "Edit" })
|
|
2479
|
+
]
|
|
2480
|
+
}
|
|
2481
|
+
) }),
|
|
2482
|
+
/* @__PURE__ */ e(me, { className: "w-[440px] p-ds-06 max-md:w-[90%] max-md:rounded-ds-lg", children: /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(Ze, { children: /* @__PURE__ */ s("div", { className: "flex w-full flex-col items-center gap-ds-05", children: [
|
|
2483
|
+
/* @__PURE__ */ s("p", { className: "text-ds-md w-full text-left text-text-tertiary", children: [
|
|
2484
|
+
"Edit break details of",
|
|
2485
|
+
" ",
|
|
2486
|
+
/* @__PURE__ */ e("span", { className: "font-semibold text-interactive", children: (F = t == null ? void 0 : t.user) == null ? void 0 : F.name })
|
|
2487
|
+
] }),
|
|
2488
|
+
/* @__PURE__ */ s(
|
|
2489
|
+
"form",
|
|
2490
|
+
{
|
|
2491
|
+
ref: w,
|
|
2492
|
+
onSubmit: k,
|
|
2493
|
+
id: "updateleaveform",
|
|
2494
|
+
className: "flex w-full flex-col gap-ds-05",
|
|
2495
|
+
children: [
|
|
2496
|
+
/* @__PURE__ */ s("div", { className: "flex w-full flex-col gap-ds-02 rounded-ds-lg border border-border-subtle px-ds-05 pb-ds-03 pt-ds-04", children: [
|
|
2497
|
+
/* @__PURE__ */ e("h2", { className: "text-ds-xs font-semibold uppercase tracking-wider text-text-placeholder", children: "Reason" }),
|
|
2498
|
+
/* @__PURE__ */ e("p", { className: "text-ds-md text-text-primary", children: Re(t == null ? void 0 : t.reason) })
|
|
2499
|
+
] }),
|
|
2500
|
+
/* @__PURE__ */ s("div", { className: "flex w-full items-center justify-center gap-ds-02", children: [
|
|
2501
|
+
/* @__PURE__ */ e(
|
|
2502
|
+
"button",
|
|
2503
|
+
{
|
|
2504
|
+
type: "button",
|
|
2505
|
+
onClick: () => v("start"),
|
|
2506
|
+
className: S(
|
|
2507
|
+
"text-ds-md flex w-full items-center justify-center gap-ds-03 rounded-ds-full border bg-layer-02 px-ds-03 py-ds-03 text-text-secondary max-md:text-ds-sm",
|
|
2508
|
+
c.showCalendar && c.activeDate === "start" ? "border-border-strong" : "border-border"
|
|
2509
|
+
),
|
|
2510
|
+
children: P(i.startDate)
|
|
2511
|
+
}
|
|
2512
|
+
),
|
|
2513
|
+
/* @__PURE__ */ e("div", { className: "flex h-ico-sm w-ico-sm items-center", children: /* @__PURE__ */ e(ms, { className: "h-ico-sm w-ico-sm text-icon-secondary" }) }),
|
|
2514
|
+
/* @__PURE__ */ e(
|
|
2515
|
+
"button",
|
|
2516
|
+
{
|
|
2517
|
+
type: "button",
|
|
2518
|
+
onClick: () => v("end"),
|
|
2519
|
+
className: S(
|
|
2520
|
+
"text-ds-md flex w-full items-center justify-center gap-ds-03 rounded-ds-full border bg-layer-02 px-ds-03 py-ds-03 text-text-secondary max-md:text-ds-sm",
|
|
2521
|
+
c.showCalendar && c.activeDate === "end" ? "border-border-strong" : "border-border"
|
|
2522
|
+
),
|
|
2523
|
+
children: P(i.endDate)
|
|
2524
|
+
}
|
|
2525
|
+
)
|
|
2526
|
+
] }),
|
|
2527
|
+
c.showCalendar && /* @__PURE__ */ s("div", { className: "", children: [
|
|
2528
|
+
/* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
|
|
2529
|
+
/* @__PURE__ */ e(
|
|
2530
|
+
"button",
|
|
2531
|
+
{
|
|
2532
|
+
type: "button",
|
|
2533
|
+
className: "rounded-ds-full p-ds-03 hover:bg-field-hover",
|
|
2534
|
+
onClick: () => c.navigateMonth("prev"),
|
|
2535
|
+
children: /* @__PURE__ */ e(ye, { className: "h-ico-md w-ico-md" })
|
|
2536
|
+
}
|
|
2537
|
+
),
|
|
2538
|
+
/* @__PURE__ */ s("div", { className: "text-ds-md font-semibold uppercase", children: [
|
|
2539
|
+
new Date(c.currentYear, c.currentMonth).toLocaleString(
|
|
2540
|
+
"default",
|
|
2541
|
+
{
|
|
2542
|
+
month: "long"
|
|
2543
|
+
}
|
|
2544
|
+
),
|
|
2545
|
+
" ",
|
|
2546
|
+
c.currentYear
|
|
2547
|
+
] }),
|
|
2548
|
+
/* @__PURE__ */ e(
|
|
2549
|
+
"button",
|
|
2550
|
+
{
|
|
2551
|
+
type: "button",
|
|
2552
|
+
className: "rounded-ds-full p-ds-03 hover:bg-field-hover",
|
|
2553
|
+
onClick: () => c.navigateMonth("next"),
|
|
2554
|
+
children: /* @__PURE__ */ e(ge, { className: "h-ico-md w-ico-md" })
|
|
2555
|
+
}
|
|
2556
|
+
)
|
|
2557
|
+
] }),
|
|
2558
|
+
/* @__PURE__ */ s("div", { className: "calendar grid w-full grid-cols-7 items-center gap-0 overflow-hidden", children: [
|
|
2559
|
+
["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"].map(
|
|
2560
|
+
(b) => /* @__PURE__ */ e("div", { className: "pb-ds-03 pt-ds-05 text-center", children: /* @__PURE__ */ e("span", { className: "text-ds-sm font-semibold uppercase tracking-wider text-text-tertiary", children: b }) }, b)
|
|
2561
|
+
),
|
|
2562
|
+
I.map((b, N) => /* @__PURE__ */ e(
|
|
2563
|
+
"button",
|
|
2564
|
+
{
|
|
2565
|
+
type: "button",
|
|
2566
|
+
tabIndex: b.isPadding ? -1 : 0,
|
|
2567
|
+
"aria-label": b.isPadding ? void 0 : A(new Date(b.fullDate), "MMMM d, yyyy"),
|
|
2568
|
+
className: S(
|
|
2569
|
+
"flex cursor-pointer flex-col items-center pb-0 pt-0 text-center",
|
|
2570
|
+
B(b.fullDate) && b.fullDate !== c.selectedStartDate && b.fullDate !== c.selectedEndDate && "bg-layer-accent-subtle",
|
|
2571
|
+
b.isPadding && "opacity-[0.5]",
|
|
2572
|
+
b.fullDate === c.selectedStartDate && B(b.fullDate) && "start-date mini",
|
|
2573
|
+
b.fullDate === c.selectedEndDate && B(b.fullDate) && "end-date mini",
|
|
2574
|
+
B(b.fullDate) && b.fullDate !== c.selectedStartDate && b.fullDate !== c.selectedEndDate && "in-range-date",
|
|
2575
|
+
c.selectedStartDate === c.selectedEndDate && "same-date"
|
|
2576
|
+
),
|
|
2577
|
+
onClick: () => C(b),
|
|
2578
|
+
children: /* @__PURE__ */ e(
|
|
2579
|
+
"div",
|
|
2580
|
+
{
|
|
2581
|
+
className: S(
|
|
2582
|
+
"mx-ds-02 my-ds-02",
|
|
2583
|
+
b.isPadding && "opacity-[0.5]"
|
|
2584
|
+
),
|
|
2585
|
+
children: /* @__PURE__ */ e(
|
|
2586
|
+
"span",
|
|
2587
|
+
{
|
|
2588
|
+
className: S(
|
|
2589
|
+
"text-ds-base flex h-ds-md w-ds-md items-center justify-center rounded-ds-full",
|
|
2590
|
+
(b.fullDate === c.selectedStartDate || b.fullDate === c.selectedEndDate || ft(b.fullDate, x, t.id)) && "bg-accent ring-2 ring-inset ring-accent",
|
|
2591
|
+
b.isToday ? "bg-interactive-hover p-ds-03 text-text-on-color" : "text-text-secondary"
|
|
2592
|
+
),
|
|
2593
|
+
children: b.date
|
|
2594
|
+
}
|
|
2595
|
+
)
|
|
2596
|
+
}
|
|
2597
|
+
)
|
|
2598
|
+
},
|
|
2599
|
+
N
|
|
2600
|
+
))
|
|
2601
|
+
] })
|
|
2602
|
+
] }),
|
|
2603
|
+
/* @__PURE__ */ s("div", { className: "flex w-full items-center justify-between rounded-ds-lg border border-border px-ds-05 py-ds-04", children: [
|
|
2604
|
+
/* @__PURE__ */ e("p", { className: "text-ds-xs font-semibold uppercase tracking-wider text-text-placeholder", children: "No of Days" }),
|
|
2605
|
+
/* @__PURE__ */ e("p", { className: "text-ds-xl font-semibold text-text-primary", children: t.numberOfDays })
|
|
2606
|
+
] }),
|
|
2607
|
+
/* @__PURE__ */ s("div", { className: "flex w-full items-center justify-between rounded-ds-lg border border-border px-ds-05 py-ds-04", children: [
|
|
2608
|
+
/* @__PURE__ */ e("p", { className: "text-ds-xs font-semibold uppercase tracking-wider text-text-placeholder", children: "Status" }),
|
|
2609
|
+
/* @__PURE__ */ s("div", { className: "relative flex items-center gap-ds-02", children: [
|
|
2610
|
+
/* @__PURE__ */ s(
|
|
2611
|
+
"button",
|
|
2612
|
+
{
|
|
2613
|
+
type: "button",
|
|
2614
|
+
className: "flex cursor-pointer items-center gap-ds-02",
|
|
2615
|
+
"aria-label": "Change status",
|
|
2616
|
+
"aria-haspopup": "listbox",
|
|
2617
|
+
"aria-expanded": r,
|
|
2618
|
+
onClick: () => o(!r),
|
|
2619
|
+
children: [
|
|
2620
|
+
D(i.status),
|
|
2621
|
+
/* @__PURE__ */ e(ie, {})
|
|
2622
|
+
]
|
|
2623
|
+
}
|
|
2624
|
+
),
|
|
2625
|
+
r && /* @__PURE__ */ s("div", { className: "text-ds-base absolute left-[10px] top-[25px] z-raised flex flex-col overflow-hidden rounded-ds-md border border-border bg-layer-01 shadow-02", role: "listbox", children: [
|
|
2626
|
+
/* @__PURE__ */ e(
|
|
2627
|
+
"div",
|
|
2628
|
+
{
|
|
2629
|
+
className: "cursor-pointer border-b border-b-border bg-layer-01 px-ds-04 py-ds-03 text-left",
|
|
2630
|
+
role: "option",
|
|
2631
|
+
tabIndex: 0,
|
|
2632
|
+
"aria-selected": i.status === "APPROVED",
|
|
2633
|
+
onClick: () => E("APPROVED"),
|
|
2634
|
+
onKeyDown: (b) => {
|
|
2635
|
+
(b.key === "Enter" || b.key === " ") && (b.preventDefault(), E("APPROVED"));
|
|
2636
|
+
},
|
|
2637
|
+
children: D("APPROVED")
|
|
2638
|
+
}
|
|
2639
|
+
),
|
|
2640
|
+
/* @__PURE__ */ e(
|
|
2641
|
+
"div",
|
|
2642
|
+
{
|
|
2643
|
+
className: "cursor-pointer bg-layer-01 px-ds-04 py-ds-03 text-left",
|
|
2644
|
+
role: "option",
|
|
2645
|
+
tabIndex: 0,
|
|
2646
|
+
"aria-selected": i.status === "REJECTED",
|
|
2647
|
+
onClick: () => E("REJECTED"),
|
|
2648
|
+
onKeyDown: (b) => {
|
|
2649
|
+
(b.key === "Enter" || b.key === " ") && (b.preventDefault(), E("REJECTED"));
|
|
2650
|
+
},
|
|
2651
|
+
children: D("REJECTED")
|
|
2652
|
+
}
|
|
2653
|
+
)
|
|
2654
|
+
] })
|
|
2655
|
+
] })
|
|
2656
|
+
] }),
|
|
2657
|
+
/* @__PURE__ */ s("div", { className: "flex w-full flex-col gap-ds-02 rounded-ds-lg border border-border-subtle px-ds-05 pb-ds-03 pt-ds-04", children: [
|
|
2658
|
+
/* @__PURE__ */ e("h2", { className: "text-ds-xs font-semibold uppercase tracking-wider text-text-placeholder", children: "Comment" }),
|
|
2659
|
+
/* @__PURE__ */ e(
|
|
2660
|
+
"input",
|
|
2661
|
+
{
|
|
2662
|
+
type: "text",
|
|
2663
|
+
name: "comment",
|
|
2664
|
+
className: "text-ds-md text-text-primary outline-none",
|
|
2665
|
+
placeholder: "Enjoy your break, TC",
|
|
2666
|
+
value: i.comment,
|
|
2667
|
+
onChange: T
|
|
2668
|
+
}
|
|
2669
|
+
)
|
|
2670
|
+
] }),
|
|
2671
|
+
/* @__PURE__ */ s("div", { className: "flex w-full justify-between", children: [
|
|
2672
|
+
/* @__PURE__ */ e("div", { className: "flex h-ds-md w-ds-md items-center justify-center", children: /* @__PURE__ */ e(
|
|
2673
|
+
Kt,
|
|
2674
|
+
{
|
|
2675
|
+
id: t.id,
|
|
2676
|
+
userId: t.userId,
|
|
2677
|
+
onDelete: m
|
|
2678
|
+
}
|
|
2679
|
+
) }),
|
|
2680
|
+
/* @__PURE__ */ e(
|
|
2681
|
+
J,
|
|
2682
|
+
{
|
|
2683
|
+
className: "w-fit",
|
|
2684
|
+
variant: "outline",
|
|
2685
|
+
disabled: f,
|
|
2686
|
+
onClick: () => {
|
|
2687
|
+
var b;
|
|
2688
|
+
return (b = w.current) == null ? void 0 : b.requestSubmit();
|
|
2689
|
+
},
|
|
2690
|
+
children: "Update"
|
|
2691
|
+
}
|
|
2692
|
+
)
|
|
2693
|
+
] })
|
|
2694
|
+
]
|
|
2695
|
+
}
|
|
2696
|
+
)
|
|
2697
|
+
] }) }) }) })
|
|
2698
|
+
] });
|
|
2699
|
+
});
|
|
2700
|
+
Vt.displayName = "EditBreak";
|
|
2701
|
+
const Jt = O.forwardRef(
|
|
2702
|
+
function({
|
|
2703
|
+
breaks: t,
|
|
2704
|
+
userImages: n,
|
|
2705
|
+
existingBreaks: a,
|
|
2706
|
+
onFetchMonthBreaks: d,
|
|
2707
|
+
onSave: m,
|
|
2708
|
+
onDelete: p,
|
|
2709
|
+
onRefresh: r
|
|
2710
|
+
}, o) {
|
|
2711
|
+
return /* @__PURE__ */ s("div", { ref: o, className: "m-0 flex h-[400px] w-full flex-col items-start justify-start p-0 max-md:h-auto", children: [
|
|
2712
|
+
/* @__PURE__ */ s("div", { className: "mx-auto mb-ds-05 mt-ds-04 flex w-[92%] items-center", children: [
|
|
2713
|
+
/* @__PURE__ */ e("div", { className: "w-[16%] min-w-[120px] overflow-hidden px-ds-04 py-ds-03", children: /* @__PURE__ */ e("div", { className: "text-ds-sm font-semibold uppercase tracking-wider text-text-tertiary", children: "NAME" }) }),
|
|
2714
|
+
/* @__PURE__ */ e("div", { className: "w-[19%] overflow-hidden px-ds-04 py-ds-03", children: /* @__PURE__ */ e("div", { className: "text-ds-sm font-semibold uppercase tracking-wider text-text-tertiary", children: "DATE" }) }),
|
|
2715
|
+
/* @__PURE__ */ e("div", { className: "w-[8%] overflow-hidden px-ds-04 py-ds-03", children: /* @__PURE__ */ e("div", { className: "text-ds-sm font-semibold uppercase tracking-wider w-full text-center text-text-tertiary", children: "DAYS" }) }),
|
|
2716
|
+
/* @__PURE__ */ e("div", { className: "w-[22%] overflow-hidden px-ds-04 py-ds-03", children: /* @__PURE__ */ e("div", { className: "text-ds-sm font-semibold uppercase tracking-wider text-text-tertiary", children: "REASON" }) }),
|
|
2717
|
+
/* @__PURE__ */ e("div", { className: "flex w-[14%] items-center justify-start overflow-hidden px-ds-04 py-ds-03", children: /* @__PURE__ */ e("div", { className: "text-ds-sm font-semibold uppercase tracking-wider text-text-tertiary", children: "STATUS" }) }),
|
|
2718
|
+
/* @__PURE__ */ e("div", { className: "w-[24%] overflow-hidden px-ds-04 py-ds-03", children: /* @__PURE__ */ e("div", { className: "text-ds-sm font-semibold uppercase tracking-wider text-text-tertiary", children: "COMMENT" }) }),
|
|
2719
|
+
/* @__PURE__ */ e("div", { className: "w-ds-lg overflow-hidden px-ds-04 py-ds-03" })
|
|
2720
|
+
] }),
|
|
2721
|
+
/* @__PURE__ */ e("div", { className: "no-scrollbar mx-auto flex w-[92%] flex-col gap-ds-05 overflow-y-auto max-md:h-[calc(100dvh-373px)]", children: t.map((x) => {
|
|
2722
|
+
var i, h, c, w, g, T;
|
|
2723
|
+
const u = new Date(x.startDate), f = new Date(x.endDate), y = Z(u, f);
|
|
2724
|
+
return /* @__PURE__ */ s(
|
|
2725
|
+
"div",
|
|
2726
|
+
{
|
|
2727
|
+
className: "flex w-full items-center hover:bg-field",
|
|
2728
|
+
children: [
|
|
2729
|
+
/* @__PURE__ */ s("div", { className: "flex w-[16%] min-w-[120px] items-center gap-ds-03 overflow-hidden px-ds-04 py-ds-03", children: [
|
|
2730
|
+
n[x.userId] ? /* @__PURE__ */ e(
|
|
2731
|
+
"img",
|
|
2732
|
+
{
|
|
2733
|
+
src: n[x.userId],
|
|
2734
|
+
alt: "",
|
|
2735
|
+
className: "h-ds-xs-plus w-full max-w-7 flex-shrink-0 rounded-ds-full object-cover"
|
|
2736
|
+
}
|
|
2737
|
+
) : /* @__PURE__ */ e("span", { className: "flex h-ds-xs-plus w-full max-w-7 items-center justify-center rounded-ds-full bg-layer-02 text-ds-sm font-medium uppercase text-text-primary", children: ((h = (i = x.user) == null ? void 0 : i.name) == null ? void 0 : h[0]) || "U" }),
|
|
2738
|
+
/* @__PURE__ */ s(vs, { children: [
|
|
2739
|
+
/* @__PURE__ */ e(Ds, { asChild: !0, children: /* @__PURE__ */ e("span", { className: "text-ds-md truncate text-text-primary", children: ((c = x.user) == null ? void 0 : c.name) || ((g = (w = x.user) == null ? void 0 : w.name) == null ? void 0 : g.split(" ")[0]) }) }),
|
|
2740
|
+
/* @__PURE__ */ e(Es, { children: (T = x.user) == null ? void 0 : T.name })
|
|
2741
|
+
] })
|
|
2742
|
+
] }),
|
|
2743
|
+
/* @__PURE__ */ e("div", { className: "w-[19%] overflow-hidden px-ds-04 py-ds-03", children: /* @__PURE__ */ s("span", { className: "text-ds-md whitespace-nowrap text-text-secondary", children: [
|
|
2744
|
+
ot(u),
|
|
2745
|
+
" ",
|
|
2746
|
+
!y && /* @__PURE__ */ s(V, { children: [
|
|
2747
|
+
/* @__PURE__ */ e("span", { children: "-" }),
|
|
2748
|
+
" ",
|
|
2749
|
+
ot(f)
|
|
2750
|
+
] })
|
|
2751
|
+
] }) }),
|
|
2752
|
+
/* @__PURE__ */ e("div", { className: "flex w-[8%] items-center justify-center overflow-hidden px-ds-04 py-ds-03", children: /* @__PURE__ */ e("span", { className: "text-ds-md text-center text-text-secondary", children: x.numberOfDays }) }),
|
|
2753
|
+
/* @__PURE__ */ e("div", { className: "w-[22%] overflow-hidden px-ds-04 py-ds-03", children: /* @__PURE__ */ e("span", { className: "text-ds-md text-text-tertiary", children: x.reason }) }),
|
|
2754
|
+
/* @__PURE__ */ e("div", { className: "flex w-[14%] items-center justify-start overflow-hidden px-ds-04 py-ds-03", children: /* @__PURE__ */ e("span", { className: "text-ds-md text-text-tertiary", children: Rt(x == null ? void 0 : x.status, x == null ? void 0 : x.correction) }) }),
|
|
2755
|
+
/* @__PURE__ */ e("div", { className: "w-[24%] overflow-hidden px-ds-04 py-ds-03", children: /* @__PURE__ */ e("span", { className: "text-ds-md text-text-tertiary", children: x.adminComment || " " }) }),
|
|
2756
|
+
/* @__PURE__ */ e("div", { className: "flex w-ds-lg justify-center px-ds-04 py-ds-03", children: /* @__PURE__ */ s(ys, { children: [
|
|
2757
|
+
/* @__PURE__ */ e(gs, { children: /* @__PURE__ */ e(X, { icon: /* @__PURE__ */ e(us, {}), size: "md", "aria-label": "More options" }) }),
|
|
2758
|
+
/* @__PURE__ */ e(ws, { className: "w-auto p-0", children: /* @__PURE__ */ e(
|
|
2759
|
+
Vt,
|
|
2760
|
+
{
|
|
2761
|
+
selectedLeave: x,
|
|
2762
|
+
existingBreaks: a,
|
|
2763
|
+
onFetchMonthBreaks: d,
|
|
2764
|
+
onSave: m,
|
|
2765
|
+
onDelete: p
|
|
2766
|
+
}
|
|
2767
|
+
) })
|
|
2768
|
+
] }) })
|
|
2769
|
+
]
|
|
2770
|
+
},
|
|
2771
|
+
x.id
|
|
2772
|
+
);
|
|
2773
|
+
}) })
|
|
2774
|
+
] });
|
|
2775
|
+
}
|
|
2776
|
+
);
|
|
2777
|
+
Jt.displayName = "Breaks";
|
|
2778
|
+
const pt = [
|
|
2779
|
+
{ id: 1, name: "January" },
|
|
2780
|
+
{ id: 2, name: "February" },
|
|
2781
|
+
{ id: 3, name: "March" },
|
|
2782
|
+
{ id: 4, name: "April" },
|
|
2783
|
+
{ id: 5, name: "May" },
|
|
2784
|
+
{ id: 6, name: "June" },
|
|
2785
|
+
{ id: 7, name: "July" },
|
|
2786
|
+
{ id: 8, name: "August" },
|
|
2787
|
+
{ id: 9, name: "September" },
|
|
2788
|
+
{ id: 10, name: "October" },
|
|
2789
|
+
{ id: 11, name: "November" },
|
|
2790
|
+
{ id: 12, name: "December" }
|
|
2791
|
+
], Gt = O.forwardRef(
|
|
2792
|
+
function({
|
|
2793
|
+
filters: t,
|
|
2794
|
+
onFilterChange: n,
|
|
2795
|
+
breakBalance: a,
|
|
2796
|
+
userImages: d,
|
|
2797
|
+
users: m
|
|
2798
|
+
}, p) {
|
|
2799
|
+
const r = (f) => {
|
|
2800
|
+
n(f(t));
|
|
2801
|
+
}, o = () => {
|
|
2802
|
+
r((f) => ({
|
|
2803
|
+
...f,
|
|
2804
|
+
currMonth: f.currMonth === 0 ? 11 : f.currMonth - 1
|
|
2805
|
+
}));
|
|
2806
|
+
}, x = () => {
|
|
2807
|
+
r((f) => ({
|
|
2808
|
+
...f,
|
|
2809
|
+
currMonth: f.currMonth === 11 ? 0 : f.currMonth + 1
|
|
2810
|
+
}));
|
|
2811
|
+
}, u = () => {
|
|
2812
|
+
r((f) => ({
|
|
2813
|
+
...f,
|
|
2814
|
+
dateFilterStart: new Date(f.currYear, f.currMonth, 1),
|
|
2815
|
+
dateFilterEnd: new Date(f.currYear, f.currMonth + 1, 0),
|
|
2816
|
+
isOpen: !1
|
|
2817
|
+
}));
|
|
2818
|
+
};
|
|
2819
|
+
return /* @__PURE__ */ s("div", { ref: p, className: "flex min-w-[800px] items-center justify-between bg-field px-ds-06 py-ds-05b max-md:justify-start max-md:gap-ds-05b max-lg:min-w-[100%]", children: [
|
|
2820
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col gap-ds-05", children: t.selectedAssociate && /* @__PURE__ */ s(V, { children: [
|
|
2821
|
+
/* @__PURE__ */ e("p", { className: "text-ds-sm font-semibold uppercase tracking-wider text-text-tertiary", children: "Break Balance" }),
|
|
2822
|
+
/* @__PURE__ */ s("div", { className: "flex items-end", children: [
|
|
2823
|
+
/* @__PURE__ */ e("p", { className: "text-ds-5xl font-semibold mr-ds-02 text-interactive", children: (a == null ? void 0 : a.remainingDays) || 0 }),
|
|
2824
|
+
/* @__PURE__ */ s("p", { className: "text-ds-2xl translate-y-[-5px] text-text-placeholder", children: [
|
|
2825
|
+
"/ ",
|
|
2826
|
+
(a == null ? void 0 : a.breakBalance) || 0
|
|
2827
|
+
] })
|
|
2828
|
+
] })
|
|
2829
|
+
] }) }),
|
|
2830
|
+
/* @__PURE__ */ s("header", { className: "flex items-center gap-ds-04", children: [
|
|
2831
|
+
t.selectedAssociate ? /* @__PURE__ */ s("div", { className: "text-ds-md flex flex-row items-center justify-start gap-ds-02 rounded-ds-md bg-interactive p-ds-02b text-text-on-color", children: [
|
|
2832
|
+
/* @__PURE__ */ s("div", { className: "flex items-center justify-start gap-ds-01", children: [
|
|
2833
|
+
d[t.selectedAssociate.id] ? /* @__PURE__ */ e(
|
|
2834
|
+
"img",
|
|
2835
|
+
{
|
|
2836
|
+
src: d[t.selectedAssociate.id],
|
|
2837
|
+
alt: `${t.selectedAssociate.name}'s avatar`,
|
|
2838
|
+
className: "h-ico-md w-ico-md rounded-ds-full"
|
|
2839
|
+
}
|
|
2840
|
+
) : /* @__PURE__ */ e("div", { className: "flex h-ico-md w-ico-md items-center justify-center rounded-ds-full bg-layer-02", children: /* @__PURE__ */ e("span", { className: "text-interactive", children: t.selectedAssociate.name.charAt(0) }) }),
|
|
2841
|
+
/* @__PURE__ */ e("span", { className: "text-ds-md mx-ds-01 text-text-on-color", children: t.selectedAssociate.name })
|
|
2842
|
+
] }),
|
|
2843
|
+
/* @__PURE__ */ e(
|
|
2844
|
+
"button",
|
|
2845
|
+
{
|
|
2846
|
+
"aria-label": "Clear filter",
|
|
2847
|
+
onClick: () => r((f) => ({
|
|
2848
|
+
...f,
|
|
2849
|
+
selectedAssociate: null
|
|
2850
|
+
})),
|
|
2851
|
+
className: "border-0 p-0",
|
|
2852
|
+
children: /* @__PURE__ */ e(oe, { className: "h-ico-sm w-ico-sm text-text-on-color" })
|
|
2853
|
+
}
|
|
2854
|
+
)
|
|
2855
|
+
] }) : /* @__PURE__ */ s(he, { children: [
|
|
2856
|
+
/* @__PURE__ */ s(be, { className: "text-ds-md flex flex-row items-center justify-between rounded-ds-md border border-border-subtle bg-layer-01 px-ds-03 py-ds-02b", children: [
|
|
2857
|
+
/* @__PURE__ */ s("div", { className: "flex items-center", children: [
|
|
2858
|
+
/* @__PURE__ */ e(vt, { className: "h-ico-sm w-ico-sm" }),
|
|
2859
|
+
/* @__PURE__ */ e("span", { className: "text-ds-md mx-ds-03 text-text-secondary max-lg:mx-0 max-lg:text-ds-sm", children: "Associate" })
|
|
2860
|
+
] }),
|
|
2861
|
+
/* @__PURE__ */ e(ie, { className: "h-ico-sm w-ico-sm" })
|
|
2862
|
+
] }),
|
|
2863
|
+
/* @__PURE__ */ e(ke, { className: "custom-scrollbar max-h-[400px] w-64 overflow-y-auto p-ds-03", children: (m == null ? void 0 : m.length) === 0 ? /* @__PURE__ */ e(pe, { disabled: !0, children: "No users available" }) : m == null ? void 0 : m.map((f) => /* @__PURE__ */ e(ht, { children: /* @__PURE__ */ s(
|
|
2864
|
+
pe,
|
|
2865
|
+
{
|
|
2866
|
+
onSelect: () => r((y) => ({
|
|
2867
|
+
...y,
|
|
2868
|
+
selectedAssociate: f
|
|
2869
|
+
})),
|
|
2870
|
+
className: "flex items-center gap-ds-03 p-ds-03",
|
|
2871
|
+
children: [
|
|
2872
|
+
d[f.id] ? /* @__PURE__ */ e(
|
|
2873
|
+
"img",
|
|
2874
|
+
{
|
|
2875
|
+
src: d[f.id],
|
|
2876
|
+
alt: `${f.name}'s avatar`,
|
|
2877
|
+
className: "h-ds-xs w-ds-xs rounded-ds-full"
|
|
2878
|
+
}
|
|
2879
|
+
) : /* @__PURE__ */ e("div", { className: "flex h-ds-xs w-ds-xs items-center justify-center rounded-ds-full bg-layer-03", children: /* @__PURE__ */ e("span", { className: "text-ds-md text-interactive", children: f.name.charAt(0) }) }),
|
|
2880
|
+
/* @__PURE__ */ e("span", { className: "text-ds-md text-text-secondary", children: f.name })
|
|
2881
|
+
]
|
|
2882
|
+
},
|
|
2883
|
+
f.id
|
|
2884
|
+
) }, f.id)) })
|
|
2885
|
+
] }),
|
|
2886
|
+
t.dateFilterEnd && /* @__PURE__ */ s("div", { className: "text-ds-md flex items-center justify-between rounded-ds-md bg-interactive px-ds-03 py-ds-02b text-text-on-color", children: [
|
|
2887
|
+
/* @__PURE__ */ s("div", { className: "flex items-center", children: [
|
|
2888
|
+
/* @__PURE__ */ e(xs, {}),
|
|
2889
|
+
/* @__PURE__ */ s("span", { className: "ml-ds-01 mr-ds-02", children: [
|
|
2890
|
+
pt[new Date(t.dateFilterStart).getMonth()].name,
|
|
2891
|
+
","
|
|
2892
|
+
] }),
|
|
2893
|
+
/* @__PURE__ */ e("span", { className: "mr-ds-02", children: new Date(t.dateFilterStart).getFullYear() })
|
|
2894
|
+
] }),
|
|
2895
|
+
/* @__PURE__ */ e(
|
|
2896
|
+
"button",
|
|
2897
|
+
{
|
|
2898
|
+
"aria-label": "Clear filter",
|
|
2899
|
+
onClick: () => {
|
|
2900
|
+
r((f) => ({
|
|
2901
|
+
...f,
|
|
2902
|
+
dateFilterStart: null,
|
|
2903
|
+
dateFilterEnd: null
|
|
2904
|
+
}));
|
|
2905
|
+
},
|
|
2906
|
+
className: "border-0 bg-transparent p-0",
|
|
2907
|
+
children: /* @__PURE__ */ e(oe, { className: "h-ico-sm w-ico-sm" })
|
|
2908
|
+
}
|
|
2909
|
+
)
|
|
2910
|
+
] }),
|
|
2911
|
+
/* @__PURE__ */ s(
|
|
2912
|
+
he,
|
|
2913
|
+
{
|
|
2914
|
+
open: t.isOpen,
|
|
2915
|
+
onOpenChange: (f) => {
|
|
2916
|
+
r((y) => ({ ...y, isOpen: f }));
|
|
2917
|
+
},
|
|
2918
|
+
children: [
|
|
2919
|
+
/* @__PURE__ */ s(be, { className: "text-ds-md flex items-center justify-between rounded-ds-md border border-border-subtle bg-layer-01 p-ds-02b", children: [
|
|
2920
|
+
/* @__PURE__ */ s("div", { className: "flex items-center", children: [
|
|
2921
|
+
/* @__PURE__ */ e(fs, {}),
|
|
2922
|
+
/* @__PURE__ */ e("span", { className: "mx-ds-03 text-text-secondary", children: "Date" })
|
|
2923
|
+
] }),
|
|
2924
|
+
/* @__PURE__ */ e(ie, { className: "h-ico-sm w-ico-sm" })
|
|
2925
|
+
] }),
|
|
2926
|
+
/* @__PURE__ */ e(ke, { className: "mr-32 p-ds-04", children: /* @__PURE__ */ s("div", { className: "flex w-[140px] flex-col items-center justify-start", children: [
|
|
2927
|
+
/* @__PURE__ */ s("div", { className: "flex w-full items-center justify-between", children: [
|
|
2928
|
+
/* @__PURE__ */ e(
|
|
2929
|
+
X,
|
|
2930
|
+
{
|
|
2931
|
+
size: "sm",
|
|
2932
|
+
icon: /* @__PURE__ */ e(ye, {}),
|
|
2933
|
+
"aria-label": "Previous month",
|
|
2934
|
+
onClick: o
|
|
2935
|
+
}
|
|
2936
|
+
),
|
|
2937
|
+
/* @__PURE__ */ e("span", { className: "text-ds-md text-text-secondary", children: pt[t.currMonth].name }),
|
|
2938
|
+
/* @__PURE__ */ e(
|
|
2939
|
+
X,
|
|
2940
|
+
{
|
|
2941
|
+
size: "sm",
|
|
2942
|
+
icon: /* @__PURE__ */ e(ge, {}),
|
|
2943
|
+
"aria-label": "Next month",
|
|
2944
|
+
onClick: x
|
|
2945
|
+
}
|
|
2946
|
+
)
|
|
2947
|
+
] }),
|
|
2948
|
+
/* @__PURE__ */ s("div", { className: "mt-ds-04 flex w-full items-center justify-between", children: [
|
|
2949
|
+
/* @__PURE__ */ e(
|
|
2950
|
+
X,
|
|
2951
|
+
{
|
|
2952
|
+
size: "sm",
|
|
2953
|
+
icon: /* @__PURE__ */ e(ye, {}),
|
|
2954
|
+
"aria-label": "Previous year",
|
|
2955
|
+
onClick: () => {
|
|
2956
|
+
r((f) => ({
|
|
2957
|
+
...f,
|
|
2958
|
+
currYear: f.currYear - 1
|
|
2959
|
+
}));
|
|
2960
|
+
}
|
|
2961
|
+
}
|
|
2962
|
+
),
|
|
2963
|
+
/* @__PURE__ */ e("span", { className: "text-ds-md text-text-secondary", children: t.currYear }),
|
|
2964
|
+
/* @__PURE__ */ e(
|
|
2965
|
+
X,
|
|
2966
|
+
{
|
|
2967
|
+
size: "sm",
|
|
2968
|
+
icon: /* @__PURE__ */ e(ge, {}),
|
|
2969
|
+
"aria-label": "Next year",
|
|
2970
|
+
onClick: () => {
|
|
2971
|
+
r((f) => ({
|
|
2972
|
+
...f,
|
|
2973
|
+
currYear: f.currYear + 1
|
|
2974
|
+
}));
|
|
2975
|
+
}
|
|
2976
|
+
}
|
|
2977
|
+
)
|
|
2978
|
+
] }),
|
|
2979
|
+
/* @__PURE__ */ e(
|
|
2980
|
+
J,
|
|
2981
|
+
{
|
|
2982
|
+
className: "mt-ds-05",
|
|
2983
|
+
variant: "outline",
|
|
2984
|
+
fullWidth: !0,
|
|
2985
|
+
onClick: u,
|
|
2986
|
+
children: "Filter"
|
|
2987
|
+
}
|
|
2988
|
+
)
|
|
2989
|
+
] }) })
|
|
2990
|
+
]
|
|
2991
|
+
}
|
|
2992
|
+
)
|
|
2993
|
+
] })
|
|
2994
|
+
] });
|
|
2995
|
+
}
|
|
2996
|
+
);
|
|
2997
|
+
Gt.displayName = "BreakAdminHeader";
|
|
2998
|
+
const Zt = O.forwardRef(
|
|
2999
|
+
function(t, n) {
|
|
3000
|
+
return /* @__PURE__ */ s("div", { ref: n, className: "z-base h-fit w-full max-w-layout-body overflow-hidden border-[1px] border-border-subtle bg-field sm:rounded-ds-lg", children: [
|
|
3001
|
+
/* @__PURE__ */ e("div", { className: "flex items-center justify-end bg-field px-ds-06 py-ds-05b", children: /* @__PURE__ */ e("header", { className: "flex items-center", children: /* @__PURE__ */ s("div", { className: "flex items-center gap-ds-04", children: [
|
|
3002
|
+
/* @__PURE__ */ e(R, { className: "h-ds-sm-plus w-32 rounded-ds-md" }),
|
|
3003
|
+
/* @__PURE__ */ e(R, { className: "h-ds-sm-plus w-32 rounded-ds-md" })
|
|
3004
|
+
] }) }) }),
|
|
3005
|
+
/* @__PURE__ */ s("div", { className: "flex h-fit flex-col border-t-[1px] border-border-subtle bg-layer-02 shadow-transparent", children: [
|
|
3006
|
+
/* @__PURE__ */ s("div", { className: "flex w-full gap-ds-03 border-b-[1px] border-border px-ds-06 pt-ds-03", children: [
|
|
3007
|
+
/* @__PURE__ */ e(R, { className: "h-ds-md w-20" }),
|
|
3008
|
+
/* @__PURE__ */ e(R, { className: "h-ds-md w-24" }),
|
|
3009
|
+
/* @__PURE__ */ e(R, { className: "h-ds-md w-24" })
|
|
3010
|
+
] }),
|
|
3011
|
+
/* @__PURE__ */ s("div", { className: "h-[400px] border-0 px-ds-06 py-ds-05", children: [
|
|
3012
|
+
/* @__PURE__ */ s("div", { className: "mb-ds-05 ml-ds-06 grid grid-cols-6 items-center gap-ds-05 py-ds-03", children: [
|
|
3013
|
+
/* @__PURE__ */ e(R, { className: "h-5 w-full bg-field" }),
|
|
3014
|
+
/* @__PURE__ */ e(R, { className: "h-5 w-full bg-field" }),
|
|
3015
|
+
/* @__PURE__ */ e(R, { className: "h-5 w-full bg-field" }),
|
|
3016
|
+
/* @__PURE__ */ e(R, { className: "h-5 w-full bg-field" }),
|
|
3017
|
+
/* @__PURE__ */ e(R, { className: "h-5 w-full bg-field" }),
|
|
3018
|
+
/* @__PURE__ */ e(R, { className: "h-5 w-full bg-field" })
|
|
3019
|
+
] }),
|
|
3020
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col gap-ds-05", children: Array.from({ length: 5 }).map((a, d) => /* @__PURE__ */ s(
|
|
3021
|
+
"div",
|
|
3022
|
+
{
|
|
3023
|
+
className: "ml-ds-06 grid grid-cols-6 items-center gap-ds-05 rounded-ds-lg py-ds-03",
|
|
3024
|
+
children: [
|
|
3025
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-ds-03", children: [
|
|
3026
|
+
/* @__PURE__ */ e(R, { className: "h-ds-sm w-ds-sm rounded-ds-full bg-field" }),
|
|
3027
|
+
/* @__PURE__ */ e(R, { className: "h-5 w-24 bg-field" })
|
|
3028
|
+
] }),
|
|
3029
|
+
/* @__PURE__ */ e(R, { className: "h-5 w-full bg-field" }),
|
|
3030
|
+
/* @__PURE__ */ e(R, { className: "h-5 w-16 bg-field" }),
|
|
3031
|
+
/* @__PURE__ */ e(R, { className: "h-5 w-full bg-field" }),
|
|
3032
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-ds-03", children: [
|
|
3033
|
+
/* @__PURE__ */ e(R, { className: "h-ds-xs w-ds-xs rounded-ds-full bg-field" }),
|
|
3034
|
+
/* @__PURE__ */ e(R, { className: "h-5 w-16 bg-field" })
|
|
3035
|
+
] }),
|
|
3036
|
+
/* @__PURE__ */ s("div", { className: "flex items-center justify-end gap-ds-03", children: [
|
|
3037
|
+
/* @__PURE__ */ e(R, { className: "h-ds-sm w-ds-sm rounded-ds-full bg-field" }),
|
|
3038
|
+
/* @__PURE__ */ e(R, { className: "h-ds-sm w-ds-sm rounded-ds-full bg-field" })
|
|
3039
|
+
] })
|
|
3040
|
+
]
|
|
3041
|
+
},
|
|
3042
|
+
d
|
|
3043
|
+
)) })
|
|
3044
|
+
] })
|
|
3045
|
+
] })
|
|
3046
|
+
] });
|
|
3047
|
+
}
|
|
3048
|
+
);
|
|
3049
|
+
Zt.displayName = "BreakAdminSkeleton";
|
|
3050
|
+
const Xt = bt(null);
|
|
3051
|
+
function Te() {
|
|
3052
|
+
const l = yt(Xt);
|
|
3053
|
+
if (!l)
|
|
3054
|
+
throw new Error(
|
|
3055
|
+
"BreakAdmin compound components must be used within <BreakAdmin>"
|
|
3056
|
+
);
|
|
3057
|
+
return l;
|
|
3058
|
+
}
|
|
3059
|
+
const We = O.forwardRef(
|
|
3060
|
+
function({
|
|
3061
|
+
currentUser: t,
|
|
3062
|
+
breaks: n,
|
|
3063
|
+
pendingRequests: a,
|
|
3064
|
+
cashoutRequests: d = [],
|
|
3065
|
+
breakBalanceData: m,
|
|
3066
|
+
breakBalance: p,
|
|
3067
|
+
userImages: r,
|
|
3068
|
+
users: o,
|
|
3069
|
+
isLoading: x = !1,
|
|
3070
|
+
isLoadingBreaks: u = !1,
|
|
3071
|
+
isLoadingRequests: f = !1,
|
|
3072
|
+
isLoadingBalance: y = !1,
|
|
3073
|
+
existingBreaks: i,
|
|
3074
|
+
filters: h,
|
|
3075
|
+
onFilterChange: c,
|
|
3076
|
+
onApproveRequest: w,
|
|
3077
|
+
onRejectRequest: g,
|
|
3078
|
+
onApproveCashout: T,
|
|
3079
|
+
onRejectCashout: E,
|
|
3080
|
+
onRefresh: v,
|
|
3081
|
+
onSaveBreak: k,
|
|
3082
|
+
onDeleteBreak: D,
|
|
3083
|
+
onSaveBalance: P,
|
|
3084
|
+
onFetchMonthBreaks: Y,
|
|
3085
|
+
realtimeCallbacks: C,
|
|
3086
|
+
children: B
|
|
3087
|
+
}, I) {
|
|
3088
|
+
const [F, b] = M("breaks"), [N, _] = M(!1), [j, L] = M(
|
|
3089
|
+
null
|
|
3090
|
+
), [ee, te] = M(null), { toast: z } = je(), se = Ye(
|
|
3091
|
+
() => ({
|
|
3092
|
+
selectedAssociate: null,
|
|
3093
|
+
dateFilterStart: null,
|
|
3094
|
+
dateFilterEnd: null,
|
|
3095
|
+
currMonth: (/* @__PURE__ */ new Date()).getMonth(),
|
|
3096
|
+
currYear: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
3097
|
+
isOpen: !1
|
|
3098
|
+
}),
|
|
3099
|
+
[]
|
|
3100
|
+
), K = h || se, G = $(
|
|
3101
|
+
(W) => {
|
|
3102
|
+
c && c(W);
|
|
3103
|
+
},
|
|
3104
|
+
[c]
|
|
3105
|
+
), at = $(
|
|
3106
|
+
async (W, ne, De) => {
|
|
3107
|
+
if (!N) {
|
|
3108
|
+
if (!De && ((W == null ? void 0 : W.metaKey) || (W == null ? void 0 : W.ctrlKey))) {
|
|
3109
|
+
L(ne);
|
|
3110
|
+
return;
|
|
3111
|
+
}
|
|
3112
|
+
try {
|
|
3113
|
+
_(!0);
|
|
3114
|
+
const H = a.find((Fe) => Fe.id === ne);
|
|
3115
|
+
if (!H)
|
|
3116
|
+
throw new Error("Request not found");
|
|
3117
|
+
w && w(ne, De, H.correction, H), z({
|
|
3118
|
+
description: /* @__PURE__ */ s(V, { children: [
|
|
3119
|
+
/* @__PURE__ */ s("span", { children: [
|
|
3120
|
+
H.correction ? "Attendance correction" : "Break request",
|
|
3121
|
+
" "
|
|
3122
|
+
] }),
|
|
3123
|
+
/* @__PURE__ */ e("span", { className: "text-success-text", children: "approved successfully" })
|
|
3124
|
+
] }),
|
|
3125
|
+
color: "neutral",
|
|
3126
|
+
style: { marginBottom: "var(--spacing-04)", border: "none" }
|
|
3127
|
+
});
|
|
3128
|
+
} catch (H) {
|
|
3129
|
+
console.error("Error approving request:", H), z({
|
|
3130
|
+
title: "Error",
|
|
3131
|
+
description: H instanceof Error ? H.message : "Failed to approve request",
|
|
3132
|
+
color: "error"
|
|
3133
|
+
});
|
|
3134
|
+
} finally {
|
|
3135
|
+
_(!1);
|
|
3136
|
+
}
|
|
3137
|
+
}
|
|
3138
|
+
},
|
|
3139
|
+
[N, a, w, z]
|
|
3140
|
+
), rt = $(
|
|
3141
|
+
async (W, ne, De) => {
|
|
3142
|
+
if (!N) {
|
|
3143
|
+
if (!De && ((W == null ? void 0 : W.metaKey) || (W == null ? void 0 : W.ctrlKey))) {
|
|
3144
|
+
te(ne);
|
|
3145
|
+
return;
|
|
3146
|
+
}
|
|
3147
|
+
try {
|
|
3148
|
+
_(!0);
|
|
3149
|
+
const H = a.find((Fe) => Fe.id === ne);
|
|
3150
|
+
if (!H)
|
|
3151
|
+
throw new Error("Request not found");
|
|
3152
|
+
g && g(ne, De, H.correction, H), z({
|
|
3153
|
+
description: /* @__PURE__ */ s(V, { children: [
|
|
3154
|
+
/* @__PURE__ */ s("span", { children: [
|
|
3155
|
+
H.correction ? "Attendance correction" : "Break request",
|
|
3156
|
+
" "
|
|
3157
|
+
] }),
|
|
3158
|
+
/* @__PURE__ */ e("span", { className: "text-error-text", children: "rejected" })
|
|
3159
|
+
] }),
|
|
3160
|
+
color: "neutral",
|
|
3161
|
+
style: { marginBottom: "var(--spacing-04)", border: "none" }
|
|
3162
|
+
});
|
|
3163
|
+
} catch (H) {
|
|
3164
|
+
console.error("Error rejecting request:", H), z({
|
|
3165
|
+
title: "Error",
|
|
3166
|
+
description: H instanceof Error ? H.message : "Failed to reject request",
|
|
3167
|
+
color: "error"
|
|
3168
|
+
});
|
|
3169
|
+
} finally {
|
|
3170
|
+
_(!1);
|
|
3171
|
+
}
|
|
3172
|
+
}
|
|
3173
|
+
},
|
|
3174
|
+
[N, a, g, z]
|
|
3175
|
+
), Qt = Ye(
|
|
3176
|
+
() => ({
|
|
3177
|
+
currentUser: t,
|
|
3178
|
+
activeTab: F,
|
|
3179
|
+
setActiveTab: b,
|
|
3180
|
+
isProcessing: N,
|
|
3181
|
+
breaks: n,
|
|
3182
|
+
pendingRequests: a,
|
|
3183
|
+
cashoutRequests: d,
|
|
3184
|
+
breakBalanceData: m,
|
|
3185
|
+
breakBalance: p,
|
|
3186
|
+
userImages: r,
|
|
3187
|
+
users: o,
|
|
3188
|
+
existingBreaks: i,
|
|
3189
|
+
filters: K,
|
|
3190
|
+
handleFilterChange: G,
|
|
3191
|
+
handleApproveRequest: at,
|
|
3192
|
+
handleRejectRequest: rt,
|
|
3193
|
+
acceptedCommentBox: j,
|
|
3194
|
+
rejectedCommentBox: ee,
|
|
3195
|
+
setAcceptedCommentBox: L,
|
|
3196
|
+
setRejectedCommentBox: te,
|
|
3197
|
+
onRefresh: v,
|
|
3198
|
+
onSaveBreak: k,
|
|
3199
|
+
onDeleteBreak: D,
|
|
3200
|
+
onSaveBalance: P,
|
|
3201
|
+
onFetchMonthBreaks: Y
|
|
3202
|
+
}),
|
|
3203
|
+
[
|
|
3204
|
+
t,
|
|
3205
|
+
F,
|
|
3206
|
+
b,
|
|
3207
|
+
N,
|
|
3208
|
+
n,
|
|
3209
|
+
a,
|
|
3210
|
+
d,
|
|
3211
|
+
m,
|
|
3212
|
+
p,
|
|
3213
|
+
r,
|
|
3214
|
+
o,
|
|
3215
|
+
i,
|
|
3216
|
+
K,
|
|
3217
|
+
G,
|
|
3218
|
+
at,
|
|
3219
|
+
rt,
|
|
3220
|
+
j,
|
|
3221
|
+
ee,
|
|
3222
|
+
L,
|
|
3223
|
+
te,
|
|
3224
|
+
v,
|
|
3225
|
+
k,
|
|
3226
|
+
D,
|
|
3227
|
+
P,
|
|
3228
|
+
Y
|
|
3229
|
+
]
|
|
3230
|
+
);
|
|
3231
|
+
return x ? /* @__PURE__ */ e(Zt, {}) : /* @__PURE__ */ e(Xt.Provider, { value: Qt, children: /* @__PURE__ */ e(
|
|
3232
|
+
"div",
|
|
3233
|
+
{
|
|
3234
|
+
ref: I,
|
|
3235
|
+
className: "z-base flex w-full max-w-layout flex-col items-center justify-center md:pt-0",
|
|
3236
|
+
children: /* @__PURE__ */ e("div", { className: "no-scrollbar w-full overflow-auto border border-border-subtle sm:rounded-ds-lg max-md:rounded-ds-none max-md:border-0", children: B ?? /* @__PURE__ */ s(V, { children: [
|
|
3237
|
+
/* @__PURE__ */ e(qe, {}),
|
|
3238
|
+
/* @__PURE__ */ s("div", { className: "no-scrollbar flex h-fit min-w-[800px] flex-col border-t-[1px] border-border-subtle bg-layer-02 shadow-transparent max-lg:min-w-[100%] max-lg:overflow-x-auto", children: [
|
|
3239
|
+
/* @__PURE__ */ e(Ue, {}),
|
|
3240
|
+
/* @__PURE__ */ s("div", { className: "w-full border-0 max-lg:min-w-[800px]", children: [
|
|
3241
|
+
/* @__PURE__ */ e(et, {}),
|
|
3242
|
+
/* @__PURE__ */ e(tt, {}),
|
|
3243
|
+
/* @__PURE__ */ e(st, {})
|
|
3244
|
+
] })
|
|
3245
|
+
] })
|
|
3246
|
+
] }) })
|
|
3247
|
+
}
|
|
3248
|
+
) });
|
|
3249
|
+
}
|
|
3250
|
+
);
|
|
3251
|
+
We.displayName = "BreakAdmin";
|
|
3252
|
+
const qe = O.forwardRef(function({ className: t, ...n }, a) {
|
|
3253
|
+
const {
|
|
3254
|
+
filters: d,
|
|
3255
|
+
handleFilterChange: m,
|
|
3256
|
+
breakBalance: p,
|
|
3257
|
+
userImages: r,
|
|
3258
|
+
users: o
|
|
3259
|
+
} = Te();
|
|
3260
|
+
return /* @__PURE__ */ e("div", { ref: a, className: S(t), ...n, children: /* @__PURE__ */ e(
|
|
3261
|
+
Gt,
|
|
3262
|
+
{
|
|
3263
|
+
filters: d,
|
|
3264
|
+
onFilterChange: m,
|
|
3265
|
+
breakBalance: p,
|
|
3266
|
+
userImages: r,
|
|
3267
|
+
users: o
|
|
3268
|
+
}
|
|
3269
|
+
) });
|
|
3270
|
+
});
|
|
3271
|
+
qe.displayName = "BreakAdmin.Header";
|
|
3272
|
+
const Ue = O.forwardRef(function({ className: t, ...n }, a) {
|
|
3273
|
+
const { activeTab: d, setActiveTab: m, pendingRequests: p, breakBalanceData: r } = Te();
|
|
3274
|
+
return /* @__PURE__ */ s(
|
|
3275
|
+
"div",
|
|
3276
|
+
{
|
|
3277
|
+
ref: a,
|
|
3278
|
+
className: S(
|
|
3279
|
+
"flex w-full gap-ds-03 border-b-[1px] border-border px-ds-06 pt-ds-03 max-lg:min-w-[800px]",
|
|
3280
|
+
t
|
|
3281
|
+
),
|
|
3282
|
+
...n,
|
|
3283
|
+
children: [
|
|
3284
|
+
/* @__PURE__ */ e(
|
|
3285
|
+
"button",
|
|
3286
|
+
{
|
|
3287
|
+
className: S("text-ds-sm font-semibold uppercase tracking-wider mb-[-1px] px-ds-03 py-ds-04", d === "breaks" ? "text-text-primary border-b-[1px] border-interactive-hover" : "text-text-tertiary"),
|
|
3288
|
+
onClick: () => m("breaks"),
|
|
3289
|
+
children: "BREAKS"
|
|
3290
|
+
}
|
|
3291
|
+
),
|
|
3292
|
+
/* @__PURE__ */ s(
|
|
3293
|
+
"button",
|
|
3294
|
+
{
|
|
3295
|
+
className: S("text-ds-sm font-semibold uppercase tracking-wider mb-[-1px] flex items-center gap-ds-02 px-ds-03 py-ds-04", d === "requests" ? "border-b-[1px] border-interactive-hover text-text-primary" : "text-text-tertiary"),
|
|
3296
|
+
onClick: () => m("requests"),
|
|
3297
|
+
children: [
|
|
3298
|
+
"REQUESTS",
|
|
3299
|
+
" ",
|
|
3300
|
+
/* @__PURE__ */ e("span", { className: "text-interactive-hover", children: `(${p.length})` })
|
|
3301
|
+
]
|
|
3302
|
+
}
|
|
3303
|
+
),
|
|
3304
|
+
/* @__PURE__ */ s(
|
|
3305
|
+
"button",
|
|
3306
|
+
{
|
|
3307
|
+
className: S("text-ds-sm font-semibold uppercase tracking-wider mb-[-1px] flex items-center gap-ds-02 px-ds-03 py-ds-04", d === "balance" ? "border-b-[1px] border-interactive-hover text-text-primary" : "text-text-tertiary"),
|
|
3308
|
+
onClick: () => m("balance"),
|
|
3309
|
+
children: [
|
|
3310
|
+
"BALANCE",
|
|
3311
|
+
" ",
|
|
3312
|
+
/* @__PURE__ */ e("span", { className: "text-interactive-hover", children: `(${r.length})` })
|
|
3313
|
+
]
|
|
3314
|
+
}
|
|
3315
|
+
)
|
|
3316
|
+
]
|
|
3317
|
+
}
|
|
3318
|
+
);
|
|
3319
|
+
});
|
|
3320
|
+
Ue.displayName = "BreakAdmin.TabBar";
|
|
3321
|
+
const et = O.forwardRef(function({ className: t, ...n }, a) {
|
|
3322
|
+
const {
|
|
3323
|
+
activeTab: d,
|
|
3324
|
+
breaks: m,
|
|
3325
|
+
userImages: p,
|
|
3326
|
+
existingBreaks: r,
|
|
3327
|
+
onFetchMonthBreaks: o,
|
|
3328
|
+
onSaveBreak: x,
|
|
3329
|
+
onDeleteBreak: u,
|
|
3330
|
+
onRefresh: f
|
|
3331
|
+
} = Te();
|
|
3332
|
+
return d !== "breaks" ? null : /* @__PURE__ */ e("div", { ref: a, className: S(t), ...n, children: /* @__PURE__ */ e(
|
|
3333
|
+
Jt,
|
|
3334
|
+
{
|
|
3335
|
+
breaks: m,
|
|
3336
|
+
userImages: p,
|
|
3337
|
+
existingBreaks: r,
|
|
3338
|
+
onFetchMonthBreaks: o,
|
|
3339
|
+
onSave: x,
|
|
3340
|
+
onDelete: u,
|
|
3341
|
+
onRefresh: f
|
|
3342
|
+
}
|
|
3343
|
+
) });
|
|
3344
|
+
});
|
|
3345
|
+
et.displayName = "BreakAdmin.BreaksPanel";
|
|
3346
|
+
const tt = O.forwardRef(function({ className: t, ...n }, a) {
|
|
3347
|
+
const {
|
|
3348
|
+
activeTab: d,
|
|
3349
|
+
currentUser: m,
|
|
3350
|
+
pendingRequests: p,
|
|
3351
|
+
userImages: r,
|
|
3352
|
+
handleApproveRequest: o,
|
|
3353
|
+
handleRejectRequest: x,
|
|
3354
|
+
acceptedCommentBox: u,
|
|
3355
|
+
rejectedCommentBox: f,
|
|
3356
|
+
setAcceptedCommentBox: y,
|
|
3357
|
+
setRejectedCommentBox: i
|
|
3358
|
+
} = Te();
|
|
3359
|
+
return d !== "requests" ? null : /* @__PURE__ */ e(
|
|
3360
|
+
"div",
|
|
3361
|
+
{
|
|
3362
|
+
ref: a,
|
|
3363
|
+
className: S(
|
|
3364
|
+
/* intentional: h-[400px] is the fixed panel height for break tab content areas; mobile uses dvh for browser chrome */
|
|
3365
|
+
"no-scrollbar flex h-[400px] flex-col gap-ds-02 overflow-y-auto border-t border-t-border px-ds-06 pb-ds-02 pt-ds-02 max-md:h-[calc(100dvh-317px)] max-md:border-0",
|
|
3366
|
+
t
|
|
3367
|
+
),
|
|
3368
|
+
...n,
|
|
3369
|
+
children: p.map((h) => /* @__PURE__ */ e(
|
|
3370
|
+
zt,
|
|
3371
|
+
{
|
|
3372
|
+
request: h,
|
|
3373
|
+
userImages: r,
|
|
3374
|
+
handleRejectRequest: x,
|
|
3375
|
+
handleApproveRequest: o,
|
|
3376
|
+
commentBoxOpen: u === h.id || f === h.id,
|
|
3377
|
+
onCommentBoxClose: () => {
|
|
3378
|
+
y(null), i(null);
|
|
3379
|
+
},
|
|
3380
|
+
clickedAction: u === h.id ? "approve" : f === h.id ? "reject" : null,
|
|
3381
|
+
userId: m.id
|
|
3382
|
+
},
|
|
3383
|
+
h.id
|
|
3384
|
+
))
|
|
3385
|
+
}
|
|
3386
|
+
);
|
|
3387
|
+
});
|
|
3388
|
+
tt.displayName = "BreakAdmin.RequestsPanel";
|
|
3389
|
+
const st = O.forwardRef(function({ className: t, ...n }, a) {
|
|
3390
|
+
const { activeTab: d, breakBalanceData: m, userImages: p, onSaveBalance: r } = Te();
|
|
3391
|
+
return d !== "balance" ? null : /* @__PURE__ */ e("div", { ref: a, className: S(t), ...n, children: /* @__PURE__ */ e(
|
|
3392
|
+
$t,
|
|
3393
|
+
{
|
|
3394
|
+
breakBalanceData: m,
|
|
3395
|
+
userImages: p,
|
|
3396
|
+
onSaveBalance: r
|
|
3397
|
+
}
|
|
3398
|
+
) });
|
|
3399
|
+
});
|
|
3400
|
+
st.displayName = "BreakAdmin.BalancePanel";
|
|
3401
|
+
const ua = Object.assign(We, {
|
|
3402
|
+
Root: We,
|
|
3403
|
+
Header: qe,
|
|
3404
|
+
TabBar: Ue,
|
|
3405
|
+
BreaksPanel: et,
|
|
3406
|
+
RequestsPanel: tt,
|
|
3407
|
+
BalancePanel: st
|
|
3408
|
+
}), _s = O.forwardRef(function({
|
|
3409
|
+
selectedLeave: t,
|
|
3410
|
+
onSave: n
|
|
3411
|
+
}, a) {
|
|
3412
|
+
var i;
|
|
3413
|
+
const [d, m] = M(!1), [p, r] = M(
|
|
3414
|
+
typeof (t == null ? void 0 : t.cashout) == "number" ? t.cashout : 0
|
|
3415
|
+
), [o, x] = M(
|
|
3416
|
+
(t == null ? void 0 : t.carryForward) || 0
|
|
3417
|
+
), u = Be(null), { toast: f } = je();
|
|
3418
|
+
U(() => {
|
|
3419
|
+
r(
|
|
3420
|
+
typeof (t == null ? void 0 : t.cashout) == "number" ? t.cashout : 0
|
|
3421
|
+
), x((t == null ? void 0 : t.carryForward) || 0);
|
|
3422
|
+
}, [t]);
|
|
3423
|
+
const y = async (h) => {
|
|
3424
|
+
h.preventDefault(), m(!0);
|
|
3425
|
+
try {
|
|
3426
|
+
n && n({
|
|
3427
|
+
userId: t.userId,
|
|
3428
|
+
cashOutDays: p,
|
|
3429
|
+
carryForward: o,
|
|
3430
|
+
year: (/* @__PURE__ */ new Date()).getFullYear()
|
|
3431
|
+
}), f({
|
|
3432
|
+
description: "Break balance updated successfully",
|
|
3433
|
+
color: "neutral"
|
|
3434
|
+
});
|
|
3435
|
+
} catch (c) {
|
|
3436
|
+
console.error("Error updating break balance:", c), f({
|
|
3437
|
+
title: "Error",
|
|
3438
|
+
description: "Failed to update break balance",
|
|
3439
|
+
color: "error"
|
|
3440
|
+
});
|
|
3441
|
+
} finally {
|
|
3442
|
+
m(!1);
|
|
3443
|
+
}
|
|
3444
|
+
};
|
|
3445
|
+
return /* @__PURE__ */ s(ce, { children: [
|
|
3446
|
+
/* @__PURE__ */ e(we, { asChild: !0, children: /* @__PURE__ */ s(
|
|
3447
|
+
J,
|
|
3448
|
+
{
|
|
3449
|
+
variant: "outline",
|
|
3450
|
+
className: "text-ds-base border-border bg-layer-01 px-ds-05 py-ds-04 pr-ds-06 text-text-secondary shadow-02",
|
|
3451
|
+
children: [
|
|
3452
|
+
/* @__PURE__ */ e(Je, {}),
|
|
3453
|
+
/* @__PURE__ */ e("span", { children: "Edit" })
|
|
3454
|
+
]
|
|
3455
|
+
}
|
|
3456
|
+
) }),
|
|
3457
|
+
/* @__PURE__ */ e(me, { className: "w-[308px] p-ds-06", children: /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(Ze, { children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center justify-start gap-ds-05", children: [
|
|
3458
|
+
/* @__PURE__ */ s("p", { className: "text-ds-md w-full text-left text-text-tertiary", children: [
|
|
3459
|
+
"Edit break balance conversion of ",
|
|
3460
|
+
/* @__PURE__ */ e("br", { className: "mb-ds-02" }),
|
|
3461
|
+
/* @__PURE__ */ e("span", { className: "font-semibold text-interactive", children: (i = t == null ? void 0 : t.user) == null ? void 0 : i.name })
|
|
3462
|
+
] }),
|
|
3463
|
+
/* @__PURE__ */ s(
|
|
3464
|
+
"form",
|
|
3465
|
+
{
|
|
3466
|
+
ref: u,
|
|
3467
|
+
onSubmit: y,
|
|
3468
|
+
id: "updatebreakbalanceform",
|
|
3469
|
+
className: "flex w-full flex-col gap-ds-05",
|
|
3470
|
+
children: [
|
|
3471
|
+
/* @__PURE__ */ s("div", { className: "flex w-full items-center justify-between", children: [
|
|
3472
|
+
/* @__PURE__ */ e("div", { className: "text-ds-sm font-semibold uppercase tracking-wider text-text-placeholder", children: "Cash out" }),
|
|
3473
|
+
/* @__PURE__ */ e(
|
|
3474
|
+
ks,
|
|
3475
|
+
{
|
|
3476
|
+
value: p,
|
|
3477
|
+
onValueChange: r,
|
|
3478
|
+
min: 0,
|
|
3479
|
+
max: 100,
|
|
3480
|
+
step: 1,
|
|
3481
|
+
disabled: d
|
|
3482
|
+
}
|
|
3483
|
+
)
|
|
3484
|
+
] }),
|
|
3485
|
+
/* @__PURE__ */ s("div", { className: "flex w-full items-center justify-between", children: [
|
|
3486
|
+
/* @__PURE__ */ e("div", { className: "text-ds-sm font-semibold uppercase tracking-wider text-text-placeholder", children: "Carry forward" }),
|
|
3487
|
+
/* @__PURE__ */ e("div", { className: "flex w-[100px] items-center justify-center", children: /* @__PURE__ */ e("div", { className: "text-ds-base font-semibold text-text-secondary", children: o }) })
|
|
3488
|
+
] }),
|
|
3489
|
+
/* @__PURE__ */ e(
|
|
3490
|
+
J,
|
|
3491
|
+
{
|
|
3492
|
+
variant: "outline",
|
|
3493
|
+
fullWidth: !0,
|
|
3494
|
+
onClick: () => {
|
|
3495
|
+
var h;
|
|
3496
|
+
return (h = u.current) == null ? void 0 : h.requestSubmit();
|
|
3497
|
+
},
|
|
3498
|
+
disabled: d,
|
|
3499
|
+
children: "Update"
|
|
3500
|
+
}
|
|
3501
|
+
)
|
|
3502
|
+
]
|
|
3503
|
+
}
|
|
3504
|
+
)
|
|
3505
|
+
] }) }) }) })
|
|
3506
|
+
] });
|
|
3507
|
+
});
|
|
3508
|
+
_s.displayName = "EditBreakBalance";
|
|
3509
|
+
const Ys = O.forwardRef(
|
|
3510
|
+
function({
|
|
3511
|
+
adjustments: t,
|
|
3512
|
+
adminId: n
|
|
3513
|
+
}, a) {
|
|
3514
|
+
return /* @__PURE__ */ e("div", { ref: a, className: "no-scrollbar w-full overflow-auto border border-border-subtle sm:rounded-ds-lg max-md:rounded-ds-none max-md:border-0", children: /* @__PURE__ */ e("div", { className: "bg-layer-02 pb-ds-06 pl-ds-05 pt-ds-03 md:p-ds-05", children: /* @__PURE__ */ e("div", { className: "no-scrollbar w-full overflow-x-auto overflow-y-auto", children: /* @__PURE__ */ s("div", { className: "min-w-[800px] max-md:w-[max-content]", children: [
|
|
3515
|
+
/* @__PURE__ */ s("div", { className: "text-ds-sm font-semibold uppercase tracking-wider sticky top-0 grid grid-cols-[200px_160px_80px_1fr_1fr_1fr] gap-ds-05 py-ds-03 text-text-placeholder sm:px-ds-06", children: [
|
|
3516
|
+
/* @__PURE__ */ e("div", { className: "p-ds-03 pl-ds-04", children: "User" }),
|
|
3517
|
+
/* @__PURE__ */ e("div", { className: "p-ds-03 pl-ds-04", children: "Date" }),
|
|
3518
|
+
/* @__PURE__ */ e("div", { className: "p-ds-03 text-center", children: "Days" }),
|
|
3519
|
+
/* @__PURE__ */ e("div", { className: "p-ds-03 pl-ds-04", children: "Type" }),
|
|
3520
|
+
/* @__PURE__ */ e("div", { className: "p-ds-03", children: "Reason" }),
|
|
3521
|
+
/* @__PURE__ */ e("div", { className: "p-ds-03", children: "Approved By" })
|
|
3522
|
+
] }),
|
|
3523
|
+
/* @__PURE__ */ e("div", { className: "text-ds-md no-scrollbar overflow-y-auto md:max-h-[414px] max-md:h-[calc(100dvh-366px)] max-md:max-h-[calc(100dvh-366px)] max-md:overflow-visible max-md:overflow-y-auto max-md:overflow-x-visible", children: t.length === 0 ? /* @__PURE__ */ e("div", { className: "flex justify-center p-ds-05 text-text-tertiary", children: "No approved adjustments found" }) : t.map((d) => {
|
|
3524
|
+
var m, p;
|
|
3525
|
+
return /* @__PURE__ */ s(
|
|
3526
|
+
"div",
|
|
3527
|
+
{
|
|
3528
|
+
className: "grid grid-cols-[200px_160px_80px_1fr_1fr_1fr] gap-ds-05 bg-layer-02 py-ds-03 sm:px-ds-06",
|
|
3529
|
+
children: [
|
|
3530
|
+
/* @__PURE__ */ e("div", { className: "p-ds-03 pl-ds-04 text-text-secondary", children: ((m = d.user) == null ? void 0 : m.name) || "Unknown User" }),
|
|
3531
|
+
/* @__PURE__ */ e("div", { className: "w-[160px] p-ds-03 text-text-secondary", children: de(new Date(d.createdAt)) }),
|
|
3532
|
+
/* @__PURE__ */ e("div", { className: "w-[80px] p-ds-03 text-center text-text-secondary", children: d.numberOfDays }),
|
|
3533
|
+
/* @__PURE__ */ e("div", { className: "max-w-[350px] p-ds-03 pl-ds-04 text-text-tertiary", children: d.type }),
|
|
3534
|
+
/* @__PURE__ */ e("div", { className: "max-w-[350px] p-ds-03 text-text-secondary", children: d.reason || "-" }),
|
|
3535
|
+
/* @__PURE__ */ e("div", { className: "p-ds-03 text-text-secondary", children: ((p = d.approver) == null ? void 0 : p.name) || (d.approvedBy === n ? "You" : "Unknown") })
|
|
3536
|
+
]
|
|
3537
|
+
},
|
|
3538
|
+
d.id
|
|
3539
|
+
);
|
|
3540
|
+
}) })
|
|
3541
|
+
] }) }) }) });
|
|
3542
|
+
}
|
|
3543
|
+
);
|
|
3544
|
+
Ys.displayName = "ApprovedAdjustments";
|
|
3545
|
+
const xa = {
|
|
3546
|
+
YEARLY_BALANCE: "YEARLY_BALANCE",
|
|
3547
|
+
CARRY_FORWARD: "CARRY_FORWARD",
|
|
3548
|
+
CASHOUT: "CASHOUT",
|
|
3549
|
+
OTHER: "OTHER"
|
|
3550
|
+
}, Is = {
|
|
3551
|
+
YEARLY_BALANCE: "Yearly Balance",
|
|
3552
|
+
CARRY_FORWARD: "Carry Forward",
|
|
3553
|
+
CASHOUT: "Cashout",
|
|
3554
|
+
OTHER: "Other"
|
|
3555
|
+
};
|
|
3556
|
+
function fa(l) {
|
|
3557
|
+
return /* @__PURE__ */ e("div", { children: Is[l] });
|
|
3558
|
+
}
|
|
3559
|
+
export {
|
|
3560
|
+
xa as A,
|
|
3561
|
+
ua as B,
|
|
3562
|
+
js as C,
|
|
3563
|
+
kt as D,
|
|
3564
|
+
Vt as E,
|
|
3565
|
+
ca as F,
|
|
3566
|
+
fa as G,
|
|
3567
|
+
Rt as H,
|
|
3568
|
+
zt as L,
|
|
3569
|
+
Mt as R,
|
|
3570
|
+
ma as a,
|
|
3571
|
+
Ys as b,
|
|
3572
|
+
At as c,
|
|
3573
|
+
St as d,
|
|
3574
|
+
Gt as e,
|
|
3575
|
+
Zt as f,
|
|
3576
|
+
$t as g,
|
|
3577
|
+
ze as h,
|
|
3578
|
+
Jt as i,
|
|
3579
|
+
Bt as j,
|
|
3580
|
+
Ct as k,
|
|
3581
|
+
Kt as l,
|
|
3582
|
+
_s as m,
|
|
3583
|
+
jt as n,
|
|
3584
|
+
de as o,
|
|
3585
|
+
na as p,
|
|
3586
|
+
Me as q,
|
|
3587
|
+
ot as r,
|
|
3588
|
+
ia as s,
|
|
3589
|
+
_e as t,
|
|
3590
|
+
oa as u,
|
|
3591
|
+
Cs as v,
|
|
3592
|
+
fe as w,
|
|
3593
|
+
Tt as x,
|
|
3594
|
+
Q as y,
|
|
3595
|
+
Re as z
|
|
3596
|
+
};
|