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