@riverbankcms/sdk 0.179.0 → 0.180.0

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 (193) hide show
  1. package/README.md +2 -2
  2. package/dist/_dts/{BlocksIslandsHydrator-DKwgs95u.d.ts → BlocksIslandsHydrator-DC_AvZwy.d.ts} +1 -1
  3. package/dist/_dts/{Page-lWenra5i.d.ts → Page-DQOxVtp3.d.ts} +7 -7
  4. package/dist/_dts/{SdkPreviewMode-BRxhRw4I.d.ts → SdkPreviewMode-DrLgY9_f.d.ts} +3 -2
  5. package/dist/_dts/{client-qWn7xAwJ.d.ts → client-BP7VBRvs.d.ts} +235 -56
  6. package/dist/_dts/{content-types-DL6GIvTm.d.ts → content-types-1-K2qi__.d.ts} +2 -2
  7. package/dist/_dts/{contracts-CzWyAiJj.d.ts → contracts-Dfqz0Tcu.d.ts} +3 -3
  8. package/dist/_dts/{generatePageMetadata-CBKd0cJ4.d.ts → generatePageMetadata-CSfAqmry.d.ts} +2 -2
  9. package/dist/_dts/{index-DVSipdrT.d.ts → index-B0_2-65A.d.ts} +3 -3
  10. package/dist/_dts/{index-DCiSHd-C.d.ts → index-BeM5Ylwf.d.ts} +5 -3
  11. package/dist/_dts/{index-BYnG_vF5.d.ts → index-Blrw2oVk.d.ts} +1 -1
  12. package/dist/_dts/{index-CaCum9mM.d.ts → index-CB5Csefo.d.ts} +2 -2
  13. package/dist/_dts/{index-CZgJrhzT.d.ts → index-DCcxLa8p.d.ts} +2 -2
  14. package/dist/_dts/{index-7CDBZGb-.d.ts → index-DQBGwBPx.d.ts} +1 -1
  15. package/dist/_dts/{index-BU9uAkHB.d.ts → index-DQr358-m.d.ts} +4 -4
  16. package/dist/_dts/{loadContent-CPKbFQyq.d.ts → loadContent-BG2tLGXj.d.ts} +7 -7
  17. package/dist/_dts/{request-BjKBCS7t.d.ts → request-P08l6mkr.d.ts} +2602 -821
  18. package/dist/_dts/{resolveBlockData-DupbMCup.d.ts → resolveBlockData-BDHc8lFs.d.ts} +5 -5
  19. package/dist/_dts/{resolvePageContent-BqNyCHi8.d.ts → resolvePageContent-Y3IZBbtL.d.ts} +1 -1
  20. package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
  21. package/dist/_dts/sdk/src/client/types.d.ts +2 -2
  22. package/dist/_dts/sdk/src/client.d.ts +7 -7
  23. package/dist/_dts/sdk/src/config/index.d.ts +6 -6
  24. package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
  25. package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
  26. package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
  27. package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
  28. package/dist/_dts/sdk/src/data/types.d.ts +2 -2
  29. package/dist/_dts/sdk/src/gifting/client.d.ts +1 -1
  30. package/dist/_dts/sdk/src/index.d.ts +8 -8
  31. package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
  32. package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
  33. package/dist/_dts/sdk/src/navigation/index.d.ts +3 -3
  34. package/dist/_dts/sdk/src/next/index.d.ts +8 -8
  35. package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
  36. package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
  37. package/dist/_dts/sdk/src/portal/client.d.ts +3 -3
  38. package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
  39. package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
  40. package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
  41. package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
  42. package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
  43. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
  44. package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
  45. package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +4 -4
  46. package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
  47. package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
  48. package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
  49. package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
  50. package/dist/_dts/sdk/src/routing/index.d.ts +6 -6
  51. package/dist/_dts/sdk/src/server.d.ts +5 -5
  52. package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
  53. package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
  54. package/dist/_dts/{serviceBookingOutline-YcsIjvn1.d.ts → serviceBookingOutline-BvtNagjw.d.ts} +8 -7
  55. package/dist/_dts/{types-BOxSq-Bq.d.ts → types-BrK6SS5c.d.ts} +9 -8
  56. package/dist/_dts/{types-CT-KOxl_.d.ts → types-DpEAnP4F.d.ts} +7 -2
  57. package/dist/_dts/{types-B7e6Lmo5.d.ts → types-HAy1-Jjo.d.ts} +3 -3
  58. package/dist/_dts/{validation-Dz6qccue.d.ts → validation-D6q3tOBA.d.ts} +4 -4
  59. package/dist/client/{BlocksIslandsHydrator-1XifJg6V.mjs → BlocksIslandsHydrator-DJSmdNUJ.mjs} +16 -16
  60. package/dist/client/{BookingMailingListNote-BsbEgagJ.mjs → BookingMailingListNote-CGxg37zx.mjs} +91 -59
  61. package/dist/client/{BookingQuestionFields-C8IbeLHj.mjs → BookingQuestionFields-DXegGSnS.mjs} +24 -3
  62. package/dist/client/{CalendarNavigationChevron-Bbqij1XQ.mjs → CalendarNavigationChevron-VfP50sYm.mjs} +5 -5
  63. package/dist/client/{DemoBookingPortalAccess-uA9H8LIL.mjs → DemoBookingPortalAccess-0Ua44F1j.mjs} +12 -7
  64. package/dist/client/{EventCalendar.client-yoSI77ov.mjs → EventCalendar.client-CrpiyDSP.mjs} +9 -9
  65. package/dist/client/{EventCombined.client-HeCNlliq.mjs → EventCombined.client-D0me9wnz.mjs} +8 -8
  66. package/dist/client/{EventItem-Duhk1vnF.mjs → EventItem-CJITrGkF.mjs} +5 -4
  67. package/dist/client/{EventListWeekNavigation-BiutEqPK.mjs → EventListWeekNavigation-BlEm_xjq.mjs} +1 -1
  68. package/dist/client/{EventListing.client-B5ln77jG.mjs → EventListing.client-BNM_HuS0.mjs} +3 -3
  69. package/dist/client/{EventListing.view-hUDhNtMv.mjs → EventListing.view-CXfb7RRy.mjs} +7 -210
  70. package/dist/client/{EventRegistrationPayment-DqtX1vB2.mjs → EventRegistrationPayment-DiD9uYs6.mjs} +1292 -224
  71. package/dist/client/{Page-ChJ2TGVk.mjs → Page-bX7iy_MK.mjs} +158 -50
  72. package/dist/client/{SiteTermsAgreementField-CDBU31xW.mjs → SiteTermsAgreementField-BAdW5DvE.mjs} +22 -15
  73. package/dist/client/{StepIndicator-JQA-VuEH.mjs → StepIndicator-DCfdcb7s.mjs} +1 -1
  74. package/dist/client/{StepIndicator-2Dl9zon2.mjs → StepIndicator-DCqorVne.mjs} +6 -6
  75. package/dist/client/{accordion-B6SqU49k.mjs → accordion-wofJY8xY.mjs} +1 -1
  76. package/dist/client/{booking-form.client-DrEOjQ3N.mjs → booking-form.client-CYl9NrqS.mjs} +410 -77
  77. package/dist/client/{bookingForm-drZBwEZW.mjs → bookingForm-kgVWtuMe.mjs} +4 -4
  78. package/dist/client/bookings.mjs +40 -10
  79. package/dist/client/{boxStyleClassNames-DEh45w16.mjs → boxStyleClassNames-CQHWz5gJ.mjs} +2 -2
  80. package/dist/client/{carousel-C-YJliD-.mjs → carousel-BE1dEFsD.mjs} +1 -1
  81. package/dist/client/{cart-acGFWK9R.mjs → cart-BsjsdGZE.mjs} +3 -3
  82. package/dist/client/{cart.client-BzlOGP2j.mjs → cart.client-DylGUWXY.mjs} +1 -1
  83. package/dist/client/{checkout-SEontwhy.mjs → checkout-B5KxEUDr.mjs} +3 -3
  84. package/dist/client/{checkout.client-C0Qvh-d4.mjs → checkout.client-C98fhch3.mjs} +1 -1
  85. package/dist/client/{checkoutUrls-yUKeq1N9.mjs → checkoutUrls-BMLYTf38.mjs} +1 -1
  86. package/dist/client/client.mjs +224 -158
  87. package/dist/client/constants-PfYJsEZF.mjs +101 -0
  88. package/dist/client/{context-DTrwaQtg.mjs → context-DtKdUdkO.mjs} +199 -27
  89. package/dist/client/{dateFormatting-Cg8E1r9l.mjs → dateFormatting-BaGPvQS3.mjs} +1 -1
  90. package/dist/client/{demoPortalMagicLink-D0kOJYOX.mjs → demoPortalMagicLink-B8eDjhuG.mjs} +1 -1
  91. package/dist/client/{enhanceHeaderSection-DyrpZ7ks.mjs → enhanceHeaderSection-DvhD-8eE.mjs} +3 -3
  92. package/dist/client/{event-registration.client-RLZQWi2V.mjs → event-registration.client-Du9a_xAN.mjs} +1980 -1517
  93. package/dist/client/{eventCalendar-CphYnImh.mjs → eventCalendar-Di9wDfzl.mjs} +4 -4
  94. package/dist/client/{eventCombined-BvqjASB_.mjs → eventCombined-CNW6nBsB.mjs} +4 -4
  95. package/dist/client/{eventListing-BaNAoC_M.mjs → eventListing-CQMxQ8By.mjs} +4 -4
  96. package/dist/client/{eventRegistration-COMHoRl6.mjs → eventRegistration-CprS9k1D.mjs} +4 -4
  97. package/dist/client/{form-DyH2juYT.mjs → form-Zl1_8RJ6.mjs} +3 -3
  98. package/dist/client/{form.client-DBwzkB0M.mjs → form.client-TaMUys6I.mjs} +4 -4
  99. package/dist/client/{form.parts-CY4kX3mh.mjs → form.parts-CpNPbPPM.mjs} +1 -1
  100. package/dist/client/{formatDate-CTEN7gxW.mjs → formatDate-hhI1-tzt.mjs} +1 -1
  101. package/dist/client/gifting/client.mjs +5 -5
  102. package/dist/client/{gifting-CIx4V378.mjs → gifting-DNVa7-Wj.mjs} +4 -4
  103. package/dist/client/{gifting.client-BEVPpzJM.mjs → gifting.client-CFUq3GVx.mjs} +4 -4
  104. package/dist/client/{gifting.parts-VnORjnZK.mjs → gifting.parts-CDQvxA4A.mjs} +2 -2
  105. package/dist/client/{headerSection-DGcJfRS8.mjs → headerSection-Cg6083rn.mjs} +2 -2
  106. package/dist/client/{lookSurfaces-IqT_SVnX.mjs → lookSurfaces-gJ3OqPf9.mjs} +92 -2
  107. package/dist/client/{newsletter-form.client-BvEDkjiD.mjs → newsletter-form.client-VuL9I96G.mjs} +5 -5
  108. package/dist/client/{newsletter-form.interactive-DCO1lErD.mjs → newsletter-form.interactive-7Of3eYn0.mjs} +18 -24
  109. package/dist/client/{newsletter-form.parts-BIy4IUT3.mjs → newsletter-form.parts-OBqsfT24.mjs} +1 -1
  110. package/dist/client/{newsletterForm-CoTXDNFS.mjs → newsletterForm-BkJe_RTv.mjs} +3 -3
  111. package/dist/client/portal/client.mjs +299 -115
  112. package/dist/client/{product-detail.client-YHQ2aKX1.mjs → product-detail.client-B2hdxqJN.mjs} +1 -1
  113. package/dist/client/{product-list.client-DxoZw1vF.mjs → product-list.client-CCEgu9rx.mjs} +1 -1
  114. package/dist/client/{productDetail-DjuFvkey.mjs → productDetail-CRX_ZRfS.mjs} +3 -3
  115. package/dist/client/{productList-DE9GEFoZ.mjs → productList-BAdJ6z5S.mjs} +3 -3
  116. package/dist/client/{propsDecoder-Cyag_HOs.mjs → propsDecoder-BLKAmX0S.mjs} +2 -2
  117. package/dist/client/{registry.server-BPwV-0Pp.mjs → registry.server-Bj9cmHHF.mjs} +89 -50
  118. package/dist/client/rendering/client.mjs +22 -22
  119. package/dist/client/rendering/islands.mjs +1 -1
  120. package/dist/client/rendering.mjs +4 -4
  121. package/dist/client/{richText-coerce-NrRqDeOg.mjs → richText-coerce-Z45OLLEX.mjs} +1 -1
  122. package/dist/client/{routeIslandApiConfig-BWq5gKFK.mjs → routeIslandApiConfig-DHpTTK77.mjs} +1 -1
  123. package/dist/client/{shop-C3wM0Hr4.mjs → shop-BKsgxm_-.mjs} +3 -3
  124. package/dist/client/{shop-commerce-34YvcpbX.mjs → shop-commerce-Cbtk_kUW.mjs} +12 -12
  125. package/dist/client/{shop-commerce-store-B7xHksOs.mjs → shop-commerce-store-B-rv2p5h.mjs} +1 -1
  126. package/dist/client/{shop-discount-apply.state-BiBnozfO.mjs → shop-discount-apply.state-CiCDLNh7.mjs} +2 -2
  127. package/dist/client/{shop.client-C0v88nLd.mjs → shop.client-Rnqa74Tk.mjs} +12 -12
  128. package/dist/client/{shopShared-Ct-BRNez.mjs → shopShared-BaBfhjCq.mjs} +2 -2
  129. package/dist/client/{src-CCtanNlD.mjs → src-o7WEvbK1.mjs} +118 -3
  130. package/dist/client/{timetableModel-lhE29TNT.mjs → timetableModel-BOff1Kk5.mjs} +201 -7
  131. package/dist/client/{useAvailableSlots-BelJviOT.mjs → useAvailableSlots-DQJNh10g.mjs} +3 -23
  132. package/dist/client/{useDiscountCodeUi-rQRE1-Ho.mjs → useDiscountCodeUi-BcFQRI_7.mjs} +1 -1
  133. package/dist/client/{useEventPagination-C4rS2Xxl.mjs → useEventPagination-BvdcexDC.mjs} +7 -7
  134. package/dist/client/{view-LJVHVqsy.mjs → view-CTBwSpKv.mjs} +3 -3
  135. package/dist/client/{wizardSteps-CNDsxeJH.mjs → wizardSteps-CWIQyRIw.mjs} +1605 -442
  136. package/dist/preview-next/before-render.mjs +1 -0
  137. package/dist/preview-next/client/{LocationPickerEnvironment-BHAT81Wx.mjs → LocationPickerEnvironment-BW3dRFIv.mjs} +1 -1
  138. package/dist/preview-next/client/{MapLibreEditMap-B52hkdIZ.mjs → MapLibreEditMap-Db9BHyXh.mjs} +2 -2
  139. package/dist/preview-next/client/{PageSectionToolbar-C4TtBPN-.mjs → PageSectionToolbar-CG6KwITA.mjs} +4 -4
  140. package/dist/preview-next/client/{PreviewEditorSidebar-D6fkE59-.mjs → PreviewEditorSidebar-BGBqrC9m.mjs} +8 -7
  141. package/dist/preview-next/client/{PreviewEditorUI-amcDlj0O.mjs → PreviewEditorUI-Bwkyx28x.mjs} +5 -5
  142. package/dist/preview-next/client/{PreviewShell-DeQjx4zk.mjs → PreviewShell-DB1l6JNU.mjs} +7 -7
  143. package/dist/preview-next/client/{SdkPreviewModeRuntime-Cx0SXnoX.mjs → SdkPreviewModeRuntime-Bs6Cwzr3.mjs} +15 -7
  144. package/dist/preview-next/client/{lucide-react-McYZeSMb.mjs → lucide-react-00FF_oar.mjs} +13 -1
  145. package/dist/preview-next/client/{previewAssistantSlot-aqpU34WI.mjs → previewAssistantSlot-T-oDD_Dd.mjs} +5735 -2073
  146. package/dist/preview-next/client/{previewChromeRoot-D3Gy_Rs0.mjs → previewChromeRoot-BeukcDRy.mjs} +1 -1
  147. package/dist/preview-next/client/runtime.mjs +3 -3
  148. package/dist/preview-next/client/{sdk-runtime-Dzx_RrN7.mjs → sdk-runtime-ceDW_9q2.mjs} +2 -2
  149. package/dist/preview-next/client/{siteStyleAccess-LHedw83e.mjs → siteStyleAccess-CCB9bScO.mjs} +35 -23
  150. package/dist/preview-next/client/{useAutosaveStatus-DpSd9aVk.mjs → useAutosaveStatus-D4o0CKq7.mjs} +1 -1
  151. package/dist/preview-next/client/{useOpenBlockForSetup-BGZn5AT1.mjs → useOpenBlockForSetup-Seccrvwu.mjs} +2 -2
  152. package/dist/preview-next/container-responsive.css +103 -10
  153. package/dist/preview-next/keepAlive.mjs +1 -1
  154. package/dist/preview-next/middleware.mjs +1 -1
  155. package/dist/preview-next/{route-contract-DnL-FgSV.mjs → route-contract-FwFj8zGL.mjs} +43 -0
  156. package/dist/server/{Block.shared-BEbq6EwO.mjs → Block.shared-D6WrRCxX.mjs} +4 -4
  157. package/dist/server/{ThemeScopeCore-DFEM1a85.mjs → ThemeScopeCore-BQzjDQ2q.mjs} +8 -1
  158. package/dist/server/{bindings-Bly0dRs7.mjs → bindings-CS6ih1Yc.mjs} +4 -4
  159. package/dist/server/{client-CGJ2ztYp.mjs → client-m0ylCj_f.mjs} +847 -786
  160. package/dist/server/config-validation.mjs +1 -1
  161. package/dist/server/config.mjs +2 -2
  162. package/dist/server/data/resolveBlockData.mjs +1 -1
  163. package/dist/server/index.mjs +2 -2
  164. package/dist/server/{loadContent-BkK1w3QQ.mjs → loadContent-vgWMz1uD.mjs} +6 -4
  165. package/dist/server/{loadPage-DTLe0FEs.mjs → loadPage-CIOL3-9t.mjs} +3 -3
  166. package/dist/server/{lookMediaFrame-CaH018pK.mjs → lookMediaFrame-m-91jGGn.mjs} +36 -0
  167. package/dist/server/next.mjs +43 -30
  168. package/dist/server/{overrideResolution-Uy9Zp2Ks.mjs → overrideResolution-BiHmsvTZ.mjs} +1 -1
  169. package/dist/server/page-converter.mjs +1 -1
  170. package/dist/server/{pageRenderPlan-JzxBnqfV.mjs → pageRenderPlan-DJo_obpi.mjs} +9 -7
  171. package/dist/server/{pageRuntimeSupport-DyNSd2Yj.mjs → pageRuntimeSupport-BnSuoHON.mjs} +5 -1
  172. package/dist/server/{pageShared-DU4ETFPS.mjs → pageShared-BJuOzxzn.mjs} +550 -258
  173. package/dist/server/{prebuild-8jNtDXmS.mjs → prebuild-Cr8p8T7V.mjs} +1 -1
  174. package/dist/server/prebuild.mjs +1 -1
  175. package/dist/server/{prefetchBlockData-xeMG42aw.mjs → prefetchBlockData-BZh57-ua.mjs} +4 -3
  176. package/dist/server/{registry-DH1VrsCl.mjs → registry-CvhFwbXJ.mjs} +240 -80
  177. package/dist/server/rendering/components/pageShared.mjs +1 -1
  178. package/dist/server/rendering/helpers/loadPage.mjs +1 -1
  179. package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
  180. package/dist/server/rendering/server.mjs +4 -4
  181. package/dist/server/rendering.mjs +8 -8
  182. package/dist/server/{resolveBlockData-BN8tweTx.mjs → resolveBlockData-Cv_W1LVB.mjs} +39 -31
  183. package/dist/server/{resolvePageContent-DnM16_f9.mjs → resolvePageContent-BWKUZUIn.mjs} +1 -1
  184. package/dist/server/{responseMedia-F-ElH2Rd.mjs → responseMedia-KRKguBC5.mjs} +56 -1
  185. package/dist/server/routing.mjs +1 -1
  186. package/dist/server/server.mjs +3 -3
  187. package/dist/server/{servicePageContent-B-FezJmH.mjs → servicePageContent-CRKbTm_7.mjs} +14 -10
  188. package/dist/server/theme-bridge.mjs +1 -1
  189. package/dist/server/{validation-3jOzYdPL.mjs → validation-DCl-FCk_.mjs} +4 -4
  190. package/dist/server/{version-8t0o6_jd.mjs → version-DT_R5JAR.mjs} +1 -1
  191. package/dist/styles/index.css +504 -27
  192. package/package.json +1 -1
  193. package/dist/client/constants-4o4_hl34.mjs +0 -6
@@ -1,23 +1,22 @@
1
1
  "use client";
2
- import { A as bookingPanelHeading, D as bookingCardEntry, E as bookingBarPlacement, M as cancelledDateCopy, N as hasCancelledRegistrationDate, O as bookingEntry, Sn as formatEventPriceDisplay, T as DEFAULT_BOOKING_BUTTON_TEXT, b as displayButtonText, j as courseTitleOf, k as bookingEntryProgress, v as buildEventRegistrationDisplayFromScopedEvents, w as offeringNounForEvent, y as buildEventRegistrationInteractiveIslandProps } from "./newsletter-form.interactive-DCO1lErD.mjs";
3
- import { $n as placesLeftLabel, A as isEventRegistrationAvailable, Aa as getEventAvailability, Ar as resolveEventRegistrationScopedEvents, B as paymentChoiceDetails, Bn as getTicketSelectionTotal, Bt as selectionAtLimit, Cn as getVisibleTicketTypes, D as settledRemainingPlaces, Dt as SELECTION_LIMIT_NOTE, Ea as canJoinEventWaitlistOnAnyMode, En as withOccurrenceTitle, Fa as selectMostOpenCapacitySource, Ht as selectionConsentLabel, It as runChoiceUsable, Jt as selectionPlacesNote, Kt as selectionItemsLabel, Ln as canRequestTicketOption, Lt as runNeedsPricingChoice, Ma as getRemainingPlaces, Na as isEventFull, Ot as SEVERAL_BOOKINGS_ACCOUNT_NOTE, Pa as selectEventCapacitySource, Ro as INCOMPATIBLE_ATTENDANCE_MESSAGE, Rt as runPricingChoice, Sn as getTicketTypeAvailabilityLabel, T as resolveRegistrationAvailabilityBlocker, Ta as canJoinEventWaitlist, Ut as selectionEntitlementNote, V as paymentChoicePrice, Vn as getTicketTypeLineMax, Vt as selectionConfirmationHint, Wn as setTicketLineQuantity, Wt as selectionIncludes, Xr as getRegistrationSuccessCopy, Yt as selectionRowAvailability, Zt as severalConfirmationSentence, _ as shouldPromptForLogin, _a as bookingPresentation, _n as formatPassCreditUsageLabel, b as placeCountCeiling, c as registrationStepLabelContext, dn as ENTITLEMENT_SINGLE_TICKET_TOOLTIP, fi as formatCentsAsCurrencyInput, fn as areEntitlementsDisabledForTicketCount, fs as publicEventPricingStrategy, gn as formatEventDateTime, hn as formatDate, in as combinationOffersOf, j as normalizeEventRegistrationMaxTickets, kt as canToggleSelectionItem, l as areEventRegistrationPaymentSelectionsEqual, mn as formatBookingWhen, n as getEventSelectionMode, nr as shownVenue, ot as confirmationPaymentRows, pi as formatPrice, ps as publicEventPricingType, qt as selectionPlacesLabel, r as panelShouldOpen, rn as combinationOfferLine, rr as appliedDiscountHint, s as registrationStepLabel, sn as selectionItemName, st as resolveFinishedPresentation, us as publicEventPricingCurrency, v as fullyBookedLabel, vn as formatRegistrationSchedule, wn as occurrenceTitleOverride, yn as formatTime, zn as getTicketLineQuantity, zt as runUnitPriceCents } from "./wizardSteps-CNDsxeJH.mjs";
4
- import { bn as formatCurrencyAmount, t as assertNever } from "./src-CCtanNlD.mjs";
5
- import { g as formatCreditProductUnits } from "./creditProducts-BQ1t1erI.mjs";
6
- import { a as eventSiteTermsSurface, n as SiteTermsChangedNotice, t as SiteTermsAgreementField } from "./SiteTermsAgreementField-CDBU31xW.mjs";
7
- import { a as planEventRegistrationSurface, i as useEventRegistrationRecoveryRequest, o as registrationAdmissionSurface, r as useEventRegistrationWizard, s as resolveEventRegistrationClientSurface, t as EventPaymentMount } from "./EventRegistrationPayment-DqtX1vB2.mjs";
8
- import { n as useBlockApi } from "./context-DTrwaQtg.mjs";
2
+ import { A as bookingPanelHeading, D as bookingCardEntry, E as bookingBarPlacement, M as cancelledDateCopy, N as hasCancelledRegistrationDate, O as bookingEntry, Sn as formatEventPriceDisplay, T as DEFAULT_BOOKING_BUTTON_TEXT, b as displayButtonText, j as courseTitleOf, k as bookingEntryProgress, v as buildEventRegistrationDisplayFromScopedEvents, w as offeringNounForEvent, y as buildEventRegistrationInteractiveIslandProps } from "./newsletter-form.interactive-7Of3eYn0.mjs";
3
+ import { $n as getTicketSelectionTotal, $t as runNeedsPricingChoice, An as formatEventDateTime, Ba as canJoinEventWaitlistOnAnyMode, C as registrationStopsHere, E as resolveRegistrationAvailabilityBlocker, Fn as getTicketTypeAvailabilityLabel, Hi as formatPrice, Ht as SELECTION_LIMIT_NOTE, In as getVisibleTicketTypes, Ja as selectEventCapacitySource, Ka as getRemainingPlaces, Ln as occurrenceTitleOverride, M as isEventRegistrationAvailable, Mn as formatTime, Ms as publicEventPricingType, N as normalizeEventRegistrationMaxTickets, O as settledRemainingPlaces, On as formatBookingWhen, Qn as getTicketLineQuantity, Qo as INCOMPATIBLE_ATTENDANCE_MESSAGE, Qt as runChoiceUsable, St as resolveFinishedPresentation, U as paymentChoiceDetails, Ur as resolveEventRegistrationScopedEvents, Ut as SEVERAL_BOOKINGS_ACCOUNT_NOTE, Vi as formatCentsAsCurrencyInput, W as paymentChoicePrice, Wa as getEventAvailability, Wt as canToggleSelectionItem, Xn as canRequestTicketOption, Ya as selectMostOpenCapacitySource, _ as closedAdmissionLabel, an as selectionEntitlementNote, b as placeCountCeiling, bn as combinationOffersOf, c as registrationStepLabelContext, cn as selectionItemsLabel, dn as selectionRowAvailability, en as runPricingChoice, er as getTicketTypeLineMax, es as setRoomChoicePeople, fr as placesLeftLabel, g as shouldPromptForLogin, hr as shownVenue, in as selectionConsentLabel, ja as bookingPresentation, jn as formatRegistrationSchedule, js as publicEventPricingStrategy, kn as formatDate, ks as publicEventPricingCurrency, l as areEventRegistrationPaymentSelectionsEqual, li as getRegistrationSuccessCopy, ln as selectionPlacesLabel, lt as ADD_A_PLACE, n as getEventSelectionMode, nn as selectionAtLimit, on as selectionIncludes, pn as severalConfirmationSentence, qa as isEventFull, r as panelShouldOpen, rn as selectionConfirmationHint, rr as setTicketLineQuantity, s as registrationStepLabel, tn as runUnitPriceCents, un as selectionPlacesNote, v as fullyBookedLabel, wn as selectionItemName, xt as confirmationPaymentRows, yn as combinationOfferLine, za as canJoinEventWaitlist, zn as withOccurrenceTitle } from "./wizardSteps-CWIQyRIw.mjs";
4
+ import { Tn as formatCurrencyAmount, t as assertNever } from "./src-o7WEvbK1.mjs";
5
+ import { n as SiteTermsChangedNotice, t as SiteTermsAgreementField } from "./SiteTermsAgreementField-BAdW5DvE.mjs";
6
+ import { a as ONE_DATE_FUNDING_LOAD_FAILED, c as planEventRegistrationSurface, i as summaryExplainsMoreThanTheOption, l as registrationAdmissionSurface, o as SELECTION_FUNDING_LOAD_FAILED, r as useEventRegistrationWizard, s as useEventRegistrationRecoveryRequest, t as EventPaymentMount, u as resolveEventRegistrationClientSurface } from "./EventRegistrationPayment-DiD9uYs6.mjs";
7
+ import { n as useBlockApi } from "./context-DtKdUdkO.mjs";
9
8
  import { r as ThemedButton, x as SpinnerNode } from "./ThemedButton-CnSa7o-I.mjs";
10
- import { t as EVENT_REGISTRATION_ANCHOR_ID } from "./constants-4o4_hl34.mjs";
11
- import { f as NavigationHandOffPanel, p as DiscountCodeDisclosure, t as BookingConfirmation } from "./DemoBookingPortalAccess-uA9H8LIL.mjs";
9
+ import { t as EVENT_REGISTRATION_ANCHOR_ID } from "./constants-PfYJsEZF.mjs";
10
+ import { m as DiscountCodeDisclosure, p as NavigationHandOffPanel, t as BookingConfirmation } from "./DemoBookingPortalAccess-0Ua44F1j.mjs";
12
11
  import { t as createBodyThemePortalRoot } from "./themePortalRoot-DeP49PT8.mjs";
13
12
  import { t as CheckboxChoice } from "./CheckboxChoice-BZPLCgTU.mjs";
14
13
  import { t as CrossIcon } from "./CrossIcon-CpG9VRyW.mjs";
15
14
  import { n as getFieldValidationControlProps, t as FieldValidationMessage } from "./FieldValidationMessage-CsqxShw4.mjs";
16
15
  import { t as FeedbackMessage } from "./FeedbackMessage-CSJrAuXH.mjs";
17
- import { n as TerminalPanel, r as StateIcon } from "./useDiscountCodeUi-rQRE1-Ho.mjs";
16
+ import { n as TerminalPanel, r as StateIcon } from "./useDiscountCodeUi-BcFQRI_7.mjs";
18
17
  import { t as ModalShell } from "./ModalShell-B_fHWK71.mjs";
19
- import { i as BookingConsentAgreement, l as PaymentChoiceRows, n as BookingQuestionSections, r as MagicLinkForm, t as BookingMailingListNote } from "./BookingMailingListNote-BsbEgagJ.mjs";
20
- import { a as planEventBookingPanel, c as EventBookingPanelView, i as RegistrationClosedState, n as BookingEntryBar, o as registrationSourceForPanel, r as BookingEntryCard, s as resolveBookingPanelSelection, t as StepIndicator } from "./StepIndicator-2Dl9zon2.mjs";
18
+ import { a as MagicLinkForm, d as PaymentChoiceRows, n as OrganiserContactLine, o as BookingConsentAgreement, r as BookingQuestionSections, t as BookingMailingListNote } from "./BookingMailingListNote-CGxg37zx.mjs";
19
+ import { a as planEventBookingPanel, c as EventBookingPanelView, i as RegistrationClosedState, n as BookingEntryBar, o as registrationSourceForPanel, r as BookingEntryCard, s as resolveBookingPanelSelection, t as StepIndicator } from "./StepIndicator-DCqorVne.mjs";
21
20
  import { t as createLucideIcon } from "./createLucideIcon-BrXgHVKN.mjs";
22
21
  import React, { useCallback, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
23
22
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -393,1387 +392,1609 @@ function EventRegistrationBookingLayer(props) {
393
392
  ] });
394
393
  }
395
394
  //#endregion
396
- //#region ../blocks/src/system/runtime/nodes/event-registration/ErrorStep.tsx
397
- /**
398
- * Error Step
399
- *
400
- * Displays an error message with a retry button when registration fails.
401
- */
402
- const labels = {
403
- none: "",
404
- retry: "Try again",
405
- places: "Choose places",
406
- start: "Start again",
407
- details: "Check my details",
408
- "payment-options": "View payment options",
409
- portal: "View my bookings",
410
- event: "View event"
411
- };
412
- const ErrorStep = ({ message, onRetry, action = "retry", canJoinWaitlist = false }) => {
413
- const offerWaitlist = action === "places" && canJoinWaitlist;
414
- return /* @__PURE__ */ jsx(TerminalPanel, {
415
- tone: "error",
416
- className: "er-center",
417
- titleClassName: "er-title--lg er-message",
418
- icon: /* @__PURE__ */ jsx(StateIcon, {
419
- variant: "error",
420
- children: /* @__PURE__ */ jsx(CrossIcon, {})
421
- }),
422
- title: "We couldn’t complete your booking",
423
- body: /* @__PURE__ */ jsx("p", {
424
- className: "er-text--muted er-message",
425
- children: offerWaitlist ? "Sorry, this event is now full. You can join the waiting list, and we’ll email you if a place becomes available." : message
426
- }),
427
- actions: action === "none" ? void 0 : action === "portal" ? /* @__PURE__ */ jsx("a", {
428
- href: "/portal",
429
- className: "er-retry-btn",
430
- children: labels[action]
431
- }) : /* @__PURE__ */ jsx("button", {
432
- type: "button",
433
- onClick: onRetry,
434
- className: "er-retry-btn",
435
- children: offerWaitlist ? "Join the waiting list" : labels[action]
436
- })
437
- });
438
- };
439
- //#endregion
440
- //#region ../blocks/src/system/runtime/nodes/event-registration/CopyParts.tsx
441
- /** Copy with its bold parts in <strong>: offer lines and hints (issue 1725). */
442
- function CopyParts(props) {
443
- return /* @__PURE__ */ jsx(Fragment, { children: props.parts.map((part, index) => part.strong ? /* @__PURE__ */ jsx("strong", { children: part.text }, index) : /* @__PURE__ */ jsx(React.Fragment, { children: part.text }, index)) });
395
+ //#region ../blocks/src/system/runtime/nodes/event-registration/TicketSelectionStep.tsx
396
+ function pluralizeBookingUnit(kind, quantity) {
397
+ return `${kind}${quantity === 1 ? "" : "s"}`;
444
398
  }
445
- //#endregion
446
- //#region ../blocks/src/system/runtime/nodes/event-registration/CombinationSummary.tsx
447
- /** The usual total struck through, then what combination prices bring it to (issue 1725). */
448
- function CombinationPricing(props) {
449
- return /* @__PURE__ */ jsxs("div", {
450
- className: "er-summary-bar-pricing",
451
- children: [/* @__PURE__ */ jsx("span", {
452
- className: "er-summary-bar-price er-summary-bar-price--struck",
453
- children: formatPrice(props.listCents, props.currency)
454
- }), /* @__PURE__ */ jsx("span", {
455
- className: "er-summary-bar-price",
456
- children: formatPrice(props.totalCents, props.currency)
457
- })]
458
- });
399
+ function getEventAttendanceModeLabel(mode) {
400
+ switch (mode) {
401
+ case "in_person": return "In person";
402
+ case "online": return "Online";
403
+ }
459
404
  }
460
- /** "4 dates for £40, plus 1 at £12 · You save £8" under the summary row. */
461
- function CombinationDetail(props) {
462
- if (!props.working) return null;
463
- return /* @__PURE__ */ jsxs("p", {
464
- className: "er-combination-detail",
405
+ function TicketCounter(props) {
406
+ const { ticketsCount, maxAllowed, label, onTicketsChange } = props;
407
+ const minAllowed = props.minAllowed ?? 1;
408
+ return /* @__PURE__ */ jsxs("div", {
409
+ className: "rb-reg-row er-row er-counter",
465
410
  children: [
466
- props.working.working,
467
- " · ",
411
+ /* @__PURE__ */ jsx("button", {
412
+ type: "button",
413
+ "aria-label": `Decrease ${label}`,
414
+ onClick: () => onTicketsChange(stepNumber(ticketsCount, -1, { min: minAllowed })),
415
+ disabled: ticketsCount <= minAllowed,
416
+ className: "er-counter-btn",
417
+ children: "−"
418
+ }),
468
419
  /* @__PURE__ */ jsx("span", {
469
- className: "er-combination-saving",
470
- children: props.working.saving
420
+ className: "er-counter-value",
421
+ children: ticketsCount
422
+ }),
423
+ /* @__PURE__ */ jsx("button", {
424
+ type: "button",
425
+ "aria-label": `Increase ${label}`,
426
+ onClick: () => onTicketsChange(stepNumber(ticketsCount, 1, { max: maxAllowed })),
427
+ disabled: ticketsCount >= maxAllowed,
428
+ className: "er-counter-btn",
429
+ children: "+"
471
430
  })
472
431
  ]
473
432
  });
474
433
  }
475
- /** "Add 1 more date to get 4 dates for £40." under the summary bar. */
476
- function CombinationHint(props) {
477
- if (!props.parts) return null;
478
- return /* @__PURE__ */ jsx("p", {
479
- className: "er-combination-hint",
480
- role: "status",
481
- children: /* @__PURE__ */ jsx(CopyParts, { parts: props.parts })
434
+ function TicketCounterLimit(props) {
435
+ const showBookingLimit = !props.availabilityLabel || props.maxAllowed < (props.availableSpots ?? Infinity);
436
+ return /* @__PURE__ */ jsxs("p", {
437
+ className: "er-ticket-counter-limit",
438
+ children: [props.availabilityLabel ? /* @__PURE__ */ jsx("span", { children: props.availabilityLabel }) : null, showBookingLimit ? /* @__PURE__ */ jsxs(Fragment, { children: [props.availabilityLabel ? /* @__PURE__ */ jsx("br", {}) : null, /* @__PURE__ */ jsxs("span", { children: [
439
+ "Up to ",
440
+ props.maxAllowed,
441
+ " ",
442
+ props.quantityLabel,
443
+ " per booking."
444
+ ] })] }) : null]
482
445
  });
483
446
  }
484
- //#endregion
485
- //#region ../blocks/src/system/runtime/nodes/event-registration/registrationSummary.state.ts
486
- /** Several course runs are one purchase; individual run names belong in the breakdown. */
487
- function registrationSummaryTitle(input) {
488
- if (input.severalItems === "runs") return (input.subject?.kind === "eventOffering" ? input.subject.title?.trim() : null) || "Your booking";
489
- return occurrenceTitleOverride(input.occurrenceContext) ?? input.eventTitle ?? "";
490
- }
491
- //#endregion
492
- //#region ../blocks/src/system/runtime/nodes/event-registration/EventRegistrationSummaryBar.tsx
493
- function productMethodFor(wizard) {
494
- return isProductMethod(wizard.paymentSelection.method);
495
- }
496
- function isProductMethod(method) {
497
- return method !== null && [
498
- "pass",
499
- "membership",
500
- "pass_bundle",
501
- "membership_bundle"
502
- ].includes(method);
503
- }
504
- function getPaymentSelectionProductName(selection) {
505
- return "productName" in selection ? selection.productName : void 0;
506
- }
507
- /** Credits held on the pass the customer is about to redeem, before this booking. */
508
- function getSelectedPassCreditsRemaining(wizard) {
509
- const selection = wizard.paymentSelection;
510
- if (selection.method !== "pass") return null;
511
- const passId = selection.passId;
512
- return (wizard.eligibility?.eligiblePasses ?? []).find((candidate) => candidate.id === passId)?.creditsRemaining ?? null;
513
- }
514
- /**
515
- * Copy describing how a pass or membership covers the booking.
516
- *
517
- * Pass redemptions spend something, so they say so and name the balance;
518
- * memberships already include the class, so "Included" stays accurate.
519
- */
520
- function resolveEntitlementSummaryCopy(method, passCreditsRemaining) {
521
- switch (method) {
522
- case "pass": return {
523
- productPrice: formatCreditProductUnits("event_pass", 1),
524
- pricingNote: formatPassCreditUsageLabel(passCreditsRemaining)
525
- };
526
- case "pass_bundle": return {
527
- productPrice: null,
528
- pricingNote: formatPassCreditUsageLabel(null)
529
- };
530
- case "membership": return {
531
- productPrice: "Included",
532
- pricingNote: "Included in membership"
533
- };
534
- case "membership_bundle":
535
- case "free":
536
- case "stripe":
537
- case null: return {
538
- productPrice: null,
539
- pricingNote: "Included in membership"
540
- };
541
- }
447
+ function BookingUnitSessionHint(props) {
448
+ const count = props.bookingUnit.includedSessionCount;
449
+ return props.bookingUnit.kind === "place" && count && count > 1 ? /* @__PURE__ */ jsxs("p", {
450
+ className: "er-text er-text--muted",
451
+ children: [
452
+ "Every place includes all ",
453
+ count,
454
+ " sessions."
455
+ ]
456
+ }) : null;
542
457
  }
543
- function getFlexibleBalanceSummary(option) {
544
- return option?.flexibleBalance ? {
545
- total: option.amounts.formattedTotal,
546
- dueToday: option.amounts.formattedDueToday,
547
- ...option.flexibleBalance
548
- } : null;
458
+ function bookingQuantityLabel(unit, waitlist) {
459
+ if (!waitlist) return pluralizeBookingUnit(unit, 2);
460
+ return "waitlist places";
549
461
  }
550
- function getSelectedDirectPaymentOption(wizard) {
551
- if (wizard.paymentSelection.method !== "stripe") return null;
552
- const kind = wizard.paymentSelection.collectionOptionKind;
553
- return wizard.directPaymentOptions.find((option) => option.kind === kind) ?? null;
462
+ function BookingQuantityPrompt(props) {
463
+ return /* @__PURE__ */ jsxs("h3", {
464
+ tabIndex: -1,
465
+ className: "er-title",
466
+ children: [
467
+ "How many ",
468
+ bookingQuantityLabel(props.unit, props.waitlist),
469
+ "?"
470
+ ]
471
+ });
554
472
  }
555
- /** Product row naming the pass or membership that covers this booking. */
556
- function EntitlementSummaryRow(props) {
557
- const { paymentSelection } = props.wizard;
558
- if (!isProductMethod(paymentSelection.method)) return null;
559
- const productName = "productName" in paymentSelection ? paymentSelection.productName : void 0;
560
- const productInterval = "productInterval" in paymentSelection ? paymentSelection.productInterval : void 0;
561
- const productPrice = "productPrice" in paymentSelection ? paymentSelection.productPrice : void 0;
562
- const productCurrency = "productCurrency" in paymentSelection ? paymentSelection.productCurrency : void 0;
473
+ function SlidingScaleAmountField(props) {
474
+ const id = props.id ?? "er-sliding-amount";
475
+ const minLabel = formatPrice(props.slidingScale.minAmount, props.currency);
476
+ const maxLabel = formatPrice(props.slidingScale.maxAmount, props.currency);
477
+ const suggestedLabel = props.slidingScale.suggestedAmount !== null ? formatPrice(props.slidingScale.suggestedAmount, props.currency) : null;
563
478
  return /* @__PURE__ */ jsxs("div", {
564
- className: "er-summary-bar-product",
565
- children: [/* @__PURE__ */ jsxs("div", { children: [
566
- /* @__PURE__ */ jsx("div", {
567
- className: "er-summary-bar-product-name",
568
- children: productName
479
+ className: "er-field",
480
+ children: [
481
+ /* @__PURE__ */ jsx("label", {
482
+ htmlFor: id,
483
+ className: "form-label",
484
+ children: "Amount"
569
485
  }),
570
- props.showPassEscape && /* @__PURE__ */ jsx("button", {
571
- type: "button",
572
- className: "er-summary-bar-pass-escape",
573
- onClick: props.wizard.handleUseCardInsteadOfPass,
574
- children: "Pay by card instead"
486
+ /* @__PURE__ */ jsx("input", {
487
+ id,
488
+ type: "number",
489
+ min: formatCentsAsCurrencyInput(props.slidingScale.minAmount),
490
+ max: formatCentsAsCurrencyInput(props.slidingScale.maxAmount),
491
+ step: "0.01",
492
+ inputMode: "decimal",
493
+ className: "form-input",
494
+ value: props.value,
495
+ onChange: (event) => props.onChange?.(event.target.value)
575
496
  }),
576
- productInterval && /* @__PURE__ */ jsx("div", {
577
- className: "er-summary-bar-product-detail",
578
- children: productInterval
497
+ /* @__PURE__ */ jsxs("p", {
498
+ className: "er-text er-text--muted",
499
+ children: [
500
+ "Choose between ",
501
+ minLabel,
502
+ " and ",
503
+ maxLabel,
504
+ suggestedLabel ? `; suggested ${suggestedLabel}` : "",
505
+ "."
506
+ ]
579
507
  }),
580
- /* @__PURE__ */ jsx(MembershipFirstPayment, {
581
- firstPaymentCents: props.wizard.membershipFirstPaymentCents,
582
- priceCents: productPrice,
583
- currency: productCurrency,
584
- interval: productInterval
585
- })
586
- ] }), /* @__PURE__ */ jsx("div", {
587
- className: "er-summary-bar-product-price",
588
- children: props.copy.productPrice ? /* @__PURE__ */ jsx("span", {
589
- className: "er-summary-bar-included",
590
- children: props.copy.productPrice
591
- }) : productPrice && productCurrency ? /* @__PURE__ */ jsx(ProductPrice, {
592
- cents: productPrice,
593
- afterCodeCents: props.wizard.passPriceAfterCodeCents,
594
- currency: productCurrency
508
+ props.message ? /* @__PURE__ */ jsx("p", {
509
+ className: "er-text er-text--muted",
510
+ children: props.message
595
511
  }) : null
596
- })]
512
+ ]
597
513
  });
598
514
  }
599
- /** A membership's discount comes off once, and it renews at the regular price. */
600
- function MembershipFirstPayment(props) {
601
- const { firstPaymentCents, priceCents, currency, interval } = props;
602
- if (firstPaymentCents === null || !priceCents || !currency || interval !== "month" && interval !== "year") return null;
603
- return /* @__PURE__ */ jsx("div", {
604
- className: "er-summary-bar-product-detail",
605
- children: appliedDiscountHint({
606
- totalAfterDiscountCents: firstPaymentCents,
607
- currency,
608
- membership: {
609
- priceCents,
610
- billingInterval: interval
611
- }
612
- })
515
+ function ticketTypePriceText(ticketType, currency) {
516
+ return ticketType.priceAmount > 0 ? formatPrice(ticketType.priceAmount, currency) : "Free";
517
+ }
518
+ function TicketTypeLineText(props) {
519
+ const { ticketType } = props;
520
+ return /* @__PURE__ */ jsxs("div", {
521
+ className: "er-ticket-line-main",
522
+ children: [
523
+ /* @__PURE__ */ jsxs("div", {
524
+ className: "er-ticket-line-heading",
525
+ children: [/* @__PURE__ */ jsx("span", {
526
+ className: "er-ticket-line-name",
527
+ children: ticketType.name
528
+ }), /* @__PURE__ */ jsx("span", {
529
+ className: "er-ticket-line-price",
530
+ children: ticketTypePriceText(ticketType, props.currency)
531
+ })]
532
+ }),
533
+ ticketType.description ? /* @__PURE__ */ jsx("p", {
534
+ className: "er-ticket-line-detail",
535
+ children: ticketType.description
536
+ }) : null,
537
+ props.detail ? /* @__PURE__ */ jsx("p", {
538
+ className: "er-ticket-line-detail",
539
+ children: props.detail
540
+ }) : null
541
+ ]
613
542
  });
614
543
  }
615
- /** The price, struck through once a code has taken something off a pass. */
616
- function ProductPrice(props) {
617
- const { cents, afterCodeCents, currency } = props;
618
- if (afterCodeCents === null || afterCodeCents >= cents) return /* @__PURE__ */ jsx(Fragment, { children: formatPrice(cents, currency) });
619
- return /* @__PURE__ */ jsxs(Fragment, { children: [
620
- /* @__PURE__ */ jsx("span", {
621
- className: "er-summary-bar-price er-summary-bar-price--struck",
622
- children: formatPrice(cents, currency)
544
+ /** What one ticket type's row says and allows, whichever row draws it. Places without a room draw it in the rooms' own row. */
545
+ function ticketTypeQuantity(props) {
546
+ const { ticketType } = props;
547
+ const quantity = getTicketLineQuantity(props.ticketSelections, ticketType.pricingOptionId);
548
+ return {
549
+ quantity,
550
+ maxAllowed: getTicketTypeLineMax({
551
+ currentQuantity: quantity,
552
+ totalSelectedQuantity: getTicketSelectionTotal(props.ticketSelections),
553
+ maxTickets: props.maxTickets,
554
+ purpose: props.purpose,
555
+ pricingOptionId: ticketType.pricingOptionId,
556
+ availability: ticketType.availability,
557
+ heldPlacesBySelection: props.heldPlacesBySelection,
558
+ overallRemainingPlaces: props.availableSpots ?? null
623
559
  }),
624
- " ",
625
- formatPrice(afterCodeCents, currency)
626
- ] });
627
- }
628
- /** The pass the customer turned down, with the way back to it. */
629
- function DeclinedPassRow(props) {
630
- return /* @__PURE__ */ jsx("div", {
631
- className: "er-summary-bar-product",
632
- children: /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("div", {
633
- className: "er-summary-bar-product-name",
634
- children: props.passName
635
- }), /* @__PURE__ */ jsxs("button", {
636
- type: "button",
637
- className: "er-summary-bar-pass-escape",
638
- onClick: props.onUsePass,
639
- children: [
640
- "Use ",
641
- formatCreditProductUnits("event_pass", 1),
642
- " from your pass instead"
643
- ]
644
- })] })
645
- });
560
+ disabled: !canRequestTicketOption(ticketType.availability, props.purpose),
561
+ detail: getTicketTypeAvailabilityLabel(ticketType) ?? placesLeftLabel({
562
+ kind: "ticketType",
563
+ remaining: ticketType.availability.remainingPlaces,
564
+ dateRemaining: props.availableSpots ?? null
565
+ }, props.display),
566
+ setQuantity: (next) => props.onTicketSelectionsChange?.(setTicketLineQuantity({
567
+ lines: props.ticketSelections,
568
+ pricingOptionId: ticketType.pricingOptionId,
569
+ quantity: next
570
+ }))
571
+ };
646
572
  }
647
- /**
648
- * The pass or membership covering the booking, or the pass the customer
649
- * turned down. Redeeming a pass is easy to miss, so the steps before payment
650
- * offer the way out of it and back again.
651
- */
652
- function PaymentProductRow(props) {
653
- const { wizard } = props;
654
- const canSwitchPass = wizard.step === "enter-details" || wizard.step === "select-tickets";
655
- const declinedPassName = canSwitchPass ? wizard.declinedPass?.productName : void 0;
656
- if (declinedPassName) return /* @__PURE__ */ jsx(DeclinedPassRow, {
657
- passName: declinedPassName,
658
- onUsePass: wizard.handleUsePassInstead
659
- });
660
- if (!getPaymentSelectionProductName(wizard.paymentSelection)) return null;
661
- return /* @__PURE__ */ jsx(EntitlementSummaryRow, {
662
- wizard,
663
- copy: props.copy,
664
- showPassEscape: canSwitchPass && wizard.paymentSelection.method === "pass"
573
+ /** One ticket type with its price, what's left and a counter. */
574
+ function TicketTypeQuantityRow(props) {
575
+ const { ticketType } = props;
576
+ const { quantity, maxAllowed, disabled, detail, setQuantity } = ticketTypeQuantity(props);
577
+ return /* @__PURE__ */ jsxs("div", {
578
+ className: `er-ticket-line${disabled ? " er-ticket-line--disabled" : ""}`,
579
+ role: "listitem",
580
+ children: [/* @__PURE__ */ jsx(TicketTypeLineText, {
581
+ ticketType,
582
+ currency: props.currency,
583
+ detail
584
+ }), /* @__PURE__ */ jsx(TicketCounter, {
585
+ ticketsCount: quantity,
586
+ minAllowed: 0,
587
+ maxAllowed,
588
+ label: ticketType.name,
589
+ onTicketsChange: setQuantity
590
+ })]
665
591
  });
666
592
  }
667
- /** "2 tickets" or "1 place"; booking several, "5 dates × 2 places" or the runs by name. */
668
- function summaryCountLabel(wizard, summaryEvent) {
669
- if (wizard.severalItems !== null) return selectionPlacesLabel(wizard.severalItems, wizard.selection, wizard.ticketsCount);
670
- if (wizard.ticketsCount <= 0) return null;
671
- const tiered = summaryEvent !== null && summaryEvent !== void 0 && publicEventPricingStrategy(summaryEvent.pricing) === "tiered";
672
- if (tiered) {
673
- const byType = ticketTypeCountLabel(wizard.selectedTicketLines, wizard.visibleTicketTypes);
674
- if (byType) return byType;
675
- }
676
- const unit = tiered ? "ticket" : "place";
677
- return `${wizard.ticketsCount} ${unit}${wizard.ticketsCount === 1 ? "" : "s"}`;
678
- }
679
- /** "1 Standard, 1 Concession" when tickets of more than one type are chosen; otherwise null. */
680
- function ticketTypeCountLabel(lines, ticketTypes) {
681
- const chosen = lines.filter((line) => line.quantity > 0);
682
- if (chosen.length < 2) return null;
683
- const parts = chosen.map((line) => {
684
- const name = ticketTypes.find((type) => type.pricingOptionId === line.pricingOptionId)?.name;
685
- return name ? `${line.quantity} ${name}` : null;
686
- });
687
- return parts.every((part) => part !== null) ? parts.join(", ") : null;
688
- }
689
- /**
690
- * The footer's one line (issue 1581): how many, the discount's name, then
691
- * when. Ticket types are tickets; a single price, or a course, is places.
692
- */
693
- function summaryMetaFacts(input) {
694
- const { wizard, summaryEvent } = input;
695
- const several = wizard.severalItems;
696
- return {
697
- countLabel: summaryCountLabel(wizard, summaryEvent),
698
- discount: input.discount && !productMethodFor(wizard) ? {
699
- label: input.discount.publicLabel,
700
- description: input.discount.description ?? null
701
- } : null,
702
- schedule: summaryEvent && several === null ? formatRegistrationSchedule(summaryEvent, wizard.occurrenceContext) : null
703
- };
704
- }
705
- /** The panel's header already says when, so the panel hides the schedule. */
706
- function SummaryMeta({ facts }) {
707
- return /* @__PURE__ */ jsxs("span", {
708
- className: "er-summary-bar-meta",
593
+ function TicketTypeQuantityRows(props) {
594
+ const totalSelectedQuantity = getTicketSelectionTotal(props.ticketSelections);
595
+ const effectiveMaxTickets = props.maxTickets;
596
+ return /* @__PURE__ */ jsxs("div", {
597
+ className: "er-ticket-lines",
709
598
  children: [
710
- facts.countLabel ? /* @__PURE__ */ jsx("span", {
711
- className: "er-summary-bar-count",
712
- children: facts.countLabel
713
- }) : null,
714
- facts.discount ? /* @__PURE__ */ jsx("span", {
715
- className: "er-summary-bar-discount",
716
- title: facts.discount.description ?? void 0,
717
- children: facts.discount.label
718
- }) : null,
719
- facts.schedule ? /* @__PURE__ */ jsx("span", {
720
- className: "er-summary-bar-schedule",
721
- children: facts.schedule
599
+ /* @__PURE__ */ jsx("div", {
600
+ className: "er-ticket-line-list",
601
+ role: "list",
602
+ "aria-label": props.bookingUnit === "place" ? "Places" : "Tickets",
603
+ children: props.ticketTypes.map((ticketType) => /* @__PURE__ */ jsx(TicketTypeQuantityRow, {
604
+ display: props.display,
605
+ purpose: props.purpose,
606
+ ticketType,
607
+ ticketSelections: props.ticketSelections,
608
+ maxTickets: props.maxTickets,
609
+ heldPlacesBySelection: props.heldPlacesBySelection,
610
+ availableSpots: props.availableSpots,
611
+ currency: props.currency,
612
+ onTicketSelectionsChange: props.onTicketSelectionsChange
613
+ }, ticketType.pricingOptionId))
614
+ }),
615
+ /* @__PURE__ */ jsx(TicketCounterLimit, {
616
+ maxAllowed: effectiveMaxTickets,
617
+ quantityLabel: pluralizeBookingUnit(props.bookingUnit, effectiveMaxTickets),
618
+ availableSpots: props.availableSpots,
619
+ availabilityLabel: props.availabilityLabel
620
+ }),
621
+ totalSelectedQuantity === 0 && props.hasAvailableTicketTypes ? /* @__PURE__ */ jsxs("p", {
622
+ className: "er-text er-text--muted",
623
+ children: [
624
+ "Choose at least one ",
625
+ props.bookingUnit,
626
+ " to continue."
627
+ ]
628
+ }) : totalSelectedQuantity === 0 ? /* @__PURE__ */ jsxs("p", {
629
+ className: "er-text er-text--muted",
630
+ children: [
631
+ "No ",
632
+ props.bookingUnit === "place" ? "places" : "ticket types",
633
+ " are currently available."
634
+ ]
722
635
  }) : null
723
636
  ]
724
637
  });
725
638
  }
726
- /**
727
- * The date step's footer line (issue 1581): the chosen date and its price,
728
- * before any places are counted. Nothing until a date is chosen.
729
- */
730
- function DateStepSummary({ event }) {
731
- if (!event) return null;
732
- const price = formatEventPriceDisplay(event.pricing).trim();
733
- return /* @__PURE__ */ jsxs("div", {
734
- className: "er-summary-bar",
735
- "data-step": "select-event",
736
- children: [/* @__PURE__ */ jsx("div", {
737
- className: "er-summary-bar-info",
738
- children: /* @__PURE__ */ jsx("span", {
739
- className: "er-summary-bar-meta",
740
- children: /* @__PURE__ */ jsx("span", {
741
- className: "er-summary-bar-schedule",
742
- children: formatRegistrationSchedule(event)
743
- })
744
- })
745
- }), price ? /* @__PURE__ */ jsx("div", {
746
- className: "er-summary-bar-pricing",
747
- children: /* @__PURE__ */ jsx("span", {
748
- className: "er-summary-bar-price",
749
- children: price
750
- })
751
- }) : null]
639
+ function getAttendanceModeDetail(attendanceMode, display) {
640
+ return placesLeftLabel(attendanceMode, display, {
641
+ unlimited: "Unlimited places",
642
+ open: "Places available",
643
+ full: "Currently full",
644
+ waitlist: "Currently full, waitlist available"
752
645
  });
753
646
  }
754
- /**
755
- * Booking several (issue 1725): how many are ticked and their total. With
756
- * combination prices the usual total is struck through above the planned
757
- * one, with the working underneath and the next saving under the bar.
758
- */
759
- function SeveralStepSummary({ wizard }) {
760
- const several = wizard.severalItems;
761
- const first = wizard.selectedEvent;
762
- const { working, hint } = wizard.selectionCombination;
763
- if (several === null || !first) return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DateStepSummary, { event: first }), /* @__PURE__ */ jsx(CombinationHint, { parts: hint })] });
764
- const currency = publicEventPricingCurrency(first.pricing);
765
- const { totalCents: total, listTotalCents: list } = wizard.selectionPrice;
766
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
767
- className: summaryBarClassName(working),
768
- "data-step": "select-event",
769
- children: [
770
- /* @__PURE__ */ jsx("div", {
771
- className: "er-summary-bar-info",
772
- children: /* @__PURE__ */ jsx("span", {
773
- className: "er-summary-bar-meta",
774
- children: /* @__PURE__ */ jsx("span", {
775
- className: "er-summary-bar-count",
776
- children: selectionItemsLabel(several, wizard.selection)
777
- })
778
- })
779
- }),
780
- currency && total !== null && total > 0 ? working && list !== null ? /* @__PURE__ */ jsx(CombinationPricing, {
781
- listCents: list,
782
- totalCents: total,
783
- currency
784
- }) : /* @__PURE__ */ jsx("div", {
785
- className: "er-summary-bar-pricing",
786
- children: /* @__PURE__ */ jsx("span", {
787
- className: "er-summary-bar-price",
788
- children: formatPrice(total, currency)
647
+ /** One event's ways of attending, each with its places left. */
648
+ function eventAttendanceModeTiles(attendanceModes, display) {
649
+ return attendanceModes.map((attendanceMode) => ({
650
+ mode: attendanceMode.mode,
651
+ detail: getAttendanceModeDetail(attendanceMode, display)
652
+ }));
653
+ }
654
+ /** The "How will you attend?" choice; several runs share it, so one choice covers them all. */
655
+ function AttendanceModeTiles(props) {
656
+ return /* @__PURE__ */ jsx("div", {
657
+ className: "er-payment-tiles",
658
+ role: "list",
659
+ "aria-label": "Attendance mode",
660
+ children: props.tiles.map((tile) => {
661
+ const isSelected = props.selectedAttendanceMode === tile.mode;
662
+ return /* @__PURE__ */ jsx("div", {
663
+ role: "listitem",
664
+ children: /* @__PURE__ */ jsxs("button", {
665
+ type: "button",
666
+ "aria-pressed": isSelected,
667
+ className: `er-payment-tile${isSelected ? " er-payment-tile--selected" : ""}`,
668
+ onClick: () => props.onAttendanceModeChange?.(tile.mode),
669
+ children: [/* @__PURE__ */ jsx("div", {
670
+ className: "er-payment-tile-label",
671
+ children: getEventAttendanceModeLabel(tile.mode)
672
+ }), /* @__PURE__ */ jsx("div", {
673
+ className: "er-payment-tile-detail",
674
+ children: tile.detail
675
+ })]
789
676
  })
790
- }) : null,
791
- /* @__PURE__ */ jsx(CombinationDetail, { working })
792
- ]
793
- }), /* @__PURE__ */ jsx(CombinationHint, { parts: hint })] });
677
+ }, tile.mode);
678
+ })
679
+ });
794
680
  }
795
- /**
796
- * The later steps' price for several items with combination prices: the
797
- * usual total struck through, then what's due. The working shows while the
798
- * planner's total stands; once the server prices a code, its total alone.
799
- */
800
- function combinationSummary(wizard, subtotalCents) {
801
- if (wizard.severalItems === null) return null;
802
- const list = wizard.selectionPrice.listTotalCents;
803
- const working = wizard.selectionCombination.working;
804
- if (list === null || list <= subtotalCents || working === null && wizard.combinationCodeField === null) return null;
681
+ function resolveTicketSelectionPricing(event) {
805
682
  return {
806
- list,
807
- working: subtotalCents === wizard.selectionPrice.totalCents ? working : null
683
+ mode: event ? publicEventPricingStrategy(event.pricing) : void 0,
684
+ currency: event ? publicEventPricingCurrency(event.pricing) : null
808
685
  };
809
686
  }
810
- /** A deposit or instalment plan: the total, what's payable now, and what's left. */
811
- function FlexibleBalancePricing(props) {
812
- const { summary } = props;
813
- return /* @__PURE__ */ jsxs(Fragment, { children: [
814
- summary.total ? /* @__PURE__ */ jsxs("div", {
815
- className: "er-summary-bar-product-detail",
816
- children: ["Total: ", summary.total]
817
- }) : null,
818
- /* @__PURE__ */ jsx("div", {
819
- className: "er-summary-bar-price",
820
- children: summary.dueToday ?? props.fallbackDueToday
821
- }),
822
- /* @__PURE__ */ jsx("div", {
823
- className: "er-summary-bar-included",
824
- children: "Payable now"
825
- }),
826
- summary.remainingBalance ? /* @__PURE__ */ jsxs("div", {
827
- className: "er-summary-bar-product-detail",
828
- children: [
829
- "Remaining balance: ",
830
- summary.remainingBalance,
831
- summary.balanceDueBy ? ` due by ${summary.balanceDueBy}` : ""
832
- ]
833
- }) : null,
834
- summary.depositPolicy ? /* @__PURE__ */ jsxs("div", {
835
- className: "er-summary-bar-product-detail",
836
- children: ["Deposit: ", summary.depositPolicy]
837
- }) : null
838
- ] });
687
+ /** Someone with an invitation is claiming a place, not joining the list. */
688
+ function waitlistIsOpenTo(source, invitation) {
689
+ return source && !invitation ? canJoinEventWaitlist(source) : false;
839
690
  }
840
- function summaryBarClassName(working) {
841
- return working ? "er-summary-bar er-summary-bar--combination" : "er-summary-bar";
842
- }
843
- function EventRegistrationSummaryBar(props) {
844
- const { wizard } = props;
845
- if (wizard.step === "select-event") return /* @__PURE__ */ jsx(SeveralStepSummary, { wizard });
846
- const summaryEvent = wizard.selectedEvent ?? wizard.preSelectedEvent;
847
- const summaryTitle = registrationSummaryTitle({
848
- ...wizard,
849
- eventTitle: summaryEvent?.title
850
- });
851
- const summaryCurrency = summaryEvent ? publicEventPricingCurrency(summaryEvent.pricing) : null;
852
- const teamMemberNames = (summaryEvent?.teamMembers ?? []).map((teamMember) => teamMember.name).filter(Boolean);
853
- const subtotalCents = wizard.ticketSelectionSubtotalCents;
854
- if (!summaryTitle || !summaryCurrency || subtotalCents === null) return null;
855
- const autoAppliedDiscount = wizard.autoAppliedDiscount;
856
- const autoAppliedDiscountCents = Math.max(0, autoAppliedDiscount?.computedAmountCents ?? 0);
857
- const discountedTotalCents = Math.max(0, subtotalCents - autoAppliedDiscountCents);
858
- const flexibleBalanceSummary = getFlexibleBalanceSummary(getSelectedDirectPaymentOption(wizard));
859
- const meta = summaryMetaFacts({
860
- wizard,
861
- summaryEvent,
862
- discount: autoAppliedDiscountCents > 0 ? autoAppliedDiscount : null
863
- });
864
- const productMethod = isProductMethod(wizard.paymentSelection.method);
865
- const entitlementCopy = resolveEntitlementSummaryCopy(wizard.paymentSelection.method, getSelectedPassCreditsRemaining(wizard));
866
- const combination = combinationSummary(wizard, subtotalCents);
867
- const working = combination?.working ?? null;
868
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(PaymentProductRow, {
869
- wizard,
870
- copy: entitlementCopy
871
- }), /* @__PURE__ */ jsxs("div", {
872
- className: summaryBarClassName(working),
873
- "data-step": wizard.step,
874
- children: [
875
- /* @__PURE__ */ jsxs("div", {
876
- className: "er-summary-bar-info",
877
- children: [
878
- /* @__PURE__ */ jsx("h4", {
879
- className: "er-summary-bar-event",
880
- children: summaryTitle
881
- }),
882
- /* @__PURE__ */ jsx(SummaryMeta, { facts: meta }),
883
- teamMemberNames.length > 0 && /* @__PURE__ */ jsxs("div", {
884
- className: "er-summary-bar-meta",
885
- children: ["With ", teamMemberNames.join(", ")]
886
- })
887
- ]
888
- }),
889
- combination && subtotalCents > 0 ? /* @__PURE__ */ jsx(CombinationPricing, {
890
- listCents: combination.list,
891
- totalCents: subtotalCents,
892
- currency: summaryCurrency
893
- }) : subtotalCents > 0 && /* @__PURE__ */ jsx("div", {
894
- className: "er-summary-bar-pricing",
895
- children: productMethod ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
896
- className: "er-summary-bar-price er-summary-bar-price--struck",
897
- children: formatPrice(subtotalCents, summaryCurrency)
898
- }), /* @__PURE__ */ jsx("div", {
899
- className: "er-summary-bar-included",
900
- children: entitlementCopy.pricingNote
901
- })] }) : flexibleBalanceSummary ? /* @__PURE__ */ jsx(FlexibleBalancePricing, {
902
- summary: flexibleBalanceSummary,
903
- fallbackDueToday: formatPrice(discountedTotalCents, summaryCurrency)
904
- }) : autoAppliedDiscount && autoAppliedDiscountCents > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
905
- /* @__PURE__ */ jsx("span", {
906
- className: "er-summary-bar-price er-summary-bar-price--struck",
907
- children: formatPrice(subtotalCents, summaryCurrency)
908
- }),
909
- /* @__PURE__ */ jsx("span", {
910
- className: "er-summary-bar-price",
911
- children: formatPrice(discountedTotalCents, summaryCurrency)
912
- }),
913
- autoAppliedDiscount.description ? /* @__PURE__ */ jsx("div", {
914
- className: "er-summary-bar-product-detail er-summary-bar-discount-detail",
915
- children: autoAppliedDiscount.description
916
- }) : null
917
- ] }) : /* @__PURE__ */ jsx("span", {
918
- className: "er-summary-bar-price",
919
- children: formatPrice(subtotalCents, summaryCurrency)
920
- })
921
- }),
922
- /* @__PURE__ */ jsx(CombinationDetail, { working })
923
- ]
924
- })] });
925
- }
926
- //#endregion
927
- //#region ../blocks/src/system/runtime/nodes/event-registration/EventRegistrationWizardActions.tsx
928
- /**
929
- * Label for the button that submits the details step.
930
- *
931
- * When a pass covers the booking there is no payment step to follow, so this
932
- * button is the last thing read before a credit is spent — it names the pass
933
- * rather than leaving that to the summary above it.
934
- */
935
- function resolveDetailsButtonText(input) {
936
- const { wizard } = input;
937
- const admission = wizard.admission;
938
- switch (admission.kind) {
939
- case "checking": return "Checking availability…";
940
- case "closed": return closedLabel(admission.reason);
941
- case "fullyBooked": return fullyBookedLabel(admission);
942
- case "waitlist": return "Join waitlist";
943
- case "open":
944
- case "resume": break;
945
- }
946
- if (wizard.paymentSelection.method === "pass") return "Book using class pass";
947
- if (wizard.paymentSelection.method === "membership") return input.fallbackText;
948
- return wizard.eventRequiresPayment ? "Continue to payment" : input.fallbackText;
691
+ function getTicketSelectionCapacity(event, attendanceMode, display, invitation = null) {
692
+ const source = event ? selectEventCapacitySource(event, attendanceMode) : null;
693
+ const availability = source ? getEventAvailability(source) : null;
694
+ const canJoinWaitlist = waitlistIsOpenTo(source, invitation);
695
+ return {
696
+ availableSpots: availability?.available,
697
+ isSoldOut: availability?.isFull ?? false,
698
+ canJoinWaitlist,
699
+ eventAvailabilityLabel: !canJoinWaitlist && source ? placesLeftLabel(source, display) : null
700
+ };
949
701
  }
950
702
  /**
951
- * The date step's footer (issue 1581): Continue moves on once a date is
952
- * chosen. Unrelated events still move on when picked, so there's nothing here.
703
+ * One price: the visitor is choosing places, not ticket types (issue 1581).
704
+ * The ceiling comes from settled availability (`placeCountCeiling`); the
705
+ * page's cached count is only shown, never enforced.
953
706
  */
954
- function SelectDateActions(props) {
955
- const { wizard } = props;
956
- const several = wizard.selectionMode.kind === "several";
957
- if (!several && getEventSelectionMode(wizard.scopedEvents) !== "date") return null;
958
- const chosen = wizard.selectedEvent;
959
- return /* @__PURE__ */ jsx("div", {
960
- className: "rb-wizard-actions er-actions",
961
- children: /* @__PURE__ */ jsx(ThemedButton, {
962
- type: "button",
963
- onClick: several ? wizard.handleSelectionContinue : () => {
964
- if (chosen) wizard.handleEventSelect(chosen);
965
- },
966
- disabled: several ? wizard.selection.length === 0 : !chosen,
967
- variant: props.buttonVariant,
968
- size: "md",
969
- label: "Continue"
970
- })
971
- });
972
- }
973
- function SelectTicketsActions(props) {
974
- const { wizard } = props;
975
- const { label: continueLabel, pending: registrationOptionsPending } = wizard.ticketContinuation;
976
- const isContinueDisabled = wizard.ticketContinuation.kind === "blocked";
977
- return /* @__PURE__ */ jsxs("div", {
978
- className: "rb-wizard-actions er-actions",
979
- children: [!wizard.hasPreSelectedContext && /* @__PURE__ */ jsx("button", {
980
- type: "button",
981
- onClick: () => wizard.setStep("select-event"),
982
- className: "er-back-btn",
983
- children: "← Back"
984
- }), /* @__PURE__ */ jsx(ThemedButton, {
985
- type: "button",
986
- onClick: wizard.handleTicketsComplete,
987
- disabled: isContinueDisabled,
988
- variant: props.buttonVariant,
989
- size: "md",
990
- label: continueLabel,
991
- pending: registrationOptionsPending ? {
992
- label: continueLabel,
993
- spinnerSize: "xs",
994
- spinnerClassName: "er-button-spinner",
995
- contentClassName: "er-button-with-spinner"
996
- } : void 0
997
- })]
998
- });
999
- }
1000
- function EnterDetailsActions(props) {
1001
- const { wizard } = props;
1002
- const isContinueDisabled = resolveRegistrationAvailabilityBlocker(wizard.admission) !== null;
1003
- const continueLabel = resolveDetailsButtonText({
1004
- wizard,
1005
- fallbackText: props.buttonText
1006
- });
1007
- return /* @__PURE__ */ jsxs("div", {
1008
- className: "rb-wizard-actions er-actions",
1009
- children: [/* @__PURE__ */ jsx("button", {
1010
- type: "button",
1011
- onClick: () => wizard.setStep("select-tickets"),
1012
- className: "er-back-btn",
1013
- children: "← Back"
1014
- }), /* @__PURE__ */ jsx(ThemedButton, {
1015
- type: "button",
1016
- onClick: wizard.handleDetailsComplete,
1017
- disabled: isContinueDisabled,
1018
- variant: props.buttonVariant,
1019
- size: "md",
1020
- label: continueLabel
1021
- })]
1022
- });
1023
- }
1024
- function SelectPaymentActions(props) {
1025
- const { wizard } = props;
1026
- const { status, canContinue, buttonText } = wizard.paymentStepState;
1027
- return /* @__PURE__ */ jsxs(Fragment, { children: [status === "ready" && wizard.paymentHeldForCode ? /* @__PURE__ */ jsx("p", {
1028
- className: "er-discount__hint",
1029
- children: "Press Apply to use your discount code, or remove it to carry on without it."
1030
- }) : null, /* @__PURE__ */ jsxs("div", {
1031
- className: "rb-wizard-actions er-actions",
1032
- children: [/* @__PURE__ */ jsx("button", {
1033
- type: "button",
1034
- onClick: () => wizard.setStep("enter-details"),
1035
- className: "er-back-btn",
1036
- children: "← Back"
1037
- }), status === "ready" && /* @__PURE__ */ jsx(ThemedButton, {
1038
- type: "button",
1039
- onClick: () => void wizard.handlePaymentSelect(),
1040
- disabled: !canContinue,
1041
- variant: props.buttonVariant,
1042
- size: "md",
1043
- label: buttonText
707
+ function PlaceCounter(props) {
708
+ const spots = props.waitlist ? null : props.availableSpots;
709
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(BookingQuantityPrompt, {
710
+ unit: "place",
711
+ waitlist: props.waitlist
712
+ }), /* @__PURE__ */ jsxs("div", {
713
+ className: "er-ticket-counter-group",
714
+ children: [/* @__PURE__ */ jsx(TicketCounter, {
715
+ ticketsCount: props.ticketsCount,
716
+ maxAllowed: props.ceiling,
717
+ label: bookingQuantityLabel("place", props.waitlist),
718
+ onTicketsChange: props.onTicketsChange
719
+ }), /* @__PURE__ */ jsx(TicketCounterLimit, {
720
+ maxAllowed: props.ceiling,
721
+ quantityLabel: props.waitlist ? bookingQuantityLabel("place", true) : pluralizeBookingUnit("place", props.ceiling),
722
+ availableSpots: spots,
723
+ availabilityLabel: props.availabilityLabel
1044
724
  })]
1045
725
  })] });
1046
726
  }
1047
- /** Stripe owns the Pay button, so the payment footer offers only the way back. */
1048
- function PaymentActions(props) {
1049
- return /* @__PURE__ */ jsx("div", {
1050
- className: "rb-wizard-actions rb-wizard-actions--back-only er-actions",
1051
- children: /* @__PURE__ */ jsx("button", {
1052
- type: "button",
1053
- onClick: props.wizard.paymentController.check,
1054
- className: "er-back-btn",
1055
- children: "← Back"
1056
- })
1057
- });
1058
- }
1059
- function closedLabel(reason) {
1060
- switch (reason) {
1061
- case "alreadyWaitlisted": return "Already on waitlist";
1062
- case "optionsUnavailable": return "Availability unavailable";
1063
- case "unavailable": return "Registration unavailable";
1064
- }
1065
- }
1066
- function EventRegistrationWizardActions(props) {
1067
- const { wizard } = props;
1068
- switch (wizard.step) {
1069
- case "error":
1070
- case "success":
1071
- case "submitting":
1072
- case "verifying-payment":
1073
- case "verifying-timeout":
1074
- case "payment-status":
1075
- case "payment-failed": return null;
1076
- case "select-event": return /* @__PURE__ */ jsx(SelectDateActions, { ...props });
1077
- case "select-tickets": return /* @__PURE__ */ jsx(SelectTicketsActions, { ...props });
1078
- case "enter-details": return /* @__PURE__ */ jsx(EnterDetailsActions, { ...props });
1079
- case "select-payment": return /* @__PURE__ */ jsx(SelectPaymentActions, { ...props });
1080
- case "payment": return /* @__PURE__ */ jsx(PaymentActions, { ...props });
1081
- default: return null;
1082
- }
727
+ function SelectionNote({ text }) {
728
+ return text ? /* @__PURE__ */ jsx("p", {
729
+ className: "er-text er-text--muted",
730
+ children: text
731
+ }) : null;
1083
732
  }
1084
- //#endregion
1085
- //#region ../blocks/src/system/runtime/nodes/event-registration/SingleTicketEntitlementNote.tsx
1086
733
  /**
1087
- * Passes and memberships cover one person, so with more than one place they
1088
- * are greyed out; this says why, in the open rather than in a hover tooltip.
734
+ * Ticket Selection Step
735
+ *
736
+ * Allows users to select how many tickets they want for the selected event.
737
+ * Respects both max tickets per registration and available spots.
738
+ *
739
+ * Can use either a full PublicEvent or just occurrence context (when on event page).
1089
740
  */
1090
- function SingleTicketEntitlementNote(props) {
1091
- const { eligibility } = props;
1092
- if (!eligibility || !areEntitlementsDisabledForTicketCount(props.ticketsCount)) return null;
1093
- const hasPasses = eligibility.eligiblePasses.length + eligibility.availablePasses.length > 0;
1094
- const hasMemberships = eligibility.eligibleMemberships.length + eligibility.availableMemberships.length > 0;
1095
- if (!hasPasses && !hasMemberships) return null;
1096
- return /* @__PURE__ */ jsxs("p", {
1097
- className: "er-entitlement-note",
741
+ const TicketSelectionStep = ({ purpose, event, display, occurrenceContext: _occurrenceContext, selectedAttendanceMode = null, onAttendanceModeChange, ticketsCount, maxTickets, placesCeiling, visibleTicketTypes: visibleTicketTypesOverride, overallRemainingPlaces, heldPlacesBySelection, ticketSelections = [], onTicketSelectionsChange, slidingScale = null, selectedSlidingAmountInput = "", slidingScaleSelectionMessage = null, onSlidingAmountChange, onTicketsChange, bookingUnit = { kind: "ticket" }, selectionNote, invitation = null }) => {
742
+ const unit = bookingUnit.kind;
743
+ const deliveryMode = event?.deliveryMode ?? "in_person";
744
+ const attendanceModes = event?.attendanceModes ?? [];
745
+ const { availableSpots, isSoldOut, canJoinWaitlist, eventAvailabilityLabel } = getTicketSelectionCapacity(event, selectedAttendanceMode, display, invitation);
746
+ const { mode: eventPricingMode, currency: eventPricingCurrency } = resolveTicketSelectionPricing(event);
747
+ const usesTicketTypes = eventPricingMode === "tiered";
748
+ const visibleTicketTypes = usesTicketTypes ? visibleTicketTypesOverride ?? getVisibleTicketTypes({
749
+ event,
750
+ eligibility: null,
751
+ selectedAttendanceMode,
752
+ ticketSelections
753
+ }) : [];
754
+ const noVisibleTicketTypes = usesTicketTypes && visibleTicketTypes.length === 0;
755
+ const hasAvailableTicketTypes = usesTicketTypes && visibleTicketTypes.some((ticketType) => canRequestTicketOption(ticketType.availability, purpose));
756
+ const maxAllowed = maxTickets;
757
+ if (deliveryMode === "hybrid" && !selectedAttendanceMode) return /* @__PURE__ */ jsxs("div", {
758
+ className: "rb-reg-stack er-stack",
1098
759
  children: [
1099
- hasPasses ? "Passes are" : "Memberships are",
1100
- " for one person.",
1101
- " ",
1102
- /* @__PURE__ */ jsx("button", {
1103
- type: "button",
1104
- className: "er-entitlement-note__action",
1105
- onClick: props.onBookOnePlace,
1106
- children: "Book 1 place"
760
+ /* @__PURE__ */ jsx("h3", {
761
+ tabIndex: -1,
762
+ className: "er-title",
763
+ children: "How will you attend?"
1107
764
  }),
1108
- " ",
1109
- "to use ",
1110
- hasPasses ? "a pass" : "a membership",
1111
- "."
765
+ /* @__PURE__ */ jsx(AttendanceModeTiles, {
766
+ tiles: eventAttendanceModeTiles(attendanceModes, display),
767
+ selectedAttendanceMode: null,
768
+ onAttendanceModeChange
769
+ }),
770
+ /* @__PURE__ */ jsx("p", {
771
+ className: "er-text er-text--muted",
772
+ children: "Choose whether you want to attend in person or online."
773
+ })
1112
774
  ]
1113
775
  });
1114
- }
1115
- //#endregion
1116
- //#region ../blocks/src/system/runtime/nodes/event-registration/PaymentBlockingPanel.tsx
1117
- function MissingEligibilityPanel() {
1118
- return /* @__PURE__ */ jsx("div", {
776
+ if (!eventPricingCurrency) return /* @__PURE__ */ jsx("div", {
1119
777
  className: "rb-reg-stack er-stack",
1120
- children: /* @__PURE__ */ jsx("div", {
1121
- className: "er-center",
1122
- children: /* @__PURE__ */ jsx("p", {
1123
- className: "er-text er-error",
1124
- children: "We couldn’t load the booking options for this event. Please refresh this page and try again. If this keeps happening, contact the organiser for help."
1125
- })
1126
- })
1127
- });
1128
- }
1129
- function UnavailableEntitlementMessage(props) {
1130
- return /* @__PURE__ */ jsxs(Fragment, { children: [
1131
- /* @__PURE__ */ jsx("p", {
1132
- className: "er-text er-error",
1133
- children: "This event requires a valid pass or membership to register."
1134
- }),
1135
- props.eligibility.eventAcceptsPasses && !props.eligibility.eventAcceptsMemberships && /* @__PURE__ */ jsx("p", {
1136
- className: "er-text er-text--muted",
1137
- children: "You need a pass with credits for this event category."
1138
- }),
1139
- props.eligibility.eventAcceptsMemberships && !props.eligibility.eventAcceptsPasses && /* @__PURE__ */ jsx("p", {
778
+ children: /* @__PURE__ */ jsx("p", {
1140
779
  className: "er-text er-text--muted",
1141
- children: "You need an active membership for this event category."
780
+ children: "Pricing is unavailable for this event right now."
1142
781
  })
1143
- ] });
1144
- }
1145
- /** Places remain, just fewer than this booking asks for (issue 1581). */
1146
- function FewerPlacesPaymentPanel(props) {
782
+ });
1147
783
  return /* @__PURE__ */ jsxs("div", {
1148
784
  className: "rb-reg-stack er-stack",
1149
- children: [/* @__PURE__ */ jsx("h3", {
1150
- className: "er-title",
1151
- children: props.heading
1152
- }), /* @__PURE__ */ jsx("div", {
1153
- className: "er-center",
1154
- children: /* @__PURE__ */ jsx("p", {
785
+ children: [
786
+ deliveryMode === "hybrid" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("h3", {
787
+ tabIndex: -1,
788
+ className: "er-title",
789
+ children: "How will you attend?"
790
+ }), /* @__PURE__ */ jsx(AttendanceModeTiles, {
791
+ tiles: eventAttendanceModeTiles(attendanceModes, display),
792
+ selectedAttendanceMode,
793
+ onAttendanceModeChange
794
+ })] }) : null,
795
+ usesTicketTypes ? /* @__PURE__ */ jsx(Fragment, { children: noVisibleTicketTypes ? /* @__PURE__ */ jsx("p", {
1155
796
  className: "er-text er-text--muted",
1156
- children: props.message
797
+ children: "No ticket types are currently available."
798
+ }) : /* @__PURE__ */ jsxs(Fragment, { children: [
799
+ /* @__PURE__ */ jsxs("h3", {
800
+ tabIndex: -1,
801
+ className: "er-title",
802
+ children: ["Choose ", unit === "place" ? "your places" : "tickets"]
803
+ }),
804
+ /* @__PURE__ */ jsx(BookingUnitSessionHint, { bookingUnit }),
805
+ /* @__PURE__ */ jsx(TicketTypeQuantityRows, {
806
+ purpose,
807
+ display,
808
+ ticketTypes: visibleTicketTypes,
809
+ ticketSelections,
810
+ maxTickets,
811
+ heldPlacesBySelection,
812
+ availableSpots: resolveRemainingPlacesOverride(overallRemainingPlaces, availableSpots),
813
+ availabilityLabel: eventAvailabilityLabel,
814
+ currency: eventPricingCurrency,
815
+ hasAvailableTicketTypes,
816
+ onTicketSelectionsChange,
817
+ bookingUnit: unit
818
+ })
819
+ ] }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
820
+ slidingScale ? /* @__PURE__ */ jsx(SlidingScaleAmountField, {
821
+ slidingScale,
822
+ currency: eventPricingCurrency,
823
+ value: selectedSlidingAmountInput,
824
+ message: slidingScaleSelectionMessage,
825
+ onChange: onSlidingAmountChange
826
+ }) : null,
827
+ /* @__PURE__ */ jsx(BookingUnitSessionHint, { bookingUnit }),
828
+ /* @__PURE__ */ jsx(PlaceCounter, {
829
+ ticketsCount,
830
+ ceiling: placesCeiling ?? maxAllowed,
831
+ availableSpots,
832
+ availabilityLabel: eventAvailabilityLabel,
833
+ waitlist: canJoinWaitlist,
834
+ onTicketsChange
835
+ })
836
+ ] }),
837
+ /* @__PURE__ */ jsx(SelectionNote, { text: selectionNote }),
838
+ /* @__PURE__ */ jsx(PlacesNote, {
839
+ invitation,
840
+ isSoldOut,
841
+ canJoinWaitlist,
842
+ event,
843
+ someTicketsFull: someTicketsAtOwnLimit(visibleTicketTypes, purpose)
1157
844
  })
1158
- })]
845
+ ]
1159
846
  });
847
+ };
848
+ /** Some ticket types are full by their own limit while another can still be chosen. */
849
+ function someTicketsAtOwnLimit(ticketTypes, purpose) {
850
+ return ticketTypes.some((ticketType) => canRequestTicketOption(ticketType.availability, purpose)) && ticketTypes.some((ticketType) => ticketType.availability.kind === "unavailable" && ticketType.availability.reason === "sold_out");
1160
851
  }
1161
- function SoldOutPaymentPanel() {
1162
- return /* @__PURE__ */ jsxs("div", {
1163
- className: "rb-reg-stack er-stack",
1164
- children: [/* @__PURE__ */ jsx("h3", {
1165
- className: "er-title",
1166
- children: "Sold out"
1167
- }), /* @__PURE__ */ jsx("div", {
1168
- className: "er-center",
1169
- children: /* @__PURE__ */ jsx("p", {
1170
- className: "er-text er-text--muted",
1171
- children: "This event is fully booked and there is no waitlist available for this booking."
1172
- })
1173
- })]
852
+ function PlacesNote({ invitation, isSoldOut, canJoinWaitlist, event, someTicketsFull }) {
853
+ if (invitation?.kind === "held") return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("p", {
854
+ className: "er-text",
855
+ children: heldPlaceText(invitation.places, invitation.expiresAt, event)
856
+ }), invitation.ticketChoice && someTicketsFull ? /* @__PURE__ */ jsx("p", {
857
+ className: "er-text er-text--muted",
858
+ children: "If the ticket you were waiting for is sold out, you can choose another one for your place."
859
+ }) : null] });
860
+ if (invitation) return null;
861
+ if (canJoinWaitlist) return /* @__PURE__ */ jsx("p", {
862
+ className: "er-text er-text--muted",
863
+ children: "This event is currently full. Continue to join the waitlist if a place opens up."
1174
864
  });
865
+ return isSoldOut ? /* @__PURE__ */ jsx("p", {
866
+ className: "er-text er-text--muted",
867
+ children: "This event is fully booked."
868
+ }) : null;
1175
869
  }
1176
- function IneligiblePaymentPanel(props) {
1177
- const promptLogin = shouldPromptForLogin("not-eligible", props.isAuthenticated, props.eligibility);
1178
- return /* @__PURE__ */ jsxs("div", {
1179
- className: "rb-reg-stack er-stack",
1180
- children: [/* @__PURE__ */ jsx("h3", {
1181
- className: "er-title",
1182
- children: promptLogin ? "Log in required" : "Payment required"
1183
- }), /* @__PURE__ */ jsx("div", {
1184
- className: "er-center",
1185
- children: promptLogin ? /* @__PURE__ */ jsxs(Fragment, { children: [
1186
- /* @__PURE__ */ jsx("p", {
1187
- className: "er-text er-text--muted",
1188
- children: "Have a pass or membership? Log in to use it."
1189
- }),
1190
- /* @__PURE__ */ jsx(ThemedButton, {
870
+ /** How long the invitation holds their place, in the event's own time zone. */
871
+ function heldPlaceText(places, expiresAt, event) {
872
+ const held = places === 1 ? "We’re holding a place for you" : `We’re holding ${places} places for you`;
873
+ return event ? `${held} until ${formatTime(expiresAt, event)} on ${formatDate(expiresAt, event)}. Continue to book before then.` : `${held}. Continue to book.`;
874
+ }
875
+ function resolveRemainingPlacesOverride(override, cached) {
876
+ return override === void 0 ? cached : override;
877
+ }
878
+ //#endregion
879
+ //#region ../blocks/src/system/runtime/nodes/event-registration/RoomChooser.tsx
880
+ function currencyOf(wizard) {
881
+ return wizard.eligibility?.currency ?? (wizard.selectedEvent && publicEventPricingCurrency(wizard.selectedEvent.pricing)) ?? "GBP";
882
+ }
883
+ function RoomPhotos(props) {
884
+ const { kind } = props;
885
+ const titleId = useId();
886
+ const [index, setIndex] = useState(0);
887
+ const photo = kind.photos[index];
888
+ const several = kind.photos.length > 1;
889
+ return /* @__PURE__ */ jsxs(ModalShell, {
890
+ title: kind.name,
891
+ titleId,
892
+ onClose: props.onClose,
893
+ overlayClassName: "er-room-photos-overlay",
894
+ modalClassName: "er-room-photos",
895
+ headerClassName: "er-room-photos-head",
896
+ titleClassName: "er-title",
897
+ closeButtonClassName: "er-room-photos-close",
898
+ children: [photo ? /* @__PURE__ */ jsx("img", {
899
+ src: photo.src,
900
+ alt: photo.alt,
901
+ className: "er-room-photos-image"
902
+ }) : null, several ? /* @__PURE__ */ jsxs("div", {
903
+ className: "er-room-photos-nav",
904
+ children: [
905
+ /* @__PURE__ */ jsx("button", {
1191
906
  type: "button",
1192
- variant: "primary",
1193
- size: "md",
1194
- label: "Email me a login link",
1195
- disabled: !props.email.trim(),
1196
- onClick: props.onRequestLogin
907
+ className: "er-back-btn",
908
+ disabled: index === 0,
909
+ onClick: () => setIndex(index - 1),
910
+ children: "Previous photo"
1197
911
  }),
1198
- !props.email.trim() && /* @__PURE__ */ jsx("p", {
912
+ /* @__PURE__ */ jsxs("span", {
1199
913
  className: "er-text er-text--muted",
1200
- children: "Enter your email to request a login link."
914
+ children: [
915
+ index + 1,
916
+ " of ",
917
+ kind.photos.length
918
+ ]
919
+ }),
920
+ /* @__PURE__ */ jsx("button", {
921
+ type: "button",
922
+ className: "er-back-btn",
923
+ disabled: index === kind.photos.length - 1,
924
+ onClick: () => setIndex(index + 1),
925
+ children: "Next photo"
1201
926
  })
1202
- ] }) : /* @__PURE__ */ jsx(UnavailableEntitlementMessage, { eligibility: props.eligibility })
1203
- })]
927
+ ]
928
+ }) : null]
1204
929
  });
1205
930
  }
1206
- function renderRegistrationAvailabilityBlocker(admission) {
1207
- const blocker = resolveRegistrationAvailabilityBlocker(admission);
1208
- if (blocker?.kind !== "unavailable") return null;
1209
- switch (blocker.reason) {
1210
- case "alreadyWaitlisted": return /* @__PURE__ */ jsx(AlreadyWaitlistedPaymentPanel, {});
1211
- case "soldOut": return /* @__PURE__ */ jsx(SoldOutPaymentPanel, {});
1212
- case "fewerPlacesLeft": return /* @__PURE__ */ jsx(FewerPlacesPaymentPanel, {
1213
- heading: blocker.heading,
1214
- message: blocker.message
1215
- });
1216
- case "closed": return /* @__PURE__ */ jsx(ClosedPaymentPanel, { message: blocker.message });
1217
- }
931
+ function photoLabel(kind) {
932
+ return `${kind.name}, ${kind.photos.length} ${kind.photos.length === 1 ? "photo" : "photos"}. Tap to see them.`;
1218
933
  }
1219
- function PaymentBlockingPanel(props) {
1220
- if (props.eligibilityLoading) return /* @__PURE__ */ jsx("div", {
1221
- className: "rb-reg-stack er-stack",
1222
- children: /* @__PURE__ */ jsxs("div", {
1223
- className: "er-center",
1224
- children: [/* @__PURE__ */ jsx(SpinnerNode, {
1225
- size: "lg",
1226
- srLabel: "Checking payment options"
1227
- }), /* @__PURE__ */ jsx("p", {
1228
- className: "er-text--muted",
1229
- children: "Checking payment options…"
1230
- })]
934
+ /** The one row every place on this step uses: what it is, its price, then how many. */
935
+ function RoomRow(props) {
936
+ return /* @__PURE__ */ jsxs("div", {
937
+ className: [
938
+ "er-room-option",
939
+ props.disabled ? "er-ticket-line--disabled" : null,
940
+ props.gone ? "er-room-option--gone" : null
941
+ ].filter(Boolean).join(" "),
942
+ "data-chosen": props.chosen ? "" : void 0,
943
+ role: "listitem",
944
+ children: [
945
+ /* @__PURE__ */ jsxs("div", {
946
+ className: "er-room-option-text",
947
+ children: [/* @__PURE__ */ jsx("span", {
948
+ className: "er-ticket-line-name",
949
+ children: props.title
950
+ }), props.details.map((detail) => detail ? /* @__PURE__ */ jsx("p", {
951
+ className: "er-ticket-line-detail",
952
+ children: detail
953
+ }, detail) : null)]
954
+ }),
955
+ /* @__PURE__ */ jsx("span", {
956
+ className: "er-ticket-line-price er-room-option-price",
957
+ children: props.price
958
+ }),
959
+ props.control
960
+ ]
961
+ });
962
+ }
963
+ function RoomOptionRow(props) {
964
+ const { option } = props;
965
+ const price = `${formatPrice(option.priceCents, props.currency)}${option.each ? " each" : ""}`;
966
+ if (option.gone) return /* @__PURE__ */ jsx(RoomRow, {
967
+ gone: true,
968
+ chosen: false,
969
+ title: option.title,
970
+ details: ["Someone else has just booked this."],
971
+ price,
972
+ control: /* @__PURE__ */ jsx("button", {
973
+ type: "button",
974
+ className: "er-back-btn er-room-take-off",
975
+ "aria-label": `Take off ${props.kindName}, ${option.title}`,
976
+ onClick: () => props.onChange(0),
977
+ children: "Take off"
1231
978
  })
1232
979
  });
1233
- if (props.eligibilityError) return /* @__PURE__ */ jsx("div", {
1234
- className: "rb-reg-stack er-stack",
1235
- children: /* @__PURE__ */ jsx("div", {
1236
- className: "er-center",
1237
- children: /* @__PURE__ */ jsx("p", {
1238
- className: "er-text er-error",
1239
- children: props.eligibilityError
1240
- })
980
+ return /* @__PURE__ */ jsx(RoomRow, {
981
+ chosen: option.people > 0,
982
+ title: option.title,
983
+ details: [option.detail, props.display.placesLeft === "shown" ? option.placesLeft : null],
984
+ price,
985
+ control: /* @__PURE__ */ jsx(TicketCounter, {
986
+ ticketsCount: option.people,
987
+ minAllowed: 0,
988
+ maxAllowed: option.maxPeople,
989
+ label: `${props.kindName}, ${option.title}`,
990
+ onTicketsChange: props.onChange
1241
991
  })
1242
992
  });
1243
- if (!props.eligibility) return /* @__PURE__ */ jsx(MissingEligibilityPanel, {});
1244
- const availabilityPanel = renderRegistrationAvailabilityBlocker(props.admission);
1245
- if (availabilityPanel) return availabilityPanel;
1246
- if (props.paysNothing) return /* @__PURE__ */ jsx(FreePaymentSummary, { ticketsCount: props.ticketsCount });
1247
- return props.eligibility.paymentOptions.length > 0 ? null : /* @__PURE__ */ jsx(IneligiblePaymentPanel, {
1248
- eligibility: props.eligibility,
1249
- email: props.email,
1250
- isAuthenticated: props.isAuthenticated,
1251
- onRequestLogin: props.onRequestLogin
993
+ }
994
+ function RoomKindGroup(props) {
995
+ const { kind, chooser } = props;
996
+ const [viewing, setViewing] = useState(false);
997
+ const firstPhoto = kind.photos[0];
998
+ return /* @__PURE__ */ jsxs("section", {
999
+ className: "er-room-kind",
1000
+ "aria-label": kind.name,
1001
+ "data-fully-booked": kind.fullyBooked ? "" : void 0,
1002
+ children: [
1003
+ /* @__PURE__ */ jsxs("div", {
1004
+ className: "er-room-kind-head",
1005
+ children: [firstPhoto ? /* @__PURE__ */ jsx("button", {
1006
+ type: "button",
1007
+ className: "er-room-photo",
1008
+ onClick: () => setViewing(true),
1009
+ children: /* @__PURE__ */ jsx("img", {
1010
+ src: firstPhoto.src,
1011
+ alt: photoLabel(kind)
1012
+ })
1013
+ }) : null, /* @__PURE__ */ jsxs("div", {
1014
+ className: "er-room-kind-text",
1015
+ children: [/* @__PURE__ */ jsxs("div", {
1016
+ className: "er-room-kind-title",
1017
+ children: [/* @__PURE__ */ jsx("h4", {
1018
+ className: "er-room-kind-name",
1019
+ children: kind.name
1020
+ }), kind.fullyBooked ? /* @__PURE__ */ jsx("span", {
1021
+ className: "er-room-kind-full",
1022
+ children: "Fully booked"
1023
+ }) : null]
1024
+ }), kind.description ? /* @__PURE__ */ jsx("p", {
1025
+ className: "er-text er-text--muted",
1026
+ children: kind.description
1027
+ }) : null]
1028
+ })]
1029
+ }),
1030
+ kind.options.length > 0 ? /* @__PURE__ */ jsx("div", {
1031
+ role: "list",
1032
+ children: kind.options.map((option) => /* @__PURE__ */ jsx(RoomOptionRow, {
1033
+ kindName: kind.name,
1034
+ option,
1035
+ currency: props.currency,
1036
+ display: props.display,
1037
+ onChange: (people) => chooser.setRoomChoices(setRoomChoicePeople(chooser.choices, option.choice, people))
1038
+ }, option.key))
1039
+ }) : null,
1040
+ viewing ? /* @__PURE__ */ jsx(RoomPhotos, {
1041
+ kind,
1042
+ onClose: () => setViewing(false)
1043
+ }) : null
1044
+ ]
1252
1045
  });
1253
1046
  }
1254
- function AlreadyWaitlistedPaymentPanel() {
1255
- return /* @__PURE__ */ jsxs("div", {
1256
- className: "rb-reg-stack er-stack",
1257
- children: [/* @__PURE__ */ jsx("h3", {
1258
- className: "er-title",
1259
- children: "Already on the waitlist"
1260
- }), /* @__PURE__ */ jsxs("div", {
1261
- className: "er-center",
1262
- children: [/* @__PURE__ */ jsx("p", {
1263
- className: "er-text er-text--muted",
1264
- children: "You're already on the waitlist for this event."
1265
- }), /* @__PURE__ */ jsx("a", {
1266
- href: "/portal",
1267
- className: "er-retry-btn",
1268
- children: "View my bookings"
1269
- })]
1270
- })]
1047
+ function DayPlaceRow(props) {
1048
+ const { ticketType, wizard } = props;
1049
+ const { quantity, maxAllowed, disabled, detail, setQuantity } = ticketTypeQuantity({
1050
+ display: props.display,
1051
+ purpose: wizard.ticketSelectionPurpose,
1052
+ ticketType,
1053
+ ticketSelections: wizard.selectedTicketLines,
1054
+ maxTickets: wizard.maxTicketsNum,
1055
+ availableSpots: null,
1056
+ currency: props.currency,
1057
+ onTicketSelectionsChange: props.chooser.setDayLines
1058
+ });
1059
+ return /* @__PURE__ */ jsx(RoomRow, {
1060
+ chosen: quantity > 0,
1061
+ disabled,
1062
+ title: ticketType.name,
1063
+ details: [ticketType.description ?? null, detail],
1064
+ price: ticketTypePriceText(ticketType, props.currency),
1065
+ control: /* @__PURE__ */ jsx(TicketCounter, {
1066
+ ticketsCount: quantity,
1067
+ minAllowed: 0,
1068
+ maxAllowed,
1069
+ label: ticketType.name,
1070
+ onTicketsChange: setQuantity
1071
+ })
1271
1072
  });
1272
1073
  }
1273
- function FreePaymentSummary({ ticketsCount }) {
1274
- return /* @__PURE__ */ jsxs("div", {
1275
- className: "rb-reg-stack er-stack",
1276
- children: [/* @__PURE__ */ jsx("h3", {
1277
- className: "er-title",
1278
- children: "Payment"
1279
- }), /* @__PURE__ */ jsxs("div", {
1280
- className: "er-payment-summary",
1281
- children: [/* @__PURE__ */ jsx("p", {
1282
- className: "er-text",
1283
- children: "This event is free!"
1284
- }), /* @__PURE__ */ jsxs("p", {
1285
- className: "er-text er-text--muted",
1074
+ function PlacesWithoutARoom(props) {
1075
+ const { chooser } = props;
1076
+ if (chooser.dayOptions.length === 0) return null;
1077
+ return /* @__PURE__ */ jsxs("section", {
1078
+ className: "er-room-kind",
1079
+ "aria-label": "Places without a room",
1080
+ children: [/* @__PURE__ */ jsx("h4", {
1081
+ className: "er-room-kind-name",
1082
+ children: "Places without a room"
1083
+ }), /* @__PURE__ */ jsx("div", {
1084
+ role: "list",
1085
+ children: chooser.dayOptions.map((ticketType) => /* @__PURE__ */ jsx(DayPlaceRow, {
1086
+ ticketType,
1087
+ wizard: props.wizard,
1088
+ chooser,
1089
+ display: props.display,
1090
+ currency: props.currency
1091
+ }, ticketType.pricingOptionId))
1092
+ })]
1093
+ });
1094
+ }
1095
+ /** Everywhere to sleep, the places that don't need a room, and how that adds up. */
1096
+ function RoomChooser(props) {
1097
+ const { wizard, chooser, display } = props;
1098
+ const { view } = chooser;
1099
+ const currency = currencyOf(wizard);
1100
+ return /* @__PURE__ */ jsxs("div", {
1101
+ className: "er-room-chooser",
1102
+ children: [
1103
+ /* @__PURE__ */ jsxs("div", {
1104
+ className: "er-room-chooser-intro",
1105
+ children: [/* @__PURE__ */ jsx("h3", {
1106
+ tabIndex: -1,
1107
+ className: "er-title",
1108
+ children: "Where would you like to sleep?"
1109
+ }), /* @__PURE__ */ jsx("p", {
1110
+ className: "er-text er-text--muted",
1111
+ children: view.intro
1112
+ })]
1113
+ }),
1114
+ view.kinds.map((kind) => /* @__PURE__ */ jsx(RoomKindGroup, {
1115
+ kind,
1116
+ currency,
1117
+ display,
1118
+ chooser
1119
+ }, kind.kindId)),
1120
+ /* @__PURE__ */ jsx(PlacesWithoutARoom, {
1121
+ wizard,
1122
+ chooser,
1123
+ display,
1124
+ currency
1125
+ }),
1126
+ /* @__PURE__ */ jsxs("div", {
1127
+ className: "er-room-chooser-stay",
1128
+ "aria-live": "polite",
1286
1129
  children: [
1287
- ticketsCount,
1288
- " ticket",
1289
- ticketsCount > 1 ? "s" : ""
1130
+ view.stayLines.length > 0 ? /* @__PURE__ */ jsxs("div", {
1131
+ className: "er-ticket-line-summary",
1132
+ children: [/* @__PURE__ */ jsx("p", {
1133
+ className: "er-ticket-line-summary-title",
1134
+ children: "How you'll stay"
1135
+ }), /* @__PURE__ */ jsx("ul", {
1136
+ className: "er-ticket-line-summary-list",
1137
+ children: view.stayLines.map((line) => /* @__PURE__ */ jsxs("li", { children: [line, "."] }, line))
1138
+ })]
1139
+ }) : null,
1140
+ view.priceNote ? /* @__PURE__ */ jsx("p", {
1141
+ className: "er-text er-text--muted er-room-price-note-beside-stay",
1142
+ children: view.priceNote
1143
+ }) : null,
1144
+ view.note ? /* @__PURE__ */ jsx("div", {
1145
+ className: "er-notice er-notice--info",
1146
+ role: "status",
1147
+ children: /* @__PURE__ */ jsx("p", { children: view.note })
1148
+ }) : null
1290
1149
  ]
1291
- })]
1150
+ })
1151
+ ]
1152
+ });
1153
+ }
1154
+ /**
1155
+ * The footer's summary: anything stopping the booking sits directly above the
1156
+ * total, where it stays in view in the sticky bar on a phone.
1157
+ */
1158
+ function RoomChooserSummary(props) {
1159
+ const { view } = props;
1160
+ const { takeOff } = view;
1161
+ return /* @__PURE__ */ jsxs(Fragment, { children: [view.notice ? /* @__PURE__ */ jsxs("div", {
1162
+ className: "er-notice er-notice--info er-room-notice",
1163
+ role: "alert",
1164
+ children: [
1165
+ /* @__PURE__ */ jsx("p", { children: view.notice }),
1166
+ view.noticeStay.length > 0 ? /* @__PURE__ */ jsx("ul", {
1167
+ className: "er-room-notice-stay",
1168
+ children: view.noticeStay.map((line) => /* @__PURE__ */ jsxs("li", { children: [line, "."] }, line))
1169
+ }) : null,
1170
+ takeOff ? /* @__PURE__ */ jsx("button", {
1171
+ type: "button",
1172
+ className: "er-back-btn er-room-take-off",
1173
+ onClick: () => props.wizard.roomChooser?.setRoomChoices(takeOff.choices),
1174
+ children: takeOff.label
1175
+ }) : null
1176
+ ]
1177
+ }) : null, /* @__PURE__ */ jsxs("div", {
1178
+ className: "er-summary-bar er-room-summary",
1179
+ children: [/* @__PURE__ */ jsx("div", {
1180
+ className: "er-summary-bar-info",
1181
+ children: view.people === 0 ? /* @__PURE__ */ jsx("span", {
1182
+ className: "er-summary-bar-meta",
1183
+ children: ADD_A_PLACE
1184
+ }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1185
+ /* @__PURE__ */ jsxs("span", {
1186
+ className: "er-summary-bar-meta",
1187
+ children: [
1188
+ view.people,
1189
+ " ",
1190
+ view.people === 1 ? "person" : "people"
1191
+ ]
1192
+ }),
1193
+ view.splitWarning ? /* @__PURE__ */ jsx("span", {
1194
+ className: "er-room-split-warning",
1195
+ children: view.splitWarning
1196
+ }) : null,
1197
+ view.totalNote ? /* @__PURE__ */ jsx("span", {
1198
+ className: "er-text er-text--muted",
1199
+ children: view.totalNote
1200
+ }) : null,
1201
+ view.priceNote ? /* @__PURE__ */ jsx("span", {
1202
+ className: "er-text er-text--muted er-room-price-note-in-bar",
1203
+ children: view.priceNote
1204
+ }) : null
1205
+ ] })
1206
+ }), view.totalCents === null ? null : /* @__PURE__ */ jsx("span", {
1207
+ className: "er-summary-bar-price",
1208
+ children: formatPrice(view.totalCents, currencyOf(props.wizard))
1209
+ })]
1210
+ })] });
1211
+ }
1212
+ //#endregion
1213
+ //#region ../blocks/src/system/runtime/nodes/event-registration/ErrorStep.tsx
1214
+ /**
1215
+ * Error Step
1216
+ *
1217
+ * Displays an error message with a retry button when registration fails.
1218
+ */
1219
+ const labels = {
1220
+ none: "",
1221
+ retry: "Try again",
1222
+ places: "Choose places",
1223
+ start: "Start again",
1224
+ details: "Check my details",
1225
+ "payment-options": "View payment options",
1226
+ portal: "View my bookings",
1227
+ event: "View event"
1228
+ };
1229
+ const ErrorStep = ({ message, onRetry, action = "retry", canJoinWaitlist = false }) => {
1230
+ const offerWaitlist = action === "places" && canJoinWaitlist;
1231
+ return /* @__PURE__ */ jsx(TerminalPanel, {
1232
+ tone: "error",
1233
+ className: "er-center",
1234
+ titleClassName: "er-title--lg er-message",
1235
+ icon: /* @__PURE__ */ jsx(StateIcon, {
1236
+ variant: "error",
1237
+ children: /* @__PURE__ */ jsx(CrossIcon, {})
1238
+ }),
1239
+ title: "We couldn’t complete your booking",
1240
+ body: /* @__PURE__ */ jsx("p", {
1241
+ className: "er-text--muted er-message",
1242
+ children: offerWaitlist ? "Sorry, this event is now full. You can join the waiting list, and we’ll email you if a place becomes available." : message
1243
+ }),
1244
+ actions: action === "none" ? void 0 : action === "portal" ? /* @__PURE__ */ jsx("a", {
1245
+ href: "/portal",
1246
+ className: "er-retry-btn",
1247
+ children: labels[action]
1248
+ }) : /* @__PURE__ */ jsx("button", {
1249
+ type: "button",
1250
+ onClick: onRetry,
1251
+ className: "er-retry-btn",
1252
+ children: offerWaitlist ? "Join the waiting list" : labels[action]
1253
+ })
1254
+ });
1255
+ };
1256
+ //#endregion
1257
+ //#region ../blocks/src/system/runtime/nodes/event-registration/CopyParts.tsx
1258
+ /** Copy with its bold parts in <strong>: offer lines and hints (issue 1725). */
1259
+ function CopyParts(props) {
1260
+ return /* @__PURE__ */ jsx(Fragment, { children: props.parts.map((part, index) => part.strong ? /* @__PURE__ */ jsx("strong", { children: part.text }, index) : /* @__PURE__ */ jsx(React.Fragment, { children: part.text }, index)) });
1261
+ }
1262
+ //#endregion
1263
+ //#region ../blocks/src/system/runtime/nodes/event-registration/CombinationSummary.tsx
1264
+ /** The usual total struck through, then what combination prices bring it to (issue 1725). */
1265
+ function CombinationPricing(props) {
1266
+ return /* @__PURE__ */ jsxs("div", {
1267
+ className: "er-summary-bar-pricing",
1268
+ children: [/* @__PURE__ */ jsx("span", {
1269
+ className: "er-summary-bar-price er-summary-bar-price--struck",
1270
+ children: formatPrice(props.listCents, props.currency)
1271
+ }), /* @__PURE__ */ jsx("span", {
1272
+ className: "er-summary-bar-price",
1273
+ children: formatPrice(props.totalCents, props.currency)
1292
1274
  })]
1293
1275
  });
1294
1276
  }
1295
- function ClosedPaymentPanel({ message }) {
1277
+ /** "4 dates for £40, plus 1 at £12 · You save £8" under the summary row. */
1278
+ function CombinationDetail(props) {
1279
+ if (!props.working) return null;
1280
+ return /* @__PURE__ */ jsxs("p", {
1281
+ className: "er-combination-detail",
1282
+ children: [
1283
+ props.working.working,
1284
+ " · ",
1285
+ /* @__PURE__ */ jsx("span", {
1286
+ className: "er-combination-saving",
1287
+ children: props.working.saving
1288
+ })
1289
+ ]
1290
+ });
1291
+ }
1292
+ /** "Add 1 more date to get 4 dates for £40." under the summary bar. */
1293
+ function CombinationHint(props) {
1294
+ if (!props.parts) return null;
1295
+ return /* @__PURE__ */ jsx("p", {
1296
+ className: "er-combination-hint",
1297
+ role: "status",
1298
+ children: /* @__PURE__ */ jsx(CopyParts, { parts: props.parts })
1299
+ });
1300
+ }
1301
+ //#endregion
1302
+ //#region ../blocks/src/system/runtime/nodes/event-registration/registrationSummary.state.ts
1303
+ /** Several course runs are one purchase; individual run names belong in the breakdown. */
1304
+ function registrationSummaryTitle(input) {
1305
+ if (input.severalItems === "runs") return (input.subject?.kind === "eventOffering" ? input.subject.title?.trim() : null) || "Your booking";
1306
+ return occurrenceTitleOverride(input.occurrenceContext) ?? input.eventTitle ?? "";
1307
+ }
1308
+ //#endregion
1309
+ //#region ../blocks/src/system/runtime/nodes/event-registration/EventRegistrationSummaryBar.tsx
1310
+ /** A run booked with the visitor's membership, which the bar names in place of a price. */
1311
+ function membershipFor(wizard) {
1312
+ const selection = wizard.paymentSelection;
1313
+ return selection.method === "membership" ? selection.productName?.trim() || "Membership" : null;
1314
+ }
1315
+ /** The membership covering a run, above the bar; nothing without one. */
1316
+ function MembershipRow(props) {
1317
+ if (props.name === null) return null;
1318
+ return /* @__PURE__ */ jsxs("div", {
1319
+ className: "er-summary-bar-product",
1320
+ children: [/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("div", {
1321
+ className: "er-summary-bar-product-name",
1322
+ children: props.name
1323
+ }) }), /* @__PURE__ */ jsx("div", {
1324
+ className: "er-summary-bar-product-price",
1325
+ children: /* @__PURE__ */ jsx("span", {
1326
+ className: "er-summary-bar-included",
1327
+ children: "Included"
1328
+ })
1329
+ })]
1330
+ });
1331
+ }
1332
+ function getFlexibleBalanceSummary(option) {
1333
+ return option?.flexibleBalance ? {
1334
+ total: option.amounts.formattedTotal,
1335
+ dueToday: option.amounts.formattedDueToday,
1336
+ ...option.flexibleBalance
1337
+ } : null;
1338
+ }
1339
+ function getSelectedDirectPaymentOption(wizard) {
1340
+ if (wizard.paymentSelection.method !== "stripe") return null;
1341
+ const kind = wizard.paymentSelection.collectionOptionKind;
1342
+ return wizard.directPaymentOptions.find((option) => option.kind === kind) ?? null;
1343
+ }
1344
+ /** "2 tickets" or "1 place"; booking several, "5 dates × 2 places" or the runs by name. */
1345
+ function summaryCountLabel(wizard, summaryEvent) {
1346
+ if (wizard.severalItems !== null) return selectionPlacesLabel(wizard.severalItems, wizard.selection, wizard.ticketsCount);
1347
+ if (wizard.ticketsCount <= 0) return null;
1348
+ const tiered = summaryEvent !== null && summaryEvent !== void 0 && publicEventPricingStrategy(summaryEvent.pricing) === "tiered";
1349
+ if (tiered) {
1350
+ const byType = ticketTypeCountLabel(wizard.selectedTicketLines, wizard.visibleTicketTypes);
1351
+ if (byType) return byType;
1352
+ }
1353
+ const unit = tiered ? "ticket" : "place";
1354
+ return `${wizard.ticketsCount} ${unit}${wizard.ticketsCount === 1 ? "" : "s"}`;
1355
+ }
1356
+ /** "1 Standard, 1 Concession" when tickets of more than one type are chosen; otherwise null. */
1357
+ function ticketTypeCountLabel(lines, ticketTypes) {
1358
+ const chosen = lines.filter((line) => line.quantity > 0);
1359
+ if (chosen.length < 2) return null;
1360
+ const parts = chosen.map((line) => {
1361
+ const name = ticketTypes.find((type) => type.pricingOptionId === line.pricingOptionId)?.name;
1362
+ return name ? `${line.quantity} ${name}` : null;
1363
+ });
1364
+ return parts.every((part) => part !== null) ? parts.join(", ") : null;
1365
+ }
1366
+ /**
1367
+ * The footer's one line (issue 1581): how many, the discount's name, then
1368
+ * when. Ticket types are tickets; a single price, or a course, is places.
1369
+ */
1370
+ function summaryMetaFacts(input) {
1371
+ const { wizard, summaryEvent } = input;
1372
+ const several = wizard.severalItems;
1373
+ return {
1374
+ countLabel: summaryCountLabel(wizard, summaryEvent),
1375
+ discount: input.discount && membershipFor(wizard) === null ? {
1376
+ label: input.discount.publicLabel,
1377
+ description: input.discount.description ?? null
1378
+ } : null,
1379
+ schedule: summaryEvent && several === null ? formatRegistrationSchedule(summaryEvent, wizard.occurrenceContext) : null
1380
+ };
1381
+ }
1382
+ /** The panel's header already says when, so the panel hides the schedule. */
1383
+ function SummaryMeta({ facts }) {
1384
+ return /* @__PURE__ */ jsxs("span", {
1385
+ className: "er-summary-bar-meta",
1386
+ children: [
1387
+ facts.countLabel ? /* @__PURE__ */ jsx("span", {
1388
+ className: "er-summary-bar-count",
1389
+ children: facts.countLabel
1390
+ }) : null,
1391
+ facts.discount ? /* @__PURE__ */ jsx("span", {
1392
+ className: "er-summary-bar-discount",
1393
+ title: facts.discount.description ?? void 0,
1394
+ children: facts.discount.label
1395
+ }) : null,
1396
+ facts.schedule ? /* @__PURE__ */ jsx("span", {
1397
+ className: "er-summary-bar-schedule",
1398
+ children: facts.schedule
1399
+ }) : null
1400
+ ]
1401
+ });
1402
+ }
1403
+ /**
1404
+ * The date step's footer line (issue 1581): the chosen date and its price,
1405
+ * before any places are counted. Nothing until a date is chosen.
1406
+ */
1407
+ function DateStepSummary({ event }) {
1408
+ if (!event) return null;
1409
+ const price = formatEventPriceDisplay(event.pricing).trim();
1410
+ return /* @__PURE__ */ jsxs("div", {
1411
+ className: "er-summary-bar",
1412
+ "data-step": "select-event",
1413
+ children: [/* @__PURE__ */ jsx("div", {
1414
+ className: "er-summary-bar-info",
1415
+ children: /* @__PURE__ */ jsx("span", {
1416
+ className: "er-summary-bar-meta",
1417
+ children: /* @__PURE__ */ jsx("span", {
1418
+ className: "er-summary-bar-schedule",
1419
+ children: formatRegistrationSchedule(event)
1420
+ })
1421
+ })
1422
+ }), price ? /* @__PURE__ */ jsx("div", {
1423
+ className: "er-summary-bar-pricing",
1424
+ children: /* @__PURE__ */ jsx("span", {
1425
+ className: "er-summary-bar-price",
1426
+ children: price
1427
+ })
1428
+ }) : null]
1429
+ });
1430
+ }
1431
+ /**
1432
+ * Booking several (issue 1725): how many are ticked and their total. With
1433
+ * combination prices the usual total is struck through above the planned
1434
+ * one, with the working underneath and the next saving under the bar.
1435
+ */
1436
+ function SeveralStepSummary({ wizard }) {
1437
+ const several = wizard.severalItems;
1438
+ const first = wizard.selectedEvent;
1439
+ const { working, hint } = wizard.selectionCombination;
1440
+ if (several === null || !first) return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DateStepSummary, { event: first }), /* @__PURE__ */ jsx(CombinationHint, { parts: hint })] });
1441
+ const currency = publicEventPricingCurrency(first.pricing);
1442
+ const { totalCents: total, listTotalCents: list } = wizard.selectionPrice;
1443
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
1444
+ className: summaryBarClassName(working),
1445
+ "data-step": "select-event",
1446
+ children: [
1447
+ /* @__PURE__ */ jsx("div", {
1448
+ className: "er-summary-bar-info",
1449
+ children: /* @__PURE__ */ jsx("span", {
1450
+ className: "er-summary-bar-meta",
1451
+ children: /* @__PURE__ */ jsx("span", {
1452
+ className: "er-summary-bar-count",
1453
+ children: selectionItemsLabel(several, wizard.selection)
1454
+ })
1455
+ })
1456
+ }),
1457
+ currency && total !== null && total > 0 ? working && list !== null ? /* @__PURE__ */ jsx(CombinationPricing, {
1458
+ listCents: list,
1459
+ totalCents: total,
1460
+ currency
1461
+ }) : /* @__PURE__ */ jsx("div", {
1462
+ className: "er-summary-bar-pricing",
1463
+ children: /* @__PURE__ */ jsx("span", {
1464
+ className: "er-summary-bar-price",
1465
+ children: formatPrice(total, currency)
1466
+ })
1467
+ }) : null,
1468
+ /* @__PURE__ */ jsx(CombinationDetail, { working })
1469
+ ]
1470
+ }), /* @__PURE__ */ jsx(CombinationHint, { parts: hint })] });
1471
+ }
1472
+ /**
1473
+ * Dates with a pass or membership: the bar shows what the card is charged,
1474
+ * not the dates' price.
1475
+ */
1476
+ function barPrice(wizard) {
1477
+ const fundedCardCents = wizard.selectionFunding?.view?.cardCents ?? null;
1478
+ return fundedCardCents === null ? {
1479
+ subtotalCents: wizard.ticketSelectionSubtotalCents,
1480
+ funded: false
1481
+ } : {
1482
+ subtotalCents: fundedCardCents,
1483
+ funded: true
1484
+ };
1485
+ }
1486
+ /**
1487
+ * The later steps' price for several items with combination prices: the
1488
+ * usual total struck through, then what's due. The working shows while the
1489
+ * planner's total stands; once the server prices a code, its total alone.
1490
+ */
1491
+ function combinationSummary(wizard, price) {
1492
+ if (wizard.severalItems === null || price.funded) return null;
1493
+ const subtotalCents = price.subtotalCents;
1494
+ const list = wizard.selectionPrice.listTotalCents;
1495
+ const working = wizard.selectionCombination.working;
1496
+ if (list === null || list <= subtotalCents || working === null && wizard.combinationCodeField === null) return null;
1497
+ return {
1498
+ list,
1499
+ working: subtotalCents === wizard.selectionPrice.totalCents ? working : null
1500
+ };
1501
+ }
1502
+ /** A deposit or instalment plan: the total, what's payable now, and what's left. */
1503
+ function FlexibleBalancePricing(props) {
1504
+ const { summary } = props;
1505
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1506
+ summary.total ? /* @__PURE__ */ jsxs("div", {
1507
+ className: "er-summary-bar-product-detail",
1508
+ children: ["Total: ", summary.total]
1509
+ }) : null,
1510
+ /* @__PURE__ */ jsx("div", {
1511
+ className: "er-summary-bar-price",
1512
+ children: summary.dueToday ?? props.fallbackDueToday
1513
+ }),
1514
+ /* @__PURE__ */ jsx("div", {
1515
+ className: "er-summary-bar-included",
1516
+ children: "Payable now"
1517
+ }),
1518
+ summary.remainingBalance ? /* @__PURE__ */ jsxs("div", {
1519
+ className: "er-summary-bar-product-detail",
1520
+ children: [
1521
+ "Remaining balance: ",
1522
+ summary.remainingBalance,
1523
+ summary.balanceDueBy ? ` due by ${summary.balanceDueBy}` : ""
1524
+ ]
1525
+ }) : null,
1526
+ summary.depositPolicy ? /* @__PURE__ */ jsxs("div", {
1527
+ className: "er-summary-bar-product-detail",
1528
+ children: ["Deposit: ", summary.depositPolicy]
1529
+ }) : null
1530
+ ] });
1531
+ }
1532
+ function summaryBarClassName(working) {
1533
+ return working ? "er-summary-bar er-summary-bar--combination" : "er-summary-bar";
1534
+ }
1535
+ function EventRegistrationSummaryBar(props) {
1536
+ const { wizard } = props;
1537
+ if (wizard.step === "select-event") return /* @__PURE__ */ jsx(SeveralStepSummary, { wizard });
1538
+ const summaryEvent = wizard.selectedEvent ?? wizard.preSelectedEvent;
1539
+ const summaryTitle = registrationSummaryTitle({
1540
+ ...wizard,
1541
+ eventTitle: summaryEvent?.title
1542
+ });
1543
+ const summaryCurrency = summaryEvent ? publicEventPricingCurrency(summaryEvent.pricing) : null;
1544
+ const teamMemberNames = (summaryEvent?.teamMembers ?? []).map((teamMember) => teamMember.name).filter(Boolean);
1545
+ const price = barPrice(wizard);
1546
+ const subtotalCents = price.subtotalCents;
1547
+ if (!summaryTitle || !summaryCurrency || subtotalCents === null) return null;
1548
+ const autoAppliedDiscount = wizard.autoAppliedDiscount;
1549
+ const autoAppliedDiscountCents = Math.max(0, autoAppliedDiscount?.computedAmountCents ?? 0);
1550
+ const discountedTotalCents = Math.max(0, subtotalCents - autoAppliedDiscountCents);
1551
+ const flexibleBalanceSummary = getFlexibleBalanceSummary(getSelectedDirectPaymentOption(wizard));
1552
+ const meta = summaryMetaFacts({
1553
+ wizard,
1554
+ summaryEvent,
1555
+ discount: autoAppliedDiscountCents > 0 ? autoAppliedDiscount : null
1556
+ });
1557
+ const membership = membershipFor(wizard);
1558
+ const combination = combinationSummary(wizard, {
1559
+ subtotalCents,
1560
+ funded: price.funded
1561
+ });
1562
+ const working = combination?.working ?? null;
1563
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MembershipRow, { name: membership }), /* @__PURE__ */ jsxs("div", {
1564
+ className: summaryBarClassName(working),
1565
+ "data-step": wizard.step,
1566
+ children: [
1567
+ /* @__PURE__ */ jsxs("div", {
1568
+ className: "er-summary-bar-info",
1569
+ children: [
1570
+ /* @__PURE__ */ jsx("h4", {
1571
+ className: "er-summary-bar-event",
1572
+ children: summaryTitle
1573
+ }),
1574
+ /* @__PURE__ */ jsx(SummaryMeta, { facts: meta }),
1575
+ teamMemberNames.length > 0 && /* @__PURE__ */ jsxs("div", {
1576
+ className: "er-summary-bar-meta",
1577
+ children: ["With ", teamMemberNames.join(", ")]
1578
+ })
1579
+ ]
1580
+ }),
1581
+ combination && subtotalCents > 0 ? /* @__PURE__ */ jsx(CombinationPricing, {
1582
+ listCents: combination.list,
1583
+ totalCents: subtotalCents,
1584
+ currency: summaryCurrency
1585
+ }) : subtotalCents > 0 && /* @__PURE__ */ jsx("div", {
1586
+ className: "er-summary-bar-pricing",
1587
+ children: membership ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
1588
+ className: "er-summary-bar-price er-summary-bar-price--struck",
1589
+ children: formatPrice(subtotalCents, summaryCurrency)
1590
+ }), /* @__PURE__ */ jsx("div", {
1591
+ className: "er-summary-bar-included",
1592
+ children: "Included in membership"
1593
+ })] }) : flexibleBalanceSummary ? /* @__PURE__ */ jsx(FlexibleBalancePricing, {
1594
+ summary: flexibleBalanceSummary,
1595
+ fallbackDueToday: formatPrice(discountedTotalCents, summaryCurrency)
1596
+ }) : autoAppliedDiscount && autoAppliedDiscountCents > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
1597
+ /* @__PURE__ */ jsx("span", {
1598
+ className: "er-summary-bar-price er-summary-bar-price--struck",
1599
+ children: formatPrice(subtotalCents, summaryCurrency)
1600
+ }),
1601
+ /* @__PURE__ */ jsx("span", {
1602
+ className: "er-summary-bar-price",
1603
+ children: formatPrice(discountedTotalCents, summaryCurrency)
1604
+ }),
1605
+ autoAppliedDiscount.description ? /* @__PURE__ */ jsx("div", {
1606
+ className: "er-summary-bar-product-detail er-summary-bar-discount-detail",
1607
+ children: autoAppliedDiscount.description
1608
+ }) : null
1609
+ ] }) : /* @__PURE__ */ jsx("span", {
1610
+ className: "er-summary-bar-price",
1611
+ children: formatPrice(subtotalCents, summaryCurrency)
1612
+ })
1613
+ }),
1614
+ /* @__PURE__ */ jsx(CombinationDetail, { working })
1615
+ ]
1616
+ })] });
1617
+ }
1618
+ //#endregion
1619
+ //#region ../blocks/src/system/runtime/nodes/event-registration/EventRegistrationWizardActions.tsx
1620
+ /**
1621
+ * Label for the button that submits the details step.
1622
+ *
1623
+ * When a pass covers the booking there is no payment step to follow, so this
1624
+ * button is the last thing read before a credit is spent — it names the pass
1625
+ * rather than leaving that to the summary above it.
1626
+ */
1627
+ function resolveDetailsButtonText(input) {
1628
+ const { wizard } = input;
1629
+ const admission = wizard.admission;
1630
+ switch (admission.kind) {
1631
+ case "checking": return "Checking availability…";
1632
+ case "closed": return closedAdmissionLabel(admission.reason);
1633
+ case "fullyBooked": return fullyBookedLabel(admission);
1634
+ case "waitlist": return "Join waitlist";
1635
+ case "open":
1636
+ case "resume": break;
1637
+ }
1638
+ if (wizard.paymentSelection.method === "membership") return input.fallbackText;
1639
+ return wizard.eventRequiresPayment ? "Continue to payment" : input.fallbackText;
1640
+ }
1641
+ /** When the booking options failed to load, the visitor can ask for them again. */
1642
+ function ReloadOptionsButton(props) {
1643
+ const { admission } = props.wizard;
1644
+ if (admission.kind !== "closed" || admission.reason !== "optionsUnavailable") return null;
1645
+ return /* @__PURE__ */ jsx("button", {
1646
+ type: "button",
1647
+ onClick: props.wizard.reloadOptions,
1648
+ className: "er-back-btn",
1649
+ children: "Try again"
1650
+ });
1651
+ }
1652
+ /**
1653
+ * The date step's footer (issue 1581): Continue moves on once a date is
1654
+ * chosen. Unrelated events still move on when picked, so there's nothing here.
1655
+ */
1656
+ function SelectDateActions(props) {
1657
+ const { wizard } = props;
1658
+ const several = wizard.selectionMode.kind === "several";
1659
+ if (!several && getEventSelectionMode(wizard.scopedEvents) !== "date") return null;
1660
+ const chosen = wizard.selectedEvent;
1296
1661
  return /* @__PURE__ */ jsx("div", {
1297
- className: "rb-reg-stack er-stack",
1298
- children: /* @__PURE__ */ jsx("div", {
1299
- className: "er-center",
1300
- children: /* @__PURE__ */ jsx("p", {
1301
- className: "er-text er-error",
1302
- children: message
1303
- })
1662
+ className: "rb-wizard-actions er-actions",
1663
+ children: /* @__PURE__ */ jsx(ThemedButton, {
1664
+ type: "button",
1665
+ onClick: several ? wizard.handleSelectionContinue : () => {
1666
+ if (chosen) wizard.handleEventSelect(chosen);
1667
+ },
1668
+ disabled: several ? wizard.selection.length === 0 : !chosen,
1669
+ variant: props.buttonVariant,
1670
+ size: "md",
1671
+ label: "Continue"
1304
1672
  })
1305
1673
  });
1306
1674
  }
1307
- //#endregion
1308
- //#region ../blocks/src/system/runtime/nodes/event-registration/existingBookingsSummary.ts
1309
- function places(count) {
1310
- return count === 1 ? "1 place" : `${count} places`;
1311
- }
1312
- /** Waitlist entries have their own notice, so only confirmed bookings count here. */
1313
- function summariseExistingBookings(registrations) {
1314
- const confirmed = registrations.filter((registration) => registration.status === "confirmed");
1315
- const [only] = confirmed;
1316
- if (!only) return { kind: "none" };
1317
- if (confirmed.length === 1) return {
1318
- kind: "booked",
1319
- detail: only.ticketBreakdown ?? places(only.ticketsCount)
1320
- };
1321
- const placeCount = confirmed.reduce((total, registration) => total + registration.ticketsCount, 0);
1322
- return {
1323
- kind: "booked",
1324
- detail: `${confirmed.length} bookings · ${places(placeCount)}`
1325
- };
1326
- }
1327
- //#endregion
1328
- //#region ../blocks/src/system/runtime/nodes/event-registration/TicketSelectionStep.tsx
1329
- function pluralizeBookingUnit(kind, quantity) {
1330
- return `${kind}${quantity === 1 ? "" : "s"}`;
1331
- }
1332
- function getEventAttendanceModeLabel(mode) {
1333
- switch (mode) {
1334
- case "in_person": return "In person";
1335
- case "online": return "Online";
1336
- }
1337
- }
1338
- function TicketCounter(props) {
1339
- const { ticketsCount, maxAllowed, label, onTicketsChange } = props;
1340
- const minAllowed = props.minAllowed ?? 1;
1675
+ function SelectTicketsActions(props) {
1676
+ const { wizard } = props;
1677
+ const { label: continueLabel, pending: registrationOptionsPending } = wizard.ticketContinuation;
1678
+ const isContinueDisabled = wizard.ticketContinuation.kind === "blocked";
1341
1679
  return /* @__PURE__ */ jsxs("div", {
1342
- className: "rb-reg-row er-row er-counter",
1680
+ className: "rb-wizard-actions er-actions",
1343
1681
  children: [
1344
- /* @__PURE__ */ jsx("button", {
1682
+ !wizard.hasPreSelectedContext && /* @__PURE__ */ jsx("button", {
1345
1683
  type: "button",
1346
- "aria-label": `Decrease ${label}`,
1347
- onClick: () => onTicketsChange(stepNumber(ticketsCount, -1, { min: minAllowed })),
1348
- disabled: ticketsCount <= minAllowed,
1349
- className: "er-counter-btn",
1350
- children: "−"
1351
- }),
1352
- /* @__PURE__ */ jsx("span", {
1353
- className: "er-counter-value",
1354
- children: ticketsCount
1684
+ onClick: () => wizard.setStep("select-event"),
1685
+ className: "er-back-btn",
1686
+ children: "← Back"
1355
1687
  }),
1356
- /* @__PURE__ */ jsx("button", {
1688
+ registrationStopsHere(wizard.admission) ? null : /* @__PURE__ */ jsx(ThemedButton, {
1357
1689
  type: "button",
1358
- "aria-label": `Increase ${label}`,
1359
- onClick: () => onTicketsChange(stepNumber(ticketsCount, 1, { max: maxAllowed })),
1360
- disabled: ticketsCount >= maxAllowed,
1361
- className: "er-counter-btn",
1362
- children: "+"
1363
- })
1690
+ onClick: wizard.handleTicketsComplete,
1691
+ disabled: isContinueDisabled,
1692
+ variant: props.buttonVariant,
1693
+ size: "md",
1694
+ label: continueLabel,
1695
+ pending: registrationOptionsPending ? {
1696
+ label: continueLabel,
1697
+ spinnerSize: "xs",
1698
+ spinnerClassName: "er-button-spinner",
1699
+ contentClassName: "er-button-with-spinner"
1700
+ } : void 0
1701
+ }),
1702
+ /* @__PURE__ */ jsx(ReloadOptionsButton, { wizard })
1364
1703
  ]
1365
1704
  });
1366
1705
  }
1367
- function TicketCounterLimit(props) {
1368
- const showBookingLimit = !props.availabilityLabel || props.maxAllowed < (props.availableSpots ?? Infinity);
1369
- return /* @__PURE__ */ jsxs("p", {
1370
- className: "er-ticket-counter-limit",
1371
- children: [props.availabilityLabel ? /* @__PURE__ */ jsx("span", { children: props.availabilityLabel }) : null, showBookingLimit ? /* @__PURE__ */ jsxs(Fragment, { children: [props.availabilityLabel ? /* @__PURE__ */ jsx("br", {}) : null, /* @__PURE__ */ jsxs("span", { children: [
1372
- "Up to ",
1373
- props.maxAllowed,
1374
- " ",
1375
- props.quantityLabel,
1376
- " per booking."
1377
- ] })] }) : null]
1378
- });
1379
- }
1380
- function BookingUnitSessionHint(props) {
1381
- const count = props.bookingUnit.includedSessionCount;
1382
- return props.bookingUnit.kind === "place" && count && count > 1 ? /* @__PURE__ */ jsxs("p", {
1383
- className: "er-text er-text--muted",
1384
- children: [
1385
- "Every place includes all ",
1386
- count,
1387
- " sessions."
1388
- ]
1389
- }) : null;
1390
- }
1391
- function bookingQuantityLabel(unit, waitlist) {
1392
- if (!waitlist) return pluralizeBookingUnit(unit, 2);
1393
- return "waitlist places";
1394
- }
1395
- function BookingQuantityPrompt(props) {
1396
- return /* @__PURE__ */ jsxs("h3", {
1397
- tabIndex: -1,
1398
- className: "er-title",
1399
- children: [
1400
- "How many ",
1401
- bookingQuantityLabel(props.unit, props.waitlist),
1402
- "?"
1403
- ]
1706
+ function EnterDetailsActions(props) {
1707
+ const { wizard } = props;
1708
+ const isContinueDisabled = resolveRegistrationAvailabilityBlocker(wizard.admission) !== null;
1709
+ const continueLabel = resolveDetailsButtonText({
1710
+ wizard,
1711
+ fallbackText: props.buttonText
1404
1712
  });
1405
- }
1406
- function SlidingScaleAmountField(props) {
1407
- const id = props.id ?? "er-sliding-amount";
1408
- const minLabel = formatPrice(props.slidingScale.minAmount, props.currency);
1409
- const maxLabel = formatPrice(props.slidingScale.maxAmount, props.currency);
1410
- const suggestedLabel = props.slidingScale.suggestedAmount !== null ? formatPrice(props.slidingScale.suggestedAmount, props.currency) : null;
1411
1713
  return /* @__PURE__ */ jsxs("div", {
1412
- className: "er-field",
1714
+ className: "rb-wizard-actions er-actions",
1413
1715
  children: [
1414
- /* @__PURE__ */ jsx("label", {
1415
- htmlFor: id,
1416
- className: "form-label",
1417
- children: "Amount"
1418
- }),
1419
- /* @__PURE__ */ jsx("input", {
1420
- id,
1421
- type: "number",
1422
- min: formatCentsAsCurrencyInput(props.slidingScale.minAmount),
1423
- max: formatCentsAsCurrencyInput(props.slidingScale.maxAmount),
1424
- step: "0.01",
1425
- inputMode: "decimal",
1426
- className: "form-input",
1427
- value: props.value,
1428
- onChange: (event) => props.onChange?.(event.target.value)
1716
+ /* @__PURE__ */ jsx("button", {
1717
+ type: "button",
1718
+ onClick: () => wizard.setStep("select-tickets"),
1719
+ className: "er-back-btn",
1720
+ children: "← Back"
1429
1721
  }),
1430
- /* @__PURE__ */ jsxs("p", {
1431
- className: "er-text er-text--muted",
1432
- children: [
1433
- "Choose between ",
1434
- minLabel,
1435
- " and ",
1436
- maxLabel,
1437
- suggestedLabel ? `; suggested ${suggestedLabel}` : "",
1438
- "."
1439
- ]
1722
+ registrationStopsHere(wizard.admission) ? null : /* @__PURE__ */ jsx(ThemedButton, {
1723
+ type: "button",
1724
+ onClick: wizard.handleDetailsComplete,
1725
+ disabled: isContinueDisabled,
1726
+ variant: props.buttonVariant,
1727
+ size: "md",
1728
+ label: continueLabel
1440
1729
  }),
1441
- props.message ? /* @__PURE__ */ jsx("p", {
1442
- className: "er-text er-text--muted",
1443
- children: props.message
1444
- }) : null
1730
+ /* @__PURE__ */ jsx(ReloadOptionsButton, { wizard })
1445
1731
  ]
1446
1732
  });
1447
1733
  }
1448
- function TicketTypeQuantityRows(props) {
1449
- const totalSelectedQuantity = getTicketSelectionTotal(props.ticketSelections);
1450
- const effectiveMaxTickets = props.maxTickets;
1451
- return /* @__PURE__ */ jsxs("div", {
1452
- className: "er-ticket-lines",
1453
- children: [
1454
- /* @__PURE__ */ jsx("div", {
1455
- className: "er-ticket-line-list",
1456
- role: "list",
1457
- "aria-label": props.bookingUnit === "place" ? "Places" : "Tickets",
1458
- children: props.ticketTypes.map((ticketType) => {
1459
- const quantity = getTicketLineQuantity(props.ticketSelections, ticketType.pricingOptionId);
1460
- const disabled = !canRequestTicketOption(ticketType.availability, props.purpose);
1461
- const availabilityLabel = getTicketTypeAvailabilityLabel(ticketType);
1462
- const ticketTypeRemainingLabel = placesLeftLabel({
1463
- kind: "ticketType",
1464
- remaining: ticketType.availability.remainingPlaces,
1465
- dateRemaining: props.availableSpots ?? null
1466
- }, props.display);
1467
- const priceLabel = ticketType.priceAmount > 0 ? formatPrice(ticketType.priceAmount, props.currency) : "Free";
1468
- const maxAllowed = getTicketTypeLineMax({
1469
- currentQuantity: quantity,
1470
- totalSelectedQuantity,
1471
- maxTickets: props.maxTickets,
1472
- purpose: props.purpose,
1473
- pricingOptionId: ticketType.pricingOptionId,
1474
- availability: ticketType.availability,
1475
- heldPlacesBySelection: props.heldPlacesBySelection,
1476
- overallRemainingPlaces: props.availableSpots ?? null
1477
- });
1478
- return /* @__PURE__ */ jsxs("div", {
1479
- className: `er-ticket-line${disabled ? " er-ticket-line--disabled" : ""}`,
1480
- role: "listitem",
1481
- children: [/* @__PURE__ */ jsxs("div", {
1482
- className: "er-ticket-line-main",
1483
- children: [
1484
- /* @__PURE__ */ jsxs("div", {
1485
- className: "er-ticket-line-heading",
1486
- children: [/* @__PURE__ */ jsx("span", {
1487
- className: "er-ticket-line-name",
1488
- children: ticketType.name
1489
- }), /* @__PURE__ */ jsx("span", {
1490
- className: "er-ticket-line-price",
1491
- children: priceLabel
1492
- })]
1493
- }),
1494
- ticketType.description ? /* @__PURE__ */ jsx("p", {
1495
- className: "er-ticket-line-detail",
1496
- children: ticketType.description
1497
- }) : null,
1498
- availabilityLabel ? /* @__PURE__ */ jsx("p", {
1499
- className: "er-ticket-line-detail",
1500
- children: availabilityLabel
1501
- }) : ticketTypeRemainingLabel ? /* @__PURE__ */ jsx("p", {
1502
- className: "er-ticket-line-detail",
1503
- children: ticketTypeRemainingLabel
1504
- }) : null
1505
- ]
1506
- }), /* @__PURE__ */ jsx(TicketCounter, {
1507
- ticketsCount: quantity,
1508
- minAllowed: 0,
1509
- maxAllowed,
1510
- label: ticketType.name,
1511
- onTicketsChange: (nextQuantity) => {
1512
- props.onTicketSelectionsChange?.(setTicketLineQuantity({
1513
- lines: props.ticketSelections,
1514
- pricingOptionId: ticketType.pricingOptionId,
1515
- quantity: nextQuantity
1516
- }));
1517
- }
1518
- })]
1519
- }, ticketType.pricingOptionId);
1520
- })
1521
- }),
1522
- /* @__PURE__ */ jsx(TicketCounterLimit, {
1523
- maxAllowed: effectiveMaxTickets,
1524
- quantityLabel: pluralizeBookingUnit(props.bookingUnit, effectiveMaxTickets),
1525
- availableSpots: props.availableSpots,
1526
- availabilityLabel: props.availabilityLabel
1527
- }),
1528
- totalSelectedQuantity === 0 && props.hasAvailableTicketTypes ? /* @__PURE__ */ jsxs("p", {
1529
- className: "er-text er-text--muted",
1530
- children: [
1531
- "Choose at least one ",
1532
- props.bookingUnit,
1533
- " to continue."
1534
- ]
1535
- }) : totalSelectedQuantity === 0 ? /* @__PURE__ */ jsxs("p", {
1536
- className: "er-text er-text--muted",
1537
- children: [
1538
- "No ",
1539
- props.bookingUnit === "place" ? "places" : "ticket types",
1540
- " are currently available."
1541
- ]
1542
- }) : null
1543
- ]
1544
- });
1734
+ function SelectPaymentActions(props) {
1735
+ const { wizard } = props;
1736
+ const { status, canContinue, buttonText } = wizard.paymentStepState;
1737
+ return /* @__PURE__ */ jsxs(Fragment, { children: [status === "ready" && wizard.paymentHeldForCode ? /* @__PURE__ */ jsx("p", {
1738
+ className: "er-discount__hint",
1739
+ children: "Press Apply to use your discount code, or remove it to carry on without it."
1740
+ }) : null, /* @__PURE__ */ jsxs("div", {
1741
+ className: "rb-wizard-actions er-actions",
1742
+ children: [/* @__PURE__ */ jsx("button", {
1743
+ type: "button",
1744
+ onClick: () => wizard.setStep("enter-details"),
1745
+ className: "er-back-btn",
1746
+ children: "← Back"
1747
+ }), status === "ready" && /* @__PURE__ */ jsx(ThemedButton, {
1748
+ type: "button",
1749
+ onClick: () => void wizard.handlePaymentSelect(),
1750
+ disabled: !canContinue,
1751
+ variant: props.buttonVariant,
1752
+ size: "md",
1753
+ label: buttonText
1754
+ })]
1755
+ })] });
1545
1756
  }
1546
- function getAttendanceModeDetail(attendanceMode, display) {
1547
- return placesLeftLabel(attendanceMode, display, {
1548
- unlimited: "Unlimited places",
1549
- open: "Places available",
1550
- full: "Currently full",
1551
- waitlist: "Currently full, waitlist available"
1757
+ /** Stripe owns the Pay button, so the payment footer offers only the way back. */
1758
+ function PaymentActions(props) {
1759
+ return /* @__PURE__ */ jsx("div", {
1760
+ className: "rb-wizard-actions rb-wizard-actions--back-only er-actions",
1761
+ children: /* @__PURE__ */ jsx("button", {
1762
+ type: "button",
1763
+ onClick: props.wizard.paymentController.check,
1764
+ className: "er-back-btn",
1765
+ children: "← Back"
1766
+ })
1552
1767
  });
1553
1768
  }
1554
- /** One event's ways of attending, each with its places left. */
1555
- function eventAttendanceModeTiles(attendanceModes, display) {
1556
- return attendanceModes.map((attendanceMode) => ({
1557
- mode: attendanceMode.mode,
1558
- detail: getAttendanceModeDetail(attendanceMode, display)
1559
- }));
1769
+ function EventRegistrationWizardActions(props) {
1770
+ const { wizard } = props;
1771
+ switch (wizard.step) {
1772
+ case "error":
1773
+ case "success":
1774
+ case "submitting":
1775
+ case "verifying-payment":
1776
+ case "verifying-timeout":
1777
+ case "payment-status":
1778
+ case "payment-failed": return null;
1779
+ case "select-event": return /* @__PURE__ */ jsx(SelectDateActions, { ...props });
1780
+ case "select-tickets": return /* @__PURE__ */ jsx(SelectTicketsActions, { ...props });
1781
+ case "enter-details": return /* @__PURE__ */ jsx(EnterDetailsActions, { ...props });
1782
+ case "select-payment": return /* @__PURE__ */ jsx(SelectPaymentActions, { ...props });
1783
+ case "payment": return /* @__PURE__ */ jsx(PaymentActions, { ...props });
1784
+ default: return null;
1785
+ }
1560
1786
  }
1561
- /** The "How will you attend?" choice; several runs share it, so one choice covers them all. */
1562
- function AttendanceModeTiles(props) {
1787
+ //#endregion
1788
+ //#region ../blocks/src/system/runtime/nodes/event-registration/PaymentBlockingPanel.tsx
1789
+ function MissingEligibilityPanel() {
1563
1790
  return /* @__PURE__ */ jsx("div", {
1564
- className: "er-payment-tiles",
1565
- role: "list",
1566
- "aria-label": "Attendance mode",
1567
- children: props.tiles.map((tile) => {
1568
- const isSelected = props.selectedAttendanceMode === tile.mode;
1569
- return /* @__PURE__ */ jsx("div", {
1570
- role: "listitem",
1571
- children: /* @__PURE__ */ jsxs("button", {
1572
- type: "button",
1573
- "aria-pressed": isSelected,
1574
- className: `er-payment-tile${isSelected ? " er-payment-tile--selected" : ""}`,
1575
- onClick: () => props.onAttendanceModeChange?.(tile.mode),
1576
- children: [/* @__PURE__ */ jsx("div", {
1577
- className: "er-payment-tile-label",
1578
- children: getEventAttendanceModeLabel(tile.mode)
1579
- }), /* @__PURE__ */ jsx("div", {
1580
- className: "er-payment-tile-detail",
1581
- children: tile.detail
1582
- })]
1583
- })
1584
- }, tile.mode);
1791
+ className: "rb-reg-stack er-stack",
1792
+ children: /* @__PURE__ */ jsx("div", {
1793
+ className: "er-center",
1794
+ children: /* @__PURE__ */ jsx("p", {
1795
+ className: "er-text er-error",
1796
+ children: "We couldn’t load the booking options for this event. Please refresh this page and try again. If this keeps happening, contact the organiser for help."
1797
+ })
1585
1798
  })
1586
1799
  });
1587
1800
  }
1588
- function resolveTicketSelectionPricing(event) {
1589
- return {
1590
- mode: event ? publicEventPricingStrategy(event.pricing) : void 0,
1591
- currency: event ? publicEventPricingCurrency(event.pricing) : null
1592
- };
1801
+ function UnavailableEntitlementMessage(props) {
1802
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1803
+ /* @__PURE__ */ jsx("p", {
1804
+ className: "er-text er-error",
1805
+ children: "This event requires a valid pass or membership to register."
1806
+ }),
1807
+ props.eligibility.eventAcceptsPasses && !props.eligibility.eventAcceptsMemberships && /* @__PURE__ */ jsx("p", {
1808
+ className: "er-text er-text--muted",
1809
+ children: "You need a pass with credits for this event category."
1810
+ }),
1811
+ props.eligibility.eventAcceptsMemberships && !props.eligibility.eventAcceptsPasses && /* @__PURE__ */ jsx("p", {
1812
+ className: "er-text er-text--muted",
1813
+ children: "You need an active membership for this event category."
1814
+ })
1815
+ ] });
1593
1816
  }
1594
- /** Someone with an invitation is claiming a place, not joining the list. */
1595
- function waitlistIsOpenTo(source, invitation) {
1596
- return source && !invitation ? canJoinEventWaitlist(source) : false;
1817
+ /** Places remain, just fewer than this booking asks for (issue 1581). */
1818
+ function FewerPlacesPaymentPanel(props) {
1819
+ return /* @__PURE__ */ jsxs("div", {
1820
+ className: "rb-reg-stack er-stack",
1821
+ children: [/* @__PURE__ */ jsx("h3", {
1822
+ className: "er-title",
1823
+ children: props.heading
1824
+ }), /* @__PURE__ */ jsx("div", {
1825
+ className: "er-center",
1826
+ children: /* @__PURE__ */ jsx("p", {
1827
+ className: "er-text er-text--muted",
1828
+ children: props.message
1829
+ })
1830
+ })]
1831
+ });
1597
1832
  }
1598
- function getTicketSelectionCapacity(event, attendanceMode, display, invitation = null) {
1599
- const source = event ? selectEventCapacitySource(event, attendanceMode) : null;
1600
- const availability = source ? getEventAvailability(source) : null;
1601
- const canJoinWaitlist = waitlistIsOpenTo(source, invitation);
1602
- return {
1603
- availableSpots: availability?.available,
1604
- isSoldOut: availability?.isFull ?? false,
1605
- canJoinWaitlist,
1606
- eventAvailabilityLabel: !canJoinWaitlist && source ? placesLeftLabel(source, display) : null
1607
- };
1833
+ function SoldOutPaymentPanel() {
1834
+ return /* @__PURE__ */ jsxs("div", {
1835
+ className: "rb-reg-stack er-stack",
1836
+ children: [/* @__PURE__ */ jsx("h3", {
1837
+ className: "er-title",
1838
+ children: "Sold out"
1839
+ }), /* @__PURE__ */ jsx("div", {
1840
+ className: "er-center",
1841
+ children: /* @__PURE__ */ jsx("p", {
1842
+ className: "er-text er-text--muted",
1843
+ children: "This event is fully booked and there is no waitlist available for this booking."
1844
+ })
1845
+ })]
1846
+ });
1608
1847
  }
1609
- /**
1610
- * One price: the visitor is choosing places, not ticket types (issue 1581).
1611
- * The ceiling comes from settled availability (`placeCountCeiling`); the
1612
- * page's cached count is only shown, never enforced.
1613
- */
1614
- function PlaceCounter(props) {
1615
- const spots = props.waitlist ? null : props.availableSpots;
1616
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(BookingQuantityPrompt, {
1617
- unit: "place",
1618
- waitlist: props.waitlist
1619
- }), /* @__PURE__ */ jsxs("div", {
1620
- className: "er-ticket-counter-group",
1621
- children: [/* @__PURE__ */ jsx(TicketCounter, {
1622
- ticketsCount: props.ticketsCount,
1623
- maxAllowed: props.ceiling,
1624
- label: bookingQuantityLabel("place", props.waitlist),
1625
- onTicketsChange: props.onTicketsChange
1626
- }), /* @__PURE__ */ jsx(TicketCounterLimit, {
1627
- maxAllowed: props.ceiling,
1628
- quantityLabel: props.waitlist ? bookingQuantityLabel("place", true) : pluralizeBookingUnit("place", props.ceiling),
1629
- availableSpots: spots,
1630
- availabilityLabel: props.availabilityLabel
1848
+ function IneligiblePaymentPanel(props) {
1849
+ const promptLogin = shouldPromptForLogin("not-eligible", props.isAuthenticated, props.eligibility);
1850
+ return /* @__PURE__ */ jsxs("div", {
1851
+ className: "rb-reg-stack er-stack",
1852
+ children: [/* @__PURE__ */ jsx("h3", {
1853
+ className: "er-title",
1854
+ children: promptLogin ? "Log in required" : "Payment required"
1855
+ }), /* @__PURE__ */ jsx("div", {
1856
+ className: "er-center",
1857
+ children: promptLogin ? /* @__PURE__ */ jsxs(Fragment, { children: [
1858
+ /* @__PURE__ */ jsx("p", {
1859
+ className: "er-text er-text--muted",
1860
+ children: "Have a pass or membership? Log in to use it."
1861
+ }),
1862
+ /* @__PURE__ */ jsx(ThemedButton, {
1863
+ type: "button",
1864
+ variant: "primary",
1865
+ size: "md",
1866
+ label: "Email me a login link",
1867
+ disabled: !props.email.trim(),
1868
+ onClick: props.onRequestLogin
1869
+ }),
1870
+ !props.email.trim() && /* @__PURE__ */ jsx("p", {
1871
+ className: "er-text er-text--muted",
1872
+ children: "Enter your email to request a login link."
1873
+ })
1874
+ ] }) : /* @__PURE__ */ jsx(UnavailableEntitlementMessage, { eligibility: props.eligibility })
1631
1875
  })]
1632
- })] });
1876
+ });
1633
1877
  }
1634
- function SelectionNote({ text }) {
1635
- return text ? /* @__PURE__ */ jsx("p", {
1636
- className: "er-text er-text--muted",
1637
- children: text
1638
- }) : null;
1878
+ function renderRegistrationAvailabilityBlocker(admission) {
1879
+ const blocker = resolveRegistrationAvailabilityBlocker(admission);
1880
+ if (blocker?.kind !== "unavailable") return null;
1881
+ switch (blocker.reason) {
1882
+ case "alreadyWaitlisted": return /* @__PURE__ */ jsx(AlreadyWaitlistedPaymentPanel, {});
1883
+ case "soldOut": return /* @__PURE__ */ jsx(SoldOutPaymentPanel, {});
1884
+ case "fewerPlacesLeft": return /* @__PURE__ */ jsx(FewerPlacesPaymentPanel, {
1885
+ heading: blocker.heading,
1886
+ message: blocker.message
1887
+ });
1888
+ case "closed": return /* @__PURE__ */ jsx(ClosedPaymentPanel, { message: blocker.message });
1889
+ }
1639
1890
  }
1640
- /**
1641
- * Ticket Selection Step
1642
- *
1643
- * Allows users to select how many tickets they want for the selected event.
1644
- * Respects both max tickets per registration and available spots.
1645
- *
1646
- * Can use either a full PublicEvent or just occurrence context (when on event page).
1647
- */
1648
- const TicketSelectionStep = ({ purpose, event, display, occurrenceContext: _occurrenceContext, selectedAttendanceMode = null, onAttendanceModeChange, ticketsCount, maxTickets, placesCeiling, visibleTicketTypes: visibleTicketTypesOverride, overallRemainingPlaces, heldPlacesBySelection, ticketSelections = [], onTicketSelectionsChange, slidingScale = null, selectedSlidingAmountInput = "", slidingScaleSelectionMessage = null, onSlidingAmountChange, onTicketsChange, bookingUnit = { kind: "ticket" }, selectionNote, invitation = null }) => {
1649
- const unit = bookingUnit.kind;
1650
- const deliveryMode = event?.deliveryMode ?? "in_person";
1651
- const attendanceModes = event?.attendanceModes ?? [];
1652
- const { availableSpots, isSoldOut, canJoinWaitlist, eventAvailabilityLabel } = getTicketSelectionCapacity(event, selectedAttendanceMode, display, invitation);
1653
- const { mode: eventPricingMode, currency: eventPricingCurrency } = resolveTicketSelectionPricing(event);
1654
- const usesTicketTypes = eventPricingMode === "tiered";
1655
- const visibleTicketTypes = usesTicketTypes ? visibleTicketTypesOverride ?? getVisibleTicketTypes({
1656
- event,
1657
- eligibility: null,
1658
- selectedAttendanceMode,
1659
- ticketSelections
1660
- }) : [];
1661
- const noVisibleTicketTypes = usesTicketTypes && visibleTicketTypes.length === 0;
1662
- const hasAvailableTicketTypes = usesTicketTypes && visibleTicketTypes.some((ticketType) => canRequestTicketOption(ticketType.availability, purpose));
1663
- const maxAllowed = maxTickets;
1664
- if (deliveryMode === "hybrid" && !selectedAttendanceMode) return /* @__PURE__ */ jsxs("div", {
1891
+ function PaymentBlockingPanel(props) {
1892
+ if (props.eligibilityLoading) return /* @__PURE__ */ jsx("div", {
1665
1893
  className: "rb-reg-stack er-stack",
1666
- children: [
1667
- /* @__PURE__ */ jsx("h3", {
1668
- tabIndex: -1,
1669
- className: "er-title",
1670
- children: "How will you attend?"
1671
- }),
1672
- /* @__PURE__ */ jsx(AttendanceModeTiles, {
1673
- tiles: eventAttendanceModeTiles(attendanceModes, display),
1674
- selectedAttendanceMode: null,
1675
- onAttendanceModeChange
1676
- }),
1677
- /* @__PURE__ */ jsx("p", {
1678
- className: "er-text er-text--muted",
1679
- children: "Choose whether you want to attend in person or online."
1894
+ children: /* @__PURE__ */ jsxs("div", {
1895
+ className: "er-center",
1896
+ children: [/* @__PURE__ */ jsx(SpinnerNode, {
1897
+ size: "lg",
1898
+ srLabel: "Checking payment options"
1899
+ }), /* @__PURE__ */ jsx("p", {
1900
+ className: "er-text--muted",
1901
+ children: "Checking payment options…"
1902
+ })]
1903
+ })
1904
+ });
1905
+ if (props.eligibilityError) return /* @__PURE__ */ jsx("div", {
1906
+ className: "rb-reg-stack er-stack",
1907
+ children: /* @__PURE__ */ jsx("div", {
1908
+ className: "er-center",
1909
+ children: /* @__PURE__ */ jsx("p", {
1910
+ className: "er-text er-error",
1911
+ children: props.eligibilityError
1680
1912
  })
1681
- ]
1913
+ })
1914
+ });
1915
+ if (!props.eligibility) return /* @__PURE__ */ jsx(MissingEligibilityPanel, {});
1916
+ const availabilityPanel = renderRegistrationAvailabilityBlocker(props.admission);
1917
+ if (availabilityPanel) return availabilityPanel;
1918
+ if (props.paysNothing) return /* @__PURE__ */ jsx(FreePaymentSummary, { ticketsCount: props.ticketsCount });
1919
+ return props.eligibility.paymentOptions.length > 0 ? null : /* @__PURE__ */ jsx(IneligiblePaymentPanel, {
1920
+ eligibility: props.eligibility,
1921
+ email: props.email,
1922
+ isAuthenticated: props.isAuthenticated,
1923
+ onRequestLogin: props.onRequestLogin
1682
1924
  });
1683
- if (!eventPricingCurrency) return /* @__PURE__ */ jsx("div", {
1925
+ }
1926
+ function AlreadyWaitlistedPaymentPanel() {
1927
+ return /* @__PURE__ */ jsxs("div", {
1684
1928
  className: "rb-reg-stack er-stack",
1685
- children: /* @__PURE__ */ jsx("p", {
1686
- className: "er-text er-text--muted",
1687
- children: "Pricing is unavailable for this event right now."
1688
- })
1929
+ children: [/* @__PURE__ */ jsx("h3", {
1930
+ className: "er-title",
1931
+ children: "Already on the waitlist"
1932
+ }), /* @__PURE__ */ jsxs("div", {
1933
+ className: "er-center",
1934
+ children: [/* @__PURE__ */ jsx("p", {
1935
+ className: "er-text er-text--muted",
1936
+ children: "You're already on the waitlist for this event."
1937
+ }), /* @__PURE__ */ jsx("a", {
1938
+ href: "/portal",
1939
+ className: "er-retry-btn",
1940
+ children: "View my bookings"
1941
+ })]
1942
+ })]
1689
1943
  });
1944
+ }
1945
+ function FreePaymentSummary({ ticketsCount }) {
1690
1946
  return /* @__PURE__ */ jsxs("div", {
1691
1947
  className: "rb-reg-stack er-stack",
1692
- children: [
1693
- deliveryMode === "hybrid" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("h3", {
1694
- tabIndex: -1,
1695
- className: "er-title",
1696
- children: "How will you attend?"
1697
- }), /* @__PURE__ */ jsx(AttendanceModeTiles, {
1698
- tiles: eventAttendanceModeTiles(attendanceModes, display),
1699
- selectedAttendanceMode,
1700
- onAttendanceModeChange
1701
- })] }) : null,
1702
- usesTicketTypes ? /* @__PURE__ */ jsx(Fragment, { children: noVisibleTicketTypes ? /* @__PURE__ */ jsx("p", {
1948
+ children: [/* @__PURE__ */ jsx("h3", {
1949
+ className: "er-title",
1950
+ children: "Payment"
1951
+ }), /* @__PURE__ */ jsxs("div", {
1952
+ className: "er-payment-summary",
1953
+ children: [/* @__PURE__ */ jsx("p", {
1954
+ className: "er-text",
1955
+ children: "This event is free!"
1956
+ }), /* @__PURE__ */ jsxs("p", {
1703
1957
  className: "er-text er-text--muted",
1704
- children: "No ticket types are currently available."
1705
- }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1706
- /* @__PURE__ */ jsxs("h3", {
1707
- tabIndex: -1,
1708
- className: "er-title",
1709
- children: ["Choose ", unit === "place" ? "your places" : "tickets"]
1710
- }),
1711
- /* @__PURE__ */ jsx(BookingUnitSessionHint, { bookingUnit }),
1712
- /* @__PURE__ */ jsx(TicketTypeQuantityRows, {
1713
- purpose,
1714
- display,
1715
- ticketTypes: visibleTicketTypes,
1716
- ticketSelections,
1717
- maxTickets,
1718
- heldPlacesBySelection,
1719
- availableSpots: resolveRemainingPlacesOverride(overallRemainingPlaces, availableSpots),
1720
- availabilityLabel: eventAvailabilityLabel,
1721
- currency: eventPricingCurrency,
1722
- hasAvailableTicketTypes,
1723
- onTicketSelectionsChange,
1724
- bookingUnit: unit
1725
- })
1726
- ] }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1727
- slidingScale ? /* @__PURE__ */ jsx(SlidingScaleAmountField, {
1728
- slidingScale,
1729
- currency: eventPricingCurrency,
1730
- value: selectedSlidingAmountInput,
1731
- message: slidingScaleSelectionMessage,
1732
- onChange: onSlidingAmountChange
1733
- }) : null,
1734
- /* @__PURE__ */ jsx(BookingUnitSessionHint, { bookingUnit }),
1735
- /* @__PURE__ */ jsx(PlaceCounter, {
1958
+ children: [
1736
1959
  ticketsCount,
1737
- ceiling: placesCeiling ?? maxAllowed,
1738
- availableSpots,
1739
- availabilityLabel: eventAvailabilityLabel,
1740
- waitlist: canJoinWaitlist,
1741
- onTicketsChange
1742
- })
1743
- ] }),
1744
- /* @__PURE__ */ jsx(SelectionNote, { text: selectionNote }),
1745
- /* @__PURE__ */ jsx(PlacesNote, {
1746
- invitation,
1747
- isSoldOut,
1748
- canJoinWaitlist,
1749
- ticketsCount,
1750
- event
1751
- })
1752
- ]
1753
- });
1754
- };
1755
- function PlacesNote({ invitation, isSoldOut, canJoinWaitlist, ticketsCount, event }) {
1756
- if (invitation?.kind === "held") return /* @__PURE__ */ jsx("p", {
1757
- className: "er-text",
1758
- children: heldPlaceText(ticketsCount, invitation.expiresAt, event)
1960
+ " ticket",
1961
+ ticketsCount > 1 ? "s" : ""
1962
+ ]
1963
+ })]
1964
+ })]
1759
1965
  });
1760
- if (invitation) return null;
1761
- if (canJoinWaitlist) return /* @__PURE__ */ jsx("p", {
1762
- className: "er-text er-text--muted",
1763
- children: "This event is currently full. Continue to join the waitlist if a place opens up."
1966
+ }
1967
+ function ClosedPaymentPanel({ message }) {
1968
+ return /* @__PURE__ */ jsx("div", {
1969
+ className: "rb-reg-stack er-stack",
1970
+ children: /* @__PURE__ */ jsx("div", {
1971
+ className: "er-center",
1972
+ children: /* @__PURE__ */ jsx("p", {
1973
+ className: "er-text er-error",
1974
+ children: message
1975
+ })
1976
+ })
1764
1977
  });
1765
- return isSoldOut ? /* @__PURE__ */ jsx("p", {
1766
- className: "er-text er-text--muted",
1767
- children: "This event is fully booked."
1768
- }) : null;
1769
1978
  }
1770
- /** How long the invitation holds their place, in the event's own time zone. */
1771
- function heldPlaceText(places, expiresAt, event) {
1772
- const held = places === 1 ? "We’re holding a place for you" : `We’re holding ${places} places for you`;
1773
- return event ? `${held} until ${formatTime(expiresAt, event)} on ${formatDate(expiresAt, event)}. Continue to book before then.` : `${held}. Continue to book.`;
1979
+ //#endregion
1980
+ //#region ../blocks/src/system/runtime/nodes/event-registration/existingBookingsSummary.ts
1981
+ function places(count) {
1982
+ return count === 1 ? "1 place" : `${count} places`;
1774
1983
  }
1775
- function resolveRemainingPlacesOverride(override, cached) {
1776
- return override === void 0 ? cached : override;
1984
+ /** Waitlist entries have their own notice, so only confirmed bookings count here. */
1985
+ function summariseExistingBookings(registrations) {
1986
+ const confirmed = registrations.filter((registration) => registration.status === "confirmed");
1987
+ const [only] = confirmed;
1988
+ if (!only) return { kind: "none" };
1989
+ if (confirmed.length === 1) return {
1990
+ kind: "booked",
1991
+ detail: only.ticketBreakdown ?? places(only.ticketsCount)
1992
+ };
1993
+ const placeCount = confirmed.reduce((total, registration) => total + registration.ticketsCount, 0);
1994
+ return {
1995
+ kind: "booked",
1996
+ detail: `${confirmed.length} bookings · ${places(placeCount)}`
1997
+ };
1777
1998
  }
1778
1999
  //#endregion
1779
2000
  //#region ../blocks/src/system/runtime/nodes/event-registration/SeveralRunsTicketStep.tsx
@@ -1969,13 +2190,6 @@ function Totals(props) {
1969
2190
  })]
1970
2191
  });
1971
2192
  }
1972
- /**
1973
- * What several items cost, above the payment choice (issue 1725): the items
1974
- * and places as a caption, each item at what all its places cost, then the
1975
- * total (after a subtotal and any code when something comes off). With
1976
- * combination prices the items are grouped by combination, with the note
1977
- * and saving under the list.
1978
- */
1979
2193
  function SelectionPaymentSummary(props) {
1980
2194
  const { summary, currency } = props;
1981
2195
  const money = (cents) => formatCurrencyAmount(cents, currency);
@@ -1987,46 +2201,332 @@ function SelectionPaymentSummary(props) {
1987
2201
  return /* @__PURE__ */ jsxs("div", {
1988
2202
  className: "rb-reg-stack er-stack er-selection-payment-summary",
1989
2203
  children: [
1990
- /* @__PURE__ */ jsx("h3", {
1991
- tabIndex: -1,
2204
+ /* @__PURE__ */ jsx(SummaryHeading, { changeDates: props.changeDates }),
2205
+ /* @__PURE__ */ jsxs("div", {
2206
+ className: "er-confirmation-summary er-selection-payment",
2207
+ children: [
2208
+ /* @__PURE__ */ jsx("p", {
2209
+ className: "er-selection-payment__caption",
2210
+ children: summary.caption
2211
+ }),
2212
+ groups.map((group) => /* @__PURE__ */ jsxs(React.Fragment, { children: [group.heading ? /* @__PURE__ */ jsx("p", {
2213
+ className: "er-selection-payment__group",
2214
+ children: group.heading
2215
+ }) : null, /* @__PURE__ */ jsx(Lines, {
2216
+ lines: group.lines,
2217
+ money
2218
+ })] }, group.key)),
2219
+ /* @__PURE__ */ jsx(Totals, {
2220
+ subtotalCents: summary.subtotalCents,
2221
+ reductions: summary.reductions,
2222
+ totalCents: summary.totalCents,
2223
+ money
2224
+ })
2225
+ ]
2226
+ }),
2227
+ summary.kind === "combined" && summary.note ? /* @__PURE__ */ jsx("p", {
2228
+ className: "er-combination-note",
2229
+ role: "status",
2230
+ children: summary.note
2231
+ }) : null,
2232
+ summary.kind === "combined" && summary.savingCents !== null ? /* @__PURE__ */ jsxs("p", {
2233
+ className: "er-combination-saving",
2234
+ children: ["You save ", money(summary.savingCents)]
2235
+ }) : null
2236
+ ]
2237
+ });
2238
+ }
2239
+ /** "Your booking", with "Change dates" beside it when the dates can be changed from here. */
2240
+ function SummaryHeading(props) {
2241
+ return /* @__PURE__ */ jsx(StepHeading, {
2242
+ title: "Your booking",
2243
+ changeDates: props.changeDates
2244
+ });
2245
+ }
2246
+ /** A payment step heading, with "Change date(s)" beside it when the dates can be changed from here. */
2247
+ function StepHeading(props) {
2248
+ const heading = /* @__PURE__ */ jsx("h3", {
2249
+ tabIndex: -1,
2250
+ className: "er-title",
2251
+ children: props.title
2252
+ });
2253
+ if (!props.changeDates) return heading;
2254
+ return /* @__PURE__ */ jsxs("div", {
2255
+ className: "er-confirmation-summary__row",
2256
+ children: [heading, /* @__PURE__ */ jsx("button", {
2257
+ type: "button",
2258
+ className: "er-portal-auth-link",
2259
+ onClick: props.changeDates.onChange,
2260
+ children: props.changeDates.label
2261
+ })]
2262
+ });
2263
+ }
2264
+ /**
2265
+ * Dates paid with a pass or membership (issue 1767, sets 6 and 7): each date with
2266
+ * "1 credit", "Included" or its price, a bought pass on its own line, then
2267
+ * what comes from the pass and what's left to pay.
2268
+ */
2269
+ function FundedPaymentSummary(props) {
2270
+ const { summary } = props;
2271
+ return /* @__PURE__ */ jsxs("div", {
2272
+ className: "rb-reg-stack er-stack er-selection-payment-summary",
2273
+ children: [/* @__PURE__ */ jsx(SummaryHeading, { changeDates: props.changeDates }), /* @__PURE__ */ jsxs("div", {
2274
+ className: "er-confirmation-summary er-selection-payment",
2275
+ children: [
2276
+ /* @__PURE__ */ jsx("p", {
2277
+ className: "er-selection-payment__caption",
2278
+ children: summary.caption
2279
+ }),
2280
+ /* @__PURE__ */ jsx("dl", {
2281
+ className: "er-selection-payment__lines",
2282
+ children: summary.lines.map((line) => /* @__PURE__ */ jsxs("div", {
2283
+ className: "er-confirmation-summary__row",
2284
+ children: [/* @__PURE__ */ jsxs("dt", { children: [line.label, line.note ? /* @__PURE__ */ jsx("span", {
2285
+ className: "er-selection-payment__multiplier",
2286
+ children: line.note
2287
+ }) : null] }), /* @__PURE__ */ jsx("dd", { children: line.value })]
2288
+ }, line.key))
2289
+ }),
2290
+ summary.totals.length > 0 ? /* @__PURE__ */ jsx("dl", {
2291
+ className: "er-selection-payment__lines er-selection-payment__totals",
2292
+ children: summary.totals.map((row) => /* @__PURE__ */ jsxs("div", {
2293
+ className: row.total ? "er-confirmation-summary__row er-selection-payment__total" : "er-confirmation-summary__row",
2294
+ children: [/* @__PURE__ */ jsx("dt", { children: row.label }), /* @__PURE__ */ jsx("dd", { children: row.value })]
2295
+ }, row.key))
2296
+ }) : null
2297
+ ]
2298
+ })]
2299
+ });
2300
+ }
2301
+ //#endregion
2302
+ //#region ../blocks/src/system/runtime/nodes/event-registration/SiteCreditPreviewPanel.tsx
2303
+ function SiteCreditPreviewPanel(props) {
2304
+ const { preview } = props;
2305
+ if (preview.kind === "not_authenticated" || preview.kind === "not_applicable" || preview.kind === "no_credit") return null;
2306
+ if (preview.kind === "loading") return /* @__PURE__ */ jsx("div", {
2307
+ className: "er-payment-summary",
2308
+ "aria-live": "polite",
2309
+ children: /* @__PURE__ */ jsx("p", {
2310
+ className: "er-text er-text--muted",
2311
+ children: "Checking your site credit…"
2312
+ })
2313
+ });
2314
+ if (preview.kind === "unavailable") return /* @__PURE__ */ jsx("div", {
2315
+ className: "er-payment-summary",
2316
+ role: "status",
2317
+ children: /* @__PURE__ */ jsx("p", {
2318
+ className: "er-text er-text--muted",
2319
+ children: "We couldn't check your site credit just now. We'll check again before payment."
2320
+ })
2321
+ });
2322
+ if (preview.kind === "currency_mismatch") return /* @__PURE__ */ jsxs("div", {
2323
+ className: "er-payment-summary",
2324
+ role: "status",
2325
+ children: [/* @__PURE__ */ jsx("h4", {
2326
+ className: "er-title",
2327
+ children: "Your site credit"
2328
+ }), /* @__PURE__ */ jsxs("p", {
2329
+ className: "er-text er-text--muted",
2330
+ children: [
2331
+ "You have",
2332
+ " ",
2333
+ formatPrice(preview.availableCreditCents, preview.creditCurrency),
2334
+ " ",
2335
+ "in site credit, but it can't be used for this",
2336
+ " ",
2337
+ props.currency.toUpperCase(),
2338
+ " booking."
2339
+ ]
2340
+ })]
2341
+ });
2342
+ return /* @__PURE__ */ jsxs("div", {
2343
+ className: "er-payment-summary",
2344
+ "aria-live": "polite",
2345
+ children: [
2346
+ /* @__PURE__ */ jsx("h4", {
1992
2347
  className: "er-title",
1993
- children: "Your booking"
2348
+ children: "Your site credit"
2349
+ }),
2350
+ /* @__PURE__ */ jsxs("p", {
2351
+ className: "er-text",
2352
+ children: ["Available: ", formatPrice(preview.availableCreditCents, props.currency)]
1994
2353
  }),
1995
- /* @__PURE__ */ jsxs("div", {
1996
- className: "er-confirmation-summary er-selection-payment",
2354
+ /* @__PURE__ */ jsx("p", {
2355
+ className: "er-text",
2356
+ children: preview.outcome === "credit_only" ? `Your credit covers this registration. ${formatPrice(preview.appliedCreditCents, props.currency)} will be used and no card payment is needed.` : preview.cardDueNowCents === 0 ? `${formatPrice(preview.appliedCreditCents, props.currency)} will be applied automatically. No card payment is needed today.` : `${formatPrice(preview.appliedCreditCents, props.currency)} will be applied automatically. ${formatPrice(preview.cardDueNowCents, props.currency)} is due by card today.`
2357
+ }),
2358
+ preview.laterBalanceCents > 0 && /* @__PURE__ */ jsxs("p", {
2359
+ className: "er-text er-text--muted",
1997
2360
  children: [
1998
- /* @__PURE__ */ jsx("p", {
1999
- className: "er-selection-payment__caption",
2000
- children: summary.caption
2001
- }),
2002
- groups.map((group) => /* @__PURE__ */ jsxs(React.Fragment, { children: [group.heading ? /* @__PURE__ */ jsx("p", {
2003
- className: "er-selection-payment__group",
2004
- children: group.heading
2005
- }) : null, /* @__PURE__ */ jsx(Lines, {
2006
- lines: group.lines,
2007
- money
2008
- })] }, group.key)),
2009
- /* @__PURE__ */ jsx(Totals, {
2010
- subtotalCents: summary.subtotalCents,
2011
- reductions: summary.reductions,
2012
- totalCents: summary.totalCents,
2013
- money
2014
- })
2361
+ "Remaining balance after today:",
2362
+ " ",
2363
+ formatPrice(preview.laterBalanceCents, props.currency)
2015
2364
  ]
2016
2365
  }),
2017
- summary.kind === "combined" && summary.note ? /* @__PURE__ */ jsx("p", {
2018
- className: "er-combination-note",
2019
- role: "status",
2020
- children: summary.note
2021
- }) : null,
2022
- summary.kind === "combined" && summary.savingCents !== null ? /* @__PURE__ */ jsxs("p", {
2023
- className: "er-combination-saving",
2024
- children: ["You save ", money(summary.savingCents)]
2025
- }) : null
2366
+ preview.remainingCreditCents > 0 && /* @__PURE__ */ jsxs("p", {
2367
+ className: "er-text er-text--muted",
2368
+ children: [
2369
+ "Credit left afterwards:",
2370
+ " ",
2371
+ formatPrice(preview.remainingCreditCents, props.currency)
2372
+ ]
2373
+ }),
2374
+ preview.manualDiscountPending && /* @__PURE__ */ jsx("p", {
2375
+ className: "er-text er-text--muted",
2376
+ children: "We'll recalculate these amounts after your discount code is checked."
2377
+ })
2026
2378
  ]
2027
2379
  });
2028
2380
  }
2029
2381
  //#endregion
2382
+ //#region ../blocks/src/system/runtime/nodes/event-registration/SelectionFundingStep.tsx
2383
+ const PAY_HEADING = "How would you like to pay?";
2384
+ /**
2385
+ * The payment step for dates, one or several (issue 1767, sets 6 and 7): the
2386
+ * server's ways to pay in its order, then "Your booking", which breaks the choice
2387
+ * down. The breakdown follows the choice because it's the choice's result. One
2388
+ * date drops it when the chosen option and the button already say it all.
2389
+ */
2390
+ function SelectionFundingStep(props) {
2391
+ const { model } = props;
2392
+ const oneDate = model.dateCount === 1;
2393
+ if (model.status === "failed") return /* @__PURE__ */ jsx(FundingLoadFailed, {
2394
+ oneDate,
2395
+ retry: model.retry
2396
+ });
2397
+ const view = model.view;
2398
+ if (model.status === "loading" || !view) return /* @__PURE__ */ jsx(FundingLoading, {});
2399
+ const changeDates = props.onChangeDates ? {
2400
+ label: oneDate ? "Change date" : "Change dates",
2401
+ onChange: props.onChangeDates
2402
+ } : void 0;
2403
+ return /* @__PURE__ */ jsx(LoadedFundingStep, {
2404
+ ...props,
2405
+ view,
2406
+ oneDate,
2407
+ changeDates
2408
+ });
2409
+ }
2410
+ function LoadedFundingStep(props) {
2411
+ const { model, view, changeDates } = props;
2412
+ const layout = fundingStepLayout(view, props.oneDate, props.cardSummary !== null);
2413
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
2414
+ model.notice ? /* @__PURE__ */ jsx("p", {
2415
+ role: "alert",
2416
+ className: "er-error er-funding-notice",
2417
+ children: model.notice
2418
+ }) : null,
2419
+ props.signInPrompt,
2420
+ layout.options ? /* @__PURE__ */ jsxs("div", {
2421
+ className: "rb-reg-stack er-stack er-funding-options",
2422
+ children: [/* @__PURE__ */ jsx(StepHeading, {
2423
+ title: PAY_HEADING,
2424
+ changeDates: layout.changeDatesOn === "options" ? changeDates : void 0
2425
+ }), /* @__PURE__ */ jsx(PaymentChoiceRows, {
2426
+ label: PAY_HEADING,
2427
+ rows: view.rows.map((row) => ({
2428
+ id: row.key,
2429
+ label: row.label,
2430
+ details: row.details,
2431
+ price: row.price,
2432
+ selected: row.selected,
2433
+ onSelect: () => model.choose(row)
2434
+ }))
2435
+ })]
2436
+ }) : null,
2437
+ view.option.kind === "money" ? /* @__PURE__ */ jsx(SiteCreditPreviewPanel, {
2438
+ preview: props.creditPreview,
2439
+ currency: props.currency
2440
+ }) : null,
2441
+ view.note ? /* @__PURE__ */ jsx("p", {
2442
+ className: "er-entitlement-note",
2443
+ children: view.note
2444
+ }) : null,
2445
+ props.afterOptions,
2446
+ layout.breakdown ? /* @__PURE__ */ jsx("div", {
2447
+ className: "er-funding-breakdown",
2448
+ children: /* @__PURE__ */ jsx(FundingSummary, {
2449
+ summary: view.summary,
2450
+ cardSummary: props.cardSummary,
2451
+ currency: props.currency,
2452
+ changeDates: layout.changeDatesOn === "breakdown" ? changeDates : void 0
2453
+ })
2454
+ }) : null,
2455
+ layout.changeDatesOn === "alone" && changeDates ? /* @__PURE__ */ jsx("p", {
2456
+ className: "er-text er-funding-change-dates",
2457
+ children: /* @__PURE__ */ jsx("button", {
2458
+ type: "button",
2459
+ className: "er-portal-auth-link",
2460
+ onClick: changeDates.onChange,
2461
+ children: changeDates.label
2462
+ })
2463
+ }) : null
2464
+ ] });
2465
+ }
2466
+ /**
2467
+ * Which parts the step shows. The breakdown always shows for several dates, and
2468
+ * when nothing else describes the payment. One date with ways to pay shows it
2469
+ * only when it explains a reduction the option's row doesn't.
2470
+ */
2471
+ function fundingStepLayout(view, oneDate, hasCardSummary) {
2472
+ const options = showsPaymentOptions(view);
2473
+ const explains = view.summary !== null && summaryExplainsMoreThanTheOption(view.summary);
2474
+ const breakdown = (!oneDate || !options || explains) && (view.summary !== null || hasCardSummary);
2475
+ return {
2476
+ options,
2477
+ breakdown,
2478
+ changeDatesOn: options ? "options" : breakdown ? "breakdown" : "alone"
2479
+ };
2480
+ }
2481
+ function showsPaymentOptions(view) {
2482
+ return view.rows.length > 1 || view.option.kind === "money" && view.takesPayment;
2483
+ }
2484
+ function FundingLoadFailed(props) {
2485
+ return /* @__PURE__ */ jsxs("div", {
2486
+ className: "rb-reg-stack er-stack",
2487
+ role: "alert",
2488
+ children: [/* @__PURE__ */ jsx("p", {
2489
+ className: "er-text er-error",
2490
+ children: props.oneDate ? ONE_DATE_FUNDING_LOAD_FAILED : SELECTION_FUNDING_LOAD_FAILED
2491
+ }), /* @__PURE__ */ jsx("p", {
2492
+ className: "er-text",
2493
+ children: /* @__PURE__ */ jsx("button", {
2494
+ type: "button",
2495
+ className: "er-portal-auth-link",
2496
+ onClick: props.retry,
2497
+ children: "Try again"
2498
+ })
2499
+ })]
2500
+ });
2501
+ }
2502
+ function FundingLoading() {
2503
+ return /* @__PURE__ */ jsx("div", {
2504
+ className: "rb-reg-stack er-stack",
2505
+ children: /* @__PURE__ */ jsxs("div", {
2506
+ className: "er-center",
2507
+ children: [/* @__PURE__ */ jsx(SpinnerNode, {
2508
+ size: "lg",
2509
+ srLabel: "Checking payment options"
2510
+ }), /* @__PURE__ */ jsx("p", {
2511
+ className: "er-text--muted",
2512
+ children: "Checking payment options…"
2513
+ })]
2514
+ })
2515
+ });
2516
+ }
2517
+ /** A pass or membership's own summary, or the card step's for the money option. */
2518
+ function FundingSummary(props) {
2519
+ if (props.summary) return /* @__PURE__ */ jsx(FundedPaymentSummary, {
2520
+ summary: props.summary,
2521
+ changeDates: props.changeDates
2522
+ });
2523
+ return props.cardSummary ? /* @__PURE__ */ jsx(SelectionPaymentSummary, {
2524
+ summary: props.cardSummary,
2525
+ currency: props.currency,
2526
+ changeDates: props.changeDates
2527
+ }) : null;
2528
+ }
2529
+ //#endregion
2030
2530
  //#region ../blocks/src/system/runtime/nodes/event-registration/EventSelectionStep.tsx
2031
2531
  /** Dates in order, grouped by the month and year they fall in, both in the date's own zone. */
2032
2532
  function groupByMonth(events) {
@@ -2901,86 +3401,6 @@ const MembershipHero = ({ membershipName }) => {
2901
3401
  });
2902
3402
  };
2903
3403
  //#endregion
2904
- //#region ../blocks/src/system/runtime/nodes/event-registration/SiteCreditPreviewPanel.tsx
2905
- function SiteCreditPreviewPanel(props) {
2906
- const { preview } = props;
2907
- if (preview.kind === "not_authenticated" || preview.kind === "not_applicable" || preview.kind === "no_credit") return null;
2908
- if (preview.kind === "loading") return /* @__PURE__ */ jsx("div", {
2909
- className: "er-payment-summary",
2910
- "aria-live": "polite",
2911
- children: /* @__PURE__ */ jsx("p", {
2912
- className: "er-text er-text--muted",
2913
- children: "Checking your site credit…"
2914
- })
2915
- });
2916
- if (preview.kind === "unavailable") return /* @__PURE__ */ jsx("div", {
2917
- className: "er-payment-summary",
2918
- role: "status",
2919
- children: /* @__PURE__ */ jsx("p", {
2920
- className: "er-text er-text--muted",
2921
- children: "We couldn't check your site credit just now. We'll check again before payment."
2922
- })
2923
- });
2924
- if (preview.kind === "currency_mismatch") return /* @__PURE__ */ jsxs("div", {
2925
- className: "er-payment-summary",
2926
- role: "status",
2927
- children: [/* @__PURE__ */ jsx("h4", {
2928
- className: "er-title",
2929
- children: "Your site credit"
2930
- }), /* @__PURE__ */ jsxs("p", {
2931
- className: "er-text er-text--muted",
2932
- children: [
2933
- "You have",
2934
- " ",
2935
- formatPrice(preview.availableCreditCents, preview.creditCurrency),
2936
- " ",
2937
- "in site credit, but it can't be used for this",
2938
- " ",
2939
- props.currency.toUpperCase(),
2940
- " booking."
2941
- ]
2942
- })]
2943
- });
2944
- return /* @__PURE__ */ jsxs("div", {
2945
- className: "er-payment-summary",
2946
- "aria-live": "polite",
2947
- children: [
2948
- /* @__PURE__ */ jsx("h4", {
2949
- className: "er-title",
2950
- children: "Your site credit"
2951
- }),
2952
- /* @__PURE__ */ jsxs("p", {
2953
- className: "er-text",
2954
- children: ["Available: ", formatPrice(preview.availableCreditCents, props.currency)]
2955
- }),
2956
- /* @__PURE__ */ jsx("p", {
2957
- className: "er-text",
2958
- children: preview.outcome === "credit_only" ? `Your credit covers this registration. ${formatPrice(preview.appliedCreditCents, props.currency)} will be used and no card payment is needed.` : preview.cardDueNowCents === 0 ? `${formatPrice(preview.appliedCreditCents, props.currency)} will be applied automatically. No card payment is needed today.` : `${formatPrice(preview.appliedCreditCents, props.currency)} will be applied automatically. ${formatPrice(preview.cardDueNowCents, props.currency)} is due by card today.`
2959
- }),
2960
- preview.laterBalanceCents > 0 && /* @__PURE__ */ jsxs("p", {
2961
- className: "er-text er-text--muted",
2962
- children: [
2963
- "Remaining balance after today:",
2964
- " ",
2965
- formatPrice(preview.laterBalanceCents, props.currency)
2966
- ]
2967
- }),
2968
- preview.remainingCreditCents > 0 && /* @__PURE__ */ jsxs("p", {
2969
- className: "er-text er-text--muted",
2970
- children: [
2971
- "Credit left afterwards:",
2972
- " ",
2973
- formatPrice(preview.remainingCreditCents, props.currency)
2974
- ]
2975
- }),
2976
- preview.manualDiscountPending && /* @__PURE__ */ jsx("p", {
2977
- className: "er-text er-text--muted",
2978
- children: "We'll recalculate these amounts after your discount code is checked."
2979
- })
2980
- ]
2981
- });
2982
- }
2983
- //#endregion
2984
3404
  //#region ../blocks/src/system/runtime/nodes/event-registration/PaymentSelectionStep.tsx
2985
3405
  function isDirectPaymentOptionSelected(option, selectionState) {
2986
3406
  return selectionState.kind === "valid" && selectionState.selection.collectionOptionKind === option.kind;
@@ -3027,8 +3447,9 @@ const PaymentSelectionStep = (props) => {
3027
3447
  selectionState: view.directPaymentSelectionState,
3028
3448
  preview: view.preview,
3029
3449
  onSelectionChange: props.onSelectionChange
3030
- }) : [], ...entitlementRows({
3450
+ }) : [], ...runMembershipRows({
3031
3451
  offered: view.offersEntitlements,
3452
+ event: props.event,
3032
3453
  eligibility,
3033
3454
  isAuthenticated: props.isAuthenticated ?? false,
3034
3455
  ticketsCount: props.ticketsCount,
@@ -3036,6 +3457,7 @@ const PaymentSelectionStep = (props) => {
3036
3457
  onSelectionChange: props.onSelectionChange
3037
3458
  })]
3038
3459
  }),
3460
+ /* @__PURE__ */ jsx(UnavailableEntitlementNotes, { eligibility }),
3039
3461
  /* @__PURE__ */ jsx(SiteCreditPreviewPanel, {
3040
3462
  preview: view.preview,
3041
3463
  currency: eligibility.currency
@@ -3043,81 +3465,30 @@ const PaymentSelectionStep = (props) => {
3043
3465
  ]
3044
3466
  });
3045
3467
  };
3046
- function ownedPassChoices(eligibility) {
3047
- return eligibility.eligiblePasses.map((pass) => ({
3048
- id: `owned-pass-${pass.id}`,
3049
- selection: {
3050
- method: "pass",
3051
- passId: pass.id,
3052
- productName: pass.passName
3053
- },
3054
- label: pass.passName,
3055
- details: [`${formatCreditProductUnits("event_pass", pass.creditsRemaining)} left`],
3056
- price: formatCreditProductUnits("event_pass", 1)
3057
- }));
3058
- }
3059
- function ownedMembershipChoices(eligibility) {
3060
- return eligibility.eligibleMemberships.map((membership) => ({
3061
- id: `owned-membership-${membership.id}`,
3062
- selection: {
3468
+ /** A run's own membership; dates offer theirs through the server's funding options (issue 1767). */
3469
+ function runMembershipRows(props) {
3470
+ if (!props.offered || !props.isAuthenticated || props.ticketsCount !== 1 || props.event?.registrationSubject.kind !== "wholeSeries") return [];
3471
+ return props.eligibility.eligibleMemberships.map((membership) => {
3472
+ const selection = {
3063
3473
  method: "membership",
3064
3474
  membershipId: membership.id,
3065
3475
  productName: membership.membershipName
3066
- },
3067
- label: membership.membershipName,
3068
- details: ["Active"],
3069
- price: "Included"
3070
- }));
3071
- }
3072
- function purchasablePassChoices(eligibility) {
3073
- return eligibility.availablePasses.map((pass) => ({
3074
- id: `buy-pass-${pass.id}`,
3075
- selection: {
3076
- method: "pass_bundle",
3077
- bundlePassId: pass.id,
3078
- productName: pass.name,
3079
- productPrice: pass.price,
3080
- productCurrency: pass.currency
3081
- },
3082
- label: pass.name,
3083
- details: [formatCreditProductUnits("event_pass", pass.creditsTotal), ...pass.description ? [pass.description] : []],
3084
- price: formatPrice(pass.price, pass.currency)
3085
- }));
3086
- }
3087
- function purchasableMembershipChoices(eligibility) {
3088
- return eligibility.availableMemberships.map((membership) => ({
3089
- id: `buy-membership-${membership.id}`,
3090
- selection: {
3091
- method: "membership_bundle",
3092
- bundleMembershipId: membership.id,
3093
- productName: membership.name,
3094
- productPrice: membership.price,
3095
- productCurrency: membership.currency,
3096
- productInterval: membership.interval
3097
- },
3098
- label: membership.name,
3099
- details: membership.description ? [membership.description] : [],
3100
- price: `${formatPrice(membership.price, membership.currency)}/${membership.interval}`
3101
- }));
3476
+ };
3477
+ return {
3478
+ id: `owned-membership-${membership.id}`,
3479
+ label: membership.membershipName,
3480
+ details: ["Active"],
3481
+ price: "Included",
3482
+ selected: areEventRegistrationPaymentSelectionsEqual(props.selection, selection),
3483
+ onSelect: () => props.onSelectionChange(selection)
3484
+ };
3485
+ });
3102
3486
  }
3103
- /** Passes and memberships, when the selection can use them (one item, issue 1725). */
3104
- function entitlementRows(props) {
3105
- if (!props.offered) return [];
3106
- const disabled = areEntitlementsDisabledForTicketCount(props.ticketsCount);
3107
- return [
3108
- ...props.isAuthenticated ? [...ownedPassChoices(props.eligibility), ...ownedMembershipChoices(props.eligibility)] : [],
3109
- ...purchasablePassChoices(props.eligibility),
3110
- ...purchasableMembershipChoices(props.eligibility)
3111
- ].map((choice) => ({
3112
- id: choice.id,
3113
- label: choice.label,
3114
- details: choice.details,
3115
- price: choice.price,
3116
- disabled,
3117
- disabledReason: disabled ? ENTITLEMENT_SINGLE_TICKET_TOOLTIP : void 0,
3118
- selected: areEventRegistrationPaymentSelectionsEqual(props.selection, choice.selection),
3119
- onSelect: () => props.onSelectionChange(choice.selection)
3120
- }));
3487
+ function UnavailableEntitlementNotes({ eligibility }) {
3488
+ return /* @__PURE__ */ jsx(Fragment, { children: eligibility.unavailableEntitlements?.map((note) => /* @__PURE__ */ jsx("p", {
3489
+ className: "er-entitlement-note",
3490
+ children: note
3491
+ }, note)) });
3121
3492
  }
3122
3493
  //#endregion
3123
3494
  //#region ../blocks/src/system/runtime/nodes/event-registration/CalendarAction.tsx
@@ -3468,9 +3839,12 @@ function ExistingRegistrationNotice(props) {
3468
3839
  })
3469
3840
  });
3470
3841
  }
3471
- /** A membership covers one place on one item, so the hero shows only then. */
3842
+ /**
3843
+ * A membership covers one place on one run, so the hero shows only then. Dates
3844
+ * show a membership with their other ways to pay (issue 1767).
3845
+ */
3472
3846
  function heroMembership(wizard) {
3473
- return wizard.portalAuthState === "authenticated" && wizard.ticketsCount === 1 && wizard.severalItems === null ? wizard.eligibility?.eligibleMemberships[0] : void 0;
3847
+ return wizard.portalAuthState === "authenticated" && wizard.ticketsCount === 1 && wizard.severalItems === null && wizard.selectedEvent?.registrationSubject.kind === "wholeSeries" ? wizard.eligibility?.eligibleMemberships[0] : void 0;
3474
3848
  }
3475
3849
  /** The event's consent, with its checkbox worded for every item being booked. */
3476
3850
  function selectionConsent(wizard) {
@@ -3539,7 +3913,8 @@ function AttendeeDetailsContent(props) {
3539
3913
  }
3540
3914
  function EventDiscountCodeDisclosure(props) {
3541
3915
  const { wizard } = props;
3542
- const preview = wizard.combinationCodeField;
3916
+ const coverSelected = wizard.discountCardOnly;
3917
+ const preview = coverSelected ? null : wizard.combinationCodeField;
3543
3918
  if (preview?.failed) return /* @__PURE__ */ jsxs("div", {
3544
3919
  role: "alert",
3545
3920
  children: [/* @__PURE__ */ jsx("p", { children: "We couldn’t check your price. Try again." }), /* @__PURE__ */ jsx("button", {
@@ -3548,10 +3923,17 @@ function EventDiscountCodeDisclosure(props) {
3548
3923
  children: "Try again"
3549
3924
  })]
3550
3925
  });
3551
- if (wizard.discountsAvailableLoading || !wizard.shouldShowDiscountToggle) return null;
3926
+ if (!coverSelected && (wizard.discountsAvailableLoading || !wizard.shouldShowDiscountToggle)) return null;
3927
+ return /* @__PURE__ */ jsx(EventDiscountField, {
3928
+ wizard,
3929
+ coverSelected,
3930
+ preview
3931
+ });
3932
+ }
3933
+ function EventDiscountField({ wizard, coverSelected, preview }) {
3552
3934
  return /* @__PURE__ */ jsx(DiscountCodeDisclosure, {
3553
3935
  surface: "event-registration",
3554
- isOpen: wizard.discountUiOpen,
3936
+ isOpen: coverSelected || wizard.discountUiOpen,
3555
3937
  code: wizard.discountCode,
3556
3938
  onOpen: () => wizard.setDiscountUiOpen(true),
3557
3939
  onChange: wizard.setDiscountCode,
@@ -3561,6 +3943,8 @@ function EventDiscountCodeDisclosure(props) {
3561
3943
  },
3562
3944
  applied: preview?.feedback?.tone === "success",
3563
3945
  id: "er-discount-code",
3946
+ disabled: coverSelected,
3947
+ hint: coverSelected ? "Codes apply to card payments. Choose Pay by card to use one." : void 0,
3564
3948
  ...preview ? {
3565
3949
  onApply: () => void preview.apply(),
3566
3950
  isApplying: preview.applying,
@@ -3569,14 +3953,16 @@ function EventDiscountCodeDisclosure(props) {
3569
3953
  } : {}
3570
3954
  });
3571
3955
  }
3572
- function bookOnePlace(wizard) {
3573
- if (!wizard.ticketTypeSelectionRequired) wizard.setTicketsCount(1);
3574
- wizard.setStep("select-tickets");
3575
- }
3576
3956
  function PaymentSelectionContent(props) {
3577
3957
  const { wizard } = props;
3578
3958
  const subtotalCents = wizard.ticketSelectionSubtotalCents;
3579
3959
  if (!wizard.api.config.siteId) return null;
3960
+ const funding = selectionFundingShown(wizard);
3961
+ if (funding) return /* @__PURE__ */ jsx(SelectionFundingPayment, {
3962
+ wizard,
3963
+ model: funding,
3964
+ signInPrompt: props.signInPrompt
3965
+ });
3580
3966
  if (subtotalCents === null && wizard.combinationAwaitingVisitor) return /* @__PURE__ */ jsx(EventDiscountCodeDisclosure, { wizard });
3581
3967
  if (subtotalCents === null) return /* @__PURE__ */ jsx(PaymentBlockingPanel, {
3582
3968
  eligibility: wizard.eligibility,
@@ -3590,7 +3976,7 @@ function PaymentSelectionContent(props) {
3590
3976
  onRequestLogin: () => wizard.setShowMagicLinkModal(true)
3591
3977
  });
3592
3978
  return /* @__PURE__ */ jsxs(Fragment, { children: [
3593
- eventSiteTermsSurface(wizard.paymentSelection.method) === "commerce" ? /* @__PURE__ */ jsx(SiteTermsChangedNotice, { message: wizard.siteTerms.notice }) : null,
3979
+ wizard.paymentTermsSurface === "commerce" ? /* @__PURE__ */ jsx(SiteTermsChangedNotice, { message: wizard.siteTerms.notice }) : null,
3594
3980
  /* @__PURE__ */ jsx(SeveralItemsPaymentSummary, { wizard }),
3595
3981
  /* @__PURE__ */ jsx(PaymentSelectionStep, {
3596
3982
  event: wizard.selectedEvent,
@@ -3605,23 +3991,22 @@ function PaymentSelectionContent(props) {
3605
3991
  onRequestLogin: () => wizard.setShowMagicLinkModal(true),
3606
3992
  decision: wizard.paymentDecision
3607
3993
  }),
3608
- /* @__PURE__ */ jsx(PaymentEntitlementNote, { wizard }),
3994
+ /* @__PURE__ */ jsx(PaymentStepNote, { wizard }),
3609
3995
  /* @__PURE__ */ jsx(EventDiscountCodeDisclosure, { wizard }),
3610
3996
  /* @__PURE__ */ jsx(BundleSiteTerms, { wizard })
3611
3997
  ] });
3612
3998
  }
3613
- /** What the places booked entitle the visitor to, under the payment choice. */
3614
- function PaymentEntitlementNote({ wizard }) {
3615
- if (wizard.severalItems !== null) return /* @__PURE__ */ jsx("p", {
3999
+ /**
4000
+ * The note under the ways to pay, in both payment layouts. Several items: what
4001
+ * the places booked entitle the visitor to (a date's pass and membership notes
4002
+ * come with its ways to pay). One booking: why it's paid in full.
4003
+ */
4004
+ function PaymentStepNote({ wizard }) {
4005
+ const note = wizard.severalItems === null ? wizard.paymentInFullNote : selectionEntitlementNote(wizard.severalItems, wizard.paymentDecision.paysInFullBecauseSeveral);
4006
+ return note ? /* @__PURE__ */ jsx("p", {
3616
4007
  className: "er-entitlement-note",
3617
- children: selectionEntitlementNote(wizard.severalItems, wizard.paymentDecision.paysInFullBecauseSeveral)
3618
- });
3619
- if (wizard.paymentStepState.status !== "ready") return null;
3620
- return /* @__PURE__ */ jsx(SingleTicketEntitlementNote, {
3621
- ticketsCount: wizard.ticketsCount,
3622
- eligibility: wizard.eligibility,
3623
- onBookOnePlace: () => bookOnePlace(wizard)
3624
- });
4008
+ children: note
4009
+ }) : null;
3625
4010
  }
3626
4011
  function SeveralItemsPaymentSummary({ wizard }) {
3627
4012
  return wizard.selectionPaymentSummary && wizard.eligibility ? /* @__PURE__ */ jsx(SelectionPaymentSummary, {
@@ -3631,17 +4016,24 @@ function SeveralItemsPaymentSummary({ wizard }) {
3631
4016
  }
3632
4017
  function ClosedAdmissionNotice({ wizard }) {
3633
4018
  const admission = wizard.admission;
3634
- return admission.kind === "closed" && admission.reason !== "alreadyWaitlisted" && !wizard.eligibilityLoading ? /* @__PURE__ */ jsx("p", {
4019
+ if (admission.kind !== "closed" || admission.reason === "alreadyWaitlisted" || wizard.eligibilityLoading) return null;
4020
+ return registrationStopsHere(admission) ? /* @__PURE__ */ jsxs("div", {
4021
+ role: "status",
4022
+ className: "er-notice er-notice--info",
4023
+ children: [/* @__PURE__ */ jsx("p", { children: admission.message }), admission.contact ? /* @__PURE__ */ jsx(OrganiserContactLine, { contact: admission.contact }) : null]
4024
+ }) : /* @__PURE__ */ jsxs("div", {
3635
4025
  role: "alert",
3636
4026
  className: "er-error",
3637
- children: admission.message
3638
- }) : null;
4027
+ children: [/* @__PURE__ */ jsx("p", { children: admission.message }), admission.contact ? /* @__PURE__ */ jsx(OrganiserContactLine, { contact: admission.contact }) : null]
4028
+ });
3639
4029
  }
3640
4030
  function ticketStepInvitation(claim) {
3641
4031
  if (claim.kind === "none") return null;
3642
4032
  return claim.kind === "ready" ? {
3643
4033
  kind: "held",
3644
- expiresAt: claim.claim.expiresAt
4034
+ expiresAt: claim.claim.expiresAt,
4035
+ places: claim.restoration.claimed.places,
4036
+ ticketChoice: claim.restoration.claimed.kind === "anyTicket"
3645
4037
  } : { kind: "pending" };
3646
4038
  }
3647
4039
  /** With a date to pick, the choosing step has already said it. */
@@ -3664,39 +4056,64 @@ function TicketSelectionContent({ wizard, display }) {
3664
4056
  }),
3665
4057
  /* @__PURE__ */ jsx(ClosedAdmissionNotice, { wizard }),
3666
4058
  /* @__PURE__ */ jsx(TicketStepBookingCloseLine, { wizard }),
3667
- wizard.severalItems === "runs" ? /* @__PURE__ */ jsx(SeveralRunsTicketStep, {
4059
+ /* @__PURE__ */ jsx(TicketChooser, {
3668
4060
  wizard,
3669
4061
  display
3670
- }) : /* @__PURE__ */ jsx(TicketSelectionStep, {
3671
- purpose: wizard.ticketSelectionPurpose,
3672
- display,
3673
- invitation: ticketStepInvitation(wizard.waitlistClaim),
3674
- event: wizard.selectedEvent,
3675
- occurrenceContext: wizard.occurrenceContext,
3676
- selectedAttendanceMode: wizard.selectedAttendanceMode,
3677
- onAttendanceModeChange: wizard.setSelectedAttendanceMode,
3678
- ticketsCount: wizard.ticketsCount,
3679
- maxTickets: wizard.maxTicketsNum,
3680
- placesCeiling: placeCountCeiling({
3681
- maxAllowed: wizard.maxTicketsNum,
3682
- admission: wizard.admission,
3683
- settledRemaining: settledRemainingPlaces(wizard.eligibility)
3684
- }),
3685
- visibleTicketTypes: wizard.visibleTicketTypes,
3686
- overallRemainingPlaces: wizard.overallRemainingPlaces,
3687
- heldPlacesBySelection: wizard.heldPlacesBySelection,
3688
- ticketSelections: wizard.selectedTicketLines,
3689
- onTicketSelectionsChange: wizard.setSelectedTicketLines,
3690
- slidingScale: wizard.selectedEventSlidingScale,
3691
- selectedSlidingAmountInput: wizard.selectedSlidingAmountInput,
3692
- slidingScaleSelectionMessage: wizard.slidingScaleSelectionMessage,
3693
- onSlidingAmountChange: wizard.setSelectedSlidingAmountInput,
3694
- onTicketsChange: wizard.setTicketsCount,
3695
- bookingUnit: resolveBookingUnit(wizard.selectedEvent),
3696
- selectionNote: wizard.severalItems === "dates" ? selectionPlacesNote("dates", wizard.selection.length) : null
3697
4062
  })
3698
4063
  ] });
3699
4064
  }
4065
+ /**
4066
+ * Whether choosing differently could reopen a refusal: the site can't take
4067
+ * this selection's payment, but a free ticket, the free end of a sliding scale,
4068
+ * or another room or run might not need one.
4069
+ */
4070
+ function selectionCouldChangePrice(wizard) {
4071
+ return wizard.selectedEventSlidingScale != null || wizard.visibleTicketTypes.length > 1 || wizard.roomChooser != null || wizard.severalItems === "runs";
4072
+ }
4073
+ /**
4074
+ * How the client chooses their places. Where registration stops at the notice
4075
+ * above and no other choice could change that, there's nothing to choose.
4076
+ */
4077
+ function TicketChooser({ wizard, display }) {
4078
+ if (registrationStopsHere(wizard.admission) && !selectionCouldChangePrice(wizard)) return null;
4079
+ if (wizard.roomChooser) return /* @__PURE__ */ jsx(RoomChooser, {
4080
+ wizard,
4081
+ chooser: wizard.roomChooser,
4082
+ display
4083
+ });
4084
+ if (wizard.severalItems === "runs") return /* @__PURE__ */ jsx(SeveralRunsTicketStep, {
4085
+ wizard,
4086
+ display
4087
+ });
4088
+ return /* @__PURE__ */ jsx(TicketSelectionStep, {
4089
+ purpose: wizard.ticketSelectionPurpose,
4090
+ display,
4091
+ invitation: ticketStepInvitation(wizard.waitlistClaim),
4092
+ event: wizard.selectedEvent,
4093
+ occurrenceContext: wizard.occurrenceContext,
4094
+ selectedAttendanceMode: wizard.selectedAttendanceMode,
4095
+ onAttendanceModeChange: wizard.setSelectedAttendanceMode,
4096
+ ticketsCount: wizard.ticketsCount,
4097
+ maxTickets: wizard.maxTicketsNum,
4098
+ placesCeiling: placeCountCeiling({
4099
+ maxAllowed: wizard.maxTicketsNum,
4100
+ admission: wizard.admission,
4101
+ settledRemaining: settledRemainingPlaces(wizard.eligibility)
4102
+ }),
4103
+ visibleTicketTypes: wizard.visibleTicketTypes,
4104
+ overallRemainingPlaces: wizard.overallRemainingPlaces,
4105
+ heldPlacesBySelection: wizard.heldPlacesBySelection,
4106
+ ticketSelections: wizard.selectedTicketLines,
4107
+ onTicketSelectionsChange: wizard.setSelectedTicketLines,
4108
+ slidingScale: wizard.selectedEventSlidingScale,
4109
+ selectedSlidingAmountInput: wizard.selectedSlidingAmountInput,
4110
+ slidingScaleSelectionMessage: wizard.slidingScaleSelectionMessage,
4111
+ onSlidingAmountChange: wizard.setSelectedSlidingAmountInput,
4112
+ onTicketsChange: wizard.setTicketsCount,
4113
+ bookingUnit: resolveBookingUnit(wizard.selectedEvent),
4114
+ selectionNote: wizard.severalItems === "dates" ? selectionPlacesNote("dates", wizard.selection.length) : null
4115
+ });
4116
+ }
3700
4117
  function EventRegistrationWizardContent(props) {
3701
4118
  const { wizard } = props;
3702
4119
  switch (wizard.step) {
@@ -3731,12 +4148,15 @@ function EventRegistrationWizardContent(props) {
3731
4148
  display: props.display
3732
4149
  });
3733
4150
  case "enter-details": return /* @__PURE__ */ jsx(AttendeeDetailsContent, { wizard });
3734
- case "select-payment": return /* @__PURE__ */ jsx(PaymentSelectionContent, { wizard });
4151
+ case "select-payment": return /* @__PURE__ */ jsx(PaymentSelectionContent, {
4152
+ wizard,
4153
+ signInPrompt: props.paymentSignInPrompt
4154
+ });
3735
4155
  default: return null;
3736
4156
  }
3737
4157
  }
3738
4158
  function BundleSiteTerms({ wizard }) {
3739
- if (eventSiteTermsSurface(wizard.paymentSelection.method) !== "commerce") return null;
4159
+ if (wizard.paymentTermsSurface !== "commerce") return null;
3740
4160
  return /* @__PURE__ */ jsx(SiteTermsAgreementField, {
3741
4161
  agreement: wizard.siteTerms.commerceView,
3742
4162
  onChange: wizard.siteTerms.onChange,
@@ -3745,6 +4165,34 @@ function BundleSiteTerms({ wizard }) {
3745
4165
  requiredMark: "none"
3746
4166
  });
3747
4167
  }
4168
+ /**
4169
+ * Dates keep their ways to pay on screen while a pass's money dates are
4170
+ * priced (Pay waits for the price). A closed or failed booking shows its
4171
+ * own panel instead.
4172
+ */
4173
+ function selectionFundingShown(wizard) {
4174
+ const model = wizard.selectionFunding;
4175
+ if (!model) return null;
4176
+ const status = wizard.paymentDecision.stepState.status;
4177
+ return status === "error" || status === "not-eligible" ? null : model;
4178
+ }
4179
+ function SelectionFundingPayment(props) {
4180
+ const { wizard } = props;
4181
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
4182
+ wizard.paymentTermsSurface === "commerce" ? /* @__PURE__ */ jsx(SiteTermsChangedNotice, { message: wizard.siteTerms.notice }) : null,
4183
+ /* @__PURE__ */ jsx(SelectionFundingStep, {
4184
+ model: props.model,
4185
+ currency: wizard.eligibility?.currency ?? "",
4186
+ cardSummary: wizard.selectionPaymentSummary,
4187
+ creditPreview: wizard.paymentDecision.preview,
4188
+ signInPrompt: props.signInPrompt,
4189
+ afterOptions: /* @__PURE__ */ jsx(EventDiscountCodeDisclosure, { wizard }),
4190
+ onChangeDates: wizard.hasPreSelectedContext ? void 0 : wizard.handleChangeDates
4191
+ }),
4192
+ /* @__PURE__ */ jsx(PaymentStepNote, { wizard }),
4193
+ /* @__PURE__ */ jsx(BundleSiteTerms, { wizard })
4194
+ ] });
4195
+ }
3748
4196
  //#endregion
3749
4197
  //#region ../blocks/src/system/runtime/nodes/event-registration/PaymentStatusStep.tsx
3750
4198
  function presentation(state) {
@@ -3783,8 +4231,8 @@ function presentation(state) {
3783
4231
  action: { label: "Check payment status" }
3784
4232
  };
3785
4233
  case "assistanceRequired": return {
3786
- title: "We still can’t confirm your payment",
3787
- message: "Please don’t make another payment. Contact the organiser so they can check your booking.",
4234
+ title: "We couldn’t confirm your booking",
4235
+ message: "Please don’t pay again. Contact the organiser to check your booking.",
3788
4236
  action: {
3789
4237
  label: "Return to booking",
3790
4238
  disabled: true
@@ -3907,7 +4355,10 @@ function EventRegistrationMagicLinkModal(props) {
3907
4355
  function EventRegistrationWholeScreen(props) {
3908
4356
  const { wizard } = props;
3909
4357
  switch (props.presentation.screen) {
3910
- case "processing": return /* @__PURE__ */ jsx(RegistrationProcessing, { selection: wizard.paymentSelection });
4358
+ case "processing": return /* @__PURE__ */ jsx(RegistrationProcessing, {
4359
+ selection: wizard.paymentSelection,
4360
+ takesPayment: wizard.selectionFunding?.view?.takesPayment ?? null
4361
+ });
3911
4362
  case "verifying": return /* @__PURE__ */ jsx(VerifyingPaymentStep, {});
3912
4363
  case "verifyingTimeout": return /* @__PURE__ */ jsx(RegistrationVerificationTimeout, {
3913
4364
  wizard,
@@ -3936,7 +4387,7 @@ function EventRegistrationSuccess(props) {
3936
4387
  const { wizard } = props;
3937
4388
  const { result, finished } = props.presentation;
3938
4389
  const copy = finished.several ? {
3939
- message: "",
4390
+ message: finished.creditsLeftSentence ?? "",
3940
4391
  defaultEmailSentence: severalConfirmationSentence(finished.several, wizard.formData.email)
3941
4392
  } : getRegistrationSuccessCopy(result, props.fallbackMessage);
3942
4393
  return /* @__PURE__ */ jsx(SuccessStep, {
@@ -3964,13 +4415,22 @@ function EventRegistrationProgress(props) {
3964
4415
  function EventRegistrationStepFooter(props) {
3965
4416
  return /* @__PURE__ */ jsxs("div", {
3966
4417
  className: "er-payment-layout-footer",
3967
- children: [/* @__PURE__ */ jsx(EventRegistrationSummaryBar, { wizard: props.wizard }), /* @__PURE__ */ jsx(EventRegistrationWizardActions, {
4418
+ "data-room-chooser": props.wizard.roomChooser ? "" : void 0,
4419
+ children: [props.wizard.roomChooser ? /* @__PURE__ */ jsx(RoomChooserSummary, {
4420
+ wizard: props.wizard,
4421
+ view: props.wizard.roomChooser.view
4422
+ }) : /* @__PURE__ */ jsx(EventRegistrationSummaryBar, { wizard: props.wizard }), /* @__PURE__ */ jsx(EventRegistrationWizardActions, {
3968
4423
  wizard: props.wizard,
3969
4424
  buttonText: props.buttonText,
3970
4425
  buttonVariant: props.buttonVariant
3971
4426
  })]
3972
4427
  });
3973
4428
  }
4429
+ /** Offer the same sign-in help before asking an anonymous visitor to buy cover. */
4430
+ function paymentOffersSignIn(wizard) {
4431
+ if (wizard.step !== "select-payment" || wizard.portalAuthState === "authenticated" || wizard.portalAuthState === "checking") return false;
4432
+ return wizard.selectionFunding?.view?.rows.some((row) => row.pick.kind === "entitlement" && (row.pick.source.kind === "buyPass" || row.pick.source.kind === "buyMembership")) ?? false;
4433
+ }
3974
4434
  function EventRegistrationStepLayout(props) {
3975
4435
  const { wizard, progress } = props;
3976
4436
  const prompt = /* @__PURE__ */ jsx(EventPortalAuthPrompt, {
@@ -3979,6 +4439,7 @@ function EventRegistrationStepLayout(props) {
3979
4439
  });
3980
4440
  return /* @__PURE__ */ jsxs("div", {
3981
4441
  className: "er-payment-layout er-payment-layout--no-sidebar",
4442
+ "data-room-chooser": wizard.roomChooser ? "" : void 0,
3982
4443
  children: [/* @__PURE__ */ jsxs("div", {
3983
4444
  className: "er-payment-layout-main",
3984
4445
  children: [
@@ -3990,7 +4451,8 @@ function EventRegistrationStepLayout(props) {
3990
4451
  /* @__PURE__ */ jsx(EventRegistrationWizardContent, {
3991
4452
  wizard,
3992
4453
  display: props.display,
3993
- buttonVariant: props.buttonVariant
4454
+ buttonVariant: props.buttonVariant,
4455
+ paymentSignInPrompt: paymentOffersSignIn(wizard) ? prompt : null
3994
4456
  }),
3995
4457
  props.showPortalAuthPrompt && props.portalAuthCopy.placement === "after" ? prompt : null
3996
4458
  ]
@@ -4085,8 +4547,9 @@ function EventRegistrationSurface(props) {
4085
4547
  })]
4086
4548
  });
4087
4549
  }
4088
- function RegistrationProcessing({ selection }) {
4089
- const label = (selection.method === "stripe" ? selection.collectionOptionKind !== "deferred_manual" : selection.method === "pass_bundle" || selection.method === "membership_bundle") ? "Preparing your payment" : "Confirming your booking";
4550
+ /** `takesPayment`: dates say from their way to pay; null leaves it to the card choice. */
4551
+ function RegistrationProcessing({ selection, takesPayment }) {
4552
+ const label = takesPayment ?? (selection.method === "stripe" && selection.collectionOptionKind !== "deferred_manual") ? "Preparing your payment" : "Confirming your booking";
4090
4553
  return /* @__PURE__ */ jsxs("div", {
4091
4554
  className: "er-center",
4092
4555
  role: "status",