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,1114 @@
|
|
|
1
|
+
import { a as e, n as t, r as n } from "./forms-Bvx9HTM6.js";
|
|
2
|
+
import { $t as r, Cn as i, Da as a, Dt as o, Fn as s, Gn as c, Hn as l, Jt as u, Na as d, Nn as f, Oa as p, Ot as m, Rn as h, Tt as g, Wn as _, Wt as v, Yt as y, ar as b, cr as x, ct as S, dr as C, ir as w, k as ee, ka as te, ln as ne, nn as re, nr as T, or as ie, pt as ae, rr as E, sr as D, vn as oe, wn as O, wt as se, xn as k, xt as ce, zn as A } from "./TimeZoneField-DkI1Bkcz.js";
|
|
3
|
+
import { X as le, ln as ue, o as de, pn as j } from "./lucide-react-CA7GD7Nv.js";
|
|
4
|
+
import { n as fe } from "./Popup-xROLytgr.js";
|
|
5
|
+
import { t as pe } from "./Button-4lzOE31p.js";
|
|
6
|
+
import { t as me } from "./Loader-D4gwgBOq.js";
|
|
7
|
+
import { c as he, n as M, u as ge } from "./BookingCalendar-DZ2fEFja.js";
|
|
8
|
+
import { O as _e, h as N, i as ve, s as ye, x as P } from "./scheduleData-ATN8w5hI.js";
|
|
9
|
+
import { i as be, r as xe, u as Se } from "./address-C2bHNxJU.js";
|
|
10
|
+
import F, { Suspense as Ce, useCallback as we, useContext as Te, useEffect as I, useId as Ee, useMemo as L, useRef as R, useState as z } from "react";
|
|
11
|
+
import { Fragment as De, jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
12
|
+
import { addDoc as Oe, collection as ke, doc as Ae, getDoc as je, serverTimestamp as Me } from "firebase/firestore";
|
|
13
|
+
import { useNavigate as Ne } from "react-router-dom";
|
|
14
|
+
import { createPortal as Pe } from "react-dom";
|
|
15
|
+
//#region src/components/Input.tsx
|
|
16
|
+
var H = F.forwardRef(({ className: e, label: t, error: n, currencySymbol: r, type: i, ...a }, o) => {
|
|
17
|
+
let s = i === "currency";
|
|
18
|
+
return /* @__PURE__ */ V("div", {
|
|
19
|
+
className: "flex flex-col w-full relative",
|
|
20
|
+
children: [
|
|
21
|
+
t && /* @__PURE__ */ B("label", {
|
|
22
|
+
className: "text-[13px] font-medium text-foreground/70 select-none mb-2",
|
|
23
|
+
children: t
|
|
24
|
+
}),
|
|
25
|
+
/* @__PURE__ */ V("div", {
|
|
26
|
+
className: "relative flex items-center lift-focus",
|
|
27
|
+
children: [s && r && /* @__PURE__ */ B("span", {
|
|
28
|
+
className: "absolute left-4 font-bold text-foreground/70 z-10 pointer-events-none text-[15px]",
|
|
29
|
+
children: r
|
|
30
|
+
}), /* @__PURE__ */ B("input", {
|
|
31
|
+
ref: o,
|
|
32
|
+
type: s ? "number" : i,
|
|
33
|
+
className: w("block h-12 w-full text-[15px] text-foreground py-2", s && r ? "pl-8 pr-4" : "px-4", "transition-all duration-300 placeholder:text-foreground/40", "focus:outline-none focus:border-accent glow-focus", "disabled:cursor-not-allowed disabled:opacity-50 glass-panel", n && "border-red-500/50 focus:border-red-500/50", e),
|
|
34
|
+
style: { borderRadius: "var(--input-radius, 0.75rem)" },
|
|
35
|
+
...a
|
|
36
|
+
})]
|
|
37
|
+
}),
|
|
38
|
+
n && /* @__PURE__ */ B(D.p, {
|
|
39
|
+
initial: {
|
|
40
|
+
opacity: 0,
|
|
41
|
+
y: -5
|
|
42
|
+
},
|
|
43
|
+
animate: {
|
|
44
|
+
opacity: 1,
|
|
45
|
+
y: 0
|
|
46
|
+
},
|
|
47
|
+
className: "text-[13px] text-red-500 font-medium mt-1.5",
|
|
48
|
+
children: n
|
|
49
|
+
})
|
|
50
|
+
]
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
H.displayName = "Input";
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/components/TextArea.tsx
|
|
56
|
+
var Fe = F.forwardRef(({ className: e, label: t, error: n, id: r, rows: i = 2, ...a }, o) => {
|
|
57
|
+
let s = Ee(), c = r ?? `textarea-${s}`;
|
|
58
|
+
return /* @__PURE__ */ V("div", {
|
|
59
|
+
className: "flex flex-col w-full relative",
|
|
60
|
+
children: [
|
|
61
|
+
t && /* @__PURE__ */ B("label", {
|
|
62
|
+
htmlFor: c,
|
|
63
|
+
className: "text-[13px] font-medium text-foreground/70 select-none mb-2",
|
|
64
|
+
children: t
|
|
65
|
+
}),
|
|
66
|
+
/* @__PURE__ */ B(E, {
|
|
67
|
+
ref: o,
|
|
68
|
+
id: c,
|
|
69
|
+
rows: i,
|
|
70
|
+
className: w("block w-full text-[15px] leading-6 text-foreground px-4 py-3", "transition-[border-color,box-shadow,background-color] duration-300 placeholder:text-foreground/40", "focus:outline-none focus:border-accent glow-focus", "disabled:cursor-not-allowed disabled:opacity-50 glass-panel", n && "border-red-500/50 focus:border-red-500/50", e),
|
|
71
|
+
style: { borderRadius: "var(--input-radius, 0.75rem)" },
|
|
72
|
+
...a
|
|
73
|
+
}),
|
|
74
|
+
n && /* @__PURE__ */ B(D.p, {
|
|
75
|
+
initial: {
|
|
76
|
+
opacity: 0,
|
|
77
|
+
y: -5
|
|
78
|
+
},
|
|
79
|
+
animate: {
|
|
80
|
+
opacity: 1,
|
|
81
|
+
y: 0
|
|
82
|
+
},
|
|
83
|
+
className: "text-[13px] text-red-500 font-medium mt-1.5",
|
|
84
|
+
children: n
|
|
85
|
+
})
|
|
86
|
+
]
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
Fe.displayName = "TextArea";
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/lib/visitorState.ts
|
|
92
|
+
var U = (e) => `fbos.visitor.${e}`, Ie = "buyer", W = "fbos:visitor-forgotten", G = "fbos:visitor-changed";
|
|
93
|
+
function K(e) {
|
|
94
|
+
try {
|
|
95
|
+
window.localStorage.removeItem(U(e));
|
|
96
|
+
} catch {}
|
|
97
|
+
try {
|
|
98
|
+
window.dispatchEvent(new CustomEvent(W, { detail: e }));
|
|
99
|
+
} catch {}
|
|
100
|
+
}
|
|
101
|
+
var q = (e, t) => {
|
|
102
|
+
try {
|
|
103
|
+
let n = window.localStorage.getItem(U(e));
|
|
104
|
+
if (n === null) return t;
|
|
105
|
+
let r = JSON.parse(n);
|
|
106
|
+
return r === null ? t : r;
|
|
107
|
+
} catch {
|
|
108
|
+
return t;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
function Le(e, t, n, r) {
|
|
112
|
+
return Object.assign([
|
|
113
|
+
e,
|
|
114
|
+
t,
|
|
115
|
+
n
|
|
116
|
+
], {
|
|
117
|
+
value: e,
|
|
118
|
+
setValue: t,
|
|
119
|
+
clear: n,
|
|
120
|
+
ready: r
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
function Re(e, t) {
|
|
124
|
+
let [n, r] = z(t), [i, a] = z(!1), o = R(t), s = R(t), c = R(Symbol("visitor-state"));
|
|
125
|
+
I(() => {
|
|
126
|
+
let t = q(e, o.current);
|
|
127
|
+
s.current = t, r(t), a(!0);
|
|
128
|
+
let n = (t) => {
|
|
129
|
+
t.detail === e && (s.current = o.current, r(o.current));
|
|
130
|
+
}, i = (t) => {
|
|
131
|
+
let n = t.detail;
|
|
132
|
+
!n || n.key !== e || n.from === c.current || (s.current = n.value, r(n.value));
|
|
133
|
+
}, l = (t) => {
|
|
134
|
+
if (t.key !== U(e)) return;
|
|
135
|
+
let n = q(e, o.current);
|
|
136
|
+
s.current = n, r(n);
|
|
137
|
+
};
|
|
138
|
+
return window.addEventListener(W, n), window.addEventListener(G, i), window.addEventListener("storage", l), () => {
|
|
139
|
+
window.removeEventListener(W, n), window.removeEventListener(G, i), window.removeEventListener("storage", l);
|
|
140
|
+
};
|
|
141
|
+
}, [e]);
|
|
142
|
+
let l = R(null), u = we((t) => {
|
|
143
|
+
let n = typeof t == "function" ? t(s.current) : t;
|
|
144
|
+
s.current = n, l.current ||= { json: JSON.stringify(o.current) };
|
|
145
|
+
let i = JSON.stringify(n);
|
|
146
|
+
try {
|
|
147
|
+
i === l.current.json ? window.localStorage.removeItem(U(e)) : window.localStorage.setItem(U(e), i);
|
|
148
|
+
} catch {}
|
|
149
|
+
r(n);
|
|
150
|
+
try {
|
|
151
|
+
window.dispatchEvent(new CustomEvent(G, { detail: {
|
|
152
|
+
key: e,
|
|
153
|
+
value: n,
|
|
154
|
+
from: c.current
|
|
155
|
+
} }));
|
|
156
|
+
} catch {}
|
|
157
|
+
}, [e]), d = we(() => {
|
|
158
|
+
s.current = o.current;
|
|
159
|
+
try {
|
|
160
|
+
window.localStorage.removeItem(U(e));
|
|
161
|
+
} catch {}
|
|
162
|
+
r(o.current);
|
|
163
|
+
try {
|
|
164
|
+
window.dispatchEvent(new CustomEvent(W, { detail: e }));
|
|
165
|
+
} catch {}
|
|
166
|
+
}, [e]);
|
|
167
|
+
return L(() => Le(n, u, d, i), [
|
|
168
|
+
n,
|
|
169
|
+
u,
|
|
170
|
+
d,
|
|
171
|
+
i
|
|
172
|
+
]);
|
|
173
|
+
}
|
|
174
|
+
//#endregion
|
|
175
|
+
//#region src/components/AttachmentField.tsx
|
|
176
|
+
var ze = { borderRadius: "var(--input-radius, 0.75rem)" }, Be = (e) => /\.(png|jpe?g|gif|webp|avif|svg|heic|heif|bmp)$/i.test(e), Ve = (e) => {
|
|
177
|
+
let t = (e.split(".").pop() || "").toLowerCase();
|
|
178
|
+
return t && t.length <= 4 && t !== e.toLowerCase() ? t : "file";
|
|
179
|
+
};
|
|
180
|
+
function He({ field: e, value: t, error: n, onChange: r }) {
|
|
181
|
+
let [i, a] = z(0), [o, u] = z(""), d = R(null), m = i > 0, g = A(t), v = async (e) => {
|
|
182
|
+
let t = Array.from(e || []);
|
|
183
|
+
d.current && (d.current.value = ""), t.length && (u(""), a((e) => e + t.length), await Promise.all(t.map(async (e) => {
|
|
184
|
+
try {
|
|
185
|
+
let t = await c(e, p.currentUser);
|
|
186
|
+
r((e) => l([...A(e), t]));
|
|
187
|
+
} catch (e) {
|
|
188
|
+
u(e?.code === "storage/unauthorized" ? "That kind of file is not accepted. Try a PDF, a document or a picture." : _(e));
|
|
189
|
+
} finally {
|
|
190
|
+
a((e) => e - 1);
|
|
191
|
+
}
|
|
192
|
+
})));
|
|
193
|
+
}, y = (e) => {
|
|
194
|
+
u(""), r((t) => l(A(t).filter((t) => t !== e)));
|
|
195
|
+
}, { over: b, dropProps: x } = s({
|
|
196
|
+
accept: e.accept,
|
|
197
|
+
multiple: !0,
|
|
198
|
+
disabled: m,
|
|
199
|
+
onFiles: v,
|
|
200
|
+
onReject: () => u("That kind of file is not accepted here.")
|
|
201
|
+
}), S = n || o, C = b ? "Drop to attach" : g.length ? "Add another file" : e.placeholder || "Drop a file or choose one";
|
|
202
|
+
return /* @__PURE__ */ V("div", {
|
|
203
|
+
className: "flex flex-col w-full relative",
|
|
204
|
+
children: [
|
|
205
|
+
/* @__PURE__ */ B("label", {
|
|
206
|
+
className: "text-[13px] font-medium text-foreground/70 select-none mb-2",
|
|
207
|
+
children: e.label
|
|
208
|
+
}),
|
|
209
|
+
g.length > 0 && /* @__PURE__ */ B("ul", {
|
|
210
|
+
className: "flex flex-col gap-2 mb-2",
|
|
211
|
+
children: g.map((e) => {
|
|
212
|
+
let t = h(e);
|
|
213
|
+
return /* @__PURE__ */ V("li", {
|
|
214
|
+
className: "flex items-center gap-3 w-full pl-2 pr-2 py-2 border border-[var(--panel-border)]",
|
|
215
|
+
style: ze,
|
|
216
|
+
children: [
|
|
217
|
+
Be(t) ? /* @__PURE__ */ B(f, {
|
|
218
|
+
src: e,
|
|
219
|
+
alt: t,
|
|
220
|
+
fit: "cover",
|
|
221
|
+
className: "w-11 h-11 shrink-0 rounded-lg overflow-hidden"
|
|
222
|
+
}) : /* @__PURE__ */ B("span", {
|
|
223
|
+
"aria-hidden": "true",
|
|
224
|
+
className: "w-11 h-11 shrink-0 rounded-lg bg-foreground/[0.05] flex items-center justify-center text-[11px] font-semibold uppercase tracking-wide text-foreground/60",
|
|
225
|
+
children: Ve(t)
|
|
226
|
+
}),
|
|
227
|
+
/* @__PURE__ */ B("span", {
|
|
228
|
+
className: "flex-1 min-w-0 truncate text-[14px] text-foreground",
|
|
229
|
+
children: t
|
|
230
|
+
}),
|
|
231
|
+
/* @__PURE__ */ B("button", {
|
|
232
|
+
type: "button",
|
|
233
|
+
onClick: () => y(e),
|
|
234
|
+
"aria-label": `Remove ${t}`,
|
|
235
|
+
title: "Remove",
|
|
236
|
+
className: "w-8 h-8 shrink-0 inline-flex items-center justify-center rounded-lg text-foreground/45 hover:text-foreground hover:bg-foreground/[0.06] active:scale-[0.97] transition-colors cursor-pointer",
|
|
237
|
+
children: /* @__PURE__ */ B(de, { className: "w-4 h-4" })
|
|
238
|
+
})
|
|
239
|
+
]
|
|
240
|
+
}, e);
|
|
241
|
+
})
|
|
242
|
+
}),
|
|
243
|
+
/* @__PURE__ */ V("label", {
|
|
244
|
+
...x,
|
|
245
|
+
className: `flex flex-col items-center justify-center gap-1 w-full px-5 text-center border border-dashed transition-[border-color,background-color] duration-200 cursor-pointer ${g.length ? "py-4" : "py-7"} ${b ? "border-accent bg-accent/[0.05]" : "border-foreground/15 bg-foreground/[0.015] hover:border-accent/50 hover:bg-foreground/[0.03]"} ${m ? "pointer-events-none" : ""}`,
|
|
246
|
+
style: ze,
|
|
247
|
+
children: [m ? /* @__PURE__ */ B(me, {
|
|
248
|
+
size: "sm",
|
|
249
|
+
label: i > 1 ? `Uploading ${i} files...` : "Uploading..."
|
|
250
|
+
}) : /* @__PURE__ */ B("span", {
|
|
251
|
+
className: `text-[14px] font-medium ${b ? "text-accent" : "text-foreground/70"}`,
|
|
252
|
+
children: C
|
|
253
|
+
}), /* @__PURE__ */ B("input", {
|
|
254
|
+
ref: d,
|
|
255
|
+
type: "file",
|
|
256
|
+
multiple: !0,
|
|
257
|
+
accept: e.accept,
|
|
258
|
+
"aria-label": e.label,
|
|
259
|
+
disabled: m,
|
|
260
|
+
onChange: (e) => v(e.target.files),
|
|
261
|
+
className: "hidden"
|
|
262
|
+
})]
|
|
263
|
+
}),
|
|
264
|
+
S && /* @__PURE__ */ B("span", {
|
|
265
|
+
className: "text-[13px] text-red-500 font-medium mt-1.5",
|
|
266
|
+
children: S
|
|
267
|
+
})
|
|
268
|
+
]
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
//#endregion
|
|
272
|
+
//#region src/components/schedule/PickedTime.tsx
|
|
273
|
+
var J = "rounded-2xl flex items-center justify-center shrink-0 border border-[var(--panel-border)]/50 bg-accent/10 text-accent";
|
|
274
|
+
function Ue({ slot: e, timeZone: t, who: n, onChange: r }) {
|
|
275
|
+
let i = k(e, t), a = (n || "").trim();
|
|
276
|
+
return /* @__PURE__ */ V("div", {
|
|
277
|
+
className: "flex items-center gap-3 rounded-2xl border border-[var(--panel-border)]/60 bg-foreground/[0.015] px-3.5 py-3",
|
|
278
|
+
children: [
|
|
279
|
+
/* @__PURE__ */ B("div", {
|
|
280
|
+
className: `w-10 h-10 ${J}`,
|
|
281
|
+
children: /* @__PURE__ */ B(j, { className: "w-4 h-4" })
|
|
282
|
+
}),
|
|
283
|
+
/* @__PURE__ */ V("div", {
|
|
284
|
+
className: "flex flex-col min-w-0 flex-1 gap-0.5",
|
|
285
|
+
children: [/* @__PURE__ */ B("span", {
|
|
286
|
+
className: "text-[14px] sm:text-[15px] font-bold text-foreground leading-tight truncate",
|
|
287
|
+
children: i.day
|
|
288
|
+
}), /* @__PURE__ */ V("span", {
|
|
289
|
+
className: "text-[12.5px] sm:text-[13px] font-semibold text-foreground/55 leading-tight tabular-nums truncate",
|
|
290
|
+
children: [i.time, a ? ` · with ${a}` : ""]
|
|
291
|
+
})]
|
|
292
|
+
}),
|
|
293
|
+
/* @__PURE__ */ V("button", {
|
|
294
|
+
type: "button",
|
|
295
|
+
onClick: r,
|
|
296
|
+
"aria-label": "Change the time",
|
|
297
|
+
className: "shrink-0 cursor-pointer flex items-center justify-center transition-all max-sm:w-9 max-sm:h-9 max-sm:rounded-xl max-sm:border max-sm:border-[var(--panel-border)] max-sm:text-foreground/50 max-sm:hover:text-accent max-sm:hover:border-accent/40 max-sm:active:scale-[0.98] sm:text-[12.5px] sm:font-bold sm:text-accent sm:hover:underline",
|
|
298
|
+
children: [/* @__PURE__ */ B(le, {
|
|
299
|
+
className: "w-3.5 h-3.5 sm:hidden",
|
|
300
|
+
"aria-hidden": !0
|
|
301
|
+
}), /* @__PURE__ */ B("span", {
|
|
302
|
+
className: "max-sm:hidden",
|
|
303
|
+
children: "Change"
|
|
304
|
+
})]
|
|
305
|
+
})
|
|
306
|
+
]
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
//#endregion
|
|
310
|
+
//#region src/components/ContactPopup.tsx
|
|
311
|
+
var Y = new Set([
|
|
312
|
+
"uid",
|
|
313
|
+
"formId",
|
|
314
|
+
"submittedAt",
|
|
315
|
+
"submitterName",
|
|
316
|
+
"submitterEmail",
|
|
317
|
+
"submitterAvatar"
|
|
318
|
+
]), We = (e, t) => {
|
|
319
|
+
if (!e || typeof e != "object") return {};
|
|
320
|
+
let n;
|
|
321
|
+
try {
|
|
322
|
+
n = JSON.parse(JSON.stringify(e));
|
|
323
|
+
} catch {
|
|
324
|
+
return {};
|
|
325
|
+
}
|
|
326
|
+
let r = {};
|
|
327
|
+
for (let [e, i] of Object.entries(n || {})) Y.has(e) || e in t || (r[e] = i);
|
|
328
|
+
return r;
|
|
329
|
+
}, Ge = a(() => import("./PhoneInputField-DfOtCIH_.js")), Ke = a(() => import("./AddressField-9Sqn8TvC.js")), qe = /^[^\s@,;]+@[^\s@,;.]+(\.[^\s@,;.]+)*\.[a-z]{2,}$/i, Je = "text-[13px] font-medium text-foreground/70 select-none mb-2", X = "text-[13px] text-red-500 font-medium mt-1.5", Ye = "block h-12 w-full text-[15px] text-foreground py-2 transition-all duration-300 placeholder:text-foreground/40 focus:outline-none focus:border-accent glow-focus disabled:cursor-not-allowed disabled:opacity-50 glass-panel", Z = { borderRadius: "var(--input-radius, 0.75rem)" }, Q = [
|
|
330
|
+
.16,
|
|
331
|
+
1,
|
|
332
|
+
.3,
|
|
333
|
+
1
|
|
334
|
+
];
|
|
335
|
+
function Xe({ field: e, value: t, error: n, timeZone: a, onTimeZone: o, onChange: s }) {
|
|
336
|
+
let { schedules: c } = N(), l = O(e), u = c.filter((e) => l.includes(e.id) && S(e)), d = new Set(u.map((e) => e.memberId)).size > 1, f = i(e), p = f === "choose" && d, [h, g] = z(!1), _ = d && (f === "all" || p && h), v = _ ? r(u) : [], [b] = z(() => /* @__PURE__ */ new Date()), x = P(u.map((e) => e.memberId), b), C = se(t), w = e.look === "calendar" ? M : he;
|
|
337
|
+
return /* @__PURE__ */ V("div", {
|
|
338
|
+
className: "flex flex-col w-full",
|
|
339
|
+
children: [
|
|
340
|
+
/* @__PURE__ */ B("label", {
|
|
341
|
+
className: Je,
|
|
342
|
+
children: e.label
|
|
343
|
+
}),
|
|
344
|
+
p && /* @__PURE__ */ B("div", {
|
|
345
|
+
className: "flex gap-1.5 mb-2.5 p-1 rounded-[var(--input-radius,0.75rem)] border border-[var(--panel-border)] bg-[var(--panel-bg)] w-fit",
|
|
346
|
+
children: [{
|
|
347
|
+
on: !h,
|
|
348
|
+
label: "One of them",
|
|
349
|
+
v: !1
|
|
350
|
+
}, {
|
|
351
|
+
on: h,
|
|
352
|
+
label: "All of them",
|
|
353
|
+
v: !0
|
|
354
|
+
}].map((e) => /* @__PURE__ */ B("button", {
|
|
355
|
+
type: "button",
|
|
356
|
+
"aria-pressed": e.on,
|
|
357
|
+
onClick: () => {
|
|
358
|
+
e.v !== h && (g(e.v), s(""));
|
|
359
|
+
},
|
|
360
|
+
className: `px-3 h-8 rounded-[calc(var(--input-radius,0.75rem)-0.25rem)] text-[12.5px] font-semibold transition-all cursor-pointer ${e.on ? "bg-accent text-[var(--button-fg,#fff)] shadow-sm" : "text-foreground/55 hover:text-foreground"}`,
|
|
361
|
+
children: e.label
|
|
362
|
+
}, e.label))
|
|
363
|
+
}),
|
|
364
|
+
_ && /* @__PURE__ */ V("p", {
|
|
365
|
+
className: "text-[12.5px] font-medium text-foreground/50 mb-2 ml-1",
|
|
366
|
+
children: [
|
|
367
|
+
"Times ",
|
|
368
|
+
y(v),
|
|
369
|
+
" are all free."
|
|
370
|
+
]
|
|
371
|
+
}),
|
|
372
|
+
/* @__PURE__ */ B(w, {
|
|
373
|
+
members: u,
|
|
374
|
+
value: C,
|
|
375
|
+
onChange: (e) => s(e ? m(e, _) : ""),
|
|
376
|
+
taken: x,
|
|
377
|
+
timeZone: a,
|
|
378
|
+
onTimeZone: o,
|
|
379
|
+
together: _
|
|
380
|
+
}),
|
|
381
|
+
n && /* @__PURE__ */ B("span", {
|
|
382
|
+
className: X,
|
|
383
|
+
children: n
|
|
384
|
+
})
|
|
385
|
+
]
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
var Ze = (e, t) => {
|
|
389
|
+
let n = e.find((e) => e.type === "text" && /name/i.test(String(e.name || ""))) || e.find((e) => e.type === "text");
|
|
390
|
+
return String(n && t[n.name] || p.currentUser?.displayName || "").trim();
|
|
391
|
+
}, Qe = (e, t) => {
|
|
392
|
+
let n = e.find((e) => e.type === "email");
|
|
393
|
+
return String(n && t[n.name] || p.currentUser?.email || "").trim();
|
|
394
|
+
}, $e = (e, t) => {
|
|
395
|
+
let n = i(e);
|
|
396
|
+
if (!(n === "all" || n === "choose" && g(t))) return [];
|
|
397
|
+
let a = O(e), o = r(v().filter((e) => a.includes(e.id) && S(e)));
|
|
398
|
+
return o.length > 1 ? o : [];
|
|
399
|
+
};
|
|
400
|
+
function et(e, t) {
|
|
401
|
+
if (!t || !e.some((e) => e?.type === "schedule")) return {};
|
|
402
|
+
let n = {}, r = String(t.email || "").trim(), i = e.find((e) => e?.type === "email" && e.name);
|
|
403
|
+
i && r && (n[i.name] = r);
|
|
404
|
+
let a = String(t.displayName || "").trim(), o = e.find((e) => e?.type === "text" && e.name && /name/i.test(`${e.name} ${e.label || ""}`));
|
|
405
|
+
return o && a && (n[o.name] = a), n;
|
|
406
|
+
}
|
|
407
|
+
function tt(e, t) {
|
|
408
|
+
let n = {};
|
|
409
|
+
for (let [r, i] of Object.entries(t || {})) {
|
|
410
|
+
if (i === "" || i == null || i === !1) continue;
|
|
411
|
+
let t = (e || []).find((e) => e?.name && (r === e.name || e.type === "address" && r.startsWith(e.name)));
|
|
412
|
+
!t || t.type === "schedule" || (n[r] = i);
|
|
413
|
+
}
|
|
414
|
+
return n;
|
|
415
|
+
}
|
|
416
|
+
var nt = (e, t) => Object.fromEntries(e.filter((e) => e.type !== "schedule" && e.name && t[e.name] !== void 0 && t[e.name] !== "").map((e) => [e.name, String(t[e.name])])), rt = (e, t) => Object.fromEntries(Object.entries(We(e, t)).filter(([, e]) => e != null && e !== "").map(([e, t]) => [e, typeof t == "object" ? JSON.stringify(t) : String(t)]));
|
|
417
|
+
function $({ onClose: r, formId: i, formConfig: a, isInline: s, bare: c, onSubmitted: l, extra: f }) {
|
|
418
|
+
let [m, h] = z({}), [g, _] = z("idle"), [S, w] = z(""), [E, O] = z({}), [k, A] = z(() => o()), [le, de] = z(""), j = R(null), he = Te(b), [M, N] = z(a || null), [P, F] = z(!a), we = Ne(), Ee = d(), { user: L } = C(), U = et(M?.fields || [], L), Ie = String(L?.displayName || "").trim(), W = String(L?.email || "").trim(), G = (t) => {
|
|
419
|
+
let r = (typeof window < "u" ? window.__FBOS_FORMS__ : null) || {};
|
|
420
|
+
return Ee?.defaultConfigs?.[t] || Ee?.defaultConfigs?.[`${t}Form`] || r[t] || (t === "contact" ? e : t === "support" ? n : null);
|
|
421
|
+
};
|
|
422
|
+
I(() => {
|
|
423
|
+
if (a) {
|
|
424
|
+
N(a), F(!1);
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
if (!i) {
|
|
428
|
+
N(G("contact")), F(!1);
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
if (!localStorage.getItem(`fbos_custom_form_${i}`)) {
|
|
432
|
+
let e = G(i);
|
|
433
|
+
if (e) {
|
|
434
|
+
N(e), F(!1);
|
|
435
|
+
return;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
try {
|
|
439
|
+
let e = localStorage.getItem(`fbos_form_${i}`);
|
|
440
|
+
e && (N(JSON.parse(e)), F(!1));
|
|
441
|
+
} catch {}
|
|
442
|
+
(async () => {
|
|
443
|
+
try {
|
|
444
|
+
let e = await je(Ae(te, "sys_forms", i));
|
|
445
|
+
if (e.exists()) {
|
|
446
|
+
let t = {
|
|
447
|
+
...e.data(),
|
|
448
|
+
id: e.id
|
|
449
|
+
};
|
|
450
|
+
N(t), localStorage.setItem(`fbos_form_${i}`, JSON.stringify(t));
|
|
451
|
+
} else {
|
|
452
|
+
let e = G(i);
|
|
453
|
+
e && (N(e), localStorage.removeItem(`fbos_custom_form_${i}`));
|
|
454
|
+
}
|
|
455
|
+
} catch (e) {
|
|
456
|
+
console.error("Failed to load form config:", e);
|
|
457
|
+
let t = G(i);
|
|
458
|
+
t && N(t);
|
|
459
|
+
} finally {
|
|
460
|
+
F(!1);
|
|
461
|
+
}
|
|
462
|
+
})();
|
|
463
|
+
}, [i, a]), I(() => {
|
|
464
|
+
M && M.fields && h((e) => {
|
|
465
|
+
let t = { ...e }, n = !1;
|
|
466
|
+
return M.fields.forEach((e) => {
|
|
467
|
+
(e.name === "contactEmail" || e.type === "email") && !t[e.name] && p.currentUser?.email && (t[e.name] = p.currentUser.email, n = !0);
|
|
468
|
+
}), n ? t : e;
|
|
469
|
+
});
|
|
470
|
+
}, [M]);
|
|
471
|
+
let K = Re(`form.${i || ""}`, {}), q = R(!1), Le = K.setValue;
|
|
472
|
+
I(() => {
|
|
473
|
+
!i || !q.current || g === "success" || Le(tt(M?.fields || [], m));
|
|
474
|
+
}, [
|
|
475
|
+
i,
|
|
476
|
+
m,
|
|
477
|
+
M,
|
|
478
|
+
g,
|
|
479
|
+
Le
|
|
480
|
+
]), I(() => {
|
|
481
|
+
if (!i || q.current || !K.ready || !M?.fields) return;
|
|
482
|
+
q.current = !0;
|
|
483
|
+
let e = tt(M.fields, K.value);
|
|
484
|
+
Object.keys(e).length && h((t) => ({
|
|
485
|
+
...e,
|
|
486
|
+
...t
|
|
487
|
+
}));
|
|
488
|
+
}, [
|
|
489
|
+
i,
|
|
490
|
+
K.ready,
|
|
491
|
+
K.value,
|
|
492
|
+
M
|
|
493
|
+
]), I(() => {
|
|
494
|
+
function e(e) {
|
|
495
|
+
j.current && !j.current.contains(e.target) && r?.();
|
|
496
|
+
}
|
|
497
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
498
|
+
}, [r]), I(() => {
|
|
499
|
+
if (s) return;
|
|
500
|
+
let e = (e) => {
|
|
501
|
+
e.key === "Escape" && !e.defaultPrevented && (e.preventDefault(), r?.());
|
|
502
|
+
};
|
|
503
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
504
|
+
}, [r, s]), I(() => {
|
|
505
|
+
if (!s && !he) {
|
|
506
|
+
let e = document.body.style.overflow;
|
|
507
|
+
return document.body.style.overflow = "hidden", () => {
|
|
508
|
+
document.body.style.overflow = fe() > 0 ? "hidden" : e;
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
}, [s, he]);
|
|
512
|
+
let ze = async (e) => {
|
|
513
|
+
e.preventDefault();
|
|
514
|
+
let n = (M?.fields || []).filter((e) => e.type === "email"), o = {}, s = {};
|
|
515
|
+
n.forEach((e) => {
|
|
516
|
+
let t = String(m[e.name] ?? "").trim();
|
|
517
|
+
t && (s[e.name] = t, qe.test(t) || (o[e.name] = "That does not look like an email address — check for a typo, e.g. jane@example.com"));
|
|
518
|
+
}), (M?.fields || []).filter((e) => e.type === "address").forEach((e) => {
|
|
519
|
+
Object.assign(s, xe(e.name, Se(be(e.name, m))));
|
|
520
|
+
}), (M?.fields || []).filter((e) => e.type === "file" && e.required && !m[e.name]).forEach((e) => {
|
|
521
|
+
o[e.name] = "Please attach a file before sending.";
|
|
522
|
+
});
|
|
523
|
+
let c = (M?.fields || []).filter((e) => e.type === "schedule");
|
|
524
|
+
if (c.filter((e) => e.required && !se(m[e.name])).forEach((e) => {
|
|
525
|
+
o[e.name] = "Pick a time before sending.";
|
|
526
|
+
}), Object.keys(o).length > 0) {
|
|
527
|
+
O(o);
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
O({}), _("loading"), w("");
|
|
531
|
+
try {
|
|
532
|
+
let e = t(M), n = i || M?.systemName || M?.title || "unknown", o = [], d = [], g = async () => {
|
|
533
|
+
for (let e of d) await ye(e);
|
|
534
|
+
};
|
|
535
|
+
for (let e of c) {
|
|
536
|
+
let t = se(m[e.name]);
|
|
537
|
+
if (!t) continue;
|
|
538
|
+
let n = $e(e, m[e.name]), r = n.length ? re(t, n) : [t], i = [], a = null;
|
|
539
|
+
for (let e of r) {
|
|
540
|
+
if (a = await ve(e), a) break;
|
|
541
|
+
d.push(e);
|
|
542
|
+
let t = ne(e, v());
|
|
543
|
+
i.push({
|
|
544
|
+
slot: e,
|
|
545
|
+
memberName: t?.memberName || "",
|
|
546
|
+
scheduleId: t?.id || e.scheduleId,
|
|
547
|
+
scheduleName: u(t, String(M?.title || ""))
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
if (a) {
|
|
551
|
+
await g(), O({ [e.name]: a }), _("idle");
|
|
552
|
+
return;
|
|
553
|
+
}
|
|
554
|
+
o.push({
|
|
555
|
+
field: e,
|
|
556
|
+
slot: t,
|
|
557
|
+
whoName: n.length ? y(n) : i[0]?.memberName || "",
|
|
558
|
+
each: i
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
let b = {
|
|
562
|
+
...m,
|
|
563
|
+
...s,
|
|
564
|
+
...U
|
|
565
|
+
};
|
|
566
|
+
for (let e of o) delete b[e.field.name], Object.assign(b, ae(e.field.name, e.slot, e.whoName, k));
|
|
567
|
+
let x = p.currentUser ? {
|
|
568
|
+
uid: p.currentUser.uid,
|
|
569
|
+
submitterName: p.currentUser.displayName || "",
|
|
570
|
+
submitterEmail: p.currentUser.email || "",
|
|
571
|
+
submitterAvatar: p.currentUser.photoURL || ""
|
|
572
|
+
} : { uid: "guest" }, S = o.length > 0, C;
|
|
573
|
+
if (S) C = Ae(ke(te, e));
|
|
574
|
+
else try {
|
|
575
|
+
C = await Oe(ke(te, e), {
|
|
576
|
+
...We(f, b),
|
|
577
|
+
...b,
|
|
578
|
+
...x,
|
|
579
|
+
formId: n,
|
|
580
|
+
submittedAt: Me(),
|
|
581
|
+
...M?.transaction === !0 ? { transaction: !0 } : {}
|
|
582
|
+
});
|
|
583
|
+
} catch (e) {
|
|
584
|
+
throw await g(), e;
|
|
585
|
+
}
|
|
586
|
+
let T = M?.fields || [], ie = "";
|
|
587
|
+
for (let e of o) for (let t of e.each) {
|
|
588
|
+
let e = await _e(t.slot, {
|
|
589
|
+
memberName: t.memberName,
|
|
590
|
+
scheduleId: t.scheduleId,
|
|
591
|
+
scheduleName: t.scheduleName,
|
|
592
|
+
timeZone: k,
|
|
593
|
+
name: Ze(T, b),
|
|
594
|
+
email: Qe(T, b),
|
|
595
|
+
answers: {
|
|
596
|
+
...rt(f, b),
|
|
597
|
+
...nt(T, b)
|
|
598
|
+
},
|
|
599
|
+
formId: n,
|
|
600
|
+
entryId: C.id
|
|
601
|
+
});
|
|
602
|
+
if (e) {
|
|
603
|
+
await g(), _("error"), w(e);
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
ie ||= oe(t.slot.memberId, t.slot.start);
|
|
607
|
+
}
|
|
608
|
+
o.length && de(o.map((e) => ce(e.slot, e.whoName, k)).join("; ")), _("success"), i && K.clear();
|
|
609
|
+
try {
|
|
610
|
+
l?.(Object.fromEntries(Object.entries(b).map(([e, t]) => [e, String(t ?? "")])), S ? {
|
|
611
|
+
collection: ee,
|
|
612
|
+
id: ie
|
|
613
|
+
} : {
|
|
614
|
+
collection: e,
|
|
615
|
+
id: C.id
|
|
616
|
+
});
|
|
617
|
+
} catch {}
|
|
618
|
+
setTimeout(() => {
|
|
619
|
+
M?.redirectTo && !a && (M.redirectTo.startsWith("/") ? we(M.redirectTo) : window.location.href = M.redirectTo), r?.(), _("idle"), h({}), de("");
|
|
620
|
+
}, 3e3);
|
|
621
|
+
} catch (e) {
|
|
622
|
+
console.error("Submission error:", e), _("error"), w("We could not send your message right now. Please try again.");
|
|
623
|
+
}
|
|
624
|
+
}, [Be, Ve] = z(!1), J = ie();
|
|
625
|
+
if (I(() => {
|
|
626
|
+
let e;
|
|
627
|
+
return P || !M && !a ? e = setTimeout(() => Ve(!0), 150) : Ve(!1), () => clearTimeout(e);
|
|
628
|
+
}, [
|
|
629
|
+
P,
|
|
630
|
+
M,
|
|
631
|
+
a
|
|
632
|
+
]), P || !M) return Be ? s ? /* @__PURE__ */ B("div", {
|
|
633
|
+
className: "w-full flex items-center justify-center py-[10vh]",
|
|
634
|
+
children: /* @__PURE__ */ B(me, {
|
|
635
|
+
size: "sm",
|
|
636
|
+
label: "Loading the form"
|
|
637
|
+
})
|
|
638
|
+
}) : Pe(/* @__PURE__ */ B("div", {
|
|
639
|
+
className: "fixed inset-0 z-[9995] flex items-center justify-center bg-background/10 backdrop-blur-sm",
|
|
640
|
+
children: /* @__PURE__ */ B("div", {
|
|
641
|
+
className: "px-5 py-4 glass-popover border border-[var(--panel-border)]",
|
|
642
|
+
style: { borderRadius: "var(--card-radius, 1.5rem)" },
|
|
643
|
+
children: /* @__PURE__ */ B(me, {
|
|
644
|
+
size: "sm",
|
|
645
|
+
label: "Loading the form"
|
|
646
|
+
})
|
|
647
|
+
})
|
|
648
|
+
}), document.body) : null;
|
|
649
|
+
let Y = (M.fields || []).find((e) => e.type === "schedule" && e.look === "calendar"), X = Y ? se(m[Y.name]) : null, $ = !!Y && !X, it = $ ? "max-w-[880px]" : "max-w-[500px]", at = X ? $e(Y, m[Y.name]) : [], ot = X ? at.length ? y(at) : ne(X, v())?.memberName || "" : "", st = (e) => J ? { initial: !1 } : {
|
|
650
|
+
initial: {
|
|
651
|
+
opacity: 0,
|
|
652
|
+
y: 8
|
|
653
|
+
},
|
|
654
|
+
animate: {
|
|
655
|
+
opacity: 1,
|
|
656
|
+
y: 0
|
|
657
|
+
},
|
|
658
|
+
transition: {
|
|
659
|
+
duration: .35,
|
|
660
|
+
ease: Q,
|
|
661
|
+
delay: Math.min(e, 12) * .04
|
|
662
|
+
}
|
|
663
|
+
}, ct = !$ && Object.keys(U).length > 0, lt = +!!Y + +!!ct, ut = g === "loading", dt = M.submitText || M.buttonName || "Submit", ft = /* @__PURE__ */ B("div", {
|
|
664
|
+
className: "relative z-10 w-full",
|
|
665
|
+
children: g === "success" ? /* @__PURE__ */ V(D.div, {
|
|
666
|
+
role: "status",
|
|
667
|
+
"aria-live": "polite",
|
|
668
|
+
initial: J ? !1 : {
|
|
669
|
+
opacity: 0,
|
|
670
|
+
y: 8
|
|
671
|
+
},
|
|
672
|
+
animate: {
|
|
673
|
+
opacity: 1,
|
|
674
|
+
y: 0
|
|
675
|
+
},
|
|
676
|
+
transition: {
|
|
677
|
+
duration: .4,
|
|
678
|
+
ease: Q
|
|
679
|
+
},
|
|
680
|
+
className: "flex flex-col items-center text-center gap-2 py-2",
|
|
681
|
+
children: [/* @__PURE__ */ V("div", {
|
|
682
|
+
className: "flex items-center justify-center gap-2.5",
|
|
683
|
+
children: [/* @__PURE__ */ B("svg", {
|
|
684
|
+
viewBox: "0 0 20 20",
|
|
685
|
+
className: "w-5 h-5 text-accent shrink-0",
|
|
686
|
+
fill: "none",
|
|
687
|
+
"aria-hidden": "true",
|
|
688
|
+
children: /* @__PURE__ */ B(D.path, {
|
|
689
|
+
d: "M4 10.5l4 4 8-9",
|
|
690
|
+
stroke: "currentColor",
|
|
691
|
+
strokeWidth: "2",
|
|
692
|
+
strokeLinecap: "round",
|
|
693
|
+
strokeLinejoin: "round",
|
|
694
|
+
initial: J ? !1 : {
|
|
695
|
+
pathLength: 0,
|
|
696
|
+
opacity: 0
|
|
697
|
+
},
|
|
698
|
+
animate: {
|
|
699
|
+
pathLength: 1,
|
|
700
|
+
opacity: 1
|
|
701
|
+
},
|
|
702
|
+
transition: {
|
|
703
|
+
duration: .45,
|
|
704
|
+
ease: Q,
|
|
705
|
+
delay: .15
|
|
706
|
+
}
|
|
707
|
+
})
|
|
708
|
+
}), /* @__PURE__ */ B("h4", {
|
|
709
|
+
className: "text-lg font-semibold text-foreground tracking-tight",
|
|
710
|
+
children: "Sent. Thank you."
|
|
711
|
+
})]
|
|
712
|
+
}), le ? /* @__PURE__ */ V("p", {
|
|
713
|
+
className: "text-[14px] font-medium text-foreground leading-relaxed",
|
|
714
|
+
children: ["Booked: ", le]
|
|
715
|
+
}) : /* @__PURE__ */ B("p", {
|
|
716
|
+
className: "text-[14px] text-foreground/60 leading-relaxed",
|
|
717
|
+
children: "We'll be in touch soon."
|
|
718
|
+
})]
|
|
719
|
+
}, "sent") : /* @__PURE__ */ V(De, { children: [
|
|
720
|
+
/* @__PURE__ */ V("div", {
|
|
721
|
+
className: s && c ? "sr-only" : "mb-7",
|
|
722
|
+
children: [/* @__PURE__ */ B("h3", {
|
|
723
|
+
className: "text-[22px] sm:text-2xl font-semibold text-foreground tracking-tight leading-snug break-words",
|
|
724
|
+
children: M.title
|
|
725
|
+
}), M.description && /* @__PURE__ */ B("p", {
|
|
726
|
+
className: "mt-1.5 text-[14px] text-foreground/60 leading-relaxed",
|
|
727
|
+
children: M.description
|
|
728
|
+
})]
|
|
729
|
+
}),
|
|
730
|
+
/* @__PURE__ */ B(x, {
|
|
731
|
+
initial: !1,
|
|
732
|
+
children: g === "error" && S && /* @__PURE__ */ B(D.p, {
|
|
733
|
+
role: "alert",
|
|
734
|
+
initial: {
|
|
735
|
+
opacity: 0,
|
|
736
|
+
y: -4
|
|
737
|
+
},
|
|
738
|
+
animate: {
|
|
739
|
+
opacity: 1,
|
|
740
|
+
y: 0
|
|
741
|
+
},
|
|
742
|
+
exit: { opacity: 0 },
|
|
743
|
+
transition: {
|
|
744
|
+
duration: .2,
|
|
745
|
+
ease: Q
|
|
746
|
+
},
|
|
747
|
+
className: "mb-5 text-[13px] font-medium text-red-500 leading-relaxed",
|
|
748
|
+
children: S
|
|
749
|
+
}, "error")
|
|
750
|
+
}),
|
|
751
|
+
/* @__PURE__ */ V("form", {
|
|
752
|
+
onSubmit: ze,
|
|
753
|
+
"aria-busy": ut || void 0,
|
|
754
|
+
className: "flex flex-col gap-5 w-full",
|
|
755
|
+
children: [
|
|
756
|
+
Y && /* @__PURE__ */ B(D.div, {
|
|
757
|
+
...st(0),
|
|
758
|
+
className: "w-full",
|
|
759
|
+
children: X ? /* @__PURE__ */ B(Ue, {
|
|
760
|
+
slot: X,
|
|
761
|
+
timeZone: k,
|
|
762
|
+
who: ot,
|
|
763
|
+
onChange: () => h((e) => ({
|
|
764
|
+
...e,
|
|
765
|
+
[Y.name]: ""
|
|
766
|
+
}))
|
|
767
|
+
}) : /* @__PURE__ */ B(Xe, {
|
|
768
|
+
field: Y,
|
|
769
|
+
value: m[Y.name] || "",
|
|
770
|
+
error: E[Y.name],
|
|
771
|
+
timeZone: k,
|
|
772
|
+
onTimeZone: A,
|
|
773
|
+
onChange: (e) => h((t) => ({
|
|
774
|
+
...t,
|
|
775
|
+
[Y.name]: e
|
|
776
|
+
}))
|
|
777
|
+
})
|
|
778
|
+
}, X ? "picked" : "calendar"),
|
|
779
|
+
ct && /* @__PURE__ */ V(D.div, {
|
|
780
|
+
...st(+!!Y),
|
|
781
|
+
className: "flex items-center gap-2 px-4 py-3 border border-[var(--panel-border)]",
|
|
782
|
+
style: Z,
|
|
783
|
+
children: [/* @__PURE__ */ B("span", {
|
|
784
|
+
className: "text-[13px] font-medium text-foreground/60 shrink-0",
|
|
785
|
+
children: "Booking as"
|
|
786
|
+
}), /* @__PURE__ */ B("span", {
|
|
787
|
+
className: "text-[14px] font-medium text-foreground truncate",
|
|
788
|
+
children: [Ie, W].filter(Boolean).join(" · ")
|
|
789
|
+
})]
|
|
790
|
+
}),
|
|
791
|
+
!$ && [...M.fields || []].filter((e) => e !== Y && !(e.name in U)).sort((e, t) => {
|
|
792
|
+
let n = e.type === "checkbox", r = t.type === "checkbox";
|
|
793
|
+
return n && !r ? 1 : !n && r ? -1 : 0;
|
|
794
|
+
}).map((e, t) => {
|
|
795
|
+
let n = st(lt + t), r = () => {
|
|
796
|
+
E[e.name] && O((t) => {
|
|
797
|
+
let n = { ...t };
|
|
798
|
+
return delete n[e.name], n;
|
|
799
|
+
});
|
|
800
|
+
};
|
|
801
|
+
if (e.type === "schedule") return /* @__PURE__ */ B(D.div, {
|
|
802
|
+
...n,
|
|
803
|
+
className: "w-full",
|
|
804
|
+
children: /* @__PURE__ */ B(Xe, {
|
|
805
|
+
field: e,
|
|
806
|
+
value: m[e.name] || "",
|
|
807
|
+
error: E[e.name],
|
|
808
|
+
timeZone: k,
|
|
809
|
+
onTimeZone: A,
|
|
810
|
+
onChange: (t) => {
|
|
811
|
+
h((n) => ({
|
|
812
|
+
...n,
|
|
813
|
+
[e.name]: t
|
|
814
|
+
})), r();
|
|
815
|
+
}
|
|
816
|
+
})
|
|
817
|
+
}, t);
|
|
818
|
+
if (e.type === "tel") return /* @__PURE__ */ B(D.div, {
|
|
819
|
+
...n,
|
|
820
|
+
className: "w-full",
|
|
821
|
+
children: /* @__PURE__ */ B(Ce, {
|
|
822
|
+
fallback: /* @__PURE__ */ B("div", {
|
|
823
|
+
className: "h-12 w-full glass-panel animate-pulse",
|
|
824
|
+
style: Z
|
|
825
|
+
}),
|
|
826
|
+
children: /* @__PURE__ */ B(Ge, {
|
|
827
|
+
field: e,
|
|
828
|
+
value: m[e.name] || "",
|
|
829
|
+
onChange: (t) => h((n) => ({
|
|
830
|
+
...n,
|
|
831
|
+
[e.name]: t
|
|
832
|
+
}))
|
|
833
|
+
})
|
|
834
|
+
})
|
|
835
|
+
}, t);
|
|
836
|
+
if (e.type === "address") return /* @__PURE__ */ B(D.div, {
|
|
837
|
+
...n,
|
|
838
|
+
className: "w-full",
|
|
839
|
+
children: /* @__PURE__ */ B(Ce, {
|
|
840
|
+
fallback: /* @__PURE__ */ B("div", {
|
|
841
|
+
className: "h-12 w-full glass-panel animate-pulse",
|
|
842
|
+
style: Z
|
|
843
|
+
}),
|
|
844
|
+
children: /* @__PURE__ */ B(Ke, {
|
|
845
|
+
id: `form-${e.name}`,
|
|
846
|
+
label: e.label,
|
|
847
|
+
required: e.required,
|
|
848
|
+
placeholder: e.placeholder,
|
|
849
|
+
error: E[e.name],
|
|
850
|
+
value: be(e.name, m),
|
|
851
|
+
onChange: (t) => {
|
|
852
|
+
h((n) => ({
|
|
853
|
+
...n,
|
|
854
|
+
...xe(e.name, t)
|
|
855
|
+
})), r();
|
|
856
|
+
}
|
|
857
|
+
})
|
|
858
|
+
})
|
|
859
|
+
}, t);
|
|
860
|
+
if (e.type === "file") return /* @__PURE__ */ B(D.div, {
|
|
861
|
+
...n,
|
|
862
|
+
className: "w-full",
|
|
863
|
+
children: /* @__PURE__ */ B(He, {
|
|
864
|
+
field: e,
|
|
865
|
+
value: m[e.name] || "",
|
|
866
|
+
error: E[e.name],
|
|
867
|
+
onChange: (t) => {
|
|
868
|
+
h((n) => ({
|
|
869
|
+
...n,
|
|
870
|
+
[e.name]: t(n[e.name] || "")
|
|
871
|
+
})), r();
|
|
872
|
+
}
|
|
873
|
+
})
|
|
874
|
+
}, t);
|
|
875
|
+
if (e.type === "textarea") return /* @__PURE__ */ B(D.div, {
|
|
876
|
+
...n,
|
|
877
|
+
className: "w-full",
|
|
878
|
+
children: /* @__PURE__ */ B(Fe, {
|
|
879
|
+
label: e.label,
|
|
880
|
+
required: e.required,
|
|
881
|
+
placeholder: e.placeholder,
|
|
882
|
+
value: m[e.name] || "",
|
|
883
|
+
onChange: (t) => h((n) => ({
|
|
884
|
+
...n,
|
|
885
|
+
[e.name]: t.target.value
|
|
886
|
+
}))
|
|
887
|
+
})
|
|
888
|
+
}, t);
|
|
889
|
+
if (e.type === "select") return /* @__PURE__ */ B(D.div, {
|
|
890
|
+
...n,
|
|
891
|
+
className: "w-full",
|
|
892
|
+
children: /* @__PURE__ */ B(T, {
|
|
893
|
+
label: e.label,
|
|
894
|
+
direction: "auto",
|
|
895
|
+
value: m[e.name] || "",
|
|
896
|
+
options: [{
|
|
897
|
+
value: "",
|
|
898
|
+
label: /* @__PURE__ */ B("span", {
|
|
899
|
+
className: "text-foreground/40",
|
|
900
|
+
children: "Select an option..."
|
|
901
|
+
})
|
|
902
|
+
}, ...(e.options || []).map((e) => ({
|
|
903
|
+
value: e,
|
|
904
|
+
label: e
|
|
905
|
+
}))],
|
|
906
|
+
onChange: (t) => h((n) => ({
|
|
907
|
+
...n,
|
|
908
|
+
[e.name]: t
|
|
909
|
+
}))
|
|
910
|
+
})
|
|
911
|
+
}, t);
|
|
912
|
+
if (e.type === "checkbox") {
|
|
913
|
+
let r = !!m[e.name];
|
|
914
|
+
return /* @__PURE__ */ V(D.label, {
|
|
915
|
+
...n,
|
|
916
|
+
className: "flex items-start gap-3 w-full cursor-pointer group py-1",
|
|
917
|
+
children: [/* @__PURE__ */ V("span", {
|
|
918
|
+
className: "relative mt-0.5 flex items-center justify-center w-5 h-5 shrink-0 rounded-md border border-foreground/25 group-hover:border-accent/60 group-focus-within:border-accent group-focus-within:ring-[3px] group-focus-within:ring-accent/20 transition-colors",
|
|
919
|
+
children: [/* @__PURE__ */ B("input", {
|
|
920
|
+
type: "checkbox",
|
|
921
|
+
required: e.required,
|
|
922
|
+
checked: r,
|
|
923
|
+
onChange: (t) => h((n) => ({
|
|
924
|
+
...n,
|
|
925
|
+
[e.name]: t.target.checked
|
|
926
|
+
})),
|
|
927
|
+
className: "absolute inset-0 opacity-0 w-full h-full cursor-pointer"
|
|
928
|
+
}), r && /* @__PURE__ */ B("span", { className: "w-2.5 h-2.5 bg-accent rounded-[3px] shrink-0" })]
|
|
929
|
+
}), /* @__PURE__ */ B("span", {
|
|
930
|
+
className: "text-[14px] text-foreground/80 leading-snug group-hover:text-foreground transition-colors",
|
|
931
|
+
children: e.label
|
|
932
|
+
})]
|
|
933
|
+
}, t);
|
|
934
|
+
}
|
|
935
|
+
if (e.type === "date") {
|
|
936
|
+
let r = m[e.name] || "";
|
|
937
|
+
return /* @__PURE__ */ V(D.div, {
|
|
938
|
+
...n,
|
|
939
|
+
className: "flex flex-col w-full relative",
|
|
940
|
+
children: [/* @__PURE__ */ B("label", {
|
|
941
|
+
className: Je,
|
|
942
|
+
children: e.label
|
|
943
|
+
}), /* @__PURE__ */ V("div", {
|
|
944
|
+
className: "relative flex items-center",
|
|
945
|
+
children: [/* @__PURE__ */ B("input", {
|
|
946
|
+
type: "date",
|
|
947
|
+
required: e.required,
|
|
948
|
+
value: r,
|
|
949
|
+
onChange: (t) => h((n) => ({
|
|
950
|
+
...n,
|
|
951
|
+
[e.name]: t.target.value
|
|
952
|
+
})),
|
|
953
|
+
className: `date-field ${Ye} pl-4 pr-11 ${r ? "text-foreground" : "text-foreground/40"}`,
|
|
954
|
+
style: Z
|
|
955
|
+
}), /* @__PURE__ */ B(ue, { className: "w-4 h-4 text-foreground/40 absolute right-4 pointer-events-none" })]
|
|
956
|
+
})]
|
|
957
|
+
}, t);
|
|
958
|
+
}
|
|
959
|
+
return e.type === "age" ? /* @__PURE__ */ B(D.div, {
|
|
960
|
+
...n,
|
|
961
|
+
className: "w-full",
|
|
962
|
+
children: /* @__PURE__ */ B(H, {
|
|
963
|
+
label: e.label,
|
|
964
|
+
required: e.required,
|
|
965
|
+
type: "number",
|
|
966
|
+
min: 0,
|
|
967
|
+
max: 120,
|
|
968
|
+
placeholder: e.placeholder || "Age (Max 120)",
|
|
969
|
+
value: m[e.name] || "",
|
|
970
|
+
onChange: (t) => {
|
|
971
|
+
let n = t.target.value;
|
|
972
|
+
if (n === "") h((t) => ({
|
|
973
|
+
...t,
|
|
974
|
+
[e.name]: ""
|
|
975
|
+
}));
|
|
976
|
+
else {
|
|
977
|
+
let t = Math.max(0, Math.min(120, parseInt(n, 10)));
|
|
978
|
+
h((n) => ({
|
|
979
|
+
...n,
|
|
980
|
+
[e.name]: isNaN(t) ? "" : String(t)
|
|
981
|
+
}));
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
})
|
|
985
|
+
}, t) : e.type === "currency" || e.type === "number" && e.name === "budget" ? /* @__PURE__ */ V(D.div, {
|
|
986
|
+
...n,
|
|
987
|
+
className: "flex flex-col w-full relative",
|
|
988
|
+
children: [/* @__PURE__ */ B("label", {
|
|
989
|
+
className: Je,
|
|
990
|
+
children: e.label
|
|
991
|
+
}), /* @__PURE__ */ V("div", {
|
|
992
|
+
className: "relative flex items-center",
|
|
993
|
+
children: [/* @__PURE__ */ B("span", {
|
|
994
|
+
className: "absolute left-4 text-foreground/60 font-medium flex items-center h-full z-10 pointer-events-none text-[15px]",
|
|
995
|
+
children: e.currencySymbol || "$"
|
|
996
|
+
}), /* @__PURE__ */ B("input", {
|
|
997
|
+
required: e.required,
|
|
998
|
+
type: "number",
|
|
999
|
+
placeholder: e.placeholder,
|
|
1000
|
+
value: m[e.name] || "",
|
|
1001
|
+
onChange: (t) => h((n) => ({
|
|
1002
|
+
...n,
|
|
1003
|
+
[e.name]: t.target.value
|
|
1004
|
+
})),
|
|
1005
|
+
className: `${Ye} pl-8 pr-4`,
|
|
1006
|
+
style: Z
|
|
1007
|
+
})]
|
|
1008
|
+
})]
|
|
1009
|
+
}, t) : /* @__PURE__ */ B(D.div, {
|
|
1010
|
+
...n,
|
|
1011
|
+
className: "w-full",
|
|
1012
|
+
children: /* @__PURE__ */ B(H, {
|
|
1013
|
+
label: e.label,
|
|
1014
|
+
required: e.required,
|
|
1015
|
+
type: e.type,
|
|
1016
|
+
placeholder: e.placeholder,
|
|
1017
|
+
currencySymbol: e.currencySymbol,
|
|
1018
|
+
error: E[e.name],
|
|
1019
|
+
value: m[e.name] || "",
|
|
1020
|
+
onChange: (t) => {
|
|
1021
|
+
h((n) => ({
|
|
1022
|
+
...n,
|
|
1023
|
+
[e.name]: t.target.value
|
|
1024
|
+
})), r();
|
|
1025
|
+
}
|
|
1026
|
+
})
|
|
1027
|
+
}, t);
|
|
1028
|
+
}),
|
|
1029
|
+
X ? /* @__PURE__ */ V("div", {
|
|
1030
|
+
className: "flex flex-col gap-4 pt-1",
|
|
1031
|
+
children: [/* @__PURE__ */ B("div", { className: "h-px bg-[var(--panel-border)]/60" }), /* @__PURE__ */ B(ge, {
|
|
1032
|
+
timeZone: k,
|
|
1033
|
+
onTimeZone: A,
|
|
1034
|
+
action: /* @__PURE__ */ B(pe, {
|
|
1035
|
+
type: "submit",
|
|
1036
|
+
className: "max-sm:w-full h-11 px-6 text-[13.5px] font-semibold shrink-0",
|
|
1037
|
+
isLoading: ut,
|
|
1038
|
+
children: dt
|
|
1039
|
+
})
|
|
1040
|
+
})]
|
|
1041
|
+
}) : !$ && /* @__PURE__ */ B(D.div, {
|
|
1042
|
+
...st(lt + (M.fields || []).length),
|
|
1043
|
+
className: "pt-2",
|
|
1044
|
+
children: /* @__PURE__ */ B(pe, {
|
|
1045
|
+
type: "submit",
|
|
1046
|
+
className: "w-full h-12 text-[15px] font-semibold",
|
|
1047
|
+
isLoading: ut,
|
|
1048
|
+
children: dt
|
|
1049
|
+
})
|
|
1050
|
+
})
|
|
1051
|
+
]
|
|
1052
|
+
})
|
|
1053
|
+
] })
|
|
1054
|
+
});
|
|
1055
|
+
return s && c ? /* @__PURE__ */ B("div", {
|
|
1056
|
+
className: `form-calm w-full ${it} mx-auto relative transition-[max-width] duration-500 ease-out`,
|
|
1057
|
+
children: ft
|
|
1058
|
+
}) : s ? /* @__PURE__ */ B("div", {
|
|
1059
|
+
className: "form-calm w-full flex justify-center flex-col items-center",
|
|
1060
|
+
children: /* @__PURE__ */ B(D.div, {
|
|
1061
|
+
initial: J ? !1 : {
|
|
1062
|
+
opacity: 0,
|
|
1063
|
+
y: 10
|
|
1064
|
+
},
|
|
1065
|
+
animate: {
|
|
1066
|
+
opacity: 1,
|
|
1067
|
+
y: 0
|
|
1068
|
+
},
|
|
1069
|
+
transition: {
|
|
1070
|
+
duration: .4,
|
|
1071
|
+
ease: Q
|
|
1072
|
+
},
|
|
1073
|
+
className: `w-full ${it} p-6 sm:p-8 glass-form relative shadow-[0_8px_32px_rgba(0,0,0,0.06)] z-10 mx-auto transition-[max-width] duration-500 ease-out`,
|
|
1074
|
+
style: { borderRadius: "var(--card-radius, 1.5rem)" },
|
|
1075
|
+
children: ft
|
|
1076
|
+
})
|
|
1077
|
+
}) : Pe(/* @__PURE__ */ V("div", {
|
|
1078
|
+
className: "form-calm fixed inset-0 z-[9995] flex items-start justify-center p-4 py-20 md:py-10 h-[-webkit-fill-available] md:h-screen w-screen overflow-y-auto no-scrollbar",
|
|
1079
|
+
children: [/* @__PURE__ */ B(D.div, {
|
|
1080
|
+
onClick: r,
|
|
1081
|
+
initial: { opacity: 0 },
|
|
1082
|
+
animate: { opacity: 1 },
|
|
1083
|
+
exit: { opacity: 0 },
|
|
1084
|
+
transition: { duration: .25 },
|
|
1085
|
+
className: "fixed inset-0 bg-background/60 backdrop-blur-xl cursor-pointer"
|
|
1086
|
+
}), /* @__PURE__ */ B(D.div, {
|
|
1087
|
+
initial: J ? !1 : {
|
|
1088
|
+
opacity: 0,
|
|
1089
|
+
scale: .98,
|
|
1090
|
+
y: 10
|
|
1091
|
+
},
|
|
1092
|
+
animate: {
|
|
1093
|
+
opacity: 1,
|
|
1094
|
+
scale: 1,
|
|
1095
|
+
y: 0
|
|
1096
|
+
},
|
|
1097
|
+
exit: {
|
|
1098
|
+
opacity: 0,
|
|
1099
|
+
scale: .98,
|
|
1100
|
+
y: 10
|
|
1101
|
+
},
|
|
1102
|
+
transition: {
|
|
1103
|
+
duration: .35,
|
|
1104
|
+
ease: Q
|
|
1105
|
+
},
|
|
1106
|
+
ref: j,
|
|
1107
|
+
className: `w-full ${it} p-6 sm:p-8 glass-popover relative z-10 mx-auto my-auto border border-[var(--panel-border)] shrink-0 transition-[max-width] duration-500 ease-out`,
|
|
1108
|
+
style: { borderRadius: "var(--card-radius, 1.5rem)" },
|
|
1109
|
+
children: ft
|
|
1110
|
+
})]
|
|
1111
|
+
}), document.body);
|
|
1112
|
+
}
|
|
1113
|
+
//#endregion
|
|
1114
|
+
export { Ie as a, U as c, H as d, He as i, Re as l, Ue as n, W as o, J as r, K as s, $ as t, Fe as u };
|