@wealthx/shadcn 1.3.0 → 1.3.1
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/.turbo/turbo-build.log +43 -43
- package/CHANGELOG.md +6 -0
- package/dist/chunk-MLNEWRWV.mjs +449 -0
- package/dist/{chunk-FNQXOAYJ.mjs → chunk-Q2BGOAMG.mjs} +61 -28
- package/dist/components/ui/advisor-card.js +61 -28
- package/dist/components/ui/advisor-card.mjs +5 -3
- package/dist/components/ui/sidebar-nav.js +268 -172
- package/dist/components/ui/sidebar-nav.mjs +2 -1
- package/dist/index.js +515 -424
- package/dist/index.mjs +5 -3
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/index.tsx +2 -1
- package/src/components/ui/advisor-card.tsx +111 -54
- package/src/components/ui/sidebar-nav.tsx +194 -137
- package/src/styles/styles-css.ts +1 -1
- package/dist/chunk-ZC45IGZO.mjs +0 -388
package/dist/index.js
CHANGED
|
@@ -68,6 +68,7 @@ __export(index_exports, {
|
|
|
68
68
|
AddLeadModal: () => AddLeadModal,
|
|
69
69
|
AddressAutocomplete: () => AddressAutocomplete,
|
|
70
70
|
AdvisorCard: () => AdvisorCard,
|
|
71
|
+
AdvisorInviteCard: () => AdvisorInviteCard,
|
|
71
72
|
AiAssistantDrawer: () => AiAssistantDrawer,
|
|
72
73
|
Alert: () => Alert,
|
|
73
74
|
AlertAccordion: () => AlertAccordion,
|
|
@@ -574,6 +575,9 @@ function AccordionContent(_a) {
|
|
|
574
575
|
);
|
|
575
576
|
}
|
|
576
577
|
|
|
578
|
+
// src/components/ui/advisor-card.tsx
|
|
579
|
+
var import_react2 = __toESM(require("react"));
|
|
580
|
+
|
|
577
581
|
// src/components/ui/badge.tsx
|
|
578
582
|
var import_class_variance_authority = require("class-variance-authority");
|
|
579
583
|
|
|
@@ -892,31 +896,34 @@ function AdvisorCard({
|
|
|
892
896
|
role,
|
|
893
897
|
phone,
|
|
894
898
|
email,
|
|
899
|
+
companyName,
|
|
895
900
|
companyLogoUrl,
|
|
896
901
|
avatarInitials,
|
|
897
902
|
isPrimary = false,
|
|
898
|
-
|
|
903
|
+
appointments,
|
|
899
904
|
onRefer,
|
|
900
905
|
onMoreOptions,
|
|
901
906
|
onBookAppointment,
|
|
902
907
|
onViewAppointment
|
|
903
908
|
}) {
|
|
909
|
+
const hasAppointments = appointments !== void 0;
|
|
910
|
+
const appointmentList = appointments === null || Array.isArray(appointments) && appointments.length === 0 ? null : appointments;
|
|
904
911
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex flex-col border border-border bg-card", children: [
|
|
905
912
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-start gap-4 p-4", children: [
|
|
906
913
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Avatar, { className: "h-10 w-10 shrink-0", children: [
|
|
907
914
|
companyLogoUrl && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AvatarImage, { src: companyLogoUrl, alt: `${name} company logo` }),
|
|
908
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AvatarFallback, { className: "text-sm", children: avatarInitials != null ? avatarInitials : name.slice(0, 2).toUpperCase() })
|
|
915
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AvatarFallback, { className: "text-sm", children: avatarInitials != null ? avatarInitials : companyName ? companyName.split(" ").map((w) => w[0]).join("").slice(0, 2).toUpperCase() : name.slice(0, 2).toUpperCase() })
|
|
909
916
|
] }),
|
|
910
917
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
911
918
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-sm font-semibold leading-tight", children: name }),
|
|
912
919
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-sm text-muted-foreground", children: role }),
|
|
913
920
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "mt-2 flex flex-col gap-1", children: [
|
|
914
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center gap-1.5 text-
|
|
915
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react3.Phone, { className: "h-
|
|
921
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center gap-1.5 text-sm text-muted-foreground", children: [
|
|
922
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react3.Phone, { className: "h-4 w-4 shrink-0" }),
|
|
916
923
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: phone })
|
|
917
924
|
] }),
|
|
918
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center gap-1.5 text-
|
|
919
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react3.Mail, { className: "h-
|
|
925
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center gap-1.5 text-sm text-muted-foreground", children: [
|
|
926
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react3.Mail, { className: "h-4 w-4 shrink-0" }),
|
|
920
927
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: email })
|
|
921
928
|
] })
|
|
922
929
|
] })
|
|
@@ -936,14 +943,14 @@ function AdvisorCard({
|
|
|
936
943
|
)
|
|
937
944
|
] })
|
|
938
945
|
] }),
|
|
939
|
-
|
|
946
|
+
hasAppointments && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
940
947
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Separator, {}),
|
|
941
|
-
|
|
942
|
-
/*
|
|
948
|
+
appointmentList ? appointmentList.map((appt, i) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react2.default.Fragment, { children: [
|
|
949
|
+
i > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Separator, {}),
|
|
943
950
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
944
951
|
"div",
|
|
945
952
|
{
|
|
946
|
-
className: `flex items-center gap-3 px-4 py-3 ${STRIP_BG[
|
|
953
|
+
className: `flex items-center gap-3 px-4 py-3 ${STRIP_BG[appt.status]}`,
|
|
947
954
|
children: [
|
|
948
955
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react3.CalendarCheck, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
|
|
949
956
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
@@ -951,19 +958,19 @@ function AdvisorCard({
|
|
|
951
958
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
952
959
|
Badge,
|
|
953
960
|
{
|
|
954
|
-
variant: STATUS_VARIANT[
|
|
961
|
+
variant: STATUS_VARIANT[appt.status],
|
|
955
962
|
className: "text-[10px]",
|
|
956
|
-
children: STATUS_LABEL[
|
|
963
|
+
children: STATUS_LABEL[appt.status]
|
|
957
964
|
}
|
|
958
965
|
),
|
|
959
|
-
|
|
966
|
+
appt.appointmentType && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "truncate text-sm font-semibold", children: appt.appointmentType })
|
|
960
967
|
] }),
|
|
961
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("p", { className: "text-
|
|
962
|
-
|
|
968
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("p", { className: "whitespace-nowrap text-sm text-muted-foreground", children: [
|
|
969
|
+
appt.date,
|
|
963
970
|
" \xB7 ",
|
|
964
|
-
|
|
971
|
+
appt.timeStart,
|
|
965
972
|
"\u2013",
|
|
966
|
-
|
|
973
|
+
appt.timeEnd
|
|
967
974
|
] })
|
|
968
975
|
] }),
|
|
969
976
|
onViewAppointment && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
@@ -972,7 +979,7 @@ function AdvisorCard({
|
|
|
972
979
|
variant: "ghost",
|
|
973
980
|
size: "sm",
|
|
974
981
|
className: "h-7 shrink-0 gap-1 px-2 text-xs",
|
|
975
|
-
onClick: onViewAppointment,
|
|
982
|
+
onClick: () => onViewAppointment(i),
|
|
976
983
|
children: [
|
|
977
984
|
"View",
|
|
978
985
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react3.ChevronRight, { className: "h-3 w-3" })
|
|
@@ -982,8 +989,8 @@ function AdvisorCard({
|
|
|
982
989
|
]
|
|
983
990
|
}
|
|
984
991
|
)
|
|
985
|
-
) : (
|
|
986
|
-
/*
|
|
992
|
+
] }, i)) : (
|
|
993
|
+
/* Empty state */
|
|
987
994
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center gap-3 px-4 py-3", children: [
|
|
988
995
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react3.Calendar, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
|
|
989
996
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "flex-1 text-xs text-muted-foreground", children: "No upcoming appointments" })
|
|
@@ -991,31 +998,58 @@ function AdvisorCard({
|
|
|
991
998
|
)
|
|
992
999
|
] }),
|
|
993
1000
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Separator, {}),
|
|
994
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex
|
|
1001
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex flex-col gap-2 px-4 py-3", children: [
|
|
995
1002
|
onBookAppointment && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
996
1003
|
Button,
|
|
997
1004
|
{
|
|
998
1005
|
variant: "outline-primary",
|
|
999
1006
|
size: "sm",
|
|
1007
|
+
className: "w-full",
|
|
1000
1008
|
onClick: onBookAppointment,
|
|
1001
1009
|
children: "Book Appointment"
|
|
1002
1010
|
}
|
|
1003
1011
|
),
|
|
1004
|
-
onRefer && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1012
|
+
onRefer && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1013
|
+
Button,
|
|
1014
|
+
{
|
|
1015
|
+
variant: "outline",
|
|
1016
|
+
size: "sm",
|
|
1017
|
+
className: "w-full",
|
|
1018
|
+
onClick: onRefer,
|
|
1019
|
+
children: [
|
|
1020
|
+
"Refer ",
|
|
1021
|
+
name,
|
|
1022
|
+
" to Others"
|
|
1023
|
+
]
|
|
1024
|
+
}
|
|
1025
|
+
)
|
|
1009
1026
|
] })
|
|
1010
1027
|
] });
|
|
1011
1028
|
}
|
|
1029
|
+
function AdvisorInviteCard({ onInvite }) {
|
|
1030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1031
|
+
Button,
|
|
1032
|
+
{
|
|
1033
|
+
variant: "ghost",
|
|
1034
|
+
onClick: onInvite,
|
|
1035
|
+
className: "flex h-auto w-full flex-col items-center justify-center gap-3 border border-dashed border-border bg-card p-8 text-center transition-colors hover:bg-muted/40",
|
|
1036
|
+
children: [
|
|
1037
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex h-10 w-10 items-center justify-center border border-dashed border-muted-foreground/40", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react3.Plus, { className: "h-5 w-5 text-muted-foreground" }) }),
|
|
1038
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
1039
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-sm font-medium", children: "Add Another Advisor" }),
|
|
1040
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-xs text-muted-foreground", children: "Connect more advisors to your account" })
|
|
1041
|
+
] })
|
|
1042
|
+
]
|
|
1043
|
+
}
|
|
1044
|
+
);
|
|
1045
|
+
}
|
|
1012
1046
|
|
|
1013
1047
|
// src/components/ui/appointment-upcoming-card.tsx
|
|
1014
|
-
var
|
|
1048
|
+
var import_react4 = __toESM(require("react"));
|
|
1015
1049
|
var import_lucide_react6 = require("lucide-react");
|
|
1016
1050
|
|
|
1017
1051
|
// src/components/ui/calendar.tsx
|
|
1018
|
-
var
|
|
1052
|
+
var React3 = __toESM(require("react"));
|
|
1019
1053
|
var import_lucide_react4 = require("lucide-react");
|
|
1020
1054
|
var import_react_day_picker = require("react-day-picker");
|
|
1021
1055
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
@@ -1188,8 +1222,8 @@ function CalendarDayButton(_a) {
|
|
|
1188
1222
|
"modifiers"
|
|
1189
1223
|
]);
|
|
1190
1224
|
const defaultClassNames = (0, import_react_day_picker.getDefaultClassNames)();
|
|
1191
|
-
const ref =
|
|
1192
|
-
|
|
1225
|
+
const ref = React3.useRef(null);
|
|
1226
|
+
React3.useEffect(() => {
|
|
1193
1227
|
var _a2;
|
|
1194
1228
|
if (modifiers.focused) (_a2 = ref.current) == null ? void 0 : _a2.focus();
|
|
1195
1229
|
}, [modifiers.focused]);
|
|
@@ -1219,11 +1253,11 @@ var import_lucide_react5 = require("lucide-react");
|
|
|
1219
1253
|
var import_dialog = require("@base-ui/react/dialog");
|
|
1220
1254
|
|
|
1221
1255
|
// src/lib/theme-provider.tsx
|
|
1222
|
-
var
|
|
1256
|
+
var import_react3 = require("react");
|
|
1223
1257
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1224
|
-
var ThemeVarsContext = (0,
|
|
1258
|
+
var ThemeVarsContext = (0, import_react3.createContext)({});
|
|
1225
1259
|
function useThemeVars() {
|
|
1226
|
-
return (0,
|
|
1260
|
+
return (0, import_react3.useContext)(ThemeVarsContext);
|
|
1227
1261
|
}
|
|
1228
1262
|
|
|
1229
1263
|
// src/components/ui/dialog.tsx
|
|
@@ -1565,16 +1599,16 @@ function AppointmentUpcomingCard({
|
|
|
1565
1599
|
onAcceptReschedule
|
|
1566
1600
|
}) {
|
|
1567
1601
|
var _a, _b, _c;
|
|
1568
|
-
const [calendarDialogOpen, setCalendarDialogOpen] =
|
|
1569
|
-
const [acceptDialogOpen, setAcceptDialogOpen] =
|
|
1570
|
-
const [rescheduleDialogOpen, setRescheduleDialogOpen] =
|
|
1571
|
-
const [cancelDialogOpen, setCancelDialogOpen] =
|
|
1572
|
-
const [rescheduleDate, setRescheduleDate] =
|
|
1602
|
+
const [calendarDialogOpen, setCalendarDialogOpen] = import_react4.default.useState(false);
|
|
1603
|
+
const [acceptDialogOpen, setAcceptDialogOpen] = import_react4.default.useState(false);
|
|
1604
|
+
const [rescheduleDialogOpen, setRescheduleDialogOpen] = import_react4.default.useState(false);
|
|
1605
|
+
const [cancelDialogOpen, setCancelDialogOpen] = import_react4.default.useState(false);
|
|
1606
|
+
const [rescheduleDate, setRescheduleDate] = import_react4.default.useState(
|
|
1573
1607
|
/* @__PURE__ */ new Date()
|
|
1574
1608
|
);
|
|
1575
|
-
const [rescheduleSlot, setRescheduleSlot] =
|
|
1576
|
-
const [rescheduleNote, setRescheduleNote] =
|
|
1577
|
-
const [cancelReason, setCancelReason] =
|
|
1609
|
+
const [rescheduleSlot, setRescheduleSlot] = import_react4.default.useState(void 0);
|
|
1610
|
+
const [rescheduleNote, setRescheduleNote] = import_react4.default.useState("");
|
|
1611
|
+
const [cancelReason, setCancelReason] = import_react4.default.useState("");
|
|
1578
1612
|
const resetRescheduleForm = () => {
|
|
1579
1613
|
setRescheduleDate(/* @__PURE__ */ new Date());
|
|
1580
1614
|
setRescheduleSlot(void 0);
|
|
@@ -1977,7 +2011,7 @@ function AppointmentUpcomingCard({
|
|
|
1977
2011
|
}
|
|
1978
2012
|
|
|
1979
2013
|
// src/components/ui/add-column-modal.tsx
|
|
1980
|
-
var
|
|
2014
|
+
var React6 = __toESM(require("react"));
|
|
1981
2015
|
var import_lucide_react8 = require("lucide-react");
|
|
1982
2016
|
|
|
1983
2017
|
// src/components/ui/input.tsx
|
|
@@ -2192,16 +2226,16 @@ function AddColumnModal({
|
|
|
2192
2226
|
}) {
|
|
2193
2227
|
var _a, _b;
|
|
2194
2228
|
const isEdit = !!(editData == null ? void 0 : editData.id);
|
|
2195
|
-
const nextId =
|
|
2196
|
-
const [name, setName] =
|
|
2197
|
-
const [warningDays, setWarningDays] =
|
|
2229
|
+
const nextId = React6.useRef(0);
|
|
2230
|
+
const [name, setName] = React6.useState((_a = editData == null ? void 0 : editData.name) != null ? _a : "");
|
|
2231
|
+
const [warningDays, setWarningDays] = React6.useState(
|
|
2198
2232
|
(editData == null ? void 0 : editData.warningDays) != null ? String(editData.warningDays) : ""
|
|
2199
2233
|
);
|
|
2200
|
-
const [priorityDays, setPriorityDays] =
|
|
2234
|
+
const [priorityDays, setPriorityDays] = React6.useState(
|
|
2201
2235
|
(editData == null ? void 0 : editData.priorityDays) != null ? String(editData.priorityDays) : ""
|
|
2202
2236
|
);
|
|
2203
|
-
const [tasks, setTasks] =
|
|
2204
|
-
|
|
2237
|
+
const [tasks, setTasks] = React6.useState((_b = editData == null ? void 0 : editData.tasks) != null ? _b : []);
|
|
2238
|
+
React6.useEffect(() => {
|
|
2205
2239
|
var _a2, _b2;
|
|
2206
2240
|
if (open) {
|
|
2207
2241
|
setName((_a2 = editData == null ? void 0 : editData.name) != null ? _a2 : "");
|
|
@@ -2386,11 +2420,11 @@ function AddColumnModal({
|
|
|
2386
2420
|
}
|
|
2387
2421
|
|
|
2388
2422
|
// src/components/ui/add-lead-modal.tsx
|
|
2389
|
-
var
|
|
2423
|
+
var React7 = __toESM(require("react"));
|
|
2390
2424
|
var import_lucide_react11 = require("lucide-react");
|
|
2391
2425
|
|
|
2392
2426
|
// src/components/ui/checkbox.tsx
|
|
2393
|
-
var
|
|
2427
|
+
var import_react5 = require("react");
|
|
2394
2428
|
var import_lucide_react9 = require("lucide-react");
|
|
2395
2429
|
var import_checkbox = require("@base-ui/react/checkbox");
|
|
2396
2430
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
@@ -2449,7 +2483,7 @@ function CheckboxCard(_a) {
|
|
|
2449
2483
|
"label",
|
|
2450
2484
|
"description"
|
|
2451
2485
|
]);
|
|
2452
|
-
const [internalChecked, setInternalChecked] = (0,
|
|
2486
|
+
const [internalChecked, setInternalChecked] = (0, import_react5.useState)(
|
|
2453
2487
|
Boolean(defaultChecked)
|
|
2454
2488
|
);
|
|
2455
2489
|
const resolvedChecked = checked != null ? checked : internalChecked;
|
|
@@ -2533,8 +2567,8 @@ function AddLeadModal({
|
|
|
2533
2567
|
onAdd,
|
|
2534
2568
|
className
|
|
2535
2569
|
}) {
|
|
2536
|
-
const [selectedIds, setSelectedIds] =
|
|
2537
|
-
|
|
2570
|
+
const [selectedIds, setSelectedIds] = React7.useState(/* @__PURE__ */ new Set());
|
|
2571
|
+
React7.useEffect(() => {
|
|
2538
2572
|
if (open) setSelectedIds(/* @__PURE__ */ new Set());
|
|
2539
2573
|
}, [open]);
|
|
2540
2574
|
const allPageSelected = contacts.length > 0 && contacts.every((c) => selectedIds.has(c.id));
|
|
@@ -2701,7 +2735,7 @@ function AddLeadModal({
|
|
|
2701
2735
|
}
|
|
2702
2736
|
|
|
2703
2737
|
// src/components/ui/ai-assistant-drawer.tsx
|
|
2704
|
-
var
|
|
2738
|
+
var React8 = __toESM(require("react"));
|
|
2705
2739
|
var import_lucide_react13 = require("lucide-react");
|
|
2706
2740
|
|
|
2707
2741
|
// src/components/ui/sheet.tsx
|
|
@@ -2928,26 +2962,26 @@ function AiAssistantDrawer({
|
|
|
2928
2962
|
className
|
|
2929
2963
|
}) {
|
|
2930
2964
|
var _a;
|
|
2931
|
-
const [inputValue, setInputValue] =
|
|
2932
|
-
const messagesEndRef =
|
|
2933
|
-
const textareaRef =
|
|
2965
|
+
const [inputValue, setInputValue] = React8.useState("");
|
|
2966
|
+
const messagesEndRef = React8.useRef(null);
|
|
2967
|
+
const textareaRef = React8.useRef(null);
|
|
2934
2968
|
const suggestions = taskSuggestions != null ? taskSuggestions : DEFAULT_SUGGESTIONS;
|
|
2935
2969
|
const hasMessages = messages.length > 0;
|
|
2936
2970
|
const canSend = inputValue.trim().length > 0 && !isStreaming && !isLoading;
|
|
2937
|
-
|
|
2971
|
+
React8.useEffect(() => {
|
|
2938
2972
|
if (!messagesEndRef.current) return;
|
|
2939
2973
|
messagesEndRef.current.scrollIntoView({
|
|
2940
2974
|
behavior: "smooth",
|
|
2941
2975
|
block: "nearest"
|
|
2942
2976
|
});
|
|
2943
2977
|
}, [messages.length]);
|
|
2944
|
-
|
|
2978
|
+
React8.useEffect(() => {
|
|
2945
2979
|
const el = textareaRef.current;
|
|
2946
2980
|
if (!el) return;
|
|
2947
2981
|
el.style.height = "auto";
|
|
2948
2982
|
el.style.height = `${Math.min(el.scrollHeight, 120)}px`;
|
|
2949
2983
|
}, [inputValue]);
|
|
2950
|
-
const handleSend =
|
|
2984
|
+
const handleSend = React8.useCallback(() => {
|
|
2951
2985
|
const text = inputValue.trim();
|
|
2952
2986
|
if (!text || !canSend) return;
|
|
2953
2987
|
onSendMessage == null ? void 0 : onSendMessage(text);
|
|
@@ -3355,10 +3389,10 @@ function AlertDialogCancel(_a) {
|
|
|
3355
3389
|
}
|
|
3356
3390
|
|
|
3357
3391
|
// src/components/ui/appointment-availability-settings.tsx
|
|
3358
|
-
var
|
|
3392
|
+
var import_react7 = __toESM(require("react"));
|
|
3359
3393
|
|
|
3360
3394
|
// src/components/ui/date-picker.tsx
|
|
3361
|
-
var
|
|
3395
|
+
var React9 = __toESM(require("react"));
|
|
3362
3396
|
var import_date_fns = require("date-fns");
|
|
3363
3397
|
var import_lucide_react14 = require("lucide-react");
|
|
3364
3398
|
|
|
@@ -3467,7 +3501,7 @@ function DatePicker({
|
|
|
3467
3501
|
className,
|
|
3468
3502
|
calendarProps
|
|
3469
3503
|
}) {
|
|
3470
|
-
const [open, setOpen] =
|
|
3504
|
+
const [open, setOpen] = React9.useState(false);
|
|
3471
3505
|
function handleDaySelect(day) {
|
|
3472
3506
|
if (!day) {
|
|
3473
3507
|
onChange == null ? void 0 : onChange(void 0);
|
|
@@ -3556,7 +3590,7 @@ function DatePicker({
|
|
|
3556
3590
|
}
|
|
3557
3591
|
|
|
3558
3592
|
// src/components/ui/switch.tsx
|
|
3559
|
-
var
|
|
3593
|
+
var import_react6 = require("react");
|
|
3560
3594
|
var import_switch = require("@base-ui/react/switch");
|
|
3561
3595
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
3562
3596
|
function Switch(_a) {
|
|
@@ -3623,7 +3657,7 @@ function SwitchCard(_a) {
|
|
|
3623
3657
|
"switchPosition",
|
|
3624
3658
|
"size"
|
|
3625
3659
|
]);
|
|
3626
|
-
const [internalChecked, setInternalChecked] = (0,
|
|
3660
|
+
const [internalChecked, setInternalChecked] = (0, import_react6.useState)(
|
|
3627
3661
|
defaultChecked != null ? defaultChecked : false
|
|
3628
3662
|
);
|
|
3629
3663
|
const isChecked = checked != null ? checked : internalChecked;
|
|
@@ -3852,11 +3886,11 @@ function AddTimeOffDialog({
|
|
|
3852
3886
|
onOpenChange,
|
|
3853
3887
|
onAdd
|
|
3854
3888
|
}) {
|
|
3855
|
-
const [label, setLabel] =
|
|
3856
|
-
const [date, setDate] =
|
|
3857
|
-
const [includeTime, setIncludeTime] =
|
|
3858
|
-
const [timeStart, setTimeStart] =
|
|
3859
|
-
const [timeEnd, setTimeEnd] =
|
|
3889
|
+
const [label, setLabel] = import_react7.default.useState("");
|
|
3890
|
+
const [date, setDate] = import_react7.default.useState(void 0);
|
|
3891
|
+
const [includeTime, setIncludeTime] = import_react7.default.useState(false);
|
|
3892
|
+
const [timeStart, setTimeStart] = import_react7.default.useState("09:00");
|
|
3893
|
+
const [timeEnd, setTimeEnd] = import_react7.default.useState("17:00");
|
|
3860
3894
|
const reset = () => {
|
|
3861
3895
|
setLabel("");
|
|
3862
3896
|
setDate(void 0);
|
|
@@ -3956,15 +3990,15 @@ function AppointmentAvailabilitySettings({
|
|
|
3956
3990
|
onSave,
|
|
3957
3991
|
onBlockedDatesChange
|
|
3958
3992
|
}) {
|
|
3959
|
-
const hasMounted =
|
|
3960
|
-
|
|
3993
|
+
const hasMounted = import_react7.default.useRef(false);
|
|
3994
|
+
import_react7.default.useEffect(() => {
|
|
3961
3995
|
hasMounted.current = true;
|
|
3962
3996
|
}, []);
|
|
3963
|
-
const [schedule, setSchedule] =
|
|
3964
|
-
const [meetingDuration, setMeetingDuration] =
|
|
3965
|
-
const [schedulingBuffer, setSchedulingBuffer] =
|
|
3966
|
-
const [maxSlotsPerDay, setMaxSlotsPerDay] =
|
|
3967
|
-
const [timeOffEntries, setTimeOffEntries] =
|
|
3997
|
+
const [schedule, setSchedule] = import_react7.default.useState(initialSchedule);
|
|
3998
|
+
const [meetingDuration, setMeetingDuration] = import_react7.default.useState("30");
|
|
3999
|
+
const [schedulingBuffer, setSchedulingBuffer] = import_react7.default.useState("0");
|
|
4000
|
+
const [maxSlotsPerDay, setMaxSlotsPerDay] = import_react7.default.useState("8");
|
|
4001
|
+
const [timeOffEntries, setTimeOffEntries] = import_react7.default.useState(
|
|
3968
4002
|
() => {
|
|
3969
4003
|
const holidayDates = new Set(AU_PUBLIC_HOLIDAYS_2026.map((h) => h.date));
|
|
3970
4004
|
const entries = AU_PUBLIC_HOLIDAYS_2026.map((h) => __spreadProps(__spreadValues({}, h), {
|
|
@@ -3984,20 +4018,20 @@ function AppointmentAvailabilitySettings({
|
|
|
3984
4018
|
return entries.sort((a, b) => a.date.localeCompare(b.date));
|
|
3985
4019
|
}
|
|
3986
4020
|
);
|
|
3987
|
-
const [addMoreOpen, setAddMoreOpen] =
|
|
3988
|
-
const currentPrefs =
|
|
4021
|
+
const [addMoreOpen, setAddMoreOpen] = import_react7.default.useState(false);
|
|
4022
|
+
const currentPrefs = import_react7.default.useMemo(
|
|
3989
4023
|
() => ({ meetingDuration, schedulingBuffer, maxSlotsPerDay }),
|
|
3990
4024
|
[meetingDuration, schedulingBuffer, maxSlotsPerDay]
|
|
3991
4025
|
);
|
|
3992
|
-
|
|
4026
|
+
import_react7.default.useEffect(() => {
|
|
3993
4027
|
if (!hasMounted.current) return;
|
|
3994
4028
|
onSave == null ? void 0 : onSave(schedule, currentPrefs);
|
|
3995
4029
|
}, [schedule]);
|
|
3996
|
-
|
|
4030
|
+
import_react7.default.useEffect(() => {
|
|
3997
4031
|
if (!hasMounted.current) return;
|
|
3998
4032
|
onSave == null ? void 0 : onSave(schedule, currentPrefs);
|
|
3999
4033
|
}, [meetingDuration, schedulingBuffer, maxSlotsPerDay]);
|
|
4000
|
-
|
|
4034
|
+
import_react7.default.useEffect(() => {
|
|
4001
4035
|
if (!hasMounted.current) return;
|
|
4002
4036
|
const blocked = timeOffEntries.filter((e) => e.enabled).map(({ date, label, timeStart, timeEnd }) => ({
|
|
4003
4037
|
date,
|
|
@@ -4252,7 +4286,7 @@ function AppointmentAvailabilitySettings({
|
|
|
4252
4286
|
}
|
|
4253
4287
|
|
|
4254
4288
|
// src/components/ui/appointment-action-dialogs.tsx
|
|
4255
|
-
var
|
|
4289
|
+
var import_react8 = __toESM(require("react"));
|
|
4256
4290
|
var import_lucide_react16 = require("lucide-react");
|
|
4257
4291
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
4258
4292
|
function AppointmentConfirmDialog({
|
|
@@ -4263,7 +4297,7 @@ function AppointmentConfirmDialog({
|
|
|
4263
4297
|
onConfirm
|
|
4264
4298
|
}) {
|
|
4265
4299
|
const isDecline = action === "decline";
|
|
4266
|
-
const [cancelReason, setCancelReason] =
|
|
4300
|
+
const [cancelReason, setCancelReason] = import_react8.default.useState("");
|
|
4267
4301
|
const handleOpenChange = (next) => {
|
|
4268
4302
|
if (!next) setCancelReason("");
|
|
4269
4303
|
onOpenChange(next);
|
|
@@ -4323,9 +4357,9 @@ function AppointmentRescheduleDialog({
|
|
|
4323
4357
|
currentTimeEnd,
|
|
4324
4358
|
onReschedule
|
|
4325
4359
|
}) {
|
|
4326
|
-
const [date, setDate] =
|
|
4327
|
-
const [slot, setSlot] =
|
|
4328
|
-
const [note, setNote] =
|
|
4360
|
+
const [date, setDate] = import_react8.default.useState(/* @__PURE__ */ new Date());
|
|
4361
|
+
const [slot, setSlot] = import_react8.default.useState();
|
|
4362
|
+
const [note, setNote] = import_react8.default.useState("");
|
|
4329
4363
|
const handleOpenChange = (next) => {
|
|
4330
4364
|
if (!next) {
|
|
4331
4365
|
setDate(/* @__PURE__ */ new Date());
|
|
@@ -4445,17 +4479,17 @@ function AppointmentRescheduleDialog({
|
|
|
4445
4479
|
}
|
|
4446
4480
|
|
|
4447
4481
|
// src/components/ui/appointment-book-dialog.tsx
|
|
4448
|
-
var
|
|
4482
|
+
var import_react9 = __toESM(require("react"));
|
|
4449
4483
|
|
|
4450
4484
|
// src/components/ui/form-primitives.tsx
|
|
4451
|
-
var
|
|
4485
|
+
var React14 = __toESM(require("react"));
|
|
4452
4486
|
var import_lucide_react17 = require("lucide-react");
|
|
4453
4487
|
|
|
4454
4488
|
// src/components/ui/slider.tsx
|
|
4455
|
-
var
|
|
4489
|
+
var React12 = __toESM(require("react"));
|
|
4456
4490
|
var import_slider = require("@base-ui/react/slider");
|
|
4457
4491
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
4458
|
-
var Slider =
|
|
4492
|
+
var Slider = React12.forwardRef(
|
|
4459
4493
|
({
|
|
4460
4494
|
className,
|
|
4461
4495
|
value,
|
|
@@ -4524,11 +4558,11 @@ var Slider = React11.forwardRef(
|
|
|
4524
4558
|
Slider.displayName = "Slider";
|
|
4525
4559
|
|
|
4526
4560
|
// src/components/ui/toggle-group.tsx
|
|
4527
|
-
var
|
|
4561
|
+
var React13 = __toESM(require("react"));
|
|
4528
4562
|
var import_toggle_group = require("@base-ui/react/toggle-group");
|
|
4529
4563
|
var import_toggle3 = require("@base-ui/react/toggle");
|
|
4530
4564
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
4531
|
-
var ToggleGroupContext =
|
|
4565
|
+
var ToggleGroupContext = React13.createContext({
|
|
4532
4566
|
size: "default",
|
|
4533
4567
|
variant: "default",
|
|
4534
4568
|
spacing: 0
|
|
@@ -4580,7 +4614,7 @@ function ToggleGroupItem(_a) {
|
|
|
4580
4614
|
"variant",
|
|
4581
4615
|
"size"
|
|
4582
4616
|
]);
|
|
4583
|
-
const context =
|
|
4617
|
+
const context = React13.useContext(ToggleGroupContext);
|
|
4584
4618
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4585
4619
|
import_toggle3.Toggle,
|
|
4586
4620
|
__spreadProps(__spreadValues({
|
|
@@ -4624,13 +4658,13 @@ function CurrencyInputWithSlider({
|
|
|
4624
4658
|
onValueChange,
|
|
4625
4659
|
className
|
|
4626
4660
|
}) {
|
|
4627
|
-
const [internalValue, setInternalValue] =
|
|
4661
|
+
const [internalValue, setInternalValue] = React14.useState(defaultValue);
|
|
4628
4662
|
const numericValue = controlledValue !== void 0 ? controlledValue : internalValue;
|
|
4629
|
-
const [inputText, setInputText] =
|
|
4663
|
+
const [inputText, setInputText] = React14.useState(
|
|
4630
4664
|
formatNumberToCurrency(numericValue)
|
|
4631
4665
|
);
|
|
4632
|
-
const [isFocused, setIsFocused] =
|
|
4633
|
-
|
|
4666
|
+
const [isFocused, setIsFocused] = React14.useState(false);
|
|
4667
|
+
React14.useEffect(() => {
|
|
4634
4668
|
if (!isFocused) {
|
|
4635
4669
|
setInputText(formatNumberToCurrency(numericValue));
|
|
4636
4670
|
}
|
|
@@ -4700,7 +4734,7 @@ function ConcernScale({
|
|
|
4700
4734
|
className
|
|
4701
4735
|
}) {
|
|
4702
4736
|
var _a;
|
|
4703
|
-
const [internalValue, setInternalValue] =
|
|
4737
|
+
const [internalValue, setInternalValue] = React14.useState(defaultValue);
|
|
4704
4738
|
const selected = controlledValue !== void 0 ? controlledValue : internalValue;
|
|
4705
4739
|
const handleValueChange = (val) => {
|
|
4706
4740
|
const n = val ? Number(val) : 0;
|
|
@@ -4786,13 +4820,13 @@ function AddressAutocomplete({
|
|
|
4786
4820
|
onSelect,
|
|
4787
4821
|
className
|
|
4788
4822
|
}) {
|
|
4789
|
-
const [internalValue, setInternalValue] =
|
|
4823
|
+
const [internalValue, setInternalValue] = React14.useState("");
|
|
4790
4824
|
const inputValue = controlledValue !== void 0 ? controlledValue : internalValue;
|
|
4791
|
-
const [open, setOpen] =
|
|
4792
|
-
const [activeIndex, setActiveIndex] =
|
|
4793
|
-
const containerRef =
|
|
4794
|
-
const listRef =
|
|
4795
|
-
const filtered =
|
|
4825
|
+
const [open, setOpen] = React14.useState(false);
|
|
4826
|
+
const [activeIndex, setActiveIndex] = React14.useState(-1);
|
|
4827
|
+
const containerRef = React14.useRef(null);
|
|
4828
|
+
const listRef = React14.useRef(null);
|
|
4829
|
+
const filtered = React14.useMemo(() => {
|
|
4796
4830
|
if (!inputValue.trim()) return suggestions.slice(0, 5);
|
|
4797
4831
|
const q = inputValue.toLowerCase();
|
|
4798
4832
|
return suggestions.filter((s) => s.label.toLowerCase().includes(q)).slice(0, 5);
|
|
@@ -4822,7 +4856,7 @@ function AddressAutocomplete({
|
|
|
4822
4856
|
setOpen(false);
|
|
4823
4857
|
}
|
|
4824
4858
|
};
|
|
4825
|
-
|
|
4859
|
+
React14.useEffect(() => {
|
|
4826
4860
|
const handler = (e) => {
|
|
4827
4861
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
4828
4862
|
setOpen(false);
|
|
@@ -4899,7 +4933,7 @@ function OwnershipSplit({
|
|
|
4899
4933
|
onOwnersChange,
|
|
4900
4934
|
className
|
|
4901
4935
|
}) {
|
|
4902
|
-
const [internalOwners, setInternalOwners] =
|
|
4936
|
+
const [internalOwners, setInternalOwners] = React14.useState(DEFAULT_OWNERS);
|
|
4903
4937
|
const owners = controlledOwners !== void 0 ? controlledOwners : internalOwners;
|
|
4904
4938
|
const setOwners = (updated) => {
|
|
4905
4939
|
if (controlledOwners === void 0) setInternalOwners(updated);
|
|
@@ -5070,8 +5104,8 @@ function ClientSearch({
|
|
|
5070
5104
|
value,
|
|
5071
5105
|
onValueChange
|
|
5072
5106
|
}) {
|
|
5073
|
-
const [query, setQuery] =
|
|
5074
|
-
const [open, setOpen] =
|
|
5107
|
+
const [query, setQuery] = import_react9.default.useState("");
|
|
5108
|
+
const [open, setOpen] = import_react9.default.useState(false);
|
|
5075
5109
|
const selected = clients.find((c) => c.id === value);
|
|
5076
5110
|
const filtered = clients.filter((c) => {
|
|
5077
5111
|
const q = query.toLowerCase();
|
|
@@ -5224,29 +5258,29 @@ function AppointmentBookDialog({
|
|
|
5224
5258
|
Sat: 6
|
|
5225
5259
|
};
|
|
5226
5260
|
const disabledDayOfWeek = schedule == null ? void 0 : schedule.filter((d) => !d.enabled).map((d) => DAY_MAP[d.day]).filter((n) => n !== void 0);
|
|
5227
|
-
const [clientId, setClientId] =
|
|
5228
|
-
const [meetingType, setMeetingType] =
|
|
5229
|
-
const [meetingFormat, setMeetingFormat] =
|
|
5230
|
-
const [offlineLocation, setOfflineLocation] =
|
|
5261
|
+
const [clientId, setClientId] = import_react9.default.useState(void 0);
|
|
5262
|
+
const [meetingType, setMeetingType] = import_react9.default.useState("");
|
|
5263
|
+
const [meetingFormat, setMeetingFormat] = import_react9.default.useState("call");
|
|
5264
|
+
const [offlineLocation, setOfflineLocation] = import_react9.default.useState(
|
|
5231
5265
|
advisorOfficeAddress ? "office" : "custom"
|
|
5232
5266
|
);
|
|
5233
|
-
const [customAddress, setCustomAddress] =
|
|
5234
|
-
const [date, setDate] =
|
|
5235
|
-
const [selectedSlot, setSelectedSlot] =
|
|
5236
|
-
const [notes, setNotes] =
|
|
5237
|
-
const [selectedPhone, setSelectedPhone] =
|
|
5267
|
+
const [customAddress, setCustomAddress] = import_react9.default.useState("");
|
|
5268
|
+
const [date, setDate] = import_react9.default.useState(/* @__PURE__ */ new Date());
|
|
5269
|
+
const [selectedSlot, setSelectedSlot] = import_react9.default.useState(void 0);
|
|
5270
|
+
const [notes, setNotes] = import_react9.default.useState("");
|
|
5271
|
+
const [selectedPhone, setSelectedPhone] = import_react9.default.useState(
|
|
5238
5272
|
void 0
|
|
5239
5273
|
);
|
|
5240
5274
|
const selectedClient = clients.find((c) => c.id === clientId);
|
|
5241
|
-
|
|
5275
|
+
import_react9.default.useEffect(() => {
|
|
5242
5276
|
if (open && initialClientId) {
|
|
5243
5277
|
setClientId(initialClientId);
|
|
5244
5278
|
}
|
|
5245
5279
|
}, [open, initialClientId]);
|
|
5246
|
-
|
|
5280
|
+
import_react9.default.useEffect(() => {
|
|
5247
5281
|
setSelectedPhone(void 0);
|
|
5248
5282
|
}, [clientId]);
|
|
5249
|
-
|
|
5283
|
+
import_react9.default.useEffect(() => {
|
|
5250
5284
|
if (meetingFormat !== "call") {
|
|
5251
5285
|
setSelectedPhone(void 0);
|
|
5252
5286
|
}
|
|
@@ -5832,7 +5866,7 @@ function AppointmentCalendarView({
|
|
|
5832
5866
|
}
|
|
5833
5867
|
|
|
5834
5868
|
// src/components/ui/appointment-detail-sheet.tsx
|
|
5835
|
-
var
|
|
5869
|
+
var import_react10 = __toESM(require("react"));
|
|
5836
5870
|
var import_lucide_react21 = require("lucide-react");
|
|
5837
5871
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
5838
5872
|
var STATUS_CONFIG2 = {
|
|
@@ -5869,8 +5903,8 @@ function AppointmentDetailSheet({
|
|
|
5869
5903
|
onReschedule,
|
|
5870
5904
|
onBookNew
|
|
5871
5905
|
}) {
|
|
5872
|
-
const [confirmAction, setConfirmAction] =
|
|
5873
|
-
const [rescheduleOpen, setRescheduleOpen] =
|
|
5906
|
+
const [confirmAction, setConfirmAction] = import_react10.default.useState(null);
|
|
5907
|
+
const [rescheduleOpen, setRescheduleOpen] = import_react10.default.useState(false);
|
|
5874
5908
|
if (!appointment) return null;
|
|
5875
5909
|
const { variant, label, icon } = STATUS_CONFIG2[appointment.status];
|
|
5876
5910
|
const isCancelled = appointment.status === "cancelled";
|
|
@@ -6250,7 +6284,7 @@ function AppointmentMiniCard({
|
|
|
6250
6284
|
}
|
|
6251
6285
|
|
|
6252
6286
|
// src/components/ui/backoffice-alert-history-chart.tsx
|
|
6253
|
-
var
|
|
6287
|
+
var import_react11 = require("react");
|
|
6254
6288
|
var import_chart = require("chart.js");
|
|
6255
6289
|
var import_react_chartjs_2 = require("react-chartjs-2");
|
|
6256
6290
|
|
|
@@ -6654,22 +6688,22 @@ function BackofficeAlertHistoryChart({
|
|
|
6654
6688
|
className,
|
|
6655
6689
|
isLoading = false
|
|
6656
6690
|
}) {
|
|
6657
|
-
const [period, setPeriod] = (0,
|
|
6691
|
+
const [period, setPeriod] = (0, import_react11.useState)(defaultPeriod);
|
|
6658
6692
|
const themeVars = useThemeVars();
|
|
6659
6693
|
const fontFamily = themeVars["--font-sans"] || "Figtree, sans-serif";
|
|
6660
|
-
const sliced = (0,
|
|
6694
|
+
const sliced = (0, import_react11.useMemo)(() => {
|
|
6661
6695
|
if (!(chartData == null ? void 0 : chartData.length)) return null;
|
|
6662
6696
|
const count = Math.min(SLICE_COUNT[period], chartData.length);
|
|
6663
6697
|
return chartData.slice(chartData.length - count);
|
|
6664
6698
|
}, [chartData, period]);
|
|
6665
|
-
const labels = (0,
|
|
6699
|
+
const labels = (0, import_react11.useMemo)(
|
|
6666
6700
|
() => {
|
|
6667
6701
|
var _a;
|
|
6668
6702
|
return (_a = sliced == null ? void 0 : sliced.map((p) => formatMonthLabel(p.date))) != null ? _a : [];
|
|
6669
6703
|
},
|
|
6670
6704
|
[sliced]
|
|
6671
6705
|
);
|
|
6672
|
-
const data = (0,
|
|
6706
|
+
const data = (0, import_react11.useMemo)(() => {
|
|
6673
6707
|
if (!sliced) return { labels: [], datasets: [] };
|
|
6674
6708
|
return {
|
|
6675
6709
|
labels,
|
|
@@ -6698,7 +6732,7 @@ function BackofficeAlertHistoryChart({
|
|
|
6698
6732
|
]
|
|
6699
6733
|
};
|
|
6700
6734
|
}, [sliced, labels]);
|
|
6701
|
-
const options = (0,
|
|
6735
|
+
const options = (0, import_react11.useMemo)(
|
|
6702
6736
|
() => ({
|
|
6703
6737
|
responsive: true,
|
|
6704
6738
|
maintainAspectRatio: false,
|
|
@@ -6797,7 +6831,7 @@ function BackofficeAlertHistoryChart({
|
|
|
6797
6831
|
}
|
|
6798
6832
|
|
|
6799
6833
|
// src/components/ui/backoffice-alerts-chart.tsx
|
|
6800
|
-
var
|
|
6834
|
+
var import_react12 = require("react");
|
|
6801
6835
|
var import_chart2 = require("chart.js");
|
|
6802
6836
|
var import_react_chartjs_22 = require("react-chartjs-2");
|
|
6803
6837
|
var import_lucide_react23 = require("lucide-react");
|
|
@@ -6851,16 +6885,16 @@ function BackofficeAlertsChart({
|
|
|
6851
6885
|
className,
|
|
6852
6886
|
isLoading = false
|
|
6853
6887
|
}) {
|
|
6854
|
-
const [period, setPeriod] = (0,
|
|
6855
|
-
const [chartType, setChartType] = (0,
|
|
6888
|
+
const [period, setPeriod] = (0, import_react12.useState)(defaultPeriod);
|
|
6889
|
+
const [chartType, setChartType] = (0, import_react12.useState)("line");
|
|
6856
6890
|
const themeVars = useThemeVars();
|
|
6857
6891
|
const fontFamily = themeVars["--font-sans"] || "Figtree, sans-serif";
|
|
6858
|
-
const sliced = (0,
|
|
6892
|
+
const sliced = (0, import_react12.useMemo)(() => {
|
|
6859
6893
|
if (!(chartData == null ? void 0 : chartData.length)) return null;
|
|
6860
6894
|
const count = Math.min(SLICE_COUNT2[period], chartData.length);
|
|
6861
6895
|
return chartData.slice(chartData.length - count);
|
|
6862
6896
|
}, [chartData, period]);
|
|
6863
|
-
const labels = (0,
|
|
6897
|
+
const labels = (0, import_react12.useMemo)(
|
|
6864
6898
|
() => {
|
|
6865
6899
|
var _a;
|
|
6866
6900
|
return (_a = sliced == null ? void 0 : sliced.map((p) => formatMonthLabel(p.date))) != null ? _a : [];
|
|
@@ -6868,7 +6902,7 @@ function BackofficeAlertsChart({
|
|
|
6868
6902
|
[sliced]
|
|
6869
6903
|
);
|
|
6870
6904
|
const isBar = chartType === "bar";
|
|
6871
|
-
const datasets = (0,
|
|
6905
|
+
const datasets = (0, import_react12.useMemo)(() => {
|
|
6872
6906
|
if (!sliced) return [];
|
|
6873
6907
|
return [
|
|
6874
6908
|
{
|
|
@@ -6906,7 +6940,7 @@ function BackofficeAlertsChart({
|
|
|
6906
6940
|
}
|
|
6907
6941
|
];
|
|
6908
6942
|
}, [sliced, chartType, isBar]);
|
|
6909
|
-
const options = (0,
|
|
6943
|
+
const options = (0, import_react12.useMemo)(
|
|
6910
6944
|
() => ({
|
|
6911
6945
|
responsive: true,
|
|
6912
6946
|
maintainAspectRatio: false,
|
|
@@ -7021,7 +7055,7 @@ function BackofficeAlertsChart({
|
|
|
7021
7055
|
}
|
|
7022
7056
|
|
|
7023
7057
|
// src/components/ui/backoffice-connections-chart.tsx
|
|
7024
|
-
var
|
|
7058
|
+
var import_react13 = require("react");
|
|
7025
7059
|
var import_chart3 = require("chart.js");
|
|
7026
7060
|
var import_react_chartjs_23 = require("react-chartjs-2");
|
|
7027
7061
|
var import_lucide_react24 = require("lucide-react");
|
|
@@ -7095,16 +7129,16 @@ function BackofficeConnectionsChart({
|
|
|
7095
7129
|
className,
|
|
7096
7130
|
isLoading = false
|
|
7097
7131
|
}) {
|
|
7098
|
-
const [period, setPeriod] = (0,
|
|
7099
|
-
const [chartType, setChartType] = (0,
|
|
7132
|
+
const [period, setPeriod] = (0, import_react13.useState)(defaultPeriod);
|
|
7133
|
+
const [chartType, setChartType] = (0, import_react13.useState)("line");
|
|
7100
7134
|
const themeVars = useThemeVars();
|
|
7101
7135
|
const fontFamily = themeVars["--font-sans"] || "Figtree, sans-serif";
|
|
7102
|
-
const sliced = (0,
|
|
7136
|
+
const sliced = (0, import_react13.useMemo)(() => {
|
|
7103
7137
|
if (!(chartData == null ? void 0 : chartData.length)) return null;
|
|
7104
7138
|
const count = Math.min(SLICE_COUNT3[period], chartData.length);
|
|
7105
7139
|
return chartData.slice(chartData.length - count);
|
|
7106
7140
|
}, [chartData, period]);
|
|
7107
|
-
const labels = (0,
|
|
7141
|
+
const labels = (0, import_react13.useMemo)(
|
|
7108
7142
|
() => {
|
|
7109
7143
|
var _a;
|
|
7110
7144
|
return (_a = sliced == null ? void 0 : sliced.map((p) => formatMonthLabel(p.date))) != null ? _a : [];
|
|
@@ -7112,7 +7146,7 @@ function BackofficeConnectionsChart({
|
|
|
7112
7146
|
[sliced]
|
|
7113
7147
|
);
|
|
7114
7148
|
const isBar = chartType === "bar";
|
|
7115
|
-
const datasets = (0,
|
|
7149
|
+
const datasets = (0, import_react13.useMemo)(() => {
|
|
7116
7150
|
if (!sliced) return [];
|
|
7117
7151
|
return [
|
|
7118
7152
|
{
|
|
@@ -7161,7 +7195,7 @@ function BackofficeConnectionsChart({
|
|
|
7161
7195
|
}
|
|
7162
7196
|
];
|
|
7163
7197
|
}, [sliced, chartType, isBar]);
|
|
7164
|
-
const options = (0,
|
|
7198
|
+
const options = (0, import_react13.useMemo)(
|
|
7165
7199
|
() => ({
|
|
7166
7200
|
responsive: true,
|
|
7167
7201
|
maintainAspectRatio: false,
|
|
@@ -7276,7 +7310,7 @@ function BackofficeConnectionsChart({
|
|
|
7276
7310
|
}
|
|
7277
7311
|
|
|
7278
7312
|
// src/components/ui/backoffice-contact-history-chart.tsx
|
|
7279
|
-
var
|
|
7313
|
+
var import_react14 = require("react");
|
|
7280
7314
|
var import_chart4 = require("chart.js");
|
|
7281
7315
|
var import_react_chartjs_24 = require("react-chartjs-2");
|
|
7282
7316
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
@@ -7320,7 +7354,7 @@ function BackofficeContactHistoryChart({
|
|
|
7320
7354
|
className,
|
|
7321
7355
|
isLoading = false
|
|
7322
7356
|
}) {
|
|
7323
|
-
const [period, setPeriod] = (0,
|
|
7357
|
+
const [period, setPeriod] = (0, import_react14.useState)(defaultPeriod);
|
|
7324
7358
|
const themeVars = useThemeVars();
|
|
7325
7359
|
const brandPrimary = themeVars["--theme-primary"] || FALLBACK_PRIMARY;
|
|
7326
7360
|
const fontFamily = themeVars["--font-sans"] || "Figtree, sans-serif";
|
|
@@ -7328,26 +7362,26 @@ function BackofficeContactHistoryChart({
|
|
|
7328
7362
|
const emailColor = hexToRgba(brandPrimary, 0.65);
|
|
7329
7363
|
const meetingColor = hexToRgba(brandPrimary, 0.4);
|
|
7330
7364
|
const noteColor = hexToRgba(brandPrimary, 0.22);
|
|
7331
|
-
const sliced = (0,
|
|
7365
|
+
const sliced = (0, import_react14.useMemo)(() => {
|
|
7332
7366
|
if (!(chartData == null ? void 0 : chartData.length)) return null;
|
|
7333
7367
|
const count = Math.min(SLICE_COUNT4[period], chartData.length);
|
|
7334
7368
|
return chartData.slice(chartData.length - count);
|
|
7335
7369
|
}, [chartData, period]);
|
|
7336
|
-
const showNotes = (0,
|
|
7370
|
+
const showNotes = (0, import_react14.useMemo)(
|
|
7337
7371
|
() => !!(sliced == null ? void 0 : sliced.some((p) => {
|
|
7338
7372
|
var _a;
|
|
7339
7373
|
return ((_a = p.notes) != null ? _a : 0) > 0;
|
|
7340
7374
|
})),
|
|
7341
7375
|
[sliced]
|
|
7342
7376
|
);
|
|
7343
|
-
const labels = (0,
|
|
7377
|
+
const labels = (0, import_react14.useMemo)(
|
|
7344
7378
|
() => {
|
|
7345
7379
|
var _a;
|
|
7346
7380
|
return (_a = sliced == null ? void 0 : sliced.map((p) => formatMonthLabel(p.date))) != null ? _a : [];
|
|
7347
7381
|
},
|
|
7348
7382
|
[sliced]
|
|
7349
7383
|
);
|
|
7350
|
-
const data = (0,
|
|
7384
|
+
const data = (0, import_react14.useMemo)(() => {
|
|
7351
7385
|
if (!sliced) return { labels: [], datasets: [] };
|
|
7352
7386
|
return {
|
|
7353
7387
|
labels,
|
|
@@ -7396,7 +7430,7 @@ function BackofficeContactHistoryChart({
|
|
|
7396
7430
|
noteColor,
|
|
7397
7431
|
showNotes
|
|
7398
7432
|
]);
|
|
7399
|
-
const options = (0,
|
|
7433
|
+
const options = (0, import_react14.useMemo)(
|
|
7400
7434
|
() => ({
|
|
7401
7435
|
responsive: true,
|
|
7402
7436
|
maintainAspectRatio: false,
|
|
@@ -7514,7 +7548,7 @@ function BackofficeContactHistoryChart({
|
|
|
7514
7548
|
}
|
|
7515
7549
|
|
|
7516
7550
|
// src/components/ui/borrowing-capacity-line-chart.tsx
|
|
7517
|
-
var
|
|
7551
|
+
var import_react15 = require("react");
|
|
7518
7552
|
var import_chart5 = require("chart.js");
|
|
7519
7553
|
var import_react_chartjs_25 = require("react-chartjs-2");
|
|
7520
7554
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
@@ -7576,7 +7610,7 @@ function BorrowingCapacityLineChart({
|
|
|
7576
7610
|
const themeVars = useThemeVars();
|
|
7577
7611
|
const brandPrimary = themeVars["--theme-primary"] || FALLBACK_PRIMARY;
|
|
7578
7612
|
const fontFamily = themeVars["--font-sans"] || "Figtree, sans-serif";
|
|
7579
|
-
const seriesColor = (0,
|
|
7613
|
+
const seriesColor = (0, import_react15.useMemo)(
|
|
7580
7614
|
() => ({
|
|
7581
7615
|
"current-expenses": FALLBACK_FOREGROUND,
|
|
7582
7616
|
"optimised-estimate": FALLBACK_TICK,
|
|
@@ -7585,20 +7619,20 @@ function BorrowingCapacityLineChart({
|
|
|
7585
7619
|
}),
|
|
7586
7620
|
[brandPrimary]
|
|
7587
7621
|
);
|
|
7588
|
-
const orderedSeries = (0,
|
|
7622
|
+
const orderedSeries = (0, import_react15.useMemo)(() => {
|
|
7589
7623
|
if (!(series == null ? void 0 : series.length)) return [];
|
|
7590
7624
|
return SERIES_RENDER_ORDER.map(
|
|
7591
7625
|
(t) => series.find((s) => s.type === t)
|
|
7592
7626
|
).filter((s) => !!s && s.data.length > 0);
|
|
7593
7627
|
}, [series]);
|
|
7594
7628
|
const hasData = orderedSeries.length > 0;
|
|
7595
|
-
const labels = (0,
|
|
7629
|
+
const labels = (0, import_react15.useMemo)(() => {
|
|
7596
7630
|
var _a;
|
|
7597
7631
|
if (!orderedSeries.length) return [];
|
|
7598
7632
|
const primary = (_a = orderedSeries.find((s) => s.type === "current-expenses")) != null ? _a : orderedSeries[0];
|
|
7599
7633
|
return primary.data.map((p) => p.date);
|
|
7600
7634
|
}, [orderedSeries]);
|
|
7601
|
-
const chartData = (0,
|
|
7635
|
+
const chartData = (0, import_react15.useMemo)(() => {
|
|
7602
7636
|
if (!orderedSeries.length) return { labels: [], datasets: [] };
|
|
7603
7637
|
return {
|
|
7604
7638
|
labels,
|
|
@@ -7623,7 +7657,7 @@ function BorrowingCapacityLineChart({
|
|
|
7623
7657
|
})
|
|
7624
7658
|
};
|
|
7625
7659
|
}, [labels, orderedSeries, seriesColor]);
|
|
7626
|
-
const options = (0,
|
|
7660
|
+
const options = (0, import_react15.useMemo)(
|
|
7627
7661
|
() => ({
|
|
7628
7662
|
responsive: true,
|
|
7629
7663
|
maintainAspectRatio: false,
|
|
@@ -7693,7 +7727,7 @@ function BorrowingCapacityLineChart({
|
|
|
7693
7727
|
}),
|
|
7694
7728
|
[showXAxis, showYAxis, labels, fontFamily]
|
|
7695
7729
|
);
|
|
7696
|
-
const legendEl = (0,
|
|
7730
|
+
const legendEl = (0, import_react15.useMemo)(() => {
|
|
7697
7731
|
if (!showLegend || !hasData) return null;
|
|
7698
7732
|
const items = SERIES_LEGEND_ORDER.map(
|
|
7699
7733
|
(t) => orderedSeries.find((s) => s.type === t)
|
|
@@ -7738,7 +7772,7 @@ function BorrowingCapacityLineChart({
|
|
|
7738
7772
|
}
|
|
7739
7773
|
|
|
7740
7774
|
// src/components/ui/cash-balance-line-chart.tsx
|
|
7741
|
-
var
|
|
7775
|
+
var import_react16 = require("react");
|
|
7742
7776
|
var import_chart6 = require("chart.js");
|
|
7743
7777
|
var import_react_chartjs_26 = require("react-chartjs-2");
|
|
7744
7778
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
@@ -7779,7 +7813,7 @@ function CashBalanceLineChart({
|
|
|
7779
7813
|
const brandPrimary = themeVars["--theme-primary"] || FALLBACK_PRIMARY;
|
|
7780
7814
|
const fontFamily = themeVars["--font-sans"] || "Figtree, sans-serif";
|
|
7781
7815
|
const hasData = Array.isArray(chartData) && chartData.length > 0;
|
|
7782
|
-
const tickIndices = (0,
|
|
7816
|
+
const tickIndices = (0, import_react16.useMemo)(() => {
|
|
7783
7817
|
if (!hasData) return /* @__PURE__ */ new Set();
|
|
7784
7818
|
const count = chartData.length;
|
|
7785
7819
|
const step = Math.max(1, Math.floor(count / 6));
|
|
@@ -7788,7 +7822,7 @@ function CashBalanceLineChart({
|
|
|
7788
7822
|
indices.add(count - 1);
|
|
7789
7823
|
return indices;
|
|
7790
7824
|
}, [hasData, chartData]);
|
|
7791
|
-
const data = (0,
|
|
7825
|
+
const data = (0, import_react16.useMemo)(() => {
|
|
7792
7826
|
if (!hasData) return { labels: [], datasets: [] };
|
|
7793
7827
|
return {
|
|
7794
7828
|
labels: chartData.map((p) => p.x),
|
|
@@ -7812,7 +7846,7 @@ function CashBalanceLineChart({
|
|
|
7812
7846
|
]
|
|
7813
7847
|
};
|
|
7814
7848
|
}, [hasData, chartData, brandPrimary, title]);
|
|
7815
|
-
const options = (0,
|
|
7849
|
+
const options = (0, import_react16.useMemo)(
|
|
7816
7850
|
() => ({
|
|
7817
7851
|
responsive: true,
|
|
7818
7852
|
maintainAspectRatio: false,
|
|
@@ -7934,7 +7968,7 @@ function CashBalanceLineChart({
|
|
|
7934
7968
|
}
|
|
7935
7969
|
|
|
7936
7970
|
// src/components/ui/cashflow-bar-chart.tsx
|
|
7937
|
-
var
|
|
7971
|
+
var import_react17 = require("react");
|
|
7938
7972
|
var import_chart7 = require("chart.js");
|
|
7939
7973
|
var import_react_chartjs_27 = require("react-chartjs-2");
|
|
7940
7974
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
@@ -8024,12 +8058,12 @@ function CashflowBarChart({
|
|
|
8024
8058
|
className,
|
|
8025
8059
|
isLoading = false
|
|
8026
8060
|
}) {
|
|
8027
|
-
const [period, setPeriod] = (0,
|
|
8061
|
+
const [period, setPeriod] = (0, import_react17.useState)(defaultPeriod);
|
|
8028
8062
|
const themeVars = useThemeVars();
|
|
8029
8063
|
const brandPrimary = themeVars["--theme-primary"] || FALLBACK_PRIMARY;
|
|
8030
8064
|
const brandSecondary = themeVars["--theme-secondary"] || FALLBACK_SECONDARY;
|
|
8031
8065
|
const fontFamily = themeVars["--font-sans"] || "Figtree, sans-serif";
|
|
8032
|
-
const sliced = (0,
|
|
8066
|
+
const sliced = (0, import_react17.useMemo)(() => {
|
|
8033
8067
|
var _a;
|
|
8034
8068
|
if (!((_a = cashflowData == null ? void 0 : cashflowData.data) == null ? void 0 : _a.length)) return null;
|
|
8035
8069
|
const count = Math.min(period, cashflowData.data.length);
|
|
@@ -8039,7 +8073,7 @@ function CashflowBarChart({
|
|
|
8039
8073
|
data: cashflowData.data.slice(start)
|
|
8040
8074
|
};
|
|
8041
8075
|
}, [cashflowData, period]);
|
|
8042
|
-
const chartData = (0,
|
|
8076
|
+
const chartData = (0, import_react17.useMemo)(() => {
|
|
8043
8077
|
if (!sliced) return { labels: [], datasets: [] };
|
|
8044
8078
|
return {
|
|
8045
8079
|
labels: sliced.months,
|
|
@@ -8088,7 +8122,7 @@ function CashflowBarChart({
|
|
|
8088
8122
|
]
|
|
8089
8123
|
};
|
|
8090
8124
|
}, [sliced, brandPrimary, brandSecondary]);
|
|
8091
|
-
const options = (0,
|
|
8125
|
+
const options = (0, import_react17.useMemo)(
|
|
8092
8126
|
() => ({
|
|
8093
8127
|
responsive: true,
|
|
8094
8128
|
maintainAspectRatio: false,
|
|
@@ -8242,7 +8276,7 @@ function Chip(_a) {
|
|
|
8242
8276
|
}
|
|
8243
8277
|
|
|
8244
8278
|
// src/components/ui/color-picker.tsx
|
|
8245
|
-
var
|
|
8279
|
+
var React24 = __toESM(require("react"));
|
|
8246
8280
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
8247
8281
|
var COLOR_PICKER_PRESETS = [
|
|
8248
8282
|
// Blues
|
|
@@ -8320,8 +8354,8 @@ function ColorPickerContent({
|
|
|
8320
8354
|
onChange,
|
|
8321
8355
|
presets = COLOR_PICKER_PRESETS
|
|
8322
8356
|
}) {
|
|
8323
|
-
const [hexInput, setHexInput] =
|
|
8324
|
-
|
|
8357
|
+
const [hexInput, setHexInput] = React24.useState(value);
|
|
8358
|
+
React24.useEffect(() => {
|
|
8325
8359
|
setHexInput(value);
|
|
8326
8360
|
}, [value]);
|
|
8327
8361
|
function handleHexInputChange(e) {
|
|
@@ -8408,10 +8442,10 @@ function ColorPicker({
|
|
|
8408
8442
|
className
|
|
8409
8443
|
}) {
|
|
8410
8444
|
const isControlled = controlledValue !== void 0;
|
|
8411
|
-
const [internalValue, setInternalValue] =
|
|
8445
|
+
const [internalValue, setInternalValue] = React24.useState(defaultValue);
|
|
8412
8446
|
const color = isControlled ? controlledValue : internalValue;
|
|
8413
|
-
const [open, setOpen] =
|
|
8414
|
-
|
|
8447
|
+
const [open, setOpen] = React24.useState(false);
|
|
8448
|
+
React24.useEffect(() => {
|
|
8415
8449
|
if (disabled) setOpen(false);
|
|
8416
8450
|
}, [disabled]);
|
|
8417
8451
|
function handleChange(newColor) {
|
|
@@ -8635,7 +8669,7 @@ function ComboboxSeparator(_a) {
|
|
|
8635
8669
|
}
|
|
8636
8670
|
|
|
8637
8671
|
// src/components/ui/data-table.tsx
|
|
8638
|
-
var
|
|
8672
|
+
var React25 = __toESM(require("react"));
|
|
8639
8673
|
var import_react_table = require("@tanstack/react-table");
|
|
8640
8674
|
var import_lucide_react29 = require("lucide-react");
|
|
8641
8675
|
|
|
@@ -9459,20 +9493,20 @@ function DataTable({
|
|
|
9459
9493
|
onColumnFiltersChange: onColumnFiltersChangeProp
|
|
9460
9494
|
}) {
|
|
9461
9495
|
var _a;
|
|
9462
|
-
const [internalSorting, setInternalSorting] =
|
|
9496
|
+
const [internalSorting, setInternalSorting] = React25.useState(
|
|
9463
9497
|
[]
|
|
9464
9498
|
);
|
|
9465
|
-
const [internalColumnFilters, setInternalColumnFilters] =
|
|
9466
|
-
const [internalPagination, setInternalPagination] =
|
|
9499
|
+
const [internalColumnFilters, setInternalColumnFilters] = React25.useState([]);
|
|
9500
|
+
const [internalPagination, setInternalPagination] = React25.useState({
|
|
9467
9501
|
pageIndex: 0,
|
|
9468
9502
|
pageSize: (_a = pageSizeOptions[0]) != null ? _a : 10
|
|
9469
9503
|
});
|
|
9470
|
-
const [columnVisibility, setColumnVisibility] =
|
|
9471
|
-
const [rowSelection, setRowSelection] =
|
|
9504
|
+
const [columnVisibility, setColumnVisibility] = React25.useState({});
|
|
9505
|
+
const [rowSelection, setRowSelection] = React25.useState({});
|
|
9472
9506
|
const sorting = controlledSorting != null ? controlledSorting : internalSorting;
|
|
9473
9507
|
const columnFilters = controlledColumnFilters != null ? controlledColumnFilters : internalColumnFilters;
|
|
9474
9508
|
const pagination = controlledPagination != null ? controlledPagination : internalPagination;
|
|
9475
|
-
const resolvedColumns =
|
|
9509
|
+
const resolvedColumns = React25.useMemo(() => {
|
|
9476
9510
|
if (!enableRowSelection) return userColumns;
|
|
9477
9511
|
return [getSelectionColumn(), ...userColumns];
|
|
9478
9512
|
}, [userColumns, enableRowSelection]);
|
|
@@ -9688,7 +9722,7 @@ function DrawerDescription(_a) {
|
|
|
9688
9722
|
}
|
|
9689
9723
|
|
|
9690
9724
|
// src/components/ui/expense-bar-chart.tsx
|
|
9691
|
-
var
|
|
9725
|
+
var import_react18 = require("react");
|
|
9692
9726
|
var import_chart8 = require("chart.js");
|
|
9693
9727
|
var import_react_chartjs_28 = require("react-chartjs-2");
|
|
9694
9728
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
@@ -9715,9 +9749,9 @@ function ExpenseBarChart({
|
|
|
9715
9749
|
isLoading = false
|
|
9716
9750
|
}) {
|
|
9717
9751
|
const periods = CHART_PERIODS[granularity];
|
|
9718
|
-
const [period, setPeriod] = (0,
|
|
9719
|
-
const isFirstRender = (0,
|
|
9720
|
-
(0,
|
|
9752
|
+
const [period, setPeriod] = (0, import_react18.useState)(defaultPeriod);
|
|
9753
|
+
const isFirstRender = (0, import_react18.useRef)(true);
|
|
9754
|
+
(0, import_react18.useEffect)(() => {
|
|
9721
9755
|
if (isFirstRender.current) {
|
|
9722
9756
|
isFirstRender.current = false;
|
|
9723
9757
|
return;
|
|
@@ -9727,7 +9761,7 @@ function ExpenseBarChart({
|
|
|
9727
9761
|
const themeVars = useThemeVars();
|
|
9728
9762
|
const brandSecondary = themeVars["--theme-secondary"] || FALLBACK_SECONDARY;
|
|
9729
9763
|
const fontFamily = themeVars["--font-sans"] || "Figtree, sans-serif";
|
|
9730
|
-
const sliced = (0,
|
|
9764
|
+
const sliced = (0, import_react18.useMemo)(() => {
|
|
9731
9765
|
var _a, _b;
|
|
9732
9766
|
if (!((_a = expenseData == null ? void 0 : expenseData.months) == null ? void 0 : _a.length) || !expenseData.datasets.length)
|
|
9733
9767
|
return null;
|
|
@@ -9744,7 +9778,7 @@ function ExpenseBarChart({
|
|
|
9744
9778
|
}))
|
|
9745
9779
|
};
|
|
9746
9780
|
}, [expenseData, period, granularity]);
|
|
9747
|
-
const datasetColors = (0,
|
|
9781
|
+
const datasetColors = (0, import_react18.useMemo)(
|
|
9748
9782
|
() => {
|
|
9749
9783
|
var _a;
|
|
9750
9784
|
return (_a = sliced == null ? void 0 : sliced.datasets.map(
|
|
@@ -9753,7 +9787,7 @@ function ExpenseBarChart({
|
|
|
9753
9787
|
},
|
|
9754
9788
|
[sliced, brandSecondary]
|
|
9755
9789
|
);
|
|
9756
|
-
const chartData = (0,
|
|
9790
|
+
const chartData = (0, import_react18.useMemo)(() => {
|
|
9757
9791
|
if (!sliced) return { labels: [], datasets: [] };
|
|
9758
9792
|
return {
|
|
9759
9793
|
labels: sliced.months,
|
|
@@ -9774,7 +9808,7 @@ function ExpenseBarChart({
|
|
|
9774
9808
|
}))
|
|
9775
9809
|
};
|
|
9776
9810
|
}, [sliced, datasetColors, brandSecondary]);
|
|
9777
|
-
const options = (0,
|
|
9811
|
+
const options = (0, import_react18.useMemo)(
|
|
9778
9812
|
() => ({
|
|
9779
9813
|
responsive: true,
|
|
9780
9814
|
maintainAspectRatio: false,
|
|
@@ -9883,7 +9917,7 @@ function ExpenseBarChart({
|
|
|
9883
9917
|
}
|
|
9884
9918
|
|
|
9885
9919
|
// src/components/ui/field.tsx
|
|
9886
|
-
var
|
|
9920
|
+
var import_react19 = require("react");
|
|
9887
9921
|
var import_class_variance_authority8 = require("class-variance-authority");
|
|
9888
9922
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
9889
9923
|
function FieldSet(_a) {
|
|
@@ -10082,7 +10116,7 @@ function FieldError(_a) {
|
|
|
10082
10116
|
"children",
|
|
10083
10117
|
"errors"
|
|
10084
10118
|
]);
|
|
10085
|
-
const content = (0,
|
|
10119
|
+
const content = (0, import_react19.useMemo)(() => {
|
|
10086
10120
|
var _a2;
|
|
10087
10121
|
if (children) {
|
|
10088
10122
|
return children;
|
|
@@ -10116,7 +10150,7 @@ function FieldError(_a) {
|
|
|
10116
10150
|
}
|
|
10117
10151
|
|
|
10118
10152
|
// src/components/ui/financial-cards.tsx
|
|
10119
|
-
var
|
|
10153
|
+
var React27 = __toESM(require("react"));
|
|
10120
10154
|
var import_lucide_react30 = require("lucide-react");
|
|
10121
10155
|
|
|
10122
10156
|
// src/components/ui/financial-primitives.tsx
|
|
@@ -10279,7 +10313,7 @@ function PropertyCard({
|
|
|
10279
10313
|
interestCharged,
|
|
10280
10314
|
principlePaidOff
|
|
10281
10315
|
}) {
|
|
10282
|
-
const [expanded, setExpanded] =
|
|
10316
|
+
const [expanded, setExpanded] = React27.useState(false);
|
|
10283
10317
|
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
10284
10318
|
"div",
|
|
10285
10319
|
{
|
|
@@ -11134,7 +11168,7 @@ function OpportunityDetailsDrawer({
|
|
|
11134
11168
|
}
|
|
11135
11169
|
|
|
11136
11170
|
// src/components/ui/financial-sections.tsx
|
|
11137
|
-
var
|
|
11171
|
+
var import_react20 = require("react");
|
|
11138
11172
|
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
11139
11173
|
function PropertyHoldingsSection({
|
|
11140
11174
|
title = "Property Holdings",
|
|
@@ -11261,7 +11295,7 @@ function AlertAccordion({
|
|
|
11261
11295
|
onSaveActions,
|
|
11262
11296
|
isSaving = false
|
|
11263
11297
|
}) {
|
|
11264
|
-
const [actionMap, setActionMap] = (0,
|
|
11298
|
+
const [actionMap, setActionMap] = (0, import_react20.useState)(
|
|
11265
11299
|
{}
|
|
11266
11300
|
);
|
|
11267
11301
|
const handleActionChange = (id) => (action) => {
|
|
@@ -11495,7 +11529,7 @@ function FinancialViewSection({
|
|
|
11495
11529
|
}
|
|
11496
11530
|
|
|
11497
11531
|
// src/components/ui/income-bar-chart.tsx
|
|
11498
|
-
var
|
|
11532
|
+
var import_react21 = require("react");
|
|
11499
11533
|
var import_chart9 = require("chart.js");
|
|
11500
11534
|
var import_react_chartjs_29 = require("react-chartjs-2");
|
|
11501
11535
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
@@ -11522,9 +11556,9 @@ function IncomeBarChart({
|
|
|
11522
11556
|
isLoading = false
|
|
11523
11557
|
}) {
|
|
11524
11558
|
const periods = CHART_PERIODS[granularity];
|
|
11525
|
-
const [period, setPeriod] = (0,
|
|
11526
|
-
const isFirstRender = (0,
|
|
11527
|
-
(0,
|
|
11559
|
+
const [period, setPeriod] = (0, import_react21.useState)(defaultPeriod);
|
|
11560
|
+
const isFirstRender = (0, import_react21.useRef)(true);
|
|
11561
|
+
(0, import_react21.useEffect)(() => {
|
|
11528
11562
|
if (isFirstRender.current) {
|
|
11529
11563
|
isFirstRender.current = false;
|
|
11530
11564
|
return;
|
|
@@ -11534,7 +11568,7 @@ function IncomeBarChart({
|
|
|
11534
11568
|
const themeVars = useThemeVars();
|
|
11535
11569
|
const brandPrimary = themeVars["--theme-primary"] || FALLBACK_PRIMARY;
|
|
11536
11570
|
const fontFamily = themeVars["--font-sans"] || "Figtree, sans-serif";
|
|
11537
|
-
const sliced = (0,
|
|
11571
|
+
const sliced = (0, import_react21.useMemo)(() => {
|
|
11538
11572
|
var _a, _b;
|
|
11539
11573
|
if (!((_a = incomeData == null ? void 0 : incomeData.months) == null ? void 0 : _a.length) || !incomeData.datasets.length) return null;
|
|
11540
11574
|
const count = Math.min(
|
|
@@ -11550,7 +11584,7 @@ function IncomeBarChart({
|
|
|
11550
11584
|
}))
|
|
11551
11585
|
};
|
|
11552
11586
|
}, [incomeData, period, granularity]);
|
|
11553
|
-
const datasetColors = (0,
|
|
11587
|
+
const datasetColors = (0, import_react21.useMemo)(
|
|
11554
11588
|
() => {
|
|
11555
11589
|
var _a;
|
|
11556
11590
|
return (_a = sliced == null ? void 0 : sliced.datasets.map(
|
|
@@ -11559,7 +11593,7 @@ function IncomeBarChart({
|
|
|
11559
11593
|
},
|
|
11560
11594
|
[sliced, brandPrimary]
|
|
11561
11595
|
);
|
|
11562
|
-
const chartData = (0,
|
|
11596
|
+
const chartData = (0, import_react21.useMemo)(() => {
|
|
11563
11597
|
if (!sliced) return { labels: [], datasets: [] };
|
|
11564
11598
|
return {
|
|
11565
11599
|
labels: sliced.months,
|
|
@@ -11580,7 +11614,7 @@ function IncomeBarChart({
|
|
|
11580
11614
|
}))
|
|
11581
11615
|
};
|
|
11582
11616
|
}, [sliced, datasetColors, brandPrimary]);
|
|
11583
|
-
const options = (0,
|
|
11617
|
+
const options = (0, import_react21.useMemo)(
|
|
11584
11618
|
() => ({
|
|
11585
11619
|
responsive: true,
|
|
11586
11620
|
maintainAspectRatio: false,
|
|
@@ -11855,7 +11889,7 @@ function InputGroupTextarea(_a) {
|
|
|
11855
11889
|
}
|
|
11856
11890
|
|
|
11857
11891
|
// src/components/ui/input-otp.tsx
|
|
11858
|
-
var
|
|
11892
|
+
var React30 = __toESM(require("react"));
|
|
11859
11893
|
var import_input_otp = require("input-otp");
|
|
11860
11894
|
var import_lucide_react32 = require("lucide-react");
|
|
11861
11895
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
@@ -11902,7 +11936,7 @@ function InputOTPSlot(_a) {
|
|
|
11902
11936
|
"className"
|
|
11903
11937
|
]);
|
|
11904
11938
|
var _a2;
|
|
11905
|
-
const inputOTPContext =
|
|
11939
|
+
const inputOTPContext = React30.useContext(import_input_otp.OTPInputContext);
|
|
11906
11940
|
const { char, hasFakeCaret, isActive } = (_a2 = inputOTPContext.slots[index]) != null ? _a2 : {};
|
|
11907
11941
|
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
11908
11942
|
"div",
|
|
@@ -12515,7 +12549,7 @@ function KanbanColumn({
|
|
|
12515
12549
|
}
|
|
12516
12550
|
|
|
12517
12551
|
// src/components/ui/opportunity-edit-modals.tsx
|
|
12518
|
-
var
|
|
12552
|
+
var React31 = __toESM(require("react"));
|
|
12519
12553
|
var import_lucide_react35 = require("lucide-react");
|
|
12520
12554
|
|
|
12521
12555
|
// src/lib/opportunity-constants.ts
|
|
@@ -12878,9 +12912,9 @@ function EditLoanScenarioModal({
|
|
|
12878
12912
|
container,
|
|
12879
12913
|
className
|
|
12880
12914
|
}) {
|
|
12881
|
-
const [form, setForm] =
|
|
12882
|
-
const initialSnapshot =
|
|
12883
|
-
|
|
12915
|
+
const [form, setForm] = React31.useState(__spreadValues(__spreadValues({}, LOAN_SCENARIO_DEFAULTS), initialData));
|
|
12916
|
+
const initialSnapshot = React31.useRef("");
|
|
12917
|
+
React31.useEffect(() => {
|
|
12884
12918
|
if (open) {
|
|
12885
12919
|
const data = __spreadValues(__spreadValues({}, LOAN_SCENARIO_DEFAULTS), initialData);
|
|
12886
12920
|
setForm(data);
|
|
@@ -13140,11 +13174,11 @@ function EditAssetsModal({
|
|
|
13140
13174
|
container,
|
|
13141
13175
|
className
|
|
13142
13176
|
}) {
|
|
13143
|
-
const [items, setItems] =
|
|
13177
|
+
const [items, setItems] = React31.useState(
|
|
13144
13178
|
initialItems.length > 0 ? initialItems : [makeDefaultAssetItem()]
|
|
13145
13179
|
);
|
|
13146
|
-
const initialSnapshot =
|
|
13147
|
-
|
|
13180
|
+
const initialSnapshot = React31.useRef("");
|
|
13181
|
+
React31.useEffect(() => {
|
|
13148
13182
|
if (open) {
|
|
13149
13183
|
const data = initialItems.length > 0 ? initialItems : [makeDefaultAssetItem()];
|
|
13150
13184
|
setItems(data);
|
|
@@ -13437,11 +13471,11 @@ function EditDebtsModal({
|
|
|
13437
13471
|
container,
|
|
13438
13472
|
className
|
|
13439
13473
|
}) {
|
|
13440
|
-
const [items, setItems] =
|
|
13474
|
+
const [items, setItems] = React31.useState(
|
|
13441
13475
|
initialItems.length > 0 ? initialItems : [makeDefaultDebtItem()]
|
|
13442
13476
|
);
|
|
13443
|
-
const initialSnapshot =
|
|
13444
|
-
|
|
13477
|
+
const initialSnapshot = React31.useRef("");
|
|
13478
|
+
React31.useEffect(() => {
|
|
13445
13479
|
if (open) {
|
|
13446
13480
|
const data = initialItems.length > 0 ? initialItems : [makeDefaultDebtItem()];
|
|
13447
13481
|
setItems(data);
|
|
@@ -13763,9 +13797,9 @@ function EditAboutApplicantModal({
|
|
|
13763
13797
|
container,
|
|
13764
13798
|
className
|
|
13765
13799
|
}) {
|
|
13766
|
-
const [form, setForm] =
|
|
13767
|
-
const initialSnapshot =
|
|
13768
|
-
|
|
13800
|
+
const [form, setForm] = React31.useState(__spreadValues(__spreadValues({}, ABOUT_APPLICANT_DEFAULTS), initialData));
|
|
13801
|
+
const initialSnapshot = React31.useRef("");
|
|
13802
|
+
React31.useEffect(() => {
|
|
13769
13803
|
if (open) {
|
|
13770
13804
|
const data = __spreadValues(__spreadValues({}, ABOUT_APPLICANT_DEFAULTS), initialData);
|
|
13771
13805
|
setForm(data);
|
|
@@ -14037,7 +14071,7 @@ function EditIncomeModal({
|
|
|
14037
14071
|
container,
|
|
14038
14072
|
className
|
|
14039
14073
|
}) {
|
|
14040
|
-
const defaultItems =
|
|
14074
|
+
const defaultItems = React31.useMemo(
|
|
14041
14075
|
() => {
|
|
14042
14076
|
var _a;
|
|
14043
14077
|
return ((_a = initialData == null ? void 0 : initialData.items) == null ? void 0 : _a.length) ? initialData.items : [makeDefaultIncomeItem()];
|
|
@@ -14045,9 +14079,9 @@ function EditIncomeModal({
|
|
|
14045
14079
|
[]
|
|
14046
14080
|
// eslint-disable-line react-hooks/exhaustive-deps
|
|
14047
14081
|
);
|
|
14048
|
-
const [items, setItems] =
|
|
14049
|
-
const initialSnapshot =
|
|
14050
|
-
|
|
14082
|
+
const [items, setItems] = React31.useState(defaultItems);
|
|
14083
|
+
const initialSnapshot = React31.useRef("");
|
|
14084
|
+
React31.useEffect(() => {
|
|
14051
14085
|
var _a;
|
|
14052
14086
|
if (open) {
|
|
14053
14087
|
const data = ((_a = initialData == null ? void 0 : initialData.items) == null ? void 0 : _a.length) ? initialData.items : [makeDefaultIncomeItem()];
|
|
@@ -14264,7 +14298,7 @@ function EditExpensesModal({
|
|
|
14264
14298
|
container,
|
|
14265
14299
|
className
|
|
14266
14300
|
}) {
|
|
14267
|
-
const defaultItems =
|
|
14301
|
+
const defaultItems = React31.useMemo(
|
|
14268
14302
|
() => {
|
|
14269
14303
|
var _a;
|
|
14270
14304
|
return ((_a = initialData == null ? void 0 : initialData.items) == null ? void 0 : _a.length) ? initialData.items : [makeDefaultExpenseItem()];
|
|
@@ -14272,9 +14306,9 @@ function EditExpensesModal({
|
|
|
14272
14306
|
[]
|
|
14273
14307
|
// eslint-disable-line react-hooks/exhaustive-deps
|
|
14274
14308
|
);
|
|
14275
|
-
const [items, setItems] =
|
|
14276
|
-
const initialSnapshot =
|
|
14277
|
-
|
|
14309
|
+
const [items, setItems] = React31.useState(defaultItems);
|
|
14310
|
+
const initialSnapshot = React31.useRef("");
|
|
14311
|
+
React31.useEffect(() => {
|
|
14278
14312
|
var _a;
|
|
14279
14313
|
if (open) {
|
|
14280
14314
|
const data = ((_a = initialData == null ? void 0 : initialData.items) == null ? void 0 : _a.length) ? initialData.items : [makeDefaultExpenseItem()];
|
|
@@ -14407,7 +14441,7 @@ function EditExpensesModal({
|
|
|
14407
14441
|
}
|
|
14408
14442
|
|
|
14409
14443
|
// src/components/ui/opportunity-summary-tab.tsx
|
|
14410
|
-
var
|
|
14444
|
+
var import_react22 = require("react");
|
|
14411
14445
|
var import_lucide_react36 = require("lucide-react");
|
|
14412
14446
|
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
14413
14447
|
function toMonthly(amount, freq) {
|
|
@@ -14668,20 +14702,20 @@ function OpportunitySummaryTab({
|
|
|
14668
14702
|
onCoExpensesChange
|
|
14669
14703
|
}) {
|
|
14670
14704
|
var _a, _b;
|
|
14671
|
-
const [portalEl, setPortalEl] = (0,
|
|
14672
|
-
const [summarySubTab, setSummarySubTab] = (0,
|
|
14705
|
+
const [portalEl, setPortalEl] = (0, import_react22.useState)(null);
|
|
14706
|
+
const [summarySubTab, setSummarySubTab] = (0, import_react22.useState)(
|
|
14673
14707
|
"joint"
|
|
14674
14708
|
);
|
|
14675
|
-
const [loanScenarioExpanded, setLoanScenarioExpanded] = (0,
|
|
14676
|
-
const [editLoanOpen, setEditLoanOpen] = (0,
|
|
14677
|
-
const [editAssetsOpen, setEditAssetsOpen] = (0,
|
|
14678
|
-
const [editDebtsOpen, setEditDebtsOpen] = (0,
|
|
14679
|
-
const [editMainAboutOpen, setEditMainAboutOpen] = (0,
|
|
14680
|
-
const [editCoAboutOpen, setEditCoAboutOpen] = (0,
|
|
14681
|
-
const [editMainIncomeOpen, setEditMainIncomeOpen] = (0,
|
|
14682
|
-
const [editCoIncomeOpen, setEditCoIncomeOpen] = (0,
|
|
14683
|
-
const [editMainExpensesOpen, setEditMainExpensesOpen] = (0,
|
|
14684
|
-
const [editCoExpensesOpen, setEditCoExpensesOpen] = (0,
|
|
14709
|
+
const [loanScenarioExpanded, setLoanScenarioExpanded] = (0, import_react22.useState)(true);
|
|
14710
|
+
const [editLoanOpen, setEditLoanOpen] = (0, import_react22.useState)(false);
|
|
14711
|
+
const [editAssetsOpen, setEditAssetsOpen] = (0, import_react22.useState)(false);
|
|
14712
|
+
const [editDebtsOpen, setEditDebtsOpen] = (0, import_react22.useState)(false);
|
|
14713
|
+
const [editMainAboutOpen, setEditMainAboutOpen] = (0, import_react22.useState)(false);
|
|
14714
|
+
const [editCoAboutOpen, setEditCoAboutOpen] = (0, import_react22.useState)(false);
|
|
14715
|
+
const [editMainIncomeOpen, setEditMainIncomeOpen] = (0, import_react22.useState)(false);
|
|
14716
|
+
const [editCoIncomeOpen, setEditCoIncomeOpen] = (0, import_react22.useState)(false);
|
|
14717
|
+
const [editMainExpensesOpen, setEditMainExpensesOpen] = (0, import_react22.useState)(false);
|
|
14718
|
+
const [editCoExpensesOpen, setEditCoExpensesOpen] = (0, import_react22.useState)(false);
|
|
14685
14719
|
const totalAssetsAmount = assets.reduce((sum, a) => sum + a.value, 0);
|
|
14686
14720
|
const totalDebtsAmount = debts.reduce((sum, d) => sum + d.amountOwing, 0);
|
|
14687
14721
|
const totalAssets = formatCurrency(totalAssetsAmount);
|
|
@@ -15071,8 +15105,9 @@ function OpportunitySummaryTab({
|
|
|
15071
15105
|
}
|
|
15072
15106
|
|
|
15073
15107
|
// src/components/ui/sidebar-nav.tsx
|
|
15074
|
-
var
|
|
15108
|
+
var React32 = __toESM(require("react"));
|
|
15075
15109
|
var import_lucide_react37 = require("lucide-react");
|
|
15110
|
+
var import_accordion6 = require("@base-ui/react/accordion");
|
|
15076
15111
|
|
|
15077
15112
|
// src/components/ui/tooltip.tsx
|
|
15078
15113
|
var import_tooltip = require("@base-ui/react/tooltip");
|
|
@@ -15217,7 +15252,7 @@ function SidebarNavItemView({
|
|
|
15217
15252
|
Icon,
|
|
15218
15253
|
{
|
|
15219
15254
|
className: navIconCn((_a = item.isActive) != null ? _a : false),
|
|
15220
|
-
size:
|
|
15255
|
+
size: 24,
|
|
15221
15256
|
strokeWidth: 1.75
|
|
15222
15257
|
}
|
|
15223
15258
|
),
|
|
@@ -15234,8 +15269,8 @@ function CollapsibleNavItem({
|
|
|
15234
15269
|
var _a, _b;
|
|
15235
15270
|
const Icon = item.icon;
|
|
15236
15271
|
const hasActiveChild = (_b = (_a = item.subItems) == null ? void 0 : _a.some((sub) => sub.isActive)) != null ? _b : false;
|
|
15237
|
-
const [open, setOpen] =
|
|
15238
|
-
|
|
15272
|
+
const [open, setOpen] = React32.useState(hasActiveChild);
|
|
15273
|
+
React32.useEffect(() => {
|
|
15239
15274
|
if (hasActiveChild) setOpen(true);
|
|
15240
15275
|
}, [hasActiveChild]);
|
|
15241
15276
|
if (collapsed) {
|
|
@@ -15254,79 +15289,83 @@ function CollapsibleNavItem({
|
|
|
15254
15289
|
Icon,
|
|
15255
15290
|
{
|
|
15256
15291
|
className: navIconCn(hasActiveChild),
|
|
15257
|
-
size:
|
|
15292
|
+
size: 24,
|
|
15258
15293
|
strokeWidth: 1.75
|
|
15259
15294
|
}
|
|
15260
15295
|
)
|
|
15261
15296
|
}
|
|
15262
15297
|
) });
|
|
15263
15298
|
}
|
|
15264
|
-
return /* @__PURE__ */ (0, import_jsx_runtime74.
|
|
15265
|
-
|
|
15266
|
-
|
|
15267
|
-
|
|
15268
|
-
|
|
15269
|
-
|
|
15270
|
-
|
|
15271
|
-
|
|
15272
|
-
|
|
15273
|
-
|
|
15274
|
-
|
|
15275
|
-
|
|
15276
|
-
|
|
15277
|
-
|
|
15278
|
-
|
|
15279
|
-
|
|
15280
|
-
|
|
15281
|
-
|
|
15282
|
-
|
|
15283
|
-
|
|
15284
|
-
|
|
15285
|
-
|
|
15286
|
-
|
|
15287
|
-
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15288
|
-
import_lucide_react37.ChevronDown,
|
|
15289
|
-
{
|
|
15290
|
-
className: cn(
|
|
15291
|
-
"ml-auto shrink-0 text-brand-secondary-foreground/40 transition-transform duration-200",
|
|
15292
|
-
open && "rotate-180"
|
|
15299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15300
|
+
Accordion,
|
|
15301
|
+
{
|
|
15302
|
+
value: open ? [item.href] : [],
|
|
15303
|
+
onValueChange: (values) => setOpen(values.length > 0),
|
|
15304
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(AccordionItem, { className: "border-none", value: item.href, children: [
|
|
15305
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_accordion6.Accordion.Header, { className: "flex", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
15306
|
+
import_accordion6.Accordion.Trigger,
|
|
15307
|
+
{
|
|
15308
|
+
className: cn(
|
|
15309
|
+
"group flex h-auto w-full items-center justify-start gap-3 px-3 py-2.5 text-base font-medium transition-colors",
|
|
15310
|
+
"text-brand-secondary-foreground/70 hover:bg-white/10 hover:text-brand-secondary-foreground",
|
|
15311
|
+
"border-l-4 border-transparent",
|
|
15312
|
+
hasActiveChild && "bg-white/15 text-brand-secondary-foreground border-primary"
|
|
15313
|
+
),
|
|
15314
|
+
children: [
|
|
15315
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15316
|
+
Icon,
|
|
15317
|
+
{
|
|
15318
|
+
className: navIconCn(hasActiveChild),
|
|
15319
|
+
size: 24,
|
|
15320
|
+
strokeWidth: 1.75
|
|
15321
|
+
}
|
|
15293
15322
|
),
|
|
15294
|
-
|
|
15295
|
-
|
|
15296
|
-
|
|
15297
|
-
|
|
15298
|
-
|
|
15299
|
-
|
|
15300
|
-
|
|
15301
|
-
|
|
15302
|
-
|
|
15303
|
-
|
|
15304
|
-
|
|
15305
|
-
variant: "ghost",
|
|
15306
|
-
onClick: () => onNavigate == null ? void 0 : onNavigate(sub.href),
|
|
15307
|
-
className: cn(
|
|
15308
|
-
"h-auto w-full justify-start gap-2 py-1.5 pl-1 text-sm transition-colors",
|
|
15309
|
-
"text-brand-secondary-foreground/50 hover:text-brand-secondary-foreground",
|
|
15310
|
-
sub.isActive && "text-primary font-medium"
|
|
15311
|
-
),
|
|
15312
|
-
children: [
|
|
15313
|
-
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15314
|
-
import_lucide_react37.ChevronRight,
|
|
15315
|
-
{
|
|
15316
|
-
size: 11,
|
|
15317
|
-
strokeWidth: 2,
|
|
15318
|
-
className: cn(
|
|
15319
|
-
"shrink-0",
|
|
15320
|
-
sub.isActive ? "text-primary" : "text-brand-secondary-foreground/30"
|
|
15323
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "flex-1 truncate text-left", children: item.title }),
|
|
15324
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15325
|
+
import_lucide_react37.ChevronDown,
|
|
15326
|
+
{
|
|
15327
|
+
className: cn(
|
|
15328
|
+
"ml-auto shrink-0 text-brand-secondary-foreground/40 transition-transform duration-200",
|
|
15329
|
+
"group-data-[panel-open]:rotate-180"
|
|
15330
|
+
),
|
|
15331
|
+
size: 14,
|
|
15332
|
+
strokeWidth: 2
|
|
15333
|
+
}
|
|
15321
15334
|
)
|
|
15322
|
-
|
|
15323
|
-
|
|
15324
|
-
|
|
15325
|
-
|
|
15326
|
-
|
|
15327
|
-
|
|
15328
|
-
|
|
15329
|
-
|
|
15335
|
+
]
|
|
15336
|
+
}
|
|
15337
|
+
) }),
|
|
15338
|
+
item.subItems && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(AccordionContent, { className: "p-0 text-inherit", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "ml-9 border-l border-white/15 pl-3", children: item.subItems.map((sub) => /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
15339
|
+
Button,
|
|
15340
|
+
{
|
|
15341
|
+
type: "button",
|
|
15342
|
+
variant: "ghost",
|
|
15343
|
+
onClick: () => onNavigate == null ? void 0 : onNavigate(sub.href),
|
|
15344
|
+
className: cn(
|
|
15345
|
+
"h-auto w-full justify-start gap-2 py-1.5 pl-1 text-sm transition-colors",
|
|
15346
|
+
"text-brand-secondary-foreground/50 hover:text-brand-secondary-foreground",
|
|
15347
|
+
sub.isActive && "text-primary font-medium"
|
|
15348
|
+
),
|
|
15349
|
+
children: [
|
|
15350
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15351
|
+
import_lucide_react37.ChevronRight,
|
|
15352
|
+
{
|
|
15353
|
+
size: 11,
|
|
15354
|
+
strokeWidth: 2,
|
|
15355
|
+
className: cn(
|
|
15356
|
+
"shrink-0",
|
|
15357
|
+
sub.isActive ? "text-primary" : "text-brand-secondary-foreground/30"
|
|
15358
|
+
)
|
|
15359
|
+
}
|
|
15360
|
+
),
|
|
15361
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "truncate", children: sub.title })
|
|
15362
|
+
]
|
|
15363
|
+
},
|
|
15364
|
+
sub.href
|
|
15365
|
+
)) }) })
|
|
15366
|
+
] })
|
|
15367
|
+
}
|
|
15368
|
+
);
|
|
15330
15369
|
}
|
|
15331
15370
|
function SidebarNav({
|
|
15332
15371
|
items,
|
|
@@ -15340,7 +15379,24 @@ function SidebarNav({
|
|
|
15340
15379
|
onCollapsedChange,
|
|
15341
15380
|
className
|
|
15342
15381
|
}) {
|
|
15343
|
-
const [userMenuOpen, setUserMenuOpen] =
|
|
15382
|
+
const [userMenuOpen, setUserMenuOpen] = React32.useState(false);
|
|
15383
|
+
const navScrollRef = React32.useRef(null);
|
|
15384
|
+
const expandedScrollRef = React32.useRef(0);
|
|
15385
|
+
React32.useEffect(() => {
|
|
15386
|
+
if (collapsed) setUserMenuOpen(false);
|
|
15387
|
+
}, [collapsed]);
|
|
15388
|
+
React32.useLayoutEffect(() => {
|
|
15389
|
+
const nav = navScrollRef.current;
|
|
15390
|
+
if (!nav) return;
|
|
15391
|
+
if (!collapsed) {
|
|
15392
|
+
nav.scrollTop = expandedScrollRef.current;
|
|
15393
|
+
}
|
|
15394
|
+
return () => {
|
|
15395
|
+
if (!collapsed && nav) {
|
|
15396
|
+
expandedScrollRef.current = nav.scrollTop;
|
|
15397
|
+
}
|
|
15398
|
+
};
|
|
15399
|
+
}, [collapsed]);
|
|
15344
15400
|
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
15345
15401
|
"nav",
|
|
15346
15402
|
{
|
|
@@ -15356,81 +15412,115 @@ function SidebarNav({
|
|
|
15356
15412
|
className
|
|
15357
15413
|
),
|
|
15358
15414
|
children: [
|
|
15359
|
-
|
|
15360
|
-
|
|
15361
|
-
|
|
15362
|
-
src: logo,
|
|
15363
|
-
alt: "Logo",
|
|
15364
|
-
className: "h-8 w-auto object-contain object-left",
|
|
15365
|
-
style: { filter: "brightness(0) invert(1)" }
|
|
15366
|
-
}
|
|
15367
|
-
) }),
|
|
15368
|
-
collapsed && logoCollapsed && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "flex items-center justify-center border-b border-white/15 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15369
|
-
"img",
|
|
15370
|
-
{
|
|
15371
|
-
src: logoCollapsed,
|
|
15372
|
-
alt: "Logo",
|
|
15373
|
-
className: "h-8 w-8 object-contain",
|
|
15374
|
-
style: { filter: "brightness(0) invert(1)" }
|
|
15375
|
-
}
|
|
15376
|
-
) }),
|
|
15377
|
-
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "border-b border-white/15", children: [
|
|
15378
|
-
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(NavTooltip, { label: userName, collapsed, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
15379
|
-
Button,
|
|
15415
|
+
(logo || logoCollapsed) && /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "relative flex items-center border-b border-white/15 py-4 overflow-hidden", children: [
|
|
15416
|
+
logo && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15417
|
+
"img",
|
|
15380
15418
|
{
|
|
15381
|
-
|
|
15382
|
-
|
|
15383
|
-
onClick: () => !collapsed && setUserMenuOpen((prev) => !prev),
|
|
15419
|
+
src: logo,
|
|
15420
|
+
alt: "Logo",
|
|
15384
15421
|
className: cn(
|
|
15385
|
-
"
|
|
15386
|
-
"
|
|
15387
|
-
collapsed && "justify-center px-2 py-4"
|
|
15422
|
+
"h-8 w-auto object-contain object-left px-5 transition-opacity duration-200",
|
|
15423
|
+
collapsed ? "opacity-0" : "opacity-100"
|
|
15388
15424
|
),
|
|
15389
|
-
|
|
15390
|
-
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "flex h-8 w-8 shrink-0 items-center justify-center font-semibold text-xs bg-primary text-primary-foreground", children: getInitials(userName) }),
|
|
15391
|
-
!collapsed && /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_jsx_runtime74.Fragment, { children: [
|
|
15392
|
-
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "flex-1 truncate text-left font-medium text-brand-secondary-foreground", children: userName }),
|
|
15393
|
-
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15394
|
-
import_lucide_react37.ChevronDown,
|
|
15395
|
-
{
|
|
15396
|
-
className: cn(
|
|
15397
|
-
"shrink-0 text-brand-secondary-foreground/50 transition-transform duration-200",
|
|
15398
|
-
userMenuOpen && "rotate-180"
|
|
15399
|
-
),
|
|
15400
|
-
size: 16,
|
|
15401
|
-
strokeWidth: 2
|
|
15402
|
-
}
|
|
15403
|
-
)
|
|
15404
|
-
] })
|
|
15405
|
-
]
|
|
15425
|
+
style: { filter: "brightness(0) invert(1)" }
|
|
15406
15426
|
}
|
|
15407
|
-
)
|
|
15408
|
-
|
|
15409
|
-
|
|
15427
|
+
),
|
|
15428
|
+
logoCollapsed && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15429
|
+
"img",
|
|
15410
15430
|
{
|
|
15411
|
-
|
|
15412
|
-
|
|
15413
|
-
onClick: onLogout,
|
|
15431
|
+
src: logoCollapsed,
|
|
15432
|
+
alt: "Logo",
|
|
15414
15433
|
className: cn(
|
|
15415
|
-
"
|
|
15416
|
-
"
|
|
15434
|
+
"absolute inset-y-0 left-0 right-0 m-auto h-8 w-8 object-contain transition-opacity duration-200",
|
|
15435
|
+
collapsed ? "opacity-100" : "opacity-0"
|
|
15417
15436
|
),
|
|
15418
|
-
|
|
15419
|
-
|
|
15420
|
-
|
|
15421
|
-
|
|
15422
|
-
|
|
15423
|
-
|
|
15424
|
-
|
|
15425
|
-
|
|
15426
|
-
|
|
15427
|
-
|
|
15428
|
-
|
|
15437
|
+
style: { filter: "brightness(0) invert(1)" }
|
|
15438
|
+
}
|
|
15439
|
+
)
|
|
15440
|
+
] }),
|
|
15441
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "relative border-b border-white/15", children: [
|
|
15442
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15443
|
+
"div",
|
|
15444
|
+
{
|
|
15445
|
+
className: cn(
|
|
15446
|
+
collapsed ? "opacity-0 pointer-events-none" : "opacity-100"
|
|
15447
|
+
),
|
|
15448
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15449
|
+
Accordion,
|
|
15450
|
+
{
|
|
15451
|
+
value: userMenuOpen ? ["user-menu"] : [],
|
|
15452
|
+
onValueChange: (values) => setUserMenuOpen(values.length > 0),
|
|
15453
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(AccordionItem, { className: "border-none", value: "user-menu", children: [
|
|
15454
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_accordion6.Accordion.Header, { className: "flex", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
15455
|
+
import_accordion6.Accordion.Trigger,
|
|
15456
|
+
{
|
|
15457
|
+
className: cn(
|
|
15458
|
+
"group flex h-auto w-full items-center justify-start gap-3 px-5 py-5 text-base transition-colors",
|
|
15459
|
+
"text-brand-secondary-foreground hover:bg-white/10"
|
|
15460
|
+
),
|
|
15461
|
+
children: [
|
|
15462
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "flex h-8 w-8 shrink-0 items-center justify-center font-semibold text-xs bg-primary text-primary-foreground", children: getInitials(userName) }),
|
|
15463
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "flex-1 truncate text-left font-medium text-brand-secondary-foreground", children: userName }),
|
|
15464
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15465
|
+
import_lucide_react37.ChevronDown,
|
|
15466
|
+
{
|
|
15467
|
+
className: "ml-auto shrink-0 text-brand-secondary-foreground/50 transition-transform duration-200 group-data-[panel-open]:rotate-180",
|
|
15468
|
+
size: 16,
|
|
15469
|
+
strokeWidth: 2
|
|
15470
|
+
}
|
|
15471
|
+
)
|
|
15472
|
+
]
|
|
15473
|
+
}
|
|
15474
|
+
) }),
|
|
15475
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(AccordionContent, { className: "p-0 text-inherit", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "border-t border-white/15 bg-black/20", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
15476
|
+
Button,
|
|
15477
|
+
{
|
|
15478
|
+
type: "button",
|
|
15479
|
+
variant: "ghost",
|
|
15480
|
+
onClick: onLogout,
|
|
15481
|
+
className: cn(
|
|
15482
|
+
"h-auto w-full justify-start gap-3 px-5 py-3 text-base",
|
|
15483
|
+
"text-brand-secondary-foreground/70 hover:bg-white/10 hover:text-brand-secondary-foreground transition-colors"
|
|
15484
|
+
),
|
|
15485
|
+
children: [
|
|
15486
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15487
|
+
import_lucide_react37.LogOut,
|
|
15488
|
+
{
|
|
15489
|
+
size: 16,
|
|
15490
|
+
strokeWidth: 1.75,
|
|
15491
|
+
className: "shrink-0 text-destructive"
|
|
15492
|
+
}
|
|
15493
|
+
),
|
|
15494
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { children: "Logout" })
|
|
15495
|
+
]
|
|
15496
|
+
}
|
|
15497
|
+
) }) })
|
|
15498
|
+
] })
|
|
15499
|
+
}
|
|
15500
|
+
)
|
|
15501
|
+
}
|
|
15502
|
+
),
|
|
15503
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(NavTooltip, { label: userName, collapsed, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15504
|
+
"div",
|
|
15505
|
+
{
|
|
15506
|
+
className: cn(
|
|
15507
|
+
"absolute inset-0 flex items-center justify-center transition-opacity duration-200",
|
|
15508
|
+
collapsed ? "opacity-100" : "opacity-0 pointer-events-none"
|
|
15509
|
+
),
|
|
15510
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "flex h-8 w-8 shrink-0 items-center justify-center font-semibold text-xs bg-primary text-primary-foreground", children: getInitials(userName) })
|
|
15429
15511
|
}
|
|
15430
15512
|
) })
|
|
15431
15513
|
] }),
|
|
15432
|
-
|
|
15433
|
-
|
|
15514
|
+
!!(metricsGroups == null ? void 0 : metricsGroups.length) && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15515
|
+
Accordion,
|
|
15516
|
+
{
|
|
15517
|
+
value: !collapsed ? ["metrics"] : [],
|
|
15518
|
+
onValueChange: () => {
|
|
15519
|
+
},
|
|
15520
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(AccordionItem, { className: "border-none", value: "metrics", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(AccordionContent, { className: "p-0 text-inherit", children: metricsGroups.map((group, i) => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(MetricsGroup, { group }, i)) }) })
|
|
15521
|
+
}
|
|
15522
|
+
),
|
|
15523
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { ref: navScrollRef, className: "flex flex-col overflow-y-auto py-3", children: items.map(
|
|
15434
15524
|
(item) => item.isCollapsible ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15435
15525
|
CollapsibleNavItem,
|
|
15436
15526
|
{
|
|
@@ -15461,7 +15551,7 @@ function SidebarNav({
|
|
|
15461
15551
|
variant: "ghost",
|
|
15462
15552
|
onClick: () => onCollapsedChange(!collapsed),
|
|
15463
15553
|
className: cn(
|
|
15464
|
-
"h-
|
|
15554
|
+
"h-12 w-full justify-start gap-3 px-3 py-3 transition-colors",
|
|
15465
15555
|
"text-brand-secondary-foreground/80 hover:bg-white/10 hover:text-brand-secondary-foreground",
|
|
15466
15556
|
collapsed && "justify-center px-2"
|
|
15467
15557
|
),
|
|
@@ -15469,14 +15559,14 @@ function SidebarNav({
|
|
|
15469
15559
|
collapsed ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15470
15560
|
import_lucide_react37.PanelLeftOpen,
|
|
15471
15561
|
{
|
|
15472
|
-
size:
|
|
15562
|
+
size: 24,
|
|
15473
15563
|
strokeWidth: 1.75,
|
|
15474
15564
|
className: "shrink-0"
|
|
15475
15565
|
}
|
|
15476
15566
|
) : /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15477
15567
|
import_lucide_react37.PanelLeftClose,
|
|
15478
15568
|
{
|
|
15479
|
-
size:
|
|
15569
|
+
size: 24,
|
|
15480
15570
|
strokeWidth: 1.75,
|
|
15481
15571
|
className: "shrink-0"
|
|
15482
15572
|
}
|
|
@@ -15670,7 +15760,7 @@ function PipelineBoard({
|
|
|
15670
15760
|
}
|
|
15671
15761
|
|
|
15672
15762
|
// src/components/ui/pipeline-chart.tsx
|
|
15673
|
-
var
|
|
15763
|
+
var React33 = __toESM(require("react"));
|
|
15674
15764
|
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
15675
15765
|
function formatValue(v) {
|
|
15676
15766
|
return new Intl.NumberFormat("en-AU", {
|
|
@@ -15693,9 +15783,9 @@ function PipelineChart({
|
|
|
15693
15783
|
className
|
|
15694
15784
|
}) {
|
|
15695
15785
|
const themeVars = useThemeVars();
|
|
15696
|
-
const [activeId, setActiveId] =
|
|
15697
|
-
const [tooltipX, setTooltipX] =
|
|
15698
|
-
const barRef =
|
|
15786
|
+
const [activeId, setActiveId] = React33.useState(null);
|
|
15787
|
+
const [tooltipX, setTooltipX] = React33.useState(0);
|
|
15788
|
+
const barRef = React33.useRef(null);
|
|
15699
15789
|
const nonEmpty = stages.filter((s) => s.value > 0);
|
|
15700
15790
|
const total = nonEmpty.reduce((sum, s) => sum + s.value, 0);
|
|
15701
15791
|
if (total === 0 || stages.length === 0) {
|
|
@@ -15800,7 +15890,7 @@ function PipelineChart({
|
|
|
15800
15890
|
}
|
|
15801
15891
|
|
|
15802
15892
|
// src/components/ui/pipeline-dialogs.tsx
|
|
15803
|
-
var
|
|
15893
|
+
var React34 = __toESM(require("react"));
|
|
15804
15894
|
var import_date_fns3 = require("date-fns");
|
|
15805
15895
|
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
15806
15896
|
function DeleteOpportunityDialog({
|
|
@@ -15914,10 +16004,10 @@ function PutOnHoldDialog({
|
|
|
15914
16004
|
onSave,
|
|
15915
16005
|
className
|
|
15916
16006
|
}) {
|
|
15917
|
-
const [duration, setDuration] =
|
|
15918
|
-
const [customDate, setCustomDate] =
|
|
15919
|
-
const today =
|
|
15920
|
-
const resolvedDate =
|
|
16007
|
+
const [duration, setDuration] = React34.useState("90");
|
|
16008
|
+
const [customDate, setCustomDate] = React34.useState();
|
|
16009
|
+
const today = React34.useMemo(() => (0, import_date_fns3.startOfDay)(/* @__PURE__ */ new Date()), []);
|
|
16010
|
+
const resolvedDate = React34.useMemo(() => {
|
|
15921
16011
|
if (duration === "custom") return customDate;
|
|
15922
16012
|
return (0, import_date_fns3.addDays)(today, parseInt(duration, 10));
|
|
15923
16013
|
}, [duration, customDate, today]);
|
|
@@ -15926,7 +16016,7 @@ function PutOnHoldDialog({
|
|
|
15926
16016
|
if (!resolvedDate) return;
|
|
15927
16017
|
onSave((0, import_date_fns3.format)(resolvedDate, "yyyy-MM-dd"));
|
|
15928
16018
|
}
|
|
15929
|
-
|
|
16019
|
+
React34.useEffect(() => {
|
|
15930
16020
|
if (open) {
|
|
15931
16021
|
setDuration("90");
|
|
15932
16022
|
setCustomDate(void 0);
|
|
@@ -16068,7 +16158,7 @@ function Progress(_a) {
|
|
|
16068
16158
|
}
|
|
16069
16159
|
|
|
16070
16160
|
// src/components/ui/property-cashflow-doughnut-chart.tsx
|
|
16071
|
-
var
|
|
16161
|
+
var import_react23 = require("react");
|
|
16072
16162
|
var import_chart10 = require("chart.js");
|
|
16073
16163
|
var import_react_chartjs_210 = require("react-chartjs-2");
|
|
16074
16164
|
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
@@ -16092,7 +16182,7 @@ function PropertyCashflowDoughnutChart({
|
|
|
16092
16182
|
const total = incomeVal + expensesVal;
|
|
16093
16183
|
const netCashflow = incomeVal - expensesVal;
|
|
16094
16184
|
const hasData = total > 0;
|
|
16095
|
-
const chartData = (0,
|
|
16185
|
+
const chartData = (0, import_react23.useMemo)(
|
|
16096
16186
|
() => ({
|
|
16097
16187
|
labels: ["Income", "Expenses"],
|
|
16098
16188
|
datasets: [
|
|
@@ -16106,7 +16196,7 @@ function PropertyCashflowDoughnutChart({
|
|
|
16106
16196
|
}),
|
|
16107
16197
|
[incomeVal, expensesVal, brandPrimary, brandSecondary]
|
|
16108
16198
|
);
|
|
16109
|
-
const options = (0,
|
|
16199
|
+
const options = (0, import_react23.useMemo)(
|
|
16110
16200
|
() => ({
|
|
16111
16201
|
responsive: true,
|
|
16112
16202
|
maintainAspectRatio: false,
|
|
@@ -16198,7 +16288,7 @@ function PropertyCashflowDoughnutChart({
|
|
|
16198
16288
|
}
|
|
16199
16289
|
|
|
16200
16290
|
// src/components/ui/property-debt-equity-doughnut-chart.tsx
|
|
16201
|
-
var
|
|
16291
|
+
var import_react24 = require("react");
|
|
16202
16292
|
var import_chart11 = require("chart.js");
|
|
16203
16293
|
var import_react_chartjs_211 = require("react-chartjs-2");
|
|
16204
16294
|
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
@@ -16221,7 +16311,7 @@ function PropertyDebtEquityDoughnutChart({
|
|
|
16221
16311
|
const debt = Math.min(debtValue != null ? debtValue : 0, estimate);
|
|
16222
16312
|
const equity = Math.max(0, estimate - debt);
|
|
16223
16313
|
const hasData = estimate > 0;
|
|
16224
|
-
const chartData = (0,
|
|
16314
|
+
const chartData = (0, import_react24.useMemo)(
|
|
16225
16315
|
() => ({
|
|
16226
16316
|
labels: ["Equity", "Debt"],
|
|
16227
16317
|
datasets: [
|
|
@@ -16235,7 +16325,7 @@ function PropertyDebtEquityDoughnutChart({
|
|
|
16235
16325
|
}),
|
|
16236
16326
|
[equity, debt, brandPrimary, brandSecondary]
|
|
16237
16327
|
);
|
|
16238
|
-
const options = (0,
|
|
16328
|
+
const options = (0, import_react24.useMemo)(
|
|
16239
16329
|
() => ({
|
|
16240
16330
|
responsive: true,
|
|
16241
16331
|
maintainAspectRatio: false,
|
|
@@ -16326,7 +16416,7 @@ function PropertyDebtEquityDoughnutChart({
|
|
|
16326
16416
|
}
|
|
16327
16417
|
|
|
16328
16418
|
// src/components/ui/property-mobile-estimate-line-chart.tsx
|
|
16329
|
-
var
|
|
16419
|
+
var import_react25 = require("react");
|
|
16330
16420
|
var import_chart12 = require("chart.js");
|
|
16331
16421
|
var import_react_chartjs_212 = require("react-chartjs-2");
|
|
16332
16422
|
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
@@ -16400,29 +16490,29 @@ function PropertyMobileEstimateLineChart({
|
|
|
16400
16490
|
className,
|
|
16401
16491
|
isLoading = false
|
|
16402
16492
|
}) {
|
|
16403
|
-
const [period, setPeriod] = (0,
|
|
16493
|
+
const [period, setPeriod] = (0, import_react25.useState)(defaultPeriod);
|
|
16404
16494
|
const themeVars = useThemeVars();
|
|
16405
16495
|
const brandPrimary = themeVars["--theme-primary"] || FALLBACK_PRIMARY;
|
|
16406
16496
|
const brandSecondary = themeVars["--theme-secondary"] || FALLBACK_SECONDARY;
|
|
16407
16497
|
const fontFamily = themeVars["--font-sans"] || "Figtree, sans-serif";
|
|
16408
|
-
const sliced = (0,
|
|
16498
|
+
const sliced = (0, import_react25.useMemo)(() => {
|
|
16409
16499
|
if (!(chartData == null ? void 0 : chartData.length)) return null;
|
|
16410
16500
|
const count = Math.min(PROPERTY_SLICE_COUNT[period], chartData.length);
|
|
16411
16501
|
const start = chartData.length - count;
|
|
16412
16502
|
return chartData.slice(start);
|
|
16413
16503
|
}, [chartData, period]);
|
|
16414
|
-
const showDebt = (0,
|
|
16504
|
+
const showDebt = (0, import_react25.useMemo)(
|
|
16415
16505
|
() => !!(sliced == null ? void 0 : sliced.some((p) => p.debt != null && p.debt > 0)),
|
|
16416
16506
|
[sliced]
|
|
16417
16507
|
);
|
|
16418
|
-
const labels = (0,
|
|
16508
|
+
const labels = (0, import_react25.useMemo)(
|
|
16419
16509
|
() => {
|
|
16420
16510
|
var _a;
|
|
16421
16511
|
return (_a = sliced == null ? void 0 : sliced.map((p) => formatMonthLabel(p.date))) != null ? _a : [];
|
|
16422
16512
|
},
|
|
16423
16513
|
[sliced]
|
|
16424
16514
|
);
|
|
16425
|
-
const data = (0,
|
|
16515
|
+
const data = (0, import_react25.useMemo)(() => {
|
|
16426
16516
|
if (!sliced) return { labels: [], datasets: [] };
|
|
16427
16517
|
return {
|
|
16428
16518
|
labels,
|
|
@@ -16481,7 +16571,7 @@ function PropertyMobileEstimateLineChart({
|
|
|
16481
16571
|
]
|
|
16482
16572
|
};
|
|
16483
16573
|
}, [sliced, labels, brandPrimary, brandSecondary, showDebt]);
|
|
16484
|
-
const options = (0,
|
|
16574
|
+
const options = (0, import_react25.useMemo)(
|
|
16485
16575
|
() => ({
|
|
16486
16576
|
responsive: true,
|
|
16487
16577
|
maintainAspectRatio: false,
|
|
@@ -16772,15 +16862,15 @@ function StageTimeline({
|
|
|
16772
16862
|
}
|
|
16773
16863
|
|
|
16774
16864
|
// src/components/ui/stepper.tsx
|
|
16775
|
-
var
|
|
16865
|
+
var React38 = __toESM(require("react"));
|
|
16776
16866
|
var import_lucide_react41 = require("lucide-react");
|
|
16777
16867
|
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
16778
|
-
var StepperContext =
|
|
16868
|
+
var StepperContext = React38.createContext({
|
|
16779
16869
|
activeStep: 0,
|
|
16780
16870
|
orientation: "horizontal",
|
|
16781
16871
|
totalSteps: 0
|
|
16782
16872
|
});
|
|
16783
|
-
var StepContext =
|
|
16873
|
+
var StepContext = React38.createContext({
|
|
16784
16874
|
index: 0,
|
|
16785
16875
|
isActive: false,
|
|
16786
16876
|
isCompleted: false,
|
|
@@ -16793,7 +16883,7 @@ function Stepper({
|
|
|
16793
16883
|
className,
|
|
16794
16884
|
children
|
|
16795
16885
|
}) {
|
|
16796
|
-
const totalSteps =
|
|
16886
|
+
const totalSteps = React38.Children.count(children);
|
|
16797
16887
|
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(StepperContext.Provider, { value: { activeStep, orientation, totalSteps }, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
16798
16888
|
"div",
|
|
16799
16889
|
{
|
|
@@ -16803,9 +16893,9 @@ function Stepper({
|
|
|
16803
16893
|
orientation === "horizontal" ? "flex w-full items-start" : "flex flex-col",
|
|
16804
16894
|
className
|
|
16805
16895
|
),
|
|
16806
|
-
children:
|
|
16896
|
+
children: React38.Children.map(
|
|
16807
16897
|
children,
|
|
16808
|
-
(step, index) =>
|
|
16898
|
+
(step, index) => React38.isValidElement(step) ? React38.cloneElement(
|
|
16809
16899
|
step,
|
|
16810
16900
|
{ _index: index }
|
|
16811
16901
|
) : step
|
|
@@ -16814,7 +16904,7 @@ function Stepper({
|
|
|
16814
16904
|
) });
|
|
16815
16905
|
}
|
|
16816
16906
|
function Step({ _index = 0, error, className, children }) {
|
|
16817
|
-
const { activeStep, orientation, totalSteps } =
|
|
16907
|
+
const { activeStep, orientation, totalSteps } = React38.useContext(StepperContext);
|
|
16818
16908
|
const isActive = _index === activeStep;
|
|
16819
16909
|
const isCompleted = _index < activeStep;
|
|
16820
16910
|
const isFirst = _index === 0;
|
|
@@ -16842,8 +16932,8 @@ function Step({ _index = 0, error, className, children }) {
|
|
|
16842
16932
|
);
|
|
16843
16933
|
}
|
|
16844
16934
|
function StepIndicator({ error, className }) {
|
|
16845
|
-
const { orientation } =
|
|
16846
|
-
const { index, isActive, isCompleted, isFirst, isLast } =
|
|
16935
|
+
const { orientation } = React38.useContext(StepperContext);
|
|
16936
|
+
const { index, isActive, isCompleted, isFirst, isLast } = React38.useContext(StepContext);
|
|
16847
16937
|
const filled = isActive || isCompleted;
|
|
16848
16938
|
const circle = /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
16849
16939
|
"div",
|
|
@@ -16915,8 +17005,8 @@ function StepLabel({
|
|
|
16915
17005
|
error,
|
|
16916
17006
|
className
|
|
16917
17007
|
}) {
|
|
16918
|
-
const { orientation } =
|
|
16919
|
-
const { isActive, isCompleted, isLast } =
|
|
17008
|
+
const { orientation } = React38.useContext(StepperContext);
|
|
17009
|
+
const { isActive, isCompleted, isLast } = React38.useContext(StepContext);
|
|
16920
17010
|
const subtext = typeof error === "string" ? error : description;
|
|
16921
17011
|
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
16922
17012
|
"div",
|
|
@@ -16955,7 +17045,7 @@ function StepLabel({
|
|
|
16955
17045
|
);
|
|
16956
17046
|
}
|
|
16957
17047
|
function StepContent({ className, children }) {
|
|
16958
|
-
const { isActive } =
|
|
17048
|
+
const { isActive } = React38.useContext(StepContext);
|
|
16959
17049
|
if (!isActive) return null;
|
|
16960
17050
|
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { "data-slot": "step-content", className: cn("pb-4 pt-2", className), children });
|
|
16961
17051
|
}
|
|
@@ -16967,7 +17057,7 @@ function StepItem({ label, description, error }) {
|
|
|
16967
17057
|
}
|
|
16968
17058
|
|
|
16969
17059
|
// src/components/ui/transactions-expense-categories-doughnut-chart.tsx
|
|
16970
|
-
var
|
|
17060
|
+
var import_react26 = require("react");
|
|
16971
17061
|
var import_chart13 = require("chart.js");
|
|
16972
17062
|
var import_react_chartjs_213 = require("react-chartjs-2");
|
|
16973
17063
|
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
@@ -16985,20 +17075,20 @@ function TransactionsExpenseCategoriesDoughnutChart({
|
|
|
16985
17075
|
const brandPrimary = themeVars["--theme-primary"] || FALLBACK_PRIMARY;
|
|
16986
17076
|
const fontFamily = themeVars["--font-sans"] || "Figtree, sans-serif";
|
|
16987
17077
|
const hasData = !!(segments == null ? void 0 : segments.length) && segments.some((s) => s.value > 0);
|
|
16988
|
-
const total = (0,
|
|
17078
|
+
const total = (0, import_react26.useMemo)(
|
|
16989
17079
|
() => {
|
|
16990
17080
|
var _a;
|
|
16991
17081
|
return (_a = segments == null ? void 0 : segments.reduce((sum, s) => sum + s.value, 0)) != null ? _a : 0;
|
|
16992
17082
|
},
|
|
16993
17083
|
[segments]
|
|
16994
17084
|
);
|
|
16995
|
-
const colors = (0,
|
|
17085
|
+
const colors = (0, import_react26.useMemo)(
|
|
16996
17086
|
() => (segments != null ? segments : []).map(
|
|
16997
17087
|
(_, i) => hexToRgba(brandPrimary, DATASET_ALPHAS[i % DATASET_ALPHAS.length])
|
|
16998
17088
|
),
|
|
16999
17089
|
[segments, brandPrimary]
|
|
17000
17090
|
);
|
|
17001
|
-
const chartData = (0,
|
|
17091
|
+
const chartData = (0, import_react26.useMemo)(
|
|
17002
17092
|
() => {
|
|
17003
17093
|
var _a, _b;
|
|
17004
17094
|
return {
|
|
@@ -17015,7 +17105,7 @@ function TransactionsExpenseCategoriesDoughnutChart({
|
|
|
17015
17105
|
},
|
|
17016
17106
|
[segments, colors]
|
|
17017
17107
|
);
|
|
17018
|
-
const options = (0,
|
|
17108
|
+
const options = (0, import_react26.useMemo)(
|
|
17019
17109
|
() => ({
|
|
17020
17110
|
responsive: true,
|
|
17021
17111
|
maintainAspectRatio: false,
|
|
@@ -17094,7 +17184,7 @@ function TransactionsExpenseCategoriesDoughnutChart({
|
|
|
17094
17184
|
}
|
|
17095
17185
|
|
|
17096
17186
|
// src/components/ui/transactions-income-expense-bar-chart.tsx
|
|
17097
|
-
var
|
|
17187
|
+
var import_react27 = require("react");
|
|
17098
17188
|
var import_chart14 = require("chart.js");
|
|
17099
17189
|
var import_chartjs_plugin_datalabels = __toESM(require("chartjs-plugin-datalabels"));
|
|
17100
17190
|
var import_react_chartjs_214 = require("react-chartjs-2");
|
|
@@ -17123,7 +17213,7 @@ function TransactionsIncomeExpenseBarChart({
|
|
|
17123
17213
|
const incomeVal = totalIncome != null ? totalIncome : 0;
|
|
17124
17214
|
const expenseVal = Math.abs(totalExpense != null ? totalExpense : 0);
|
|
17125
17215
|
const maxVal = Math.max(incomeVal, expenseVal);
|
|
17126
|
-
const chartData = (0,
|
|
17216
|
+
const chartData = (0, import_react27.useMemo)(() => {
|
|
17127
17217
|
if (!hasData) return { labels: [], datasets: [] };
|
|
17128
17218
|
return {
|
|
17129
17219
|
labels: ["Incoming", "Outgoing"],
|
|
@@ -17174,7 +17264,7 @@ function TransactionsIncomeExpenseBarChart({
|
|
|
17174
17264
|
]
|
|
17175
17265
|
};
|
|
17176
17266
|
}, [hasData, incomeVal, expenseVal, brandPrimary, brandSecondary]);
|
|
17177
|
-
const options = (0,
|
|
17267
|
+
const options = (0, import_react27.useMemo)(
|
|
17178
17268
|
() => ({
|
|
17179
17269
|
indexAxis: "y",
|
|
17180
17270
|
responsive: true,
|
|
@@ -17237,7 +17327,7 @@ function TransactionsIncomeExpenseBarChart({
|
|
|
17237
17327
|
}
|
|
17238
17328
|
|
|
17239
17329
|
// src/components/ui/transactions-liabilities-breakdown-doughnut-chart.tsx
|
|
17240
|
-
var
|
|
17330
|
+
var import_react28 = require("react");
|
|
17241
17331
|
var import_chart15 = require("chart.js");
|
|
17242
17332
|
var import_react_chartjs_215 = require("react-chartjs-2");
|
|
17243
17333
|
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
@@ -17255,20 +17345,20 @@ function TransactionsLiabilitiesBreakdownChart({
|
|
|
17255
17345
|
const brandPrimary = themeVars["--theme-primary"] || FALLBACK_PRIMARY;
|
|
17256
17346
|
const fontFamily = themeVars["--font-sans"] || "Figtree, sans-serif";
|
|
17257
17347
|
const hasData = !!(segments == null ? void 0 : segments.length) && segments.some((s) => s.value > 0);
|
|
17258
|
-
const total = (0,
|
|
17348
|
+
const total = (0, import_react28.useMemo)(
|
|
17259
17349
|
() => {
|
|
17260
17350
|
var _a;
|
|
17261
17351
|
return (_a = segments == null ? void 0 : segments.reduce((sum, s) => sum + s.value, 0)) != null ? _a : 0;
|
|
17262
17352
|
},
|
|
17263
17353
|
[segments]
|
|
17264
17354
|
);
|
|
17265
|
-
const colors = (0,
|
|
17355
|
+
const colors = (0, import_react28.useMemo)(
|
|
17266
17356
|
() => (segments != null ? segments : []).map(
|
|
17267
17357
|
(_, i) => hexToRgba(brandPrimary, DATASET_ALPHAS[i % DATASET_ALPHAS.length])
|
|
17268
17358
|
),
|
|
17269
17359
|
[segments, brandPrimary]
|
|
17270
17360
|
);
|
|
17271
|
-
const chartData = (0,
|
|
17361
|
+
const chartData = (0, import_react28.useMemo)(
|
|
17272
17362
|
() => {
|
|
17273
17363
|
var _a, _b;
|
|
17274
17364
|
return {
|
|
@@ -17285,7 +17375,7 @@ function TransactionsLiabilitiesBreakdownChart({
|
|
|
17285
17375
|
},
|
|
17286
17376
|
[segments, colors]
|
|
17287
17377
|
);
|
|
17288
|
-
const options = (0,
|
|
17378
|
+
const options = (0, import_react28.useMemo)(
|
|
17289
17379
|
() => ({
|
|
17290
17380
|
responsive: true,
|
|
17291
17381
|
maintainAspectRatio: false,
|
|
@@ -17373,6 +17463,7 @@ function TransactionsLiabilitiesBreakdownChart({
|
|
|
17373
17463
|
AddLeadModal,
|
|
17374
17464
|
AddressAutocomplete,
|
|
17375
17465
|
AdvisorCard,
|
|
17466
|
+
AdvisorInviteCard,
|
|
17376
17467
|
AiAssistantDrawer,
|
|
17377
17468
|
Alert,
|
|
17378
17469
|
AlertAccordion,
|