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