@burdenoff/microfe-timecampus 2026.1025.1 → 2026.1028.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.
@@ -6,165 +6,179 @@ import { PageLayout as n } from "../../components/PageLayout.js";
6
6
  import { StatusBadge as r } from "../../components/StatusBadge.js";
7
7
  import { ToastContainer as fe, useToast as pe } from "../../components/Toast.js";
8
8
  import { TimeCampusFocusBlockResponse as i, TimeCampusFocusProtectionLevel as a, TimeCampusFocusSessionStatus as o } from "../../../generated/wspace-types.js";
9
- import { DAY_MS as me, canStartBlock as he, formatDuration as s, formatRange as c, localDayStart as ge, minutesLeft as _e, minutesToTime as l, parseSiteList as ve, reasonLabel as ye, timeToMinutes as be } from "./focusHelpers.js";
10
- import { useEffect as u, useMemo as d, useState as f } from "react";
11
- import { AlarmClock as xe, Ban as Se, CalendarClock as Ce, Check as we, Play as Te, Shield as p, ShieldCheck as Ee, Square as De, Target as m, X as Oe } from "lucide-react";
12
- import { Fragment as ke, jsx as h, jsxs as g } from "react/jsx-runtime";
13
- import { GlassCard as Ae } from "@burdenoff/fe-libs/ui";
9
+ import { useDesktopFocusStatus as me } from "./useDesktopFocusStatus.js";
10
+ import { DAY_MS as s, announceFocusChange as he, canStartBlock as ge, formatDuration as c, formatRange as l, localDayStart as _e, minutesLeft as ve, minutesToTime as ye, parseAppList as be, parseSiteList as xe, reasonLabel as Se, timeToMinutes as Ce } from "./focusHelpers.js";
11
+ import { useEffect as we, useMemo as u, useState as d } from "react";
12
+ import { AlarmClock as Te, Ban as f, CalendarClock as Ee, Check as De, Play as p, Shield as m, ShieldCheck as Oe, Square as ke, Target as h, X as Ae } from "lucide-react";
13
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
14
+ import { GlassCard as je } from "@burdenoff/fe-libs/ui";
14
15
  //#region src/timecampus/pages/focus/FocusProtectionPage.tsx
15
- var _ = "Focus Protection", v = "Adaptive focus blocks and distraction blocking during focus sessions", je = [
16
+ var y = "Focus Protection", b = "Adaptive focus blocks and distraction blocking during focus sessions", Me = [
16
17
  "GetActiveFocusSession",
17
18
  "GetFocusBlockSuggestions",
18
19
  "ListFocusBlocks",
19
20
  "GetFocusProtectionSummary"
20
- ], y = "rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm text-text-primary", b = "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50", x = "inline-flex items-center gap-1.5 rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-surface-hover disabled:opacity-50";
21
- function S(e) {
21
+ ], x = "rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm text-text-primary", S = "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50", C = "inline-flex items-center gap-1.5 rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-surface-hover disabled:opacity-50", w = {
22
+ on: "on",
23
+ off: "off",
24
+ running: "on",
25
+ stopped: "off",
26
+ unsupported: "not available on this system",
27
+ "needs-setup": "needs a one-time setup",
28
+ error: "not working"
29
+ };
30
+ function T(e) {
31
+ return w[e] ?? e;
32
+ }
33
+ function E(e) {
22
34
  return e instanceof Error ? e.message : "Something went wrong";
23
35
  }
24
- function C() {
25
- let { workspaceId: C = "" } = e(), { toasts: Me, addToast: w, dismissToast: Ne } = pe(), [T, Pe] = f(0), [E, Fe] = f(() => Date.now());
26
- u(() => {
36
+ function D() {
37
+ let { workspaceId: w = "" } = e(), { toasts: D, addToast: O, dismissToast: Ne } = pe(), [k, Pe] = d(0), [A, Fe] = d(() => Date.now());
38
+ we(() => {
27
39
  let e = window.setInterval(() => Fe(Date.now()), 6e4);
28
40
  return () => window.clearInterval(e);
29
41
  }, []);
30
- let D = d(() => ge(/* @__PURE__ */ new Date(), T), [T]), Ie = d(() => new Date(D.getTime() + me), [D]), Le = d(() => {
42
+ let j = u(() => _e(/* @__PURE__ */ new Date(), k), [k]), Ie = u(() => new Date(j.getTime() + s), [j]), Le = u(() => {
31
43
  let e = /* @__PURE__ */ new Date();
32
44
  return {
33
- from: (/* @__PURE__ */ new Date(e.getTime() - 7 * me)).toISOString(),
45
+ from: (/* @__PURE__ */ new Date(e.getTime() - 7 * s)).toISOString(),
34
46
  to: e.toISOString()
35
47
  };
36
- }, []), O = re({ skip: !C }), k = ie({
37
- variables: { dayStart: D.toISOString() },
38
- skip: !C
39
- }), Re = se({
48
+ }, []), M = re({ skip: !w }), N = ie({
49
+ variables: { dayStart: j.toISOString() },
50
+ skip: !w
51
+ }), P = se({
40
52
  variables: {
41
- from: D.toISOString(),
53
+ from: j.toISOString(),
42
54
  to: Ie.toISOString()
43
55
  },
44
- skip: !C
45
- }), A = ae({ skip: !C }), ze = oe({
56
+ skip: !w
57
+ }), F = ae({ skip: !w }), Re = oe({
46
58
  variables: Le,
47
- skip: !C
48
- }), j = { refetchQueries: je }, [Be, { loading: M }] = ue(j), [Ve, { loading: N }] = ne(j), [He] = ce(j), [Ue, { loading: P }] = le(j), [We] = te(j), [Ge, { loading: F }] = de({ refetchQueries: ["GetFocusPreferences", "GetFocusBlockSuggestions"] }), [I, Ke] = f(50), [L, qe] = f(!1), R = A.data?.timeCampusFocusPreferences, [z, B] = f("09:00"), [V, H] = f("18:00"), [U, W] = f(90), [Je, G] = f(2), [K, q] = f(10), [Ye, Xe] = f(!0), [Ze, J] = f("");
49
- u(() => {
50
- R && (B(l(R.workdayStartMinute)), H(l(R.workdayEndMinute)), W(R.preferredBlockMinutes), G(R.maxBlocksPerDay), q(R.meetingBufferMinutes), Xe(R.blockingEnabled), J(R.blockedDomains.join("\n")));
51
- }, [R]);
52
- let Y = O.data?.timeCampusActiveFocusSession ?? null, Qe = k.data?.timeCampusFocusBlockSuggestions ?? [], $e = Re.data?.timeCampusFocusBlocks ?? [], X = ze.data?.timeCampusFocusSummary, et = !O.data && O.loading || !A.data && A.loading, tt = O.error ?? A.error;
59
+ skip: !w
60
+ }), I = { refetchQueries: Me }, [ze, { loading: L }] = ue(I), [Be, { loading: R }] = ne(I), [Ve] = ce(I), [He, { loading: z }] = le(I), [Ue] = te(I), [We, { loading: B }] = de({ refetchQueries: ["GetFocusPreferences", "GetFocusBlockSuggestions"] }), [V, Ge] = d(50), [H, Ke] = d(!1), U = F.data?.timeCampusFocusPreferences, [W, G] = d("09:00"), [K, qe] = d("18:00"), [q, Je] = d(90), [Ye, Xe] = d(2), [Ze, Qe] = d(10), [$e, et] = d(!0), [tt, nt] = d(""), [rt, it] = d(""), [at, ot] = d(!0), J = me();
61
+ we(() => {
62
+ U && (G(ye(U.workdayStartMinute)), qe(ye(U.workdayEndMinute)), Je(U.preferredBlockMinutes), Xe(U.maxBlocksPerDay), Qe(U.meetingBufferMinutes), et(U.blockingEnabled), nt(U.blockedDomains.join("\n")), it(U.blockedApps.join("\n")), ot(U.doNotDisturb));
63
+ }, [U]);
64
+ let Y = M.data?.timeCampusActiveFocusSession ?? null, st = N.data?.timeCampusFocusBlockSuggestions ?? [], ct = P.data?.timeCampusFocusBlocks ?? [], X = Re.data?.timeCampusFocusSummary, lt = !M.data && M.loading || !F.data && F.loading, ut = M.error ?? F.error;
53
65
  async function Z(e, t) {
54
66
  try {
55
- await e(), w({
67
+ await e(), he(), O({
56
68
  title: t,
57
69
  variant: "success"
58
70
  });
59
71
  } catch (e) {
60
- w({
61
- title: S(e),
72
+ O({
73
+ title: E(e),
62
74
  variant: "error"
63
75
  });
64
76
  }
65
77
  }
66
- let nt = (e) => Z(() => Be({ variables: {
67
- plannedDurationSeconds: e ? void 0 : I * 60,
68
- protectionLevel: L ? a.Strict : a.Standard,
78
+ let dt = (e) => Z(() => ze({ variables: {
79
+ plannedDurationSeconds: e ? void 0 : V * 60,
80
+ protectionLevel: H ? a.Strict : a.Standard,
69
81
  focusBlockId: e
70
- } }), "Focus session started"), rt = (e) => Y ? Z(() => Ve({ variables: {
82
+ } }), "Focus session started"), ft = (e) => Y ? Z(() => Be({ variables: {
71
83
  id: Y.id,
72
84
  status: e
73
- } }), e === o.Completed ? "Focus session completed" : "Focus session abandoned") : void 0, Q = (e, t) => Z(() => Ue({ variables: { input: {
85
+ } }), e === o.Completed ? "Focus session completed" : "Focus session abandoned") : void 0, Q = (e, t) => Z(() => He({ variables: { input: {
74
86
  startTime: e.startTime,
75
87
  endTime: e.endTime,
76
88
  response: t,
77
- dayStart: D.toISOString(),
89
+ dayStart: j.toISOString(),
78
90
  snoozeMinutes: t === i.Snooze ? 30 : null
79
- } } }), t === i.Accept ? "Focus block scheduled" : t === i.Snooze ? "Snoozed for 30 minutes" : "Suggestion dismissed"), it = () => {
80
- let e = be(z), t = be(V);
91
+ } } }), t === i.Accept ? "Focus block scheduled" : t === i.Snooze ? "Snoozed for 30 minutes" : "Suggestion dismissed"), pt = () => {
92
+ let e = Ce(W), t = Ce(K);
81
93
  if (e === null || t === null) {
82
- w({
94
+ O({
83
95
  title: "Use HH:MM for the workday",
84
96
  variant: "error"
85
97
  });
86
98
  return;
87
99
  }
88
- Z(() => Ge({ variables: { input: {
100
+ Z(() => We({ variables: { input: {
89
101
  workdayStartMinute: e,
90
102
  workdayEndMinute: t,
91
- preferredBlockMinutes: U,
92
- minBlockMinutes: Math.min(45, U),
93
- maxBlocksPerDay: Je,
94
- meetingBufferMinutes: K,
95
- blockingEnabled: Ye,
96
- blockedDomains: ve(Ze)
103
+ preferredBlockMinutes: q,
104
+ minBlockMinutes: Math.min(45, q),
105
+ maxBlocksPerDay: Ye,
106
+ meetingBufferMinutes: Ze,
107
+ blockingEnabled: $e,
108
+ blockedDomains: xe(tt),
109
+ blockedApps: be(rt),
110
+ doNotDisturb: at
97
111
  } } }), "Focus settings saved");
98
112
  };
99
- if (et) return /* @__PURE__ */ h(n, {
100
- title: _,
101
- description: v,
102
- children: /* @__PURE__ */ h(ee, {
113
+ if (lt) return /* @__PURE__ */ _(n, {
114
+ title: y,
115
+ description: b,
116
+ children: /* @__PURE__ */ _(ee, {
103
117
  variant: "card",
104
118
  count: 4
105
119
  })
106
120
  });
107
- if (tt && !O.data) return /* @__PURE__ */ h(n, {
108
- title: _,
109
- description: v,
110
- children: /* @__PURE__ */ h("div", {
121
+ if (ut && !M.data) return /* @__PURE__ */ _(n, {
122
+ title: y,
123
+ description: b,
124
+ children: /* @__PURE__ */ _("div", {
111
125
  className: "rounded-xl border border-status-error-border/50 bg-status-error-bg/10 p-4 text-sm text-status-error-text",
112
126
  children: "Failed to load focus protection. Please try again later."
113
127
  })
114
128
  });
115
- let $ = Y ? _e(Y.startTime, Y.plannedDurationSeconds, E) : null, at = X ? Math.round(X.averageProtectionRatio * 100) : null;
116
- return /* @__PURE__ */ g(n, {
117
- title: _,
118
- description: v,
119
- purpose: "Protect the hours that matter: TimeCampus suggests focus blocks around your meetings and the times you focus best, and blocks distracting sites in your browser while a session runs.",
129
+ let $ = Y ? ve(Y.startTime, Y.plannedDurationSeconds, A) : null, mt = X ? Math.round(X.averageProtectionRatio * 100) : null;
130
+ return /* @__PURE__ */ v(n, {
131
+ title: y,
132
+ description: b,
133
+ purpose: "Protect the hours that matter: TimeCampus suggests focus blocks around your meetings and the times you focus best, and blocks distracting sites in your browser, and in the desktop app turns on Do Not Disturb and hides distracting apps while a session runs.",
120
134
  children: [
121
- /* @__PURE__ */ h(fe, {
122
- toasts: Me,
135
+ /* @__PURE__ */ _(fe, {
136
+ toasts: D,
123
137
  onDismiss: Ne
124
138
  }),
125
- /* @__PURE__ */ g("div", {
139
+ /* @__PURE__ */ v("div", {
126
140
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
127
141
  children: [
128
- /* @__PURE__ */ h(t, {
142
+ /* @__PURE__ */ _(t, {
129
143
  featured: !0,
130
144
  title: "Protected Time",
131
- value: X ? s(X.totalProtectedSeconds) : "--",
132
- icon: /* @__PURE__ */ h(Ee, { className: "h-5 w-5" }),
145
+ value: X ? c(X.totalProtectedSeconds) : "--",
146
+ icon: /* @__PURE__ */ _(Oe, { className: "h-5 w-5" }),
133
147
  description: "Last 7 days"
134
148
  }),
135
- /* @__PURE__ */ h(t, {
149
+ /* @__PURE__ */ _(t, {
136
150
  title: "Protection Ratio",
137
- value: at === null ? "--" : `${at}%`,
138
- icon: /* @__PURE__ */ h(p, { className: "h-5 w-5" }),
151
+ value: mt === null ? "--" : `${mt}%`,
152
+ icon: /* @__PURE__ */ _(m, { className: "h-5 w-5" }),
139
153
  description: "Protected vs interrupted"
140
154
  }),
141
- /* @__PURE__ */ h(t, {
155
+ /* @__PURE__ */ _(t, {
142
156
  title: "Sessions",
143
157
  value: X ? String(X.totalSessions) : "--",
144
- icon: /* @__PURE__ */ h(m, { className: "h-5 w-5" }),
158
+ icon: /* @__PURE__ */ _(h, { className: "h-5 w-5" }),
145
159
  description: X ? `${X.completedSessions} completed` : "Last 7 days"
146
160
  }),
147
- /* @__PURE__ */ h(t, {
161
+ /* @__PURE__ */ _(t, {
148
162
  title: "Interruptions",
149
163
  value: X ? String(X.totalInterruptionCount) : "--",
150
- icon: /* @__PURE__ */ h(Se, { className: "h-5 w-5" }),
164
+ icon: /* @__PURE__ */ _(f, { className: "h-5 w-5" }),
151
165
  description: "Logged, detected or bypassed"
152
166
  })
153
167
  ]
154
168
  }),
155
- /* @__PURE__ */ h("div", {
169
+ /* @__PURE__ */ _("div", {
156
170
  className: "mt-6",
157
171
  "data-testid": "focus-session-card",
158
- children: /* @__PURE__ */ g(Ae, {
172
+ children: /* @__PURE__ */ v(je, {
159
173
  treatment: "glass",
160
174
  glow: !0,
161
175
  className: "p-6",
162
- children: [/* @__PURE__ */ g("div", {
176
+ children: [/* @__PURE__ */ v("div", {
163
177
  className: "flex flex-wrap items-start justify-between gap-4",
164
- children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("h3", {
178
+ children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("h3", {
165
179
  className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
166
- children: [/* @__PURE__ */ h(p, { className: "h-4 w-4" }), "Focus session"]
167
- }), Y ? /* @__PURE__ */ g("p", {
180
+ children: [/* @__PURE__ */ _(m, { className: "h-4 w-4" }), "Focus session"]
181
+ }), Y ? /* @__PURE__ */ v("p", {
168
182
  className: "mt-1 text-sm text-text-secondary",
169
183
  "data-testid": "focus-session-status",
170
184
  children: [
@@ -176,149 +190,149 @@ function C() {
176
190
  ",",
177
191
  " ",
178
192
  Y.blockedAttemptCount,
179
- " site",
193
+ " distraction",
180
194
  Y.blockedAttemptCount === 1 ? "" : "s",
181
195
  " blocked."
182
196
  ]
183
- }) : /* @__PURE__ */ h("p", {
197
+ }) : /* @__PURE__ */ _("p", {
184
198
  className: "mt-1 text-sm text-text-secondary",
185
- children: "No session running. While one is active, the TimeCampus browser extension blocks the sites listed below."
186
- })] }), Y && /* @__PURE__ */ h(r, {
199
+ children: "No session running. While one is active, the TimeCampus browser extension blocks the sites listed below and the TimeCampus desktop app hides or flags the apps listed below."
200
+ })] }), Y && /* @__PURE__ */ _(r, {
187
201
  variant: Y.protectionLevel === a.Strict ? "warning" : "success",
188
202
  label: Y.protectionLevel === a.Strict ? "Strict" : "Standard"
189
203
  })]
190
- }), /* @__PURE__ */ h("div", {
204
+ }), /* @__PURE__ */ _("div", {
191
205
  className: "mt-4 flex flex-wrap items-center gap-3",
192
- children: Y ? /* @__PURE__ */ g(ke, { children: [
193
- /* @__PURE__ */ g("button", {
206
+ children: Y ? /* @__PURE__ */ v(g, { children: [
207
+ /* @__PURE__ */ v("button", {
194
208
  type: "button",
195
- className: b,
196
- disabled: N,
197
- onClick: () => rt(o.Completed),
209
+ className: S,
210
+ disabled: R,
211
+ onClick: () => ft(o.Completed),
198
212
  "data-testid": "focus-end",
199
- children: [/* @__PURE__ */ h(De, { className: "h-4 w-4" }), " End session"]
213
+ children: [/* @__PURE__ */ _(ke, { className: "h-4 w-4" }), " End session"]
200
214
  }),
201
- /* @__PURE__ */ h("button", {
215
+ /* @__PURE__ */ _("button", {
202
216
  type: "button",
203
- className: x,
204
- disabled: N,
205
- onClick: () => rt(o.Abandoned),
217
+ className: C,
218
+ disabled: R,
219
+ onClick: () => ft(o.Abandoned),
206
220
  children: "Abandon"
207
221
  }),
208
- /* @__PURE__ */ h("button", {
222
+ /* @__PURE__ */ _("button", {
209
223
  type: "button",
210
- className: x,
211
- onClick: () => Z(() => He({ variables: { focusSessionId: Y.id } }), "Interruption logged"),
224
+ className: C,
225
+ onClick: () => Z(() => Ve({ variables: { focusSessionId: Y.id } }), "Interruption logged"),
212
226
  "data-testid": "focus-log-interruption",
213
227
  children: "Log an interruption"
214
228
  })
215
- ] }) : /* @__PURE__ */ g(ke, { children: [
216
- /* @__PURE__ */ g("label", {
229
+ ] }) : /* @__PURE__ */ v(g, { children: [
230
+ /* @__PURE__ */ v("label", {
217
231
  className: "flex items-center gap-2 text-sm text-text-secondary",
218
- children: ["Length", /* @__PURE__ */ g("select", {
219
- className: y,
220
- value: I,
221
- onChange: (e) => Ke(Number(e.target.value)),
232
+ children: ["Length", /* @__PURE__ */ v("select", {
233
+ className: x,
234
+ value: V,
235
+ onChange: (e) => Ge(Number(e.target.value)),
222
236
  "data-testid": "focus-length",
223
237
  children: [
224
- /* @__PURE__ */ h("option", {
238
+ /* @__PURE__ */ _("option", {
225
239
  value: 25,
226
240
  children: "25 min"
227
241
  }),
228
- /* @__PURE__ */ h("option", {
242
+ /* @__PURE__ */ _("option", {
229
243
  value: 50,
230
244
  children: "50 min"
231
245
  }),
232
- /* @__PURE__ */ h("option", {
246
+ /* @__PURE__ */ _("option", {
233
247
  value: 90,
234
248
  children: "90 min"
235
249
  }),
236
- /* @__PURE__ */ h("option", {
250
+ /* @__PURE__ */ _("option", {
237
251
  value: 120,
238
252
  children: "2 hours"
239
253
  })
240
254
  ]
241
255
  })]
242
256
  }),
243
- /* @__PURE__ */ g("label", {
257
+ /* @__PURE__ */ v("label", {
244
258
  className: "flex items-center gap-2 text-sm text-text-secondary",
245
- children: [/* @__PURE__ */ h("input", {
259
+ children: [/* @__PURE__ */ _("input", {
246
260
  type: "checkbox",
247
- checked: L,
248
- onChange: (e) => qe(e.target.checked),
261
+ checked: H,
262
+ onChange: (e) => Ke(e.target.checked),
249
263
  className: "h-4 w-4 rounded border-border-subtle"
250
264
  }), "Strict (no “continue anyway”)"]
251
265
  }),
252
- /* @__PURE__ */ g("button", {
266
+ /* @__PURE__ */ v("button", {
253
267
  type: "button",
254
- className: b,
255
- disabled: M,
256
- onClick: () => nt(),
268
+ className: S,
269
+ disabled: L,
270
+ onClick: () => dt(),
257
271
  "data-testid": "focus-start",
258
- children: [/* @__PURE__ */ h(Te, { className: "h-4 w-4" }), " Start focus session"]
272
+ children: [/* @__PURE__ */ _(p, { className: "h-4 w-4" }), " Start focus session"]
259
273
  })
260
274
  ] })
261
275
  })]
262
276
  })
263
277
  }),
264
- /* @__PURE__ */ g("div", {
278
+ /* @__PURE__ */ v("div", {
265
279
  className: "mt-6 grid grid-cols-1 gap-6 lg:grid-cols-2",
266
- children: [/* @__PURE__ */ g("div", {
280
+ children: [/* @__PURE__ */ v("div", {
267
281
  className: "rounded-xl border border-border-seam bg-bg-surface p-6 shadow-elevation-1",
268
282
  "data-testid": "focus-suggestions",
269
283
  children: [
270
- /* @__PURE__ */ g("div", {
284
+ /* @__PURE__ */ v("div", {
271
285
  className: "flex flex-wrap items-center justify-between gap-2",
272
- children: [/* @__PURE__ */ g("h3", {
286
+ children: [/* @__PURE__ */ v("h3", {
273
287
  className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
274
- children: [/* @__PURE__ */ h(Ce, { className: "h-4 w-4" }), "Suggested focus blocks"]
275
- }), /* @__PURE__ */ h("div", {
288
+ children: [/* @__PURE__ */ _(Ee, { className: "h-4 w-4" }), "Suggested focus blocks"]
289
+ }), /* @__PURE__ */ _("div", {
276
290
  className: "flex gap-1",
277
291
  role: "group",
278
292
  "aria-label": "Day to plan",
279
- children: ["Today", "Tomorrow"].map((e, t) => /* @__PURE__ */ h("button", {
293
+ children: ["Today", "Tomorrow"].map((e, t) => /* @__PURE__ */ _("button", {
280
294
  type: "button",
281
- "aria-pressed": T === t,
282
- className: T === t ? b : x,
295
+ "aria-pressed": k === t,
296
+ className: k === t ? S : C,
283
297
  onClick: () => Pe(t),
284
298
  children: e
285
299
  }, e))
286
300
  })]
287
301
  }),
288
- /* @__PURE__ */ h("p", {
302
+ /* @__PURE__ */ _("p", {
289
303
  className: "mt-1 text-xs text-text-secondary",
290
304
  children: "Ranked from your peak hours, meetings and how well past sessions held up. Snoozed and dismissed slots are planned around."
291
305
  }),
292
- /* @__PURE__ */ g("div", {
306
+ /* @__PURE__ */ v("div", {
293
307
  className: "mt-4 space-y-3",
294
308
  children: [
295
- k.error && /* @__PURE__ */ h("p", {
309
+ N.error && /* @__PURE__ */ _("p", {
296
310
  className: "text-sm text-status-error-text",
297
- children: S(k.error)
311
+ children: E(N.error)
298
312
  }),
299
- !k.error && k.data && Qe.length === 0 && /* @__PURE__ */ g("p", {
313
+ !N.error && N.data && st.length === 0 && /* @__PURE__ */ v("p", {
300
314
  className: "text-sm text-text-secondary",
301
315
  "data-testid": "focus-suggestions-empty",
302
316
  children: [
303
317
  "No free window left for",
304
318
  " ",
305
- T === 0 ? "today" : "tomorrow",
319
+ k === 0 ? "today" : "tomorrow",
306
320
  " — your day is full or you have scheduled your maximum blocks."
307
321
  ]
308
322
  }),
309
- Qe.map((e) => /* @__PURE__ */ g("div", {
323
+ st.map((e) => /* @__PURE__ */ v("div", {
310
324
  className: "rounded-lg border border-border-subtle p-3",
311
325
  "data-testid": "focus-suggestion",
312
326
  children: [
313
- /* @__PURE__ */ g("div", {
327
+ /* @__PURE__ */ v("div", {
314
328
  className: "flex flex-wrap items-center justify-between gap-2",
315
- children: [/* @__PURE__ */ g("span", {
329
+ children: [/* @__PURE__ */ v("span", {
316
330
  className: "text-sm font-medium text-text-primary",
317
- children: [c(e.startTime, e.endTime), /* @__PURE__ */ h("span", {
331
+ children: [l(e.startTime, e.endTime), /* @__PURE__ */ _("span", {
318
332
  className: "ml-2 text-xs text-text-secondary",
319
- children: s(e.durationMinutes * 60)
333
+ children: c(e.durationMinutes * 60)
320
334
  })]
321
- }), /* @__PURE__ */ g("span", {
335
+ }), /* @__PURE__ */ v("span", {
322
336
  className: "text-xs text-text-secondary",
323
337
  children: [
324
338
  "Fit ",
@@ -327,39 +341,39 @@ function C() {
327
341
  ]
328
342
  })]
329
343
  }),
330
- /* @__PURE__ */ h("div", {
344
+ /* @__PURE__ */ _("div", {
331
345
  className: "mt-2 flex flex-wrap gap-1.5",
332
- children: e.reasons.map((e) => /* @__PURE__ */ h(r, {
346
+ children: e.reasons.map((e) => /* @__PURE__ */ _(r, {
333
347
  variant: "info",
334
- label: ye(e)
348
+ label: Se(e)
335
349
  }, e))
336
350
  }),
337
- /* @__PURE__ */ g("div", {
351
+ /* @__PURE__ */ v("div", {
338
352
  className: "mt-3 flex flex-wrap gap-2",
339
353
  children: [
340
- /* @__PURE__ */ g("button", {
354
+ /* @__PURE__ */ v("button", {
341
355
  type: "button",
342
- className: b,
343
- disabled: P,
356
+ className: S,
357
+ disabled: z,
344
358
  onClick: () => Q(e, i.Accept),
345
359
  "data-testid": "focus-suggestion-accept",
346
- children: [/* @__PURE__ */ h(we, { className: "h-4 w-4" }), " Accept"]
360
+ children: [/* @__PURE__ */ _(De, { className: "h-4 w-4" }), " Accept"]
347
361
  }),
348
- /* @__PURE__ */ g("button", {
362
+ /* @__PURE__ */ v("button", {
349
363
  type: "button",
350
- className: x,
351
- disabled: P,
364
+ className: C,
365
+ disabled: z,
352
366
  onClick: () => Q(e, i.Snooze),
353
367
  "data-testid": "focus-suggestion-snooze",
354
- children: [/* @__PURE__ */ h(xe, { className: "h-4 w-4" }), " Snooze 30 min"]
368
+ children: [/* @__PURE__ */ _(Te, { className: "h-4 w-4" }), " Snooze 30 min"]
355
369
  }),
356
- /* @__PURE__ */ g("button", {
370
+ /* @__PURE__ */ v("button", {
357
371
  type: "button",
358
- className: x,
359
- disabled: P,
372
+ className: C,
373
+ disabled: z,
360
374
  onClick: () => Q(e, i.Dismiss),
361
375
  "data-testid": "focus-suggestion-dismiss",
362
- children: [/* @__PURE__ */ h(Oe, { className: "h-4 w-4" }), " Dismiss"]
376
+ children: [/* @__PURE__ */ _(Ae, { className: "h-4 w-4" }), " Dismiss"]
363
377
  })
364
378
  ]
365
379
  })
@@ -368,51 +382,51 @@ function C() {
368
382
  ]
369
383
  })
370
384
  ]
371
- }), /* @__PURE__ */ g("div", {
385
+ }), /* @__PURE__ */ v("div", {
372
386
  className: "rounded-xl border border-border-seam bg-bg-surface p-6 shadow-elevation-1",
373
387
  "data-testid": "focus-scheduled",
374
- children: [/* @__PURE__ */ g("h3", {
388
+ children: [/* @__PURE__ */ v("h3", {
375
389
  className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
376
390
  children: [
377
- /* @__PURE__ */ h(m, { className: "h-4 w-4" }),
391
+ /* @__PURE__ */ _(h, { className: "h-4 w-4" }),
378
392
  "Scheduled (",
379
- T === 0 ? "today" : "tomorrow",
393
+ k === 0 ? "today" : "tomorrow",
380
394
  ")"
381
395
  ]
382
- }), /* @__PURE__ */ g("div", {
396
+ }), /* @__PURE__ */ v("div", {
383
397
  className: "mt-4 space-y-3",
384
- children: [Re.data && $e.length === 0 && /* @__PURE__ */ h("p", {
398
+ children: [P.data && ct.length === 0 && /* @__PURE__ */ _("p", {
385
399
  className: "text-sm text-text-secondary",
386
400
  children: "Accept a suggestion to put a focus block on your schedule."
387
- }), $e.map((e) => /* @__PURE__ */ g("div", {
401
+ }), ct.map((e) => /* @__PURE__ */ v("div", {
388
402
  className: "flex flex-wrap items-center justify-between gap-2 rounded-lg border border-border-subtle p-3",
389
403
  "data-testid": "focus-scheduled-block",
390
- children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("p", {
404
+ children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
391
405
  className: "text-sm font-medium text-text-primary",
392
- children: c(e.startTime, e.endTime)
393
- }), /* @__PURE__ */ g("p", {
406
+ children: l(e.startTime, e.endTime)
407
+ }), /* @__PURE__ */ v("p", {
394
408
  className: "text-xs text-text-secondary",
395
409
  children: [
396
410
  e.source === "ADAPTIVE" ? "Suggested" : "Manual",
397
411
  " ·",
398
412
  " ",
399
- s(e.durationMinutes * 60)
413
+ c(e.durationMinutes * 60)
400
414
  ]
401
- })] }), e.status === "STARTED" ? /* @__PURE__ */ h(r, {
415
+ })] }), e.status === "STARTED" ? /* @__PURE__ */ _(r, {
402
416
  variant: "success",
403
417
  label: "Started"
404
- }) : /* @__PURE__ */ g("div", {
418
+ }) : /* @__PURE__ */ v("div", {
405
419
  className: "flex gap-2",
406
- children: [!Y && he(e.endTime, E) && /* @__PURE__ */ g("button", {
420
+ children: [!Y && ge(e.endTime, A) && /* @__PURE__ */ v("button", {
407
421
  type: "button",
408
- className: b,
409
- disabled: M,
410
- onClick: () => nt(e.id),
411
- children: [/* @__PURE__ */ h(Te, { className: "h-4 w-4" }), " Start"]
412
- }), /* @__PURE__ */ h("button", {
422
+ className: S,
423
+ disabled: L,
424
+ onClick: () => dt(e.id),
425
+ children: [/* @__PURE__ */ _(p, { className: "h-4 w-4" }), " Start"]
426
+ }), /* @__PURE__ */ _("button", {
413
427
  type: "button",
414
- className: x,
415
- onClick: () => Z(() => We({ variables: { id: e.id } }), "Focus block canceled"),
428
+ className: C,
429
+ onClick: () => Z(() => Ue({ variables: { id: e.id } }), "Focus block canceled"),
416
430
  "data-testid": "focus-block-cancel",
417
431
  children: "Cancel"
418
432
  })]
@@ -421,125 +435,165 @@ function C() {
421
435
  })]
422
436
  })]
423
437
  }),
424
- /* @__PURE__ */ g("div", {
438
+ /* @__PURE__ */ v("div", {
425
439
  className: "mt-6 rounded-xl border border-border-seam bg-bg-surface p-6 shadow-elevation-1",
426
440
  "data-testid": "focus-settings",
427
441
  children: [
428
- /* @__PURE__ */ g("h3", {
442
+ /* @__PURE__ */ v("h3", {
429
443
  className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
430
- children: [/* @__PURE__ */ h(Se, { className: "h-4 w-4" }), "Distraction blocking and planning"]
444
+ children: [/* @__PURE__ */ _(f, { className: "h-4 w-4" }), "Distraction blocking and planning"]
431
445
  }),
432
- /* @__PURE__ */ g("div", {
446
+ /* @__PURE__ */ v("div", {
433
447
  className: "mt-4 grid grid-cols-1 gap-6 lg:grid-cols-2",
434
- children: [/* @__PURE__ */ g("div", {
448
+ children: [/* @__PURE__ */ v("div", {
435
449
  className: "space-y-3",
436
450
  children: [
437
- /* @__PURE__ */ g("label", {
451
+ /* @__PURE__ */ v("label", {
438
452
  className: "flex items-center justify-between gap-4 text-sm text-text-primary",
439
- children: ["Block sites during focus sessions", /* @__PURE__ */ h("input", {
453
+ children: ["Block sites and apps during focus sessions", /* @__PURE__ */ _("input", {
440
454
  type: "checkbox",
441
- checked: Ye,
442
- onChange: (e) => Xe(e.target.checked),
455
+ checked: $e,
456
+ onChange: (e) => et(e.target.checked),
443
457
  className: "h-4 w-4 rounded border-border-subtle",
444
458
  "data-testid": "focus-blocking-enabled"
445
459
  })]
446
460
  }),
447
- /* @__PURE__ */ g("label", {
461
+ /* @__PURE__ */ v("label", {
448
462
  className: "block text-sm text-text-primary",
449
- children: ["Blocked sites", /* @__PURE__ */ h("textarea", {
463
+ children: ["Blocked sites", /* @__PURE__ */ _("textarea", {
450
464
  rows: 6,
451
- value: Ze,
452
- onChange: (e) => J(e.target.value),
453
- className: `${y} mt-1 w-full font-mono`,
465
+ value: tt,
466
+ onChange: (e) => nt(e.target.value),
467
+ className: `${x} mt-1 w-full font-mono`,
454
468
  "aria-describedby": "focus-sites-help",
455
469
  "data-testid": "focus-blocked-sites"
456
470
  })]
457
471
  }),
458
- /* @__PURE__ */ h("p", {
472
+ /* @__PURE__ */ _("p", {
459
473
  id: "focus-sites-help",
460
474
  className: "text-xs text-text-secondary",
461
475
  children: "One site per line (subdomains are included). Blocking is enforced by the TimeCampus browser extension while a session is active; allow-listed apps on a session are never blocked."
476
+ }),
477
+ /* @__PURE__ */ v("label", {
478
+ className: "block text-sm text-text-primary",
479
+ children: ["Blocked desktop apps", /* @__PURE__ */ _("textarea", {
480
+ rows: 5,
481
+ value: rt,
482
+ onChange: (e) => it(e.target.value),
483
+ className: `${x} mt-1 w-full font-mono`,
484
+ "aria-describedby": "focus-apps-help",
485
+ "data-testid": "focus-blocked-apps"
486
+ })]
487
+ }),
488
+ /* @__PURE__ */ _("p", {
489
+ id: "focus-apps-help",
490
+ className: "text-xs text-text-secondary",
491
+ children: "One app per line, as your computer names it (for example Discord or Steam). In the TimeCampus desktop app, strict sessions hide these apps and standard sessions warn you and count the time as an interruption."
492
+ }),
493
+ /* @__PURE__ */ v("label", {
494
+ className: "flex items-center justify-between gap-4 text-sm text-text-primary",
495
+ children: ["Turn on Do Not Disturb during focus sessions", /* @__PURE__ */ _("input", {
496
+ type: "checkbox",
497
+ checked: at,
498
+ onChange: (e) => ot(e.target.checked),
499
+ className: "h-4 w-4 rounded border-border-subtle",
500
+ "data-testid": "focus-do-not-disturb"
501
+ })]
502
+ }),
503
+ J && /* @__PURE__ */ v("p", {
504
+ className: "text-xs text-text-secondary",
505
+ "data-testid": "focus-desktop-status",
506
+ children: [
507
+ "This computer: Do Not Disturb",
508
+ " ",
509
+ T(J.doNotDisturb),
510
+ ", app blocking",
511
+ " ",
512
+ T(J.appWatcher),
513
+ ".",
514
+ J.detail ? ` ${J.detail}` : ""
515
+ ]
462
516
  })
463
517
  ]
464
- }), /* @__PURE__ */ g("div", {
518
+ }), /* @__PURE__ */ v("div", {
465
519
  className: "space-y-3",
466
520
  children: [
467
- /* @__PURE__ */ g("div", {
521
+ /* @__PURE__ */ v("div", {
468
522
  className: "flex items-center justify-between gap-4",
469
- children: [/* @__PURE__ */ h("span", {
523
+ children: [/* @__PURE__ */ _("span", {
470
524
  className: "text-sm text-text-primary",
471
525
  children: "Workday"
472
- }), /* @__PURE__ */ g("span", {
526
+ }), /* @__PURE__ */ v("span", {
473
527
  className: "flex items-center gap-2",
474
528
  children: [
475
- /* @__PURE__ */ h("input", {
529
+ /* @__PURE__ */ _("input", {
476
530
  type: "time",
477
- value: z,
478
- onChange: (e) => B(e.target.value),
479
- className: y,
531
+ value: W,
532
+ onChange: (e) => G(e.target.value),
533
+ className: x,
480
534
  "aria-label": "Workday start"
481
535
  }),
482
- /* @__PURE__ */ h("span", {
536
+ /* @__PURE__ */ _("span", {
483
537
  className: "text-text-secondary",
484
538
  children: "to"
485
539
  }),
486
- /* @__PURE__ */ h("input", {
540
+ /* @__PURE__ */ _("input", {
487
541
  type: "time",
488
- value: V === "24:00" ? "23:59" : V,
489
- onChange: (e) => H(e.target.value),
490
- className: y,
542
+ value: K === "24:00" ? "23:59" : K,
543
+ onChange: (e) => qe(e.target.value),
544
+ className: x,
491
545
  "aria-label": "Workday end"
492
546
  })
493
547
  ]
494
548
  })]
495
549
  }),
496
- /* @__PURE__ */ g("label", {
550
+ /* @__PURE__ */ v("label", {
497
551
  className: "flex items-center justify-between gap-4 text-sm text-text-primary",
498
- children: ["Preferred block length (minutes)", /* @__PURE__ */ h("input", {
552
+ children: ["Preferred block length (minutes)", /* @__PURE__ */ _("input", {
499
553
  type: "number",
500
554
  min: 15,
501
555
  max: 240,
502
556
  step: 15,
503
- value: U,
504
- onChange: (e) => W(Number(e.target.value)),
505
- className: `${y} w-24 text-right`
557
+ value: q,
558
+ onChange: (e) => Je(Number(e.target.value)),
559
+ className: `${x} w-24 text-right`
506
560
  })]
507
561
  }),
508
- /* @__PURE__ */ g("label", {
562
+ /* @__PURE__ */ v("label", {
509
563
  className: "flex items-center justify-between gap-4 text-sm text-text-primary",
510
- children: ["Focus blocks per day", /* @__PURE__ */ h("input", {
564
+ children: ["Focus blocks per day", /* @__PURE__ */ _("input", {
511
565
  type: "number",
512
566
  min: 1,
513
567
  max: 6,
514
- value: Je,
515
- onChange: (e) => G(Number(e.target.value)),
516
- className: `${y} w-24 text-right`
568
+ value: Ye,
569
+ onChange: (e) => Xe(Number(e.target.value)),
570
+ className: `${x} w-24 text-right`
517
571
  })]
518
572
  }),
519
- /* @__PURE__ */ g("label", {
573
+ /* @__PURE__ */ v("label", {
520
574
  className: "flex items-center justify-between gap-4 text-sm text-text-primary",
521
- children: ["Buffer around meetings (minutes)", /* @__PURE__ */ h("input", {
575
+ children: ["Buffer around meetings (minutes)", /* @__PURE__ */ _("input", {
522
576
  type: "number",
523
577
  min: 0,
524
578
  max: 60,
525
579
  step: 5,
526
- value: K,
527
- onChange: (e) => q(Number(e.target.value)),
528
- className: `${y} w-24 text-right`
580
+ value: Ze,
581
+ onChange: (e) => Qe(Number(e.target.value)),
582
+ className: `${x} w-24 text-right`
529
583
  })]
530
584
  })
531
585
  ]
532
586
  })]
533
587
  }),
534
- /* @__PURE__ */ h("div", {
588
+ /* @__PURE__ */ _("div", {
535
589
  className: "mt-4 flex justify-end",
536
- children: /* @__PURE__ */ h("button", {
590
+ children: /* @__PURE__ */ _("button", {
537
591
  type: "button",
538
- className: b,
539
- disabled: F,
540
- onClick: it,
592
+ className: S,
593
+ disabled: B,
594
+ onClick: pt,
541
595
  "data-testid": "focus-save-settings",
542
- children: F ? "Saving..." : "Save focus settings"
596
+ children: B ? "Saving..." : "Save focus settings"
543
597
  })
544
598
  })
545
599
  ]
@@ -548,6 +602,6 @@ function C() {
548
602
  });
549
603
  }
550
604
  //#endregion
551
- export { C as FocusProtectionPage };
605
+ export { D as FocusProtectionPage };
552
606
 
553
607
  //# sourceMappingURL=FocusProtectionPage.js.map