@burdenoff/microfe-timecampus 2026.1031.9 → 2026.1031.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/generated/wspace-operations.d.ts +45 -0
  2. package/dist/generated/wspace-operations.d.ts.map +1 -1
  3. package/dist/generated/wspace-operations.js +710 -672
  4. package/dist/generated/wspace-operations.js.map +1 -1
  5. package/dist/generated/wspace-types.d.ts +731 -0
  6. package/dist/generated/wspace-types.d.ts.map +1 -1
  7. package/dist/generated/wspace-types.js +14 -12
  8. package/dist/generated/wspace-types.js.map +1 -1
  9. package/dist/index.js +7 -7
  10. package/dist/timecampus/analytics/index.d.ts +3 -0
  11. package/dist/timecampus/analytics/index.d.ts.map +1 -0
  12. package/dist/timecampus/analytics/index.js +3 -0
  13. package/dist/timecampus/analytics/timecampusAnalytics.d.ts +83 -0
  14. package/dist/timecampus/analytics/timecampusAnalytics.d.ts.map +1 -0
  15. package/dist/timecampus/analytics/timecampusAnalytics.js +175 -0
  16. package/dist/timecampus/analytics/timecampusAnalytics.js.map +1 -0
  17. package/dist/timecampus/analytics/useTimeCampusAnalytics.d.ts +16 -0
  18. package/dist/timecampus/analytics/useTimeCampusAnalytics.d.ts.map +1 -0
  19. package/dist/timecampus/analytics/useTimeCampusAnalytics.js +48 -0
  20. package/dist/timecampus/analytics/useTimeCampusAnalytics.js.map +1 -0
  21. package/dist/timecampus/components/ActivationCard.d.ts +3 -0
  22. package/dist/timecampus/components/ActivationCard.d.ts.map +1 -0
  23. package/dist/timecampus/components/ActivationCard.js +156 -0
  24. package/dist/timecampus/components/ActivationCard.js.map +1 -0
  25. package/dist/timecampus/index.js +7 -7
  26. package/dist/timecampus/pages/HomePage.d.ts.map +1 -1
  27. package/dist/timecampus/pages/HomePage.js +142 -139
  28. package/dist/timecampus/pages/HomePage.js.map +1 -1
  29. package/dist/timecampus/pages/client-portal/ClientPortalPage.d.ts.map +1 -1
  30. package/dist/timecampus/pages/client-portal/ClientPortalPage.js +244 -228
  31. package/dist/timecampus/pages/client-portal/ClientPortalPage.js.map +1 -1
  32. package/dist/timecampus/pages/dashboard/AnalyticsPage.d.ts.map +1 -1
  33. package/dist/timecampus/pages/dashboard/AnalyticsPage.js +117 -112
  34. package/dist/timecampus/pages/dashboard/AnalyticsPage.js.map +1 -1
  35. package/dist/timecampus/pages/dashboard/ReportsPage.d.ts.map +1 -1
  36. package/dist/timecampus/pages/dashboard/ReportsPage.js +105 -102
  37. package/dist/timecampus/pages/dashboard/ReportsPage.js.map +1 -1
  38. package/dist/timecampus/pages/expense-tracking/ExpenseTrackingPage.d.ts.map +1 -1
  39. package/dist/timecampus/pages/expense-tracking/ExpenseTrackingPage.js +209 -192
  40. package/dist/timecampus/pages/expense-tracking/ExpenseTrackingPage.js.map +1 -1
  41. package/dist/timecampus/pages/focus-score/FocusScorePage.d.ts.map +1 -1
  42. package/dist/timecampus/pages/focus-score/FocusScorePage.js +71 -68
  43. package/dist/timecampus/pages/focus-score/FocusScorePage.js.map +1 -1
  44. package/dist/timecampus/pages/invoicing/InvoicingPage.d.ts.map +1 -1
  45. package/dist/timecampus/pages/invoicing/InvoicingPage.js +157 -150
  46. package/dist/timecampus/pages/invoicing/InvoicingPage.js.map +1 -1
  47. package/dist/timecampus/pages/meetings/MeetingCreatePage.d.ts.map +1 -1
  48. package/dist/timecampus/pages/meetings/MeetingCreatePage.js +58 -52
  49. package/dist/timecampus/pages/meetings/MeetingCreatePage.js.map +1 -1
  50. package/dist/timecampus/pages/meetings/MeetingsPage.d.ts.map +1 -1
  51. package/dist/timecampus/pages/meetings/MeetingsPage.js +51 -45
  52. package/dist/timecampus/pages/meetings/MeetingsPage.js.map +1 -1
  53. package/dist/timecampus/pages/pomodoro/PomodoroPage.d.ts.map +1 -1
  54. package/dist/timecampus/pages/pomodoro/PomodoroPage.js +55 -51
  55. package/dist/timecampus/pages/pomodoro/PomodoroPage.js.map +1 -1
  56. package/dist/timecampus/pages/projects/ProjectCreatePage.d.ts.map +1 -1
  57. package/dist/timecampus/pages/projects/ProjectCreatePage.js +59 -49
  58. package/dist/timecampus/pages/projects/ProjectCreatePage.js.map +1 -1
  59. package/dist/timecampus/pages/projects/ProjectsPage.d.ts.map +1 -1
  60. package/dist/timecampus/pages/projects/ProjectsPage.js +165 -155
  61. package/dist/timecampus/pages/projects/ProjectsPage.js.map +1 -1
  62. package/dist/timecampus/pages/time/TimeEntriesPage.d.ts.map +1 -1
  63. package/dist/timecampus/pages/time/TimeEntriesPage.js +194 -186
  64. package/dist/timecampus/pages/time/TimeEntriesPage.js.map +1 -1
  65. package/dist/timecampus/pages/time/TimeTrackingPage.d.ts.map +1 -1
  66. package/dist/timecampus/pages/time/TimeTrackingPage.js +139 -126
  67. package/dist/timecampus/pages/time/TimeTrackingPage.js.map +1 -1
  68. package/dist/timecampus/pages/time/TimerPage.d.ts.map +1 -1
  69. package/dist/timecampus/pages/time/TimerPage.js +48 -35
  70. package/dist/timecampus/pages/time/TimerPage.js.map +1 -1
  71. package/dist/timecampus/pages/time-approval/TimeApprovalPage.d.ts.map +1 -1
  72. package/dist/timecampus/pages/time-approval/TimeApprovalPage.js +60 -50
  73. package/dist/timecampus/pages/time-approval/TimeApprovalPage.js.map +1 -1
  74. package/dist/timecampus/pages/timeline/TimelinePage.d.ts.map +1 -1
  75. package/dist/timecampus/pages/timeline/TimelinePage.js +223 -219
  76. package/dist/timecampus/pages/timeline/TimelinePage.js.map +1 -1
  77. package/dist/timecampus/pages/work-patterns/WorkPatternsPage.d.ts.map +1 -1
  78. package/dist/timecampus/pages/work-patterns/WorkPatternsPage.js +1 -5
  79. package/dist/timecampus/pages/work-patterns/WorkPatternsPage.js.map +1 -1
  80. package/package.json +1 -1
@@ -4,25 +4,27 @@ import { StatCard as r } from "../../components/StatCard.js";
4
4
  import { LoadingSkeleton as i } from "../../components/LoadingSkeleton.js";
5
5
  import { EmptyState as a } from "../../components/EmptyState.js";
6
6
  import { useApproveExpenseMutation as ee, useCreateExpenseMutation as te, useDeleteExpenseMutation as ne, useGetExpenseStatsQuery as re, useListExpensesQuery as ie, useRejectExpenseMutation as ae, useSubmitExpenseForApprovalMutation as oe, useUpdateExpenseMutation as se } from "../../../generated/wspace-operations.js";
7
+ import { useTimeCampusAnalytics as ce } from "../../analytics/useTimeCampusAnalytics.js";
8
+ import "../../analytics/index.js";
7
9
  import { PageLayout as o } from "../../components/PageLayout.js";
8
- import { StatusBadge as ce } from "../../components/StatusBadge.js";
10
+ import { StatusBadge as le } from "../../components/StatusBadge.js";
9
11
  import { Modal as s } from "../../components/Modal.js";
10
12
  import { ChartCard as c } from "../../components/ChartCard.js";
11
- import { ToastContainer as le, useToast as ue } from "../../components/Toast.js";
12
- import { DonutChart as de } from "../../components/charts/DonutChart.js";
13
- import { RadialGauge as fe } from "../../components/charts/RadialGauge.js";
13
+ import { ToastContainer as ue, useToast as de } from "../../components/Toast.js";
14
+ import { DonutChart as fe } from "../../components/charts/DonutChart.js";
15
+ import { RadialGauge as pe } from "../../components/charts/RadialGauge.js";
14
16
  import "../../components/index.js";
15
17
  import { ExpenseStatus as l } from "../../../generated/wspace-types.js";
16
18
  import { useState as u } from "react";
17
- import { Check as pe, DollarSign as me, ExternalLink as he, MessageSquare as ge, Pencil as _e, Plus as ve, Receipt as d, Send as ye, Trash2 as be, Upload as xe, X as Se } from "lucide-react";
18
- import { gql as f } from "@apollo/client";
19
- import { useApolloClient as Ce } from "@apollo/client/react";
20
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
21
- import { uploadBlobToFiles as we } from "@burdenoff/fe-libs/storage";
22
- import { ContextConversationWidget as g } from "@burdenoff/fe-libs/shared";
23
- import { useRegisterPageConversationContext as _ } from "@burdenoff/fe-libs/shared/providers/shell";
19
+ import { Check as me, DollarSign as he, ExternalLink as ge, MessageSquare as _e, Pencil as ve, Plus as ye, Receipt as be, Send as xe, Trash2 as Se, Upload as Ce, X as we } from "lucide-react";
20
+ import { gql as d } from "@apollo/client";
21
+ import { useApolloClient as Te } from "@apollo/client/react";
22
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
23
+ import { uploadBlobToFiles as Ee } from "@burdenoff/fe-libs/storage";
24
+ import { ContextConversationWidget as h } from "@burdenoff/fe-libs/shared";
25
+ import { useRegisterPageConversationContext as g } from "@burdenoff/fe-libs/shared/providers/shell";
24
26
  //#region src/timecampus/pages/expense-tracking/ExpenseTrackingPage.tsx
25
- var v = 25, y = [
27
+ var _ = 25, v = [
26
28
  "Travel",
27
29
  "Meals",
28
30
  "Software",
@@ -30,85 +32,85 @@ var v = 25, y = [
30
32
  "Office",
31
33
  "Training",
32
34
  "Other"
33
- ], b = "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary", Te = f`
35
+ ], y = "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary", De = d`
34
36
  query TimeCampusExpense_GetFileDownloadUrl($id: ID!, $expiresIn: Int) {
35
37
  getFileDownloadUrl(id: $id, expiresIn: $expiresIn)
36
38
  }
37
- `, Ee = f`
39
+ `, Oe = d`
38
40
  mutation TimeCampusExpense_EnsureFolder($path: String!) {
39
41
  ensureFolderByPath(path: $path) {
40
42
  id
41
43
  }
42
44
  }
43
- `, De = 3600;
44
- function Oe({ expense: e }) {
45
- return _({
45
+ `, ke = 3600;
46
+ function Ae({ expense: e }) {
47
+ return g({
46
48
  entityType: "TIMECAMPUS_EXPENSE",
47
49
  entityId: e.id,
48
50
  contextTitle: `Expense · ${e.description ?? e.id}`
49
- }), /* @__PURE__ */ m(g, { widgetKey: "expense-review" });
51
+ }), /* @__PURE__ */ p(h, { widgetKey: "expense-review" });
50
52
  }
51
- function x() {
53
+ function b() {
52
54
  return (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
53
55
  }
54
- var S = {
56
+ var x = {
55
57
  amount: "",
56
- category: y[0],
58
+ category: v[0],
57
59
  description: "",
58
60
  projectId: "",
59
- date: x(),
61
+ date: b(),
60
62
  receiptFileId: "",
61
63
  receiptPreviewUrl: ""
62
64
  };
63
- function C() {
64
- let { workspaceId: f = "" } = e(), { toasts: g, addToast: _, dismissToast: C } = ue(), w = Ce(), { data: ke, loading: T, error: Ae, refetch: je, fetchMore: Me } = ie({
65
+ function S() {
66
+ let { workspaceId: d = "" } = e(), { toasts: h, addToast: g, dismissToast: S } = de(), C = Te(), { data: je, loading: w, error: Me, refetch: Ne, fetchMore: Pe } = ie({
65
67
  variables: {
66
- workspaceId: f,
68
+ workspaceId: d,
67
69
  pagination: {
68
- limit: v,
70
+ limit: _,
69
71
  offset: 0
70
72
  }
71
73
  },
72
74
  notifyOnNetworkStatusChange: !0
73
- }), { data: Ne, loading: Pe, error: Fe, refetch: Ie } = re({ variables: { workspaceId: f } }), [Le, { loading: E }] = te(), [Re, { loading: D }] = se(), [ze, { loading: O }] = ne(), [Be] = oe(), [Ve] = ee(), [He, { loading: k }] = ae(), A = ke?.expenses ?? [], j = Ne?.expenseStats, Ue = A[0]?.currency ?? "USD", We = j?.byCategory ? Object.entries(j.byCategory).map(([e, t]) => ({
75
+ }), { data: Fe, loading: Ie, error: Le, refetch: Re } = re({ variables: { workspaceId: d } }), [ze, { loading: T }] = te(), E = ce(), [Be, { loading: D }] = se(), [Ve, { loading: O }] = ne(), [He] = oe(), [Ue] = ee(), [We, { loading: k }] = ae(), A = je?.expenses ?? [], j = Fe?.expenseStats, Ge = A[0]?.currency ?? "USD", Ke = j?.byCategory ? Object.entries(j.byCategory).map(([e, t]) => ({
74
76
  name: e,
75
77
  value: typeof t == "number" ? t : Number(t)
76
- })).filter((e) => Number.isFinite(e.value) && e.value > 0) : [], M = (j?.approvedCount ?? 0) + (j?.pendingCount ?? 0), [N, P] = u(!1), [Ge, Ke] = u(!0), [qe, F] = u(!1), [I, L] = u(null), [R, z] = u(S), [B, V] = u(!1), [H, U] = u(null), [W, G] = u(null), [K, q] = u(null), [J, Y] = u(""), [Je, X] = u(null), Z = async () => {
77
- await Promise.all([je(), Ie()]);
78
- }, Ye = () => {
78
+ })).filter((e) => Number.isFinite(e.value) && e.value > 0) : [], M = (j?.approvedCount ?? 0) + (j?.pendingCount ?? 0), [N, P] = u(!1), [qe, Je] = u(!0), [Ye, F] = u(!1), [I, L] = u(null), [R, z] = u(x), [B, V] = u(!1), [H, U] = u(null), [W, G] = u(null), [K, q] = u(null), [J, Y] = u(""), [Xe, X] = u(null), Z = async () => {
79
+ await Promise.all([Ne(), Re()]);
80
+ }, Ze = () => {
79
81
  L(null), z({
80
- ...S,
81
- date: x()
82
+ ...x,
83
+ date: b()
82
84
  }), F(!0);
83
- }, Xe = (e) => {
85
+ }, Qe = (e) => {
84
86
  L(e), z({
85
87
  amount: String(e.amount),
86
88
  category: e.category,
87
89
  description: e.description ?? "",
88
90
  projectId: e.projectId ?? "",
89
- date: e.date ? e.date.slice(0, 10) : x(),
91
+ date: e.date ? e.date.slice(0, 10) : b(),
90
92
  receiptFileId: e.receiptFileId ?? "",
91
93
  receiptPreviewUrl: e.receiptDownloadUrl ?? ""
92
94
  }), F(!0);
93
- }, Ze = async (e) => {
95
+ }, $e = async (e) => {
94
96
  V(!0);
95
97
  try {
96
- let { data: t } = await w.mutate({
97
- mutation: Ee,
98
+ let { data: t } = await C.mutate({
99
+ mutation: Oe,
98
100
  variables: { path: "/TimeCampus/Receipts" }
99
101
  }), n = t?.ensureFolderByPath?.id;
100
102
  if (!n) throw Error("Could not resolve upload folder");
101
- let r = await we({
102
- client: w,
103
+ let r = await Ee({
104
+ client: C,
103
105
  blob: e,
104
106
  filename: e.name,
105
107
  mimeType: e.type || "application/octet-stream",
106
108
  folderId: n
107
- }), { data: i } = await w.query({
108
- query: Te,
109
+ }), { data: i } = await C.query({
110
+ query: De,
109
111
  variables: {
110
112
  id: r.id,
111
- expiresIn: De
113
+ expiresIn: ke
112
114
  },
113
115
  fetchPolicy: "no-cache"
114
116
  }), a = i?.getFileDownloadUrl;
@@ -116,12 +118,12 @@ function C() {
116
118
  ...e,
117
119
  receiptFileId: r.id,
118
120
  receiptPreviewUrl: a ?? ""
119
- })), _({
121
+ })), g({
120
122
  title: "Receipt attached",
121
123
  variant: "success"
122
124
  });
123
125
  } catch {
124
- _({
126
+ g({
125
127
  title: "Failed to upload receipt",
126
128
  variant: "error"
127
129
  });
@@ -130,14 +132,14 @@ function C() {
130
132
  }
131
133
  }, Q = () => {
132
134
  F(!1), L(null);
133
- }, Qe = async () => {
135
+ }, et = async () => {
134
136
  let e = Number(R.amount);
135
137
  if (!R.amount || Number.isNaN(e) || !R.category.trim()) return;
136
138
  let t = new Date(R.date).toISOString();
137
139
  try {
138
- I ? (await Re({ variables: {
140
+ if (I) await Be({ variables: {
139
141
  id: I.id,
140
- workspaceId: f,
142
+ workspaceId: d,
141
143
  input: {
142
144
  amount: e,
143
145
  category: R.category.trim(),
@@ -146,102 +148,117 @@ function C() {
146
148
  date: t,
147
149
  receiptFileId: R.receiptFileId || void 0
148
150
  }
149
- } }), _({
151
+ } }), g({
150
152
  title: "Expense updated",
151
153
  variant: "success"
152
- })) : (await Le({ variables: { input: {
153
- workspaceId: f,
154
- amount: e,
155
- category: R.category.trim(),
156
- description: R.description.trim() || void 0,
157
- projectId: R.projectId.trim() || void 0,
158
- date: t,
159
- receiptFileId: R.receiptFileId || void 0
160
- } } }), _({
161
- title: "Expense added",
162
- variant: "success"
163
- })), Q(), await Z();
154
+ });
155
+ else {
156
+ let n = (await ze({ variables: { input: {
157
+ workspaceId: d,
158
+ amount: e,
159
+ category: R.category.trim(),
160
+ description: R.description.trim() || void 0,
161
+ projectId: R.projectId.trim() || void 0,
162
+ date: t,
163
+ receiptFileId: R.receiptFileId || void 0
164
+ } } })).data?.createExpense;
165
+ if (!n) throw Error("createExpense returned no expense");
166
+ E.expenseCreated({
167
+ expenseId: n.id,
168
+ category: n.category,
169
+ projectId: n.projectId
170
+ }), g({
171
+ title: "Expense added",
172
+ variant: "success"
173
+ });
174
+ }
175
+ Q(), await Z();
164
176
  } catch {
165
- _({
177
+ g({
166
178
  title: I ? "Failed to update expense" : "Failed to add expense",
167
179
  variant: "error"
168
180
  });
169
181
  }
170
- }, $e = async () => {
182
+ }, tt = async () => {
171
183
  if (W) try {
172
- await ze({ variables: {
184
+ await Ve({ variables: {
173
185
  id: W.id,
174
- workspaceId: f
175
- } }), _({
186
+ workspaceId: d
187
+ } }), g({
176
188
  title: "Expense deleted",
177
189
  variant: "success"
178
190
  }), G(null), await Z();
179
191
  } catch {
180
- _({
192
+ g({
181
193
  title: "Failed to delete expense",
182
194
  variant: "error"
183
195
  });
184
196
  }
185
- }, et = async (e) => {
197
+ }, nt = async (e) => {
186
198
  X(e.id);
187
199
  try {
188
- await Be({ variables: {
200
+ let t = (await He({ variables: {
189
201
  id: e.id,
190
- workspaceId: f
191
- } }), _({
202
+ workspaceId: d
203
+ } })).data?.submitExpenseForApproval;
204
+ if (!t) throw Error("submitExpenseForApproval failed");
205
+ E.approvalSubmitted({
206
+ approvalId: t.id,
207
+ kind: "expense"
208
+ }), g({
192
209
  title: "Submitted for approval",
193
210
  variant: "success"
194
211
  }), await Z();
195
212
  } catch {
196
- _({
213
+ g({
197
214
  title: "Failed to submit expense",
198
215
  variant: "error"
199
216
  });
200
217
  } finally {
201
218
  X(null);
202
219
  }
203
- }, tt = async (e) => {
220
+ }, rt = async (e) => {
204
221
  X(e.id);
205
222
  try {
206
- await Ve({ variables: {
223
+ await Ue({ variables: {
207
224
  id: e.id,
208
- workspaceId: f
209
- } }), _({
225
+ workspaceId: d
226
+ } }), g({
210
227
  title: "Expense approved",
211
228
  variant: "success"
212
229
  }), await Z();
213
230
  } catch {
214
- _({
231
+ g({
215
232
  title: "Failed to approve expense",
216
233
  variant: "error"
217
234
  });
218
235
  } finally {
219
236
  X(null);
220
237
  }
221
- }, nt = async () => {
238
+ }, it = async () => {
222
239
  if (K) try {
223
- await He({ variables: {
240
+ await We({ variables: {
224
241
  id: K.id,
225
- workspaceId: f,
242
+ workspaceId: d,
226
243
  reason: J.trim() || void 0
227
- } }), _({
244
+ } }), g({
228
245
  title: "Expense rejected",
229
246
  variant: "success"
230
247
  }), q(null), Y(""), await Z();
231
248
  } catch {
232
- _({
249
+ g({
233
250
  title: "Failed to reject expense",
234
251
  variant: "error"
235
252
  });
236
253
  }
237
- }, rt = async () => {
254
+ }, at = async () => {
238
255
  P(!0);
239
256
  try {
240
- ((await Me({
257
+ ((await Pe({
241
258
  variables: {
242
- workspaceId: f,
259
+ workspaceId: d,
243
260
  pagination: {
244
- limit: v,
261
+ limit: _,
245
262
  offset: A.length
246
263
  }
247
264
  },
@@ -249,90 +266,90 @@ function C() {
249
266
  ...e,
250
267
  expenses: [...e.expenses, ...t.expenses]
251
268
  } : e
252
- })).data?.expenses?.length ?? 0) < v && Ke(!1);
269
+ })).data?.expenses?.length ?? 0) < _ && Je(!1);
253
270
  } finally {
254
271
  P(!1);
255
272
  }
256
273
  };
257
- if (T && Pe && A.length === 0) return /* @__PURE__ */ m(o, {
274
+ if (w && Ie && A.length === 0) return /* @__PURE__ */ p(o, {
258
275
  title: "Expense Tracking",
259
276
  description: "Track and manage work expenses",
260
- children: /* @__PURE__ */ m(i, {
277
+ children: /* @__PURE__ */ p(i, {
261
278
  variant: "list",
262
279
  count: 4
263
280
  })
264
281
  });
265
- if (Ae && Fe) return /* @__PURE__ */ m(o, {
282
+ if (Me && Le) return /* @__PURE__ */ p(o, {
266
283
  title: "Expense Tracking",
267
284
  description: "Track and manage work expenses",
268
- children: /* @__PURE__ */ m("div", {
285
+ children: /* @__PURE__ */ p("div", {
269
286
  className: "rounded-lg border border-status-error-bg/40 bg-status-error-bg p-4 text-sm text-status-error-text",
270
287
  children: "Failed to load expense data. Please try again later."
271
288
  })
272
289
  });
273
- let $ = /* @__PURE__ */ h("button", {
274
- onClick: Ye,
290
+ let $ = /* @__PURE__ */ m("button", {
291
+ onClick: Ze,
275
292
  className: "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90",
276
- children: [/* @__PURE__ */ m(ve, { className: "h-4 w-4" }), "Add Expense"]
293
+ children: [/* @__PURE__ */ p(ye, { className: "h-4 w-4" }), "Add Expense"]
277
294
  });
278
- return /* @__PURE__ */ h(o, {
295
+ return /* @__PURE__ */ m(o, {
279
296
  title: "Expense Tracking",
280
297
  description: "Track and manage work expenses",
281
298
  purpose: "Capture project-related costs alongside the hours you log — receipts, categories and approvals in one place — so the bill you send a client reflects the full cost of the work, not just time.",
282
299
  actions: $,
283
300
  children: [
284
- /* @__PURE__ */ h("div", {
301
+ /* @__PURE__ */ m("div", {
285
302
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
286
303
  children: [
287
- /* @__PURE__ */ m(r, {
304
+ /* @__PURE__ */ p(r, {
288
305
  featured: !0,
289
306
  title: "Total This Month",
290
307
  value: t(j?.totalAmount ?? 0),
291
- icon: /* @__PURE__ */ m(me, { className: "h-5 w-5" })
308
+ icon: /* @__PURE__ */ p(he, { className: "h-5 w-5" })
292
309
  }),
293
- /* @__PURE__ */ m(r, {
310
+ /* @__PURE__ */ p(r, {
294
311
  title: "Pending",
295
312
  value: String(j?.pendingCount ?? 0),
296
313
  description: "expenses awaiting approval"
297
314
  }),
298
- /* @__PURE__ */ m(r, {
315
+ /* @__PURE__ */ p(r, {
299
316
  title: "Approved",
300
317
  value: String(j?.approvedCount ?? 0),
301
318
  description: "expenses approved"
302
319
  }),
303
- /* @__PURE__ */ m(r, {
320
+ /* @__PURE__ */ p(r, {
304
321
  title: "Average",
305
322
  value: t(j?.averageAmount ?? 0),
306
- icon: /* @__PURE__ */ m(d, { className: "h-5 w-5" }),
323
+ icon: /* @__PURE__ */ p(be, { className: "h-5 w-5" }),
307
324
  description: "per expense"
308
325
  })
309
326
  ]
310
327
  }),
311
- A.length === 0 && !T ? /* @__PURE__ */ m(a, {
328
+ A.length === 0 && !w ? /* @__PURE__ */ p(a, {
312
329
  illustration: "empty-data",
313
330
  title: "No expenses recorded yet",
314
331
  description: "Add your first expense to track project costs and route them for approval.",
315
332
  action: $
316
- }) : /* @__PURE__ */ h(p, { children: [
317
- /* @__PURE__ */ h("div", {
333
+ }) : /* @__PURE__ */ m(f, { children: [
334
+ /* @__PURE__ */ m("div", {
318
335
  className: "grid grid-cols-1 gap-4 lg:grid-cols-3",
319
- children: [/* @__PURE__ */ m(c, {
336
+ children: [/* @__PURE__ */ p(c, {
320
337
  title: "Spend by category",
321
338
  description: "Total tracked spend grouped by category",
322
339
  className: "lg:col-span-2",
323
- children: /* @__PURE__ */ m(de, {
324
- data: We,
340
+ children: /* @__PURE__ */ p(fe, {
341
+ data: Ke,
325
342
  centerLabel: "Total",
326
343
  centerValue: j?.totalAmount ?? 0,
327
- valueFormat: (e) => t(e, Ue),
344
+ valueFormat: (e) => t(e, Ge),
328
345
  height: 240,
329
346
  emptyLabel: "No categorised spend yet.",
330
347
  ariaLabel: "Spend by category"
331
348
  })
332
- }), /* @__PURE__ */ m(c, {
349
+ }), /* @__PURE__ */ p(c, {
333
350
  title: "Approval progress",
334
351
  description: "Approved vs. awaiting review",
335
- children: /* @__PURE__ */ m(fe, {
352
+ children: /* @__PURE__ */ p(pe, {
336
353
  value: j?.approvedCount ?? 0,
337
354
  min: 0,
338
355
  max: M > 0 ? M : 1,
@@ -344,20 +361,20 @@ function C() {
344
361
  })
345
362
  })]
346
363
  }),
347
- /* @__PURE__ */ m("div", {
364
+ /* @__PURE__ */ p("div", {
348
365
  className: "rounded-xl border border-border-seam bg-gloss-card shadow-pop",
349
- children: /* @__PURE__ */ m("div", {
366
+ children: /* @__PURE__ */ p("div", {
350
367
  className: "divide-y divide-border",
351
368
  children: A.map((e) => {
352
- let r = Je === e.id, i = e.status === l.Pending, a = e.status === l.Rejected;
353
- return /* @__PURE__ */ h("div", {
369
+ let r = Xe === e.id, i = e.status === l.Pending, a = e.status === l.Rejected;
370
+ return /* @__PURE__ */ m("div", {
354
371
  className: "flex flex-col gap-3 p-4 hover:bg-bg-sunken/50 transition-colors sm:flex-row sm:items-center sm:justify-between",
355
- children: [/* @__PURE__ */ h("div", {
372
+ children: [/* @__PURE__ */ m("div", {
356
373
  className: "flex items-center gap-3",
357
- children: [/* @__PURE__ */ m(d, { className: "h-5 w-5 shrink-0 text-text-secondary" }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
374
+ children: [/* @__PURE__ */ p(be, { className: "h-5 w-5 shrink-0 text-text-secondary" }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
358
375
  className: "text-sm font-medium text-text-primary",
359
376
  children: e.description ?? "Untitled expense"
360
- }), /* @__PURE__ */ h("p", {
377
+ }), /* @__PURE__ */ m("p", {
361
378
  className: "text-xs text-text-secondary",
362
379
  children: [
363
380
  e.category,
@@ -369,28 +386,28 @@ function C() {
369
386
  n(e.date)
370
387
  ]
371
388
  })] })]
372
- }), /* @__PURE__ */ h("div", {
389
+ }), /* @__PURE__ */ m("div", {
373
390
  className: "flex items-center gap-3",
374
391
  children: [
375
- /* @__PURE__ */ m("p", {
392
+ /* @__PURE__ */ p("p", {
376
393
  className: "text-sm font-medium text-text-primary",
377
394
  children: t(e.amount, e.currency)
378
395
  }),
379
- /* @__PURE__ */ m(ce, {
396
+ /* @__PURE__ */ p(le, {
380
397
  label: e.status.toLowerCase(),
381
398
  status: e.status.toLowerCase()
382
399
  }),
383
- /* @__PURE__ */ h("div", {
400
+ /* @__PURE__ */ m("div", {
384
401
  className: "flex items-center gap-1",
385
402
  children: [
386
- i && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("button", {
403
+ i && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("button", {
387
404
  type: "button",
388
405
  disabled: r,
389
- onClick: () => tt(e),
406
+ onClick: () => rt(e),
390
407
  title: "Approve expense",
391
408
  className: "rounded-md p-1.5 text-status-success-text hover:bg-status-success-bg disabled:opacity-50",
392
- children: /* @__PURE__ */ m(pe, { className: "h-4 w-4" })
393
- }), /* @__PURE__ */ m("button", {
409
+ children: /* @__PURE__ */ p(me, { className: "h-4 w-4" })
410
+ }), /* @__PURE__ */ p("button", {
394
411
  type: "button",
395
412
  disabled: r,
396
413
  onClick: () => {
@@ -398,36 +415,36 @@ function C() {
398
415
  },
399
416
  title: "Reject expense",
400
417
  className: "rounded-md p-1.5 text-status-error-text hover:bg-status-error-bg disabled:opacity-50",
401
- children: /* @__PURE__ */ m(Se, { className: "h-4 w-4" })
418
+ children: /* @__PURE__ */ p(we, { className: "h-4 w-4" })
402
419
  })] }),
403
- a && /* @__PURE__ */ m("button", {
420
+ a && /* @__PURE__ */ p("button", {
404
421
  type: "button",
405
422
  disabled: r,
406
- onClick: () => et(e),
423
+ onClick: () => nt(e),
407
424
  title: "Resubmit for approval",
408
425
  className: "rounded-md p-1.5 text-text-secondary hover:bg-bg-sunken disabled:opacity-50",
409
- children: /* @__PURE__ */ m(ye, { className: "h-4 w-4" })
426
+ children: /* @__PURE__ */ p(xe, { className: "h-4 w-4" })
410
427
  }),
411
- /* @__PURE__ */ m("button", {
428
+ /* @__PURE__ */ p("button", {
412
429
  type: "button",
413
430
  onClick: () => U(e),
414
431
  title: "Review expense",
415
432
  className: "rounded-md p-1.5 text-text-secondary hover:bg-bg-sunken",
416
- children: /* @__PURE__ */ m(ge, { className: "h-4 w-4" })
433
+ children: /* @__PURE__ */ p(_e, { className: "h-4 w-4" })
417
434
  }),
418
- /* @__PURE__ */ m("button", {
435
+ /* @__PURE__ */ p("button", {
419
436
  type: "button",
420
- onClick: () => Xe(e),
437
+ onClick: () => Qe(e),
421
438
  title: "Edit expense",
422
439
  className: "rounded-md p-1.5 text-text-secondary hover:bg-bg-sunken",
423
- children: /* @__PURE__ */ m(_e, { className: "h-4 w-4" })
440
+ children: /* @__PURE__ */ p(ve, { className: "h-4 w-4" })
424
441
  }),
425
- /* @__PURE__ */ m("button", {
442
+ /* @__PURE__ */ p("button", {
426
443
  type: "button",
427
444
  onClick: () => G(e),
428
445
  title: "Delete expense",
429
446
  className: "rounded-md p-1.5 text-status-error-text hover:bg-status-error-bg",
430
- children: /* @__PURE__ */ m(be, { className: "h-4 w-4" })
447
+ children: /* @__PURE__ */ p(Se, { className: "h-4 w-4" })
431
448
  })
432
449
  ]
433
450
  })
@@ -437,40 +454,40 @@ function C() {
437
454
  })
438
455
  })
439
456
  }),
440
- Ge && A.length >= v && /* @__PURE__ */ m("div", {
457
+ qe && A.length >= _ && /* @__PURE__ */ p("div", {
441
458
  className: "mt-4 flex justify-center",
442
- children: /* @__PURE__ */ m("button", {
443
- onClick: rt,
459
+ children: /* @__PURE__ */ p("button", {
460
+ onClick: at,
444
461
  disabled: N,
445
462
  className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50 disabled:opacity-50",
446
463
  children: N ? "Loading..." : "Load more"
447
464
  })
448
465
  })
449
466
  ] }),
450
- /* @__PURE__ */ m(s, {
451
- open: qe,
467
+ /* @__PURE__ */ p(s, {
468
+ open: Ye,
452
469
  onClose: Q,
453
470
  title: I ? "Edit Expense" : "Add Expense",
454
471
  description: I ? "Update this expense's details." : "Record a project-related cost to track alongside your logged hours.",
455
- footer: /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("button", {
472
+ footer: /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("button", {
456
473
  onClick: Q,
457
474
  className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50",
458
475
  children: "Cancel"
459
- }), /* @__PURE__ */ m("button", {
460
- onClick: Qe,
461
- disabled: E || D || !R.amount || Number.isNaN(Number(R.amount)) || !R.category.trim(),
476
+ }), /* @__PURE__ */ p("button", {
477
+ onClick: et,
478
+ disabled: T || D || !R.amount || Number.isNaN(Number(R.amount)) || !R.category.trim(),
462
479
  className: "rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50",
463
- children: E || D ? "Saving..." : I ? "Save Changes" : "Add Expense"
480
+ children: T || D ? "Saving..." : I ? "Save Changes" : "Add Expense"
464
481
  })] }),
465
- children: /* @__PURE__ */ h("div", {
482
+ children: /* @__PURE__ */ m("div", {
466
483
  className: "space-y-4",
467
484
  children: [
468
- /* @__PURE__ */ h("div", {
485
+ /* @__PURE__ */ m("div", {
469
486
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
470
- children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
487
+ children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
471
488
  className: "block text-sm font-medium text-text-primary",
472
489
  children: "Amount"
473
- }), /* @__PURE__ */ m("input", {
490
+ }), /* @__PURE__ */ p("input", {
474
491
  type: "number",
475
492
  min: 0,
476
493
  step: "0.01",
@@ -480,27 +497,27 @@ function C() {
480
497
  ...R,
481
498
  amount: e.target.value
482
499
  }),
483
- className: b
484
- })] }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
500
+ className: y
501
+ })] }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
485
502
  className: "block text-sm font-medium text-text-primary",
486
503
  children: "Category"
487
- }), /* @__PURE__ */ m("select", {
504
+ }), /* @__PURE__ */ p("select", {
488
505
  value: R.category,
489
506
  onChange: (e) => z({
490
507
  ...R,
491
508
  category: e.target.value
492
509
  }),
493
- className: b,
494
- children: y.map((e) => /* @__PURE__ */ m("option", {
510
+ className: y,
511
+ children: v.map((e) => /* @__PURE__ */ p("option", {
495
512
  value: e,
496
513
  children: e
497
514
  }, e))
498
515
  })] })]
499
516
  }),
500
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
517
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
501
518
  className: "block text-sm font-medium text-text-primary",
502
519
  children: "Description"
503
- }), /* @__PURE__ */ m("input", {
520
+ }), /* @__PURE__ */ p("input", {
504
521
  type: "text",
505
522
  placeholder: "What was this expense for?",
506
523
  value: R.description,
@@ -508,14 +525,14 @@ function C() {
508
525
  ...R,
509
526
  description: e.target.value
510
527
  }),
511
- className: b
528
+ className: y
512
529
  })] }),
513
- /* @__PURE__ */ h("div", {
530
+ /* @__PURE__ */ m("div", {
514
531
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
515
- children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
532
+ children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
516
533
  className: "block text-sm font-medium text-text-primary",
517
534
  children: "Project ID"
518
- }), /* @__PURE__ */ m("input", {
535
+ }), /* @__PURE__ */ p("input", {
519
536
  type: "text",
520
537
  placeholder: "Optional project ID",
521
538
  value: R.projectId,
@@ -523,51 +540,51 @@ function C() {
523
540
  ...R,
524
541
  projectId: e.target.value
525
542
  }),
526
- className: b
527
- })] }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
543
+ className: y
544
+ })] }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
528
545
  className: "block text-sm font-medium text-text-primary",
529
546
  children: "Date"
530
- }), /* @__PURE__ */ m("input", {
547
+ }), /* @__PURE__ */ p("input", {
531
548
  type: "date",
532
549
  value: R.date,
533
550
  onChange: (e) => z({
534
551
  ...R,
535
552
  date: e.target.value
536
553
  }),
537
- className: b
554
+ className: y
538
555
  })] })]
539
556
  }),
540
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
557
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
541
558
  className: "block text-sm font-medium text-text-primary",
542
559
  children: "Receipt"
543
- }), /* @__PURE__ */ h("div", {
560
+ }), /* @__PURE__ */ m("div", {
544
561
  className: "mt-1 flex flex-col gap-2",
545
562
  children: [
546
- /* @__PURE__ */ h("label", {
563
+ /* @__PURE__ */ m("label", {
547
564
  className: `inline-flex w-fit cursor-pointer items-center gap-1.5 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50 ${B ? "opacity-50" : ""}`,
548
565
  children: [
549
- /* @__PURE__ */ m(xe, { className: "h-4 w-4" }),
566
+ /* @__PURE__ */ p(Ce, { className: "h-4 w-4" }),
550
567
  B ? "Uploading..." : "Upload receipt",
551
- /* @__PURE__ */ m("input", {
568
+ /* @__PURE__ */ p("input", {
552
569
  type: "file",
553
570
  accept: "image/*,application/pdf",
554
571
  disabled: B,
555
572
  className: "hidden",
556
573
  onChange: (e) => {
557
574
  let t = e.target.files?.[0];
558
- e.target.value = "", t && Ze(t);
575
+ e.target.value = "", t && $e(t);
559
576
  }
560
577
  })
561
578
  ]
562
579
  }),
563
- R.receiptFileId && R.receiptPreviewUrl && /* @__PURE__ */ h("a", {
580
+ R.receiptFileId && R.receiptPreviewUrl && /* @__PURE__ */ m("a", {
564
581
  href: R.receiptPreviewUrl,
565
582
  target: "_blank",
566
583
  rel: "noopener noreferrer",
567
584
  className: "inline-flex w-fit items-center gap-1.5 text-sm font-medium text-action-primary-text/90 underline decoration-border-subtle underline-offset-2 hover:text-action-primary-text",
568
- children: [/* @__PURE__ */ m(he, { className: "h-3.5 w-3.5" }), "View current receipt"]
585
+ children: [/* @__PURE__ */ p(ge, { className: "h-3.5 w-3.5" }), "View current receipt"]
569
586
  }),
570
- /* @__PURE__ */ m("p", {
587
+ /* @__PURE__ */ p("p", {
571
588
  className: "text-xs text-text-secondary",
572
589
  children: "Attach an image or PDF. Uploading is optional and never blocks saving the expense."
573
590
  })
@@ -576,69 +593,69 @@ function C() {
576
593
  ]
577
594
  })
578
595
  }),
579
- /* @__PURE__ */ m(s, {
596
+ /* @__PURE__ */ p(s, {
580
597
  open: W !== null,
581
598
  onClose: () => G(null),
582
599
  title: "Delete expense?",
583
600
  description: W ? `${t(W.amount, W.currency)} · ${W.category} will be removed.` : void 0,
584
601
  size: "sm",
585
- footer: /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("button", {
602
+ footer: /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("button", {
586
603
  onClick: () => G(null),
587
604
  className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50",
588
605
  children: "Cancel"
589
- }), /* @__PURE__ */ m("button", {
590
- onClick: $e,
606
+ }), /* @__PURE__ */ p("button", {
607
+ onClick: tt,
591
608
  disabled: O,
592
609
  className: "rounded-md bg-status-error-bg px-4 py-2 text-sm font-medium text-status-error-text hover:bg-status-error-bg/80 disabled:opacity-50",
593
610
  children: O ? "Deleting..." : "Delete"
594
611
  })] }),
595
- children: /* @__PURE__ */ m("p", {
612
+ children: /* @__PURE__ */ p("p", {
596
613
  className: "text-sm text-text-secondary",
597
614
  children: "This permanently removes the expense. This action cannot be undone."
598
615
  })
599
616
  }),
600
- /* @__PURE__ */ h(s, {
617
+ /* @__PURE__ */ m(s, {
601
618
  open: K !== null,
602
619
  onClose: () => q(null),
603
620
  title: "Reject expense",
604
621
  description: "Let the submitter know why this expense was rejected.",
605
622
  size: "sm",
606
- footer: /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("button", {
623
+ footer: /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("button", {
607
624
  onClick: () => q(null),
608
625
  className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50",
609
626
  children: "Cancel"
610
- }), /* @__PURE__ */ m("button", {
611
- onClick: nt,
627
+ }), /* @__PURE__ */ p("button", {
628
+ onClick: it,
612
629
  disabled: k,
613
630
  className: "rounded-md bg-status-error-bg px-4 py-2 text-sm font-medium text-status-error-text hover:bg-status-error-bg/80 disabled:opacity-50",
614
631
  children: k ? "Rejecting..." : "Reject Expense"
615
632
  })] }),
616
- children: [/* @__PURE__ */ m("label", {
633
+ children: [/* @__PURE__ */ p("label", {
617
634
  className: "block text-sm font-medium text-text-primary",
618
635
  children: "Reason"
619
- }), /* @__PURE__ */ m("textarea", {
636
+ }), /* @__PURE__ */ p("textarea", {
620
637
  rows: 3,
621
638
  placeholder: "Reason for rejection (optional)",
622
639
  value: J,
623
640
  onChange: (e) => Y(e.target.value),
624
- className: b
641
+ className: y
625
642
  })]
626
643
  }),
627
- /* @__PURE__ */ m(s, {
644
+ /* @__PURE__ */ p(s, {
628
645
  open: H !== null,
629
646
  onClose: () => U(null),
630
647
  title: "Expense review",
631
648
  description: H ? `Discuss ${H.description ?? "this expense"} with your team.` : void 0,
632
- children: H && /* @__PURE__ */ m(Oe, { expense: H })
649
+ children: H && /* @__PURE__ */ p(Ae, { expense: H })
633
650
  }),
634
- /* @__PURE__ */ m(le, {
635
- toasts: g,
636
- onDismiss: C
651
+ /* @__PURE__ */ p(ue, {
652
+ toasts: h,
653
+ onDismiss: S
637
654
  })
638
655
  ]
639
656
  });
640
657
  }
641
658
  //#endregion
642
- export { C as ExpenseTrackingPage };
659
+ export { S as ExpenseTrackingPage };
643
660
 
644
661
  //# sourceMappingURL=ExpenseTrackingPage.js.map