your-ai-workflow-firebase-os 2.0.1 → 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-R-HvndkG.js → AddressField-9Sqn8TvC.js} +3 -3
- package/dist/{AddressField-BkzFOo2t.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-BlYHb5e0.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-9J_YeJrb.js → TimeZoneField-DkI1Bkcz.js} +3382 -5513
- 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-D0gLVNTL.cjs → bake-n2wyFw0B.cjs} +1 -1
- package/dist/{bake-OErV2MLy.js → bake-naZeMu98.js} +14 -14
- 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/{dist-_zWHDDrc.js → dist-DUPvBnOA.js} +1 -1
- package/dist/email-BfnZnMwD.cjs +1 -0
- package/dist/email-Ddj8Dlu6.js +58 -0
- package/dist/{fileBytes-B0qxHYQL.cjs → fileBytes-BJPaiX9Y.cjs} +1 -1
- package/dist/{fileBytes-uhq3pGCS.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/pageDesignLines.d.ts +1 -1
- package/dist/lib/paymentProducts.d.ts +8 -0
- package/dist/lib/payments.d.ts +11 -1
- package/dist/lib/people.d.ts +9 -0
- package/dist/lib/recordsKey.d.ts +24 -0
- package/dist/{lucide-react-DiyP8FA_.js → lucide-react-CA7GD7Nv.js} +8 -8
- 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 -7
- package/dist/{pdf-DLuvpvHg.js → pdf-DRXcPGkr.js} +1 -1
- package/dist/{pdf.worker.min-C0gkd2Ec.js → pdf.worker.min-CfKZezeM.js} +1 -1
- 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 +11695 -35911
- package/package.json +1 -1
- package/src/index.css +122 -2
- package/dist/ContactPopup-DF8qQCoY.cjs +0 -12
- package/dist/PhoneInputField-Btx07xvM.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-BLGlDv1e.cjs → dist-E4jTFPs7.cjs} +0 -0
- /package/dist/{lucide-react-BYniZ3lQ.cjs → lucide-react-BwV6L6Is.cjs} +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-CC5g01eC.cjs → pdf-jLjjhvjp.cjs} +0 -0
- /package/dist/{pdf.worker.min-pI_P-OCl.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,411 @@
|
|
|
1
|
+
import "./PageTitle-D93YCiN8.js";
|
|
2
|
+
import { g as e, h as t, n, o as r, s as i, v as a } from "./TimeZoneField-DkI1Bkcz.js";
|
|
3
|
+
import { sn as o, yn as s } from "./lucide-react-CA7GD7Nv.js";
|
|
4
|
+
import { a as c, n as l } from "./Setup-CHLgd-ag.js";
|
|
5
|
+
import { t as u } from "./SupportBar-CN_JGC-9.js";
|
|
6
|
+
import { r as d, t as f } from "./serviceStatus-vS8AI7SZ.js";
|
|
7
|
+
import "react";
|
|
8
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
9
|
+
import { Navigate as g } from "react-router-dom";
|
|
10
|
+
//#region src/pages/SetupPayments.tsx
|
|
11
|
+
var _ = {
|
|
12
|
+
configured: !1,
|
|
13
|
+
mode: null,
|
|
14
|
+
webhookConfigured: !1
|
|
15
|
+
};
|
|
16
|
+
function v(e = 5e3) {
|
|
17
|
+
let { status: t, error: n } = d(e);
|
|
18
|
+
return {
|
|
19
|
+
...t ?? _,
|
|
20
|
+
checked: t !== null || !!n
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function y(e, t) {
|
|
24
|
+
if (!t.checked) return {
|
|
25
|
+
state: "saving",
|
|
26
|
+
label: "Checking"
|
|
27
|
+
};
|
|
28
|
+
switch (e) {
|
|
29
|
+
case 1:
|
|
30
|
+
case 2: return t.configured ? {
|
|
31
|
+
state: "saved",
|
|
32
|
+
label: "Done"
|
|
33
|
+
} : {
|
|
34
|
+
state: "off",
|
|
35
|
+
label: "Not yet"
|
|
36
|
+
};
|
|
37
|
+
case 3: return t.configured ? {
|
|
38
|
+
state: "saved",
|
|
39
|
+
label: t.mode === "live" ? "Key found — live" : "Key found — test mode"
|
|
40
|
+
} : {
|
|
41
|
+
state: "off",
|
|
42
|
+
label: "No key yet"
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
var b = {
|
|
47
|
+
configured: !1,
|
|
48
|
+
from: null,
|
|
49
|
+
adminCount: 0
|
|
50
|
+
};
|
|
51
|
+
function x(e = 5e3) {
|
|
52
|
+
let { status: t, error: n } = f(e);
|
|
53
|
+
return {
|
|
54
|
+
...t ?? b,
|
|
55
|
+
checked: t !== null || !!n
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function S(e) {
|
|
59
|
+
return e.checked ? e.configured ? {
|
|
60
|
+
state: "saved",
|
|
61
|
+
label: "Connected"
|
|
62
|
+
} : {
|
|
63
|
+
state: "off",
|
|
64
|
+
label: "Not yet"
|
|
65
|
+
} : {
|
|
66
|
+
state: "saving",
|
|
67
|
+
label: "Checking"
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function C(e) {
|
|
71
|
+
return e.checked ? e.from && !String(e.from).toLowerCase().endsWith("@resend.dev") ? {
|
|
72
|
+
state: "saved",
|
|
73
|
+
label: "Your own address"
|
|
74
|
+
} : {
|
|
75
|
+
state: "off",
|
|
76
|
+
label: "Practice address"
|
|
77
|
+
} : {
|
|
78
|
+
state: "saving",
|
|
79
|
+
label: "Checking"
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
var w = "text-accent underline underline-offset-2 font-semibold hover:text-accent-deep transition-colors";
|
|
83
|
+
function T({ href: e, children: t }) {
|
|
84
|
+
return /* @__PURE__ */ m("a", {
|
|
85
|
+
href: e,
|
|
86
|
+
target: "_blank",
|
|
87
|
+
rel: "noopener noreferrer",
|
|
88
|
+
className: w,
|
|
89
|
+
children: t
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
function E({ number: e, title: t, aside: n, children: r }) {
|
|
93
|
+
return /* @__PURE__ */ h("div", {
|
|
94
|
+
className: "flex flex-col gap-3 pb-5 mb-5 border-b border-[var(--panel-border)]/50 last:border-0 last:pb-0 last:mb-0",
|
|
95
|
+
children: [/* @__PURE__ */ h("div", {
|
|
96
|
+
className: "flex items-center gap-2.5",
|
|
97
|
+
children: [
|
|
98
|
+
/* @__PURE__ */ m("span", {
|
|
99
|
+
className: "w-7 h-7 shrink-0 rounded-full bg-accent/10 border border-accent/20 text-accent flex items-center justify-center text-[12.5px] font-extrabold",
|
|
100
|
+
children: e
|
|
101
|
+
}),
|
|
102
|
+
/* @__PURE__ */ m("h4", {
|
|
103
|
+
className: "text-[14px] font-bold text-foreground tracking-tight flex-1 min-w-0",
|
|
104
|
+
children: t
|
|
105
|
+
}),
|
|
106
|
+
n
|
|
107
|
+
]
|
|
108
|
+
}), /* @__PURE__ */ m("div", {
|
|
109
|
+
className: "text-[13px] text-foreground/70 leading-relaxed space-y-3 sm:pl-[2.375rem]",
|
|
110
|
+
children: r
|
|
111
|
+
})]
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
var D = "space-y-1.5 list-decimal list-inside text-foreground/75", O = "glass-panel border border-[var(--panel-border)] rounded-2xl overflow-hidden bg-background";
|
|
115
|
+
function k({ onConfirm: e, hint: t, label: n }) {
|
|
116
|
+
let [a] = c();
|
|
117
|
+
return /* @__PURE__ */ h("div", {
|
|
118
|
+
className: "flex flex-col gap-2 pt-1",
|
|
119
|
+
children: [/* @__PURE__ */ m(r, {
|
|
120
|
+
icon: o,
|
|
121
|
+
onClick: e,
|
|
122
|
+
className: "self-start",
|
|
123
|
+
children: n || "I have added the variables"
|
|
124
|
+
}), /* @__PURE__ */ m("p", {
|
|
125
|
+
className: i,
|
|
126
|
+
children: t || (a === "local" ? "Start the app again first — a value added to .env while it is running is not read until then. If the chips have not turned green a minute later, reload this page." : "Press Apply in AI Studio’s Secrets tab first — the app can only read a secret once it has been applied. If the chips have not turned green a minute later, reload this page.")
|
|
127
|
+
})]
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
function A({ icon: n, title: r, description: i, stepsDescription: a, button: o, secret: l, open: d, onOpen: f, confirmed: g, steps: _, children: v }) {
|
|
131
|
+
let [y] = c();
|
|
132
|
+
return /* @__PURE__ */ h(t, {
|
|
133
|
+
icon: n,
|
|
134
|
+
title: r,
|
|
135
|
+
description: d ? a : i,
|
|
136
|
+
collapsible: !1,
|
|
137
|
+
children: [(d || g) && /* @__PURE__ */ m(u, {}), d ? _ : /* @__PURE__ */ h(p, { children: [
|
|
138
|
+
v,
|
|
139
|
+
g && /* @__PURE__ */ h(e, {
|
|
140
|
+
tone: "error",
|
|
141
|
+
children: [
|
|
142
|
+
"The app cannot see the key yet.",
|
|
143
|
+
" ",
|
|
144
|
+
y === "local" ? /* @__PURE__ */ h(p, { children: [
|
|
145
|
+
"Make sure ",
|
|
146
|
+
l,
|
|
147
|
+
" has a value in your .env file, start the app again, then reload this page"
|
|
148
|
+
] }) : /* @__PURE__ */ h(p, { children: [
|
|
149
|
+
"In AI Studio’s Secrets tab make sure ",
|
|
150
|
+
l,
|
|
151
|
+
" is there and press Apply, then reload this page"
|
|
152
|
+
] }),
|
|
153
|
+
" ",
|
|
154
|
+
"— or open the steps again to check them."
|
|
155
|
+
]
|
|
156
|
+
}),
|
|
157
|
+
/* @__PURE__ */ h("button", {
|
|
158
|
+
type: "button",
|
|
159
|
+
onClick: f,
|
|
160
|
+
className: "inline-flex items-center gap-1.5 w-fit h-9 px-4 rounded-[var(--btn-radius,0.75rem)] text-[12.5px] font-bold border border-accent/40 bg-accent/10 text-accent hover:bg-accent/15 transition-all active:scale-[0.98] cursor-pointer",
|
|
161
|
+
children: [o, /* @__PURE__ */ m(s, { className: "w-3.5 h-3.5" })]
|
|
162
|
+
})
|
|
163
|
+
] })]
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
function j({ onConfirm: e }) {
|
|
167
|
+
let t = v(), [r] = c(), i = r === "local";
|
|
168
|
+
return /* @__PURE__ */ h("div", {
|
|
169
|
+
className: "flex flex-col",
|
|
170
|
+
children: [
|
|
171
|
+
/* @__PURE__ */ m(E, {
|
|
172
|
+
number: 1,
|
|
173
|
+
title: "Make a Stripe account",
|
|
174
|
+
aside: /* @__PURE__ */ m(a, { ...y(1, t) }),
|
|
175
|
+
children: /* @__PURE__ */ h("ol", {
|
|
176
|
+
className: D,
|
|
177
|
+
children: [/* @__PURE__ */ h("li", { children: [
|
|
178
|
+
"Open ",
|
|
179
|
+
/* @__PURE__ */ m(T, {
|
|
180
|
+
href: "https://dashboard.stripe.com",
|
|
181
|
+
children: "dashboard.stripe.com"
|
|
182
|
+
}),
|
|
183
|
+
" and create an account. It asks about your business — answer what you can and skip what you can't; none of it blocks the next steps."
|
|
184
|
+
] }), /* @__PURE__ */ h("li", { children: [
|
|
185
|
+
"Click your account name in the ",
|
|
186
|
+
/* @__PURE__ */ m("strong", { children: "top left" }),
|
|
187
|
+
" corner, choose",
|
|
188
|
+
" ",
|
|
189
|
+
/* @__PURE__ */ m("strong", { children: "Switch to sandbox" }),
|
|
190
|
+
", and make a sandbox for testing. A sandbox is a practice copy of Stripe: every card in it is pretend and every payment is practice, so nothing you do here can cost anyone real money."
|
|
191
|
+
] })]
|
|
192
|
+
})
|
|
193
|
+
}),
|
|
194
|
+
/* @__PURE__ */ m(E, {
|
|
195
|
+
number: 2,
|
|
196
|
+
title: "Copy the test secret key",
|
|
197
|
+
aside: /* @__PURE__ */ m(a, { ...y(2, t) }),
|
|
198
|
+
children: /* @__PURE__ */ h("ol", {
|
|
199
|
+
className: D,
|
|
200
|
+
children: [/* @__PURE__ */ h("li", { children: [
|
|
201
|
+
"Along the very bottom of the Stripe page is a dark bar that says ",
|
|
202
|
+
/* @__PURE__ */ m("strong", { children: "Developers" }),
|
|
203
|
+
". Click the arrow on it to unfold the panel."
|
|
204
|
+
] }), /* @__PURE__ */ h("li", { children: [
|
|
205
|
+
"On the right of that panel, under ",
|
|
206
|
+
/* @__PURE__ */ m("strong", { children: "Testing tools" }),
|
|
207
|
+
", is your",
|
|
208
|
+
" ",
|
|
209
|
+
/* @__PURE__ */ m("strong", { children: "secret key" }),
|
|
210
|
+
" — it starts with ",
|
|
211
|
+
/* @__PURE__ */ m("strong", { children: "sk_test_" }),
|
|
212
|
+
". Copy it."
|
|
213
|
+
] })]
|
|
214
|
+
})
|
|
215
|
+
}),
|
|
216
|
+
/* @__PURE__ */ h(E, {
|
|
217
|
+
number: 3,
|
|
218
|
+
title: i ? "Put it in your .env and start the app again" : "Paste it into Secrets and press Apply",
|
|
219
|
+
aside: /* @__PURE__ */ m(a, { ...y(3, t) }),
|
|
220
|
+
children: [
|
|
221
|
+
i ? /* @__PURE__ */ h("p", { children: [
|
|
222
|
+
"Open your ",
|
|
223
|
+
/* @__PURE__ */ m("strong", { children: ".env" }),
|
|
224
|
+
" file — or ask your assistant to. The line below is already in it: paste the sk_test_… key between its quotes. One line, and that is the whole step — then ",
|
|
225
|
+
/* @__PURE__ */ m("strong", { children: "start the app again" }),
|
|
226
|
+
" so it is read."
|
|
227
|
+
] }) : /* @__PURE__ */ h("ol", {
|
|
228
|
+
className: D,
|
|
229
|
+
children: [
|
|
230
|
+
/* @__PURE__ */ h("li", { children: [
|
|
231
|
+
"Click the ",
|
|
232
|
+
/* @__PURE__ */ m(n, {}),
|
|
233
|
+
" icon in the top right corner of your app in Google AI Studio."
|
|
234
|
+
] }),
|
|
235
|
+
/* @__PURE__ */ h("li", { children: [
|
|
236
|
+
"In the menu along the top, scroll across to ",
|
|
237
|
+
/* @__PURE__ */ m("strong", { children: "Secrets" }),
|
|
238
|
+
", then click",
|
|
239
|
+
" ",
|
|
240
|
+
/* @__PURE__ */ m("strong", { children: "+ Add secret" }),
|
|
241
|
+
"."
|
|
242
|
+
] }),
|
|
243
|
+
/* @__PURE__ */ h("li", { children: [
|
|
244
|
+
"Copy the name below into ",
|
|
245
|
+
/* @__PURE__ */ m("strong", { children: "Secret name" }),
|
|
246
|
+
", and paste the sk_test_… key you just copied as the value."
|
|
247
|
+
] }),
|
|
248
|
+
/* @__PURE__ */ h("li", { children: [
|
|
249
|
+
"Click ",
|
|
250
|
+
/* @__PURE__ */ m("strong", { children: "Apply" }),
|
|
251
|
+
", then refresh the page. You are all set."
|
|
252
|
+
] })
|
|
253
|
+
]
|
|
254
|
+
}),
|
|
255
|
+
/* @__PURE__ */ m("div", {
|
|
256
|
+
className: O,
|
|
257
|
+
children: /* @__PURE__ */ m(l, {
|
|
258
|
+
name: "STRIPE_SECRET_KEY",
|
|
259
|
+
hint: "the sk_test_… key you copied in step 2"
|
|
260
|
+
})
|
|
261
|
+
}),
|
|
262
|
+
/* @__PURE__ */ h("p", { children: [
|
|
263
|
+
"Now you can test a payment with the pretend card ",
|
|
264
|
+
/* @__PURE__ */ m("strong", { children: "4242 4242 4242 4242" }),
|
|
265
|
+
" and any other details you like, or by paying with Google Pay or Apple Pay. Nothing is ever charged — a sandbox is all practice."
|
|
266
|
+
] })
|
|
267
|
+
]
|
|
268
|
+
}),
|
|
269
|
+
/* @__PURE__ */ m(k, { onConfirm: e })
|
|
270
|
+
]
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
function M({ onConfirm: e }) {
|
|
274
|
+
let t = x(), [r] = c(), i = r === "local";
|
|
275
|
+
return /* @__PURE__ */ h("div", {
|
|
276
|
+
className: "flex flex-col",
|
|
277
|
+
children: [
|
|
278
|
+
/* @__PURE__ */ m(E, {
|
|
279
|
+
number: 1,
|
|
280
|
+
title: "Make a Resend account and a key",
|
|
281
|
+
aside: /* @__PURE__ */ m(a, { ...S(t) }),
|
|
282
|
+
children: /* @__PURE__ */ h("ol", {
|
|
283
|
+
className: D,
|
|
284
|
+
children: [/* @__PURE__ */ h("li", { children: [
|
|
285
|
+
"Open ",
|
|
286
|
+
/* @__PURE__ */ m(T, {
|
|
287
|
+
href: "https://resend.com",
|
|
288
|
+
children: "resend.com"
|
|
289
|
+
}),
|
|
290
|
+
" and create a free account — it is the service that delivers email for you. Sign up with the address you want your app's mail to reach you at."
|
|
291
|
+
] }), /* @__PURE__ */ h("li", { children: [
|
|
292
|
+
"In Resend, open ",
|
|
293
|
+
/* @__PURE__ */ m("strong", { children: "API Keys" }),
|
|
294
|
+
" and click ",
|
|
295
|
+
/* @__PURE__ */ m("strong", { children: "Create API key" }),
|
|
296
|
+
". Copy the key it shows — it starts with ",
|
|
297
|
+
/* @__PURE__ */ m("strong", { children: "re_" }),
|
|
298
|
+
" — and keep the tab open."
|
|
299
|
+
] })]
|
|
300
|
+
})
|
|
301
|
+
}),
|
|
302
|
+
/* @__PURE__ */ h(E, {
|
|
303
|
+
number: 2,
|
|
304
|
+
title: i ? "Put two values in your .env and start the app again" : "Paste two secrets and press Apply",
|
|
305
|
+
aside: /* @__PURE__ */ m(a, { ...S(t) }),
|
|
306
|
+
children: [i ? /* @__PURE__ */ h("p", { children: [
|
|
307
|
+
"Open your ",
|
|
308
|
+
/* @__PURE__ */ m("strong", { children: ".env" }),
|
|
309
|
+
" file. Both lines below are already in it — paste each value between its quotes, then ",
|
|
310
|
+
/* @__PURE__ */ m("strong", { children: "start the app again" }),
|
|
311
|
+
" so they are read."
|
|
312
|
+
] }) : /* @__PURE__ */ h("ol", {
|
|
313
|
+
className: D,
|
|
314
|
+
children: [
|
|
315
|
+
/* @__PURE__ */ h("li", { children: [
|
|
316
|
+
"Click the ",
|
|
317
|
+
/* @__PURE__ */ m(n, {}),
|
|
318
|
+
" icon in the top right corner of your app in Google AI Studio."
|
|
319
|
+
] }),
|
|
320
|
+
/* @__PURE__ */ h("li", { children: [
|
|
321
|
+
"In the menu along the top, scroll across to ",
|
|
322
|
+
/* @__PURE__ */ m("strong", { children: "Secrets" }),
|
|
323
|
+
"."
|
|
324
|
+
] }),
|
|
325
|
+
/* @__PURE__ */ h("li", { children: [
|
|
326
|
+
"For each row below, click ",
|
|
327
|
+
/* @__PURE__ */ m("strong", { children: "+ Add secret" }),
|
|
328
|
+
", copy the name here into",
|
|
329
|
+
" ",
|
|
330
|
+
/* @__PURE__ */ m("strong", { children: "Secret name" }),
|
|
331
|
+
", and paste the value."
|
|
332
|
+
] }),
|
|
333
|
+
/* @__PURE__ */ h("li", { children: [
|
|
334
|
+
"Click ",
|
|
335
|
+
/* @__PURE__ */ m("strong", { children: "Apply" }),
|
|
336
|
+
", then refresh the page."
|
|
337
|
+
] })
|
|
338
|
+
]
|
|
339
|
+
}), /* @__PURE__ */ h("div", {
|
|
340
|
+
className: O,
|
|
341
|
+
children: [/* @__PURE__ */ m(l, {
|
|
342
|
+
name: "RESEND_API_KEY",
|
|
343
|
+
hint: "the re_… key you just made in Resend"
|
|
344
|
+
}), /* @__PURE__ */ m(l, {
|
|
345
|
+
name: "VITE_ADMIN_EMAILS",
|
|
346
|
+
hint: "your own email address — where sale, booking and form alerts are sent"
|
|
347
|
+
})]
|
|
348
|
+
})]
|
|
349
|
+
}),
|
|
350
|
+
/* @__PURE__ */ h(E, {
|
|
351
|
+
number: 3,
|
|
352
|
+
title: "Verify your domain, or mail only reaches you",
|
|
353
|
+
aside: /* @__PURE__ */ m(a, { ...C(t) }),
|
|
354
|
+
children: [
|
|
355
|
+
/* @__PURE__ */ h("p", { children: [/* @__PURE__ */ m("strong", { children: "Until you verify a domain of your own, Resend delivers only to the email address you made your Resend account with." }), " A test email to yourself works; a customer's confirmation, a buyer's receipt, a booking note to someone else does not arrive at all. Do this before anyone but you should get an email."] }),
|
|
356
|
+
/* @__PURE__ */ h("ol", {
|
|
357
|
+
className: D,
|
|
358
|
+
children: [
|
|
359
|
+
/* @__PURE__ */ h("li", { children: [
|
|
360
|
+
"In Resend open ",
|
|
361
|
+
/* @__PURE__ */ m(T, {
|
|
362
|
+
href: "https://resend.com/domains",
|
|
363
|
+
children: "Domains"
|
|
364
|
+
}),
|
|
365
|
+
", click ",
|
|
366
|
+
/* @__PURE__ */ m("strong", { children: "Add domain" }),
|
|
367
|
+
" ",
|
|
368
|
+
"and type the domain you own — ",
|
|
369
|
+
/* @__PURE__ */ m("strong", { children: "yourbusiness.com" }),
|
|
370
|
+
", without www."
|
|
371
|
+
] }),
|
|
372
|
+
/* @__PURE__ */ m("li", { children: "Resend shows a few DNS records. Add each one where your domain is managed — the company you bought it from, or wherever its website is hosted — copying name and value exactly." }),
|
|
373
|
+
/* @__PURE__ */ h("li", { children: [
|
|
374
|
+
"Back in Resend, click ",
|
|
375
|
+
/* @__PURE__ */ m("strong", { children: "Verify" }),
|
|
376
|
+
". It can take a few minutes to turn green; if it does not, one record was copied wrong."
|
|
377
|
+
] }),
|
|
378
|
+
i ? /* @__PURE__ */ h("li", { children: [
|
|
379
|
+
"Fill in one more line in your ",
|
|
380
|
+
/* @__PURE__ */ m("strong", { children: ".env" }),
|
|
381
|
+
" — an address at that domain, which is what your mail goes out as — and ",
|
|
382
|
+
/* @__PURE__ */ m("strong", { children: "start the app again" }),
|
|
383
|
+
"."
|
|
384
|
+
] }) : /* @__PURE__ */ h("li", { children: [
|
|
385
|
+
"Add one more secret in AI Studio — an address at that domain, which is what your mail goes out as — and press ",
|
|
386
|
+
/* @__PURE__ */ m("strong", { children: "Apply" }),
|
|
387
|
+
" again."
|
|
388
|
+
] })
|
|
389
|
+
]
|
|
390
|
+
}),
|
|
391
|
+
/* @__PURE__ */ m("div", {
|
|
392
|
+
className: O,
|
|
393
|
+
children: /* @__PURE__ */ m(l, {
|
|
394
|
+
name: "EMAIL_FROM",
|
|
395
|
+
hint: "an address at your verified domain, like hello@yourbusiness.com"
|
|
396
|
+
})
|
|
397
|
+
})
|
|
398
|
+
]
|
|
399
|
+
}),
|
|
400
|
+
/* @__PURE__ */ m(k, { onConfirm: e })
|
|
401
|
+
]
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
function N() {
|
|
405
|
+
return /* @__PURE__ */ m(g, {
|
|
406
|
+
to: "/setup",
|
|
407
|
+
replace: !0
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
//#endregion
|
|
411
|
+
export { A as ConnectCard, M as EmailSetupSteps, N as SetupPayments, j as StripeSetupSteps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./chunk-CiTBaPhY.cjs`);require(`./PageTitle-CZhgmmDT.cjs`);const t=require(`./TimeZoneField-qs7NPR30.cjs`),n=require(`./lucide-react-BwV6L6Is.cjs`),r=require(`./Setup-CaDranTm.cjs`),i=require(`./SupportBar-CDT0HwdP.cjs`),a=require(`./serviceStatus-TQyZO_Y_.cjs`);let o=require(`react`);o=e.a(o,1);let s=require(`react/jsx-runtime`),c=require(`react-router-dom`);var l={configured:!1,mode:null,webhookConfigured:!1};function u(e=5e3){let{status:t,error:n}=a.r(e);return{...t??l,checked:t!==null||!!n}}function d(e,t){if(!t.checked)return{state:`saving`,label:`Checking`};switch(e){case 1:case 2:return t.configured?{state:`saved`,label:`Done`}:{state:`off`,label:`Not yet`};case 3:return t.configured?{state:`saved`,label:t.mode===`live`?`Key found — live`:`Key found — test mode`}:{state:`off`,label:`No key yet`}}}var f={configured:!1,from:null,adminCount:0};function p(e=5e3){let{status:t,error:n}=a.t(e);return{...t??f,checked:t!==null||!!n}}function m(e){return e.checked?e.configured?{state:`saved`,label:`Connected`}:{state:`off`,label:`Not yet`}:{state:`saving`,label:`Checking`}}function h(e){return e.checked?e.from&&!String(e.from).toLowerCase().endsWith(`@resend.dev`)?{state:`saved`,label:`Your own address`}:{state:`off`,label:`Practice address`}:{state:`saving`,label:`Checking`}}var g=`text-accent underline underline-offset-2 font-semibold hover:text-accent-deep transition-colors`;function _({href:e,children:t}){return(0,s.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,className:g,children:t})}function v({number:e,title:t,aside:n,children:r}){return(0,s.jsxs)(`div`,{className:`flex flex-col gap-3 pb-5 mb-5 border-b border-[var(--panel-border)]/50 last:border-0 last:pb-0 last:mb-0`,children:[(0,s.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,s.jsx)(`span`,{className:`w-7 h-7 shrink-0 rounded-full bg-accent/10 border border-accent/20 text-accent flex items-center justify-center text-[12.5px] font-extrabold`,children:e}),(0,s.jsx)(`h4`,{className:`text-[14px] font-bold text-foreground tracking-tight flex-1 min-w-0`,children:t}),n]}),(0,s.jsx)(`div`,{className:`text-[13px] text-foreground/70 leading-relaxed space-y-3 sm:pl-[2.375rem]`,children:r})]})}var y=`space-y-1.5 list-decimal list-inside text-foreground/75`,b=`glass-panel border border-[var(--panel-border)] rounded-2xl overflow-hidden bg-background`;function x({onConfirm:e,hint:i,label:a}){let[o]=r.a();return(0,s.jsxs)(`div`,{className:`flex flex-col gap-2 pt-1`,children:[(0,s.jsx)(t.o,{icon:n.sn,onClick:e,className:`self-start`,children:a||`I have added the variables`}),(0,s.jsx)(`p`,{className:t.s,children:i||(o===`local`?`Start the app again first — a value added to .env while it is running is not read until then. If the chips have not turned green a minute later, reload this page.`:`Press Apply in AI Studio’s Secrets tab first — the app can only read a secret once it has been applied. If the chips have not turned green a minute later, reload this page.`)})]})}function S({icon:e,title:a,description:o,stepsDescription:c,button:l,secret:u,open:d,onOpen:f,confirmed:p,steps:m,children:h}){let[g]=r.a();return(0,s.jsxs)(t.h,{icon:e,title:a,description:d?c:o,collapsible:!1,children:[(d||p)&&(0,s.jsx)(i.t,{}),d?m:(0,s.jsxs)(s.Fragment,{children:[h,p&&(0,s.jsxs)(t.g,{tone:`error`,children:[`The app cannot see the key yet.`,` `,g===`local`?(0,s.jsxs)(s.Fragment,{children:[`Make sure `,u,` has a value in your .env file, start the app again, then reload this page`]}):(0,s.jsxs)(s.Fragment,{children:[`In AI Studio’s Secrets tab make sure `,u,` is there and press Apply, then reload this page`]}),` `,`— or open the steps again to check them.`]}),(0,s.jsxs)(`button`,{type:`button`,onClick:f,className:`inline-flex items-center gap-1.5 w-fit h-9 px-4 rounded-[var(--btn-radius,0.75rem)] text-[12.5px] font-bold border border-accent/40 bg-accent/10 text-accent hover:bg-accent/15 transition-all active:scale-[0.98] cursor-pointer`,children:[l,(0,s.jsx)(n.yn,{className:`w-3.5 h-3.5`})]})]})]})}function C({onConfirm:e}){let n=u(),[i]=r.a(),a=i===`local`;return(0,s.jsxs)(`div`,{className:`flex flex-col`,children:[(0,s.jsx)(v,{number:1,title:`Make a Stripe account`,aside:(0,s.jsx)(t.v,{...d(1,n)}),children:(0,s.jsxs)(`ol`,{className:y,children:[(0,s.jsxs)(`li`,{children:[`Open `,(0,s.jsx)(_,{href:`https://dashboard.stripe.com`,children:`dashboard.stripe.com`}),` and create an account. It asks about your business — answer what you can and skip what you can't; none of it blocks the next steps.`]}),(0,s.jsxs)(`li`,{children:[`Click your account name in the `,(0,s.jsx)(`strong`,{children:`top left`}),` corner, choose`,` `,(0,s.jsx)(`strong`,{children:`Switch to sandbox`}),`, and make a sandbox for testing. A sandbox is a practice copy of Stripe: every card in it is pretend and every payment is practice, so nothing you do here can cost anyone real money.`]})]})}),(0,s.jsx)(v,{number:2,title:`Copy the test secret key`,aside:(0,s.jsx)(t.v,{...d(2,n)}),children:(0,s.jsxs)(`ol`,{className:y,children:[(0,s.jsxs)(`li`,{children:[`Along the very bottom of the Stripe page is a dark bar that says `,(0,s.jsx)(`strong`,{children:`Developers`}),`. Click the arrow on it to unfold the panel.`]}),(0,s.jsxs)(`li`,{children:[`On the right of that panel, under `,(0,s.jsx)(`strong`,{children:`Testing tools`}),`, is your`,` `,(0,s.jsx)(`strong`,{children:`secret key`}),` — it starts with `,(0,s.jsx)(`strong`,{children:`sk_test_`}),`. Copy it.`]})]})}),(0,s.jsxs)(v,{number:3,title:a?`Put it in your .env and start the app again`:`Paste it into Secrets and press Apply`,aside:(0,s.jsx)(t.v,{...d(3,n)}),children:[a?(0,s.jsxs)(`p`,{children:[`Open your `,(0,s.jsx)(`strong`,{children:`.env`}),` file — or ask your assistant to. The line below is already in it: paste the sk_test_… key between its quotes. One line, and that is the whole step — then `,(0,s.jsx)(`strong`,{children:`start the app again`}),` so it is read.`]}):(0,s.jsxs)(`ol`,{className:y,children:[(0,s.jsxs)(`li`,{children:[`Click the `,(0,s.jsx)(t.n,{}),` icon in the top right corner of your app in Google AI Studio.`]}),(0,s.jsxs)(`li`,{children:[`In the menu along the top, scroll across to `,(0,s.jsx)(`strong`,{children:`Secrets`}),`, then click`,` `,(0,s.jsx)(`strong`,{children:`+ Add secret`}),`.`]}),(0,s.jsxs)(`li`,{children:[`Copy the name below into `,(0,s.jsx)(`strong`,{children:`Secret name`}),`, and paste the sk_test_… key you just copied as the value.`]}),(0,s.jsxs)(`li`,{children:[`Click `,(0,s.jsx)(`strong`,{children:`Apply`}),`, then refresh the page. You are all set.`]})]}),(0,s.jsx)(`div`,{className:b,children:(0,s.jsx)(r.n,{name:`STRIPE_SECRET_KEY`,hint:`the sk_test_… key you copied in step 2`})}),(0,s.jsxs)(`p`,{children:[`Now you can test a payment with the pretend card `,(0,s.jsx)(`strong`,{children:`4242 4242 4242 4242`}),` and any other details you like, or by paying with Google Pay or Apple Pay. Nothing is ever charged — a sandbox is all practice.`]})]}),(0,s.jsx)(x,{onConfirm:e})]})}function w({onConfirm:e}){let n=p(),[i]=r.a(),a=i===`local`;return(0,s.jsxs)(`div`,{className:`flex flex-col`,children:[(0,s.jsx)(v,{number:1,title:`Make a Resend account and a key`,aside:(0,s.jsx)(t.v,{...m(n)}),children:(0,s.jsxs)(`ol`,{className:y,children:[(0,s.jsxs)(`li`,{children:[`Open `,(0,s.jsx)(_,{href:`https://resend.com`,children:`resend.com`}),` and create a free account — it is the service that delivers email for you. Sign up with the address you want your app's mail to reach you at.`]}),(0,s.jsxs)(`li`,{children:[`In Resend, open `,(0,s.jsx)(`strong`,{children:`API Keys`}),` and click `,(0,s.jsx)(`strong`,{children:`Create API key`}),`. Copy the key it shows — it starts with `,(0,s.jsx)(`strong`,{children:`re_`}),` — and keep the tab open.`]})]})}),(0,s.jsxs)(v,{number:2,title:a?`Put two values in your .env and start the app again`:`Paste two secrets and press Apply`,aside:(0,s.jsx)(t.v,{...m(n)}),children:[a?(0,s.jsxs)(`p`,{children:[`Open your `,(0,s.jsx)(`strong`,{children:`.env`}),` file. Both lines below are already in it — paste each value between its quotes, then `,(0,s.jsx)(`strong`,{children:`start the app again`}),` so they are read.`]}):(0,s.jsxs)(`ol`,{className:y,children:[(0,s.jsxs)(`li`,{children:[`Click the `,(0,s.jsx)(t.n,{}),` icon in the top right corner of your app in Google AI Studio.`]}),(0,s.jsxs)(`li`,{children:[`In the menu along the top, scroll across to `,(0,s.jsx)(`strong`,{children:`Secrets`}),`.`]}),(0,s.jsxs)(`li`,{children:[`For each row below, click `,(0,s.jsx)(`strong`,{children:`+ Add secret`}),`, copy the name here into`,` `,(0,s.jsx)(`strong`,{children:`Secret name`}),`, and paste the value.`]}),(0,s.jsxs)(`li`,{children:[`Click `,(0,s.jsx)(`strong`,{children:`Apply`}),`, then refresh the page.`]})]}),(0,s.jsxs)(`div`,{className:b,children:[(0,s.jsx)(r.n,{name:`RESEND_API_KEY`,hint:`the re_… key you just made in Resend`}),(0,s.jsx)(r.n,{name:`VITE_ADMIN_EMAILS`,hint:`your own email address — where sale, booking and form alerts are sent`})]})]}),(0,s.jsxs)(v,{number:3,title:`Verify your domain, or mail only reaches you`,aside:(0,s.jsx)(t.v,{...h(n)}),children:[(0,s.jsxs)(`p`,{children:[(0,s.jsx)(`strong`,{children:`Until you verify a domain of your own, Resend delivers only to the email address you made your Resend account with.`}),` A test email to yourself works; a customer's confirmation, a buyer's receipt, a booking note to someone else does not arrive at all. Do this before anyone but you should get an email.`]}),(0,s.jsxs)(`ol`,{className:y,children:[(0,s.jsxs)(`li`,{children:[`In Resend open `,(0,s.jsx)(_,{href:`https://resend.com/domains`,children:`Domains`}),`, click `,(0,s.jsx)(`strong`,{children:`Add domain`}),` `,`and type the domain you own — `,(0,s.jsx)(`strong`,{children:`yourbusiness.com`}),`, without www.`]}),(0,s.jsx)(`li`,{children:`Resend shows a few DNS records. Add each one where your domain is managed — the company you bought it from, or wherever its website is hosted — copying name and value exactly.`}),(0,s.jsxs)(`li`,{children:[`Back in Resend, click `,(0,s.jsx)(`strong`,{children:`Verify`}),`. It can take a few minutes to turn green; if it does not, one record was copied wrong.`]}),a?(0,s.jsxs)(`li`,{children:[`Fill in one more line in your `,(0,s.jsx)(`strong`,{children:`.env`}),` — an address at that domain, which is what your mail goes out as — and `,(0,s.jsx)(`strong`,{children:`start the app again`}),`.`]}):(0,s.jsxs)(`li`,{children:[`Add one more secret in AI Studio — an address at that domain, which is what your mail goes out as — and press `,(0,s.jsx)(`strong`,{children:`Apply`}),` again.`]})]}),(0,s.jsx)(`div`,{className:b,children:(0,s.jsx)(r.n,{name:`EMAIL_FROM`,hint:`an address at your verified domain, like hello@yourbusiness.com`})})]}),(0,s.jsx)(x,{onConfirm:e})]})}function T(){return(0,s.jsx)(c.Navigate,{to:`/setup`,replace:!0})}exports.ConnectCard=S,exports.EmailSetupSteps=w,exports.SetupPayments=T,exports.StripeSetupSteps=C;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const e=require(`./chunk-CiTBaPhY.cjs`),t=require(`./PageTitle-CZhgmmDT.cjs`),n=require(`./TimeZoneField-qs7NPR30.cjs`),r=require(`./DashboardNav-CXa_ci-_.cjs`),i=require(`./lucide-react-BwV6L6Is.cjs`),a=require(`./Button-5DlB2MCi.cjs`),o=require(`./registrationFields-v4pOoRdn.cjs`),s=require(`./roles-DQUFFBQe.cjs`),c=require(`./ProviderMark-xLkUN3Fx.cjs`),l=require(`./SupportBar-CDT0HwdP.cjs`);let u=require(`react`);u=e.a(u,1);let d=require(`react/jsx-runtime`),f=require(`firebase/firestore`);function p({roles:e,onCreated:t,placeholder:r=`Client`,onPending:a}){let[o,c]=(0,u.useState)(!1),[l,f]=(0,u.useState)(``),[p,m]=(0,u.useState)(``),[h,g]=(0,u.useState)(!1),_=()=>{c(!1),f(``),m(``)},v=async()=>{let r=s.o(l,e);if(r){m(r);return}let i=l.trim();g(!0),a?.(i);try{t(await s.n(i)),_()}catch(e){m(n.Ta(e,`The role could not be saved. Try again.`))}g(!1),a?.(``)},y=`flex items-center gap-2 px-3 py-2.5 text-[13px]`,b={borderRadius:`calc(var(--input-radius, 0.75rem) - 0.25rem)`},x=`shrink-0 w-7 h-7 flex items-center justify-center rounded-md transition-colors cursor-pointer hover:bg-foreground/[0.07]`;return(0,d.jsx)(`div`,{className:`mt-1 pt-1 border-t border-[var(--panel-border)]/60`,children:h?(0,d.jsxs)(`div`,{className:`${y} justify-between font-medium text-foreground/55`,style:b,children:[(0,d.jsxs)(`span`,{className:`truncate`,children:[`Adding `,l.trim(),`…`]}),(0,d.jsx)(i.ht,{className:`w-3.5 h-3.5 shrink-0 animate-spin text-accent`})]}):o?(0,d.jsxs)(`div`,{className:`flex flex-col gap-1 p-1`,children:[(0,d.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,d.jsx)(`input`,{autoFocus:!0,value:l,placeholder:r,"aria-label":`Name the role`,onChange:e=>{f(e.target.value),p&&m(``)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),v()),e.key===`Escape`&&(e.preventDefault(),_())},className:`flex-1 min-w-0 h-8 px-2.5 rounded-md border border-[var(--panel-border)] bg-[var(--panel-bg)] text-[13px] font-medium text-foreground placeholder:text-foreground/35 outline-none focus:border-accent transition-colors`}),(0,d.jsx)(`button`,{type:`button`,onClick:v,title:`Add role`,"aria-label":`Add role`,className:`${x} text-accent`,children:(0,d.jsx)(i.sn,{className:`w-3.5 h-3.5`})}),(0,d.jsx)(`button`,{type:`button`,onClick:_,title:`Cancel`,"aria-label":`Cancel the new role`,className:`${x} text-foreground/45 hover:text-foreground`,children:(0,d.jsx)(i.o,{className:`w-3.5 h-3.5`})})]}),p&&(0,d.jsx)(`span`,{className:`text-[11.5px] font-semibold text-red-500 leading-snug px-1.5`,children:p})]}):(0,d.jsxs)(`div`,{role:`option`,"aria-selected":!1,onClick:()=>c(!0),className:`${y} font-semibold text-accent hover:bg-foreground/5 cursor-pointer`,style:b,children:[(0,d.jsx)(i.G,{className:`w-3.5 h-3.5 shrink-0`}),`Custom role…`]})})}var m={collection:`sys_configs`,doc:`registration_briefs`},h=`What do you want to ask people after they register?`,g=(e,t)=>e===`member`?h:`${h.slice(0,-1)} as ${n.Zr(e,t).replace(`one of our team`,`one of your team`)}?`,_=`What would you like changed about these questions?`,v=`Their company name, and for business customers a VAT number — the VAT number must not be editable afterwards.`,y=`Which office they work from, and their job title.`,b=`Make the VAT number optional, and ask which country they are in.`,x=`Anything I have not decided — how a question is worded, what kind of box it is, what order they come in — decide yourself and write it finished; do not stop to ask me.`,S=`Each question is { key, label, type, required, editable } — editable: false for an answer that must never be changed after it is first given.`;function C(e,t,n){let r=`src/your-ai-workflow-firebase-os/configs/${o.b(e)}`,i=String(n?.words||``).trim();return n?.sent?[`The questions my app asks ${o.C(e,t)} on its Finish registration screen are one file: ${r}.`,`Change that file, and leave the questions I have not mentioned exactly as they are; decide anything I have not said yourself. If it is not there, write it: one const named ${o.y(e)} with a fields list.`,S,`Here is what I would like changed: ${i||`___`}`].join(`
|
|
2
|
+
`):[`My app shows people a Finish registration screen after they register — a few questions on top of a name and an email address, kept on the person's own profile. This is what I ask ${o.C(e,t)}.`,`Write one file: ${r}, exporting one const named ${o.y(e)} with a fields list. Do not build a registration page or a form of your own, do not touch any other file, and do not add a question I have not asked for.`,S,x,`Here is what I want to know: ${i||`___`}`].join(`
|
|
3
|
+
`)}function w(e,t){return[`My app shows people a Finish registration screen after they register — a few questions on top of a name and an email address, kept on the person's own profile. It asks different questions depending on how somebody registers, one file per role below. Do not build a registration page or a form of your own, do not touch a file I have not named here, and do not add a question I have not asked for.`,...e.filter(e=>String(t[e.id]?.words||``).trim()).map(e=>{let n=`src/your-ai-workflow-firebase-os/configs/${o.b(e.id)}`,r=String(t[e.id]?.words||``).trim(),i=!!t[e.id]?.sent;return[`For ${o.C(e.id,e.name)}:`,i?`change ${n}, leaving any question I have not mentioned exactly as it is — if it is not there, write it, one const named ${o.y(e.id)} with a fields list.`:`write ${n}, exporting one const named ${o.y(e.id)} with a fields list.`,`Here is what I ${i?`would like changed`:`want to know`}: ${r}`].join(` `)}),S,x].join(`
|
|
4
|
+
`)}var T=`fbos_swr_registration_briefs`,E=()=>{try{let e=localStorage.getItem(T);return e?JSON.parse(e):{}}catch{return{}}};function D(e,t){let r={id:o.t,name:n.ha(`user`,t)};return e.finishRegistration.perRole?[r,...n.Xr(e,t).map(e=>({id:e.id,name:e.name}))]:[r]}function O({list:e,answer:r,words:i,onType:a,onSave:o,onCopied:s,showPrompt:c=!0}){let l=!!r?.sent;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(n.b,{label:l?_:g(e.id,e.name),value:i,placeholder:l?b:e.id===`internal`?y:v,onChange:a,onBlur:o}),c&&(0,d.jsx)(t.o,{compact:!0,title:l?`Change what you ask`:`Ask for these details`,prompt:C(e.id,e.name,{...r,words:i}),locked:!i.trim(),onCopied:s})]})}function k({settings:e}){let r=s.l(),[a,o]=(0,u.useState)(E),[c,l]=(0,u.useState)({}),[p,h]=(0,u.useState)(null),[g,_]=(0,u.useState)(``);(0,u.useEffect)(()=>(0,f.onSnapshot)((0,f.doc)(n.ka,m.collection,m.doc),e=>{let t=e.exists()?e.data():{};o(t);try{localStorage.setItem(T,JSON.stringify(t))}catch{}},e=>{console.warn(`registration_briefs snapshot error:`,e)}),[]);let v=(e,t)=>{let r={...a[e],...t};o(t=>({...t,[e]:r})),(0,f.setDoc)((0,f.doc)(n.ka,m.collection,m.doc),{[e]:r},{merge:!0}).catch(e=>console.warn(`registration_briefs write failed:`,e))},y=(0,u.useCallback)(e=>{l(t=>({...t,[e]:``})),v(e,{words:``,sent:Date.now()})},[a]),b=(0,u.useCallback)(e=>{l(t=>{let n={...t};for(let t of e)n[t]=``;return n});let t=Date.now();for(let n of e)v(n,{words:``,sent:t})},[a]),{skippable:x,perRole:S}=e.finishRegistration,C=n.Xr(e,r).length>0,k=async t=>_(await e.setFinishRegistration(t)||``),A=D(e,r),j=e=>c[e]??a[e]?.words??``,M=e=>({list:e,answer:a[e.id],words:j(e.id),onType:t=>l(n=>({...n,[e.id]:t})),onSave:()=>{j(e.id)!==(a[e.id]?.words??``)&&v(e.id,{words:j(e.id)})}}),N=A.filter(e=>j(e.id).trim()).map(e=>e.id),P={};for(let e of A)P[e.id]={...a[e.id],words:j(e.id)};let F=N.some(e=>a[e]?.sent);return(0,d.jsxs)(n.h,{title:`Finish registration`,description:`A screen people see once, after they register, for anything you want to know on top of a name and an email address. It only appears when you have asked for something.`,children:[(0,d.jsx)(n.g,{children:`Some of it is there already: somebody who came in with a phone number or an emailed link is asked for a name or an email address first, and then for your questions. People can change their own answers on their Profile, and you can read them on the Users screen.`}),(0,d.jsx)(n.C,{label:`People can skip it`,hint:x?`Skippable — the screen has a Skip for now, and anything you marked as needed is asked again next time they sign in.`:`Required — nobody goes on until it is filled in. You and your admins are never held.`,hintWideOnly:!0,enabled:x,onChange:e=>k({skippable:e}),disabled:e.loading}),C&&(0,d.jsx)(n.C,{label:`Different questions for different roles`,hint:S?`One set of questions per role below. A role with none of its own is asked everybody's.`:`One set of questions, asked of everybody whatever they registered as.`,hintWideOnly:!0,enabled:S,onChange:e=>k({perRole:e}),disabled:e.loading}),g?(0,d.jsx)(n.g,{tone:`error`,children:g}):null,A.length===1?(0,d.jsx)(`div`,{className:`flex flex-col gap-4`,children:(0,d.jsx)(O,{...M(A[0]),onCopied:()=>y(A[0].id)})}):(0,d.jsx)(`div`,{className:`flex flex-col gap-3`,children:A.map(e=>{let t=p===e.id,r=!!a[e.id]?.sent;return(0,d.jsxs)(`div`,{onClick:()=>h(t?null:e.id),className:`group flex flex-col p-3.5 sm:py-4 sm:px-5 glass-panel border border-transparent hover:border-accent/40 transition-all rounded-2xl hover:shadow-sm cursor-pointer`,children:[(0,d.jsxs)(`div`,{className:`flex items-center justify-between w-full gap-2 sm:gap-3`,children:[(0,d.jsxs)(`div`,{className:`flex items-center gap-2.5 flex-1 min-w-0`,children:[(0,d.jsx)(`h3`,{className:`text-[14.5px] font-semibold text-foreground tracking-tight truncate`,children:e.id===`member`?`${e.name} — everybody else`:e.name}),(0,d.jsx)(`span`,{className:`max-sm:hidden text-[12px] font-medium text-foreground/45 truncate`,children:r?`Asked for`:`Nothing asked yet`})]}),(0,d.jsx)(`div`,{className:`p-1.5 transition-transform duration-300 text-foreground/40 shrink-0 ${t?`rotate-180`:``}`,children:(0,d.jsx)(i.on,{className:`w-3.5 h-3.5`})})]}),(0,d.jsx)(n.cr,{children:t&&(0,d.jsx)(n.sr.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:n.T,className:`overflow-hidden mt-4 pt-4 border-t border-[var(--panel-border)]/50 pb-1 flex flex-col gap-4`,onClick:e=>e.stopPropagation(),children:(0,d.jsx)(O,{...M(e),showPrompt:!1})})})]},e.id)})}),A.length>1&&(0,d.jsx)(t.o,{compact:!0,title:F?`Change what you ask`:`Ask for these details`,prompt:w(A,P),locked:!N.length,onCopied:()=>b(N)})]})}var A=[{id:`login`,title:`The sign-in page`,description:`Where somebody who already has an account comes back in.`,to:`/login?preview=1`,icon:i.pt},{id:`register`,title:`The registration page`,description:`Where somebody new makes an account for the first time.`,to:`/register?preview=1`,icon:i.v}],j=/\b((?:[a-z0-9-]+\.)+(?:com|org|net|io|dev|app|ai))(\/[a-z0-9\-._~:/?#@!$&'()*+,;=%]*)?/gi;function M({text:e}){let t=[],n=0;for(let r of e.matchAll(j)){let i=r[0],a=r.index??0;a>n&&t.push(e.slice(n,a)),t.push((0,d.jsx)(`a`,{href:`https://${i}`,target:`_blank`,rel:`noreferrer`,className:`font-bold text-accent hover:underline break-all`,children:i},`${i}-${a}`)),n=a+i.length}return n===0?(0,d.jsx)(d.Fragment,{children:e}):(n<e.length&&t.push(e.slice(n)),(0,d.jsx)(d.Fragment,{children:t}))}function N({title:e,steps:t,addresses:n,missing:r,children:i}){return(0,d.jsxs)(`div`,{className:`rounded-2xl border border-[var(--panel-border)]/60 bg-foreground/[0.02] p-4`,children:[(0,d.jsx)(`p`,{className:`text-[11px] font-bold uppercase tracking-[0.16em] text-foreground/40 mb-2.5`,children:e}),(0,d.jsx)(`ol`,{className:`space-y-2.5 list-decimal pl-[1.15rem] text-[13px] text-foreground/75 font-medium leading-relaxed marker:font-bold marker:text-foreground/35`,children:t.map(e=>{let{text:t,copy:i}=typeof e==`string`?{text:e,copy:void 0}:e,a=i&&n?n[i.address]:``;return(0,d.jsxs)(`li`,{children:[(0,d.jsx)(M,{text:t}),i&&(a?(0,d.jsx)(P,{label:i.label,value:a,note:i.note}):r?.(i))]},t)})}),i]})}function P({label:e,value:t,note:r}){let[a,o]=(0,u.useState)(!1);return(0,d.jsxs)(`div`,{className:`mt-2 mb-1 rounded-xl border border-accent/25 bg-accent/[0.06] p-3`,children:[(0,d.jsxs)(`div`,{className:`flex items-center justify-between gap-2 mb-1.5`,children:[(0,d.jsxs)(`span`,{className:`text-[11.5px] font-bold text-foreground/60 leading-tight`,children:[`Paste into “`,e,`”`]}),(0,d.jsx)(n.o,{icon:a?i.sn:i.Jt,title:`Copy ${t}`,onClick:()=>{try{navigator.clipboard?.writeText(t)?.catch(()=>{})}catch{}o(!0),setTimeout(()=>o(!1),1500)},children:a?`Copied`:`Copy`})]}),(0,d.jsx)(`code`,{className:`block text-[12px] font-mono text-foreground/80 break-all leading-relaxed`,children:t}),r&&(0,d.jsx)(`p`,{className:`mt-2 text-[11.5px] font-medium text-foreground/50 leading-relaxed`,children:r})]})}function F({method:e,onClose:t}){let r=e?c.t[e.id]:null,o=e?.setup,s={callback:n.Ur(n.Kr()),home:n.Vr()};return(0,d.jsx)(n.cr,{children:e&&(0,d.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4`,children:[(0,d.jsx)(n.sr.div,{onClick:t,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:`absolute inset-0 bg-background/80 backdrop-blur-xl cursor-pointer`}),(0,d.jsxs)(n.sr.div,{role:`dialog`,"aria-modal":`true`,"aria-label":`Set up ${e.label} in Firebase`,initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},className:`w-full max-w-[520px] max-h-[86vh] flex flex-col rounded-3xl glass-popover border border-[var(--panel-border)] shadow-2xl relative z-10`,children:[(0,d.jsxs)(`div`,{className:`flex-1 min-h-0 overflow-y-auto p-6 pb-2`,children:[(0,d.jsxs)(`div`,{className:`grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 mb-4`,children:[(0,d.jsx)(`div`,{className:`row-start-1 col-start-1 w-10 h-10 rounded-2xl flex items-center justify-center shrink-0 border border-[var(--panel-border)]/50 bg-accent/10 text-accent`,children:r&&(0,d.jsx)(r,{className:`w-5 h-5`})}),(0,d.jsx)(`h3`,{className:`row-start-1 col-start-2 self-center min-w-0 text-[17px] font-bold text-foreground tracking-tight leading-tight`,children:e.setupTitle||`Set up ${e.label} in Firebase first`}),(0,d.jsx)(`p`,{className:`row-start-2 col-start-2 min-w-0 text-[13.5px] font-medium text-foreground/60 leading-relaxed`,children:o?(0,d.jsxs)(d.Fragment,{children:[`This one takes two consoles. Firebase asks `,e.label,` who you are, and `,o.where,` wants an address back. Both halves are below — it is about five minutes.`]}):(0,d.jsx)(d.Fragment,{children:`This one is switched on in your Firebase project, not here. Firebase walks you through it — these are the clicks that get you to the right screen.`})})]}),(0,d.jsxs)(`div`,{className:`flex flex-col gap-3 mb-4`,children:[(0,d.jsx)(N,{title:`In Firebase`,steps:[...n.Rr,...e.steps],addresses:s,children:o&&(0,d.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[(0,d.jsx)(`span`,{className:`text-[11.5px] font-semibold text-foreground/45`,children:`It asks you for`}),o.asksFor.map(e=>(0,d.jsx)(`span`,{className:`px-2 py-0.5 rounded-lg border border-[var(--panel-border)] bg-foreground/[0.04] text-[11.5px] font-bold text-foreground/70`,children:e},e))]})}),o&&(0,d.jsx)(N,{title:`In ${o.where} — where those come from`,steps:o.steps,addresses:s,missing:t=>t.address===`home`?null:(0,d.jsxs)(`p`,{className:`mt-2 mb-1 text-[12.5px] font-medium text-foreground/55 leading-relaxed`,children:[`The address for “`,t.label,`” is the one Firebase prints at the bottom of its own `,e.label,` panel. Copy it from there.`]})}),o?.warning&&(0,d.jsx)(`p`,{className:`text-[12.5px] font-medium text-amber-600 dark:text-amber-400 leading-relaxed px-1`,children:o.warning})]}),(0,d.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-5 gap-y-2 mb-5`,children:[(0,d.jsxs)(`a`,{href:`https://console.firebase.google.com/`,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1.5 text-[13px] font-bold text-accent hover:underline`,children:[`Open the Firebase console`,(0,d.jsx)(i.Ht,{className:`w-3.5 h-3.5`})]}),o&&(0,d.jsxs)(`a`,{href:o.url,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1.5 text-[13px] font-bold text-accent hover:underline`,children:[`Open `,o.where,(0,d.jsx)(i.Ht,{className:`w-3.5 h-3.5`})]})]})]}),(0,d.jsx)(`div`,{className:`shrink-0 px-6 pb-6 pt-4 border-t border-[var(--panel-border)]/50 flex items-center gap-3 w-full`,children:(0,d.jsx)(a.t,{type:`button`,variant:`secondary`,onClick:t,className:`flex-1 py-2.5 text-[13px] font-bold rounded-xl`,children:`Close`})})]})]})})}function I({method:e,settings:t,problem:r,onFlip:i,onSteps:a}){let o=c.t[e.id],s=t.on[e.id];return(0,d.jsxs)(`div`,{className:`grid 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,d.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,d.jsx)(o,{className:`w-4 h-4`})}),(0,d.jsx)(`span`,{className:`row-start-1 col-start-2 min-w-0 text-[13px] font-bold text-foreground leading-tight self-end truncate`,children:e.label}),(0,d.jsx)(`span`,{className:`${r?``:`max-sm:hidden `}row-start-2 col-start-2 min-w-0 text-[12px] leading-snug self-start truncate ${r?`text-red-500 font-medium`:`text-foreground/50 font-normal`}`,children:r||e.description}),(0,d.jsxs)(`div`,{className:`row-start-1 row-span-2 col-start-3 self-center justify-self-end flex items-center gap-2 sm:gap-3 shrink-0`,children:[e.needsSetup&&(0,d.jsx)(`button`,{type:`button`,onClick:a,className:`max-sm:hidden text-[11.5px] font-semibold text-foreground/45 hover:text-accent transition-colors cursor-pointer`,children:`How to set it up`}),t.loading?(0,d.jsx)(`span`,{"aria-hidden":!0,className:`w-10 h-6 rounded-full bg-foreground/10 animate-pulse shrink-0`}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`span`,{className:`max-sm:hidden`,children:(0,d.jsx)(n.v,{state:s?`saved`:`off`,label:s?`On`:`Off`})}),(0,d.jsx)(n.S,{enabled:s,onChange:i,label:e.label})]})]})]})}function L({settings:e}){let t=s.l(),[r,a]=(0,u.useState)(``),[o,c]=(0,u.useState)(``),{on:l,roles:f}=e.registerAs,m=[{value:`internal`,label:n.ha(`internal`,t)},...t.filter(e=>!o||e.name.trim().toLowerCase()!==o.trim().toLowerCase()).map(e=>({value:e.id,label:e.name}))],h=n.Xr(e,t),g=async t=>a(await e.setRegisterAs({on:t})||``),_=async t=>{let n=f.includes(t)?f.filter(e=>e!==t):[...f,t];a(await e.setRegisterAs({roles:n})||``)},v=h.length?n.Jr(h):`Tick at least one, or the registration page stays the one form it is.`;return(0,d.jsxs)(n.h,{icon:i.Dt,title:`Registering as a role`,description:`Let people say what they are when they sign up. You approve each one on the Users screen.`,children:[(0,d.jsx)(n.C,{label:`Let people register as…`,hint:l?`On — the registration page opens on a choice: the roles below, or an ordinary account.`:`Off — the registration page is one form, and everybody who signs up is a member.`,hintWideOnly:!0,enabled:l,onChange:g,disabled:e.loading}),l&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(n.i,{label:`Which roles`,hint:v,children:(0,d.jsx)(n.nr,{multiple:!0,dense:!0,portal:!0,direction:`auto`,className:`console-select`,ariaLabel:`Roles people can register as`,placeholder:`Pick the roles`,values:f.filter(e=>m.some(t=>t.value===e)),options:m,onChange:_,footer:(0,d.jsx)(p,{roles:t,onPending:c,onCreated:e=>{_(e.id)}}),disabled:e.loading})}),(0,d.jsx)(n.g,{children:`Registering as a role makes an ordinary account with a request on it — nobody becomes anything by asking. You approve or decline each request on the Users screen, and until you do they are a member like anybody else. Admins are never offered here: an admin is made on the Users screen only. Signing in does not change.`})]}),r?(0,d.jsx)(n.g,{tone:`error`,children:r}):null]})}function R(){let e=n.$r(),[a,o]=(0,u.useState)(``),[s,c]=(0,u.useState)({}),[f,p]=(0,u.useState)(null),m=async(t,n)=>{o(``),c(e=>({...e,[t.id]:``}));let r=await e.set(t.id,n);r&&c(e=>({...e,[t.id]:r}))},h=n.Lr.filter(e=>e.kind===`security`);return(0,d.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,d.jsxs)(n.sr.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:`mb-6`,children:[(0,d.jsx)(t.t,{children:`Sign in`}),(0,d.jsxs)(`div`,{className:`flex items-center gap-2 text-foreground/40 font-bold uppercase tracking-[0.2em] text-[11px]`,children:[(0,d.jsx)(`span`,{className:`w-8 h-[1px] bg-foreground/10`}),`/sign-in`]})]}),(0,d.jsxs)(`div`,{className:`flex flex-col gap-6 flex-1 pb-16`,children:[(0,d.jsx)(r.t,{}),(0,d.jsxs)(`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 gap-4 min-h-[600px]`,children:[(0,d.jsxs)(n.h,{icon:i.D,title:`Your two pages`,description:`Right now people can sign in with ${n.Qr(e)}.`,children:[(0,d.jsx)(`div`,{className:`flex flex-col divide-y divide-[var(--panel-border)]/60 rounded-2xl border border-[var(--panel-border)]/60`,children:A.map(e=>{let t=e.icon;return(0,d.jsxs)(`div`,{className:`grid 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,d.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,d.jsx)(t,{className:`w-4 h-4`})}),(0,d.jsx)(`span`,{className:`row-start-1 col-start-2 min-w-0 text-[13px] font-bold text-foreground leading-tight self-end truncate`,children:e.title}),(0,d.jsx)(`span`,{className:`max-sm:hidden row-start-2 col-start-2 min-w-0 text-[12px] text-foreground/50 font-normal leading-snug self-start truncate`,children:e.description}),(0,d.jsx)(n.w,{to:e.to,title:`View ${e.title.charAt(0).toLowerCase()}${e.title.slice(1)}`,className:`row-start-1 row-span-2 col-start-3 self-center justify-self-end`,children:`View page`})]},e.id)})}),(0,d.jsx)(`p`,{className:n.s,children:`Both pages draw themselves from the switches below: every way you switch on appears on them, and every way you switch off leaves. There is nothing to rebuild in between.`})]}),(0,d.jsxs)(n.h,{icon:i.Nt,title:`Ways in`,description:`What people can use to sign in and to register.`,children:[(0,d.jsx)(n.g,{children:`A way of signing in also has to be switched on in your Firebase project before it works, and most of them already are. Switch one on here and it appears on both pages straight away; if Firebase has not got it, the person who presses that button is told so in plain words, and “How to set it up” on the row shows you exactly where to go.`}),(0,d.jsx)(`div`,{className:`flex flex-col divide-y divide-[var(--panel-border)]/60 rounded-2xl border border-[var(--panel-border)]/60`,children:n.Br.map(t=>(0,d.jsx)(I,{method:t,settings:e,problem:s[t.id]||``,onFlip:e=>m(t,e),onSteps:()=>p(t)},t.id))}),a?(0,d.jsx)(n.g,{tone:`error`,children:a}):null]}),(0,d.jsxs)(n.h,{icon:i.j,title:`One more step`,description:`A code by text after the password, for an app that holds something worth protecting.`,children:[(0,d.jsx)(n.g,{children:`With this on, everybody with a password is asked for a phone number the first time they sign in, and for a texted code every time after. People who sign in with Google, GitHub or X are already covered by that company's own checks.`}),(0,d.jsx)(`div`,{className:`flex flex-col divide-y divide-[var(--panel-border)]/60 rounded-2xl border border-[var(--panel-border)]/60`,children:h.map(t=>(0,d.jsx)(I,{method:t,settings:e,problem:s[t.id]||``,onFlip:e=>m(t,e),onSteps:()=>p(t)},t.id))}),e.on.sms2fa&&(0,d.jsx)(n.C,{label:`People can skip it`,hint:e.twoStepOptional?`Optional — the setup screen has a "Not now" on it, and they are asked again the next time they sign in.`:`Required — nobody gets past the setup screen until they have given a number.`,hintWideOnly:!0,enabled:e.twoStepOptional,onChange:async t=>o(await e.setTwoStepOptional(t)||``),disabled:e.loading}),(0,d.jsx)(n.g,{children:`A phone number can only be set up on one account. Somebody typing a number that is already somebody else's two-step code is told so before the text is sent — so the code really does say which person is signing in, which is the whole reason to ask for one. Signing in WITH a phone number is one account per number too; that part is Firebase's own doing.`})]}),(0,d.jsx)(L,{settings:e}),(0,d.jsx)(k,{settings:e})]})]}),(0,d.jsx)(l.t,{}),(0,d.jsx)(F,{method:f,onClose:()=>p(null)})]})}exports.SignInAdmin=R;
|