@burdenoff/microfe-timecampus 2026.1031.10 → 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 (77) 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/package.json +1 -1
@@ -3,112 +3,119 @@ import { StatCard as i } from "../../components/StatCard.js";
3
3
  import { LoadingSkeleton as a } from "../../components/LoadingSkeleton.js";
4
4
  import { EmptyState as o } from "../../components/EmptyState.js";
5
5
  import { useCreateClientPortalConfigMutation as s, useDeleteClientPortalConfigMutation as ee, useGetClientPortalStatsQuery as te, useListClientPortalConfigsQuery as ne, useRegenerateClientPortalShareTokenMutation as re, useToggleClientPortalMutation as ie, useUpdateClientPortalConfigMutation as ae } from "../../../generated/wspace-operations.js";
6
- import { PageLayout as c } from "../../components/PageLayout.js";
6
+ import { useTimeCampusAnalytics as c } from "../../analytics/useTimeCampusAnalytics.js";
7
+ import "../../analytics/index.js";
8
+ import { PageLayout as l } from "../../components/PageLayout.js";
7
9
  import { StatusBadge as oe } from "../../components/StatusBadge.js";
8
- import { Modal as l } from "../../components/Modal.js";
9
- import { ChartCard as u } from "../../components/ChartCard.js";
10
+ import { Modal as u } from "../../components/Modal.js";
11
+ import { ChartCard as d } from "../../components/ChartCard.js";
10
12
  import { ToastContainer as se, useToast as ce } from "../../components/Toast.js";
11
13
  import { BarsChart as le } from "../../components/charts/BarsChart.js";
12
14
  import { DonutChart as ue } from "../../components/charts/DonutChart.js";
13
15
  import { ProgressMeter as de } from "../../components/charts/ProgressMeter.js";
14
16
  import "../../components/index.js";
15
- import { useState as d } from "react";
16
- import { Building2 as fe, Check as pe, FolderOpen as me, Link2 as he, Pencil as f, Plus as p, Power as m, PowerOff as ge, RefreshCw as _e, Trash2 as ve, Users as ye } from "lucide-react";
17
- import { gql as h } from "@apollo/client";
18
- import { useApolloClient as be } from "@apollo/client/react";
19
- import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
20
- import { GlassCard as xe } from "@burdenoff/fe-libs/ui";
21
- import { uploadBlobToFiles as Se } from "@burdenoff/fe-libs/storage";
17
+ import { useState as f } from "react";
18
+ import { Building2 as fe, Check as pe, FolderOpen as me, Link2 as he, Pencil as ge, Plus as _e, Power as ve, PowerOff as ye, RefreshCw as p, Trash2 as be, Users as xe } from "lucide-react";
19
+ import { gql as m } from "@apollo/client";
20
+ import { useApolloClient as Se } from "@apollo/client/react";
21
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
22
+ import { GlassCard as Ce } from "@burdenoff/fe-libs/ui";
23
+ import { uploadBlobToFiles as we } from "@burdenoff/fe-libs/storage";
22
24
  //#region src/timecampus/pages/client-portal/ClientPortalPage.tsx
23
- var y = 25, 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", Ce = "mt-1 block w-full text-sm text-text-secondary file:mr-3 file:rounded-md file:border-0 file:bg-action-primary-bg file:px-3 file:py-1.5 file:text-sm file:font-medium file:text-action-primary-text hover:file:bg-action-primary-bg/90", we = h`
25
+ var v = 25, 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", Te = "mt-1 block w-full text-sm text-text-secondary file:mr-3 file:rounded-md file:border-0 file:bg-action-primary-bg file:px-3 file:py-1.5 file:text-sm file:font-medium file:text-action-primary-text hover:file:bg-action-primary-bg/90", Ee = m`
24
26
  query TimeCampus_GetFileDownloadUrl($id: ID!, $expiresIn: Int) {
25
27
  getFileDownloadUrl(id: $id, expiresIn: $expiresIn)
26
28
  }
27
- `, Te = h`
29
+ `, De = m`
28
30
  mutation TimeCampusClient_EnsureFolder($path: String!) {
29
31
  ensureFolderByPath(path: $path) {
30
32
  id
31
33
  }
32
34
  }
33
35
  `;
34
- function Ee(e) {
36
+ function Oe(e) {
35
37
  return `${typeof window < "u" ? window.location.origin : ""}/portal/${e}`;
36
38
  }
37
- var x = {
39
+ var b = {
38
40
  clientName: "",
39
41
  contactEmail: "",
40
42
  contactPhone: "",
41
43
  description: "",
42
44
  logoUrl: ""
43
45
  };
44
- function S() {
45
- let { toasts: h, addToast: S, dismissToast: C } = ce(), w = be(), [T, E] = d(null), [D, O] = d(!1), { data: k, loading: De, error: Oe, refetch: A, fetchMore: ke } = ne({
46
+ function x() {
47
+ let { toasts: m, addToast: x, dismissToast: S } = ce(), C = Se(), [w, T] = f(null), [E, D] = f(!1), { data: O, loading: ke, error: Ae, refetch: k, fetchMore: je } = ne({
46
48
  variables: { pagination: {
47
- limit: y,
49
+ limit: v,
48
50
  offset: 0
49
51
  } },
50
52
  notifyOnNetworkStatusChange: !0
51
- }), { data: Ae, refetch: je } = te(), [Me, { loading: j }] = re(), [Ne, { loading: M }] = s(), [N, { loading: P }] = ae(), [Pe, { loading: F }] = ee(), [Fe] = ie(), I = k?.clientPortalConfigs?.items ?? [], Ie = k?.clientPortalConfigs?.hasMore ?? !1, L = Ae?.clientPortalStats, R = (e) => e.projects.reduce((e, t) => e + t.trackedHours, 0), z = (L?.totalClients ?? 0) - (L?.activeClients ?? 0), Le = I.map((e) => ({
53
+ }), { data: Me, refetch: Ne } = te(), [Pe, { loading: A }] = re(), [Fe, { loading: j }] = s(), [Ie, { loading: M }] = ae(), [Le, { loading: N }] = ee(), [Re] = ie(), P = c(), F = O?.clientPortalConfigs?.items ?? [], ze = O?.clientPortalConfigs?.hasMore ?? !1, I = Me?.clientPortalStats, L = (e) => e.projects.reduce((e, t) => e + t.trackedHours, 0), R = (I?.totalClients ?? 0) - (I?.activeClients ?? 0), Be = F.map((e) => ({
52
54
  name: e.clientName,
53
- hours: R(e)
54
- })).filter((e) => e.hours > 0).sort((e, t) => t.hours - e.hours).slice(0, 8), B = I.reduce((e, t) => Math.max(e, R(t)), 0), Re = [{
55
+ hours: L(e)
56
+ })).filter((e) => e.hours > 0).sort((e, t) => t.hours - e.hours).slice(0, 8), z = F.reduce((e, t) => Math.max(e, L(t)), 0), Ve = [{
55
57
  name: "Active",
56
- value: L?.activeClients ?? 0
58
+ value: I?.activeClients ?? 0
57
59
  }, {
58
60
  name: "Inactive",
59
- value: Math.max(z, 0)
60
- }], [V, H] = d(!1), [ze, U] = d(!1), [W, G] = d(null), [K, q] = d(x), [J, Y] = d(null), [Be, X] = d(null), Z = async () => {
61
- await Promise.all([A(), je()]);
62
- }, Ve = async (e) => {
61
+ value: Math.max(R, 0)
62
+ }], [B, V] = f(!1), [He, H] = f(!1), [U, W] = f(null), [G, K] = f(b), [q, J] = f(null), [Ue, Y] = f(null), X = async () => {
63
+ await Promise.all([k(), Ne()]);
64
+ }, We = async (e) => {
63
65
  if (e.shareToken) try {
64
- await navigator.clipboard.writeText(Ee(e.shareToken)), E(e.id), window.setTimeout(() => E(null), 2e3);
66
+ await navigator.clipboard.writeText(Oe(e.shareToken)), T(e.id), window.setTimeout(() => T(null), 2e3);
65
67
  } catch {
66
- S({
68
+ x({
67
69
  title: "Clipboard unavailable",
68
70
  variant: "error"
69
71
  });
70
72
  }
71
- }, He = async (e) => {
72
- X(e.id);
73
+ }, Z = async (e) => {
74
+ Y(e.id);
73
75
  try {
74
- await Me({ variables: { id: e.id } }), S({
76
+ let t = (await Pe({ variables: { id: e.id } })).data?.regenerateClientPortalShareToken;
77
+ if (!t) throw Error("regenerateClientPortalShareToken failed");
78
+ P.clientPortalShared({
79
+ portalId: t.id,
80
+ action: "link_regenerated"
81
+ }), x({
75
82
  title: "Share link regenerated",
76
83
  variant: "success"
77
- }), await A();
84
+ }), await k();
78
85
  } catch {
79
- S({
86
+ x({
80
87
  title: "Failed to regenerate link",
81
88
  variant: "error"
82
89
  });
83
90
  } finally {
84
- X(null);
91
+ Y(null);
85
92
  }
86
- }, Ue = () => {
87
- G(null), q(x), U(!0);
88
- }, We = (e) => {
89
- G(e), q({
93
+ }, Ge = () => {
94
+ W(null), K(b), H(!0);
95
+ }, Ke = (e) => {
96
+ W(e), K({
90
97
  clientName: e.clientName,
91
98
  contactEmail: e.contactEmail ?? "",
92
99
  contactPhone: e.contactPhone ?? "",
93
100
  description: e.description ?? "",
94
101
  logoUrl: e.logoUrl ?? ""
95
- }), U(!0);
96
- }, Ge = async (e) => {
97
- O(!0);
102
+ }), H(!0);
103
+ }, qe = async (e) => {
104
+ D(!0);
98
105
  try {
99
- let { data: t } = await w.mutate({
100
- mutation: Te,
106
+ let { data: t } = await C.mutate({
107
+ mutation: De,
101
108
  variables: { path: "/TimeCampus/ClientLogos" }
102
109
  }), n = t?.ensureFolderByPath?.id;
103
110
  if (!n) throw Error("Could not resolve upload folder");
104
- let r = await Se({
105
- client: w,
111
+ let r = await we({
112
+ client: C,
106
113
  blob: e,
107
114
  filename: e.name,
108
115
  mimeType: e.type || "application/octet-stream",
109
116
  folderId: n
110
- }), { data: i } = await w.query({
111
- query: we,
117
+ }), { data: i } = await C.query({
118
+ query: Ee,
112
119
  variables: {
113
120
  id: r.id,
114
121
  expiresIn: 604800
@@ -116,88 +123,97 @@ function S() {
116
123
  fetchPolicy: "no-cache"
117
124
  }), a = i?.getFileDownloadUrl;
118
125
  if (!a) throw Error("No download URL returned");
119
- q((e) => ({
126
+ K((e) => ({
120
127
  ...e,
121
128
  logoUrl: a
122
129
  }));
123
130
  } catch {
124
- S({
131
+ x({
125
132
  title: "Failed to upload logo",
126
133
  variant: "error"
127
134
  });
128
135
  } finally {
129
- O(!1);
136
+ D(!1);
130
137
  }
131
138
  }, Q = () => {
132
- U(!1), G(null);
133
- }, Ke = async () => {
134
- if (K.clientName.trim()) try {
135
- W ? (await N({ variables: {
136
- id: W.id,
139
+ H(!1), W(null);
140
+ }, Je = async () => {
141
+ if (G.clientName.trim()) try {
142
+ if (U) await Ie({ variables: {
143
+ id: U.id,
137
144
  input: {
138
- clientName: K.clientName.trim(),
139
- contactEmail: K.contactEmail.trim() || void 0,
140
- contactPhone: K.contactPhone.trim() || void 0,
141
- description: K.description.trim() || void 0,
142
- logoUrl: K.logoUrl || void 0
145
+ clientName: G.clientName.trim(),
146
+ contactEmail: G.contactEmail.trim() || void 0,
147
+ contactPhone: G.contactPhone.trim() || void 0,
148
+ description: G.description.trim() || void 0,
149
+ logoUrl: G.logoUrl || void 0
143
150
  }
144
- } }), S({
151
+ } }), x({
145
152
  title: "Client updated",
146
153
  variant: "success"
147
- })) : (await Ne({ variables: { input: {
148
- clientName: K.clientName.trim(),
149
- contactEmail: K.contactEmail.trim() || void 0,
150
- contactPhone: K.contactPhone.trim() || void 0,
151
- description: K.description.trim() || void 0,
152
- logoUrl: K.logoUrl || void 0,
153
- isActive: !0
154
- } } }), S({
155
- title: "Client added",
156
- variant: "success"
157
- })), Q(), await Z();
154
+ });
155
+ else {
156
+ let e = (await Fe({ variables: { input: {
157
+ clientName: G.clientName.trim(),
158
+ contactEmail: G.contactEmail.trim() || void 0,
159
+ contactPhone: G.contactPhone.trim() || void 0,
160
+ description: G.description.trim() || void 0,
161
+ logoUrl: G.logoUrl || void 0,
162
+ isActive: !0
163
+ } } })).data?.createClientPortalConfig;
164
+ if (!e) throw Error("createClientPortalConfig failed");
165
+ P.clientPortalShared({
166
+ portalId: e.id,
167
+ action: "created"
168
+ }), x({
169
+ title: "Client added",
170
+ variant: "success"
171
+ });
172
+ }
173
+ Q(), await X();
158
174
  } catch {
159
- S({
160
- title: W ? "Failed to update client" : "Failed to add client",
175
+ x({
176
+ title: U ? "Failed to update client" : "Failed to add client",
161
177
  variant: "error"
162
178
  });
163
179
  }
164
- }, qe = async () => {
165
- if (J) try {
166
- await Pe({ variables: { id: J.id } }), S({
180
+ }, Ye = async () => {
181
+ if (q) try {
182
+ await Le({ variables: { id: q.id } }), x({
167
183
  title: "Client deleted",
168
184
  variant: "success"
169
- }), Y(null), await Z();
185
+ }), J(null), await X();
170
186
  } catch {
171
- S({
187
+ x({
172
188
  title: "Failed to delete client",
173
189
  variant: "error"
174
190
  });
175
191
  }
176
- }, Je = async (e) => {
177
- X(e.id);
192
+ }, Xe = async (e) => {
193
+ Y(e.id);
178
194
  try {
179
- await Fe({ variables: {
195
+ await Re({ variables: {
180
196
  id: e.id,
181
197
  isActive: !e.isActive
182
- } }), S({
198
+ } }), x({
183
199
  title: e.isActive ? "Client deactivated" : "Client activated",
184
200
  variant: "success"
185
- }), await Z();
201
+ }), await X();
186
202
  } catch {
187
- S({
203
+ x({
188
204
  title: "Failed to toggle client",
189
205
  variant: "error"
190
206
  });
191
207
  } finally {
192
- X(null);
208
+ Y(null);
193
209
  }
194
- }, Ye = async () => {
195
- H(!0);
210
+ }, Ze = async () => {
211
+ V(!0);
196
212
  try {
197
- await ke({
213
+ await je({
198
214
  variables: { pagination: {
199
- limit: y,
200
- offset: I.length
215
+ limit: v,
216
+ offset: F.length
201
217
  } },
202
218
  updateQuery: (e, { fetchMoreResult: t }) => t ? {
203
219
  ...e,
@@ -208,78 +224,78 @@ function S() {
208
224
  } : e
209
225
  });
210
226
  } finally {
211
- H(!1);
227
+ V(!1);
212
228
  }
213
229
  };
214
- if (De && I.length === 0) return /* @__PURE__ */ _(c, {
230
+ if (ke && F.length === 0) return /* @__PURE__ */ g(l, {
215
231
  title: "Client Portal",
216
232
  description: "Manage clients and their projects",
217
- children: /* @__PURE__ */ _(a, {
233
+ children: /* @__PURE__ */ g(a, {
218
234
  variant: "list",
219
235
  count: 4
220
236
  })
221
237
  });
222
- if (Oe) return /* @__PURE__ */ _(c, {
238
+ if (Ae) return /* @__PURE__ */ g(l, {
223
239
  title: "Client Portal",
224
240
  description: "Manage clients and their projects",
225
- children: /* @__PURE__ */ _("div", {
241
+ children: /* @__PURE__ */ g("div", {
226
242
  className: "rounded-lg border border-status-error-bg/40 bg-status-error-bg p-4 text-sm text-status-error-text",
227
243
  children: "Failed to load client portal data. Please try again later."
228
244
  })
229
245
  });
230
- let $ = /* @__PURE__ */ v("button", {
231
- onClick: Ue,
246
+ let $ = /* @__PURE__ */ _("button", {
247
+ onClick: Ge,
232
248
  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",
233
- children: [/* @__PURE__ */ _(p, { className: "h-4 w-4" }), "Add Client"]
249
+ children: [/* @__PURE__ */ g(_e, { className: "h-4 w-4" }), "Add Client"]
234
250
  });
235
- return /* @__PURE__ */ v(c, {
251
+ return /* @__PURE__ */ _(l, {
236
252
  title: "Client Portal",
237
253
  description: "Manage clients and their projects",
238
254
  purpose: "Give clients a transparent window into the work you do for them — the projects, hours and progress tied to each one — so billing conversations are backed by data and trust, not spreadsheets.",
239
255
  actions: $,
240
256
  children: [
241
- /* @__PURE__ */ v("div", {
257
+ /* @__PURE__ */ _("div", {
242
258
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
243
259
  children: [
244
- /* @__PURE__ */ _(i, {
260
+ /* @__PURE__ */ g(i, {
245
261
  featured: !0,
246
262
  title: "Active Clients",
247
- value: String(L?.activeClients ?? 0),
248
- icon: /* @__PURE__ */ _(fe, { className: "h-5 w-5" })
263
+ value: String(I?.activeClients ?? 0),
264
+ icon: /* @__PURE__ */ g(fe, { className: "h-5 w-5" })
249
265
  }),
250
- /* @__PURE__ */ _(i, {
266
+ /* @__PURE__ */ g(i, {
251
267
  title: "Total Projects",
252
- value: String(L?.totalProjectsShared ?? 0),
253
- icon: /* @__PURE__ */ _(me, { className: "h-5 w-5" })
268
+ value: String(I?.totalProjectsShared ?? 0),
269
+ icon: /* @__PURE__ */ g(me, { className: "h-5 w-5" })
254
270
  }),
255
- /* @__PURE__ */ _(i, {
271
+ /* @__PURE__ */ g(i, {
256
272
  title: "Total Clients",
257
- value: String(L?.totalClients ?? 0),
258
- icon: /* @__PURE__ */ _(ye, { className: "h-5 w-5" })
273
+ value: String(I?.totalClients ?? 0),
274
+ icon: /* @__PURE__ */ g(xe, { className: "h-5 w-5" })
259
275
  }),
260
- /* @__PURE__ */ _(i, {
276
+ /* @__PURE__ */ g(i, {
261
277
  title: "Inactive",
262
- value: String(Math.max(z, 0)),
263
- icon: /* @__PURE__ */ _(ge, { className: "h-5 w-5" }),
278
+ value: String(Math.max(R, 0)),
279
+ icon: /* @__PURE__ */ g(ye, { className: "h-5 w-5" }),
264
280
  iconBgColor: "bg-bg-sunken text-text-secondary",
265
281
  description: "portals turned off"
266
282
  })
267
283
  ]
268
284
  }),
269
- I.length === 0 ? /* @__PURE__ */ _(o, {
285
+ F.length === 0 ? /* @__PURE__ */ g(o, {
270
286
  illustration: "empty-people",
271
287
  title: "No clients configured yet",
272
288
  description: "Add your first client to share projects and tracked hours with them.",
273
289
  action: $
274
- }) : /* @__PURE__ */ v(g, { children: [
275
- /* @__PURE__ */ v("div", {
290
+ }) : /* @__PURE__ */ _(h, { children: [
291
+ /* @__PURE__ */ _("div", {
276
292
  className: "grid grid-cols-1 gap-4 lg:grid-cols-3",
277
- children: [/* @__PURE__ */ _(u, {
293
+ children: [/* @__PURE__ */ g(d, {
278
294
  title: "Tracked hours by client",
279
295
  description: "Top clients by logged hours (loaded page)",
280
296
  className: "lg:col-span-2",
281
- children: /* @__PURE__ */ _(le, {
282
- data: Le,
297
+ children: /* @__PURE__ */ g(le, {
298
+ data: Be,
283
299
  xKey: "name",
284
300
  series: [{
285
301
  key: "hours",
@@ -292,130 +308,130 @@ function S() {
292
308
  emptyLabel: "No tracked hours logged yet.",
293
309
  ariaLabel: "Tracked hours by client"
294
310
  })
295
- }), /* @__PURE__ */ _(u, {
311
+ }), /* @__PURE__ */ g(d, {
296
312
  title: "Portal status",
297
313
  description: "Shared vs. private clients",
298
- children: /* @__PURE__ */ _(ue, {
299
- data: Re,
314
+ children: /* @__PURE__ */ g(ue, {
315
+ data: Ve,
300
316
  centerLabel: "Clients",
301
- centerValue: L?.totalClients ?? 0,
317
+ centerValue: I?.totalClients ?? 0,
302
318
  height: 260,
303
319
  emptyLabel: "No clients yet.",
304
320
  ariaLabel: "Clients by portal status"
305
321
  })
306
322
  })]
307
323
  }),
308
- /* @__PURE__ */ _("div", {
324
+ /* @__PURE__ */ g("div", {
309
325
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3",
310
- children: I.map((i) => {
311
- let a = R(i), o = Be === i.id, s = T === i.id;
312
- return /* @__PURE__ */ v(xe, {
326
+ children: F.map((i) => {
327
+ let a = L(i), o = Ue === i.id, s = w === i.id;
328
+ return /* @__PURE__ */ _(Ce, {
313
329
  treatment: "insight",
314
330
  glow: i.isActive,
315
331
  className: "p-4",
316
332
  children: [
317
- /* @__PURE__ */ v("div", {
333
+ /* @__PURE__ */ _("div", {
318
334
  className: "flex items-start justify-between gap-3",
319
- children: [/* @__PURE__ */ v("div", {
335
+ children: [/* @__PURE__ */ _("div", {
320
336
  className: "flex min-w-0 items-center gap-3",
321
- children: [i.logoUrl ? /* @__PURE__ */ _("img", {
337
+ children: [i.logoUrl ? /* @__PURE__ */ g("img", {
322
338
  src: i.logoUrl,
323
339
  alt: `${i.clientName} logo`,
324
340
  className: "h-11 w-11 shrink-0 rounded-lg border border-border-seam object-cover"
325
- }) : /* @__PURE__ */ _("div", {
341
+ }) : /* @__PURE__ */ g("div", {
326
342
  className: "flex h-11 w-11 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-sm font-semibold text-primary",
327
343
  children: r(i.clientName)
328
- }), /* @__PURE__ */ v("div", {
344
+ }), /* @__PURE__ */ _("div", {
329
345
  className: "min-w-0",
330
- children: [/* @__PURE__ */ _("p", {
346
+ children: [/* @__PURE__ */ g("p", {
331
347
  className: "truncate text-sm font-semibold text-text-primary",
332
348
  children: i.clientName
333
- }), /* @__PURE__ */ v("p", {
349
+ }), /* @__PURE__ */ _("p", {
334
350
  className: "truncate text-xs text-text-secondary",
335
351
  children: ["Since ", t(i.createdAt)]
336
352
  })]
337
353
  })]
338
- }), /* @__PURE__ */ _(oe, {
354
+ }), /* @__PURE__ */ g(oe, {
339
355
  label: i.isActive ? "active" : "inactive",
340
356
  status: i.isActive ? "active" : "inactive"
341
357
  })]
342
358
  }),
343
- /* @__PURE__ */ v("div", {
359
+ /* @__PURE__ */ _("div", {
344
360
  className: "mt-4 grid grid-cols-2 gap-3",
345
- children: [/* @__PURE__ */ v("div", {
361
+ children: [/* @__PURE__ */ _("div", {
346
362
  className: "rounded-lg border border-border-seam bg-bg-sunken/40 px-3 py-2",
347
- children: [/* @__PURE__ */ _("p", {
363
+ children: [/* @__PURE__ */ g("p", {
348
364
  className: "text-[11px] font-medium uppercase tracking-wide text-text-secondary",
349
365
  children: "Projects"
350
- }), /* @__PURE__ */ _("p", {
366
+ }), /* @__PURE__ */ g("p", {
351
367
  className: "mt-0.5 text-lg font-semibold tabular-nums text-text-primary",
352
368
  children: i.projects.length
353
369
  })]
354
- }), /* @__PURE__ */ v("div", {
370
+ }), /* @__PURE__ */ _("div", {
355
371
  className: "rounded-lg border border-border-seam bg-bg-sunken/40 px-3 py-2",
356
- children: [/* @__PURE__ */ _("p", {
372
+ children: [/* @__PURE__ */ g("p", {
357
373
  className: "text-[11px] font-medium uppercase tracking-wide text-text-secondary",
358
374
  children: "Tracked hours"
359
- }), /* @__PURE__ */ v("p", {
375
+ }), /* @__PURE__ */ _("p", {
360
376
  className: "mt-0.5 text-lg font-semibold tabular-nums text-text-primary",
361
377
  children: [n(a), "h"]
362
378
  })]
363
379
  })]
364
380
  }),
365
- B > 0 && /* @__PURE__ */ _("div", {
381
+ z > 0 && /* @__PURE__ */ g("div", {
366
382
  className: "mt-3",
367
- children: /* @__PURE__ */ _(de, {
383
+ children: /* @__PURE__ */ g(de, {
368
384
  value: a,
369
- max: B,
385
+ max: z,
370
386
  tone: "success",
371
387
  size: "sm",
372
388
  showValue: !1,
373
389
  label: "Tracked volume vs. top client"
374
390
  })
375
391
  }),
376
- /* @__PURE__ */ v("div", {
392
+ /* @__PURE__ */ _("div", {
377
393
  className: "mt-4 flex items-center justify-between rounded-lg border border-border-seam bg-bg-sunken/40 px-3 py-2",
378
- children: [/* @__PURE__ */ _("span", {
394
+ children: [/* @__PURE__ */ g("span", {
379
395
  className: "text-xs font-medium text-text-secondary",
380
396
  children: "Public Access"
381
- }), /* @__PURE__ */ v("button", {
397
+ }), /* @__PURE__ */ _("button", {
382
398
  type: "button",
383
399
  disabled: o,
384
- onClick: () => void Je(i),
400
+ onClick: () => void Xe(i),
385
401
  title: i.isActive ? "Deactivate client portal" : "Activate client portal",
386
402
  className: e("inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-xs font-medium transition-colors disabled:opacity-50", i.isActive ? "bg-status-success-bg text-status-success-text hover:bg-status-success-bg/80" : "border border-border-seam bg-bg-surface text-text-secondary hover:bg-bg-sunken/60"),
387
- children: [/* @__PURE__ */ _(m, { className: "h-3.5 w-3.5" }), i.isActive ? "Active" : "Inactive"]
403
+ children: [/* @__PURE__ */ g(ve, { className: "h-3.5 w-3.5" }), i.isActive ? "Active" : "Inactive"]
388
404
  })]
389
405
  }),
390
- /* @__PURE__ */ v("div", {
406
+ /* @__PURE__ */ _("div", {
391
407
  className: "mt-4 flex flex-wrap items-center gap-2 border-t border-border-seam pt-3",
392
- children: [i.isActive && i.shareToken && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("button", {
408
+ children: [i.isActive && i.shareToken && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("button", {
393
409
  type: "button",
394
- onClick: () => void Ve(i),
410
+ onClick: () => void We(i),
395
411
  title: "Copy the client's private share link",
396
412
  className: "inline-flex items-center gap-1.5 rounded-md border border-border-seam bg-bg-surface px-2.5 py-1.5 text-xs font-medium text-text-secondary hover:bg-bg-sunken/60",
397
- children: s ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(pe, { className: "h-3.5 w-3.5" }), " Copied"] }) : /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(he, { className: "h-3.5 w-3.5" }), " Share link"] })
398
- }), /* @__PURE__ */ v("button", {
413
+ children: s ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(pe, { className: "h-3.5 w-3.5" }), " Copied"] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(he, { className: "h-3.5 w-3.5" }), " Share link"] })
414
+ }), /* @__PURE__ */ _("button", {
399
415
  type: "button",
400
- disabled: o && j,
401
- onClick: () => void He(i),
416
+ disabled: o && A,
417
+ onClick: () => void Z(i),
402
418
  title: "Regenerate the link (invalidates the old one)",
403
419
  className: "inline-flex items-center gap-1.5 rounded-md border border-border-seam bg-bg-surface px-2.5 py-1.5 text-xs font-medium text-text-secondary hover:bg-bg-sunken/60 disabled:opacity-50",
404
- children: [/* @__PURE__ */ _(_e, { className: e("h-3.5 w-3.5", o && j && "animate-spin") }), "Regenerate"]
405
- })] }), /* @__PURE__ */ v("div", {
420
+ children: [/* @__PURE__ */ g(p, { className: e("h-3.5 w-3.5", o && A && "animate-spin") }), "Regenerate"]
421
+ })] }), /* @__PURE__ */ _("div", {
406
422
  className: "ml-auto flex items-center gap-1",
407
- children: [/* @__PURE__ */ _("button", {
423
+ children: [/* @__PURE__ */ g("button", {
408
424
  type: "button",
409
- onClick: () => We(i),
425
+ onClick: () => Ke(i),
410
426
  title: "Edit client",
411
427
  className: "inline-flex items-center rounded-md border border-border-seam bg-bg-surface p-1.5 text-text-secondary hover:bg-bg-sunken/60",
412
- children: /* @__PURE__ */ _(f, { className: "h-3.5 w-3.5" })
413
- }), /* @__PURE__ */ _("button", {
428
+ children: /* @__PURE__ */ g(ge, { className: "h-3.5 w-3.5" })
429
+ }), /* @__PURE__ */ g("button", {
414
430
  type: "button",
415
- onClick: () => Y(i),
431
+ onClick: () => J(i),
416
432
  title: "Delete client",
417
433
  className: "inline-flex items-center rounded-md border border-border-seam bg-bg-surface p-1.5 text-status-error-text hover:bg-status-error-bg",
418
- children: /* @__PURE__ */ _(ve, { className: "h-3.5 w-3.5" })
434
+ children: /* @__PURE__ */ g(be, { className: "h-3.5 w-3.5" })
419
435
  })]
420
436
  })]
421
437
  })
@@ -423,109 +439,109 @@ function S() {
423
439
  }, i.id);
424
440
  })
425
441
  }),
426
- Ie && /* @__PURE__ */ _("div", {
442
+ ze && /* @__PURE__ */ g("div", {
427
443
  className: "flex justify-center",
428
- children: /* @__PURE__ */ _("button", {
429
- onClick: Ye,
430
- disabled: V,
444
+ children: /* @__PURE__ */ g("button", {
445
+ onClick: Ze,
446
+ disabled: B,
431
447
  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",
432
- children: V ? "Loading..." : "Load more"
448
+ children: B ? "Loading..." : "Load more"
433
449
  })
434
450
  })
435
451
  ] }),
436
- /* @__PURE__ */ _(l, {
437
- open: ze,
452
+ /* @__PURE__ */ g(u, {
453
+ open: He,
438
454
  onClose: Q,
439
- title: W ? "Edit Client" : "Add Client",
440
- description: W ? "Update this client's portal details." : "Set up a client so you can share projects and tracked hours with them.",
441
- footer: /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("button", {
455
+ title: U ? "Edit Client" : "Add Client",
456
+ description: U ? "Update this client's portal details." : "Set up a client so you can share projects and tracked hours with them.",
457
+ footer: /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("button", {
442
458
  onClick: Q,
443
459
  className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50",
444
460
  children: "Cancel"
445
- }), /* @__PURE__ */ _("button", {
446
- onClick: Ke,
447
- disabled: M || P || !K.clientName.trim(),
461
+ }), /* @__PURE__ */ g("button", {
462
+ onClick: Je,
463
+ disabled: j || M || !G.clientName.trim(),
448
464
  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",
449
- children: M || P ? "Saving..." : W ? "Save Changes" : "Add Client"
465
+ children: j || M ? "Saving..." : U ? "Save Changes" : "Add Client"
450
466
  })] }),
451
- children: /* @__PURE__ */ v("div", {
467
+ children: /* @__PURE__ */ _("div", {
452
468
  className: "space-y-4",
453
469
  children: [
454
- /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
470
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
455
471
  className: "block text-sm font-medium text-text-primary",
456
472
  children: "Client Name"
457
- }), /* @__PURE__ */ _("input", {
473
+ }), /* @__PURE__ */ g("input", {
458
474
  type: "text",
459
475
  placeholder: "e.g. Acme Corp",
460
- value: K.clientName,
461
- onChange: (e) => q({
462
- ...K,
476
+ value: G.clientName,
477
+ onChange: (e) => K({
478
+ ...G,
463
479
  clientName: e.target.value
464
480
  }),
465
- className: b
481
+ className: y
466
482
  })] }),
467
- /* @__PURE__ */ v("div", {
483
+ /* @__PURE__ */ _("div", {
468
484
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
469
- children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
485
+ children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
470
486
  className: "block text-sm font-medium text-text-primary",
471
487
  children: "Contact Email"
472
- }), /* @__PURE__ */ _("input", {
488
+ }), /* @__PURE__ */ g("input", {
473
489
  type: "email",
474
490
  placeholder: "contact@client.com",
475
- value: K.contactEmail,
476
- onChange: (e) => q({
477
- ...K,
491
+ value: G.contactEmail,
492
+ onChange: (e) => K({
493
+ ...G,
478
494
  contactEmail: e.target.value
479
495
  }),
480
- className: b
481
- })] }), /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
496
+ className: y
497
+ })] }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
482
498
  className: "block text-sm font-medium text-text-primary",
483
499
  children: "Contact Phone"
484
- }), /* @__PURE__ */ _("input", {
500
+ }), /* @__PURE__ */ g("input", {
485
501
  type: "tel",
486
502
  placeholder: "Optional",
487
- value: K.contactPhone,
488
- onChange: (e) => q({
489
- ...K,
503
+ value: G.contactPhone,
504
+ onChange: (e) => K({
505
+ ...G,
490
506
  contactPhone: e.target.value
491
507
  }),
492
- className: b
508
+ className: y
493
509
  })] })]
494
510
  }),
495
- /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
511
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
496
512
  className: "block text-sm font-medium text-text-primary",
497
513
  children: "Description"
498
- }), /* @__PURE__ */ _("textarea", {
514
+ }), /* @__PURE__ */ g("textarea", {
499
515
  rows: 3,
500
516
  placeholder: "Notes about this client (optional)",
501
- value: K.description,
502
- onChange: (e) => q({
503
- ...K,
517
+ value: G.description,
518
+ onChange: (e) => K({
519
+ ...G,
504
520
  description: e.target.value
505
521
  }),
506
- className: b
522
+ className: y
507
523
  })] }),
508
- /* @__PURE__ */ v("div", { children: [
509
- /* @__PURE__ */ _("label", {
524
+ /* @__PURE__ */ _("div", { children: [
525
+ /* @__PURE__ */ g("label", {
510
526
  className: "block text-sm font-medium text-text-primary",
511
527
  children: "Logo"
512
528
  }),
513
- /* @__PURE__ */ _("input", {
529
+ /* @__PURE__ */ g("input", {
514
530
  type: "file",
515
531
  accept: "image/*",
516
- disabled: D,
532
+ disabled: E,
517
533
  onChange: (e) => {
518
534
  let t = e.target.files?.[0];
519
- t && Ge(t), e.target.value = "";
535
+ t && qe(t), e.target.value = "";
520
536
  },
521
- className: Ce
537
+ className: Te
522
538
  }),
523
- D && /* @__PURE__ */ _("p", {
539
+ E && /* @__PURE__ */ g("p", {
524
540
  className: "mt-1 text-xs text-text-secondary",
525
541
  children: "Uploading…"
526
542
  }),
527
- K.logoUrl && /* @__PURE__ */ _("img", {
528
- src: K.logoUrl,
543
+ G.logoUrl && /* @__PURE__ */ g("img", {
544
+ src: G.logoUrl,
529
545
  alt: "Client logo preview",
530
546
  className: "mt-2 h-16 w-16 rounded-md border border-border-seam object-cover"
531
547
  })
@@ -533,35 +549,35 @@ function S() {
533
549
  ]
534
550
  })
535
551
  }),
536
- /* @__PURE__ */ _(l, {
537
- open: J !== null,
538
- onClose: () => Y(null),
552
+ /* @__PURE__ */ g(u, {
553
+ open: q !== null,
554
+ onClose: () => J(null),
539
555
  title: "Delete client?",
540
- description: J ? `"${J.clientName}" and its share link will be removed.` : void 0,
556
+ description: q ? `"${q.clientName}" and its share link will be removed.` : void 0,
541
557
  size: "sm",
542
- footer: /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("button", {
543
- onClick: () => Y(null),
558
+ footer: /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("button", {
559
+ onClick: () => J(null),
544
560
  className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50",
545
561
  children: "Cancel"
546
- }), /* @__PURE__ */ _("button", {
547
- onClick: qe,
548
- disabled: F,
562
+ }), /* @__PURE__ */ g("button", {
563
+ onClick: Ye,
564
+ disabled: N,
549
565
  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",
550
- children: F ? "Deleting..." : "Delete"
566
+ children: N ? "Deleting..." : "Delete"
551
567
  })] }),
552
- children: /* @__PURE__ */ _("p", {
568
+ children: /* @__PURE__ */ g("p", {
553
569
  className: "text-sm text-text-secondary",
554
570
  children: "The client will lose access to their shared portal immediately. This cannot be undone."
555
571
  })
556
572
  }),
557
- /* @__PURE__ */ _(se, {
558
- toasts: h,
559
- onDismiss: C
573
+ /* @__PURE__ */ g(se, {
574
+ toasts: m,
575
+ onDismiss: S
560
576
  })
561
577
  ]
562
578
  });
563
579
  }
564
580
  //#endregion
565
- export { S as ClientPortalPage };
581
+ export { x as ClientPortalPage };
566
582
 
567
583
  //# sourceMappingURL=ClientPortalPage.js.map