@burdenoff/microfe-calendar 2026.625.1 → 2026.626.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.
@@ -1,50 +1,52 @@
1
1
  import { useGetCalendarsQuery as e } from "../generated/wspace-operations.js";
2
2
  import { useCalendarStore as t } from "../store/calendarStore.js";
3
3
  import { useSafePermissions as n } from "../hooks/useSafePermissions.js";
4
- import { AVAILABILITY_RULES_QUERY as r, BLACKOUT_DATES_QUERY as ee, CALENDAR_DETAILS_QUERY as te, CONNECT_EXTERNAL_CALENDAR_MUTATION as ne, CREATE_AVAILABILITY_RULE_MUTATION as re, CREATE_BLACKOUT_DATE_MUTATION as ie, CREATE_BOOKING_PAGE_MUTATION as ae, DELETE_AVAILABILITY_RULE_MUTATION as oe, DELETE_BLACKOUT_DATE_MUTATION as se, DELETE_BOOKING_PAGE_MUTATION as ce, DISCONNECT_EXTERNAL_CALENDAR_MUTATION as le, EXTERNAL_SYNCS_QUERY as ue, PAUSE_SYNC_MUTATION as de, RESUME_SYNC_MUTATION as i, REVOKE_CALENDAR_SHARE_MUTATION as a, SHARE_CALENDAR_MUTATION as o, TRIGGER_SYNC_MUTATION as s } from "../graphql/calendarDocuments.js";
5
- import { CALENDAR_PERMISSIONS as c } from "../constants/permissions.js";
6
- import { useMemo as l, useState as u } from "react";
7
- import { AccessDenied as fe } from "@burdenoff/fe-libs/shared/components";
8
- import { useI18n as pe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
9
- import { CalendarClock as me, CalendarDays as he, Clock as ge, Link2 as _e, Settings as ve, Shield as ye, Users as be } from "lucide-react";
4
+ import { AVAILABILITY_RULES_QUERY as r, BLACKOUT_DATES_QUERY as i, CALENDAR_DETAILS_QUERY as a, CONNECT_EXTERNAL_CALENDAR_MUTATION as ee, CREATE_AVAILABILITY_RULE_MUTATION as te, CREATE_BLACKOUT_DATE_MUTATION as ne, CREATE_BOOKING_PAGE_MUTATION as o, DELETE_AVAILABILITY_RULE_MUTATION as re, DELETE_BLACKOUT_DATE_MUTATION as ie, DELETE_BOOKING_PAGE_MUTATION as ae, DISCONNECT_EXTERNAL_CALENDAR_MUTATION as oe, EXTERNAL_SYNCS_QUERY as se, PAUSE_SYNC_MUTATION as ce, RESUME_SYNC_MUTATION as s, REVOKE_CALENDAR_SHARE_MUTATION as le, SHARE_CALENDAR_MUTATION as ue, TRIGGER_SYNC_MUTATION as de } from "../graphql/calendarDocuments.js";
5
+ import { CALENDAR_PERMISSIONS as fe } from "../constants/permissions.js";
6
+ import { useMemo as c, useState as l } from "react";
7
+ import { AccessDenied as pe } from "@burdenoff/fe-libs/shared/components";
8
+ import { useI18n as me } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
9
+ import { CalendarClock as he, CalendarDays as ge, Clock as u, Link2 as _e, Settings as ve, Shield as ye, Users as be } from "lucide-react";
10
10
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
11
- import { GlassCard as p, GradientText as xe } from "@burdenoff/fe-libs/ui";
12
- import { useMutation as m, useQuery as h } from "@apollo/client/react";
11
+ import { GlassCard as p, GradientText as xe, IllustratedEmptyState as m, NextSteps as Se, PagePurpose as Ce } from "@burdenoff/fe-libs/ui";
12
+ import { useMutation as h, useQuery as g } from "@apollo/client/react";
13
13
  //#region src/pages/SettingsPage.tsx
14
- function g({ title: e, description: t, icon: n, children: r }) {
14
+ function _({ id: e, title: t, description: n, icon: r, children: i, emphasis: a = !1 }) {
15
15
  return /* @__PURE__ */ d(p, {
16
- treatment: "metric",
17
- className: "p-card-padding",
16
+ id: e,
17
+ treatment: a ? "glass" : "metric",
18
+ glow: a,
19
+ className: "scroll-mt-24 p-card-padding",
18
20
  children: /* @__PURE__ */ f("div", {
19
21
  className: "space-y-4",
20
22
  children: [/* @__PURE__ */ f("div", {
21
23
  className: "flex items-start gap-3",
22
- children: [/* @__PURE__ */ d(n, { className: "size-5 text-text-secondary shrink-0" }), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("h2", {
24
+ children: [/* @__PURE__ */ d(r, { className: "size-5 text-text-secondary shrink-0" }), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("h2", {
23
25
  className: "font-heading-sm text-text-primary",
24
- children: e
25
- }), t ? /* @__PURE__ */ d("p", {
26
- className: "font-text-sm text-text-secondary mt-1",
27
26
  children: t
27
+ }), n ? /* @__PURE__ */ d("p", {
28
+ className: "font-text-sm text-text-secondary mt-1",
29
+ children: n
28
30
  }) : null] })]
29
- }), r]
31
+ }), i]
30
32
  })
31
33
  });
32
34
  }
33
- function _(e) {
35
+ function v(e) {
34
36
  return e ? new Date(e).toLocaleString() : "—";
35
37
  }
36
- function v() {
37
- let { hasPermission: p, isLoading: v } = n(), y = t((e) => e.currentView), b = t((e) => e.selectedTimeZone), Se = t((e) => e.setTimeZone), Ce = t((e) => e.miniCalendarVisible), x = t((e) => e.setMiniCalendarVisible), { t: S } = pe(), C = (e, t) => {
38
- let n = S(e);
38
+ function y() {
39
+ let { hasPermission: p, isLoading: y } = n(), b = t((e) => e.currentView), x = t((e) => e.selectedTimeZone), we = t((e) => e.setTimeZone), Te = t((e) => e.miniCalendarVisible), Ee = t((e) => e.setMiniCalendarVisible), { t: De } = me(), S = (e, t) => {
40
+ let n = De(e);
39
41
  return n === e ? t : n;
40
- }, w = {
41
- day: C("calendar.day", "Day"),
42
- week: C("calendar.week", "Week"),
43
- month: C("calendar.month", "Month"),
44
- year: C("calendar.year", "Year"),
45
- agenda: C("calendar.agenda", "Agenda"),
46
- timeline: C("calendar.timeline", "Timeline")
47
- }, [T, E] = u(""), [D, O] = u(""), [k, A] = u("user"), [j, M] = u("VIEW"), [N, P] = u({
42
+ }, C = {
43
+ day: S("calendar.day", "Day"),
44
+ week: S("calendar.week", "Week"),
45
+ month: S("calendar.month", "Month"),
46
+ year: S("calendar.year", "Year"),
47
+ agenda: S("calendar.agenda", "Agenda"),
48
+ timeline: S("calendar.timeline", "Timeline")
49
+ }, [w, T] = l(""), [E, D] = l(""), [O, Oe] = l("user"), [k, A] = l("VIEW"), [j, M] = l({
48
50
  dayOfWeek: "MONDAY",
49
51
  startTime: "09:00",
50
52
  endTime: "17:00",
@@ -53,11 +55,11 @@ function v() {
53
55
  slotIncrement: "30",
54
56
  minNotice: "60",
55
57
  maxNotice: "43200"
56
- }), [F, I] = u({
58
+ }), [N, P] = l({
57
59
  startDate: "",
58
60
  endDate: "",
59
61
  reason: ""
60
- }), [L, R] = u({
62
+ }), [F, I] = l({
61
63
  name: "",
62
64
  slug: "",
63
65
  pageType: "ONE_ON_ONE",
@@ -65,7 +67,7 @@ function v() {
65
67
  locationType: "ONLINE",
66
68
  maxAttendees: "1",
67
69
  requireApproval: !1
68
- }), [z, B] = u({
70
+ }), [L, R] = l({
69
71
  provider: "GOOGLE_CALENDAR",
70
72
  externalCalendarId: "",
71
73
  externalCalendarName: "",
@@ -73,109 +75,143 @@ function v() {
73
75
  refreshToken: "",
74
76
  syncFrequency: "300",
75
77
  direction: "TWO_WAY"
76
- }), { data: V, loading: we, refetch: Te } = e({
78
+ }), { data: z, loading: ke, refetch: Ae } = e({
77
79
  variables: { pagination: { limit: 50 } },
78
- skip: v
79
- }), H = l(() => V?.calendars?.calendars ?? [], [V?.calendars?.calendars]), U = l(() => T || ((H.find((e) => e.isDefault) ?? H[0])?.id ?? ""), [H, T]), W = l(() => /* @__PURE__ */ new Date(), []), Ee = l(() => new Date(W.getFullYear() - 1, W.getMonth(), W.getDate()).toISOString(), [W]), De = l(() => new Date(W.getFullYear() + 1, W.getMonth(), W.getDate()).toISOString(), [W]), { data: Oe, refetch: ke } = h(te, {
80
- variables: { id: U },
81
- skip: !U,
80
+ skip: y
81
+ }), B = c(() => z?.calendars?.calendars ?? [], [z?.calendars?.calendars]), V = c(() => w || ((B.find((e) => e.isDefault) ?? B[0])?.id ?? ""), [B, w]), H = c(() => /* @__PURE__ */ new Date(), []), je = c(() => new Date(H.getFullYear() - 1, H.getMonth(), H.getDate()).toISOString(), [H]), Me = c(() => new Date(H.getFullYear() + 1, H.getMonth(), H.getDate()).toISOString(), [H]), { data: Ne, refetch: Pe } = g(a, {
82
+ variables: { id: V },
83
+ skip: !V,
82
84
  fetchPolicy: "cache-and-network"
83
- }), { data: Ae, refetch: je } = h(r, {
84
- variables: { calendarId: U },
85
- skip: !U,
85
+ }), { data: Fe, refetch: Ie } = g(r, {
86
+ variables: { calendarId: V },
87
+ skip: !V,
86
88
  fetchPolicy: "cache-and-network"
87
- }), { data: Me, refetch: Ne } = h(ee, {
89
+ }), { data: Le, refetch: Re } = g(i, {
88
90
  variables: {
89
- calendarId: U,
90
- startDate: Ee,
91
- endDate: De
91
+ calendarId: V,
92
+ startDate: je,
93
+ endDate: Me
92
94
  },
93
- skip: !U,
95
+ skip: !V,
94
96
  fetchPolicy: "cache-and-network"
95
- }), { data: Pe, refetch: Fe } = h(ue, {
96
- variables: { calendarId: U },
97
- skip: !U,
97
+ }), { data: ze, refetch: Be } = g(se, {
98
+ variables: { calendarId: V },
99
+ skip: !V,
98
100
  fetchPolicy: "cache-and-network"
99
- }), [Ie, { loading: G }] = m(o), [Le] = m(a), [Re, { loading: K }] = m(re), [ze] = m(oe), [Be, { loading: q }] = m(ie), [Ve] = m(se), [He, { loading: J }] = m(ae), [Ue] = m(ce), [We, { loading: Y }] = m(ne), [Ge] = m(de), [Ke] = m(i), [qe] = m(s), [X] = m(le), Z = Oe?.calendar, Q = Z?.shares ?? [], Je = Z?.bookingPages ?? [], Ye = Ae?.getAvailabilityRules ?? [], Xe = Me?.getBlackoutDates ?? [], Ze = Pe?.getExternalCalendarSyncs ?? [], $ = async () => {
101
+ }), [Ve, { loading: U }] = h(ue), [He] = h(le), [Ue, { loading: W }] = h(te), [We] = h(re), [Ge, { loading: G }] = h(ne), [Ke] = h(ie), [qe, { loading: K }] = h(o), [Je] = h(ae), [Ye, { loading: q }] = h(ee), [Xe] = h(ce), [Ze] = h(s), [Qe] = h(de), [$e] = h(oe), J = Ne?.calendar, Y = J?.shares ?? [], X = J?.bookingPages ?? [], Z = Fe?.getAvailabilityRules ?? [], et = Le?.getBlackoutDates ?? [], Q = ze?.getExternalCalendarSyncs ?? [], $ = async () => {
100
102
  await Promise.all([
101
- Te(),
102
- ke(),
103
- je(),
104
- Ne(),
105
- Fe()
103
+ Ae(),
104
+ Pe(),
105
+ Ie(),
106
+ Re(),
107
+ Be()
106
108
  ]);
107
109
  };
108
- return v || we ? /* @__PURE__ */ d("div", {
110
+ return y || ke ? /* @__PURE__ */ d("div", {
109
111
  className: "@container min-h-screen bg-bg-canvas flex items-center justify-center",
110
112
  children: /* @__PURE__ */ d("p", {
111
113
  className: "font-text-md text-text-secondary",
112
- children: C("calendar.loading", "Loading...")
114
+ children: S("calendar.loading", "Loading...")
113
115
  })
114
- }) : p(c.CALENDAR_READ) ? /* @__PURE__ */ f("div", {
116
+ }) : p(fe.CALENDAR_READ) ? /* @__PURE__ */ f("div", {
115
117
  className: "@container min-h-screen bg-bg-canvas",
116
- children: [/* @__PURE__ */ d("header", {
118
+ children: [/* @__PURE__ */ f("header", {
117
119
  className: "border-b border-border-seam bg-bg-surface px-page-padding py-element-padding",
118
- children: /* @__PURE__ */ f("div", {
120
+ children: [/* @__PURE__ */ f("div", {
119
121
  className: "flex items-center gap-inline-gap",
120
122
  children: [/* @__PURE__ */ d(ve, { className: "size-5 text-text-secondary" }), /* @__PURE__ */ d("h1", {
121
123
  className: "font-heading-lg text-text-primary",
122
- children: /* @__PURE__ */ d(xe, { children: C("calendar.calendarSettings", "Calendar Settings") })
124
+ children: /* @__PURE__ */ d(xe, { children: S("calendar.calendarSettings", "Calendar Settings") })
123
125
  })]
124
- })
126
+ }), /* @__PURE__ */ d(Ce, {
127
+ className: "mt-stack-gap-sm max-w-3xl",
128
+ children: S("calendar.settingsPagePurpose", "The control room for a calendar. Pick the calendar to manage, set how it displays, share it with people or teams, define when you are bookable, publish Calendly-style booking pages, and connect Google, Outlook, or Apple so everything stays in sync.")
129
+ })]
125
130
  }), /* @__PURE__ */ f("div", {
126
131
  className: "max-w-5xl mx-auto p-page-padding space-y-6",
127
132
  children: [
128
- /* @__PURE__ */ d(g, {
129
- title: C("calendar.activeCalendar", "Active calendar"),
130
- description: C("calendar.activeCalendarDescription", "Choose which calendar to manage for availability, shares, booking pages, and syncs."),
131
- icon: he,
133
+ /* @__PURE__ */ d(Se, {
134
+ storageKey: "calendar-settings",
135
+ steps: [
136
+ {
137
+ id: "set-availability",
138
+ label: S("calendar.nextStepAvailability", "Set your weekly availability"),
139
+ description: S("calendar.nextStepAvailabilityDesc", "Define the hours you are open for bookings, plus any blackout windows."),
140
+ href: "#settings-availability"
141
+ },
142
+ {
143
+ id: "create-booking-page",
144
+ label: S("calendar.nextStepBookingPage", "Publish a booking page"),
145
+ description: S("calendar.nextStepBookingPageDesc", "Let others self-schedule time with you, Calendly-style."),
146
+ href: "#settings-booking-pages"
147
+ },
148
+ {
149
+ id: "connect-external",
150
+ label: S("calendar.nextStepExternalSync", "Connect an external calendar"),
151
+ description: S("calendar.nextStepExternalSyncDesc", "Two-way sync with Google, Outlook, or Apple calendars."),
152
+ href: "#settings-external-sync"
153
+ },
154
+ {
155
+ id: "share-calendar",
156
+ label: S("calendar.nextStepShare", "Share this calendar"),
157
+ description: S("calendar.nextStepShareDesc", "Give teammates view, edit, or admin access."),
158
+ href: "#settings-sharing"
159
+ }
160
+ ]
161
+ }),
162
+ /* @__PURE__ */ d(_, {
163
+ id: "settings-active-calendar",
164
+ emphasis: !0,
165
+ title: S("calendar.activeCalendar", "Active calendar"),
166
+ description: S("calendar.activeCalendarDescription", "Choose which calendar to manage for availability, shares, booking pages, and syncs."),
167
+ icon: ge,
132
168
  children: /* @__PURE__ */ d("select", {
133
- value: U,
134
- onChange: (e) => E(e.target.value),
169
+ value: V,
170
+ onChange: (e) => T(e.target.value),
135
171
  className: "w-full px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm focus:outline-none focus:ring-2 focus:ring-action-primary-border",
136
- children: H.map((e) => /* @__PURE__ */ d("option", {
172
+ children: B.map((e) => /* @__PURE__ */ d("option", {
137
173
  value: e.id,
138
174
  children: e.name
139
175
  }, e.id))
140
176
  })
141
177
  }),
142
- /* @__PURE__ */ f(g, {
143
- title: C("calendar.displayPreferences", "Display preferences"),
144
- description: C("calendar.displayPreferencesDescription", "Personalize your default view, sidebar visibility, and timezone rendering."),
145
- icon: ge,
178
+ /* @__PURE__ */ f(_, {
179
+ title: S("calendar.displayPreferences", "Display preferences"),
180
+ description: S("calendar.displayPreferencesDescription", "Personalize your default view, sidebar visibility, and timezone rendering."),
181
+ icon: u,
146
182
  children: [/* @__PURE__ */ f("div", {
147
183
  className: "grid grid-cols-1 gap-4 @md:grid-cols-2",
148
184
  children: [/* @__PURE__ */ f("div", {
149
185
  className: "space-y-2",
150
186
  children: [/* @__PURE__ */ d("p", {
151
187
  className: "font-text-sm font-weight-medium text-text-primary",
152
- children: C("calendar.currentView", "Current view")
188
+ children: S("calendar.currentView", "Current view")
153
189
  }), /* @__PURE__ */ d("p", {
154
190
  className: "font-text-sm text-text-secondary",
155
- children: w[y] ?? y
191
+ children: C[b] ?? b
156
192
  })]
157
193
  }), /* @__PURE__ */ f("div", {
158
194
  className: "flex items-center justify-between rounded-radius-md border border-border-subtle px-3 py-2 bg-bg-canvas",
159
195
  children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("p", {
160
196
  className: "font-text-sm font-weight-medium text-text-primary",
161
- children: C("calendar.showMiniCalendar", "Show mini calendar")
197
+ children: S("calendar.showMiniCalendar", "Show mini calendar")
162
198
  }), /* @__PURE__ */ d("p", {
163
199
  className: "font-text-xs text-text-tertiary",
164
- children: C("calendar.showMiniCalendarDescription", "Display the mini calendar sidebar in calendar views.")
200
+ children: S("calendar.showMiniCalendarDescription", "Display the mini calendar sidebar in calendar views.")
165
201
  })] }), /* @__PURE__ */ d("input", {
166
202
  type: "checkbox",
167
- checked: Ce,
168
- onChange: (e) => x(e.target.checked),
203
+ checked: Te,
204
+ onChange: (e) => Ee(e.target.checked),
169
205
  className: "size-4 rounded border-border-default",
170
- "aria-label": C("calendar.showMiniCalendar", "Show mini calendar")
206
+ "aria-label": S("calendar.showMiniCalendar", "Show mini calendar")
171
207
  })]
172
208
  })]
173
209
  }), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
174
210
  className: "block font-text-sm font-weight-medium text-text-primary mb-1",
175
- children: C("calendar.timezone", "Timezone")
211
+ children: S("calendar.timezone", "Timezone")
176
212
  }), /* @__PURE__ */ d("select", {
177
- value: b,
178
- onChange: (e) => Se(e.target.value),
213
+ value: x,
214
+ onChange: (e) => we(e.target.value),
179
215
  className: "w-full px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm focus:outline-none focus:ring-2 focus:ring-action-primary-border",
180
216
  children: Intl.supportedValuesOf("timeZone").map((e) => /* @__PURE__ */ d("option", {
181
217
  value: e,
@@ -183,123 +219,127 @@ function v() {
183
219
  }, e))
184
220
  })] })]
185
221
  }),
186
- /* @__PURE__ */ f(g, {
187
- title: C("calendar.sharingAndPermissions", "Sharing and permissions"),
188
- description: C("calendar.sharingAndPermissionsDescription", "Share calendars with users or teams using view, edit, or admin access."),
222
+ /* @__PURE__ */ f(_, {
223
+ id: "settings-sharing",
224
+ title: S("calendar.sharingAndPermissions", "Sharing and permissions"),
225
+ description: S("calendar.sharingAndPermissionsDescription", "Share calendars with users or teams using view, edit, or admin access."),
189
226
  icon: be,
190
227
  children: [/* @__PURE__ */ f("form", {
191
228
  onSubmit: async (e) => {
192
- e.preventDefault(), !(!U || !D.trim()) && (await Ie({ variables: {
193
- calendarId: U,
194
- userId: k === "user" ? D.trim() : void 0,
195
- teamId: k === "team" ? D.trim() : void 0,
229
+ e.preventDefault(), !(!V || !E.trim()) && (await Ve({ variables: {
230
+ calendarId: V,
231
+ userId: O === "user" ? E.trim() : void 0,
232
+ teamId: O === "team" ? E.trim() : void 0,
196
233
  canView: !0,
197
- canEdit: j !== "VIEW",
198
- canManage: j === "ADMIN"
199
- } }), O(""), M("VIEW"), await $());
234
+ canEdit: k !== "VIEW",
235
+ canManage: k === "ADMIN"
236
+ } }), D(""), A("VIEW"), await $());
200
237
  },
201
238
  className: "grid grid-cols-1 gap-3 @md:grid-cols-4",
202
239
  children: [
203
240
  /* @__PURE__ */ f("select", {
204
- value: k,
205
- onChange: (e) => A(e.target.value),
241
+ value: O,
242
+ onChange: (e) => Oe(e.target.value),
206
243
  className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm focus:outline-none focus:ring-2 focus:ring-action-primary-border",
207
244
  children: [/* @__PURE__ */ d("option", {
208
245
  value: "user",
209
- children: C("calendar.shareWithUser", "User")
246
+ children: S("calendar.shareWithUser", "User")
210
247
  }), /* @__PURE__ */ d("option", {
211
248
  value: "team",
212
- children: C("calendar.shareWithTeam", "Team")
249
+ children: S("calendar.shareWithTeam", "Team")
213
250
  })]
214
251
  }),
215
252
  /* @__PURE__ */ d("input", {
216
- value: D,
217
- onChange: (e) => O(e.target.value),
218
- placeholder: C("calendar.shareTargetPlaceholder", "User ID or team ID"),
219
- "aria-label": C("calendar.shareTarget", "Share target"),
253
+ value: E,
254
+ onChange: (e) => D(e.target.value),
255
+ placeholder: S("calendar.shareTargetPlaceholder", "User ID or team ID"),
256
+ "aria-label": S("calendar.shareTarget", "Share target"),
220
257
  className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-border"
221
258
  }),
222
259
  /* @__PURE__ */ f("select", {
223
- value: j,
224
- onChange: (e) => M(e.target.value),
260
+ value: k,
261
+ onChange: (e) => A(e.target.value),
225
262
  className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm focus:outline-none focus:ring-2 focus:ring-action-primary-border",
226
263
  children: [
227
264
  /* @__PURE__ */ d("option", {
228
265
  value: "VIEW",
229
- children: C("calendar.permissionView", "View")
266
+ children: S("calendar.permissionView", "View")
230
267
  }),
231
268
  /* @__PURE__ */ d("option", {
232
269
  value: "EDIT",
233
- children: C("calendar.permissionEdit", "Edit")
270
+ children: S("calendar.permissionEdit", "Edit")
234
271
  }),
235
272
  /* @__PURE__ */ d("option", {
236
273
  value: "ADMIN",
237
- children: C("calendar.permissionAdmin", "Admin")
274
+ children: S("calendar.permissionAdmin", "Admin")
238
275
  })
239
276
  ]
240
277
  }),
241
278
  /* @__PURE__ */ d("button", {
242
279
  type: "submit",
243
- disabled: !U || !D.trim() || G,
280
+ disabled: !V || !E.trim() || U,
244
281
  className: "px-4 py-2 rounded-radius-md bg-action-primary-bg text-action-primary-fg font-text-sm font-weight-medium hover:bg-action-primary-bg-hover disabled:opacity-50",
245
- children: G ? C("calendar.sharing", "Sharing...") : C("calendar.shareCalendar", "Share calendar")
282
+ children: U ? S("calendar.sharing", "Sharing...") : S("calendar.shareCalendar", "Share calendar")
246
283
  })
247
284
  ]
248
285
  }), /* @__PURE__ */ d("div", {
249
286
  className: "space-y-2",
250
- children: Q.length === 0 ? /* @__PURE__ */ d("p", {
251
- className: "font-text-sm text-text-secondary",
252
- children: C("calendar.noSharesConfigured", "No calendar shares configured yet.")
253
- }) : Q.map((e) => /* @__PURE__ */ f("div", {
287
+ children: Y.length === 0 ? /* @__PURE__ */ d(m, {
288
+ illustration: "empty-people",
289
+ className: "py-8",
290
+ title: S("calendar.noSharesConfigured", "No calendar shares configured yet."),
291
+ description: S("calendar.noSharesConfiguredDesc", "Use the form above to give a user or team view, edit, or admin access to this calendar.")
292
+ }) : Y.map((e) => /* @__PURE__ */ f("div", {
254
293
  className: "flex flex-col gap-2 rounded-radius-md border border-border-subtle bg-bg-canvas p-3 @md:flex-row @md:items-center @md:justify-between",
255
294
  children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("p", {
256
295
  className: "font-text-sm font-weight-medium text-text-primary",
257
- children: e.userId ?? e.teamId ?? C("calendar.unknownShareTarget", "Unknown target")
296
+ children: e.userId ?? e.teamId ?? S("calendar.unknownShareTarget", "Unknown target")
258
297
  }), /* @__PURE__ */ f("p", {
259
298
  className: "font-text-xs text-text-tertiary",
260
299
  children: [
261
300
  e.canManage ? "ADMIN" : e.canEdit ? "EDIT" : "VIEW",
262
301
  " •",
263
302
  " ",
264
- _(e.createdAt)
303
+ v(e.createdAt)
265
304
  ]
266
305
  })] }), /* @__PURE__ */ d("button", {
267
306
  type: "button",
268
307
  onClick: async () => {
269
- await Le({ variables: { shareId: e.id } }), await $();
308
+ await He({ variables: { shareId: e.id } }), await $();
270
309
  },
271
310
  className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-surface hover:bg-bg-elevated text-text-primary font-text-sm",
272
- children: C("calendar.revokeShare", "Revoke")
311
+ children: S("calendar.revokeShare", "Revoke")
273
312
  })]
274
313
  }, e.id))
275
314
  })]
276
315
  }),
277
- /* @__PURE__ */ f(g, {
278
- title: C("calendar.availabilityAndBlocking", "Availability and blocking"),
279
- description: C("calendar.availabilityAndBlockingDescription", "Define recurring availability and create manual blackout windows for booking protection."),
280
- icon: me,
316
+ /* @__PURE__ */ f(_, {
317
+ id: "settings-availability",
318
+ title: S("calendar.availabilityAndBlocking", "Availability and blocking"),
319
+ description: S("calendar.availabilityAndBlockingDescription", "Define recurring availability and create manual blackout windows for booking protection."),
320
+ icon: he,
281
321
  children: [
282
322
  /* @__PURE__ */ f("form", {
283
323
  onSubmit: async (e) => {
284
- e.preventDefault(), U && (await Re({ variables: { input: {
285
- calendarId: U,
286
- dayOfWeek: N.dayOfWeek,
324
+ e.preventDefault(), V && (await Ue({ variables: { input: {
325
+ calendarId: V,
326
+ dayOfWeek: j.dayOfWeek,
287
327
  isAvailable: !0,
288
- startTime: N.startTime,
289
- endTime: N.endTime,
290
- timezone: b,
291
- bufferBefore: parseInt(N.bufferBefore, 10),
292
- bufferAfter: parseInt(N.bufferAfter, 10),
293
- slotIncrement: parseInt(N.slotIncrement, 10),
294
- minNotice: parseInt(N.minNotice, 10),
295
- maxNotice: parseInt(N.maxNotice, 10)
328
+ startTime: j.startTime,
329
+ endTime: j.endTime,
330
+ timezone: x,
331
+ bufferBefore: parseInt(j.bufferBefore, 10),
332
+ bufferAfter: parseInt(j.bufferAfter, 10),
333
+ slotIncrement: parseInt(j.slotIncrement, 10),
334
+ minNotice: parseInt(j.minNotice, 10),
335
+ maxNotice: parseInt(j.maxNotice, 10)
296
336
  } } }), await $());
297
337
  },
298
338
  className: "grid grid-cols-1 gap-3 @md:grid-cols-4",
299
339
  children: [
300
340
  /* @__PURE__ */ d("select", {
301
- value: N.dayOfWeek,
302
- onChange: (e) => P((t) => ({
341
+ value: j.dayOfWeek,
342
+ onChange: (e) => M((t) => ({
303
343
  ...t,
304
344
  dayOfWeek: e.target.value
305
345
  })),
@@ -319,35 +359,40 @@ function v() {
319
359
  }),
320
360
  /* @__PURE__ */ d("input", {
321
361
  type: "time",
322
- value: N.startTime,
323
- onChange: (e) => P((t) => ({
362
+ value: j.startTime,
363
+ onChange: (e) => M((t) => ({
324
364
  ...t,
325
365
  startTime: e.target.value
326
366
  })),
327
367
  className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm focus:outline-none focus:ring-2 focus:ring-action-primary-border",
328
- "aria-label": C("calendar.availabilityStart", "Availability start time")
368
+ "aria-label": S("calendar.availabilityStart", "Availability start time")
329
369
  }),
330
370
  /* @__PURE__ */ d("input", {
331
371
  type: "time",
332
- value: N.endTime,
333
- onChange: (e) => P((t) => ({
372
+ value: j.endTime,
373
+ onChange: (e) => M((t) => ({
334
374
  ...t,
335
375
  endTime: e.target.value
336
376
  })),
337
377
  className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm focus:outline-none focus:ring-2 focus:ring-action-primary-border",
338
- "aria-label": C("calendar.availabilityEnd", "Availability end time")
378
+ "aria-label": S("calendar.availabilityEnd", "Availability end time")
339
379
  }),
340
380
  /* @__PURE__ */ d("button", {
341
381
  type: "submit",
342
- disabled: !U || K,
382
+ disabled: !V || W,
343
383
  className: "px-4 py-2 rounded-radius-md bg-action-primary-bg text-action-primary-fg font-text-sm font-weight-medium hover:bg-action-primary-bg-hover disabled:opacity-50",
344
- children: K ? C("calendar.savingAvailability", "Saving...") : C("calendar.addAvailabilityRule", "Add availability rule")
384
+ children: W ? S("calendar.savingAvailability", "Saving...") : S("calendar.addAvailabilityRule", "Add availability rule")
345
385
  })
346
386
  ]
347
387
  }),
348
- /* @__PURE__ */ d("div", {
388
+ /* @__PURE__ */ f("div", {
349
389
  className: "space-y-2",
350
- children: Ye.map((e) => /* @__PURE__ */ f("div", {
390
+ children: [Z.length === 0 ? /* @__PURE__ */ d(m, {
391
+ illustration: "empty-data",
392
+ className: "py-8",
393
+ title: S("calendar.noAvailabilityRules", "No availability rules yet"),
394
+ description: S("calendar.noAvailabilityRulesDesc", "Add a weekly window above to tell booking pages when you can be scheduled.")
395
+ }) : null, Z.map((e) => /* @__PURE__ */ f("div", {
351
396
  className: "flex items-center justify-between rounded-radius-md border border-border-subtle bg-bg-canvas p-3",
352
397
  children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("p", {
353
398
  className: "font-text-sm font-weight-medium text-text-primary",
@@ -364,21 +409,21 @@ function v() {
364
409
  })] }), /* @__PURE__ */ d("button", {
365
410
  type: "button",
366
411
  onClick: async () => {
367
- await ze({ variables: { id: e.id } }), await $();
412
+ await We({ variables: { id: e.id } }), await $();
368
413
  },
369
414
  className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-surface hover:bg-bg-elevated text-text-primary font-text-sm",
370
- children: C("calendar.delete", "Delete")
415
+ children: S("calendar.delete", "Delete")
371
416
  })]
372
- }, e.id))
417
+ }, e.id))]
373
418
  }),
374
419
  /* @__PURE__ */ f("form", {
375
420
  onSubmit: async (e) => {
376
- e.preventDefault(), !(!U || !F.startDate || !F.endDate) && (await Be({ variables: { input: {
377
- calendarId: U,
378
- startDate: new Date(F.startDate).toISOString(),
379
- endDate: new Date(F.endDate).toISOString(),
380
- reason: F.reason || void 0
381
- } } }), I({
421
+ e.preventDefault(), !(!V || !N.startDate || !N.endDate) && (await Ge({ variables: { input: {
422
+ calendarId: V,
423
+ startDate: new Date(N.startDate).toISOString(),
424
+ endDate: new Date(N.endDate).toISOString(),
425
+ reason: N.reason || void 0
426
+ } } }), P({
382
427
  startDate: "",
383
428
  endDate: "",
384
429
  reason: ""
@@ -388,52 +433,52 @@ function v() {
388
433
  children: [
389
434
  /* @__PURE__ */ d("input", {
390
435
  type: "datetime-local",
391
- value: F.startDate,
392
- onChange: (e) => I((t) => ({
436
+ value: N.startDate,
437
+ onChange: (e) => P((t) => ({
393
438
  ...t,
394
439
  startDate: e.target.value
395
440
  })),
396
441
  className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm focus:outline-none focus:ring-2 focus:ring-action-primary-border",
397
- "aria-label": C("calendar.blackoutStart", "Blackout start")
442
+ "aria-label": S("calendar.blackoutStart", "Blackout start")
398
443
  }),
399
444
  /* @__PURE__ */ d("input", {
400
445
  type: "datetime-local",
401
- value: F.endDate,
402
- onChange: (e) => I((t) => ({
446
+ value: N.endDate,
447
+ onChange: (e) => P((t) => ({
403
448
  ...t,
404
449
  endDate: e.target.value
405
450
  })),
406
451
  className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm focus:outline-none focus:ring-2 focus:ring-action-primary-border",
407
- "aria-label": C("calendar.blackoutEnd", "Blackout end")
452
+ "aria-label": S("calendar.blackoutEnd", "Blackout end")
408
453
  }),
409
454
  /* @__PURE__ */ d("input", {
410
- value: F.reason,
411
- onChange: (e) => I((t) => ({
455
+ value: N.reason,
456
+ onChange: (e) => P((t) => ({
412
457
  ...t,
413
458
  reason: e.target.value
414
459
  })),
415
- placeholder: C("calendar.blackoutReason", "Reason for block"),
416
- "aria-label": C("calendar.blackoutReason", "Reason for block"),
460
+ placeholder: S("calendar.blackoutReason", "Reason for block"),
461
+ "aria-label": S("calendar.blackoutReason", "Reason for block"),
417
462
  className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-border"
418
463
  }),
419
464
  /* @__PURE__ */ d("button", {
420
465
  type: "submit",
421
- disabled: !U || q,
466
+ disabled: !V || G,
422
467
  className: "px-4 py-2 rounded-radius-md bg-action-primary-bg text-action-primary-fg font-text-sm font-weight-medium hover:bg-action-primary-bg-hover disabled:opacity-50",
423
- children: q ? C("calendar.blocking", "Blocking...") : C("calendar.addBlackout", "Add block")
468
+ children: G ? S("calendar.blocking", "Blocking...") : S("calendar.addBlackout", "Add block")
424
469
  })
425
470
  ]
426
471
  }),
427
472
  /* @__PURE__ */ d("div", {
428
473
  className: "space-y-2",
429
- children: Xe.map((e) => /* @__PURE__ */ f("div", {
474
+ children: et.map((e) => /* @__PURE__ */ f("div", {
430
475
  className: "flex items-center justify-between rounded-radius-md border border-border-subtle bg-bg-canvas p-3",
431
476
  children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("p", {
432
477
  className: "font-text-sm font-weight-medium text-text-primary",
433
478
  children: [
434
- _(e.startDate),
479
+ v(e.startDate),
435
480
  " → ",
436
- _(e.endDate)
481
+ v(e.endDate)
437
482
  ]
438
483
  }), /* @__PURE__ */ d("p", {
439
484
  className: "font-text-xs text-text-tertiary",
@@ -441,33 +486,34 @@ function v() {
441
486
  })] }), /* @__PURE__ */ d("button", {
442
487
  type: "button",
443
488
  onClick: async () => {
444
- await Ve({ variables: { id: e.id } }), await $();
489
+ await Ke({ variables: { id: e.id } }), await $();
445
490
  },
446
491
  className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-surface hover:bg-bg-elevated text-text-primary font-text-sm",
447
- children: C("calendar.delete", "Delete")
492
+ children: S("calendar.delete", "Delete")
448
493
  })]
449
494
  }, e.id))
450
495
  })
451
496
  ]
452
497
  }),
453
- /* @__PURE__ */ f(g, {
454
- title: C("calendar.bookingPages", "Booking pages"),
455
- description: C("calendar.bookingPagesDescription", "Create Calendly-style booking pages for appointment scheduling from your calendar availability."),
498
+ /* @__PURE__ */ f(_, {
499
+ id: "settings-booking-pages",
500
+ title: S("calendar.bookingPages", "Booking pages"),
501
+ description: S("calendar.bookingPagesDescription", "Create Calendly-style booking pages for appointment scheduling from your calendar availability."),
456
502
  icon: _e,
457
503
  children: [/* @__PURE__ */ f("form", {
458
504
  onSubmit: async (e) => {
459
- e.preventDefault(), !(!U || !L.name.trim() || !L.slug.trim()) && (await He({ variables: { input: {
460
- calendarId: U,
461
- name: L.name.trim(),
462
- slug: L.slug.trim(),
463
- pageType: L.pageType,
464
- eventDuration: parseInt(L.eventDuration, 10),
465
- locationType: L.locationType,
466
- maxAttendees: parseInt(L.maxAttendees, 10),
467
- requireApproval: L.requireApproval,
505
+ e.preventDefault(), !(!V || !F.name.trim() || !F.slug.trim()) && (await qe({ variables: { input: {
506
+ calendarId: V,
507
+ name: F.name.trim(),
508
+ slug: F.slug.trim(),
509
+ pageType: F.pageType,
510
+ eventDuration: parseInt(F.eventDuration, 10),
511
+ locationType: F.locationType,
512
+ maxAttendees: parseInt(F.maxAttendees, 10),
513
+ requireApproval: F.requireApproval,
468
514
  isActive: !0,
469
515
  isPublic: !0
470
- } } }), R({
516
+ } } }), I({
471
517
  name: "",
472
518
  slug: "",
473
519
  pageType: "ONE_ON_ONE",
@@ -480,40 +526,40 @@ function v() {
480
526
  className: "grid grid-cols-1 gap-3 @md:grid-cols-3",
481
527
  children: [
482
528
  /* @__PURE__ */ d("input", {
483
- "aria-label": C("calendar.bookingPageName", "Booking page name"),
484
- value: L.name,
485
- onChange: (e) => R((t) => ({
529
+ "aria-label": S("calendar.bookingPageName", "Booking page name"),
530
+ value: F.name,
531
+ onChange: (e) => I((t) => ({
486
532
  ...t,
487
533
  name: e.target.value
488
534
  })),
489
- placeholder: C("calendar.bookingPageName", "Booking page name"),
535
+ placeholder: S("calendar.bookingPageName", "Booking page name"),
490
536
  className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-border"
491
537
  }),
492
538
  /* @__PURE__ */ d("input", {
493
- "aria-label": C("calendar.bookingPageSlugLabel", "Booking page slug"),
494
- value: L.slug,
495
- onChange: (e) => R((t) => ({
539
+ "aria-label": S("calendar.bookingPageSlugLabel", "Booking page slug"),
540
+ value: F.slug,
541
+ onChange: (e) => I((t) => ({
496
542
  ...t,
497
543
  slug: e.target.value
498
544
  })),
499
- placeholder: C("calendar.bookingPageSlug", "booking-page-slug"),
545
+ placeholder: S("calendar.bookingPageSlug", "booking-page-slug"),
500
546
  className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-border"
501
547
  }),
502
548
  /* @__PURE__ */ d("input", {
503
- "aria-label": C("calendar.bookingPageDuration", "Event duration in minutes"),
549
+ "aria-label": S("calendar.bookingPageDuration", "Event duration in minutes"),
504
550
  type: "number",
505
551
  min: "15",
506
552
  step: "15",
507
- value: L.eventDuration,
508
- onChange: (e) => R((t) => ({
553
+ value: F.eventDuration,
554
+ onChange: (e) => I((t) => ({
509
555
  ...t,
510
556
  eventDuration: e.target.value
511
557
  })),
512
558
  className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm focus:outline-none focus:ring-2 focus:ring-action-primary-border"
513
559
  }),
514
560
  /* @__PURE__ */ d("select", {
515
- value: L.pageType,
516
- onChange: (e) => R((t) => ({
561
+ value: F.pageType,
562
+ onChange: (e) => I((t) => ({
517
563
  ...t,
518
564
  pageType: e.target.value
519
565
  })),
@@ -529,8 +575,8 @@ function v() {
529
575
  }, e))
530
576
  }),
531
577
  /* @__PURE__ */ d("select", {
532
- value: L.locationType,
533
- onChange: (e) => R((t) => ({
578
+ value: F.locationType,
579
+ onChange: (e) => I((t) => ({
534
580
  ...t,
535
581
  locationType: e.target.value
536
582
  })),
@@ -549,10 +595,10 @@ function v() {
549
595
  className: "flex items-center gap-3 rounded-radius-md border border-border-subtle bg-bg-canvas px-3 py-2",
550
596
  children: [/* @__PURE__ */ d("input", {
551
597
  id: "booking-page-approval",
552
- "aria-label": C("calendar.requireApproval", "Require approval"),
598
+ "aria-label": S("calendar.requireApproval", "Require approval"),
553
599
  type: "checkbox",
554
- checked: L.requireApproval,
555
- onChange: (e) => R((t) => ({
600
+ checked: F.requireApproval,
601
+ onChange: (e) => I((t) => ({
556
602
  ...t,
557
603
  requireApproval: e.target.checked
558
604
  })),
@@ -560,19 +606,24 @@ function v() {
560
606
  }), /* @__PURE__ */ d("label", {
561
607
  htmlFor: "booking-page-approval",
562
608
  className: "font-text-sm text-text-primary",
563
- children: C("calendar.requireApproval", "Require approval")
609
+ children: S("calendar.requireApproval", "Require approval")
564
610
  })]
565
611
  }),
566
612
  /* @__PURE__ */ d("button", {
567
613
  type: "submit",
568
- disabled: !U || J,
614
+ disabled: !V || K,
569
615
  className: "@md:col-span-3 px-4 py-2 rounded-radius-md bg-action-primary-bg text-action-primary-fg font-text-sm font-weight-medium hover:bg-action-primary-bg-hover disabled:opacity-50",
570
- children: J ? C("calendar.creating", "Creating...") : C("calendar.createBookingPage", "Create booking page")
616
+ children: K ? S("calendar.creating", "Creating...") : S("calendar.createBookingPage", "Create booking page")
571
617
  })
572
618
  ]
573
- }), /* @__PURE__ */ d("div", {
619
+ }), /* @__PURE__ */ f("div", {
574
620
  className: "space-y-2",
575
- children: Je.map((e) => /* @__PURE__ */ f("div", {
621
+ children: [X.length === 0 ? /* @__PURE__ */ d(m, {
622
+ illustration: "empty-data",
623
+ className: "py-8",
624
+ title: S("calendar.noBookingPages", "No booking pages yet"),
625
+ description: S("calendar.noBookingPagesDesc", "Create a booking page above to let others self-schedule time with you.")
626
+ }) : null, X.map((e) => /* @__PURE__ */ f("div", {
576
627
  className: "flex items-center justify-between rounded-radius-md border border-border-subtle bg-bg-canvas p-3",
577
628
  children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("p", {
578
629
  className: "font-text-sm font-weight-medium text-text-primary",
@@ -595,30 +646,31 @@ function v() {
595
646
  })] }), /* @__PURE__ */ d("button", {
596
647
  type: "button",
597
648
  onClick: async () => {
598
- await Ue({ variables: { id: e.id } }), await $();
649
+ await Je({ variables: { id: e.id } }), await $();
599
650
  },
600
651
  className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-surface hover:bg-bg-elevated text-text-primary font-text-sm",
601
- children: C("calendar.delete", "Delete")
652
+ children: S("calendar.delete", "Delete")
602
653
  })]
603
- }, e.id))
654
+ }, e.id))]
604
655
  })]
605
656
  }),
606
- /* @__PURE__ */ f(g, {
607
- title: C("calendar.externalCalendarSync", "External calendar sync"),
608
- description: C("calendar.externalCalendarSyncDescription", "Configure Google, Outlook, and Apple-compatible sync connections and trigger synchronization cycles."),
657
+ /* @__PURE__ */ f(_, {
658
+ id: "settings-external-sync",
659
+ title: S("calendar.externalCalendarSync", "External calendar sync"),
660
+ description: S("calendar.externalCalendarSyncDescription", "Configure Google, Outlook, and Apple-compatible sync connections and trigger synchronization cycles."),
609
661
  icon: ye,
610
662
  children: [/* @__PURE__ */ f("form", {
611
663
  onSubmit: async (e) => {
612
- e.preventDefault(), !(!U || !z.externalCalendarId.trim() || !z.accessToken.trim()) && (await We({ variables: { input: {
613
- calendarId: U,
614
- provider: z.provider,
615
- externalCalendarId: z.externalCalendarId.trim(),
616
- externalCalendarName: z.externalCalendarName.trim() || void 0,
617
- accessToken: z.accessToken.trim(),
618
- refreshToken: z.refreshToken.trim() || void 0,
619
- syncFrequency: parseInt(z.syncFrequency, 10),
620
- direction: z.direction
621
- } } }), B({
664
+ e.preventDefault(), !(!V || !L.externalCalendarId.trim() || !L.accessToken.trim()) && (await Ye({ variables: { input: {
665
+ calendarId: V,
666
+ provider: L.provider,
667
+ externalCalendarId: L.externalCalendarId.trim(),
668
+ externalCalendarName: L.externalCalendarName.trim() || void 0,
669
+ accessToken: L.accessToken.trim(),
670
+ refreshToken: L.refreshToken.trim() || void 0,
671
+ syncFrequency: parseInt(L.syncFrequency, 10),
672
+ direction: L.direction
673
+ } } }), R({
622
674
  provider: "GOOGLE_CALENDAR",
623
675
  externalCalendarId: "",
624
676
  externalCalendarName: "",
@@ -631,8 +683,8 @@ function v() {
631
683
  className: "grid grid-cols-1 gap-3 @md:grid-cols-3",
632
684
  children: [
633
685
  /* @__PURE__ */ f("select", {
634
- value: z.provider,
635
- onChange: (e) => B((t) => ({
686
+ value: L.provider,
687
+ onChange: (e) => R((t) => ({
636
688
  ...t,
637
689
  provider: e.target.value
638
690
  })),
@@ -657,60 +709,60 @@ function v() {
657
709
  ]
658
710
  }),
659
711
  /* @__PURE__ */ d("input", {
660
- "aria-label": C("calendar.externalCalendarId", "External calendar ID"),
661
- value: z.externalCalendarId,
662
- onChange: (e) => B((t) => ({
712
+ "aria-label": S("calendar.externalCalendarId", "External calendar ID"),
713
+ value: L.externalCalendarId,
714
+ onChange: (e) => R((t) => ({
663
715
  ...t,
664
716
  externalCalendarId: e.target.value
665
717
  })),
666
- placeholder: C("calendar.externalCalendarId", "External calendar ID"),
718
+ placeholder: S("calendar.externalCalendarId", "External calendar ID"),
667
719
  className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-border"
668
720
  }),
669
721
  /* @__PURE__ */ d("input", {
670
- "aria-label": C("calendar.externalCalendarName", "External calendar name"),
671
- value: z.externalCalendarName,
672
- onChange: (e) => B((t) => ({
722
+ "aria-label": S("calendar.externalCalendarName", "External calendar name"),
723
+ value: L.externalCalendarName,
724
+ onChange: (e) => R((t) => ({
673
725
  ...t,
674
726
  externalCalendarName: e.target.value
675
727
  })),
676
- placeholder: C("calendar.externalCalendarName", "External calendar name"),
728
+ placeholder: S("calendar.externalCalendarName", "External calendar name"),
677
729
  className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-border"
678
730
  }),
679
731
  /* @__PURE__ */ d("input", {
680
- "aria-label": C("calendar.accessToken", "Access token"),
681
- value: z.accessToken,
682
- onChange: (e) => B((t) => ({
732
+ "aria-label": S("calendar.accessToken", "Access token"),
733
+ value: L.accessToken,
734
+ onChange: (e) => R((t) => ({
683
735
  ...t,
684
736
  accessToken: e.target.value
685
737
  })),
686
- placeholder: C("calendar.accessToken", "Access token"),
738
+ placeholder: S("calendar.accessToken", "Access token"),
687
739
  className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-border"
688
740
  }),
689
741
  /* @__PURE__ */ d("input", {
690
- "aria-label": C("calendar.refreshToken", "Refresh token (optional)"),
691
- value: z.refreshToken,
692
- onChange: (e) => B((t) => ({
742
+ "aria-label": S("calendar.refreshToken", "Refresh token (optional)"),
743
+ value: L.refreshToken,
744
+ onChange: (e) => R((t) => ({
693
745
  ...t,
694
746
  refreshToken: e.target.value
695
747
  })),
696
- placeholder: C("calendar.refreshToken", "Refresh token (optional)"),
748
+ placeholder: S("calendar.refreshToken", "Refresh token (optional)"),
697
749
  className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-border"
698
750
  }),
699
751
  /* @__PURE__ */ d("input", {
700
- "aria-label": C("calendar.syncFrequencyLabel", "Sync frequency in seconds"),
752
+ "aria-label": S("calendar.syncFrequencyLabel", "Sync frequency in seconds"),
701
753
  type: "number",
702
754
  min: "60",
703
755
  step: "60",
704
- value: z.syncFrequency,
705
- onChange: (e) => B((t) => ({
756
+ value: L.syncFrequency,
757
+ onChange: (e) => R((t) => ({
706
758
  ...t,
707
759
  syncFrequency: e.target.value
708
760
  })),
709
761
  className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm focus:outline-none focus:ring-2 focus:ring-action-primary-border"
710
762
  }),
711
763
  /* @__PURE__ */ f("select", {
712
- value: z.direction,
713
- onChange: (e) => B((t) => ({
764
+ value: L.direction,
765
+ onChange: (e) => R((t) => ({
714
766
  ...t,
715
767
  direction: e.target.value
716
768
  })),
@@ -718,28 +770,33 @@ function v() {
718
770
  children: [
719
771
  /* @__PURE__ */ d("option", {
720
772
  value: "TWO_WAY",
721
- children: C("calendar.twoWaySync", "Two-way sync")
773
+ children: S("calendar.twoWaySync", "Two-way sync")
722
774
  }),
723
775
  /* @__PURE__ */ d("option", {
724
776
  value: "ONE_WAY_TO_EXTERNAL",
725
- children: C("calendar.oneWayToExternal", "One-way to external")
777
+ children: S("calendar.oneWayToExternal", "One-way to external")
726
778
  }),
727
779
  /* @__PURE__ */ d("option", {
728
780
  value: "ONE_WAY_FROM_EXTERNAL",
729
- children: C("calendar.oneWayFromExternal", "One-way from external")
781
+ children: S("calendar.oneWayFromExternal", "One-way from external")
730
782
  })
731
783
  ]
732
784
  }),
733
785
  /* @__PURE__ */ d("button", {
734
786
  type: "submit",
735
- disabled: !U || Y,
787
+ disabled: !V || q,
736
788
  className: "px-4 py-2 rounded-radius-md bg-action-primary-bg text-action-primary-fg font-text-sm font-weight-medium hover:bg-action-primary-bg-hover disabled:opacity-50",
737
- children: Y ? C("calendar.connecting", "Connecting...") : C("calendar.connectExternalCalendar", "Connect external calendar")
789
+ children: q ? S("calendar.connecting", "Connecting...") : S("calendar.connectExternalCalendar", "Connect external calendar")
738
790
  })
739
791
  ]
740
- }), /* @__PURE__ */ d("div", {
792
+ }), /* @__PURE__ */ f("div", {
741
793
  className: "space-y-3",
742
- children: Ze.map((e) => /* @__PURE__ */ f("div", {
794
+ children: [Q.length === 0 ? /* @__PURE__ */ d(m, {
795
+ illustration: "empty-generic",
796
+ className: "py-8",
797
+ title: S("calendar.noExternalSyncs", "No external calendars connected"),
798
+ description: S("calendar.noExternalSyncsDesc", "Connect Google, Outlook, or Apple above to keep events in sync both ways.")
799
+ }) : null, Q.map((e) => /* @__PURE__ */ f("div", {
743
800
  className: "rounded-radius-md border border-border-subtle bg-bg-canvas p-3 space-y-3",
744
801
  children: [/* @__PURE__ */ f("div", { children: [
745
802
  /* @__PURE__ */ f("p", {
@@ -756,15 +813,15 @@ function v() {
756
813
  e.status,
757
814
  " •",
758
815
  " ",
759
- C("calendar.everySeconds", "Every {value} seconds").replace("{value}", String(e.syncFrequency))
816
+ S("calendar.everySeconds", "Every {value} seconds").replace("{value}", String(e.syncFrequency))
760
817
  ]
761
818
  }),
762
819
  /* @__PURE__ */ f("p", {
763
820
  className: "font-text-xs text-text-tertiary",
764
821
  children: [
765
- C("calendar.lastSync", "Last sync"),
822
+ S("calendar.lastSync", "Last sync"),
766
823
  ": ",
767
- _(e.lastSyncAt),
824
+ v(e.lastSyncAt),
768
825
  " •",
769
826
  " ",
770
827
  e.lastSyncStatus ?? "—"
@@ -780,40 +837,40 @@ function v() {
780
837
  /* @__PURE__ */ d("button", {
781
838
  type: "button",
782
839
  onClick: async () => {
783
- await qe({ variables: { syncId: e.id } }), await $();
840
+ await Qe({ variables: { syncId: e.id } }), await $();
784
841
  },
785
842
  className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-surface hover:bg-bg-elevated text-text-primary font-text-sm",
786
- children: C("calendar.triggerSync", "Trigger sync")
843
+ children: S("calendar.triggerSync", "Trigger sync")
787
844
  }),
788
845
  /* @__PURE__ */ d("button", {
789
846
  type: "button",
790
847
  onClick: async () => {
791
- e.syncEnabled ? await Ge({ variables: { syncId: e.id } }) : await Ke({ variables: { syncId: e.id } }), await $();
848
+ e.syncEnabled ? await Xe({ variables: { syncId: e.id } }) : await Ze({ variables: { syncId: e.id } }), await $();
792
849
  },
793
850
  className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-surface hover:bg-bg-elevated text-text-primary font-text-sm",
794
- children: e.syncEnabled ? C("calendar.pauseSync", "Pause") : C("calendar.resumeSync", "Resume")
851
+ children: e.syncEnabled ? S("calendar.pauseSync", "Pause") : S("calendar.resumeSync", "Resume")
795
852
  }),
796
853
  /* @__PURE__ */ d("button", {
797
854
  type: "button",
798
855
  onClick: async () => {
799
- await X({ variables: { syncId: e.id } }), await $();
856
+ await $e({ variables: { syncId: e.id } }), await $();
800
857
  },
801
858
  className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-surface hover:bg-bg-elevated text-text-primary font-text-sm",
802
- children: C("calendar.disconnect", "Disconnect")
859
+ children: S("calendar.disconnect", "Disconnect")
803
860
  })
804
861
  ]
805
862
  })]
806
- }, e.id))
863
+ }, e.id))]
807
864
  })]
808
865
  })
809
866
  ]
810
867
  })]
811
- }) : /* @__PURE__ */ d(fe, {
812
- title: C("calendar.accessDenied", "Access Denied"),
813
- description: C("calendar.noPermissionViewSettings", "You don't have permission to view calendar settings.")
868
+ }) : /* @__PURE__ */ d(pe, {
869
+ title: S("calendar.accessDenied", "Access Denied"),
870
+ description: S("calendar.noPermissionViewSettings", "You don't have permission to view calendar settings.")
814
871
  });
815
872
  }
816
873
  //#endregion
817
- export { v as SettingsPage };
874
+ export { y as SettingsPage };
818
875
 
819
876
  //# sourceMappingURL=SettingsPage.js.map