your-ai-workflow-firebase-os 2.0.2 → 2.0.3
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/dist/AccessNotice-BZ5Gt1nP.js +40 -0
- package/dist/AccessNotice-CN7kc70o.cjs +1 -0
- package/dist/{AddressField-B2YBRXcx.js → AddressField-9Sqn8TvC.js} +3 -3
- package/dist/{AddressField-BBv8NGX8.cjs → AddressField-B7wtV8yA.cjs} +1 -1
- package/dist/Assets-DBMwZ3bN.cjs +1 -0
- package/dist/Assets-DT-NU_WO.js +296 -0
- package/dist/Attachments-Bl9_dfsu.js +46 -0
- package/dist/Attachments-UVK9SRXf.cjs +1 -0
- package/dist/Billing-0RIHayHy.cjs +1 -0
- package/dist/Billing-FNE2r3_d.js +379 -0
- package/dist/BookingCalendar-BP5kiv3d.cjs +1 -0
- package/dist/BookingCalendar-DZ2fEFja.js +309 -0
- package/dist/Button-4lzOE31p.js +48 -0
- package/dist/Button-5DlB2MCi.cjs +1 -0
- package/dist/CalendarView-BimoXy_k.cjs +1 -0
- package/dist/CalendarView-D-ykjpvI.js +664 -0
- package/dist/ConfirmModal-Di9GR-vV.cjs +1 -0
- package/dist/ConfirmModal-gKQEpd4d.js +113 -0
- package/dist/ContactPopup-BXnHrRwl.js +1114 -0
- package/dist/ContactPopup-lxmRMoIa.cjs +1 -0
- package/dist/CopyLink-BpEQWmfI.cjs +1 -0
- package/dist/CopyLink-CBAVfcm1.js +43 -0
- package/dist/DashboardNav-CXa_ci-_.cjs +1 -0
- package/dist/DashboardNav-Dmn7PVSp.js +886 -0
- package/dist/EmailAdmin-CjN_rvxT.js +318 -0
- package/dist/EmailAdmin-lAEBdY1s.cjs +1 -0
- package/dist/EventCard-46EquygT.cjs +1 -0
- package/dist/EventCard-B6xD-mk3.js +97 -0
- package/dist/FileViewerPopup-CX-J75TM.js +1283 -0
- package/dist/FileViewerPopup-D8-MmIoS.cjs +3 -0
- package/dist/FormNote-BivRNA3J.js +50 -0
- package/dist/FormNote-BtdTGpml.cjs +1 -0
- package/dist/FormsAdmin-B5PBCG2W.js +812 -0
- package/dist/FormsAdmin-BQCULvi5.cjs +1 -0
- package/dist/Inbox-BPk2ZkE5.js +779 -0
- package/dist/Inbox-DNrcBx0o.cjs +3 -0
- package/dist/Loader-Bu89fsbB.cjs +1 -0
- package/dist/Loader-D4gwgBOq.js +32 -0
- package/dist/ManagePlanButton-B0dwqZBd.cjs +1 -0
- package/dist/ManagePlanButton-BSrOHYze.js +29 -0
- package/dist/MyBookings-6qr0GgzO.cjs +1 -0
- package/dist/MyBookings-BQjGM2LQ.js +113 -0
- package/dist/PageTitle-CZhgmmDT.cjs +3 -0
- package/dist/PageTitle-D93YCiN8.js +1606 -0
- package/dist/PagesAdmin-BcHIcqM5.cjs +34 -0
- package/dist/PagesAdmin-D69P9nRb.js +5802 -0
- package/dist/PagesAdmin-DNwZOKjA.cjs +1 -0
- package/dist/PagesAdmin-HUITEcHx.js +3 -0
- package/dist/PaymentsAdmin-C2iCI9qC.js +1291 -0
- package/dist/PaymentsAdmin-CoXi2vCm.cjs +2 -0
- package/dist/{PhoneInputField-B3P_vUDW.cjs → PhoneInputField-BEwYZMB7.cjs} +1 -1
- package/dist/{PhoneInputField-D3wWs-M8.js → PhoneInputField-BG0L2djE.js} +2 -2
- package/dist/PhoneInputField-DfOtCIH_.js +2 -0
- package/dist/{PhoneInputField-CdNTvWXQ.cjs → PhoneInputField-jhWvto8C.cjs} +1 -1
- package/dist/Popup-DHYGFl2-.cjs +1 -0
- package/dist/Popup-xROLytgr.js +142 -0
- package/dist/ProviderMark-BBfaM5Yl.js +52 -0
- package/dist/ProviderMark-xLkUN3Fx.cjs +1 -0
- package/dist/PublishApp-Bm-6r3Td.js +595 -0
- package/dist/PublishApp-D4XJUkJa.cjs +2 -0
- package/dist/Said-CoC15awL.js +94 -0
- package/dist/Said-IqCNofdh.cjs +1 -0
- package/dist/ScheduleAdmin-BKfQkrR8.js +1853 -0
- package/dist/ScheduleAdmin-DwK36GAZ.cjs +1 -0
- package/dist/SchedulePicker--urIH2Eb.js +112 -0
- package/dist/SchedulePicker-nmqzUnUH.cjs +1 -0
- package/dist/Setup-CHLgd-ag.js +849 -0
- package/dist/Setup-CaDranTm.cjs +1374 -0
- package/dist/SetupPayments-CVIwh1eQ.js +411 -0
- package/dist/SetupPayments-HNXWA25X.cjs +1 -0
- package/dist/SignInAdmin-C94-A-0w.cjs +4 -0
- package/dist/SignInAdmin-Yxgv_8U4.js +766 -0
- package/dist/SupportBar-CDT0HwdP.cjs +1 -0
- package/dist/SupportBar-CN_JGC-9.js +117 -0
- package/dist/SystemTabContent-L3vGGF3P.cjs +1 -0
- package/dist/SystemTabContent-QdxxLILE.js +35 -0
- package/dist/TemplateDrive-DV8zNjYe.cjs +1 -0
- package/dist/TemplateDrive-NJY_AAvV.js +1197 -0
- package/dist/ThemeAdmin-BzFjJkLg.js +269 -0
- package/dist/ThemeAdmin-DVnPNxe7.cjs +1 -0
- package/dist/ThemeAdmin-DY7Vc4Sj.cjs +3 -0
- package/dist/ThemeAdmin-DnC-D2N3.js +2 -0
- package/dist/{ContactPopup-Dsg2ntq3.js → TimeZoneField-DkI1Bkcz.js} +3191 -5322
- package/dist/TimeZoneField-qs7NPR30.cjs +12 -0
- package/dist/TransactionsAdmin-BsZ-oQWi.js +582 -0
- package/dist/TransactionsAdmin-CTSTiPld.cjs +1 -0
- package/dist/Trouble-9es_AI4F.cjs +1 -0
- package/dist/Trouble-oWt9fMsm.js +164 -0
- package/dist/Users-CTitWXyd.cjs +1 -0
- package/dist/Users-DJjQTWJF.js +1207 -0
- package/dist/aiModels-DIP9fn8T.cjs +1 -0
- package/dist/{aiModels-BHlEfuRJ.js → aiModels-DnDhNGup.js} +29 -61
- package/dist/arrivalRoads-BJ-35vkk.js +228 -0
- package/dist/arrivalRoads-qoU-B4jt.cjs +4 -0
- package/dist/{bake-BWG3y-15.cjs → bake-n2wyFw0B.cjs} +1 -1
- package/dist/{bake-BtYOG1Du.js → bake-naZeMu98.js} +1 -1
- package/dist/bookingPages-C7a3srPG.js +102 -0
- package/dist/bookingPages-DvbFbD9X.cjs +1 -0
- package/dist/components/CustomSelect.d.ts +7 -1
- package/dist/components/RegistrationFields.d.ts +6 -1
- package/dist/components/Reveal.d.ts +12 -0
- package/dist/components/ScrollToTop.d.ts +4 -0
- package/dist/contentFallback-C9MZjdq7.cjs +1 -0
- package/dist/contentFallback-CEDY0Pwp.js +96 -0
- package/dist/contentKey-Bwry4lDa.js +13 -0
- package/dist/contentKey-DJGYYnAE.cjs +1 -0
- package/dist/email-BfnZnMwD.cjs +1 -0
- package/dist/email-Ddj8Dlu6.js +58 -0
- package/dist/{fileBytes-BdwaFKRy.cjs → fileBytes-BJPaiX9Y.cjs} +1 -1
- package/dist/{fileBytes-DuW2K-H_.js → fileBytes-bjgvCfWu.js} +2 -2
- package/dist/forms-Bvx9HTM6.js +75 -0
- package/dist/forms-CmNeTETW.cjs +1 -0
- package/dist/lib/ThemeContext.d.ts +0 -14
- package/dist/lib/bareImgWatch.d.ts +6 -1
- package/dist/lib/localEdits.d.ts +2 -0
- package/dist/lib/paymentProducts.d.ts +8 -0
- package/dist/lib/payments.d.ts +11 -1
- package/dist/notices-B7iIrIEg.js +29 -0
- package/dist/notices-upMg8UVh.cjs +1 -0
- package/dist/openOnArrival-Buwqb86D.cjs +1 -0
- package/dist/openOnArrival-S2K6v-lB.js +35 -0
- package/dist/pageFiles--Ih60ITP.js +45 -0
- package/dist/pageFiles-UtBmlOcD.cjs +1 -0
- package/dist/pages/PagesAdmin.d.ts +69 -0
- package/dist/people-2jZE_pdI.js +102 -0
- package/dist/people-BpVvIr9-.cjs +1 -0
- package/dist/personName-CFw3pxuu.js +18 -0
- package/dist/personName-CbzN_i57.cjs +1 -0
- package/dist/publishSteps-C1cDFzzB.js +88 -0
- package/dist/publishSteps-SSm8afDw.cjs +1 -0
- package/dist/recordLock-DHVvI9bP.js +61 -0
- package/dist/recordLock-DWeIxiwh.cjs +1 -0
- package/dist/recordsKey-B7QrxdeU.cjs +1 -0
- package/dist/recordsKey-D5-wC0Aw.js +141 -0
- package/dist/registrationFields-CLeR2lQJ.js +181 -0
- package/dist/registrationFields-v4pOoRdn.cjs +1 -0
- package/dist/renderer.cjs.js +1 -1
- package/dist/renderer.es.js +1 -1
- package/dist/roles-D6VaHWfV.js +147 -0
- package/dist/roles-DQUFFBQe.cjs +1 -0
- package/dist/scheduleData-ATN8w5hI.js +727 -0
- package/dist/scheduleData-Cltj0ABZ.cjs +1 -0
- package/dist/server.cjs.js +6 -6
- package/dist/server.es.js +716 -715
- package/dist/serviceStatus-TQyZO_Y_.cjs +1 -0
- package/dist/serviceStatus-vS8AI7SZ.js +125 -0
- package/dist/tabAudience-BqpN6dsR.cjs +1 -0
- package/dist/tabAudience-CRyMvv0v.js +34 -0
- package/dist/transactions-BqMQDRx3.js +343 -0
- package/dist/transactions-CufFrdAM.cjs +1 -0
- package/dist/useIsPhone-BVGx_X3e.js +13 -0
- package/dist/useIsPhone-o63tNneA.cjs +1 -0
- package/dist/{validate-DzSJWuyL.js → validate-CmC_tLK-.js} +433 -351
- package/dist/validate-DZMwqSrb.cjs +103 -0
- package/dist/vite/validate.d.ts +14 -0
- package/dist/vite.cjs.js +1 -1
- package/dist/vite.es.js +1 -1
- package/dist/your-ai-workflow-firebase-os.cjs.js +15 -1431
- package/dist/your-ai-workflow-firebase-os.css +1 -1
- package/dist/your-ai-workflow-firebase-os.es.js +8200 -32421
- package/package.json +1 -1
- package/src/index.css +122 -2
- package/dist/ContactPopup-IwBm-eqz.cjs +0 -12
- package/dist/PhoneInputField-CVamkTJg.js +0 -2
- package/dist/aiModels-BIhoTNH0.cjs +0 -1
- package/dist/validate-e48WXJdP.cjs +0 -103
- /package/dist/{address-DI1YaCI4.cjs → address-Bsb8COq2.cjs} +0 -0
- /package/dist/{address-Ca1h_UZX.js → address-C2bHNxJU.js} +0 -0
- /package/dist/{dist-BkUiTtIb.js → dist-DUPvBnOA.js} +0 -0
- /package/dist/{dist-BLGlDv1e.cjs → dist-E4jTFPs7.cjs} +0 -0
- /package/dist/{lucide-react-BYniZ3lQ.cjs → lucide-react-BwV6L6Is.cjs} +0 -0
- /package/dist/{lucide-react-ehRy1vqS.js → lucide-react-CA7GD7Nv.js} +0 -0
- /package/dist/{mediaKind-dk396a03.cjs → mediaKind-D0MWyv6b.cjs} +0 -0
- /package/dist/{mediaKind-De2Cx_kB.js → mediaKind-DmKMsjeY.js} +0 -0
- /package/dist/{pdf-u73U7-6s.js → pdf-DRXcPGkr.js} +0 -0
- /package/dist/{pdf-B24jYmSf.cjs → pdf-jLjjhvjp.cjs} +0 -0
- /package/dist/{pdf.worker.min-BPOWx2_9.js → pdf.worker.min-CfKZezeM.js} +0 -0
- /package/dist/{pdf.worker.min-BvhEiZFe.cjs → pdf.worker.min-bLgNWd7w.cjs} +0 -0
- /package/dist/{verifiedAccount-C1iCxopN.js → verifiedAccount-DRbRFJ6H.js} +0 -0
- /package/dist/{verifiedAccount-D3OeaOBo.cjs → verifiedAccount-DScyKk96.cjs} +0 -0
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import { t as e } from "./PageTitle-D93YCiN8.js";
|
|
2
|
+
import { d as t, g as n, h as r, ka as i, o as a, sr as o, v as s, y as c } from "./TimeZoneField-DkI1Bkcz.js";
|
|
3
|
+
import { t as l } from "./DashboardNav-Dmn7PVSp.js";
|
|
4
|
+
import { H as u, Ht as d, O as f, P as p, W as m, ft as h, gn as g, hn as _, ht as v, lt as y, yn as b } from "./lucide-react-CA7GD7Nv.js";
|
|
5
|
+
import { t as x } from "./SupportBar-CN_JGC-9.js";
|
|
6
|
+
import { a as S, i as C, t as w } from "./serviceStatus-vS8AI7SZ.js";
|
|
7
|
+
import { ConnectCard as T, EmailSetupSteps as E } from "./SetupPayments-CVIwh1eQ.js";
|
|
8
|
+
import { useEffect as D, useState as O } from "react";
|
|
9
|
+
import { Fragment as k, jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
10
|
+
import { doc as M, onSnapshot as N, setDoc as P } from "firebase/firestore";
|
|
11
|
+
import { Link as F } from "react-router-dom";
|
|
12
|
+
//#region src/components/SendTestEmail.tsx
|
|
13
|
+
function I({ trailing: e, onSent: t }) {
|
|
14
|
+
let [n, r] = O("idle"), [i, o] = O("");
|
|
15
|
+
return /* @__PURE__ */ j("div", {
|
|
16
|
+
className: "flex flex-col gap-1.5",
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ j("div", {
|
|
19
|
+
className: "flex items-center gap-2.5 flex-wrap",
|
|
20
|
+
children: [/* @__PURE__ */ A(a, {
|
|
21
|
+
compact: !0,
|
|
22
|
+
icon: g,
|
|
23
|
+
busy: n === "sending",
|
|
24
|
+
onClick: async () => {
|
|
25
|
+
r("sending"), o("");
|
|
26
|
+
try {
|
|
27
|
+
let e = await fetch("/api/_selftest/email"), n = await e.json().catch(() => ({}));
|
|
28
|
+
e.ok && n?.ok ? (r("sent"), t?.(typeof n.from == "string" && n.from.trim() ? n.from : null)) : (r("failed"), o(String(n?.error || n?.message || "That test could not be sent. Try again in a moment.")));
|
|
29
|
+
} catch {
|
|
30
|
+
r("failed"), o("The server could not be reached.");
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
title: "Sends the test email to your own admin address",
|
|
34
|
+
children: "Send yourself a test email"
|
|
35
|
+
}), e]
|
|
36
|
+
}),
|
|
37
|
+
n === "sent" && /* @__PURE__ */ A("p", {
|
|
38
|
+
className: "text-[12px] font-semibold text-emerald-500 px-1",
|
|
39
|
+
children: "Sent. If you do not receive it within a minute, check your spam."
|
|
40
|
+
}),
|
|
41
|
+
n === "failed" && /* @__PURE__ */ j("p", {
|
|
42
|
+
className: "text-[12px] font-medium text-red-500 px-1 leading-relaxed",
|
|
43
|
+
children: [
|
|
44
|
+
"It did not send: ",
|
|
45
|
+
i,
|
|
46
|
+
" If the sending address uses your own domain, that domain must be verified under ",
|
|
47
|
+
/* @__PURE__ */ A("strong", { children: "Domains" }),
|
|
48
|
+
" in your Resend account — an unverified domain makes every send fail."
|
|
49
|
+
]
|
|
50
|
+
})
|
|
51
|
+
]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/lib/emailTested.ts
|
|
56
|
+
var { collection: L, doc: R } = C.email, z = (e, t) => {
|
|
57
|
+
let n = String(e || "").trim().toLowerCase(), r = String(t || "").trim().toLowerCase();
|
|
58
|
+
return !!n && n === r;
|
|
59
|
+
};
|
|
60
|
+
function B() {
|
|
61
|
+
let [e, t] = O({
|
|
62
|
+
loading: !0,
|
|
63
|
+
testedFrom: null
|
|
64
|
+
});
|
|
65
|
+
return D(() => N(M(i, L, R), (e) => {
|
|
66
|
+
let n = e.exists() ? e.data()?.testedFrom : null;
|
|
67
|
+
t({
|
|
68
|
+
loading: !1,
|
|
69
|
+
testedFrom: typeof n == "string" && n.trim() ? n : null
|
|
70
|
+
});
|
|
71
|
+
}, () => t({
|
|
72
|
+
loading: !1,
|
|
73
|
+
testedFrom: null
|
|
74
|
+
})), []), {
|
|
75
|
+
loading: e.loading,
|
|
76
|
+
testedFrom: e.testedFrom,
|
|
77
|
+
mark: async (e) => {
|
|
78
|
+
if (e.trim()) {
|
|
79
|
+
t({
|
|
80
|
+
loading: !1,
|
|
81
|
+
testedFrom: e
|
|
82
|
+
});
|
|
83
|
+
try {
|
|
84
|
+
await P(M(i, L, R), { testedFrom: e }, { merge: !0 });
|
|
85
|
+
} catch (e) {
|
|
86
|
+
console.error("Could not remember the test send", e);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/pages/EmailAdmin.tsx
|
|
94
|
+
var V = (e) => [
|
|
95
|
+
{
|
|
96
|
+
title: "Hear about what happens",
|
|
97
|
+
body: "A booking, a form entry, a new member — at your address the moment it happens.",
|
|
98
|
+
icon: _,
|
|
99
|
+
where: {
|
|
100
|
+
path: "/pages",
|
|
101
|
+
label: "Pages screen"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
title: "Confirm to the people who write in",
|
|
106
|
+
body: "Whoever books or writes gets a note that it arrived, in your words.",
|
|
107
|
+
icon: h,
|
|
108
|
+
where: {
|
|
109
|
+
path: "/pages",
|
|
110
|
+
label: "Pages screen"
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
title: "Receipts and sale alerts",
|
|
115
|
+
body: "Every payment emails the buyer a receipt and tells you something sold.",
|
|
116
|
+
icon: u,
|
|
117
|
+
where: {
|
|
118
|
+
path: "/payments",
|
|
119
|
+
label: "Payments screen"
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
title: "Write to anyone from your app",
|
|
124
|
+
body: `A page for your team can write to any address, from ${e}.`,
|
|
125
|
+
icon: p,
|
|
126
|
+
where: {
|
|
127
|
+
path: "/pages",
|
|
128
|
+
label: "Pages screen"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
], H = (e) => String(e || "").toLowerCase().endsWith("@resend.dev"), U = (e) => String(e || "").split("@")[1] || "", W = (e) => e ? {
|
|
132
|
+
description: "Every page you told to send email does. Switch it off to stop all of it at once.",
|
|
133
|
+
chip: {
|
|
134
|
+
state: "saved",
|
|
135
|
+
label: "On"
|
|
136
|
+
}
|
|
137
|
+
} : {
|
|
138
|
+
description: "Nothing sends. Your pages keep their settings and wait for this to come back on.",
|
|
139
|
+
chip: {
|
|
140
|
+
state: "off",
|
|
141
|
+
label: "Off"
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
function G({ from: e }) {
|
|
145
|
+
return /* @__PURE__ */ A("div", {
|
|
146
|
+
className: "flex flex-col divide-y divide-[var(--panel-border)]/60 rounded-2xl border border-[var(--panel-border)]/60",
|
|
147
|
+
children: V(e).map((e) => {
|
|
148
|
+
let t = e.icon;
|
|
149
|
+
return /* @__PURE__ */ j("div", {
|
|
150
|
+
className: "grid grid-cols-[auto_minmax(0,1fr)] sm:grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-x-3 sm:gap-x-3.5 gap-y-0.5 px-4 py-3",
|
|
151
|
+
children: [
|
|
152
|
+
/* @__PURE__ */ A("div", {
|
|
153
|
+
className: "row-start-1 row-span-2 col-start-1 self-center w-9 h-9 rounded-xl flex items-center justify-center shrink-0 border border-[var(--panel-border)]/50 bg-accent/10 text-accent",
|
|
154
|
+
children: /* @__PURE__ */ A(t, { className: "w-4 h-4" })
|
|
155
|
+
}),
|
|
156
|
+
/* @__PURE__ */ A("span", {
|
|
157
|
+
className: "row-start-1 col-start-2 min-w-0 text-[13px] font-bold text-foreground leading-tight self-end",
|
|
158
|
+
children: e.title
|
|
159
|
+
}),
|
|
160
|
+
/* @__PURE__ */ A("span", {
|
|
161
|
+
className: "row-start-2 col-start-2 min-w-0 text-[12px] text-foreground/50 font-normal leading-snug self-start",
|
|
162
|
+
children: e.body
|
|
163
|
+
}),
|
|
164
|
+
/* @__PURE__ */ j(F, {
|
|
165
|
+
to: e.where.path,
|
|
166
|
+
className: "max-sm:hidden sm:inline-flex row-start-1 row-span-2 col-start-3 self-center justify-self-end items-center gap-1.5 text-[11.5px] font-semibold text-foreground/45 hover:text-accent whitespace-nowrap transition-colors",
|
|
167
|
+
children: [e.where.label, /* @__PURE__ */ A(b, { className: "w-3 h-3" })]
|
|
168
|
+
})
|
|
169
|
+
]
|
|
170
|
+
}, e.title);
|
|
171
|
+
})
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
function K({ adminCount: e, onSetUp: n }) {
|
|
175
|
+
return /* @__PURE__ */ j("div", {
|
|
176
|
+
className: "flex items-center gap-2.5 px-1 flex-wrap",
|
|
177
|
+
children: [/* @__PURE__ */ A(s, {
|
|
178
|
+
state: e ? "saved" : "off",
|
|
179
|
+
label: e ? `Your mail reaches ${e} address${e === 1 ? "" : "es"}` : "No address for your mail"
|
|
180
|
+
}), !e && /* @__PURE__ */ j("span", {
|
|
181
|
+
className: "text-[11px] sm:text-[11.5px] text-foreground/40 font-medium leading-snug",
|
|
182
|
+
children: [
|
|
183
|
+
"Sale, booking and form alerts have nowhere to go —",
|
|
184
|
+
" ",
|
|
185
|
+
/* @__PURE__ */ A(t, {
|
|
186
|
+
onClick: n,
|
|
187
|
+
children: "add VITE_ADMIN_EMAILS"
|
|
188
|
+
}),
|
|
189
|
+
"."
|
|
190
|
+
]
|
|
191
|
+
})]
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
function q() {
|
|
195
|
+
let { status: i, error: a, reread: u } = w(), p = S("email"), [g, _] = O(""), b = B(), [C, D] = O(!1), [M, N] = O(!1), P = () => {
|
|
196
|
+
D(!1), u().then(() => N(!0));
|
|
197
|
+
}, F = !!(i && !i.configured), L = H(i?.from), R = W(p.on), V = !b.loading && z(b.testedFrom, i?.from);
|
|
198
|
+
return /* @__PURE__ */ j("main", {
|
|
199
|
+
className: "flex-1 w-full max-w-7xl mx-auto p-4 pt-2 md:p-8 md:pt-4 z-10 flex flex-col min-h-screen",
|
|
200
|
+
children: [
|
|
201
|
+
/* @__PURE__ */ j(o.div, {
|
|
202
|
+
initial: {
|
|
203
|
+
opacity: 0,
|
|
204
|
+
y: 20
|
|
205
|
+
},
|
|
206
|
+
animate: {
|
|
207
|
+
opacity: 1,
|
|
208
|
+
y: 0
|
|
209
|
+
},
|
|
210
|
+
className: "mb-6",
|
|
211
|
+
children: [/* @__PURE__ */ A(e, { children: "Email" }), /* @__PURE__ */ j("div", {
|
|
212
|
+
className: "flex items-center gap-2 text-foreground/40 font-bold uppercase tracking-[0.2em] text-[11px]",
|
|
213
|
+
children: [/* @__PURE__ */ A("span", { className: "w-8 h-[1px] bg-foreground/10" }), "/email"]
|
|
214
|
+
})]
|
|
215
|
+
}),
|
|
216
|
+
/* @__PURE__ */ j("div", {
|
|
217
|
+
className: "flex flex-col gap-6 flex-1 pb-16",
|
|
218
|
+
children: [/* @__PURE__ */ A(l, {}), /* @__PURE__ */ A("div", {
|
|
219
|
+
className: "glass-panel border border-[var(--panel-border)] rounded-3xl p-4 sm:p-5 md:p-8 shadow-2xl relative bg-background flex flex-col fbos-tab-fill min-h-[600px]",
|
|
220
|
+
children: !i && !a ? /* @__PURE__ */ A("div", {
|
|
221
|
+
className: "flex items-center justify-center flex-1 text-foreground/40 py-16",
|
|
222
|
+
children: /* @__PURE__ */ A(v, { className: "w-6 h-6 animate-spin text-accent" })
|
|
223
|
+
}) : F ? /* @__PURE__ */ A(T, {
|
|
224
|
+
icon: y,
|
|
225
|
+
title: "Connect email",
|
|
226
|
+
description: "This app is not sending email yet.",
|
|
227
|
+
stepsDescription: "Three steps — a key, two secrets, and the domain your mail goes out as.",
|
|
228
|
+
button: "Set up email",
|
|
229
|
+
secret: "RESEND_API_KEY",
|
|
230
|
+
open: C,
|
|
231
|
+
onOpen: () => D(!0),
|
|
232
|
+
confirmed: M,
|
|
233
|
+
steps: /* @__PURE__ */ A(E, { onConfirm: P }),
|
|
234
|
+
children: /* @__PURE__ */ A(n, { children: "Email runs through Resend, and connecting it is two pasted rows — a key, and your own address for the mail that is meant for you. Once they are in, this screen fills itself: what your app can do with email, and where it goes." })
|
|
235
|
+
}) : /* @__PURE__ */ j("div", {
|
|
236
|
+
className: "flex flex-col gap-4",
|
|
237
|
+
children: [
|
|
238
|
+
/* @__PURE__ */ A(c, {
|
|
239
|
+
icon: m,
|
|
240
|
+
title: "Send email",
|
|
241
|
+
description: R.description,
|
|
242
|
+
chip: R.chip,
|
|
243
|
+
enabled: p.loading ? null : p.on,
|
|
244
|
+
onChange: async (e) => _(await p.set(e) || ""),
|
|
245
|
+
children: g ? /* @__PURE__ */ A(n, {
|
|
246
|
+
tone: "error",
|
|
247
|
+
children: g
|
|
248
|
+
}) : null
|
|
249
|
+
}),
|
|
250
|
+
/* @__PURE__ */ A(r, {
|
|
251
|
+
icon: h,
|
|
252
|
+
title: "Connection",
|
|
253
|
+
description: V && !a ? `Mail goes out as ${i?.from}.` : "Whether this app can send email right now.",
|
|
254
|
+
defaultOpen: !V || !i?.adminCount,
|
|
255
|
+
actions: a ? /* @__PURE__ */ A(s, {
|
|
256
|
+
state: "error",
|
|
257
|
+
label: "Unreachable"
|
|
258
|
+
}) : /* @__PURE__ */ A(s, {
|
|
259
|
+
state: "saved",
|
|
260
|
+
label: "Connected"
|
|
261
|
+
}),
|
|
262
|
+
children: a ? /* @__PURE__ */ A(n, {
|
|
263
|
+
tone: "error",
|
|
264
|
+
children: a
|
|
265
|
+
}) : /* @__PURE__ */ j(k, { children: [
|
|
266
|
+
!V && /* @__PURE__ */ j(n, { children: [
|
|
267
|
+
"Mail goes out as ",
|
|
268
|
+
/* @__PURE__ */ A("span", {
|
|
269
|
+
className: "font-bold text-foreground/70",
|
|
270
|
+
children: i?.from
|
|
271
|
+
}),
|
|
272
|
+
".",
|
|
273
|
+
L ? " That is Resend’s shared practice address: it delivers only to the address you made your Resend account with, so a test to yourself works and a customer’s email does not arrive. Before anyone else should get one, verify your own domain in Resend and add EMAIL_FROM — " : ` That only works if ${U(i?.from)} is verified under Domains in your Resend account — an unverified domain makes every send fail. Every send also appears in your Resend dashboard, with nothing to sync.`,
|
|
274
|
+
L && /* @__PURE__ */ A(t, {
|
|
275
|
+
onClick: () => D(!0),
|
|
276
|
+
children: "show me how"
|
|
277
|
+
}),
|
|
278
|
+
L && "."
|
|
279
|
+
] }),
|
|
280
|
+
/* @__PURE__ */ A(K, {
|
|
281
|
+
adminCount: i?.adminCount || 0,
|
|
282
|
+
onSetUp: () => D(!0)
|
|
283
|
+
}),
|
|
284
|
+
C && /* @__PURE__ */ A("div", {
|
|
285
|
+
className: "px-1 pt-1",
|
|
286
|
+
children: /* @__PURE__ */ A(E, { onConfirm: P })
|
|
287
|
+
}),
|
|
288
|
+
!V && /* @__PURE__ */ A("div", {
|
|
289
|
+
className: "px-1",
|
|
290
|
+
children: /* @__PURE__ */ A(I, {
|
|
291
|
+
onSent: (e) => b.mark(e || i?.from || ""),
|
|
292
|
+
trailing: /* @__PURE__ */ j("a", {
|
|
293
|
+
href: "https://resend.com/emails",
|
|
294
|
+
target: "_blank",
|
|
295
|
+
rel: "noreferrer",
|
|
296
|
+
className: "inline-flex items-center gap-1.5 text-[12px] font-bold text-accent hover:underline",
|
|
297
|
+
children: ["See everything sent, in Resend", /* @__PURE__ */ A(d, { className: "w-3 h-3" })]
|
|
298
|
+
})
|
|
299
|
+
})
|
|
300
|
+
})
|
|
301
|
+
] })
|
|
302
|
+
}),
|
|
303
|
+
/* @__PURE__ */ A(r, {
|
|
304
|
+
icon: f,
|
|
305
|
+
title: "What you can do with email",
|
|
306
|
+
description: "Each is switched on where it happens — a page on the Pages screen, a payment on the Payments screen.",
|
|
307
|
+
children: /* @__PURE__ */ A(G, { from: i?.from || "" })
|
|
308
|
+
})
|
|
309
|
+
]
|
|
310
|
+
})
|
|
311
|
+
})]
|
|
312
|
+
}),
|
|
313
|
+
/* @__PURE__ */ A(x, {})
|
|
314
|
+
]
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
//#endregion
|
|
318
|
+
export { q as EmailAdmin };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk-CiTBaPhY.cjs`);const e=require(`./PageTitle-CZhgmmDT.cjs`),t=require(`./TimeZoneField-qs7NPR30.cjs`),n=require(`./DashboardNav-CXa_ci-_.cjs`),r=require(`./lucide-react-BwV6L6Is.cjs`),i=require(`./SupportBar-CDT0HwdP.cjs`),a=require(`./serviceStatus-TQyZO_Y_.cjs`),o=require(`./SetupPayments-HNXWA25X.cjs`);let s=require(`react`),c=require(`react/jsx-runtime`),l=require(`firebase/firestore`),u=require(`react-router-dom`);function d({trailing:e,onSent:n}){let[i,a]=(0,s.useState)(`idle`),[o,l]=(0,s.useState)(``);return(0,c.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-2.5 flex-wrap`,children:[(0,c.jsx)(t.o,{compact:!0,icon:r.gn,busy:i===`sending`,onClick:async()=>{a(`sending`),l(``);try{let e=await fetch(`/api/_selftest/email`),t=await e.json().catch(()=>({}));e.ok&&t?.ok?(a(`sent`),n?.(typeof t.from==`string`&&t.from.trim()?t.from:null)):(a(`failed`),l(String(t?.error||t?.message||`That test could not be sent. Try again in a moment.`)))}catch{a(`failed`),l(`The server could not be reached.`)}},title:`Sends the test email to your own admin address`,children:`Send yourself a test email`}),e]}),i===`sent`&&(0,c.jsx)(`p`,{className:`text-[12px] font-semibold text-emerald-500 px-1`,children:`Sent. If you do not receive it within a minute, check your spam.`}),i===`failed`&&(0,c.jsxs)(`p`,{className:`text-[12px] font-medium text-red-500 px-1 leading-relaxed`,children:[`It did not send: `,o,` If the sending address uses your own domain, that domain must be verified under `,(0,c.jsx)(`strong`,{children:`Domains`}),` in your Resend account — an unverified domain makes every send fail.`]})]})}var{collection:f,doc:p}=a.i.email,m=(e,t)=>{let n=String(e||``).trim().toLowerCase(),r=String(t||``).trim().toLowerCase();return!!n&&n===r};function h(){let[e,n]=(0,s.useState)({loading:!0,testedFrom:null});return(0,s.useEffect)(()=>(0,l.onSnapshot)((0,l.doc)(t.ka,f,p),e=>{let t=e.exists()?e.data()?.testedFrom:null;n({loading:!1,testedFrom:typeof t==`string`&&t.trim()?t:null})},()=>n({loading:!1,testedFrom:null})),[]),{loading:e.loading,testedFrom:e.testedFrom,mark:async e=>{if(e.trim()){n({loading:!1,testedFrom:e});try{await(0,l.setDoc)((0,l.doc)(t.ka,f,p),{testedFrom:e},{merge:!0})}catch(e){console.error(`Could not remember the test send`,e)}}}}}var g=e=>[{title:`Hear about what happens`,body:`A booking, a form entry, a new member — at your address the moment it happens.`,icon:r.hn,where:{path:`/pages`,label:`Pages screen`}},{title:`Confirm to the people who write in`,body:`Whoever books or writes gets a note that it arrived, in your words.`,icon:r.ft,where:{path:`/pages`,label:`Pages screen`}},{title:`Receipts and sale alerts`,body:`Every payment emails the buyer a receipt and tells you something sold.`,icon:r.H,where:{path:`/payments`,label:`Payments screen`}},{title:`Write to anyone from your app`,body:`A page for your team can write to any address, from ${e}.`,icon:r.P,where:{path:`/pages`,label:`Pages screen`}}],_=e=>String(e||``).toLowerCase().endsWith(`@resend.dev`),v=e=>String(e||``).split(`@`)[1]||``,y=e=>e?{description:`Every page you told to send email does. Switch it off to stop all of it at once.`,chip:{state:`saved`,label:`On`}}:{description:`Nothing sends. Your pages keep their settings and wait for this to come back on.`,chip:{state:`off`,label:`Off`}};function b({from:e}){return(0,c.jsx)(`div`,{className:`flex flex-col divide-y divide-[var(--panel-border)]/60 rounded-2xl border border-[var(--panel-border)]/60`,children:g(e).map(e=>{let t=e.icon;return(0,c.jsxs)(`div`,{className:`grid grid-cols-[auto_minmax(0,1fr)] sm:grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-x-3 sm:gap-x-3.5 gap-y-0.5 px-4 py-3`,children:[(0,c.jsx)(`div`,{className:`row-start-1 row-span-2 col-start-1 self-center w-9 h-9 rounded-xl flex items-center justify-center shrink-0 border border-[var(--panel-border)]/50 bg-accent/10 text-accent`,children:(0,c.jsx)(t,{className:`w-4 h-4`})}),(0,c.jsx)(`span`,{className:`row-start-1 col-start-2 min-w-0 text-[13px] font-bold text-foreground leading-tight self-end`,children:e.title}),(0,c.jsx)(`span`,{className:`row-start-2 col-start-2 min-w-0 text-[12px] text-foreground/50 font-normal leading-snug self-start`,children:e.body}),(0,c.jsxs)(u.Link,{to:e.where.path,className:`max-sm:hidden sm:inline-flex row-start-1 row-span-2 col-start-3 self-center justify-self-end items-center gap-1.5 text-[11.5px] font-semibold text-foreground/45 hover:text-accent whitespace-nowrap transition-colors`,children:[e.where.label,(0,c.jsx)(r.yn,{className:`w-3 h-3`})]})]},e.title)})})}function x({adminCount:e,onSetUp:n}){return(0,c.jsxs)(`div`,{className:`flex items-center gap-2.5 px-1 flex-wrap`,children:[(0,c.jsx)(t.v,{state:e?`saved`:`off`,label:e?`Your mail reaches ${e} address${e===1?``:`es`}`:`No address for your mail`}),!e&&(0,c.jsxs)(`span`,{className:`text-[11px] sm:text-[11.5px] text-foreground/40 font-medium leading-snug`,children:[`Sale, booking and form alerts have nowhere to go —`,` `,(0,c.jsx)(t.d,{onClick:n,children:`add VITE_ADMIN_EMAILS`}),`.`]})]})}function S(){let{status:l,error:u,reread:f}=a.t(),p=a.a(`email`),[g,S]=(0,s.useState)(``),C=h(),[w,T]=(0,s.useState)(!1),[E,D]=(0,s.useState)(!1),O=()=>{T(!1),f().then(()=>D(!0))},k=!!(l&&!l.configured),A=_(l?.from),j=y(p.on),M=!C.loading&&m(C.testedFrom,l?.from);return(0,c.jsxs)(`main`,{className:`flex-1 w-full max-w-7xl mx-auto p-4 pt-2 md:p-8 md:pt-4 z-10 flex flex-col min-h-screen`,children:[(0,c.jsxs)(t.sr.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:`mb-6`,children:[(0,c.jsx)(e.t,{children:`Email`}),(0,c.jsxs)(`div`,{className:`flex items-center gap-2 text-foreground/40 font-bold uppercase tracking-[0.2em] text-[11px]`,children:[(0,c.jsx)(`span`,{className:`w-8 h-[1px] bg-foreground/10`}),`/email`]})]}),(0,c.jsxs)(`div`,{className:`flex flex-col gap-6 flex-1 pb-16`,children:[(0,c.jsx)(n.t,{}),(0,c.jsx)(`div`,{className:`glass-panel border border-[var(--panel-border)] rounded-3xl p-4 sm:p-5 md:p-8 shadow-2xl relative bg-background flex flex-col fbos-tab-fill min-h-[600px]`,children:!l&&!u?(0,c.jsx)(`div`,{className:`flex items-center justify-center flex-1 text-foreground/40 py-16`,children:(0,c.jsx)(r.ht,{className:`w-6 h-6 animate-spin text-accent`})}):k?(0,c.jsx)(o.ConnectCard,{icon:r.lt,title:`Connect email`,description:`This app is not sending email yet.`,stepsDescription:`Three steps — a key, two secrets, and the domain your mail goes out as.`,button:`Set up email`,secret:`RESEND_API_KEY`,open:w,onOpen:()=>T(!0),confirmed:E,steps:(0,c.jsx)(o.EmailSetupSteps,{onConfirm:O}),children:(0,c.jsx)(t.g,{children:`Email runs through Resend, and connecting it is two pasted rows — a key, and your own address for the mail that is meant for you. Once they are in, this screen fills itself: what your app can do with email, and where it goes.`})}):(0,c.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,c.jsx)(t.y,{icon:r.W,title:`Send email`,description:j.description,chip:j.chip,enabled:p.loading?null:p.on,onChange:async e=>S(await p.set(e)||``),children:g?(0,c.jsx)(t.g,{tone:`error`,children:g}):null}),(0,c.jsx)(t.h,{icon:r.ft,title:`Connection`,description:M&&!u?`Mail goes out as ${l?.from}.`:`Whether this app can send email right now.`,defaultOpen:!M||!l?.adminCount,actions:u?(0,c.jsx)(t.v,{state:`error`,label:`Unreachable`}):(0,c.jsx)(t.v,{state:`saved`,label:`Connected`}),children:u?(0,c.jsx)(t.g,{tone:`error`,children:u}):(0,c.jsxs)(c.Fragment,{children:[!M&&(0,c.jsxs)(t.g,{children:[`Mail goes out as `,(0,c.jsx)(`span`,{className:`font-bold text-foreground/70`,children:l?.from}),`.`,A?` That is Resend’s shared practice address: it delivers only to the address you made your Resend account with, so a test to yourself works and a customer’s email does not arrive. Before anyone else should get one, verify your own domain in Resend and add EMAIL_FROM — `:` That only works if ${v(l?.from)} is verified under Domains in your Resend account — an unverified domain makes every send fail. Every send also appears in your Resend dashboard, with nothing to sync.`,A&&(0,c.jsx)(t.d,{onClick:()=>T(!0),children:`show me how`}),A&&`.`]}),(0,c.jsx)(x,{adminCount:l?.adminCount||0,onSetUp:()=>T(!0)}),w&&(0,c.jsx)(`div`,{className:`px-1 pt-1`,children:(0,c.jsx)(o.EmailSetupSteps,{onConfirm:O})}),!M&&(0,c.jsx)(`div`,{className:`px-1`,children:(0,c.jsx)(d,{onSent:e=>C.mark(e||l?.from||``),trailing:(0,c.jsxs)(`a`,{href:`https://resend.com/emails`,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1.5 text-[12px] font-bold text-accent hover:underline`,children:[`See everything sent, in Resend`,(0,c.jsx)(r.Ht,{className:`w-3 h-3`})]})})})]})}),(0,c.jsx)(t.h,{icon:r.O,title:`What you can do with email`,description:`Each is switched on where it happens — a page on the Pages screen, a payment on the Payments screen.`,children:(0,c.jsx)(b,{from:l?.from||``})})]})})]}),(0,c.jsx)(i.t,{})]})}exports.EmailAdmin=S;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk-CiTBaPhY.cjs`),require(`./PageTitle-CZhgmmDT.cjs`);const e=require(`./TimeZoneField-qs7NPR30.cjs`);let t=require(`react/jsx-runtime`);var n=(t,n=`host`)=>t.heldOnly?`Held time`:n===`booker`?t.scheduleName.trim()||`A meeting`:e.jt(t),r=(e,t=`host`)=>e.heldOnly?`Held with no booking behind it`:e.own?`Your own event`:t===`booker`?e.memberName.trim()?`With ${e.memberName.trim()}`:`Booked`:e.scheduleName||e.email||`Booked`,i=(t,r=`host`)=>r===`booker`&&!t.heldOnly?e.mt(t):n(t,r),a=e=>!e.pending||e.cancelled||e.own||e.heldOnly?``:e.partySize>1?`${e.partyAccepted} of ${e.partySize}`:`Pending`;function o({value:n,onChange:r}){return(0,t.jsx)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:e.B.map(i=>{let a=i.value===n;return(0,t.jsx)(`button`,{type:`button`,title:i.label,"aria-label":i.label,"aria-pressed":a,onClick:()=>r(i.value),className:`w-8 h-8 rounded-full transition-all cursor-pointer active:scale-95 flex items-center justify-center ${i.value?`border-2`:`border-2 border-dashed`} ${a?`scale-105`:`hover:scale-105`}`,style:{background:e.Mt(i.value,a?55:30),borderColor:a?e.At(i.value):e.Mt(i.value,40)},children:a&&(0,t.jsx)(`span`,{className:`w-2 h-2 rounded-full`,style:{background:e.At(i.value)}})},i.value||`theme`)})})}function s({className:e=``}){return(0,t.jsx)(`span`,{className:`inline-flex items-center h-[18px] px-1.5 rounded-md shrink-0 border border-red-500/25 bg-red-500/10 text-[10px] font-bold uppercase tracking-[0.08em] text-red-500/90 ${e}`,children:`Cancelled`})}function c({label:e=`Pending`,className:n=``}){return(0,t.jsx)(`span`,{title:`Waiting to be accepted`,className:`inline-flex items-center h-[18px] px-1.5 rounded-md shrink-0 border border-amber-500/25 bg-amber-500/10 text-[10px] font-bold uppercase tracking-[0.08em] text-amber-600 dark:text-amber-400 ${n}`,children:e})}function l({className:e=``}){return(0,t.jsx)(`span`,{title:`Held with nothing booked`,className:`inline-flex items-center h-[18px] px-1.5 rounded-md shrink-0 border border-[var(--panel-border)] bg-foreground/[0.04] text-[10px] font-bold uppercase tracking-[0.08em] text-foreground/45 ${e}`,children:`Held`})}function u({booking:i,zone:o,chip:u,withMember:d=!1,side:f=`host`,onOpen:p,now:m}){let h=i.end<(m?m():new Date).toISOString(),g=i.cancelled,_=a(i),v=i.color;return(0,t.jsxs)(`button`,{type:`button`,onClick:p,"aria-label":`${e.Pt(new Date(i.start),o)} — ${n(i,f)}${g?` (cancelled)`:``}`,className:`group relative w-full text-left rounded-2xl border overflow-hidden flex items-stretch gap-2.5 p-2.5 transition-all cursor-pointer active:scale-[0.99] ${h&&!g?`opacity-60`:``} ${g||i.heldOnly?`border-dashed border-[var(--panel-border)]/60 bg-foreground/[0.02]`:``}`,style:g||i.heldOnly?void 0:{background:e.Mt(v,7),borderColor:e.Mt(v,26)},children:[(0,t.jsx)(`span`,{"aria-hidden":!0,className:`w-1 rounded-full shrink-0 ${g||i.heldOnly?`bg-foreground/15`:``}`,style:g||i.heldOnly?void 0:{background:e.Mt(v,85)}}),(0,t.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-0 bg-foreground/0 group-hover:bg-foreground/[0.04] transition-colors`}),(0,t.jsxs)(`span`,{className:`relative flex-1 min-w-0 flex flex-col gap-0.5 py-0.5`,children:[(0,t.jsxs)(`span`,{className:`flex items-baseline gap-2 min-w-0`,children:[(0,t.jsx)(`span`,{className:`text-[12.5px] font-bold tabular-nums shrink-0 ${g?`text-foreground/45 line-through`:`text-foreground`}`,children:e.Pt(new Date(i.start),o)}),(0,t.jsx)(`span`,{className:`text-[12.5px] font-semibold truncate ${g?`text-foreground/45 line-through`:`text-foreground/80`}`,children:n(i,f)})]}),(0,t.jsxs)(`span`,{className:`flex items-center justify-between gap-2 min-w-0`,children:[(0,t.jsx)(`span`,{className:`text-[11.5px] font-medium text-foreground/45 truncate`,children:d&&i.memberName?`${i.memberName} · ${r(i,f)}`:r(i,f)}),g?(0,t.jsx)(s,{}):i.heldOnly?(0,t.jsx)(l,{}):_?(0,t.jsx)(c,{label:_}):u&&(0,t.jsx)(e.v,{state:u.state,label:u.label})]})]})]})}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return s}});
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import "./PageTitle-D93YCiN8.js";
|
|
2
|
+
import { At as e, B as t, Mt as n, Pt as r, jt as i, mt as a, v as o } from "./TimeZoneField-DkI1Bkcz.js";
|
|
3
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/schedule/EventCard.tsx
|
|
5
|
+
var l = (e, t = "host") => e.heldOnly ? "Held time" : t === "booker" ? e.scheduleName.trim() || "A meeting" : i(e), u = (e, t = "host") => e.heldOnly ? "Held with no booking behind it" : e.own ? "Your own event" : t === "booker" ? e.memberName.trim() ? `With ${e.memberName.trim()}` : "Booked" : e.scheduleName || e.email || "Booked", d = (e, t = "host") => t === "booker" && !e.heldOnly ? a(e) : l(e, t), f = (e) => !e.pending || e.cancelled || e.own || e.heldOnly ? "" : e.partySize > 1 ? `${e.partyAccepted} of ${e.partySize}` : "Pending";
|
|
6
|
+
function p({ value: r, onChange: i }) {
|
|
7
|
+
return /* @__PURE__ */ s("div", {
|
|
8
|
+
className: "flex items-center gap-2 flex-wrap",
|
|
9
|
+
children: t.map((t) => {
|
|
10
|
+
let a = t.value === r;
|
|
11
|
+
return /* @__PURE__ */ s("button", {
|
|
12
|
+
type: "button",
|
|
13
|
+
title: t.label,
|
|
14
|
+
"aria-label": t.label,
|
|
15
|
+
"aria-pressed": a,
|
|
16
|
+
onClick: () => i(t.value),
|
|
17
|
+
className: `w-8 h-8 rounded-full transition-all cursor-pointer active:scale-95 flex items-center justify-center ${t.value ? "border-2" : "border-2 border-dashed"} ${a ? "scale-105" : "hover:scale-105"}`,
|
|
18
|
+
style: {
|
|
19
|
+
background: n(t.value, a ? 55 : 30),
|
|
20
|
+
borderColor: a ? e(t.value) : n(t.value, 40)
|
|
21
|
+
},
|
|
22
|
+
children: a && /* @__PURE__ */ s("span", {
|
|
23
|
+
className: "w-2 h-2 rounded-full",
|
|
24
|
+
style: { background: e(t.value) }
|
|
25
|
+
})
|
|
26
|
+
}, t.value || "theme");
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function m({ className: e = "" }) {
|
|
31
|
+
return /* @__PURE__ */ s("span", {
|
|
32
|
+
className: `inline-flex items-center h-[18px] px-1.5 rounded-md shrink-0 border border-red-500/25 bg-red-500/10 text-[10px] font-bold uppercase tracking-[0.08em] text-red-500/90 ${e}`,
|
|
33
|
+
children: "Cancelled"
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function h({ label: e = "Pending", className: t = "" }) {
|
|
37
|
+
return /* @__PURE__ */ s("span", {
|
|
38
|
+
title: "Waiting to be accepted",
|
|
39
|
+
className: `inline-flex items-center h-[18px] px-1.5 rounded-md shrink-0 border border-amber-500/25 bg-amber-500/10 text-[10px] font-bold uppercase tracking-[0.08em] text-amber-600 dark:text-amber-400 ${t}`,
|
|
40
|
+
children: e
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function g({ className: e = "" }) {
|
|
44
|
+
return /* @__PURE__ */ s("span", {
|
|
45
|
+
title: "Held with nothing booked",
|
|
46
|
+
className: `inline-flex items-center h-[18px] px-1.5 rounded-md shrink-0 border border-[var(--panel-border)] bg-foreground/[0.04] text-[10px] font-bold uppercase tracking-[0.08em] text-foreground/45 ${e}`,
|
|
47
|
+
children: "Held"
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function _({ booking: e, zone: t, chip: i, withMember: a = !1, side: d = "host", onOpen: p, now: _ }) {
|
|
51
|
+
let v = e.end < (_ ? _() : /* @__PURE__ */ new Date()).toISOString(), y = e.cancelled, b = f(e), x = e.color;
|
|
52
|
+
return /* @__PURE__ */ c("button", {
|
|
53
|
+
type: "button",
|
|
54
|
+
onClick: p,
|
|
55
|
+
"aria-label": `${r(new Date(e.start), t)} — ${l(e, d)}${y ? " (cancelled)" : ""}`,
|
|
56
|
+
className: `group relative w-full text-left rounded-2xl border overflow-hidden flex items-stretch gap-2.5 p-2.5 transition-all cursor-pointer active:scale-[0.99] ${v && !y ? "opacity-60" : ""} ${y || e.heldOnly ? "border-dashed border-[var(--panel-border)]/60 bg-foreground/[0.02]" : ""}`,
|
|
57
|
+
style: y || e.heldOnly ? void 0 : {
|
|
58
|
+
background: n(x, 7),
|
|
59
|
+
borderColor: n(x, 26)
|
|
60
|
+
},
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ s("span", {
|
|
63
|
+
"aria-hidden": !0,
|
|
64
|
+
className: `w-1 rounded-full shrink-0 ${y || e.heldOnly ? "bg-foreground/15" : ""}`,
|
|
65
|
+
style: y || e.heldOnly ? void 0 : { background: n(x, 85) }
|
|
66
|
+
}),
|
|
67
|
+
/* @__PURE__ */ s("span", {
|
|
68
|
+
"aria-hidden": !0,
|
|
69
|
+
className: "absolute inset-0 bg-foreground/0 group-hover:bg-foreground/[0.04] transition-colors"
|
|
70
|
+
}),
|
|
71
|
+
/* @__PURE__ */ c("span", {
|
|
72
|
+
className: "relative flex-1 min-w-0 flex flex-col gap-0.5 py-0.5",
|
|
73
|
+
children: [/* @__PURE__ */ c("span", {
|
|
74
|
+
className: "flex items-baseline gap-2 min-w-0",
|
|
75
|
+
children: [/* @__PURE__ */ s("span", {
|
|
76
|
+
className: `text-[12.5px] font-bold tabular-nums shrink-0 ${y ? "text-foreground/45 line-through" : "text-foreground"}`,
|
|
77
|
+
children: r(new Date(e.start), t)
|
|
78
|
+
}), /* @__PURE__ */ s("span", {
|
|
79
|
+
className: `text-[12.5px] font-semibold truncate ${y ? "text-foreground/45 line-through" : "text-foreground/80"}`,
|
|
80
|
+
children: l(e, d)
|
|
81
|
+
})]
|
|
82
|
+
}), /* @__PURE__ */ c("span", {
|
|
83
|
+
className: "flex items-center justify-between gap-2 min-w-0",
|
|
84
|
+
children: [/* @__PURE__ */ s("span", {
|
|
85
|
+
className: "text-[11.5px] font-medium text-foreground/45 truncate",
|
|
86
|
+
children: a && e.memberName ? `${e.memberName} · ${u(e, d)}` : u(e, d)
|
|
87
|
+
}), y ? /* @__PURE__ */ s(m, {}) : e.heldOnly ? /* @__PURE__ */ s(g, {}) : b ? /* @__PURE__ */ s(h, { label: b }) : i && /* @__PURE__ */ s(o, {
|
|
88
|
+
state: i.state,
|
|
89
|
+
label: i.label
|
|
90
|
+
})]
|
|
91
|
+
})]
|
|
92
|
+
})
|
|
93
|
+
]
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
export { l as a, h as i, p as n, d as o, _ as r, f as s, m as t };
|