@burdenoff/microfe-atheletebridge 2026.1107.1 → 2026.1108.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atheletebridge/components/registration/OnlineCheckout.d.ts +11 -0
- package/dist/atheletebridge/components/registration/OnlineCheckout.d.ts.map +1 -0
- package/dist/atheletebridge/components/registration/OnlineCheckout.js +102 -0
- package/dist/atheletebridge/components/registration/OnlineCheckout.js.map +1 -0
- package/dist/atheletebridge/components/registration/OnlinePaymentsCard.d.ts +4 -0
- package/dist/atheletebridge/components/registration/OnlinePaymentsCard.d.ts.map +1 -0
- package/dist/atheletebridge/components/registration/OnlinePaymentsCard.js +150 -0
- package/dist/atheletebridge/components/registration/OnlinePaymentsCard.js.map +1 -0
- package/dist/atheletebridge/hooks/useRegistrationApi.d.ts +18 -1
- package/dist/atheletebridge/hooks/useRegistrationApi.d.ts.map +1 -1
- package/dist/atheletebridge/hooks/useRegistrationApi.js +76 -33
- package/dist/atheletebridge/hooks/useRegistrationApi.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.d.ts +3 -1
- package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.js +71 -64
- package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegisterPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegisterPage.js +81 -78
- package/dist/atheletebridge/pages/registrations/RegisterPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegistrationFormsListPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegistrationFormsListPage.js +49 -47
- package/dist/atheletebridge/pages/registrations/RegistrationFormsListPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.js +120 -114
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.js.map +1 -1
- package/dist/atheletebridge/types/registration.d.ts +38 -0
- package/dist/atheletebridge/types/registration.d.ts.map +1 -1
- package/dist/atheletebridge/utils/onlineCheckout.d.ts +69 -0
- package/dist/atheletebridge/utils/onlineCheckout.d.ts.map +1 -0
- package/dist/atheletebridge/utils/onlineCheckout.js +61 -0
- package/dist/atheletebridge/utils/onlineCheckout.js.map +1 -0
- package/dist/generated/global-types.d.ts +6164 -1907
- package/dist/generated/global-types.d.ts.map +1 -1
- package/dist/generated/wspace-types.d.ts +60796 -3422
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -7,15 +7,16 @@ import { FormField as o, fieldInputClass as s } from "../../components/form.js";
|
|
|
7
7
|
import { useRecordRegistrationPayment as c, useRefundRegistrationPayment as l, useRegistrationForm as u, useRegistrationPayments as d, useRegistrationSubmission as f, useReviewRegistration as p, useVoidRegistrationPayment as m } from "../../hooks/useRegistrationApi.js";
|
|
8
8
|
import { formatMoney as h, minorToInput as g, parseMoney as _ } from "../../utils/money.js";
|
|
9
9
|
import { PAYMENT_METHODS as v, paymentMethodLabel as y, rosterNotice as b } from "../../utils/registration.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
10
|
+
import { canVoidPayment as x, paymentSourceLabel as S, providerLabel as C } from "../../utils/onlineCheckout.js";
|
|
11
|
+
import { useState as w } from "react";
|
|
12
|
+
import { AlertTriangle as T, ArrowLeft as E, Ban as D, Check as O, Loader2 as k, Plus as A, RotateCcw as j, Users as M, X as N } from "lucide-react";
|
|
13
|
+
import { useParams as P } from "react-router";
|
|
14
|
+
import { jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
14
15
|
//#region src/atheletebridge/pages/registrations/RegistrationSubmissionPage.tsx
|
|
15
|
-
var
|
|
16
|
-
function
|
|
17
|
-
let t = p(), [n, i] =
|
|
18
|
-
if (e.status === "WITHDRAWN") return /* @__PURE__ */
|
|
16
|
+
var L = "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-50", R = "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-50", z = (e, t) => e instanceof Error ? e.message : t;
|
|
17
|
+
function B({ submission: e }) {
|
|
18
|
+
let t = p(), [n, i] = w(e.reviewNotes ?? ""), [a, c] = w(null);
|
|
19
|
+
if (e.status === "WITHDRAWN") return /* @__PURE__ */ F("p", {
|
|
19
20
|
className: "text-sm text-text-secondary",
|
|
20
21
|
children: "The family withdrew this registration."
|
|
21
22
|
});
|
|
@@ -28,17 +29,17 @@ function L({ submission: e }) {
|
|
|
28
29
|
notes: n.trim() || void 0
|
|
29
30
|
});
|
|
30
31
|
} catch (e) {
|
|
31
|
-
c(
|
|
32
|
+
c(z(e, "Could not save the decision."));
|
|
32
33
|
}
|
|
33
34
|
};
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
+
return /* @__PURE__ */ I("div", {
|
|
35
36
|
className: "space-y-3",
|
|
36
37
|
children: [
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
+
/* @__PURE__ */ F(o, {
|
|
38
39
|
label: "Review notes",
|
|
39
40
|
htmlFor: "reviewNotes",
|
|
40
41
|
hint: "Visible to club staff only.",
|
|
41
|
-
children: /* @__PURE__ */
|
|
42
|
+
children: /* @__PURE__ */ F("textarea", {
|
|
42
43
|
id: "reviewNotes",
|
|
43
44
|
rows: 2,
|
|
44
45
|
className: s,
|
|
@@ -46,27 +47,27 @@ function L({ submission: e }) {
|
|
|
46
47
|
onChange: (e) => i(e.target.value)
|
|
47
48
|
})
|
|
48
49
|
}),
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ I("div", {
|
|
50
51
|
className: "flex flex-wrap gap-2",
|
|
51
|
-
children: [/* @__PURE__ */
|
|
52
|
+
children: [/* @__PURE__ */ I("button", {
|
|
52
53
|
type: "button",
|
|
53
|
-
className:
|
|
54
|
+
className: R,
|
|
54
55
|
disabled: t.isPending || e.status === "ACCEPTED",
|
|
55
56
|
onClick: () => void l("ACCEPT"),
|
|
56
|
-
children: [/* @__PURE__ */
|
|
57
|
-
}), /* @__PURE__ */
|
|
57
|
+
children: [/* @__PURE__ */ F(O, { className: "h-4 w-4" }), " Accept"]
|
|
58
|
+
}), /* @__PURE__ */ I("button", {
|
|
58
59
|
type: "button",
|
|
59
|
-
className:
|
|
60
|
+
className: L,
|
|
60
61
|
disabled: t.isPending || e.status === "DECLINED",
|
|
61
62
|
onClick: () => void l("DECLINE"),
|
|
62
|
-
children: [/* @__PURE__ */
|
|
63
|
+
children: [/* @__PURE__ */ F(N, { className: "h-4 w-4" }), " Decline"]
|
|
63
64
|
})]
|
|
64
65
|
}),
|
|
65
|
-
e.reviewedAt && /* @__PURE__ */
|
|
66
|
+
e.reviewedAt && /* @__PURE__ */ I("p", {
|
|
66
67
|
className: "text-xs text-text-secondary",
|
|
67
68
|
children: ["Last reviewed ", r(e.reviewedAt)]
|
|
68
69
|
}),
|
|
69
|
-
a && /* @__PURE__ */
|
|
70
|
+
a && /* @__PURE__ */ F("p", {
|
|
70
71
|
role: "alert",
|
|
71
72
|
className: "text-sm text-status-error-text",
|
|
72
73
|
children: a
|
|
@@ -74,36 +75,36 @@ function L({ submission: e }) {
|
|
|
74
75
|
]
|
|
75
76
|
});
|
|
76
77
|
}
|
|
77
|
-
function
|
|
78
|
+
function V({ submission: t, formTeamId: n }) {
|
|
78
79
|
let { navigateTo: r } = e(), i = b(t);
|
|
79
|
-
if (!i) return t.status !== "ACCEPTED" || t.rosterOutcome || !n ? null : /* @__PURE__ */
|
|
80
|
+
if (!i) return t.status !== "ACCEPTED" || t.rosterOutcome || !n ? null : /* @__PURE__ */ F("button", {
|
|
80
81
|
type: "button",
|
|
81
|
-
className: `${
|
|
82
|
+
className: `${L} mt-4 w-full justify-center`,
|
|
82
83
|
onClick: () => r(`/teams/${n}`),
|
|
83
84
|
children: "Open the team roster to add this athlete"
|
|
84
85
|
});
|
|
85
86
|
let a = i.tone === "success";
|
|
86
|
-
return /* @__PURE__ */
|
|
87
|
+
return /* @__PURE__ */ I("div", {
|
|
87
88
|
role: "status",
|
|
88
89
|
"data-testid": "registration-roster-notice",
|
|
89
90
|
className: `mt-4 space-y-2 rounded-lg border p-3 text-sm ${a ? "border-status-success-border bg-status-success-bg-subtle text-status-success-text" : "border-status-warning-border bg-status-warning-bg-subtle text-status-warning-text"}`,
|
|
90
|
-
children: [/* @__PURE__ */
|
|
91
|
+
children: [/* @__PURE__ */ I("p", {
|
|
91
92
|
className: "flex items-start gap-2",
|
|
92
|
-
children: [
|
|
93
|
+
children: [F(a ? O : T, {
|
|
93
94
|
className: "mt-0.5 h-4 w-4 shrink-0",
|
|
94
95
|
"aria-hidden": "true"
|
|
95
|
-
}), /* @__PURE__ */
|
|
96
|
-
}), i.teamId && /* @__PURE__ */
|
|
96
|
+
}), /* @__PURE__ */ F("span", { children: i.message })]
|
|
97
|
+
}), i.teamId && /* @__PURE__ */ I("button", {
|
|
97
98
|
type: "button",
|
|
98
|
-
className: `${
|
|
99
|
+
className: `${L} w-full justify-center`,
|
|
99
100
|
onClick: () => r(`/teams/${i.teamId}`),
|
|
100
|
-
children: [/* @__PURE__ */ M
|
|
101
|
+
children: [/* @__PURE__ */ F(M, { className: "h-4 w-4" }), " Open the team roster"]
|
|
101
102
|
})]
|
|
102
103
|
});
|
|
103
104
|
}
|
|
104
|
-
function
|
|
105
|
-
let t = c(), [n, r] =
|
|
106
|
-
return /* @__PURE__ */
|
|
105
|
+
function H({ submission: e }) {
|
|
106
|
+
let t = c(), [n, r] = w(g(e.amountOutstanding, e.currency)), [i, a] = w("CASH"), [l, u] = w(""), [d, f] = w(null);
|
|
107
|
+
return /* @__PURE__ */ I("form", {
|
|
107
108
|
onSubmit: async (r) => {
|
|
108
109
|
r.preventDefault(), f(null);
|
|
109
110
|
let a = _(n, e.currency);
|
|
@@ -119,16 +120,16 @@ function z({ submission: e }) {
|
|
|
119
120
|
reference: l.trim() || void 0
|
|
120
121
|
}), u("");
|
|
121
122
|
} catch (e) {
|
|
122
|
-
f(
|
|
123
|
+
f(z(e, "Could not record the payment."));
|
|
123
124
|
}
|
|
124
125
|
},
|
|
125
126
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-[9rem_12rem_1fr_auto]",
|
|
126
127
|
"aria-label": "Record a payment",
|
|
127
128
|
children: [
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ F(o, {
|
|
129
130
|
label: `Amount (${e.currency})`,
|
|
130
131
|
htmlFor: "paymentAmount",
|
|
131
|
-
children: /* @__PURE__ */
|
|
132
|
+
children: /* @__PURE__ */ F("input", {
|
|
132
133
|
id: "paymentAmount",
|
|
133
134
|
inputMode: "decimal",
|
|
134
135
|
className: s,
|
|
@@ -136,24 +137,24 @@ function z({ submission: e }) {
|
|
|
136
137
|
onChange: (e) => r(e.target.value)
|
|
137
138
|
})
|
|
138
139
|
}),
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ F(o, {
|
|
140
141
|
label: "Method",
|
|
141
142
|
htmlFor: "paymentMethod",
|
|
142
|
-
children: /* @__PURE__ */
|
|
143
|
+
children: /* @__PURE__ */ F("select", {
|
|
143
144
|
id: "paymentMethod",
|
|
144
145
|
className: s,
|
|
145
146
|
value: i,
|
|
146
147
|
onChange: (e) => a(e.target.value),
|
|
147
|
-
children: v.map((e) => /* @__PURE__ */
|
|
148
|
+
children: v.map((e) => /* @__PURE__ */ F("option", {
|
|
148
149
|
value: e,
|
|
149
150
|
children: y(e)
|
|
150
151
|
}, e))
|
|
151
152
|
})
|
|
152
153
|
}),
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ F(o, {
|
|
154
155
|
label: "Reference",
|
|
155
156
|
htmlFor: "paymentReference",
|
|
156
|
-
children: /* @__PURE__ */
|
|
157
|
+
children: /* @__PURE__ */ F("input", {
|
|
157
158
|
id: "paymentReference",
|
|
158
159
|
className: s,
|
|
159
160
|
value: l,
|
|
@@ -161,20 +162,20 @@ function z({ submission: e }) {
|
|
|
161
162
|
placeholder: "Receipt / bank / cheque no."
|
|
162
163
|
})
|
|
163
164
|
}),
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ F("div", {
|
|
165
166
|
className: "flex items-end",
|
|
166
|
-
children: /* @__PURE__ */
|
|
167
|
+
children: /* @__PURE__ */ I("button", {
|
|
167
168
|
type: "submit",
|
|
168
|
-
className:
|
|
169
|
+
className: R,
|
|
169
170
|
disabled: t.isPending,
|
|
170
171
|
children: [
|
|
171
|
-
t.isPending ? /* @__PURE__ */
|
|
172
|
+
t.isPending ? /* @__PURE__ */ F(k, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ F(A, { className: "h-4 w-4" }),
|
|
172
173
|
" ",
|
|
173
174
|
"Record"
|
|
174
175
|
]
|
|
175
176
|
})
|
|
176
177
|
}),
|
|
177
|
-
d && /* @__PURE__ */
|
|
178
|
+
d && /* @__PURE__ */ F("p", {
|
|
178
179
|
role: "alert",
|
|
179
180
|
className: "text-sm text-status-error-text sm:col-span-4",
|
|
180
181
|
children: d
|
|
@@ -182,8 +183,8 @@ function z({ submission: e }) {
|
|
|
182
183
|
]
|
|
183
184
|
});
|
|
184
185
|
}
|
|
185
|
-
function
|
|
186
|
-
let t = m(), i = l(), [a, o] =
|
|
186
|
+
function U({ payment: e }) {
|
|
187
|
+
let t = m(), i = l(), [a, o] = w(null), s = e.amount - e.refundedAmount, c = async () => {
|
|
187
188
|
let n = window.prompt("Why is this payment being voided?");
|
|
188
189
|
if (n?.trim()) {
|
|
189
190
|
o(null);
|
|
@@ -193,7 +194,7 @@ function B({ payment: e }) {
|
|
|
193
194
|
reason: n.trim()
|
|
194
195
|
});
|
|
195
196
|
} catch (e) {
|
|
196
|
-
o(
|
|
197
|
+
o(z(e, "Could not void the payment."));
|
|
197
198
|
}
|
|
198
199
|
}
|
|
199
200
|
}, u = async () => {
|
|
@@ -208,6 +209,7 @@ function B({ payment: e }) {
|
|
|
208
209
|
o(`You can refund at most ${h(s, e.currency)} of this payment.`);
|
|
209
210
|
return;
|
|
210
211
|
}
|
|
212
|
+
if (e.processor && !window.confirm(`This refunds ${h(n, e.currency)} to the payer's card through ${C(e.processor)}. Continue?`)) return;
|
|
211
213
|
let r = window.prompt("Reason for the refund?");
|
|
212
214
|
if (r?.trim()) {
|
|
213
215
|
o(null);
|
|
@@ -218,87 +220,91 @@ function B({ payment: e }) {
|
|
|
218
220
|
reason: r.trim()
|
|
219
221
|
});
|
|
220
222
|
} catch (e) {
|
|
221
|
-
o(
|
|
223
|
+
o(z(e, "Could not record the refund."));
|
|
222
224
|
}
|
|
223
225
|
}
|
|
224
226
|
}, d = t.isPending || i.isPending;
|
|
225
|
-
return /* @__PURE__ */
|
|
227
|
+
return /* @__PURE__ */ I("li", {
|
|
226
228
|
className: "space-y-1 px-4 py-3",
|
|
227
229
|
"data-testid": "registration-payment",
|
|
228
|
-
children: [/* @__PURE__ */
|
|
230
|
+
children: [/* @__PURE__ */ I("div", {
|
|
229
231
|
className: "flex flex-wrap items-center justify-between gap-3",
|
|
230
|
-
children: [/* @__PURE__ */
|
|
232
|
+
children: [/* @__PURE__ */ I("span", {
|
|
231
233
|
className: "min-w-0",
|
|
232
234
|
children: [
|
|
233
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ I("span", {
|
|
234
236
|
className: "block text-sm font-medium tabular-nums text-text-primary",
|
|
235
|
-
children: [h(e.amount, e.currency), e.refundedAmount > 0 && /* @__PURE__ */
|
|
237
|
+
children: [h(e.amount, e.currency), e.refundedAmount > 0 && /* @__PURE__ */ I("span", {
|
|
236
238
|
className: "ml-2 text-xs text-text-secondary",
|
|
237
239
|
children: ["refunded ", h(e.refundedAmount, e.currency)]
|
|
238
240
|
})]
|
|
239
241
|
}),
|
|
240
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ I("span", {
|
|
241
243
|
className: "block text-xs text-text-secondary",
|
|
242
244
|
children: [
|
|
243
|
-
|
|
244
|
-
|
|
245
|
+
/* @__PURE__ */ F("span", {
|
|
246
|
+
"data-testid": "payment-source",
|
|
247
|
+
children: S(e)
|
|
248
|
+
}),
|
|
249
|
+
" ·",
|
|
250
|
+
" ",
|
|
245
251
|
r(e.receivedAt),
|
|
246
252
|
e.reference ? ` · ${e.reference}` : ""
|
|
247
253
|
]
|
|
248
254
|
}),
|
|
249
|
-
e.voidReason && /* @__PURE__ */
|
|
255
|
+
e.voidReason && /* @__PURE__ */ I("span", {
|
|
250
256
|
className: "block text-xs text-text-secondary",
|
|
251
257
|
children: ["Voided: ", e.voidReason]
|
|
252
258
|
}),
|
|
253
|
-
e.refundReason && /* @__PURE__ */
|
|
259
|
+
e.refundReason && /* @__PURE__ */ I("span", {
|
|
254
260
|
className: "block text-xs text-text-secondary",
|
|
255
261
|
children: ["Refund: ", e.refundReason]
|
|
256
262
|
})
|
|
257
263
|
]
|
|
258
|
-
}), /* @__PURE__ */
|
|
264
|
+
}), /* @__PURE__ */ I("span", {
|
|
259
265
|
className: "flex items-center gap-2",
|
|
260
266
|
children: [
|
|
261
|
-
/* @__PURE__ */
|
|
262
|
-
e.status !== "VOIDED" && s > 0 && /* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ F(n, { status: e.status }),
|
|
268
|
+
e.status !== "VOIDED" && s > 0 && /* @__PURE__ */ I("button", {
|
|
263
269
|
type: "button",
|
|
264
|
-
className:
|
|
270
|
+
className: L,
|
|
265
271
|
disabled: d,
|
|
266
272
|
onClick: () => void u(),
|
|
267
|
-
children: [/* @__PURE__ */
|
|
273
|
+
children: [/* @__PURE__ */ F(j, { className: "h-4 w-4" }), " Refund"]
|
|
268
274
|
}),
|
|
269
|
-
e
|
|
275
|
+
x(e) && /* @__PURE__ */ I("button", {
|
|
270
276
|
type: "button",
|
|
271
|
-
className:
|
|
277
|
+
className: L,
|
|
272
278
|
disabled: d,
|
|
273
279
|
onClick: () => void c(),
|
|
274
|
-
children: [/* @__PURE__ */
|
|
280
|
+
children: [/* @__PURE__ */ F(D, { className: "h-4 w-4" }), " Void"]
|
|
275
281
|
})
|
|
276
282
|
]
|
|
277
283
|
})]
|
|
278
|
-
}), a && /* @__PURE__ */
|
|
284
|
+
}), a && /* @__PURE__ */ F("p", {
|
|
279
285
|
role: "alert",
|
|
280
286
|
className: "text-sm text-status-error-text",
|
|
281
287
|
children: a
|
|
282
288
|
})]
|
|
283
289
|
});
|
|
284
290
|
}
|
|
285
|
-
function
|
|
291
|
+
function W({ submission: e }) {
|
|
286
292
|
let t = d(e.id);
|
|
287
|
-
return t.isError ? null : /* @__PURE__ */
|
|
293
|
+
return t.isError ? null : /* @__PURE__ */ I("section", {
|
|
288
294
|
className: "space-y-4 rounded-lg border border-border-seam bg-bg-surface p-4",
|
|
289
295
|
"aria-label": "Payments",
|
|
290
296
|
children: [
|
|
291
|
-
/* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ I("div", {
|
|
292
298
|
className: "flex flex-wrap items-center justify-between gap-3",
|
|
293
|
-
children: [/* @__PURE__ */
|
|
299
|
+
children: [/* @__PURE__ */ F("h2", {
|
|
294
300
|
className: "text-base font-semibold text-text-primary",
|
|
295
301
|
children: "Payments"
|
|
296
|
-
}), /* @__PURE__ */
|
|
302
|
+
}), /* @__PURE__ */ I("span", {
|
|
297
303
|
className: "text-sm text-text-secondary",
|
|
298
304
|
children: [
|
|
299
305
|
"Paid",
|
|
300
306
|
" ",
|
|
301
|
-
/* @__PURE__ */
|
|
307
|
+
/* @__PURE__ */ F("strong", {
|
|
302
308
|
className: "tabular-nums text-text-primary",
|
|
303
309
|
children: h(e.amountPaid, e.currency)
|
|
304
310
|
}),
|
|
@@ -307,103 +313,103 @@ function V({ submission: e }) {
|
|
|
307
313
|
h(e.amountDue, e.currency),
|
|
308
314
|
" ·",
|
|
309
315
|
" ",
|
|
310
|
-
/* @__PURE__ */
|
|
316
|
+
/* @__PURE__ */ I("span", {
|
|
311
317
|
"data-testid": "submission-outstanding",
|
|
312
318
|
children: [h(e.amountOutstanding, e.currency), " outstanding"]
|
|
313
319
|
})
|
|
314
320
|
]
|
|
315
321
|
})]
|
|
316
322
|
}),
|
|
317
|
-
e.amountOutstanding > 0 && e.status !== "WITHDRAWN" && /* @__PURE__ */
|
|
318
|
-
t.isLoading ? /* @__PURE__ */
|
|
323
|
+
e.amountOutstanding > 0 && e.status !== "WITHDRAWN" && /* @__PURE__ */ F(H, { submission: e }, `${e.id}-${e.amountOutstanding}`),
|
|
324
|
+
t.isLoading ? /* @__PURE__ */ F(a, { label: "Loading payments…" }) : (t.data ?? []).length === 0 ? /* @__PURE__ */ F("p", {
|
|
319
325
|
className: "text-sm text-text-secondary",
|
|
320
326
|
children: "No payments recorded yet."
|
|
321
|
-
}) : /* @__PURE__ */
|
|
327
|
+
}) : /* @__PURE__ */ F("ul", {
|
|
322
328
|
className: "divide-y divide-border-seam rounded-lg border border-border-seam",
|
|
323
|
-
children: (t.data ?? []).map((e) => /* @__PURE__ */
|
|
329
|
+
children: (t.data ?? []).map((e) => /* @__PURE__ */ F(U, { payment: e }, e.id))
|
|
324
330
|
})
|
|
325
331
|
]
|
|
326
332
|
});
|
|
327
333
|
}
|
|
328
|
-
function
|
|
329
|
-
let { id: o, submissionId: s } =
|
|
330
|
-
if (l.isLoading) return /* @__PURE__ */
|
|
334
|
+
function G() {
|
|
335
|
+
let { id: o, submissionId: s } = P(), { navigateTo: c } = e(), l = f(s), d = u(o);
|
|
336
|
+
if (l.isLoading) return /* @__PURE__ */ F(t, {
|
|
331
337
|
title: "Registration",
|
|
332
|
-
children: /* @__PURE__ */
|
|
338
|
+
children: /* @__PURE__ */ F(a, { label: "Loading registration…" })
|
|
333
339
|
});
|
|
334
|
-
if (l.isError || !l.data) return /* @__PURE__ */
|
|
340
|
+
if (l.isError || !l.data) return /* @__PURE__ */ F(t, {
|
|
335
341
|
title: "Registration",
|
|
336
|
-
children: /* @__PURE__ */
|
|
342
|
+
children: /* @__PURE__ */ F(i, {
|
|
337
343
|
title: "Registration not found",
|
|
338
344
|
message: "This registration does not exist or you do not have access to it.",
|
|
339
345
|
onRetry: () => c(o ? `/registrations/${o}` : "/registrations")
|
|
340
346
|
})
|
|
341
347
|
});
|
|
342
348
|
let p = l.data, m = d.data?.fields ?? [], g = d.data?.fees ?? [], _ = (e) => m.find((t) => t.key === e)?.label ?? e, v = [...m.map((e) => e.key).filter((e) => e in p.answers), ...Object.keys(p.answers).filter((e) => !m.some((t) => t.key === e))];
|
|
343
|
-
return /* @__PURE__ */
|
|
344
|
-
title: /* @__PURE__ */
|
|
349
|
+
return /* @__PURE__ */ F(t, {
|
|
350
|
+
title: /* @__PURE__ */ I("span", {
|
|
345
351
|
className: "flex flex-wrap items-center gap-3",
|
|
346
352
|
children: [
|
|
347
353
|
p.participantName,
|
|
348
354
|
" ",
|
|
349
|
-
/* @__PURE__ */
|
|
355
|
+
/* @__PURE__ */ F(n, { status: p.status }),
|
|
350
356
|
" ",
|
|
351
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ F(n, { status: p.paymentStatus })
|
|
352
358
|
]
|
|
353
359
|
}),
|
|
354
360
|
description: `${p.formTitle} · submitted ${r(p.submittedAt)} · ${p.source === "STAFF_ENTRY" ? "entered by staff" : "via share link"}`,
|
|
355
|
-
actions: /* @__PURE__ */
|
|
361
|
+
actions: /* @__PURE__ */ I("button", {
|
|
356
362
|
type: "button",
|
|
357
|
-
className:
|
|
363
|
+
className: L,
|
|
358
364
|
onClick: () => c(`/registrations/${p.formId}`),
|
|
359
|
-
children: [/* @__PURE__ */
|
|
365
|
+
children: [/* @__PURE__ */ F(E, { className: "h-4 w-4" }), " Back to form"]
|
|
360
366
|
}),
|
|
361
|
-
children: /* @__PURE__ */
|
|
367
|
+
children: /* @__PURE__ */ I("div", {
|
|
362
368
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-[1fr_22rem]",
|
|
363
|
-
children: [/* @__PURE__ */
|
|
369
|
+
children: [/* @__PURE__ */ I("div", {
|
|
364
370
|
className: "space-y-6",
|
|
365
|
-
children: [/* @__PURE__ */
|
|
371
|
+
children: [/* @__PURE__ */ I("section", {
|
|
366
372
|
className: "rounded-lg border border-border-seam bg-bg-surface p-4",
|
|
367
373
|
"aria-label": "Answers",
|
|
368
374
|
children: [
|
|
369
|
-
/* @__PURE__ */
|
|
375
|
+
/* @__PURE__ */ F("h2", {
|
|
370
376
|
className: "mb-3 text-base font-semibold text-text-primary",
|
|
371
377
|
children: "Details"
|
|
372
378
|
}),
|
|
373
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ I("dl", {
|
|
374
380
|
className: "grid grid-cols-1 gap-x-6 gap-y-3 text-sm sm:grid-cols-2",
|
|
375
381
|
children: [[
|
|
376
382
|
["Contact", p.contactName],
|
|
377
383
|
["Email", p.contactEmail],
|
|
378
384
|
["Phone", p.contactPhone],
|
|
379
385
|
["Waiver accepted", p.waiverAcceptedAt ? r(p.waiverAcceptedAt) : null]
|
|
380
|
-
].filter(([, e]) => e).map(([e, t]) => /* @__PURE__ */
|
|
386
|
+
].filter(([, e]) => e).map(([e, t]) => /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("dt", {
|
|
381
387
|
className: "text-xs text-text-secondary",
|
|
382
388
|
children: e
|
|
383
|
-
}), /* @__PURE__ */
|
|
389
|
+
}), /* @__PURE__ */ F("dd", {
|
|
384
390
|
className: "text-text-primary",
|
|
385
391
|
children: t
|
|
386
392
|
})] }, e)), v.map((e) => {
|
|
387
393
|
let t = p.answers[e];
|
|
388
|
-
return /* @__PURE__ */
|
|
394
|
+
return /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("dt", {
|
|
389
395
|
className: "text-xs text-text-secondary",
|
|
390
396
|
children: _(e)
|
|
391
|
-
}), /* @__PURE__ */
|
|
397
|
+
}), /* @__PURE__ */ F("dd", {
|
|
392
398
|
className: "text-text-primary",
|
|
393
399
|
children: typeof t == "boolean" ? t ? "Yes" : "No" : String(t)
|
|
394
400
|
})] }, e);
|
|
395
401
|
})]
|
|
396
402
|
}),
|
|
397
|
-
g.length > 0 && /* @__PURE__ */
|
|
403
|
+
g.length > 0 && /* @__PURE__ */ I("div", {
|
|
398
404
|
className: "mt-4 border-t border-border-seam pt-3",
|
|
399
|
-
children: [/* @__PURE__ */
|
|
405
|
+
children: [/* @__PURE__ */ F("p", {
|
|
400
406
|
className: "mb-2 text-xs text-text-secondary",
|
|
401
407
|
children: "Fees"
|
|
402
|
-
}), /* @__PURE__ */
|
|
408
|
+
}), /* @__PURE__ */ F("ul", {
|
|
403
409
|
className: "space-y-1 text-sm",
|
|
404
|
-
children: g.filter((e) => p.selectedFeeIds.includes(e.id)).map((e) => /* @__PURE__ */
|
|
410
|
+
children: g.filter((e) => p.selectedFeeIds.includes(e.id)).map((e) => /* @__PURE__ */ I("li", {
|
|
405
411
|
className: "flex justify-between text-text-primary",
|
|
406
|
-
children: [/* @__PURE__ */
|
|
412
|
+
children: [/* @__PURE__ */ F("span", { children: e.name }), /* @__PURE__ */ F("span", {
|
|
407
413
|
className: "tabular-nums",
|
|
408
414
|
children: h(e.amount, p.currency)
|
|
409
415
|
})]
|
|
@@ -411,17 +417,17 @@ function H() {
|
|
|
411
417
|
})]
|
|
412
418
|
})
|
|
413
419
|
]
|
|
414
|
-
}), /* @__PURE__ */
|
|
415
|
-
}), /* @__PURE__ */
|
|
420
|
+
}), /* @__PURE__ */ F(W, { submission: p })]
|
|
421
|
+
}), /* @__PURE__ */ I("section", {
|
|
416
422
|
className: "h-fit rounded-lg border border-border-seam bg-bg-surface p-4",
|
|
417
423
|
"aria-label": "Review",
|
|
418
424
|
children: [
|
|
419
|
-
/* @__PURE__ */
|
|
425
|
+
/* @__PURE__ */ F("h2", {
|
|
420
426
|
className: "mb-3 text-base font-semibold text-text-primary",
|
|
421
427
|
children: "Review"
|
|
422
428
|
}),
|
|
423
|
-
/* @__PURE__ */
|
|
424
|
-
/* @__PURE__ */
|
|
429
|
+
/* @__PURE__ */ F(B, { submission: p }, p.id),
|
|
430
|
+
/* @__PURE__ */ F(V, {
|
|
425
431
|
submission: p,
|
|
426
432
|
formTeamId: d.data?.teamId ?? null
|
|
427
433
|
})
|
|
@@ -431,6 +437,6 @@ function H() {
|
|
|
431
437
|
});
|
|
432
438
|
}
|
|
433
439
|
//#endregion
|
|
434
|
-
export {
|
|
440
|
+
export { G as RegistrationSubmissionPage };
|
|
435
441
|
|
|
436
442
|
//# sourceMappingURL=RegistrationSubmissionPage.js.map
|